diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index eab59c888..6a645023c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -3852,6 +3852,7 @@ export default function App() { const eventId = turn.meta?.eventId; const sid = sessionId; if (!eventId || !sid || !currentRuntime) return; + if (cloudProvider === "byteplus") return; const output = turnText(turn); const previousFeedback = turn.meta?.feedback; const optimisticFeedback = { diff --git a/frontend/src/adk/client.ts b/frontend/src/adk/client.ts index 3c8d75512..11527704d 100644 --- a/frontend/src/adk/client.ts +++ b/frontend/src/adk/client.ts @@ -135,6 +135,8 @@ export interface AgentFeedbackCasesResponse { projectName: string; sets: AgentFeedbackSetSummary[]; items: AgentFeedbackCase[]; + unsupported?: boolean; + unsupportedMessage?: string; } export type AutomaticEvaluationState = "pending" | "running"; diff --git a/frontend/src/adk/cloudProvider.ts b/frontend/src/adk/cloudProvider.ts index 8aa45d84e..4dbd73f21 100644 --- a/frontend/src/adk/cloudProvider.ts +++ b/frontend/src/adk/cloudProvider.ts @@ -22,7 +22,7 @@ const VOLCENGINE_REGIONS: CloudRegionOption[] = [ ]; const BYTEPLUS_REGIONS: CloudRegionOption[] = [ - { value: BYTEPLUS_DEFAULT_REGION, label: "ap-southeast-1 (Singapore)" }, + { value: BYTEPLUS_DEFAULT_REGION, label: BYTEPLUS_DEFAULT_REGION }, ]; export function cloudRegionOptions(provider: CloudProvider): CloudRegionOption[] { diff --git a/frontend/src/create/skills/skillhub.ts b/frontend/src/create/skills/skillhub.ts index 041db2a10..7a760eef3 100644 --- a/frontend/src/create/skills/skillhub.ts +++ b/frontend/src/create/skills/skillhub.ts @@ -1,8 +1,9 @@ // Volcengine Skill Hub client (the backend behind findskill.com / -// skills.volces.com). Endpoints are proxied via vite `/skillhub` to dodge the -// missing CORS headers: -// GET /v1/skills?query=&namespace=public -> { Skills: [...] } -// GET /v1/skills/download/?namespace= -> application/zip +// skills.volces.com). Search uses the same normalized Studio harness endpoint +// as the in-chat skill picker. Downloads still use `/skillhub` because the +// selected zip is unpacked client-side into the generated project: +// GET /harness/skills/findskill?query= -> { items: [...] } +// GET /skillhub/v1/skills/download/?namespace= -> application/zip // // Skills are downloaded as a zip and unpacked client-side into project files. @@ -15,17 +16,16 @@ import { import type { SkillHit, SelectedSkill } from "./types"; import { unzip } from "./zip"; -const BASE = "/skillhub/v1/skills"; +const DOWNLOAD_BASE = "/skillhub/v1/skills"; +const SEARCH_BASE = "/harness/skills/findskill"; interface RawSkill { - Id?: string; - Slug?: string; - Name?: string; - Description?: string; - Namespace?: string; - SourceRepo?: string; - DownloadCount?: number; - Metadata?: { DisplayDescription?: string }; + slug?: string; + name?: string; + description?: string; + sourceRepo?: string; + downloadCount?: number; + version?: string; } /** Search the public Skill Hub. */ @@ -34,22 +34,28 @@ export async function searchSkills( namespace = "public", ): Promise { const q = query.trim(); - const url = `${BASE}?query=${encodeURIComponent(q)}&namespace=${encodeURIComponent(namespace)}`; + const params = new URLSearchParams({ + query: q, + page_number: "1", + page_size: "20", + }); + const url = `${SEARCH_BASE}?${params.toString()}`; const res = await fetch(url, { headers: { accept: "application/json" }, signal: requestSignal(undefined, DEFAULT_REQUEST_TIMEOUT_MS), }); if (!res.ok) throw new Error(`搜索失败 (${res.status})`); - const data = (await res.json()) as { Skills?: RawSkill[] }; - return (data.Skills ?? []).map((s) => ({ + const data = (await res.json()) as { items?: RawSkill[] }; + return (data.items ?? []).map((s) => ({ source: "skillhub" as const, - id: s.Id ?? s.Slug ?? "", - slug: s.Slug ?? "", - name: s.Name ?? s.Slug ?? "", - description: s.Metadata?.DisplayDescription || s.Description || "", - namespace: s.Namespace ?? namespace, - sourceRepo: s.SourceRepo, - downloadCount: s.DownloadCount, + id: s.slug ?? s.name ?? "", + slug: s.slug ?? "", + name: s.name ?? s.slug ?? "", + description: s.description ?? "", + namespace, + sourceRepo: s.sourceRepo, + downloadCount: s.downloadCount, + version: s.version, })); } @@ -60,7 +66,7 @@ export async function downloadSkillHubSkill( ): Promise { const slug = s.slug || ""; const namespace = s.namespace || "public"; - const url = `${BASE}/download/${slug}?namespace=${encodeURIComponent(namespace)}`; + const url = `${DOWNLOAD_BASE}/download/${slug}?namespace=${encodeURIComponent(namespace)}`; const res = await fetch(url, { signal: requestSignal(undefined, TRANSFER_REQUEST_TIMEOUT_MS), }); diff --git a/frontend/src/ui/AgentWorkspace.tsx b/frontend/src/ui/AgentWorkspace.tsx index bc4628697..617e232cd 100644 --- a/frontend/src/ui/AgentWorkspace.tsx +++ b/frontend/src/ui/AgentWorkspace.tsx @@ -985,6 +985,7 @@ export function AgentWorkspace({ const [feedbackSets, setFeedbackSets] = useState([]); const [feedbackCasesLoading, setFeedbackCasesLoading] = useState(false); const [feedbackCasesError, setFeedbackCasesError] = useState(""); + const [feedbackCasesUnsupported, setFeedbackCasesUnsupported] = useState(""); const [feedbackReloadToken, setFeedbackReloadToken] = useState(0); const [optimizationGroups, setOptimizationGroups] = useState([]); const [optimizationsLoading, setOptimizationsLoading] = useState(false); @@ -1623,6 +1624,7 @@ export function AgentWorkspace({ setFeedbackCases(cached ? feedbackCasesFromResponse(cached) : []); setFeedbackSets(cached?.sets ?? []); setFeedbackCasesError(""); + setFeedbackCasesUnsupported(cached?.unsupportedMessage ?? ""); if (section !== "evaluations" || !runtimeId) { setFeedbackCasesLoading(false); return; @@ -1642,10 +1644,12 @@ export function AgentWorkspace({ if (cancelled) return; setFeedbackSets(response.sets); setFeedbackCases(feedbackCasesFromResponse(response)); + setFeedbackCasesUnsupported(response.unsupportedMessage ?? ""); }) .catch((cause) => { if (!cancelled) { setFeedbackCasesError(cause instanceof Error ? cause.message : String(cause)); + setFeedbackCasesUnsupported(""); } }) .finally(() => { @@ -2927,6 +2931,7 @@ export function AgentWorkspace({ cases={visibleCases} loading={feedbackCasesLoading && visibleCases.length === 0} error={feedbackCasesError} + notice={feedbackCasesUnsupported} runtimeBacked={Boolean(selectedAgent?.runtimeId)} selectionMode={caseSelectionMode} selectedCaseIds={selectedCaseIds} @@ -3132,6 +3137,7 @@ function CaseTable({ cases, loading = false, error = "", + notice = "", runtimeBacked = false, selectionMode = false, selectedCaseIds, @@ -3148,6 +3154,7 @@ function CaseTable({ cases: AgentCase[]; loading?: boolean; error?: string; + notice?: string; runtimeBacked?: boolean; selectionMode?: boolean; selectedCaseIds?: Set; @@ -3177,6 +3184,8 @@ function CaseTable({ {error} {onRetry && } + ) : notice ? ( +
{notice}
) : cases.length === 0 ? (
{runtimeBacked ? "暂无用户反馈案例" : "没有匹配的案例"} diff --git a/frontend/src/ui/ProjectPreview.tsx b/frontend/src/ui/ProjectPreview.tsx index bfabbb6c5..d3ec36368 100644 --- a/frontend/src/ui/ProjectPreview.tsx +++ b/frontend/src/ui/ProjectPreview.tsx @@ -887,6 +887,9 @@ export function ProjectPreview({ inMemorySession ? "1" : "5", ); const [createEvaluationSets, setCreateEvaluationSets] = useState(true); + const supportsEvaluationSets = cloudProvider !== "byteplus"; + const effectiveCreateEvaluationSets = + supportsEvaluationSets && createEvaluationSets; const [deploymentActionTarget, setDeploymentActionTarget] = useState(null); const mountedRef = useRef(true); @@ -901,7 +904,7 @@ export function ProjectPreview({ const deploymentStepsWithInstanceUpdate = needsInstanceUpdate ? [...baseDeploymentSteps, INSTANCE_UPDATE_STEP] : baseDeploymentSteps; - const deploymentSteps = createEvaluationSets + const deploymentSteps = effectiveCreateEvaluationSets ? [...deploymentStepsWithInstanceUpdate, EVALUATION_SET_STEP] : deploymentStepsWithInstanceUpdate; @@ -1233,7 +1236,7 @@ export function ProjectPreview({ instanceRange: needsInstanceUpdate ? { min: instanceRange.min, max: instanceRange.max } : undefined, - createEvaluationSets, + createEvaluationSets: effectiveCreateEvaluationSets, }; onDeploymentTaskChange?.(initialTask); onDeploymentStarted?.(initialTask); @@ -1325,7 +1328,7 @@ export function ProjectPreview({ : { type: "api_key" as const }, } : {}), - createEvaluationSets, + createEvaluationSets: effectiveCreateEvaluationSets, ...(feishuEnabled ? { im: { @@ -2074,25 +2077,27 @@ export function ProjectPreview({
-
-
评测集
- -
+ {supportsEvaluationSets && ( +
+
评测集
+ +
+ )}
diff --git a/frontend/src/ui/StudioUpdateControl.css b/frontend/src/ui/StudioUpdateControl.css index aa0fff27a..e3b8fda1d 100644 --- a/frontend/src/ui/StudioUpdateControl.css +++ b/frontend/src/ui/StudioUpdateControl.css @@ -94,7 +94,9 @@ grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; width: min(500px, calc(100vw - 32px)); + max-width: calc(100vw - 32px); min-width: 0; + overflow: hidden; } .studio-update-dialog > .studio-update-dialog-mark { @@ -111,6 +113,8 @@ .studio-update-dialog > :not(.studio-update-dialog-mark, .confirm-title) { grid-column: 1 / -1; + width: 100%; + max-width: 100%; min-width: 0; } @@ -121,7 +125,10 @@ .studio-update-dialog .studio-update-progress small, .studio-update-dialog .studio-update-progress-note, .studio-update-dialog .studio-update-console-link { + max-width: 100%; + white-space: normal; overflow-wrap: anywhere; + word-break: break-word; } .studio-update-field { diff --git a/frontend/tests/deploymentConfigUi.test.mjs b/frontend/tests/deploymentConfigUi.test.mjs index 1356bf7db..146f7c96a 100644 --- a/frontend/tests/deploymentConfigUi.test.mjs +++ b/frontend/tests/deploymentConfigUi.test.mjs @@ -413,13 +413,21 @@ test("creates feedback evaluation sets by default and sends the deployment choic projectPreviewSource, /useState\(true\)[\s\S]*?自动创建评测集<\/strong>[\s\S]*?部署成功后,自动创建 Good Case 和 Bad Case 评测集。/, ); + assert.match( + projectPreviewSource, + /const supportsEvaluationSets = cloudProvider !== "byteplus"/, + ); + assert.match( + projectPreviewSource, + /const effectiveCreateEvaluationSets =[\s\S]*supportsEvaluationSets && createEvaluationSets/, + ); assert.match( projectPreviewSource, /type="checkbox"[\s\S]*?checked=\{createEvaluationSets\}[\s\S]*?setCreateEvaluationSets/, ); assert.match( projectPreviewSource, - /createEvaluationSets,\s*[\s\S]*?envs,/, + /createEvaluationSets: effectiveCreateEvaluationSets,\s*[\s\S]*?envs,/, ); assert.match( adkClientSource, @@ -431,10 +439,10 @@ test("creates feedback evaluation sets by default and sends the deployment choic ); assert.match( projectPreviewSource, - /createEvaluationSets[\s\S]*?\[\.\.\.deploymentStepsWithInstanceUpdate, EVALUATION_SET_STEP\][\s\S]*?: deploymentStepsWithInstanceUpdate/, + /effectiveCreateEvaluationSets[\s\S]*?\[\.\.\.deploymentStepsWithInstanceUpdate, EVALUATION_SET_STEP\][\s\S]*?: deploymentStepsWithInstanceUpdate/, ); assert.match( projectPreviewSource, - /const initialTask: DeploymentTaskUpdate =[\s\S]*?createEvaluationSets,\s*\n\s*};/, + /const initialTask: DeploymentTaskUpdate =[\s\S]*?createEvaluationSets: effectiveCreateEvaluationSets,\s*\n\s*};/, ); }); diff --git a/frontend/tests/markdownPromptEditor.test.mjs b/frontend/tests/markdownPromptEditor.test.mjs index a6b5f8cd9..e2facabca 100644 --- a/frontend/tests/markdownPromptEditor.test.mjs +++ b/frontend/tests/markdownPromptEditor.test.mjs @@ -26,6 +26,10 @@ const skillHubPickerSource = readFileSync( new URL("../src/create/SkillHubPicker.tsx", import.meta.url), "utf8", ); +const skillHubSource = readFileSync( + new URL("../src/create/skills/skillhub.ts", import.meta.url), + "utf8", +); const skillSpacePickerSource = readFileSync( new URL("../src/create/SkillSpacePicker.tsx", import.meta.url), "utf8", @@ -669,6 +673,8 @@ test("skill sources open in a fixed-height dialog above a six-row selected list" assert.match(createSource, /label: "AgentKit Skills 中心"/); assert.doesNotMatch(createSource, /label: "SkillSpace"/); assert.match(createSource, /label: "火山 Find Skill 技能广场"/); + assert.match(skillHubSource, /const SEARCH_BASE = "\/harness\/skills\/findskill"/); + assert.match(skillHubSource, /const DOWNLOAD_BASE = "\/skillhub\/v1\/skills"/); assert.match(createSource, /function AgentKitSkillsIcon/); assert.match( createSource, diff --git a/frontend/tests/messageFeedback.test.mjs b/frontend/tests/messageFeedback.test.mjs index 7f4eba93f..d582c3b2d 100644 --- a/frontend/tests/messageFeedback.test.mjs +++ b/frontend/tests/messageFeedback.test.mjs @@ -79,6 +79,23 @@ test("feedback selection updates immediately and uses a neutral solid icon", () assert.doesNotMatch(stylesSource, /\.feedback-btn--bad[\s\S]{0,120}destructive/); }); +test("BytePlus feedback buttons are visible but do not submit evaluation feedback", () => { + const handler = appSource.slice( + appSource.indexOf("const rateAssistantTurn"), + appSource.indexOf("const send = async"), + ); + assert.ok( + handler.indexOf('if (cloudProvider === "byteplus") return;') < + handler.indexOf('syncStatus: "syncing"'), + ); + assert.ok( + handler.indexOf('if (cloudProvider === "byteplus") return;') < + handler.indexOf("await submitMessageFeedback"), + ); + assert.match(appSource, /aria-label="赞"/); + assert.match(appSource, /aria-label="踩"/); +}); + test("chat feedback row has no evaluation case shortcut", () => { assert.doesNotMatch(appSource, /const openCurrentAgentCases/); assert.match(appSource, /feedbackCasePreview=\{feedbackCasePreview\}/); diff --git a/tests/cli/test_frontend_evaluation_feedback.py b/tests/cli/test_frontend_evaluation_feedback.py index 9bc38ff1a..48590b7e5 100644 --- a/tests/cli/test_frontend_evaluation_feedback.py +++ b/tests/cli/test_frontend_evaluation_feedback.py @@ -31,6 +31,7 @@ def _create_frontend_app( tmp_path: Path, *, studio: bool = False, + provider: str = "volcengine", ) -> FastAPI: captured: dict[str, Any] = {} monkeypatch.setattr("dotenv.find_dotenv", lambda *args, **kwargs: "") @@ -40,6 +41,8 @@ def _create_frontend_app( ) monkeypatch.setenv("VOLCENGINE_ACCESS_KEY", "ak") monkeypatch.setenv("VOLCENGINE_SECRET_KEY", "sk") + monkeypatch.setenv("BYTEPLUS_ACCESS_KEY", "bp-ak") + monkeypatch.setenv("BYTEPLUS_SECRET_KEY", "bp-sk") _run_frontend_server( agents_dir=str(tmp_path), frontend_dir=None, @@ -59,6 +62,7 @@ def _create_frontend_app( auth_mode="frontend", generated_agent_test_run_ttl=60, open_browser=False, + provider=provider, # type: ignore[arg-type] studio=studio, ) return captured["app"] @@ -75,6 +79,47 @@ def json(self) -> dict[str, Any]: return self._payload +def test_studio_findskill_route_uses_session_skillhub_search( + monkeypatch: pytest.MonkeyPatch, tmp_path: Path +) -> None: + app = _create_frontend_app( + monkeypatch, + tmp_path, + studio=True, + provider="byteplus", + ) + + async def search_findskill(**kwargs: Any) -> dict[str, object]: + assert kwargs == {"query": "pdf", "page_number": 1, "page_size": 20} + return { + "items": [ + { + "slug": "clawhub/pdf-reader", + "name": "pdf-reader", + "description": "Read PDF files", + "sourceType": "clawhub", + "sourceRepo": "clawhub/pdf-reader", + "downloadCount": 42, + "evaluationScore": 0, + "version": "1.0.0", + "updatedAt": "2026-07-26T00:00:00+08:00", + } + ], + "totalCount": 1, + } + + monkeypatch.setattr( + "veadk.integrations.agentkit.session_capabilities._search_findskill", + search_findskill, + ) + + with TestClient(app) as client: + response = client.get("/harness/skills/findskill?query=pdf") + + assert response.status_code == 200 + assert response.json()["items"][0]["slug"] == "clawhub/pdf-reader" + + def test_message_feedback_writes_dataset_and_session_state( monkeypatch: pytest.MonkeyPatch, tmp_path: Path ) -> None: @@ -220,6 +265,76 @@ async def post(self, url: str, **kwargs: Any) -> _FakeResponse: assert state["evaluationItemId"] == "item-1" +def test_message_feedback_byteplus_is_noop( + monkeypatch: pytest.MonkeyPatch, tmp_path: Path +) -> None: + app = _create_frontend_app( + monkeypatch, + tmp_path, + studio=True, + provider="byteplus", + ) + + class _FakeRuntimeClient: + def __init__(self, **kwargs: Any) -> None: + del kwargs + + def get_runtime(self, request: Any) -> SimpleNamespace: + del request + return SimpleNamespace( + project_name="support", + tags=[], + network_configurations=[ + SimpleNamespace( + endpoint="https://runtime.example", + network_type="public", + ) + ], + authorizer_configuration=SimpleNamespace( + key_auth=SimpleNamespace(api_key="runtime-key"), + custom_jwt_authorizer=None, + ), + ) + + class _UnexpectedAsyncClient: + def __init__(self, **kwargs: Any) -> None: + del kwargs + raise AssertionError("BytePlus feedback should not call remote APIs") + + monkeypatch.setattr( + "agentkit.sdk.runtime.client.AgentkitRuntimeClient", + _FakeRuntimeClient, + ) + monkeypatch.setattr("httpx.AsyncClient", _UnexpectedAsyncClient) + + with TestClient(app) as client: + response = client.post( + "/web/evaluation/feedback", + headers={"X-VeADK-Local-User": "user-1"}, + json={ + "runtimeId": "runtime-1", + "region": "ap-southeast-1", + "appName": "agent", + "userId": "user-1", + "sessionId": "session-1", + "eventId": "assistant-event", + "rating": "good", + }, + ) + + assert response.status_code == 200 + assert response.json() == { + "rating": None, + "evaluationSetId": None, + "evaluationSetName": None, + "workspaceId": None, + "evaluationItemId": None, + "syncStatus": "synced", + "statePersistence": "browser", + "updatedAt": response.json()["updatedAt"], + } + + def test_message_feedback_uncheck_deletes_case_by_stable_item_key( monkeypatch: pytest.MonkeyPatch, tmp_path: Path ) -> None: @@ -626,6 +741,91 @@ async def post(self, url: str, **kwargs: Any) -> _FakeResponse: assert listed_set_ids == {"good-set", "bad-set", "auto-good-set"} +def test_feedback_cases_byteplus_404_reports_unsupported( + monkeypatch: pytest.MonkeyPatch, tmp_path: Path +) -> None: + app = _create_frontend_app( + monkeypatch, + tmp_path, + studio=True, + provider="byteplus", + ) + + class _FakeRuntimeClient: + def __init__(self, **kwargs: Any) -> None: + del kwargs + + def get_runtime(self, request: Any) -> SimpleNamespace: + del request + return SimpleNamespace( + project_name="support", + tags=[], + network_configurations=[ + SimpleNamespace( + endpoint="https://runtime.example", + network_type="public", + ) + ], + authorizer_configuration=SimpleNamespace( + key_auth=SimpleNamespace(api_key="runtime-key"), + custom_jwt_authorizer=None, + ), + ) + + class _FakeAsyncClient: + def __init__(self, **kwargs: Any) -> None: + del kwargs + + async def __aenter__(self) -> "_FakeAsyncClient": + return self + + async def __aexit__(self, *args: Any) -> None: + del args + + async def request(self, method: str, url: str, **kwargs: Any) -> _FakeResponse: + del kwargs + if method == "GET" and "/web/agent-info/agent" in url: + return _FakeResponse({"name": "agent"}) + raise AssertionError((method, url)) + + async def post(self, url: str, **kwargs: Any) -> _FakeResponse: + del url, kwargs + return _FakeResponse( + { + "ResponseMetadata": { + "RequestId": ( + "02178602503621000000000000000000000ffffac101ef9ae9c3d" + ) + } + }, + status_code=404, + ) + + monkeypatch.setattr( + "agentkit.sdk.runtime.client.AgentkitRuntimeClient", + _FakeRuntimeClient, + ) + monkeypatch.setattr("httpx.AsyncClient", _FakeAsyncClient) + + with TestClient(app) as client: + response = client.get( + "/web/evaluation/feedback-cases", + headers={"X-VeADK-Local-User": "user-1"}, + params={ + "runtimeId": "runtime-1", + "region": "ap-southeast-1", + "appName": "agent", + }, + ) + + assert response.status_code == 200 + payload = response.json() + assert payload["unsupported"] is True + assert payload["unsupportedMessage"] == "BytePlus 暂不支持 AgentKit 评测集。" + assert payload["sets"] == [] + assert payload["items"] == [] + + def test_feedback_cases_delete_removes_dataset_items_and_clears_rating( monkeypatch: pytest.MonkeyPatch, tmp_path: Path ) -> None: diff --git a/tests/cli/test_studio_rbac.py b/tests/cli/test_studio_rbac.py index 6e3c76f00..9f2294cb1 100644 --- a/tests/cli/test_studio_rbac.py +++ b/tests/cli/test_studio_rbac.py @@ -389,7 +389,14 @@ def launch(*, config_file: str, **_kwargs: Any) -> SimpleNamespace: ), ) + async def initialize_evaluation_sets(**_kwargs: Any) -> list[str]: + raise AssertionError("BytePlus deploy should not create evaluation sets") + monkeypatch.setattr("agentkit.toolkit.sdk.launch", launch) + monkeypatch.setattr( + "frontend.server.evaluation_automation.datasets.ensure_feedback_sets", + initialize_evaluation_sets, + ) app = _create_studio_app( monkeypatch, tmp_path, @@ -404,7 +411,6 @@ def launch(*, config_file: str, **_kwargs: Any) -> SimpleNamespace: headers={"X-VeADK-Local-User": "developer"}, json={ "name": "byteplus-agent", - "createEvaluationSets": False, "files": [{"path": "app.py", "content": "app = object()\n"}], "config": {"region": "ap-southeast-1", "projectName": "default"}, }, @@ -417,6 +423,7 @@ def launch(*, config_file: str, **_kwargs: Any) -> SimpleNamespace: assert response.status_code == 200 assert frames[-1]["success"] is True + assert not [frame for frame in frames if frame.get("phase") == "evaluation"] assert captured_env == { "BYTEPLUS_ACCESS_KEY": "iam-ak", "BYTEPLUS_SECRET_KEY": "iam-sk", diff --git a/tests/cli/test_studio_update.py b/tests/cli/test_studio_update.py index c3deab44c..04be06bfb 100644 --- a/tests/cli/test_studio_update.py +++ b/tests/cli/test_studio_update.py @@ -669,6 +669,103 @@ def update_application_code_bundle(self, **kwargs: object) -> str: } +def test_byteplus_studio_update_repairs_missing_sandbox_tools( + monkeypatch: pytest.MonkeyPatch, + tmp_path: Path, +) -> None: + target = _target(region="ap-southeast-1") + captured: dict[str, object] = {} + code_tools: list[dict[str, object]] = [] + agent_tools: list[dict[str, object]] = [] + code_credentials: list[dict[str, object]] = [] + agent_credentials: list[dict[str, object]] = [] + monkeypatch.setattr( + "veadk.cli.studio_update.find_studio_deployments", lambda **_: [target] + ) + monkeypatch.setattr( + "veadk.cli.studio_update.load_deployed_site_logo", lambda _: None + ) + monkeypatch.setattr( + "veadk.cli.studio_package.build_frontend_assets", lambda *_: None + ) + monkeypatch.setattr( + "veadk.cli.studio_package.build_local_studio_requirements", + lambda *_a, **_k: "./veadk.whl\n", + ) + monkeypatch.setattr( + "veadk.cli.studio_package.write_studio_package", lambda *_a, **_k: None + ) + monkeypatch.setattr( + "veadk.cli.studio_sandbox_tools.ensure_studio_code_env_tool", + lambda **kwargs: code_tools.append(kwargs) or f"{kwargs['name']}-tool", + ) + monkeypatch.setattr( + "veadk.cli.studio_sandbox_tools.ensure_studio_agent_tool", + lambda **kwargs: agent_tools.append(kwargs) or f"{kwargs['kind']}-tool", + ) + monkeypatch.setattr( + "veadk.cli.frontend_skill_creator.ensure_skill_creator_model_credential", + lambda **kwargs: code_credentials.append(kwargs), + ) + monkeypatch.setattr( + "veadk.cli.studio_sandbox_tools.ensure_studio_agent_model_credential", + lambda **kwargs: agent_credentials.append(kwargs), + ) + + class _FakeVeFaaS: + def __init__(self, **_: str) -> None: + self.client = SimpleNamespace( + get_function=lambda _request: SimpleNamespace( + envs=[ + SimpleNamespace( + key="SANDBOX_CHAT_CODEX", + value="existing-codex-tool", + ) + ] + ) + ) + + def update_application_code_bundle(self, **kwargs: object) -> str: + captured.update(kwargs) + return target.url + + monkeypatch.setattr("veadk.integrations.ve_faas.ve_faas.VeFaaS", _FakeVeFaaS) + + result = CliRunner().invoke( + studio, + [ + "update", + "--provider", + "byteplus", + "--vefaas-app-name", + "studio-app", + "--path", + str(tmp_path), + "--byteplus-access-key", + "ak", + "--byteplus-secret-key", + "sk", + ], + ) + + assert result.exit_code == 0, result.output + assert len(code_tools) == 1 + assert "skill" in str(code_tools[0]["name"]) + assert {str(call["kind"]) for call in agent_tools} == {"openclaw", "hermes"} + assert {str(call["provider"]) for call in code_credentials} == {"byteplus"} + assert {str(call["provider"]) for call in agent_credentials} == {"byteplus"} + assert {str(call["model_base_url"]) for call in agent_credentials} == { + "https://ark.ap-southeast.bytepluses.com/api/v3" + } + overrides = captured["environment_overrides"] + assert isinstance(overrides, dict) + assert overrides["SANDBOX_CHAT_CODEX"] == "existing-codex-tool" + assert str(overrides["SANDBOX_SKILL_CREATOR"]).endswith("-tool") + assert overrides["SANDBOX_CHAT_OPENCLAW"] == "openclaw-tool" + assert overrides["SANDBOX_CHAT_HERMES"] == "hermes-tool" + assert overrides["CLOUD_PROVIDER"] == "byteplus" + + def test_update_application_code_bundle_merges_only_explicit_environment( monkeypatch: pytest.MonkeyPatch, tmp_path: Path, diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index 3358340ec..4df1083eb 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -1850,11 +1850,6 @@ async def _web_search( ) async def _skillhub_proxy(request: Request, path: str): """Proxy requests to Volcengine Skill Hub API to avoid CORS issues.""" - if provider == "byteplus": - raise HTTPException( - status_code=404, - detail="Volcengine Skill Hub proxy is disabled in BytePlus mode.", - ) target_url = f"{SKILLHUB_TARGET}/{path}" if request.url.query: target_url += f"?{request.url.query}" @@ -1880,6 +1875,29 @@ async def _skillhub_proxy(request: Request, path: str): logger.error(f"Skillhub proxy error: {e}") raise HTTPException(status_code=502, detail=f"Proxy error: {str(e)}") + @app.get("/harness/skills/findskill") + async def _studio_search_findskill( + query: str = "", + page_number: int = Query(default=1, ge=1), + page_size: int = Query(default=20, ge=1, le=50), + ) -> dict[str, Any]: + """Expose the same public Skill Hub search contract used by chat skills.""" + try: + from veadk.integrations.agentkit.session_capabilities import ( + _search_findskill, + ) + + return await _search_findskill( + query=query, + page_number=page_number, + page_size=page_size, + ) + except Exception as exc: + raise HTTPException( + status_code=502, + detail="暂时无法搜索 Skill Hub,请稍后重试。", + ) from exc + # ---- AgentKit proxy: proxy /agentkit-proxy/* to remote AgentKit ---- @app.api_route( "/agentkit-proxy/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH"] @@ -3139,6 +3157,8 @@ async def _deploy_to_agentkit(request: Request): status_code=400, detail="createEvaluationSets must be a boolean", ) + if provider == "byteplus": + create_evaluation_sets = False min_instance = data.get("minInstance", 1) max_instance = data.get("maxInstance", 5) @@ -5748,6 +5768,17 @@ async def _web_message_feedback( feedback.region, coded_access_error=True, ) + if provider == "byteplus": + return { + "rating": None, + "evaluationSetId": None, + "evaluationSetName": None, + "workspaceId": None, + "evaluationItemId": None, + "syncStatus": "synced", + "statePersistence": "browser", + "updatedAt": time.time(), + } session_path = ( f"apps/{quote(feedback.app_name, safe='')}/users/" f"{quote(feedback.user_id, safe='')}/sessions/" @@ -6072,6 +6103,19 @@ async def _evaluation_post( except ValueError as error: raise HTTPException(status_code=400, detail=str(error)) from error except RuntimeError as error: + if provider == "byteplus" and "AgentKit OpenAPI returned HTTP 404" in str( + error + ): + return { + "agentName": appName, + "runtimeId": runtimeId, + "region": region, + "projectName": getattr(runtime, "project_name", "") or "default", + "sets": [], + "items": [], + "unsupported": True, + "unsupportedMessage": "BytePlus 暂不支持 AgentKit 评测集。", + } raise HTTPException( status_code=502, detail="读取 AgentKit 评测集失败:" + _safe_exception_detail(error), @@ -8031,6 +8075,191 @@ def frontend_update( environment_overrides["AGENTKIT_CLOUD_PROVIDER"] = provider_id environment_overrides["BYTEPLUS_REGION"] = target.region environment_overrides["DATABASE_VIKING_REGION"] = DEFAULT_BYTEPLUS_REGION + service_client = getattr(service, "client", None) + has_explicit_sandbox_tool = any( + tool_id is not None + for tool_id in ( + sandbox_chat_codex_tool_id, + sandbox_skill_creator_tool_id, + sandbox_chat_openclaw_tool_id, + sandbox_chat_hermes_tool_id, + ) + ) + if service_client is None and not has_explicit_sandbox_tool: + current_env: dict[str, str] = {} + repair_sandbox_tools = False + else: + import volcenginesdkvefaas + + function = service_client.get_function( + volcenginesdkvefaas.GetFunctionRequest(id=target.function_id) + ) + current_env = { + item.key: item.value + for item in (getattr(function, "envs", None) or []) + } + repair_sandbox_tools = True + byteplus_sandbox_tool_ids = { + "codex": sandbox_chat_codex_tool_id + if sandbox_chat_codex_tool_id is not None + else current_env.get("SANDBOX_CHAT_CODEX", ""), + "skill_creator": sandbox_skill_creator_tool_id + if sandbox_skill_creator_tool_id is not None + else current_env.get("SANDBOX_SKILL_CREATOR", ""), + "openclaw": sandbox_chat_openclaw_tool_id + if sandbox_chat_openclaw_tool_id is not None + else current_env.get("SANDBOX_CHAT_OPENCLAW", ""), + "hermes": sandbox_chat_hermes_tool_id + if sandbox_chat_hermes_tool_id is not None + else current_env.get("SANDBOX_CHAT_HERMES", ""), + } + byteplus_sandbox_labels = { + "codex": "Codex", + "skill_creator": "Skill Creator", + "openclaw": "OpenClaw", + "hermes": "Hermes", + } + byteplus_sandbox_purposes = { + "codex": "chat", + "skill_creator": "skill", + "openclaw": "openclaw", + "hermes": "hermes", + } + if repair_sandbox_tools: + from veadk.cli.frontend_skill_creator import ( + ensure_skill_creator_model_credential, + ) + from veadk.cli.studio_sandbox_tools import ( + ensure_studio_agent_model_credential, + ensure_studio_agent_tool, + ensure_studio_code_env_tool, + studio_sandbox_agent_model_name, + studio_sandbox_model_base_url, + studio_sandbox_tool_name, + ) + + sandbox_agent_model_name = studio_sandbox_agent_model_name(provider_id) + sandbox_model_base_url = studio_sandbox_model_base_url(provider_id) + missing_sandbox_tools: dict[str, str] = {} + for kind, tool_id in byteplus_sandbox_tool_ids.items(): + label = byteplus_sandbox_labels[kind] + if str(tool_id or "").strip(): + click.echo(f"Using AgentKit {label} Tool '{tool_id}'.") + continue + tool_name = studio_sandbox_tool_name( + vefaas_app_name, + byteplus_sandbox_purposes[kind], + ) + click.echo(f"Creating AgentKit {label} Tool '{tool_name}'…") + missing_sandbox_tools[kind] = tool_name + + if missing_sandbox_tools: + with ThreadPoolExecutor( + max_workers=len(missing_sandbox_tools) + ) as ex: + tool_futures = {} + for kind, tool_name in missing_sandbox_tools.items(): + if kind in {"codex", "skill_creator"}: + future = ex.submit( + ensure_studio_code_env_tool, + name=tool_name, + region=target.region, + access_key=ak, + secret_key=sk, + session_token=session_token or "", + ) + else: + future = ex.submit( + ensure_studio_agent_tool, + name=tool_name, + kind=kind, + model_name=sandbox_agent_model_name, + region=target.region, + access_key=ak, + secret_key=sk, + session_token=session_token or "", + ) + tool_futures[kind] = future + for kind, future in tool_futures.items(): + label = byteplus_sandbox_labels[kind] + try: + byteplus_sandbox_tool_ids[kind] = future.result() + except Exception as error: + detail = _safe_exception_detail( + error, + secrets=(ak, sk, session_token), + ) + raise click.ClickException( + f"Failed to provision the AgentKit {label} Tool. " + f"Underlying error:\n{detail}" + ) from error + click.echo(f"AgentKit {label} Tool is ready.") + + credential_futures = {} + with ThreadPoolExecutor( + max_workers=len(byteplus_sandbox_tool_ids) + ) as ex: + for kind, tool_id in byteplus_sandbox_tool_ids.items(): + tool_id = str(tool_id or "").strip() + if not tool_id: + continue + label = byteplus_sandbox_labels[kind] + click.echo(f"Creating AgentKit {label} model credential…") + if kind in {"codex", "skill_creator"}: + code_model_name = ( + sandbox_agent_model_name if kind == "codex" else None + ) + future = ex.submit( + ensure_skill_creator_model_credential, + tool_id=tool_id, + region=target.region, + access_key=ak, + secret_key=sk, + session_token=session_token, + provider=provider_id, + model_name=code_model_name, + ) + else: + future = ex.submit( + ensure_studio_agent_model_credential, + tool_id=tool_id, + kind=kind, + model_name=sandbox_agent_model_name, + model_base_url=sandbox_model_base_url, + region=target.region, + access_key=ak, + secret_key=sk, + session_token=session_token, + provider=provider_id, + ) + credential_futures[kind] = future + for kind, future in credential_futures.items(): + label = byteplus_sandbox_labels[kind] + try: + future.result() + except Exception as error: + detail = _safe_exception_detail( + error, + secrets=(ak, sk, session_token), + ) + raise click.ClickException( + f"Failed to provision the AgentKit {label} model " + f"credential. Underlying error:\n{detail}" + ) from error + click.echo(f"AgentKit {label} model credential is ready.") + + environment_overrides["SANDBOX_CHAT_CODEX"] = str( + byteplus_sandbox_tool_ids["codex"] or "" + ) + environment_overrides["SANDBOX_SKILL_CREATOR"] = str( + byteplus_sandbox_tool_ids["skill_creator"] or "" + ) + environment_overrides["SANDBOX_CHAT_OPENCLAW"] = str( + byteplus_sandbox_tool_ids["openclaw"] or "" + ) + environment_overrides["SANDBOX_CHAT_HERMES"] = str( + byteplus_sandbox_tool_ids["hermes"] or "" + ) if branding_title is not None: environment_overrides["VEADK_SITE_TITLE"] = branding_title if sandbox_dev_tool_id is not None: diff --git a/veadk/webui/assets/CodeEditor-DsbJWtS8.js b/veadk/webui/assets/CodeEditor-1lm8yIe5.js similarity index 99% rename from veadk/webui/assets/CodeEditor-DsbJWtS8.js rename to veadk/webui/assets/CodeEditor-1lm8yIe5.js index f6a88054c..6b30d377b 100644 --- a/veadk/webui/assets/CodeEditor-DsbJWtS8.js +++ b/veadk/webui/assets/CodeEditor-1lm8yIe5.js @@ -1,4 +1,4 @@ -import{L as xe,D as sf}from"./index-CB_XKkbG.js";const of=1024;let Zm=0,Le=class{constructor(e,t){this.from=e,this.to=t}};class M{constructor(e={}){this.id=Zm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}M.closedBy=new M({deserialize:i=>i.split(" ")});M.openedBy=new M({deserialize:i=>i.split(" ")});M.group=new M({deserialize:i=>i.split(" ")});M.isolate=new M({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});M.contextHash=new M({perNode:!0});M.lookAhead=new M({perNode:!0});M.mounted=new M({perNode:!0});class Ri{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[M.mounted.id]}}const Am=Object.create(null);class Oe{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Am,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(M.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(M.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}Oe.none=new Oe("",Object.create(null),0,8);class Kn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|I.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:na(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new U(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new U(Oe.none,t,n,r)))}static build(e){return zm(e)}}U.empty=new U(Oe.none,[],[],0);class ta{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ta(this.buffer,this.index)}}class It{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function vn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=h;e+=t){let c=l[e],O=a[e]+o.from,f;if(!(!(s&I.EnterBracketed&&c instanceof U&&(f=Ri.get(c))&&!f.overlay&&f.bracketed&&n>=O&&n<=O+c.length)&&!lf(r,n,O,O+c.length))){if(c instanceof It){if(s&I.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-O,r);if(u>-1)return new dt(new qm(o,c,e,O),null,u)}else if(s&I.IncludeAnonymous||!c.type.isAnonymous||ia(c)){let u;if(!(s&I.IgnoreMounts)&&(u=Ri.get(c))&&!u.overlay)return new Pe(u.tree,O,e,o);let d=new Pe(c,O,e,o);return s&I.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&I.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&I.IgnoreOverlays)&&(r=Ri.get(this._tree))&&r.overlay){let s=e-this.from,o=n&I.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new Pe(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ch(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Go(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class qm{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class dt extends af{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new dt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&I.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hf(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new Pe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(vn(l,e,t,!1))}}return r?hf(r):n}class Ur{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~I.EnterBracketed,e instanceof Pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Pe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&I.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&I.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&I.IncludeAnonymous||l instanceof It||!l.type.isAnonymous||ia(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Go(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function ia(i){return i.children.some(e=>e instanceof It||!e.type.isAnonymous||ia(e))}function zm(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=of,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new ta(t,t.length):t,a=n.types,h=0,c=0;function O(x,k,$,q,_,B){let{id:z,start:A,end:V,size:E}=l,G=c,oe=h;if(E<0)if(l.next(),E==-1){let me=s[z];$.push(me),q.push(A-x);return}else if(E==-3){h=z;return}else if(E==-4){c=z;return}else throw new RangeError(`Unrecognized record size: ${E}`);let fe=a[z],we,ie,pe=A-x;if(V-A<=r&&(ie=g(l.pos-k,_))){let me=new Uint16Array(ie.size-ie.skip),ve=l.pos-ie.size,Me=me.length;for(;l.pos>ve;)Me=Q(ie.start,me,Me);we=new It(me,V-ie.start,n),pe=ie.start-x}else{let me=l.pos-E;l.next();let ve=[],Me=[],H=z>=o?z:-1,Fe=0,ni=V;for(;l.pos>me;)H>=0&&l.id==H&&l.size>=0?(l.end<=ni-r&&(d(ve,Me,A,Fe,l.end,ni,H,G,oe),Fe=ve.length,ni=l.end),l.next()):B>2500?f(A,me,ve,Me):O(A,me,ve,Me,H,B+1);if(H>=0&&Fe>0&&Fe-1&&Fe>0){let ki=u(fe,oe);we=na(fe,ve,Me,0,ve.length,0,V-A,ki,ki)}else we=m(fe,ve,Me,V-A,G-V,oe)}$.push(we),q.push(pe)}function f(x,k,$,q){let _=[],B=0,z=-1;for(;l.pos>k;){let{id:A,start:V,end:E,size:G}=l;if(G>4)l.next();else{if(z>-1&&V=0;E-=3)A[G++]=_[E],A[G++]=_[E+1]-V,A[G++]=_[E+2]-V,A[G++]=G;$.push(new It(A,_[2]-V,n)),q.push(V-x)}}function u(x,k){return($,q,_)=>{let B=0,z=$.length-1,A,V;if(z>=0&&(A=$[z])instanceof U){if(!z&&A.type==x&&A.length==_)return A;(V=A.prop(M.lookAhead))&&(B=q[z]+A.length+V)}return m(x,$,q,_,B,k)}}function d(x,k,$,q,_,B,z,A,V){let E=[],G=[];for(;x.length>q;)E.push(x.pop()),G.push(k.pop()+$-_);x.push(m(n.types[z],E,G,B-_,A-B,V)),k.push(_-$)}function m(x,k,$,q,_,B,z){if(B){let A=[M.contextHash,B];z=z?[A].concat(z):[A]}if(_>25){let A=[M.lookAhead,_];z=z?[A].concat(z):[A]}return new U(x,k,$,q,z)}function g(x,k){let $=l.fork(),q=0,_=0,B=0,z=$.end-r,A={size:0,start:0,skip:0};e:for(let V=$.pos-x;$.pos>V;){let E=$.size;if($.id==k&&E>=0){A.size=q,A.start=_,A.skip=B,B+=4,q+=4,$.next();continue}let G=$.pos-E;if(E<0||G=o?4:0,fe=$.start;for($.next();$.pos>G;){if($.size<0)if($.size==-3||$.size==-4)oe+=4;else break e;else $.id>=o&&(oe+=4);$.next()}_=fe,q+=E,B+=oe}return(k<0||q==x)&&(A.size=q,A.start=_,A.skip=B),A.size>4?A:void 0}function Q(x,k,$){let{id:q,start:_,end:B,size:z}=l;if(l.next(),z>=0&&q4){let V=l.pos-(z-4);for(;l.pos>V;)$=Q(x,k,$)}k[--$]=A,k[--$]=B-x,k[--$]=_-x,k[--$]=q}else z==-3?h=q:z==-4&&(c=q);return $}let S=[],y=[];for(;l.pos>0;)O(i.start||0,i.bufferStart||0,S,y,-1,0);let w=(e=i.length)!==null&&e!==void 0?e:S.length?y[0]+S[0].length:0;return new U(a[i.topID],S.reverse(),y.reverse(),w)}const Oh=new WeakMap;function Wr(i,e){if(!i.isAnonymous||e instanceof It||e.type!=i)return 1;let t=Oh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof U)){t=1;break}t+=Wr(i,n)}Oh.set(e,t)}return t}function na(i,e,t,n,r,s,o,l,a){let h=0;for(let d=n;d=c)break;k+=$}if(y==w+1){if(k>c){let $=d[w];u($.children,$.positions,0,$.children.length,m[w]+S);continue}O.push(d[w])}else{let $=m[y-1]+d[y-1].length-x;O.push(na(i,d,m,w,y,x,$,null,a))}f.push(x+S-s)}}return u(e,t,n,r,0),(l||a)(O,f,o)}class ra{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof dt?this.setBuffer(e.context.buffer,e.index,t):e instanceof Pe&&this.map.set(e.tree,t)}get(e){return e instanceof dt?this.getBuffer(e.context.buffer,e.index):e instanceof Pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xt{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new Xt(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=n)for(;o&&o.from=f.from||O<=f.to||h){let u=Math.max(f.from,a)-h,d=Math.min(f.to,O)-h;f=u>=d?null:new Xt(u,d,f.tree,f.offset+h,l>0,!!c)}if(f&&r.push(f),o.to>O)break;o=snew Le(r.from,r.to)):[new Le(0,0)]:[new Le(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class _m{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function cf(i){return(e,t,n,r)=>new jm(e,i,t,n,r)}class fh{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function uh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class Em{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Io=new M({perNode:!0});class jm{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new U(n.type,n.children,n.positions,n.length,n.propValues.concat([[Io,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[M.mounted.id]=new Ri(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let O=c.from+h.pos,f=c.to+h.pos;O>=r.from&&f<=r.to&&!t.ranges.some(u=>u.fromO)&&t.ranges.push({from:O,to:f})}}l=!1}else if(n&&(o=Vm(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Le(O.from-r.from,O.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Le(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=mh(this.ranges,t.ranges);h.length&&(uh(h),this.inner.splice(t.index,0,new fh(t.parser,t.parser.startParse(this.input,gh(t.mounts,h),h),t.ranges.map(c=>new Le(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function Vm(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function dh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,I.IgnoreOverlays|I.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let Lm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Io))!==null&&t!==void 0?t:n.to,this.inner=new ph(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Io))!==null&&e!==void 0?e:t.to,this.inner=new ph(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(M.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function mh(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new Le(l,a.to))):a.to>l?t[s--]=new Le(l,a.to):t.splice(s--,1))}}return n}function Dm(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,O=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),u=Math.min(c,O,n);fnew Le(f.from+n,f.to+n)),O=Dm(e,c,a,h);for(let f=0,u=a;;f++){let d=f==O.length,m=d?h:O[f].from;if(m>u&&t.push(new Xt(u,m,r.tree,-o,s.from>=u||s.openStart,s.to<=m||s.openEnd)),d)break;u=O[f].to}}else t.push(new Xt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Qh={};class Nr{constructor(e,t,n,r,s,o,l,a,h,c=0,O){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new Nr(e,[],t,n,n,0,[],0,r?new Sh(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Nr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bm(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}}class Sh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Bm{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Fr{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fr(this.stack,this.pos,this.index)}}function un(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Mr{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const bh=new Mr;class Gm{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=bh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=bh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class Zi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Of(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Zi.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class Hr{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?un(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Of(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Hr.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class ae{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Of(i,e,t,n,r,s){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||Im(d,e.token.value,r,s))){e.acceptToken(d);break}}let c=e.next,O=0,f=i[o+2];if(e.next<0&&f>O&&i[h+f*3-3]==65535){o=i[h+f*3-1];continue e}for(;O>1,d=h+u+(u<<1),m=i[d],g=i[d+1]||65536;if(c=g)O=u+1;else{o=i[d+2],e.advance();continue e}}break}}function yh(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Im(i,e,t,n){let r=yh(t,n,e);return r<0||yh(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}let Um=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xh(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xh(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof U){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class Nm{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Mr)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let f=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!c.extend&&(n=O,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Mr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Mr,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Um(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&Km(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let f=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(f>-1&&O.length&&(!h||(O.prop(M.contextHash)||0)==c))return e.useNode(O,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof U)||O.children.length==0||O.positions[0]>0)break;let u=O.children[0];if(u instanceof U&&O.positions[0]==0)O=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return kh(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),ze&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let O=l.split(),f=c;for(let u=0;u<10&&O.forceReduce()&&(ze&&console.log(f+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,n));u++)ze&&(f=this.stackID(O)+" -> ");for(let u of l.recoverByInsert(a))ze&&console.log(c+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),ze&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),kh(l,n)):(!r||r.scorei;class Ts{constructor(e){this.start=e.start,this.shift=e.shift||Us,this.reduce=e.reduce||Us,this.reuse=e.reuse||Us,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Rt extends sa{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let O=l[h+-c];for(let f=-c;f>0;f--)s(l[h++],a,O);h++}}}this.nodeSet=new Kn(t.map((l,a)=>Oe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=of;let o=un(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Zi(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Fm(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vt(this.data,s+2);else break;r=t(vt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(Rt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Ph(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}let Jm=0,ct=class Uo{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Jm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Uo&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Uo(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Kr(e);return n=>n.modified.indexOf(t)>-1?n:Kr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},eg=0;class Kr{constructor(e){this.name=e,this.instances=[],this.id=eg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&tg(t,l.modified));if(n)return n;let r=[],s=new ct(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=ig(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Kr.get(l,a));return s}}function tg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function ig(i){let e=[[]];for(let t=0;tn.length-t.length)}function zt(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let O=0;;){if(l=="..."&&O>0&&O+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),O+=f[0].length,O==r.length)break;let u=r[O++];if(O==r.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+r);l=r.slice(O)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new Tn(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return ff.add(e)}const ff=new M({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Tn(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}});class Tn{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function ng(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function rg(i,e,t,n=0,r=i.length){let s=new sg(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class sg{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(o)));let h=r,c=og(e)||Tn.empty,O=ng(s,c.tags);if(O&&(h&&(h+=" "),h+=O,c.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,l),h),c.opaque)return;let f=e.tree&&e.tree.prop(M.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,Q=l;;g++){let S=g=y||!e.nextSibling())););if(!S||y>n)break;Q=S.to+l,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,S.from+l),Math.min(n,Q),"",d),this.startSpan(Math.min(n,Q),h))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function og(i){let e=i.type.prop(ff);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const T=ct.define,cr=T(),Vt=T(),$h=T(Vt),wh=T(Vt),Yt=T(),Or=T(Yt),Ns=T(Yt),ht=T(),oi=T(ht),ot=T(),lt=T(),No=T(),sn=T(No),fr=T(),p={comment:cr,lineComment:T(cr),blockComment:T(cr),docComment:T(cr),name:Vt,variableName:T(Vt),typeName:$h,tagName:T($h),propertyName:wh,attributeName:T(wh),className:T(Vt),labelName:T(Vt),namespace:T(Vt),macroName:T(Vt),literal:Yt,string:Or,docString:T(Or),character:T(Or),attributeValue:T(Or),number:Ns,integer:T(Ns),float:T(Ns),bool:T(Yt),regexp:T(Yt),escape:T(Yt),color:T(Yt),url:T(Yt),keyword:ot,self:T(ot),null:T(ot),atom:T(ot),unit:T(ot),modifier:T(ot),operatorKeyword:T(ot),controlKeyword:T(ot),definitionKeyword:T(ot),moduleKeyword:T(ot),operator:lt,derefOperator:T(lt),arithmeticOperator:T(lt),logicOperator:T(lt),bitwiseOperator:T(lt),compareOperator:T(lt),updateOperator:T(lt),definitionOperator:T(lt),typeOperator:T(lt),controlOperator:T(lt),punctuation:No,separator:T(No),bracket:sn,angleBracket:T(sn),squareBracket:T(sn),paren:T(sn),brace:T(sn),content:ht,heading:oi,heading1:T(oi),heading2:T(oi),heading3:T(oi),heading4:T(oi),heading5:T(oi),heading6:T(oi),contentSeparator:T(ht),list:T(ht),quote:T(ht),emphasis:T(ht),strong:T(ht),link:T(ht),monospace:T(ht),strikethrough:T(ht),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:fr,documentMeta:T(fr),annotation:T(fr),processingInstruction:T(fr),definition:ct.defineModifier("definition"),constant:ct.defineModifier("constant"),function:ct.defineModifier("function"),standard:ct.defineModifier("standard"),local:ct.defineModifier("local"),special:ct.defineModifier("special")};for(let i in p){let e=p[i];e instanceof ct&&(e.name=i)}uf([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);const lg=316,ag=317,vh=1,hg=2,cg=3,Og=4,fg=318,ug=320,dg=321,pg=5,mg=6,gg=0,Fo=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],df=125,Qg=59,Ho=47,Sg=42,bg=43,yg=45,xg=60,kg=44,Pg=63,$g=46,wg=91,vg=new Ts({start:!1,shift(i,e){return e==pg||e==mg||e==ug?i:e==dg},strict:!1}),Tg=new ae((i,e)=>{let{next:t}=i;(t==df||t==-1||e.context)&&i.acceptToken(fg)},{contextual:!0,fallback:!0}),Xg=new ae((i,e)=>{let{next:t}=i,n;Fo.indexOf(t)>-1||t==Ho&&((n=i.peek(1))==Ho||n==Sg)||t!=df&&t!=Qg&&t!=-1&&!e.context&&i.acceptToken(lg)},{contextual:!0}),Cg=new ae((i,e)=>{i.next==wg&&!e.context&&i.acceptToken(ag)},{contextual:!0}),Rg=new ae((i,e)=>{let{next:t}=i;if(t==bg||t==yg){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(vh);i.acceptToken(n?vh:hg)}}else t==Pg&&i.peek(1)==$g&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(cg))},{contextual:!0});function Fs(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const Zg=new ae((i,e)=>{if(i.next!=xg||!e.dialectEnabled(gg)||(i.advance(),i.next==Ho))return;let t=0;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(Fs(i.next,!0)){for(i.advance(),t++;Fs(i.next,!1);)i.advance(),t++;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==kg)return;for(let n=0;;n++){if(n==7){if(!Fs(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Og,-t)}),Ag=zt({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case defer":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),qg={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Wg={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Mg={__proto__:null,"<":193},zg=Rt.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:vg,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Ag],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Xg,Cg,Rg,Zg,2,3,4,5,6,7,8,9,10,11,12,13,14,Tg,new Hr("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Hr("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:i=>qg[i]||-1},{term:343,get:i=>Wg[i]||-1},{term:95,get:i=>Mg[i]||-1}],tokenPrec:15201});let Ko=[],pf=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=pf[n])e=n+1;else return!0;if(e==t)return!1}}function Th(i){return i>=127462&&i<=127487}const Xh=8205;function Eg(i,e,t=!0,n=!0){return(t?mf:jg)(i,e,n)}function mf(i,e,t){if(e==i.length)return e;e&&gf(i.charCodeAt(e))&&Qf(i.charCodeAt(e-1))&&e--;let n=Hs(i,e);for(e+=Ch(n);e=0&&Th(Hs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function jg(i,e,t){for(;e>1;){let n=mf(i,e-2,t);if(n=56320&&i<57344}function Qf(i){return i>=55296&&i<56320}function Ch(i){return i<65536?1:2}class D{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Vi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ot.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let n=[];return this.decompose(e,t,n,0),Ot.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new gn(this),s=new gn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new gn(this,e)}iterRange(e,t=this.length){return new Sf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?D.empty:e.length<=32?new le(e):Ot.from(le.split(e,[]))}}class le extends D{constructor(e,t=Vg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Yg(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new le(Rh(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=zr(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new le(l,o.length+s.length));else{let a=l.length>>1;n.push(new le(l.slice(0,a)),new le(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof le))return super.replace(e,t,n);[e,t]=Vi(this,e,t);let r=zr(this.text,zr(n.text,Rh(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new le(r,s):Ot.from(le.split(r,[]),s)}sliceString(e,t=this.length,n=` +import{L as xe,D as sf}from"./index-D88Zv3M6.js";const of=1024;let Zm=0,Le=class{constructor(e,t){this.from=e,this.to=t}};class M{constructor(e={}){this.id=Zm++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Oe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}M.closedBy=new M({deserialize:i=>i.split(" ")});M.openedBy=new M({deserialize:i=>i.split(" ")});M.group=new M({deserialize:i=>i.split(" ")});M.isolate=new M({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});M.contextHash=new M({perNode:!0});M.lookAhead=new M({perNode:!0});M.mounted=new M({perNode:!0});class Ri{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[M.mounted.id]}}const Am=Object.create(null);class Oe{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Am,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Oe(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(M.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(" "))t[r]=e[n];return n=>{for(let r=n.prop(M.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?n.name:r[s]];if(o)return o}}}}Oe.none=new Oe("",Object.create(null),0,8);class Kn{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|I.IncludeAnonymous);;){let h=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:na(Oe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new U(this.type,t,n,r,this.propValues),e.makeTree||((t,n,r)=>new U(Oe.none,t,n,r)))}static build(e){return zm(e)}}U.empty=new U(Oe.none,[],[],0);class ta{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ta(this.buffer,this.index)}}class It{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Oe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function vn(i,e,t,n){for(var r;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=h;e+=t){let c=l[e],O=a[e]+o.from,f;if(!(!(s&I.EnterBracketed&&c instanceof U&&(f=Ri.get(c))&&!f.overlay&&f.bracketed&&n>=O&&n<=O+c.length)&&!lf(r,n,O,O+c.length))){if(c instanceof It){if(s&I.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,n-O,r);if(u>-1)return new dt(new qm(o,c,e,O),null,u)}else if(s&I.IncludeAnonymous||!c.type.isAnonymous||ia(c)){let u;if(!(s&I.IgnoreMounts)&&(u=Ri.get(c))&&!u.overlay)return new Pe(u.tree,O,e,o);let d=new Pe(c,O,e,o);return s&I.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,n,r,s)}}}if(s&I.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,n=0){let r;if(!(n&I.IgnoreOverlays)&&(r=Ri.get(this._tree))&&r.overlay){let s=e-this.from,o=n&I.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((t>0||o?l<=s:l=s:a>s))return new Pe(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function ch(i,e,t,n){let r=i.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function Go(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class qm{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class dt extends af{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new dt(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,n=0){if(n&I.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dt(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dt(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),t.push(0)}return new U(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function hf(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;st.from||o.to=e){let l=new Pe(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(vn(l,e,t,!1))}}return r?hf(r):n}class Ur{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~I.EnterBracketed,e instanceof Pe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Pe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&I.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&I.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&I.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&I.IncludeAnonymous||l instanceof It||!l.type.isAnonymous||ia(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return Go(this._tree,e,r);let o=n[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function ia(i){return i.children.some(e=>e instanceof It||!e.type.isAnonymous||ia(e))}function zm(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:r=of,reused:s=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new ta(t,t.length):t,a=n.types,h=0,c=0;function O(x,k,$,q,_,B){let{id:z,start:A,end:V,size:E}=l,G=c,oe=h;if(E<0)if(l.next(),E==-1){let me=s[z];$.push(me),q.push(A-x);return}else if(E==-3){h=z;return}else if(E==-4){c=z;return}else throw new RangeError(`Unrecognized record size: ${E}`);let fe=a[z],we,ie,pe=A-x;if(V-A<=r&&(ie=g(l.pos-k,_))){let me=new Uint16Array(ie.size-ie.skip),ve=l.pos-ie.size,Me=me.length;for(;l.pos>ve;)Me=Q(ie.start,me,Me);we=new It(me,V-ie.start,n),pe=ie.start-x}else{let me=l.pos-E;l.next();let ve=[],Me=[],H=z>=o?z:-1,Fe=0,ni=V;for(;l.pos>me;)H>=0&&l.id==H&&l.size>=0?(l.end<=ni-r&&(d(ve,Me,A,Fe,l.end,ni,H,G,oe),Fe=ve.length,ni=l.end),l.next()):B>2500?f(A,me,ve,Me):O(A,me,ve,Me,H,B+1);if(H>=0&&Fe>0&&Fe-1&&Fe>0){let ki=u(fe,oe);we=na(fe,ve,Me,0,ve.length,0,V-A,ki,ki)}else we=m(fe,ve,Me,V-A,G-V,oe)}$.push(we),q.push(pe)}function f(x,k,$,q){let _=[],B=0,z=-1;for(;l.pos>k;){let{id:A,start:V,end:E,size:G}=l;if(G>4)l.next();else{if(z>-1&&V=0;E-=3)A[G++]=_[E],A[G++]=_[E+1]-V,A[G++]=_[E+2]-V,A[G++]=G;$.push(new It(A,_[2]-V,n)),q.push(V-x)}}function u(x,k){return($,q,_)=>{let B=0,z=$.length-1,A,V;if(z>=0&&(A=$[z])instanceof U){if(!z&&A.type==x&&A.length==_)return A;(V=A.prop(M.lookAhead))&&(B=q[z]+A.length+V)}return m(x,$,q,_,B,k)}}function d(x,k,$,q,_,B,z,A,V){let E=[],G=[];for(;x.length>q;)E.push(x.pop()),G.push(k.pop()+$-_);x.push(m(n.types[z],E,G,B-_,A-B,V)),k.push(_-$)}function m(x,k,$,q,_,B,z){if(B){let A=[M.contextHash,B];z=z?[A].concat(z):[A]}if(_>25){let A=[M.lookAhead,_];z=z?[A].concat(z):[A]}return new U(x,k,$,q,z)}function g(x,k){let $=l.fork(),q=0,_=0,B=0,z=$.end-r,A={size:0,start:0,skip:0};e:for(let V=$.pos-x;$.pos>V;){let E=$.size;if($.id==k&&E>=0){A.size=q,A.start=_,A.skip=B,B+=4,q+=4,$.next();continue}let G=$.pos-E;if(E<0||G=o?4:0,fe=$.start;for($.next();$.pos>G;){if($.size<0)if($.size==-3||$.size==-4)oe+=4;else break e;else $.id>=o&&(oe+=4);$.next()}_=fe,q+=E,B+=oe}return(k<0||q==x)&&(A.size=q,A.start=_,A.skip=B),A.size>4?A:void 0}function Q(x,k,$){let{id:q,start:_,end:B,size:z}=l;if(l.next(),z>=0&&q4){let V=l.pos-(z-4);for(;l.pos>V;)$=Q(x,k,$)}k[--$]=A,k[--$]=B-x,k[--$]=_-x,k[--$]=q}else z==-3?h=q:z==-4&&(c=q);return $}let S=[],y=[];for(;l.pos>0;)O(i.start||0,i.bufferStart||0,S,y,-1,0);let w=(e=i.length)!==null&&e!==void 0?e:S.length?y[0]+S[0].length:0;return new U(a[i.topID],S.reverse(),y.reverse(),w)}const Oh=new WeakMap;function Wr(i,e){if(!i.isAnonymous||e instanceof It||e.type!=i)return 1;let t=Oh.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof U)){t=1;break}t+=Wr(i,n)}Oh.set(e,t)}return t}function na(i,e,t,n,r,s,o,l,a){let h=0;for(let d=n;d=c)break;k+=$}if(y==w+1){if(k>c){let $=d[w];u($.children,$.positions,0,$.children.length,m[w]+S);continue}O.push(d[w])}else{let $=m[y-1]+d[y-1].length-x;O.push(na(i,d,m,w,y,x,$,null,a))}f.push(x+S-s)}}return u(e,t,n,r,0),(l||a)(O,f,o)}class ra{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof dt?this.setBuffer(e.context.buffer,e.index,t):e instanceof Pe&&this.map.set(e.tree,t)}get(e){return e instanceof dt?this.getBuffer(e.context.buffer,e.index):e instanceof Pe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Xt{constructor(e,t,n,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let r=[new Xt(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=n)for(;o&&o.from=f.from||O<=f.to||h){let u=Math.max(f.from,a)-h,d=Math.min(f.to,O)-h;f=u>=d?null:new Xt(u,d,f.tree,f.offset+h,l>0,!!c)}if(f&&r.push(f),o.to>O)break;o=snew Le(r.from,r.to)):[new Le(0,0)]:[new Le(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let s=r.advance();if(s)return s}}}class _m{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function cf(i){return(e,t,n,r)=>new jm(e,i,t,n,r)}class fh{constructor(e,t,n,r,s,o){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function uh(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class Em{constructor(e,t,n,r,s,o,l,a){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const Io=new M({perNode:!0});class jm{constructor(e,t,n,r,s){this.nest=t,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new U(n.type,n.children,n.positions,n.length,n.propValues.concat([[Io,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[M.mounted.id]=new Ri(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let O=c.from+h.pos,f=c.to+h.pos;O>=r.from&&f<=r.to&&!t.ranges.some(u=>u.fromO)&&t.ranges.push({from:O,to:f})}}l=!1}else if(n&&(o=Vm(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Le(O.from-r.from,O.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(r))&&(a===!0&&(a=new Le(r.from,r.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&r.firstChild())t&&t.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=mh(this.ranges,t.ranges);h.length&&(uh(h),this.inner.splice(t.index,0,new fh(t.parser,t.parser.startParse(this.input,gh(t.mounts,h),h),t.ranges.map(c=>new Le(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}}function Vm(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function dh(i,e,t,n,r,s){if(e=e&&t.enter(n,1,I.IgnoreOverlays|I.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof U)t=t.children[0];else break}return!1}}let Lm=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(Io))!==null&&t!==void 0?t:n.to,this.inner=new ph(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Io))!==null&&e!==void 0?e:t.to,this.inner=new ph(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(M.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function mh(i,e){let t=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(s+1,0,new Le(l,a.to))):a.to>l?t[s--]=new Le(l,a.to):t.splice(s--,1))}}return n}function Dm(i,e,t,n){let r=0,s=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=r==i.length?1e9:o?i[r].to:i[r].from,O=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,t),u=Math.min(c,O,n);fnew Le(f.from+n,f.to+n)),O=Dm(e,c,a,h);for(let f=0,u=a;;f++){let d=f==O.length,m=d?h:O[f].from;if(m>u&&t.push(new Xt(u,m,r.tree,-o,s.from>=u||s.openStart,s.to<=m||s.openEnd)),d)break;u=O[f].to}}else t.push(new Xt(a,h,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return t}var Qh={};class Nr{constructor(e,t,n,r,s,o,l,a,h,c=0,O){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let r=e.parser.context;return new Nr(e,[],t,n,n,0,[],0,r?new Sh(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(t==n)return;if(this.buffer[o-2]>=t){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new Nr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Bm(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(t[s],o)}t=r}let n=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&e.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t0&&this.emitLookAhead()}}class Sh{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Bm{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Fr{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fr(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fr(this.stack,this.pos,this.index)}}function un(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Mr{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const bh=new Mr;class Gm{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=bh,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=bh,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}}class Zi{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Of(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Zi.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class Hr{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?un(e):e}token(e,t){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(Of(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}Hr.prototype.contextual=Zi.prototype.fallback=Zi.prototype.extend=!1;class ae{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Of(i,e,t,n,r,s){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||Im(d,e.token.value,r,s))){e.acceptToken(d);break}}let c=e.next,O=0,f=i[o+2];if(e.next<0&&f>O&&i[h+f*3-3]==65535){o=i[h+f*3-1];continue e}for(;O>1,d=h+u+(u<<1),m=i[d],g=i[d+1]||65536;if(c=g)O=u+1;else{o=i[d+2],e.advance();continue e}}break}}function yh(i,e,t){for(let n=e,r;(r=i[n])!=65535;n++)if(r==t)return n-e;return-1}function Im(i,e,t,n){let r=yh(t,n,e);return r<0||yh(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}let Um=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?xh(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?xh(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof U){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};class Nm{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Mr)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let h=0;hO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let f=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!c.extend&&(n=O,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Mr,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Mr,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let s=0;se.bufferLength*4?new Um(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&Km(r);if(o)return ze&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw ze&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return ze&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,c=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let f=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(f>-1&&O.length&&(!h||(O.prop(M.contextHash)||0)==c))return e.useNode(O,f),ze&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof U)||O.children.length==0||O.positions[0]>0)break;let u=O.children[0];if(u instanceof U&&O.positions[0]==0)O=u;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),ze&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let h=0;hr?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return kh(e,t),!0}}runRecovery(e,t,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),ze&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let O=l.split(),f=c;for(let u=0;u<10&&O.forceReduce()&&(ze&&console.log(f+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,n));u++)ze&&(f=this.stackID(O)+" -> ");for(let u of l.recoverByInsert(a))ze&&console.log(c+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),ze&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),kh(l,n)):(!r||r.scorei;class Ts{constructor(e){this.start=e.start,this.shift=e.shift||Us,this.reduce=e.reduce||Us,this.reuse=e.reuse||Us,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Rt extends sa{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[h++]);else{let O=l[h+-c];for(let f=-c;f>0;f--)s(l[h++],a,O);h++}}}this.nodeSet=new Kn(t.map((l,a)=>Oe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=of;let o=un(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new Zi(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new Fm(this,e,t,n);for(let s of this.wrappers)r=s(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let h=s+(o>>1);s0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=vt(this.data,s+2);else break;r=t(vt(this.data,s+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=vt(this.data,n+2);else break;if(!(this.data[n+2]&1)){let r=this.data[n+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[n],r)}}return t}configure(e){let t=Object.assign(Object.create(Rt.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[r]=Ph(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}let Jm=0,ct=class Uo{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Jm++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Uo&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Uo(n,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Kr(e);return n=>n.modified.indexOf(t)>-1?n:Kr.get(n.base||n,n.modified.concat(t).sort((r,s)=>r.id-s.id))}},eg=0;class Kr{constructor(e){this.name=e,this.instances=[],this.id=eg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&tg(t,l.modified));if(n)return n;let r=[],s=new ct(e.name,r,e,t);for(let l of t)l.instances.push(s);let o=ig(t);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Kr.get(l,a));return s}}function tg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function ig(i){let e=[[]];for(let t=0;tn.length-t.length)}function zt(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let r of t.split(" "))if(r){let s=[],o=2,l=r;for(let O=0;;){if(l=="..."&&O>0&&O+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),O+=f[0].length,O==r.length)break;let u=r[O++];if(O==r.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+r);l=r.slice(O)}let a=s.length-1,h=s[a];if(!h)throw new RangeError("Invalid path: "+r);let c=new Tn(n,o,a>0?s.slice(0,a):null);e[h]=c.sort(e[h])}}return ff.add(e)}const ff=new M({combine(i,e){let t,n,r;for(;i||e;){if(!i||e&&i.depth>=e.depth?(r=e,e=e.next):(r=i,i=i.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Tn(r.tags,r.mode,r.context);t?t.next=s:n=s,t=s}return n}});class Tn{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:n}}function ng(i,e){let t=null;for(let n of i){let r=n.style(e);r&&(t=t?t+" "+r:r)}return t}function rg(i,e,t,n=0,r=i.length){let s=new sg(n,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),n,r,"",s.highlighters),s.flush(r)}class sg{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(u=>!u.scope||u.scope(o)));let h=r,c=og(e)||Tn.empty,O=ng(s,c.tags);if(O&&(h&&(h+=" "),h+=O,c.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,l),h),c.opaque)return;let f=e.tree&&e.tree.prop(M.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,Q=l;;g++){let S=g=y||!e.nextSibling())););if(!S||y>n)break;Q=S.to+l,Q>t&&(this.highlightRange(u.cursor(),Math.max(t,S.from+l),Math.min(n,Q),"",d),this.startSpan(Math.min(n,Q),h))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),h)}while(e.nextSibling());e.parent()}}}function og(i){let e=i.type.prop(ff);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const T=ct.define,cr=T(),Vt=T(),$h=T(Vt),wh=T(Vt),Yt=T(),Or=T(Yt),Ns=T(Yt),ht=T(),oi=T(ht),ot=T(),lt=T(),No=T(),sn=T(No),fr=T(),p={comment:cr,lineComment:T(cr),blockComment:T(cr),docComment:T(cr),name:Vt,variableName:T(Vt),typeName:$h,tagName:T($h),propertyName:wh,attributeName:T(wh),className:T(Vt),labelName:T(Vt),namespace:T(Vt),macroName:T(Vt),literal:Yt,string:Or,docString:T(Or),character:T(Or),attributeValue:T(Or),number:Ns,integer:T(Ns),float:T(Ns),bool:T(Yt),regexp:T(Yt),escape:T(Yt),color:T(Yt),url:T(Yt),keyword:ot,self:T(ot),null:T(ot),atom:T(ot),unit:T(ot),modifier:T(ot),operatorKeyword:T(ot),controlKeyword:T(ot),definitionKeyword:T(ot),moduleKeyword:T(ot),operator:lt,derefOperator:T(lt),arithmeticOperator:T(lt),logicOperator:T(lt),bitwiseOperator:T(lt),compareOperator:T(lt),updateOperator:T(lt),definitionOperator:T(lt),typeOperator:T(lt),controlOperator:T(lt),punctuation:No,separator:T(No),bracket:sn,angleBracket:T(sn),squareBracket:T(sn),paren:T(sn),brace:T(sn),content:ht,heading:oi,heading1:T(oi),heading2:T(oi),heading3:T(oi),heading4:T(oi),heading5:T(oi),heading6:T(oi),contentSeparator:T(ht),list:T(ht),quote:T(ht),emphasis:T(ht),strong:T(ht),link:T(ht),monospace:T(ht),strikethrough:T(ht),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:fr,documentMeta:T(fr),annotation:T(fr),processingInstruction:T(fr),definition:ct.defineModifier("definition"),constant:ct.defineModifier("constant"),function:ct.defineModifier("function"),standard:ct.defineModifier("standard"),local:ct.defineModifier("local"),special:ct.defineModifier("special")};for(let i in p){let e=p[i];e instanceof ct&&(e.name=i)}uf([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);const lg=316,ag=317,vh=1,hg=2,cg=3,Og=4,fg=318,ug=320,dg=321,pg=5,mg=6,gg=0,Fo=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],df=125,Qg=59,Ho=47,Sg=42,bg=43,yg=45,xg=60,kg=44,Pg=63,$g=46,wg=91,vg=new Ts({start:!1,shift(i,e){return e==pg||e==mg||e==ug?i:e==dg},strict:!1}),Tg=new ae((i,e)=>{let{next:t}=i;(t==df||t==-1||e.context)&&i.acceptToken(fg)},{contextual:!0,fallback:!0}),Xg=new ae((i,e)=>{let{next:t}=i,n;Fo.indexOf(t)>-1||t==Ho&&((n=i.peek(1))==Ho||n==Sg)||t!=df&&t!=Qg&&t!=-1&&!e.context&&i.acceptToken(lg)},{contextual:!0}),Cg=new ae((i,e)=>{i.next==wg&&!e.context&&i.acceptToken(ag)},{contextual:!0}),Rg=new ae((i,e)=>{let{next:t}=i;if(t==bg||t==yg){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(vh);i.acceptToken(n?vh:hg)}}else t==Pg&&i.peek(1)==$g&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(cg))},{contextual:!0});function Fs(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}const Zg=new ae((i,e)=>{if(i.next!=xg||!e.dialectEnabled(gg)||(i.advance(),i.next==Ho))return;let t=0;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(Fs(i.next,!0)){for(i.advance(),t++;Fs(i.next,!1);)i.advance(),t++;for(;Fo.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==kg)return;for(let n=0;;n++){if(n==7){if(!Fs(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(Og,-t)}),Ag=zt({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case defer":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),qg={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Wg={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Mg={__proto__:null,"<":193},zg=Rt.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:vg,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Ag],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Xg,Cg,Rg,Zg,2,3,4,5,6,7,8,9,10,11,12,13,14,Tg,new Hr("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new Hr("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:i=>qg[i]||-1},{term:343,get:i=>Wg[i]||-1},{term:95,get:i=>Mg[i]||-1}],tokenPrec:15201});let Ko=[],pf=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=pf[n])e=n+1;else return!0;if(e==t)return!1}}function Th(i){return i>=127462&&i<=127487}const Xh=8205;function Eg(i,e,t=!0,n=!0){return(t?mf:jg)(i,e,n)}function mf(i,e,t){if(e==i.length)return e;e&&gf(i.charCodeAt(e))&&Qf(i.charCodeAt(e-1))&&e--;let n=Hs(i,e);for(e+=Ch(n);e=0&&Th(Hs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function jg(i,e,t){for(;e>1;){let n=mf(i,e-2,t);if(n=56320&&i<57344}function Qf(i){return i>=55296&&i<56320}function Ch(i){return i<65536?1:2}class D{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Vi(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),Ot.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let n=[];return this.decompose(e,t,n,0),Ot.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new gn(this),s=new gn(e);for(let o=t,l=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new gn(this,e)}iterRange(e,t=this.length){return new Sf(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bf(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?D.empty:e.length<=32?new le(e):Ot.from(le.split(e,[]))}}class le extends D{constructor(e,t=Vg(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((t?n:l)>=e)return new Yg(r,l,n,o);r=l+1,n++}}decompose(e,t,n,r){let s=e<=0&&t>=this.length?this:new le(Rh(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=zr(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new le(l,o.length+s.length));else{let a=l.length>>1;n.push(new le(l.slice(0,a)),new le(l.slice(a)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof le))return super.replace(e,t,n);[e,t]=Vi(this,e,t);let r=zr(this.text,zr(n.text,Rh(this.text,0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new le(r,s):Ot.from(le.split(r,[]),s)}sliceString(e,t=this.length,n=` `){[e,t]=Vi(this,e,t);let r="";for(let s=0,o=0;s<=t&&oe&&o&&(r+=n),es&&(r+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(t.push(new le(n,r)),n=[],r=-1);return r>-1&&t.push(new le(n,r)),t}}class Ot extends D{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,r);r=l+1,n=a+1}}decompose(e,t,n,r){for(let s=0,o=0;o<=t&&s=o){let h=r&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?n.push(l):l.decompose(e-o,t-o,n,h)}o=a+1}}replace(e,t,n){if([e,t]=Vi(this,e,t),n.lines=s&&t<=l){let a=o.replace(e-s,t-s,n),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new Ot(c,this.length-(t-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){[e,t]=Vi(this,e,t);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=l.sliceString(e-o,t-o,n)),o=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ot))return 0;let n=0,[r,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==l)return n;let a=this.children[r],h=e.children[s];if(a!=h)return n+a.scanIdentical(h,t);n+=a.length+1}}static from(e,t=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let u of e)n+=u.lines;if(n<32){let u=[];for(let d of e)d.flatten(u);return new le(u,t)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function O(u){let d;if(u.lines>s&&u instanceof Ot)for(let m of u.children)O(m);else u.lines>o&&(a>o||!a)?(f(),l.push(u)):u instanceof le&&a&&(d=c[c.length-1])instanceof le&&u.lines+d.lines<=32?(a+=u.lines,h+=u.length+1,c[c.length-1]=new le(d.text.concat(u.text),d.length+1+u.length)):(a+u.lines>r&&f(),a+=u.lines,h+=u.length+1,c.push(u))}function f(){a!=0&&(l.push(c.length==1?c[0]:Ot.from(c,h)),h=-1,a=c.length=0)}for(let u of e)O(u);return f(),l.length==1?l[0]:new Ot(l,t)}}D.empty=new le([""],0);function Vg(i){let e=-1;for(let t of i)e+=t.length+1;return e}function zr(i,e,t=0,n=1e9){for(let r=0,s=0,o=!0;s=t&&(a>n&&(l=l.slice(0,n-r)),r0?1:(e instanceof le?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof le?r.text.length:r.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(r instanceof le){let a=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof le?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Sf{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new gn(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class bf{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(D.prototype[Symbol.iterator]=function(){return this.iter()},gn.prototype[Symbol.iterator]=Sf.prototype[Symbol.iterator]=bf.prototype[Symbol.iterator]=function(){return this});let Yg=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function Vi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function de(i,e,t=!0,n=!0){return Eg(i,e,t,n)}function Lg(i){return i>=56320&&i<57344}function Dg(i){return i>=55296&&i<56320}function Re(i,e){let t=i.charCodeAt(e);if(!Dg(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return Lg(n)?(t-55296<<10)+(n-56320)+65536:t}function oa(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function ft(i){return i<65536?1:2}const Jo=/\r\n?|\n/;var Se=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(Se||(Se={}));class Qt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=l}else{if(n!=Se.Simple&&h>=e&&(n==Se.TrackDel&&re||n==Se.TrackBefore&&re))return null;if(h>e||h==e&&t<0&&!l)return e==r||t<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let n=0,r=0;n=0&&r<=t&&l>=e)return rt?"cover":!0;r=l}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Qt(e)}static create(e){return new Qt(e)}}class ce extends Qt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return el(this,(t,n,r,s,o)=>e=e.replace(r,r+(n-t),o),!1),e}mapDesc(e,t=!1){return tl(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length0&&Bt(n,t,s.text),s.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;of||O<0||f>t)throw new RangeError(`Invalid change range ${O} to ${f} (in doc of length ${t})`);let d=u?typeof u=="string"?D.of(u.split(n||Jo)):u:D.empty,m=d.length;if(O==f&&m==0)return;Oo&&ke(r,O-o,-1),ke(r,f-O,m),Bt(s,r,d),o=f}}return h(e),a(!l),l}static empty(e){return new ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length=0&&t<=0&&t==i[r+1]?i[r]+=e:r>=0&&e==0&&i[r]==0?i[r+1]+=t:n?(i[r]+=e,i[r+1]+=t):i.push(e,t)}function Bt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(r,h,s,c,O),r=h,s=c}}}function tl(i,e,t,n=!1){let r=[],s=n?[]:null,o=new Xn(i),l=new Xn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);ke(r,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let O=Math.min(c,l.len);h+=O,c-=O,l.forward(O)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>h),s.forward2(a),o.forward(a)}}}}class Xn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?D.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?D.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Lt{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new Lt(n,r,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,n,r){return new Lt(e,t,n,r)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>Lt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;rr.from-s.from),t=e.indexOf(n);for(let r=1;rs.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function xf(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let la=0;class C{constructor(e,t,n,r,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=la++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new C(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:aa),!!e.static,e.enables)}of(e){return new _r([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _r(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _r(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function aa(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}class _r{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=la++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?h=!0:((t=e[O.id])!==null&&t!==void 0?t:1)&1||c.push(e[O.id]);return{create(O){return O.values[o]=n(O),1},update(O,f){if(a&&f.docChanged||h&&(f.docChanged||f.selection)||il(O,c)){let u=n(O);if(l?!Zh(u,O.values[o],r):!r(u,O.values[o]))return O.values[o]=u,1}return 0},reconfigure:(O,f)=>{let u,d=f.config.address[s];if(d!=null){let m=es(f,d);if(this.dependencies.every(g=>g instanceof C?f.facet(g)===O.facet(g):g instanceof ye?f.field(g,!1)==O.field(g,!1):!0)||(l?Zh(u=n(O),m,r):r(u=n(O),m)))return O.values[o]=m,0}else u=n(O);return O.values[o]=u,1}}}get extension(){return this}}function Zh(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),r=t.map(a=>a.type),s=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let h=[];for(let c=0;cn===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ur).find(n=>n.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,r)=>{let s=n.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[t]=o,1)},reconfigure:(n,r)=>{let s=n.facet(ur),o=r.facet(ur),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):r.config.address[this.id]!=null?(n.values[t]=r.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,ur.of({field:this,create:e})]}get extension(){return this}}const ai={lowest:4,low:3,default:2,high:1,highest:0};function on(i){return e=>new kf(e,i)}const _t={highest:on(ai.highest),high:on(ai.high),default:on(ai.default),low:on(ai.low),lowest:on(ai.lowest)};class kf{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class Xs{of(e){return new nl(this,e)}reconfigure(e){return Xs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class nl{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class Jr{constructor(e,t,n,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let r=[],s=Object.create(null),o=new Map;for(let f of Gg(e,t,o))f instanceof ye?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],h=[];for(let f of r)l[f.id]=h.length<<1,h.push(u=>f.slot(u));let c=n==null?void 0:n.config.facets;for(let f in s){let u=s[f],d=u[0].facet,m=c&&c[f]||[];if(u.every(g=>g.type==0))if(l[d.id]=a.length<<1|1,aa(m,u))a.push(n.facet(d));else{let g=d.combine(u.map(Q=>Q.value));a.push(n&&d.compare(g,n.facet(d))?n.facet(d):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(Q=>g.dynamicSlot(Q)));l[d.id]=h.length<<1,h.push(g=>Bg(g,d,u))}}let O=h.map(f=>f(l));return new Jr(e,o,O,l,a,s)}}function Gg(i,e,t){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let h=n[a].indexOf(o);h>-1&&n[a].splice(h,1),o instanceof nl&&t.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let h of o)s(h,l);else if(o instanceof nl){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,l)}else if(o instanceof kf)s(o.inner,o.prec);else if(o instanceof ye)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof _r)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,ai.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,l)}}return s(i,ai.default),n.reduce((o,l)=>o.concat(l))}function Qn(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let r=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|r}function es(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const Pf=C.define(),rl=C.define({combine:i=>i.some(e=>e),static:!0}),$f=C.define({combine:i=>i.length?i[0]:void 0,static:!0}),wf=C.define(),vf=C.define(),Tf=C.define(),Xf=C.define({combine:i=>i.length?i[0]:!1});class bt{constructor(e,t){this.type=e,this.value=t}static define(){return new Ig}}class Ig{of(e){return new bt(this,e)}}class Ug{constructor(e){this.map=e}of(e){return new W(this,e)}}class W{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new W(this.type,t)}is(e){return this.type==e}static define(e={}){return new Ug(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(t);s&&n.push(s)}return n}}W.reconfigure=W.define();W.appendConfig=W.define();class he{constructor(e,t,n,r,s,o){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&xf(n,t.newLength),s.some(l=>l.type==he.time)||(this.annotations=s.concat(he.time.of(Date.now())))}static create(e,t,n,r,s,o){return new he(e,t,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(he.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}he.time=bt.define();he.userEvent=bt.define();he.addToHistory=bt.define();he.remote=bt.define();function Ng(i,e){let t=[];for(let n=0,r=0;;){let s,o;if(n=i[n]))s=i[n++],o=i[n++];else if(r=0;r--){let s=n[r](i);s instanceof he?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof he?i=s[0]:i=Rf(e,Ai(s),!1)}return i}function Hg(i){let e=i.startState,t=e.facet(Tf),n=i;for(let r=t.length-1;r>=0;r--){let s=t[r](i);s&&Object.keys(s).length&&(n=Cf(n,sl(e,s,i.changes.newLength),!0))}return n==i?i:he.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}const Kg=[];function Ai(i){return i==null?Kg:Array.isArray(i)?i:[i]}var te=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(te||(te={}));const Jg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ol;try{ol=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function e0(i){if(ol)return ol.test(i);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Jg.test(t)))return!0}return!1}function t0(i){return e=>{if(!/\S/.test(e))return te.Space;if(e0(e))return te.Word;for(let t=0;t-1)return te.Word;return te.Other}}class Y{constructor(e,t,n,r,s,o){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(h,a)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(W.reconfigure)?(t=null,n=l.value):l.is(W.appendConfig)&&(t=null,n=Ai(n).concat(l.value));let s;t?s=e.startState.values.slice():(t=Jr.resolve(n,r,this),s=new Y(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(rl)?e.newSelection:e.newSelection.asSingle();new Y(t,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),s=[n.range],o=Ai(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return Y.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Jr.resolve(e.extensions||[],new Map),n=e.doc instanceof D?e.doc:D.of((e.doc||"").split(t.staticFacet(Y.lineSeparator)||Jo)),r=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return xf(r,n.length),t.staticFacet(rl)||(r=r.asSingle()),new Y(t,n,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Y.tabSize)}get lineBreak(){return this.facet(Y.lineSeparator)||` diff --git a/veadk/webui/assets/MarkdownPromptEditor-35Gi6h5-.js b/veadk/webui/assets/MarkdownPromptEditor-BdhMqVzS.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor-35Gi6h5-.js rename to veadk/webui/assets/MarkdownPromptEditor-BdhMqVzS.js index 9abd8d872..a75a75bf4 100644 --- a/veadk/webui/assets/MarkdownPromptEditor-35Gi6h5-.js +++ b/veadk/webui/assets/MarkdownPromptEditor-BdhMqVzS.js @@ -1,4 +1,4 @@ -var px=Object.defineProperty;var mx=(t,e,n)=>e in t?px(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var L=(t,e,n)=>mx(t,typeof e!="symbol"?e+"":e,n);import{s as Cd,t as yx,o as xx,q as Cc,J as _x,a0 as vx,C as Cx,L as E,D as R,a as Ze,W as xt,U as Ln,f as $e,p as bx,_ as sn,K as Or,i as Wl,$ as wx,P as Ru,Z as Fu,h as Sx,k as Ex,Y as Fp,X as bc,I as Tx,c as kx,j as Hp,m as Vp,b as Nx,T as Mx,l as Ox,R as N,n as bd,d as wd,V as rt,H as pn,Q as xs,N as $a,M as Ax,e as Sd,E as nn,G as ol,r as Hu,F as gr,S as Jn,O as jt,g as ni,u as Lx,y as Px,w as $x,x as Ix,v as Dx,B as Rx,z as Fx,A as Hx}from"./index-CB_XKkbG.js";const Vx={}.hasOwnProperty;function Bp(t,e){let n=-1,r;if(e.extensions)for(;++ne in t?px(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var L=(t,e,n)=>mx(t,typeof e!="symbol"?e+"":e,n);import{s as Cd,t as yx,o as xx,q as Cc,J as _x,a0 as vx,C as Cx,L as E,D as R,a as Ze,W as xt,U as Ln,f as $e,p as bx,_ as sn,K as Or,i as Wl,$ as wx,P as Ru,Z as Fu,h as Sx,k as Ex,Y as Fp,X as bc,I as Tx,c as kx,j as Hp,m as Vp,b as Nx,T as Mx,l as Ox,R as N,n as bd,d as wd,V as rt,H as pn,Q as xs,N as $a,M as Ax,e as Sd,E as nn,G as ol,r as Hu,F as gr,S as Jn,O as jt,g as ni,u as Lx,y as Px,w as $x,x as Ix,v as Dx,B as Rx,z as Fx,A as Hx}from"./index-D88Zv3M6.js";const Vx={}.hasOwnProperty;function Bp(t,e){let n=-1,r;if(e.extensions)for(;++nstrong{min-width:0;flex:1}.aw-version-badge{flex:0 0 auto;padding:2px 6px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .5);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;line-height:1.2}.aw-draft-badge{flex:0 0 auto;padding:2px 7px;border-radius:999px;background:#f0ebe0;color:#675332;font-size:10px;font-weight:680;line-height:1.2}.aw-draft-badge.is-deploying{background:#e4eaf2;color:#2d5080}.aw-draft-badge.is-error{background:#dc28281f;color:hsl(var(--destructive))}.aw-draft-badge.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.aw-agent-copy strong,.aw-agent-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-agent-copy strong{font-size:13px;font-weight:650}.aw-agent-copy small{color:hsl(var(--muted-foreground));font-size:11px}.aw-agent-item>svg{width:14px;height:14px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .14s ease,transform .14s ease}.aw-agent-item:hover>svg,.aw-agent-item.is-active>svg{opacity:1}.aw-agent-item:hover>svg{transform:translate(2px)}.aw-agent-check{position:relative}.aw-agent-check>input{position:absolute;width:1px;height:1px;opacity:0}.aw-check-mark{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--foreground) / .22);border-radius:5px;background:hsl(var(--background));color:transparent}.aw-check-mark svg{width:11px;height:11px}.aw-agent-check:has(input:checked) .aw-check-mark{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.aw-agent-check:has(input:focus-visible){outline:2px solid hsl(var(--ring) / .42);outline-offset:-2px}.aw-list-empty{min-height:0;flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding:28px 12px;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.aw-list-error{display:flex;flex-direction:column;align-items:center;gap:10px}.aw-list-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px}.aw-create-card{width:100%;min-height:48px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:8px;margin-top:12px;border:1px dashed hsl(var(--foreground) / .28);border-radius:14px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:600;transition:border-color .16s ease,color .16s ease}.aw-create-card:hover:not(:disabled){border-color:hsl(var(--foreground) / .5);color:hsl(var(--foreground))}.aw-create-card svg{width:15px;height:15px}.aw-list-count{flex:0 0 auto;padding-top:10px;color:hsl(var(--muted-foreground));font-size:10.5px;text-align:center}.aw-main{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:hsl(var(--background))}.aw-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.aw-empty-selection{align-items:center;justify-content:center}.aw-empty-selection p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.aw-agent-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 24px}.aw-agent-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-head-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.aw-head-delete.studio-update-action{border:1px solid hsl(var(--destructive) / .34);background:#ffffffc2;color:hsl(var(--destructive));-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}.aw-head-delete.studio-update-action:hover:not(:disabled){border:1px solid hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.aw-agent-title-row{gap:8px}.aw-agent-head h2,.aw-eval-head h2{overflow:hidden;font-size:20px;font-weight:720;text-overflow:ellipsis;white-space:nowrap}.aw-agent-title-row>span,.aw-eval-head>div>span{padding:2px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px}.aw-agent-head p{max-width:720px;overflow:hidden;font-size:13.5px;text-overflow:ellipsis;white-space:nowrap}.aw-update{align-self:center}.aw-update-wrap{position:relative;align-self:center;display:inline-flex;border-radius:999px}.aw-update-wrap.is-disabled{cursor:not-allowed}.aw-update-wrap.is-disabled .aw-update{cursor:inherit}.aw-update-spinner{width:14px;height:14px;flex-basis:14px;border-color:currentColor;border-right-color:transparent}.aw-update-disabled-reason{position:absolute;z-index:20;bottom:calc(100% + 8px);left:50%;width:max-content;max-width:260px;padding:7px 10px;border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));font-size:11.5px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translate(-50%,3px);transition:opacity .14s ease,transform .14s ease}.aw-update-wrap.is-disabled:hover .aw-update-disabled-reason,.aw-update-wrap.is-disabled:focus-visible .aw-update-disabled-reason{opacity:1;transform:translate(-50%)}.aw-update-wrap:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}@media (prefers-reduced-motion: reduce){.aw-update-disabled-reason{transition:none}}.aw-talk svg{width:15px;height:15px}.aw-agent-tabs{flex:0 0 auto;display:flex;gap:24px;margin:0 24px;padding:0;border-bottom:1px solid hsl(var(--border))}.aw-agent-tabs button{position:relative;min-height:42px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:14px;font-weight:580}.aw-agent-tabs button.is-active{color:hsl(var(--foreground))}.aw-agent-tabs button.is-active:after{content:"";position:absolute;right:0;bottom:-1px;left:0;height:2px;border-radius:2px 2px 0 0;background:hsl(var(--foreground))}.aw-agent-tabs button:disabled{cursor:default}.aw-content{flex:1;min-height:0;overflow-y:auto;margin-top:14px;padding:0 24px 80px}.aw-basic-stack,.aw-integration-stack{display:flex;flex-direction:column;gap:16px}.aw-integration-intro h3,.aw-integration-intro p,.aw-integration-panel h3,.aw-integration-panel h4,.aw-integration-panel dl,.aw-integration-panel dd{margin:0}.aw-integration-intro h3{font-size:15px;font-weight:620}.aw-integration-intro p{margin-top:4px;color:hsl(var(--muted-foreground));font-size:12.5px}.aw-integration-body{display:flex;min-width:0;flex-direction:column;gap:12px}.aw-integration-protocol-tabs{position:relative;display:grid;width:min(240px,100%);height:36px;box-sizing:border-box;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;padding:3px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--secondary))}.aw-integration-protocol-slider{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc((100% - 9px)/2);border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .05);transition:transform .24s cubic-bezier(.22,1,.36,1)}.aw-integration-protocol-tabs.is-a2a .aw-integration-protocol-slider{transform:translate(calc(100% + 3px))}.aw-integration-protocol-tabs button{position:relative;z-index:1;min-width:0;min-height:28px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:550;transition:background-color .16s ease,color .16s ease}.aw-integration-protocol-tabs button:hover{background:hsl(var(--panel) / .45);color:hsl(var(--foreground))}.aw-integration-protocol-tabs button[aria-selected=true]{color:hsl(var(--foreground));font-weight:620}.aw-integration-protocol-tabs button:focus-visible{outline:2px solid hsl(var(--ring) / .62);outline-offset:1px}.aw-integration-panel{min-width:0;padding:20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.aw-integration-panel.has-example{display:flex;flex-direction:column;gap:20px}.aw-integration-panel header{display:flex;align-items:center;margin-bottom:4px}.aw-integration-panel h3{color:hsl(var(--foreground));font-size:14px;font-weight:620}.aw-integration-panel dl{display:grid;align-content:start;gap:12px}.aw-integration-panel dl>div{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:start;gap:12px}.aw-integration-panel dt{color:hsl(var(--muted-foreground));font-size:12px}.aw-integration-panel dd{min-width:0;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:12.5px;line-height:1.55}.aw-integration-secret{display:inline-flex;min-width:0;flex-wrap:wrap;align-items:center;gap:6px}.aw-integration-secret-value{min-width:52px;overflow-wrap:anywhere}.aw-integration-secret-toggle{display:inline-grid;width:28px;height:28px;flex:0 0 28px;padding:0;place-items:center;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer}.aw-integration-secret-toggle:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.aw-integration-secret-toggle:focus-visible{outline:2px solid hsl(var(--ring) / .62);outline-offset:1px}.aw-integration-secret-toggle:disabled{cursor:wait;opacity:.62}.aw-integration-secret-toggle svg,.aw-integration-secret-toggle .loading-gap-spinner{width:16px;height:16px}.aw-integration-secret-error{flex-basis:100%;color:hsl(var(--destructive));font-size:12px;line-height:1.45}.aw-integration-example{min-width:0}.aw-integration-example h4{margin-bottom:8px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.aw-integration-example-code.md{min-width:0;font-size:12px}.aw-integration-example-code.md pre{max-height:360px;margin:0;overflow:auto;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--secondary))}.aw-integration-example-code.md pre code{display:block;min-width:max-content;padding:14px 16px;line-height:1.55}.aw-integration-error{display:flex;align-items:center;gap:8px;min-height:36px;padding:10px 12px;border-radius:8px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:12.5px}.aw-integration-error{justify-content:space-between;color:hsl(var(--destructive))}.aw-integration-error button{min-height:28px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit}.aw-canvas-card,.aw-details-card{min-width:0;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel))}.aw-canvas-card{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.aw-details-card{overflow:hidden}.aw-deploy-progress-card{width:100%;min-width:0;box-sizing:border-box;padding:24px 26px 26px;border:1px solid hsl(var(--border));border-radius:18px;background:hsl(var(--panel))}.aw-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.aw-deploy-progress-head,.aw-deploy-progress-head>div,.aw-deploy-progress-icon{display:flex;align-items:center}.aw-deploy-progress-head{justify-content:space-between;gap:20px}.aw-deploy-progress-head>div{min-width:0;gap:12px}.aw-deploy-progress-head>div>div{min-width:0}.aw-deploy-progress-icon{width:34px;height:34px;flex:0 0 34px;justify-content:center;border-radius:50%;background:#eaeff5;color:#295189}.aw-deploy-progress-icon svg{width:17px;height:17px}.aw-deploy-progress-card.is-success .aw-deploy-progress-icon{background:#e8f2ee;color:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-icon,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-icon{background:#f5ecea;color:#8d3d34}.aw-deploy-progress-head h3{margin:0;font-size:14px;font-weight:700}.aw-deploy-progress-head p{margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45;overflow-wrap:anywhere}.aw-deploy-progress-head>strong{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:12px;font-weight:650}.aw-deploy-progress-track{height:5px;margin-top:18px;overflow:hidden;border-radius:999px;background:hsl(var(--secondary))}.aw-deploy-progress-track span{display:block;height:100%;border-radius:inherit;background:#295189;transition:width .32s cubic-bezier(.22,1,.36,1)}.aw-deploy-progress-card.is-success .aw-deploy-progress-track span{background:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-track span,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-track span{background:#8d3d34}.aw-deploy-steps{margin:22px 0 0;padding:0;list-style:none}.aw-deploy-steps li{position:relative;min-width:0;display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;padding:0 0 18px}.aw-deploy-steps li:last-child{padding-bottom:0}.aw-deploy-steps li:not(:last-child):after{content:"";position:absolute;top:28px;bottom:0;left:13px;width:2px;border-radius:999px;background:hsl(var(--border))}.aw-deploy-steps li.is-done:not(:last-child):after{background:#9dcdb8}.aw-deploy-step-marker{position:relative;z-index:1;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:680}.aw-deploy-step-marker svg{width:14px;height:14px}.aw-deploy-steps li.is-done .aw-deploy-step-marker{border-color:#b3dbca;background:#e8f2ee;color:#2d7656}.aw-deploy-steps li.is-active .aw-deploy-step-marker{border-color:#9eb3d1;background:#eaeff5;color:#295189}.aw-deploy-steps li.is-failed .aw-deploy-step-marker{border-color:#dcbfbc;background:#f5ecea;color:#8d3d34}.aw-deploy-step-copy{min-width:0;padding-top:2px}.aw-deploy-step-copy strong{display:block;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:620;line-height:1.4}.aw-deploy-step-copy p{min-width:0;margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.55;overflow-wrap:anywhere;word-break:break-word}.aw-deploy-steps li.is-done .aw-deploy-step-copy strong,.aw-deploy-steps li.is-active .aw-deploy-step-copy strong,.aw-deploy-steps li.is-failed .aw-deploy-step-copy strong{color:hsl(var(--foreground))}.aw-deploy-steps li.is-active .aw-deploy-step-copy p{color:hsl(var(--foreground) / .78)}.aw-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.aw-card-head{justify-content:space-between;gap:12px;min-height:48px;padding:0 16px}.aw-card-head strong{font-size:13px;font-weight:680}.aw-card-head span{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-canvas{height:220px;min-height:0;border-top:1px solid hsl(var(--border))}.aw-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;border:0;background:#f9f8f5}.aw-canvas .abc-canvas{flex:1;min-height:0}.aw-canvas .react-flow__controls{transform:scale(.86);transform-origin:bottom left}.aw-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:4px 16px 14px}.aw-facts>div{min-height:39px;display:grid;grid-template-columns:minmax(88px,.72fr) minmax(0,1.28fr);align-items:center;gap:12px;border-top:1px solid hsl(var(--border) / .72)}.aw-facts>div:nth-child(2n){padding-left:20px}.aw-facts>div:nth-child(odd){padding-right:20px}.aw-facts dt{color:hsl(var(--muted-foreground));font-size:11.5px}.aw-facts dd{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-weight:600;text-align:right;text-overflow:ellipsis;white-space:nowrap}.aw-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.aw-status-dot{width:6px;height:6px;display:inline-block;margin-right:6px;border-radius:50%;background:#358d67}.aw-section-head{justify-content:space-between;gap:18px;margin-bottom:16px}.aw-section-head h3{font-size:17px;font-weight:700}.aw-case-filters{width:fit-content;gap:3px;padding:3px;border-radius:8px;background:hsl(var(--secondary) / .62)}.aw-case-filter-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:16px}.aw-case-filter-stack{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.aw-case-source-filters{display:flex;flex-wrap:wrap;gap:6px}.aw-case-source-filters button{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.aw-case-source-filters button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.aw-case-source-filters button.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.aw-case-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-search{width:min(360px,46%);min-width:260px;height:40px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .16s ease,box-shadow .16s ease}.aw-case-search:focus-within{border-color:hsl(var(--foreground) / .32);box-shadow:0 0 0 3px hsl(var(--foreground) / .045)}.aw-case-search svg{width:15px;height:15px;color:hsl(var(--muted-foreground))}.aw-case-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.aw-case-search input::placeholder{color:hsl(var(--muted-foreground) / .8)}.aw-case-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-filters button{min-height:30px;padding:0 12px;border-radius:6px;font-size:12.5px}.aw-case-filters button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.aw-case-table{overflow-x:auto;border:1px solid hsl(var(--border));border-radius:12px}.aw-case-row{min-width:870px;min-height:86px;display:grid;grid-template-columns:minmax(180px,.78fr) minmax(250px,1.16fr) 80px minmax(220px,.94fr) 48px;align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:13px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.aw-case-action-head{text-align:center}.aw-case-text,.aw-case-output,.aw-case-reason{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-score{color:hsl(var(--foreground));font-size:13px;font-weight:650;line-height:1.5}.aw-case-reason p{display:-webkit-box;overflow:hidden;margin:0;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-reason.is-expanded p{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-title-line{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{flex:1;min-width:0}.aw-case-actions{min-width:0;display:flex;justify-content:center}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-time{color:hsl(var(--foreground) / .62)!important}.aw-case-delete{width:28px;height:28px;flex:0 0 28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .15s ease,border-color .15s ease,color .15s ease}.aw-case-delete:hover:not(:disabled){border-color:hsl(var(--destructive) / .18);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive))}.aw-case-delete:active:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.aw-deployment-panel{width:100%;box-sizing:border-box;margin:0}.aw-settings-card{padding:18px;border:1px solid hsl(var(--border));border-radius:14px}.aw-optimizations{display:flex;flex-direction:column;gap:16px}.aw-optimization-intro h3{margin:0;color:hsl(var(--foreground));font-size:17px;font-weight:650}.aw-optimization-intro p{margin:5px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.aw-optimization-state{min-height:92px;display:flex;align-items:center;justify-content:center;gap:9px;padding:20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .16);color:hsl(var(--muted-foreground));font-size:13px;text-align:center}.aw-optimization-state.is-error{color:hsl(var(--destructive))}.aw-optimization-state button{min-height:28px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-weight:600}.aw-optimization-table-wrap{overflow-x:auto;border:1px solid hsl(var(--border));border-radius:12px}.aw-optimization-table{width:100%;min-width:760px;border-collapse:collapse;table-layout:fixed;color:hsl(var(--foreground));font-size:13px}.aw-optimization-table th,.aw-optimization-table td{padding:14px 16px;border-top:1px solid hsl(var(--border));text-align:left;vertical-align:top}.aw-optimization-table th{padding-block:11px;border-top:0;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.aw-optimization-table th:first-child,.aw-optimization-table td:first-child{width:108px}.aw-optimization-table th:nth-child(2),.aw-optimization-table td:nth-child(2){width:142px}.aw-optimization-module{color:hsl(var(--foreground));font-size:13px;font-weight:620;line-height:1.55}.aw-optimization-list{margin:0;padding:0;list-style:none}.aw-optimization-list li{position:relative;padding-left:16px}.aw-optimization-list li+li{margin-top:13px;padding-top:13px;border-top:1px dashed hsl(var(--border))}.aw-optimization-list li:before{position:absolute;top:6px;left:1px;width:5px;height:5px;border-radius:50%;background:hsl(var(--primary) / .72);content:""}.aw-optimization-list li+li:before{top:19px}.aw-optimization-list strong{display:block;font-size:13.5px;font-weight:650;line-height:1.45}.aw-optimization-list p{margin:5px 0 0;color:hsl(var(--muted-foreground));line-height:1.55}.aw-priority{font-size:13px;font-weight:700;line-height:1.5}.aw-priority.is-high{color:hsl(var(--destructive))}.aw-priority.is-medium{color:#93591f}.aw-priority.is-low{color:#28674c}.aw-readonly-config{margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.aw-readonly-config>div{min-width:0;padding:12px 14px;border-radius:10px;background:hsl(var(--secondary) / .42)}.aw-readonly-config dt{color:hsl(var(--muted-foreground));font-size:11px}.aw-readonly-config dd{margin:5px 0 0;color:hsl(var(--foreground));font-size:12px;font-weight:600}.aw-readonly-config dd.is-ready{color:#1d7c40}.aw-basic-actions{position:absolute;z-index:8;bottom:20px;left:50%;display:flex;align-items:center;justify-content:center;gap:10px;padding:0;border:0;border-radius:10px;background:transparent;box-shadow:none;transform:translate(-50%)}.aw-eval-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;justify-content:space-between;gap:20px;padding:14px 24px}.aw-evaluation-glass{position:absolute;z-index:12;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:hsl(var(--background) / .44);color:hsl(var(--foreground));-webkit-backdrop-filter:blur(9px) saturate(118%);backdrop-filter:blur(9px) saturate(118%);transition:background .18s ease,backdrop-filter .18s ease}.aw-evaluation-glass:hover{background:hsl(var(--background) / .52);-webkit-backdrop-filter:blur(11px) saturate(125%);backdrop-filter:blur(11px) saturate(125%)}.aw-evaluation-glass span{padding:8px 13px;border:1px solid hsl(var(--border) / .82);border-radius:999px;background:hsl(var(--background) / .7);box-shadow:0 8px 24px hsl(var(--foreground) / .07);font-size:12.5px;font-weight:620;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.aw-eval-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-run{min-height:38px;padding:0 14px;border-radius:9px}.aw-eval-setup{width:min(900px,100%);margin:0 auto;display:flex;flex-direction:column;gap:14px}.aw-eval-block{min-width:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px}.aw-eval-agent-grid{max-height:230px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow-y:auto;padding:0 16px 16px}.aw-eval-agent-grid>label{min-height:52px;display:flex;align-items:center;gap:10px;padding:0 12px;border:1px solid hsl(var(--border) / .82);border-radius:10px;cursor:pointer}.aw-eval-agent-grid input,.aw-metric-list input{width:15px;height:15px;accent-color:hsl(var(--foreground))}.aw-eval-agent-grid label>span{min-width:0;display:flex;flex-direction:column;gap:3px}.aw-eval-agent-grid strong,.aw-eval-agent-grid small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-eval-agent-grid strong{font-size:12px;font-weight:620}.aw-eval-agent-grid small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-eval-setting-grid{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(260px,.82fr);gap:14px}.aw-eval-fields{display:flex;flex-direction:column;gap:13px;padding:0 16px 16px}.aw-eval-fields label{min-height:36px;display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:10px}.aw-eval-fields label>span,.aw-eval-fields label>small{color:hsl(var(--muted-foreground));font-size:11px}.aw-eval-fields select{width:100%;height:34px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11.5px}.aw-metric-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 16px 16px}.aw-metric-list label{min-height:40px;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid hsl(var(--border) / .82);border-radius:9px;cursor:pointer;font-size:11.5px}.aw-eval-history{width:min(820px,100%);margin:0 auto}.aw-history-list{display:flex;flex-direction:column;gap:9px}.aw-history-list>button{width:100%;min-height:68px;display:grid;grid-template-columns:minmax(0,1fr) auto auto 16px;align-items:center;gap:16px;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:11px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left}.aw-history-list>button:hover{border-color:hsl(var(--foreground) / .2)}.aw-history-list>button>span:first-child,.aw-history-score{display:flex;flex-direction:column;gap:4px}.aw-history-list strong{font-size:12px}.aw-history-list small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-history-score{align-items:flex-end}.aw-history-score strong{font-size:17px}.aw-complete{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;background:#3c866617;color:#28674c;font-size:10.5px;font-weight:620}.aw-complete svg{width:12px;height:12px}.aw-results-empty{min-height:210px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));text-align:center}.aw-results-empty strong{color:hsl(var(--foreground));font-size:12.5px}.aw-results-empty span{font-size:11.5px}@media (max-width: 980px){.aw-workspace{grid-template-columns:260px minmax(0,1fr)}.aw-eval-setting-grid{grid-template-columns:minmax(0,1fr)}.aw-case-row{min-width:790px;grid-template-columns:minmax(160px,.78fr) minmax(220px,1fr) 72px minmax(180px,.82fr) 48px}}@media (max-width: 720px){.aw-view-tabs{padding-inline:16px}.aw-workspace{grid-template-columns:minmax(0,1fr);overflow-y:auto}.aw-sidebar{height:340px;max-height:340px;box-sizing:border-box;padding:18px 16px}.aw-agent-list{min-height:128px}.aw-main{min-height:620px;overflow:visible}.aw-agent-tabs{gap:18px;margin-inline:16px;overflow-x:auto}.aw-agent-head,.aw-eval-head{padding-inline:16px}.aw-content{overflow:visible;padding-inline:16px}.aw-facts{grid-template-columns:minmax(0,1fr)}.aw-facts>div:nth-child(n){padding-right:0;padding-left:0}.aw-eval-agent-grid,.aw-metric-list{grid-template-columns:minmax(0,1fr)}.aw-case-summary,.aw-case-row{min-width:0;grid-template-columns:minmax(0,1fr)}.aw-case-filter-bar{align-items:stretch;flex-direction:column;gap:12px}.aw-case-search{width:100%;min-width:0}.aw-case-row-head{display:none}.aw-case-cell{position:relative;padding-top:20px}.aw-case-cell:before{content:attr(data-label);position:absolute;top:0;left:0;color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-actions{justify-content:flex-start}.aw-optimization-table{min-width:680px}.aw-readonly-config{grid-template-columns:minmax(0,1fr)}}@media (prefers-reduced-motion: reduce){.aw-integration-protocol-slider{transition:none}.aw-root *,.aw-root *:before,.aw-root *:after{scroll-behavior:auto!important;transition-duration:.01ms!important}}@layer components{._LoadingIndicator_7yl6f_1{position:relative;width:var(--indicator-size, 1em);height:var(--indicator-size, 1em);animation:_rotate_7yl6f_1 var(--indicator-rotate-duration, .8s) linear infinite;transition:opacity .15s ease}._LoadingIndicator_7yl6f_1:before{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border:var(--indicator-stroke, 2px) solid var(--indicator-color, currentcolor);border-radius:50%;content:"";-webkit-mask-image:conic-gradient(rgb(0 0 0 / 0%),rgb(0 0 0));mask-image:conic-gradient(#0000,#000)}._LoadingIndicator_7yl6f_1:after{position:absolute;top:0;left:50%;display:block;width:var(--indicator-stroke, 2px);height:var(--indicator-stroke, 2px);border-radius:100%;margin-left:calc(var(--indicator-stroke, 2px) * -1 / 2);background-color:var(--indicator-color, currentcolor);content:""}@keyframes _rotate_7yl6f_1{0%{transform:rotate(0)}to{transform:rotate(1turn)}}}@layer components{._TransitionGroupChild_1hv1z_1{display:block}}@layer components{._Button_1864l_1{position:relative;display:inline-block;gap:var(--button-gap);flex-shrink:0;height:var(--button-size);padding:0 var(--button-gutter);border-radius:var(--button-radius);cursor:pointer;font-size:var(--button-font-size);font-weight:var(--button-font-weight);line-height:1;transition-duration:var(--transition-duration-basic);transition-property:opacity,color;transition-timing-function:var(--transition-ease-basic);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}._Button_1864l_1:before{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit;content:"";transition-duration:var(--transition-duration-basic);transition-property:opacity,background-color,transform,box-shadow,border-color;transition-timing-function:var(--transition-ease-basic);will-change:transform}._Button_1864l_1:after{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit;content:"";pointer-events:none;transition-duration:var(--transition-duration-basic);transition-property:transform;transition-timing-function:var(--transition-ease-basic);will-change:transform}._Button_1864l_1:focus{outline:none}._Button_1864l_1:focus-visible:after{outline:2px solid var(--button-ring-color, var(--color-ring));outline-offset:var(--button-ring-offset, 2px)}._Button_1864l_1 svg:where(:not([data-no-autosize])){width:var(--button-icon-size);height:var(--button-icon-size)}:where(._Button_1864l_1 svg:where(:not([data-no-autosize])):first-child:not(:only-child)){margin-left:var(--button-icon-offset, -1px)}:where(._Button_1864l_1 svg:where(:not([data-no-autosize])):last-child:not(:only-child)){margin-right:var(--button-icon-offset, -1px)}._Button_1864l_1:where([data-optically-align=start]){margin-inline-start:calc(var(--button-gutter) * -1)}._Button_1864l_1:where([data-optically-align=end]){margin-inline-end:calc(var(--button-gutter) * -1)}._Button_1864l_1:where([data-optically-align=start][data-uniform]){margin-inline-start:calc(((var(--button-size) - var(--button-icon-size)) / 2) * -1)}._Button_1864l_1:where([data-optically-align=end][data-uniform]){margin-inline-end:calc(((var(--button-size) - var(--button-icon-size)) / 2) * -1)}._Button_1864l_1:where([data-size="3xs"]){--button-size: var(--control-size-3xs);--button-gutter: var(--control-gutter-2xs);--button-font-size: var(--control-font-size-sm);--button-icon-size: var(--control-icon-size-xs);--button-gap: var(--button-gap-sm);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 11px;--circular-progress-size: 11px}._Button_1864l_1:where([data-size="2xs"]){--button-size: var(--control-size-2xs);--button-gutter: var(--control-gutter-xs);--button-font-size: var(--control-font-size-sm);--button-icon-size: var(--control-icon-size-sm);--button-gap: var(--button-gap-md);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 12px;--circular-progress-size: 12px}._Button_1864l_1:where([data-size=xs]){--button-size: var(--control-size-xs);--button-gutter: var(--control-gutter-xs);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-sm);--button-gap: var(--button-gap-md);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 13px;--circular-progress-size: 14px}._Button_1864l_1:where([data-size=sm]){--button-size: var(--control-size-sm);--button-gutter: var(--control-gutter-sm);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-md);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 15px;--circular-progress-size: 15px}._Button_1864l_1:where([data-size=md]){--button-size: var(--control-size-md);--button-gutter: var(--control-gutter-md);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-md);--button-icon-offset: -1px;--indicator-size: 16px;--circular-progress-size: 16px}._Button_1864l_1:where([data-size=lg]){--button-size: var(--control-size-lg);--button-gutter: var(--control-gutter-md);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-md);--button-icon-offset: -1px;--indicator-size: 16px;--circular-progress-size: 16px}._Button_1864l_1:where([data-size=xl]){--button-size: var(--control-size-xl);--button-gutter: var(--control-gutter-lg);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-lg);--button-icon-offset: -1px;--indicator-size: 18px;--circular-progress-size: 18px}._Button_1864l_1:where([data-size="2xl"]){--button-size: var(--control-size-2xl);--button-gutter: var(--control-gutter-lg);--button-font-size: var(--control-font-size-lg);--button-icon-size: var(--control-icon-size-lg);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-xl);--button-icon-offset: -2px;--indicator-size: 18px;--circular-progress-size: 18px}._Button_1864l_1:where([data-size="3xl"]){--button-size: var(--control-size-3xl);--button-gutter: var(--control-gutter-xl);--button-font-size: var(--control-font-size-lg);--button-icon-size: var(--control-icon-size-lg);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-xl);--button-icon-offset: -2px;--indicator-size: 20px;--circular-progress-size: 20px}._Button_1864l_1:where([data-gutter-size="2xs"]){--button-gutter: var(--control-gutter-2xs)}._Button_1864l_1:where([data-gutter-size=xs]){--button-gutter: var(--control-gutter-xs)}._Button_1864l_1:where([data-gutter-size=sm]){--button-gutter: var(--control-gutter-sm)}._Button_1864l_1:where([data-gutter-size=md]){--button-gutter: var(--control-gutter-md)}._Button_1864l_1:where([data-gutter-size=lg]){--button-gutter: var(--control-gutter-lg)}._Button_1864l_1:where([data-gutter-size=xl]){--button-gutter: var(--control-gutter-xl)}._Button_1864l_1:where([data-icon-size=sm]){--button-icon-size: var(--control-icon-size-sm)}._Button_1864l_1:where([data-icon-size=md]){--button-icon-size: var(--control-icon-size-md)}._Button_1864l_1:where([data-icon-size=lg]){--button-icon-size: var(--control-icon-size-lg)}._Button_1864l_1:where([data-icon-size=xl]){--button-icon-size: var(--control-icon-size-xl)}._Button_1864l_1:where([data-icon-size="2xl"]){--button-icon-size: var(--control-icon-size-2xl)}._Button_1864l_1:where([data-pill]){--button-radius: var(--radius-full);padding:0 calc(var(--button-gutter) * var(--control-gutter-pill-scaling))}._Button_1864l_1:where([data-block]){width:100%}._Button_1864l_1[data-uniform]{--button-gutter: 0;width:var(--button-size)}._Button_1864l_1[data-variant=ghost]{--button-ring-offset: -1px;color:var(--button-text-color)}._Button_1864l_1[data-variant=ghost]:before{background-color:var(--button-background-color);opacity:0;transform:scale(var(--scale))}._Button_1864l_1[data-variant=ghost][aria-expanded=true],._Button_1864l_1[data-variant=ghost][data-state=open]{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=ghost][aria-expanded=true]:before,._Button_1864l_1[data-variant=ghost][data-state=open]:before{opacity:.6;transform:scale(1)}._Button_1864l_1[data-variant=ghost][data-selected]{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=ghost][data-selected]:before{opacity:1;transform:scale(1)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):hover{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):hover:before{opacity:1;transform:scale(1)}}._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active);opacity:1;transform:scale(var(--scale))}._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=ghost]:where([data-color=primary]){--button-background-color: var(--color-background-primary-ghost-hover);--button-background-color-active: var(--color-background-primary-ghost-active);--button-text-color: var(--color-text-primary-ghost);--button-text-color-hover: var(--color-text-primary-ghost-hover);--button-ring-color: var(--color-ring-primary-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=secondary]){--button-background-color: var(--color-background-secondary-ghost-hover);--button-background-color-active: var(--color-background-secondary-ghost-active);--button-text-color: var(--color-text-secondary-ghost);--button-text-color-hover: var(--color-text-secondary-ghost-hover);--button-ring-color: var(--color-ring-secondary-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=danger]){--button-background-color: var(--color-background-danger-ghost-hover);--button-background-color-active: var(--color-background-danger-ghost-active);--button-text-color: var(--color-text-danger-ghost);--button-text-color-hover: var(--color-text-danger-ghost-hover);--button-ring-color: var(--color-ring-danger-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=success]){--button-background-color: var(--color-background-success-ghost-hover);--button-background-color-active: var(--color-background-success-ghost-active);--button-text-color: var(--color-text-success-ghost);--button-text-color-hover: var(--color-text-success-ghost-hover);--button-ring-color: var(--color-ring-success-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=warning]){--button-background-color: var(--color-background-warning-ghost-hover);--button-background-color-active: var(--color-background-warning-ghost-active);--button-text-color: var(--color-text-warning-ghost);--button-text-color-hover: var(--color-text-warning-ghost-hover);--button-ring-color: var(--color-ring-warning-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=caution]){--button-background-color: var(--color-background-caution-ghost-hover);--button-background-color-active: var(--color-background-caution-ghost-active);--button-text-color: var(--color-text-caution-ghost);--button-text-color-hover: var(--color-text-caution-ghost-hover);--button-ring-color: var(--color-ring-caution-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=info]){--button-background-color: var(--color-background-info-ghost-hover);--button-background-color-active: var(--color-background-info-ghost-active);--button-text-color: var(--color-text-info-ghost);--button-text-color-hover: var(--color-text-info-ghost-hover);--button-ring-color: var(--color-ring-info-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=discovery]){--button-background-color: var(--color-background-discovery-ghost-hover);--button-background-color-active: var(--color-background-discovery-ghost-active);--button-text-color: var(--color-text-discovery-ghost);--button-text-color-hover: var(--color-text-discovery-ghost-hover);--button-ring-color: var(--color-ring-discovery-ghost)}._Button_1864l_1[data-variant=solid]{color:var(--button-text-color)}._Button_1864l_1[data-variant=solid]:before{background-color:var(--button-background-color)}._Button_1864l_1[data-variant=solid][aria-expanded=true]:before,._Button_1864l_1[data-variant=solid][data-state=open]:before,._Button_1864l_1[data-variant=solid][data-selected]:before{background-color:var(--button-background-color-hover)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):hover:before{background-color:var(--button-background-color-hover)}}._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active)}._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):active:before,._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=solid]:where([data-color=primary]){--button-background-color: var(--color-background-primary-solid);--button-background-color-hover: var(--color-background-primary-solid-hover);--button-background-color-active: var(--color-background-primary-solid-active);--button-text-color: var(--color-text-primary-solid);--button-ring-color: var(--color-ring-primary-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=secondary]){--button-background-color: var(--color-background-secondary-solid);--button-background-color-hover: var(--color-background-secondary-solid-hover);--button-background-color-active: var(--color-background-secondary-solid-active);--button-text-color: var(--color-text-secondary-solid);--button-ring-color: var(--color-ring-secondary-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=success]){--button-background-color: var(--color-background-success-solid);--button-background-color-hover: var(--color-background-success-solid-hover);--button-background-color-active: var(--color-background-success-solid-active);--button-text-color: var(--color-text-success-solid);--button-ring-color: var(--color-ring-success-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=danger]){--button-background-color: var(--color-background-danger-solid);--button-background-color-hover: var(--color-background-danger-solid-hover);--button-background-color-active: var(--color-background-danger-solid-active);--button-text-color: var(--color-text-danger-solid);--button-ring-color: var(--color-ring-danger-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=warning]){--button-background-color: var(--color-background-warning-solid);--button-background-color-hover: var(--color-background-warning-solid-hover);--button-background-color-active: var(--color-background-warning-solid-active);--button-text-color: var(--color-text-warning-solid);--button-ring-color: var(--color-ring-warning-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=caution]){--button-background-color: var(--color-background-caution-solid);--button-background-color-hover: var(--color-background-caution-solid-hover);--button-background-color-active: var(--color-background-caution-solid-active);--button-text-color: var(--color-text-caution-solid);--button-ring-color: var(--color-ring-caution-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=info]){--button-background-color: var(--color-background-info-solid);--button-background-color-hover: var(--color-background-info-solid-hover);--button-background-color-active: var(--color-background-info-solid-active);--button-text-color: var(--color-text-info-solid);--button-ring-color: var(--color-ring-info-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=discovery]){--button-background-color: var(--color-background-discovery-solid);--button-background-color-hover: var(--color-background-discovery-solid-hover);--button-background-color-active: var(--color-background-discovery-solid-active);--button-text-color: var(--color-text-discovery-solid);--button-ring-color: var(--color-ring-discovery-solid)}._Button_1864l_1[data-variant=soft]{color:var(--button-text-color)}._Button_1864l_1[data-variant=soft]:before{background-color:var(--button-background-color)}._Button_1864l_1[data-variant=soft][aria-expanded=true]:before,._Button_1864l_1[data-variant=soft][data-state=open]:before,._Button_1864l_1[data-variant=soft][data-selected]:before{background-color:var(--button-background-color-hover)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):hover:before{background-color:var(--button-background-color-hover)}}._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active)}._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):active:before,._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=soft]:where([data-color=primary]){--button-background-color: var(--color-background-primary-soft-alpha);--button-background-color-hover: var(--color-background-primary-soft-alpha-hover);--button-background-color-active: var(--color-background-primary-soft-alpha-active);--button-text-color: var(--color-text-primary-soft);--button-ring-color: var(--color-ring-primary-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=secondary]){--button-background-color: var(--color-background-secondary-soft-alpha);--button-background-color-hover: var(--color-background-secondary-soft-alpha-hover);--button-background-color-active: var(--color-background-secondary-soft-alpha-active);--button-text-color: var(--color-text-secondary-soft);--button-ring-color: var(--color-ring-secondary-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=success]){--button-background-color: var(--color-background-success-soft-alpha);--button-background-color-hover: var(--color-background-success-soft-alpha-hover);--button-background-color-active: var(--color-background-success-soft-alpha-active);--button-text-color: var(--color-text-success-soft);--button-ring-color: var(--color-ring-success-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=danger]){--button-background-color: var(--color-background-danger-soft-alpha);--button-background-color-hover: var(--color-background-danger-soft-alpha-hover);--button-background-color-active: var(--color-background-danger-soft-alpha-active);--button-text-color: var(--color-text-danger-soft);--button-ring-color: var(--color-ring-danger-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=warning]){--button-background-color: var(--color-background-warning-soft-alpha);--button-background-color-hover: var(--color-background-warning-soft-alpha-hover);--button-background-color-active: var(--color-background-warning-soft-alpha-active);--button-text-color: var(--color-text-warning-soft);--button-ring-color: var(--color-ring-warning-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=caution]){--button-background-color: var(--color-background-caution-soft-alpha);--button-background-color-hover: var(--color-background-caution-soft-alpha-hover);--button-background-color-active: var(--color-background-caution-soft-alpha-active);--button-text-color: var(--color-text-caution-soft);--button-ring-color: var(--color-ring-caution-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=info]){--button-background-color: var(--color-background-info-soft-alpha);--button-background-color-hover: var(--color-background-info-soft-alpha-hover);--button-background-color-active: var(--color-background-info-soft-alpha-active);--button-text-color: var(--color-text-info-soft);--button-ring-color: var(--color-ring-info-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=discovery]){--button-background-color: var(--color-background-discovery-soft-alpha);--button-background-color-hover: var(--color-background-discovery-soft-alpha-hover);--button-background-color-active: var(--color-background-discovery-soft-alpha-active);--button-text-color: var(--color-text-discovery-soft);--button-ring-color: var(--color-ring-discovery-soft)}._Button_1864l_1[data-variant=outline]{--button-ring-offset: -1px;color:var(--button-text-color)}._Button_1864l_1[data-variant=outline]:before{background-color:transparent;box-shadow:0 0 0 1px var(--button-border-color) inset,var(--button-shadow-custom, 0 0 #00000000)}._Button_1864l_1[data-variant=outline][aria-expanded=true],._Button_1864l_1[data-variant=outline][data-state=open],._Button_1864l_1[data-variant=outline][data-selected]{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=outline][aria-expanded=true]:before,._Button_1864l_1[data-variant=outline][data-state=open]:before,._Button_1864l_1[data-variant=outline][data-selected]:before{background-color:var(--button-background-color-hover);box-shadow:0 0 0 1px var(--button-border-color-hover) inset,var(--button-shadow-custom, 0 0 #00000000)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):hover{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):hover:before{background-color:var(--button-background-color-hover);box-shadow:0 0 0 1px var(--button-border-color-hover) inset,var(--button-shadow-custom, 0 0 #00000000)}}._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active);transform:scale(var(--scale))}._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=outline]:where([data-color=primary]){--button-background-color-hover: var(--color-background-primary-outline-hover);--button-background-color-active: var(--color-background-primary-outline-active);--button-border-color: var(--color-border-primary-outline);--button-border-color-hover: var(--color-border-primary-outline-hover);--button-text-color: var(--color-text-primary-outline);--button-text-color-hover: var(--color-text-primary-outline-hover);--button-ring-color: var(--color-ring-primary-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=secondary]){--button-background-color-hover: var(--color-background-secondary-outline-hover);--button-background-color-active: var(--color-background-secondary-outline-active);--button-border-color: var(--color-border-secondary-outline);--button-border-color-hover: var(--color-border-secondary-outline-hover);--button-text-color: var(--color-text-secondary-outline);--button-text-color-hover: var(--color-text-secondary-outline-hover);--button-ring-color: var(--color-ring-secondary-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=danger]){--button-background-color-hover: var(--color-background-danger-outline-hover);--button-background-color-active: var(--color-background-danger-outline-active);--button-border-color: var(--color-border-danger-outline);--button-border-color-hover: var(--color-border-danger-outline-hover);--button-text-color: var(--color-text-danger-outline);--button-text-color-hover: var(--color-text-danger-outline-hover);--button-ring-color: var(--color-ring-danger-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=success]){--button-background-color-hover: var(--color-background-success-outline-hover);--button-background-color-active: var(--color-background-success-outline-active);--button-border-color: var(--color-border-success-outline);--button-border-color-hover: var(--color-border-success-outline-hover);--button-text-color: var(--color-text-success-outline);--button-text-color-hover: var(--color-text-success-outline-hover);--button-ring-color: var(--color-ring-success-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=warning]){--button-background-color-hover: var(--color-background-warning-outline-hover);--button-background-color-active: var(--color-background-warning-outline-active);--button-border-color: var(--color-border-warning-outline);--button-border-color-hover: var(--color-border-warning-outline-hover);--button-text-color: var(--color-text-warning-outline);--button-text-color-hover: var(--color-text-warning-outline-hover);--button-ring-color: var(--color-ring-warning-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=caution]){--button-background-color-hover: var(--color-background-caution-outline-hover);--button-background-color-active: var(--color-background-caution-outline-active);--button-border-color: var(--color-border-caution-outline);--button-border-color-hover: var(--color-border-caution-outline-hover);--button-text-color: var(--color-text-caution-outline);--button-text-color-hover: var(--color-text-caution-outline-hover);--button-ring-color: var(--color-ring-caution-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=info]){--button-background-color-hover: var(--color-background-info-outline-hover);--button-background-color-active: var(--color-background-info-outline-active);--button-border-color: var(--color-border-info-outline);--button-border-color-hover: var(--color-border-info-outline-hover);--button-text-color: var(--color-text-info-outline);--button-text-color-hover: var(--color-text-info-outline-hover);--button-ring-color: var(--color-ring-info-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=discovery]){--button-background-color-hover: var(--color-background-discovery-outline-hover);--button-background-color-active: var(--color-background-discovery-outline-active);--button-border-color: var(--color-border-discovery-outline);--button-border-color-hover: var(--color-border-discovery-outline-hover);--button-text-color: var(--color-text-discovery-outline);--button-text-color-hover: var(--color-text-discovery-outline-hover);--button-ring-color: var(--color-ring-discovery-outline)}._Button_1864l_1[disabled]{pointer-events:none}._Button_1864l_1[data-disabled][data-variant]{--button-background-color: var(--color-background-disabled);--button-border-color: var(--color-border-disabled);--button-text-color: var(--color-text-disabled);cursor:not-allowed;pointer-events:auto}._Button_1864l_1[data-disabled][data-variant]:active:before{transform:scale(1)}._Button_1864l_1[data-disabled][data-variant][data-disabled-tone=relaxed]{cursor:default}._ButtonInner_1864l_4{position:relative;display:flex;flex-direction:inherit;align-items:center;justify-content:center;gap:inherit;width:100%;height:100%;transition:opacity .15s ease .1s}[data-loading] ._ButtonInner_1864l_4{opacity:0;transition:opacity .3s ease}._ButtonLoader_1864l_749{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;align-items:center;justify-content:center;pointer-events:none}._ButtonLoader_1864l_749[data-entering]{opacity:0}._ButtonLoader_1864l_749[data-exiting]{opacity:1}._ButtonLoader_1864l_749[data-entering-active],._ButtonLoader_1864l_749[data-entering][data-interrupted]{opacity:1;transition:opacity .15s ease .1s}._ButtonLoader_1864l_749[data-exiting-active],._ButtonLoader_1864l_749[data-exiting][data-interrupted]{opacity:0;transition:opacity .15s ease}}@layer components{._EmptyMessage_1r5gu_1{display:flex;flex-direction:column;align-items:center;justify-content:center}._EmptyMessage_1r5gu_1[data-fill=static]{width:100%;height:100%}._EmptyMessage_1r5gu_1[data-fill=absolute]{position:absolute;top:0;right:0;bottom:0;left:0}._IconBadge_1r5gu_16{--badge-size: 40px;--icon-size: 24px;display:flex;align-items:center;justify-content:center;width:var(--badge-size);height:var(--badge-size);border-radius:var(--radius-md);margin:0 0 12px;background:var(--badge-background-color);color:var(--badge-text-color)}._IconBadge_1r5gu_16 svg{width:var(--icon-size);height:var(--icon-size)}._IconBadge_1r5gu_16[data-size=sm]{--badge-size: 32px;--icon-size: 20px}._IconBadge_1r5gu_16[data-color=secondary]{--badge-background-color: var(--color-background-secondary-soft);--badge-text-color: var(--color-text-secondary-soft)}._IconBadge_1r5gu_16[data-color=warning]{--badge-background-color: var(--color-background-warning-soft);--badge-text-color: var(--color-text-warning-soft)}._IconBadge_1r5gu_16[data-color=danger]{--badge-background-color: var(--color-background-danger-soft);--badge-text-color: var(--color-text-danger-soft)}._Title_1r5gu_54{max-width:90%;color:var(--color-text);font-size:16px;font-weight:var(--font-weight-semibold);text-align:center;text-wrap:balance}._Title_1r5gu_54:where([data-color=danger]){color:var(--color-text-danger)}._Title_1r5gu_54:where([data-color=warning]){color:var(--color-text-warning)}._Description_1r5gu_69{max-width:90%;margin:6px 0 0;color:var(--color-text-secondary);font-size:14px;line-height:1.45;text-align:center;text-wrap:balance}._ActionRow_1r5gu_77{margin-top:calc(var(--spacing) * 4)}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));align-items:start;gap:12px}.my-agent-inline-error{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .05);color:hsl(var(--destructive));font-size:12px}.my-agent-inline-error span{min-width:0;overflow-wrap:anywhere}.my-agent-inline-error button{flex:0 0 auto;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;font-weight:600}.my-agent-card{width:100%;height:auto;box-sizing:border-box;border-radius:12px;background:hsl(var(--secondary) / .82)}.my-agent-create-primary{min-width:max-content;height:32px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:border-color .16s ease,background-color .16s ease,color .16s ease}.my-agent-create-primary:hover:not(:disabled){border-color:hsl(var(--foreground) / .84);background:hsl(var(--foreground) / .84)}.my-agent-create-primary:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.58}.my-agent-create-primary svg{width:14px;height:14px;flex:0 0 14px}.my-agent-card{min-width:0;display:flex;flex-direction:column;overflow:hidden;border:0;animation:my-agent-card-enter .22s ease-out both;transition:transform .16s ease}.my-agent-card:hover{transform:translateY(-1px)}.my-agent-card-content{flex:0 0 auto;min-width:0;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;padding:16px;position:relative;z-index:1;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .035)}.my-agent-card-title{min-width:0;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.my-agent-card-title-copy{min-width:0}.my-agent-card-badges{display:flex;flex:0 0 auto;align-items:center;gap:6px}.my-agent-region-badge{min-height:22px;display:inline-flex;flex:0 0 auto;align-items:center;padding:0 8px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10px;font-weight:600;line-height:1}.my-agent-draft-badge,.my-agent-deploying-badge{min-height:22px;display:inline-flex;flex:0 0 auto;align-items:center;padding:0 8px;border:1px solid hsl(43 90% 48% / .3);border-radius:999px;background:#fabf0f24;color:#a36f14;font-size:10px;font-weight:600;line-height:1}.my-agent-card-badges .runtime-owner-badge{min-height:22px;display:inline-flex;align-items:center;padding:0 8px;line-height:1}.my-agent-session-id{display:block;margin-top:3px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;font-weight:400;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.my-agent-card h3{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:15px;font-weight:650;line-height:1.4;letter-spacing:-.015em;text-overflow:ellipsis;white-space:nowrap}.my-agent-description{min-height:40px;display:-webkit-box;margin:7px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.my-agent-status-label{display:inline-flex;min-height:22px;flex:0 0 auto;align-items:center;padding:0 8px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:550;line-height:1}.my-agent-status-label[data-ready]{border-color:#428a5c38;background:#e9f6ee;color:#206f3d}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{display:grid;gap:5px;margin-top:12px}.my-agent-meta>div{display:flex;align-items:center}.my-agent-meta dt,.my-agent-meta dd{font-size:12px;line-height:1.4}.my-agent-meta dt{color:hsl(var(--muted-foreground))}.my-agent-meta dd{color:hsl(var(--foreground));font-weight:600}.my-agent-created-at,.my-agent-region{width:100%;display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground))}.my-agent-created-at dt,.my-agent-region dt{color:hsl(var(--foreground));font-weight:600}.my-agent-created-at dd,.my-agent-region dd{color:hsl(var(--muted-foreground));font-weight:400}.my-agent-region dd{min-width:0;overflow:hidden;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.my-agent-actions{flex:0 0 42px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:6px 8px 7px;position:relative;z-index:0;border-radius:0 0 12px 12px;background:hsl(var(--secondary) / .82)}.my-agent-actions button{min-width:0;min-height:28px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;white-space:nowrap;transition:border-color .15s ease,background-color .15s ease,color .15s ease}.my-agent-actions button:hover:not(:disabled){background:hsl(var(--background) / .72);color:hsl(var(--foreground))}.my-agent-actions button:disabled{cursor:default;opacity:.48}.my-agent-actions .my-agent-use{display:inline-flex;align-items:center;justify-content:center;gap:5px;color:hsl(var(--foreground))}.my-agent-actions .my-agent-details{background:hsl(var(--background) / .56)}.my-agent-actions .my-agent-delete{color:hsl(var(--destructive))}.my-agent-actions .my-agent-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08);color:hsl(var(--destructive))}.my-agent-actions .my-agent-use:hover:not(:disabled){background:hsl(var(--background) / .72)}.my-agent-actions .my-agent-use.is-connected,.my-agent-actions .my-agent-use.is-connected:disabled{background:transparent;color:#1d7c40;opacity:1}.my-agent-use-spinner{width:11px;height:11px;flex:0 0 11px;box-sizing:border-box;border:1.25px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty-message{width:100%;height:100%;min-height:220px;display:grid;place-items:center}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{white-space:pre-wrap;overflow-wrap:anywhere;color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-actions button:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-create-primary:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-create-primary{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-actions button,.my-agent-type-pill,.my-agent-create-primary,.my-agent-search{transition:none}.my-agent-use-spinner{animation:none}.my-agent-card:hover{transform:none}}.applications-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.applications-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.applications-header h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.applications-header p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.applications-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.applications-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.applications-search svg{width:16px;height:16px;flex:0 0 16px}.applications-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.applications-search input::placeholder{color:hsl(var(--muted-foreground))}.applications-categories{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}.applications-categories button{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.applications-categories button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.applications-categories button.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.applications-categories button:focus-visible{outline:2px solid hsl(var(--ring) / .3);outline-offset:2px}.applications-results{flex:1;min-height:0;overflow-y:auto;margin-top:28px;padding-bottom:56px;scrollbar-gutter:stable}.applications-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));align-items:start;gap:12px}.application-card{min-width:0;min-height:96px;display:flex;align-items:flex-start;gap:16px;box-sizing:border-box;padding:16px 18px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;box-shadow:0 1px 2px hsl(var(--foreground) / .035);animation:application-card-enter .18s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.application-card:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .24);box-shadow:0 4px 14px hsl(var(--foreground) / .06)}.application-card:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.application-card-icon{width:36px;height:36px;flex:0 0 36px;color:hsl(var(--foreground))}.application-card-brand-icon{object-fit:contain}.application-card-copy{min-width:0}.application-card-title{display:flex;align-items:center;gap:6px}.application-card-copy h2{min-width:0;margin:1px 0 0;font-size:15px;font-weight:620;line-height:1.4}.application-card-badge{flex:0 0 auto;display:inline-flex;align-items:center;min-height:16px;box-sizing:border-box;padding:1px 6px;border-radius:999px;background:hsl(var(--destructive));color:#fff;font-size:10px;font-weight:600;line-height:1.2}.application-card-badge.is-success{background:#36ab661f;color:#217343}.application-card-copy p{display:-webkit-box;margin:7px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.applications-empty{min-height:260px;display:grid;place-items:center;align-content:center;text-align:center;color:hsl(var(--muted-foreground))}.applications-empty svg{width:32px;height:32px;margin-bottom:12px}.applications-empty h2{margin:0;color:hsl(var(--foreground));font-size:15px;font-weight:600}.applications-empty p{margin:6px 0 0;font-size:12.5px}@keyframes application-card-enter{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 760px){.applications-page{padding:24px 20px 0}.applications-header{flex-direction:column;gap:16px}.applications-search{width:100%}}@media (prefers-reduced-motion: reduce){.application-card{animation:none;transition:none}}.github-integration-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:28px 32px 0;background:hsl(var(--background))}.github-integration-header{display:flex;align-items:center;gap:12px;padding-bottom:24px}.github-back{width:32px;height:32px;display:grid;flex:0 0 32px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .16s ease,color .16s ease}.github-back:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.github-back:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.github-back svg{width:16px;height:16px}.github-integration-logo{width:30px;height:30px;flex:0 0 30px;color:hsl(var(--foreground))}.github-integration-header h1{margin:0;font-size:20px;font-weight:650;line-height:1.3;letter-spacing:-.02em}.github-integration-header p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.github-integration-layout{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:start;overflow-y:auto;padding-bottom:56px;scrollbar-gutter:stable}.github-section-panel{width:100%;min-width:0;box-sizing:border-box;padding:0;border:0;border-radius:0;background:transparent}.github-panel-heading p{margin:0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.6}.github-release-form{margin-top:24px}.github-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.github-field{min-width:0;display:flex;flex-direction:column}.github-field>label,.github-token-label-row>label{display:flex;align-items:center;gap:7px;margin-bottom:7px;color:hsl(var(--foreground));font-size:13px;font-weight:600}.github-field-requirement{color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:500}.github-field-requirement.is-required{color:hsl(var(--destructive))}.github-field input{width:100%;height:38px;box-sizing:border-box;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;outline:0;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .16s ease,box-shadow .16s ease}.github-field input::placeholder{color:hsl(var(--muted-foreground))}.github-field input:focus{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.github-field input[aria-invalid=true]{border-color:hsl(var(--destructive) / .62)}.github-region-picker{gap:0;margin:0}.github-region-picker .pp-region-trigger,.github-region-picker .pp-region-option{height:38px;font-size:14px}.github-field-help{min-height:18px;margin-top:5px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.github-field-error{margin-top:3px;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.github-token-field{margin-top:16px}.github-token-label-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.github-token-label-row>a{display:inline-flex;align-items:center;gap:4px;color:#2371e7;font-size:12.5px;font-weight:600;line-height:1.5;text-decoration:none}.github-token-label-row>a:hover{text-decoration:underline}.github-token-label-row>a:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px;border-radius:4px}.github-token-label-row>a svg{width:13px;height:13px}.github-token-input{position:relative}.github-token-input input{padding-right:42px}.github-token-input button{position:absolute;top:5px;right:4px;width:28px;height:28px;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.github-token-input button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.github-token-input button:focus-visible{outline:2px solid hsl(var(--ring) / .3)}.github-token-input button svg{width:17px;height:17px}.github-submit-message{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;margin-top:16px;padding:10px 12px;border:1px solid;border-radius:8px;font-size:12px;line-height:1.5}.github-submit-message.is-error{border-color:hsl(var(--destructive) / .22);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.github-submit-message.is-success{border-color:#24894e3d;background:#2bab6012;color:#217343}.github-submit-message a,.github-history-item a{display:inline-flex;align-items:center;gap:5px;flex:0 0 auto;color:inherit;font-weight:620;text-decoration:none}.github-submit-message a:hover,.github-history-item a:hover{text-decoration:underline}.github-submit-message svg,.github-history-item svg{width:14px;height:14px}.github-form-actions{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:24px;padding-top:20px;border-top:1px solid hsl(var(--border))}.github-secrets-note{max-width:470px;display:flex;flex-direction:column;gap:3px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.github-secrets-note strong{color:hsl(var(--foreground));font-weight:600}.github-form-actions button{min-width:126px;height:36px;padding:0 15px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:600;transition:background-color .16s ease,opacity .16s ease}.github-form-actions button:hover:not(:disabled){background:hsl(var(--foreground) / .84)}.github-form-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.github-form-actions button:disabled{cursor:wait;opacity:.56}@media (max-width: 680px){.github-integration-page{padding:20px 18px 0}.github-field-grid{grid-template-columns:minmax(0,1fr)}.github-form-actions{align-items:stretch;flex-direction:column}.github-form-actions button{width:100%}}@media (prefers-reduced-motion: reduce){.github-back,.github-field input,.github-form-actions button{transition:none}}.feishu-integration-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:28px 32px 0;background:hsl(var(--background))}.feishu-integration-header{display:flex;align-items:center;gap:12px;padding-bottom:24px}.feishu-back{width:32px;height:32px;display:grid;flex:0 0 32px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .16s ease,color .16s ease}.feishu-back:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.feishu-back:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.feishu-back:disabled{cursor:not-allowed;opacity:.5}.feishu-back svg{width:16px;height:16px}.feishu-integration-logo{width:30px;height:30px;flex:0 0 30px;object-fit:contain}.feishu-integration-header h1{margin:0;font-size:20px;font-weight:650;line-height:1.3;letter-spacing:-.02em}.feishu-integration-header p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.feishu-integration-layout{flex:1;min-width:0;min-height:0;overflow-y:auto;padding-bottom:56px;scrollbar-gutter:stable}.feishu-section-panel{width:100%;min-width:0}.feishu-panel-description{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6}.feishu-form{margin-top:24px}.feishu-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 16px}.feishu-field{min-width:0;display:flex;flex-direction:column}.feishu-field>label{margin-bottom:7px;color:hsl(var(--foreground));font-size:13px;font-weight:600}.feishu-field input{width:100%;height:36px;box-sizing:border-box;padding:0 11px;border:1px solid hsl(var(--border));border-radius:6px;outline:0;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .16s ease,box-shadow .16s ease}.feishu-field input::placeholder{color:hsl(var(--muted-foreground))}.feishu-field input:focus{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.feishu-field input[aria-invalid=true]{border-color:hsl(var(--destructive) / .62)}.feishu-field input:disabled{cursor:not-allowed;opacity:.62}.feishu-field-help{min-height:18px;margin-top:5px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.feishu-field-error{margin-top:2px;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.feishu-region-picker{position:relative;min-width:0}.feishu-region-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;min-height:36px;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background-color:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.feishu-region-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background-color:hsl(var(--muted) / .18)}.feishu-region-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.feishu-region-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.feishu-region-trigger:disabled{cursor:not-allowed;opacity:.5}.feishu-region-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.feishu-region-trigger>svg{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.feishu-region-trigger[aria-expanded=true]>svg{transform:rotate(180deg)}.feishu-region-menu{position:absolute;z-index:30;top:calc(100% + 6px);left:0;width:100%;box-sizing:border-box;max-height:238px;overflow-y:auto;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08)}.feishu-region-option{display:flex;align-items:center;width:100%;min-height:34px;padding:8px 10px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left}.feishu-region-option:hover,.feishu-region-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.feishu-region-option.is-selected{background:hsl(var(--primary) / .08)}.feishu-secret-input{position:relative}.feishu-secret-input input{padding-right:54px}.feishu-secret-input>button{position:absolute;top:4px;right:4px;height:28px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:550}.feishu-secret-input>button:hover:not(:disabled){background:hsl(var(--muted) / .5);color:hsl(var(--foreground))}.feishu-secret-input>button:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:-2px}.feishu-secret-input>button:disabled{cursor:not-allowed;opacity:.5}.feishu-deployment-status{margin-top:20px;padding:14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--secondary) / .38)}.feishu-deployment-status.is-succeeded{border-color:#40966452;background:#f1f9f4}.feishu-deployment-status.is-failed{border-color:hsl(var(--destructive) / .25);background:hsl(var(--destructive) / .045)}.feishu-deployment-heading{min-height:20px;color:hsl(var(--foreground));font-size:13px;line-height:1.5}.feishu-deployment-heading strong{display:inline-flex;align-items:center;gap:6px;font-weight:600}.feishu-deployment-heading svg{width:16px;height:16px;color:#217343}.feishu-deployment-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0 0;padding:0;list-style:none}.feishu-deployment-steps li{display:flex;align-items:center;gap:6px;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.4}.feishu-deployment-steps li>span{width:18px;height:18px;display:grid;flex:0 0 18px;place-items:center;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));font-size:10px}.feishu-deployment-steps li>span svg{width:12px;height:12px}.feishu-deployment-steps li.is-active{color:hsl(var(--foreground));font-weight:550}.feishu-deployment-steps li.is-active>span{border-color:hsl(var(--foreground) / .3)}.feishu-deployment-steps li.is-done>span{border-color:#34895766;color:#217343}.feishu-deployment-error{margin:10px 0 0;color:hsl(var(--destructive));font-size:12px;line-height:1.55;white-space:pre-wrap}.feishu-deployment-result{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:10px;color:hsl(var(--muted-foreground));font-size:12px}.feishu-deployment-result>span:first-child{color:hsl(var(--foreground));font-weight:600}.feishu-deployment-result a{display:inline-flex;align-items:center;gap:4px;color:hsl(var(--foreground));font-weight:550;text-decoration:none}.feishu-deployment-result a:hover{text-decoration:underline}.feishu-deployment-result a svg{width:14px;height:14px}.feishu-form-actions{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-top:28px;padding-top:20px;border-top:1px solid hsl(var(--border))}.feishu-secrets-note{display:flex;min-width:0;flex-direction:column;gap:3px}.feishu-secrets-note strong{font-size:12.5px;font-weight:600}.feishu-secrets-note span{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.feishu-action-buttons{display:flex;flex:0 0 auto;gap:8px}.feishu-submit,.feishu-cancel{height:36px;padding:0 15px;border-radius:7px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}.feishu-submit{border:1px solid hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.feishu-submit:hover:not(:disabled){opacity:.88}.feishu-submit:disabled{cursor:not-allowed;opacity:.45}.feishu-cancel{border:1px solid hsl(var(--border));background:hsl(var(--panel));color:hsl(var(--foreground))}.feishu-cancel:hover{background:hsl(var(--secondary))}.feishu-submit:focus-visible,.feishu-cancel:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}@media (max-width: 760px){.feishu-integration-page{padding:24px 20px 0}.feishu-field-grid{grid-template-columns:1fr}.feishu-deployment-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.feishu-form-actions{align-items:stretch;flex-direction:column}.feishu-action-buttons{justify-content:flex-end}}@media (prefers-reduced-motion: reduce){.feishu-back,.feishu-field input,.feishu-region-trigger,.feishu-region-trigger>svg{transition:none}}.coding-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:28px 32px 0;background:hsl(var(--background));color:hsl(var(--foreground))}.coding-agents-header{display:flex;align-items:center;gap:12px;padding-bottom:24px}.coding-agents-back{width:32px;height:32px;display:grid;flex:0 0 32px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .16s ease,color .16s ease}.coding-agents-back:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-back:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-back:disabled{cursor:not-allowed;opacity:.5}.coding-agents-back svg{width:16px;height:16px}.coding-agents-logo{width:32px;height:32px;flex:0 0 32px;color:hsl(var(--foreground))}.coding-agents-header h1{margin:0;font-size:20px;font-weight:650;line-height:1.3;letter-spacing:-.02em}.coding-agents-header p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.coding-agents-scroll{flex:1;min-height:0;overflow-y:auto;padding-bottom:56px;scrollbar-gutter:stable}.coding-agents-content{width:100%;display:flex;flex-direction:column;gap:14px}.coding-agents-section{min-width:0;box-sizing:border-box;padding:18px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.coding-agents-section-heading{min-height:28px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.coding-agents-section-heading>div{display:flex;align-items:center;gap:9px}.coding-agents-section-heading>div>span{width:22px;height:22px;display:grid;place-items:center;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.coding-agents-section-heading h2{margin:0;font-size:14px;font-weight:650;line-height:1.4}.coding-agents-section-heading>button,.coding-agents-error-row button{min-height:28px;padding:4px 8px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:600}.coding-agents-section-heading>button:hover:not(:disabled),.coding-agents-error-row button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-section-heading>button:focus-visible,.coding-agents-error-row button:focus-visible{outline:2px solid hsl(var(--ring) / .3)}.coding-agents-section-heading>button:disabled{cursor:wait;opacity:.5}.coding-agents-inline-state{min-height:86px;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.coding-agents-inline-state i{width:14px;height:14px;box-sizing:border-box;border:1.5px solid hsl(var(--border));border-top-color:hsl(var(--foreground));border-radius:999px;animation:coding-agents-spin .7s linear infinite}.coding-agents-error-row{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .05);color:hsl(var(--destructive));font-size:12px;line-height:1.5}.coding-agents-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.coding-agents-agent{position:relative;min-width:0;min-height:92px;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:11px;box-sizing:border-box;padding:12px;overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.coding-agents-agent:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--secondary) / .18)}.coding-agents-agent.is-selected{border-color:hsl(var(--ring) / .5);background:hsl(var(--primary) / .035);box-shadow:inset 0 0 0 1px hsl(var(--ring) / .08)}.coding-agents-agent:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-agent:disabled{cursor:not-allowed;opacity:.58}.coding-agents-agent-mark{width:38px;height:38px;display:grid;place-items:center;color:hsl(var(--foreground))}.coding-agents-agent-mark img{width:32px;height:32px;border-radius:7px}.coding-agents-agent-mark svg{width:32px;height:32px}.coding-agents-agent-mark.is-claude-code{color:#d86e4b}.coding-agents-agent-mark.is-codex{color:#4a55ed}.coding-agents-agent-copy{min-width:0;display:flex;flex-direction:column;gap:3px;padding-right:40px}.coding-agents-agent-copy strong{overflow:hidden;font-size:12.5px;font-weight:650;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.coding-agents-agent-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.coding-agents-status{position:absolute;top:8px;right:8px;padding:2px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:600}.coding-agents-status.is-ready{background:#36ab661a;color:#247b48}.coding-agents-check{position:absolute;right:9px;bottom:9px;width:17px;height:17px;display:grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;color:transparent}.coding-agents-agent.is-selected .coding-agents-check{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.coding-agents-check svg{width:12px;height:12px}.coding-agents-skill-list{display:flex;flex-direction:column;gap:7px}.coding-agents-skill{min-width:0;min-height:54px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding-right:8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));transition:border-color .15s ease,background-color .15s ease}.coding-agents-skill:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .14)}.coding-agents-skill.is-selected{border-color:hsl(var(--ring) / .42);background:hsl(var(--primary) / .025)}.coding-agents-skill label{position:relative;min-width:0;min-height:52px;display:grid;grid-template-columns:15px minmax(0,1fr);align-items:center;gap:10px;padding:7px 10px;cursor:pointer}.coding-agents-skill label>span:last-child{min-width:0;display:flex;flex-direction:column;gap:2px}.coding-agents-skill input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0}.coding-agents-skill-check{width:15px;height:15px;display:grid;place-items:center;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:4px;background:hsl(var(--background));color:transparent}.coding-agents-skill-check svg{width:10px;height:10px}.coding-agents-skill input:checked+.coding-agents-skill-check{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.coding-agents-skill input:focus-visible+.coding-agents-skill-check,.coding-agents-skill>button:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-skill input:disabled+.coding-agents-skill-check{opacity:.55}.coding-agents-skill>button{min-height:30px;padding:4px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:600;white-space:nowrap}.coding-agents-skill>button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-skill-list strong{font-size:12.5px;font-weight:630;line-height:1.35}.coding-agents-skill-list small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.coding-agents-global{margin-top:14px;padding:14px;border-radius:9px;background:hsl(var(--secondary) / .42)}.coding-agents-global-heading{display:flex;align-items:center;gap:9px}.coding-agents-global-heading>svg{width:18px;height:18px;flex:0 0 18px;color:hsl(var(--muted-foreground))}.coding-agents-global-heading>div{min-width:0;display:flex;align-items:baseline;gap:8px}.coding-agents-global-heading strong{font-size:12px;font-weight:650}.coding-agents-global-heading span{color:hsl(var(--muted-foreground));font-size:11px}.coding-agents-global dl{margin:10px 0 0 27px}.coding-agents-global dl>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:10px;padding-top:6px;font-size:11.5px;line-height:1.45}.coding-agents-global dt{color:hsl(var(--muted-foreground))}.coding-agents-global dd{min-width:0;margin:0;overflow-wrap:anywhere}.coding-agents-global>p{margin:9px 0 0 27px;color:hsl(var(--muted-foreground));font-size:11.5px}.coding-agents-result{padding:11px 12px;border:1px solid;border-radius:8px;font-size:11.5px;line-height:1.45}.coding-agents-result.is-success{border-color:#2c965838;background:#2da9610f;color:#217343}.coding-agents-result.is-error{border-color:hsl(var(--destructive) / .22);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.coding-agents-result strong{font-weight:620}.coding-agents-result ul{margin:7px 0 0;padding-left:16px;color:inherit}.coding-agents-result li{margin-top:3px;overflow-wrap:anywhere}.coding-agents-actions{min-height:52px;display:flex;align-items:center;justify-content:flex-end;gap:16px}.coding-agents-actions>span{color:hsl(var(--muted-foreground));font-size:11.5px}.coding-agents-actions>button{min-width:112px;min-height:36px;padding:7px 18px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:620;transition:opacity .15s ease}.coding-agents-actions>button:hover:not(:disabled){opacity:.82}.coding-agents-actions>button:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-actions>button:disabled{cursor:not-allowed;opacity:.42}.coding-agents-preview-dialog{width:min(980px,calc(100vw - 48px));height:min(680px,calc(100vh - 48px));max-width:none;max-height:none;margin:auto;padding:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 24px 64px hsl(var(--foreground) / .18)}.coding-agents-preview-dialog[open]{display:flex;flex-direction:column}.coding-agents-preview-dialog::backdrop{background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.coding-agents-preview-header{min-height:64px;display:grid;grid-template-columns:34px minmax(0,1fr) 32px;align-items:center;gap:11px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.coding-agents-preview-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.coding-agents-preview-mark svg{width:18px;height:18px}.coding-agents-preview-header h2,.coding-agents-preview-header p{margin:0}.coding-agents-preview-header h2{font-size:14px;font-weight:650;line-height:1.4}.coding-agents-preview-header p{margin-top:2px;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4}.coding-agents-preview-header>button{width:30px;height:30px;display:grid;place-items:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.coding-agents-preview-header>button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-preview-header>button:focus-visible,.coding-agents-preview-tree button:focus-visible,.coding-agents-preview-tree summary:focus-visible,.coding-agents-preview-state button:focus-visible,.coding-agents-preview-file pre:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:1px}.coding-agents-preview-header>button svg{width:16px;height:16px}.coding-agents-preview-layout{flex:1;min-width:0;min-height:0;display:grid;grid-template-columns:230px minmax(0,1fr)}.coding-agents-preview-tree{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .16)}.coding-agents-preview-tree-title{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px;border-bottom:1px solid hsl(var(--border))}.coding-agents-preview-tree-title span{font-size:11.5px;font-weight:650}.coding-agents-preview-tree-title small{min-width:20px;padding:2px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;text-align:center}.coding-agents-preview-tree-scroll{min-height:0;overflow:auto;padding:8px}.coding-agents-preview-tree details{margin-bottom:4px}.coding-agents-preview-tree summary{min-height:30px;display:flex;align-items:center;gap:7px;padding:0 7px;border-radius:6px;color:hsl(var(--muted-foreground));cursor:pointer;font-size:11.5px;list-style:none}.coding-agents-preview-tree summary::-webkit-details-marker{display:none}.coding-agents-preview-tree summary:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-preview-tree summary svg,.coding-agents-preview-tree button svg{width:15px;height:15px;flex:0 0 15px}.coding-agents-preview-tree details>div{padding-left:13px}.coding-agents-preview-tree button{width:100%;min-width:0;min-height:30px;display:flex;align-items:center;gap:7px;padding:0 7px;overflow:hidden;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;text-align:left}.coding-agents-preview-tree button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-preview-tree button.is-selected{background:hsl(var(--foreground) / .08);color:hsl(var(--foreground));font-weight:600}.coding-agents-preview-tree button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.coding-agents-preview-file{min-width:0;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.coding-agents-preview-file>header{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.coding-agents-preview-file>header strong{min-width:0;overflow:hidden;font-size:11.5px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.coding-agents-preview-file>header span{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:10.5px}.coding-agents-preview-file pre{flex:1;min-width:0;min-height:0;margin:0;overflow:auto;padding:16px 18px 24px;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;line-height:1.65;-moz-tab-size:2;tab-size:2;white-space:pre}.coding-agents-preview-file code{font:inherit}.coding-agents-preview-state,.coding-agents-preview-unavailable{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:10px;padding:24px;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.coding-agents-preview-state i{width:14px;height:14px;box-sizing:border-box;border:1.5px solid hsl(var(--border));border-top-color:hsl(var(--foreground));border-radius:999px;animation:coding-agents-spin .7s linear infinite}.coding-agents-preview-state.is-error{flex-direction:column;color:hsl(var(--destructive))}.coding-agents-preview-state button{min-height:30px;padding:4px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px}@keyframes coding-agents-spin{to{transform:rotate(360deg)}}@media (max-width: 760px){.coding-agents-page{padding:20px 18px 0}.coding-agents-agent-grid{grid-template-columns:minmax(0,1fr)}.coding-agents-global-heading>div{align-items:flex-start;flex-direction:column;gap:2px}.coding-agents-global dl>div{grid-template-columns:minmax(0,1fr);gap:2px}.coding-agents-actions{align-items:stretch;flex-direction:column;gap:8px}.coding-agents-actions>span{text-align:right}.coding-agents-actions>button{width:100%}.coding-agents-preview-dialog{width:calc(100vw - 24px);height:calc(100vh - 24px)}.coding-agents-preview-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(130px,34%) minmax(0,1fr)}.coding-agents-preview-tree{border-right:0;border-bottom:1px solid hsl(var(--border))}}@media (prefers-reduced-motion: reduce){.coding-agents-back,.coding-agents-agent,.coding-agents-skill,.coding-agents-actions>button{transition:none}.coding-agents-inline-state i,.coding-agents-preview-state i{animation-duration:1.5s}}.builtin-tool-head{--builtin-tool-accent: 215 18% 42%;display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:3px 7px 3px 3px;border:0;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;transition:color .12s ease}.builtin-tool-head[data-tool-tone=search]{--builtin-tool-accent: 211 62% 42%}.builtin-tool-head[data-tool-tone=image]{--builtin-tool-accent: 28 67% 42%}.builtin-tool-head[data-tool-tone=video]{--builtin-tool-accent: 260 38% 48%}.builtin-tool-head[data-tool-tone=presentation]{--builtin-tool-accent: 252 38% 52%}.builtin-tool-head[data-tool-tone=memory]{--builtin-tool-accent: 174 52% 34%}.builtin-tool-head[data-tool-tone=knowledge]{--builtin-tool-accent: 225 48% 45%}.builtin-tool-head[data-tool-tone=skill]{--builtin-tool-accent: 154 50% 34%}.builtin-tool-head[data-tool-tone=sandbox]{--builtin-tool-accent: 32 67% 42%}.builtin-tool-head:hover{color:hsl(var(--foreground))}.builtin-tool-icon{position:relative;width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center;color:hsl(var(--builtin-tool-accent))}.builtin-tool-icon>svg{width:18px;height:18px}.builtin-tool-label{font-size:14.5px;font-weight:400;line-height:1.35}.builtin-tool-head.is-done .builtin-tool-label{color:hsl(var(--muted-foreground))}.builtin-tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.builtin-tool-chevron.is-open{transform:rotate(90deg)}.new-chat-mode{position:relative;align-self:flex-start}.new-chat-mode__trigger{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:2px 7px 2px 5px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer;transition:color .12s ease,background .12s ease}.composer--new-chat .new-chat-mode__trigger{min-height:36px;font-size:15px}.new-chat-mode__trigger:hover,.new-chat-mode__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-mode__current{max-width:min(180px,42vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__trigger:focus-visible,.new-chat-mode__option:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}.new-chat-mode__icon,.new-chat-mode__option-icon{display:inline-grid;place-items:center;flex:0 0 auto}.new-chat-mode__icon svg{width:15px;height:15px}.new-chat-mode__option-icon svg{width:18px;height:18px}.new-chat-mode svg{fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}.new-chat-mode svg.new-chat-mode__temporary-icon{stroke-width:1.3}.new-chat-mode__skill-icon path:first-child{fill:currentColor;stroke:none}.new-chat-mode__chevron{width:12px;height:12px;transition:transform .14s ease}.new-chat-mode__trigger[aria-expanded=true] .new-chat-mode__chevron{transform:rotate(180deg)}.new-chat-mode__menus{position:absolute;z-index:43;top:calc(100% + 7px);left:0;display:flex;align-items:flex-start;gap:8px}.new-chat-mode__menu{flex:0 0 auto;width:286px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__option{display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.new-chat-mode__option.is-active{background:hsl(var(--accent))}.new-chat-mode__option:disabled{cursor:not-allowed;opacity:.48}.new-chat-mode__copy{display:flex;min-width:0;flex-direction:column;gap:2px}.new-chat-mode__copy>span:last-child{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.new-chat-mode__label{display:flex;min-width:0;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__beta{flex:0 0 auto;padding:1px 5px;border:1px solid hsl(var(--border));border-radius:999px;color:hsl(var(--muted-foreground));font-size:9px;font-weight:500;line-height:1.2}.new-chat-mode__check{width:16px;height:16px;color:hsl(var(--primary))}.new-chat-mode__nested-chevron{width:14px;height:14px;color:hsl(var(--muted-foreground))}.new-chat-mode__submenu{flex:0 0 auto;width:248px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__submenu-option{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.new-chat-mode__submenu-option:hover:not(:disabled){background:hsl(var(--accent))}.new-chat-mode__submenu-option:disabled{cursor:not-allowed;opacity:.42}.new-chat-mode__builtin-icon{width:24px;height:24px;flex:0 0 auto;stroke-width:1.75}@media (max-width: 640px){.new-chat-mode__menus{width:min(320px,calc(100vw - 48px));max-height:min(520px,calc(100vh - 160px));flex-direction:column;overflow-y:auto}.new-chat-mode__menu,.new-chat-mode__submenu{width:100%}}@media (prefers-reduced-motion: reduce){.new-chat-mode__trigger,.new-chat-mode__chevron{transition:none}}.new-chat-agent-picker{position:relative;min-width:0}.composer--new-chat .new-chat-agent-picker{position:absolute;z-index:5;bottom:10px;left:52px}.composer--new-chat.composer--has-task .new-chat-agent-picker{left:138px}.composer--new-chat.composer--task-image .new-chat-agent-picker,.composer--new-chat.composer--task-video .new-chat-agent-picker{left:176px}.new-chat-agent-picker__trigger{display:inline-flex;align-items:center;gap:6px;max-width:min(220px,42vw);min-height:36px;padding:2px 8px 2px 6px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;line-height:20px;cursor:pointer;transition:color .14s ease,background .14s ease}.new-chat-agent-picker__trigger:hover,.new-chat-agent-picker__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-agent-picker__trigger:disabled{cursor:not-allowed;opacity:.48}.new-chat-agent-picker__trigger>span{display:flex;min-height:20px;align-items:center;overflow:hidden;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.new-chat-agent-picker__trigger-icon,.new-chat-agent-picker__trigger-chevron{display:block}.new-chat-agent-picker__trigger-icon{width:17px;height:17px;flex:0 0 auto}.new-chat-agent-picker__trigger-chevron{width:13px;height:13px;flex:0 0 auto;transform:rotate(90deg);transition:transform .14s ease}.new-chat-agent-picker__trigger[aria-expanded=true] .new-chat-agent-picker__trigger-chevron{transform:rotate(-90deg)}.new-chat-agent-picker__menus{position:absolute;z-index:44;top:calc(100% + 7px);left:0;display:flex;align-items:flex-start;gap:7px;outline:none}.new-chat-agent-picker__menu,.new-chat-agent-picker__submenu{padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-agent-picker__menu{width:218px}.new-chat-agent-picker__submenu{width:272px;max-height:286px;overflow:auto}.new-chat-agent-picker__type,.new-chat-agent-picker__runtime{display:grid;align-items:center;width:100%;min-height:38px;border:0;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left}.new-chat-agent-picker__type{grid-template-columns:22px minmax(0,1fr) 16px;gap:8px;padding:7px 8px;font-size:13px;cursor:pointer}.new-chat-agent-picker__type:hover,.new-chat-agent-picker__type.is-keyboard-active,.new-chat-agent-picker__runtime:hover:not(:disabled),.new-chat-agent-picker__runtime.is-keyboard-active{background:hsl(var(--accent))}.new-chat-agent-picker__type-icon,.new-chat-agent-picker__runtime-icon{width:18px;height:18px;flex:0 0 auto}.new-chat-agent-picker__nested-chevron{width:14px;height:14px;color:hsl(var(--muted-foreground))}.new-chat-agent-picker__runtime{grid-template-columns:22px minmax(0,1fr) auto;gap:8px;padding:8px;font-size:13px;cursor:pointer}.new-chat-agent-picker__runtime:disabled{cursor:wait;opacity:.62}.new-chat-agent-picker__runtime>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-agent-picker__runtime small{color:hsl(var(--muted-foreground));font-size:11px}.new-chat-agent-picker__check{width:16px;height:16px;color:hsl(var(--primary))}.new-chat-agent-picker__runtime-list{display:flex;flex-direction:column;gap:1px}.new-chat-agent-picker__empty{min-height:116px;padding:14px 10px}.new-chat-agent-picker__empty-title{white-space:nowrap}.new-chat-agent-picker__empty-agent-icon{width:32px;height:32px}.new-chat-agent-picker__status,.new-chat-agent-picker__error,.new-chat-agent-picker__inline-error{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.new-chat-agent-picker__status{display:flex;min-height:76px;align-items:center;justify-content:center;gap:7px;padding:12px}.new-chat-agent-picker__error{display:flex;flex-direction:column;gap:8px;padding:10px;color:hsl(var(--destructive))}.new-chat-agent-picker__error>span,.new-chat-agent-picker__inline-error{white-space:pre-wrap;overflow-wrap:anywhere}.new-chat-agent-picker__error button,.new-chat-agent-picker__load-more{min-height:30px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font:inherit;font-size:12px;cursor:pointer}.new-chat-agent-picker__inline-error{padding:6px 8px;color:hsl(var(--destructive))}.new-chat-agent-picker__load-more{width:100%;margin-top:4px}.new-chat-agent-picker__load-more:disabled{cursor:wait;opacity:.55}.new-chat-agent-picker__spinner{width:13px;height:13px;border:1.5px solid hsl(var(--border));border-top-color:hsl(var(--foreground));border-radius:50%;animation:new-chat-agent-picker-spin .7s linear infinite}.new-chat-agent-picker__trigger:focus-visible,.new-chat-agent-picker__type:focus-visible,.new-chat-agent-picker__runtime:focus-visible,.new-chat-agent-picker__error button:focus-visible,.new-chat-agent-picker__load-more:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}@keyframes new-chat-agent-picker-spin{to{transform:rotate(360deg)}}@media (max-height: 700px) and (min-width: 641px){.new-chat-agent-picker__menus{top:auto;bottom:calc(100% + 7px)}.new-chat-agent-picker__submenu{max-height:min(220px,calc(100dvh - 180px))}}@media (max-width: 640px){.new-chat-agent-picker__menus{width:min(320px,calc(100vw - 88px));max-height:min(420px,calc(100dvh - 168px));flex-direction:column;overflow-y:auto;overscroll-behavior:contain}.new-chat-agent-picker__menu,.new-chat-agent-picker__submenu{width:100%;flex:0 0 auto}.new-chat-agent-picker__submenu{max-height:220px}}@media (prefers-reduced-motion: reduce){.new-chat-agent-picker__trigger,.new-chat-agent-picker__trigger-chevron{transition:none}.new-chat-agent-picker__spinner{animation:none}}.stk{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.stk-head{text-align:center;margin-bottom:26px}.stk-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.stk-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.stk-list{display:flex;flex-direction:column;gap:12px;width:100%;max-width:520px}.stk-card{display:flex;align-items:center;gap:14px;width:100%;padding:18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s,box-shadow .15s,background .12s}.stk-card:hover{border-color:hsl(var(--ring) / .35);background:hsl(var(--foreground) / .02);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.stk-card-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.stk-card-icon svg{width:21px;height:21px}.stk-card-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.stk-card-title{font-size:15px;font-weight:600}.stk-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.stk-card-status{flex-shrink:0;padding:4px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600;line-height:1.3;white-space:nowrap}.stk-card-arrow{flex-shrink:0;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.stk-card:hover .stk-card-arrow{opacity:1;transform:translate(0)}.stk-card-disabled{opacity:.5;cursor:not-allowed}.stk-card-disabled:hover{border-color:hsl(var(--border));background:hsl(var(--card));box-shadow:none}.stk-card-disabled .stk-card-arrow{display:none}.stk-footer{margin-top:18px;width:100%;max-width:520px;display:flex;justify-content:center}.stk-import{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border:1px dashed hsl(var(--border));border-radius:9px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.stk-import:hover{color:hsl(var(--foreground));border-color:hsl(var(--ring) / .4);background:hsl(var(--foreground) / .03)}.stk-import svg{width:15px;height:15px}.code-browser-trigger{min-height:26px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:color .12s ease,background-color .12s ease}.code-browser-trigger svg{width:13px;height:13px}.code-browser-trigger:hover{background:hsl(var(--foreground) / .04);color:hsl(var(--foreground))}.code-browser-trigger:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.code-browser-backdrop{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:code-browser-fade-in .14s ease-out}.code-browser-dialog{width:min(1040px,92vw);height:min(720px,84vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:code-browser-rise-in .18s cubic-bezier(.2,.8,.2,1)}.code-browser-head{flex:0 0 58px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.code-browser-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.code-browser-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-title-icon svg,.code-browser-close svg{width:16px;height:16px}.code-browser-title-wrap h2,.code-browser-title-wrap p{margin:0}.code-browser-title-wrap h2{color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.code-browser-title-wrap p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.code-browser-close{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.code-browser-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-workspace{flex:1;min-height:0;display:flex}.code-browser-sidebar{flex:0 0 220px;min-width:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .22)}.code-browser-sidebar-head,.code-browser-path{flex:0 0 38px;min-height:38px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.code-browser-sidebar-head{justify-content:space-between;padding:0 12px;color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.code-browser-sidebar-head span{font-variant-numeric:tabular-nums;font-weight:500}.code-browser-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.code-browser-file,.code-browser-folder{width:100%;min-height:30px;display:flex;align-items:center;gap:6px;padding-top:4px;padding-right:10px;padding-bottom:4px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;text-align:left;cursor:pointer}.code-browser-file:hover,.code-browser-folder:hover{background:hsl(var(--foreground) / .045);color:hsl(var(--foreground))}.code-browser-file.is-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.code-browser-file svg,.code-browser-folder svg{width:14px;height:14px;flex:0 0 auto}.code-browser-folder>svg:first-child{width:12px;height:12px;transition:transform .12s ease}.code-browser-folder>svg:first-child.is-open{transform:rotate(90deg)}.code-browser-file span,.code-browser-folder span,.code-browser-path span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-browser-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.code-browser-path{gap:7px;padding:0 13px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px}.code-browser-path svg{width:13px;height:13px;flex:0 0 auto}.code-browser-editor{flex:1;min-height:0;overflow:hidden}.code-browser-editor>div,.code-browser-editor .cm-theme,.code-browser-editor .cm-editor{height:100%}.code-browser-editor .cm-scroller{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12.5px}.code-browser-empty{height:100%;display:grid;place-items:center;padding:20px;color:hsl(var(--muted-foreground));font-size:12px}@keyframes code-browser-fade-in{0%{opacity:0}to{opacity:1}}@keyframes code-browser-rise-in{0%{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.code-browser-backdrop{padding:12px}.code-browser-dialog{width:100%;height:min(760px,92vh)}.code-browser-sidebar{flex-basis:168px}}@media (prefers-reduced-motion: reduce){.code-browser-backdrop,.code-browser-dialog{animation:none}}.layout{--pp-sidebar-width: 236px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.pp-root{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.pp-toolbar{flex:0 0 auto;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:10px 24px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-toolbar-left,.pp-toolbar-actions,.pp-actions{display:flex;align-items:center}.pp-toolbar-left{min-width:0;gap:18px}.pp-toolbar-actions{flex:0 0 auto;gap:8px}.pp-toolbar-back{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer}.pp-toolbar-back:hover{color:hsl(var(--foreground))}.pp-toolbar-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-secondary{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:6px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.pp-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.pp-secondary:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--accent))}.pp-secondary:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.pp-secondary:disabled{opacity:.55;cursor:default}.pp-body{flex:1;min-height:0;min-width:0;display:flex}.pp-files-area{flex:1 1 auto;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.pp-sidebar{flex:0 0 218px;width:218px;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .24)}.pp-sidebar-head,.pp-main-head{flex:0 0 42px;min-height:42px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.pp-sidebar-head{gap:8px;padding:0 9px 0 14px}.pp-project-name{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:650;letter-spacing:.04em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.pp-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.pp-row{width:100%;min-height:29px;display:flex;align-items:center;gap:6px;padding:4px 8px;border:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.pp-row:hover{background:hsl(var(--foreground) / .045)}.pp-file.pp-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.pp-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-folder .pp-label{color:hsl(var(--muted-foreground))}.pp-ic{width:15px;height:15px;flex:0 0 auto}.pp-chevron{color:hsl(var(--muted-foreground));transition:transform .12s ease}.pp-chevron.pp-open{transform:rotate(90deg)}.pp-icon-btn{width:28px;height:28px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-icon-btn:hover:not(:disabled){background:hsl(var(--foreground) / .07);color:hsl(var(--foreground))}.pp-icon-btn:disabled{opacity:.45;cursor:default}.pp-danger:hover:not(:disabled){color:hsl(var(--destructive))}.pp-new-input{width:calc(100% - 16px);height:30px;margin:2px 8px 6px;padding:0 8px;border:1px solid hsl(var(--ring) / .55);border-radius:4px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.pp-empty,.pp-placeholder{width:100%;padding:28px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.pp-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.pp-main-head{gap:12px;padding:0 10px 0 14px;background:hsl(var(--background))}.pp-path{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-actions{gap:2px}.pp-content{flex:1;min-height:0;min-width:0;display:flex;overflow:hidden}.pp-codemirror,.pp-codemirror>div,.pp-codemirror .cm-editor{width:100%;height:100%;min-height:0}.pp-codemirror .cm-editor{overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground));font-size:12.5px}.pp-codemirror .cm-scroller{overflow:auto;overscroll-behavior:none;scroll-padding-block:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.58}.pp-codemirror .cm-content{padding:10px 0 0}.pp-codemirror .cm-line{padding:0 14px 0 8px}.pp-codemirror .cm-content>.cm-line:last-child:has(>br:only-child){display:none}.pp-codemirror .cm-gutters{border-right:1px solid hsl(var(--border) / .7);background:hsl(var(--secondary) / .2);color:hsl(var(--muted-foreground) / .65)}.pp-codemirror .cm-activeLine,.pp-codemirror .cm-activeLineGutter{background:hsl(var(--foreground) / .035)}.pp-codemirror .cm-focused{outline:none}.pp-editor-loading{height:100%;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px}.pp-pre{flex:1;width:100%;height:100%;box-sizing:border-box;margin:0;padding:14px 16px 0;overflow:auto;background:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px;font-style:normal;font-variant-ligatures:none;font-weight:400;line-height:1.58;-moz-tab-size:2;tab-size:2;white-space:pre}.pp-root.is-deploy{--pp-publish-content-width: min(760px, max(680px, calc(100% - 48px) ));overflow-y:auto}.pp-root.is-deploy.is-embedded{--pp-publish-content-width: 100%}.pp-root.is-deploy .pp-body{flex:0 0 auto;min-height:100%;display:grid;grid-template-rows:auto auto;overflow:visible}.pp-root.is-deploy.has-primary-pane .pp-body{display:flex;justify-content:center;background:hsl(var(--background))}.pp-root.is-deploy.has-primary-pane .pp-config{width:min(760px,100%);background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-head,.pp-root.is-deploy.has-primary-pane .pp-config-actions{border:0;background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-actions{position:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:hsl(var(--background));transform:none}.pp-root.is-deploy.has-primary-pane .pp-deploy-hint{position:absolute;left:18px}.pp-root.is-deploy .pp-files-area{display:none}.pp-release-overview{min-width:0;min-height:0;border-bottom:0;background:transparent}.pp-release-preview{width:var(--pp-publish-content-width);box-sizing:border-box;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0 auto;padding:8px 0 12px}.pp-release-preview.is-embedded{grid-template-columns:minmax(0,1fr) 132px;align-items:stretch}.pp-flow-thumbnail{position:relative;height:200px;min-width:0;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:transparent;box-shadow:none}.pp-flow-thumbnail .abc-root,.pp-flow-dialog-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;flex:1 1 auto;border:0;background:transparent}.pp-flow-thumbnail .abc-canvas,.pp-flow-dialog-canvas .abc-canvas{flex:1;min-height:0;background:transparent}.pp-flow-thumbnail .react-flow__pane{cursor:grab}.pp-flow-thumbnail .react-flow__pane:active{cursor:grabbing}.pp-flow-thumbnail .react-flow__controls{display:none}.pp-flow-expand{position:absolute;z-index:5;right:10px;bottom:10px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit}.pp-flow-expand:hover{background:transparent;color:hsl(var(--foreground))}.pp-flow-expand:focus-visible{outline:2px solid hsl(var(--primary) / .72);outline-offset:2px}.pp-flow-expand svg{width:17px;height:17px}.pp-release-info{min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:18px;background:hsl(var(--panel));box-shadow:inset 0 1px hsl(var(--background)),0 8px 28px hsl(var(--foreground) / .045)}.pp-release-card-head{padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34);color:hsl(var(--foreground));font-size:14px;font-weight:620;letter-spacing:-.01em}.pp-release-info-body{padding:14px 18px 16px}.pp-release-info-main{min-width:0}.pp-release-info h2{margin:0;color:hsl(var(--foreground));font-size:18px;font-weight:700;letter-spacing:-.02em}.pp-release-description{display:-webkit-box;margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;overflow:hidden;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;margin:12px 0 0}.pp-release-facts>div{min-width:0}.pp-release-facts dt{color:hsl(var(--muted-foreground));font-size:13px}.pp-release-facts dd{margin:5px 0 0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-release-facts .pp-release-fact-long{display:-webkit-box;overflow:hidden;line-height:1.45;text-overflow:clip;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts .pp-release-prompt{-webkit-line-clamp:3}.pp-artifact-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:12px}.pp-artifact-actions.is-rail{flex-direction:column;flex-wrap:nowrap;gap:8px;margin:0;padding:0}.pp-artifact-actions.is-rail .pp-secondary,.pp-artifact-actions.is-rail .code-browser-trigger{flex:1 1 0;width:100%;min-height:36px;justify-content:center}.pp-artifact-actions .pp-secondary,.pp-artifact-actions .code-browser-trigger{min-height:34px;padding-inline:12px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);box-shadow:none;color:hsl(var(--foreground));font-size:13px}.pp-artifact-actions .pp-secondary:hover,.pp-artifact-actions .code-browser-trigger:hover{background:hsl(var(--secondary))}.pp-flow-backdrop{--cw-workspace-ink: 222 24% 13%;position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:32px;background:hsl(var(--foreground) / .36);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.pp-flow-dialog{width:min(1120px,92vw);height:min(720px,86vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 80px hsl(var(--foreground) / .22)}.pp-flow-dialog>header{flex:0 0 62px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 18px 0 22px;border-bottom:1px solid hsl(var(--border))}.pp-flow-dialog>header>div{display:flex;flex-direction:column;gap:3px}.pp-flow-dialog>header strong{font-size:15px;font-weight:680}.pp-flow-dialog>header span{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-flow-dialog>header button{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-flow-dialog>header button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.pp-flow-dialog>header svg{width:17px;height:17px}.pp-flow-dialog-canvas{flex:1;min-height:0;background:transparent}.pp-config{position:relative;min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{width:var(--pp-publish-content-width);flex:0 0 48px;height:48px;box-sizing:border-box;display:flex;align-items:center;margin:0 auto;padding:0;border-bottom:0}.pp-config-title{color:hsl(var(--foreground));font-size:18px;font-weight:650;letter-spacing:-.01em}.pp-env-sub{margin-top:4px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.pp-config-scroll{width:var(--pp-publish-content-width);flex:0 0 auto;min-height:0;box-sizing:border-box;display:block;margin:0 auto;overflow:visible;padding:0 0 88px}.pp-config-actions{position:fixed;z-index:40;left:calc((100vw + var(--pp-sidebar-width, 0px)) / 2);bottom:max(20px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;transform:translate(-50%)}.pp-config-actions.is-external{display:none}.pp-config-section{width:100%;min-width:0;box-sizing:border-box;margin:0 0 12px;padding:0 18px 16px;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:18px;background:hsl(var(--panel));box-shadow:inset 0 1px hsl(var(--background)),0 8px 28px hsl(var(--foreground) / .045)}.pp-config-section:has(.pp-network-region){overflow:visible}.pp-config-section:has(.pp-network-region.is-open){position:relative;z-index:70}.pp-config-section:has(.pp-network-region)>.pp-config-label{border-radius:17px 17px 0 0}.pp-env-section,.pp-progress-section,.pp-deploy-result,.pp-config-scroll>.pp-error{width:100%;margin-inline:0}.pp-config-label{margin:0 -18px 12px;padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34);color:hsl(var(--foreground));font-size:14px;font-weight:620;letter-spacing:-.01em}.pp-env-head{margin:0 -18px 12px;padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34)}.pp-env-head .pp-config-label{margin:0;padding:0;border:0;background:transparent}.pp-config-note{margin:-4px 0 10px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.pp-auth-section{overflow:visible}.pp-auth-preserved-note{margin:0}.pp-auth-fields{width:min(100%,560px);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px}.pp-auth-fields>label{min-width:0;display:flex;flex-direction:column;gap:7px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deployment-select{position:relative;min-width:0}.pp-deployment-select-trigger{width:100%;height:36px;min-height:36px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.pp-deployment-select-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .18)}.pp-deployment-select-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.pp-deployment-select-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.pp-deployment-select-trigger:disabled{cursor:not-allowed;opacity:.5}.pp-deployment-select-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-deployment-select-trigger>.is-placeholder{color:hsl(var(--muted-foreground));font-weight:400}.pp-deployment-select-chevron{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.pp-deployment-select-chevron.is-open{transform:rotate(180deg)}.pp-deployment-select-menu{position:absolute;z-index:40;top:calc(100% + 6px);right:0;left:0;max-height:224px;overflow-y:auto;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08);overscroll-behavior:contain}.pp-deployment-select-option{width:100%;min-height:40px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 9px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left}.pp-deployment-select-option:hover,.pp-deployment-select-option:focus-visible,.pp-deployment-select-option.is-selected{outline:none;background:hsl(var(--muted) / .5)}.pp-deployment-select-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.pp-deployment-select-name{min-width:0;display:flex;align-items:center;gap:6px;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-weight:560;text-overflow:ellipsis;white-space:nowrap}.pp-deployment-select-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.pp-deployment-select-option>svg{width:15px;height:15px;flex-shrink:0;color:hsl(var(--primary))}.pp-deployment-select-badge{flex-shrink:0;padding:1px 5px;border:1px solid hsl(211 90% 48% / .24);border-radius:999px;background:#006fe61a;color:#1863b4;font-size:10px;font-weight:600}.pp-user-pool-picker{min-width:0;display:flex;flex-direction:column;gap:7px}.pp-user-pool-status{min-height:18px;display:inline-flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.5}.pp-user-pool-spinner{width:13px;height:13px;flex-shrink:0;animation:pp-spin .9s linear infinite}.pp-user-pool-error{min-height:18px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:hsl(var(--destructive));font-size:11.5px;line-height:1.5}.pp-user-pool-error button{flex-shrink:0;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;font-weight:600}.pp-user-pool-error button:focus-visible{outline:2px solid hsl(var(--ring) / .45);outline-offset:2px}.pp-instance-note{margin:10px 0 0;color:#d79804;font-size:12px;line-height:1.5}.pp-instance-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pp-instance-fields label{min-width:0;display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-instance-error{margin:8px 0 0;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.pp-config-select,.pp-channel-fields input,.pp-instance-fields input,.pp-network-fields input,.pp-env-row input,.pp-env-row textarea{width:100%;min-width:0;height:34px;box-sizing:border-box;padding:0 10px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;transition:border-color .12s ease,box-shadow .12s ease}.pp-channel-fields input{height:30px;padding-inline:8px;font-size:11.5px}.pp-config-select:focus,.pp-channel-fields input:focus,.pp-instance-fields input:focus,.pp-network-fields input:focus,.pp-env-row input:focus,.pp-env-row textarea:focus{border-color:hsl(var(--ring) / .55);box-shadow:0 0 0 2px hsl(var(--ring) / .08)}.pp-config-select:disabled,.pp-channel-fields input:disabled,.pp-instance-fields input:disabled,.pp-network-fields input:disabled,.pp-env-row input:disabled,.pp-env-row textarea:disabled{opacity:.55}.pp-channel-card{position:relative;width:clamp(154px,33.333%,236px);max-width:100%;height:112px;perspective:1200px;transition:height .18s ease}.pp-channel-card.is-flipped{height:176px}.pp-channel-card-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .42s cubic-bezier(.22,1,.36,1)}.pp-channel-card.is-flipped .pp-channel-card-inner{transform:rotateY(180deg)}.pp-channel-card-face{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:14px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden}.pp-channel-card-front{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:11px;padding:12px;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.pp-channel-card-front:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);box-shadow:0 12px 30px hsl(var(--foreground) / .07);transform:translateY(-1px)}.pp-channel-card-front:focus-visible,.pp-channel-remove:focus-visible{outline:2px solid hsl(var(--ring) / .58);outline-offset:2px}.pp-channel-card-front:disabled{cursor:default}.pp-channel-card-back{padding:10px;transform:rotateY(180deg)}.pp-channel-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.pp-channel-card-head>strong{font-size:12.5px;font-weight:650}.pp-channel-logo{width:42px;height:42px;flex:0 0 42px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border) / .65);border-radius:12px;background:#fff;box-shadow:0 4px 14px hsl(var(--foreground) / .07)}.pp-channel-logo img{width:30px;height:30px;display:block}.pp-channel-card-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:3px}.pp-channel-card-copy strong{font-size:14px;font-weight:650}.pp-channel-card-copy small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-channel-remove{min-height:24px;padding:0 6px;border:1px solid hsl(var(--destructive) / .14);border-radius:7px;background:hsl(var(--destructive) / .07);color:#863232;cursor:pointer;font:inherit;font-size:10.5px;white-space:nowrap}.pp-channel-remove:hover:not(:disabled){background:hsl(var(--destructive) / .12);color:#782626}.pp-channel-fields{display:flex;flex-direction:column;gap:6px;margin-top:7px}.pp-channel-fields label{min-width:0;display:flex;flex-direction:column;gap:3px;color:hsl(var(--muted-foreground));font-size:11px}.pp-channel-fields label>span{color:hsl(var(--foreground));font-weight:560}.pp-channel-fields small{margin-left:5px;color:hsl(var(--destructive));font-size:9px;font-weight:500}.pp-network-layout{width:min(100%,560px);display:grid;grid-template-columns:minmax(132px,.36fr) minmax(0,.64fr);align-items:start;gap:24px}.pp-network-region{position:relative;display:flex;flex-direction:column;gap:7px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-region.is-open{z-index:80}.pp-region-trigger{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.pp-region-trigger:hover,.pp-region-trigger[aria-expanded=true]{border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025)}.pp-region-trigger:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.pp-region-trigger:disabled{cursor:not-allowed;opacity:.58;background:hsl(var(--muted) / .32)}.pp-region-help{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.pp-region-chevron{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s ease}.pp-region-chevron.is-open{transform:rotate(180deg)}.pp-region-menu{position:absolute;top:calc(100% + 6px);right:0;left:0;z-index:81;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12)}.pp-region-option{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;padding:0 9px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;text-align:left;cursor:pointer}.pp-region-option:hover,.pp-region-option:focus-visible,.pp-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.pp-region-option.is-selected{font-weight:600}.pp-region-option svg{width:15px;height:15px;color:hsl(var(--primary))}.pp-network-modes{display:flex;flex-direction:column;gap:9px}.pp-network-option{min-height:28px;display:flex;align-items:center;gap:9px;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-option:has(input:checked){color:hsl(var(--foreground))}.pp-network-option:has(input:disabled){cursor:default;opacity:.58}.pp-network-option input{width:15px;height:15px;flex:0 0 15px;display:grid;place-items:center;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--background));cursor:inherit;transition:border-color .12s ease,box-shadow .12s ease}.pp-network-option input:before{width:7px;height:7px;border-radius:50%;background:hsl(var(--primary));content:"";transform:scale(0);transition:transform .12s ease-out}.pp-network-option input:checked{border-color:hsl(var(--primary))}.pp-network-option input:checked:before{transform:scale(1)}.pp-network-option input:focus-visible,.pp-network-check input:focus-visible,.pp-evaluation-set-option input:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.pp-network-fields{display:flex;flex-direction:column;gap:12px;min-width:0}.pp-network-fields label:not(.pp-network-check){display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-fields small{font-size:10.5px;font-weight:400}.pp-network-check{display:flex;align-items:center;gap:8px;color:hsl(var(--foreground));font-size:12.5px;cursor:pointer}.pp-evaluation-set-option{display:flex;align-items:flex-start;gap:10px;color:hsl(var(--foreground));cursor:pointer}.pp-evaluation-set-option>span{display:flex;flex-direction:column;gap:3px;min-width:0}.pp-evaluation-set-option strong{font-size:13px;font-weight:550;line-height:1.45}.pp-evaluation-set-option small{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.pp-network-check input,.pp-evaluation-set-option input{width:16px;height:16px;flex:0 0 16px;display:grid;place-items:center;margin:0;padding:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid hsl(var(--border));border-radius:4px;background:hsl(var(--background));cursor:inherit;transition:border-color .12s ease,background-color .12s ease,box-shadow .12s ease}.pp-network-check input:before,.pp-evaluation-set-option input:before{width:4px;height:8px;border:solid hsl(var(--primary-foreground));border-width:0 2px 2px 0;content:"";transform:translateY(-1px) rotate(45deg) scale(0);transition:transform .12s ease-out}.pp-network-check input:checked,.pp-evaluation-set-option input:checked{border-color:hsl(var(--primary));background:hsl(var(--primary))}.pp-network-check input:checked:before,.pp-evaluation-set-option input:checked:before{transform:translateY(-1px) rotate(45deg) scale(1)}.pp-env-section{width:100%;padding-bottom:16px}.pp-env-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.pp-env-head .pp-config-label{display:flex;align-items:center;gap:7px;margin-bottom:0}.pp-env-count{display:inline-flex;align-items:center}.pp-env-table{display:flex;flex-direction:column;margin-top:10px}.pp-env-group{padding:4px 7px 0;border:1px solid hsl(var(--border) / .75);border-radius:6px;background:hsl(var(--secondary) / .16)}.pp-env-group-head{display:flex;align-items:center;justify-content:space-between;padding:5px 1px 3px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.pp-env-group-head small{color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:450}.pp-env-group-head-custom{margin-top:12px}.pp-env-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;align-items:center;gap:7px;padding:7px 0;border-bottom:1px solid hsl(var(--border) / .65)}.pp-env-row.is-multiline{align-items:start}.pp-env-row input:first-child{font-family:inherit;font-size:13px}.pp-env-row-derived:last-child{border-bottom:0}.pp-env-key-fixed{background:hsl(var(--secondary) / .32)!important;cursor:default}.pp-env-key-cell{min-width:0;min-height:34px;box-sizing:border-box;display:flex;align-items:center;gap:6px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:6px;color:hsl(var(--foreground));font-size:13px;font-weight:500}.pp-env-key-cell span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-env-help{position:relative;width:15px;height:15px;flex:0 0 15px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));cursor:default;font-size:10px;font-weight:650;line-height:1}.pp-env-help-popover{position:absolute;z-index:80;bottom:calc(100% + 8px);left:50%;width:max-content;max-width:min(320px,72vw);padding:7px 9px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 10px 28px hsl(var(--foreground) / .14);font-size:11.5px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;transform:translate(-50%);opacity:0;pointer-events:none;-webkit-user-select:text;user-select:text}.pp-env-help:hover .pp-env-help-popover,.pp-env-help:focus-visible .pp-env-help-popover,.pp-env-help:focus-within .pp-env-help-popover{opacity:1;pointer-events:auto}.pp-env-help:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.pp-env-value-wrap{min-width:0;display:grid;gap:4px}.pp-env-value{min-width:0;width:100%}.pp-env-json-value{min-height:86px;padding:8px 10px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.45}.pp-env-value[aria-invalid=true]{border-color:hsl(var(--destructive) / .7);box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.pp-env-error{color:hsl(var(--destructive));font-size:11.5px;line-height:1.35}.pp-env-link{width:22px;height:22px;flex:0 0 22px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;color:hsl(var(--muted-foreground));text-decoration:none}.pp-env-link:hover{background:hsl(var(--foreground) / .055);color:hsl(var(--foreground))}.pp-env-link svg{width:13px;height:13px;flex:0 0 13px}.pp-env-source{color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.pp-env-remove{width:28px;height:28px}.pp-env-add{width:100%;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer}.pp-env-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.pp-env-add:disabled{opacity:.5}.pp-steps{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none}.pp-step{position:relative;min-height:34px;display:flex;align-items:flex-start;gap:9px}.pp-step:not(:last-child):after{content:"";position:absolute;top:20px;bottom:-2px;left:9px;width:1px;background:hsl(var(--border))}.pp-step-dot{z-index:1;width:19px;height:19px;flex:0 0 19px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10px}.pp-step-body{min-width:0;display:flex;flex-direction:column;padding-top:1px}.pp-step-label{color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560}.pp-step-msg{max-width:300px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-step.is-active .pp-step-dot{border-color:hsl(var(--primary));color:hsl(var(--primary))}.pp-step.is-done .pp-step-dot{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-step.is-failed .pp-step-dot{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.pp-error{margin:14px 18px;padding:10px 11px;border:1px solid hsl(var(--destructive) / .22);border-radius:5px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.pp-deploy-result{margin:14px 18px 18px;padding:14px;border:1px solid hsl(var(--primary) / .2);border-radius:6px;background:hsl(var(--primary) / .035)}.pp-deploy-result-header{margin-bottom:12px;color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-deploy-result-body{display:flex;flex-direction:column;gap:10px}.pp-deploy-result-warning{display:flex;flex-direction:column;gap:4px;padding:9px 10px;border:1px solid hsl(42 90% 45% / .25);border-radius:6px;background:#f2ad0d12;color:#9e6310;font-size:12.5px;line-height:1.5}.pp-deploy-result-field{display:flex;flex-direction:column;gap:4px}.pp-deploy-result-field label{color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deploy-result-field code{overflow-wrap:anywhere;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px}.pp-deploy-result-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.pp-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;min-height:0}.pp-confirm-head{flex-basis:60px}.pp-confirm-icon{background:#f59f0a1f;color:#ba6708}.pp-confirm-body{padding:24px 20px}.pp-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.pp-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.pp-confirm-actions button{min-width:76px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.pp-confirm-actions button:hover{background:hsl(var(--secondary))}.pp-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.pp-confirm-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-confirm-actions .is-primary:hover{background:hsl(var(--primary) / .9)}.pp-deploy-result-btn,.pp-console-link-btn{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border-radius:5px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer}.pp-deploy-result-btn{border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-console-link-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.spin{animation:pp-spin .85s linear infinite}@keyframes pp-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.pp-channel-card-inner,.pp-channel-card-front,.pp-deployment-select-chevron,.pp-config-actions .pp-deploy{transition:none}}@media (max-width: 1120px){.pp-release-preview{grid-template-columns:minmax(320px,.9fr) minmax(300px,1.1fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.layout{--pp-sidebar-width: 204px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.pp-root.is-deploy{--pp-publish-content-width: min(88%, calc(100% - 36px) )}.pp-toolbar{align-items:flex-start;flex-direction:column;gap:8px}.pp-toolbar-actions{width:100%}.pp-body{overflow-y:auto;flex-direction:column}.pp-root.is-deploy .pp-body{display:flex}.pp-release-overview{flex:0 0 auto;min-height:460px;border-right:0;border-bottom:0}.pp-release-preview{min-width:0;grid-template-columns:minmax(0,1fr);grid-template-rows:220px auto}.pp-release-info{min-height:200px}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:680px;border-top:0;border-left:0}.pp-config-scroll{padding-inline:0;padding-bottom:84px}.pp-config-actions{bottom:max(14px,env(safe-area-inset-bottom))}.pp-flow-backdrop{padding:12px}}@media (max-width: 520px){.pp-auth-fields,.pp-network-layout{grid-template-columns:minmax(0,1fr);gap:16px}.pp-env-section{width:100%}}.ic-root{display:flex;flex-direction:column;height:100%;min-height:0}.ic-body{flex:1;min-height:0;display:flex}.ic-chat{flex:0 0 380px;width:380px;min-width:0;display:flex;flex-direction:column;min-height:0;border-right:1px solid hsl(var(--border))}.ic-transcript{flex:1;min-height:0;overflow-y:auto;padding:24px 20px 12px}.ic-turn{display:flex;gap:10px;max-width:760px;margin:0 auto 16px}.ic-turn:last-child{margin-bottom:0}.ic-turn--assistant{justify-content:flex-start}.ic-turn--user{justify-content:flex-end}.ic-avatar{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:hsl(var(--secondary));color:#7c48f4}.ic-avatar-icon{width:17px;height:17px}.ic-bubble{max-width:78%;padding:11px 15px;border-radius:16px;font-size:14px;line-height:1.6;word-break:break-word}.ic-turn--user .ic-bubble{white-space:pre-wrap}.ic-turn--assistant .ic-bubble{background:hsl(var(--secondary));color:hsl(var(--foreground));border-top-left-radius:5px}.ic-turn--user .ic-bubble{background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-top-right-radius:5px}.ic-bubble .md>:first-child{margin-top:0}.ic-bubble .md>:last-child{margin-bottom:0}.ic-bubble--typing{display:inline-flex;align-items:center;gap:4px;padding:14px 16px}.ic-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground));animation:ic-bounce 1.2s ease-in-out infinite}.ic-dot:nth-child(2){animation-delay:.16s}.ic-dot:nth-child(3){animation-delay:.32s}@keyframes ic-bounce{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.ic-error{flex-shrink:0;display:flex;align-items:center;gap:8px;max-width:760px;width:100%;margin:0 auto;padding:9px 14px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px;line-height:1.45}.ic-error-icon{width:15px;height:15px;flex-shrink:0}.ic-composer{flex-shrink:0;max-width:760px;width:100%;margin:0 auto;padding:8px 20px 18px}.ic-composer-box{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background));transition:border-color .15s,box-shadow .15s}.ic-composer-box:focus-within{border-color:hsl(var(--ring) / .4);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.ic-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 2px;max-height:160px;overflow-y:auto}.ic-input::placeholder{color:hsl(var(--muted-foreground))}.ic-input:disabled{opacity:.6}.ic-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.ic-send-icon{width:17px;height:17px}.ic-send:hover:not(:disabled){opacity:.85}.ic-send:active:not(:disabled){transform:scale(.94)}.ic-send:disabled{opacity:.3;cursor:default}.ic-composer-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.ic-composer-hint{flex:1;text-align:center;font-size:11px;color:hsl(var(--muted-foreground))}.ic-ab-toggle{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;cursor:pointer;-webkit-user-select:none;user-select:none}.ic-ab-checkbox{position:absolute;opacity:0;width:0;height:0}.ic-ab-track{position:relative;display:inline-block;width:30px;height:17px;border-radius:999px;background:hsl(var(--muted-foreground) / .35);transition:background .15s}.ic-ab-thumb{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}.ic-ab-checkbox:checked+.ic-ab-track{background:hsl(var(--primary))}.ic-ab-checkbox:checked+.ic-ab-track .ic-ab-thumb{transform:translate(13px)}.ic-ab-checkbox:disabled+.ic-ab-track{opacity:.5}.ic-ab-checkbox:focus-visible+.ic-ab-track{box-shadow:0 0 0 3px hsl(var(--ring) / .25)}.ic-ab-label{font-size:12px;font-weight:600;color:hsl(var(--foreground))}.ic-compare{flex:1;min-height:0;display:flex}.ic-compare-divider{flex:0 0 1px;background:hsl(var(--border))}.ic-pane{flex:1 1 0;min-width:0;min-height:0;display:flex;flex-direction:column}.ic-pane-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background))}.ic-pane-title{display:flex;align-items:center;gap:8px;min-width:0}.ic-pane-tag{flex-shrink:0;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff}.ic-pane-tag--a{background:#7c48f4}.ic-pane-tag--b{background:#0da2e7}.ic-pane-model{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ic-adopt{flex-shrink:0;padding:6px 12px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font-size:12px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.ic-adopt:hover:not(:disabled){opacity:.85}.ic-adopt:active:not(:disabled){transform:scale(.96)}.ic-adopt:disabled{opacity:.4;cursor:default}.ic-pane-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ic-pane-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-size:13px;color:hsl(var(--muted-foreground))}.ic-pane-spinner{width:22px;height:22px;color:#7c48f4;animation:ic-spin .9s linear infinite}@keyframes ic-spin{to{transform:rotate(360deg)}}.ic-pane-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.ic-preview{flex:1 1 0;min-width:0;display:flex;flex-direction:column;min-height:0;background:hsl(var(--muted) / .35)}.ic-preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.ic-preview-empty-icon{position:relative;display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:18px;background:#7c48f414;color:#7c48f4;margin-bottom:4px}.ic-preview-empty-glyph{width:30px;height:30px}.ic-preview-empty-spark{position:absolute;top:9px;right:9px;width:14px;height:14px}.ic-preview-empty-title{font-size:15px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.ic-preview-empty-sub{font-size:13px;line-height:1.55;color:hsl(var(--muted-foreground));max-width:240px}@media (max-width: 920px){.ic-body{flex-direction:column}.ic-preview{width:100%;border-left:none;border-top:1px solid hsl(var(--border));min-height:320px}}@layer components{._Container_1tuad_1{position:relative;display:flex}._Container_1tuad_1[data-has-label]{align-items:flex-start}._Container_1tuad_1[data-orientation=right]{flex-direction:row-reverse}._Container_1tuad_1>input{right:0;bottom:0;left:0;height:1px!important;transform:none!important}._Checkbox_1tuad_22{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:18px;max-width:18px;height:18px;padding:0;border-radius:var(--radius-xs);background-color:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}._Checkbox_1tuad_22,:where([data-theme=light]) ._Checkbox_1tuad_22{border:1px solid var(--gray-200)}:where([data-theme=dark]) ._Checkbox_1tuad_22{border:1px solid var(--gray-500)}[data-has-label] ._Checkbox_1tuad_22{top:1px}@media (hover: hover) and (pointer: fine){._Checkbox_1tuad_22:where(:not([data-disabled],[data-state=checked])):hover,:where([data-theme=light]) ._Checkbox_1tuad_22:where(:not([data-disabled],[data-state=checked])):hover{border-color:var(--gray-300)}:where([data-theme=dark]) ._Checkbox_1tuad_22:where(:not([data-disabled],[data-state=checked])):hover{border-color:var(--gray-600)}}._Checkbox_1tuad_22[data-state=indeterminate],._Checkbox_1tuad_22[data-state=checked]{border-color:var(--gray-900);background-color:var(--gray-900)}._Checkbox_1tuad_22:focus{outline:none}._Checkbox_1tuad_22:focus-visible{outline:2px solid var(--color-ring);outline-offset:2px}._Checkbox_1tuad_22[data-disabled]{cursor:not-allowed}._Checkbox_1tuad_22[data-disabled],:where([data-theme=light]) ._Checkbox_1tuad_22[data-disabled]{border-color:var(--gray-150);background:var(--gray-25)}:where([data-theme=dark]) ._Checkbox_1tuad_22[data-disabled]{border-color:var(--gray-300);background:var(--gray-200)}._Checkbox_1tuad_22[data-disabled][data-state=checked],:where([data-theme=light]) ._Checkbox_1tuad_22[data-disabled][data-state=checked]{border-color:var(--gray-300);background-color:var(--gray-300)}:where([data-theme=dark]) ._Checkbox_1tuad_22[data-disabled][data-state=checked]{border-color:var(--gray-200);background-color:var(--gray-200)}._CheckMark_1tuad_92{position:absolute;top:0;left:0;width:64%;height:32%;transform:rotate(-45deg) translate(-10%,100%);transform-origin:center;transition:opacity .15s ease,transform .15s ease}@starting-style{._CheckMark_1tuad_92{opacity:0}}[data-state=indeterminate] ._CheckMark_1tuad_92{transform:translate(30%,80%)}[data-state=indeterminate] ._CheckMark_1tuad_92:before{opacity:0}._CheckMark_1tuad_92:before,._CheckMark_1tuad_92:after{position:absolute;display:block;background:var(--gray-0);content:"";will-change:transform}@starting-style{._CheckMark_1tuad_92:before,._CheckMark_1tuad_92:after{transform:scale(0)}}:where([data-theme=dark]) ._CheckMark_1tuad_92[data-disabled]:before,:where([data-theme=dark]) ._CheckMark_1tuad_92[data-disabled]:after{background:var(--gray-100)}._CheckMark_1tuad_92:before{top:0;bottom:0;left:0;width:2px;transform-origin:0 0;transition:transform .1s ease 80ms,opacity .2s ease}._CheckMark_1tuad_92 [data-state=indeterminate]:before{opacity:0}._CheckMark_1tuad_92:after{right:0;bottom:0;left:0;height:2px;transform-origin:0 100%;transition:transform .1s ease .16s}._Label_1tuad_162{display:flex;align-items:center;min-height:20px;cursor:pointer;font-size:14px;line-height:20px}[data-disabled] ._Label_1tuad_162{cursor:not-allowed}[data-orientation=left] ._Label_1tuad_162{padding-left:8px}[data-orientation=right] ._Label_1tuad_162{padding-right:8px}}@layer components{._RadioGroup_onrfm_1{display:flex;gap:var(--radio-group-row-gap)}._RadioGroup_onrfm_1:where([data-direction=col]){flex-direction:column;gap:var(--radio-group-col-gap)}._RadioLabel_onrfm_9{display:inline-flex;flex-direction:row;align-items:flex-start;gap:var(--radio-group-item-gap);cursor:pointer;font-size:var(--radio-group-item-font-size);line-height:var(--radio-group-item-line-height)}._RadioLabel_onrfm_9[data-disabled]{cursor:not-allowed;opacity:.5}._RadioLabel_onrfm_9[data-block]{width:100%}._RadioIndicatorWrapper_onrfm_26{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;height:var(--radio-group-item-line-height)}._RadioIndicatorWrapper_onrfm_26>input{right:0;bottom:0;left:0;height:1px!important;transform:none!important}._RadioItem_onrfm_43{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--radio-group-indicator-size);height:var(--radio-group-indicator-size);padding:0;border:none;border-radius:var(--radius-full);background-color:transparent;box-shadow:0 0 0 1px var(--radio-group-indicator-border-color) inset;cursor:pointer;transition-duration:var(--transition-duration-basic);transition-property:box-shadow;transition-timing-function:var(--transition-ease-basic)}@media (hover: hover) and (pointer: fine){._RadioItem_onrfm_43:where(:not([data-disabled])):hover{box-shadow:0 0 0 1px var(--radio-group-indicator-border-color-hover) inset}}._RadioItem_onrfm_43[data-disabled]{cursor:not-allowed}._RadioItem_onrfm_43:focus{outline:none}._RadioItem_onrfm_43:focus-visible{outline:2px solid var(--color-ring);outline-offset:2px}._RadioIndicator_onrfm_26{position:relative;display:inline-grid;align-items:center;justify-content:center;width:100%;height:100%}._RadioIndicator_onrfm_26:before,._RadioIndicator_onrfm_26:after{display:block;content:"";grid-column-start:1;grid-row-start:1;place-self:center center;will-change:transform}._RadioIndicator_onrfm_26:before{width:var(--radio-group-indicator-size);height:var(--radio-group-indicator-size);border-radius:var(--radius-full);animation:_fade-in_onrfm_1 .6s var(--cubic-enter);background-color:var(--radio-group-indicator-background-color)}._RadioIndicator_onrfm_26:after{width:var(--radio-group-indicator-hole-size);height:var(--radio-group-indicator-hole-size);border-radius:var(--radius-full);animation:_scale-in_onrfm_1 .6s var(--cubic-enter);background-color:var(--radio-group-indicator-hole-background-color)}@keyframes _scale-in_onrfm_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _fade-in_onrfm_1{0%{opacity:0}to{opacity:1}}}.cw-root{--cw-workspace-gutter: 10px;--cw-workspace-width: 60%;--cw-workbench-toolbar-height: 64px;--cw-workspace-ink: 222 24% 13%;--cw-workspace-accent: 162 44% 32%;--cw-workspace-accent-soft: 156 34% 92%;--cw-workspace-warm: 42 28% 96%;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground));background:hsl(var(--background))}.cw-root.is-validate{--cw-workspace-width: min(88%, 1440px)}.cw-root.is-publish{--cw-workspace-width: min(80%, 1180px)}.cw-workspace-header{position:relative;z-index:12;flex:0 0 auto;width:var(--cw-workspace-width);min-height:48px;display:flex;justify-content:center;align-items:center;margin:12px auto 0;padding:8px 0;background:transparent}.cw-workspace-header h1{margin:0;color:hsl(var(--foreground));font-size:22px;font-weight:700;line-height:1.25;letter-spacing:-.02em;white-space:nowrap}.cw-workspace-main{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;width:var(--cw-workspace-width);margin:0 auto;padding:8px 0 20px;background:transparent}.cw-workspace-footer{flex:0 0 auto;display:flex;flex-direction:column;width:var(--cw-workspace-width);gap:12px;margin:0 auto 24px;padding:12px 0 4px;background:transparent}.cw-workspace-nav-actions{width:100%;display:grid;grid-template-columns:minmax(120px,1fr) auto minmax(120px,1fr);align-items:center;gap:12px;margin:0 auto}.cw-workspace-nav-actions.has-assistant{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"assistant next"}.cw-workspace-nav-actions.has-assistant>.cw-workspace-nav-button:first-child,.cw-workspace-nav-actions.has-assistant>span[aria-hidden=true]{display:none}.cw-workspace-nav-actions.has-assistant>.cw-workspace-ai-slot{grid-area:assistant}.cw-publish-action-slot{grid-column:3;display:flex;justify-content:flex-end}.cw-publish-action-slot .pp-deploy{position:static;min-width:70px;min-height:38px;transform:none}.cw-workspace-nav-actions.has-assistant>.cw-workspace-nav-button:last-child{grid-area:next}.cw-workspace-ai-slot{min-width:0}.cw-workspace-nav-button{min-height:36px;justify-self:start;padding:0 18px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:background-color .16s ease,border-color .16s ease}.cw-workspace-nav-button:last-child{justify-self:end}.cw-workspace-nav-button:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--muted) / .55)}.cw-workspace-nav-button.is-primary{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.cw-workspace-nav-button.is-primary:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.cw-workspace-nav-button:focus-visible,.cw-workspace-progress button:focus-visible{outline:2px solid hsl(var(--primary) / .35);outline-offset:2px}.cw-workspace-nav-button:disabled{cursor:not-allowed;opacity:.5}.cw-workspace-nav-button.is-placeholder{visibility:hidden;pointer-events:none}.cw-workspace-progress{width:min(132px,40vw);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0 auto}.cw-workspace-progress button{height:12px;padding:4px 0;border:0;background:transparent;cursor:pointer}.cw-workspace-progress button>span{display:block;height:3px;border-radius:999px;background:hsl(var(--muted-foreground) / .16);transition:background-color .16s ease}.cw-workspace-progress button.is-complete>span,.cw-workspace-progress button.is-active>span{background:hsl(var(--foreground) / .46)}.cw-workspace-progress button.is-active>span{height:4px}.cw-workspace-progress button:disabled{cursor:not-allowed}@media (prefers-reduced-motion: reduce){.cw-workspace-nav-button,.cw-workspace-progress button>span{transition:none}}.cw-build-workspace{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-ai-compose{min-width:0}.cw-ai-compose-entry{min-width:0;display:grid;gap:6px}.cw-ai-compose-form{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:4px 4px 4px 16px;border-radius:16px;background:hsl(var(--panel));box-shadow:inset 0 0 0 1px hsl(var(--border) / .7),0 8px 24px hsl(var(--foreground) / .05);transition:background-color .18s ease,box-shadow .18s ease}.cw-ai-compose.is-generating .cw-ai-compose-form{background:hsl(var(--muted) / .7);box-shadow:inset 0 0 0 1px hsl(var(--foreground) / .05)}.cw-ai-compose-form input{min-width:0;height:38px;min-height:38px;padding:6px 0;border:0;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;line-height:20px}.cw-ai-compose-form input::placeholder{color:hsl(var(--muted-foreground) / .72)}.cw-ai-compose-form:has(input:focus-visible){background:hsl(var(--background));box-shadow:0 0 0 2px hsl(var(--ring) / .12),inset 0 0 0 1px hsl(var(--ring) / .24)}.cw-ai-compose-form input:focus,.cw-ai-compose-form input:focus-visible{outline:none;box-shadow:none}.cw-ai-compose.is-generating .cw-ai-compose-form input{color:hsl(var(--muted-foreground) / .78);cursor:wait}.cw-ai-compose-form button{height:38px;min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 16px;border:0;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:650;white-space:nowrap;transition:background-color .15s ease,opacity .15s ease}.cw-ai-compose-form button:hover:not(:disabled){background:hsl(var(--foreground) / .86)}.cw-ai-compose-form button:disabled{cursor:not-allowed;opacity:.34}.cw-ai-requirement-error{margin:0;padding:0 16px;color:hsl(var(--destructive));font-size:12px;line-height:18px}.cw-ai-compose.is-generating .cw-ai-compose-form button:disabled{width:34px;padding:0;background:hsl(var(--foreground));opacity:1}.cw-ai-orb{width:14px;height:14px;display:block;border:1.5px solid hsl(var(--background) / .34);border-top-color:hsl(var(--background));border-radius:50%;animation:cw-ai-orb-spin .72s linear infinite}.cw-ai-orb>span{display:none}@keyframes cw-ai-orb-spin{to{transform:rotate(360deg)}}.cw-ai-compose-success{min-height:38px;display:flex;align-items:center;justify-content:flex-end;gap:7px;padding:2px 3px 2px 10px;border-radius:12px;background:hsl(var(--background) / .7);box-shadow:inset 0 0 0 1px hsl(var(--foreground) / .055);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.cw-ai-compose-success strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:650}.cw-ai-success-check{position:relative;width:18px;height:18px;flex:0 0 18px;border-radius:50%;background:hsl(var(--foreground))}.cw-ai-success-check:after{position:absolute;top:3px;left:6px;width:4px;height:7px;border:solid hsl(var(--background));border-width:0 2px 2px 0;content:"";transform:rotate(45deg)}.cw-ai-regenerate{height:34px;min-height:34px;padding:0 12px;border:0;border-radius:9px;background:hsl(var(--muted));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;transition:background-color .15s ease}.cw-ai-regenerate:hover{background:hsl(var(--muted-foreground) / .12)}.cw-ai-compose-form button:focus-visible,.cw-ai-regenerate:focus-visible{outline:2px solid hsl(var(--primary) / .35);outline-offset:2px}@media (prefers-reduced-motion: reduce){.cw-ai-compose-form,.cw-ai-compose-form button,.cw-ai-regenerate{transition:none}.cw-ai-orb{animation:none}}.cw-ai-error-dialog{width:460px;font-family:inherit}.cw-ai-error-message{max-height:min(320px,50vh);margin:10px 0 18px;overflow:auto;color:hsl(var(--foreground) / .78);font-family:inherit;font-size:13px;line-height:1.65;overflow-wrap:anywhere;white-space:pre-wrap}.cw-ai-error-close{border-color:transparent;background:hsl(var(--foreground));color:hsl(var(--background))}.cw-ai-error-close:hover{background:hsl(var(--foreground) / .86)}.cw-workspace-alert{position:absolute;z-index:30;top:94px;right:18px;max-width:min(420px,calc(100% - 36px));padding:10px 13px;border:1px solid hsl(var(--destructive) / .2);border-radius:9px;background:hsl(var(--background));box-shadow:0 12px 36px hsl(var(--foreground) / .12);color:hsl(var(--destructive));font-size:12.5px}.cw-editor{flex:1;width:100%;min-height:0;display:flex;flex-direction:column;align-items:stretch;gap:14px;padding:0;overflow:hidden}.cw-editor>.abc-root{flex:0 0 200px;width:100%;min-width:0;min-height:200px;overflow:hidden;border-radius:12px;background:hsl(var(--background));box-shadow:none}.cw-tree{flex-shrink:0;width:248px;overflow-y:auto;padding:16px 14px;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.cw-tree-head{font-size:12px;font-weight:650;letter-spacing:.02em;color:hsl(var(--muted-foreground));padding:0 6px;margin-bottom:10px}.cw-tree-branch{display:flex;flex-direction:column}.cw-tree-node{position:relative;display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:13px;border:1px solid transparent;transition:background .12s ease,border-color .12s ease}.cw-tree-node:hover{background:hsl(var(--accent))}.cw-tree-node.is-selected{background:hsl(var(--primary) / .04);border-color:hsl(var(--primary) / .16)}.cw-tree-node.is-invalid{background:hsl(var(--destructive) / .07);border-color:hsl(var(--destructive) / .5)}.cw-tree-node.is-invalid.is-selected{background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .6)}.cw-tree-node.is-draggable{cursor:grab}.cw-tree-node.is-draggable:active{cursor:grabbing}.cw-tree-node.is-dragover{background:hsl(var(--primary) / .1);border-color:hsl(var(--primary) / .45)}.cw-tree-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.cw-tree-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.cw-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.cw-tree-type{font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:hsl(var(--muted-foreground))}.cw-tree-actions{display:flex;align-items:center;gap:1px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .12s ease}.cw-tree-node:hover .cw-tree-actions,.cw-tree-node.is-selected .cw-tree-actions{opacity:1;pointer-events:auto}.cw-tree-children{display:flex;flex-direction:column;gap:2px;margin-top:2px;margin-left:8px;padding-left:8px;border-left:1px solid hsl(var(--border))}.cw-detail{position:relative;flex:1 1 auto;width:100%;max-width:none;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:12px;background:hsl(var(--background));box-shadow:none}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable;padding:0 4px 16px;background:hsl(var(--background))}.cw-detail-inner{max-width:none;margin:0 auto}.cw-lower{display:flex;gap:0;align-items:flex-start}.cw-detail .cw-form-col{flex:1;min-width:0;max-width:none;margin:0}.cw-debug{flex-shrink:0;width:380px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid hsl(var(--border));background:hsl(var(--panel));transition:width .22s cubic-bezier(.22,1,.36,1),min-width .22s cubic-bezier(.22,1,.36,1),height .22s cubic-bezier(.22,1,.36,1),min-height .22s cubic-bezier(.22,1,.36,1),flex-basis .22s cubic-bezier(.22,1,.36,1),padding .18s ease}.cw-debug:not(.is-collapsed)>*{animation:cw-debug-content-in .18s ease-out both}.cw-debug.is-collapsed .cw-debug-expand{animation:cw-debug-control-in .18s .06s ease-out both}@keyframes cw-debug-content-in{0%{opacity:0;transform:scale(.985)}}@keyframes cw-debug-control-in{0%{opacity:0;transform:scale(.9)}}@media (prefers-reduced-motion: reduce){.cw-debug{transition:none}.cw-debug:not(.is-collapsed)>*,.cw-debug.is-collapsed .cw-debug-expand{animation:none}}.cw-debug-head{flex-shrink:0;height:var(--cw-workbench-toolbar-height);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid hsl(var(--border))}.cw-debug-collapse,.cw-debug-expand{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s,background .12s,transform .12s}.cw-debug-collapse{width:24px;height:24px}.cw-debug-collapse:hover,.cw-debug-expand:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.cw-debug-expand:hover{transform:scale(1.06)}.cw-debug.is-collapsed{width:48px;min-width:48px;height:100%;min-height:0;align-items:center;padding-top:14px}.cw-debug-expand{width:34px;height:34px;min-height:34px}.cw-debug-title{display:inline-flex;align-items:center;gap:7px;font-size:17px;font-weight:650;color:hsl(var(--foreground))}.cw-debug-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:#111;box-shadow:none;color:#fff;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .18s cubic-bezier(.22,1,.36,1),box-shadow .18s ease,transform .15s ease}.cw-debug-start:hover:not(:disabled){background:#29292b;box-shadow:0 7px 18px #00000029}.cw-debug-start:active:not(:disabled){transform:translateY(0) scale(.98)}.cw-debug-start:disabled{opacity:.45;cursor:default}.cw-debug-sub{flex-shrink:0;display:flex;flex-direction:column;gap:3px;padding:10px 16px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.cw-debug-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.cw-debug-body{flex:1;min-height:0;overflow-y:auto;padding:10px 16px 18px}.cw-debug-empty{min-height:120px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:14px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-run-icon{width:17px;height:17px;transition:transform .16s cubic-bezier(.22,1,.36,1)}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:translate(1.5px)}@media (prefers-reduced-motion: reduce){.cw-debug-run-icon{transition:none}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:none}}.cw-debug-progress{display:flex;flex-direction:column;gap:8px}.cw-debug-logline{display:flex;align-items:center;gap:8px;min-height:28px;padding:7px 9px;border-radius:9px;background:hsl(var(--foreground) / .04);color:hsl(var(--muted-foreground));font-size:12.5px}.cw-debug-logline .cw-i{color:hsl(var(--foreground))}.cw-debug-error{display:flex;flex-direction:column;gap:12px;color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-debug-error-detail,.cw-debug-msg-error{width:100%;min-width:0;color:hsl(var(--destructive));text-align:left}.cw-debug-error-detail .deploy-error-message-text,.cw-debug-msg-error .deploy-error-message-text{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px}.cw-debug-chat{min-height:100%;display:flex;flex-direction:column;gap:18px}.cw-debug-chat-empty{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-msg{display:flex;flex-direction:column;gap:6px;max-width:100%}.cw-debug-msg-user{align-items:flex-end}.cw-debug-msg-assistant{align-items:flex-start}.cw-debug-role{display:none}.cw-debug-content{max-width:100%;color:hsl(var(--foreground));font-size:14px;line-height:1.65;word-break:break-word}.cw-debug-msg-user .cw-debug-content{max-width:88%;padding:9px 14px;border-radius:18px;background:hsl(var(--secondary))}.cw-debug-msg-assistant .cw-debug-content{width:100%}.cw-debug-composer{flex-shrink:0;padding:10px 14px 14px;background:hsl(var(--panel))}.cw-debug-composerbox{display:flex;align-items:center;gap:6px;padding:6px 6px 6px 10px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background))}.cw-debug-input{flex:1;min-width:0;max-height:120px;padding:8px 4px;border:none;outline:none;resize:none;overflow-y:auto;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.5}.cw-debug-input::placeholder{color:hsl(var(--muted-foreground))}.cw-debug-send{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;cursor:pointer;transition:opacity .15s,transform .1s,background .12s,color .12s}.cw-debug-send{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-debug-send:hover:not(:disabled){opacity:.85}.cw-debug-send:active:not(:disabled){transform:scale(.94)}.cw-debug-send:disabled{opacity:.3;cursor:default}.cw-debug-overlay{position:absolute;z-index:5;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:22px;background:hsl(var(--panel) / .5);backdrop-filter:blur(9px) saturate(.9);-webkit-backdrop-filter:blur(9px) saturate(.9)}.cw-debug-overlay-content{width:min(100%,290px);display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px;border:1px solid hsl(var(--border) / .72);border-radius:12px;background:hsl(var(--background) / .82);box-shadow:0 10px 30px hsl(var(--foreground) / .08);text-align:center}.cw-debug-overlay-title{color:hsl(var(--foreground));font-size:14px;font-weight:650}.cw-debug-overlay-copy{color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55}.cw-debug-overlay-progress{width:100%;display:flex;flex-direction:column;gap:8px}.cw-debug-overlay-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:2px}.cw-debug-ignore{min-height:30px;padding:6px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,transform .1s}.cw-debug-ignore:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.cw-debug-ignore:active:not(:disabled){transform:scale(.96)}.cw-debug-ignore:disabled{opacity:.45;cursor:default}.cw-validation-workspace{position:relative;flex:1;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.cw-optimization-panel{min-width:0;min-height:0;display:flex;flex-direction:column;padding:22px 16px 16px;border-right:1px solid hsl(var(--border));background:hsl(var(--cw-workspace-warm))}.cw-optimization-head{display:flex;flex-direction:column;gap:5px;padding:0 4px 18px}.cw-optimization-head>span{color:hsl(var(--cw-workspace-ink));font-size:16px;font-weight:700;letter-spacing:-.02em}.cw-optimization-head>small{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45}.cw-optimization-list{display:flex;flex-direction:column;gap:8px}.cw-optimization-option{position:relative;width:100%;display:flex;align-items:flex-start;gap:9px;padding:11px;border:1px solid hsl(var(--border) / .82);border-radius:11px;background:hsl(var(--panel) / .62);color:hsl(var(--foreground));cursor:pointer;transition:background-color .14s ease,border-color .14s ease,box-shadow .14s ease}.cw-optimization-option:hover{border-color:hsl(var(--cw-workspace-ink) / .24);background:hsl(var(--panel))}.cw-optimization-option.is-disabled{cursor:not-allowed;opacity:.62}.cw-optimization-option.is-disabled:hover{border-color:hsl(var(--border) / .82);background:hsl(var(--panel) / .62)}.cw-optimization-option:has(input:focus-visible){outline:2px solid hsl(var(--cw-workspace-ink) / .34);outline-offset:2px}.cw-optimization-option input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}.cw-optimization-check{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;margin-top:1px;border:1px solid hsl(var(--foreground) / .24);border-radius:5px;background:hsl(var(--panel));color:#fff}.cw-optimization-check .cw-i{width:11px;height:11px;stroke-width:2.4}.cw-optimization-copy{min-width:0;display:flex;flex-direction:column;gap:4px}.cw-optimization-copy strong{color:hsl(var(--cw-workspace-ink));font-size:12.5px;font-weight:650}.cw-optimization-copy small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.45}.cw-validation-content{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;background:hsl(var(--background))}.cw-ab-workspace{flex:1;min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;background:hsl(var(--background))}.cw-ab-stage{position:relative;flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{min-height:100%;display:grid;grid-template-columns:repeat(var(--cw-ab-column-count),minmax(0,1fr));grid-auto-rows:minmax(420px,1fr);align-items:stretch;gap:12px}.cw-ab-card{min-width:0;min-height:420px;display:flex;flex-direction:column;perspective:1400px}.cw-ab-card-inner{position:relative;width:100%;min-height:420px;flex:1;transform-style:preserve-3d;transition:transform .44s cubic-bezier(.22,1,.36,1)}.cw-ab-card-inner.is-flipped{transform:rotateY(180deg)}.cw-ab-card-face{position:absolute;top:0;right:0;bottom:0;left:0;min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px dashed hsl(var(--foreground) / .2);border-radius:16px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden;transition:border-color .16s ease,background-color .16s ease}.cw-ab-card-back{transform:rotateY(180deg);overflow-x:hidden;overflow-y:auto}.cw-ab-card-head{min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px 9px 14px}.cw-ab-card-title{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ab-card-title strong{font-size:13.5px;font-weight:680}.cw-ab-card-title span{max-width:150px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-ab-card-actions{flex:0 0 auto;display:flex;align-items:center;gap:4px}.cw-ab-config-trigger,.cw-ab-remove{min-height:28px;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 8px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11px;font-weight:400}.cw-ab-config-trigger{background:transparent;color:hsl(var(--muted-foreground))}.cw-ab-config-trigger:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-remove:hover{background:hsl(var(--secondary) / .62);color:hsl(var(--foreground))}.cw-ab-config-trigger:disabled,.cw-ab-remove:disabled{cursor:default;opacity:.45}.cw-ab-remove{width:28px;padding:0;background:transparent}.cw-ab-config-head{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 10px;background:hsl(var(--background) / .94)}.cw-ab-config-head>div{min-width:0;display:flex;flex-direction:column;gap:3px}.cw-ab-config-head strong{font-size:16px;font-weight:680}.cw-ab-config-head span{color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-config-head>.cw-ab-config-head-actions{flex:0 0 auto;display:inline-flex;flex-direction:row;align-items:center;gap:6px}.cw-ab-config-head-actions .cw-ab-config-remove{width:32px;height:32px}.cw-ab-config-done{min-height:32px;padding:0 11px;border:0;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:650}.cw-ab-config-done-wrap{position:relative;flex:0 0 auto;display:inline-flex;border-radius:8px}.cw-ab-config-done:disabled{background:hsl(var(--secondary) / .82);color:hsl(var(--muted-foreground) / .68);cursor:not-allowed}.cw-ab-config-head .cw-ab-config-done-tip{position:absolute;z-index:8;right:0;top:calc(100% + 7px);bottom:auto;width:max-content;max-width:190px;padding:6px 8px;border-radius:7px;background:hsl(var(--foreground));color:#fff;font-size:11px;font-weight:400;line-height:1.4;opacity:0;pointer-events:none;transform:translateY(3px);transition:opacity .14s ease,transform .14s ease}.cw-ab-config-done-wrap.is-disabled:hover .cw-ab-config-done-tip,.cw-ab-config-done-wrap.is-disabled:focus-visible .cw-ab-config-done-tip{opacity:1;transform:translateY(0)}.cw-ab-config-done-wrap:focus-visible{outline:2px solid hsl(var(--foreground) / .18);outline-offset:2px}.cw-ab-config{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:12px;padding:12px 16px 16px;background:hsl(var(--background))}.cw-ab-config>label,.cw-ab-config fieldset{min-width:0;display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0}.cw-ab-config>label>span,.cw-ab-config legend{color:hsl(var(--muted-foreground));font-size:13px;font-weight:650}.cw-ab-config legend{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-ab-config legend em{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px;font-style:normal;font-weight:550}.cw-ab-config input[type=text],.cw-ab-config>label>input,.cw-ab-config>label>textarea{width:100%;min-height:40px;padding:8px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px}.cw-ab-config>label>textarea{min-height:58px;max-height:132px;resize:vertical;line-height:1.55}.cw-ab-optimization-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cw-ab-optimization-checkbox{display:inline-flex;align-items:center;gap:0;padding:8px 9px;border-radius:8px;background:hsl(var(--background) / .82);color:hsl(var(--foreground));font-size:12.5px;cursor:not-allowed;opacity:.5}.cw-ab-optimization-checkbox>label{padding-left:7px;color:inherit;font-size:inherit}.cw-ab-config>p{margin:0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.cw-ab-conversation{flex:1;min-height:0;overflow-y:auto;padding:14px}.cw-ab-empty{height:100%;min-height:210px;display:grid;place-items:center;color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-launch{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center}.cw-ab-launch-hint{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-ab-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.cw-ab-starting{align-content:center;gap:8px}.cw-ab-starting .cw-i{width:18px;height:18px}.cw-ab-start{min-width:118px;min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 13px;border:0;border-radius:9px;background:hsl(var(--secondary) / .72);color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:580;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-start:hover:not(:disabled){background:hsl(var(--secondary));box-shadow:none}.cw-ab-start:disabled{background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground) / .62);cursor:not-allowed}.cw-ab-start .cw-i{width:15px;height:15px}.cw-ab-deploy-footer{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.cw-ab-deploy{min-height:32px;padding:0 13px;border:0;border-radius:8px;background:#111;color:#fff;cursor:pointer;font:inherit;font-size:11.5px;font-weight:620;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-deploy:hover:not(:disabled){background:#29292b;box-shadow:0 6px 16px #00000024}.cw-ab-deploy:disabled{cursor:not-allowed;opacity:.42}.cw-ab-add{min-height:48px;align-self:stretch;justify-content:center;padding-inline:18px;white-space:nowrap}.cw-ab-composer{position:relative;z-index:2;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:12px;padding:18px var(--cw-workspace-gutter) 18px;background:hsl(var(--background))}.cw-ab-composer .cw-debug-composerbox{width:100%;min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;background:#fff;box-shadow:0 8px 22px hsl(var(--foreground) / .045)}.cw-ab-composer .cw-debug-input{background:#fff}.cw-debug.is-standalone{flex:1;width:100%;min-width:0;border-left:0;background:transparent}.cw-debug.is-standalone .cw-debug-head{height:58px;padding-inline:22px;background:hsl(var(--panel) / .7)}.cw-debug.is-standalone .cw-debug-title{font-size:15px}.cw-debug.is-standalone .cw-debug-body{padding:22px clamp(18px,5vw,72px) 28px}.cw-debug.is-standalone .cw-debug-chat{width:min(100%,840px);margin:0 auto}.cw-debug.is-standalone .cw-debug-chat-empty{min-height:260px;border:1px dashed hsl(var(--border));border-radius:16px;background:hsl(var(--panel) / .56)}.cw-debug.is-standalone .cw-debug-composer{padding:12px 210px 20px clamp(18px,5vw,72px);background:transparent}.cw-debug.is-standalone .cw-debug-composerbox{width:min(100%,840px);min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;box-shadow:0 12px 32px hsl(var(--foreground) / .06)}.cw-debug.is-standalone .cw-debug-overlay{background:hsl(var(--background) / .68)}.cw-debug.is-standalone .cw-debug-overlay-content{width:min(100%,390px);padding:28px;border-radius:16px}.cw-validation-prototype{flex:1;min-width:0;min-height:0;overflow-y:auto;padding:clamp(26px,4vw,56px)}.cw-validation-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:0 auto 28px;max-width:1040px}.cw-eyebrow{color:hsl(var(--cw-workspace-accent));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10px;font-weight:700;letter-spacing:.15em}.cw-validation-page-head h2{margin:5px 0 4px;color:hsl(var(--cw-workspace-ink));font-size:clamp(24px,3vw,34px);font-weight:720;letter-spacing:-.045em}.cw-validation-page-head p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.cw-prototype-action{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 14px;border:1px solid hsl(var(--cw-workspace-ink));border-radius:8px;background:hsl(var(--cw-workspace-ink));color:hsl(var(--background));font:inherit;font-size:12px;font-weight:650}.cw-prototype-action:disabled{cursor:not-allowed;opacity:.72}.cw-dataset-summary,.cw-variant-grid,.cw-metric-board,.cw-prototype-table,.cw-run-list,.cw-prototype-note{width:min(100%,1040px);margin-inline:auto}.cw-dataset-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 10px 32px hsl(var(--foreground) / .035)}.cw-dataset-summary>div{display:flex;flex-direction:column;gap:4px;padding:17px 20px}.cw-dataset-summary>div+div{border-left:1px solid hsl(var(--border))}.cw-dataset-summary strong{color:hsl(var(--cw-workspace-ink));font-size:22px;letter-spacing:-.04em}.cw-dataset-summary span{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-table{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-prototype-row{min-height:54px;display:grid;grid-template-columns:minmax(180px,1.3fr) minmax(100px,.7fr) minmax(170px,1fr) 82px;align-items:center;gap:16px;padding:10px 16px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.cw-prototype-row.is-head{min-height:38px;border-top:0;background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.04em;text-transform:uppercase}.cw-prototype-row>strong{color:hsl(var(--foreground));font-size:12px;font-weight:600}.cw-status-pill,.cw-run-status,.cw-run-kind{justify-self:start;padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:600}.cw-variant-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px}.cw-variant-card{position:relative;overflow:hidden;padding:20px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel));box-shadow:0 12px 34px hsl(var(--foreground) / .04)}.cw-variant-card:before{content:"";position:absolute;top:0;left:0;width:100%;height:3px;background:hsl(var(--foreground) / .22)}.cw-variant-card.is-candidate:before{background:hsl(var(--cw-workspace-accent))}.cw-variant-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:28px;color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.06em;text-transform:uppercase}.cw-variant-head small{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));font-size:9.5px;letter-spacing:0;text-transform:none}.cw-variant-card>strong{color:hsl(var(--cw-workspace-ink));font-size:17px;letter-spacing:-.025em}.cw-variant-card>p{min-height:42px;margin:7px 0 22px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.6}.cw-variant-card dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.cw-variant-card dl>div{padding:9px 10px;border-radius:8px;background:hsl(var(--secondary) / .5)}.cw-variant-card dt{color:hsl(var(--muted-foreground));font-size:9.5px}.cw-variant-card dd{margin:3px 0 0;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10.5px}.cw-metric-board{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-metric-head,.cw-metric-row{display:grid;grid-template-columns:minmax(170px,1fr) 100px 100px 88px;align-items:center;gap:12px;padding:11px 16px}.cw-metric-head{grid-template-columns:auto auto minmax(0,1fr);min-height:48px;border-bottom:1px solid hsl(var(--border))}.cw-metric-head .cw-i{width:15px;color:hsl(var(--cw-workspace-accent))}.cw-metric-head strong{font-size:12px}.cw-metric-head span{justify-self:end;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-metric-row{min-height:44px;color:hsl(var(--muted-foreground));font-size:11px}.cw-metric-row+.cw-metric-row{border-top:1px solid hsl(var(--border) / .7)}.cw-metric-row strong{color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px}.cw-metric-row em{color:hsl(var(--cw-workspace-accent));font-size:10.5px;font-style:normal;font-weight:650}.cw-run-list{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-run-row{min-height:72px;display:grid;grid-template-columns:36px minmax(220px,1fr) 70px 110px 72px;align-items:center;gap:12px;padding:11px 16px}.cw-run-row+.cw-run-row{border-top:1px solid hsl(var(--border))}.cw-run-icon{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-run-icon .cw-i{width:14px;height:14px}.cw-run-row>div{min-width:0}.cw-run-row strong{color:hsl(var(--foreground));font-size:12px}.cw-run-row p{margin:3px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-run-row time{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-run-status.is-running{background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-prototype-note{display:flex;align-items:center;gap:7px;margin-top:14px;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-note .cw-i{width:13px;height:13px}.cw-publish-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:hsl(var(--muted-foreground));font-size:12px}.cw-publish-loading .cw-i{width:22px;height:22px;margin-bottom:5px;color:hsl(var(--cw-workspace-accent))}.cw-publish-loading strong{color:hsl(var(--foreground));font-size:14px}.cw-header{flex-shrink:0;display:flex;align-items:flex-start;gap:16px;padding:18px 24px 16px;border-bottom:1px solid hsl(var(--border))}.cw-header-title{flex:1;min-width:0}.cw-header-mode{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:hsl(var(--muted-foreground))}.cw-title{margin:5px 0 2px;font-size:21px;font-weight:650;letter-spacing:-.02em}.cw-subtitle{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.cw-progress-pill{flex-shrink:0;margin-top:2px;padding:5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}.cw-body{flex:1;min-height:0;overflow-y:auto}.cw-center{display:flex;align-items:flex-start;justify-content:center;gap:32px;max-width:960px;margin:0 auto;padding:32px 24px 80px}.cw-form-col{flex:1 1 auto;min-width:0;max-width:640px;display:flex;flex-direction:column;gap:12px}.cw-section{scroll-margin-top:24px;padding:0;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:18px;background:hsl(var(--panel));box-shadow:inset 0 1px hsl(var(--background)),0 8px 28px hsl(var(--foreground) / .045)}.cw-sec-head{padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34)}.cw-section:has(.cw-a2a-space-picker){overflow:visible}.cw-section:has(.cw-a2a-space-picker)>.cw-sec-head{border-radius:17px 17px 0 0}.cw-sec-body{padding:2px 18px 6px}.cw-sec-title{margin:0;font-size:14px;font-weight:620;letter-spacing:-.01em;color:hsl(var(--foreground))}.cw-sec-hint{margin:0;font-size:13px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-form{display:flex;flex-direction:column;gap:0}.cw-section-desc{margin:0;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.cw-field{display:grid;grid-template-columns:minmax(124px,.34fr) minmax(0,1fr);align-items:start;column-gap:16px;row-gap:6px;padding:11px 0}.cw-form>.cw-field+.cw-field,.cw-form>.cw-toggle+.cw-toggle,.cw-form>.cw-field+.cw-toggle,.cw-form>.cw-toggle+.cw-field,.cw-toggle-stack>.cw-field,.cw-toggle-stack>.cw-toggle+.cw-toggle{border-top:1px dashed hsl(var(--border) / .8)}.cw-field>.cw-label,.cw-field>.cw-remote-center-head{grid-column:1;align-self:start}.cw-field:has(>.cw-input)>.cw-label{align-self:center}.cw-field>:not(.cw-label):not(.cw-remote-center-head){grid-column:2;min-width:0}.cw-form>.cw-more-options{margin:10px 0 10px calc(34% + 16px)}.cw-form>.cw-model-more-options{margin-left:0}.cw-help:not(.cw-a2a-space-status):not(.cw-dependency-hint),.cw-section-desc:not(.cw-dependency-hint),.cw-remote-center-description,.cw-ctool-desc,.cw-skill-result-desc{display:none}.cw-dependency-hint{margin:0 0 14px calc(34% + 16px)}.cw-field>.cw-dependency-hint{grid-column:2;margin:0}.cw-more-options{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;margin-top:-4px;padding:4px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer;transition:color .14s ease}.cw-more-options:hover,.cw-more-options:focus-visible{color:hsl(var(--foreground))}.cw-more-options:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:3px;border-radius:4px}.cw-more-options-chevron{width:14px;height:14px;transition:transform .18s ease}.cw-more-options-chevron.is-open{transform:rotate(90deg)}.cw-more-options-count{margin-left:2px;padding:2px 7px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:10.5px;font-weight:600}.cw-model-advanced{display:flex;flex-direction:column;gap:20px;overflow:hidden}.cw-label{font-size:13px;font-weight:400;color:hsl(var(--foreground))}.cw-req{margin-left:2px;color:hsl(var(--destructive))}.cw-help{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-remote-center-head{display:flex;flex-direction:column;gap:6px}.cw-remote-center-description{display:block;max-width:560px;margin:0;line-height:1.6}.cw-a2a-space-picker{position:relative;display:flex;flex-direction:column;gap:8px}.cw-a2a-space-picker.is-open{z-index:80}.cw-a2a-space-row{display:flex;align-items:center;gap:8px}.cw-a2a-space-select-wrap{position:relative;flex:1;min-width:0}.cw-a2a-space-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;min-height:36px;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background-color:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;letter-spacing:0;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.cw-a2a-space-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background-color:hsl(var(--muted) / .18)}.cw-a2a-space-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background-color:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.cw-a2a-space-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-a2a-space-trigger:disabled{cursor:not-allowed;opacity:.5}.cw-a2a-space-trigger.is-error{box-shadow:0 0 0 1px hsl(var(--destructive) / .55)}.cw-a2a-space-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-trigger>span.is-placeholder{color:hsl(var(--muted-foreground));font-weight:400}.cw-a2a-space-trigger-icon{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.cw-a2a-space-trigger[aria-expanded=true] .cw-a2a-space-trigger-icon{transform:rotate(180deg)}.cw-a2a-space-menu{position:absolute;z-index:81;top:calc(100% + 6px);left:0;width:100%;overflow:hidden;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08);font-size:12px}.cw-picker-search{padding:4px 4px 6px;border-bottom:1px solid hsl(var(--border) / .72)}.cw-picker-search-input{width:100%;height:30px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.cw-picker-search-input:focus{border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 2px hsl(var(--ring) / .1)}.cw-picker-options{max-height:188px;overflow-y:auto;padding-top:4px;overscroll-behavior:contain}.cw-picker-empty{padding:14px 10px;color:hsl(var(--muted-foreground));text-align:center}.cw-a2a-space-option{display:flex;align-items:center;width:100%;min-height:34px;padding:8px 10px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-option:hover,.cw-a2a-space-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.cw-a2a-space-option.is-selected{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-a2a-space-refresh{flex-shrink:0;width:36px;height:36px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s ease,background-color .12s ease}.cw-a2a-space-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .4)}.cw-a2a-space-refresh:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-a2a-space-status{display:inline-flex;align-items:center;gap:6px}.cw-a2a-space-error{align-items:flex-start;padding:9px 11px;font-size:12.5px}.cw-viking-kb-picker{gap:6px}.cw-viking-kb-inline-status{min-height:36px;display:inline-flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.cw-viking-kb-menu{padding:3px;box-shadow:0 6px 18px hsl(var(--foreground) / .06)}.cw-viking-kb-menu .cw-picker-options{max-height:min(112px,calc(100vh - 310px))}.cw-viking-kb-menu .cw-a2a-space-option{min-height:28px;padding:5px 9px;line-height:1.25}.cw-viking-kb-refresh{color:hsl(var(--foreground) / .72)}.cw-viking-kb-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .28);background:hsl(var(--muted) / .45);color:hsl(var(--foreground))}.cw-viking-kb-refresh:disabled{color:hsl(var(--muted-foreground))}.cw-error-text{font-size:12px;color:hsl(var(--destructive))}.cw-env-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:12px;margin-top:5px}.cw-env-field{display:flex;min-width:0;flex-direction:column;gap:6px}.cw-env-field-head{display:grid;min-width:0;gap:3px;color:hsl(var(--foreground));font-size:12px;font-weight:560}.cw-env-field-title{display:inline-flex;min-width:0;align-items:center;gap:5px}.cw-env-field-label{min-width:0;line-height:1.4;overflow-wrap:anywhere}.cw-env-help{position:relative;width:15px;height:15px;flex:0 0 15px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));cursor:default;font-size:10px;font-weight:650;line-height:1}.cw-env-help-popover{position:absolute;z-index:80;bottom:calc(100% + 8px);left:50%;width:max-content;max-width:min(320px,72vw);padding:7px 9px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 10px 28px hsl(var(--foreground) / .14);font-size:11.5px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;transform:translate(-50%);opacity:0;pointer-events:none;-webkit-user-select:text;user-select:text}.cw-env-help:hover .cw-env-help-popover,.cw-env-help:focus-visible .cw-env-help-popover,.cw-env-help:focus-within .cw-env-help-popover{opacity:1;pointer-events:auto}.cw-env-help:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-env-link{width:22px;height:22px;flex:0 0 22px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;color:hsl(var(--muted-foreground));text-decoration:none}.cw-env-link:hover{background:hsl(var(--foreground) / .055);color:hsl(var(--foreground))}.cw-env-link svg{width:13px;height:13px;flex:0 0 13px}.cw-env-field-head code{display:block;max-width:100%;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.cw-env-empty{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12px}.cw-input{min-width:0;width:100%;min-height:38px;padding:9px 12px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background));box-shadow:inset 0 1px hsl(var(--foreground) / .015);color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .12s,box-shadow .12s}.cw-input::placeholder{color:hsl(var(--muted-foreground))}.cw-input:focus{outline:none;border-color:hsl(var(--ring) / .38);box-shadow:0 0 0 3px hsl(var(--ring) / .09),inset 0 1px hsl(var(--foreground) / .015)}.cw-input[aria-invalid=true]{border-color:hsl(var(--destructive) / .7);box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.cw-input.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-env-textarea{min-height:96px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.45;white-space:pre-wrap}.cw-env-error{margin-top:-2px;color:hsl(var(--destructive));font-size:11.5px;line-height:1.4}.cw-textarea{width:100%;padding:11px 13px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background));box-shadow:inset 0 1px hsl(var(--foreground) / .015);color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.6;resize:vertical;transition:border-color .12s,box-shadow .12s}.cw-textarea::placeholder{color:hsl(var(--muted-foreground))}.cw-textarea:focus{outline:none;border-color:hsl(var(--ring) / .38);box-shadow:0 0 0 3px hsl(var(--ring) / .09),inset 0 1px hsl(var(--foreground) / .015)}.cw-textarea.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}@keyframes cw-error-shake-a{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}@keyframes cw-error-shake-b{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}.cw-error-shake-0{animation:cw-error-shake-a .28s ease-in-out}.cw-error-shake-1{animation:cw-error-shake-b .28s ease-in-out}@media (prefers-reduced-motion: reduce){.cw-error-shake-0,.cw-error-shake-1{animation:none}}.cw-textarea-sm{min-height:80px;max-height:160px;overflow-y:auto}.cw-textarea-lg{min-height:340px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.cw-markdown-loading,.cw-markdown-editor:not(.mdxeditor-popup-container){min-height:340px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.cw-markdown-loading{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px}.cw-markdown-editor:not(.mdxeditor-popup-container){display:flex;flex-direction:column;max-height:420px;overflow:hidden;color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.cw-markdown-editor:not(.mdxeditor-popup-container):focus-within{border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-markdown-editor:not(.mdxeditor-popup-container).is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-markdown-toolbar{flex-shrink:0;min-height:40px;padding:5px 8px;border:0;border-bottom:1px solid hsl(var(--border));border-radius:0;background:hsl(var(--muted) / .38)}.cw-markdown-toolbar button,.cw-markdown-toolbar [role=combobox]{color:hsl(var(--foreground))}.cw-markdown-content{min-height:298px;max-height:360px;overflow-y:auto;padding:18px 20px 28px;color:hsl(var(--foreground));font-size:14px;line-height:1.7}.cw-markdown-content:focus{outline:none}.cw-markdown-content h1,.cw-markdown-content h2,.cw-markdown-content h3{margin:1.1em 0 .45em;color:hsl(var(--foreground));font-weight:650;line-height:1.3}.cw-markdown-content h1:first-child,.cw-markdown-content h2:first-child,.cw-markdown-content h3:first-child{margin-top:0}.cw-markdown-content h1{font-size:20px}.cw-markdown-content h2{font-size:17px}.cw-markdown-content h3{font-size:15px}.cw-markdown-content p{margin:0 0 .8em}.cw-markdown-content ul,.cw-markdown-content ol{margin:.5em 0 .9em;padding-left:1.5em}.cw-markdown-content ul{list-style:disc outside}.cw-markdown-content ol{list-style:decimal outside}.cw-markdown-content li{display:list-item}.cw-markdown-content blockquote{margin:.8em 0;padding-left:12px;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.cw-markdown-error{display:block;margin-top:6px;color:hsl(var(--destructive));font-size:12px}.cw-tag-editor{display:flex;flex-direction:column;gap:12px}.cw-tag-inputrow{display:flex;gap:8px}.cw-tag-inputrow .cw-input{flex:1}.cw-presets{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.cw-presets-label{font-size:11.5px;color:hsl(var(--muted-foreground));margin-right:2px}.cw-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12.5px;white-space:nowrap}.cw-chip-ghost{border:1px dashed hsl(var(--border));background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;transition:background .12s,color .12s,border-color .12s}.cw-chip-ghost:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-chip-sub{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-pills{display:flex;flex-wrap:wrap;gap:8px}.cw-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:13px}.cw-pill-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-pill-x:hover{background:hsl(var(--destructive) / .12);color:hsl(var(--destructive))}.cw-empty-line{margin:0;font-size:12.5px;color:hsl(var(--muted-foreground))}.cw-check-inline{display:flex;align-items:center;gap:8px;margin-top:2px;font-size:13px;color:hsl(var(--foreground));cursor:pointer;-webkit-user-select:none;user-select:none}.cw-check-inline input[type=checkbox]{width:16px;height:16px;margin:0;flex-shrink:0;accent-color:hsl(var(--primary));cursor:pointer}.cw-checklist{display:flex;flex-direction:column;gap:8px}.cw-tools-list-shell{min-width:0;container-type:inline-size}.cw-tool-config{padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--muted) / .28)}.cw-tool-config-head{display:flex;flex-direction:column;gap:3px}.cw-checklist-tools{--cw-checklist-row-height: 40px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(var(--cw-checklist-row-height),auto);max-height:var(--cw-checklist-max-height);padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-checklist-tools .cw-check{min-height:var(--cw-checklist-row-height);align-items:center;padding:8px 10px}.cw-checklist-tools .cw-check-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}@container (max-width: 575px){.cw-checklist-tools{grid-template-columns:minmax(0,1fr)}}.cw-check{display:flex;align-items:flex-start;gap:0;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-check>label{flex:1;min-width:0;padding-left:12px;color:inherit;cursor:pointer}.cw-checklist-tools .cw-check>label{padding-left:10px}.cw-check:hover{background:hsl(var(--foreground) / .05)}.cw-check.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-check-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-check-title{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.cw-check-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-segmented{display:flex;flex-wrap:wrap;gap:8px}.cw-seg{flex:1 1 160px;display:flex;flex-direction:column;gap:2px;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-seg:hover{background:hsl(var(--foreground) / .05)}.cw-seg.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-seg-title{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-seg-desc{font-size:11.5px;line-height:1.45;color:hsl(var(--muted-foreground))}.cw-ctool{display:flex;flex-direction:column;gap:12px}.cw-ctool-inputs{display:flex;flex-wrap:wrap;gap:8px}.cw-ctool-inputs .cw-input{flex:1 1 180px}.cw-ctool-list{display:flex;flex-direction:column;gap:8px}.cw-ctool-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--card))}.cw-ctool-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.cw-ctool-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ctool-name{font-size:13.5px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--foreground));word-break:break-word}.cw-ctool-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp,.cw-mcp-list{display:flex;flex-direction:column;gap:12px}.cw-mcp-row{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.cw-mcp-rowhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-mcp-transport{display:inline-flex;gap:6px}.cw-seg-sm{flex:0 0 auto;min-width:72px;flex-direction:row;align-items:center;justify-content:center;text-align:center;padding:6px 16px;border-radius:9px}.cw-seg-sm .cw-seg-title{font-size:12.5px}.cw-mcp-note{margin:0;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp-warning{display:flex;align-items:flex-start;gap:7px;margin:0;padding:9px 10px;border:1px solid #b4530940;border-radius:8px;background:#b453091a;color:#b45309;font-size:12.5px;line-height:1.5}.cw-mcp-warning svg{flex:0 0 auto;width:15px;height:15px;margin-top:2px}.cw-mcp .cw-add-sub{margin-top:0}.cw-mcp-field{align-items:center}.cw-mcp-field>.cw-label{align-self:center}.cw-subfield{margin:0;padding:9px 0;border:0;border-radius:0;background:transparent}.cw-toggle-stack{gap:0}.cw-toggle{display:grid;grid-template-columns:minmax(124px,.34fr) minmax(0,1fr);align-items:center;gap:16px;width:100%;padding:9px 0;border:0;border-radius:0;background:transparent;text-align:left;cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.cw-toggle:hover{background:hsl(var(--muted) / .18)}.cw-toggle.is-on{background:hsl(var(--muted) / .24);box-shadow:none}.cw-toggle-text{grid-column:1;grid-row:1;margin-left:0;flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-toggle-title{font-size:14px;font-weight:600}.cw-toggle-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-switch{grid-column:2;grid-row:1;justify-self:end;flex-shrink:0;display:flex;align-items:center;width:42px;height:24px;padding:2px;border-radius:999px;background:hsl(var(--border));transition:background .18s}.cw-toggle.is-on .cw-switch{background:hsl(var(--primary));justify-content:flex-end}.cw-switch-knob{display:block;width:20px;height:20px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .2)}.cw-sub-list{display:flex;flex-direction:column;gap:14px}.cw-sub{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .03)}.cw-sub-head{display:flex;align-items:center;justify-content:space-between}.cw-sub-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.cw-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-icon-btn:not(:disabled):hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-icon-btn:disabled{opacity:.35;cursor:not-allowed}.cw-icon-danger:not(:disabled):hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.cw-sub-head-actions{display:inline-flex;align-items:center;gap:2px}.cw-sub-list-wrap{display:flex;flex-direction:column}.cw-agent-type-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:14px 0}.cw-agent-type-option{position:relative;min-width:0;min-height:42px;display:flex;align-items:center;gap:10px;padding:0;border:1px solid hsl(var(--border) / .72);border-radius:10px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.cw-agent-type-option:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .28)}.cw-agent-type-option.is-on{border-color:hsl(var(--foreground) / .3);background:hsl(var(--secondary) / .42)}.cw-agent-type-option.is-disabled{color:hsl(var(--muted-foreground) / .52);cursor:not-allowed}.cw-agent-type-option>.flex{align-self:stretch;flex:1;min-width:0}.cw-agent-type-control{align-self:stretch;flex:1;width:100%;min-width:0;min-height:100%;box-sizing:border-box;padding:10px 12px;color:inherit;cursor:inherit}.cw-agent-type-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-agent-type-copy strong{font-size:13px;font-weight:650}.cw-agent-type-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.cw-agent-type-disabled-hint{position:absolute;top:calc(100% + 17px);right:0;width:max-content;max-width:220px;padding:7px 10px;border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--popover));box-shadow:0 8px 24px hsl(var(--foreground) / .1);color:hsl(var(--popover-foreground));font-size:12px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease}.cw-agent-type-option.is-disabled:hover .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus-visible .cw-agent-type-disabled-hint{opacity:1;transform:translateY(0)}.cw-agent-type-option:focus-within,.cw-agent-type-option:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-add-sub{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:14px;padding:12px;width:100%;border:1px dashed hsl(var(--border));border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;transition:background .12s,color .12s,border-color .12s}.cw-add-sub:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-banner{display:flex;align-items:center;gap:8px;padding:11px 14px;border-radius:var(--radius);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-review{display:flex;flex-direction:column;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;background:hsl(var(--card))}.cw-review-row{display:flex;gap:18px;padding:13px 16px;border-bottom:1px solid hsl(var(--border))}.cw-review-row:last-child{border-bottom:none}.cw-review-key{flex-shrink:0;width:110px;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.cw-review-val{flex:1;min-width:0;font-size:13.5px}.cw-review-strong{font-weight:600}.cw-review-muted{color:hsl(var(--muted-foreground))}.cw-review-pre{margin:0;padding:10px 12px;background:hsl(var(--muted));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow-y:auto}.cw-review-chips,.cw-review-subs{display:flex;flex-wrap:wrap;gap:6px}.cw-tag{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:500}.cw-tag-on{background:#22c35d24;color:#1c7d3f}.cw-tag-off{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.cw-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13.5px;font-weight:550;cursor:pointer;transition:background .13s,opacity .13s,border-color .13s,transform .1s}.cw-btn:active{transform:scale(.98)}.cw-btn-primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-btn-primary:hover:not(:disabled){opacity:.88}.cw-btn-primary:disabled{opacity:.4;cursor:default}.cw-btn-ghost{background:hsl(var(--background));border-color:hsl(var(--border));color:hsl(var(--foreground))}.cw-btn-ghost:hover{background:hsl(var(--accent))}.cw-btn-soft{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));flex-shrink:0}.cw-btn-soft:hover:not(:disabled){background:hsl(var(--accent))}.cw-btn-soft:disabled{opacity:.45;cursor:default}.cw-i{width:16px;height:16px;flex-shrink:0}.cw-i-sm{width:14px;height:14px}.cw-root-preview{height:100%}.cw-preview-body{flex:1;min-height:0;display:flex;overflow:hidden;background:hsl(var(--background))}.cw-preview-body>*{flex:1;min-height:0}.cw-skillhub{height:100%;min-height:0;display:flex;flex-direction:column;gap:14px}.cw-skill-searchrow{display:flex;gap:8px}.cw-skill-searchbox{position:relative;flex:1;min-width:0;display:flex;align-items:center}.cw-skill-searchicon{position:absolute;left:11px;color:hsl(var(--muted-foreground));pointer-events:none}.cw-skill-input{padding-left:36px}.cw-skill-input:focus,.cw-skill-input:focus-visible{outline:2px solid hsl(var(--ring) / .38);outline-offset:1px;border-color:hsl(var(--ring) / .48);background:hsl(var(--background));box-shadow:none}.cw-skill-selected{display:flex;flex-direction:column;gap:8px}.cw-skill-selected-label{font-size:11.5px;font-weight:600;color:hsl(var(--muted-foreground))}.cw-skill-results{display:flex;flex-direction:column;gap:8px;max-height:472px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-skill-result{flex-shrink:0;display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s;min-height:72px}.cw-skill-result:hover{background:hsl(var(--foreground) / .05)}.cw-skill-result.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-skill-result-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--muted-foreground));transition:background .12s,border-color .12s,color .12s}.cw-skill-result.is-on .cw-skill-result-icon{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-skill-result-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-skill-result-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground));word-break:break-word}.cw-skill-result-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-skill-result-repo{font-size:11px;font-family:inherit;line-height:1.4;color:hsl(var(--muted-foreground));word-break:break-all}.cw-skill-loading{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.cw-spin{animation:cw-spin .8s linear infinite}@keyframes cw-spin{to{transform:rotate(360deg)}}.cw-skillspane{display:flex;flex-direction:column;gap:10px;padding:10px 0 12px}.cw-skill-add{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:40px;padding:6px 10px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:border-color .15s,background .15s,color .15s}.cw-skill-add:hover{border-color:hsl(var(--foreground) / .34);background:transparent;color:hsl(var(--foreground))}.cw-skill-add:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-skill-add-icon{flex-shrink:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}.cw-skill-dialog-backdrop{position:fixed;z-index:80;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:20px;background:#15181e47;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.cw-skill-dialog{width:min(680px,calc(100vw - 32px));height:min(640px,calc(100dvh - 40px));min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 72px #10131933}.cw-skill-dialog-head{flex-shrink:0;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px 0 20px;border-bottom:1px solid hsl(var(--border))}.cw-skill-dialog-head h3{margin:0;font-size:16px;font-weight:650;letter-spacing:-.01em}.cw-skill-dialog-close{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-skill-dialog-close:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-skill-dialog-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;padding:18px 20px 20px}.cw-skill-sourcetabs{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;height:44px;padding:4px;overflow:hidden;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-skill-tab-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-skill-tab-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-skill-tab-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-skill-pickertab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:7px 10px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background .16s,color .16s}.cw-skill-pickertab:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-skill-pickertab.is-on{background:transparent;color:hsl(var(--foreground))}.cw-skill-pickertab:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-skill-tabbody{flex:1;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}.cw-selected-skill-list{display:flex;flex-direction:column;gap:7px;max-height:347px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-selected-skill-row{display:flex;align-items:center;gap:10px;min-width:0;min-height:52px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--card))}.cw-selected-skill-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-selected-skill-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-selected-skill-name{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-detail{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-remove{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-selected-skill-remove:hover{background:hsl(var(--destructive) / .09);color:hsl(var(--destructive))}.cw-local{height:100%;min-height:0;display:flex;flex-direction:column;gap:8px}.cw-local-dropzone{flex:1;min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:18px 14px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .15s,color .15s}.cw-local-drop-icon{width:20px;height:20px;color:hsl(var(--muted-foreground))}.cw-local-dropzone.is-dragging{border-color:hsl(var(--foreground) / .48);color:hsl(var(--foreground))}.cw-local-drop-hint{margin:0;color:hsl(var(--muted-foreground));font-size:11.5px}.cw-local-dropzone.is-dragging .cw-local-drop-hint,.cw-local-dropzone.is-dragging .cw-local-drop-icon{color:hsl(var(--foreground))}.cw-local-hint{margin:0;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-skillspace{height:100%;min-height:0;display:flex;flex-direction:column}.cw-skillspace-header{display:flex;gap:8px;align-items:center;margin-bottom:10px}.cw-skillspace-select{width:100%;flex:1;min-width:0}.cw-skillspace-region-label{flex-shrink:0;display:inline-flex;align-items:center;min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted) / .52);color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap}.cw-skillspace-console-link{flex-shrink:0;padding:9px 12px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-color:hsl(var(--primary))}.cw-skillspace-console-link .cw-i{display:block}.cw-skill-result-version{color:hsl(var(--muted-foreground));font-weight:400;font-size:11px;margin-left:4px}.cw-skill-result-repo .cw-i{vertical-align:-2px;margin-right:2px}@media (max-width: 1280px){.cw-root{--cw-workspace-width: calc(100% - 48px) }.cw-workspace-header{padding-inline:16px}.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-editor{overflow:hidden}.cw-tree{height:auto}.cw-detail{flex:1 1 auto;width:100%;max-width:none;min-height:0}.cw-debug{flex:0 0 100%;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px;border-left:none;border-top:1px solid hsl(var(--border))}.cw-debug.is-collapsed{flex:0 0 48px;width:100%;min-width:0;height:48px;min-height:48px;align-items:flex-end;padding:7px 12px}.cw-debug.is-collapsed .cw-debug-expand{width:34px;min-height:34px}.cw-lower{gap:0}.cw-detail .cw-form-col{max-width:100%}}@media (max-width: 860px){.cw-root{--cw-workspace-gutter: 8px;--cw-workspace-width: calc(100% - 16px) }.cw-workspace-header{min-height:50px;padding:6px 10px}.cw-workspace-header h1{font-size:17px}.cw-validation-workspace{display:flex}.cw-ab-stage{padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{grid-template-columns:repeat(var(--cw-ab-column-count),minmax(0,1fr))}.cw-ab-composer{padding-inline:var(--cw-workspace-gutter)}.cw-editor{flex-direction:column;overflow-x:hidden;overflow-y:hidden}.cw-editor>.abc-root{flex:0 0 180px;width:100%;min-width:0;min-height:180px}.cw-tree{width:100%;height:auto;max-height:220px;border-right:0;border-bottom:1px solid hsl(var(--border))}.cw-detail{flex:1 1 auto;width:100%;max-width:none;height:auto;min-height:0;border-left:0}.cw-detail-scroll{padding:16px 12px 20px}.cw-debug{flex:none;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px}.cw-debug.is-collapsed{width:100%;height:48px;min-height:48px}.cw-center{gap:0;padding:24px 16px 64px}.cw-form-col{max-width:100%}}@media (max-width: 700px){.cw-workspace-header h1{text-align:center}.cw-workspace-nav-actions{grid-template-columns:minmax(88px,1fr) auto minmax(88px,1fr)}.cw-workspace-nav-button{padding-inline:12px}.cw-form>.cw-more-options,.cw-dependency-hint{margin-left:0}.cw-optimization-list,.cw-ab-grid,.cw-ab-config{grid-template-columns:minmax(0,1fr)}.cw-ab-composer{grid-template-columns:minmax(0,1fr);padding-bottom:12px}.cw-ab-add{width:100%}.cw-dataset-summary>div+div{border-top:1px solid hsl(var(--border));border-left:0}}.tpl-root{flex:1;min-height:0;display:flex;flex-direction:column}.tpl-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 18px;padding:6px 10px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,color .12s}.tpl-back:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.tpl-back .icon{width:15px;height:15px}.tpl-scroll{flex:1;min-height:0;overflow-y:auto;padding:24px 28px 40px}.tpl-scroll--detail{padding-left:14px;padding-right:14px}.tpl-head{max-width:720px;margin:8px auto 28px;text-align:center}.tpl-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;max-width:1100px;margin:0 auto}.tpl-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding:16px 16px 18px;text-align:left;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;transition:background .14s,border-color .14s}.tpl-card:hover{background:hsl(var(--foreground) / .05)}.tpl-card:active{background:hsl(var(--foreground) / .08)}.tpl-card-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;color:hsl(var(--muted-foreground))}.tpl-card-icon .icon{width:20px;height:20px}.tpl-card-name{font-size:14px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground))}.tpl-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.tpl-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.tpl-tags--detail{margin-top:0}.tpl-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border:1px solid hsl(var(--border));border-radius:999px;background:none;color:hsl(var(--muted-foreground));font-size:11.5px;white-space:nowrap}.tpl-tag-icon{width:12px;height:12px;flex-shrink:0}.tpl-detail{max-width:720px;margin:0 auto;display:flex;flex-direction:column;gap:20px}.tpl-detail-head{display:flex;align-items:flex-start;gap:14px}.tpl-detail-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;border:1px solid hsl(var(--border));border-radius:12px;background:none;color:hsl(var(--muted-foreground))}.tpl-detail-icon .icon{width:22px;height:22px}.tpl-detail-headtext{min-width:0}.tpl-detail-name{font-size:20px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-detail-desc{margin-top:4px;font-size:13.5px;line-height:1.6;color:hsl(var(--muted-foreground))}.tpl-field{display:flex;flex-direction:column;gap:8px}.tpl-field-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.tpl-input{width:100%;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .15s}.tpl-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.tpl-instruction{margin:0;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .03);color:hsl(var(--foreground));font-size:13px;line-height:1.7;white-space:pre-wrap}.tpl-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px}.tpl-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.tpl-meta-key{flex-shrink:0;color:hsl(var(--muted-foreground))}.tpl-meta-val{text-align:right;word-break:break-word;color:hsl(var(--foreground))}.tpl-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tpl-subagents{display:flex;flex-direction:column;gap:10px}.tpl-subagent{padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background))}.tpl-subagent-top{display:flex;align-items:center;gap:8px}.tpl-subagent-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.tpl-subagent-tools{margin-left:auto;font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tpl-subagent-desc{margin-top:5px;font-size:12.5px;line-height:1.55;color:hsl(var(--muted-foreground))}.tpl-create{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:flex-start;margin-top:4px;padding:11px 20px;border:none;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.tpl-create:hover{opacity:.88}.tpl-create:active{transform:scale(.98)}.tpl-create .icon{width:17px;height:17px}@media (max-width: 560px){.tpl-meta-grid{grid-template-columns:1fr}.tpl-scroll{padding:20px 16px 32px}}.wfb{flex:1;min-height:0;display:flex;flex-direction:column;height:100%}.wfb-create{position:absolute;top:14px;right:14px;z-index:5;display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border:1px solid transparent;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:550;cursor:pointer;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .4);transition:opacity .15s,transform .1s}.wfb-create:hover:not(:disabled){opacity:.88}.wfb-create:active:not(:disabled){transform:scale(.97)}.wfb-create:disabled{opacity:.4;cursor:default}.wfb-grid{flex:1;min-height:0;display:grid;grid-template-columns:248px minmax(0,1fr) 288px}.wfb-section-label{margin:4px 0 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.wfb-field{display:flex;flex-direction:column;gap:5px}.wfb-field-label{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-input{width:100%;border:1px solid hsl(var(--border));border-radius:var(--radius);padding:8px 10px;font:inherit;font-size:13px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.wfb-input::placeholder{color:hsl(var(--muted-foreground) / .7)}.wfb-input:focus{outline:none;border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.wfb-input--error,.wfb-input--error:focus{border-color:hsl(var(--destructive));box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.wfb-field-error,.wfb-field-help{font-size:11px;line-height:1.4}.wfb-field-error{color:hsl(var(--destructive))}.wfb-field-help{color:hsl(var(--muted-foreground))}.wfb-textarea{resize:vertical;min-height:52px;line-height:1.5}.wfb-palette{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-right:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-types{display:flex;flex-direction:column;gap:6px}.wfb-type{display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:border-color .12s,background .12s}.wfb-type:hover{border-color:hsl(var(--ring) / .3)}.wfb-type .icon{color:hsl(var(--muted-foreground))}.wfb-type--active{border-color:hsl(var(--ring) / .55);background:hsl(var(--accent))}.wfb-type--active .icon{color:#7c48f4}.wfb-type-text{display:flex;flex-direction:column;gap:1px;min-width:0}.wfb-type-name{font-size:13px;font-weight:550}.wfb-type-desc{font-size:11px;color:hsl(var(--muted-foreground))}.wfb-palette-item{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));cursor:grab;transition:border-color .12s,background .12s}.wfb-palette-item:hover{border-color:hsl(var(--ring) / .4);background:hsl(var(--accent))}.wfb-palette-item:active{cursor:grabbing}.wfb-grip{color:hsl(var(--muted-foreground) / .7)}.wfb-palette-item-text{font-size:13px;font-weight:500}.wfb-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:9px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background .12s}.wfb-add:hover{background:hsl(var(--accent))}.wfb-hint{margin-top:auto;padding-top:10px;font-size:11.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.wfb-canvas{position:relative;min-width:0;height:100%;background:hsl(var(--canvas))}.wfb-canvas .react-flow{background:transparent}.wfb-node{display:flex;align-items:center;gap:10px;width:188px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .2);transition:border-color .12s,box-shadow .12s}.wfb-node--selected{border-color:hsl(var(--ring) / .6);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.wfb-node-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;background:hsl(var(--secondary));color:#7c48f4}.wfb-node-icon--sm{width:24px;height:24px;border-radius:7px}.wfb-node-body{min-width:0;display:flex;flex-direction:column;gap:2px}.wfb-node-name{font-size:13px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-node-desc{font-size:11px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-handle{width:9px!important;height:9px!important;background:hsl(var(--background))!important;border:2px solid hsl(258 89% 62%)!important}.wfb-handle:hover{background:#7c48f4!important}.wfb-canvas .react-flow__controls{border-radius:10px;overflow:hidden;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .25);border:1px solid hsl(var(--border))}.wfb-canvas .react-flow__controls-button{background:hsl(var(--background));border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground))}.wfb-canvas .react-flow__controls-button:hover{background:hsl(var(--accent))}.wfb-canvas .react-flow__controls-button svg{fill:hsl(var(--foreground))}.wfb-canvas .react-flow__edge-path{stroke:hsl(var(--muted-foreground) / .55);stroke-width:1.5}.wfb-canvas .react-flow__edge.selected .react-flow__edge-path,.wfb-canvas .react-flow__edge:hover .react-flow__edge-path{stroke:#7c48f4}.wfb-canvas .react-flow__arrowhead *{fill:hsl(var(--muted-foreground) / .55)}.wfb-minimap{border:1px solid hsl(var(--border));border-radius:10px;overflow:hidden}.wfb-inspector{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-left:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-inspector-head{display:flex;align-items:center;justify-content:space-between}.wfb-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:7px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.wfb-icon-btn:hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.wfb-inspector-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;padding-top:12px;border-top:1px solid hsl(var(--border))}.wfb-meta-key{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-meta-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 7px;border-radius:6px;background:hsl(var(--muted));color:hsl(var(--foreground))}.wfb-inspector-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.wfb-empty-icon{width:32px;height:32px;opacity:.4;margin-bottom:4px}.wfb-inspector-empty p{margin:0}.wfb-empty-sub{font-size:12px;color:hsl(var(--muted-foreground) / .8)}@media (max-width: 900px){.wfb-grid{grid-template-columns:220px minmax(0,1fr)}.wfb-inspector{display:none}}.package-create{flex:1;min-width:0;min-height:0;display:flex;color:hsl(var(--foreground))}.package-create-preview{height:100%}.package-create-preview>*{flex:1;min-width:0;min-height:0}.package-source-pane{padding:16px 18px 18px}.package-source-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650}.package-dropzone{min-height:152px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:20px;border:1px dashed hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .16);text-align:center;cursor:pointer;transition:border-color .16s ease,background-color .16s ease}.package-dropzone:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:3px}.package-dropzone.is-dragging{border-color:hsl(var(--primary) / .62);background:hsl(var(--primary) / .045)}.package-dropzone.is-ready{background:hsl(var(--background))}.package-dropzone>strong{max-width:100%;overflow:hidden;font-size:15px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.package-dropzone>span{max-width:420px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6}.package-upload-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:5px}.package-upload-actions button{min-height:36px;padding:0 16px;border-radius:7px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,color .14s ease}.package-upload-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.package-upload-secondary:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--secondary))}.package-upload-actions button:disabled{cursor:default;opacity:.45}.package-upload-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.package-dropzone input{display:none}.package-create-error{flex:0 0 auto;margin-top:12px;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));font-size:13px;line-height:1.5}@media (max-width: 860px){.package-dropzone{min-height:140px}}@media (prefers-reduced-motion: reduce){.package-dropzone,.package-upload-actions button{transition:none}}.skill-workspace{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:34px clamp(18px,4vw,54px) 44px;background:hsl(var(--panel))}.skill-workspace__intro{width:min(1180px,100%);margin:0 auto 32px}.skill-workspace__intro h1{margin:0;font-size:22px;font-weight:620;letter-spacing:-.025em}.skill-workspace__poll-error{width:min(1180px,100%);margin:0 auto 14px;padding:9px 11px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px}.skill-workspace__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:clamp(36px,5vw,72px);width:min(1180px,100%);margin:0 auto}.skill-candidate{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:transparent}.skill-candidate:nth-child(2):before{position:absolute;top:0;bottom:0;left:calc(clamp(36px,5vw,72px)/-2);width:1px;background:hsl(var(--border));content:""}.skill-candidate__header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:0 0 12px;border-bottom:1px solid hsl(var(--border))}.skill-candidate__header h2{margin:0;font-family:inherit;font-size:13px;font-weight:500;line-height:1.4;letter-spacing:0}.skill-candidate__selected{padding:3px 7px;border-radius:999px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:10px}.skill-candidate__view{min-height:0;overflow-y:auto;padding-right:8px;scrollbar-gutter:stable;animation:skill-view-in .18s ease-out}.skill-candidate__status{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:46px;padding:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.4;text-align:left}.skill-candidate--succeeded .skill-candidate__status{color:#2a844f}.skill-candidate--failed .skill-candidate__status{color:hsl(var(--destructive))}.skill-candidate__status-icon{display:inline-grid;place-items:center;width:18px;height:18px}.skill-candidate__status-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__spinner{animation:skill-spin .9s linear infinite}.skill-candidate__spinner circle{opacity:.2}.skill-candidate__duration{margin-left:auto;font-size:10px;color:hsl(var(--muted-foreground))}.skill-conversation{min-height:220px;margin:0 0 16px;padding:8px 0 18px}.skill-conversation .bubble{font-size:13px;line-height:1.65}.skill-conversation .think-head,.skill-conversation .tool-head,.skill-conversation .builtin-tool-head{display:grid;grid-template-columns:20px minmax(0,1fr) 13px;align-items:center;gap:8px;width:100%;min-height:38px;padding:4px 0;text-align:left}.skill-conversation .think-label,.skill-conversation .tool-name,.skill-conversation .builtin-tool-label{min-width:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere;text-align:left}.skill-conversation .think-icon,.skill-conversation .tool-icon,.skill-conversation .builtin-tool-icon{width:20px;height:26px}.skill-conversation .chev,.skill-conversation .tool-chevron,.skill-conversation .builtin-tool-chevron{justify-self:end}.skill-candidate__error{margin:0 0 14px;padding:9px 10px;border-radius:7px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:11px;line-height:1.5}.skill-candidate__view-actions{display:flex;justify-content:flex-start;padding:4px 0 20px}.skill-candidate__preview-nav{display:flex;align-items:center;min-height:46px}.skill-candidate__back{display:inline-flex;align-items:center;gap:6px;padding:5px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer}.skill-candidate__back:hover{color:hsl(var(--foreground))}.skill-candidate__back svg,.skill-action--preview svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__result{padding:0 0 20px}.skill-candidate__summary{display:grid;grid-template-columns:1fr .55fr .7fr;gap:8px;margin-bottom:13px}.skill-candidate__summary>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:9px 10px;border-radius:8px;background:hsl(var(--muted) / .55)}.skill-candidate__summary span{color:hsl(var(--muted-foreground));font-size:9px;text-transform:uppercase;letter-spacing:.05em}.skill-candidate__summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:560}.skill-candidate__summary .is-valid{color:#2a844f}.skill-candidate__summary .is-invalid{color:hsl(var(--destructive))}.skill-candidate__description{margin:0 0 13px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.skill-validation{margin-bottom:12px;font-size:11px;color:hsl(var(--muted-foreground))}.skill-validation summary{margin-bottom:6px;cursor:pointer;color:hsl(var(--foreground))}.skill-files{overflow:hidden;margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:9px}.skill-files__tabs{display:flex;gap:2px;overflow-x:auto;padding:5px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--muted) / .34)}.skill-files__tabs button{flex:0 0 auto;max-width:180px;overflow:hidden;text-overflow:ellipsis;padding:4px 7px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:10px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.skill-files__tabs button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 3px hsl(var(--foreground) / .08)}.skill-files__content{margin:0;overflow-x:auto;padding:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:10.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word}.skill-files__truncated{margin:0;padding:8px 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:10px}.skill-files__unavailable{padding:20px 12px;color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.skill-candidate__actions{display:flex;flex-wrap:wrap;gap:7px}.skill-action{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px;text-decoration:none;cursor:pointer}.skill-action:hover:not(:disabled){background:hsl(var(--accent))}.skill-action:disabled{cursor:default;opacity:.42}.skill-action--select{border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-action--select[aria-pressed=true]{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.skill-action--preview{gap:7px;border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-publish-form{display:flex;flex-direction:column;gap:9px;margin-top:12px;padding:11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .28)}.skill-publish-form label{display:flex;flex-direction:column;gap:4px;color:hsl(var(--muted-foreground));font-size:10px}.skill-publish-form input{min-width:0;height:31px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px}.skill-publish-form input:focus{border-color:hsl(var(--primary) / .55)}.skill-publish-form__optional{display:grid;grid-template-columns:1fr 1fr;gap:8px}@keyframes skill-spin{to{transform:rotate(360deg)}}@keyframes skill-view-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 780px){.skill-workspace{overflow-y:auto;padding:24px 12px 32px}.skill-workspace__grid{flex:none;grid-template-columns:1fr;gap:32px}.skill-candidate{display:block}.skill-candidate__view{overflow:visible;padding-right:0}.skill-candidate:nth-child(2){padding-top:32px;border-top:1px solid hsl(var(--border))}.skill-candidate:nth-child(2):before{display:none}.skill-workspace__intro h1{font-size:20px}.skill-publish-form__optional{grid-template-columns:1fr}.skill-action{min-height:44px}}@media (prefers-reduced-motion: reduce){.skill-candidate__view,.skill-candidate__spinner{animation:none}}.ui-carousel{position:relative}.ui-carousel__viewport{overflow:hidden;touch-action:pan-y pinch-zoom}.ui-carousel__track{display:flex;margin-left:-12px}.ui-carousel__track.is-vertical{flex-direction:column;margin-top:-12px;margin-left:0}.ui-carousel__item{min-width:0;flex:0 0 100%;padding-left:12px}.ui-carousel__item.is-vertical{padding-top:12px;padding-left:0}.ui-carousel__control{position:absolute;z-index:2;top:50%;display:inline-grid;width:28px;height:28px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background) / .92);color:hsl(var(--foreground));box-shadow:0 2px 8px hsl(var(--foreground) / .08);cursor:pointer;transform:translateY(-50%);transition:background-color .14s ease,border-color .14s ease,opacity .14s ease;touch-action:manipulation}.ui-carousel__control--previous{left:8px}.ui-carousel__control--next{right:8px}.ui-carousel__control:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.ui-carousel__control:focus-visible{outline:2px solid hsl(var(--ring) / .42);outline-offset:2px}.ui-carousel__control:disabled{cursor:default;opacity:.34}.ui-carousel__control svg{width:15px;height:15px}.ui-carousel__control.is-vertical{left:50%;transform:translate(-50%) rotate(90deg)}.ui-carousel__control--previous.is-vertical{top:8px}.ui-carousel__control--next.is-vertical{top:auto;right:auto;bottom:8px}@media (prefers-reduced-motion: reduce){.ui-carousel__control{transition:none}}.new-chat-feature-carousel{position:absolute;bottom:10px;left:50%;display:grid;grid-template-columns:28px minmax(0,230px) 28px;align-items:center;column-gap:12px;width:min(310px,calc(100% - 32px));transform:translate(-50%)}.new-chat-feature-carousel .ui-carousel__viewport{grid-column:2;grid-row:1;min-width:0}.new-chat-feature-carousel .ui-carousel__track{margin-left:-10px}.new-chat-feature-carousel .ui-carousel__item{padding-left:10px}.new-chat-feature-carousel .ui-carousel__control{position:static;grid-row:1;border:0;background:transparent;box-shadow:none;transform:none}.new-chat-feature-carousel .ui-carousel__control:hover:not(:disabled){border:0;background:transparent}.new-chat-feature-carousel .ui-carousel__control--previous{grid-column:1}.new-chat-feature-carousel .ui-carousel__control--next{grid-column:3}.new-chat-feature-carousel__close{position:absolute;z-index:3;top:4px;left:41px;display:inline-grid;width:28px;height:28px;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .14s ease,background-color .14s ease}.new-chat-feature-carousel__close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-feature-carousel__close:focus-visible{outline:2px solid hsl(var(--ring) / .42);outline-offset:1px}.new-chat-feature-carousel__close svg{width:14px;height:14px}.new-chat-feature-card{position:relative;display:flex;height:104px;align-items:flex-end;overflow:hidden;padding:12px 28px 12px 12px;border:0;border-radius:12px;background:hsl(var(--muted) / .58);color:hsl(var(--foreground));-webkit-user-select:none;user-select:none}.new-chat-feature-card>div{position:relative;z-index:1;display:flex;flex-direction:column;gap:4px}.new-chat-feature-card__copy{max-width:118px}.new-chat-feature-card__illustration{position:absolute;top:28px;right:8px;width:86px;height:64px;fill:none;stroke:hsl(var(--foreground) / .44);stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;shape-rendering:geometricPrecision}.new-chat-feature-card__illustration-connectors{stroke:hsl(var(--foreground) / .3)}.new-chat-feature-card__illustration-surfaces{fill:hsl(var(--panel) / .82)}.new-chat-feature-card__illustration-details{fill:none}.new-chat-feature-card__illustration-dot{fill:hsl(var(--foreground) / .4);stroke:none}.new-chat-feature-card strong{font-size:13px;font-weight:600;line-height:1.35}.new-chat-feature-card>div>span{color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}@media (max-width: 720px){.new-chat-feature-carousel{grid-template-columns:28px minmax(0,1fr) 28px;column-gap:8px;width:min(310px,calc(100% - 24px))}.new-chat-feature-carousel__close{left:37px}}@media (max-width: 440px){.new-chat-feature-carousel{width:calc(100% - 16px)}}@media (max-height: 640px){.new-chat-feature-carousel{grid-template-columns:28px minmax(0,1fr) 28px;column-gap:8px;width:min(280px,calc(100% - 24px))}}@media (prefers-reduced-motion: reduce){.new-chat-feature-carousel__close{transition:none}}.studio-update-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:112px;min-height:32px;padding:0 10px;border:1px solid #1664ff;border-radius:8px;background:#1664ff;color:#fff;font:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle{gap:0;width:32px;min-width:32px;padding:0;overflow:hidden;white-space:nowrap;transition:width .18s ease,gap .18s ease,padding .18s ease,border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle:hover,.studio-update-trigger.is-idle:focus-visible{gap:7px;width:124px;padding:0 10px;border-color:#1664ff;background:#1664ff;color:#fff}.studio-update-trigger.is-idle>span{max-width:0;overflow:hidden;opacity:0;transform:translate(-4px);transition:max-width .18s ease,opacity .12s ease,transform .18s ease}.studio-update-trigger.is-idle:hover>span,.studio-update-trigger.is-idle:focus-visible>span{max-width:86px;opacity:1;transform:translate(0)}.studio-update-trigger.is-submitting{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer}.studio-update-trigger.is-error{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--destructive))}.studio-update-trigger.is-published{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.studio-update-icon{width:17px;height:17px;flex:0 0 17px}.studio-update-dialog{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:10px;width:min(500px,calc(100vw - 32px));min-width:0}.studio-update-dialog>.studio-update-dialog-mark{grid-column:1;grid-row:1}.studio-update-dialog>.confirm-title{grid-column:2;grid-row:1;align-self:start;margin:5px 0 12px}.studio-update-dialog>:not(.studio-update-dialog-mark,.confirm-title){grid-column:1 / -1;min-width:0}.studio-update-dialog .confirm-text,.studio-update-dialog .studio-update-changelog li,.studio-update-dialog .studio-update-changelog p,.studio-update-dialog .studio-update-error,.studio-update-dialog .studio-update-progress small,.studio-update-dialog .studio-update-progress-note,.studio-update-dialog .studio-update-console-link{overflow-wrap:anywhere}.studio-update-field{position:relative;display:grid;gap:6px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-version-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:36px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.studio-update-version-trigger:hover{border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .18)}.studio-update-version-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.studio-update-version-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.studio-update-version-trigger>svg{width:16px;height:16px;flex:0 0 16px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .16s ease}.studio-update-version-trigger>span,.studio-update-version-option>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.studio-update-version-trigger[aria-expanded=true]>svg{transform:rotate(180deg)}.studio-update-version-menu{position:absolute;z-index:50;top:calc(100% + 6px);left:0;width:100%;max-height:190px;padding:4px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel, var(--background)));box-shadow:0 12px 28px hsl(var(--foreground) / .1),0 2px 8px hsl(var(--foreground) / .05);overscroll-behavior:contain}.studio-update-version-option{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:34px;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer}.studio-update-version-option:hover,.studio-update-version-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.studio-update-version-option.is-selected{background:hsl(var(--primary) / .08)}.studio-update-version-option>svg{width:15px;height:15px;flex:0 0 15px;color:hsl(var(--primary));stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.studio-update-dialog-mark{display:inline-grid;flex:0 0 30px;width:30px;height:30px;margin-bottom:12px;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-update-dialog-mark svg{width:18px;height:18px}.studio-update-versions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--canvas) / .5)}.studio-update-versions div:last-child{grid-column:1 / -1}.studio-update-versions dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-versions dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.studio-update-changelog{margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px}.studio-update-changelog>div{margin-bottom:7px;color:hsl(var(--foreground));font-size:12px;font-weight:500}.studio-update-changelog ul{display:grid;gap:5px;max-height:min(180px,25vh);margin:0;padding:0 6px 0 18px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-changelog li,.studio-update-changelog p{margin:0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.studio-update-confirm{border-color:transparent;background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-update-confirm:hover{background:hsl(var(--primary) / .88)}.studio-update-error{margin-bottom:12px;color:hsl(var(--destructive))}.studio-update-error-panel{min-width:0}.studio-update-error-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 12px}.studio-update-error-meta>div{min-width:0;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-error-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-error-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.studio-update-log-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid hsl(var(--border));border-bottom:0;border-radius:8px 8px 0 0;background:hsl(var(--muted) / .28);color:hsl(var(--foreground));font-size:11px;font-weight:500}.studio-update-log-header>span{display:inline-flex;align-items:center;gap:6px}.studio-update-log-header i{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground))}.studio-update-log-header i.is-active{background:#1664ff;box-shadow:0 0 0 3px #1664ff1c}.studio-update-log-header i.is-complete{background:#29ae60}.studio-update-log-header i.is-error{background:hsl(var(--destructive))}.studio-update-log-header small{color:hsl(var(--muted-foreground));font-size:10px;font-weight:400}.studio-update-log-header button{padding:2px 0;border:0;background:transparent;color:hsl(var(--primary));font:inherit;cursor:pointer}.studio-update-log-header button:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-log-header button:disabled{color:hsl(var(--muted-foreground));cursor:default;text-decoration:none}.studio-update-log-lines{min-height:92px;max-height:min(210px,29vh);padding:11px 12px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:0 0 8px 8px;background:hsl(var(--foreground) / .035);color:hsl(var(--foreground));font-family:inherit;font-size:11px;line-height:1.55;overflow-wrap:anywhere;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-log-lines:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:-2px}.studio-update-log-lines>div+div{margin-top:3px}.studio-update-log-lines p{margin:0;color:hsl(var(--muted-foreground))}.studio-update-console-link{display:inline-flex;align-items:center;gap:5px;margin-top:10px;color:hsl(var(--primary));font-size:11px;font-weight:500;text-decoration:none}.studio-update-console-link:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-progress-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 18px}.studio-update-progress-summary>div{display:grid;gap:4px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-progress-summary span{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-summary strong{overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.studio-update-progress{display:grid;gap:0;margin:0 0 14px;padding:0;list-style:none}.studio-update-progress li{position:relative;display:grid;grid-template-columns:18px minmax(0,1fr);gap:9px;min-height:38px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-progress li:not(:last-child):after{position:absolute;top:14px;bottom:-2px;left:5px;width:1px;background:hsl(var(--border));content:""}.studio-update-progress li.is-complete:not(:last-child):after{background:#1664ff}.studio-update-progress-dot{position:relative;z-index:1;width:11px;height:11px;margin-top:2px;border:2px solid hsl(var(--border));border-radius:50%;background:hsl(var(--background))}.studio-update-progress li.is-active,.studio-update-progress li.is-complete{color:hsl(var(--foreground))}.studio-update-progress li.is-active .studio-update-progress-dot{border-color:#1664ff;box-shadow:0 0 0 3px #1664ff1f}.studio-update-progress li.is-complete .studio-update-progress-dot{border-color:#1664ff;background:#1664ff}.studio-update-progress li>div{display:grid;gap:3px;min-width:0}.studio-update-progress small{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-note{margin:12px 0 18px;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.55}.sandbox-entry{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid hsl(268 58% 58% / .34);background:#f4eefb;color:#5b318c;font:inherit;font-weight:600;cursor:pointer;transition:background-color .14s ease-out,border-color .14s ease-out}.sandbox-entry svg{width:15px;height:15px;flex:0 0 auto}.sandbox-entry:hover:not(:disabled){border-color:#803ecc85;background:#ece2f9}.sandbox-entry:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-entry:disabled{cursor:default;opacity:.72}.sandbox-entry--composer{min-height:30px;padding:0 13px;border-radius:999px;font-size:12px}.sandbox-entry--header{min-height:32px;padding:0 10px;border-radius:7px;font-size:12px}.sandbox-entry.is-active{border-style:dashed}.sandbox-new-chat-entry{display:flex;justify-content:center;min-height:30px}.composer-slot{width:100%;min-width:0}.sandbox-composer-wrap{position:relative;z-index:50}.sandbox-session-warning{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;width:calc(100% - 32px);max-width:736px;min-height:24px;margin:0 auto 6px;color:#c7840f;font-size:12px}.sandbox-session-warning-dot{display:none}.sandbox-session-warning-copy{grid-column:2;white-space:nowrap;text-align:center}.sandbox-session-warning button{grid-column:3;justify-self:end;padding:3px 5px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-weight:580;cursor:pointer}.sandbox-session-warning button:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.sandbox-composer-wrap .composer-box{display:grid;grid-template-columns:1fr auto;grid-template-rows:minmax(44px,auto) 36px;align-items:center;gap:2px 8px;min-height:104px;padding:10px 8px 8px;border-radius:24px}.sandbox-composer-wrap .comp-input{grid-row:1;grid-column:1 / -1;align-self:stretch;width:100%;min-height:44px;padding:8px 10px 4px}.sandbox-composer-wrap .sandbox-composer-input{grid-row:1;grid-column:1 / -1;align-self:stretch;display:flex;flex-flow:row wrap;align-content:flex-start;align-items:center;gap:6px;min-height:44px;padding:5px 10px 2px}.sandbox-composer-input>.invocation-chips{flex:0 1 auto}.sandbox-composer-input>.comp-input{flex:1 1 180px;min-width:120px;min-height:28px;padding:4px 0;line-height:20px}.sandbox-codex-composer .composer-command-menu{z-index:100;display:flex;max-height:min(420px,calc(100vh - 180px));flex-direction:column}.sandbox-codex-composer .composer-command-list{min-height:0;max-height:none}.sandbox-composer-wrap .composer-left-controls{grid-row:2;grid-column:1;justify-self:start}.composer-left-controls{display:flex;align-items:center;gap:2px;min-width:0}.sandbox-composer-control{width:32px;height:32px}.sandbox-composer-control svg{width:16px;height:16px}.sandbox-composer-control.is-locked{color:hsl(var(--muted-foreground) / .56)}.sandbox-codex-composer .composer-menu-separator{height:1px;margin:4px 6px;background:hsl(var(--border))}.turn--system{width:100%;align-items:stretch;margin-bottom:16px}.sandbox-activity-record{width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--muted-foreground))}.sandbox-activity-summary{display:grid;grid-template-columns:7px auto minmax(0,1fr) auto;align-items:center;gap:7px;min-width:0;font-size:12px;line-height:1.45}.sandbox-activity-dot{width:7px;height:7px;border-radius:50%;background:hsl(var(--muted-foreground) / .68)}.sandbox-activity-label{padding-right:7px;border-right:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11px;font-weight:600}.sandbox-activity-summary strong{min-width:0;overflow-wrap:anywhere;color:hsl(var(--foreground));font-weight:560}.sandbox-activity-summary time{color:hsl(var(--muted-foreground));font-size:11px;white-space:nowrap}.sandbox-activity-details{display:grid;gap:5px;margin:8px 0 0 21px}.sandbox-activity-details>div{min-width:0;display:grid;grid-template-columns:max-content minmax(0,1fr);gap:12px;font-size:12px;line-height:1.5}.sandbox-activity-details dt,.sandbox-activity-details dd{min-width:0;margin:0}.sandbox-activity-details dt{color:hsl(var(--muted-foreground));white-space:nowrap}.sandbox-activity-details dd{overflow-wrap:break-word;color:hsl(var(--foreground))}.sandbox-activity-details code{font:inherit;font-size:11px;line-height:1.5;white-space:pre-wrap}.sandbox-composer-wrap .comp-send{grid-row:2;grid-column:2}.main.is-sandbox-session{position:relative;isolation:isolate;background:linear-gradient(to bottom,#f4edfd,#f8f3fc,#fbf8fc 48%,hsl(var(--panel)) 76%)}.main.is-sandbox-session:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse 78% 40% at 18% 0%,hsl(244 82% 84% / .24),transparent 70%),radial-gradient(ellipse 70% 36% at 52% 0%,hsl(284 70% 86% / .2),transparent 72%),radial-gradient(ellipse 64% 38% at 88% 2%,hsl(324 66% 88% / .16),transparent 72%),linear-gradient(to bottom,hsl(var(--panel) / 0),hsl(var(--panel) / .18) 42%,hsl(var(--panel)) 76%);filter:blur(24px);opacity:1;animation:sandbox-smoke-enter .42s ease-out both}.main.is-sandbox-session>*{position:relative;z-index:1}.sandbox-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.sandbox-dialog{width:min(440px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 20px 56px hsl(var(--foreground) / .2);animation:sandbox-dialog-enter .18s ease-out both}.sandbox-dialog-visual{position:relative;display:grid;height:112px;place-items:center;overflow:hidden;border-bottom:1px solid hsl(var(--border));background:radial-gradient(circle at 35% 70%,hsl(256 68% 78% / .34),transparent 40%),radial-gradient(circle at 68% 30%,hsl(276 66% 72% / .28),transparent 42%),#f9f8fc}.sandbox-dialog-orbit{position:absolute;width:104px;height:44px;border:1px solid hsl(268 52% 54% / .22);border-radius:50%;transform:rotate(-12deg)}.sandbox-dialog-icon{display:grid;width:46px;height:46px;place-items:center;border:1px solid hsl(268 58% 58% / .3);border-radius:14px;background:hsl(var(--panel) / .9);color:#68389f;box-shadow:0 8px 24px #6c38a824}.sandbox-dialog-icon svg{width:23px;height:23px}.sandbox-spinner{width:21px;height:21px;border:2px solid hsl(268 48% 42% / .2);border-top-color:currentColor;border-radius:50%;animation:sandbox-spin .8s linear infinite}.sandbox-dialog-copy{padding:22px 24px 20px;text-align:center}.sandbox-dialog-copy h2{margin:0 0 8px;color:hsl(var(--foreground));font-size:17px;font-weight:650}.sandbox-dialog-copy p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.65}.sandbox-dialog-copy .sandbox-dialog-error{color:hsl(var(--destructive))}.sandbox-dialog-field{display:grid;gap:6px;margin-top:16px;text-align:left}.sandbox-dialog-field-label{display:flex;align-items:center;justify-content:space-between;gap:12px;color:hsl(var(--foreground));font-size:12px;font-weight:550}.sandbox-dialog-field-label>:last-child{color:hsl(var(--muted-foreground));font-size:11px;font-weight:400}.sandbox-dialog-field input{width:100%;height:36px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px}.sandbox-dialog-field input:focus-visible{border-color:hsl(var(--primary) / .64);box-shadow:0 0 0 2px hsl(var(--primary) / .14)}.sandbox-dialog-field input:disabled{cursor:default;opacity:.66}.sandbox-dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.sandbox-dialog-actions button{min-width:80px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-dialog-actions button:hover{background:hsl(var(--secondary))}.sandbox-dialog-actions button:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-dialog-actions .is-primary{border-color:#68389f;background:#68389f;color:hsl(var(--primary-foreground))}.sandbox-dialog-actions .is-primary:hover{background:#5b318c}@keyframes sandbox-spin{to{transform:rotate(360deg)}}@keyframes sandbox-dialog-enter{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sandbox-smoke-enter{0%{opacity:0}to{opacity:1}}.sandbox-codex-composer .composer-command-head small{max-width:210px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.sandbox-codex-composer .composer-command-icon--command,.sandbox-codex-composer .composer-command-icon--model{font-size:16px;font-weight:700;line-height:1}.sandbox-codex-composer .composer-command-icon--command{background:hsl(var(--accent));color:hsl(var(--foreground))}.sandbox-codex-composer .composer-command-icon--model{background:hsl(var(--secondary));color:hsl(var(--foreground))}.sandbox-token-usage{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-right:auto}.sandbox-token-usage>span{display:inline-flex;align-items:baseline;gap:4px;padding:3px 7px;border:1px solid hsl(var(--border) / .76);border-radius:6px;background:hsl(var(--muted) / .42);color:hsl(var(--muted-foreground));white-space:nowrap}.sandbox-token-usage small{font-size:9px;font-weight:560}.sandbox-token-usage strong{color:hsl(var(--foreground) / .76);font-size:10px;font-weight:600;line-height:1.2}@media (max-width: 700px){.sandbox-entry--header span{display:none}.sandbox-entry--header{width:32px;padding:0}.sandbox-session-warning{grid-template-columns:1fr auto;width:calc(100% - 16px)}.sandbox-session-warning-copy{grid-column:1;white-space:normal;text-align:left}.sandbox-session-warning button{grid-column:2}.sandbox-activity-summary{grid-template-columns:7px auto minmax(0,1fr)}.sandbox-activity-summary time{grid-column:3}.sandbox-activity-details>div{grid-template-columns:1fr;gap:1px}}@media (prefers-reduced-motion: reduce){.sandbox-entry,.sandbox-dialog,.main.is-sandbox-session:before{animation:none;transition:none}}.sandbox-control-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1220;display:grid;place-items:center;padding:28px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:sandbox-control-fade .14s ease-out}.sandbox-control-dialog{width:min(680px,calc(100vw - 40px));max-height:min(780px,calc(100vh - 48px));display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .17);animation:sandbox-control-rise .18s cubic-bezier(.2,.8,.2,1)}.sandbox-control-head{min-height:60px;display:grid;grid-template-columns:32px minmax(0,1fr) 32px;align-items:center;gap:10px;padding:0 15px 0 17px;border-bottom:1px solid hsl(var(--border))}.sandbox-control-head-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.sandbox-control-head-icon svg{width:17px;height:17px}.sandbox-control-head h2,.sandbox-control-head p{margin:0}.sandbox-control-head h2{color:hsl(var(--foreground));font-size:14px;font-weight:660;line-height:1.35}.sandbox-control-head p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.sandbox-control-close{width:30px;height:30px;display:grid;place-items:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.sandbox-control-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.sandbox-control-dialog button:focus-visible,.sandbox-control-dialog input:focus-visible,.sandbox-control-dialog iframe:focus-visible{outline:2px solid hsl(var(--primary));outline-offset:1px}.sandbox-control-close svg{width:16px;height:16px}.sandbox-control-body{min-height:0;overflow:auto;padding:18px}.sandbox-control-actions{min-height:58px;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:10px 18px;border-top:1px solid hsl(var(--border));background:hsl(var(--secondary) / .16)}.sandbox-control-actions button,.sandbox-control-state button{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:590;text-decoration:none;cursor:pointer}.sandbox-control-actions button:hover:not(:disabled),.sandbox-control-state button:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary))}.sandbox-control-actions button.is-primary,.sandbox-control-state button{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.sandbox-control-actions button:disabled{cursor:default;opacity:.5}.sandbox-control-actions svg{width:13px;height:13px}.sandbox-choice-group{margin:0 0 18px;padding:0;border:0}.sandbox-settings-dialog{width:min(720px,calc(100vw - 40px))}.sandbox-choice-group legend{margin-bottom:8px;color:hsl(var(--foreground));font-size:12px;font-weight:650}.sandbox-choice-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.sandbox-choice-group:nth-of-type(3) .sandbox-choice-list{grid-template-columns:repeat(2,minmax(0,1fr))}.sandbox-choice-list button{min-width:0;min-height:72px;display:flex;align-items:flex-start;gap:8px;padding:10px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;text-align:left;cursor:pointer}.sandbox-choice-list button:hover:not(:disabled),.sandbox-choice-list button.is-active{border-color:hsl(var(--primary) / .42);background:hsl(var(--accent))}.sandbox-choice-list button.is-danger:hover:not(:disabled),.sandbox-choice-list button.is-danger.is-active{border-color:hsl(var(--destructive) / .38);background:hsl(var(--destructive) / .06)}.sandbox-choice-list button>i{width:12px;height:12px;flex:0 0 auto;margin-top:2px;border:1px solid hsl(var(--border));border-radius:50%}.sandbox-choice-list button.is-active>i{border:3px solid hsl(var(--primary));background:hsl(var(--background))}.sandbox-choice-list button>span{min-width:0;display:grid;gap:5px}.sandbox-choice-list strong{color:hsl(var(--foreground));font-size:11px;font-weight:650}.sandbox-choice-list small{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45}.sandbox-network-toggle{min-height:54px;display:flex;align-items:center;gap:12px;margin-top:2px;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .24)}.sandbox-network-toggle>span{min-width:0;flex:1;display:grid;gap:3px}.sandbox-network-toggle strong{font-size:11px}.sandbox-network-toggle small{color:hsl(var(--muted-foreground));font-size:11px}.sandbox-network-toggle input{width:16px;height:16px;accent-color:hsl(var(--primary))}.sandbox-network-toggle.is-disabled{opacity:.62}.sandbox-control-note,.sandbox-control-error{margin-top:12px;padding:9px 11px;border:1px solid hsl(42 70% 52% / .25);border-radius:8px;background:#fcf8ed;color:#916622;font-size:12px;line-height:1.55}.sandbox-control-note.is-danger,.sandbox-control-error{border-color:hsl(var(--destructive) / .22);background:hsl(var(--destructive) / .06);color:hsl(var(--destructive))}.sandbox-workspace-dialog{width:min(600px,calc(100vw - 40px))}.sandbox-workspace-input{display:grid;gap:7px;color:hsl(var(--foreground));font-size:11px;font-weight:650}.sandbox-workspace-input>div{display:flex;gap:7px}.sandbox-workspace-input input{min-width:0;height:36px;flex:1;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;outline:0;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.sandbox-workspace-input input:focus{border-color:hsl(var(--primary) / .55);box-shadow:0 0 0 3px hsl(var(--primary) / .1)}.sandbox-workspace-input button{width:64px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--secondary) / .35);color:hsl(var(--foreground));font:inherit;font-size:11px;cursor:pointer}.sandbox-directory-browser{height:268px;margin-top:14px;overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .14)}.sandbox-directory-head{height:36px;display:flex;align-items:center;gap:8px;padding:0 10px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:10px}.sandbox-directory-head span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sandbox-directory-head svg{width:13px}.sandbox-directory-list{height:calc(100% - 36px);overflow:auto;padding:5px}.sandbox-directory-list button{width:100%;min-height:34px;display:grid;grid-template-columns:18px minmax(0,auto) minmax(0,1fr) 16px;align-items:center;gap:7px;padding:5px 7px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:11px;text-align:left;cursor:pointer}.sandbox-directory-list button:hover{background:hsl(var(--foreground) / .05)}.sandbox-directory-list button>svg:first-child{width:15px;color:hsl(var(--foreground))}.sandbox-directory-list button>svg:last-child{width:13px;color:hsl(var(--muted-foreground))}.sandbox-directory-list button small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;text-overflow:ellipsis;white-space:nowrap}.sandbox-directory-empty{display:grid;min-height:120px;place-items:center;color:hsl(var(--muted-foreground));font-size:11px}.sandbox-tool-dialog{width:min(1120px,calc(100vw - 44px));height:min(760px,calc(100vh - 48px));max-height:none}.sandbox-tool-toolbar{min-height:42px;display:flex;align-items:center;gap:12px;padding:5px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--secondary) / .2)}.sandbox-tool-toolbar>span{display:inline-flex;align-items:center;gap:7px;color:hsl(var(--muted-foreground));font-size:10px;font-weight:600}.sandbox-tool-toolbar>span i{width:7px;height:7px;border-radius:50%;background:hsl(var(--muted-foreground) / .5)}.sandbox-tool-toolbar>span i.is-ready{background:#2ab262}.sandbox-tool-toolbar>span i.is-loading{background:#e9ab1c}.sandbox-tool-surface{flex:1;min-height:0;display:grid;overflow:hidden;background:hsl(var(--secondary) / .2)}.sandbox-tool-dialog--terminal .sandbox-tool-surface{background:#15171e}.sandbox-tool-surface iframe{width:100%;height:100%;border:0;background:hsl(var(--background))}.sandbox-control-state{display:grid;place-items:center;align-content:center;gap:8px;padding:28px;color:hsl(var(--muted-foreground));text-align:center}.sandbox-control-state>svg{width:22px;height:22px;color:hsl(var(--foreground))}.sandbox-control-state strong{color:hsl(var(--foreground));font-size:13px}.sandbox-control-state span{max-width:420px;font-size:11px;line-height:1.55}.sandbox-approval-dialog{width:min(560px,calc(100vw - 40px))}.sandbox-approval-reason{margin-bottom:11px;color:hsl(var(--foreground));font-size:12px;line-height:1.55}.sandbox-approval-dialog pre{max-height:240px;margin:0 0 10px;overflow:auto;padding:11px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:#181a21;color:#e0e6eb;font:inherit;font-size:11px;line-height:1.55;white-space:pre-wrap;word-break:break-word}.sandbox-approval-meta{color:hsl(var(--muted-foreground));font-size:10px}.sandbox-approval-meta code{color:hsl(var(--foreground));font:inherit;font-size:10px}.sandbox-approval-actions{flex-wrap:wrap}.sandbox-threads-dialog{width:min(620px,calc(100vw - 40px))}.sandbox-thread-list{display:grid;max-height:min(520px,64vh);overflow-y:auto;padding:7px}.sandbox-thread-list>button{display:grid;grid-template-columns:minmax(0,1fr) auto 18px;align-items:center;gap:10px;min-height:62px;padding:9px 10px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.sandbox-thread-list>button:hover{background:hsl(var(--accent))}.sandbox-thread-list>button.is-active{background:hsl(var(--muted) / .7);cursor:default}.sandbox-thread-list>button>span{display:grid;min-width:0;gap:4px}.sandbox-thread-list strong,.sandbox-thread-list small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sandbox-thread-list strong{font-size:12px;font-weight:620}.sandbox-thread-list small,.sandbox-thread-list time{color:hsl(var(--muted-foreground));font-size:10px}.sandbox-thread-list svg{width:14px;height:14px;color:hsl(var(--muted-foreground))}@keyframes sandbox-control-fade{0%{opacity:0}to{opacity:1}}@keyframes sandbox-control-rise{0%{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.sandbox-control-backdrop{padding:10px}.sandbox-control-dialog{width:100%;max-height:calc(100vh - 20px)}.sandbox-tool-dialog{height:calc(100vh - 20px)}.sandbox-choice-list,.sandbox-choice-group:nth-of-type(3) .sandbox-choice-list{grid-template-columns:1fr}.sandbox-choice-list button{min-height:58px}.sandbox-control-head p{display:none}.sandbox-control-actions>button{flex:1}}@media (prefers-reduced-motion: reduce){.sandbox-control-backdrop,.sandbox-control-dialog{animation:none}}.sandbox-agent-details{display:grid;align-content:start;gap:20px;width:min(920px,100%);height:100%;min-height:0;margin:0 auto;padding:28px 32px;overflow:auto}.sandbox-agent-details-header{display:grid;gap:20px}.sandbox-agent-back{display:inline-flex;width:fit-content;height:32px;align-items:center;gap:6px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;font-weight:550;cursor:pointer}.sandbox-agent-back:hover{background:hsl(var(--muted));color:hsl(var(--foreground))}.sandbox-agent-back:focus-visible{outline:2px solid hsl(var(--foreground) / .3);outline-offset:2px}.sandbox-agent-back svg{width:16px;height:16px;flex:0 0 auto}.sandbox-agent-details-header h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650}.sandbox-agent-details-header p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px}.sandbox-agent-detail-error{padding:10px 12px;border:1px solid hsl(var(--destructive) / .3);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px}.sandbox-agent-detail-panel{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.sandbox-agent-detail-panel dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:8px 24px}.sandbox-agent-detail-panel dl>div{min-width:0;padding:16px 0;border-bottom:1px solid hsl(var(--border))}.sandbox-agent-detail-panel dl>div:nth-last-child(-n+2){border-bottom:0}.sandbox-agent-detail-panel dl>div:nth-child(odd){padding-right:24px}.sandbox-agent-detail-panel dl>div:nth-child(2n){padding-left:24px}.sandbox-agent-detail-panel dl>.is-wide{grid-column:1 / -1;padding-right:0}.sandbox-agent-detail-panel dt{margin-bottom:6px;color:hsl(var(--muted-foreground));font-size:11.5px}.sandbox-agent-detail-panel dd{min-width:0;margin:0;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:13px;font-weight:520}.sandbox-agent-detail-panel footer{display:flex;justify-content:flex-end;gap:8px;padding:14px 24px;border-top:1px solid hsl(var(--border));background:hsl(var(--muted) / .25)}.sandbox-agent-detail-panel footer button{height:34px;padding:0 14px;border-radius:8px;font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-agent-delete{border:1px solid hsl(var(--destructive) / .34);background:hsl(var(--panel));color:hsl(var(--destructive))}.sandbox-agent-open{border:1px solid hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.sandbox-agent-detail-panel footer button:disabled{cursor:default;opacity:.58}@media (max-width: 720px){.sandbox-agent-details{padding:20px 16px}.sandbox-agent-detail-panel dl{grid-template-columns:1fr;padding:8px 16px}.sandbox-agent-detail-panel dl>div,.sandbox-agent-detail-panel dl>div:nth-child(odd),.sandbox-agent-detail-panel dl>div:nth-child(2n){padding:14px 0;border-bottom:1px solid hsl(var(--border))}.sandbox-agent-detail-panel dl>div:last-child{border-bottom:0}}@layer components{._SegmentedControl_1sl7d_1{--segmented-control-option-radius: calc( var(--segmented-control-radius) - var(--segmented-control-gutter) );position:relative;overflow:auto;display:inline-flex;flex-wrap:nowrap;gap:var(--segmented-control-gap);height:var(--segmented-control-size);padding:var(--segmented-control-gutter);border-radius:var(--segmented-control-radius);background:var(--segmented-control-background);font-size:var(--segmented-control-font-size);font-weight:var(--segmented-control-font-weight);-ms-overflow-style:none;scrollbar-width:none;vertical-align:middle;white-space:nowrap}._SegmentedControl_1sl7d_1::-webkit-scrollbar{width:0;height:0}._SegmentedControl_1sl7d_1::-webkit-scrollbar-track,._SegmentedControl_1sl7d_1::-webkit-scrollbar-thumb{background:transparent}._SegmentedControl_1sl7d_1:where([data-block]){overflow:hidden;display:flex;width:100%;white-space:wrap}._SegmentedControl_1sl7d_1:where([data-size="3xs"]){--segmented-control-size: var(--control-size-3xs);--segmented-control-font-size: var(--control-font-size-sm);--segmented-control-radius: var(--control-radius-sm);--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-size="2xs"]){--segmented-control-size: var(--control-size-2xs);--segmented-control-font-size: var(--control-font-size-sm);--segmented-control-radius: var(--control-radius-sm);--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-size=xs]){--segmented-control-size: var(--control-size-xs);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-sm);--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-size=sm]){--segmented-control-size: var(--control-size-sm);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-md);--segmented-control-option-gutter: var(--control-gutter-sm)}._SegmentedControl_1sl7d_1:where([data-size=md]){--segmented-control-size: var(--control-size-md);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-md);--segmented-control-option-gutter: var(--control-gutter-md)}._SegmentedControl_1sl7d_1:where([data-size=lg]){--segmented-control-size: var(--control-size-lg);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-md);--segmented-control-option-gutter: var(--control-gutter-md)}._SegmentedControl_1sl7d_1:where([data-size=xl]){--segmented-control-size: var(--control-size-xl);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-lg);--segmented-control-option-gutter: var(--control-gutter-lg)}._SegmentedControl_1sl7d_1:where([data-size="2xl"]){--segmented-control-size: var(--control-size-2xl);--segmented-control-font-size: var(--control-font-size-lg);--segmented-control-radius: var(--control-radius-xl);--segmented-control-option-gutter: var(--control-gutter-xl)}._SegmentedControl_1sl7d_1:where([data-size="3xl"]){--segmented-control-size: var(--control-size-3xl);--segmented-control-font-size: var(--control-font-size-lg);--segmented-control-radius: var(--control-radius-xl);--segmented-control-option-gutter: var(--control-gutter-xl)}._SegmentedControl_1sl7d_1:where([data-gutter-size="2xs"]){--segmented-control-option-gutter: var(--control-gutter-2xs)}._SegmentedControl_1sl7d_1:where([data-gutter-size=xs]){--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-gutter-size=sm]){--segmented-control-option-gutter: var(--control-gutter-sm)}._SegmentedControl_1sl7d_1:where([data-gutter-size=md]){--segmented-control-option-gutter: var(--control-gutter-md)}._SegmentedControl_1sl7d_1:where([data-gutter-size=lg]){--segmented-control-option-gutter: var(--control-gutter-lg)}._SegmentedControl_1sl7d_1:where([data-gutter-size=xl]){--segmented-control-option-gutter: var(--control-gutter-xl)}._SegmentedControl_1sl7d_1:where([data-pill]){--segmented-control-radius: var(--radius-full);--segmented-control-option-radius: var(--radius-full)}._SegmentedControlOption_1sl7d_140{position:relative;padding:0 var(--segmented-control-option-gutter);border-radius:var(--segmented-control-option-radius);color:var(--color-text-secondary);cursor:pointer;line-height:1;transition-duration:var(--transition-duration-basic);transition-property:opacity,background-color,color;transition-timing-function:var(--transition-ease-basic)}._SegmentedControlOption_1sl7d_140:focus{outline:0}:where(._SegmentedControl_1sl7d_1[data-block]) ._SegmentedControlOption_1sl7d_140{flex:1}:where(._SegmentedControl_1sl7d_1[data-pill]) ._SegmentedControlOption_1sl7d_140{padding:0 calc(var(--segmented-control-option-gutter) * var(--control-gutter-pill-scaling))}._SegmentedControlOption_1sl7d_140[data-state=on]:focus-visible{outline:2px solid var(--color-ring)}._SegmentedControlOption_1sl7d_140:before{position:absolute;inset:var(--segmented-control-option-highlight-gutter);border-radius:var(--segmented-control-option-radius);background:var(--segmented-control-option-highlight-background-color);content:"";opacity:0;pointer-events:none;transform:scale(1);transition-duration:var(--transition-duration-basic);transition-property:opacity,transform;transition-timing-function:var(--transition-ease-basic);will-change:transform}._SegmentedControlOption_1sl7d_140:active:before{transform:scale(var(--scale),.97)}._SegmentedControlOption_1sl7d_140 svg{display:block}@media (hover: hover) and (pointer: fine){._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):hover{color:var(--color-text)}._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):hover:before{opacity:.5}}._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):focus-visible{color:var(--color-text);outline:2px solid var(--color-ring)}._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):active:before{opacity:.75}._SegmentedControlOption_1sl7d_140[data-state=on]{color:var(--color-text)}._SegmentedControlOption_1sl7d_140[data-disabled]{cursor:not-allowed;opacity:.5}._SegmentedControlOption_1sl7d_140[data-disabled]:before{opacity:0!important}._SegmentedControlThumb_1sl7d_219{position:absolute;top:var(--segmented-control-gutter);bottom:var(--segmented-control-gutter);left:0;border-radius:var(--segmented-control-option-radius);background:var(--segmented-control-thumb-background);box-shadow:var(--segmented-control-thumb-shadow);pointer-events:none;will-change:transform}}.sandbox-agent-workspace{display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-height:0;background:hsl(var(--canvas))}.sandbox-agent-workspace>header{display:flex;min-width:0;min-height:62px;align-items:center;justify-content:space-between;gap:16px;padding:10px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.sandbox-agent-workspace-title{display:flex;min-width:0;align-items:center;gap:10px}.sandbox-agent-workspace-title>button{display:inline-grid;width:24px;height:32px;flex:0 0 auto;place-items:center;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.sandbox-agent-workspace-title>button:hover{color:hsl(var(--foreground))}.sandbox-agent-workspace-title svg{width:17px;height:17px}.sandbox-agent-workspace-title>div{min-width:0}.sandbox-agent-workspace-title h1{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:15px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.sandbox-agent-workspace-title p{display:flex;align-items:center;gap:7px;margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px}.sandbox-agent-workspace-status{display:inline-flex;min-height:18px;align-items:center;padding:0 6px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:550;line-height:1}.sandbox-agent-workspace-status[data-ready]{border-color:#428a5c38;background:#e9f6ee;color:#206f3d}.sandbox-agent-workspace-tabs{width:200px;flex:0 0 auto}.sandbox-agent-workspace button:focus-visible{outline:2px solid hsl(var(--foreground) / .3);outline-offset:2px}.sandbox-agent-workspace-surface{min-width:0;min-height:0;overflow:hidden}.sandbox-agent-workspace-surface iframe{display:block;width:100%;height:100%;border:0;background:hsl(var(--panel))}.sandbox-agent-workspace-state{display:grid;height:100%;place-content:center;gap:12px;color:hsl(var(--muted-foreground));font-size:13px;text-align:center}.sandbox-agent-workspace-state p{margin:0}.sandbox-agent-workspace-state.is-error{color:hsl(var(--destructive))}.sandbox-agent-workspace-state button{justify-self:center;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--foreground));font:inherit;font-size:12px;cursor:pointer}@media (max-width: 720px){.sandbox-agent-workspace>header{align-items:stretch;flex-direction:column}.sandbox-agent-workspace-tabs{width:100%}}.auth-expired-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:140;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .22);backdrop-filter:blur(5px) saturate(.88);-webkit-backdrop-filter:blur(5px) saturate(.88)}.auth-expired-dialog{position:relative;width:min(400px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 28px 80px hsl(var(--foreground) / .2),0 2px 8px hsl(var(--foreground) / .06);animation:auth-expired-enter .18s cubic-bezier(.22,1,.36,1) both}.auth-expired-mark{display:grid;width:32px;height:32px;margin:32px auto 0;place-items:center;color:hsl(var(--foreground))}.auth-expired-mark svg{width:21px;height:21px;stroke-width:1.8}.auth-expired-copy{padding:22px 32px 28px;text-align:center}.auth-expired-copy h2{margin:0;color:hsl(var(--foreground));font-size:19px;font-weight:650;letter-spacing:-.01em}.auth-expired-copy>p:last-child{margin:11px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7}.auth-expired-copy .auth-expired-error{margin-top:10px;color:hsl(var(--destructive))}.auth-expired-actions{padding:0 16px 16px}.auth-expired-actions button{width:100%;height:38px;border:1px solid hsl(var(--foreground));border-radius:9px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:650;cursor:pointer;transition:transform .12s ease,opacity .12s ease}.auth-expired-actions button:hover{opacity:.88}.auth-expired-actions button:active{transform:translateY(1px)}.auth-expired-actions button:focus-visible{outline:3px solid hsl(var(--ring) / .28);outline-offset:2px}.auth-expired-actions button:disabled{cursor:wait;opacity:.58}@keyframes auth-expired-enter{0%{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.auth-expired-dialog{animation:none}}.issue-feedback-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1200;display:grid;place-items:center;padding:24px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:issue-feedback-fade-in .14s ease-out}.issue-feedback-dialog{width:min(480px,calc(100vw - 32px));max-height:min(680px,calc(100vh - 48px));display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:issue-feedback-rise-in .18s cubic-bezier(.2,.8,.2,1)}.issue-feedback-head{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border))}.issue-feedback-head h2{margin:0;font-size:17px;font-weight:600;line-height:1.3}.issue-feedback-close{width:30px;height:30px;display:grid;place-items:center;flex:0 0 auto;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.issue-feedback-close svg,.issue-feedback-success-mark svg{width:16px;height:16px}.issue-feedback-close:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.issue-feedback-body,.issue-feedback-success{min-height:0;overflow-y:auto;padding:20px}.issue-feedback-intro{margin:0 0 12px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.55}.issue-feedback-privacy{margin:0 0 16px;padding:10px 12px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12.5px;line-height:1.55}.issue-feedback-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}.issue-feedback-chip{min-height:30px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;cursor:pointer;transition:background .14s ease,border-color .14s ease,color .14s ease}.issue-feedback-chip:hover:not(:disabled){background:hsl(var(--secondary))}.issue-feedback-chip[aria-pressed=true]{border-color:hsl(var(--primary) / .4);background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.issue-feedback-field{display:grid;gap:8px;color:hsl(var(--foreground));font-size:13px;font-weight:550}.issue-feedback-field textarea{width:100%;min-height:112px;resize:vertical;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;font-weight:400;line-height:1.55}.issue-feedback-field textarea::placeholder{color:hsl(var(--muted-foreground))}.issue-feedback-error{margin:12px 0 0;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.issue-feedback-success{min-height:220px;display:grid;grid-template-columns:36px 1fr;gap:12px;align-content:center;align-items:center;animation:issue-feedback-success-in .18s ease-out}.issue-feedback-success-mark{position:relative;width:36px;height:36px;display:grid;place-items:center;border-radius:9px;background:#24a8541a;color:#238b49;animation:issue-feedback-success-pop .32s cubic-bezier(.2,.8,.2,1)}.issue-feedback-success-mark:after{position:absolute;top:-5px;right:-5px;bottom:-5px;left:-5px;border:1px solid hsl(142 60% 34% / .24);border-radius:12px;content:"";opacity:0;animation:issue-feedback-success-ring .44s ease-out}.issue-feedback-success-mark path{stroke-dasharray:24;stroke-dashoffset:24;animation:issue-feedback-check-draw .28s .1s ease-out forwards}.issue-feedback-success h3{margin:0 0 4px;font-size:15px;font-weight:600}.issue-feedback-success p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.55}.issue-feedback-actions button{height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.issue-feedback-actions{min-height:58px;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.issue-feedback-actions button:hover:not(:disabled){background:hsl(var(--secondary))}.issue-feedback-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.issue-feedback-actions .is-primary:hover:not(:disabled){background:hsl(var(--primary) / .9)}.issue-feedback-close:focus-visible,.issue-feedback-chip:focus-visible,.issue-feedback-field textarea:focus-visible,.issue-feedback-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.issue-feedback-dialog button:disabled,.issue-feedback-dialog textarea:disabled{cursor:not-allowed;opacity:.55}@keyframes issue-feedback-fade-in{0%{opacity:0}to{opacity:1}}@keyframes issue-feedback-rise-in{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes issue-feedback-success-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes issue-feedback-success-pop{0%{transform:scale(.72)}70%{transform:scale(1.06)}to{transform:scale(1)}}@keyframes issue-feedback-success-ring{0%{opacity:.7;transform:scale(.78)}to{opacity:0;transform:scale(1.2)}}@keyframes issue-feedback-check-draw{to{stroke-dashoffset:0}}@media (max-width: 560px){.issue-feedback-backdrop{padding:16px}.issue-feedback-dialog{max-height:calc(100vh - 32px)}}@media (prefers-reduced-motion: reduce){.issue-feedback-backdrop,.issue-feedback-dialog,.issue-feedback-success,.issue-feedback-success-mark,.issue-feedback-success-mark:after,.issue-feedback-success-mark path{animation:none}.issue-feedback-success-mark path{stroke-dashoffset:0}}.platform-feedback-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.platform-feedback-header{flex:0 0 auto}.platform-feedback-header h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.platform-feedback-header p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.platform-feedback-scroll{min-height:0;overflow-y:auto;padding:24px 0 40px}.platform-feedback-form,.platform-feedback-success{width:min(720px,100%)}.platform-feedback-form{display:grid;gap:24px}.platform-feedback-section{display:grid;gap:12px}.platform-feedback-section-heading{display:flex;align-items:center;gap:8px}.platform-feedback-section h2,.platform-feedback-field>span{margin:0;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45}.platform-feedback-section-heading>span,.platform-feedback-suggestions>span{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.platform-feedback-pills{display:flex;flex-wrap:wrap;gap:8px}.platform-feedback-pills button{min-height:32px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;transition:background .14s ease,border-color .14s ease}.platform-feedback-pills button:hover:not(:disabled){background:hsl(var(--secondary))}.platform-feedback-pills button[aria-pressed=true]{border-color:hsl(var(--primary) / .42);background:hsl(var(--primary) / .08)}.platform-feedback-field{display:grid;gap:8px}.platform-feedback-field textarea{width:100%;padding:11px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;line-height:1.55}.platform-feedback-field textarea{min-height:132px;resize:vertical}.platform-feedback-field textarea::placeholder{color:hsl(var(--muted-foreground))}.platform-feedback-suggestions{display:grid;gap:8px}.platform-feedback-privacy{margin:0;padding:10px 12px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12.5px;line-height:1.55}.platform-feedback-error{margin:0;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.platform-feedback-actions{display:flex;justify-content:flex-end}.platform-feedback-actions button{height:36px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 16px;border:1px solid hsl(var(--primary));border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.platform-feedback-actions button:hover:not(:disabled){background:hsl(var(--primary) / .9)}.platform-feedback-success{min-height:280px;display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px;align-content:center;align-items:center;animation:platform-feedback-success-in .18s ease-out}.platform-feedback-success-icon{position:relative;width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:#24a8541a;color:#238b49;animation:platform-feedback-success-pop .32s cubic-bezier(.2,.8,.2,1)}.platform-feedback-success-icon:after{position:absolute;top:-5px;right:-5px;bottom:-5px;left:-5px;border:1px solid hsl(142 60% 34% / .24);border-radius:13px;content:"";opacity:0;animation:platform-feedback-success-ring .44s ease-out}.platform-feedback-success-icon svg{width:16px;height:16px}.platform-feedback-success-icon path{stroke-dasharray:24;stroke-dashoffset:24;animation:platform-feedback-check-draw .28s .1s ease-out forwards}.platform-feedback-success h2{margin:0 0 4px;font-size:15px;font-weight:600}.platform-feedback-success p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.55}.platform-feedback-pills button:focus-visible,.platform-feedback-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:2px}.platform-feedback-field textarea:focus-visible{border-color:hsl(var(--ring) / .58);outline:none;box-shadow:inset 0 0 0 1px hsl(var(--ring) / .3)}.platform-feedback-page button:disabled,.platform-feedback-page textarea:disabled{cursor:not-allowed;opacity:.55}@media (max-width: 720px){.platform-feedback-page{padding:24px 20px 0}}@media (max-width: 560px){.platform-feedback-page{padding-inline:16px}}@keyframes platform-feedback-success-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes platform-feedback-success-pop{0%{transform:scale(.72)}70%{transform:scale(1.06)}to{transform:scale(1)}}@keyframes platform-feedback-success-ring{0%{opacity:.7;transform:scale(.78)}to{opacity:0;transform:scale(1.2)}}@keyframes platform-feedback-check-draw{to{stroke-dashoffset:0}}@media (prefers-reduced-motion: reduce){.platform-feedback-pills button,.platform-feedback-success,.platform-feedback-success-icon,.platform-feedback-success-icon:after,.platform-feedback-success-icon path{transition:none;animation:none}.platform-feedback-success-icon path{stroke-dashoffset:0}}.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0} +*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#005cc5}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-comment,.hljs-code,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}.aw-root{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.aw-agent-head h2,.aw-eval-head h2,.aw-section-head h3{margin:0;color:hsl(var(--foreground));letter-spacing:-.025em}.aw-agent-head p,.aw-eval-head p,.aw-section-head p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.aw-view-tabs,.aw-agent-title-row,.aw-card-head,.aw-section-head,.aw-case-filters,.aw-eval-head{display:flex;align-items:center}.aw-view-tabs{flex:0 0 auto;gap:26px;padding:0 24px;border-bottom:1px solid hsl(var(--border))}.aw-view-tabs button,.aw-case-filters button{border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;transition:background .16s ease,box-shadow .16s ease,color .16s ease}.aw-view-tabs button{position:relative;min-height:44px;padding:0;font-size:14px;font-weight:580}.aw-view-tabs button.is-active{color:hsl(var(--foreground))}.aw-view-tabs button.is-active:after{content:"";position:absolute;right:0;bottom:0;left:0;height:2px;border-radius:999px;background:hsl(var(--foreground))}.aw-run{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:0;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:650;transition:opacity .16s ease,transform .16s ease}.aw-run:not(:disabled):hover{transform:translateY(-1px)}.aw-root button:focus-visible,.aw-root input:focus-visible,.aw-root textarea:focus-visible,.aw-root select:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.aw-run svg{width:15px;height:15px}.aw-run:disabled,.aw-create-card:disabled{cursor:default;opacity:.42}.aw-workspace-frame{flex:1;min-height:0;position:relative}.aw-workspace{width:100%;height:100%;min-height:0;display:grid;grid-template-columns:304px minmax(0,1fr)}.aw-root.is-detail-only .aw-view-tabs,.aw-root.is-detail-only .aw-sidebar{display:none}.aw-root.is-detail-only .aw-workspace{grid-template-columns:minmax(0,1fr)}.aw-root.is-detail-only{font-size:14px}.aw-root.is-detail-only .aw-agent-head{padding-top:24px}.aw-sidebar{min-width:0;min-height:0;display:flex;flex-direction:column;padding:18px 12px 22px 24px}.aw-search{height:40px;min-height:40px;flex:0 0 40px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid hsl(var(--foreground) / .12);border-radius:10px;background:transparent;transition:border-color .16s ease,background-color .16s ease}.aw-search:focus-within{border-color:hsl(var(--foreground) / .16);background:hsl(var(--secondary) / .42);box-shadow:none}.aw-search svg{width:15px;height:15px;color:hsl(var(--muted-foreground))}.aw-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;line-height:1}.aw-search input::placeholder{color:hsl(var(--muted-foreground) / .82)}.aw-search input:focus,.aw-search input:focus-visible,.aw-case-search input:focus,.aw-case-search input:focus-visible{outline:none!important;box-shadow:none}.aw-agent-list{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:10px;margin-top:14px;overflow-y:auto}.aw-selection-toolbar{flex:0 0 auto;min-height:32px;display:flex;align-items:center;gap:8px;margin-top:10px}.aw-selection-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-selection-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-selection-toolbar button:disabled{cursor:default;opacity:.42}.aw-selection-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-selection-count{flex:1;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;font-weight:550;white-space:nowrap}.aw-selection-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-selection-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-delete-error{margin-top:8px;padding:8px 10px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px;line-height:1.45}.aw-agent-item,.aw-agent-check{width:100%;min-height:72px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:13px 14px;border:1px solid hsl(var(--foreground) / .1);border-radius:14px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:background .16s ease,border-color .16s ease}.aw-agent-item:hover,.aw-agent-check:hover{border-color:hsl(var(--foreground) / .18);background:hsl(var(--secondary) / .42)}.aw-agent-item.is-active{border-color:hsl(var(--foreground) / .42);background:hsl(var(--secondary) / .28)}.aw-agent-item[draggable=true]{cursor:grab}.aw-agent-item[draggable=true]:active{cursor:grabbing}.aw-agent-item.is-dragging{opacity:.46}.aw-agent-item.is-drop-target{border-color:hsl(var(--foreground) / .46);background:hsl(var(--secondary) / .54)}.aw-agent-item.is-drop-before{box-shadow:inset 0 2px hsl(var(--foreground) / .44)}.aw-agent-item.is-drop-after{box-shadow:inset 0 -2px hsl(var(--foreground) / .44)}.aw-agent-item.is-selecting{gap:10px}.aw-agent-item.is-selected-for-delete{border-color:hsl(var(--foreground) / .36);background:hsl(var(--secondary) / .44)}.aw-agent-item.is-selection-disabled{opacity:.58}.aw-select-marker{width:16px;height:16px;flex:0 0 16px;display:inline-grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;background:hsl(var(--background))}.aw-select-marker.is-checked{border-color:hsl(var(--foreground));background:hsl(var(--foreground))}.aw-select-marker.is-checked:after{content:"";width:7px;height:4px;border-bottom:1.6px solid hsl(var(--background));border-left:1.6px solid hsl(var(--background));transform:rotate(-45deg) translateY(-1px)}.aw-agent-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:6px}.aw-agent-name-row{min-width:0;display:flex;align-items:center;gap:8px}.aw-agent-name-row>strong{min-width:0;flex:1}.aw-version-badge{flex:0 0 auto;padding:2px 6px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .5);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;line-height:1.2}.aw-draft-badge{flex:0 0 auto;padding:2px 7px;border-radius:999px;background:#f0ebe0;color:#675332;font-size:10px;font-weight:680;line-height:1.2}.aw-draft-badge.is-deploying{background:#e4eaf2;color:#2d5080}.aw-draft-badge.is-error{background:#dc28281f;color:hsl(var(--destructive))}.aw-draft-badge.is-muted{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.aw-agent-copy strong,.aw-agent-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-agent-copy strong{font-size:13px;font-weight:650}.aw-agent-copy small{color:hsl(var(--muted-foreground));font-size:11px}.aw-agent-item>svg{width:14px;height:14px;color:hsl(var(--muted-foreground));opacity:0;transition:opacity .14s ease,transform .14s ease}.aw-agent-item:hover>svg,.aw-agent-item.is-active>svg{opacity:1}.aw-agent-item:hover>svg{transform:translate(2px)}.aw-agent-check{position:relative}.aw-agent-check>input{position:absolute;width:1px;height:1px;opacity:0}.aw-check-mark{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--foreground) / .22);border-radius:5px;background:hsl(var(--background));color:transparent}.aw-check-mark svg{width:11px;height:11px}.aw-agent-check:has(input:checked) .aw-check-mark{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.aw-agent-check:has(input:focus-visible){outline:2px solid hsl(var(--ring) / .42);outline-offset:-2px}.aw-list-empty{min-height:0;flex:1 1 auto;display:flex;align-items:center;justify-content:center;padding:28px 12px;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.aw-list-error{display:flex;flex-direction:column;align-items:center;gap:10px}.aw-list-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px}.aw-create-card{width:100%;min-height:48px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:8px;margin-top:12px;border:1px dashed hsl(var(--foreground) / .28);border-radius:14px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:600;transition:border-color .16s ease,color .16s ease}.aw-create-card:hover:not(:disabled){border-color:hsl(var(--foreground) / .5);color:hsl(var(--foreground))}.aw-create-card svg{width:15px;height:15px}.aw-list-count{flex:0 0 auto;padding-top:10px;color:hsl(var(--muted-foreground));font-size:10.5px;text-align:center}.aw-main{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:hsl(var(--background))}.aw-detail-loading{position:absolute;z-index:20;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:24px;background:hsl(var(--background) / .72);-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.aw-detail-loading-card{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background) / .94);box-shadow:0 14px 40px hsl(var(--foreground) / .1)}.aw-detail-loading-card>span:not(.loading-gap-spinner){display:flex;flex-direction:column;gap:2px}.aw-detail-loading-card>.loading-gap-spinner{width:18px;height:18px;flex:0 0 18px}.aw-detail-loading-card strong{font-size:13px;font-weight:650}.aw-detail-loading-card small{color:hsl(var(--muted-foreground));font-size:11.5px}.aw-empty-selection{align-items:center;justify-content:center}.aw-empty-selection p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.aw-agent-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 24px}.aw-agent-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-head-actions{flex:0 0 auto;display:flex;align-items:center;gap:8px}.aw-head-delete{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--destructive) / .24);border-radius:999px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:620}.aw-head-delete:hover:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-head-delete:disabled{cursor:default;opacity:.46}.aw-head-delete svg{width:14px;height:14px}.aw-head-delete--draft{border-color:hsl(var(--border));background:transparent;color:hsl(var(--foreground))}.aw-head-delete--draft:hover:not(:disabled){background:hsl(var(--secondary) / .54)}.aw-head-delete.studio-update-action{border:1px solid hsl(var(--destructive) / .34);background:#ffffffc2;color:hsl(var(--destructive));-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)}.aw-head-delete.studio-update-action:hover:not(:disabled){border:1px solid hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.aw-agent-title-row{gap:8px}.aw-agent-head h2,.aw-eval-head h2{overflow:hidden;font-size:20px;font-weight:720;text-overflow:ellipsis;white-space:nowrap}.aw-agent-title-row>span,.aw-eval-head>div>span{padding:2px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px}.aw-agent-head p{max-width:720px;overflow:hidden;font-size:13.5px;text-overflow:ellipsis;white-space:nowrap}.aw-update{align-self:center}.aw-update-wrap{position:relative;align-self:center;display:inline-flex;border-radius:999px}.aw-update-wrap.is-disabled{cursor:not-allowed}.aw-update-wrap.is-disabled .aw-update{cursor:inherit}.aw-update-spinner{width:14px;height:14px;flex-basis:14px;border-color:currentColor;border-right-color:transparent}.aw-update-disabled-reason{position:absolute;z-index:20;bottom:calc(100% + 8px);left:50%;width:max-content;max-width:260px;padding:7px 10px;border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));font-size:11.5px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translate(-50%,3px);transition:opacity .14s ease,transform .14s ease}.aw-update-wrap.is-disabled:hover .aw-update-disabled-reason,.aw-update-wrap.is-disabled:focus-visible .aw-update-disabled-reason{opacity:1;transform:translate(-50%)}.aw-update-wrap:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}@media (prefers-reduced-motion: reduce){.aw-update-disabled-reason{transition:none}}.aw-talk svg{width:15px;height:15px}.aw-agent-tabs{flex:0 0 auto;display:flex;gap:24px;margin:0 24px;padding:0;border-bottom:1px solid hsl(var(--border))}.aw-agent-tabs button{position:relative;min-height:42px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:14px;font-weight:580}.aw-agent-tabs button.is-active{color:hsl(var(--foreground))}.aw-agent-tabs button.is-active:after{content:"";position:absolute;right:0;bottom:-1px;left:0;height:2px;border-radius:2px 2px 0 0;background:hsl(var(--foreground))}.aw-agent-tabs button:disabled{cursor:default}.aw-content{flex:1;min-height:0;overflow-y:auto;margin-top:14px;padding:0 24px 80px}.aw-basic-stack,.aw-integration-stack{display:flex;flex-direction:column;gap:16px}.aw-integration-intro h3,.aw-integration-intro p,.aw-integration-panel h3,.aw-integration-panel h4,.aw-integration-panel dl,.aw-integration-panel dd{margin:0}.aw-integration-intro h3{font-size:15px;font-weight:620}.aw-integration-intro p{margin-top:4px;color:hsl(var(--muted-foreground));font-size:12.5px}.aw-integration-body{display:flex;min-width:0;flex-direction:column;gap:12px}.aw-integration-protocol-tabs{position:relative;display:grid;width:min(240px,100%);height:36px;box-sizing:border-box;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;padding:3px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--secondary))}.aw-integration-protocol-slider{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc((100% - 9px)/2);border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .05);transition:transform .24s cubic-bezier(.22,1,.36,1)}.aw-integration-protocol-tabs.is-a2a .aw-integration-protocol-slider{transform:translate(calc(100% + 3px))}.aw-integration-protocol-tabs button{position:relative;z-index:1;min-width:0;min-height:28px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:550;transition:background-color .16s ease,color .16s ease}.aw-integration-protocol-tabs button:hover{background:hsl(var(--panel) / .45);color:hsl(var(--foreground))}.aw-integration-protocol-tabs button[aria-selected=true]{color:hsl(var(--foreground));font-weight:620}.aw-integration-protocol-tabs button:focus-visible{outline:2px solid hsl(var(--ring) / .62);outline-offset:1px}.aw-integration-panel{min-width:0;padding:20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.aw-integration-panel.has-example{display:flex;flex-direction:column;gap:20px}.aw-integration-panel header{display:flex;align-items:center;margin-bottom:4px}.aw-integration-panel h3{color:hsl(var(--foreground));font-size:14px;font-weight:620}.aw-integration-panel dl{display:grid;align-content:start;gap:12px}.aw-integration-panel dl>div{display:grid;grid-template-columns:76px minmax(0,1fr);align-items:start;gap:12px}.aw-integration-panel dt{color:hsl(var(--muted-foreground));font-size:12px}.aw-integration-panel dd{min-width:0;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:12.5px;line-height:1.55}.aw-integration-secret{display:inline-flex;min-width:0;flex-wrap:wrap;align-items:center;gap:6px}.aw-integration-secret-value{min-width:52px;overflow-wrap:anywhere}.aw-integration-secret-toggle{display:inline-grid;width:28px;height:28px;flex:0 0 28px;padding:0;place-items:center;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer}.aw-integration-secret-toggle:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.aw-integration-secret-toggle:focus-visible{outline:2px solid hsl(var(--ring) / .62);outline-offset:1px}.aw-integration-secret-toggle:disabled{cursor:wait;opacity:.62}.aw-integration-secret-toggle svg,.aw-integration-secret-toggle .loading-gap-spinner{width:16px;height:16px}.aw-integration-secret-error{flex-basis:100%;color:hsl(var(--destructive));font-size:12px;line-height:1.45}.aw-integration-example{min-width:0}.aw-integration-example h4{margin-bottom:8px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.aw-integration-example-code.md{min-width:0;font-size:12px}.aw-integration-example-code.md pre{max-height:360px;margin:0;overflow:auto;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--secondary))}.aw-integration-example-code.md pre code{display:block;min-width:max-content;padding:14px 16px;line-height:1.55}.aw-integration-error{display:flex;align-items:center;gap:8px;min-height:36px;padding:10px 12px;border-radius:8px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:12.5px}.aw-integration-error{justify-content:space-between;color:hsl(var(--destructive))}.aw-integration-error button{min-height:28px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit}.aw-canvas-card,.aw-details-card{min-width:0;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel))}.aw-canvas-card{overflow:hidden}.aw-canvas-loading{width:100%;height:100%;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:13px}.aw-details-card{overflow:hidden}.aw-deploy-progress-card{width:100%;min-width:0;box-sizing:border-box;padding:24px 26px 26px;border:1px solid hsl(var(--border));border-radius:18px;background:hsl(var(--panel))}.aw-detail-deployment{flex:0 0 auto;padding:0 24px 16px}.aw-deploy-progress-head,.aw-deploy-progress-head>div,.aw-deploy-progress-icon{display:flex;align-items:center}.aw-deploy-progress-head{justify-content:space-between;gap:20px}.aw-deploy-progress-head>div{min-width:0;gap:12px}.aw-deploy-progress-head>div>div{min-width:0}.aw-deploy-progress-icon{width:34px;height:34px;flex:0 0 34px;justify-content:center;border-radius:50%;background:#eaeff5;color:#295189}.aw-deploy-progress-icon svg{width:17px;height:17px}.aw-deploy-progress-card.is-success .aw-deploy-progress-icon{background:#e8f2ee;color:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-icon,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-icon{background:#f5ecea;color:#8d3d34}.aw-deploy-progress-head h3{margin:0;font-size:14px;font-weight:700}.aw-deploy-progress-head p{margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45;overflow-wrap:anywhere}.aw-deploy-progress-head>strong{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:12px;font-weight:650}.aw-deploy-progress-track{height:5px;margin-top:18px;overflow:hidden;border-radius:999px;background:hsl(var(--secondary))}.aw-deploy-progress-track span{display:block;height:100%;border-radius:inherit;background:#295189;transition:width .32s cubic-bezier(.22,1,.36,1)}.aw-deploy-progress-card.is-success .aw-deploy-progress-track span{background:#2d7656}.aw-deploy-progress-card.is-error .aw-deploy-progress-track span,.aw-deploy-progress-card.is-cancelled .aw-deploy-progress-track span{background:#8d3d34}.aw-deploy-steps{margin:22px 0 0;padding:0;list-style:none}.aw-deploy-steps li{position:relative;min-width:0;display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;padding:0 0 18px}.aw-deploy-steps li:last-child{padding-bottom:0}.aw-deploy-steps li:not(:last-child):after{content:"";position:absolute;top:28px;bottom:0;left:13px;width:2px;border-radius:999px;background:hsl(var(--border))}.aw-deploy-steps li.is-done:not(:last-child):after{background:#9dcdb8}.aw-deploy-step-marker{position:relative;z-index:1;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:680}.aw-deploy-step-marker svg{width:14px;height:14px}.aw-deploy-steps li.is-done .aw-deploy-step-marker{border-color:#b3dbca;background:#e8f2ee;color:#2d7656}.aw-deploy-steps li.is-active .aw-deploy-step-marker{border-color:#9eb3d1;background:#eaeff5;color:#295189}.aw-deploy-steps li.is-failed .aw-deploy-step-marker{border-color:#dcbfbc;background:#f5ecea;color:#8d3d34}.aw-deploy-step-copy{min-width:0;padding-top:2px}.aw-deploy-step-copy strong{display:block;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:620;line-height:1.4}.aw-deploy-step-copy p{min-width:0;margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.55;overflow-wrap:anywhere;word-break:break-word}.aw-deploy-steps li.is-done .aw-deploy-step-copy strong,.aw-deploy-steps li.is-active .aw-deploy-step-copy strong,.aw-deploy-steps li.is-failed .aw-deploy-step-copy strong{color:hsl(var(--foreground))}.aw-deploy-steps li.is-active .aw-deploy-step-copy p{color:hsl(var(--foreground) / .78)}.aw-deploy-step-log{min-width:0;margin-top:10px}.aw-deploy-log{min-width:0;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--canvas));overflow:hidden}.aw-deploy-log header,.aw-deploy-log header>div,.aw-deploy-log-actions,.aw-deploy-log-actions button{display:flex;align-items:center}.aw-deploy-log header{min-width:0;justify-content:space-between;gap:12px;padding:10px 12px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.aw-deploy-log.is-collapsed header{border-bottom:0}.aw-deploy-log header>div:first-child{min-width:0;flex-direction:column;align-items:flex-start;gap:2px}.aw-deploy-log strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:640;line-height:1.35}.aw-deploy-log span{min-width:0;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.aw-deploy-log-actions{flex:0 0 auto;gap:6px}.aw-deploy-log-actions button{min-height:28px;gap:5px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font-size:11.5px;font-weight:560;cursor:pointer}.aw-deploy-log-actions button:hover{background:hsl(var(--muted))}.aw-deploy-log-actions button span{color:inherit;font-size:inherit;line-height:inherit}.aw-deploy-log-actions button:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:1px}.aw-deploy-log-actions svg{width:13px;height:13px;flex:0 0 auto}.aw-deploy-log pre{max-height:260px;min-width:0;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;color:hsl(var(--foreground) / .86);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:11.5px;line-height:1.55}.aw-deploy-log-empty{padding:12px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.aw-deploy-log.is-error{border-color:#dcbfbc}.aw-card-head{justify-content:space-between;gap:12px;min-height:48px;padding:0 16px}.aw-card-head strong{font-size:13px;font-weight:680}.aw-card-head span{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-canvas{height:220px;min-height:0;border-top:1px solid hsl(var(--border))}.aw-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;border:0;background:#f9f8f5}.aw-canvas .abc-canvas{flex:1;min-height:0}.aw-canvas .react-flow__controls{transform:scale(.86);transform-origin:bottom left}.aw-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:4px 16px 14px}.aw-facts>div{min-height:39px;display:grid;grid-template-columns:minmax(88px,.72fr) minmax(0,1.28fr);align-items:center;gap:12px;border-top:1px solid hsl(var(--border) / .72)}.aw-facts>div:nth-child(2n){padding-left:20px}.aw-facts>div:nth-child(odd){padding-right:20px}.aw-facts dt{color:hsl(var(--muted-foreground));font-size:11.5px}.aw-facts dd{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-weight:600;text-align:right;text-overflow:ellipsis;white-space:nowrap}.aw-facts .aw-fact-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px;overflow:visible;white-space:normal}.aw-fact-badges span{max-width:100%;overflow:hidden;padding:3px 7px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--secondary) / .55);font-size:11px;font-weight:400;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}.aw-status-dot{width:6px;height:6px;display:inline-block;margin-right:6px;border-radius:50%;background:#358d67}.aw-section-head{justify-content:space-between;gap:18px;margin-bottom:16px}.aw-section-head h3{font-size:17px;font-weight:700}.aw-case-filters{width:fit-content;gap:3px;padding:3px;border-radius:8px;background:hsl(var(--secondary) / .62)}.aw-case-filter-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:16px}.aw-case-filter-stack{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:8px}.aw-case-source-filters{display:flex;flex-wrap:wrap;gap:6px}.aw-case-source-filters button{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.aw-case-source-filters button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.aw-case-source-filters button.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.aw-case-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}.aw-case-summary>button{min-width:0;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .22)}.aw-case-summary>button{min-height:70px;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:10px;padding:14px 16px;color:inherit;cursor:pointer;font:inherit;text-align:left;transition:border-color .16s ease,background .16s ease,box-shadow .16s ease}.aw-case-summary>button:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--secondary) / .36)}.aw-case-summary>button:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:2px}.aw-case-summary strong{color:hsl(var(--foreground));font-size:26px;font-weight:720;line-height:1}.aw-case-summary span{min-width:0;color:hsl(var(--foreground));font-size:12px;font-weight:640}.aw-case-search{width:min(360px,46%);min-width:260px;height:40px;box-sizing:border-box;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .16s ease,box-shadow .16s ease}.aw-case-search:focus-within{border-color:hsl(var(--foreground) / .32);box-shadow:0 0 0 3px hsl(var(--foreground) / .045)}.aw-case-search svg{width:15px;height:15px;color:hsl(var(--muted-foreground))}.aw-case-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.aw-case-search input::placeholder{color:hsl(var(--muted-foreground) / .8)}.aw-case-toolbar{min-height:32px;display:flex;align-items:center;gap:8px;margin:-2px 0 14px}.aw-case-toolbar button{min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:580}.aw-case-toolbar button:hover:not(:disabled){background:hsl(var(--secondary) / .55)}.aw-case-toolbar button:disabled{cursor:default;opacity:.42}.aw-case-toolbar.is-active{padding:6px 8px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .3)}.aw-case-toolbar .aw-selection-danger{border-color:hsl(var(--destructive) / .28);color:hsl(var(--destructive))}.aw-case-toolbar .aw-selection-danger:hover:not(:disabled){background:hsl(var(--destructive) / .08)}.aw-case-filters button{min-height:30px;padding:0 12px;border-radius:6px;font-size:12.5px}.aw-case-filters button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 2px hsl(var(--foreground) / .07)}.aw-case-table{overflow-x:auto;border:1px solid hsl(var(--border));border-radius:12px}.aw-case-row{min-width:870px;min-height:86px;display:grid;grid-template-columns:minmax(180px,.78fr) minmax(250px,1.16fr) 80px minmax(220px,.94fr) 48px;align-items:start;gap:14px;padding:14px 16px;border-top:1px solid hsl(var(--border));font-size:13px}.aw-case-row:not(.aw-case-row-head){cursor:pointer;transition:background .15s ease,box-shadow .15s ease}.aw-case-row:not(.aw-case-row-head):hover,.aw-case-row.is-focused,.aw-case-row.is-selected-for-delete{background:hsl(var(--secondary) / .28)}.aw-case-row.is-focused{box-shadow:inset 3px 0 hsl(var(--foreground) / .22)}.aw-case-row.is-selected-for-delete{box-shadow:inset 3px 0 hsl(var(--foreground) / .34)}.aw-case-row:focus-visible{outline:2px solid hsl(var(--foreground) / .24);outline-offset:-2px}.aw-case-row:first-child{border-top:0}.aw-case-row-head{min-height:38px;align-items:center;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.aw-case-action-head{text-align:center}.aw-case-text,.aw-case-output,.aw-case-reason{min-width:0;display:flex;flex-direction:column;gap:5px}.aw-case-score{color:hsl(var(--foreground));font-size:13px;font-weight:650;line-height:1.5}.aw-case-reason p{display:-webkit-box;overflow:hidden;margin:0;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-reason.is-expanded p{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-title-line{min-width:0;display:flex;align-items:center;gap:8px}.aw-case-title-line strong{flex:1;min-width:0}.aw-case-actions{min-width:0;display:flex;justify-content:center}.aw-case-row strong,.aw-case-row p,.aw-case-row small{min-width:0;overflow-wrap:anywhere;white-space:normal;word-break:break-word}.aw-case-row strong{color:hsl(var(--foreground));font-weight:600;line-height:1.45}.aw-case-row p{margin:0;color:hsl(var(--muted-foreground));line-height:1.5}.aw-case-output-preview{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}.aw-case-output.is-expanded .aw-case-output-preview{display:block;overflow:visible;-webkit-line-clamp:unset}.aw-case-expand{width:fit-content;min-height:24px;margin-top:2px;padding:0 7px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:600}.aw-case-expand:hover{background:hsl(var(--secondary) / .55)}.aw-case-row small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35}.aw-case-time{color:hsl(var(--foreground) / .62)!important}.aw-case-delete{width:28px;height:28px;flex:0 0 28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .15s ease,border-color .15s ease,color .15s ease}.aw-case-delete:hover:not(:disabled){border-color:hsl(var(--destructive) / .18);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive))}.aw-case-delete:active:not(:disabled){background:hsl(var(--destructive) / .12)}.aw-case-delete:disabled{cursor:default;opacity:.42}.aw-case-delete svg{width:13px;height:13px}.aw-case-empty{min-height:116px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:12px}.aw-case-error{color:hsl(var(--destructive))}.aw-case-error button{min-height:30px;padding:0 12px;border:1px solid hsl(var(--destructive) / .26);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.aw-deployment-panel{width:100%;box-sizing:border-box;margin:0}.aw-settings-card{padding:18px;border:1px solid hsl(var(--border));border-radius:14px}.aw-optimizations{display:flex;flex-direction:column;gap:16px}.aw-optimization-intro h3{margin:0;color:hsl(var(--foreground));font-size:17px;font-weight:650}.aw-optimization-intro p{margin:5px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.aw-optimization-state{min-height:92px;display:flex;align-items:center;justify-content:center;gap:9px;padding:20px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .16);color:hsl(var(--muted-foreground));font-size:13px;text-align:center}.aw-optimization-state.is-error{color:hsl(var(--destructive))}.aw-optimization-state button{min-height:28px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-weight:600}.aw-optimization-table-wrap{overflow-x:auto;border:1px solid hsl(var(--border));border-radius:12px}.aw-optimization-table{width:100%;min-width:760px;border-collapse:collapse;table-layout:fixed;color:hsl(var(--foreground));font-size:13px}.aw-optimization-table th,.aw-optimization-table td{padding:14px 16px;border-top:1px solid hsl(var(--border));text-align:left;vertical-align:top}.aw-optimization-table th{padding-block:11px;border-top:0;background:hsl(var(--secondary) / .38);color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:600}.aw-optimization-table th:first-child,.aw-optimization-table td:first-child{width:108px}.aw-optimization-table th:nth-child(2),.aw-optimization-table td:nth-child(2){width:142px}.aw-optimization-module{color:hsl(var(--foreground));font-size:13px;font-weight:620;line-height:1.55}.aw-optimization-list{margin:0;padding:0;list-style:none}.aw-optimization-list li{position:relative;padding-left:16px}.aw-optimization-list li+li{margin-top:13px;padding-top:13px;border-top:1px dashed hsl(var(--border))}.aw-optimization-list li:before{position:absolute;top:6px;left:1px;width:5px;height:5px;border-radius:50%;background:hsl(var(--primary) / .72);content:""}.aw-optimization-list li+li:before{top:19px}.aw-optimization-list strong{display:block;font-size:13.5px;font-weight:650;line-height:1.45}.aw-optimization-list p{margin:5px 0 0;color:hsl(var(--muted-foreground));line-height:1.55}.aw-priority{font-size:13px;font-weight:700;line-height:1.5}.aw-priority.is-high{color:hsl(var(--destructive))}.aw-priority.is-medium{color:#93591f}.aw-priority.is-low{color:#28674c}.aw-readonly-config{margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.aw-readonly-config>div{min-width:0;padding:12px 14px;border-radius:10px;background:hsl(var(--secondary) / .42)}.aw-readonly-config dt{color:hsl(var(--muted-foreground));font-size:11px}.aw-readonly-config dd{margin:5px 0 0;color:hsl(var(--foreground));font-size:12px;font-weight:600}.aw-readonly-config dd.is-ready{color:#1d7c40}.aw-basic-actions{position:absolute;z-index:8;bottom:20px;left:50%;display:flex;align-items:center;justify-content:center;gap:10px;padding:0;border:0;border-radius:10px;background:transparent;box-shadow:none;transform:translate(-50%)}.aw-eval-head{flex:0 0 auto;min-height:72px;box-sizing:border-box;justify-content:space-between;gap:20px;padding:14px 24px}.aw-evaluation-glass{position:absolute;z-index:12;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:hsl(var(--background) / .44);color:hsl(var(--foreground));-webkit-backdrop-filter:blur(9px) saturate(118%);backdrop-filter:blur(9px) saturate(118%);transition:background .18s ease,backdrop-filter .18s ease}.aw-evaluation-glass:hover{background:hsl(var(--background) / .52);-webkit-backdrop-filter:blur(11px) saturate(125%);backdrop-filter:blur(11px) saturate(125%)}.aw-evaluation-glass span{padding:8px 13px;border:1px solid hsl(var(--border) / .82);border-radius:999px;background:hsl(var(--background) / .7);box-shadow:0 8px 24px hsl(var(--foreground) / .07);font-size:12.5px;font-weight:620;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}.aw-eval-head>div{min-width:0;display:flex;flex-direction:column;justify-content:center}.aw-run{min-height:38px;padding:0 14px;border-radius:9px}.aw-eval-setup{width:min(900px,100%);margin:0 auto;display:flex;flex-direction:column;gap:14px}.aw-eval-block{min-width:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px}.aw-eval-agent-grid{max-height:230px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow-y:auto;padding:0 16px 16px}.aw-eval-agent-grid>label{min-height:52px;display:flex;align-items:center;gap:10px;padding:0 12px;border:1px solid hsl(var(--border) / .82);border-radius:10px;cursor:pointer}.aw-eval-agent-grid input,.aw-metric-list input{width:15px;height:15px;accent-color:hsl(var(--foreground))}.aw-eval-agent-grid label>span{min-width:0;display:flex;flex-direction:column;gap:3px}.aw-eval-agent-grid strong,.aw-eval-agent-grid small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aw-eval-agent-grid strong{font-size:12px;font-weight:620}.aw-eval-agent-grid small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-eval-setting-grid{display:grid;grid-template-columns:minmax(0,1.18fr) minmax(260px,.82fr);gap:14px}.aw-eval-fields{display:flex;flex-direction:column;gap:13px;padding:0 16px 16px}.aw-eval-fields label{min-height:36px;display:grid;grid-template-columns:72px minmax(0,1fr) auto;align-items:center;gap:10px}.aw-eval-fields label>span,.aw-eval-fields label>small{color:hsl(var(--muted-foreground));font-size:11px}.aw-eval-fields select{width:100%;height:34px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11.5px}.aw-metric-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:0 16px 16px}.aw-metric-list label{min-height:40px;display:flex;align-items:center;gap:8px;padding:0 10px;border:1px solid hsl(var(--border) / .82);border-radius:9px;cursor:pointer;font-size:11.5px}.aw-eval-history{width:min(820px,100%);margin:0 auto}.aw-history-list{display:flex;flex-direction:column;gap:9px}.aw-history-list>button{width:100%;min-height:68px;display:grid;grid-template-columns:minmax(0,1fr) auto auto 16px;align-items:center;gap:16px;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:11px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left}.aw-history-list>button:hover{border-color:hsl(var(--foreground) / .2)}.aw-history-list>button>span:first-child,.aw-history-score{display:flex;flex-direction:column;gap:4px}.aw-history-list strong{font-size:12px}.aw-history-list small{color:hsl(var(--muted-foreground));font-size:10.5px}.aw-history-score{align-items:flex-end}.aw-history-score strong{font-size:17px}.aw-complete{display:inline-flex;align-items:center;gap:5px;padding:4px 8px;border-radius:999px;background:#3c866617;color:#28674c;font-size:10.5px;font-weight:620}.aw-complete svg{width:12px;height:12px}.aw-results-empty{min-height:210px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));text-align:center}.aw-results-empty strong{color:hsl(var(--foreground));font-size:12.5px}.aw-results-empty span{font-size:11.5px}@media (max-width: 980px){.aw-workspace{grid-template-columns:260px minmax(0,1fr)}.aw-eval-setting-grid{grid-template-columns:minmax(0,1fr)}.aw-case-row{min-width:790px;grid-template-columns:minmax(160px,.78fr) minmax(220px,1fr) 72px minmax(180px,.82fr) 48px}}@media (max-width: 720px){.aw-view-tabs{padding-inline:16px}.aw-workspace{grid-template-columns:minmax(0,1fr);overflow-y:auto}.aw-sidebar{height:340px;max-height:340px;box-sizing:border-box;padding:18px 16px}.aw-agent-list{min-height:128px}.aw-main{min-height:620px;overflow:visible}.aw-agent-tabs{gap:18px;margin-inline:16px;overflow-x:auto}.aw-agent-head,.aw-eval-head{padding-inline:16px}.aw-content{overflow:visible;padding-inline:16px}.aw-facts{grid-template-columns:minmax(0,1fr)}.aw-facts>div:nth-child(n){padding-right:0;padding-left:0}.aw-eval-agent-grid,.aw-metric-list{grid-template-columns:minmax(0,1fr)}.aw-case-summary,.aw-case-row{min-width:0;grid-template-columns:minmax(0,1fr)}.aw-case-filter-bar{align-items:stretch;flex-direction:column;gap:12px}.aw-case-search{width:100%;min-width:0}.aw-case-row-head{display:none}.aw-case-cell{position:relative;padding-top:20px}.aw-case-cell:before{content:attr(data-label);position:absolute;top:0;left:0;color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600}.aw-case-actions{justify-content:flex-start}.aw-optimization-table{min-width:680px}.aw-readonly-config{grid-template-columns:minmax(0,1fr)}}@media (prefers-reduced-motion: reduce){.aw-integration-protocol-slider{transition:none}.aw-root *,.aw-root *:before,.aw-root *:after{scroll-behavior:auto!important;transition-duration:.01ms!important}}@layer components{._LoadingIndicator_7yl6f_1{position:relative;width:var(--indicator-size, 1em);height:var(--indicator-size, 1em);animation:_rotate_7yl6f_1 var(--indicator-rotate-duration, .8s) linear infinite;transition:opacity .15s ease}._LoadingIndicator_7yl6f_1:before{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border:var(--indicator-stroke, 2px) solid var(--indicator-color, currentcolor);border-radius:50%;content:"";-webkit-mask-image:conic-gradient(rgb(0 0 0 / 0%),rgb(0 0 0));mask-image:conic-gradient(#0000,#000)}._LoadingIndicator_7yl6f_1:after{position:absolute;top:0;left:50%;display:block;width:var(--indicator-stroke, 2px);height:var(--indicator-stroke, 2px);border-radius:100%;margin-left:calc(var(--indicator-stroke, 2px) * -1 / 2);background-color:var(--indicator-color, currentcolor);content:""}@keyframes _rotate_7yl6f_1{0%{transform:rotate(0)}to{transform:rotate(1turn)}}}@layer components{._TransitionGroupChild_1hv1z_1{display:block}}@layer components{._Button_1864l_1{position:relative;display:inline-block;gap:var(--button-gap);flex-shrink:0;height:var(--button-size);padding:0 var(--button-gutter);border-radius:var(--button-radius);cursor:pointer;font-size:var(--button-font-size);font-weight:var(--button-font-weight);line-height:1;transition-duration:var(--transition-duration-basic);transition-property:opacity,color;transition-timing-function:var(--transition-ease-basic);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}._Button_1864l_1:before{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit;content:"";transition-duration:var(--transition-duration-basic);transition-property:opacity,background-color,transform,box-shadow,border-color;transition-timing-function:var(--transition-ease-basic);will-change:transform}._Button_1864l_1:after{position:absolute;top:0;right:0;bottom:0;left:0;display:block;border-radius:inherit;content:"";pointer-events:none;transition-duration:var(--transition-duration-basic);transition-property:transform;transition-timing-function:var(--transition-ease-basic);will-change:transform}._Button_1864l_1:focus{outline:none}._Button_1864l_1:focus-visible:after{outline:2px solid var(--button-ring-color, var(--color-ring));outline-offset:var(--button-ring-offset, 2px)}._Button_1864l_1 svg:where(:not([data-no-autosize])){width:var(--button-icon-size);height:var(--button-icon-size)}:where(._Button_1864l_1 svg:where(:not([data-no-autosize])):first-child:not(:only-child)){margin-left:var(--button-icon-offset, -1px)}:where(._Button_1864l_1 svg:where(:not([data-no-autosize])):last-child:not(:only-child)){margin-right:var(--button-icon-offset, -1px)}._Button_1864l_1:where([data-optically-align=start]){margin-inline-start:calc(var(--button-gutter) * -1)}._Button_1864l_1:where([data-optically-align=end]){margin-inline-end:calc(var(--button-gutter) * -1)}._Button_1864l_1:where([data-optically-align=start][data-uniform]){margin-inline-start:calc(((var(--button-size) - var(--button-icon-size)) / 2) * -1)}._Button_1864l_1:where([data-optically-align=end][data-uniform]){margin-inline-end:calc(((var(--button-size) - var(--button-icon-size)) / 2) * -1)}._Button_1864l_1:where([data-size="3xs"]){--button-size: var(--control-size-3xs);--button-gutter: var(--control-gutter-2xs);--button-font-size: var(--control-font-size-sm);--button-icon-size: var(--control-icon-size-xs);--button-gap: var(--button-gap-sm);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 11px;--circular-progress-size: 11px}._Button_1864l_1:where([data-size="2xs"]){--button-size: var(--control-size-2xs);--button-gutter: var(--control-gutter-xs);--button-font-size: var(--control-font-size-sm);--button-icon-size: var(--control-icon-size-sm);--button-gap: var(--button-gap-md);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 12px;--circular-progress-size: 12px}._Button_1864l_1:where([data-size=xs]){--button-size: var(--control-size-xs);--button-gutter: var(--control-gutter-xs);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-sm);--button-gap: var(--button-gap-md);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 13px;--circular-progress-size: 14px}._Button_1864l_1:where([data-size=sm]){--button-size: var(--control-size-sm);--button-gutter: var(--control-gutter-sm);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-md);--button-radius: var(--control-radius-sm);--button-icon-offset: -1px;--indicator-size: 15px;--circular-progress-size: 15px}._Button_1864l_1:where([data-size=md]){--button-size: var(--control-size-md);--button-gutter: var(--control-gutter-md);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-md);--button-icon-offset: -1px;--indicator-size: 16px;--circular-progress-size: 16px}._Button_1864l_1:where([data-size=lg]){--button-size: var(--control-size-lg);--button-gutter: var(--control-gutter-md);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-md);--button-icon-offset: -1px;--indicator-size: 16px;--circular-progress-size: 16px}._Button_1864l_1:where([data-size=xl]){--button-size: var(--control-size-xl);--button-gutter: var(--control-gutter-lg);--button-font-size: var(--control-font-size-md);--button-icon-size: var(--control-icon-size-md);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-lg);--button-icon-offset: -1px;--indicator-size: 18px;--circular-progress-size: 18px}._Button_1864l_1:where([data-size="2xl"]){--button-size: var(--control-size-2xl);--button-gutter: var(--control-gutter-lg);--button-font-size: var(--control-font-size-lg);--button-icon-size: var(--control-icon-size-lg);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-xl);--button-icon-offset: -2px;--indicator-size: 18px;--circular-progress-size: 18px}._Button_1864l_1:where([data-size="3xl"]){--button-size: var(--control-size-3xl);--button-gutter: var(--control-gutter-xl);--button-font-size: var(--control-font-size-lg);--button-icon-size: var(--control-icon-size-lg);--button-gap: var(--button-gap-lg);--button-radius: var(--control-radius-xl);--button-icon-offset: -2px;--indicator-size: 20px;--circular-progress-size: 20px}._Button_1864l_1:where([data-gutter-size="2xs"]){--button-gutter: var(--control-gutter-2xs)}._Button_1864l_1:where([data-gutter-size=xs]){--button-gutter: var(--control-gutter-xs)}._Button_1864l_1:where([data-gutter-size=sm]){--button-gutter: var(--control-gutter-sm)}._Button_1864l_1:where([data-gutter-size=md]){--button-gutter: var(--control-gutter-md)}._Button_1864l_1:where([data-gutter-size=lg]){--button-gutter: var(--control-gutter-lg)}._Button_1864l_1:where([data-gutter-size=xl]){--button-gutter: var(--control-gutter-xl)}._Button_1864l_1:where([data-icon-size=sm]){--button-icon-size: var(--control-icon-size-sm)}._Button_1864l_1:where([data-icon-size=md]){--button-icon-size: var(--control-icon-size-md)}._Button_1864l_1:where([data-icon-size=lg]){--button-icon-size: var(--control-icon-size-lg)}._Button_1864l_1:where([data-icon-size=xl]){--button-icon-size: var(--control-icon-size-xl)}._Button_1864l_1:where([data-icon-size="2xl"]){--button-icon-size: var(--control-icon-size-2xl)}._Button_1864l_1:where([data-pill]){--button-radius: var(--radius-full);padding:0 calc(var(--button-gutter) * var(--control-gutter-pill-scaling))}._Button_1864l_1:where([data-block]){width:100%}._Button_1864l_1[data-uniform]{--button-gutter: 0;width:var(--button-size)}._Button_1864l_1[data-variant=ghost]{--button-ring-offset: -1px;color:var(--button-text-color)}._Button_1864l_1[data-variant=ghost]:before{background-color:var(--button-background-color);opacity:0;transform:scale(var(--scale))}._Button_1864l_1[data-variant=ghost][aria-expanded=true],._Button_1864l_1[data-variant=ghost][data-state=open]{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=ghost][aria-expanded=true]:before,._Button_1864l_1[data-variant=ghost][data-state=open]:before{opacity:.6;transform:scale(1)}._Button_1864l_1[data-variant=ghost][data-selected]{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=ghost][data-selected]:before{opacity:1;transform:scale(1)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):hover{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):hover:before{opacity:1;transform:scale(1)}}._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active);opacity:1;transform:scale(var(--scale))}._Button_1864l_1[data-variant=ghost]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=ghost]:where([data-color=primary]){--button-background-color: var(--color-background-primary-ghost-hover);--button-background-color-active: var(--color-background-primary-ghost-active);--button-text-color: var(--color-text-primary-ghost);--button-text-color-hover: var(--color-text-primary-ghost-hover);--button-ring-color: var(--color-ring-primary-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=secondary]){--button-background-color: var(--color-background-secondary-ghost-hover);--button-background-color-active: var(--color-background-secondary-ghost-active);--button-text-color: var(--color-text-secondary-ghost);--button-text-color-hover: var(--color-text-secondary-ghost-hover);--button-ring-color: var(--color-ring-secondary-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=danger]){--button-background-color: var(--color-background-danger-ghost-hover);--button-background-color-active: var(--color-background-danger-ghost-active);--button-text-color: var(--color-text-danger-ghost);--button-text-color-hover: var(--color-text-danger-ghost-hover);--button-ring-color: var(--color-ring-danger-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=success]){--button-background-color: var(--color-background-success-ghost-hover);--button-background-color-active: var(--color-background-success-ghost-active);--button-text-color: var(--color-text-success-ghost);--button-text-color-hover: var(--color-text-success-ghost-hover);--button-ring-color: var(--color-ring-success-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=warning]){--button-background-color: var(--color-background-warning-ghost-hover);--button-background-color-active: var(--color-background-warning-ghost-active);--button-text-color: var(--color-text-warning-ghost);--button-text-color-hover: var(--color-text-warning-ghost-hover);--button-ring-color: var(--color-ring-warning-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=caution]){--button-background-color: var(--color-background-caution-ghost-hover);--button-background-color-active: var(--color-background-caution-ghost-active);--button-text-color: var(--color-text-caution-ghost);--button-text-color-hover: var(--color-text-caution-ghost-hover);--button-ring-color: var(--color-ring-caution-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=info]){--button-background-color: var(--color-background-info-ghost-hover);--button-background-color-active: var(--color-background-info-ghost-active);--button-text-color: var(--color-text-info-ghost);--button-text-color-hover: var(--color-text-info-ghost-hover);--button-ring-color: var(--color-ring-info-ghost)}._Button_1864l_1[data-variant=ghost]:where([data-color=discovery]){--button-background-color: var(--color-background-discovery-ghost-hover);--button-background-color-active: var(--color-background-discovery-ghost-active);--button-text-color: var(--color-text-discovery-ghost);--button-text-color-hover: var(--color-text-discovery-ghost-hover);--button-ring-color: var(--color-ring-discovery-ghost)}._Button_1864l_1[data-variant=solid]{color:var(--button-text-color)}._Button_1864l_1[data-variant=solid]:before{background-color:var(--button-background-color)}._Button_1864l_1[data-variant=solid][aria-expanded=true]:before,._Button_1864l_1[data-variant=solid][data-state=open]:before,._Button_1864l_1[data-variant=solid][data-selected]:before{background-color:var(--button-background-color-hover)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):hover:before{background-color:var(--button-background-color-hover)}}._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active)}._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):active:before,._Button_1864l_1[data-variant=solid]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=solid]:where([data-color=primary]){--button-background-color: var(--color-background-primary-solid);--button-background-color-hover: var(--color-background-primary-solid-hover);--button-background-color-active: var(--color-background-primary-solid-active);--button-text-color: var(--color-text-primary-solid);--button-ring-color: var(--color-ring-primary-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=secondary]){--button-background-color: var(--color-background-secondary-solid);--button-background-color-hover: var(--color-background-secondary-solid-hover);--button-background-color-active: var(--color-background-secondary-solid-active);--button-text-color: var(--color-text-secondary-solid);--button-ring-color: var(--color-ring-secondary-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=success]){--button-background-color: var(--color-background-success-solid);--button-background-color-hover: var(--color-background-success-solid-hover);--button-background-color-active: var(--color-background-success-solid-active);--button-text-color: var(--color-text-success-solid);--button-ring-color: var(--color-ring-success-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=danger]){--button-background-color: var(--color-background-danger-solid);--button-background-color-hover: var(--color-background-danger-solid-hover);--button-background-color-active: var(--color-background-danger-solid-active);--button-text-color: var(--color-text-danger-solid);--button-ring-color: var(--color-ring-danger-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=warning]){--button-background-color: var(--color-background-warning-solid);--button-background-color-hover: var(--color-background-warning-solid-hover);--button-background-color-active: var(--color-background-warning-solid-active);--button-text-color: var(--color-text-warning-solid);--button-ring-color: var(--color-ring-warning-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=caution]){--button-background-color: var(--color-background-caution-solid);--button-background-color-hover: var(--color-background-caution-solid-hover);--button-background-color-active: var(--color-background-caution-solid-active);--button-text-color: var(--color-text-caution-solid);--button-ring-color: var(--color-ring-caution-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=info]){--button-background-color: var(--color-background-info-solid);--button-background-color-hover: var(--color-background-info-solid-hover);--button-background-color-active: var(--color-background-info-solid-active);--button-text-color: var(--color-text-info-solid);--button-ring-color: var(--color-ring-info-solid)}._Button_1864l_1[data-variant=solid]:where([data-color=discovery]){--button-background-color: var(--color-background-discovery-solid);--button-background-color-hover: var(--color-background-discovery-solid-hover);--button-background-color-active: var(--color-background-discovery-solid-active);--button-text-color: var(--color-text-discovery-solid);--button-ring-color: var(--color-ring-discovery-solid)}._Button_1864l_1[data-variant=soft]{color:var(--button-text-color)}._Button_1864l_1[data-variant=soft]:before{background-color:var(--button-background-color)}._Button_1864l_1[data-variant=soft][aria-expanded=true]:before,._Button_1864l_1[data-variant=soft][data-state=open]:before,._Button_1864l_1[data-variant=soft][data-selected]:before{background-color:var(--button-background-color-hover)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):hover:before{background-color:var(--button-background-color-hover)}}._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active)}._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):active:before,._Button_1864l_1[data-variant=soft]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=soft]:where([data-color=primary]){--button-background-color: var(--color-background-primary-soft-alpha);--button-background-color-hover: var(--color-background-primary-soft-alpha-hover);--button-background-color-active: var(--color-background-primary-soft-alpha-active);--button-text-color: var(--color-text-primary-soft);--button-ring-color: var(--color-ring-primary-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=secondary]){--button-background-color: var(--color-background-secondary-soft-alpha);--button-background-color-hover: var(--color-background-secondary-soft-alpha-hover);--button-background-color-active: var(--color-background-secondary-soft-alpha-active);--button-text-color: var(--color-text-secondary-soft);--button-ring-color: var(--color-ring-secondary-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=success]){--button-background-color: var(--color-background-success-soft-alpha);--button-background-color-hover: var(--color-background-success-soft-alpha-hover);--button-background-color-active: var(--color-background-success-soft-alpha-active);--button-text-color: var(--color-text-success-soft);--button-ring-color: var(--color-ring-success-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=danger]){--button-background-color: var(--color-background-danger-soft-alpha);--button-background-color-hover: var(--color-background-danger-soft-alpha-hover);--button-background-color-active: var(--color-background-danger-soft-alpha-active);--button-text-color: var(--color-text-danger-soft);--button-ring-color: var(--color-ring-danger-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=warning]){--button-background-color: var(--color-background-warning-soft-alpha);--button-background-color-hover: var(--color-background-warning-soft-alpha-hover);--button-background-color-active: var(--color-background-warning-soft-alpha-active);--button-text-color: var(--color-text-warning-soft);--button-ring-color: var(--color-ring-warning-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=caution]){--button-background-color: var(--color-background-caution-soft-alpha);--button-background-color-hover: var(--color-background-caution-soft-alpha-hover);--button-background-color-active: var(--color-background-caution-soft-alpha-active);--button-text-color: var(--color-text-caution-soft);--button-ring-color: var(--color-ring-caution-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=info]){--button-background-color: var(--color-background-info-soft-alpha);--button-background-color-hover: var(--color-background-info-soft-alpha-hover);--button-background-color-active: var(--color-background-info-soft-alpha-active);--button-text-color: var(--color-text-info-soft);--button-ring-color: var(--color-ring-info-soft)}._Button_1864l_1[data-variant=soft]:where([data-color=discovery]){--button-background-color: var(--color-background-discovery-soft-alpha);--button-background-color-hover: var(--color-background-discovery-soft-alpha-hover);--button-background-color-active: var(--color-background-discovery-soft-alpha-active);--button-text-color: var(--color-text-discovery-soft);--button-ring-color: var(--color-ring-discovery-soft)}._Button_1864l_1[data-variant=outline]{--button-ring-offset: -1px;color:var(--button-text-color)}._Button_1864l_1[data-variant=outline]:before{background-color:transparent;box-shadow:0 0 0 1px var(--button-border-color) inset,var(--button-shadow-custom, 0 0 #00000000)}._Button_1864l_1[data-variant=outline][aria-expanded=true],._Button_1864l_1[data-variant=outline][data-state=open],._Button_1864l_1[data-variant=outline][data-selected]{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=outline][aria-expanded=true]:before,._Button_1864l_1[data-variant=outline][data-state=open]:before,._Button_1864l_1[data-variant=outline][data-selected]:before{background-color:var(--button-background-color-hover);box-shadow:0 0 0 1px var(--button-border-color-hover) inset,var(--button-shadow-custom, 0 0 #00000000)}@media (hover: hover) and (pointer: fine){._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):hover{color:var(--button-text-color-hover)}._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):hover:before{background-color:var(--button-background-color-hover);box-shadow:0 0 0 1px var(--button-border-color-hover) inset,var(--button-shadow-custom, 0 0 #00000000)}}._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):active:before{background-color:var(--button-background-color-active);transform:scale(var(--scale))}._Button_1864l_1[data-variant=outline]:where(:not([data-disabled])):active:after{transform:scale(var(--scale))}._Button_1864l_1[data-variant=outline]:where([data-color=primary]){--button-background-color-hover: var(--color-background-primary-outline-hover);--button-background-color-active: var(--color-background-primary-outline-active);--button-border-color: var(--color-border-primary-outline);--button-border-color-hover: var(--color-border-primary-outline-hover);--button-text-color: var(--color-text-primary-outline);--button-text-color-hover: var(--color-text-primary-outline-hover);--button-ring-color: var(--color-ring-primary-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=secondary]){--button-background-color-hover: var(--color-background-secondary-outline-hover);--button-background-color-active: var(--color-background-secondary-outline-active);--button-border-color: var(--color-border-secondary-outline);--button-border-color-hover: var(--color-border-secondary-outline-hover);--button-text-color: var(--color-text-secondary-outline);--button-text-color-hover: var(--color-text-secondary-outline-hover);--button-ring-color: var(--color-ring-secondary-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=danger]){--button-background-color-hover: var(--color-background-danger-outline-hover);--button-background-color-active: var(--color-background-danger-outline-active);--button-border-color: var(--color-border-danger-outline);--button-border-color-hover: var(--color-border-danger-outline-hover);--button-text-color: var(--color-text-danger-outline);--button-text-color-hover: var(--color-text-danger-outline-hover);--button-ring-color: var(--color-ring-danger-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=success]){--button-background-color-hover: var(--color-background-success-outline-hover);--button-background-color-active: var(--color-background-success-outline-active);--button-border-color: var(--color-border-success-outline);--button-border-color-hover: var(--color-border-success-outline-hover);--button-text-color: var(--color-text-success-outline);--button-text-color-hover: var(--color-text-success-outline-hover);--button-ring-color: var(--color-ring-success-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=warning]){--button-background-color-hover: var(--color-background-warning-outline-hover);--button-background-color-active: var(--color-background-warning-outline-active);--button-border-color: var(--color-border-warning-outline);--button-border-color-hover: var(--color-border-warning-outline-hover);--button-text-color: var(--color-text-warning-outline);--button-text-color-hover: var(--color-text-warning-outline-hover);--button-ring-color: var(--color-ring-warning-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=caution]){--button-background-color-hover: var(--color-background-caution-outline-hover);--button-background-color-active: var(--color-background-caution-outline-active);--button-border-color: var(--color-border-caution-outline);--button-border-color-hover: var(--color-border-caution-outline-hover);--button-text-color: var(--color-text-caution-outline);--button-text-color-hover: var(--color-text-caution-outline-hover);--button-ring-color: var(--color-ring-caution-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=info]){--button-background-color-hover: var(--color-background-info-outline-hover);--button-background-color-active: var(--color-background-info-outline-active);--button-border-color: var(--color-border-info-outline);--button-border-color-hover: var(--color-border-info-outline-hover);--button-text-color: var(--color-text-info-outline);--button-text-color-hover: var(--color-text-info-outline-hover);--button-ring-color: var(--color-ring-info-outline)}._Button_1864l_1[data-variant=outline]:where([data-color=discovery]){--button-background-color-hover: var(--color-background-discovery-outline-hover);--button-background-color-active: var(--color-background-discovery-outline-active);--button-border-color: var(--color-border-discovery-outline);--button-border-color-hover: var(--color-border-discovery-outline-hover);--button-text-color: var(--color-text-discovery-outline);--button-text-color-hover: var(--color-text-discovery-outline-hover);--button-ring-color: var(--color-ring-discovery-outline)}._Button_1864l_1[disabled]{pointer-events:none}._Button_1864l_1[data-disabled][data-variant]{--button-background-color: var(--color-background-disabled);--button-border-color: var(--color-border-disabled);--button-text-color: var(--color-text-disabled);cursor:not-allowed;pointer-events:auto}._Button_1864l_1[data-disabled][data-variant]:active:before{transform:scale(1)}._Button_1864l_1[data-disabled][data-variant][data-disabled-tone=relaxed]{cursor:default}._ButtonInner_1864l_4{position:relative;display:flex;flex-direction:inherit;align-items:center;justify-content:center;gap:inherit;width:100%;height:100%;transition:opacity .15s ease .1s}[data-loading] ._ButtonInner_1864l_4{opacity:0;transition:opacity .3s ease}._ButtonLoader_1864l_749{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;align-items:center;justify-content:center;pointer-events:none}._ButtonLoader_1864l_749[data-entering]{opacity:0}._ButtonLoader_1864l_749[data-exiting]{opacity:1}._ButtonLoader_1864l_749[data-entering-active],._ButtonLoader_1864l_749[data-entering][data-interrupted]{opacity:1;transition:opacity .15s ease .1s}._ButtonLoader_1864l_749[data-exiting-active],._ButtonLoader_1864l_749[data-exiting][data-interrupted]{opacity:0;transition:opacity .15s ease}}@layer components{._EmptyMessage_1r5gu_1{display:flex;flex-direction:column;align-items:center;justify-content:center}._EmptyMessage_1r5gu_1[data-fill=static]{width:100%;height:100%}._EmptyMessage_1r5gu_1[data-fill=absolute]{position:absolute;top:0;right:0;bottom:0;left:0}._IconBadge_1r5gu_16{--badge-size: 40px;--icon-size: 24px;display:flex;align-items:center;justify-content:center;width:var(--badge-size);height:var(--badge-size);border-radius:var(--radius-md);margin:0 0 12px;background:var(--badge-background-color);color:var(--badge-text-color)}._IconBadge_1r5gu_16 svg{width:var(--icon-size);height:var(--icon-size)}._IconBadge_1r5gu_16[data-size=sm]{--badge-size: 32px;--icon-size: 20px}._IconBadge_1r5gu_16[data-color=secondary]{--badge-background-color: var(--color-background-secondary-soft);--badge-text-color: var(--color-text-secondary-soft)}._IconBadge_1r5gu_16[data-color=warning]{--badge-background-color: var(--color-background-warning-soft);--badge-text-color: var(--color-text-warning-soft)}._IconBadge_1r5gu_16[data-color=danger]{--badge-background-color: var(--color-background-danger-soft);--badge-text-color: var(--color-text-danger-soft)}._Title_1r5gu_54{max-width:90%;color:var(--color-text);font-size:16px;font-weight:var(--font-weight-semibold);text-align:center;text-wrap:balance}._Title_1r5gu_54:where([data-color=danger]){color:var(--color-text-danger)}._Title_1r5gu_54:where([data-color=warning]){color:var(--color-text-warning)}._Description_1r5gu_69{max-width:90%;margin:6px 0 0;color:var(--color-text-secondary);font-size:14px;line-height:1.45;text-align:center;text-wrap:balance}._ActionRow_1r5gu_77{margin-top:calc(var(--spacing) * 4)}}.my-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.my-agents-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.my-agents-heading{min-width:0}.my-agents-title-row{display:flex;align-items:center;gap:8px}.my-agents-heading h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.my-agents-heading p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.my-agent-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.my-agent-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.my-agent-search svg{width:16px;height:16px;flex:0 0 16px}.my-agent-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.my-agent-search input::placeholder{color:hsl(var(--muted-foreground))}.my-agent-search input::-webkit-search-cancel-button{cursor:pointer}.my-agent-type-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.my-agent-type-pills{min-width:0;display:flex;flex-wrap:wrap;gap:8px}.my-agent-type-pill{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.my-agent-type-pill:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.my-agent-type-pill.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.my-agent-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;margin-top:28px;padding-bottom:56px}.my-agent-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));align-items:start;gap:12px}.my-agent-inline-error{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .05);color:hsl(var(--destructive));font-size:12px}.my-agent-inline-error span{min-width:0;overflow-wrap:anywhere}.my-agent-inline-error button{flex:0 0 auto;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;font-weight:600}.my-agent-card{width:100%;height:auto;box-sizing:border-box;border-radius:12px;background:hsl(var(--secondary) / .82)}.my-agent-create-primary{min-width:max-content;height:32px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:border-color .16s ease,background-color .16s ease,color .16s ease}.my-agent-create-primary:hover:not(:disabled){border-color:hsl(var(--foreground) / .84);background:hsl(var(--foreground) / .84)}.my-agent-create-primary:disabled{border-color:hsl(var(--border));background:hsl(var(--secondary));color:hsl(var(--muted-foreground));cursor:not-allowed;opacity:.58}.my-agent-create-primary svg{width:14px;height:14px;flex:0 0 14px}.my-agent-card{min-width:0;display:flex;flex-direction:column;overflow:hidden;border:0;animation:my-agent-card-enter .22s ease-out both;transition:transform .16s ease}.my-agent-card:hover{transform:translateY(-1px)}.my-agent-card-content{flex:0 0 auto;min-width:0;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;padding:16px;position:relative;z-index:1;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 1px 2px hsl(var(--foreground) / .035)}.my-agent-card-title{min-width:0;display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.my-agent-card-title-copy{min-width:0}.my-agent-card-badges{display:flex;flex:0 0 auto;align-items:center;gap:6px}.my-agent-region-badge{min-height:22px;display:inline-flex;flex:0 0 auto;align-items:center;padding:0 8px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10px;font-weight:600;line-height:1}.my-agent-draft-badge,.my-agent-deploying-badge{min-height:22px;display:inline-flex;flex:0 0 auto;align-items:center;padding:0 8px;border:1px solid hsl(43 90% 48% / .3);border-radius:999px;background:#fabf0f24;color:#a36f14;font-size:10px;font-weight:600;line-height:1}.my-agent-card-badges .runtime-owner-badge{min-height:22px;display:inline-flex;align-items:center;padding:0 8px;line-height:1}.my-agent-session-id{display:block;margin-top:3px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;font-weight:400;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.my-agent-card h3{min-width:0;margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:15px;font-weight:650;line-height:1.4;letter-spacing:-.015em;text-overflow:ellipsis;white-space:nowrap}.my-agent-description{min-height:40px;display:-webkit-box;margin:7px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.my-agent-status-label{display:inline-flex;min-height:22px;flex:0 0 auto;align-items:center;padding:0 8px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:550;line-height:1}.my-agent-status-label[data-ready]{border-color:#428a5c38;background:#e9f6ee;color:#206f3d}.my-agent-meta,.my-agent-meta dt,.my-agent-meta dd{margin:0}.my-agent-meta{display:grid;gap:5px;margin-top:12px}.my-agent-meta>div{display:flex;align-items:center}.my-agent-meta dt,.my-agent-meta dd{font-size:12px;line-height:1.4}.my-agent-meta dt{color:hsl(var(--muted-foreground))}.my-agent-meta dd{color:hsl(var(--foreground));font-weight:600}.my-agent-created-at,.my-agent-region{width:100%;display:flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground))}.my-agent-created-at dt,.my-agent-region dt{color:hsl(var(--foreground));font-weight:600}.my-agent-created-at dd,.my-agent-region dd{color:hsl(var(--muted-foreground));font-weight:400}.my-agent-region dd{min-width:0;overflow:hidden;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.my-agent-actions{flex:0 0 42px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:6px 8px 7px;position:relative;z-index:0;border-radius:0 0 12px 12px;background:hsl(var(--secondary) / .82)}.my-agent-actions button{min-width:0;min-height:28px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;white-space:nowrap;transition:border-color .15s ease,background-color .15s ease,color .15s ease}.my-agent-actions button:hover:not(:disabled){background:hsl(var(--background) / .72);color:hsl(var(--foreground))}.my-agent-actions button:disabled{cursor:default;opacity:.48}.my-agent-actions .my-agent-use{display:inline-flex;align-items:center;justify-content:center;gap:5px;color:hsl(var(--foreground))}.my-agent-actions .my-agent-details{background:hsl(var(--background) / .56)}.my-agent-actions .my-agent-delete{color:hsl(var(--destructive))}.my-agent-actions .my-agent-delete:hover:not(:disabled){background:hsl(var(--destructive) / .08);color:hsl(var(--destructive))}.my-agent-actions .my-agent-use:hover:not(:disabled){background:hsl(var(--background) / .72)}.my-agent-actions .my-agent-use.is-connected,.my-agent-actions .my-agent-use.is-connected:disabled{background:transparent;color:#1d7c40;opacity:1}.my-agent-use-spinner{width:11px;height:11px;flex:0 0 11px;box-sizing:border-box;border:1.25px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .7s linear infinite}.my-agent-loading-mark{box-sizing:border-box;border:1.5px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loading-gap-spin .72s linear infinite}.my-agent-loading-mark{width:14px;height:14px;flex:0 0 14px}.my-agent-initial-loading,.my-agent-load-more,.my-agent-empty{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12.5px}.my-agent-initial-loading{min-height:180px;gap:8px}.my-agent-load-more{min-height:54px;gap:8px;padding-top:6px}.my-agent-empty-message{width:100%;height:100%;min-height:220px;display:grid;place-items:center}.my-agent-empty{min-height:220px;flex-direction:column;gap:7px}.my-agent-empty p,.my-agent-empty span{margin:0}.my-agent-empty p{white-space:pre-wrap;overflow-wrap:anywhere;color:inherit;font-size:inherit;font-weight:400}.my-agent-empty button{height:30px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px}.my-agent-actions button:focus-visible,.my-agent-type-pill:focus-visible,.my-agent-create-primary:focus-visible,.my-agent-empty button:focus-visible{outline:2px solid hsl(var(--ring) / .65);outline-offset:-2px}@keyframes my-agent-card-enter{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 720px){.my-agents-page{padding:24px 20px 0}.my-agents-header{flex-direction:column;gap:16px}.my-agent-search{width:100%}.my-agent-type-bar{align-items:stretch;flex-direction:column;gap:12px}.my-agent-create-primary{align-self:flex-end}.my-agent-results{padding-bottom:44px}}@media (max-width: 560px){.my-agents-page{padding-inline:16px}}@media (prefers-reduced-motion: reduce){.my-agent-card,.my-agent-loading-mark{animation:none}.my-agent-card,.my-agent-actions button,.my-agent-type-pill,.my-agent-create-primary,.my-agent-search{transition:none}.my-agent-use-spinner{animation:none}.my-agent-card:hover{transform:none}}.applications-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.applications-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px}.applications-header h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.applications-header p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.applications-search{width:min(320px,38vw);height:36px;display:flex;align-items:center;gap:8px;box-sizing:border-box;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));transition:border-color .16s ease,box-shadow .16s ease}.applications-search:focus-within{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.applications-search svg{width:16px;height:16px;flex:0 0 16px}.applications-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px}.applications-search input::placeholder{color:hsl(var(--muted-foreground))}.applications-categories{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}.applications-categories button{min-height:30px;padding:0 13px;border:1px solid transparent;border-radius:999px;background:hsl(var(--secondary) / .7);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background-color .16s ease,border-color .16s ease,color .16s ease}.applications-categories button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.applications-categories button.is-active{border-color:hsl(var(--foreground) / .14);background:hsl(var(--foreground));color:hsl(var(--background))}.applications-categories button:focus-visible{outline:2px solid hsl(var(--ring) / .3);outline-offset:2px}.applications-results{flex:1;min-height:0;overflow-y:auto;margin-top:28px;padding-bottom:56px;scrollbar-gutter:stable}.applications-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));align-items:start;gap:12px}.application-card{min-width:0;min-height:96px;display:flex;align-items:flex-start;gap:16px;box-sizing:border-box;padding:16px 18px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;box-shadow:0 1px 2px hsl(var(--foreground) / .035);animation:application-card-enter .18s ease-out both;transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease}.application-card:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .24);box-shadow:0 4px 14px hsl(var(--foreground) / .06)}.application-card:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.application-card-icon{width:36px;height:36px;flex:0 0 36px;color:hsl(var(--foreground))}.application-card-brand-icon{object-fit:contain}.application-card-copy{min-width:0}.application-card-title{display:flex;align-items:center;gap:6px}.application-card-copy h2{min-width:0;margin:1px 0 0;font-size:15px;font-weight:620;line-height:1.4}.application-card-badge{flex:0 0 auto;display:inline-flex;align-items:center;min-height:16px;box-sizing:border-box;padding:1px 6px;border-radius:999px;background:hsl(var(--destructive));color:#fff;font-size:10px;font-weight:600;line-height:1.2}.application-card-badge.is-success{background:#36ab661f;color:#217343}.application-card-copy p{display:-webkit-box;margin:7px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.applications-empty{min-height:260px;display:grid;place-items:center;align-content:center;text-align:center;color:hsl(var(--muted-foreground))}.applications-empty svg{width:32px;height:32px;margin-bottom:12px}.applications-empty h2{margin:0;color:hsl(var(--foreground));font-size:15px;font-weight:600}.applications-empty p{margin:6px 0 0;font-size:12.5px}@keyframes application-card-enter{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 760px){.applications-page{padding:24px 20px 0}.applications-header{flex-direction:column;gap:16px}.applications-search{width:100%}}@media (prefers-reduced-motion: reduce){.application-card{animation:none;transition:none}}.github-integration-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:28px 32px 0;background:hsl(var(--background))}.github-integration-header{display:flex;align-items:center;gap:12px;padding-bottom:24px}.github-back{width:32px;height:32px;display:grid;flex:0 0 32px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .16s ease,color .16s ease}.github-back:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.github-back:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.github-back svg{width:16px;height:16px}.github-integration-logo{width:30px;height:30px;flex:0 0 30px;color:hsl(var(--foreground))}.github-integration-header h1{margin:0;font-size:20px;font-weight:650;line-height:1.3;letter-spacing:-.02em}.github-integration-header p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.github-integration-layout{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;align-items:start;overflow-y:auto;padding-bottom:56px;scrollbar-gutter:stable}.github-section-panel{width:100%;min-width:0;box-sizing:border-box;padding:0;border:0;border-radius:0;background:transparent}.github-panel-heading p{margin:0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.6}.github-release-form{margin-top:24px}.github-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.github-field{min-width:0;display:flex;flex-direction:column}.github-field>label,.github-token-label-row>label{display:flex;align-items:center;gap:7px;margin-bottom:7px;color:hsl(var(--foreground));font-size:13px;font-weight:600}.github-field-requirement{color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:500}.github-field-requirement.is-required{color:hsl(var(--destructive))}.github-field input{width:100%;height:38px;box-sizing:border-box;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;outline:0;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .16s ease,box-shadow .16s ease}.github-field input::placeholder{color:hsl(var(--muted-foreground))}.github-field input:focus{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.github-field input[aria-invalid=true]{border-color:hsl(var(--destructive) / .62)}.github-region-picker{gap:0;margin:0}.github-region-picker .pp-region-trigger,.github-region-picker .pp-region-option{height:38px;font-size:14px}.github-field-help{min-height:18px;margin-top:5px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.github-field-error{margin-top:3px;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.github-token-field{margin-top:16px}.github-token-label-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.github-token-label-row>a{display:inline-flex;align-items:center;gap:4px;color:#2371e7;font-size:12.5px;font-weight:600;line-height:1.5;text-decoration:none}.github-token-label-row>a:hover{text-decoration:underline}.github-token-label-row>a:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px;border-radius:4px}.github-token-label-row>a svg{width:13px;height:13px}.github-token-input{position:relative}.github-token-input input{padding-right:42px}.github-token-input button{position:absolute;top:5px;right:4px;width:28px;height:28px;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.github-token-input button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.github-token-input button:focus-visible{outline:2px solid hsl(var(--ring) / .3)}.github-token-input button svg{width:17px;height:17px}.github-submit-message{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;margin-top:16px;padding:10px 12px;border:1px solid;border-radius:8px;font-size:12px;line-height:1.5}.github-submit-message.is-error{border-color:hsl(var(--destructive) / .22);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.github-submit-message.is-success{border-color:#24894e3d;background:#2bab6012;color:#217343}.github-submit-message a,.github-history-item a{display:inline-flex;align-items:center;gap:5px;flex:0 0 auto;color:inherit;font-weight:620;text-decoration:none}.github-submit-message a:hover,.github-history-item a:hover{text-decoration:underline}.github-submit-message svg,.github-history-item svg{width:14px;height:14px}.github-form-actions{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:24px;padding-top:20px;border-top:1px solid hsl(var(--border))}.github-secrets-note{max-width:470px;display:flex;flex-direction:column;gap:3px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.github-secrets-note strong{color:hsl(var(--foreground));font-weight:600}.github-form-actions button{min-width:126px;height:36px;padding:0 15px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12.5px;font-weight:600;transition:background-color .16s ease,opacity .16s ease}.github-form-actions button:hover:not(:disabled){background:hsl(var(--foreground) / .84)}.github-form-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.github-form-actions button:disabled{cursor:wait;opacity:.56}@media (max-width: 680px){.github-integration-page{padding:20px 18px 0}.github-field-grid{grid-template-columns:minmax(0,1fr)}.github-form-actions{align-items:stretch;flex-direction:column}.github-form-actions button{width:100%}}@media (prefers-reduced-motion: reduce){.github-back,.github-field input,.github-form-actions button{transition:none}}.feishu-integration-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:28px 32px 0;background:hsl(var(--background))}.feishu-integration-header{display:flex;align-items:center;gap:12px;padding-bottom:24px}.feishu-back{width:32px;height:32px;display:grid;flex:0 0 32px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .16s ease,color .16s ease}.feishu-back:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.feishu-back:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.feishu-back:disabled{cursor:not-allowed;opacity:.5}.feishu-back svg{width:16px;height:16px}.feishu-integration-logo{width:30px;height:30px;flex:0 0 30px;object-fit:contain}.feishu-integration-header h1{margin:0;font-size:20px;font-weight:650;line-height:1.3;letter-spacing:-.02em}.feishu-integration-header p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.feishu-integration-layout{flex:1;min-width:0;min-height:0;overflow-y:auto;padding-bottom:56px;scrollbar-gutter:stable}.feishu-section-panel{width:100%;min-width:0}.feishu-panel-description{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6}.feishu-form{margin-top:24px}.feishu-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 16px}.feishu-field{min-width:0;display:flex;flex-direction:column}.feishu-field>label{margin-bottom:7px;color:hsl(var(--foreground));font-size:13px;font-weight:600}.feishu-field input{width:100%;height:36px;box-sizing:border-box;padding:0 11px;border:1px solid hsl(var(--border));border-radius:6px;outline:0;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .16s ease,box-shadow .16s ease}.feishu-field input::placeholder{color:hsl(var(--muted-foreground))}.feishu-field input:focus{border-color:hsl(var(--ring) / .62);box-shadow:0 0 0 2px hsl(var(--ring) / .12)}.feishu-field input[aria-invalid=true]{border-color:hsl(var(--destructive) / .62)}.feishu-field input:disabled{cursor:not-allowed;opacity:.62}.feishu-field-help{min-height:18px;margin-top:5px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.feishu-field-error{margin-top:2px;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.feishu-region-picker{position:relative;min-width:0}.feishu-region-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;min-height:36px;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background-color:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.feishu-region-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background-color:hsl(var(--muted) / .18)}.feishu-region-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.feishu-region-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.feishu-region-trigger:disabled{cursor:not-allowed;opacity:.5}.feishu-region-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.feishu-region-trigger>svg{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.feishu-region-trigger[aria-expanded=true]>svg{transform:rotate(180deg)}.feishu-region-menu{position:absolute;z-index:30;top:calc(100% + 6px);left:0;width:100%;box-sizing:border-box;max-height:238px;overflow-y:auto;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08)}.feishu-region-option{display:flex;align-items:center;width:100%;min-height:34px;padding:8px 10px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left}.feishu-region-option:hover,.feishu-region-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.feishu-region-option.is-selected{background:hsl(var(--primary) / .08)}.feishu-secret-input{position:relative}.feishu-secret-input input{padding-right:54px}.feishu-secret-input>button{position:absolute;top:4px;right:4px;height:28px;padding:0 8px;border:0;border-radius:4px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:550}.feishu-secret-input>button:hover:not(:disabled){background:hsl(var(--muted) / .5);color:hsl(var(--foreground))}.feishu-secret-input>button:focus-visible{outline:2px solid hsl(var(--ring) / .28);outline-offset:-2px}.feishu-secret-input>button:disabled{cursor:not-allowed;opacity:.5}.feishu-deployment-status{margin-top:20px;padding:14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--secondary) / .38)}.feishu-deployment-status.is-succeeded{border-color:#40966452;background:#f1f9f4}.feishu-deployment-status.is-failed{border-color:hsl(var(--destructive) / .25);background:hsl(var(--destructive) / .045)}.feishu-deployment-heading{min-height:20px;color:hsl(var(--foreground));font-size:13px;line-height:1.5}.feishu-deployment-heading strong{display:inline-flex;align-items:center;gap:6px;font-weight:600}.feishu-deployment-heading svg{width:16px;height:16px;color:#217343}.feishu-deployment-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0 0;padding:0;list-style:none}.feishu-deployment-steps li{display:flex;align-items:center;gap:6px;min-width:0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.4}.feishu-deployment-steps li>span{width:18px;height:18px;display:grid;flex:0 0 18px;place-items:center;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));font-size:10px}.feishu-deployment-steps li>span svg{width:12px;height:12px}.feishu-deployment-steps li.is-active{color:hsl(var(--foreground));font-weight:550}.feishu-deployment-steps li.is-active>span{border-color:hsl(var(--foreground) / .3)}.feishu-deployment-steps li.is-done>span{border-color:#34895766;color:#217343}.feishu-deployment-error{margin:10px 0 0;color:hsl(var(--destructive));font-size:12px;line-height:1.55;white-space:pre-wrap}.feishu-deployment-result{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:10px;color:hsl(var(--muted-foreground));font-size:12px}.feishu-deployment-result>span:first-child{color:hsl(var(--foreground));font-weight:600}.feishu-deployment-result a{display:inline-flex;align-items:center;gap:4px;color:hsl(var(--foreground));font-weight:550;text-decoration:none}.feishu-deployment-result a:hover{text-decoration:underline}.feishu-deployment-result a svg{width:14px;height:14px}.feishu-form-actions{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-top:28px;padding-top:20px;border-top:1px solid hsl(var(--border))}.feishu-secrets-note{display:flex;min-width:0;flex-direction:column;gap:3px}.feishu-secrets-note strong{font-size:12.5px;font-weight:600}.feishu-secrets-note span{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.feishu-action-buttons{display:flex;flex:0 0 auto;gap:8px}.feishu-submit,.feishu-cancel{height:36px;padding:0 15px;border-radius:7px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}.feishu-submit{border:1px solid hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.feishu-submit:hover:not(:disabled){opacity:.88}.feishu-submit:disabled{cursor:not-allowed;opacity:.45}.feishu-cancel{border:1px solid hsl(var(--border));background:hsl(var(--panel));color:hsl(var(--foreground))}.feishu-cancel:hover{background:hsl(var(--secondary))}.feishu-submit:focus-visible,.feishu-cancel:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}@media (max-width: 760px){.feishu-integration-page{padding:24px 20px 0}.feishu-field-grid{grid-template-columns:1fr}.feishu-deployment-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.feishu-form-actions{align-items:stretch;flex-direction:column}.feishu-action-buttons{justify-content:flex-end}}@media (prefers-reduced-motion: reduce){.feishu-back,.feishu-field input,.feishu-region-trigger,.feishu-region-trigger>svg{transition:none}}.coding-agents-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:28px 32px 0;background:hsl(var(--background));color:hsl(var(--foreground))}.coding-agents-header{display:flex;align-items:center;gap:12px;padding-bottom:24px}.coding-agents-back{width:32px;height:32px;display:grid;flex:0 0 32px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .16s ease,color .16s ease}.coding-agents-back:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-back:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-back:disabled{cursor:not-allowed;opacity:.5}.coding-agents-back svg{width:16px;height:16px}.coding-agents-logo{width:32px;height:32px;flex:0 0 32px;color:hsl(var(--foreground))}.coding-agents-header h1{margin:0;font-size:20px;font-weight:650;line-height:1.3;letter-spacing:-.02em}.coding-agents-header p{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.coding-agents-scroll{flex:1;min-height:0;overflow-y:auto;padding-bottom:56px;scrollbar-gutter:stable}.coding-agents-content{width:100%;display:flex;flex-direction:column;gap:14px}.coding-agents-section{min-width:0;box-sizing:border-box;padding:18px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.coding-agents-section-heading{min-height:28px;display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.coding-agents-section-heading>div{display:flex;align-items:center;gap:9px}.coding-agents-section-heading>div>span{width:22px;height:22px;display:grid;place-items:center;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.coding-agents-section-heading h2{margin:0;font-size:14px;font-weight:650;line-height:1.4}.coding-agents-section-heading>button,.coding-agents-error-row button{min-height:28px;padding:4px 8px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:600}.coding-agents-section-heading>button:hover:not(:disabled),.coding-agents-error-row button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-section-heading>button:focus-visible,.coding-agents-error-row button:focus-visible{outline:2px solid hsl(var(--ring) / .3)}.coding-agents-section-heading>button:disabled{cursor:wait;opacity:.5}.coding-agents-inline-state{min-height:86px;display:flex;align-items:center;justify-content:center;gap:9px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.coding-agents-inline-state i{width:14px;height:14px;box-sizing:border-box;border:1.5px solid hsl(var(--border));border-top-color:hsl(var(--foreground));border-radius:999px;animation:coding-agents-spin .7s linear infinite}.coding-agents-error-row{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-sizing:border-box;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .05);color:hsl(var(--destructive));font-size:12px;line-height:1.5}.coding-agents-agent-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.coding-agents-agent{position:relative;min-width:0;min-height:92px;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:11px;box-sizing:border-box;padding:12px;overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.coding-agents-agent:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--secondary) / .18)}.coding-agents-agent.is-selected{border-color:hsl(var(--ring) / .5);background:hsl(var(--primary) / .035);box-shadow:inset 0 0 0 1px hsl(var(--ring) / .08)}.coding-agents-agent:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-agent:disabled{cursor:not-allowed;opacity:.58}.coding-agents-agent-mark{width:38px;height:38px;display:grid;place-items:center;color:hsl(var(--foreground))}.coding-agents-agent-mark img{width:32px;height:32px;border-radius:7px}.coding-agents-agent-mark svg{width:32px;height:32px}.coding-agents-agent-mark.is-claude-code{color:#d86e4b}.coding-agents-agent-mark.is-codex{color:#4a55ed}.coding-agents-agent-copy{min-width:0;display:flex;flex-direction:column;gap:3px;padding-right:40px}.coding-agents-agent-copy strong{overflow:hidden;font-size:12.5px;font-weight:650;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.coding-agents-agent-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.coding-agents-status{position:absolute;top:8px;right:8px;padding:2px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:600}.coding-agents-status.is-ready{background:#36ab661a;color:#247b48}.coding-agents-check{position:absolute;right:9px;bottom:9px;width:17px;height:17px;display:grid;place-items:center;border:1px solid hsl(var(--border));border-radius:5px;color:transparent}.coding-agents-agent.is-selected .coding-agents-check{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.coding-agents-check svg{width:12px;height:12px}.coding-agents-skill-list{display:flex;flex-direction:column;gap:7px}.coding-agents-skill{min-width:0;min-height:54px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding-right:8px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));transition:border-color .15s ease,background-color .15s ease}.coding-agents-skill:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .14)}.coding-agents-skill.is-selected{border-color:hsl(var(--ring) / .42);background:hsl(var(--primary) / .025)}.coding-agents-skill label{position:relative;min-width:0;min-height:52px;display:grid;grid-template-columns:15px minmax(0,1fr);align-items:center;gap:10px;padding:7px 10px;cursor:pointer}.coding-agents-skill label>span:last-child{min-width:0;display:flex;flex-direction:column;gap:2px}.coding-agents-skill input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0}.coding-agents-skill-check{width:15px;height:15px;display:grid;place-items:center;box-sizing:border-box;border:1px solid hsl(var(--border));border-radius:4px;background:hsl(var(--background));color:transparent}.coding-agents-skill-check svg{width:10px;height:10px}.coding-agents-skill input:checked+.coding-agents-skill-check{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.coding-agents-skill input:focus-visible+.coding-agents-skill-check,.coding-agents-skill>button:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-skill input:disabled+.coding-agents-skill-check{opacity:.55}.coding-agents-skill>button{min-height:30px;padding:4px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:600;white-space:nowrap}.coding-agents-skill>button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-skill-list strong{font-size:12.5px;font-weight:630;line-height:1.35}.coding-agents-skill-list small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.coding-agents-global{margin-top:14px;padding:14px;border-radius:9px;background:hsl(var(--secondary) / .42)}.coding-agents-global-heading{display:flex;align-items:center;gap:9px}.coding-agents-global-heading>svg{width:18px;height:18px;flex:0 0 18px;color:hsl(var(--muted-foreground))}.coding-agents-global-heading>div{min-width:0;display:flex;align-items:baseline;gap:8px}.coding-agents-global-heading strong{font-size:12px;font-weight:650}.coding-agents-global-heading span{color:hsl(var(--muted-foreground));font-size:11px}.coding-agents-global dl{margin:10px 0 0 27px}.coding-agents-global dl>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:10px;padding-top:6px;font-size:11.5px;line-height:1.45}.coding-agents-global dt{color:hsl(var(--muted-foreground))}.coding-agents-global dd{min-width:0;margin:0;overflow-wrap:anywhere}.coding-agents-global>p{margin:9px 0 0 27px;color:hsl(var(--muted-foreground));font-size:11.5px}.coding-agents-result{padding:11px 12px;border:1px solid;border-radius:8px;font-size:11.5px;line-height:1.45}.coding-agents-result.is-success{border-color:#2c965838;background:#2da9610f;color:#217343}.coding-agents-result.is-error{border-color:hsl(var(--destructive) / .22);background:hsl(var(--destructive) / .05);color:hsl(var(--destructive))}.coding-agents-result strong{font-weight:620}.coding-agents-result ul{margin:7px 0 0;padding-left:16px;color:inherit}.coding-agents-result li{margin-top:3px;overflow-wrap:anywhere}.coding-agents-actions{min-height:52px;display:flex;align-items:center;justify-content:flex-end;gap:16px}.coding-agents-actions>span{color:hsl(var(--muted-foreground));font-size:11.5px}.coding-agents-actions>button{min-width:112px;min-height:36px;padding:7px 18px;border:1px solid hsl(var(--foreground));border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:620;transition:opacity .15s ease}.coding-agents-actions>button:hover:not(:disabled){opacity:.82}.coding-agents-actions>button:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:2px}.coding-agents-actions>button:disabled{cursor:not-allowed;opacity:.42}.coding-agents-preview-dialog{width:min(980px,calc(100vw - 48px));height:min(680px,calc(100vh - 48px));max-width:none;max-height:none;margin:auto;padding:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 24px 64px hsl(var(--foreground) / .18)}.coding-agents-preview-dialog[open]{display:flex;flex-direction:column}.coding-agents-preview-dialog::backdrop{background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.coding-agents-preview-header{min-height:64px;display:grid;grid-template-columns:34px minmax(0,1fr) 32px;align-items:center;gap:11px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.coding-agents-preview-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.coding-agents-preview-mark svg{width:18px;height:18px}.coding-agents-preview-header h2,.coding-agents-preview-header p{margin:0}.coding-agents-preview-header h2{font-size:14px;font-weight:650;line-height:1.4}.coding-agents-preview-header p{margin-top:2px;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4}.coding-agents-preview-header>button{width:30px;height:30px;display:grid;place-items:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.coding-agents-preview-header>button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-preview-header>button:focus-visible,.coding-agents-preview-tree button:focus-visible,.coding-agents-preview-tree summary:focus-visible,.coding-agents-preview-state button:focus-visible,.coding-agents-preview-file pre:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:1px}.coding-agents-preview-header>button svg{width:16px;height:16px}.coding-agents-preview-layout{flex:1;min-width:0;min-height:0;display:grid;grid-template-columns:230px minmax(0,1fr)}.coding-agents-preview-tree{min-width:0;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .16)}.coding-agents-preview-tree-title{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 12px;border-bottom:1px solid hsl(var(--border))}.coding-agents-preview-tree-title span{font-size:11.5px;font-weight:650}.coding-agents-preview-tree-title small{min-width:20px;padding:2px 5px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:9.5px;text-align:center}.coding-agents-preview-tree-scroll{min-height:0;overflow:auto;padding:8px}.coding-agents-preview-tree details{margin-bottom:4px}.coding-agents-preview-tree summary{min-height:30px;display:flex;align-items:center;gap:7px;padding:0 7px;border-radius:6px;color:hsl(var(--muted-foreground));cursor:pointer;font-size:11.5px;list-style:none}.coding-agents-preview-tree summary::-webkit-details-marker{display:none}.coding-agents-preview-tree summary:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-preview-tree summary svg,.coding-agents-preview-tree button svg{width:15px;height:15px;flex:0 0 15px}.coding-agents-preview-tree details>div{padding-left:13px}.coding-agents-preview-tree button{width:100%;min-width:0;min-height:30px;display:flex;align-items:center;gap:7px;padding:0 7px;overflow:hidden;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;text-align:left}.coding-agents-preview-tree button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.coding-agents-preview-tree button.is-selected{background:hsl(var(--foreground) / .08);color:hsl(var(--foreground));font-weight:600}.coding-agents-preview-tree button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.coding-agents-preview-file{min-width:0;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.coding-agents-preview-file>header{min-height:42px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 14px;border-bottom:1px solid hsl(var(--border))}.coding-agents-preview-file>header strong{min-width:0;overflow:hidden;font-size:11.5px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.coding-agents-preview-file>header span{flex:0 0 auto;color:hsl(var(--muted-foreground));font-size:10.5px}.coding-agents-preview-file pre{flex:1;min-width:0;min-height:0;margin:0;overflow:auto;padding:16px 18px 24px;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;line-height:1.65;-moz-tab-size:2;tab-size:2;white-space:pre}.coding-agents-preview-file code{font:inherit}.coding-agents-preview-state,.coding-agents-preview-unavailable{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:10px;padding:24px;color:hsl(var(--muted-foreground));font-size:12px;text-align:center}.coding-agents-preview-state i{width:14px;height:14px;box-sizing:border-box;border:1.5px solid hsl(var(--border));border-top-color:hsl(var(--foreground));border-radius:999px;animation:coding-agents-spin .7s linear infinite}.coding-agents-preview-state.is-error{flex-direction:column;color:hsl(var(--destructive))}.coding-agents-preview-state button{min-height:30px;padding:4px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px}@keyframes coding-agents-spin{to{transform:rotate(360deg)}}@media (max-width: 760px){.coding-agents-page{padding:20px 18px 0}.coding-agents-agent-grid{grid-template-columns:minmax(0,1fr)}.coding-agents-global-heading>div{align-items:flex-start;flex-direction:column;gap:2px}.coding-agents-global dl>div{grid-template-columns:minmax(0,1fr);gap:2px}.coding-agents-actions{align-items:stretch;flex-direction:column;gap:8px}.coding-agents-actions>span{text-align:right}.coding-agents-actions>button{width:100%}.coding-agents-preview-dialog{width:calc(100vw - 24px);height:calc(100vh - 24px)}.coding-agents-preview-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(130px,34%) minmax(0,1fr)}.coding-agents-preview-tree{border-right:0;border-bottom:1px solid hsl(var(--border))}}@media (prefers-reduced-motion: reduce){.coding-agents-back,.coding-agents-agent,.coding-agents-skill,.coding-agents-actions>button{transition:none}.coding-agents-inline-state i,.coding-agents-preview-state i{animation-duration:1.5s}}.builtin-tool-head{--builtin-tool-accent: 215 18% 42%;display:inline-flex;align-items:center;gap:8px;min-height:32px;padding:3px 7px 3px 3px;border:0;border-radius:9px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;cursor:pointer;transition:color .12s ease}.builtin-tool-head[data-tool-tone=search]{--builtin-tool-accent: 211 62% 42%}.builtin-tool-head[data-tool-tone=image]{--builtin-tool-accent: 28 67% 42%}.builtin-tool-head[data-tool-tone=video]{--builtin-tool-accent: 260 38% 48%}.builtin-tool-head[data-tool-tone=presentation]{--builtin-tool-accent: 252 38% 52%}.builtin-tool-head[data-tool-tone=memory]{--builtin-tool-accent: 174 52% 34%}.builtin-tool-head[data-tool-tone=knowledge]{--builtin-tool-accent: 225 48% 45%}.builtin-tool-head[data-tool-tone=skill]{--builtin-tool-accent: 154 50% 34%}.builtin-tool-head[data-tool-tone=sandbox]{--builtin-tool-accent: 32 67% 42%}.builtin-tool-head:hover{color:hsl(var(--foreground))}.builtin-tool-icon{position:relative;width:20px;height:26px;flex:0 0 20px;display:grid;place-items:center;color:hsl(var(--builtin-tool-accent))}.builtin-tool-icon>svg{width:18px;height:18px}.builtin-tool-label{font-size:14.5px;font-weight:400;line-height:1.35}.builtin-tool-head.is-done .builtin-tool-label{color:hsl(var(--muted-foreground))}.builtin-tool-chevron{width:13px;height:13px;flex:0 0 13px;opacity:.58;transition:transform .18s ease}.builtin-tool-chevron.is-open{transform:rotate(90deg)}.new-chat-mode{position:relative;align-self:flex-start}.new-chat-mode__trigger{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:2px 7px 2px 5px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer;transition:color .12s ease,background .12s ease}.composer--new-chat .new-chat-mode__trigger{min-height:36px;font-size:15px}.new-chat-mode__trigger:hover,.new-chat-mode__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-mode__current{max-width:min(180px,42vw);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__trigger:focus-visible,.new-chat-mode__option:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}.new-chat-mode__icon,.new-chat-mode__option-icon{display:inline-grid;place-items:center;flex:0 0 auto}.new-chat-mode__icon svg{width:15px;height:15px}.new-chat-mode__option-icon svg{width:18px;height:18px}.new-chat-mode svg{fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}.new-chat-mode svg.new-chat-mode__temporary-icon{stroke-width:1.3}.new-chat-mode__skill-icon path:first-child{fill:currentColor;stroke:none}.new-chat-mode__chevron{width:12px;height:12px;transition:transform .14s ease}.new-chat-mode__trigger[aria-expanded=true] .new-chat-mode__chevron{transform:rotate(180deg)}.new-chat-mode__menus{position:absolute;z-index:43;top:calc(100% + 7px);left:0;display:flex;align-items:flex-start;gap:8px}.new-chat-mode__menu{flex:0 0 auto;width:286px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__option{display:grid;grid-template-columns:24px minmax(0,1fr) 18px;align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));text-align:left;cursor:pointer}.new-chat-mode__option.is-active{background:hsl(var(--accent))}.new-chat-mode__option:disabled{cursor:not-allowed;opacity:.48}.new-chat-mode__copy{display:flex;min-width:0;flex-direction:column;gap:2px}.new-chat-mode__copy>span:last-child{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.35}.new-chat-mode__label{display:flex;min-width:0;align-items:center;gap:7px;font-size:13px;line-height:1.3}.new-chat-mode__label-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-mode__beta{flex:0 0 auto;padding:1px 5px;border:1px solid hsl(var(--border));border-radius:999px;color:hsl(var(--muted-foreground));font-size:9px;font-weight:500;line-height:1.2}.new-chat-mode__check{width:16px;height:16px;color:hsl(var(--primary))}.new-chat-mode__nested-chevron{width:14px;height:14px;color:hsl(var(--muted-foreground))}.new-chat-mode__submenu{flex:0 0 auto;width:248px;padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-mode__submenu-option{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:9px;width:100%;padding:9px 8px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.new-chat-mode__submenu-option:hover:not(:disabled){background:hsl(var(--accent))}.new-chat-mode__submenu-option:disabled{cursor:not-allowed;opacity:.42}.new-chat-mode__builtin-icon{width:24px;height:24px;flex:0 0 auto;stroke-width:1.75}@media (max-width: 640px){.new-chat-mode__menus{width:min(320px,calc(100vw - 48px));max-height:min(520px,calc(100vh - 160px));flex-direction:column;overflow-y:auto}.new-chat-mode__menu,.new-chat-mode__submenu{width:100%}}@media (prefers-reduced-motion: reduce){.new-chat-mode__trigger,.new-chat-mode__chevron{transition:none}}.new-chat-agent-picker{position:relative;min-width:0}.composer--new-chat .new-chat-agent-picker{position:absolute;z-index:5;bottom:10px;left:52px}.composer--new-chat.composer--has-task .new-chat-agent-picker{left:138px}.composer--new-chat.composer--task-image .new-chat-agent-picker,.composer--new-chat.composer--task-video .new-chat-agent-picker{left:176px}.new-chat-agent-picker__trigger{display:inline-flex;align-items:center;gap:6px;max-width:min(220px,42vw);min-height:36px;padding:2px 8px 2px 6px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;line-height:20px;cursor:pointer;transition:color .14s ease,background .14s ease}.new-chat-agent-picker__trigger:hover,.new-chat-agent-picker__trigger[aria-expanded=true]{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-agent-picker__trigger:disabled{cursor:not-allowed;opacity:.48}.new-chat-agent-picker__trigger>span{display:flex;min-height:20px;align-items:center;overflow:hidden;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.new-chat-agent-picker__trigger-icon,.new-chat-agent-picker__trigger-chevron{display:block}.new-chat-agent-picker__trigger-icon{width:17px;height:17px;flex:0 0 auto}.new-chat-agent-picker__trigger-chevron{width:13px;height:13px;flex:0 0 auto;transform:rotate(90deg);transition:transform .14s ease}.new-chat-agent-picker__trigger[aria-expanded=true] .new-chat-agent-picker__trigger-chevron{transform:rotate(-90deg)}.new-chat-agent-picker__menus{position:absolute;z-index:44;top:calc(100% + 7px);left:0;display:flex;align-items:flex-start;gap:7px;outline:none}.new-chat-agent-picker__menu,.new-chat-agent-picker__submenu{padding:5px;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--popover, var(--background)));box-shadow:0 18px 48px -22px hsl(var(--foreground) / .32),0 3px 10px hsl(var(--foreground) / .06)}.new-chat-agent-picker__menu{width:218px}.new-chat-agent-picker__submenu{width:272px;max-height:286px;overflow:auto}.new-chat-agent-picker__type,.new-chat-agent-picker__runtime{display:grid;align-items:center;width:100%;min-height:38px;border:0;border-radius:8px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left}.new-chat-agent-picker__type{grid-template-columns:22px minmax(0,1fr) 16px;gap:8px;padding:7px 8px;font-size:13px;cursor:pointer}.new-chat-agent-picker__type:hover,.new-chat-agent-picker__type.is-keyboard-active,.new-chat-agent-picker__runtime:hover:not(:disabled),.new-chat-agent-picker__runtime.is-keyboard-active{background:hsl(var(--accent))}.new-chat-agent-picker__type-icon,.new-chat-agent-picker__runtime-icon{width:18px;height:18px;flex:0 0 auto}.new-chat-agent-picker__nested-chevron{width:14px;height:14px;color:hsl(var(--muted-foreground))}.new-chat-agent-picker__runtime{grid-template-columns:22px minmax(0,1fr) auto;gap:8px;padding:8px;font-size:13px;cursor:pointer}.new-chat-agent-picker__runtime:disabled{cursor:wait;opacity:.62}.new-chat-agent-picker__runtime>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.new-chat-agent-picker__runtime small{color:hsl(var(--muted-foreground));font-size:11px}.new-chat-agent-picker__check{width:16px;height:16px;color:hsl(var(--primary))}.new-chat-agent-picker__runtime-list{display:flex;flex-direction:column;gap:1px}.new-chat-agent-picker__empty{min-height:116px;padding:14px 10px}.new-chat-agent-picker__empty-title{white-space:nowrap}.new-chat-agent-picker__empty-agent-icon{width:32px;height:32px}.new-chat-agent-picker__status,.new-chat-agent-picker__error,.new-chat-agent-picker__inline-error{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.new-chat-agent-picker__status{display:flex;min-height:76px;align-items:center;justify-content:center;gap:7px;padding:12px}.new-chat-agent-picker__error{display:flex;flex-direction:column;gap:8px;padding:10px;color:hsl(var(--destructive))}.new-chat-agent-picker__error>span,.new-chat-agent-picker__inline-error{white-space:pre-wrap;overflow-wrap:anywhere}.new-chat-agent-picker__error button,.new-chat-agent-picker__load-more{min-height:30px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--panel));color:hsl(var(--foreground));font:inherit;font-size:12px;cursor:pointer}.new-chat-agent-picker__inline-error{padding:6px 8px;color:hsl(var(--destructive))}.new-chat-agent-picker__load-more{width:100%;margin-top:4px}.new-chat-agent-picker__load-more:disabled{cursor:wait;opacity:.55}.new-chat-agent-picker__spinner{width:13px;height:13px;border:1.5px solid hsl(var(--border));border-top-color:hsl(var(--foreground));border-radius:50%;animation:new-chat-agent-picker-spin .7s linear infinite}.new-chat-agent-picker__trigger:focus-visible,.new-chat-agent-picker__type:focus-visible,.new-chat-agent-picker__runtime:focus-visible,.new-chat-agent-picker__error button:focus-visible,.new-chat-agent-picker__load-more:focus-visible{outline:2px solid hsl(var(--primary) / .42);outline-offset:1px}@keyframes new-chat-agent-picker-spin{to{transform:rotate(360deg)}}@media (max-height: 700px) and (min-width: 641px){.new-chat-agent-picker__menus{top:auto;bottom:calc(100% + 7px)}.new-chat-agent-picker__submenu{max-height:min(220px,calc(100dvh - 180px))}}@media (max-width: 640px){.new-chat-agent-picker__menus{width:min(320px,calc(100vw - 88px));max-height:min(420px,calc(100dvh - 168px));flex-direction:column;overflow-y:auto;overscroll-behavior:contain}.new-chat-agent-picker__menu,.new-chat-agent-picker__submenu{width:100%;flex:0 0 auto}.new-chat-agent-picker__submenu{max-height:220px}}@media (prefers-reduced-motion: reduce){.new-chat-agent-picker__trigger,.new-chat-agent-picker__trigger-chevron{transition:none}.new-chat-agent-picker__spinner{animation:none}}.stk{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 24px 6vh}.stk-head{text-align:center;margin-bottom:26px}.stk-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em}.stk-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.stk-list{display:flex;flex-direction:column;gap:12px;width:100%;max-width:520px}.stk-card{display:flex;align-items:center;gap:14px;width:100%;padding:18px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));cursor:pointer;font:inherit;text-align:left;transition:border-color .15s,box-shadow .15s,background .12s}.stk-card:hover{border-color:hsl(var(--ring) / .35);background:hsl(var(--foreground) / .02);box-shadow:0 8px 24px -16px hsl(var(--foreground) / .25)}.stk-card-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:11px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.stk-card-icon svg{width:21px;height:21px}.stk-card-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.stk-card-title{font-size:15px;font-weight:600}.stk-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.stk-card-status{flex-shrink:0;padding:4px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:600;line-height:1.3;white-space:nowrap}.stk-card-arrow{flex-shrink:0;width:18px;height:18px;color:hsl(var(--muted-foreground));opacity:0;transform:translate(-4px);transition:opacity .15s,transform .15s}.stk-card:hover .stk-card-arrow{opacity:1;transform:translate(0)}.stk-card-disabled{opacity:.5;cursor:not-allowed}.stk-card-disabled:hover{border-color:hsl(var(--border));background:hsl(var(--card));box-shadow:none}.stk-card-disabled .stk-card-arrow{display:none}.stk-footer{margin-top:18px;width:100%;max-width:520px;display:flex;justify-content:center}.stk-import{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border:1px dashed hsl(var(--border));border-radius:9px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.stk-import:hover{color:hsl(var(--foreground));border-color:hsl(var(--ring) / .4);background:hsl(var(--foreground) / .03)}.stk-import svg{width:15px;height:15px}.code-browser-trigger{min-height:26px;display:inline-flex;align-items:center;gap:5px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:color .12s ease,background-color .12s ease}.code-browser-trigger svg{width:13px;height:13px}.code-browser-trigger:hover{background:hsl(var(--foreground) / .04);color:hsl(var(--foreground))}.code-browser-trigger:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.code-browser-backdrop{position:fixed;z-index:1200;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;padding:32px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:code-browser-fade-in .14s ease-out}.code-browser-dialog{width:min(1040px,92vw);height:min(720px,84vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:code-browser-rise-in .18s cubic-bezier(.2,.8,.2,1)}.code-browser-head{flex:0 0 58px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 16px 0 18px;border-bottom:1px solid hsl(var(--border))}.code-browser-title-wrap{min-width:0;display:flex;align-items:center;gap:10px}.code-browser-title-icon{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;border-radius:7px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-title-icon svg,.code-browser-close svg{width:16px;height:16px}.code-browser-title-wrap h2,.code-browser-title-wrap p{margin:0}.code-browser-title-wrap h2{color:hsl(var(--foreground));font-size:14px;font-weight:650;line-height:1.35}.code-browser-title-wrap p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.code-browser-close{width:30px;height:30px;flex:0 0 auto;display:grid;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.code-browser-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.code-browser-workspace{flex:1;min-height:0;display:flex}.code-browser-sidebar{flex:0 0 220px;min-width:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .22)}.code-browser-sidebar-head,.code-browser-path{flex:0 0 38px;min-height:38px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.code-browser-sidebar-head{justify-content:space-between;padding:0 12px;color:hsl(var(--muted-foreground));font-size:11px;font-weight:650}.code-browser-sidebar-head span{font-variant-numeric:tabular-nums;font-weight:500}.code-browser-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.code-browser-file,.code-browser-folder{width:100%;min-height:30px;display:flex;align-items:center;gap:6px;padding-top:4px;padding-right:10px;padding-bottom:4px;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;text-align:left;cursor:pointer}.code-browser-file:hover,.code-browser-folder:hover{background:hsl(var(--foreground) / .045);color:hsl(var(--foreground))}.code-browser-file.is-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.code-browser-file svg,.code-browser-folder svg{width:14px;height:14px;flex:0 0 auto}.code-browser-folder>svg:first-child{width:12px;height:12px;transition:transform .12s ease}.code-browser-folder>svg:first-child.is-open{transform:rotate(90deg)}.code-browser-file span,.code-browser-folder span,.code-browser-path span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.code-browser-main{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.code-browser-path{gap:7px;padding:0 13px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px}.code-browser-path svg{width:13px;height:13px;flex:0 0 auto}.code-browser-editor{flex:1;min-height:0;overflow:hidden}.code-browser-editor>div,.code-browser-editor .cm-theme,.code-browser-editor .cm-editor{height:100%}.code-browser-editor .cm-scroller{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12.5px}.code-browser-empty{height:100%;display:grid;place-items:center;padding:20px;color:hsl(var(--muted-foreground));font-size:12px}@keyframes code-browser-fade-in{0%{opacity:0}to{opacity:1}}@keyframes code-browser-rise-in{0%{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.code-browser-backdrop{padding:12px}.code-browser-dialog{width:100%;height:min(760px,92vh)}.code-browser-sidebar{flex-basis:168px}}@media (prefers-reduced-motion: reduce){.code-browser-backdrop,.code-browser-dialog{animation:none}}.layout{--pp-sidebar-width: 236px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.pp-root{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0;overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground))}.pp-toolbar{flex:0 0 auto;min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:10px 24px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.pp-toolbar-left,.pp-toolbar-actions,.pp-actions{display:flex;align-items:center}.pp-toolbar-left{min-width:0;gap:18px}.pp-toolbar-actions{flex:0 0 auto;gap:8px}.pp-toolbar-back{display:inline-flex;align-items:center;gap:7px;min-height:34px;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:15px;font-weight:500;cursor:pointer}.pp-toolbar-back:hover{color:hsl(var(--foreground))}.pp-toolbar-title{min-width:0;overflow:hidden;color:hsl(var(--foreground));font-size:14px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-secondary{min-height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border-radius:6px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;transition:background-color .12s ease,border-color .12s ease,color .12s ease}.pp-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.pp-secondary:hover{border-color:hsl(var(--foreground) / .22);background:hsl(var(--accent))}.pp-secondary:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:1px}.pp-secondary:disabled{opacity:.55;cursor:default}.pp-body{flex:1;min-height:0;min-width:0;display:flex}.pp-files-area{flex:1 1 auto;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.pp-sidebar{flex:0 0 218px;width:218px;min-height:0;display:flex;flex-direction:column;border-right:1px solid hsl(var(--border));background:hsl(var(--secondary) / .24)}.pp-sidebar-head,.pp-main-head{flex:0 0 42px;min-height:42px;display:flex;align-items:center;border-bottom:1px solid hsl(var(--border))}.pp-sidebar-head{gap:8px;padding:0 9px 0 14px}.pp-project-name{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:650;letter-spacing:.04em;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.pp-tree{flex:1;min-height:0;overflow:auto;padding:6px 0 12px}.pp-row{width:100%;min-height:29px;display:flex;align-items:center;gap:6px;padding:4px 8px;border:0;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12.5px;text-align:left;cursor:pointer}.pp-row:hover{background:hsl(var(--foreground) / .045)}.pp-file.pp-active{background:hsl(var(--foreground) / .075);color:hsl(var(--foreground))}.pp-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-folder .pp-label{color:hsl(var(--muted-foreground))}.pp-ic{width:15px;height:15px;flex:0 0 auto}.pp-chevron{color:hsl(var(--muted-foreground));transition:transform .12s ease}.pp-chevron.pp-open{transform:rotate(90deg)}.pp-icon-btn{width:28px;height:28px;flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-icon-btn:hover:not(:disabled){background:hsl(var(--foreground) / .07);color:hsl(var(--foreground))}.pp-icon-btn:disabled{opacity:.45;cursor:default}.pp-danger:hover:not(:disabled){color:hsl(var(--destructive))}.pp-new-input{width:calc(100% - 16px);height:30px;margin:2px 8px 6px;padding:0 8px;border:1px solid hsl(var(--ring) / .55);border-radius:4px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.pp-empty,.pp-placeholder{width:100%;padding:28px 16px;color:hsl(var(--muted-foreground));font-size:12.5px;text-align:center}.pp-main{flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.pp-main-head{gap:12px;padding:0 10px 0 14px;background:hsl(var(--background))}.pp-path{flex:1;min-width:0;overflow:hidden;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-actions{gap:2px}.pp-content{flex:1;min-height:0;min-width:0;display:flex;overflow:hidden}.pp-codemirror,.pp-codemirror>div,.pp-codemirror .cm-editor{width:100%;height:100%;min-height:0}.pp-codemirror .cm-editor{overflow:hidden;background:hsl(var(--background));color:hsl(var(--foreground));font-size:12.5px}.pp-codemirror .cm-scroller{overflow:auto;overscroll-behavior:none;scroll-padding-block:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.58}.pp-codemirror .cm-content{padding:10px 0 0}.pp-codemirror .cm-line{padding:0 14px 0 8px}.pp-codemirror .cm-content>.cm-line:last-child:has(>br:only-child){display:none}.pp-codemirror .cm-gutters{border-right:1px solid hsl(var(--border) / .7);background:hsl(var(--secondary) / .2);color:hsl(var(--muted-foreground) / .65)}.pp-codemirror .cm-activeLine,.pp-codemirror .cm-activeLineGutter{background:hsl(var(--foreground) / .035)}.pp-codemirror .cm-focused{outline:none}.pp-editor-loading{height:100%;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:12px}.pp-pre{flex:1;width:100%;height:100%;box-sizing:border-box;margin:0;padding:14px 16px 0;overflow:auto;background:hsl(var(--background));color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px;font-style:normal;font-variant-ligatures:none;font-weight:400;line-height:1.58;-moz-tab-size:2;tab-size:2;white-space:pre}.pp-root.is-deploy{--pp-publish-content-width: min(760px, max(680px, calc(100% - 48px) ));overflow-y:auto}.pp-root.is-deploy.is-embedded{--pp-publish-content-width: 100%}.pp-root.is-deploy .pp-body{flex:0 0 auto;min-height:100%;display:grid;grid-template-rows:auto auto;overflow:visible}.pp-root.is-deploy.has-primary-pane .pp-body{display:flex;justify-content:center;background:hsl(var(--background))}.pp-root.is-deploy.has-primary-pane .pp-config{width:min(760px,100%);background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-head,.pp-root.is-deploy.has-primary-pane .pp-config-actions{border:0;background:transparent}.pp-root.is-deploy.has-primary-pane .pp-config-actions{position:sticky;bottom:0;width:var(--pp-publish-content-width);margin:0 auto;justify-content:center;padding:12px 0 18px;background:hsl(var(--background));transform:none}.pp-root.is-deploy.has-primary-pane .pp-deploy-hint{position:absolute;left:18px}.pp-root.is-deploy .pp-files-area{display:none}.pp-release-overview{min-width:0;min-height:0;border-bottom:0;background:transparent}.pp-release-preview{width:var(--pp-publish-content-width);box-sizing:border-box;min-height:0;display:grid;grid-template-columns:minmax(0,1fr);gap:12px;margin:0 auto;padding:8px 0 12px}.pp-release-preview.is-embedded{grid-template-columns:minmax(0,1fr) 132px;align-items:stretch}.pp-flow-thumbnail{position:relative;height:200px;min-width:0;min-height:0;overflow:hidden;border:1px solid hsl(var(--border));border-radius:14px;background:transparent;box-shadow:none}.pp-flow-thumbnail .abc-root,.pp-flow-dialog-canvas .abc-root{width:100%;height:100%;min-width:0;min-height:0;flex:1 1 auto;border:0;background:transparent}.pp-flow-thumbnail .abc-canvas,.pp-flow-dialog-canvas .abc-canvas{flex:1;min-height:0;background:transparent}.pp-flow-thumbnail .react-flow__pane{cursor:grab}.pp-flow-thumbnail .react-flow__pane:active{cursor:grabbing}.pp-flow-thumbnail .react-flow__controls{display:none}.pp-flow-expand{position:absolute;z-index:5;right:10px;bottom:10px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit}.pp-flow-expand:hover{background:transparent;color:hsl(var(--foreground))}.pp-flow-expand:focus-visible{outline:2px solid hsl(var(--primary) / .72);outline-offset:2px}.pp-flow-expand svg{width:17px;height:17px}.pp-release-info{min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:18px;background:hsl(var(--panel));box-shadow:inset 0 1px hsl(var(--background)),0 8px 28px hsl(var(--foreground) / .045)}.pp-release-card-head{padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34);color:hsl(var(--foreground));font-size:14px;font-weight:620;letter-spacing:-.01em}.pp-release-info-body{padding:14px 18px 16px}.pp-release-info-main{min-width:0}.pp-release-info h2{margin:0;color:hsl(var(--foreground));font-size:18px;font-weight:700;letter-spacing:-.02em}.pp-release-description{display:-webkit-box;margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;overflow:hidden;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px;margin:12px 0 0}.pp-release-facts>div{min-width:0}.pp-release-facts dt{color:hsl(var(--muted-foreground));font-size:13px}.pp-release-facts dd{margin:5px 0 0;overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.pp-release-facts .pp-release-fact-long{display:-webkit-box;overflow:hidden;line-height:1.45;text-overflow:clip;white-space:pre-wrap;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-release-facts .pp-release-prompt{-webkit-line-clamp:3}.pp-artifact-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px;padding-top:12px}.pp-artifact-actions.is-rail{flex-direction:column;flex-wrap:nowrap;gap:8px;margin:0;padding:0}.pp-artifact-actions.is-rail .pp-secondary,.pp-artifact-actions.is-rail .code-browser-trigger{flex:1 1 0;width:100%;min-height:36px;justify-content:center}.pp-artifact-actions .pp-secondary,.pp-artifact-actions .code-browser-trigger{min-height:34px;padding-inline:12px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);box-shadow:none;color:hsl(var(--foreground));font-size:13px}.pp-artifact-actions .pp-secondary:hover,.pp-artifact-actions .code-browser-trigger:hover{background:hsl(var(--secondary))}.pp-flow-backdrop{--cw-workspace-ink: 222 24% 13%;position:fixed;z-index:1000;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:32px;background:hsl(var(--foreground) / .36);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.pp-flow-dialog{width:min(1120px,92vw);height:min(720px,86vh);min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 80px hsl(var(--foreground) / .22)}.pp-flow-dialog>header{flex:0 0 62px;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:0 18px 0 22px;border-bottom:1px solid hsl(var(--border))}.pp-flow-dialog>header>div{display:flex;flex-direction:column;gap:3px}.pp-flow-dialog>header strong{font-size:15px;font-weight:680}.pp-flow-dialog>header span{color:hsl(var(--muted-foreground));font-size:10.5px}.pp-flow-dialog>header button{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.pp-flow-dialog>header button:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.pp-flow-dialog>header svg{width:17px;height:17px}.pp-flow-dialog-canvas{flex:1;min-height:0;background:transparent}.pp-config{position:relative;min-width:0;width:auto;min-height:0;display:flex;flex-direction:column;background:hsl(var(--panel))}.pp-config-head{width:var(--pp-publish-content-width);flex:0 0 48px;height:48px;box-sizing:border-box;display:flex;align-items:center;margin:0 auto;padding:0;border-bottom:0}.pp-config-title{color:hsl(var(--foreground));font-size:18px;font-weight:650;letter-spacing:-.01em}.pp-env-sub{margin-top:4px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.pp-config-scroll{width:var(--pp-publish-content-width);flex:0 0 auto;min-height:0;box-sizing:border-box;display:block;margin:0 auto;overflow:visible;padding:0 0 88px}.pp-config-actions{position:fixed;z-index:40;left:calc((100vw + var(--pp-sidebar-width, 0px)) / 2);bottom:max(20px,env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;transform:translate(-50%)}.pp-config-actions.is-external{display:none}.pp-config-section{width:100%;min-width:0;box-sizing:border-box;margin:0 0 12px;padding:0 18px 16px;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:18px;background:hsl(var(--panel));box-shadow:inset 0 1px hsl(var(--background)),0 8px 28px hsl(var(--foreground) / .045)}.pp-config-section:has(.pp-network-region){overflow:visible}.pp-config-section:has(.pp-network-region.is-open){position:relative;z-index:70}.pp-config-section:has(.pp-network-region)>.pp-config-label{border-radius:17px 17px 0 0}.pp-env-section,.pp-progress-section,.pp-deploy-result,.pp-config-scroll>.pp-error{width:100%;margin-inline:0}.pp-config-label{margin:0 -18px 12px;padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34);color:hsl(var(--foreground));font-size:14px;font-weight:620;letter-spacing:-.01em}.pp-env-head{margin:0 -18px 12px;padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34)}.pp-env-head .pp-config-label{margin:0;padding:0;border:0;background:transparent}.pp-config-note{margin:-4px 0 10px;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.pp-auth-section{overflow:visible}.pp-auth-preserved-note{margin:0}.pp-auth-fields{width:min(100%,560px);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px}.pp-auth-fields>label{min-width:0;display:flex;flex-direction:column;gap:7px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deployment-select{position:relative;min-width:0}.pp-deployment-select-trigger{width:100%;height:36px;min-height:36px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.pp-deployment-select-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .18)}.pp-deployment-select-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.pp-deployment-select-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.pp-deployment-select-trigger:disabled{cursor:not-allowed;opacity:.5}.pp-deployment-select-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-deployment-select-trigger>.is-placeholder{color:hsl(var(--muted-foreground));font-weight:400}.pp-deployment-select-chevron{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.pp-deployment-select-chevron.is-open{transform:rotate(180deg)}.pp-deployment-select-menu{position:absolute;z-index:40;top:calc(100% + 6px);right:0;left:0;max-height:224px;overflow-y:auto;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08);overscroll-behavior:contain}.pp-deployment-select-option{width:100%;min-height:40px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 9px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left}.pp-deployment-select-option:hover,.pp-deployment-select-option:focus-visible,.pp-deployment-select-option.is-selected{outline:none;background:hsl(var(--muted) / .5)}.pp-deployment-select-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.pp-deployment-select-name{min-width:0;display:flex;align-items:center;gap:6px;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-weight:560;text-overflow:ellipsis;white-space:nowrap}.pp-deployment-select-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.pp-deployment-select-option>svg{width:15px;height:15px;flex-shrink:0;color:hsl(var(--primary))}.pp-deployment-select-badge{flex-shrink:0;padding:1px 5px;border:1px solid hsl(211 90% 48% / .24);border-radius:999px;background:#006fe61a;color:#1863b4;font-size:10px;font-weight:600}.pp-user-pool-picker{min-width:0;display:flex;flex-direction:column;gap:7px}.pp-user-pool-status{min-height:18px;display:inline-flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.5}.pp-user-pool-spinner{width:13px;height:13px;flex-shrink:0;animation:pp-spin .9s linear infinite}.pp-user-pool-error{min-height:18px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:hsl(var(--destructive));font-size:11.5px;line-height:1.5}.pp-user-pool-error button{flex-shrink:0;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;font:inherit;font-weight:600}.pp-user-pool-error button:focus-visible{outline:2px solid hsl(var(--ring) / .45);outline-offset:2px}.pp-instance-note{margin:10px 0 0;color:#d79804;font-size:12px;line-height:1.5}.pp-instance-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pp-instance-fields label{min-width:0;display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-instance-error{margin:8px 0 0;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.pp-config-select,.pp-channel-fields input,.pp-instance-fields input,.pp-network-fields input,.pp-env-row input,.pp-env-row textarea{width:100%;min-width:0;height:34px;box-sizing:border-box;padding:0 10px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;transition:border-color .12s ease,box-shadow .12s ease}.pp-channel-fields input{height:30px;padding-inline:8px;font-size:11.5px}.pp-config-select:focus,.pp-channel-fields input:focus,.pp-instance-fields input:focus,.pp-network-fields input:focus,.pp-env-row input:focus,.pp-env-row textarea:focus{border-color:hsl(var(--ring) / .55);box-shadow:0 0 0 2px hsl(var(--ring) / .08)}.pp-config-select:disabled,.pp-channel-fields input:disabled,.pp-instance-fields input:disabled,.pp-network-fields input:disabled,.pp-env-row input:disabled,.pp-env-row textarea:disabled{opacity:.55}.pp-channel-card{position:relative;width:clamp(154px,33.333%,236px);max-width:100%;height:112px;perspective:1200px;transition:height .18s ease}.pp-channel-card.is-flipped{height:176px}.pp-channel-card-inner{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .42s cubic-bezier(.22,1,.36,1)}.pp-channel-card.is-flipped .pp-channel-card-inner{transform:rotateY(180deg)}.pp-channel-card-face{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;box-sizing:border-box;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:14px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden}.pp-channel-card-front{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:11px;padding:12px;color:hsl(var(--foreground));cursor:pointer;font:inherit;text-align:left;transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease}.pp-channel-card-front:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);box-shadow:0 12px 30px hsl(var(--foreground) / .07);transform:translateY(-1px)}.pp-channel-card-front:focus-visible,.pp-channel-remove:focus-visible{outline:2px solid hsl(var(--ring) / .58);outline-offset:2px}.pp-channel-card-front:disabled{cursor:default}.pp-channel-card-back{padding:10px;transform:rotateY(180deg)}.pp-channel-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.pp-channel-card-head>strong{font-size:12.5px;font-weight:650}.pp-channel-logo{width:42px;height:42px;flex:0 0 42px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border) / .65);border-radius:12px;background:#fff;box-shadow:0 4px 14px hsl(var(--foreground) / .07)}.pp-channel-logo img{width:30px;height:30px;display:block}.pp-channel-card-copy{min-width:0;display:flex;flex:1;flex-direction:column;gap:3px}.pp-channel-card-copy strong{font-size:14px;font-weight:650}.pp-channel-card-copy small{display:-webkit-box;overflow:hidden;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:2}.pp-channel-remove{min-height:24px;padding:0 6px;border:1px solid hsl(var(--destructive) / .14);border-radius:7px;background:hsl(var(--destructive) / .07);color:#863232;cursor:pointer;font:inherit;font-size:10.5px;white-space:nowrap}.pp-channel-remove:hover:not(:disabled){background:hsl(var(--destructive) / .12);color:#782626}.pp-channel-fields{display:flex;flex-direction:column;gap:6px;margin-top:7px}.pp-channel-fields label{min-width:0;display:flex;flex-direction:column;gap:3px;color:hsl(var(--muted-foreground));font-size:11px}.pp-channel-fields label>span{color:hsl(var(--foreground));font-weight:560}.pp-channel-fields small{margin-left:5px;color:hsl(var(--destructive));font-size:9px;font-weight:500}.pp-network-layout{width:min(100%,560px);display:grid;grid-template-columns:minmax(132px,.36fr) minmax(0,.64fr);align-items:start;gap:24px}.pp-network-region{position:relative;display:flex;flex-direction:column;gap:7px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-region.is-open{z-index:80}.pp-region-trigger{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 11px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;cursor:pointer;transition:border-color .12s ease,background-color .12s ease}.pp-region-trigger:hover,.pp-region-trigger[aria-expanded=true]{border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025)}.pp-region-trigger:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.pp-region-trigger:disabled{cursor:not-allowed;opacity:.58;background:hsl(var(--muted) / .32)}.pp-region-help{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.pp-region-chevron{width:15px;height:15px;color:hsl(var(--muted-foreground));transition:transform .15s ease}.pp-region-chevron.is-open{transform:rotate(180deg)}.pp-region-menu{position:absolute;top:calc(100% + 6px);right:0;left:0;z-index:81;padding:5px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--panel));box-shadow:0 12px 28px hsl(var(--foreground) / .12)}.pp-region-option{width:100%;height:36px;display:flex;align-items:center;justify-content:space-between;padding:0 9px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;text-align:left;cursor:pointer}.pp-region-option:hover,.pp-region-option:focus-visible,.pp-region-option.is-selected{outline:none;background:hsl(var(--foreground) / .055)}.pp-region-option.is-selected{font-weight:600}.pp-region-option svg{width:15px;height:15px;color:hsl(var(--primary))}.pp-network-modes{display:flex;flex-direction:column;gap:9px}.pp-network-option{min-height:28px;display:flex;align-items:center;gap:9px;color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560;cursor:pointer}.pp-network-option:has(input:checked){color:hsl(var(--foreground))}.pp-network-option:has(input:disabled){cursor:default;opacity:.58}.pp-network-option input{width:15px;height:15px;flex:0 0 15px;display:grid;place-items:center;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--background));cursor:inherit;transition:border-color .12s ease,box-shadow .12s ease}.pp-network-option input:before{width:7px;height:7px;border-radius:50%;background:hsl(var(--primary));content:"";transform:scale(0);transition:transform .12s ease-out}.pp-network-option input:checked{border-color:hsl(var(--primary))}.pp-network-option input:checked:before{transform:scale(1)}.pp-network-option input:focus-visible,.pp-network-check input:focus-visible,.pp-evaluation-set-option input:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.pp-network-fields{display:flex;flex-direction:column;gap:12px;min-width:0}.pp-network-fields label:not(.pp-network-check){display:flex;flex-direction:column;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.pp-network-fields small{font-size:10.5px;font-weight:400}.pp-network-check{display:flex;align-items:center;gap:8px;color:hsl(var(--foreground));font-size:12.5px;cursor:pointer}.pp-evaluation-set-option{display:flex;align-items:flex-start;gap:10px;color:hsl(var(--foreground));cursor:pointer}.pp-evaluation-set-option>span{display:flex;flex-direction:column;gap:3px;min-width:0}.pp-evaluation-set-option strong{font-size:13px;font-weight:550;line-height:1.45}.pp-evaluation-set-option small{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.5}.pp-network-check input,.pp-evaluation-set-option input{width:16px;height:16px;flex:0 0 16px;display:grid;place-items:center;margin:0;padding:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid hsl(var(--border));border-radius:4px;background:hsl(var(--background));cursor:inherit;transition:border-color .12s ease,background-color .12s ease,box-shadow .12s ease}.pp-network-check input:before,.pp-evaluation-set-option input:before{width:4px;height:8px;border:solid hsl(var(--primary-foreground));border-width:0 2px 2px 0;content:"";transform:translateY(-1px) rotate(45deg) scale(0);transition:transform .12s ease-out}.pp-network-check input:checked,.pp-evaluation-set-option input:checked{border-color:hsl(var(--primary));background:hsl(var(--primary))}.pp-network-check input:checked:before,.pp-evaluation-set-option input:checked:before{transform:translateY(-1px) rotate(45deg) scale(1)}.pp-env-section{width:100%;padding-bottom:16px}.pp-env-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.pp-env-head .pp-config-label{display:flex;align-items:center;gap:7px;margin-bottom:0}.pp-env-count{display:inline-flex;align-items:center}.pp-env-table{display:flex;flex-direction:column;margin-top:10px}.pp-env-group{padding:4px 7px 0;border:1px solid hsl(var(--border) / .75);border-radius:6px;background:hsl(var(--secondary) / .16)}.pp-env-group-head{display:flex;align-items:center;justify-content:space-between;padding:5px 1px 3px;color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.pp-env-group-head small{color:hsl(var(--muted-foreground));font-size:11.5px;font-weight:450}.pp-env-group-head-custom{margin-top:12px}.pp-env-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 28px;align-items:center;gap:7px;padding:7px 0;border-bottom:1px solid hsl(var(--border) / .65)}.pp-env-row.is-multiline{align-items:start}.pp-env-row input:first-child{font-family:inherit;font-size:13px}.pp-env-row-derived:last-child{border-bottom:0}.pp-env-key-fixed{background:hsl(var(--secondary) / .32)!important;cursor:default}.pp-env-key-cell{min-width:0;min-height:34px;box-sizing:border-box;display:flex;align-items:center;gap:6px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:6px;color:hsl(var(--foreground));font-size:13px;font-weight:500}.pp-env-key-cell span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-env-help{position:relative;width:15px;height:15px;flex:0 0 15px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));cursor:default;font-size:10px;font-weight:650;line-height:1}.pp-env-help-popover{position:absolute;z-index:80;bottom:calc(100% + 8px);left:50%;width:max-content;max-width:min(320px,72vw);padding:7px 9px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 10px 28px hsl(var(--foreground) / .14);font-size:11.5px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;transform:translate(-50%);opacity:0;pointer-events:none;-webkit-user-select:text;user-select:text}.pp-env-help:hover .pp-env-help-popover,.pp-env-help:focus-visible .pp-env-help-popover,.pp-env-help:focus-within .pp-env-help-popover{opacity:1;pointer-events:auto}.pp-env-help:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.pp-env-value-wrap{min-width:0;display:grid;gap:4px}.pp-env-value{min-width:0;width:100%}.pp-env-json-value{min-height:86px;padding:8px 10px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.45}.pp-env-value[aria-invalid=true]{border-color:hsl(var(--destructive) / .7);box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.pp-env-error{color:hsl(var(--destructive));font-size:11.5px;line-height:1.35}.pp-env-link{width:22px;height:22px;flex:0 0 22px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;color:hsl(var(--muted-foreground));text-decoration:none}.pp-env-link:hover{background:hsl(var(--foreground) / .055);color:hsl(var(--foreground))}.pp-env-link svg{width:13px;height:13px;flex:0 0 13px}.pp-env-source{color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.pp-env-remove{width:28px;height:28px}.pp-env-add{width:100%;min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;font-weight:600;cursor:pointer}.pp-env-add:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--foreground) / .025);color:hsl(var(--foreground))}.pp-env-add:disabled{opacity:.5}.pp-steps{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none}.pp-step{position:relative;min-height:34px;display:flex;align-items:flex-start;gap:9px}.pp-step:not(:last-child):after{content:"";position:absolute;top:20px;bottom:-2px;left:9px;width:1px;background:hsl(var(--border))}.pp-step-dot{z-index:1;width:19px;height:19px;flex:0 0 19px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:50%;background:hsl(var(--panel));color:hsl(var(--muted-foreground));font-size:10px}.pp-step-body{min-width:0;display:flex;flex-direction:column;padding-top:1px}.pp-step-label{color:hsl(var(--muted-foreground));font-size:12.5px;font-weight:560}.pp-step-msg{max-width:300px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.pp-step.is-active .pp-step-dot{border-color:hsl(var(--primary));color:hsl(var(--primary))}.pp-step.is-done .pp-step-dot{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-step.is-failed .pp-step-dot{border-color:hsl(var(--destructive));background:hsl(var(--destructive));color:#fff}.pp-error{margin:14px 18px;padding:10px 11px;border:1px solid hsl(var(--destructive) / .22);border-radius:5px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px;line-height:1.5}.pp-deploy-result{margin:14px 18px 18px;padding:14px;border:1px solid hsl(var(--primary) / .2);border-radius:6px;background:hsl(var(--primary) / .035)}.pp-deploy-result-header{margin-bottom:12px;color:hsl(var(--foreground));font-size:13px;font-weight:650}.pp-deploy-result-body{display:flex;flex-direction:column;gap:10px}.pp-deploy-result-warning{display:flex;flex-direction:column;gap:4px;padding:9px 10px;border:1px solid hsl(42 90% 45% / .25);border-radius:6px;background:#f2ad0d12;color:#9e6310;font-size:12.5px;line-height:1.5}.pp-deploy-result-field{display:flex;flex-direction:column;gap:4px}.pp-deploy-result-field label{color:hsl(var(--muted-foreground));font-size:12.5px}.pp-deploy-result-field code{overflow-wrap:anywhere;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12.5px}.pp-deploy-result-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.pp-confirm-dialog{width:min(420px,calc(100vw - 40px));height:auto;min-height:0}.pp-confirm-head{flex-basis:60px}.pp-confirm-icon{background:#f59f0a1f;color:#ba6708}.pp-confirm-body{padding:24px 20px}.pp-confirm-body p{margin:0;color:hsl(var(--foreground));font-size:14px;line-height:1.65}.pp-confirm-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.pp-confirm-actions button{min-width:76px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.pp-confirm-actions button:hover{background:hsl(var(--secondary))}.pp-confirm-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.pp-confirm-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-confirm-actions .is-primary:hover{background:hsl(var(--primary) / .9)}.pp-deploy-result-btn,.pp-console-link-btn{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border-radius:5px;font-size:12.5px;font-weight:600;text-decoration:none;cursor:pointer}.pp-deploy-result-btn{border:1px solid hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.pp-console-link-btn{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.spin{animation:pp-spin .85s linear infinite}@keyframes pp-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.pp-channel-card-inner,.pp-channel-card-front,.pp-deployment-select-chevron,.pp-config-actions .pp-deploy{transition:none}}@media (max-width: 1120px){.pp-release-preview{grid-template-columns:minmax(320px,.9fr) minmax(300px,1.1fr)}.pp-sidebar{flex-basis:190px;width:190px}}@media (max-width: 860px){.layout{--pp-sidebar-width: 204px}.layout:has(.sidebar.is-collapsed){--pp-sidebar-width: 56px}.pp-root.is-deploy{--pp-publish-content-width: min(88%, calc(100% - 36px) )}.pp-toolbar{align-items:flex-start;flex-direction:column;gap:8px}.pp-toolbar-actions{width:100%}.pp-body{overflow-y:auto;flex-direction:column}.pp-root.is-deploy .pp-body{display:flex}.pp-release-overview{flex:0 0 auto;min-height:460px;border-right:0;border-bottom:0}.pp-release-preview{min-width:0;grid-template-columns:minmax(0,1fr);grid-template-rows:220px auto}.pp-release-info{min-height:200px}.pp-files-area{min-height:520px}.pp-config{width:100%;min-height:680px;border-top:0;border-left:0}.pp-config-scroll{padding-inline:0;padding-bottom:84px}.pp-config-actions{bottom:max(14px,env(safe-area-inset-bottom))}.pp-flow-backdrop{padding:12px}}@media (max-width: 520px){.pp-auth-fields,.pp-network-layout{grid-template-columns:minmax(0,1fr);gap:16px}.pp-env-section{width:100%}}.ic-root{display:flex;flex-direction:column;height:100%;min-height:0}.ic-body{flex:1;min-height:0;display:flex}.ic-chat{flex:0 0 380px;width:380px;min-width:0;display:flex;flex-direction:column;min-height:0;border-right:1px solid hsl(var(--border))}.ic-transcript{flex:1;min-height:0;overflow-y:auto;padding:24px 20px 12px}.ic-turn{display:flex;gap:10px;max-width:760px;margin:0 auto 16px}.ic-turn:last-child{margin-bottom:0}.ic-turn--assistant{justify-content:flex-start}.ic-turn--user{justify-content:flex-end}.ic-avatar{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:hsl(var(--secondary));color:#7c48f4}.ic-avatar-icon{width:17px;height:17px}.ic-bubble{max-width:78%;padding:11px 15px;border-radius:16px;font-size:14px;line-height:1.6;word-break:break-word}.ic-turn--user .ic-bubble{white-space:pre-wrap}.ic-turn--assistant .ic-bubble{background:hsl(var(--secondary));color:hsl(var(--foreground));border-top-left-radius:5px}.ic-turn--user .ic-bubble{background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-top-right-radius:5px}.ic-bubble .md>:first-child{margin-top:0}.ic-bubble .md>:last-child{margin-bottom:0}.ic-bubble--typing{display:inline-flex;align-items:center;gap:4px;padding:14px 16px}.ic-dot{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground));animation:ic-bounce 1.2s ease-in-out infinite}.ic-dot:nth-child(2){animation-delay:.16s}.ic-dot:nth-child(3){animation-delay:.32s}@keyframes ic-bounce{0%,60%,to{opacity:.35;transform:translateY(0)}30%{opacity:1;transform:translateY(-4px)}}.ic-error{flex-shrink:0;display:flex;align-items:center;gap:8px;max-width:760px;width:100%;margin:0 auto;padding:9px 14px;border-radius:10px;background:hsl(var(--destructive) / .1);color:hsl(var(--destructive));font-size:13px;line-height:1.45}.ic-error-icon{width:15px;height:15px;flex-shrink:0}.ic-composer{flex-shrink:0;max-width:760px;width:100%;margin:0 auto;padding:8px 20px 18px}.ic-composer-box{display:flex;align-items:flex-end;gap:6px;padding:6px 6px 6px 12px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background));transition:border-color .15s,box-shadow .15s}.ic-composer-box:focus-within{border-color:hsl(var(--ring) / .4);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.ic-input{flex:1;resize:none;border:none;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:15px;line-height:1.5;padding:8px 2px;max-height:160px;overflow-y:auto}.ic-input::placeholder{color:hsl(var(--muted-foreground))}.ic-input:disabled{opacity:.6}.ic-send{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:50%;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;transition:opacity .15s,transform .1s}.ic-send-icon{width:17px;height:17px}.ic-send:hover:not(:disabled){opacity:.85}.ic-send:active:not(:disabled){transform:scale(.94)}.ic-send:disabled{opacity:.3;cursor:default}.ic-composer-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:7px}.ic-composer-hint{flex:1;text-align:center;font-size:11px;color:hsl(var(--muted-foreground))}.ic-ab-toggle{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;cursor:pointer;-webkit-user-select:none;user-select:none}.ic-ab-checkbox{position:absolute;opacity:0;width:0;height:0}.ic-ab-track{position:relative;display:inline-block;width:30px;height:17px;border-radius:999px;background:hsl(var(--muted-foreground) / .35);transition:background .15s}.ic-ab-thumb{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:50%;background:#fff;box-shadow:0 1px 2px #0003;transition:transform .15s}.ic-ab-checkbox:checked+.ic-ab-track{background:hsl(var(--primary))}.ic-ab-checkbox:checked+.ic-ab-track .ic-ab-thumb{transform:translate(13px)}.ic-ab-checkbox:disabled+.ic-ab-track{opacity:.5}.ic-ab-checkbox:focus-visible+.ic-ab-track{box-shadow:0 0 0 3px hsl(var(--ring) / .25)}.ic-ab-label{font-size:12px;font-weight:600;color:hsl(var(--foreground))}.ic-compare{flex:1;min-height:0;display:flex}.ic-compare-divider{flex:0 0 1px;background:hsl(var(--border))}.ic-pane{flex:1 1 0;min-width:0;min-height:0;display:flex;flex-direction:column}.ic-pane-head{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background))}.ic-pane-title{display:flex;align-items:center;gap:8px;min-width:0}.ic-pane-tag{flex-shrink:0;font-size:12px;font-weight:700;padding:2px 9px;border-radius:999px;color:#fff}.ic-pane-tag--a{background:#7c48f4}.ic-pane-tag--b{background:#0da2e7}.ic-pane-model{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ic-adopt{flex-shrink:0;padding:6px 12px;border:none;border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));font-size:12px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.ic-adopt:hover:not(:disabled){opacity:.85}.ic-adopt:active:not(:disabled){transform:scale(.96)}.ic-adopt:disabled{opacity:.4;cursor:default}.ic-pane-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.ic-pane-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-size:13px;color:hsl(var(--muted-foreground))}.ic-pane-spinner{width:22px;height:22px;color:#7c48f4;animation:ic-spin .9s linear infinite}@keyframes ic-spin{to{transform:rotate(360deg)}}.ic-pane-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:13px;color:hsl(var(--muted-foreground))}.ic-preview{flex:1 1 0;min-width:0;display:flex;flex-direction:column;min-height:0;background:hsl(var(--muted) / .35)}.ic-preview-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px;text-align:center}.ic-preview-empty-icon{position:relative;display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:18px;background:#7c48f414;color:#7c48f4;margin-bottom:4px}.ic-preview-empty-glyph{width:30px;height:30px}.ic-preview-empty-spark{position:absolute;top:9px;right:9px;width:14px;height:14px}.ic-preview-empty-title{font-size:15px;font-weight:650;letter-spacing:-.01em;color:hsl(var(--foreground))}.ic-preview-empty-sub{font-size:13px;line-height:1.55;color:hsl(var(--muted-foreground));max-width:240px}@media (max-width: 920px){.ic-body{flex-direction:column}.ic-preview{width:100%;border-left:none;border-top:1px solid hsl(var(--border));min-height:320px}}@layer components{._Container_1tuad_1{position:relative;display:flex}._Container_1tuad_1[data-has-label]{align-items:flex-start}._Container_1tuad_1[data-orientation=right]{flex-direction:row-reverse}._Container_1tuad_1>input{right:0;bottom:0;left:0;height:1px!important;transform:none!important}._Checkbox_1tuad_22{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:18px;max-width:18px;height:18px;padding:0;border-radius:var(--radius-xs);background-color:transparent;cursor:pointer;transition:border-color .15s ease,background-color .15s ease}._Checkbox_1tuad_22,:where([data-theme=light]) ._Checkbox_1tuad_22{border:1px solid var(--gray-200)}:where([data-theme=dark]) ._Checkbox_1tuad_22{border:1px solid var(--gray-500)}[data-has-label] ._Checkbox_1tuad_22{top:1px}@media (hover: hover) and (pointer: fine){._Checkbox_1tuad_22:where(:not([data-disabled],[data-state=checked])):hover,:where([data-theme=light]) ._Checkbox_1tuad_22:where(:not([data-disabled],[data-state=checked])):hover{border-color:var(--gray-300)}:where([data-theme=dark]) ._Checkbox_1tuad_22:where(:not([data-disabled],[data-state=checked])):hover{border-color:var(--gray-600)}}._Checkbox_1tuad_22[data-state=indeterminate],._Checkbox_1tuad_22[data-state=checked]{border-color:var(--gray-900);background-color:var(--gray-900)}._Checkbox_1tuad_22:focus{outline:none}._Checkbox_1tuad_22:focus-visible{outline:2px solid var(--color-ring);outline-offset:2px}._Checkbox_1tuad_22[data-disabled]{cursor:not-allowed}._Checkbox_1tuad_22[data-disabled],:where([data-theme=light]) ._Checkbox_1tuad_22[data-disabled]{border-color:var(--gray-150);background:var(--gray-25)}:where([data-theme=dark]) ._Checkbox_1tuad_22[data-disabled]{border-color:var(--gray-300);background:var(--gray-200)}._Checkbox_1tuad_22[data-disabled][data-state=checked],:where([data-theme=light]) ._Checkbox_1tuad_22[data-disabled][data-state=checked]{border-color:var(--gray-300);background-color:var(--gray-300)}:where([data-theme=dark]) ._Checkbox_1tuad_22[data-disabled][data-state=checked]{border-color:var(--gray-200);background-color:var(--gray-200)}._CheckMark_1tuad_92{position:absolute;top:0;left:0;width:64%;height:32%;transform:rotate(-45deg) translate(-10%,100%);transform-origin:center;transition:opacity .15s ease,transform .15s ease}@starting-style{._CheckMark_1tuad_92{opacity:0}}[data-state=indeterminate] ._CheckMark_1tuad_92{transform:translate(30%,80%)}[data-state=indeterminate] ._CheckMark_1tuad_92:before{opacity:0}._CheckMark_1tuad_92:before,._CheckMark_1tuad_92:after{position:absolute;display:block;background:var(--gray-0);content:"";will-change:transform}@starting-style{._CheckMark_1tuad_92:before,._CheckMark_1tuad_92:after{transform:scale(0)}}:where([data-theme=dark]) ._CheckMark_1tuad_92[data-disabled]:before,:where([data-theme=dark]) ._CheckMark_1tuad_92[data-disabled]:after{background:var(--gray-100)}._CheckMark_1tuad_92:before{top:0;bottom:0;left:0;width:2px;transform-origin:0 0;transition:transform .1s ease 80ms,opacity .2s ease}._CheckMark_1tuad_92 [data-state=indeterminate]:before{opacity:0}._CheckMark_1tuad_92:after{right:0;bottom:0;left:0;height:2px;transform-origin:0 100%;transition:transform .1s ease .16s}._Label_1tuad_162{display:flex;align-items:center;min-height:20px;cursor:pointer;font-size:14px;line-height:20px}[data-disabled] ._Label_1tuad_162{cursor:not-allowed}[data-orientation=left] ._Label_1tuad_162{padding-left:8px}[data-orientation=right] ._Label_1tuad_162{padding-right:8px}}@layer components{._RadioGroup_onrfm_1{display:flex;gap:var(--radio-group-row-gap)}._RadioGroup_onrfm_1:where([data-direction=col]){flex-direction:column;gap:var(--radio-group-col-gap)}._RadioLabel_onrfm_9{display:inline-flex;flex-direction:row;align-items:flex-start;gap:var(--radio-group-item-gap);cursor:pointer;font-size:var(--radio-group-item-font-size);line-height:var(--radio-group-item-line-height)}._RadioLabel_onrfm_9[data-disabled]{cursor:not-allowed;opacity:.5}._RadioLabel_onrfm_9[data-block]{width:100%}._RadioIndicatorWrapper_onrfm_26{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;height:var(--radio-group-item-line-height)}._RadioIndicatorWrapper_onrfm_26>input{right:0;bottom:0;left:0;height:1px!important;transform:none!important}._RadioItem_onrfm_43{position:relative;display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--radio-group-indicator-size);height:var(--radio-group-indicator-size);padding:0;border:none;border-radius:var(--radius-full);background-color:transparent;box-shadow:0 0 0 1px var(--radio-group-indicator-border-color) inset;cursor:pointer;transition-duration:var(--transition-duration-basic);transition-property:box-shadow;transition-timing-function:var(--transition-ease-basic)}@media (hover: hover) and (pointer: fine){._RadioItem_onrfm_43:where(:not([data-disabled])):hover{box-shadow:0 0 0 1px var(--radio-group-indicator-border-color-hover) inset}}._RadioItem_onrfm_43[data-disabled]{cursor:not-allowed}._RadioItem_onrfm_43:focus{outline:none}._RadioItem_onrfm_43:focus-visible{outline:2px solid var(--color-ring);outline-offset:2px}._RadioIndicator_onrfm_26{position:relative;display:inline-grid;align-items:center;justify-content:center;width:100%;height:100%}._RadioIndicator_onrfm_26:before,._RadioIndicator_onrfm_26:after{display:block;content:"";grid-column-start:1;grid-row-start:1;place-self:center center;will-change:transform}._RadioIndicator_onrfm_26:before{width:var(--radio-group-indicator-size);height:var(--radio-group-indicator-size);border-radius:var(--radius-full);animation:_fade-in_onrfm_1 .6s var(--cubic-enter);background-color:var(--radio-group-indicator-background-color)}._RadioIndicator_onrfm_26:after{width:var(--radio-group-indicator-hole-size);height:var(--radio-group-indicator-hole-size);border-radius:var(--radius-full);animation:_scale-in_onrfm_1 .6s var(--cubic-enter);background-color:var(--radio-group-indicator-hole-background-color)}@keyframes _scale-in_onrfm_1{0%{transform:scale(0)}to{transform:scale(1)}}@keyframes _fade-in_onrfm_1{0%{opacity:0}to{opacity:1}}}.cw-root{--cw-workspace-gutter: 10px;--cw-workspace-width: 60%;--cw-workbench-toolbar-height: 64px;--cw-workspace-ink: 222 24% 13%;--cw-workspace-accent: 162 44% 32%;--cw-workspace-accent-soft: 156 34% 92%;--cw-workspace-warm: 42 28% 96%;flex:1;min-height:0;display:flex;flex-direction:column;height:100%;color:hsl(var(--foreground));background:hsl(var(--background))}.cw-root.is-validate{--cw-workspace-width: min(88%, 1440px)}.cw-root.is-publish{--cw-workspace-width: min(80%, 1180px)}.cw-workspace-header{position:relative;z-index:12;flex:0 0 auto;width:var(--cw-workspace-width);min-height:48px;display:flex;justify-content:center;align-items:center;margin:12px auto 0;padding:8px 0;background:transparent}.cw-workspace-header h1{margin:0;color:hsl(var(--foreground));font-size:22px;font-weight:700;line-height:1.25;letter-spacing:-.02em;white-space:nowrap}.cw-workspace-main{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;width:var(--cw-workspace-width);margin:0 auto;padding:8px 0 20px;background:transparent}.cw-workspace-footer{flex:0 0 auto;display:flex;flex-direction:column;width:var(--cw-workspace-width);gap:12px;margin:0 auto 24px;padding:12px 0 4px;background:transparent}.cw-workspace-nav-actions{width:100%;display:grid;grid-template-columns:minmax(120px,1fr) auto minmax(120px,1fr);align-items:center;gap:12px;margin:0 auto}.cw-workspace-nav-actions.has-assistant{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"assistant next"}.cw-workspace-nav-actions.has-assistant>.cw-workspace-nav-button:first-child,.cw-workspace-nav-actions.has-assistant>span[aria-hidden=true]{display:none}.cw-workspace-nav-actions.has-assistant>.cw-workspace-ai-slot{grid-area:assistant}.cw-publish-action-slot{grid-column:3;display:flex;justify-content:flex-end}.cw-publish-action-slot .pp-deploy{position:static;min-width:70px;min-height:38px;transform:none}.cw-workspace-nav-actions.has-assistant>.cw-workspace-nav-button:last-child{grid-area:next}.cw-workspace-ai-slot{min-width:0}.cw-workspace-nav-button{min-height:36px;justify-self:start;padding:0 18px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:background-color .16s ease,border-color .16s ease}.cw-workspace-nav-button:last-child{justify-self:end}.cw-workspace-nav-button:hover:not(:disabled){border-color:hsl(var(--foreground) / .22);background:hsl(var(--muted) / .55)}.cw-workspace-nav-button.is-primary{border-color:hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.cw-workspace-nav-button.is-primary:hover:not(:disabled){border-color:hsl(var(--foreground) / .86);background:hsl(var(--foreground) / .86)}.cw-workspace-nav-button:focus-visible,.cw-workspace-progress button:focus-visible{outline:2px solid hsl(var(--primary) / .35);outline-offset:2px}.cw-workspace-nav-button:disabled{cursor:not-allowed;opacity:.5}.cw-workspace-nav-button.is-placeholder{visibility:hidden;pointer-events:none}.cw-workspace-progress{width:min(132px,40vw);display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0 auto}.cw-workspace-progress button{height:12px;padding:4px 0;border:0;background:transparent;cursor:pointer}.cw-workspace-progress button>span{display:block;height:3px;border-radius:999px;background:hsl(var(--muted-foreground) / .16);transition:background-color .16s ease}.cw-workspace-progress button.is-complete>span,.cw-workspace-progress button.is-active>span{background:hsl(var(--foreground) / .46)}.cw-workspace-progress button.is-active>span{height:4px}.cw-workspace-progress button:disabled{cursor:not-allowed}@media (prefers-reduced-motion: reduce){.cw-workspace-nav-button,.cw-workspace-progress button>span{transition:none}}.cw-build-workspace{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}.cw-ai-compose{min-width:0}.cw-ai-compose-entry{min-width:0;display:grid;gap:6px}.cw-ai-compose-form{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;padding:4px 4px 4px 16px;border-radius:16px;background:hsl(var(--panel));box-shadow:inset 0 0 0 1px hsl(var(--border) / .7),0 8px 24px hsl(var(--foreground) / .05);transition:background-color .18s ease,box-shadow .18s ease}.cw-ai-compose.is-generating .cw-ai-compose-form{background:hsl(var(--muted) / .7);box-shadow:inset 0 0 0 1px hsl(var(--foreground) / .05)}.cw-ai-compose-form input{min-width:0;height:38px;min-height:38px;padding:6px 0;border:0;outline:none;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:13px;line-height:20px}.cw-ai-compose-form input::placeholder{color:hsl(var(--muted-foreground) / .72)}.cw-ai-compose-form:has(input:focus-visible){background:hsl(var(--background));box-shadow:0 0 0 2px hsl(var(--ring) / .12),inset 0 0 0 1px hsl(var(--ring) / .24)}.cw-ai-compose-form input:focus,.cw-ai-compose-form input:focus-visible{outline:none;box-shadow:none}.cw-ai-compose.is-generating .cw-ai-compose-form input{color:hsl(var(--muted-foreground) / .78);cursor:wait}.cw-ai-compose-form button{height:38px;min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 16px;border:0;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:650;white-space:nowrap;transition:background-color .15s ease,opacity .15s ease}.cw-ai-compose-form button:hover:not(:disabled){background:hsl(var(--foreground) / .86)}.cw-ai-compose-form button:disabled{cursor:not-allowed;opacity:.34}.cw-ai-requirement-error{margin:0;padding:0 16px;color:hsl(var(--destructive));font-size:12px;line-height:18px}.cw-ai-compose.is-generating .cw-ai-compose-form button:disabled{width:34px;padding:0;background:hsl(var(--foreground));opacity:1}.cw-ai-orb{width:14px;height:14px;display:block;border:1.5px solid hsl(var(--background) / .34);border-top-color:hsl(var(--background));border-radius:50%;animation:cw-ai-orb-spin .72s linear infinite}.cw-ai-orb>span{display:none}@keyframes cw-ai-orb-spin{to{transform:rotate(360deg)}}.cw-ai-compose-success{min-height:38px;display:flex;align-items:center;justify-content:flex-end;gap:7px;padding:2px 3px 2px 10px;border-radius:12px;background:hsl(var(--background) / .7);box-shadow:inset 0 0 0 1px hsl(var(--foreground) / .055);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.cw-ai-compose-success strong{color:hsl(var(--foreground));font-size:12.5px;font-weight:650}.cw-ai-success-check{position:relative;width:18px;height:18px;flex:0 0 18px;border-radius:50%;background:hsl(var(--foreground))}.cw-ai-success-check:after{position:absolute;top:3px;left:6px;width:4px;height:7px;border:solid hsl(var(--background));border-width:0 2px 2px 0;content:"";transform:rotate(45deg)}.cw-ai-regenerate{height:34px;min-height:34px;padding:0 12px;border:0;border-radius:9px;background:hsl(var(--muted));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:620;transition:background-color .15s ease}.cw-ai-regenerate:hover{background:hsl(var(--muted-foreground) / .12)}.cw-ai-compose-form button:focus-visible,.cw-ai-regenerate:focus-visible{outline:2px solid hsl(var(--primary) / .35);outline-offset:2px}@media (prefers-reduced-motion: reduce){.cw-ai-compose-form,.cw-ai-compose-form button,.cw-ai-regenerate{transition:none}.cw-ai-orb{animation:none}}.cw-ai-error-dialog{width:460px;font-family:inherit}.cw-ai-error-message{max-height:min(320px,50vh);margin:10px 0 18px;overflow:auto;color:hsl(var(--foreground) / .78);font-family:inherit;font-size:13px;line-height:1.65;overflow-wrap:anywhere;white-space:pre-wrap}.cw-ai-error-close{border-color:transparent;background:hsl(var(--foreground));color:hsl(var(--background))}.cw-ai-error-close:hover{background:hsl(var(--foreground) / .86)}.cw-workspace-alert{position:absolute;z-index:30;top:94px;right:18px;max-width:min(420px,calc(100% - 36px));padding:10px 13px;border:1px solid hsl(var(--destructive) / .2);border-radius:9px;background:hsl(var(--background));box-shadow:0 12px 36px hsl(var(--foreground) / .12);color:hsl(var(--destructive));font-size:12.5px}.cw-editor{flex:1;width:100%;min-height:0;display:flex;flex-direction:column;align-items:stretch;gap:14px;padding:0;overflow:hidden}.cw-editor>.abc-root{flex:0 0 200px;width:100%;min-width:0;min-height:200px;overflow:hidden;border-radius:12px;background:hsl(var(--background));box-shadow:none}.cw-tree{flex-shrink:0;width:248px;overflow-y:auto;padding:16px 14px;border-right:1px solid hsl(var(--border));background:hsl(var(--panel))}.cw-tree-head{font-size:12px;font-weight:650;letter-spacing:.02em;color:hsl(var(--muted-foreground));padding:0 6px;margin-bottom:10px}.cw-tree-branch{display:flex;flex-direction:column}.cw-tree-node{position:relative;display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:13px;border:1px solid transparent;transition:background .12s ease,border-color .12s ease}.cw-tree-node:hover{background:hsl(var(--accent))}.cw-tree-node.is-selected{background:hsl(var(--primary) / .04);border-color:hsl(var(--primary) / .16)}.cw-tree-node.is-invalid{background:hsl(var(--destructive) / .07);border-color:hsl(var(--destructive) / .5)}.cw-tree-node.is-invalid.is-selected{background:hsl(var(--destructive) / .1);border-color:hsl(var(--destructive) / .6)}.cw-tree-node.is-draggable{cursor:grab}.cw-tree-node.is-draggable:active{cursor:grabbing}.cw-tree-node.is-dragover{background:hsl(var(--primary) / .1);border-color:hsl(var(--primary) / .45)}.cw-tree-icon{width:15px;height:15px;flex-shrink:0;opacity:.8}.cw-tree-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.cw-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:550}.cw-tree-type{font-size:11px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:hsl(var(--muted-foreground))}.cw-tree-actions{display:flex;align-items:center;gap:1px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .12s ease}.cw-tree-node:hover .cw-tree-actions,.cw-tree-node.is-selected .cw-tree-actions{opacity:1;pointer-events:auto}.cw-tree-children{display:flex;flex-direction:column;gap:2px;margin-top:2px;margin-left:8px;padding-left:8px;border-left:1px solid hsl(var(--border))}.cw-detail{position:relative;flex:1 1 auto;width:100%;max-width:none;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-radius:12px;background:hsl(var(--background));box-shadow:none}.cw-detail-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable;padding:0 4px 16px;background:hsl(var(--background))}.cw-detail-inner{max-width:none;margin:0 auto}.cw-lower{display:flex;gap:0;align-items:flex-start}.cw-detail .cw-form-col{flex:1;min-width:0;max-width:none;margin:0}.cw-debug{flex-shrink:0;width:380px;min-height:0;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid hsl(var(--border));background:hsl(var(--panel));transition:width .22s cubic-bezier(.22,1,.36,1),min-width .22s cubic-bezier(.22,1,.36,1),height .22s cubic-bezier(.22,1,.36,1),min-height .22s cubic-bezier(.22,1,.36,1),flex-basis .22s cubic-bezier(.22,1,.36,1),padding .18s ease}.cw-debug:not(.is-collapsed)>*{animation:cw-debug-content-in .18s ease-out both}.cw-debug.is-collapsed .cw-debug-expand{animation:cw-debug-control-in .18s .06s ease-out both}@keyframes cw-debug-content-in{0%{opacity:0;transform:scale(.985)}}@keyframes cw-debug-control-in{0%{opacity:0;transform:scale(.9)}}@media (prefers-reduced-motion: reduce){.cw-debug{transition:none}.cw-debug:not(.is-collapsed)>*,.cw-debug.is-collapsed .cw-debug-expand{animation:none}}.cw-debug-head{flex-shrink:0;height:var(--cw-workbench-toolbar-height);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid hsl(var(--border))}.cw-debug-collapse,.cw-debug-expand{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .12s,background .12s,transform .12s}.cw-debug-collapse{width:24px;height:24px}.cw-debug-collapse:hover,.cw-debug-expand:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.cw-debug-expand:hover{transform:scale(1.06)}.cw-debug.is-collapsed{width:48px;min-width:48px;height:100%;min-height:0;align-items:center;padding-top:14px}.cw-debug-expand{width:34px;height:34px;min-height:34px}.cw-debug-title{display:inline-flex;align-items:center;gap:7px;font-size:17px;font-weight:650;color:hsl(var(--foreground))}.cw-debug-start{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:6px 10px;border:none;border-radius:8px;background:#111;box-shadow:none;color:#fff;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background-color .18s cubic-bezier(.22,1,.36,1),box-shadow .18s ease,transform .15s ease}.cw-debug-start:hover:not(:disabled){background:#29292b;box-shadow:0 7px 18px #00000029}.cw-debug-start:active:not(:disabled){transform:translateY(0) scale(.98)}.cw-debug-start:disabled{opacity:.45;cursor:default}.cw-debug-sub{flex-shrink:0;display:flex;flex-direction:column;gap:3px;padding:10px 16px 14px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.cw-debug-stage{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.cw-debug-body{flex:1;min-height:0;overflow-y:auto;padding:10px 16px 18px}.cw-debug-empty{min-height:120px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:14px;border:1px dashed hsl(var(--border));border-radius:10px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-run-icon{width:17px;height:17px;transition:transform .16s cubic-bezier(.22,1,.36,1)}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:translate(1.5px)}@media (prefers-reduced-motion: reduce){.cw-debug-run-icon{transition:none}.cw-debug-start:hover:not(:disabled) .cw-debug-run-icon{transform:none}}.cw-debug-progress{display:flex;flex-direction:column;gap:8px}.cw-debug-logline{display:flex;align-items:center;gap:8px;min-height:28px;padding:7px 9px;border-radius:9px;background:hsl(var(--foreground) / .04);color:hsl(var(--muted-foreground));font-size:12.5px}.cw-debug-logline .cw-i{color:hsl(var(--foreground))}.cw-debug-error{display:flex;flex-direction:column;gap:12px;color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-debug-error-detail,.cw-debug-msg-error{width:100%;min-width:0;color:hsl(var(--destructive));text-align:left}.cw-debug-error-detail .deploy-error-message-text,.cw-debug-msg-error .deploy-error-message-text{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:12px}.cw-debug-chat{min-height:100%;display:flex;flex-direction:column;gap:18px}.cw-debug-chat-empty{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6;text-align:center}.cw-debug-msg{display:flex;flex-direction:column;gap:6px;max-width:100%}.cw-debug-msg-user{align-items:flex-end}.cw-debug-msg-assistant{align-items:flex-start}.cw-debug-role{display:none}.cw-debug-content{max-width:100%;color:hsl(var(--foreground));font-size:14px;line-height:1.65;word-break:break-word}.cw-debug-msg-user .cw-debug-content{max-width:88%;padding:9px 14px;border-radius:18px;background:hsl(var(--secondary))}.cw-debug-msg-assistant .cw-debug-content{width:100%}.cw-debug-composer{flex-shrink:0;padding:10px 14px 14px;background:hsl(var(--panel))}.cw-debug-composerbox{display:flex;align-items:center;gap:6px;padding:6px 6px 6px 10px;border:1px solid hsl(var(--border));border-radius:24px;background:hsl(var(--background))}.cw-debug-input{flex:1;min-width:0;max-height:120px;padding:8px 4px;border:none;outline:none;resize:none;overflow-y:auto;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.5}.cw-debug-input::placeholder{color:hsl(var(--muted-foreground))}.cw-debug-send{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;border-radius:50%;cursor:pointer;transition:opacity .15s,transform .1s,background .12s,color .12s}.cw-debug-send{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-debug-send:hover:not(:disabled){opacity:.85}.cw-debug-send:active:not(:disabled){transform:scale(.94)}.cw-debug-send:disabled{opacity:.3;cursor:default}.cw-debug-overlay{position:absolute;z-index:5;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:22px;background:hsl(var(--panel) / .5);backdrop-filter:blur(9px) saturate(.9);-webkit-backdrop-filter:blur(9px) saturate(.9)}.cw-debug-overlay-content{width:min(100%,290px);display:flex;flex-direction:column;align-items:center;gap:10px;padding:18px;border:1px solid hsl(var(--border) / .72);border-radius:12px;background:hsl(var(--background) / .82);box-shadow:0 10px 30px hsl(var(--foreground) / .08);text-align:center}.cw-debug-overlay-title{color:hsl(var(--foreground));font-size:14px;font-weight:650}.cw-debug-overlay-copy{color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.55}.cw-debug-overlay-progress{width:100%;display:flex;flex-direction:column;gap:8px}.cw-debug-overlay-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:2px}.cw-debug-ignore{min-height:30px;padding:6px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:background .12s,border-color .12s,transform .1s}.cw-debug-ignore:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.cw-debug-ignore:active:not(:disabled){transform:scale(.96)}.cw-debug-ignore:disabled{opacity:.45;cursor:default}.cw-validation-workspace{position:relative;flex:1;min-width:0;min-height:0;display:flex;background:hsl(var(--background))}.cw-optimization-panel{min-width:0;min-height:0;display:flex;flex-direction:column;padding:22px 16px 16px;border-right:1px solid hsl(var(--border));background:hsl(var(--cw-workspace-warm))}.cw-optimization-head{display:flex;flex-direction:column;gap:5px;padding:0 4px 18px}.cw-optimization-head>span{color:hsl(var(--cw-workspace-ink));font-size:16px;font-weight:700;letter-spacing:-.02em}.cw-optimization-head>small{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45}.cw-optimization-list{display:flex;flex-direction:column;gap:8px}.cw-optimization-option{position:relative;width:100%;display:flex;align-items:flex-start;gap:9px;padding:11px;border:1px solid hsl(var(--border) / .82);border-radius:11px;background:hsl(var(--panel) / .62);color:hsl(var(--foreground));cursor:pointer;transition:background-color .14s ease,border-color .14s ease,box-shadow .14s ease}.cw-optimization-option:hover{border-color:hsl(var(--cw-workspace-ink) / .24);background:hsl(var(--panel))}.cw-optimization-option.is-disabled{cursor:not-allowed;opacity:.62}.cw-optimization-option.is-disabled:hover{border-color:hsl(var(--border) / .82);background:hsl(var(--panel) / .62)}.cw-optimization-option:has(input:focus-visible){outline:2px solid hsl(var(--cw-workspace-ink) / .34);outline-offset:2px}.cw-optimization-option input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}.cw-optimization-check{width:17px;height:17px;flex:0 0 17px;display:inline-flex;align-items:center;justify-content:center;margin-top:1px;border:1px solid hsl(var(--foreground) / .24);border-radius:5px;background:hsl(var(--panel));color:#fff}.cw-optimization-check .cw-i{width:11px;height:11px;stroke-width:2.4}.cw-optimization-copy{min-width:0;display:flex;flex-direction:column;gap:4px}.cw-optimization-copy strong{color:hsl(var(--cw-workspace-ink));font-size:12.5px;font-weight:650}.cw-optimization-copy small{color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.45}.cw-validation-content{flex:1;min-width:0;min-height:0;display:flex;overflow:hidden;background:hsl(var(--background))}.cw-ab-workspace{flex:1;min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden;background:hsl(var(--background))}.cw-ab-stage{position:relative;flex:1;min-width:0;min-height:0;overflow-x:hidden;overflow-y:auto;padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{min-height:100%;display:grid;grid-template-columns:repeat(var(--cw-ab-column-count),minmax(0,1fr));grid-auto-rows:minmax(420px,1fr);align-items:stretch;gap:12px}.cw-ab-card{min-width:0;min-height:420px;display:flex;flex-direction:column;perspective:1400px}.cw-ab-card-inner{position:relative;width:100%;min-height:420px;flex:1;transform-style:preserve-3d;transition:transform .44s cubic-bezier(.22,1,.36,1)}.cw-ab-card-inner.is-flipped{transform:rotateY(180deg)}.cw-ab-card-face{position:absolute;top:0;right:0;bottom:0;left:0;min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px dashed hsl(var(--foreground) / .2);border-radius:16px;background:hsl(var(--background));backface-visibility:hidden;-webkit-backface-visibility:hidden;transition:border-color .16s ease,background-color .16s ease}.cw-ab-card-back{transform:rotateY(180deg);overflow-x:hidden;overflow-y:auto}.cw-ab-card-head{min-height:54px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px 9px 14px}.cw-ab-card-title{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ab-card-title strong{font-size:13.5px;font-weight:680}.cw-ab-card-title span{max-width:150px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-ab-card-actions{flex:0 0 auto;display:flex;align-items:center;gap:4px}.cw-ab-config-trigger,.cw-ab-remove{min-height:28px;display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:0 8px;border:0;border-radius:7px;background:hsl(var(--secondary) / .58);color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11px;font-weight:400}.cw-ab-config-trigger{background:transparent;color:hsl(var(--muted-foreground))}.cw-ab-config-trigger:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-remove:hover{background:hsl(var(--secondary) / .62);color:hsl(var(--foreground))}.cw-ab-config-trigger:disabled,.cw-ab-remove:disabled{cursor:default;opacity:.45}.cw-ab-remove{width:28px;padding:0;background:transparent}.cw-ab-config-head{min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 10px;background:hsl(var(--background) / .94)}.cw-ab-config-head>div{min-width:0;display:flex;flex-direction:column;gap:3px}.cw-ab-config-head strong{font-size:16px;font-weight:680}.cw-ab-config-head span{color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-config-head>.cw-ab-config-head-actions{flex:0 0 auto;display:inline-flex;flex-direction:row;align-items:center;gap:6px}.cw-ab-config-head-actions .cw-ab-config-remove{width:32px;height:32px}.cw-ab-config-done{min-height:32px;padding:0 11px;border:0;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));cursor:pointer;font:inherit;font-size:12px;font-weight:650}.cw-ab-config-done-wrap{position:relative;flex:0 0 auto;display:inline-flex;border-radius:8px}.cw-ab-config-done:disabled{background:hsl(var(--secondary) / .82);color:hsl(var(--muted-foreground) / .68);cursor:not-allowed}.cw-ab-config-head .cw-ab-config-done-tip{position:absolute;z-index:8;right:0;top:calc(100% + 7px);bottom:auto;width:max-content;max-width:190px;padding:6px 8px;border-radius:7px;background:hsl(var(--foreground));color:#fff;font-size:11px;font-weight:400;line-height:1.4;opacity:0;pointer-events:none;transform:translateY(3px);transition:opacity .14s ease,transform .14s ease}.cw-ab-config-done-wrap.is-disabled:hover .cw-ab-config-done-tip,.cw-ab-config-done-wrap.is-disabled:focus-visible .cw-ab-config-done-tip{opacity:1;transform:translateY(0)}.cw-ab-config-done-wrap:focus-visible{outline:2px solid hsl(var(--foreground) / .18);outline-offset:2px}.cw-ab-config{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr);align-content:start;gap:12px;padding:12px 16px 16px;background:hsl(var(--background))}.cw-ab-config>label,.cw-ab-config fieldset{min-width:0;display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0}.cw-ab-config>label>span,.cw-ab-config legend{color:hsl(var(--muted-foreground));font-size:13px;font-weight:650}.cw-ab-config legend{width:100%;display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-ab-config legend em{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10.5px;font-style:normal;font-weight:550}.cw-ab-config input[type=text],.cw-ab-config>label>input,.cw-ab-config>label>textarea{width:100%;min-height:40px;padding:8px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px}.cw-ab-config>label>textarea{min-height:58px;max-height:132px;resize:vertical;line-height:1.55}.cw-ab-optimization-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cw-ab-optimization-checkbox{display:inline-flex;align-items:center;gap:0;padding:8px 9px;border-radius:8px;background:hsl(var(--background) / .82);color:hsl(var(--foreground));font-size:12.5px;cursor:not-allowed;opacity:.5}.cw-ab-optimization-checkbox>label{padding-left:7px;color:inherit;font-size:inherit}.cw-ab-config>p{margin:0;color:hsl(var(--muted-foreground));font-size:12.5px;line-height:1.5}.cw-ab-conversation{flex:1;min-height:0;overflow-y:auto;padding:14px}.cw-ab-empty{height:100%;min-height:210px;display:grid;place-items:center;color:hsl(var(--muted-foreground));font-size:12px}.cw-ab-launch{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;text-align:center}.cw-ab-launch-hint{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-ab-ready-title{color:hsl(var(--foreground));font-size:20px;font-weight:760;line-height:1.1}.cw-ab-starting{align-content:center;gap:8px}.cw-ab-starting .cw-i{width:18px;height:18px}.cw-ab-start{min-width:118px;min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 13px;border:0;border-radius:9px;background:hsl(var(--secondary) / .72);color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:580;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-start:hover:not(:disabled){background:hsl(var(--secondary));box-shadow:none}.cw-ab-start:disabled{background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground) / .62);cursor:not-allowed}.cw-ab-start .cw-i{width:15px;height:15px}.cw-ab-deploy-footer{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:0 12px 12px}.cw-ab-trace{min-height:32px;margin-right:auto;padding:0 10px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:11.5px;font-weight:500;transition:background-color .16s ease,color .16s ease}.cw-ab-trace:hover:not(:disabled){background:hsl(var(--secondary) / .58);color:hsl(var(--foreground))}.cw-ab-trace:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-ab-trace:disabled{color:hsl(var(--muted-foreground) / .48);cursor:not-allowed}.cw-ab-footer-start{min-width:0;background:hsl(var(--secondary) / .58)}.cw-ab-deploy{min-height:32px;padding:0 13px;border:0;border-radius:8px;background:#111;color:#fff;cursor:pointer;font:inherit;font-size:11.5px;font-weight:620;transition:background-color .16s ease,box-shadow .16s ease}.cw-ab-deploy:hover:not(:disabled){background:#29292b;box-shadow:0 6px 16px #00000024}.cw-ab-deploy:disabled{cursor:not-allowed;opacity:.42}.cw-ab-add{min-height:48px;align-self:stretch;justify-content:center;padding-inline:18px;white-space:nowrap}.cw-ab-composer{position:relative;z-index:2;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch;gap:12px;padding:18px var(--cw-workspace-gutter) 18px;background:hsl(var(--background))}.cw-ab-composer .cw-debug-composerbox{width:100%;min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;background:#fff;box-shadow:0 8px 22px hsl(var(--foreground) / .045)}.cw-ab-composer .cw-debug-input{background:#fff}.cw-debug.is-standalone{flex:1;width:100%;min-width:0;border-left:0;background:transparent}.cw-debug.is-standalone .cw-debug-head{height:58px;padding-inline:22px;background:hsl(var(--panel) / .7)}.cw-debug.is-standalone .cw-debug-title{font-size:15px}.cw-debug.is-standalone .cw-debug-body{padding:22px clamp(18px,5vw,72px) 28px}.cw-debug.is-standalone .cw-debug-chat{width:min(100%,840px);margin:0 auto}.cw-debug.is-standalone .cw-debug-chat-empty{min-height:260px;border:1px dashed hsl(var(--border));border-radius:16px;background:hsl(var(--panel) / .56)}.cw-debug.is-standalone .cw-debug-composer{padding:12px 210px 20px clamp(18px,5vw,72px);background:transparent}.cw-debug.is-standalone .cw-debug-composerbox{width:min(100%,840px);min-height:48px;margin:0 auto;border-color:hsl(var(--foreground) / .14);border-radius:14px;box-shadow:0 12px 32px hsl(var(--foreground) / .06)}.cw-debug.is-standalone .cw-debug-overlay{background:hsl(var(--background) / .68)}.cw-debug.is-standalone .cw-debug-overlay-content{width:min(100%,390px);padding:28px;border-radius:16px}.cw-validation-prototype{flex:1;min-width:0;min-height:0;overflow-y:auto;padding:clamp(26px,4vw,56px)}.cw-validation-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin:0 auto 28px;max-width:1040px}.cw-eyebrow{color:hsl(var(--cw-workspace-accent));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10px;font-weight:700;letter-spacing:.15em}.cw-validation-page-head h2{margin:5px 0 4px;color:hsl(var(--cw-workspace-ink));font-size:clamp(24px,3vw,34px);font-weight:720;letter-spacing:-.045em}.cw-validation-page-head p{margin:0;color:hsl(var(--muted-foreground));font-size:13px}.cw-prototype-action{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 14px;border:1px solid hsl(var(--cw-workspace-ink));border-radius:8px;background:hsl(var(--cw-workspace-ink));color:hsl(var(--background));font:inherit;font-size:12px;font-weight:650}.cw-prototype-action:disabled{cursor:not-allowed;opacity:.72}.cw-dataset-summary,.cw-variant-grid,.cw-metric-board,.cw-prototype-table,.cw-run-list,.cw-prototype-note{width:min(100%,1040px);margin-inline:auto}.cw-dataset-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 10px 32px hsl(var(--foreground) / .035)}.cw-dataset-summary>div{display:flex;flex-direction:column;gap:4px;padding:17px 20px}.cw-dataset-summary>div+div{border-left:1px solid hsl(var(--border))}.cw-dataset-summary strong{color:hsl(var(--cw-workspace-ink));font-size:22px;letter-spacing:-.04em}.cw-dataset-summary span{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-table{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-prototype-row{min-height:54px;display:grid;grid-template-columns:minmax(180px,1.3fr) minmax(100px,.7fr) minmax(170px,1fr) 82px;align-items:center;gap:16px;padding:10px 16px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11.5px}.cw-prototype-row.is-head{min-height:38px;border-top:0;background:hsl(var(--secondary) / .42);color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.04em;text-transform:uppercase}.cw-prototype-row>strong{color:hsl(var(--foreground));font-size:12px;font-weight:600}.cw-status-pill,.cw-run-status,.cw-run-kind{justify-self:start;padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground));font-size:10px;font-weight:600}.cw-variant-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:14px}.cw-variant-card{position:relative;overflow:hidden;padding:20px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--panel));box-shadow:0 12px 34px hsl(var(--foreground) / .04)}.cw-variant-card:before{content:"";position:absolute;top:0;left:0;width:100%;height:3px;background:hsl(var(--foreground) / .22)}.cw-variant-card.is-candidate:before{background:hsl(var(--cw-workspace-accent))}.cw-variant-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:28px;color:hsl(var(--muted-foreground));font-size:10px;font-weight:650;letter-spacing:.06em;text-transform:uppercase}.cw-variant-head small{padding:3px 7px;border-radius:999px;background:hsl(var(--secondary));font-size:9.5px;letter-spacing:0;text-transform:none}.cw-variant-card>strong{color:hsl(var(--cw-workspace-ink));font-size:17px;letter-spacing:-.025em}.cw-variant-card>p{min-height:42px;margin:7px 0 22px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.6}.cw-variant-card dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.cw-variant-card dl>div{padding:9px 10px;border-radius:8px;background:hsl(var(--secondary) / .5)}.cw-variant-card dt{color:hsl(var(--muted-foreground));font-size:9.5px}.cw-variant-card dd{margin:3px 0 0;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:10.5px}.cw-metric-board{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-metric-head,.cw-metric-row{display:grid;grid-template-columns:minmax(170px,1fr) 100px 100px 88px;align-items:center;gap:12px;padding:11px 16px}.cw-metric-head{grid-template-columns:auto auto minmax(0,1fr);min-height:48px;border-bottom:1px solid hsl(var(--border))}.cw-metric-head .cw-i{width:15px;color:hsl(var(--cw-workspace-accent))}.cw-metric-head strong{font-size:12px}.cw-metric-head span{justify-self:end;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-metric-row{min-height:44px;color:hsl(var(--muted-foreground));font-size:11px}.cw-metric-row+.cw-metric-row{border-top:1px solid hsl(var(--border) / .7)}.cw-metric-row strong{color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px}.cw-metric-row em{color:hsl(var(--cw-workspace-accent));font-size:10.5px;font-style:normal;font-weight:650}.cw-run-list{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.cw-run-row{min-height:72px;display:grid;grid-template-columns:36px minmax(220px,1fr) 70px 110px 72px;align-items:center;gap:12px;padding:11px 16px}.cw-run-row+.cw-run-row{border-top:1px solid hsl(var(--border))}.cw-run-icon{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-run-icon .cw-i{width:14px;height:14px}.cw-run-row>div{min-width:0}.cw-run-row strong{color:hsl(var(--foreground));font-size:12px}.cw-run-row p{margin:3px 0 0;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;text-overflow:ellipsis;white-space:nowrap}.cw-run-row time{color:hsl(var(--muted-foreground));font-size:10.5px}.cw-run-status.is-running{background:hsl(var(--cw-workspace-accent-soft));color:hsl(var(--cw-workspace-accent))}.cw-prototype-note{display:flex;align-items:center;gap:7px;margin-top:14px;color:hsl(var(--muted-foreground));font-size:10.5px}.cw-prototype-note .cw-i{width:13px;height:13px}.cw-publish-loading{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;color:hsl(var(--muted-foreground));font-size:12px}.cw-publish-loading .cw-i{width:22px;height:22px;margin-bottom:5px;color:hsl(var(--cw-workspace-accent))}.cw-publish-loading strong{color:hsl(var(--foreground));font-size:14px}.cw-header{flex-shrink:0;display:flex;align-items:flex-start;gap:16px;padding:18px 24px 16px;border-bottom:1px solid hsl(var(--border))}.cw-header-title{flex:1;min-width:0}.cw-header-mode{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;letter-spacing:.02em;text-transform:uppercase;color:hsl(var(--muted-foreground))}.cw-title{margin:5px 0 2px;font-size:21px;font-weight:650;letter-spacing:-.02em}.cw-subtitle{margin:0;font-size:13px;color:hsl(var(--muted-foreground))}.cw-progress-pill{flex-shrink:0;margin-top:2px;padding:5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12px;font-weight:600;font-variant-numeric:tabular-nums}.cw-body{flex:1;min-height:0;overflow-y:auto}.cw-center{display:flex;align-items:flex-start;justify-content:center;gap:32px;max-width:960px;margin:0 auto;padding:32px 24px 80px}.cw-form-col{flex:1 1 auto;min-width:0;max-width:640px;display:flex;flex-direction:column;gap:12px}.cw-section{scroll-margin-top:24px;padding:0;overflow:hidden;border:1px solid hsl(var(--border) / .72);border-radius:18px;background:hsl(var(--panel));box-shadow:inset 0 1px hsl(var(--background)),0 8px 28px hsl(var(--foreground) / .045)}.cw-sec-head{padding:13px 18px;border-bottom:1px solid hsl(var(--border) / .68);background:hsl(var(--muted) / .34)}.cw-section:has(.cw-a2a-space-picker){overflow:visible}.cw-section:has(.cw-a2a-space-picker)>.cw-sec-head{border-radius:17px 17px 0 0}.cw-sec-body{padding:2px 18px 6px}.cw-sec-title{margin:0;font-size:14px;font-weight:620;letter-spacing:-.01em;color:hsl(var(--foreground))}.cw-sec-hint{margin:0;font-size:13px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-form{display:flex;flex-direction:column;gap:0}.cw-section-desc{margin:0;font-size:13px;line-height:1.6;color:hsl(var(--muted-foreground))}.cw-field{display:grid;grid-template-columns:minmax(124px,.34fr) minmax(0,1fr);align-items:start;column-gap:16px;row-gap:6px;padding:11px 0}.cw-form>.cw-field+.cw-field,.cw-form>.cw-toggle+.cw-toggle,.cw-form>.cw-field+.cw-toggle,.cw-form>.cw-toggle+.cw-field,.cw-toggle-stack>.cw-field,.cw-toggle-stack>.cw-toggle+.cw-toggle{border-top:1px dashed hsl(var(--border) / .8)}.cw-field>.cw-label,.cw-field>.cw-remote-center-head{grid-column:1;align-self:start}.cw-field:has(>.cw-input)>.cw-label{align-self:center}.cw-field>:not(.cw-label):not(.cw-remote-center-head){grid-column:2;min-width:0}.cw-form>.cw-more-options{margin:10px 0 10px calc(34% + 16px)}.cw-form>.cw-model-more-options{margin-left:0}.cw-help:not(.cw-a2a-space-status):not(.cw-dependency-hint),.cw-section-desc:not(.cw-dependency-hint),.cw-remote-center-description,.cw-ctool-desc,.cw-skill-result-desc{display:none}.cw-dependency-hint{margin:0 0 14px calc(34% + 16px)}.cw-field>.cw-dependency-hint{grid-column:2;margin:0}.cw-more-options{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;margin-top:-4px;padding:4px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12.5px;font-weight:560;cursor:pointer;transition:color .14s ease}.cw-more-options:hover,.cw-more-options:focus-visible{color:hsl(var(--foreground))}.cw-more-options:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:3px;border-radius:4px}.cw-more-options-chevron{width:14px;height:14px;transition:transform .18s ease}.cw-more-options-chevron.is-open{transform:rotate(90deg)}.cw-more-options-count{margin-left:2px;padding:2px 7px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:10.5px;font-weight:600}.cw-model-advanced{display:flex;flex-direction:column;gap:20px;overflow:hidden}.cw-label{font-size:13px;font-weight:400;color:hsl(var(--foreground))}.cw-req{margin-left:2px;color:hsl(var(--destructive))}.cw-help{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-remote-center-head{display:flex;flex-direction:column;gap:6px}.cw-remote-center-description{display:block;max-width:560px;margin:0;line-height:1.6}.cw-a2a-space-picker{position:relative;display:flex;flex-direction:column;gap:8px}.cw-a2a-space-picker.is-open{z-index:80}.cw-a2a-space-row{display:flex;align-items:center;gap:8px}.cw-a2a-space-select-wrap{position:relative;flex:1;min-width:0}.cw-a2a-space-trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:36px;min-height:36px;gap:8px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:6px;background-color:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;letter-spacing:0;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.cw-a2a-space-trigger:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background-color:hsl(var(--muted) / .18)}.cw-a2a-space-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background-color:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.cw-a2a-space-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-a2a-space-trigger:disabled{cursor:not-allowed;opacity:.5}.cw-a2a-space-trigger.is-error{box-shadow:0 0 0 1px hsl(var(--destructive) / .55)}.cw-a2a-space-trigger>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-trigger>span.is-placeholder{color:hsl(var(--muted-foreground));font-weight:400}.cw-a2a-space-trigger-icon{width:18px;height:18px;flex-shrink:0;color:hsl(var(--muted-foreground));transition:transform .16s ease}.cw-a2a-space-trigger[aria-expanded=true] .cw-a2a-space-trigger-icon{transform:rotate(180deg)}.cw-a2a-space-menu{position:absolute;z-index:81;top:calc(100% + 6px);left:0;width:100%;overflow:hidden;padding:4px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 8px 24px hsl(var(--foreground) / .08);font-size:12px}.cw-picker-search{padding:4px 4px 6px;border-bottom:1px solid hsl(var(--border) / .72)}.cw-picker-search-input{width:100%;height:30px;padding:0 9px;border:1px solid hsl(var(--border));border-radius:5px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.cw-picker-search-input:focus{border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 2px hsl(var(--ring) / .1)}.cw-picker-options{max-height:188px;overflow-y:auto;padding-top:4px;overscroll-behavior:contain}.cw-picker-empty{padding:14px 10px;color:hsl(var(--muted-foreground));text-align:center}.cw-a2a-space-option{display:flex;align-items:center;width:100%;min-height:34px;padding:8px 10px;border:0;border-radius:4px;background:transparent;color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:500;line-height:1.35;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cw-a2a-space-option:hover,.cw-a2a-space-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.cw-a2a-space-option.is-selected{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-a2a-space-refresh{flex-shrink:0;width:36px;height:36px;border:1px solid hsl(var(--border));border-radius:6px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s ease,background-color .12s ease}.cw-a2a-space-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .4)}.cw-a2a-space-refresh:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-a2a-space-status{display:inline-flex;align-items:center;gap:6px}.cw-a2a-space-error{align-items:flex-start;padding:9px 11px;font-size:12.5px}.cw-viking-kb-picker{gap:6px}.cw-viking-kb-inline-status{min-height:36px;display:inline-flex;align-items:center;gap:6px;color:hsl(var(--muted-foreground));font-size:12.5px}.cw-viking-kb-menu{padding:3px;box-shadow:0 6px 18px hsl(var(--foreground) / .06)}.cw-viking-kb-menu .cw-picker-options{max-height:min(112px,calc(100vh - 310px))}.cw-viking-kb-menu .cw-a2a-space-option{min-height:28px;padding:5px 9px;line-height:1.25}.cw-viking-kb-refresh{color:hsl(var(--foreground) / .72)}.cw-viking-kb-refresh:hover:not(:disabled){border-color:hsl(var(--foreground) / .28);background:hsl(var(--muted) / .45);color:hsl(var(--foreground))}.cw-viking-kb-refresh:disabled{color:hsl(var(--muted-foreground))}.cw-error-text{font-size:12px;color:hsl(var(--destructive))}.cw-env-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));gap:12px;margin-top:5px}.cw-env-field{display:flex;min-width:0;flex-direction:column;gap:6px}.cw-env-field-head{display:grid;min-width:0;gap:3px;color:hsl(var(--foreground));font-size:12px;font-weight:560}.cw-env-field-title{display:inline-flex;min-width:0;align-items:center;gap:5px}.cw-env-field-label{min-width:0;line-height:1.4;overflow-wrap:anywhere}.cw-env-help{position:relative;width:15px;height:15px;flex:0 0 15px;display:inline-flex;align-items:center;justify-content:center;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--muted-foreground));cursor:default;font-size:10px;font-weight:650;line-height:1}.cw-env-help-popover{position:absolute;z-index:80;bottom:calc(100% + 8px);left:50%;width:max-content;max-width:min(320px,72vw);padding:7px 9px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--foreground));color:hsl(var(--background));box-shadow:0 10px 28px hsl(var(--foreground) / .14);font-size:11.5px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;transform:translate(-50%);opacity:0;pointer-events:none;-webkit-user-select:text;user-select:text}.cw-env-help:hover .cw-env-help-popover,.cw-env-help:focus-visible .cw-env-help-popover,.cw-env-help:focus-within .cw-env-help-popover{opacity:1;pointer-events:auto}.cw-env-help:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.cw-env-link{width:22px;height:22px;flex:0 0 22px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;color:hsl(var(--muted-foreground));text-decoration:none}.cw-env-link:hover{background:hsl(var(--foreground) / .055);color:hsl(var(--foreground))}.cw-env-link svg{width:13px;height:13px;flex:0 0 13px}.cw-env-field-head code{display:block;max-width:100%;overflow:hidden;color:hsl(var(--muted-foreground));font-size:9.5px;font-weight:400;text-overflow:ellipsis;white-space:nowrap}.cw-env-empty{margin:4px 0 0;color:hsl(var(--muted-foreground));font-size:12px}.cw-input{min-width:0;width:100%;min-height:38px;padding:9px 12px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background));box-shadow:inset 0 1px hsl(var(--foreground) / .015);color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .12s,box-shadow .12s}.cw-input::placeholder{color:hsl(var(--muted-foreground))}.cw-input:focus{outline:none;border-color:hsl(var(--ring) / .38);box-shadow:0 0 0 3px hsl(var(--ring) / .09),inset 0 1px hsl(var(--foreground) / .015)}.cw-input[aria-invalid=true]{border-color:hsl(var(--destructive) / .7);box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.cw-input.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-env-textarea{min-height:96px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.45;white-space:pre-wrap}.cw-env-error{margin-top:-2px;color:hsl(var(--destructive));font-size:11.5px;line-height:1.4}.cw-textarea{width:100%;padding:11px 13px;border:1px solid hsl(var(--border) / .8);border-radius:12px;background:hsl(var(--background));box-shadow:inset 0 1px hsl(var(--foreground) / .015);color:hsl(var(--foreground));font:inherit;font-size:14px;line-height:1.6;resize:vertical;transition:border-color .12s,box-shadow .12s}.cw-textarea::placeholder{color:hsl(var(--muted-foreground))}.cw-textarea:focus{outline:none;border-color:hsl(var(--ring) / .38);box-shadow:0 0 0 3px hsl(var(--ring) / .09),inset 0 1px hsl(var(--foreground) / .015)}.cw-textarea.is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}@keyframes cw-error-shake-a{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}@keyframes cw-error-shake-b{0%,to{transform:translate(0)}25%{transform:translate(-3px)}50%{transform:translate(3px)}75%{transform:translate(-2px)}}.cw-error-shake-0{animation:cw-error-shake-a .28s ease-in-out}.cw-error-shake-1{animation:cw-error-shake-b .28s ease-in-out}@media (prefers-reduced-motion: reduce){.cw-error-shake-0,.cw-error-shake-1{animation:none}}.cw-textarea-sm{min-height:80px;max-height:160px;overflow-y:auto}.cw-textarea-lg{min-height:340px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}.cw-markdown-loading,.cw-markdown-editor:not(.mdxeditor-popup-container){min-height:340px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background))}.cw-markdown-loading{display:flex;align-items:center;justify-content:center;color:hsl(var(--muted-foreground));font-size:13px}.cw-markdown-editor:not(.mdxeditor-popup-container){display:flex;flex-direction:column;max-height:420px;overflow:hidden;color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.cw-markdown-editor:not(.mdxeditor-popup-container):focus-within{border-color:hsl(var(--ring) / .45);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.cw-markdown-editor:not(.mdxeditor-popup-container).is-error{border-color:hsl(var(--destructive) / .6);box-shadow:0 0 0 3px hsl(var(--destructive) / .1)}.cw-markdown-toolbar{flex-shrink:0;min-height:40px;padding:5px 8px;border:0;border-bottom:1px solid hsl(var(--border));border-radius:0;background:hsl(var(--muted) / .38)}.cw-markdown-toolbar button,.cw-markdown-toolbar [role=combobox]{color:hsl(var(--foreground))}.cw-markdown-content{min-height:298px;max-height:360px;overflow-y:auto;padding:18px 20px 28px;color:hsl(var(--foreground));font-size:14px;line-height:1.7}.cw-markdown-content:focus{outline:none}.cw-markdown-content h1,.cw-markdown-content h2,.cw-markdown-content h3{margin:1.1em 0 .45em;color:hsl(var(--foreground));font-weight:650;line-height:1.3}.cw-markdown-content h1:first-child,.cw-markdown-content h2:first-child,.cw-markdown-content h3:first-child{margin-top:0}.cw-markdown-content h1{font-size:20px}.cw-markdown-content h2{font-size:17px}.cw-markdown-content h3{font-size:15px}.cw-markdown-content p{margin:0 0 .8em}.cw-markdown-content ul,.cw-markdown-content ol{margin:.5em 0 .9em;padding-left:1.5em}.cw-markdown-content ul{list-style:disc outside}.cw-markdown-content ol{list-style:decimal outside}.cw-markdown-content li{display:list-item}.cw-markdown-content blockquote{margin:.8em 0;padding-left:12px;border-left:3px solid hsl(var(--border));color:hsl(var(--muted-foreground))}.cw-markdown-error{display:block;margin-top:6px;color:hsl(var(--destructive));font-size:12px}.cw-tag-editor{display:flex;flex-direction:column;gap:12px}.cw-tag-inputrow{display:flex;gap:8px}.cw-tag-inputrow .cw-input{flex:1}.cw-presets{display:flex;flex-wrap:wrap;align-items:center;gap:7px}.cw-presets-label{font-size:11.5px;color:hsl(var(--muted-foreground));margin-right:2px}.cw-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 10px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:12.5px;white-space:nowrap}.cw-chip-ghost{border:1px dashed hsl(var(--border));background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;transition:background .12s,color .12s,border-color .12s}.cw-chip-ghost:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-chip-sub{background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-pills{display:flex;flex-wrap:wrap;gap:8px}.cw-pill{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 12px;border-radius:999px;background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font-size:13px}.cw-pill-x{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:none;border-radius:50%;background:hsl(var(--foreground) / .06);color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-pill-x:hover{background:hsl(var(--destructive) / .12);color:hsl(var(--destructive))}.cw-empty-line{margin:0;font-size:12.5px;color:hsl(var(--muted-foreground))}.cw-check-inline{display:flex;align-items:center;gap:8px;margin-top:2px;font-size:13px;color:hsl(var(--foreground));cursor:pointer;-webkit-user-select:none;user-select:none}.cw-check-inline input[type=checkbox]{width:16px;height:16px;margin:0;flex-shrink:0;accent-color:hsl(var(--primary));cursor:pointer}.cw-checklist{display:flex;flex-direction:column;gap:8px}.cw-tools-list-shell{min-width:0;container-type:inline-size}.cw-tool-config{padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--muted) / .28)}.cw-tool-config-head{display:flex;flex-direction:column;gap:3px}.cw-checklist-tools{--cw-checklist-row-height: 40px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(var(--cw-checklist-row-height),auto);max-height:var(--cw-checklist-max-height);padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-checklist-tools .cw-check{min-height:var(--cw-checklist-row-height);align-items:center;padding:8px 10px}.cw-checklist-tools .cw-check-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}@container (max-width: 575px){.cw-checklist-tools{grid-template-columns:minmax(0,1fr)}}.cw-check{display:flex;align-items:flex-start;gap:0;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-check>label{flex:1;min-width:0;padding-left:12px;color:inherit;cursor:pointer}.cw-checklist-tools .cw-check>label{padding-left:10px}.cw-check:hover{background:hsl(var(--foreground) / .05)}.cw-check.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-check-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-check-title{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.cw-check-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-segmented{display:flex;flex-wrap:wrap;gap:8px}.cw-seg{flex:1 1 160px;display:flex;flex-direction:column;gap:2px;padding:11px 13px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s}.cw-seg:hover{background:hsl(var(--foreground) / .05)}.cw-seg.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-seg-title{font-size:13px;font-weight:600;color:hsl(var(--foreground))}.cw-seg-desc{font-size:11.5px;line-height:1.45;color:hsl(var(--muted-foreground))}.cw-ctool{display:flex;flex-direction:column;gap:12px}.cw-ctool-inputs{display:flex;flex-wrap:wrap;gap:8px}.cw-ctool-inputs .cw-input{flex:1 1 180px}.cw-ctool-list{display:flex;flex-direction:column;gap:8px}.cw-ctool-row{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:11px;background:hsl(var(--card))}.cw-ctool-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--muted-foreground))}.cw-ctool-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-ctool-name{font-size:13.5px;font-weight:600;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:hsl(var(--foreground));word-break:break-word}.cw-ctool-desc{font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp,.cw-mcp-list{display:flex;flex-direction:column;gap:12px}.cw-mcp-row{display:flex;flex-direction:column;gap:8px;padding:14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card))}.cw-mcp-rowhead{display:flex;align-items:center;justify-content:space-between;gap:10px}.cw-mcp-transport{display:inline-flex;gap:6px}.cw-seg-sm{flex:0 0 auto;min-width:72px;flex-direction:row;align-items:center;justify-content:center;text-align:center;padding:6px 16px;border-radius:9px}.cw-seg-sm .cw-seg-title{font-size:12.5px}.cw-mcp-note{margin:0;font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-mcp-warning{display:flex;align-items:flex-start;gap:7px;margin:0;padding:9px 10px;border:1px solid #b4530940;border-radius:8px;background:#b453091a;color:#b45309;font-size:12.5px;line-height:1.5}.cw-mcp-warning svg{flex:0 0 auto;width:15px;height:15px;margin-top:2px}.cw-mcp .cw-add-sub{margin-top:0}.cw-mcp-field{align-items:center}.cw-mcp-field>.cw-label{align-self:center}.cw-subfield{margin:0;padding:9px 0;border:0;border-radius:0;background:transparent}.cw-toggle-stack{gap:0}.cw-toggle{display:grid;grid-template-columns:minmax(124px,.34fr) minmax(0,1fr);align-items:center;gap:16px;width:100%;padding:9px 0;border:0;border-radius:0;background:transparent;text-align:left;cursor:pointer;font:inherit;transition:border-color .15s,box-shadow .15s,background .15s}.cw-toggle:hover{background:hsl(var(--muted) / .18)}.cw-toggle.is-on{background:hsl(var(--muted) / .24);box-shadow:none}.cw-toggle-text{grid-column:1;grid-row:1;margin-left:0;flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-toggle-title{font-size:14px;font-weight:600}.cw-toggle-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-switch{grid-column:2;grid-row:1;justify-self:end;flex-shrink:0;display:flex;align-items:center;width:42px;height:24px;padding:2px;border-radius:999px;background:hsl(var(--border));transition:background .18s}.cw-toggle.is-on .cw-switch{background:hsl(var(--primary));justify-content:flex-end}.cw-switch-knob{display:block;width:20px;height:20px;border-radius:50%;background:hsl(var(--background));box-shadow:0 1px 2px hsl(var(--foreground) / .2)}.cw-sub-list{display:flex;flex-direction:column;gap:14px}.cw-sub{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .03)}.cw-sub-head{display:flex;align-items:center;justify-content:space-between}.cw-sub-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground));font-size:12.5px;font-weight:600}.cw-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.cw-icon-btn:not(:disabled):hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-icon-btn:disabled{opacity:.35;cursor:not-allowed}.cw-icon-danger:not(:disabled):hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.cw-sub-head-actions{display:inline-flex;align-items:center;gap:2px}.cw-sub-list-wrap{display:flex;flex-direction:column}.cw-agent-type-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:14px 0}.cw-agent-type-option{position:relative;min-width:0;min-height:42px;display:flex;align-items:center;gap:10px;padding:0;border:1px solid hsl(var(--border) / .72);border-radius:10px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.cw-agent-type-option:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary) / .28)}.cw-agent-type-option.is-on{border-color:hsl(var(--foreground) / .3);background:hsl(var(--secondary) / .42)}.cw-agent-type-option.is-disabled{color:hsl(var(--muted-foreground) / .52);cursor:not-allowed}.cw-agent-type-option>.flex{align-self:stretch;flex:1;min-width:0}.cw-agent-type-control{align-self:stretch;flex:1;width:100%;min-width:0;min-height:100%;box-sizing:border-box;padding:10px 12px;color:inherit;cursor:inherit}.cw-agent-type-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.cw-agent-type-copy strong{font-size:13px;font-weight:650}.cw-agent-type-copy small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:10.5px;line-height:1.35;text-overflow:ellipsis;white-space:nowrap}.cw-agent-type-disabled-hint{position:absolute;top:calc(100% + 17px);right:0;width:max-content;max-width:220px;padding:7px 10px;border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--popover));box-shadow:0 8px 24px hsl(var(--foreground) / .1);color:hsl(var(--popover-foreground));font-size:12px;font-weight:500;line-height:1.45;text-align:left;white-space:normal;opacity:0;pointer-events:none;transform:translateY(-2px);transition:opacity .14s ease,transform .14s ease}.cw-agent-type-option.is-disabled:hover .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus .cw-agent-type-disabled-hint,.cw-agent-type-option.is-disabled:focus-visible .cw-agent-type-disabled-hint{opacity:1;transform:translateY(0)}.cw-agent-type-option:focus-within,.cw-agent-type-option:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-add-sub{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin-top:14px;padding:12px;width:100%;border:1px dashed hsl(var(--border));border-radius:12px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;transition:background .12s,color .12s,border-color .12s}.cw-add-sub:hover{background:hsl(var(--accent));color:hsl(var(--foreground));border-color:hsl(var(--ring) / .3)}.cw-banner{display:flex;align-items:center;gap:8px;padding:11px 14px;border-radius:var(--radius);background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:13px;line-height:1.5}.cw-review{display:flex;flex-direction:column;border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;background:hsl(var(--card))}.cw-review-row{display:flex;gap:18px;padding:13px 16px;border-bottom:1px solid hsl(var(--border))}.cw-review-row:last-child{border-bottom:none}.cw-review-key{flex-shrink:0;width:110px;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground))}.cw-review-val{flex:1;min-width:0;font-size:13.5px}.cw-review-strong{font-weight:600}.cw-review-muted{color:hsl(var(--muted-foreground))}.cw-review-pre{margin:0;padding:10px 12px;background:hsl(var(--muted));border-radius:8px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:200px;overflow-y:auto}.cw-review-chips,.cw-review-subs{display:flex;flex-wrap:wrap;gap:6px}.cw-tag{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:500}.cw-tag-on{background:#22c35d24;color:#1c7d3f}.cw-tag-off{background:hsl(var(--muted));color:hsl(var(--muted-foreground))}.cw-btn{display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-size:13.5px;font-weight:550;cursor:pointer;transition:background .13s,opacity .13s,border-color .13s,transform .1s}.cw-btn:active{transform:scale(.98)}.cw-btn-primary{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.cw-btn-primary:hover:not(:disabled){opacity:.88}.cw-btn-primary:disabled{opacity:.4;cursor:default}.cw-btn-ghost{background:hsl(var(--background));border-color:hsl(var(--border));color:hsl(var(--foreground))}.cw-btn-ghost:hover{background:hsl(var(--accent))}.cw-btn-soft{background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));flex-shrink:0}.cw-btn-soft:hover:not(:disabled){background:hsl(var(--accent))}.cw-btn-soft:disabled{opacity:.45;cursor:default}.cw-i{width:16px;height:16px;flex-shrink:0}.cw-i-sm{width:14px;height:14px}.cw-root-preview{height:100%}.cw-preview-body{flex:1;min-height:0;display:flex;overflow:hidden;background:hsl(var(--background))}.cw-preview-body>*{flex:1;min-height:0}.cw-skillhub{height:100%;min-height:0;display:flex;flex-direction:column;gap:14px}.cw-skill-searchrow{display:flex;gap:8px}.cw-skill-searchbox{position:relative;flex:1;min-width:0;display:flex;align-items:center}.cw-skill-searchicon{position:absolute;left:11px;color:hsl(var(--muted-foreground));pointer-events:none}.cw-skill-input{padding-left:36px}.cw-skill-input:focus,.cw-skill-input:focus-visible{outline:2px solid hsl(var(--ring) / .38);outline-offset:1px;border-color:hsl(var(--ring) / .48);background:hsl(var(--background));box-shadow:none}.cw-skill-selected{display:flex;flex-direction:column;gap:8px}.cw-skill-selected-label{font-size:11.5px;font-weight:600;color:hsl(var(--muted-foreground))}.cw-skill-results{display:flex;flex-direction:column;gap:8px;max-height:472px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-skill-result{flex-shrink:0;display:flex;align-items:flex-start;gap:12px;width:100%;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));text-align:left;cursor:pointer;font:inherit;transition:background .12s,border-color .12s;min-height:72px}.cw-skill-result:hover{background:hsl(var(--foreground) / .05)}.cw-skill-result.is-on{background:hsl(var(--foreground) / .08);border-color:hsl(var(--foreground) / .18)}.cw-skill-result-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-top:1px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--muted-foreground));transition:background .12s,border-color .12s,color .12s}.cw-skill-result.is-on .cw-skill-result-icon{background:hsl(var(--foreground));border-color:hsl(var(--foreground));color:hsl(var(--background))}.cw-skill-result-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.cw-skill-result-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground));word-break:break-word}.cw-skill-result-desc{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:12px;line-height:1.5;color:hsl(var(--muted-foreground))}.cw-skill-result-repo{font-size:11px;font-family:inherit;line-height:1.4;color:hsl(var(--muted-foreground));word-break:break-all}.cw-skill-loading{flex:1;min-height:120px;display:flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.cw-spin{animation:cw-spin .8s linear infinite}@keyframes cw-spin{to{transform:rotate(360deg)}}.cw-skillspane{display:flex;flex-direction:column;gap:10px;padding:10px 0 12px}.cw-skill-add{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:40px;padding:6px 10px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:13px;font-weight:600;transition:border-color .15s,background .15s,color .15s}.cw-skill-add:hover{border-color:hsl(var(--foreground) / .34);background:transparent;color:hsl(var(--foreground))}.cw-skill-add:focus-visible{outline:none;box-shadow:0 0 0 2px hsl(var(--ring) / .25)}.cw-skill-add-icon{flex-shrink:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center}.cw-skill-dialog-backdrop{position:fixed;z-index:80;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;padding:20px;background:#15181e47;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.cw-skill-dialog{width:min(680px,calc(100vw - 32px));height:min(640px,calc(100dvh - 40px));min-height:420px;display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 24px 72px #10131933}.cw-skill-dialog-head{flex-shrink:0;min-height:58px;display:flex;align-items:center;justify-content:space-between;padding:0 18px 0 20px;border-bottom:1px solid hsl(var(--border))}.cw-skill-dialog-head h3{margin:0;font-size:16px;font-weight:650;letter-spacing:-.01em}.cw-skill-dialog-close{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-skill-dialog-close:hover{background:hsl(var(--foreground) / .06);color:hsl(var(--foreground))}.cw-skill-dialog-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:14px;padding:18px 20px 20px}.cw-skill-sourcetabs{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;height:44px;padding:4px;overflow:hidden;border:1px solid hsl(var(--border) / .55);border-radius:10px;background:hsl(var(--secondary) / .58)}.cw-skill-tab-slider{position:absolute;z-index:0;top:4px;bottom:4px;left:4px;width:var(--cw-skill-tab-slider-width);border:1px solid hsl(var(--border) / .72);border-radius:7px;background:hsl(var(--background));transform:translate(var(--cw-active-skill-tab-offset));transition:transform .24s cubic-bezier(.22,1,.36,1)}.cw-skill-pickertab{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:34px;padding:7px 10px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;font:inherit;font-size:12.5px;font-weight:500;transition:background .16s,color .16s}.cw-skill-pickertab:hover{background:hsl(var(--foreground) / .035);color:hsl(var(--foreground))}.cw-skill-pickertab.is-on{background:transparent;color:hsl(var(--foreground))}.cw-skill-pickertab:focus-visible{outline:none;box-shadow:inset 0 0 0 2px hsl(var(--ring) / .45)}.cw-skill-tabbody{flex:1;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}.cw-selected-skill-list{display:flex;flex-direction:column;gap:7px;max-height:347px;padding-right:4px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.cw-selected-skill-row{display:flex;align-items:center;gap:10px;min-width:0;min-height:52px;padding:9px 10px;border:1px solid hsl(var(--border));border-radius:10px;background:hsl(var(--card))}.cw-selected-skill-icon{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.cw-selected-skill-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.cw-selected-skill-name{overflow:hidden;color:hsl(var(--foreground));font-size:13px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-detail{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11.5px;text-overflow:ellipsis;white-space:nowrap}.cw-selected-skill-remove{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.cw-selected-skill-remove:hover{background:hsl(var(--destructive) / .09);color:hsl(var(--destructive))}.cw-local{height:100%;min-height:0;display:flex;flex-direction:column;gap:8px}.cw-local-dropzone{flex:1;min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:18px 14px;border:1px dashed hsl(var(--border));border-radius:10px;background:transparent;transition:border-color .15s,color .15s}.cw-local-drop-icon{width:20px;height:20px;color:hsl(var(--muted-foreground))}.cw-local-dropzone.is-dragging{border-color:hsl(var(--foreground) / .48);color:hsl(var(--foreground))}.cw-local-drop-hint{margin:0;color:hsl(var(--muted-foreground));font-size:11.5px}.cw-local-dropzone.is-dragging .cw-local-drop-hint,.cw-local-dropzone.is-dragging .cw-local-drop-icon{color:hsl(var(--foreground))}.cw-local-hint{margin:0;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.cw-skillspace{height:100%;min-height:0;display:flex;flex-direction:column}.cw-skillspace-header{display:flex;gap:8px;align-items:center;margin-bottom:10px}.cw-skillspace-select{width:100%;flex:1;min-width:0}.cw-skillspace-region-label{flex-shrink:0;display:inline-flex;align-items:center;min-height:30px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted) / .52);color:hsl(var(--muted-foreground));font-size:12px;font-weight:500;white-space:nowrap}.cw-skillspace-console-link{flex-shrink:0;padding:9px 12px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));border-color:hsl(var(--primary))}.cw-skillspace-console-link .cw-i{display:block}.cw-skill-result-version{color:hsl(var(--muted-foreground));font-weight:400;font-size:11px;margin-left:4px}.cw-skill-result-repo .cw-i{vertical-align:-2px;margin-right:2px}@media (max-width: 1280px){.cw-root{--cw-workspace-width: calc(100% - 48px) }.cw-workspace-header{padding-inline:16px}.cw-debug{width:280px}.cw-tree{width:208px}}@media (max-width: 1080px){.cw-editor{overflow:hidden}.cw-tree{height:auto}.cw-detail{flex:1 1 auto;width:100%;max-width:none;min-height:0}.cw-debug{flex:0 0 100%;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px;border-left:none;border-top:1px solid hsl(var(--border))}.cw-debug.is-collapsed{flex:0 0 48px;width:100%;min-width:0;height:48px;min-height:48px;align-items:flex-end;padding:7px 12px}.cw-debug.is-collapsed .cw-debug-expand{width:34px;min-height:34px}.cw-lower{gap:0}.cw-detail .cw-form-col{max-width:100%}}@media (max-width: 860px){.cw-root{--cw-workspace-gutter: 8px;--cw-workspace-width: calc(100% - 16px) }.cw-workspace-header{min-height:50px;padding:6px 10px}.cw-workspace-header h1{font-size:17px}.cw-validation-workspace{display:flex}.cw-ab-stage{padding:8px var(--cw-workspace-gutter)}.cw-ab-grid{grid-template-columns:repeat(var(--cw-ab-column-count),minmax(0,1fr))}.cw-ab-composer{padding-inline:var(--cw-workspace-gutter)}.cw-editor{flex-direction:column;overflow-x:hidden;overflow-y:hidden}.cw-editor>.abc-root{flex:0 0 180px;width:100%;min-width:0;min-height:180px}.cw-tree{width:100%;height:auto;max-height:220px;border-right:0;border-bottom:1px solid hsl(var(--border))}.cw-detail{flex:1 1 auto;width:100%;max-width:none;height:auto;min-height:0;border-left:0}.cw-detail-scroll{padding:16px 12px 20px}.cw-debug{flex:none;width:100%;height:min(480px,calc(100dvh - 120px));min-height:360px}.cw-debug.is-collapsed{width:100%;height:48px;min-height:48px}.cw-center{gap:0;padding:24px 16px 64px}.cw-form-col{max-width:100%}}@media (max-width: 700px){.cw-workspace-header h1{text-align:center}.cw-workspace-nav-actions{grid-template-columns:minmax(88px,1fr) auto minmax(88px,1fr)}.cw-workspace-nav-button{padding-inline:12px}.cw-form>.cw-more-options,.cw-dependency-hint{margin-left:0}.cw-optimization-list,.cw-ab-grid,.cw-ab-config{grid-template-columns:minmax(0,1fr)}.cw-ab-composer{grid-template-columns:minmax(0,1fr);padding-bottom:12px}.cw-ab-add{width:100%}.cw-dataset-summary>div+div{border-top:1px solid hsl(var(--border));border-left:0}}.tpl-root{flex:1;min-height:0;display:flex;flex-direction:column}.tpl-back{display:inline-flex;align-items:center;gap:6px;margin:0 0 18px;padding:6px 10px;border:none;border-radius:8px;background:none;color:hsl(var(--muted-foreground));font:inherit;font-size:13px;cursor:pointer;transition:background .12s,color .12s}.tpl-back:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.tpl-back .icon{width:15px;height:15px}.tpl-scroll{flex:1;min-height:0;overflow-y:auto;padding:24px 28px 40px}.tpl-scroll--detail{padding-left:14px;padding-right:14px}.tpl-head{max-width:720px;margin:8px auto 28px;text-align:center}.tpl-title{margin:0;font-size:24px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-sub{margin:8px 0 0;font-size:14px;color:hsl(var(--muted-foreground))}.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px;max-width:1100px;margin:0 auto}.tpl-card{display:flex;flex-direction:column;align-items:flex-start;gap:8px;width:100%;height:100%;padding:16px 16px 18px;text-align:left;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;transition:background .14s,border-color .14s}.tpl-card:hover{background:hsl(var(--foreground) / .05)}.tpl-card:active{background:hsl(var(--foreground) / .08)}.tpl-card-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:28px;height:28px;color:hsl(var(--muted-foreground))}.tpl-card-icon .icon{width:20px;height:20px}.tpl-card-name{font-size:14px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground))}.tpl-card-desc{font-size:12.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.tpl-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.tpl-tags--detail{margin-top:0}.tpl-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border:1px solid hsl(var(--border));border-radius:999px;background:none;color:hsl(var(--muted-foreground));font-size:11.5px;white-space:nowrap}.tpl-tag-icon{width:12px;height:12px;flex-shrink:0}.tpl-detail{max-width:720px;margin:0 auto;display:flex;flex-direction:column;gap:20px}.tpl-detail-head{display:flex;align-items:flex-start;gap:14px}.tpl-detail-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;border:1px solid hsl(var(--border));border-radius:12px;background:none;color:hsl(var(--muted-foreground))}.tpl-detail-icon .icon{width:22px;height:22px}.tpl-detail-headtext{min-width:0}.tpl-detail-name{font-size:20px;font-weight:650;letter-spacing:-.02em;color:hsl(var(--foreground))}.tpl-detail-desc{margin-top:4px;font-size:13.5px;line-height:1.6;color:hsl(var(--muted-foreground))}.tpl-field{display:flex;flex-direction:column;gap:8px}.tpl-field-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.tpl-input{width:100%;padding:10px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:14px;transition:border-color .15s}.tpl-input:focus{outline:none;border-color:hsl(var(--ring) / .4)}.tpl-instruction{margin:0;padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--foreground) / .03);color:hsl(var(--foreground));font-size:13px;line-height:1.7;white-space:pre-wrap}.tpl-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px}.tpl-meta{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid hsl(var(--border));font-size:13px}.tpl-meta-key{flex-shrink:0;color:hsl(var(--muted-foreground))}.tpl-meta-val{text-align:right;word-break:break-word;color:hsl(var(--foreground))}.tpl-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}.tpl-subagents{display:flex;flex-direction:column;gap:10px}.tpl-subagent{padding:12px 14px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background))}.tpl-subagent-top{display:flex;align-items:center;gap:8px}.tpl-subagent-name{font-size:13.5px;font-weight:600;color:hsl(var(--foreground))}.tpl-subagent-tools{margin-left:auto;font-size:11px;color:hsl(var(--muted-foreground));font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.tpl-subagent-desc{margin-top:5px;font-size:12.5px;line-height:1.55;color:hsl(var(--muted-foreground))}.tpl-create{display:inline-flex;align-items:center;justify-content:center;gap:6px;align-self:flex-start;margin-top:4px;padding:11px 20px;border:none;border-radius:12px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:opacity .15s,transform .1s}.tpl-create:hover{opacity:.88}.tpl-create:active{transform:scale(.98)}.tpl-create .icon{width:17px;height:17px}@media (max-width: 560px){.tpl-meta-grid{grid-template-columns:1fr}.tpl-scroll{padding:20px 16px 32px}}.wfb{flex:1;min-height:0;display:flex;flex-direction:column;height:100%}.wfb-create{position:absolute;top:14px;right:14px;z-index:5;display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border:1px solid transparent;border-radius:8px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:550;cursor:pointer;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .4);transition:opacity .15s,transform .1s}.wfb-create:hover:not(:disabled){opacity:.88}.wfb-create:active:not(:disabled){transform:scale(.97)}.wfb-create:disabled{opacity:.4;cursor:default}.wfb-grid{flex:1;min-height:0;display:grid;grid-template-columns:248px minmax(0,1fr) 288px}.wfb-section-label{margin:4px 0 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground))}.wfb-field{display:flex;flex-direction:column;gap:5px}.wfb-field-label{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-input{width:100%;border:1px solid hsl(var(--border));border-radius:var(--radius);padding:8px 10px;font:inherit;font-size:13px;background:hsl(var(--background));color:hsl(var(--foreground));transition:border-color .12s,box-shadow .12s}.wfb-input::placeholder{color:hsl(var(--muted-foreground) / .7)}.wfb-input:focus{outline:none;border-color:hsl(var(--ring) / .5);box-shadow:0 0 0 3px hsl(var(--ring) / .08)}.wfb-input--error,.wfb-input--error:focus{border-color:hsl(var(--destructive));box-shadow:0 0 0 3px hsl(var(--destructive) / .08)}.wfb-field-error,.wfb-field-help{font-size:11px;line-height:1.4}.wfb-field-error{color:hsl(var(--destructive))}.wfb-field-help{color:hsl(var(--muted-foreground))}.wfb-textarea{resize:vertical;min-height:52px;line-height:1.5}.wfb-palette{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-right:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-types{display:flex;flex-direction:column;gap:6px}.wfb-type{display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer;transition:border-color .12s,background .12s}.wfb-type:hover{border-color:hsl(var(--ring) / .3)}.wfb-type .icon{color:hsl(var(--muted-foreground))}.wfb-type--active{border-color:hsl(var(--ring) / .55);background:hsl(var(--accent))}.wfb-type--active .icon{color:#7c48f4}.wfb-type-text{display:flex;flex-direction:column;gap:1px;min-width:0}.wfb-type-name{font-size:13px;font-weight:550}.wfb-type-desc{font-size:11px;color:hsl(var(--muted-foreground))}.wfb-palette-item{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px dashed hsl(var(--border));border-radius:var(--radius);background:hsl(var(--background));cursor:grab;transition:border-color .12s,background .12s}.wfb-palette-item:hover{border-color:hsl(var(--ring) / .4);background:hsl(var(--accent))}.wfb-palette-item:active{cursor:grabbing}.wfb-grip{color:hsl(var(--muted-foreground) / .7)}.wfb-palette-item-text{font-size:13px;font-weight:500}.wfb-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%;padding:9px 12px;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--secondary));color:hsl(var(--secondary-foreground));font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background .12s}.wfb-add:hover{background:hsl(var(--accent))}.wfb-hint{margin-top:auto;padding-top:10px;font-size:11.5px;line-height:1.5;color:hsl(var(--muted-foreground))}.wfb-canvas{position:relative;min-width:0;height:100%;background:hsl(var(--canvas))}.wfb-canvas .react-flow{background:transparent}.wfb-node{display:flex;align-items:center;gap:10px;width:188px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));box-shadow:0 1px 2px hsl(var(--foreground) / .04),0 8px 24px -16px hsl(var(--foreground) / .2);transition:border-color .12s,box-shadow .12s}.wfb-node--selected{border-color:hsl(var(--ring) / .6);box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.wfb-node-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;border-radius:9px;background:hsl(var(--secondary));color:#7c48f4}.wfb-node-icon--sm{width:24px;height:24px;border-radius:7px}.wfb-node-body{min-width:0;display:flex;flex-direction:column;gap:2px}.wfb-node-name{font-size:13px;font-weight:600;letter-spacing:-.01em;color:hsl(var(--foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-node-desc{font-size:11px;color:hsl(var(--muted-foreground));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wfb-handle{width:9px!important;height:9px!important;background:hsl(var(--background))!important;border:2px solid hsl(258 89% 62%)!important}.wfb-handle:hover{background:#7c48f4!important}.wfb-canvas .react-flow__controls{border-radius:10px;overflow:hidden;box-shadow:0 4px 16px -8px hsl(var(--foreground) / .25);border:1px solid hsl(var(--border))}.wfb-canvas .react-flow__controls-button{background:hsl(var(--background));border-bottom:1px solid hsl(var(--border));color:hsl(var(--foreground))}.wfb-canvas .react-flow__controls-button:hover{background:hsl(var(--accent))}.wfb-canvas .react-flow__controls-button svg{fill:hsl(var(--foreground))}.wfb-canvas .react-flow__edge-path{stroke:hsl(var(--muted-foreground) / .55);stroke-width:1.5}.wfb-canvas .react-flow__edge.selected .react-flow__edge-path,.wfb-canvas .react-flow__edge:hover .react-flow__edge-path{stroke:#7c48f4}.wfb-canvas .react-flow__arrowhead *{fill:hsl(var(--muted-foreground) / .55)}.wfb-minimap{border:1px solid hsl(var(--border));border-radius:10px;overflow:hidden}.wfb-inspector{display:flex;flex-direction:column;gap:12px;padding:16px 14px;border-left:1px solid hsl(var(--border));overflow-y:auto;background:hsl(var(--card))}.wfb-inspector-head{display:flex;align-items:center;justify-content:space-between}.wfb-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:7px;background:none;color:hsl(var(--muted-foreground));cursor:pointer;transition:background .12s,color .12s}.wfb-icon-btn:hover{background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.wfb-inspector-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px;padding-top:12px;border-top:1px solid hsl(var(--border))}.wfb-meta-key{font-size:12px;color:hsl(var(--muted-foreground))}.wfb-meta-val{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;padding:2px 7px;border-radius:6px;background:hsl(var(--muted));color:hsl(var(--foreground))}.wfb-inspector-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.wfb-empty-icon{width:32px;height:32px;opacity:.4;margin-bottom:4px}.wfb-inspector-empty p{margin:0}.wfb-empty-sub{font-size:12px;color:hsl(var(--muted-foreground) / .8)}@media (max-width: 900px){.wfb-grid{grid-template-columns:220px minmax(0,1fr)}.wfb-inspector{display:none}}.package-create{flex:1;min-width:0;min-height:0;display:flex;color:hsl(var(--foreground))}.package-create-preview{height:100%}.package-create-preview>*{flex:1;min-width:0;min-height:0}.package-source-pane{padding:16px 18px 18px}.package-source-label{margin-bottom:10px;color:hsl(var(--foreground));font-size:15px;font-weight:650}.package-dropzone{min-height:152px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:20px;border:1px dashed hsl(var(--border));border-radius:12px;background:hsl(var(--secondary) / .16);text-align:center;cursor:pointer;transition:border-color .16s ease,background-color .16s ease}.package-dropzone:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:3px}.package-dropzone.is-dragging{border-color:hsl(var(--primary) / .62);background:hsl(var(--primary) / .045)}.package-dropzone.is-ready{background:hsl(var(--background))}.package-dropzone>strong{max-width:100%;overflow:hidden;font-size:15px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.package-dropzone>span{max-width:420px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.6}.package-upload-actions{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:5px}.package-upload-actions button{min-height:36px;padding:0 16px;border-radius:7px;font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,color .14s ease}.package-upload-secondary{border:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.package-upload-secondary:hover:not(:disabled){border-color:hsl(var(--foreground) / .24);background:hsl(var(--secondary))}.package-upload-actions button:disabled{cursor:default;opacity:.45}.package-upload-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .55);outline-offset:2px}.package-dropzone input{display:none}.package-create-error{flex:0 0 auto;margin-top:12px;padding:10px 12px;border:1px solid hsl(var(--destructive) / .2);border-radius:8px;background:hsl(var(--destructive) / .07);color:hsl(var(--destructive));font-size:13px;line-height:1.5}@media (max-width: 860px){.package-dropzone{min-height:140px}}@media (prefers-reduced-motion: reduce){.package-dropzone,.package-upload-actions button{transition:none}}.skill-workspace{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;padding:34px clamp(18px,4vw,54px) 44px;background:hsl(var(--panel))}.skill-workspace__intro{width:min(1180px,100%);margin:0 auto 32px}.skill-workspace__intro h1{margin:0;font-size:22px;font-weight:620;letter-spacing:-.025em}.skill-workspace__poll-error{width:min(1180px,100%);margin:0 auto 14px;padding:9px 11px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12px}.skill-workspace__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex:1;min-height:0;gap:clamp(36px,5vw,72px);width:min(1180px,100%);margin:0 auto}.skill-candidate{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr);min-width:0;min-height:0;background:transparent}.skill-candidate:nth-child(2):before{position:absolute;top:0;bottom:0;left:calc(clamp(36px,5vw,72px)/-2);width:1px;background:hsl(var(--border));content:""}.skill-candidate__header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:42px;padding:0 0 12px;border-bottom:1px solid hsl(var(--border))}.skill-candidate__header h2{margin:0;font-family:inherit;font-size:13px;font-weight:500;line-height:1.4;letter-spacing:0}.skill-candidate__selected{padding:3px 7px;border-radius:999px;background:hsl(var(--primary) / .1);color:hsl(var(--primary));font-size:10px}.skill-candidate__view{min-height:0;overflow-y:auto;padding-right:8px;scrollbar-gutter:stable;animation:skill-view-in .18s ease-out}.skill-candidate__status{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:46px;padding:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.4;text-align:left}.skill-candidate--succeeded .skill-candidate__status{color:#2a844f}.skill-candidate--failed .skill-candidate__status{color:hsl(var(--destructive))}.skill-candidate__status-icon{display:inline-grid;place-items:center;width:18px;height:18px}.skill-candidate__status-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__spinner{animation:skill-spin .9s linear infinite}.skill-candidate__spinner circle{opacity:.2}.skill-candidate__duration{margin-left:auto;font-size:10px;color:hsl(var(--muted-foreground))}.skill-conversation{min-height:220px;margin:0 0 16px;padding:8px 0 18px}.skill-conversation .bubble{font-size:13px;line-height:1.65}.skill-conversation .think-head,.skill-conversation .tool-head,.skill-conversation .builtin-tool-head{display:grid;grid-template-columns:20px minmax(0,1fr) 13px;align-items:center;gap:8px;width:100%;min-height:38px;padding:4px 0;text-align:left}.skill-conversation .think-label,.skill-conversation .tool-name,.skill-conversation .builtin-tool-label{min-width:0;font-size:13px;line-height:1.4;overflow-wrap:anywhere;text-align:left}.skill-conversation .think-icon,.skill-conversation .tool-icon,.skill-conversation .builtin-tool-icon{width:20px;height:26px}.skill-conversation .chev,.skill-conversation .tool-chevron,.skill-conversation .builtin-tool-chevron{justify-self:end}.skill-candidate__error{margin:0 0 14px;padding:9px 10px;border-radius:7px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:11px;line-height:1.5}.skill-candidate__view-actions{display:flex;justify-content:flex-start;padding:4px 0 20px}.skill-candidate__preview-nav{display:flex;align-items:center;min-height:46px}.skill-candidate__back{display:inline-flex;align-items:center;gap:6px;padding:5px 0;border:0;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;cursor:pointer}.skill-candidate__back:hover{color:hsl(var(--foreground))}.skill-candidate__back svg,.skill-action--preview svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.skill-candidate__result{padding:0 0 20px}.skill-candidate__summary{display:grid;grid-template-columns:1fr .55fr .7fr;gap:8px;margin-bottom:13px}.skill-candidate__summary>div{display:flex;flex-direction:column;gap:4px;min-width:0;padding:9px 10px;border-radius:8px;background:hsl(var(--muted) / .55)}.skill-candidate__summary span{color:hsl(var(--muted-foreground));font-size:9px;text-transform:uppercase;letter-spacing:.05em}.skill-candidate__summary strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:560}.skill-candidate__summary .is-valid{color:#2a844f}.skill-candidate__summary .is-invalid{color:hsl(var(--destructive))}.skill-candidate__description{margin:0 0 13px;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.skill-validation{margin-bottom:12px;font-size:11px;color:hsl(var(--muted-foreground))}.skill-validation summary{margin-bottom:6px;cursor:pointer;color:hsl(var(--foreground))}.skill-files{overflow:hidden;margin-bottom:14px;border:1px solid hsl(var(--border));border-radius:9px}.skill-files__tabs{display:flex;gap:2px;overflow-x:auto;padding:5px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--muted) / .34)}.skill-files__tabs button{flex:0 0 auto;max-width:180px;overflow:hidden;text-overflow:ellipsis;padding:4px 7px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:10px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;cursor:pointer}.skill-files__tabs button.is-active{background:hsl(var(--background));color:hsl(var(--foreground));box-shadow:0 1px 3px hsl(var(--foreground) / .08)}.skill-files__content{margin:0;overflow-x:auto;padding:12px;background:hsl(var(--background));color:hsl(var(--foreground));font:10.5px/1.55 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre-wrap;word-break:break-word}.skill-files__truncated{margin:0;padding:8px 12px;border-top:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:10px}.skill-files__unavailable{padding:20px 12px;color:hsl(var(--muted-foreground));font-size:11px;text-align:center}.skill-candidate__actions{display:flex;flex-wrap:wrap;gap:7px}.skill-action{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid hsl(var(--border));border-radius:7px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px;text-decoration:none;cursor:pointer}.skill-action:hover:not(:disabled){background:hsl(var(--accent))}.skill-action:disabled{cursor:default;opacity:.42}.skill-action--select{border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-action--select[aria-pressed=true]{background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.skill-action--preview{gap:7px;border-color:hsl(var(--primary) / .3);color:hsl(var(--primary))}.skill-publish-form{display:flex;flex-direction:column;gap:9px;margin-top:12px;padding:11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--muted) / .28)}.skill-publish-form label{display:flex;flex-direction:column;gap:4px;color:hsl(var(--muted-foreground));font-size:10px}.skill-publish-form input{min-width:0;height:31px;padding:0 8px;border:1px solid hsl(var(--border));border-radius:6px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:11px}.skill-publish-form input:focus{border-color:hsl(var(--primary) / .55)}.skill-publish-form__optional{display:grid;grid-template-columns:1fr 1fr;gap:8px}@keyframes skill-spin{to{transform:rotate(360deg)}}@keyframes skill-view-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media (max-width: 780px){.skill-workspace{overflow-y:auto;padding:24px 12px 32px}.skill-workspace__grid{flex:none;grid-template-columns:1fr;gap:32px}.skill-candidate{display:block}.skill-candidate__view{overflow:visible;padding-right:0}.skill-candidate:nth-child(2){padding-top:32px;border-top:1px solid hsl(var(--border))}.skill-candidate:nth-child(2):before{display:none}.skill-workspace__intro h1{font-size:20px}.skill-publish-form__optional{grid-template-columns:1fr}.skill-action{min-height:44px}}@media (prefers-reduced-motion: reduce){.skill-candidate__view,.skill-candidate__spinner{animation:none}}.ui-carousel{position:relative}.ui-carousel__viewport{overflow:hidden;touch-action:pan-y pinch-zoom}.ui-carousel__track{display:flex;margin-left:-12px}.ui-carousel__track.is-vertical{flex-direction:column;margin-top:-12px;margin-left:0}.ui-carousel__item{min-width:0;flex:0 0 100%;padding-left:12px}.ui-carousel__item.is-vertical{padding-top:12px;padding-left:0}.ui-carousel__control{position:absolute;z-index:2;top:50%;display:inline-grid;width:28px;height:28px;place-items:center;padding:0;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background) / .92);color:hsl(var(--foreground));box-shadow:0 2px 8px hsl(var(--foreground) / .08);cursor:pointer;transform:translateY(-50%);transition:background-color .14s ease,border-color .14s ease,opacity .14s ease;touch-action:manipulation}.ui-carousel__control--previous{left:8px}.ui-carousel__control--next{right:8px}.ui-carousel__control:hover:not(:disabled){border-color:hsl(var(--foreground) / .2);background:hsl(var(--background))}.ui-carousel__control:focus-visible{outline:2px solid hsl(var(--ring) / .42);outline-offset:2px}.ui-carousel__control:disabled{cursor:default;opacity:.34}.ui-carousel__control svg{width:15px;height:15px}.ui-carousel__control.is-vertical{left:50%;transform:translate(-50%) rotate(90deg)}.ui-carousel__control--previous.is-vertical{top:8px}.ui-carousel__control--next.is-vertical{top:auto;right:auto;bottom:8px}@media (prefers-reduced-motion: reduce){.ui-carousel__control{transition:none}}.new-chat-feature-carousel{position:absolute;bottom:10px;left:50%;display:grid;grid-template-columns:28px minmax(0,230px) 28px;align-items:center;column-gap:12px;width:min(310px,calc(100% - 32px));transform:translate(-50%)}.new-chat-feature-carousel .ui-carousel__viewport{grid-column:2;grid-row:1;min-width:0}.new-chat-feature-carousel .ui-carousel__track{margin-left:-10px}.new-chat-feature-carousel .ui-carousel__item{padding-left:10px}.new-chat-feature-carousel .ui-carousel__control{position:static;grid-row:1;border:0;background:transparent;box-shadow:none;transform:none}.new-chat-feature-carousel .ui-carousel__control:hover:not(:disabled){border:0;background:transparent}.new-chat-feature-carousel .ui-carousel__control--previous{grid-column:1}.new-chat-feature-carousel .ui-carousel__control--next{grid-column:3}.new-chat-feature-carousel__close{position:absolute;z-index:3;top:4px;left:41px;display:inline-grid;width:28px;height:28px;place-items:center;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .14s ease,background-color .14s ease}.new-chat-feature-carousel__close:hover{background:hsl(var(--accent));color:hsl(var(--foreground))}.new-chat-feature-carousel__close:focus-visible{outline:2px solid hsl(var(--ring) / .42);outline-offset:1px}.new-chat-feature-carousel__close svg{width:14px;height:14px}.new-chat-feature-card{position:relative;display:flex;height:104px;align-items:flex-end;overflow:hidden;padding:12px 28px 12px 12px;border:0;border-radius:12px;background:hsl(var(--muted) / .58);color:hsl(var(--foreground));-webkit-user-select:none;user-select:none}.new-chat-feature-card>div{position:relative;z-index:1;display:flex;flex-direction:column;gap:4px}.new-chat-feature-card__copy{max-width:118px}.new-chat-feature-card__illustration{position:absolute;top:28px;right:8px;width:86px;height:64px;fill:none;stroke:hsl(var(--foreground) / .44);stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;shape-rendering:geometricPrecision}.new-chat-feature-card__illustration-connectors{stroke:hsl(var(--foreground) / .3)}.new-chat-feature-card__illustration-surfaces{fill:hsl(var(--panel) / .82)}.new-chat-feature-card__illustration-details{fill:none}.new-chat-feature-card__illustration-dot{fill:hsl(var(--foreground) / .4);stroke:none}.new-chat-feature-card strong{font-size:13px;font-weight:600;line-height:1.35}.new-chat-feature-card>div>span{color:hsl(var(--muted-foreground));font-size:11.5px;line-height:1.45}@media (max-width: 720px){.new-chat-feature-carousel{grid-template-columns:28px minmax(0,1fr) 28px;column-gap:8px;width:min(310px,calc(100% - 24px))}.new-chat-feature-carousel__close{left:37px}}@media (max-width: 440px){.new-chat-feature-carousel{width:calc(100% - 16px)}}@media (max-height: 640px){.new-chat-feature-carousel{grid-template-columns:28px minmax(0,1fr) 28px;column-gap:8px;width:min(280px,calc(100% - 24px))}}@media (prefers-reduced-motion: reduce){.new-chat-feature-carousel__close{transition:none}}.studio-update-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:112px;min-height:32px;padding:0 10px;border:1px solid #1664ff;border-radius:8px;background:#1664ff;color:#fff;font:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle{gap:0;width:32px;min-width:32px;padding:0;overflow:hidden;white-space:nowrap;transition:width .18s ease,gap .18s ease,padding .18s ease,border-color .14s ease,background-color .14s ease,color .14s ease}.studio-update-trigger.is-idle:hover,.studio-update-trigger.is-idle:focus-visible{gap:7px;width:124px;padding:0 10px;border-color:#1664ff;background:#1664ff;color:#fff}.studio-update-trigger.is-idle>span{max-width:0;overflow:hidden;opacity:0;transform:translate(-4px);transition:max-width .18s ease,opacity .12s ease,transform .18s ease}.studio-update-trigger.is-idle:hover>span,.studio-update-trigger.is-idle:focus-visible>span{max-width:86px;opacity:1;transform:translate(0)}.studio-update-trigger.is-submitting{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer}.studio-update-trigger.is-error{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--destructive))}.studio-update-trigger.is-published{border-color:hsl(var(--border));background:hsl(var(--background));color:hsl(var(--foreground))}.studio-update-icon{width:17px;height:17px;flex:0 0 17px}.studio-update-dialog{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:10px;width:min(500px,calc(100vw - 32px));max-width:calc(100vw - 32px);min-width:0;overflow:hidden}.studio-update-dialog>.studio-update-dialog-mark{grid-column:1;grid-row:1}.studio-update-dialog>.confirm-title{grid-column:2;grid-row:1;align-self:start;margin:5px 0 12px}.studio-update-dialog>:not(.studio-update-dialog-mark,.confirm-title){grid-column:1 / -1;width:100%;max-width:100%;min-width:0}.studio-update-dialog .confirm-text,.studio-update-dialog .studio-update-changelog li,.studio-update-dialog .studio-update-changelog p,.studio-update-dialog .studio-update-error,.studio-update-dialog .studio-update-progress small,.studio-update-dialog .studio-update-progress-note,.studio-update-dialog .studio-update-console-link{max-width:100%;white-space:normal;overflow-wrap:anywhere;word-break:break-word}.studio-update-field{position:relative;display:grid;gap:6px;margin-bottom:12px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-version-trigger{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:36px;padding:0 10px 0 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease,background-color .12s ease}.studio-update-version-trigger:hover{border-color:hsl(var(--foreground) / .24);background:hsl(var(--muted) / .18)}.studio-update-version-trigger[aria-expanded=true]{border-color:hsl(var(--ring) / .42);background:hsl(var(--background));box-shadow:0 0 0 3px hsl(var(--ring) / .1)}.studio-update-version-trigger:focus-visible{outline:none;box-shadow:0 0 0 3px hsl(var(--ring) / .12)}.studio-update-version-trigger>svg{width:16px;height:16px;flex:0 0 16px;color:hsl(var(--muted-foreground));stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;transition:transform .16s ease}.studio-update-version-trigger>span,.studio-update-version-option>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.studio-update-version-trigger[aria-expanded=true]>svg{transform:rotate(180deg)}.studio-update-version-menu{position:absolute;z-index:50;top:calc(100% + 6px);left:0;width:100%;max-height:190px;padding:4px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel, var(--background)));box-shadow:0 12px 28px hsl(var(--foreground) / .1),0 2px 8px hsl(var(--foreground) / .05);overscroll-behavior:contain}.studio-update-version-option{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:34px;padding:7px 9px;border:0;border-radius:6px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-align:left;cursor:pointer}.studio-update-version-option:hover,.studio-update-version-option:focus-visible{outline:none;background:hsl(var(--muted) / .5)}.studio-update-version-option.is-selected{background:hsl(var(--primary) / .08)}.studio-update-version-option>svg{width:15px;height:15px;flex:0 0 15px;color:hsl(var(--primary));stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.studio-update-dialog-mark{display:inline-grid;flex:0 0 30px;width:30px;height:30px;margin-bottom:12px;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.studio-update-dialog-mark svg{width:18px;height:18px}.studio-update-versions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px;margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--canvas) / .5)}.studio-update-versions div:last-child{grid-column:1 / -1}.studio-update-versions dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-versions dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap}.studio-update-changelog{margin:0 0 18px;padding:12px;border:1px solid hsl(var(--border));border-radius:9px}.studio-update-changelog>div{margin-bottom:7px;color:hsl(var(--foreground));font-size:12px;font-weight:500}.studio-update-changelog ul{display:grid;gap:5px;max-height:min(180px,25vh);margin:0;padding:0 6px 0 18px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-changelog li,.studio-update-changelog p{margin:0;color:hsl(var(--muted-foreground));font-size:12px;line-height:1.55}.studio-update-confirm{border-color:transparent;background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.studio-update-confirm:hover{background:hsl(var(--primary) / .88)}.studio-update-error{margin-bottom:12px;color:hsl(var(--destructive))}.studio-update-error-panel{min-width:0}.studio-update-error-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 12px}.studio-update-error-meta>div{min-width:0;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-error-meta dt{margin-bottom:3px;color:hsl(var(--muted-foreground));font-size:11px}.studio-update-error-meta dd{margin:0;overflow:hidden;color:hsl(var(--foreground));font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.studio-update-log-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid hsl(var(--border));border-bottom:0;border-radius:8px 8px 0 0;background:hsl(var(--muted) / .28);color:hsl(var(--foreground));font-size:11px;font-weight:500}.studio-update-log-header>span{display:inline-flex;align-items:center;gap:6px}.studio-update-log-header i{width:6px;height:6px;border-radius:50%;background:hsl(var(--muted-foreground))}.studio-update-log-header i.is-active{background:#1664ff;box-shadow:0 0 0 3px #1664ff1c}.studio-update-log-header i.is-complete{background:#29ae60}.studio-update-log-header i.is-error{background:hsl(var(--destructive))}.studio-update-log-header small{color:hsl(var(--muted-foreground));font-size:10px;font-weight:400}.studio-update-log-header button{padding:2px 0;border:0;background:transparent;color:hsl(var(--primary));font:inherit;cursor:pointer}.studio-update-log-header button:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-log-header button:disabled{color:hsl(var(--muted-foreground));cursor:default;text-decoration:none}.studio-update-log-lines{min-height:92px;max-height:min(210px,29vh);padding:11px 12px;overflow-y:auto;border:1px solid hsl(var(--border));border-radius:0 0 8px 8px;background:hsl(var(--foreground) / .035);color:hsl(var(--foreground));font-family:inherit;font-size:11px;line-height:1.55;overflow-wrap:anywhere;overscroll-behavior:contain;scrollbar-gutter:stable}.studio-update-log-lines:focus-visible{outline:2px solid hsl(var(--ring) / .35);outline-offset:-2px}.studio-update-log-lines>div+div{margin-top:3px}.studio-update-log-lines p{margin:0;color:hsl(var(--muted-foreground))}.studio-update-console-link{display:inline-flex;align-items:center;gap:5px;margin-top:10px;color:hsl(var(--primary));font-size:11px;font-weight:500;text-decoration:none}.studio-update-console-link:hover{text-decoration:underline;text-underline-offset:2px}.studio-update-progress-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 18px}.studio-update-progress-summary>div{display:grid;gap:4px;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--canvas) / .5)}.studio-update-progress-summary span{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-summary strong{overflow:hidden;color:hsl(var(--foreground));font-size:12px;font-variant-numeric:tabular-nums;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.studio-update-progress{display:grid;gap:0;margin:0 0 14px;padding:0;list-style:none}.studio-update-progress li{position:relative;display:grid;grid-template-columns:18px minmax(0,1fr);gap:9px;min-height:38px;color:hsl(var(--muted-foreground));font-size:12px}.studio-update-progress li:not(:last-child):after{position:absolute;top:14px;bottom:-2px;left:5px;width:1px;background:hsl(var(--border));content:""}.studio-update-progress li.is-complete:not(:last-child):after{background:#1664ff}.studio-update-progress-dot{position:relative;z-index:1;width:11px;height:11px;margin-top:2px;border:2px solid hsl(var(--border));border-radius:50%;background:hsl(var(--background))}.studio-update-progress li.is-active,.studio-update-progress li.is-complete{color:hsl(var(--foreground))}.studio-update-progress li.is-active .studio-update-progress-dot{border-color:#1664ff;box-shadow:0 0 0 3px #1664ff1f}.studio-update-progress li.is-complete .studio-update-progress-dot{border-color:#1664ff;background:#1664ff}.studio-update-progress li>div{display:grid;gap:3px;min-width:0}.studio-update-progress small{color:hsl(var(--muted-foreground));font-size:11px}.studio-update-progress-note{margin:12px 0 18px;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.55}.sandbox-entry{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid hsl(268 58% 58% / .34);background:#f4eefb;color:#5b318c;font:inherit;font-weight:600;cursor:pointer;transition:background-color .14s ease-out,border-color .14s ease-out}.sandbox-entry svg{width:15px;height:15px;flex:0 0 auto}.sandbox-entry:hover:not(:disabled){border-color:#803ecc85;background:#ece2f9}.sandbox-entry:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-entry:disabled{cursor:default;opacity:.72}.sandbox-entry--composer{min-height:30px;padding:0 13px;border-radius:999px;font-size:12px}.sandbox-entry--header{min-height:32px;padding:0 10px;border-radius:7px;font-size:12px}.sandbox-entry.is-active{border-style:dashed}.sandbox-new-chat-entry{display:flex;justify-content:center;min-height:30px}.composer-slot{width:100%;min-width:0}.sandbox-composer-wrap{position:relative;z-index:50}.sandbox-session-warning{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;width:calc(100% - 32px);max-width:736px;min-height:24px;margin:0 auto 6px;color:#c7840f;font-size:12px}.sandbox-session-warning-dot{display:none}.sandbox-session-warning-copy{grid-column:2;white-space:nowrap;text-align:center}.sandbox-session-warning button{grid-column:3;justify-self:end;padding:3px 5px;border:0;border-radius:5px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-weight:580;cursor:pointer}.sandbox-session-warning button:hover{background:hsl(var(--foreground) / .05);color:hsl(var(--foreground))}.sandbox-composer-wrap .composer-box{display:grid;grid-template-columns:1fr auto;grid-template-rows:minmax(44px,auto) 36px;align-items:center;gap:2px 8px;min-height:104px;padding:10px 8px 8px;border-radius:24px}.sandbox-composer-wrap .comp-input{grid-row:1;grid-column:1 / -1;align-self:stretch;width:100%;min-height:44px;padding:8px 10px 4px}.sandbox-composer-wrap .sandbox-composer-input{grid-row:1;grid-column:1 / -1;align-self:stretch;display:flex;flex-flow:row wrap;align-content:flex-start;align-items:center;gap:6px;min-height:44px;padding:5px 10px 2px}.sandbox-composer-input>.invocation-chips{flex:0 1 auto}.sandbox-composer-input>.comp-input{flex:1 1 180px;min-width:120px;min-height:28px;padding:4px 0;line-height:20px}.sandbox-codex-composer .composer-command-menu{z-index:100;display:flex;max-height:min(420px,calc(100vh - 180px));flex-direction:column}.sandbox-codex-composer .composer-command-list{min-height:0;max-height:none}.sandbox-composer-wrap .composer-left-controls{grid-row:2;grid-column:1;justify-self:start}.composer-left-controls{display:flex;align-items:center;gap:2px;min-width:0}.sandbox-composer-control{width:32px;height:32px}.sandbox-composer-control svg{width:16px;height:16px}.sandbox-composer-control.is-locked{color:hsl(var(--muted-foreground) / .56)}.sandbox-codex-composer .composer-menu-separator{height:1px;margin:4px 6px;background:hsl(var(--border))}.turn--system{width:100%;align-items:stretch;margin-bottom:16px}.sandbox-activity-record{width:100%;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background) / .72);color:hsl(var(--muted-foreground))}.sandbox-activity-summary{display:grid;grid-template-columns:7px auto minmax(0,1fr) auto;align-items:center;gap:7px;min-width:0;font-size:12px;line-height:1.45}.sandbox-activity-dot{width:7px;height:7px;border-radius:50%;background:hsl(var(--muted-foreground) / .68)}.sandbox-activity-label{padding-right:7px;border-right:1px solid hsl(var(--border));color:hsl(var(--muted-foreground));font-size:11px;font-weight:600}.sandbox-activity-summary strong{min-width:0;overflow-wrap:anywhere;color:hsl(var(--foreground));font-weight:560}.sandbox-activity-summary time{color:hsl(var(--muted-foreground));font-size:11px;white-space:nowrap}.sandbox-activity-details{display:grid;gap:5px;margin:8px 0 0 21px}.sandbox-activity-details>div{min-width:0;display:grid;grid-template-columns:max-content minmax(0,1fr);gap:12px;font-size:12px;line-height:1.5}.sandbox-activity-details dt,.sandbox-activity-details dd{min-width:0;margin:0}.sandbox-activity-details dt{color:hsl(var(--muted-foreground));white-space:nowrap}.sandbox-activity-details dd{overflow-wrap:break-word;color:hsl(var(--foreground))}.sandbox-activity-details code{font:inherit;font-size:11px;line-height:1.5;white-space:pre-wrap}.sandbox-composer-wrap .comp-send{grid-row:2;grid-column:2}.main.is-sandbox-session{position:relative;isolation:isolate;background:linear-gradient(to bottom,#f4edfd,#f8f3fc,#fbf8fc 48%,hsl(var(--panel)) 76%)}.main.is-sandbox-session:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse 78% 40% at 18% 0%,hsl(244 82% 84% / .24),transparent 70%),radial-gradient(ellipse 70% 36% at 52% 0%,hsl(284 70% 86% / .2),transparent 72%),radial-gradient(ellipse 64% 38% at 88% 2%,hsl(324 66% 88% / .16),transparent 72%),linear-gradient(to bottom,hsl(var(--panel) / 0),hsl(var(--panel) / .18) 42%,hsl(var(--panel)) 76%);filter:blur(24px);opacity:1;animation:sandbox-smoke-enter .42s ease-out both}.main.is-sandbox-session>*{position:relative;z-index:1}.sandbox-dialog-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .24);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.sandbox-dialog{width:min(440px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel));box-shadow:0 20px 56px hsl(var(--foreground) / .2);animation:sandbox-dialog-enter .18s ease-out both}.sandbox-dialog-visual{position:relative;display:grid;height:112px;place-items:center;overflow:hidden;border-bottom:1px solid hsl(var(--border));background:radial-gradient(circle at 35% 70%,hsl(256 68% 78% / .34),transparent 40%),radial-gradient(circle at 68% 30%,hsl(276 66% 72% / .28),transparent 42%),#f9f8fc}.sandbox-dialog-orbit{position:absolute;width:104px;height:44px;border:1px solid hsl(268 52% 54% / .22);border-radius:50%;transform:rotate(-12deg)}.sandbox-dialog-icon{display:grid;width:46px;height:46px;place-items:center;border:1px solid hsl(268 58% 58% / .3);border-radius:14px;background:hsl(var(--panel) / .9);color:#68389f;box-shadow:0 8px 24px #6c38a824}.sandbox-dialog-icon svg{width:23px;height:23px}.sandbox-spinner{width:21px;height:21px;border:2px solid hsl(268 48% 42% / .2);border-top-color:currentColor;border-radius:50%;animation:sandbox-spin .8s linear infinite}.sandbox-dialog-copy{padding:22px 24px 20px;text-align:center}.sandbox-dialog-copy h2{margin:0 0 8px;color:hsl(var(--foreground));font-size:17px;font-weight:650}.sandbox-dialog-copy p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.65}.sandbox-dialog-copy .sandbox-dialog-error{color:hsl(var(--destructive))}.sandbox-dialog-field{display:grid;gap:6px;margin-top:16px;text-align:left}.sandbox-dialog-field-label{display:flex;align-items:center;justify-content:space-between;gap:12px;color:hsl(var(--foreground));font-size:12px;font-weight:550}.sandbox-dialog-field-label>:last-child{color:hsl(var(--muted-foreground));font-size:11px;font-weight:400}.sandbox-dialog-field input{width:100%;height:36px;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;outline:none;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px}.sandbox-dialog-field input:focus-visible{border-color:hsl(var(--primary) / .64);box-shadow:0 0 0 2px hsl(var(--primary) / .14)}.sandbox-dialog-field input:disabled{cursor:default;opacity:.66}.sandbox-dialog-actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.sandbox-dialog-actions button{min-width:80px;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-dialog-actions button:hover{background:hsl(var(--secondary))}.sandbox-dialog-actions button:focus-visible{outline:2px solid hsl(268 58% 50% / .34);outline-offset:2px}.sandbox-dialog-actions .is-primary{border-color:#68389f;background:#68389f;color:hsl(var(--primary-foreground))}.sandbox-dialog-actions .is-primary:hover{background:#5b318c}@keyframes sandbox-spin{to{transform:rotate(360deg)}}@keyframes sandbox-dialog-enter{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes sandbox-smoke-enter{0%{opacity:0}to{opacity:1}}.sandbox-codex-composer .composer-command-head small{max-width:210px;overflow:hidden;color:hsl(var(--muted-foreground));font-size:10px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.sandbox-codex-composer .composer-command-icon--command,.sandbox-codex-composer .composer-command-icon--model{font-size:16px;font-weight:700;line-height:1}.sandbox-codex-composer .composer-command-icon--command{background:hsl(var(--accent));color:hsl(var(--foreground))}.sandbox-codex-composer .composer-command-icon--model{background:hsl(var(--secondary));color:hsl(var(--foreground))}.sandbox-token-usage{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-right:auto}.sandbox-token-usage>span{display:inline-flex;align-items:baseline;gap:4px;padding:3px 7px;border:1px solid hsl(var(--border) / .76);border-radius:6px;background:hsl(var(--muted) / .42);color:hsl(var(--muted-foreground));white-space:nowrap}.sandbox-token-usage small{font-size:9px;font-weight:560}.sandbox-token-usage strong{color:hsl(var(--foreground) / .76);font-size:10px;font-weight:600;line-height:1.2}@media (max-width: 700px){.sandbox-entry--header span{display:none}.sandbox-entry--header{width:32px;padding:0}.sandbox-session-warning{grid-template-columns:1fr auto;width:calc(100% - 16px)}.sandbox-session-warning-copy{grid-column:1;white-space:normal;text-align:left}.sandbox-session-warning button{grid-column:2}.sandbox-activity-summary{grid-template-columns:7px auto minmax(0,1fr)}.sandbox-activity-summary time{grid-column:3}.sandbox-activity-details>div{grid-template-columns:1fr;gap:1px}}@media (prefers-reduced-motion: reduce){.sandbox-entry,.sandbox-dialog,.main.is-sandbox-session:before{animation:none;transition:none}}.sandbox-control-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1220;display:grid;place-items:center;padding:28px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:sandbox-control-fade .14s ease-out}.sandbox-control-dialog{width:min(680px,calc(100vw - 40px));max-height:min(780px,calc(100vh - 48px));display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:13px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .17);animation:sandbox-control-rise .18s cubic-bezier(.2,.8,.2,1)}.sandbox-control-head{min-height:60px;display:grid;grid-template-columns:32px minmax(0,1fr) 32px;align-items:center;gap:10px;padding:0 15px 0 17px;border-bottom:1px solid hsl(var(--border))}.sandbox-control-head-icon{width:32px;height:32px;display:grid;place-items:center;border-radius:8px;background:hsl(var(--secondary));color:hsl(var(--foreground))}.sandbox-control-head-icon svg{width:17px;height:17px}.sandbox-control-head h2,.sandbox-control-head p{margin:0}.sandbox-control-head h2{color:hsl(var(--foreground));font-size:14px;font-weight:660;line-height:1.35}.sandbox-control-head p{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.sandbox-control-close{width:30px;height:30px;display:grid;place-items:center;padding:0;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.sandbox-control-close:hover{background:hsl(var(--secondary));color:hsl(var(--foreground))}.sandbox-control-dialog button:focus-visible,.sandbox-control-dialog input:focus-visible,.sandbox-control-dialog iframe:focus-visible{outline:2px solid hsl(var(--primary));outline-offset:1px}.sandbox-control-close svg{width:16px;height:16px}.sandbox-control-body{min-height:0;overflow:auto;padding:18px}.sandbox-control-actions{min-height:58px;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:10px 18px;border-top:1px solid hsl(var(--border));background:hsl(var(--secondary) / .16)}.sandbox-control-actions button,.sandbox-control-state button{min-height:32px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:590;text-decoration:none;cursor:pointer}.sandbox-control-actions button:hover:not(:disabled),.sandbox-control-state button:hover{border-color:hsl(var(--foreground) / .2);background:hsl(var(--secondary))}.sandbox-control-actions button.is-primary,.sandbox-control-state button{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.sandbox-control-actions button:disabled{cursor:default;opacity:.5}.sandbox-control-actions svg{width:13px;height:13px}.sandbox-choice-group{margin:0 0 18px;padding:0;border:0}.sandbox-settings-dialog{width:min(720px,calc(100vw - 40px))}.sandbox-choice-group legend{margin-bottom:8px;color:hsl(var(--foreground));font-size:12px;font-weight:650}.sandbox-choice-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.sandbox-choice-group:nth-of-type(3) .sandbox-choice-list{grid-template-columns:repeat(2,minmax(0,1fr))}.sandbox-choice-list button{min-width:0;min-height:72px;display:flex;align-items:flex-start;gap:8px;padding:10px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;text-align:left;cursor:pointer}.sandbox-choice-list button:hover:not(:disabled),.sandbox-choice-list button.is-active{border-color:hsl(var(--primary) / .42);background:hsl(var(--accent))}.sandbox-choice-list button.is-danger:hover:not(:disabled),.sandbox-choice-list button.is-danger.is-active{border-color:hsl(var(--destructive) / .38);background:hsl(var(--destructive) / .06)}.sandbox-choice-list button>i{width:12px;height:12px;flex:0 0 auto;margin-top:2px;border:1px solid hsl(var(--border));border-radius:50%}.sandbox-choice-list button.is-active>i{border:3px solid hsl(var(--primary));background:hsl(var(--background))}.sandbox-choice-list button>span{min-width:0;display:grid;gap:5px}.sandbox-choice-list strong{color:hsl(var(--foreground));font-size:11px;font-weight:650}.sandbox-choice-list small{color:hsl(var(--muted-foreground));font-size:11px;line-height:1.45}.sandbox-network-toggle{min-height:54px;display:flex;align-items:center;gap:12px;margin-top:2px;padding:9px 11px;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .24)}.sandbox-network-toggle>span{min-width:0;flex:1;display:grid;gap:3px}.sandbox-network-toggle strong{font-size:11px}.sandbox-network-toggle small{color:hsl(var(--muted-foreground));font-size:11px}.sandbox-network-toggle input{width:16px;height:16px;accent-color:hsl(var(--primary))}.sandbox-network-toggle.is-disabled{opacity:.62}.sandbox-control-note,.sandbox-control-error{margin-top:12px;padding:9px 11px;border:1px solid hsl(42 70% 52% / .25);border-radius:8px;background:#fcf8ed;color:#916622;font-size:12px;line-height:1.55}.sandbox-control-note.is-danger,.sandbox-control-error{border-color:hsl(var(--destructive) / .22);background:hsl(var(--destructive) / .06);color:hsl(var(--destructive))}.sandbox-workspace-dialog{width:min(600px,calc(100vw - 40px))}.sandbox-workspace-input{display:grid;gap:7px;color:hsl(var(--foreground));font-size:11px;font-weight:650}.sandbox-workspace-input>div{display:flex;gap:7px}.sandbox-workspace-input input{min-width:0;height:36px;flex:1;padding:0 10px;border:1px solid hsl(var(--border));border-radius:8px;outline:0;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px}.sandbox-workspace-input input:focus{border-color:hsl(var(--primary) / .55);box-shadow:0 0 0 3px hsl(var(--primary) / .1)}.sandbox-workspace-input button{width:64px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--secondary) / .35);color:hsl(var(--foreground));font:inherit;font-size:11px;cursor:pointer}.sandbox-directory-browser{height:268px;margin-top:14px;overflow:hidden;border:1px solid hsl(var(--border));border-radius:9px;background:hsl(var(--secondary) / .14)}.sandbox-directory-head{height:36px;display:flex;align-items:center;gap:8px;padding:0 10px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--background));color:hsl(var(--muted-foreground));font:inherit;font-size:10px}.sandbox-directory-head span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sandbox-directory-head svg{width:13px}.sandbox-directory-list{height:calc(100% - 36px);overflow:auto;padding:5px}.sandbox-directory-list button{width:100%;min-height:34px;display:grid;grid-template-columns:18px minmax(0,auto) minmax(0,1fr) 16px;align-items:center;gap:7px;padding:5px 7px;border:0;border-radius:7px;background:transparent;color:hsl(var(--foreground));font:inherit;font-size:11px;text-align:left;cursor:pointer}.sandbox-directory-list button:hover{background:hsl(var(--foreground) / .05)}.sandbox-directory-list button>svg:first-child{width:15px;color:hsl(var(--foreground))}.sandbox-directory-list button>svg:last-child{width:13px;color:hsl(var(--muted-foreground))}.sandbox-directory-list button small{overflow:hidden;color:hsl(var(--muted-foreground));font-size:11px;text-overflow:ellipsis;white-space:nowrap}.sandbox-directory-empty{display:grid;min-height:120px;place-items:center;color:hsl(var(--muted-foreground));font-size:11px}.sandbox-tool-dialog{width:min(1120px,calc(100vw - 44px));height:min(760px,calc(100vh - 48px));max-height:none}.sandbox-tool-toolbar{min-height:42px;display:flex;align-items:center;gap:12px;padding:5px 14px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--secondary) / .2)}.sandbox-tool-toolbar>span{display:inline-flex;align-items:center;gap:7px;color:hsl(var(--muted-foreground));font-size:10px;font-weight:600}.sandbox-tool-toolbar>span i{width:7px;height:7px;border-radius:50%;background:hsl(var(--muted-foreground) / .5)}.sandbox-tool-toolbar>span i.is-ready{background:#2ab262}.sandbox-tool-toolbar>span i.is-loading{background:#e9ab1c}.sandbox-tool-surface{flex:1;min-height:0;display:grid;overflow:hidden;background:hsl(var(--secondary) / .2)}.sandbox-tool-dialog--terminal .sandbox-tool-surface{background:#15171e}.sandbox-tool-surface iframe{width:100%;height:100%;border:0;background:hsl(var(--background))}.sandbox-control-state{display:grid;place-items:center;align-content:center;gap:8px;padding:28px;color:hsl(var(--muted-foreground));text-align:center}.sandbox-control-state>svg{width:22px;height:22px;color:hsl(var(--foreground))}.sandbox-control-state strong{color:hsl(var(--foreground));font-size:13px}.sandbox-control-state span{max-width:420px;font-size:11px;line-height:1.55}.sandbox-approval-dialog{width:min(560px,calc(100vw - 40px))}.sandbox-approval-reason{margin-bottom:11px;color:hsl(var(--foreground));font-size:12px;line-height:1.55}.sandbox-approval-dialog pre{max-height:240px;margin:0 0 10px;overflow:auto;padding:11px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:#181a21;color:#e0e6eb;font:inherit;font-size:11px;line-height:1.55;white-space:pre-wrap;word-break:break-word}.sandbox-approval-meta{color:hsl(var(--muted-foreground));font-size:10px}.sandbox-approval-meta code{color:hsl(var(--foreground));font:inherit;font-size:10px}.sandbox-approval-actions{flex-wrap:wrap}.sandbox-threads-dialog{width:min(620px,calc(100vw - 40px))}.sandbox-thread-list{display:grid;max-height:min(520px,64vh);overflow-y:auto;padding:7px}.sandbox-thread-list>button{display:grid;grid-template-columns:minmax(0,1fr) auto 18px;align-items:center;gap:10px;min-height:62px;padding:9px 10px;border:0;border-radius:9px;background:transparent;color:hsl(var(--foreground));font:inherit;text-align:left;cursor:pointer}.sandbox-thread-list>button:hover{background:hsl(var(--accent))}.sandbox-thread-list>button.is-active{background:hsl(var(--muted) / .7);cursor:default}.sandbox-thread-list>button>span{display:grid;min-width:0;gap:4px}.sandbox-thread-list strong,.sandbox-thread-list small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sandbox-thread-list strong{font-size:12px;font-weight:620}.sandbox-thread-list small,.sandbox-thread-list time{color:hsl(var(--muted-foreground));font-size:10px}.sandbox-thread-list svg{width:14px;height:14px;color:hsl(var(--muted-foreground))}@keyframes sandbox-control-fade{0%{opacity:0}to{opacity:1}}@keyframes sandbox-control-rise{0%{opacity:0;transform:translateY(8px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 720px){.sandbox-control-backdrop{padding:10px}.sandbox-control-dialog{width:100%;max-height:calc(100vh - 20px)}.sandbox-tool-dialog{height:calc(100vh - 20px)}.sandbox-choice-list,.sandbox-choice-group:nth-of-type(3) .sandbox-choice-list{grid-template-columns:1fr}.sandbox-choice-list button{min-height:58px}.sandbox-control-head p{display:none}.sandbox-control-actions>button{flex:1}}@media (prefers-reduced-motion: reduce){.sandbox-control-backdrop,.sandbox-control-dialog{animation:none}}.sandbox-agent-details{display:grid;align-content:start;gap:20px;width:min(920px,100%);height:100%;min-height:0;margin:0 auto;padding:28px 32px;overflow:auto}.sandbox-agent-details-header{display:grid;gap:20px}.sandbox-agent-back{display:inline-flex;width:fit-content;height:32px;align-items:center;gap:6px;padding:0 8px;border:0;border-radius:7px;background:transparent;color:hsl(var(--muted-foreground));font:inherit;font-size:12px;font-weight:550;cursor:pointer}.sandbox-agent-back:hover{background:hsl(var(--muted));color:hsl(var(--foreground))}.sandbox-agent-back:focus-visible{outline:2px solid hsl(var(--foreground) / .3);outline-offset:2px}.sandbox-agent-back svg{width:16px;height:16px;flex:0 0 auto}.sandbox-agent-details-header h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650}.sandbox-agent-details-header p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px}.sandbox-agent-detail-error{padding:10px 12px;border:1px solid hsl(var(--destructive) / .3);border-radius:8px;background:hsl(var(--destructive) / .06);color:hsl(var(--destructive));font-size:12.5px}.sandbox-agent-detail-panel{overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--panel))}.sandbox-agent-detail-panel dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:8px 24px}.sandbox-agent-detail-panel dl>div{min-width:0;padding:16px 0;border-bottom:1px solid hsl(var(--border))}.sandbox-agent-detail-panel dl>div:nth-last-child(-n+2){border-bottom:0}.sandbox-agent-detail-panel dl>div:nth-child(odd){padding-right:24px}.sandbox-agent-detail-panel dl>div:nth-child(2n){padding-left:24px}.sandbox-agent-detail-panel dl>.is-wide{grid-column:1 / -1;padding-right:0}.sandbox-agent-detail-panel dt{margin-bottom:6px;color:hsl(var(--muted-foreground));font-size:11.5px}.sandbox-agent-detail-panel dd{min-width:0;margin:0;overflow-wrap:anywhere;color:hsl(var(--foreground));font-size:13px;font-weight:520}.sandbox-agent-detail-panel footer{display:flex;justify-content:flex-end;gap:8px;padding:14px 24px;border-top:1px solid hsl(var(--border));background:hsl(var(--muted) / .25)}.sandbox-agent-detail-panel footer button{height:34px;padding:0 14px;border-radius:8px;font:inherit;font-size:12px;font-weight:600;cursor:pointer}.sandbox-agent-delete{border:1px solid hsl(var(--destructive) / .34);background:hsl(var(--panel));color:hsl(var(--destructive))}.sandbox-agent-open{border:1px solid hsl(var(--foreground));background:hsl(var(--foreground));color:hsl(var(--background))}.sandbox-agent-detail-panel footer button:disabled{cursor:default;opacity:.58}@media (max-width: 720px){.sandbox-agent-details{padding:20px 16px}.sandbox-agent-detail-panel dl{grid-template-columns:1fr;padding:8px 16px}.sandbox-agent-detail-panel dl>div,.sandbox-agent-detail-panel dl>div:nth-child(odd),.sandbox-agent-detail-panel dl>div:nth-child(2n){padding:14px 0;border-bottom:1px solid hsl(var(--border))}.sandbox-agent-detail-panel dl>div:last-child{border-bottom:0}}@layer components{._SegmentedControl_1sl7d_1{--segmented-control-option-radius: calc( var(--segmented-control-radius) - var(--segmented-control-gutter) );position:relative;overflow:auto;display:inline-flex;flex-wrap:nowrap;gap:var(--segmented-control-gap);height:var(--segmented-control-size);padding:var(--segmented-control-gutter);border-radius:var(--segmented-control-radius);background:var(--segmented-control-background);font-size:var(--segmented-control-font-size);font-weight:var(--segmented-control-font-weight);-ms-overflow-style:none;scrollbar-width:none;vertical-align:middle;white-space:nowrap}._SegmentedControl_1sl7d_1::-webkit-scrollbar{width:0;height:0}._SegmentedControl_1sl7d_1::-webkit-scrollbar-track,._SegmentedControl_1sl7d_1::-webkit-scrollbar-thumb{background:transparent}._SegmentedControl_1sl7d_1:where([data-block]){overflow:hidden;display:flex;width:100%;white-space:wrap}._SegmentedControl_1sl7d_1:where([data-size="3xs"]){--segmented-control-size: var(--control-size-3xs);--segmented-control-font-size: var(--control-font-size-sm);--segmented-control-radius: var(--control-radius-sm);--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-size="2xs"]){--segmented-control-size: var(--control-size-2xs);--segmented-control-font-size: var(--control-font-size-sm);--segmented-control-radius: var(--control-radius-sm);--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-size=xs]){--segmented-control-size: var(--control-size-xs);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-sm);--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-size=sm]){--segmented-control-size: var(--control-size-sm);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-md);--segmented-control-option-gutter: var(--control-gutter-sm)}._SegmentedControl_1sl7d_1:where([data-size=md]){--segmented-control-size: var(--control-size-md);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-md);--segmented-control-option-gutter: var(--control-gutter-md)}._SegmentedControl_1sl7d_1:where([data-size=lg]){--segmented-control-size: var(--control-size-lg);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-md);--segmented-control-option-gutter: var(--control-gutter-md)}._SegmentedControl_1sl7d_1:where([data-size=xl]){--segmented-control-size: var(--control-size-xl);--segmented-control-font-size: var(--control-font-size-md);--segmented-control-radius: var(--control-radius-lg);--segmented-control-option-gutter: var(--control-gutter-lg)}._SegmentedControl_1sl7d_1:where([data-size="2xl"]){--segmented-control-size: var(--control-size-2xl);--segmented-control-font-size: var(--control-font-size-lg);--segmented-control-radius: var(--control-radius-xl);--segmented-control-option-gutter: var(--control-gutter-xl)}._SegmentedControl_1sl7d_1:where([data-size="3xl"]){--segmented-control-size: var(--control-size-3xl);--segmented-control-font-size: var(--control-font-size-lg);--segmented-control-radius: var(--control-radius-xl);--segmented-control-option-gutter: var(--control-gutter-xl)}._SegmentedControl_1sl7d_1:where([data-gutter-size="2xs"]){--segmented-control-option-gutter: var(--control-gutter-2xs)}._SegmentedControl_1sl7d_1:where([data-gutter-size=xs]){--segmented-control-option-gutter: var(--control-gutter-xs)}._SegmentedControl_1sl7d_1:where([data-gutter-size=sm]){--segmented-control-option-gutter: var(--control-gutter-sm)}._SegmentedControl_1sl7d_1:where([data-gutter-size=md]){--segmented-control-option-gutter: var(--control-gutter-md)}._SegmentedControl_1sl7d_1:where([data-gutter-size=lg]){--segmented-control-option-gutter: var(--control-gutter-lg)}._SegmentedControl_1sl7d_1:where([data-gutter-size=xl]){--segmented-control-option-gutter: var(--control-gutter-xl)}._SegmentedControl_1sl7d_1:where([data-pill]){--segmented-control-radius: var(--radius-full);--segmented-control-option-radius: var(--radius-full)}._SegmentedControlOption_1sl7d_140{position:relative;padding:0 var(--segmented-control-option-gutter);border-radius:var(--segmented-control-option-radius);color:var(--color-text-secondary);cursor:pointer;line-height:1;transition-duration:var(--transition-duration-basic);transition-property:opacity,background-color,color;transition-timing-function:var(--transition-ease-basic)}._SegmentedControlOption_1sl7d_140:focus{outline:0}:where(._SegmentedControl_1sl7d_1[data-block]) ._SegmentedControlOption_1sl7d_140{flex:1}:where(._SegmentedControl_1sl7d_1[data-pill]) ._SegmentedControlOption_1sl7d_140{padding:0 calc(var(--segmented-control-option-gutter) * var(--control-gutter-pill-scaling))}._SegmentedControlOption_1sl7d_140[data-state=on]:focus-visible{outline:2px solid var(--color-ring)}._SegmentedControlOption_1sl7d_140:before{position:absolute;inset:var(--segmented-control-option-highlight-gutter);border-radius:var(--segmented-control-option-radius);background:var(--segmented-control-option-highlight-background-color);content:"";opacity:0;pointer-events:none;transform:scale(1);transition-duration:var(--transition-duration-basic);transition-property:opacity,transform;transition-timing-function:var(--transition-ease-basic);will-change:transform}._SegmentedControlOption_1sl7d_140:active:before{transform:scale(var(--scale),.97)}._SegmentedControlOption_1sl7d_140 svg{display:block}@media (hover: hover) and (pointer: fine){._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):hover{color:var(--color-text)}._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):hover:before{opacity:.5}}._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):focus-visible{color:var(--color-text);outline:2px solid var(--color-ring)}._SegmentedControlOption_1sl7d_140[data-state=off]:where(:not([disabled])):active:before{opacity:.75}._SegmentedControlOption_1sl7d_140[data-state=on]{color:var(--color-text)}._SegmentedControlOption_1sl7d_140[data-disabled]{cursor:not-allowed;opacity:.5}._SegmentedControlOption_1sl7d_140[data-disabled]:before{opacity:0!important}._SegmentedControlThumb_1sl7d_219{position:absolute;top:var(--segmented-control-gutter);bottom:var(--segmented-control-gutter);left:0;border-radius:var(--segmented-control-option-radius);background:var(--segmented-control-thumb-background);box-shadow:var(--segmented-control-thumb-shadow);pointer-events:none;will-change:transform}}.sandbox-agent-workspace{display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-height:0;background:hsl(var(--canvas))}.sandbox-agent-workspace>header{display:flex;min-width:0;min-height:62px;align-items:center;justify-content:space-between;gap:16px;padding:10px 18px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--panel))}.sandbox-agent-workspace-title{display:flex;min-width:0;align-items:center;gap:10px}.sandbox-agent-workspace-title>button{display:inline-grid;width:24px;height:32px;flex:0 0 auto;place-items:center;padding:0;border:0;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.sandbox-agent-workspace-title>button:hover{color:hsl(var(--foreground))}.sandbox-agent-workspace-title svg{width:17px;height:17px}.sandbox-agent-workspace-title>div{min-width:0}.sandbox-agent-workspace-title h1{margin:0;overflow:hidden;color:hsl(var(--foreground));font-size:15px;font-weight:620;text-overflow:ellipsis;white-space:nowrap}.sandbox-agent-workspace-title p{display:flex;align-items:center;gap:7px;margin:3px 0 0;color:hsl(var(--muted-foreground));font-size:11.5px}.sandbox-agent-workspace-status{display:inline-flex;min-height:18px;align-items:center;padding:0 6px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--muted));color:hsl(var(--muted-foreground));font-size:10.5px;font-weight:550;line-height:1}.sandbox-agent-workspace-status[data-ready]{border-color:#428a5c38;background:#e9f6ee;color:#206f3d}.sandbox-agent-workspace-tabs{width:200px;flex:0 0 auto}.sandbox-agent-workspace button:focus-visible{outline:2px solid hsl(var(--foreground) / .3);outline-offset:2px}.sandbox-agent-workspace-surface{min-width:0;min-height:0;overflow:hidden}.sandbox-agent-workspace-surface iframe{display:block;width:100%;height:100%;border:0;background:hsl(var(--panel))}.sandbox-agent-workspace-state{display:grid;height:100%;place-content:center;gap:12px;color:hsl(var(--muted-foreground));font-size:13px;text-align:center}.sandbox-agent-workspace-state p{margin:0}.sandbox-agent-workspace-state.is-error{color:hsl(var(--destructive))}.sandbox-agent-workspace-state button{justify-self:center;height:34px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--panel));color:hsl(var(--foreground));font:inherit;font-size:12px;cursor:pointer}@media (max-width: 720px){.sandbox-agent-workspace>header{align-items:stretch;flex-direction:column}.sandbox-agent-workspace-tabs{width:100%}}.auth-expired-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:140;display:grid;place-items:center;padding:20px;background:hsl(var(--foreground) / .22);backdrop-filter:blur(5px) saturate(.88);-webkit-backdrop-filter:blur(5px) saturate(.88)}.auth-expired-dialog{position:relative;width:min(400px,calc(100vw - 40px));overflow:hidden;border:1px solid hsl(var(--border));border-radius:16px;background:hsl(var(--panel));box-shadow:0 28px 80px hsl(var(--foreground) / .2),0 2px 8px hsl(var(--foreground) / .06);animation:auth-expired-enter .18s cubic-bezier(.22,1,.36,1) both}.auth-expired-mark{display:grid;width:32px;height:32px;margin:32px auto 0;place-items:center;color:hsl(var(--foreground))}.auth-expired-mark svg{width:21px;height:21px;stroke-width:1.8}.auth-expired-copy{padding:22px 32px 28px;text-align:center}.auth-expired-copy h2{margin:0;color:hsl(var(--foreground));font-size:19px;font-weight:650;letter-spacing:-.01em}.auth-expired-copy>p:last-child{margin:11px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.7}.auth-expired-copy .auth-expired-error{margin-top:10px;color:hsl(var(--destructive))}.auth-expired-actions{padding:0 16px 16px}.auth-expired-actions button{width:100%;height:38px;border:1px solid hsl(var(--foreground));border-radius:9px;background:hsl(var(--foreground));color:hsl(var(--background));font:inherit;font-size:13px;font-weight:650;cursor:pointer;transition:transform .12s ease,opacity .12s ease}.auth-expired-actions button:hover{opacity:.88}.auth-expired-actions button:active{transform:translateY(1px)}.auth-expired-actions button:focus-visible{outline:3px solid hsl(var(--ring) / .28);outline-offset:2px}.auth-expired-actions button:disabled{cursor:wait;opacity:.58}@keyframes auth-expired-enter{0%{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media (prefers-reduced-motion: reduce){.auth-expired-dialog{animation:none}}.issue-feedback-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1200;display:grid;place-items:center;padding:24px;background:hsl(var(--foreground) / .22);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:issue-feedback-fade-in .14s ease-out}.issue-feedback-dialog{width:min(480px,calc(100vw - 32px));max-height:min(680px,calc(100vh - 48px));display:flex;flex-direction:column;overflow:hidden;border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--background));box-shadow:0 24px 64px hsl(var(--foreground) / .16);animation:issue-feedback-rise-in .18s cubic-bezier(.2,.8,.2,1)}.issue-feedback-head{min-height:58px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 16px 0 20px;border-bottom:1px solid hsl(var(--border))}.issue-feedback-head h2{margin:0;font-size:17px;font-weight:600;line-height:1.3}.issue-feedback-close{width:30px;height:30px;display:grid;place-items:center;flex:0 0 auto;padding:0;border:0;border-radius:6px;background:transparent;color:hsl(var(--muted-foreground));cursor:pointer}.issue-feedback-close svg,.issue-feedback-success-mark svg{width:16px;height:16px}.issue-feedback-close:hover:not(:disabled){background:hsl(var(--secondary));color:hsl(var(--foreground))}.issue-feedback-body,.issue-feedback-success{min-height:0;overflow-y:auto;padding:20px}.issue-feedback-intro{margin:0 0 12px;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.55}.issue-feedback-privacy{margin:0 0 16px;padding:10px 12px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12.5px;line-height:1.55}.issue-feedback-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}.issue-feedback-chip{min-height:30px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;cursor:pointer;transition:background .14s ease,border-color .14s ease,color .14s ease}.issue-feedback-chip:hover:not(:disabled){background:hsl(var(--secondary))}.issue-feedback-chip[aria-pressed=true]{border-color:hsl(var(--primary) / .4);background:hsl(var(--primary) / .08);color:hsl(var(--foreground))}.issue-feedback-field{display:grid;gap:8px;color:hsl(var(--foreground));font-size:13px;font-weight:550}.issue-feedback-field textarea{width:100%;min-height:112px;resize:vertical;padding:10px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;font-weight:400;line-height:1.55}.issue-feedback-field textarea::placeholder{color:hsl(var(--muted-foreground))}.issue-feedback-error{margin:12px 0 0;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.issue-feedback-success{min-height:220px;display:grid;grid-template-columns:36px 1fr;gap:12px;align-content:center;align-items:center;animation:issue-feedback-success-in .18s ease-out}.issue-feedback-success-mark{position:relative;width:36px;height:36px;display:grid;place-items:center;border-radius:9px;background:#24a8541a;color:#238b49;animation:issue-feedback-success-pop .32s cubic-bezier(.2,.8,.2,1)}.issue-feedback-success-mark:after{position:absolute;top:-5px;right:-5px;bottom:-5px;left:-5px;border:1px solid hsl(142 60% 34% / .24);border-radius:12px;content:"";opacity:0;animation:issue-feedback-success-ring .44s ease-out}.issue-feedback-success-mark path{stroke-dasharray:24;stroke-dashoffset:24;animation:issue-feedback-check-draw .28s .1s ease-out forwards}.issue-feedback-success h3{margin:0 0 4px;font-size:15px;font-weight:600}.issue-feedback-success p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.55}.issue-feedback-actions button{height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 14px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:12px;font-weight:600;cursor:pointer}.issue-feedback-actions{min-height:58px;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid hsl(var(--border))}.issue-feedback-actions button:hover:not(:disabled){background:hsl(var(--secondary))}.issue-feedback-actions .is-primary{border-color:hsl(var(--primary));background:hsl(var(--primary));color:hsl(var(--primary-foreground))}.issue-feedback-actions .is-primary:hover:not(:disabled){background:hsl(var(--primary) / .9)}.issue-feedback-close:focus-visible,.issue-feedback-chip:focus-visible,.issue-feedback-field textarea:focus-visible,.issue-feedback-actions button:focus-visible{outline:2px solid hsl(var(--primary) / .34);outline-offset:2px}.issue-feedback-dialog button:disabled,.issue-feedback-dialog textarea:disabled{cursor:not-allowed;opacity:.55}@keyframes issue-feedback-fade-in{0%{opacity:0}to{opacity:1}}@keyframes issue-feedback-rise-in{0%{opacity:0;transform:translateY(6px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes issue-feedback-success-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes issue-feedback-success-pop{0%{transform:scale(.72)}70%{transform:scale(1.06)}to{transform:scale(1)}}@keyframes issue-feedback-success-ring{0%{opacity:.7;transform:scale(.78)}to{opacity:0;transform:scale(1.2)}}@keyframes issue-feedback-check-draw{to{stroke-dashoffset:0}}@media (max-width: 560px){.issue-feedback-backdrop{padding:16px}.issue-feedback-dialog{max-height:calc(100vh - 32px)}}@media (prefers-reduced-motion: reduce){.issue-feedback-backdrop,.issue-feedback-dialog,.issue-feedback-success,.issue-feedback-success-mark,.issue-feedback-success-mark:after,.issue-feedback-success-mark path{animation:none}.issue-feedback-success-mark path{stroke-dashoffset:0}}.platform-feedback-page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:32px 32px 0;background:hsl(var(--background))}.platform-feedback-header{flex:0 0 auto}.platform-feedback-header h1{margin:0;color:hsl(var(--foreground));font-size:21px;font-weight:650;line-height:1.25;letter-spacing:-.02em}.platform-feedback-header p{margin:6px 0 0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.5}.platform-feedback-scroll{min-height:0;overflow-y:auto;padding:24px 0 40px}.platform-feedback-form,.platform-feedback-success{width:min(720px,100%)}.platform-feedback-form{display:grid;gap:24px}.platform-feedback-section{display:grid;gap:12px}.platform-feedback-section-heading{display:flex;align-items:center;gap:8px}.platform-feedback-section h2,.platform-feedback-field>span{margin:0;color:hsl(var(--foreground));font-size:14px;font-weight:600;line-height:1.45}.platform-feedback-section-heading>span,.platform-feedback-suggestions>span{color:hsl(var(--muted-foreground));font-size:12px;line-height:1.45}.platform-feedback-pills{display:flex;flex-wrap:wrap;gap:8px}.platform-feedback-pills button{min-height:32px;padding:0 12px;border:1px solid hsl(var(--border));border-radius:999px;background:hsl(var(--background));color:hsl(var(--foreground));cursor:pointer;font:inherit;font-size:12px;transition:background .14s ease,border-color .14s ease}.platform-feedback-pills button:hover:not(:disabled){background:hsl(var(--secondary))}.platform-feedback-pills button[aria-pressed=true]{border-color:hsl(var(--primary) / .42);background:hsl(var(--primary) / .08)}.platform-feedback-field{display:grid;gap:8px}.platform-feedback-field textarea{width:100%;padding:11px 12px;border:1px solid hsl(var(--border));border-radius:8px;background:hsl(var(--background));color:hsl(var(--foreground));font:inherit;font-size:13px;line-height:1.55}.platform-feedback-field textarea{min-height:132px;resize:vertical}.platform-feedback-field textarea::placeholder{color:hsl(var(--muted-foreground))}.platform-feedback-suggestions{display:grid;gap:8px}.platform-feedback-privacy{margin:0;padding:10px 12px;border-radius:8px;background:hsl(var(--destructive) / .08);color:hsl(var(--destructive));font-size:12.5px;line-height:1.55}.platform-feedback-error{margin:0;color:hsl(var(--destructive));font-size:12px;line-height:1.5}.platform-feedback-actions{display:flex;justify-content:flex-end}.platform-feedback-actions button{height:36px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 16px;border:1px solid hsl(var(--primary));border-radius:8px;background:hsl(var(--primary));color:hsl(var(--primary-foreground));cursor:pointer;font:inherit;font-size:12px;font-weight:600}.platform-feedback-actions button:hover:not(:disabled){background:hsl(var(--primary) / .9)}.platform-feedback-success{min-height:280px;display:grid;grid-template-columns:40px minmax(0,1fr);gap:12px;align-content:center;align-items:center;animation:platform-feedback-success-in .18s ease-out}.platform-feedback-success-icon{position:relative;width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:#24a8541a;color:#238b49;animation:platform-feedback-success-pop .32s cubic-bezier(.2,.8,.2,1)}.platform-feedback-success-icon:after{position:absolute;top:-5px;right:-5px;bottom:-5px;left:-5px;border:1px solid hsl(142 60% 34% / .24);border-radius:13px;content:"";opacity:0;animation:platform-feedback-success-ring .44s ease-out}.platform-feedback-success-icon svg{width:16px;height:16px}.platform-feedback-success-icon path{stroke-dasharray:24;stroke-dashoffset:24;animation:platform-feedback-check-draw .28s .1s ease-out forwards}.platform-feedback-success h2{margin:0 0 4px;font-size:15px;font-weight:600}.platform-feedback-success p{margin:0;color:hsl(var(--muted-foreground));font-size:13px;line-height:1.55}.platform-feedback-pills button:focus-visible,.platform-feedback-actions button:focus-visible{outline:2px solid hsl(var(--ring) / .4);outline-offset:2px}.platform-feedback-field textarea:focus-visible{border-color:hsl(var(--ring) / .58);outline:none;box-shadow:inset 0 0 0 1px hsl(var(--ring) / .3)}.platform-feedback-page button:disabled,.platform-feedback-page textarea:disabled{cursor:not-allowed;opacity:.55}@media (max-width: 720px){.platform-feedback-page{padding:24px 20px 0}}@media (max-width: 560px){.platform-feedback-page{padding-inline:16px}}@keyframes platform-feedback-success-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes platform-feedback-success-pop{0%{transform:scale(.72)}70%{transform:scale(1.06)}to{transform:scale(1)}}@keyframes platform-feedback-success-ring{0%{opacity:.7;transform:scale(.78)}to{opacity:0;transform:scale(1.2)}}@keyframes platform-feedback-check-draw{to{stroke-dashoffset:0}}@media (prefers-reduced-motion: reduce){.platform-feedback-pills button,.platform-feedback-success,.platform-feedback-success-icon,.platform-feedback-success-icon:after,.platform-feedback-success-icon path{transition:none;animation:none}.platform-feedback-success-icon path{stroke-dashoffset:0}}.PhotoView-Portal{direction:ltr;height:100%;left:0;overflow:hidden;position:fixed;top:0;touch-action:none;width:100%;z-index:2000}@keyframes PhotoView__rotate{0%{transform:rotate(0)}to{transform:rotate(1turn)}}@keyframes PhotoView__delayIn{0%,50%{opacity:0}to{opacity:1}}.PhotoView__Spinner{animation:PhotoView__delayIn .4s linear both}.PhotoView__Spinner svg{animation:PhotoView__rotate .6s linear infinite}.PhotoView__Photo{cursor:grab;max-width:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.PhotoView__Photo:active{cursor:grabbing}.PhotoView__icon{display:inline-block;left:0;position:absolute;top:0;transform:translate(-50%,-50%)}.PhotoView__PhotoBox,.PhotoView__PhotoWrap{bottom:0;direction:ltr;left:0;position:absolute;right:0;top:0;touch-action:none;width:100%}.PhotoView__PhotoWrap{overflow:hidden;z-index:10}.PhotoView__PhotoBox{transform-origin:left top}@keyframes PhotoView__fade{0%{opacity:0}to{opacity:1}}.PhotoView-Slider__clean .PhotoView-Slider__ArrowLeft,.PhotoView-Slider__clean .PhotoView-Slider__ArrowRight,.PhotoView-Slider__clean .PhotoView-Slider__BannerWrap,.PhotoView-Slider__clean .PhotoView-Slider__Overlay,.PhotoView-Slider__willClose .PhotoView-Slider__BannerWrap:hover{opacity:0}.PhotoView-Slider__Backdrop{background:#000;height:100%;left:0;position:absolute;top:0;transition-property:background-color;width:100%;z-index:-1}.PhotoView-Slider__fadeIn{animation:PhotoView__fade linear both;opacity:0}.PhotoView-Slider__fadeOut{animation:PhotoView__fade linear reverse both;opacity:0}.PhotoView-Slider__BannerWrap{align-items:center;background-color:#00000080;color:#fff;display:flex;height:44px;justify-content:space-between;left:0;position:absolute;top:0;transition:opacity .2s ease-out;width:100%;z-index:20}.PhotoView-Slider__BannerWrap:hover{opacity:1}.PhotoView-Slider__Counter{font-size:14px;opacity:.75;padding:0 10px}.PhotoView-Slider__BannerRight{align-items:center;display:flex;height:100%}.PhotoView-Slider__toolbarIcon{fill:#fff;box-sizing:border-box;cursor:pointer;opacity:.75;padding:10px;transition:opacity .2s linear}.PhotoView-Slider__toolbarIcon:hover{opacity:1}.PhotoView-Slider__ArrowLeft,.PhotoView-Slider__ArrowRight{align-items:center;bottom:0;cursor:pointer;display:flex;height:100px;justify-content:center;margin:auto;opacity:.75;position:absolute;top:0;transition:opacity .2s linear;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:70px;z-index:20}.PhotoView-Slider__ArrowLeft:hover,.PhotoView-Slider__ArrowRight:hover{opacity:1}.PhotoView-Slider__ArrowLeft svg,.PhotoView-Slider__ArrowRight svg{fill:#fff;background:#0000004d;box-sizing:content-box;height:24px;padding:10px;width:24px}.PhotoView-Slider__ArrowLeft{left:0}.PhotoView-Slider__ArrowRight{right:0} diff --git a/veadk/webui/assets/index-CB_XKkbG.js b/veadk/webui/assets/index-D88Zv3M6.js similarity index 62% rename from veadk/webui/assets/index-CB_XKkbG.js rename to veadk/webui/assets/index-D88Zv3M6.js index f10177690..7d7848804 100644 --- a/veadk/webui/assets/index-CB_XKkbG.js +++ b/veadk/webui/assets/index-D88Zv3M6.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-35Gi6h5-.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); -var IK=Object.defineProperty;var HC=e=>{throw TypeError(e)};var jK=(e,t,n)=>t in e?IK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zC=(e,t,n)=>jK(e,typeof t!="symbol"?t+"":t,n),VC=(e,t,n)=>t.has(e)||HC("Cannot "+n);var Pi=(e,t,n)=>(VC(e,t,"read from private field"),n?n.call(e):t.get(e)),GC=(e,t,n)=>t.has(e)?HC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ZE=(e,t,n,s)=>(VC(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);function RK(e,t){for(var n=0;ns[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();var Ll=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ZD={exports:{}},z1={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-BdhMqVzS.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +var jK=Object.defineProperty;var HC=e=>{throw TypeError(e)};var RK=(e,t,n)=>t in e?jK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zC=(e,t,n)=>RK(e,typeof t!="symbol"?t+"":t,n),VC=(e,t,n)=>t.has(e)||HC("Cannot "+n);var Li=(e,t,n)=>(VC(e,t,"read from private field"),n?n.call(e):t.get(e)),GC=(e,t,n)=>t.has(e)?HC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ZE=(e,t,n,s)=>(VC(e,t,"write to private field"),s?s.call(e,n):t.set(e,n),n);function OK(e,t){for(var n=0;ns[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const a of r.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();var Bl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var JD={exports:{}},V1={};/** * @license React * react-jsx-runtime.production.js * @@ -7,7 +7,7 @@ var IK=Object.defineProperty;var HC=e=>{throw TypeError(e)};var jK=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var OK=Symbol.for("react.transitional.element"),MK=Symbol.for("react.fragment");function JD(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:OK,type:e,key:s,ref:t!==void 0?t:null,props:n}}z1.Fragment=MK;z1.jsx=JD;z1.jsxs=JD;ZD.exports=z1;var o=ZD.exports,e5={exports:{}},jt={};/** + */var MK=Symbol.for("react.transitional.element"),LK=Symbol.for("react.fragment");function e5(e,t,n){var s=null;if(n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),"key"in t){n={};for(var i in t)i!=="key"&&(n[i]=t[i])}else n=t;return t=n.ref,{$$typeof:MK,type:e,key:s,ref:t!==void 0?t:null,props:n}}V1.Fragment=LK;V1.jsx=e5;V1.jsxs=e5;JD.exports=V1;var o=JD.exports,t5={exports:{}},It={};/** * @license React * react.production.js * @@ -15,7 +15,7 @@ var IK=Object.defineProperty;var HC=e=>{throw TypeError(e)};var jK=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var dT=Symbol.for("react.transitional.element"),LK=Symbol.for("react.portal"),DK=Symbol.for("react.fragment"),PK=Symbol.for("react.strict_mode"),BK=Symbol.for("react.profiler"),UK=Symbol.for("react.consumer"),FK=Symbol.for("react.context"),$K=Symbol.for("react.forward_ref"),HK=Symbol.for("react.suspense"),zK=Symbol.for("react.memo"),t5=Symbol.for("react.lazy"),VK=Symbol.for("react.activity"),KC=Symbol.iterator;function GK(e){return e===null||typeof e!="object"?null:(e=KC&&e[KC]||e["@@iterator"],typeof e=="function"?e:null)}var n5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},s5=Object.assign,i5={};function Yf(e,t,n){this.props=e,this.context=t,this.refs=i5,this.updater=n||n5}Yf.prototype.isReactComponent={};Yf.prototype.setState=function(e,t){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,t,"setState")};Yf.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function r5(){}r5.prototype=Yf.prototype;function fT(e,t,n){this.props=e,this.context=t,this.refs=i5,this.updater=n||n5}var hT=fT.prototype=new r5;hT.constructor=fT;s5(hT,Yf.prototype);hT.isPureReactComponent=!0;var qC=Array.isArray;function y_(){}var is={H:null,A:null,T:null,S:null},a5=Object.prototype.hasOwnProperty;function mT(e,t,n){var s=n.ref;return{$$typeof:dT,type:e,key:t,ref:s!==void 0?s:null,props:n}}function KK(e,t){return mT(e.type,t,e.props)}function pT(e){return typeof e=="object"&&e!==null&&e.$$typeof===dT}function qK(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var YC=/\/+/g;function JE(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qK(""+e.key):t.toString(36)}function YK(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(y_,y_):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function hd(e,t,n,s,i){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(r){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case dT:case LK:a=!0;break;case t5:return a=e._init,hd(a(e._payload),t,n,s,i)}}if(a)return i=i(e),a=s===""?"."+JE(e,0):s,qC(i)?(n="",a!=null&&(n=a.replace(YC,"$&/")+"/"),hd(i,t,n,"",function(u){return u})):i!=null&&(pT(i)&&(i=KK(i,n+(i.key==null||e&&e.key===i.key?"":(""+i.key).replace(YC,"$&/")+"/")+a)),t.push(i)),1;a=0;var l=s===""?".":s+":";if(qC(e))for(var c=0;c{throw TypeError(e)};var jK=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(C,I){var D=C.length;C.push(I);e:for(;0>>1,O=C[$];if(0>>1;$i(P,D))Qi(ee,P)?(C[$]=ee,C[Q]=D,$=Q):(C[$]=P,C[ne]=D,$=ne);else if(Qi(ee,D))C[$]=ee,C[Q]=D,$=Q;else break e}}return I}function i(C,I){var D=C.sortIndex-I.sortIndex;return D!==0?D:C.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,p=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function w(C){for(var I=n(u);I!==null;){if(I.callback===null)s(u);else if(I.startTime<=C)s(u),I.sortIndex=I.expirationTime,t(c,I);else break;I=n(u)}}function S(C){if(b=!1,w(C),!p)if(n(c)!==null)p=!0,_||(_=!0,B());else{var I=n(u);I!==null&&F(S,I.startTime-C)}}var _=!1,k=-1,T=5,A=-1;function j(){return v?!0:!(e.unstable_now()-AC&&j());){var $=f.callback;if(typeof $=="function"){f.callback=null,h=f.priorityLevel;var O=$(f.expirationTime<=C);if(C=e.unstable_now(),typeof O=="function"){f.callback=O,w(C),I=!0;break t}f===n(c)&&s(c),w(C)}else s(c);f=n(c)}if(f!==null)I=!0;else{var te=n(u);te!==null&&F(S,te.startTime-C),I=!1}}break e}finally{f=null,h=D,m=!1}I=void 0}}finally{I?B():_=!1}}}var B;if(typeof E=="function")B=function(){E(R)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,L=z.port2;z.port1.onmessage=R,B=function(){L.postMessage(null)}}else B=function(){y(R,0)};function F(C,I){k=y(function(){C(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_forceFrameRate=function(C){0>C||125$?(C.sortIndex=D,t(u,C),n(c)===null&&C===n(u)&&(b?(x(k),k=-1):b=!0,F(S,D-$))):(C.sortIndex=O,t(c,C),p||m||(p=!0,_||(_=!0,B()))),C},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(C){var I=h;return function(){var D=h;h=I;try{return C.apply(this,arguments)}finally{h=D}}}})(c5);l5.exports=c5;var QK=l5.exports,u5={exports:{}},tr={};/** + */(function(e){function t(C,I){var D=C.length;C.push(I);e:for(;0>>1,O=C[$];if(0>>1;$i(P,D))Qi(ee,P)?(C[$]=ee,C[Q]=D,$=Q):(C[$]=P,C[se]=D,$=se);else if(Qi(ee,D))C[$]=ee,C[Q]=D,$=Q;else break e}}return I}function i(C,I){var D=C.sortIndex-I.sortIndex;return D!==0?D:C.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,m=!1,b=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function w(C){for(var I=n(u);I!==null;){if(I.callback===null)s(u);else if(I.startTime<=C)s(u),I.sortIndex=I.expirationTime,t(c,I);else break;I=n(u)}}function S(C){if(b=!1,w(C),!m)if(n(c)!==null)m=!0,_||(_=!0,B());else{var I=n(u);I!==null&&F(S,I.startTime-C)}}var _=!1,T=-1,k=5,A=-1;function j(){return v?!0:!(e.unstable_now()-AC&&j());){var $=f.callback;if(typeof $=="function"){f.callback=null,h=f.priorityLevel;var O=$(f.expirationTime<=C);if(C=e.unstable_now(),typeof O=="function"){f.callback=O,w(C),I=!0;break t}f===n(c)&&s(c),w(C)}else s(c);f=n(c)}if(f!==null)I=!0;else{var te=n(u);te!==null&&F(S,te.startTime-C),I=!1}}break e}finally{f=null,h=D,p=!1}I=void 0}}finally{I?B():_=!1}}}var B;if(typeof E=="function")B=function(){E(R)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,L=z.port2;z.port1.onmessage=R,B=function(){L.postMessage(null)}}else B=function(){y(R,0)};function F(C,I){T=y(function(){C(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_forceFrameRate=function(C){0>C||125$?(C.sortIndex=D,t(u,C),n(c)===null&&C===n(u)&&(b?(x(T),T=-1):b=!0,F(S,D-$))):(C.sortIndex=O,t(c,C),m||p||(m=!0,_||(_=!0,B()))),C},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(C){var I=h;return function(){var D=h;h=I;try{return C.apply(this,arguments)}finally{h=D}}}})(u5);c5.exports=u5;var ZK=c5.exports,d5={exports:{}},tr={};/** * @license React * react-dom.production.js * @@ -31,7 +31,7 @@ var IK=Object.defineProperty;var HC=e=>{throw TypeError(e)};var jK=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ZK=g;function d5(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f5)}catch(e){console.error(e)}}f5(),u5.exports=tr;var yi=u5.exports;/** + */var JK=g;function f5(e){var t="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h5)}catch(e){console.error(e)}}h5(),d5.exports=tr;var wi=d5.exports;/** * @license React * react-dom-client.production.js * @@ -39,15 +39,15 @@ var IK=Object.defineProperty;var HC=e=>{throw TypeError(e)};var jK=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var di=QK,h5=g,tq=yi;function Te(e){var t="https://react.dev/errors/"+e;if(1Sd||(e.current=S_[Sd],S_[Sd]=null,Sd--)}function Gn(e,t){Sd++,S_[Sd]=e.current,e.current=t}var no=lo(null),hp=lo(null),zl=lo(null),by=lo(null);function yy(e,t){switch(Gn(zl,t),Gn(hp,e),Gn(no,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sj(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sj(t),e=U6(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}bi(no),Gn(no,e)}function hf(){bi(no),bi(hp),bi(zl)}function N_(e){e.memoizedState!==null&&Gn(by,e);var t=no.current,n=U6(t,e.type);t!==n&&(Gn(hp,e),Gn(no,n))}function xy(e){hp.current===e&&(bi(no),bi(hp)),by.current===e&&(bi(by),Sp._currentValue=qc)}var ev,ZC;function Cc(e){if(ev===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ev=t&&t[1]||"",ZC=-1wd||(e.current=S_[wd],S_[wd]=null,wd--)}function Hn(e,t){wd++,S_[wd]=e.current,e.current=t}var lo=mo(null),um=mo(null),Kl=mo(null),yy=mo(null);function xy(e,t){switch(Hn(Kl,t),Hn(um,e),Hn(lo,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?sj(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=sj(t),e=F6(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}vi(lo),Hn(lo,e)}function df(){vi(lo),vi(um),vi(Kl)}function N_(e){e.memoizedState!==null&&Hn(yy,e);var t=lo.current,n=F6(t,e.type);t!==n&&(Hn(um,e),Hn(lo,n))}function Ey(e){um.current===e&&(vi(lo),vi(um)),yy.current===e&&(vi(yy),vm._currentValue=Wc)}var ev,ZC;function jc(e){if(ev===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ev=t&&t[1]||"",ZC=-1)":-1i||c[s]!==u[i]){var d=` -`+c[s].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=s&&0<=i);break}}}finally{tv=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Cc(n):""}function aq(e,t){switch(e.tag){case 26:case 27:case 5:return Cc(e.type);case 16:return Cc("Lazy");case 13:return e.child!==t&&t!==null?Cc("Suspense Fallback"):Cc("Suspense");case 19:return Cc("SuspenseList");case 0:case 15:return nv(e.type,!1);case 11:return nv(e.type.render,!1);case 1:return nv(e.type,!0);case 31:return Cc("Activity");default:return""}}function JC(e){try{var t="",n=null;do t+=aq(e,n),n=e,e=e.return;while(e);return t}catch(s){return` +`+c[s].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),d}while(1<=s&&0<=i);break}}}finally{tv=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?jc(n):""}function oq(e,t){switch(e.tag){case 26:case 27:case 5:return jc(e.type);case 16:return jc("Lazy");case 13:return e.child!==t&&t!==null?jc("Suspense Fallback"):jc("Suspense");case 19:return jc("SuspenseList");case 0:case 15:return nv(e.type,!1);case 11:return nv(e.type.render,!1);case 1:return nv(e.type,!0);case 31:return jc("Activity");default:return""}}function JC(e){try{var t="",n=null;do t+=oq(e,n),n=e,e=e.return;while(e);return t}catch(s){return` Error generating stack: `+s.message+` -`+s.stack}}var T_=Object.prototype.hasOwnProperty,yT=di.unstable_scheduleCallback,sv=di.unstable_cancelCallback,oq=di.unstable_shouldYield,lq=di.unstable_requestPaint,jr=di.unstable_now,cq=di.unstable_getCurrentPriorityLevel,E5=di.unstable_ImmediatePriority,v5=di.unstable_UserBlockingPriority,Ey=di.unstable_NormalPriority,uq=di.unstable_LowPriority,w5=di.unstable_IdlePriority,dq=di.log,fq=di.unstable_setDisableYieldValue,lg=null,Rr=null;function Dl(e){if(typeof dq=="function"&&fq(e),Rr&&typeof Rr.setStrictMode=="function")try{Rr.setStrictMode(lg,e)}catch{}}var Or=Math.clz32?Math.clz32:pq,hq=Math.log,mq=Math.LN2;function pq(e){return e>>>=0,e===0?32:31-(hq(e)/mq|0)|0}var S0=256,N0=262144,T0=4194304;function Ic(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&261888;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 K1(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,r=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~r,s!==0?i=Ic(s):(a&=l,a!==0?i=Ic(a):n||(n=l&~e,n!==0&&(i=Ic(n))))):(l=s&~r,l!==0?i=Ic(l):a!==0?i=Ic(a):n||(n=s&~e,n!==0&&(i=Ic(n)))),i===0?0:t!==0&&t!==i&&!(t&r)&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function cg(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gq(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _5(){var e=T0;return T0<<=1,!(T0&62914560)&&(T0=4194304),e}function iv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ug(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bq(e,t,n,s,i,r){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var _q=/[\n"\\]/g;function Jr(e){return e.replace(_q,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function C_(e,t,n,s,i,r,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+qr(t)):e.value!==""+qr(t)&&(e.value=""+qr(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?I_(e,a,qr(t)):n!=null?I_(e,a,qr(n)):s!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+qr(l):e.removeAttribute("name")}function R5(e,t,n,s,i,r,a,l){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){A_(e);return}n=n!=null?""+qr(n):"",t=t!=null?""+qr(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??i,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),A_(e)}function I_(e,t,n){t==="number"&&vy(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Zd(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),R_=!1;if(Wo)try{var Hh={};Object.defineProperty(Hh,"passive",{get:function(){R_=!0}}),window.addEventListener("test",Hh,Hh),window.removeEventListener("test",Hh,Hh)}catch{R_=!1}var Pl=null,ST=null,Ib=null;function P5(){if(Ib)return Ib;var e,t=ST,n=t.length,s,i="value"in Pl?Pl.value:Pl.textContent,r=i.length;for(e=0;e=Rm),uI=" ",dI=!1;function U5(e,t){switch(e){case"keyup":return Qq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function F5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var kd=!1;function Jq(e,t){switch(e){case"compositionend":return F5(t);case"keypress":return t.which!==32?null:(dI=!0,uI);case"textInput":return e=t.data,e===uI&&dI?null:e;default:return null}}function eY(e,t){if(kd)return e==="compositionend"||!TT&&U5(e,t)?(e=P5(),Ib=ST=Pl=null,kd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=gI(n)}}function V5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?V5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function G5(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=vy(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vy(e.document)}return t}function kT(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 lY=Wo&&"documentMode"in document&&11>=document.documentMode,Ad=null,O_=null,Mm=null,M_=!1;function yI(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;M_||Ad==null||Ad!==vy(s)||(s=Ad,"selectionStart"in s&&kT(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Mm&&gp(Mm,s)||(Mm=s,s=Uy(O_,"onSelect"),0>=a,i-=a,Za=1<<32-Or(t)+i|n<T?(A=k,k=null):A=k.sibling;var j=h(y,k,E[T],w);if(j===null){k===null&&(k=A);break}e&&k&&j.alternate===null&&t(y,k),x=r(j,x,T),_===null?S=j:_.sibling=j,_=j,k=A}if(T===E.length)return n(y,k),tn&&Ro(y,T),S;if(k===null){for(;TT?(A=k,k=null):A=k.sibling;var R=h(y,k,j.value,w);if(R===null){k===null&&(k=A);break}e&&k&&R.alternate===null&&t(y,k),x=r(R,x,T),_===null?S=R:_.sibling=R,_=R,k=A}if(j.done)return n(y,k),tn&&Ro(y,T),S;if(k===null){for(;!j.done;T++,j=E.next())j=f(y,j.value,w),j!==null&&(x=r(j,x,T),_===null?S=j:_.sibling=j,_=j);return tn&&Ro(y,T),S}for(k=s(k);!j.done;T++,j=E.next())j=m(k,y,T,j.value,w),j!==null&&(e&&j.alternate!==null&&k.delete(j.key===null?T:j.key),x=r(j,x,T),_===null?S=j:_.sibling=j,_=j);return e&&k.forEach(function(B){return t(y,B)}),tn&&Ro(y,T),S}function v(y,x,E,w){if(typeof E=="object"&&E!==null&&E.type===_d&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case _0:e:{for(var S=E.key;x!==null;){if(x.key===S){if(S=E.type,S===_d){if(x.tag===7){n(y,x.sibling),w=i(x,E.props.children),w.return=y,y=w;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Tl&&jc(S)===x.type){n(y,x.sibling),w=i(x,E.props),Vh(w,E),w.return=y,y=w;break e}n(y,x);break}else t(y,x);x=x.sibling}E.type===_d?(w=Yc(E.props.children,y.mode,w,E.key),w.return=y,y=w):(w=Rb(E.type,E.key,E.props,null,y.mode,w),Vh(w,E),w.return=y,y=w)}return a(y);case fm:e:{for(S=E.key;x!==null;){if(x.key===S)if(x.tag===4&&x.stateNode.containerInfo===E.containerInfo&&x.stateNode.implementation===E.implementation){n(y,x.sibling),w=i(x,E.children||[]),w.return=y,y=w;break e}else{n(y,x);break}else t(y,x);x=x.sibling}w=hv(E,y.mode,w),w.return=y,y=w}return a(y);case Tl:return E=jc(E),v(y,x,E,w)}if(hm(E))return p(y,x,E,w);if($h(E)){if(S=$h(E),typeof S!="function")throw Error(Te(150));return E=S.call(E),b(y,x,E,w)}if(typeof E.then=="function")return v(y,x,I0(E),w);if(E.$$typeof===Lo)return v(y,x,C0(y,E),w);j0(y,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,x!==null&&x.tag===6?(n(y,x.sibling),w=i(x,E),w.return=y,y=w):(n(y,x),w=fv(E,y.mode,w),w.return=y,y=w),a(y)):n(y,x)}return function(y,x,E,w){try{xp=0;var S=v(y,x,E,w);return tf=null,S}catch(k){if(k===Jf||k===Z1)throw k;var _=kr(29,k,null,y.mode);return _.lanes=w,_.return=y,_}finally{}}}var cu=a4(!0),o4=a4(!1),kl=!1;function DT(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $_(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 Gl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Kl(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,fn&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,t=_y(e),Z5(e,null,n),t}return Q1(e,s,t,n),_y(e)}function Dm(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,N5(e,n)}}function pv(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=a:r=r.next=a,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var H_=!1;function Pm(){if(H_){var e=ef;if(e!==null)throw e}}function Bm(e,t,n,s){H_=!1;var i=e.updateQueue;kl=!1;var r=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?r=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(r!==null){var f=i.baseState;a=0,d=u=c=null,l=r;do{var h=l.lane&-536870913,m=h!==l.lane;if(m?(Zt&h)===h:(s&h)===h){h!==0&&h===gf&&(H_=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var p=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(p=b.payload,typeof p=="function"){f=p.call(v,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=b.payload,h=typeof p=="function"?p.call(v,f,h):p,h==null)break e;f=as({},f,h);break e;case 2:kl=!0}}h=l.callback,h!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[h]:m.push(h))}else m={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;m=l,l=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,r===null&&(i.shared.lanes=0),ic|=a,e.lanes=a,e.memoizedState=f}}function l4(e,t){if(typeof e!="function")throw Error(Te(191,e));e.call(t)}function c4(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;er?r:8;var a=xt.T,l={};xt.T=l,WT(e,!1,t,n);try{var c=i(),u=xt.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=bY(c,s);Um(e,t,d,Mr(e))}else Um(e,t,s,Mr(e))}catch(f){Um(e,t,{then:function(){},status:"rejected",reason:f},Mr())}finally{hn.p=r,a!==null&&l.types!==null&&(a.types=l.types),xt.T=a}}function _Y(){}function q_(e,t,n,s){if(e.tag!==5)throw Error(Te(476));var i=M4(e).queue;O4(e,i,t,qc,n===null?_Y:function(){return L4(e),n(s)})}function M4(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:qc,baseState:qc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:qc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function L4(e){var t=M4(e);t.next===null&&(t=e.alternate.memoizedState),Um(e,t.next.queue,{},Mr())}function YT(){return Ci(Sp)}function D4(){return Gs().memoizedState}function P4(){return Gs().memoizedState}function SY(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Mr();e=Gl(n);var s=Kl(t,e,n);s!==null&&(hr(s,t,n),Dm(s,t,n)),t={cache:OT()},e.payload=t;return}t=t.return}}function NY(e,t,n){var s=Mr();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},nx(e)?U4(t,n):(n=CT(e,t,n,s),n!==null&&(hr(n,e,s),F4(n,t,s)))}function B4(e,t,n){var s=Mr();Um(e,t,n,s)}function Um(e,t,n,s){var i={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(nx(e))U4(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var a=t.lastRenderedState,l=r(a,n);if(i.hasEagerState=!0,i.eagerState=l,Pr(l,a))return Q1(e,t,i,0),Un===null&&X1(),!1}catch{}finally{}if(n=CT(e,t,i,s),n!==null)return hr(n,e,s),F4(n,t,s),!0}return!1}function WT(e,t,n,s){if(s={lane:2,revertLane:ik(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},nx(e)){if(t)throw Error(Te(479))}else t=CT(e,n,s,2),t!==null&&hr(t,e,2)}function nx(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function U4(e,t){nf=Cy=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function F4(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,N5(e,n)}}var vp={readContext:Ci,use:ex,useCallback:Is,useContext:Is,useEffect:Is,useImperativeHandle:Is,useLayoutEffect:Is,useInsertionEffect:Is,useMemo:Is,useReducer:Is,useRef:Is,useState:Is,useDebugValue:Is,useDeferredValue:Is,useTransition:Is,useSyncExternalStore:Is,useId:Is,useHostTransitionStatus:Is,useFormState:Is,useActionState:Is,useOptimistic:Is,useMemoCache:Is,useCacheRefresh:Is};vp.useEffectEvent=Is;var $4={readContext:Ci,use:ex,useCallback:function(e,t){return Yi().memoizedState=[e,t===void 0?null:t],e},useContext:Ci,useEffect:OI,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Lb(4194308,4,A4.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Lb(4194308,4,e,t)},useInsertionEffect:function(e,t){Lb(4,2,e,t)},useMemo:function(e,t){var n=Yi();t=t===void 0?null:t;var s=e();if(uu){Dl(!0);try{e()}finally{Dl(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Yi();if(n!==void 0){var i=n(t);if(uu){Dl(!0);try{n(t)}finally{Dl(!1)}}}else i=t;return s.memoizedState=s.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},s.queue=e,e=e.dispatch=NY.bind(null,Mt,e),[s.memoizedState,e]},useRef:function(e){var t=Yi();return e={current:e},t.memoizedState=e},useState:function(e){e=G_(e);var t=e.queue,n=B4.bind(null,Mt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:KT,useDeferredValue:function(e,t){var n=Yi();return qT(n,e,t)},useTransition:function(){var e=G_(!1);return e=O4.bind(null,Mt,e.queue,!0,!1),Yi().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Mt,i=Yi();if(tn){if(n===void 0)throw Error(Te(407));n=n()}else{if(n=t(),Un===null)throw Error(Te(349));Zt&127||m4(s,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,OI(g4.bind(null,s,r,e),[e]),s.flags|=2048,yf(9,{destroy:void 0},p4.bind(null,s,r,n,t),null),n},useId:function(){var e=Yi(),t=Un.identifierPrefix;if(tn){var n=Ja,s=Za;n=(s&~(1<<32-Or(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Iy++,0<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof s.is=="string"?a.createElement("select",{is:s.is}):a.createElement("select"),s.multiple?r.multiple=!0:s.size&&(r.size=s.size);break;default:r=typeof s.is=="string"?a.createElement(i,{is:s.is}):a.createElement(i)}}r[Ti]=t,r[gr]=s;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=r;e:switch(ji(r,i,s),i){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&So(t)}}return Jn(t),_v(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&So(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(Te(166));if(e=zl.current,Ju(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,i=ki,i!==null)switch(i.tag){case 27:case 5:s=i.memoizedProps}e[Ti]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||B6(e.nodeValue,n)),e||nc(t,!0)}else e=Fy(e).createTextNode(s),e[Ti]=t,t.stateNode=e}return Jn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ju(t),n!==null){if(e===null){if(!s)throw Error(Te(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Te(557));e[Ti]=t}else ou(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jn(t),e=!1}else n=mv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Tr(t),t):(Tr(t),null);if(t.flags&128)throw Error(Te(558))}return Jn(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ju(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(Te(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Te(317));i[Ti]=t}else ou(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jn(t),i=!1}else i=mv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Tr(t),t):(Tr(t),null)}return Tr(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,i=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(i=s.alternate.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==i&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),R0(t,t.updateQueue),Jn(t),null);case 4:return hf(),e===null&&rk(t.stateNode.containerInfo),Jn(t),null;case 10:return Ho(t.type),Jn(t),null;case 19:if(bi(Hs),s=t.memoizedState,s===null)return Jn(t),null;if(i=(t.flags&128)!==0,r=s.rendering,r===null)if(i)Gh(s,!1);else{if(Rs!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(r=Ay(e),r!==null){for(t.flags|=128,Gh(s,!1),e=r.updateQueue,t.updateQueue=e,R0(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)J5(n,e),n=n.sibling;return Gn(Hs,Hs.current&1|2),tn&&Ro(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&jr()>My&&(t.flags|=128,i=!0,Gh(s,!1),t.lanes=4194304)}else{if(!i)if(e=Ay(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,R0(t,e),Gh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!r.alternate&&!tn)return Jn(t),null}else 2*jr()-s.renderingStartTime>My&&n!==536870912&&(t.flags|=128,i=!0,Gh(s,!1),t.lanes=4194304);s.isBackwards?(r.sibling=t.child,t.child=r):(e=s.last,e!==null?e.sibling=r:t.child=r,s.last=r)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=jr(),e.sibling=null,n=Hs.current,Gn(Hs,i?n&1|2:n&1),tn&&Ro(t,s.treeForkCount),e):(Jn(t),null);case 22:case 23:return Tr(t),PT(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(Jn(t),t.subtreeFlags&6&&(t.flags|=8192)):Jn(t),n=t.updateQueue,n!==null&&R0(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&bi(Wc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ho(ti),Jn(t),null;case 25:return null;case 30:return null}throw Error(Te(156,t.tag))}function IY(e,t){switch(RT(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ho(ti),hf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xy(t),null;case 31:if(t.memoizedState!==null){if(Tr(t),t.alternate===null)throw Error(Te(340));ou()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Tr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));ou()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return bi(Hs),null;case 4:return hf(),null;case 10:return Ho(t.type),null;case 22:case 23:return Tr(t),PT(),e!==null&&bi(Wc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ho(ti),null;case 25:return null;default:return null}}function J4(e,t){switch(RT(t),t.tag){case 3:Ho(ti),hf();break;case 26:case 27:case 5:xy(t);break;case 4:hf();break;case 31:t.memoizedState!==null&&Tr(t);break;case 13:Tr(t);break;case 19:bi(Hs);break;case 10:Ho(t.type);break;case 22:case 23:Tr(t),PT(),e!==null&&bi(Wc);break;case 24:Ho(ti)}}function pg(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){s=void 0;var r=n.create,a=n.inst;s=r(),a.destroy=s}n=n.next}while(n!==i)}}catch(l){An(t,t.return,l)}}function sc(e,t,n){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var r=i.next;s=r;do{if((s.tag&e)===e){var a=s.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,i=t;var c=n,u=l;try{u()}catch(d){An(i,c,d)}}}s=s.next}while(s!==r)}}catch(d){An(t,t.return,d)}}function e6(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{c4(t,n)}catch(s){An(e,e.return,s)}}}function t6(e,t,n){n.props=du(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){An(e,t,s)}}function Fm(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(i){An(e,t,i)}}function eo(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(i){An(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){An(e,t,i)}else n.current=null}function n6(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(i){An(e,e.return,i)}}function Sv(e,t,n){try{var s=e.stateNode;ZY(s,e.type,n,t),s[gr]=t}catch(i){An(e,e.return,i)}}function s6(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&fc(e.type)||e.tag===4}function Nv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||s6(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&fc(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Z_(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Do));else if(s!==4&&(s===27&&fc(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Z_(e,t,n),e=e.sibling;e!==null;)Z_(e,t,n),e=e.sibling}function Oy(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&fc(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Oy(e,t,n),e=e.sibling;e!==null;)Oy(e,t,n),e=e.sibling}function i6(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ji(t,s,n),t[Ti]=e,t[gr]=n}catch(r){An(e,e.return,r)}}var Oo=!1,ei=!1,Tv=!1,KI=typeof WeakSet=="function"?WeakSet:Set,hi=null;function jY(e,t){if(e=e.containerInfo,rS=Vy,e=G5(e),kT(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var i=s.anchorOffset,r=s.focusNode;s=s.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(l=a+i),f!==r||s!==0&&f.nodeType!==3||(c=a+s),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===i&&(l=a),h===r&&++d===s&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(aS={focusedElem:e,selectionRange:n},Vy=!1,hi=t;hi!==null;)if(t=hi,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,hi=e;else for(;hi!==null;){switch(t=hi,r=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),ji(r,s,n),r[Ti]=e,mi(r),s=r;break e;case"link":var a=fj("link","href",i).get(s+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=bI(l,b),x=bI(l,v);if(y&&x&&(m.rangeCount!==1||m.anchorNode!==y.node||m.anchorOffset!==y.offset||m.focusNode!==x.node||m.focusOffset!==x.offset)){var E=f.createRange();E.setStart(y.node,y.offset),m.removeAllRanges(),b>v?(m.addRange(E),m.extend(x.node,x.offset)):(E.setEnd(x.node,x.offset),m.addRange(E))}}}}for(f=[],m=l;m=m.parentNode;)m.nodeType===1&&f.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,xt.T=null,n=tS,tS=null;var r=Yl,a=zo;if(ui=0,Ef=Yl=null,zo=0,fn&6)throw Error(Te(331));var l=fn;if(fn|=4,p6(r.current),f6(r,r.current,a,n),fn=l,gg(0,!1),Rr&&typeof Rr.onPostCommitFiberRoot=="function")try{Rr.onPostCommitFiberRoot(lg,r)}catch{}return!0}finally{hn.p=i,xt.T=s,I6(e,t)}}function XI(e,t,n){t=ea(n,t),t=W_(e.stateNode,t,2),e=Kl(e,t,2),e!==null&&(ug(e,2),co(e))}function An(e,t,n){if(e.tag===3)XI(e,e,n);else for(;t!==null;){if(t.tag===3){XI(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(ql===null||!ql.has(s))){e=ea(n,e),n=K4(2),s=Kl(t,n,2),s!==null&&(q4(n,s,t,e),ug(s,2),co(s));break}}t=t.return}}function Av(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new MY;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(tk=!0,i.add(n),e=UY.bind(null,e,t,n),t.then(e,e))}function UY(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Un===e&&(Zt&n)===n&&(Rs===4||Rs===3&&(Zt&62914560)===Zt&&300>jr()-sx?!(fn&2)&&vf(e,0):nk|=n,xf===Zt&&(xf=0)),co(e)}function R6(e,t){t===0&&(t=_5()),e=ku(e,t),e!==null&&(ug(e,t),co(e))}function FY(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),R6(e,n)}function $Y(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(Te(314))}s!==null&&s.delete(t),R6(e,n)}function HY(e,t){return yT(e,t)}var Py=null,pd=null,sS=!1,By=!1,Cv=!1,Fl=0;function co(e){e!==pd&&e.next===null&&(pd===null?Py=pd=e:pd=pd.next=e),By=!0,sS||(sS=!0,VY())}function gg(e,t){if(!Cv&&By){Cv=!0;do for(var n=!1,s=Py;s!==null;){if(e!==0){var i=s.pendingLanes;if(i===0)var r=0;else{var a=s.suspendedLanes,l=s.pingedLanes;r=(1<<31-Or(42|e)+1)-1,r&=i&~(a&~l),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,QI(s,r))}else r=Zt,r=K1(s,s===Un?r:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(r&3)||cg(s,r)||(n=!0,QI(s,r));s=s.next}while(n);Cv=!1}}function zY(){O6()}function O6(){By=sS=!1;var e=0;Fl!==0&&eW()&&(e=Fl);for(var t=jr(),n=null,s=Py;s!==null;){var i=s.next,r=M6(s,t);r===0?(s.next=null,n===null?Py=i:n.next=i,i===null&&(pd=n)):(n=s,(e!==0||r&3)&&(By=!0)),s=i}ui!==0&&ui!==5||gg(e),Fl!==0&&(Fl=0)}function M6(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&nj(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function z6(e,t,n){var s=th;if(s&&typeof t=="string"&&t){var i=Jr(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),cj.has(i)||(cj.add(i),e={rel:e,crossOrigin:n,href:t},s.querySelector(i)===null&&(t=s.createElement("link"),ji(t,"link",e),mi(t),s.head.appendChild(t)))}}function cW(e){il.D(e),z6("dns-prefetch",e,null)}function uW(e,t){il.C(e,t),z6("preconnect",e,t)}function dW(e,t,n){il.L(e,t,n);var s=th;if(s&&e&&t){var i='link[rel="preload"][as="'+Jr(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Jr(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Jr(n.imageSizes)+'"]')):i+='[href="'+Jr(e)+'"]';var r=i;switch(t){case"style":r=wf(e);break;case"script":r=nh(e)}oa.has(r)||(e=as({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),oa.set(r,e),s.querySelector(i)!==null||t==="style"&&s.querySelector(bg(r))||t==="script"&&s.querySelector(yg(r))||(t=s.createElement("link"),ji(t,"link",e),mi(t),s.head.appendChild(t)))}}function fW(e,t){il.m(e,t);var n=th;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Jr(s)+'"][href="'+Jr(e)+'"]',r=i;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=nh(e)}if(!oa.has(r)&&(e=as({rel:"modulepreload",href:e},t),oa.set(r,e),n.querySelector(i)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(yg(r)))return}s=n.createElement("link"),ji(s,"link",e),mi(s),n.head.appendChild(s)}}}function hW(e,t,n){il.S(e,t,n);var s=th;if(s&&e){var i=Qd(s).hoistableStyles,r=wf(e);t=t||"default";var a=i.get(r);if(!a){var l={loading:0,preload:null};if(a=s.querySelector(bg(r)))l.loading=5;else{e=as({rel:"stylesheet",href:e,"data-precedence":t},n),(n=oa.get(r))&&ak(e,n);var c=a=s.createElement("link");mi(c),ji(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Ub(a,t,s)}a={type:"stylesheet",instance:a,count:1,state:l},i.set(r,a)}}}function mW(e,t){il.X(e,t);var n=th;if(n&&e){var s=Qd(n).hoistableScripts,i=nh(e),r=s.get(i);r||(r=n.querySelector(yg(i)),r||(e=as({src:e,async:!0},t),(t=oa.get(i))&&ok(e,t),r=n.createElement("script"),mi(r),ji(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function pW(e,t){il.M(e,t);var n=th;if(n&&e){var s=Qd(n).hoistableScripts,i=nh(e),r=s.get(i);r||(r=n.querySelector(yg(i)),r||(e=as({src:e,async:!0,type:"module"},t),(t=oa.get(i))&&ok(e,t),r=n.createElement("script"),mi(r),ji(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function uj(e,t,n,s){var i=(i=zl.current)?$y(i):null;if(!i)throw Error(Te(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=wf(n.href),n=Qd(i).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=wf(n.href);var r=Qd(i).hoistableStyles,a=r.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,a),(r=i.querySelector(bg(e)))&&!r._p&&(a.instance=r,a.state.loading=5),oa.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},oa.set(e,n),r||gW(i,e,n,a.state))),t&&s===null)throw Error(Te(528,""));return a}if(t&&s!==null)throw Error(Te(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=nh(n),n=Qd(i).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(Te(444,e))}}function wf(e){return'href="'+Jr(e)+'"'}function bg(e){return'link[rel="stylesheet"]['+e+"]"}function V6(e){return as({},e,{"data-precedence":e.precedence,precedence:null})}function gW(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ji(t,"link",n),mi(t),e.head.appendChild(t))}function nh(e){return'[src="'+Jr(e)+'"]'}function yg(e){return"script[async]"+e}function dj(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Jr(n.href)+'"]');if(s)return t.instance=s,mi(s),s;var i=as({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),mi(s),ji(s,"style",i),Ub(s,n.precedence,e),t.instance=s;case"stylesheet":i=wf(n.href);var r=e.querySelector(bg(i));if(r)return t.state.loading|=4,t.instance=r,mi(r),r;s=V6(n),(i=oa.get(i))&&ak(s,i),r=(e.ownerDocument||e).createElement("link"),mi(r);var a=r;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),ji(r,"link",s),t.state.loading|=4,Ub(r,n.precedence,e),t.instance=r;case"script":return r=nh(n.src),(i=e.querySelector(yg(r)))?(t.instance=i,mi(i),i):(s=n,(i=oa.get(r))&&(s=as({},n),ok(s,i)),e=e.ownerDocument||e,i=e.createElement("script"),mi(i),ji(i,"link",s),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(Te(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,Ub(s,n.precedence,e));return t.instance}function Ub(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=s.length?s[s.length-1]:null,r=i,a=0;a title"):null)}function bW(e,t,n){if(n===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 G6(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function yW(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var i=wf(s.href),r=t.querySelector(bg(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Hy.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,mi(r);return}r=t.ownerDocument||t,s=V6(s),(i=oa.get(i))&&ak(s,i),r=r.createElement("link"),mi(r);var a=r;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),ji(r,"link",s),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Hy.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Lv=0;function xW(e,t){return e.stylesheets&&e.count===0&&$b(e,e.stylesheets),0Lv?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(i)}}:null}function Hy(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$b(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var zy=null;function $b(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,zy=new Map,t.forEach(EW,e),zy=null,Hy.call(e))}function EW(e,t){if(!(t.state.loading&4)){var n=zy.get(e);if(n)var s=n.get(null);else{n=new Map,zy.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(J6)}catch(e){console.error(e)}}J6(),o5.exports=V1;var AW=o5.exports;const CW=qf(AW),fk=g.createContext({});function lx(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const cx=g.createContext(null),kp=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class IW extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function jW({children:e,isPresent:t}){const n=g.useId(),s=g.useRef(null),i=g.useRef({width:0,height:0,top:0,left:0}),{nonce:r}=g.useContext(kp);return g.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=i.current;if(t||!s.current||!a||!l)return;s.current.dataset.motionPopId=n;const d=document.createElement("style");return r&&(d.nonce=r),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+s.stack}}var T_=Object.prototype.hasOwnProperty,yT=fi.unstable_scheduleCallback,sv=fi.unstable_cancelCallback,lq=fi.unstable_shouldYield,cq=fi.unstable_requestPaint,Mr=fi.unstable_now,uq=fi.unstable_getCurrentPriorityLevel,v5=fi.unstable_ImmediatePriority,w5=fi.unstable_UserBlockingPriority,vy=fi.unstable_NormalPriority,dq=fi.unstable_LowPriority,_5=fi.unstable_IdlePriority,fq=fi.log,hq=fi.unstable_setDisableYieldValue,rg=null,Lr=null;function Ul(e){if(typeof fq=="function"&&hq(e),Lr&&typeof Lr.setStrictMode=="function")try{Lr.setStrictMode(rg,e)}catch{}}var Dr=Math.clz32?Math.clz32:gq,pq=Math.log,mq=Math.LN2;function gq(e){return e>>>=0,e===0?32:31-(pq(e)/mq|0)|0}var N0=256,T0=262144,k0=4194304;function Rc(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&261888;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 q1(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,r=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var l=s&134217727;return l!==0?(s=l&~r,s!==0?i=Rc(s):(a&=l,a!==0?i=Rc(a):n||(n=l&~e,n!==0&&(i=Rc(n))))):(l=s&~r,l!==0?i=Rc(l):a!==0?i=Rc(a):n||(n=s&~e,n!==0&&(i=Rc(n)))),i===0?0:t!==0&&t!==i&&!(t&r)&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function ag(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function bq(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function S5(){var e=k0;return k0<<=1,!(k0&62914560)&&(k0=4194304),e}function iv(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function og(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function yq(e,t,n,s,i,r){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var l=e.entanglements,c=e.expirationTimes,u=e.hiddenUpdates;for(n=a&~n;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Sq=/[\n"\\]/g;function ia(e){return e.replace(Sq,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function C_(e,t,n,s,i,r,a,l){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zr(t)):e.value!==""+Zr(t)&&(e.value=""+Zr(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?I_(e,a,Zr(t)):n!=null?I_(e,a,Zr(n)):s!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?e.name=""+Zr(l):e.removeAttribute("name")}function O5(e,t,n,s,i,r,a,l){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){A_(e);return}n=n!=null?""+Zr(n):"",t=t!=null?""+Zr(t):n,l||t===e.value||(e.value=t),e.defaultValue=t}s=s??i,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=l?e.checked:!!s,e.defaultChecked=!!s,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),A_(e)}function I_(e,t,n){t==="number"&&wy(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Xd(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),R_=!1;if(sl)try{var Uh={};Object.defineProperty(Uh,"passive",{get:function(){R_=!0}}),window.addEventListener("test",Uh,Uh),window.removeEventListener("test",Uh,Uh)}catch{R_=!1}var Fl=null,ST=null,jb=null;function B5(){if(jb)return jb;var e,t=ST,n=t.length,s,i="value"in Fl?Fl.value:Fl.textContent,r=i.length;for(e=0;e=Cp),uI=" ",dI=!1;function F5(e,t){switch(e){case"keyup":return Zq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $5(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Nd=!1;function eY(e,t){switch(e){case"compositionend":return $5(t);case"keypress":return t.which!==32?null:(dI=!0,uI);case"textInput":return e=t.data,e===uI&&dI?null:e;default:return null}}function tY(e,t){if(Nd)return e==="compositionend"||!TT&&F5(e,t)?(e=B5(),jb=ST=Fl=null,Nd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=gI(n)}}function G5(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?G5(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function K5(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wy(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=wy(e.document)}return t}function kT(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 cY=sl&&"documentMode"in document&&11>=document.documentMode,Td=null,O_=null,jp=null,M_=!1;function yI(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;M_||Td==null||Td!==wy(s)||(s=Td,"selectionStart"in s&&kT(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),jp&&hm(jp,s)||(jp=s,s=Fy(O_,"onSelect"),0>=a,i-=a,io=1<<32-Dr(t)+i|n<k?(A=T,T=null):A=T.sibling;var j=h(y,T,E[k],w);if(j===null){T===null&&(T=A);break}e&&T&&j.alternate===null&&t(y,T),x=r(j,x,k),_===null?S=j:_.sibling=j,_=j,T=A}if(k===E.length)return n(y,T),Zt&&Fo(y,k),S;if(T===null){for(;kk?(A=T,T=null):A=T.sibling;var R=h(y,T,j.value,w);if(R===null){T===null&&(T=A);break}e&&T&&R.alternate===null&&t(y,T),x=r(R,x,k),_===null?S=R:_.sibling=R,_=R,T=A}if(j.done)return n(y,T),Zt&&Fo(y,k),S;if(T===null){for(;!j.done;k++,j=E.next())j=f(y,j.value,w),j!==null&&(x=r(j,x,k),_===null?S=j:_.sibling=j,_=j);return Zt&&Fo(y,k),S}for(T=s(T);!j.done;k++,j=E.next())j=p(T,y,k,j.value,w),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?k:j.key),x=r(j,x,k),_===null?S=j:_.sibling=j,_=j);return e&&T.forEach(function(B){return t(y,B)}),Zt&&Fo(y,k),S}function v(y,x,E,w){if(typeof E=="object"&&E!==null&&E.type===vd&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case S0:e:{for(var S=E.key;x!==null;){if(x.key===S){if(S=E.type,S===vd){if(x.tag===7){n(y,x.sibling),w=i(x,E.props.children),w.return=y,y=w;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Cl&&Oc(S)===x.type){n(y,x.sibling),w=i(x,E.props),$h(w,E),w.return=y,y=w;break e}n(y,x);break}else t(y,x);x=x.sibling}E.type===vd?(w=Xc(E.props.children,y.mode,w,E.key),w.return=y,y=w):(w=Ob(E.type,E.key,E.props,null,y.mode,w),$h(w,E),w.return=y,y=w)}return a(y);case cp:e:{for(S=E.key;x!==null;){if(x.key===S)if(x.tag===4&&x.stateNode.containerInfo===E.containerInfo&&x.stateNode.implementation===E.implementation){n(y,x.sibling),w=i(x,E.children||[]),w.return=y,y=w;break e}else{n(y,x);break}else t(y,x);x=x.sibling}w=hv(E,y.mode,w),w.return=y,y=w}return a(y);case Cl:return E=Oc(E),v(y,x,E,w)}if(up(E))return m(y,x,E,w);if(Bh(E)){if(S=Bh(E),typeof S!="function")throw Error(Te(150));return E=S.call(E),b(y,x,E,w)}if(typeof E.then=="function")return v(y,x,j0(E),w);if(E.$$typeof===zo)return v(y,x,I0(y,E),w);R0(y,E)}return typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint"?(E=""+E,x!==null&&x.tag===6?(n(y,x.sibling),w=i(x,E),w.return=y,y=w):(n(y,x),w=fv(E,y.mode,w),w.return=y,y=w),a(y)):n(y,x)}return function(y,x,E,w){try{gm=0;var S=v(y,x,E,w);return Jd=null,S}catch(T){if(T===Qf||T===J1)throw T;var _=Ir(29,T,null,y.mode);return _.lanes=w,_.return=y,_}finally{}}}var du=o4(!0),l4=o4(!1),Il=!1;function DT(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $_(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 Yl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wl(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,hn&2){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,t=Sy(e),J5(e,null,n),t}return Z1(e,s,t,n),Sy(e)}function Op(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,T5(e,n)}}function mv(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=a:r=r.next=a,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var H_=!1;function Mp(){if(H_){var e=Zd;if(e!==null)throw e}}function Lp(e,t,n,s){H_=!1;var i=e.updateQueue;Il=!1;var r=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?r=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(r!==null){var f=i.baseState;a=0,d=u=c=null,l=r;do{var h=l.lane&-536870913,p=h!==l.lane;if(p?(Wt&h)===h:(s&h)===h){h!==0&&h===pf&&(H_=!0),d!==null&&(d=d.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=e,b=l;h=t;var v=n;switch(b.tag){case 1:if(m=b.payload,typeof m=="function"){f=m.call(v,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=b.payload,h=typeof m=="function"?m.call(v,f,h):m,h==null)break e;f=os({},f,h);break e;case 2:Il=!0}}h=l.callback,h!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[h]:p.push(h))}else p={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,a|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,r===null&&(i.shared.lanes=0),oc|=a,e.lanes=a,e.memoizedState=f}}function c4(e,t){if(typeof e!="function")throw Error(Te(191,e));e.call(t)}function u4(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;er?r:8;var a=yt.T,l={};yt.T=l,WT(e,!1,t,n);try{var c=i(),u=yt.S;if(u!==null&&u(l,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=yY(c,s);Dp(e,t,d,Pr(e))}else Dp(e,t,s,Pr(e))}catch(f){Dp(e,t,{then:function(){},status:"rejected",reason:f},Pr())}finally{pn.p=r,a!==null&&l.types!==null&&(a.types=l.types),yt.T=a}}function SY(){}function q_(e,t,n,s){if(e.tag!==5)throw Error(Te(476));var i=L4(e).queue;M4(e,i,t,Wc,n===null?SY:function(){return D4(e),n(s)})}function L4(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Wc,baseState:Wc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rl,lastRenderedState:Wc},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:rl,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function D4(e){var t=L4(e);t.next===null&&(t=e.alternate.memoizedState),Dp(e,t.next.queue,{},Pr())}function YT(){return Ii(vm)}function P4(){return zs().memoizedState}function B4(){return zs().memoizedState}function NY(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pr();e=Yl(n);var s=Wl(t,e,n);s!==null&&(mr(s,t,n),Op(s,t,n)),t={cache:OT()},e.payload=t;return}t=t.return}}function TY(e,t,n){var s=Pr();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},sx(e)?F4(t,n):(n=CT(e,t,n,s),n!==null&&(mr(n,e,s),$4(n,t,s)))}function U4(e,t,n){var s=Pr();Dp(e,t,n,s)}function Dp(e,t,n,s){var i={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(sx(e))F4(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var a=t.lastRenderedState,l=r(a,n);if(i.hasEagerState=!0,i.eagerState=l,Fr(l,a))return Z1(e,t,i,0),Un===null&&Q1(),!1}catch{}finally{}if(n=CT(e,t,i,s),n!==null)return mr(n,e,s),$4(n,t,s),!0}return!1}function WT(e,t,n,s){if(s={lane:2,revertLane:ik(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},sx(e)){if(t)throw Error(Te(479))}else t=CT(e,n,s,2),t!==null&&mr(t,e,2)}function sx(e){var t=e.alternate;return e===Rt||t!==null&&t===Rt}function F4(e,t){ef=Iy=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $4(e,t,n){if(n&4194048){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,T5(e,n)}}var ym={readContext:Ii,use:tx,useCallback:Is,useContext:Is,useEffect:Is,useImperativeHandle:Is,useLayoutEffect:Is,useInsertionEffect:Is,useMemo:Is,useReducer:Is,useRef:Is,useState:Is,useDebugValue:Is,useDeferredValue:Is,useTransition:Is,useSyncExternalStore:Is,useId:Is,useHostTransitionStatus:Is,useFormState:Is,useActionState:Is,useOptimistic:Is,useMemoCache:Is,useCacheRefresh:Is};ym.useEffectEvent=Is;var H4={readContext:Ii,use:tx,useCallback:function(e,t){return Yi().memoizedState=[e,t===void 0?null:t],e},useContext:Ii,useEffect:OI,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Db(4194308,4,C4.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Db(4194308,4,e,t)},useInsertionEffect:function(e,t){Db(4,2,e,t)},useMemo:function(e,t){var n=Yi();t=t===void 0?null:t;var s=e();if(fu){Ul(!0);try{e()}finally{Ul(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Yi();if(n!==void 0){var i=n(t);if(fu){Ul(!0);try{n(t)}finally{Ul(!1)}}}else i=t;return s.memoizedState=s.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},s.queue=e,e=e.dispatch=TY.bind(null,Rt,e),[s.memoizedState,e]},useRef:function(e){var t=Yi();return e={current:e},t.memoizedState=e},useState:function(e){e=G_(e);var t=e.queue,n=U4.bind(null,Rt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:KT,useDeferredValue:function(e,t){var n=Yi();return qT(n,e,t)},useTransition:function(){var e=G_(!1);return e=M4.bind(null,Rt,e.queue,!0,!1),Yi().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=Rt,i=Yi();if(Zt){if(n===void 0)throw Error(Te(407));n=n()}else{if(n=t(),Un===null)throw Error(Te(349));Wt&127||m4(s,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,OI(b4.bind(null,s,r,e),[e]),s.flags|=2048,gf(9,{destroy:void 0},g4.bind(null,s,r,n,t),null),n},useId:function(){var e=Yi(),t=Un.identifierPrefix;if(Zt){var n=ro,s=io;n=(s&~(1<<32-Dr(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=jy++,0<\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof s.is=="string"?a.createElement("select",{is:s.is}):a.createElement("select"),s.multiple?r.multiple=!0:s.size&&(r.size=s.size);break;default:r=typeof s.is=="string"?a.createElement(i,{is:s.is}):a.createElement(i)}}r[ki]=t,r[yr]=s;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=r;e:switch(Ri(r,i,s),i){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ro(t)}}return es(t),_v(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ro(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(Te(166));if(e=Kl.current,Qu(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,i=Ai,i!==null)switch(i.tag){case 27:case 5:s=i.memoizedProps}e[ki]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||U6(e.nodeValue,n)),e||rc(t,!0)}else e=$y(e).createTextNode(s),e[ki]=t,t.stateNode=e}return es(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Qu(t),n!==null){if(e===null){if(!s)throw Error(Te(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Te(557));e[ki]=t}else cu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;es(t),e=!1}else n=pv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Cr(t),t):(Cr(t),null);if(t.flags&128)throw Error(Te(558))}return es(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Qu(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(Te(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Te(317));i[ki]=t}else cu(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;es(t),i=!1}else i=pv(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Cr(t),t):(Cr(t),null)}return Cr(t),t.flags&128?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,i=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(i=s.alternate.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==i&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),O0(t,t.updateQueue),es(t),null);case 4:return df(),e===null&&rk(t.stateNode.containerInfo),es(t),null;case 10:return Xo(t.type),es(t),null;case 19:if(vi(Fs),s=t.memoizedState,s===null)return es(t),null;if(i=(t.flags&128)!==0,r=s.rendering,r===null)if(i)Hh(s,!1);else{if(Rs!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(r=Cy(e),r!==null){for(t.flags|=128,Hh(s,!1),e=r.updateQueue,t.updateQueue=e,O0(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)e4(n,e),n=n.sibling;return Hn(Fs,Fs.current&1|2),Zt&&Fo(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Mr()>Ly&&(t.flags|=128,i=!0,Hh(s,!1),t.lanes=4194304)}else{if(!i)if(e=Cy(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,O0(t,e),Hh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!r.alternate&&!Zt)return es(t),null}else 2*Mr()-s.renderingStartTime>Ly&&n!==536870912&&(t.flags|=128,i=!0,Hh(s,!1),t.lanes=4194304);s.isBackwards?(r.sibling=t.child,t.child=r):(e=s.last,e!==null?e.sibling=r:t.child=r,s.last=r)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Mr(),e.sibling=null,n=Fs.current,Hn(Fs,i?n&1|2:n&1),Zt&&Fo(t,s.treeForkCount),e):(es(t),null);case 22:case 23:return Cr(t),PT(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?n&536870912&&!(t.flags&128)&&(es(t),t.subtreeFlags&6&&(t.flags|=8192)):es(t),n=t.updateQueue,n!==null&&O0(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&vi(Qc),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xo(ti),es(t),null;case 25:return null;case 30:return null}throw Error(Te(156,t.tag))}function jY(e,t){switch(RT(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xo(ti),df(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ey(t),null;case 31:if(t.memoizedState!==null){if(Cr(t),t.alternate===null)throw Error(Te(340));cu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Cr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));cu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return vi(Fs),null;case 4:return df(),null;case 10:return Xo(t.type),null;case 22:case 23:return Cr(t),PT(),e!==null&&vi(Qc),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xo(ti),null;case 25:return null;default:return null}}function e6(e,t){switch(RT(t),t.tag){case 3:Xo(ti),df();break;case 26:case 27:case 5:Ey(t);break;case 4:df();break;case 31:t.memoizedState!==null&&Cr(t);break;case 13:Cr(t);break;case 19:vi(Fs);break;case 10:Xo(t.type);break;case 22:case 23:Cr(t),PT(),e!==null&&vi(Qc);break;case 24:Xo(ti)}}function fg(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){s=void 0;var r=n.create,a=n.inst;s=r(),a.destroy=s}n=n.next}while(n!==i)}}catch(l){Tn(t,t.return,l)}}function ac(e,t,n){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var r=i.next;s=r;do{if((s.tag&e)===e){var a=s.inst,l=a.destroy;if(l!==void 0){a.destroy=void 0,i=t;var c=n,u=l;try{u()}catch(d){Tn(i,c,d)}}}s=s.next}while(s!==r)}}catch(d){Tn(t,t.return,d)}}function t6(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{u4(t,n)}catch(s){Tn(e,e.return,s)}}}function n6(e,t,n){n.props=hu(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Tn(e,t,s)}}function Pp(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(i){Tn(e,t,i)}}function ao(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(i){Tn(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Tn(e,t,i)}else n.current=null}function s6(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(i){Tn(e,e.return,i)}}function Sv(e,t,n){try{var s=e.stateNode;JY(s,e.type,n,t),s[yr]=t}catch(i){Tn(e,e.return,i)}}function i6(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mc(e.type)||e.tag===4}function Nv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||i6(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&mc(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Z_(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vo));else if(s!==4&&(s===27&&mc(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Z_(e,t,n),e=e.sibling;e!==null;)Z_(e,t,n),e=e.sibling}function My(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&mc(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(My(e,t,n),e=e.sibling;e!==null;)My(e,t,n),e=e.sibling}function r6(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ri(t,s,n),t[ki]=e,t[yr]=n}catch(r){Tn(e,e.return,r)}}var $o=!1,ei=!1,Tv=!1,KI=typeof WeakSet=="function"?WeakSet:Set,bi=null;function RY(e,t){if(e=e.containerInfo,rS=Gy,e=K5(e),kT(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var i=s.anchorOffset,r=s.focusNode;s=s.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(l=a+i),f!==r||s!==0&&f.nodeType!==3||(c=a+s),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===i&&(l=a),h===r&&++d===s&&(c=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(aS={focusedElem:e,selectionRange:n},Gy=!1,bi=t;bi!==null;)if(t=bi,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bi=e;else for(;bi!==null;){switch(t=bi,r=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n title"))),Ri(r,s,n),r[ki]=e,yi(r),s=r;break e;case"link":var a=fj("link","href",i).get(s+(n.href||""));if(a){for(var l=0;lv&&(a=v,v=b,b=a);var y=bI(l,b),x=bI(l,v);if(y&&x&&(p.rangeCount!==1||p.anchorNode!==y.node||p.anchorOffset!==y.offset||p.focusNode!==x.node||p.focusOffset!==x.offset)){var E=f.createRange();E.setStart(y.node,y.offset),p.removeAllRanges(),b>v?(p.addRange(E),p.extend(x.node,x.offset)):(E.setEnd(x.node,x.offset),p.addRange(E))}}}}for(f=[],p=l;p=p.parentNode;)p.nodeType===1&&f.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;ln?32:n,yt.T=null,n=tS,tS=null;var r=Ql,a=Qo;if(di=0,yf=Ql=null,Qo=0,hn&6)throw Error(Te(331));var l=hn;if(hn|=4,g6(r.current),h6(r,r.current,a,n),hn=l,hg(0,!1),Lr&&typeof Lr.onPostCommitFiberRoot=="function")try{Lr.onPostCommitFiberRoot(rg,r)}catch{}return!0}finally{pn.p=i,yt.T=s,j6(e,t)}}function XI(e,t,n){t=ra(n,t),t=W_(e.stateNode,t,2),e=Wl(e,t,2),e!==null&&(og(e,2),go(e))}function Tn(e,t,n){if(e.tag===3)XI(e,e,n);else for(;t!==null;){if(t.tag===3){XI(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Xl===null||!Xl.has(s))){e=ra(n,e),n=q4(2),s=Wl(t,n,2),s!==null&&(Y4(n,s,t,e),og(s,2),go(s));break}}t=t.return}}function Av(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new LY;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(tk=!0,i.add(n),e=FY.bind(null,e,t,n),t.then(e,e))}function FY(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Un===e&&(Wt&n)===n&&(Rs===4||Rs===3&&(Wt&62914560)===Wt&&300>Mr()-ix?!(hn&2)&&xf(e,0):nk|=n,bf===Wt&&(bf=0)),go(e)}function O6(e,t){t===0&&(t=S5()),e=Cu(e,t),e!==null&&(og(e,t),go(e))}function $Y(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),O6(e,n)}function HY(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(Te(314))}s!==null&&s.delete(t),O6(e,n)}function zY(e,t){return yT(e,t)}var By=null,hd=null,sS=!1,Uy=!1,Cv=!1,zl=0;function go(e){e!==hd&&e.next===null&&(hd===null?By=hd=e:hd=hd.next=e),Uy=!0,sS||(sS=!0,GY())}function hg(e,t){if(!Cv&&Uy){Cv=!0;do for(var n=!1,s=By;s!==null;){if(e!==0){var i=s.pendingLanes;if(i===0)var r=0;else{var a=s.suspendedLanes,l=s.pingedLanes;r=(1<<31-Dr(42|e)+1)-1,r&=i&~(a&~l),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,QI(s,r))}else r=Wt,r=q1(s,s===Un?r:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),!(r&3)||ag(s,r)||(n=!0,QI(s,r));s=s.next}while(n);Cv=!1}}function VY(){M6()}function M6(){Uy=sS=!1;var e=0;zl!==0&&tW()&&(e=zl);for(var t=Mr(),n=null,s=By;s!==null;){var i=s.next,r=L6(s,t);r===0?(s.next=null,n===null?By=i:n.next=i,i===null&&(hd=n)):(n=s,(e!==0||r&3)&&(Uy=!0)),s=i}di!==0&&di!==5||hg(e),zl!==0&&(zl=0)}function L6(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0l)break;var d=c.transferSize,f=c.initiatorType;d&&nj(f)&&(c=c.responseEnd,a+=d*(c"u"?null:document;function V6(e,t,n){var s=Jf;if(s&&typeof t=="string"&&t){var i=ia(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),cj.has(i)||(cj.add(i),e={rel:e,crossOrigin:n,href:t},s.querySelector(i)===null&&(t=s.createElement("link"),Ri(t,"link",e),yi(t),s.head.appendChild(t)))}}function uW(e){fl.D(e),V6("dns-prefetch",e,null)}function dW(e,t){fl.C(e,t),V6("preconnect",e,t)}function fW(e,t,n){fl.L(e,t,n);var s=Jf;if(s&&e&&t){var i='link[rel="preload"][as="'+ia(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+ia(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+ia(n.imageSizes)+'"]')):i+='[href="'+ia(e)+'"]';var r=i;switch(t){case"style":r=Ef(e);break;case"script":r=eh(e)}fa.has(r)||(e=os({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),fa.set(r,e),s.querySelector(i)!==null||t==="style"&&s.querySelector(pg(r))||t==="script"&&s.querySelector(mg(r))||(t=s.createElement("link"),Ri(t,"link",e),yi(t),s.head.appendChild(t)))}}function hW(e,t){fl.m(e,t);var n=Jf;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ia(s)+'"][href="'+ia(e)+'"]',r=i;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=eh(e)}if(!fa.has(r)&&(e=os({rel:"modulepreload",href:e},t),fa.set(r,e),n.querySelector(i)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(mg(r)))return}s=n.createElement("link"),Ri(s,"link",e),yi(s),n.head.appendChild(s)}}}function pW(e,t,n){fl.S(e,t,n);var s=Jf;if(s&&e){var i=Wd(s).hoistableStyles,r=Ef(e);t=t||"default";var a=i.get(r);if(!a){var l={loading:0,preload:null};if(a=s.querySelector(pg(r)))l.loading=5;else{e=os({rel:"stylesheet",href:e,"data-precedence":t},n),(n=fa.get(r))&&ak(e,n);var c=a=s.createElement("link");yi(c),Ri(c,"link",e),c._p=new Promise(function(u,d){c.onload=u,c.onerror=d}),c.addEventListener("load",function(){l.loading|=1}),c.addEventListener("error",function(){l.loading|=2}),l.loading|=4,Fb(a,t,s)}a={type:"stylesheet",instance:a,count:1,state:l},i.set(r,a)}}}function mW(e,t){fl.X(e,t);var n=Jf;if(n&&e){var s=Wd(n).hoistableScripts,i=eh(e),r=s.get(i);r||(r=n.querySelector(mg(i)),r||(e=os({src:e,async:!0},t),(t=fa.get(i))&&ok(e,t),r=n.createElement("script"),yi(r),Ri(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function gW(e,t){fl.M(e,t);var n=Jf;if(n&&e){var s=Wd(n).hoistableScripts,i=eh(e),r=s.get(i);r||(r=n.querySelector(mg(i)),r||(e=os({src:e,async:!0,type:"module"},t),(t=fa.get(i))&&ok(e,t),r=n.createElement("script"),yi(r),Ri(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function uj(e,t,n,s){var i=(i=Kl.current)?Hy(i):null;if(!i)throw Error(Te(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ef(n.href),n=Wd(i).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ef(n.href);var r=Wd(i).hoistableStyles,a=r.get(e);if(a||(i=i.ownerDocument||i,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,a),(r=i.querySelector(pg(e)))&&!r._p&&(a.instance=r,a.state.loading=5),fa.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},fa.set(e,n),r||bW(i,e,n,a.state))),t&&s===null)throw Error(Te(528,""));return a}if(t&&s!==null)throw Error(Te(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=eh(n),n=Wd(i).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(Te(444,e))}}function Ef(e){return'href="'+ia(e)+'"'}function pg(e){return'link[rel="stylesheet"]['+e+"]"}function G6(e){return os({},e,{"data-precedence":e.precedence,precedence:null})}function bW(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Ri(t,"link",n),yi(t),e.head.appendChild(t))}function eh(e){return'[src="'+ia(e)+'"]'}function mg(e){return"script[async]"+e}function dj(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+ia(n.href)+'"]');if(s)return t.instance=s,yi(s),s;var i=os({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),yi(s),Ri(s,"style",i),Fb(s,n.precedence,e),t.instance=s;case"stylesheet":i=Ef(n.href);var r=e.querySelector(pg(i));if(r)return t.state.loading|=4,t.instance=r,yi(r),r;s=G6(n),(i=fa.get(i))&&ak(s,i),r=(e.ownerDocument||e).createElement("link"),yi(r);var a=r;return a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Ri(r,"link",s),t.state.loading|=4,Fb(r,n.precedence,e),t.instance=r;case"script":return r=eh(n.src),(i=e.querySelector(mg(r)))?(t.instance=i,yi(i),i):(s=n,(i=fa.get(r))&&(s=os({},n),ok(s,i)),e=e.ownerDocument||e,i=e.createElement("script"),yi(i),Ri(i,"link",s),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(Te(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(s=t.instance,t.state.loading|=4,Fb(s,n.precedence,e));return t.instance}function Fb(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=s.length?s[s.length-1]:null,r=i,a=0;a title"):null)}function yW(e,t,n){if(n===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 K6(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function xW(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var i=Ef(s.href),r=t.querySelector(pg(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=zy.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,yi(r);return}r=t.ownerDocument||t,s=G6(s),(i=fa.get(i))&&ak(s,i),r=r.createElement("link"),yi(r);var a=r;a._p=new Promise(function(l,c){a.onload=l,a.onerror=c}),Ri(r,"link",s),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=zy.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Lv=0;function EW(e,t){return e.stylesheets&&e.count===0&&Hb(e,e.stylesheets),0Lv?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(i)}}:null}function zy(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hb(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vy=null;function Hb(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vy=new Map,t.forEach(vW,e),Vy=null,zy.call(e))}function vW(e,t){if(!(t.state.loading&4)){var n=Vy.get(e);if(n)var s=n.get(null);else{n=new Map,Vy.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(eP)}catch(e){console.error(e)}}eP(),l5.exports=G1;var CW=l5.exports;const IW=Gf(CW),fk=g.createContext({});function cx(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const ux=g.createContext(null),Sm=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class jW extends g.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function RW({children:e,isPresent:t}){const n=g.useId(),s=g.useRef(null),i=g.useRef({width:0,height:0,top:0,left:0}),{nonce:r}=g.useContext(Sm);return g.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:u}=i.current;if(t||!s.current||!a||!l)return;s.current.dataset.motionPopId=n;const d=document.createElement("style");return r&&(d.nonce=r),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; @@ -55,452 +55,452 @@ Error generating stack: `+s.message+` top: ${c}px !important; left: ${u}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),o.jsx(IW,{isPresent:t,childRef:s,sizeRef:i,children:g.cloneElement(e,{ref:s})})}const RW=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:a})=>{const l=lx(OW),c=g.useId(),u=g.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;s&&s()},[l,s]),d=g.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),r?[Math.random(),u]:[n,u]);return g.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),a==="popLayout"&&(e=o.jsx(jW,{isPresent:n,children:e})),o.jsx(cx.Provider,{value:d,children:e})};function OW(){return new Map}function eP(e=!0){const t=g.useContext(cx);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,r=g.useId();g.useEffect(()=>{e&&i(r)},[e]);const a=g.useCallback(()=>e&&s&&s(r),[r,s,e]);return!n&&s?[!1,a]:[!0]}const B0=e=>e.key||"";function Ej(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const hk=typeof window<"u",tP=hk?g.useLayoutEffect:g.useEffect,Bo=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:a=!1})=>{const[l,c]=eP(a),u=g.useMemo(()=>Ej(e),[e]),d=a&&!l?[]:u.map(B0),f=g.useRef(!0),h=g.useRef(u),m=lx(()=>new Map),[p,b]=g.useState(u),[v,y]=g.useState(u);tP(()=>{f.current=!1,h.current=u;for(let w=0;w{const S=B0(w),_=a&&!l?!1:u===v||d.includes(S),k=()=>{if(m.has(S))m.set(S,!0);else return;let T=!0;m.forEach(A=>{A||(T=!1)}),T&&(E==null||E(),y(h.current),a&&(c==null||c()),s&&s())};return o.jsx(RW,{isPresent:_,initial:!f.current||n?void 0:!1,custom:_?void 0:t,presenceAffectsLayout:i,mode:r,onExitComplete:_?void 0:k,children:w},S)})})},Lr=e=>e;let nP=Lr;const MW={useManualTiming:!1};function LW(e){let t=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){r.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const m=f&&s?t:n;return d&&r.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const U0=["read","resolveKeyframes","update","preRender","render","postRender"],DW=40;function sP(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=U0.reduce((y,x)=>(y[x]=LW(r),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,m=()=>{const y=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,DW),1),i.timestamp=y,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),d.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(m))},p=()=>{n=!0,s=!0,i.isProcessing||e(m)};return{schedule:U0.reduce((y,x)=>{const E=a[x];return y[x]=(w,S=!1,_=!1)=>(n||p(),E.schedule(w,S,_)),y},{}),cancel:y=>{for(let x=0;xvj[e].some(n=>!!t[n])};function PW(e){for(const t in e)Sf[t]={...Sf[t],...e[t]}}const BW=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ky(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||BW.has(e)}let rP=e=>!Ky(e);function aP(e){e&&(rP=t=>t.startsWith("on")?!Ky(t):e(t))}try{aP(require("@emotion/is-prop-valid").default)}catch{}function UW(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(rP(i)||n===!0&&Ky(i)||!t&&!Ky(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function FW({children:e,isValidProp:t,...n}){t&&aP(t),n={...g.useContext(kp),...n},n.isStatic=lx(()=>n.isStatic);const s=g.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(kp.Provider,{value:s,children:e})}function $W(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const ux=g.createContext({});function Ap(e){return typeof e=="string"||Array.isArray(e)}function dx(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const mk=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pk=["initial",...mk];function fx(e){return dx(e.animate)||pk.some(t=>Ap(e[t]))}function oP(e){return!!(fx(e)||e.variants)}function HW(e,t){if(fx(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Ap(n)?n:void 0,animate:Ap(s)?s:void 0}}return e.inherit!==!1?t:{}}function zW(e){const{initial:t,animate:n}=HW(e,g.useContext(ux));return g.useMemo(()=>({initial:t,animate:n}),[wj(t),wj(n)])}function wj(e){return Array.isArray(e)?e.join(" "):e}const VW=Symbol.for("motionComponentSymbol");function Ld(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function GW(e,t,n){return g.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):Ld(n)&&(n.current=s))},[t])}const gk=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),KW="framerAppearId",lP="data-"+gk(KW),{schedule:bk}=sP(queueMicrotask,!1),cP=g.createContext({});function qW(e,t,n,s,i){var r,a;const{visualElement:l}=g.useContext(ux),c=g.useContext(iP),u=g.useContext(cx),d=g.useContext(kp).reducedMotion,f=g.useRef(null);s=s||c.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,m=g.useContext(cP);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&YW(f.current,n,i,m);const p=g.useRef(!1);g.useInsertionEffect(()=>{h&&p.current&&h.update(n,u)});const b=n[lP],v=g.useRef(!!b&&!(!((r=window.MotionHandoffIsComplete)===null||r===void 0)&&r.call(window,b))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,b)));return tP(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),bk.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),g.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function YW(e,t,n,s){const{layoutId:i,layout:r,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:uP(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!a||l&&Ld(l),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}function uP(e){if(e)return e.options.allowProjection!==!1?e.projection:uP(e.parent)}function WW({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var r,a;e&&PW(e);function l(u,d){let f;const h={...g.useContext(kp),...u,layoutId:XW(u)},{isStatic:m}=h,p=zW(u),b=s(u,m);if(!m&&hk){QW();const v=ZW(h);f=v.MeasureLayout,p.visualElement=qW(i,b,h,t,v.ProjectionNode)}return o.jsxs(ux.Provider,{value:p,children:[f&&p.visualElement?o.jsx(f,{visualElement:p.visualElement,...h}):null,n(i,u,GW(b,p.visualElement,d),b,m,p.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(a=(r=i.displayName)!==null&&r!==void 0?r:i.name)!==null&&a!==void 0?a:""})`}`;const c=g.forwardRef(l);return c[VW]=i,c}function XW({layoutId:e}){const t=g.useContext(fk).id;return t&&e!==void 0?t+"-"+e:e}function QW(e,t){g.useContext(iP).strict}function ZW(e){const{drag:t,layout:n}=Sf;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const JW=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function yk(e){return typeof e!="string"||e.includes("-")?!1:!!(JW.indexOf(e)>-1||/[A-Z]/u.test(e))}function _j(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function xk(e,t,n,s){if(typeof t=="function"){const[i,r]=_j(s);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=_j(s);t=t(n!==void 0?n:e.custom,i,r)}return t}const mS=e=>Array.isArray(e),eX=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),tX=e=>mS(e)?e[e.length-1]||0:e,Ui=e=>!!(e&&e.getVelocity);function zb(e){const t=Ui(e)?e.get():e;return eX(t)?t.toValue():t}function nX({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,r){const a={latestValues:sX(s,i,r,e),renderState:t()};return n&&(a.onMount=l=>n({props:s,current:l,...a}),a.onUpdate=l=>n(l)),a}const dP=e=>(t,n)=>{const s=g.useContext(ux),i=g.useContext(cx),r=()=>nX(e,t,s,i);return n?r():lx(r)};function sX(e,t,n,s){const i={},r=s(e,{});for(const h in r)i[h]=zb(r[h]);let{initial:a,animate:l}=e;const c=fx(e),u=oP(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!dx(f)){const h=Array.isArray(f)?f:[f];for(let m=0;mt=>typeof t=="string"&&t.startsWith(e),hP=fP("--"),iX=fP("var(--"),Ek=e=>iX(e)?rX.test(e.split("/*")[0].trim()):!1,rX=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mP=(e,t)=>t&&typeof e=="number"?t.transform(e):e,el=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Cp={...ih,transform:e=>el(0,1,e)},F0={...ih,default:1},xg=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),_l=xg("deg"),so=xg("%"),gt=xg("px"),aX=xg("vh"),oX=xg("vw"),Sj={...so,parse:e=>so.parse(e)/100,transform:e=>so.transform(e*100)},lX={borderWidth:gt,borderTopWidth:gt,borderRightWidth:gt,borderBottomWidth:gt,borderLeftWidth:gt,borderRadius:gt,radius:gt,borderTopLeftRadius:gt,borderTopRightRadius:gt,borderBottomRightRadius:gt,borderBottomLeftRadius:gt,width:gt,maxWidth:gt,height:gt,maxHeight:gt,top:gt,right:gt,bottom:gt,left:gt,padding:gt,paddingTop:gt,paddingRight:gt,paddingBottom:gt,paddingLeft:gt,margin:gt,marginTop:gt,marginRight:gt,marginBottom:gt,marginLeft:gt,backgroundPositionX:gt,backgroundPositionY:gt},cX={rotate:_l,rotateX:_l,rotateY:_l,rotateZ:_l,scale:F0,scaleX:F0,scaleY:F0,scaleZ:F0,skew:_l,skewX:_l,skewY:_l,distance:gt,translateX:gt,translateY:gt,translateZ:gt,x:gt,y:gt,z:gt,perspective:gt,transformPerspective:gt,opacity:Cp,originX:Sj,originY:Sj,originZ:gt},Nj={...ih,transform:Math.round},vk={...lX,...cX,zIndex:Nj,size:gt,fillOpacity:Cp,strokeOpacity:Cp,numOctaves:Nj},uX={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},dX=sh.length;function fX(e,t,n){let s="",i=!0;for(let r=0;r({style:{},transform:{},transformOrigin:{},vars:{}}),pP=()=>({...Sk(),attrs:{}}),Nk=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gP(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const r in n)e.style.setProperty(r,n[r])}const bP=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yP(e,t,n,s){gP(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(bP.has(i)?i:gk(i),t.attrs[i])}const qy={};function bX(e){Object.assign(qy,e)}function xP(e,{layout:t,layoutId:n}){return Cu.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qy[e]||e==="opacity")}function Tk(e,t,n){var s;const{style:i}=e,r={};for(const a in i)(Ui(i[a])||t.style&&Ui(t.style[a])||xP(a,e)||((s=n==null?void 0:n.getValue(a))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[a]=i[a]);return r}function EP(e,t,n){const s=Tk(e,t,n);for(const i in e)if(Ui(e[i])||Ui(t[i])){const r=sh.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=e[i]}return s}function yX(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const kj=["x","y","width","height","cx","cy","r"],xX={useVisualState:dP({scrapeMotionValuesFromProps:EP,createRenderState:pP,onUpdate:({props:e,prevProps:t,current:n,renderState:s,latestValues:i})=>{if(!n)return;let r=!!e.drag;if(!r){for(const l in i)if(Cu.has(l)){r=!0;break}}if(!r)return;let a=!t;if(t)for(let l=0;l{yX(n,s),rs.render(()=>{_k(s,i,Nk(n.tagName),e.transformTemplate),yP(n,s)})})}})},EX={useVisualState:dP({scrapeMotionValuesFromProps:Tk,createRenderState:Sk})};function vP(e,t,n){for(const s in t)!Ui(t[s])&&!xP(s,n)&&(e[s]=t[s])}function vX({transformTemplate:e},t){return g.useMemo(()=>{const n=Sk();return wk(n,t,e),Object.assign({},n.vars,n.style)},[t])}function wX(e,t){const n=e.style||{},s={};return vP(s,n,e),Object.assign(s,vX(e,t)),s}function _X(e,t){const n={},s=wX(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}function SX(e,t,n,s){const i=g.useMemo(()=>{const r=pP();return _k(r,t,Nk(s),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};vP(r,e.style,e),i.style={...r,...i.style}}return i}function NX(e=!1){return(n,s,i,{latestValues:r},a)=>{const c=(yk(n)?SX:_X)(s,r,a,n),u=UW(s,typeof n=="string",e),d=n!==g.Fragment?{...u,...c,ref:i}:{},{children:f}=s,h=g.useMemo(()=>Ui(f)?f.get():f,[f]);return g.createElement(n,{...d,children:h})}}function TX(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...yk(s)?xX:EX,preloadedFeatures:e,useRender:NX(i),createVisualElement:t,Component:s};return WW(a)}}function wP(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s(Vb===void 0&&io.set(_i.isProcessing||MW.useManualTiming?_i.timestamp:performance.now()),Vb),set:e=>{Vb=e,queueMicrotask(kX)}};function Ak(e,t){e.indexOf(t)===-1&&e.push(t)}function Ck(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ik{constructor(){this.subscriptions=[]}add(t){return Ak(this.subscriptions,t),()=>Ck(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let r=0;r!isNaN(parseFloat(e));class CX{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=io.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=io.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=AX(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ik);const s=this.events[t].add(n);return t==="change"?()=>{s(),rs.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=io.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Aj)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Aj);return SP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ip(e,t){return new CX(e,t)}function IX(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ip(n))}function jX(e,t){const n=hx(e,t);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const a in r){const l=tX(r[a]);IX(e,a,l)}}function RX(e){return!!(Ui(e)&&e.add)}function pS(e,t){const n=e.getValue("willChange");if(RX(n))return n.add(t)}function NP(e){return e.props[lP]}function jk(e){let t;return()=>(t===void 0&&(t=e()),t)}const OX=jk(()=>window.ScrollTimeline!==void 0);class MX{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s{if(OX()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class LX extends MX{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Vo=e=>e*1e3,Go=e=>e/1e3;function Rk(e){return typeof e=="function"}function Cj(e,t){e.timeline=t,e.onfinish=null}const Ok=e=>Array.isArray(e)&&typeof e[0]=="number",DX={linearEasing:void 0};function PX(e,t){const n=jk(e);return()=>{var s;return(s=DX[t])!==null&&s!==void 0?s:n()}}const Yy=PX(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Nf=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},TP=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let r=0;r`cubic-bezier(${e}, ${t}, ${n}, ${s})`,gS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bm([0,.65,.55,1]),circOut:bm([.55,0,1,.45]),backIn:bm([.31,.01,.66,-.59]),backOut:bm([.33,1.53,.69,.99])};function AP(e,t){if(e)return typeof e=="function"&&Yy()?TP(e,t):Ok(e)?bm(e):Array.isArray(e)?e.map(n=>AP(n,t)||gS.easeOut):gS[e]}const CP=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,BX=1e-7,UX=12;function FX(e,t,n,s,i){let r,a,l=0;do a=t+(n-t)/2,r=CP(a,s,i)-e,r>0?n=a:t=a;while(Math.abs(r)>BX&&++lFX(r,0,1,e,n);return r=>r===0||r===1?r:CP(i(r),t,s)}const IP=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,jP=e=>t=>1-e(1-t),RP=Eg(.33,1.53,.69,.99),Mk=jP(RP),OP=IP(Mk),MP=e=>(e*=2)<1?.5*Mk(e):.5*(2-Math.pow(2,-10*(e-1))),Lk=e=>1-Math.sin(Math.acos(e)),LP=jP(Lk),DP=IP(Lk),PP=e=>/^0[^.\s]+$/u.test(e);function $X(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||PP(e):!0}const Gm=e=>Math.round(e*1e5)/1e5,Dk=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HX(e){return e==null}const zX=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pk=(e,t)=>n=>!!(typeof n=="string"&&zX.test(n)&&n.startsWith(e)||t&&!HX(n)&&Object.prototype.hasOwnProperty.call(n,t)),BP=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,a,l]=s.match(Dk);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},VX=e=>el(0,255,e),Pv={...ih,transform:e=>Math.round(VX(e))},Hc={test:Pk("rgb","red"),parse:BP("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Pv.transform(e)+", "+Pv.transform(t)+", "+Pv.transform(n)+", "+Gm(Cp.transform(s))+")"};function GX(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const bS={test:Pk("#"),parse:GX,transform:Hc.transform},Dd={test:Pk("hsl","hue"),parse:BP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+so.transform(Gm(t))+", "+so.transform(Gm(n))+", "+Gm(Cp.transform(s))+")"},Bi={test:e=>Hc.test(e)||bS.test(e)||Dd.test(e),parse:e=>Hc.test(e)?Hc.parse(e):Dd.test(e)?Dd.parse(e):bS.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hc.transform(e):Dd.transform(e)},KX=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function qX(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Dk))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(KX))===null||n===void 0?void 0:n.length)||0)>0}const UP="number",FP="color",YX="var",WX="var(",Ij="${}",XX=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function jp(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const l=t.replace(XX,c=>(Bi.test(c)?(s.color.push(r),i.push(FP),n.push(Bi.parse(c))):c.startsWith(WX)?(s.var.push(r),i.push(YX),n.push(c)):(s.number.push(r),i.push(UP),n.push(parseFloat(c))),++r,Ij)).split(Ij);return{values:n,split:l,indexes:s,types:i}}function $P(e){return jp(e).values}function HP(e){const{split:t,types:n}=jp(e),s=t.length;return i=>{let r="";for(let a=0;atypeof e=="number"?0:e;function ZX(e){const t=$P(e);return HP(e)(t.map(QX))}const ac={test:qX,parse:$P,createTransformer:HP,getAnimatableNone:ZX},JX=new Set(["brightness","contrast","saturate","opacity"]);function eQ(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Dk)||[];if(!s)return e;const i=n.replace(s,"");let r=JX.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const tQ=/\b([a-z-]*)\(.*?\)/gu,yS={...ac,getAnimatableNone:e=>{const t=e.match(tQ);return t?t.map(eQ).join(" "):e}},nQ={...vk,color:Bi,backgroundColor:Bi,outlineColor:Bi,fill:Bi,stroke:Bi,borderColor:Bi,borderTopColor:Bi,borderRightColor:Bi,borderBottomColor:Bi,borderLeftColor:Bi,filter:yS,WebkitFilter:yS},Bk=e=>nQ[e];function zP(e,t){let n=Bk(e);return n!==yS&&(n=ac),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sQ=new Set(["auto","none","0"]);function iQ(e,t,n){let s=0,i;for(;se===ih||e===gt,Rj=(e,t)=>parseFloat(e.split(", ")[t]),Oj=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return Rj(i[1],t);{const r=s.match(/^matrix\((.+)\)$/u);return r?Rj(r[1],e):0}},rQ=new Set(["x","y","z"]),aQ=sh.filter(e=>!rQ.has(e));function oQ(e){const t=[];return aQ.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Tf={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Oj(4,13),y:Oj(5,14)};Tf.translateX=Tf.x;Tf.translateY=Tf.y;const Zc=new Set;let xS=!1,ES=!1;function VP(){if(ES){const e=Array.from(Zc).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=oQ(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,a])=>{var l;(l=s.getValue(r))===null||l===void 0||l.set(a)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ES=!1,xS=!1,Zc.forEach(e=>e.complete()),Zc.clear()}function GP(){Zc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ES=!0)})}function lQ(){GP(),VP()}class Uk{constructor(t,n,s,i,r,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Zc.add(this),xS||(xS=!0,rs.read(GP),rs.resolveKeyframes(VP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let r=0;r/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),cQ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uQ(e){const t=cQ.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function qP(e,t,n=1){const[s,i]=uQ(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const a=r.trim();return KP(a)?parseFloat(a):a}return Ek(i)?qP(i,t,n+1):i}const YP=e=>t=>t.test(e),dQ={test:e=>e==="auto",parse:e=>e},WP=[ih,gt,so,_l,oX,aX,dQ],Mj=e=>WP.find(YP(e));class XP extends Uk{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const Lj=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ac.test(e)||e==="0")&&!e.startsWith("url("));function fQ(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function mx(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(mQ),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const pQ=40;class QP{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=io.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>pQ?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&lQ(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=io.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!hQ(t,s,i,r))if(a)this.options.duration=0;else{c&&c(mx(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const vS=2e4;function ZP(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t=vS?1/0:t}const ws=(e,t,n)=>e+(t-e)*n;function Bv(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function gQ({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,r=0,a=0;if(!t)i=r=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Bv(c,l,e+1/3),r=Bv(c,l,e),a=Bv(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:s}}function Wy(e,t){return n=>n>0?t:e}const Uv=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},bQ=[bS,Hc,Dd],yQ=e=>bQ.find(t=>t.test(e));function Dj(e){const t=yQ(e);if(!t)return!1;let n=t.parse(e);return t===Dd&&(n=gQ(n)),n}const Pj=(e,t)=>{const n=Dj(e),s=Dj(t);if(!n||!s)return Wy(e,t);const i={...n};return r=>(i.red=Uv(n.red,s.red,r),i.green=Uv(n.green,s.green,r),i.blue=Uv(n.blue,s.blue,r),i.alpha=ws(n.alpha,s.alpha,r),Hc.transform(i))},xQ=(e,t)=>n=>t(e(n)),vg=(...e)=>e.reduce(xQ),wS=new Set(["none","hidden"]);function EQ(e,t){return wS.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function vQ(e,t){return n=>ws(e,t,n)}function Fk(e){return typeof e=="number"?vQ:typeof e=="string"?Ek(e)?Wy:Bi.test(e)?Pj:SQ:Array.isArray(e)?JP:typeof e=="object"?Bi.test(e)?Pj:wQ:Wy}function JP(e,t){const n=[...e],s=n.length,i=e.map((r,a)=>Fk(r)(r,t[a]));return r=>{for(let a=0;a{for(const r in s)n[r]=s[r](i);return n}}function _Q(e,t){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r{const n=ac.createTransformer(t),s=jp(e),i=jp(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?wS.has(e)&&!i.values.length||wS.has(t)&&!s.values.length?EQ(e,t):vg(JP(_Q(s,i),i.values),n):Wy(e,t)};function eB(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ws(e,t,n):Fk(e)(e,t)}const NQ=5;function tB(e,t,n){const s=Math.max(t-NQ,0);return SP(n-e(s),t-s)}const js={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Fv=.001;function TQ({duration:e=js.duration,bounce:t=js.bounce,velocity:n=js.velocity,mass:s=js.mass}){let i,r,a=1-t;a=el(js.minDamping,js.maxDamping,a),e=el(js.minDuration,js.maxDuration,Go(e)),a<1?(i=u=>{const d=u*a,f=d*e,h=d-n,m=_S(u,a),p=Math.exp(-f);return Fv-h/m*p},r=u=>{const f=u*a*e,h=f*n+n,m=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-f),b=_S(Math.pow(u,2),a);return(-i(u)+Fv>0?-1:1)*((h-m)*p)/b}):(i=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Fv+d*f},r=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=AQ(i,r,l);if(e=Vo(e),isNaN(c))return{stiffness:js.stiffness,damping:js.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:a*2*Math.sqrt(s*u),duration:e}}}const kQ=12;function AQ(e,t,n){let s=n;for(let i=1;ie[n]!==void 0)}function jQ(e){let t={velocity:js.velocity,stiffness:js.stiffness,damping:js.damping,mass:js.mass,isResolvedFromDuration:!1,...e};if(!Bj(e,IQ)&&Bj(e,CQ))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*el(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:js.mass,stiffness:i,damping:r}}else{const n=TQ(e);t={...t,...n,mass:js.mass},t.isResolvedFromDuration=!0}return t}function nB(e=js.visualDuration,t=js.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:m}=jQ({...n,velocity:-Go(n.velocity||0)}),p=h||0,b=u/(2*Math.sqrt(c*d)),v=a-r,y=Go(Math.sqrt(c/d)),x=Math.abs(v)<5;s||(s=x?js.restSpeed.granular:js.restSpeed.default),i||(i=x?js.restDelta.granular:js.restDelta.default);let E;if(b<1){const S=_S(y,b);E=_=>{const k=Math.exp(-b*y*_);return a-k*((p+b*y*v)/S*Math.sin(S*_)+v*Math.cos(S*_))}}else if(b===1)E=S=>a-Math.exp(-y*S)*(v+(p+y*v)*S);else{const S=y*Math.sqrt(b*b-1);E=_=>{const k=Math.exp(-b*y*_),T=Math.min(S*_,300);return a-k*((p+b*y*v)*Math.sinh(T)+S*v*Math.cosh(T))/S}}const w={calculatedDuration:m&&f||null,next:S=>{const _=E(S);if(m)l.done=S>=f;else{let k=0;b<1&&(k=S===0?Vo(p):tB(E,S,_));const T=Math.abs(k)<=s,A=Math.abs(a-_)<=i;l.done=T&&A}return l.value=l.done?a:_,l},toString:()=>{const S=Math.min(ZP(w),vS),_=TP(k=>w.next(S*k).value,S,30);return S+"ms "+_}};return w}function Uj({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},m=T=>l!==void 0&&Tc,p=T=>l===void 0?c:c===void 0||Math.abs(l-T)-b*Math.exp(-T/s),E=T=>y+x(T),w=T=>{const A=x(T),j=E(T);h.done=Math.abs(A)<=u,h.value=h.done?y:j};let S,_;const k=T=>{m(h.value)&&(S=T,_=nB({keyframes:[h.value,p(h.value)],velocity:tB(E,T,h.value),damping:i,stiffness:r,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:T=>{let A=!1;return!_&&S===void 0&&(A=!0,w(T),k(T)),S!==void 0&&T>=S?_.next(T-S):(!A&&w(T),h)}}}const RQ=Eg(.42,0,1,1),OQ=Eg(0,0,.58,1),sB=Eg(.42,0,.58,1),MQ=e=>Array.isArray(e)&&typeof e[0]!="number",LQ={linear:Lr,easeIn:RQ,easeInOut:sB,easeOut:OQ,circIn:Lk,circInOut:DP,circOut:LP,backIn:Mk,backInOut:OP,backOut:RP,anticipate:MP},Fj=e=>{if(Ok(e)){nP(e.length===4);const[t,n,s,i]=e;return Eg(t,n,s,i)}else if(typeof e=="string")return LQ[e];return e};function DQ(e,t,n){const s=[],i=n||eB,r=e.length-1;for(let a=0;at[0];if(r===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=DQ(t,s,i),c=l.length,u=d=>{if(a&&d1)for(;fu(el(e[0],e[r-1],d)):u}function BQ(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=Nf(0,t,s);e.push(ws(n,1,i))}}function UQ(e){const t=[0];return BQ(t,e.length-1),t}function FQ(e,t){return e.map(n=>n*t)}function $Q(e,t){return e.map(()=>t||sB).splice(0,e.length-1)}function Xy({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=MQ(s)?s.map(Fj):Fj(s),r={done:!1,value:t[0]},a=FQ(n&&n.length===t.length?n:UQ(t),e),l=PQ(a,t,{ease:Array.isArray(i)?i:$Q(t,i)});return{calculatedDuration:e,next:c=>(r.value=l(c),r.done=c>=e,r)}}const HQ=e=>{const t=({timestamp:n})=>e(n);return{start:()=>rs.update(t,!0),stop:()=>rc(t),now:()=>_i.isProcessing?_i.timestamp:io.now()}},zQ={decay:Uj,inertia:Uj,tween:Xy,keyframes:Xy,spring:nB},VQ=e=>e/100;class $k extends QP{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:s,element:i,keyframes:r}=this.options,a=(i==null?void 0:i.KeyframeResolver)||Uk,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(r,l,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=this.options,l=Rk(n)?n:zQ[n]||Xy;let c,u;l!==Xy&&typeof t[0]!="number"&&(c=vg(VQ,eB(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});r==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=ZP(d));const{calculatedDuration:f}=d,h=f+i,m=h*(s+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:s}=this;if(!s){const{keyframes:T}=this.options;return{done:!0,value:T[T.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=s;if(this.startTime===null)return r.next(0);const{delay:h,repeat:m,repeatType:p,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),x=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let E=this.currentTime,w=r;if(m){const T=Math.min(this.currentTime,d)/f;let A=Math.floor(T),j=T%1;!j&&T>=1&&(j=1),j===1&&A--,A=Math.min(A,m+1),!!(A%2)&&(p==="reverse"?(j=1-j,b&&(j-=b/f)):p==="mirror"&&(w=a)),E=el(0,1,j)*f}const S=x?{done:!1,value:c[0]}:w.next(E);l&&(S.value=l(S.value));let{done:_}=S;!x&&u!==null&&(_=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return k&&i!==void 0&&(S.value=mx(c,this.options,i)),v&&v(S.value),k&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Go(t.calculatedDuration):0}get time(){return Go(this.currentTime)}set time(t){t=Vo(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Go(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=HQ,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const GQ=new Set(["opacity","clipPath","filter","transform"]);function KQ(e,t,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=AP(l,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"})}const qQ=jk(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Qy=10,YQ=2e4;function WQ(e){return Rk(e.type)||e.type==="spring"||!kP(e.ease)}function XQ(e,t){const n=new $k({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:e[0]};const i=[];let r=0;for(;!s.done&&rthis.onKeyframesResolved(a,l),n,s,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:s=300,times:i,ease:r,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof r=="string"&&Yy()&&QQ(r)&&(r=iB[r]),WQ(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:p,...b}=this.options,v=XQ(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),s=v.duration,i=v.times,r=v.ease,a="keyframes"}const d=KQ(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:r});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Cj(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(mx(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:i,type:a,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Go(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Go(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=Vo(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Lr;const{animation:s}=n;Cj(s,t)}return Lr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:s,duration:i,type:r,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...m}=this.options,p=new $k({...m,keyframes:s,duration:i,type:r,ease:a,times:l,isGenerator:!0}),b=Vo(this.time);u.setWithVelocity(p.sample(b-Qy).value,p.sample(b).value,Qy)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:s,repeatDelay:i,repeatType:r,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return qQ()&&s&&GQ.has(s)&&!c&&!u&&!i&&r!=="mirror"&&a!==0&&l!=="inertia"}}const ZQ={type:"spring",stiffness:500,damping:25,restSpeed:10},JQ=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),eZ={type:"keyframes",duration:.8},tZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},nZ=(e,{keyframes:t})=>t.length>2?eZ:Cu.has(e)?e.startsWith("scale")?JQ(t[1]):ZQ:tZ;function sZ({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Hk=(e,t,n,s={},i,r)=>a=>{const l=kk(s,e)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Vo(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:r?void 0:i};sZ(l)||(d={...d,...nZ(e,d)}),d.duration&&(d.duration=Vo(d.duration)),d.repeatDelay&&(d.repeatDelay=Vo(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!r&&t.get()!==void 0){const h=mx(d.keyframes,l);if(h!==void 0)return rs.update(()=>{d.onUpdate(h),d.onComplete()}),new LX([])}return!r&&$j.supports(d)?new $j(d):new $k(d)};function iZ({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function rB(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(a=s);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const h=e.getValue(f,(r=e.latestValues[f])!==null&&r!==void 0?r:null),m=c[f];if(m===void 0||d&&iZ(d,f))continue;const p={delay:n,...kk(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=NP(e);if(y){const x=window.MotionHandoffAnimation(y,f,rs);x!==null&&(p.startTime=x,b=!0)}}pS(e,f),h.start(Hk(f,h,m,e.shouldReduceMotion&&_P.has(f)?{type:!1}:p,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{rs.update(()=>{l&&jX(e,l)})}),u}function SS(e,t,n={}){var s;const i=hx(e,t,n.type==="exit"?(s=e.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const a=i?()=>Promise.all(rB(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=r;return rZ(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=r;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function rZ(e,t,n=0,s=0,i=1,r){const a=[],l=(e.variantChildren.size-1)*s,c=i===1?(u=0)=>u*s:(u=0)=>l-u*s;return Array.from(e.variantChildren).sort(aZ).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(SS(u,t,{...r,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function aZ(e,t){return e.sortNodePosition(t)}function oZ(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(r=>SS(e,r,n));s=Promise.all(i)}else if(typeof t=="string")s=SS(e,t,n);else{const i=typeof t=="function"?hx(e,t,n.custom):t;s=Promise.all(rB(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const lZ=pk.length;function aB(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?aB(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:s})=>oZ(e,n,s)))}function fZ(e){let t=dZ(e),n=Hj(),s=!0;const i=c=>(u,d)=>{var f;const h=hx(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:p,...b}=h;u={...u,...b,...p}}return u};function r(c){t=c(e)}function a(c){const{props:u}=e,d=aB(e.parent)||{},f=[],h=new Set;let m={},p=1/0;for(let v=0;vp&&w,A=!1;const j=Array.isArray(E)?E:[E];let R=j.reduce(i(y),{});S===!1&&(R={});const{prevResolvedValues:B={}}=x,z={...B,...R},L=I=>{T=!0,h.has(I)&&(A=!0,h.delete(I)),x.needsAnimating[I]=!0;const D=e.getValue(I);D&&(D.liveStyle=!1)};for(const I in z){const D=R[I],$=B[I];if(m.hasOwnProperty(I))continue;let O=!1;mS(D)&&mS($)?O=!wP(D,$):O=D!==$,O?D!=null?L(I):h.add(I):D!==void 0&&h.has(I)?L(I):x.protectedKeys[I]=!0}x.prevProp=E,x.prevResolvedValues=R,x.isActive&&(m={...m,...R}),s&&e.blockInitialAnimation&&(T=!1),T&&(!(_&&k)||A)&&f.push(...j.map(I=>({animation:I,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const x=e.getBaseTarget(y),E=e.getValue(y);E&&(E.liveStyle=!0),v[y]=x??null}),f.push({animation:v})}let b=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Hj(),s=!0}}}function hZ(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!wP(t,e):!1}function Nc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hj(){return{animate:Nc(!0),whileInView:Nc(),whileHover:Nc(),whileTap:Nc(),whileDrag:Nc(),whileFocus:Nc(),exit:Nc()}}class hc{constructor(t){this.isMounted=!1,this.node=t}update(){}}class mZ extends hc{constructor(t){super(t),t.animationState||(t.animationState=fZ(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();dx(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let pZ=0;class gZ extends hc{constructor(){super(...arguments),this.id=pZ++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const bZ={animation:{Feature:mZ},exit:{Feature:gZ}},va={x:!1,y:!1};function oB(){return va.x||va.y}function yZ(e){return e==="x"||e==="y"?va[e]?null:(va[e]=!0,()=>{va[e]=!1}):va.x||va.y?null:(va.x=va.y=!0,()=>{va.x=va.y=!1})}const zk=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Rp(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function wg(e){return{point:{x:e.pageX,y:e.pageY}}}const xZ=e=>t=>zk(t)&&e(t,wg(t));function Km(e,t,n,s){return Rp(e,t,xZ(n),s)}const zj=(e,t)=>Math.abs(e-t);function EZ(e,t){const n=zj(e.x,t.x),s=zj(e.y,t.y);return Math.sqrt(n**2+s**2)}class lB{constructor(t,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Hv(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,m=EZ(f.offset,{x:0,y:0})>=3;if(!h&&!m)return;const{point:p}=f,{timestamp:b}=_i;this.history.push({...p,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=$v(h,this.transformPagePoint),rs.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:m,onSessionEnd:p,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Hv(f.type==="pointercancel"?this.lastMoveEventInfo:$v(h,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),p&&p(f,v)},!zk(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const a=wg(t),l=$v(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=_i;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Hv(l,this.history)),this.removeListeners=vg(Km(this.contextWindow,"pointermove",this.handlePointerMove),Km(this.contextWindow,"pointerup",this.handlePointerUp),Km(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),rc(this.updatePoint)}}function $v(e,t){return t?{point:t(e.point)}:e}function Vj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hv({point:e},t){return{point:e,delta:Vj(e,cB(t)),offset:Vj(e,vZ(t)),velocity:wZ(t,.1)}}function vZ(e){return e[0]}function cB(e){return e[e.length-1]}function wZ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=cB(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>Vo(t)));)n--;if(!s)return{x:0,y:0};const r=Go(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const a={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const uB=1e-4,_Z=1-uB,SZ=1+uB,dB=.01,NZ=0-dB,TZ=0+dB;function Ur(e){return e.max-e.min}function kZ(e,t,n){return Math.abs(e-t)<=n}function Gj(e,t,n,s=.5){e.origin=s,e.originPoint=ws(t.min,t.max,e.origin),e.scale=Ur(n)/Ur(t),e.translate=ws(n.min,n.max,e.origin)-e.originPoint,(e.scale>=_Z&&e.scale<=SZ||isNaN(e.scale))&&(e.scale=1),(e.translate>=NZ&&e.translate<=TZ||isNaN(e.translate))&&(e.translate=0)}function qm(e,t,n,s){Gj(e.x,t.x,n.x,s?s.originX:void 0),Gj(e.y,t.y,n.y,s?s.originY:void 0)}function Kj(e,t,n){e.min=n.min+t.min,e.max=e.min+Ur(t)}function AZ(e,t,n){Kj(e.x,t.x,n.x),Kj(e.y,t.y,n.y)}function qj(e,t,n){e.min=t.min-n.min,e.max=e.min+Ur(t)}function Ym(e,t,n){qj(e.x,t.x,n.x),qj(e.y,t.y,n.y)}function CZ(e,{min:t,max:n},s){return t!==void 0&&en&&(e=s?ws(n,e,s.max):Math.min(e,n)),e}function Yj(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function IZ(e,{top:t,left:n,bottom:s,right:i}){return{x:Yj(e.x,n,i),y:Yj(e.y,t,s)}}function Wj(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.mins?n=Nf(t.min,t.max-s,e.min):s>i&&(n=Nf(e.min,e.max-i,t.min)),el(0,1,n)}function OZ(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const NS=.35;function MZ(e=NS){return e===!1?e=0:e===!0&&(e=NS),{x:Xj(e,"left","right"),y:Xj(e,"top","bottom")}}function Xj(e,t,n){return{min:Qj(e,t),max:Qj(e,n)}}function Qj(e,t){return typeof e=="number"?e:e[t]||0}const Zj=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pd=()=>({x:Zj(),y:Zj()}),Jj=()=>({min:0,max:0}),$s=()=>({x:Jj(),y:Jj()});function Gr(e){return[e("x"),e("y")]}function fB({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function LZ({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function DZ(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function zv(e){return e===void 0||e===1}function TS({scale:e,scaleX:t,scaleY:n}){return!zv(e)||!zv(t)||!zv(n)}function Oc(e){return TS(e)||hB(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function hB(e){return eR(e.x)||eR(e.y)}function eR(e){return e&&e!=="0%"}function Zy(e,t,n){const s=e-n,i=t*s;return n+i}function tR(e,t,n,s,i){return i!==void 0&&(e=Zy(e,i,s)),Zy(e,n,s)+t}function kS(e,t=0,n=1,s,i){e.min=tR(e.min,t,n,s,i),e.max=tR(e.max,t,n,s,i)}function mB(e,{x:t,y:n}){kS(e.x,t.translate,t.scale,t.originPoint),kS(e.y,n.translate,n.scale,n.originPoint)}const nR=.999999999999,sR=1.0000000000001;function PZ(e,t,n,s=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,a;for(let l=0;lnR&&(t.x=1),t.ynR&&(t.y=1)}function Bd(e,t){e.min=e.min+t,e.max=e.max+t}function iR(e,t,n,s,i=.5){const r=ws(e.min,e.max,i);kS(e,t,n,r,s)}function Ud(e,t){iR(e.x,t.x,t.scaleX,t.scale,t.originX),iR(e.y,t.y,t.scaleY,t.scale,t.originY)}function pB(e,t){return fB(DZ(e.getBoundingClientRect(),t))}function BZ(e,t,n){const s=pB(e,n),{scroll:i}=t;return i&&(Bd(s.x,i.offset.x),Bd(s.y,i.offset.y)),s}const gB=({current:e})=>e?e.ownerDocument.defaultView:null,UZ=new WeakMap;class FZ{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$s(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(wg(d).point)},r=(d,f)=>{const{drag:h,dragPropagation:m,onDragStart:p}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=yZ(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gr(v=>{let y=this.getAxisMotionValue(v).get()||0;if(so.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const E=x.layout.layoutBox[v];E&&(y=Ur(E)*(parseFloat(y)/100))}}this.originPoint[v]=y}),p&&rs.postRender(()=>p(d,f)),pS(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:p,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(m&&this.currentDirection===null){this.currentDirection=$Z(v),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Gr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new lB(t,{onSessionStart:i,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:gB(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&rs.postRender(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:i}=this.getProps();if(!s||!$0(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let a=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(a=CZ(a,this.constraints[t],this.elastic[t])),r.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&Ld(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=IZ(i.layoutBox,n):this.constraints=!1,this.elastic=MZ(s),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Gr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=OZ(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ld(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=BZ(s,i.root,this.visualElement.getTransformPagePoint());let a=jZ(i.layout.layoutBox,r);if(n){const l=n(LZ(a));this.hasMutatedConstraints=!!l,l&&(a=fB(l))}return a}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Gr(d=>{if(!$0(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=i?200:1e6,m=i?40:1e7,p={type:"inertia",velocity:s?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...r,...f};return this.startAxisValueAnimation(d,p)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return pS(this.visualElement,t),s.start(Hk(t,s,0,n,this.visualElement,!1))}stopAnimation(){Gr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Gr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Gr(n=>{const{drag:s}=this.getProps();if(!$0(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:l}=i.layout.layoutBox[n];r.set(t[n]-ws(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Ld(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Gr(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();i[a]=RZ({min:c,max:c},this.constraints[a])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Gr(a=>{if(!$0(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(ws(c,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;UZ.set(this.visualElement,this);const t=this.visualElement.current,n=Km(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();Ld(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),rs.read(s);const a=Rp(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Gr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),r(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:a=NS,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:a,dragMomentum:l}}}function $0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $Z(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class HZ extends hc{constructor(t){super(t),this.removeGroupControls=Lr,this.removeListeners=Lr,this.controls=new FZ(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Lr}unmount(){this.removeGroupControls(),this.removeListeners()}}const rR=e=>(t,n)=>{e&&rs.postRender(()=>e(t,n))};class zZ extends hc{constructor(){super(...arguments),this.removePointerDownListener=Lr}onPointerDown(t){this.session=new lB(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gB(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:rR(t),onStart:rR(n),onMove:s,onEnd:(r,a)=>{delete this.session,i&&rs.postRender(()=>i(r,a))}}}mount(){this.removePointerDownListener=Km(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Gb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function aR(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Yh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(gt.test(e))e=parseFloat(e);else return e;const n=aR(e,t.target.x),s=aR(e,t.target.y);return`${n}% ${s}%`}},VZ={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=ac.parse(e);if(i.length>5)return s;const r=ac.createTransformer(e),a=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+a]/=l,i[1+a]/=c;const u=ws(l,c,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),r(i)}};class GZ extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=t;bX(KZ),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Gb.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,a=s.projection;return a&&(a.isPresent=r,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?a.promote():a.relegate()||rs.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),bk.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function bB(e){const[t,n]=eP(),s=g.useContext(fk);return o.jsx(GZ,{...e,layoutGroup:s,switchLayoutGroup:g.useContext(cP),isPresent:t,safeToRemove:n})}const KZ={borderRadius:{...Yh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yh,borderTopRightRadius:Yh,borderBottomLeftRadius:Yh,borderBottomRightRadius:Yh,boxShadow:VZ};function qZ(e,t,n){const s=Ui(e)?e:Ip(e);return s.start(Hk("",s,t,n)),s.animation}function YZ(e){return e instanceof SVGElement&&e.tagName!=="svg"}const WZ=(e,t)=>e.depth-t.depth;class XZ{constructor(){this.children=[],this.isDirty=!1}add(t){Ak(this.children,t),this.isDirty=!0}remove(t){Ck(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(WZ),this.isDirty=!1,this.children.forEach(t)}}function QZ(e,t){const n=io.now(),s=({timestamp:i})=>{const r=i-n;r>=t&&(rc(s),e(r-t))};return rs.read(s,!0),()=>rc(s)}const yB=["TopLeft","TopRight","BottomLeft","BottomRight"],ZZ=yB.length,oR=e=>typeof e=="string"?parseFloat(e):e,lR=e=>typeof e=="number"||gt.test(e);function JZ(e,t,n,s,i,r){i?(e.opacity=ws(0,n.opacity!==void 0?n.opacity:1,eJ(s)),e.opacityExit=ws(t.opacity!==void 0?t.opacity:1,0,tJ(s))):r&&(e.opacity=ws(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let a=0;ast?1:n(Nf(e,t,s))}function uR(e,t){e.min=t.min,e.max=t.max}function Vr(e,t){uR(e.x,t.x),uR(e.y,t.y)}function dR(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function fR(e,t,n,s,i){return e-=t,e=Zy(e,1/n,s),i!==void 0&&(e=Zy(e,1/i,s)),e}function nJ(e,t=0,n=1,s=.5,i,r=e,a=e){if(so.test(t)&&(t=parseFloat(t),t=ws(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=ws(r.min,r.max,s);e===r&&(l-=t),e.min=fR(e.min,t,n,l,i),e.max=fR(e.max,t,n,l,i)}function hR(e,t,[n,s,i],r,a){nJ(e,t[n],t[s],t[i],t.scale,r,a)}const sJ=["x","scaleX","originX"],iJ=["y","scaleY","originY"];function mR(e,t,n,s){hR(e.x,t,sJ,n?n.x:void 0,s?s.x:void 0),hR(e.y,t,iJ,n?n.y:void 0,s?s.y:void 0)}function pR(e){return e.translate===0&&e.scale===1}function EB(e){return pR(e.x)&&pR(e.y)}function gR(e,t){return e.min===t.min&&e.max===t.max}function rJ(e,t){return gR(e.x,t.x)&&gR(e.y,t.y)}function bR(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vB(e,t){return bR(e.x,t.x)&&bR(e.y,t.y)}function yR(e){return Ur(e.x)/Ur(e.y)}function xR(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class aJ{constructor(){this.members=[]}add(t){Ak(this.members,t),t.scheduleRender()}remove(t){if(Ck(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function oJ(e,t,n){let s="";const i=e.x.translate/t.x,r=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||r||a)&&(s=`translate3d(${i}px, ${r}px, ${a}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:m,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}deg) `),m&&(s+=`skewX(${m}deg) `),p&&(s+=`skewY(${p}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const Mc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},ym=typeof window<"u"&&window.MotionDebug!==void 0,Vv=["","X","Y","Z"],lJ={visibility:"hidden"},ER=1e3;let cJ=0;function Gv(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function wB(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=NP(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",rs,!(i||r))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&wB(s)}function _B({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(a={},l=t==null?void 0:t()){this.id=cJ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,ym&&(Mc.totalNodes=Mc.resolvedTargetDeltas=Mc.recalculatedProjection=0),this.nodes.forEach(fJ),this.nodes.forEach(bJ),this.nodes.forEach(yJ),this.nodes.forEach(hJ),ym&&window.MotionDebug.record(Mc)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=QZ(h,250),Gb.hasAnimatedSinceResize&&(Gb.hasAnimatedSinceResize=!1,this.nodes.forEach(wR))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||_J,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),x=!this.targetLayout||!vB(this.targetLayout,p)||m,E=!h&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,E);const w={...kk(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||wR(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,rc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(xJ),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&wB(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=w/1e3;_R(f.x,a.x,S),_R(f.y,a.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ym(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),vJ(this.relativeTarget,this.relativeTargetOrigin,h,S),E&&rJ(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=$s()),Vr(E,this.relativeTarget)),b&&(this.animationValues=d,JZ(d,u,this.latestValues,S,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(rc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rs.update(()=>{Gb.hasAnimatedSinceResize=!0,this.currentAnimation=qZ(0,ER,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ER),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&SB(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||$s();const f=Ur(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=Ur(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Vr(l,c),Ud(l,d),qm(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new aJ),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Gv("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(vR),this.root.sharedNodes.clear()}}}function uJ(e){e.updateLayout()}function dJ(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:r}=e.options,a=n.source!==e.layout.source;r==="size"?Gr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=Ur(h);h.min=s[f].min,h.max=h.min+m}):SB(r,n.layoutBox,s)&&Gr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],m=Ur(s[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=Pd();qm(l,s,n.layoutBox);const c=Pd();a?qm(c,e.applyTransform(i,!0),n.measuredBox):qm(c,s,n.layoutBox);const u=!EB(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const p=$s();Ym(p,n.layoutBox,h.layoutBox);const b=$s();Ym(b,s,m.layoutBox),vB(p,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=p,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function fJ(e){ym&&Mc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function hJ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function mJ(e){e.clearSnapshot()}function vR(e){e.clearMeasurements()}function pJ(e){e.isLayoutDirty=!1}function gJ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function wR(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bJ(e){e.resolveTargetDelta()}function yJ(e){e.calcProjection()}function xJ(e){e.resetSkewAndRotation()}function EJ(e){e.removeLeadSnapshot()}function _R(e,t,n){e.translate=ws(t.translate,0,n),e.scale=ws(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function SR(e,t,n,s){e.min=ws(t.min,n.min,s),e.max=ws(t.max,n.max,s)}function vJ(e,t,n,s){SR(e.x,t.x,n.x,s),SR(e.y,t.y,n.y,s)}function wJ(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const _J={duration:.45,ease:[.4,0,.1,1]},NR=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),TR=NR("applewebkit/")&&!NR("chrome/")?Math.round:Lr;function kR(e){e.min=TR(e.min),e.max=TR(e.max)}function SJ(e){kR(e.x),kR(e.y)}function SB(e,t,n){return e==="position"||e==="preserve-aspect"&&!kZ(yR(t),yR(n),.2)}function NJ(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const TJ=_B({attachResizeListener:(e,t)=>Rp(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Kv={current:void 0},NB=_B({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kv.current){const e=new TJ({});e.mount(window),e.setOptions({layoutScroll:!0}),Kv.current=e}return Kv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),kJ={pan:{Feature:zZ},drag:{Feature:HZ,ProjectionNode:NB,MeasureLayout:bB}};function AJ(e,t,n){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const r=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}function TB(e,t){const n=AJ(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function AR(e){return t=>{t.pointerType==="touch"||oB()||e(t)}}function CJ(e,t,n={}){const[s,i,r]=TB(e,n),a=AR(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=AR(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return s.forEach(l=>{l.addEventListener("pointerenter",a,i)}),r}function CR(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&rs.postRender(()=>r(t,wg(t)))}class IJ extends hc{mount(){const{current:t}=this.node;t&&(this.unmount=CJ(t,n=>(CR(this.node,n,"Start"),s=>CR(this.node,s,"End"))))}unmount(){}}class jJ extends hc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=vg(Rp(this.node.current,"focus",()=>this.onFocus()),Rp(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const kB=(e,t)=>t?e===t?!0:kB(e,t.parentElement):!1,RJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function OJ(e){return RJ.has(e.tagName)||e.tabIndex!==-1}const xm=new WeakSet;function IR(e){return t=>{t.key==="Enter"&&e(t)}}function qv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const MJ=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=IR(()=>{if(xm.has(n))return;qv(n,"down");const i=IR(()=>{qv(n,"up")}),r=()=>qv(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function jR(e){return zk(e)&&!oB()}function LJ(e,t,n={}){const[s,i,r]=TB(e,n),a=l=>{const c=l.currentTarget;if(!jR(l)||xm.has(c))return;xm.add(c);const u=t(l),d=(m,p)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!jR(m)||!xm.has(c))&&(xm.delete(c),typeof u=="function"&&u(m,{success:p}))},f=m=>{d(m,n.useGlobalTarget||kB(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return s.forEach(l=>{!OJ(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,i),l.addEventListener("focus",u=>MJ(u,i),i)}),r}function RR(e,t,n){const{props:s}=e;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&rs.postRender(()=>r(t,wg(t)))}class DJ extends hc{mount(){const{current:t}=this.node;t&&(this.unmount=LJ(t,n=>(RR(this.node,n,"Start"),(s,{success:i})=>RR(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const AS=new WeakMap,Yv=new WeakMap,PJ=e=>{const t=AS.get(e.target);t&&t(e)},BJ=e=>{e.forEach(PJ)};function UJ({root:e,...t}){const n=e||document;Yv.has(n)||Yv.set(n,{});const s=Yv.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(BJ,{root:e,...t})),s[i]}function FJ(e,t,n){const s=UJ(t);return AS.set(e,n),s.observe(e),()=>{AS.delete(e),s.unobserve(e)}}const $J={some:0,all:1};class HJ extends hc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=t,a={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:$J[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return FJ(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(zJ(t,n))&&this.startObserver()}unmount(){}}function zJ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const VJ={inView:{Feature:HJ},tap:{Feature:DJ},focus:{Feature:jJ},hover:{Feature:IJ}},GJ={layout:{ProjectionNode:NB,MeasureLayout:bB}},CS={current:null},AB={current:!1};function KJ(){if(AB.current=!0,!!hk)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>CS.current=e.matches;e.addListener(t),t()}else CS.current=!1}const qJ=[...WP,Bi,ac],YJ=e=>qJ.find(YP(e)),OR=new WeakMap;function WJ(e,t,n){for(const s in t){const i=t[s],r=n[s];if(Ui(i))e.addValue(s,i);else if(Ui(r))e.addValue(s,Ip(i,{owner:e}));else if(r!==i)if(e.hasValue(s)){const a=e.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(s);e.addValue(s,Ip(a!==void 0?a:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const MR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class XJ{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Uk,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=io.now();this.renderScheduledAtthis.bindToMotionValue(s,n)),AB.current||KJ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:CS.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){OR.delete(this.current),this.projection&&this.projection.unmount(),rc(this.notifyUpdate),rc(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Cu.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&rs.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Sf){const n=Sf[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$s()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Ip(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(KP(i)||PP(i))?i=parseFloat(i):!YJ(i)&&ac.test(n)&&(i=zP(t,n)),this.setBaseTarget(t,Ui(i)?i.get():i)),Ui(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const a=xk(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(i=a[t])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!Ui(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ik),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class CB extends XJ{constructor(){super(...arguments),this.KeyframeResolver=XP}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ui(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function QJ(e){return window.getComputedStyle(e)}class ZJ extends CB{constructor(){super(...arguments),this.type="html",this.renderInstance=gP}readValueFromInstance(t,n){if(Cu.has(n)){const s=Bk(n);return s&&s.default||0}else{const s=QJ(t),i=(hP(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return pB(t,n)}build(t,n,s){wk(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Tk(t,n,s)}}class JJ extends CB{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=$s}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Cu.has(n)){const s=Bk(n);return s&&s.default||0}return n=bP.has(n)?n:gk(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return EP(t,n,s)}build(t,n,s){_k(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){yP(t,n,s,i)}mount(t){this.isSVGTag=Nk(t.tagName),super.mount(t)}}const eee=(e,t)=>yk(e)?new JJ(t):new ZJ(t,{allowProjection:e!==g.Fragment}),tee=TX({...bZ,...VJ,...kJ,...GJ},eee),ss=$W(tee);function ci(){return ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?g.useEffect:g.useLayoutEffect;function gd(e,t,n){var s=g.useRef(t);s.current=t,g.useEffect(function(){function i(r){s.current(r)}return e&&window.addEventListener(e,i,n),function(){e&&window.removeEventListener(e,i)}},[e])}var nee=["container"];function see(e){var t=e.container,n=t===void 0?document.body:t,s=px(e,nee);return yi.createPortal(Pt.createElement("div",ci({},s)),n)}function iee(e){return Pt.createElement("svg",ci({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pt.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function ree(e){return Pt.createElement("svg",ci({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pt.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function aee(e){return Pt.createElement("svg",ci({width:"44",height:"44",viewBox:"0 0 768 768"},e),Pt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function oee(){return g.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function DR(e){var t=e.touches[0],n=t.clientX,s=t.clientY;if(e.touches.length>=2){var i=e.touches[1],r=i.clientX,a=i.clientY;return[(n+r)/2,(s+a)/2,Math.sqrt(Math.pow(r-n,2)+Math.pow(a-s,2))]}return[n,s,0]}var Al=function(e,t,n,s){var i,r=n*t,a=(r-s)/2,l=e;return r<=s?(i=1,l=0):e>0&&a-e<=0?(i=2,l=a):e<0&&a+e<=0&&(i=3,l=-a),[i,l]};function Wv(e,t,n,s,i,r,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=Al(e,r,n,innerWidth)[0],f=Al(t,r,s,innerHeight),h=innerWidth/2,m=innerHeight/2;return{x:a-r/i*(a-(h+e))-h+(s/n>=3&&n*r===innerWidth?0:d?c/2:c),y:l-r/i*(l-(m+t))-m+(f[0]?u/2:u),lastCX:a,lastCY:l}}function RS(e,t,n){var s=e%180!=0;return s?[n,t,s]:[t,n,s]}function Xv(e,t,n){var s=RS(n,innerWidth,innerHeight),i=s[0],r=s[1],a=0,l=i,c=r,u=e/t*r,d=t/e*i;return e=r?l=u:e>=i&&ti/r?c=d:t/e>=3&&!s[2]?a=((c=d)-r)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function z0(e,t){var n=t.leading,s=n!==void 0&&n,i=t.maxWait,r=t.wait,a=r===void 0?i||0:r,l=g.useRef(e);l.current=e;var c=g.useRef(0),u=g.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=g.useCallback(function(){var h=[].slice.call(arguments),m=Date.now();function p(){c.current=m,d(),l.current.apply(null,h)}var b=c.current,v=m-b;if(b===0&&(s&&p(),c.current=m),i!==void 0){if(v>i)return void p()}else v=1&&r&&r())};d()}function d(){c=requestAnimationFrame(u)}}var cee={T:0,L:0,W:0,H:0,FIT:void 0},jB=function(){var e=g.useRef(!1);return g.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},uee=["className"];function dee(e){var t=e.className,n=t===void 0?"":t,s=px(e,uee);return Pt.createElement("div",ci({className:"PhotoView__Spinner "+n},s),Pt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Pt.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),Pt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var fee=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function hee(e){var t=e.src,n=e.loaded,s=e.broken,i=e.className,r=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=px(e,fee),u=jB();return t&&!s?Pt.createElement(Pt.Fragment,null,Pt.createElement("img",ci({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(d){var f=d.target;u.current&&r({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&r({broken:!0})},draggable:!1,alt:""},c)),!n&&(a?Pt.createElement("span",{className:"PhotoView__icon"},a):Pt.createElement(dee,{className:"PhotoView__icon"}))):l?Pt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var mee={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function pee(e){var t=e.item,n=t.src,s=t.render,i=t.width,r=i===void 0?0:i,a=t.height,l=a===void 0?0:a,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,m=e.className,p=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,x=e.onMaskTap,E=e.onReachMove,w=e.onReachUp,S=e.onPhotoResize,_=e.isActive,k=e.expose,T=Jy(mee),A=T[0],j=T[1],R=g.useRef(0),B=jB(),z=A.naturalWidth,L=z===void 0?r:z,F=A.naturalHeight,C=F===void 0?l:F,I=A.width,D=I===void 0?r:I,$=A.height,O=$===void 0?l:$,te=A.loaded,ne=te===void 0?!n:te,P=A.broken,Q=A.x,ee=A.y,V=A.touched,X=A.stopRaf,K=A.maskTouched,ce=A.rotate,he=A.scale,ye=A.CX,ue=A.CY,we=A.lastX,De=A.lastY,Se=A.lastCX,ae=A.lastCY,pe=A.lastScale,_e=A.touchTime,et=A.touchLength,Be=A.pause,Fe=A.reach,We=Jc({onScale:function(ge){return Ae(H0(ge))},onRotate:function(ge){ce!==ge&&(k({rotate:ge}),j(ci({rotate:ge},Xv(L,C,ge))))}});function Ae(ge,$e,nt){he!==ge&&(k({scale:ge}),j(ci({scale:ge},Wv(Q,ee,D,O,he,ge,$e,nt),ge<=1&&{x:0,y:0})))}var Ke=z0(function(ge,$e,nt){if(nt===void 0&&(nt=0),(V||K)&&_){var $t=RS(ce,D,O),qn=$t[0],nn=$t[1];if(nt===0&&R.current===0){var qt=Math.abs(ge-ye)<=20,mn=Math.abs($e-ue)<=20;if(qt&&mn)return void j({lastCX:ge,lastCY:$e});R.current=qt?$e>ue?3:2:1}var wt,Bt=ge-Se,Tt=$e-ae;if(nt===0){var En=Al(Bt+we,he,qn,innerWidth)[0],vn=Al(Tt+De,he,nn,innerHeight);wt=function(os,Os,Ms,wn){return Os&&os===1||wn==="x"?"x":Ms&&os>1||wn==="y"?"y":void 0}(R.current,En,vn[0],Fe),wt!==void 0&&E(wt,ge,$e,he)}if(wt==="x"||K)return void j({reach:"x"});var Ht=H0(he+(nt-et)/100/2*he,L/D,.2);k({scale:Ht}),j(ci({touchLength:nt,reach:wt,scale:Ht},Wv(Q,ee,D,O,he,Ht,ge,$e,Bt,Tt)))}},{maxWait:8});function Ue(ge){return!X&&!V&&(B.current&&j(ci({},ge,{pause:u})),B.current)}var W,oe,Z,Ee,Oe,at,Lt,ct,yn=(Oe=function(ge){return Ue({x:ge})},at=function(ge){return Ue({y:ge})},Lt=function(ge){return B.current&&(k({scale:ge}),j({scale:ge})),!V&&B.current},ct=Jc({X:function(ge){return Oe(ge)},Y:function(ge){return at(ge)},S:function(ge){return Lt(ge)}}),function(ge,$e,nt,$t,qn,nn,qt,mn,wt,Bt,Tt){var En=RS(Bt,qn,nn),vn=En[0],Ht=En[1],os=Al(ge,mn,vn,innerWidth),Os=os[0],Ms=os[1],wn=Al($e,mn,Ht,innerHeight),ls=wn[0],Yn=wn[1],Wn=Date.now()-Tt;if(Wn>=200||mn!==qt||Math.abs(wt-qt)>1){var ri=Wv(ge,$e,qn,nn,qt,mn),ps=ri.x,Ls=ri.y,Ln=Os?Ms:ps!==ge?ps:null,Ds=ls?Yn:Ls!==$e?Ls:null;return Ln!==null&&Fc(ge,Ln,ct.X),Ds!==null&&Fc($e,Ds,ct.Y),void(mn!==qt&&Fc(qt,mn,ct.S))}var Cn=(ge-nt)/Wn,Ss=($e-$t)/Wn,Ps=Math.sqrt(Math.pow(Cn,2)+Math.pow(Ss,2)),cs=!1,gs=!1;(function(Dn,pn){var on,Yt=Dn,_n=0,de=0,Ie=function(ot){on||(on=ot);var mt=ot-on,bt=Math.sign(Dn),$n=-.001*bt,Le=Math.sign(-Yt)*Math.pow(Yt,2)*2e-4,bs=Yt*mt+($n+Le)*Math.pow(mt,2)/2;_n+=bs,on=ot,bt*(Yt+=($n+Le)*mt)<=0?Xe():pn(_n)?Me():Xe()};function Me(){de=requestAnimationFrame(Ie)}function Xe(){cancelAnimationFrame(de)}Me()})(Ps,function(Dn){var pn=ge+Dn*(Cn/Ps),on=$e+Dn*(Ss/Ps),Yt=Al(pn,qt,vn,innerWidth),_n=Yt[0],de=Yt[1],Ie=Al(on,qt,Ht,innerHeight),Me=Ie[0],Xe=Ie[1];if(_n&&!cs&&(cs=!0,Os?Fc(pn,de,ct.X):PR(de,pn+(pn-de),ct.X)),Me&&!gs&&(gs=!0,ls?Fc(on,Xe,ct.Y):PR(Xe,on+(on-Xe),ct.Y)),cs&&gs)return!1;var ot=cs||ct.X(de),mt=gs||ct.Y(Xe);return ot&&mt})}),Et=(W=y,oe=function(ge,$e){Fe||Ae(he!==1?1:Math.max(2,L/D),ge,$e)},Z=g.useRef(0),Ee=z0(function(){Z.current=0,W.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ge=[].slice.call(arguments);Z.current+=1,Ee.apply(void 0,ge),Z.current>=2&&(Ee.cancel(),Z.current=0,oe.apply(void 0,ge))});function vt(ge,$e){if(R.current=0,(V||K)&&_){j({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var nt=H0(he,L/D);if(yn(Q,ee,we,De,D,O,he,nt,pe,ce,_e),w(ge,$e),ye===ge&&ue===$e){if(V)return void Et(ge,$e);K&&x(ge,$e)}}}function xn(ge,$e,nt){nt===void 0&&(nt=0),j({touched:!0,CX:ge,CY:$e,lastCX:ge,lastCY:$e,lastX:Q,lastY:ee,lastScale:he,touchLength:nt,touchTime:Date.now()})}function Vt(ge){j({maskTouched:!0,CX:ge.clientX,CY:ge.clientY,lastX:Q,lastY:ee})}gd(Io?void 0:"mousemove",function(ge){ge.preventDefault(),Ke(ge.clientX,ge.clientY)}),gd(Io?void 0:"mouseup",function(ge){vt(ge.clientX,ge.clientY)}),gd(Io?"touchmove":void 0,function(ge){ge.preventDefault();var $e=DR(ge);Ke.apply(void 0,$e)},{passive:!1}),gd(Io?"touchend":void 0,function(ge){var $e=ge.changedTouches[0];vt($e.clientX,$e.clientY)},{passive:!1}),gd("resize",z0(function(){ne&&!V&&(j(Xv(L,C,ce)),S())},{maxWait:8})),jS(function(){_&&k(ci({scale:he,rotate:ce},We))},[_]);var Ft=function(ge,$e,nt,$t,qn,nn,qt,mn,wt,Bt){var Tt=function(ps,Ls,Ln,Ds,Cn){var Ss=g.useRef(!1),Ps=Jy({lead:!0,scale:Ln}),cs=Ps[0],gs=cs.lead,Dn=cs.scale,pn=Ps[1],on=z0(function(Yt){try{return Cn(!0),pn({lead:!1,scale:Yt}),Promise.resolve()}catch(_n){return Promise.reject(_n)}},{wait:Ds});return jS(function(){Ss.current?(Cn(!1),pn({lead:!0}),on(Ln)):Ss.current=!0},[Ln]),gs?[ps*Dn,Ls*Dn,Ln/Dn]:[ps*Ln,Ls*Ln,1]}(nn,qt,mn,wt,Bt),En=Tt[0],vn=Tt[1],Ht=Tt[2],os=function(ps,Ls,Ln,Ds,Cn){var Ss=g.useState(cee),Ps=Ss[0],cs=Ss[1],gs=g.useState(0),Dn=gs[0],pn=gs[1],on=g.useRef(),Yt=Jc({OK:function(){return ps&&pn(4)}});function _n(de){Cn(!1),pn(de)}return g.useEffect(function(){if(on.current||(on.current=Date.now()),Ln){if(function(de,Ie){var Me=de&&de.current;if(Me&&Me.nodeType===1){var Xe=Me.getBoundingClientRect();Ie({T:Xe.top,L:Xe.left,W:Xe.width,H:Xe.height,FIT:Me.tagName==="IMG"?getComputedStyle(Me).objectFit:void 0})}}(Ls,cs),ps)return Date.now()-on.current<250?(pn(1),requestAnimationFrame(function(){pn(2),requestAnimationFrame(function(){return _n(3)})}),void setTimeout(Yt.OK,Ds)):void pn(4);_n(5)}},[ps,Ln]),[Dn,Ps]}(ge,$e,nt,wt,Bt),Os=os[0],Ms=os[1],wn=Ms.W,ls=Ms.FIT,Yn=innerWidth/2,Wn=innerHeight/2,ri=Os<3||Os>4;return[ri?wn?Ms.L:Yn:$t+(Yn-nn*mn/2),ri?wn?Ms.T:Wn:qn+(Wn-qt*mn/2),En,ri&&ls?En*(Ms.H/wn):vn,Os===0?Ht:ri?wn/(nn*mn)||.01:Ht,ri?ls?1:0:1,Os,ls]}(u,c,ne,Q,ee,D,O,he,d,function(ge){return j({pause:ge})}),it=Ft[4],dt=Ft[6],He="transform "+d+"ms "+f,St={className:m,onMouseDown:Io?void 0:function(ge){ge.stopPropagation(),ge.button===0&&xn(ge.clientX,ge.clientY,0)},onTouchStart:Io?function(ge){ge.stopPropagation(),xn.apply(void 0,DR(ge))}:void 0,onWheel:function(ge){if(!Fe){var $e=H0(he-ge.deltaY/100/2,L/D);j({stopRaf:!0}),Ae($e,ge.clientX,ge.clientY)}},style:{width:Ft[2]+"px",height:Ft[3]+"px",opacity:Ft[5],objectFit:dt===4?void 0:Ft[7],transform:ce?"rotate("+ce+"deg)":void 0,transition:dt>2?He+", opacity "+d+"ms ease, height "+(dt<4?d/2:dt>4?d:0)+"ms "+f:void 0}};return Pt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:p,onMouseDown:!Io&&_?Vt:void 0,onTouchStart:Io&&_?function(ge){return Vt(ge.touches[0])}:void 0},Pt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+it+", 0, 0, "+it+", "+Ft[0]+", "+Ft[1]+")",transition:V||Be?void 0:He,willChange:_?"transform":void 0}},n?Pt.createElement(hee,ci({src:n,loaded:ne,broken:P},St,{onPhotoLoad:function(ge){j(ci({},ge,ge.loaded&&Xv(ge.naturalWidth||0,ge.naturalHeight||0,ce)))},loadingElement:b,brokenElement:v})):s&&s({attrs:St,scale:it,rotate:ce})))}var BR={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function gee(e){var t=e.loop,n=t===void 0?3:t,s=e.speed,i=e.easing,r=e.photoClosable,a=e.maskClosable,l=a===void 0||a,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,m=h===void 0||h,p=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,x=e.photoClassName,E=e.photoWrapClassName,w=e.loadingElement,S=e.brokenElement,_=e.images,k=e.index,T=k===void 0?0:k,A=e.onIndexChange,j=e.visible,R=e.onClose,B=e.afterClose,z=e.portalContainer,L=Jy(BR),F=L[0],C=L[1],I=g.useState(0),D=I[0],$=I[1],O=F.x,te=F.touched,ne=F.pause,P=F.lastCX,Q=F.lastCY,ee=F.bg,V=ee===void 0?u:ee,X=F.lastBg,K=F.overlay,ce=F.minimal,he=F.scale,ye=F.rotate,ue=F.onScale,we=F.onRotate,De=e.hasOwnProperty("index"),Se=De?T:D,ae=De?A:$,pe=g.useRef(Se),_e=_.length,et=_[Se],Be=typeof n=="boolean"?n:_e>n,Fe=function(it,dt){var He=g.useReducer(function(nt){return!nt},!1)[1],St=g.useRef(0),ge=function(nt){var $t=g.useRef(nt);function qn(nn){$t.current=nn}return g.useMemo(function(){(function(nn){it?(nn(it),St.current=1):St.current=2})(qn)},[nt]),[$t.current,qn]}(it),$e=ge[1];return[ge[0],St.current,function(){He(),St.current===2&&($e(!1),dt&&dt()),St.current=0}]}(j,B),We=Fe[0],Ae=Fe[1],Ke=Fe[2];jS(function(){if(We)return C({pause:!0,x:Se*-(innerWidth+td)}),void(pe.current=Se);C(BR)},[We]);var Ue=Jc({close:function(it){we&&we(0),C({overlay:!0,lastBg:V}),R(it)},changeIndex:function(it,dt){dt===void 0&&(dt=!1);var He=Be?pe.current+(it-Se):it,St=_e-1,ge=IS(He,0,St),$e=Be?He:ge,nt=innerWidth+td;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-nt*$e,pause:dt}),pe.current=$e,ae&&ae(Be?it<0?St:it>St?0:it:ge)}}),W=Ue.close,oe=Ue.changeIndex;function Z(it){return it?W():C({overlay:!K})}function Ee(){C({x:-(innerWidth+td)*Se,lastCX:void 0,lastCY:void 0,pause:!0}),pe.current=Se}function Oe(it,dt,He,St){it==="x"?function(ge){if(P!==void 0){var $e=ge-P,nt=$e;!Be&&(Se===0&&$e>0||Se===_e-1&&$e<0)&&(nt=$e/2),C({touched:!0,lastCX:P,x:-(innerWidth+td)*pe.current+nt,pause:!1})}else C({touched:!0,lastCX:ge,x:O,pause:!1})}(dt):it==="y"&&function(ge,$e){if(Q!==void 0){var nt=u===null?null:IS(u,.01,u-Math.abs(ge-Q)/100/4);C({touched:!0,lastCY:Q,bg:$e===1?nt:u,minimal:$e===1})}else C({touched:!0,lastCY:ge,bg:V,minimal:!0})}(He,St)}function at(it,dt){var He=it-(P??it),St=dt-(Q??dt),ge=!1;if(He<-40)oe(Se+1);else if(He>40)oe(Se-1);else{var $e=-(innerWidth+td)*pe.current;Math.abs(St)>100&&ce&&f&&(ge=!0,W()),C({touched:!1,x:$e,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ge||K})}}gd("keydown",function(it){if(j)switch(it.key){case"ArrowLeft":oe(Se-1,!0);break;case"ArrowRight":oe(Se+1,!0);break;case"Escape":W()}});var Lt=function(it,dt,He){return g.useMemo(function(){var St=it.length;return He?it.concat(it).concat(it).slice(St+dt-1,St+dt+2):it.slice(Math.max(dt-1,0),Math.min(dt+2,St+1))},[it,dt,He])}(_,Se,Be);if(!We)return null;var ct=K&&!Ae,yn=j?V:X,Et=ue&&we&&{images:_,index:Se,visible:j,onClose:W,onIndexChange:oe,overlayVisible:ct,overlay:et&&et.overlay,scale:he,rotate:ye,onScale:ue,onRotate:we},vt=s?s(Ae):400,xn=i?i(Ae):LR,Vt=s?s(3):600,Ft=i?i(3):LR;return Pt.createElement(see,{className:"PhotoView-Portal"+(ct?"":" PhotoView-Slider__clean")+(j?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(it){return it.stopPropagation()},container:z},j&&Pt.createElement(oee,null),Pt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ae===1?" PhotoView-Slider__fadeIn":Ae===2?" PhotoView-Slider__fadeOut":""),style:{background:yn?"rgba(0, 0, 0, "+yn+")":void 0,transitionTimingFunction:xn,transitionDuration:(te?0:vt)+"ms",animationDuration:vt+"ms"},onAnimationEnd:Ke}),m&&Pt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Pt.createElement("div",{className:"PhotoView-Slider__Counter"},Se+1," / ",_e),Pt.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&Et&&b(Et),Pt.createElement(iee,{className:"PhotoView-Slider__toolbarIcon",onClick:W}))),Lt.map(function(it,dt){var He=Be||Se!==0?pe.current-1+dt:Se+dt;return Pt.createElement(pee,{key:Be?it.key+"/"+it.src+"/"+He:it.key,item:it,speed:vt,easing:xn,visible:j,onReachMove:Oe,onReachUp:at,onPhotoTap:function(){return Z(r)},onMaskTap:function(){return Z(l)},wrapClassName:E,className:x,style:{left:(innerWidth+td)*He+"px",transform:"translate3d("+O+"px, 0px, 0)",transition:te||ne?void 0:"transform "+Vt+"ms "+Ft},loadingElement:w,brokenElement:S,onPhotoResize:Ee,isActive:pe.current===He,expose:C})}),!Io&&m&&Pt.createElement(Pt.Fragment,null,(Be||Se!==0)&&Pt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return oe(Se-1,!0)}},Pt.createElement(ree,null)),(Be||Se+1<_e)&&Pt.createElement("div",{className:"PhotoView-Slider__ArrowRight",onClick:function(){return oe(Se+1,!0)}},Pt.createElement(aee,null))),p&&Et&&Pt.createElement("div",{className:"PhotoView-Slider__Overlay"},p(Et)))}var bee=["children","onIndexChange","onVisibleChange"],yee={images:[],visible:!1,index:0};function xee(e){var t=e.children,n=e.onIndexChange,s=e.onVisibleChange,i=px(e,bee),r=Jy(yee),a=r[0],l=r[1],c=g.useRef(0),u=a.images,d=a.visible,f=a.index,h=Jc({nextId:function(){return c.current+=1},update:function(b){var v=u.findIndex(function(x){return x.key===b.key});if(v>-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(x){return{images:x.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(x){return x.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),s&&s(!0,v,a)}}),m=Jc({close:function(){l({visible:!1}),s&&s(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),p=g.useMemo(function(){return ci({},a,h)},[a,h]);return Pt.createElement(IB.Provider,{value:p},t,Pt.createElement(gee,ci({images:u,visible:d,index:f,onIndexChange:m.changeIndex,onClose:m.close},i)))}var RB=function(e){var t,n,s=e.src,i=e.render,r=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=g.useContext(IB),h=(t=function(){return f.nextId()},(n=g.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),m=g.useRef(null);g.useImperativeHandle(d==null?void 0:d.ref,function(){return m.current}),g.useEffect(function(){return function(){f.remove(h)}},[]);var p=Jc({render:function(v){return i&&i(v)},show:function(v,y){f.show(h),function(x,E){if(d){var w=d.props[x];w&&w(E)}}(v,y)}}),b=g.useMemo(function(){var v={};return u.forEach(function(y){v[y]=p.show.bind(null,y)}),v},[]);return g.useEffect(function(){f.update({key:h,src:s,originRef:m,render:p.render,overlay:r,width:a,height:l})},[s]),d?g.Children.only(g.cloneElement(d,ci({},b,{ref:m}))):null};/** + `),()=>{document.head.removeChild(d)}},[t]),o.jsx(jW,{isPresent:t,childRef:s,sizeRef:i,children:g.cloneElement(e,{ref:s})})}const OW=({children:e,initial:t,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:a})=>{const l=cx(MW),c=g.useId(),u=g.useCallback(f=>{l.set(f,!0);for(const h of l.values())if(!h)return;s&&s()},[l,s]),d=g.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:u,register:f=>(l.set(f,!1),()=>l.delete(f))}),r?[Math.random(),u]:[n,u]);return g.useMemo(()=>{l.forEach((f,h)=>l.set(h,!1))},[n]),g.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),a==="popLayout"&&(e=o.jsx(RW,{isPresent:n,children:e})),o.jsx(ux.Provider,{value:d,children:e})};function MW(){return new Map}function tP(e=!0){const t=g.useContext(ux);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=t,r=g.useId();g.useEffect(()=>{e&&i(r)},[e]);const a=g.useCallback(()=>e&&s&&s(r),[r,s,e]);return!n&&s?[!1,a]:[!0]}const U0=e=>e.key||"";function Ej(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const hk=typeof window<"u",nP=hk?g.useLayoutEffect:g.useEffect,Ko=({children:e,custom:t,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:a=!1})=>{const[l,c]=tP(a),u=g.useMemo(()=>Ej(e),[e]),d=a&&!l?[]:u.map(U0),f=g.useRef(!0),h=g.useRef(u),p=cx(()=>new Map),[m,b]=g.useState(u),[v,y]=g.useState(u);nP(()=>{f.current=!1,h.current=u;for(let w=0;w{const S=U0(w),_=a&&!l?!1:u===v||d.includes(S),T=()=>{if(p.has(S))p.set(S,!0);else return;let k=!0;p.forEach(A=>{A||(k=!1)}),k&&(E==null||E(),y(h.current),a&&(c==null||c()),s&&s())};return o.jsx(OW,{isPresent:_,initial:!f.current||n?void 0:!1,custom:_?void 0:t,presenceAffectsLayout:i,mode:r,onExitComplete:_?void 0:T,children:w},S)})})},Br=e=>e;let sP=Br;const LW={useManualTiming:!1};function DW(e){let t=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){r.has(u)&&(c.schedule(u),e()),u(a)}const c={schedule:(u,d=!1,f=!1)=>{const p=f&&s?t:n;return d&&r.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(a=u,s){i=!0;return}s=!0,[t,n]=[n,t],t.forEach(l),t.clear(),s=!1,i&&(i=!1,c.process(u))}};return c}const F0=["read","resolveKeyframes","update","preRender","render","postRender"],PW=40;function iP(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=F0.reduce((y,x)=>(y[x]=DW(r),y),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:h}=a,p=()=>{const y=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,PW),1),i.timestamp=y,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),d.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(p))},m=()=>{n=!0,s=!0,i.isProcessing||e(p)};return{schedule:F0.reduce((y,x)=>{const E=a[x];return y[x]=(w,S=!1,_=!1)=>(n||m(),E.schedule(w,S,_)),y},{}),cancel:y=>{for(let x=0;xvj[e].some(n=>!!t[n])};function BW(e){for(const t in e)wf[t]={...wf[t],...e[t]}}const UW=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function qy(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||UW.has(e)}let aP=e=>!qy(e);function oP(e){e&&(aP=t=>t.startsWith("on")?!qy(t):e(t))}try{oP(require("@emotion/is-prop-valid").default)}catch{}function FW(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||(aP(i)||n===!0&&qy(i)||!t&&!qy(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}function $W({children:e,isValidProp:t,...n}){t&&oP(t),n={...g.useContext(Sm),...n},n.isStatic=cx(()=>n.isStatic);const s=g.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return o.jsx(Sm.Provider,{value:s,children:e})}function HW(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const dx=g.createContext({});function Nm(e){return typeof e=="string"||Array.isArray(e)}function fx(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const pk=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mk=["initial",...pk];function hx(e){return fx(e.animate)||mk.some(t=>Nm(e[t]))}function lP(e){return!!(hx(e)||e.variants)}function zW(e,t){if(hx(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Nm(n)?n:void 0,animate:Nm(s)?s:void 0}}return e.inherit!==!1?t:{}}function VW(e){const{initial:t,animate:n}=zW(e,g.useContext(dx));return g.useMemo(()=>({initial:t,animate:n}),[wj(t),wj(n)])}function wj(e){return Array.isArray(e)?e.join(" "):e}const GW=Symbol.for("motionComponentSymbol");function Od(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function KW(e,t,n){return g.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):Od(n)&&(n.current=s))},[t])}const gk=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),qW="framerAppearId",cP="data-"+gk(qW),{schedule:bk}=iP(queueMicrotask,!1),uP=g.createContext({});function YW(e,t,n,s,i){var r,a;const{visualElement:l}=g.useContext(dx),c=g.useContext(rP),u=g.useContext(ux),d=g.useContext(Sm).reducedMotion,f=g.useRef(null);s=s||c.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=g.useContext(uP);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&WW(f.current,n,i,p);const m=g.useRef(!1);g.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const b=n[cP],v=g.useRef(!!b&&!(!((r=window.MotionHandoffIsComplete)===null||r===void 0)&&r.call(window,b))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,b)));return nP(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),bk.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),g.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,b)}),v.current=!1))}),h}function WW(e,t,n,s){const{layoutId:i,layout:r,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:dP(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!a||l&&Od(l),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}function dP(e){if(e)return e.options.allowProjection!==!1?e.projection:dP(e.parent)}function XW({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:i}){var r,a;e&&BW(e);function l(u,d){let f;const h={...g.useContext(Sm),...u,layoutId:QW(u)},{isStatic:p}=h,m=VW(u),b=s(u,p);if(!p&&hk){ZW();const v=JW(h);f=v.MeasureLayout,m.visualElement=YW(i,b,h,t,v.ProjectionNode)}return o.jsxs(dx.Provider,{value:m,children:[f&&m.visualElement?o.jsx(f,{visualElement:m.visualElement,...h}):null,n(i,u,KW(b,m.visualElement,d),b,p,m.visualElement)]})}l.displayName=`motion.${typeof i=="string"?i:`create(${(a=(r=i.displayName)!==null&&r!==void 0?r:i.name)!==null&&a!==void 0?a:""})`}`;const c=g.forwardRef(l);return c[GW]=i,c}function QW({layoutId:e}){const t=g.useContext(fk).id;return t&&e!==void 0?t+"-"+e:e}function ZW(e,t){g.useContext(rP).strict}function JW(e){const{drag:t,layout:n}=wf;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const eX=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function yk(e){return typeof e!="string"||e.includes("-")?!1:!!(eX.indexOf(e)>-1||/[A-Z]/u.test(e))}function _j(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function xk(e,t,n,s){if(typeof t=="function"){const[i,r]=_j(s);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=_j(s);t=t(n!==void 0?n:e.custom,i,r)}return t}const pS=e=>Array.isArray(e),tX=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),nX=e=>pS(e)?e[e.length-1]||0:e,Pi=e=>!!(e&&e.getVelocity);function Vb(e){const t=Pi(e)?e.get():e;return tX(t)?t.toValue():t}function sX({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},s,i,r){const a={latestValues:iX(s,i,r,e),renderState:t()};return n&&(a.onMount=l=>n({props:s,current:l,...a}),a.onUpdate=l=>n(l)),a}const fP=e=>(t,n)=>{const s=g.useContext(dx),i=g.useContext(ux),r=()=>sX(e,t,s,i);return n?r():cx(r)};function iX(e,t,n,s){const i={},r=s(e,{});for(const h in r)i[h]=Vb(r[h]);let{initial:a,animate:l}=e;const c=hx(e),u=lP(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!fx(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),pP=hP("--"),rX=hP("var(--"),Ek=e=>rX(e)?aX.test(e.split("/*")[0].trim()):!1,aX=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mP=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ll=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},Tm={...nh,transform:e=>ll(0,1,e)},$0={...nh,default:1},gg=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Tl=gg("deg"),co=gg("%"),gt=gg("px"),oX=gg("vh"),lX=gg("vw"),Sj={...co,parse:e=>co.parse(e)/100,transform:e=>co.transform(e*100)},cX={borderWidth:gt,borderTopWidth:gt,borderRightWidth:gt,borderBottomWidth:gt,borderLeftWidth:gt,borderRadius:gt,radius:gt,borderTopLeftRadius:gt,borderTopRightRadius:gt,borderBottomRightRadius:gt,borderBottomLeftRadius:gt,width:gt,maxWidth:gt,height:gt,maxHeight:gt,top:gt,right:gt,bottom:gt,left:gt,padding:gt,paddingTop:gt,paddingRight:gt,paddingBottom:gt,paddingLeft:gt,margin:gt,marginTop:gt,marginRight:gt,marginBottom:gt,marginLeft:gt,backgroundPositionX:gt,backgroundPositionY:gt},uX={rotate:Tl,rotateX:Tl,rotateY:Tl,rotateZ:Tl,scale:$0,scaleX:$0,scaleY:$0,scaleZ:$0,skew:Tl,skewX:Tl,skewY:Tl,distance:gt,translateX:gt,translateY:gt,translateZ:gt,x:gt,y:gt,z:gt,perspective:gt,transformPerspective:gt,opacity:Tm,originX:Sj,originY:Sj,originZ:gt},Nj={...nh,transform:Math.round},vk={...cX,...uX,zIndex:Nj,size:gt,fillOpacity:Tm,strokeOpacity:Tm,numOctaves:Nj},dX={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},fX=th.length;function hX(e,t,n){let s="",i=!0;for(let r=0;r({style:{},transform:{},transformOrigin:{},vars:{}}),gP=()=>({...Sk(),attrs:{}}),Nk=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bP(e,{style:t,vars:n},s,i){Object.assign(e.style,t,i&&i.getProjectionStyles(s));for(const r in n)e.style.setProperty(r,n[r])}const yP=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xP(e,t,n,s){bP(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(yP.has(i)?i:gk(i),t.attrs[i])}const Yy={};function yX(e){Object.assign(Yy,e)}function EP(e,{layout:t,layoutId:n}){return ju.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Yy[e]||e==="opacity")}function Tk(e,t,n){var s;const{style:i}=e,r={};for(const a in i)(Pi(i[a])||t.style&&Pi(t.style[a])||EP(a,e)||((s=n==null?void 0:n.getValue(a))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[a]=i[a]);return r}function vP(e,t,n){const s=Tk(e,t,n);for(const i in e)if(Pi(e[i])||Pi(t[i])){const r=th.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=e[i]}return s}function xX(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const kj=["x","y","width","height","cx","cy","r"],EX={useVisualState:fP({scrapeMotionValuesFromProps:vP,createRenderState:gP,onUpdate:({props:e,prevProps:t,current:n,renderState:s,latestValues:i})=>{if(!n)return;let r=!!e.drag;if(!r){for(const l in i)if(ju.has(l)){r=!0;break}}if(!r)return;let a=!t;if(t)for(let l=0;l{xX(n,s),as.render(()=>{_k(s,i,Nk(n.tagName),e.transformTemplate),xP(n,s)})})}})},vX={useVisualState:fP({scrapeMotionValuesFromProps:Tk,createRenderState:Sk})};function wP(e,t,n){for(const s in t)!Pi(t[s])&&!EP(s,n)&&(e[s]=t[s])}function wX({transformTemplate:e},t){return g.useMemo(()=>{const n=Sk();return wk(n,t,e),Object.assign({},n.vars,n.style)},[t])}function _X(e,t){const n=e.style||{},s={};return wP(s,n,e),Object.assign(s,wX(e,t)),s}function SX(e,t){const n={},s=_X(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}function NX(e,t,n,s){const i=g.useMemo(()=>{const r=gP();return _k(r,t,Nk(s),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};wP(r,e.style,e),i.style={...r,...i.style}}return i}function TX(e=!1){return(n,s,i,{latestValues:r},a)=>{const c=(yk(n)?NX:SX)(s,r,a,n),u=FW(s,typeof n=="string",e),d=n!==g.Fragment?{...u,...c,ref:i}:{},{children:f}=s,h=g.useMemo(()=>Pi(f)?f.get():f,[f]);return g.createElement(n,{...d,children:h})}}function kX(e,t){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...yk(s)?EX:vX,preloadedFeatures:e,useRender:TX(i),createVisualElement:t,Component:s};return XW(a)}}function _P(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s(Gb===void 0&&uo.set(Si.isProcessing||LW.useManualTiming?Si.timestamp:performance.now()),Gb),set:e=>{Gb=e,queueMicrotask(AX)}};function Ak(e,t){e.indexOf(t)===-1&&e.push(t)}function Ck(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ik{constructor(){this.subscriptions=[]}add(t){return Ak(this.subscriptions,t),()=>Ck(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let r=0;r!isNaN(parseFloat(e));class IX{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=uo.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=uo.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=CX(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ik);const s=this.events[t].add(n);return t==="change"?()=>{s(),as.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=uo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Aj)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Aj);return NP(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function km(e,t){return new IX(e,t)}function jX(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,km(n))}function RX(e,t){const n=px(e,t);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const a in r){const l=nX(r[a]);jX(e,a,l)}}function OX(e){return!!(Pi(e)&&e.add)}function mS(e,t){const n=e.getValue("willChange");if(OX(n))return n.add(t)}function TP(e){return e.props[cP]}function jk(e){let t;return()=>(t===void 0&&(t=e()),t)}const MX=jk(()=>window.ScrollTimeline!==void 0);class LX{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let s=0;s{if(MX()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class DX extends LX{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Zo=e=>e*1e3,Jo=e=>e/1e3;function Rk(e){return typeof e=="function"}function Cj(e,t){e.timeline=t,e.onfinish=null}const Ok=e=>Array.isArray(e)&&typeof e[0]=="number",PX={linearEasing:void 0};function BX(e,t){const n=jk(e);return()=>{var s;return(s=PX[t])!==null&&s!==void 0?s:n()}}const Wy=BX(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_f=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s},kP=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let r=0;r`cubic-bezier(${e}, ${t}, ${n}, ${s})`,gS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pp([0,.65,.55,1]),circOut:pp([.55,0,1,.45]),backIn:pp([.31,.01,.66,-.59]),backOut:pp([.33,1.53,.69,.99])};function CP(e,t){if(e)return typeof e=="function"&&Wy()?kP(e,t):Ok(e)?pp(e):Array.isArray(e)?e.map(n=>CP(n,t)||gS.easeOut):gS[e]}const IP=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,UX=1e-7,FX=12;function $X(e,t,n,s,i){let r,a,l=0;do a=t+(n-t)/2,r=IP(a,s,i)-e,r>0?n=a:t=a;while(Math.abs(r)>UX&&++l$X(r,0,1,e,n);return r=>r===0||r===1?r:IP(i(r),t,s)}const jP=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,RP=e=>t=>1-e(1-t),OP=bg(.33,1.53,.69,.99),Mk=RP(OP),MP=jP(Mk),LP=e=>(e*=2)<1?.5*Mk(e):.5*(2-Math.pow(2,-10*(e-1))),Lk=e=>1-Math.sin(Math.acos(e)),DP=RP(Lk),PP=jP(Lk),BP=e=>/^0[^.\s]+$/u.test(e);function HX(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||BP(e):!0}const Hp=e=>Math.round(e*1e5)/1e5,Dk=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function zX(e){return e==null}const VX=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pk=(e,t)=>n=>!!(typeof n=="string"&&VX.test(n)&&n.startsWith(e)||t&&!zX(n)&&Object.prototype.hasOwnProperty.call(n,t)),UP=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,a,l]=s.match(Dk);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},GX=e=>ll(0,255,e),Pv={...nh,transform:e=>Math.round(GX(e))},Vc={test:Pk("rgb","red"),parse:UP("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Pv.transform(e)+", "+Pv.transform(t)+", "+Pv.transform(n)+", "+Hp(Tm.transform(s))+")"};function KX(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const bS={test:Pk("#"),parse:KX,transform:Vc.transform},Md={test:Pk("hsl","hue"),parse:UP("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+co.transform(Hp(t))+", "+co.transform(Hp(n))+", "+Hp(Tm.transform(s))+")"},Di={test:e=>Vc.test(e)||bS.test(e)||Md.test(e),parse:e=>Vc.test(e)?Vc.parse(e):Md.test(e)?Md.parse(e):bS.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Vc.transform(e):Md.transform(e)},qX=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function YX(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Dk))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(qX))===null||n===void 0?void 0:n.length)||0)>0}const FP="number",$P="color",WX="var",XX="var(",Ij="${}",QX=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Am(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const l=t.replace(QX,c=>(Di.test(c)?(s.color.push(r),i.push($P),n.push(Di.parse(c))):c.startsWith(XX)?(s.var.push(r),i.push(WX),n.push(c)):(s.number.push(r),i.push(FP),n.push(parseFloat(c))),++r,Ij)).split(Ij);return{values:n,split:l,indexes:s,types:i}}function HP(e){return Am(e).values}function zP(e){const{split:t,types:n}=Am(e),s=t.length;return i=>{let r="";for(let a=0;atypeof e=="number"?0:e;function JX(e){const t=HP(e);return zP(e)(t.map(ZX))}const cc={test:YX,parse:HP,createTransformer:zP,getAnimatableNone:JX},eQ=new Set(["brightness","contrast","saturate","opacity"]);function tQ(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Dk)||[];if(!s)return e;const i=n.replace(s,"");let r=eQ.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const nQ=/\b([a-z-]*)\(.*?\)/gu,yS={...cc,getAnimatableNone:e=>{const t=e.match(nQ);return t?t.map(tQ).join(" "):e}},sQ={...vk,color:Di,backgroundColor:Di,outlineColor:Di,fill:Di,stroke:Di,borderColor:Di,borderTopColor:Di,borderRightColor:Di,borderBottomColor:Di,borderLeftColor:Di,filter:yS,WebkitFilter:yS},Bk=e=>sQ[e];function VP(e,t){let n=Bk(e);return n!==yS&&(n=cc),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const iQ=new Set(["auto","none","0"]);function rQ(e,t,n){let s=0,i;for(;se===nh||e===gt,Rj=(e,t)=>parseFloat(e.split(", ")[t]),Oj=(e,t)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return Rj(i[1],t);{const r=s.match(/^matrix\((.+)\)$/u);return r?Rj(r[1],e):0}},aQ=new Set(["x","y","z"]),oQ=th.filter(e=>!aQ.has(e));function lQ(e){const t=[];return oQ.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const Sf={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Oj(4,13),y:Oj(5,14)};Sf.translateX=Sf.x;Sf.translateY=Sf.y;const eu=new Set;let xS=!1,ES=!1;function GP(){if(ES){const e=Array.from(eu).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=lQ(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,a])=>{var l;(l=s.getValue(r))===null||l===void 0||l.set(a)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}ES=!1,xS=!1,eu.forEach(e=>e.complete()),eu.clear()}function KP(){eu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ES=!0)})}function cQ(){KP(),GP()}class Uk{constructor(t,n,s,i,r,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(eu.add(this),xS||(xS=!0,as.read(KP),as.resolveKeyframes(GP))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;for(let r=0;r/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),uQ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function dQ(e){const t=uQ.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}function YP(e,t,n=1){const[s,i]=dQ(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const a=r.trim();return qP(a)?parseFloat(a):a}return Ek(i)?YP(i,t,n+1):i}const WP=e=>t=>t.test(e),fQ={test:e=>e==="auto",parse:e=>e},XP=[nh,gt,co,Tl,lX,oX,fQ],Mj=e=>XP.find(WP(e));class QP extends Uk{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c{n.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const Lj=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(cc.test(e)||e==="0")&&!e.startsWith("url("));function hQ(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function mx(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(mQ),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const gQ=40;class ZP{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=uo.now(),this.options={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>gQ?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&cQ(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=uo.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!pQ(t,s,i,r))if(a)this.options.duration=0;else{c&&c(mx(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const vS=2e4;function JP(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t=vS?1/0:t}const ws=(e,t,n)=>e+(t-e)*n;function Bv(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function bQ({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,r=0,a=0;if(!t)i=r=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;i=Bv(c,l,e+1/3),r=Bv(c,l,e),a=Bv(c,l,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:s}}function Xy(e,t){return n=>n>0?t:e}const Uv=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},yQ=[bS,Vc,Md],xQ=e=>yQ.find(t=>t.test(e));function Dj(e){const t=xQ(e);if(!t)return!1;let n=t.parse(e);return t===Md&&(n=bQ(n)),n}const Pj=(e,t)=>{const n=Dj(e),s=Dj(t);if(!n||!s)return Xy(e,t);const i={...n};return r=>(i.red=Uv(n.red,s.red,r),i.green=Uv(n.green,s.green,r),i.blue=Uv(n.blue,s.blue,r),i.alpha=ws(n.alpha,s.alpha,r),Vc.transform(i))},EQ=(e,t)=>n=>t(e(n)),yg=(...e)=>e.reduce(EQ),wS=new Set(["none","hidden"]);function vQ(e,t){return wS.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wQ(e,t){return n=>ws(e,t,n)}function Fk(e){return typeof e=="number"?wQ:typeof e=="string"?Ek(e)?Xy:Di.test(e)?Pj:NQ:Array.isArray(e)?eB:typeof e=="object"?Di.test(e)?Pj:_Q:Xy}function eB(e,t){const n=[...e],s=n.length,i=e.map((r,a)=>Fk(r)(r,t[a]));return r=>{for(let a=0;a{for(const r in s)n[r]=s[r](i);return n}}function SQ(e,t){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r{const n=cc.createTransformer(t),s=Am(e),i=Am(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?wS.has(e)&&!i.values.length||wS.has(t)&&!s.values.length?vQ(e,t):yg(eB(SQ(s,i),i.values),n):Xy(e,t)};function tB(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ws(e,t,n):Fk(e)(e,t)}const TQ=5;function nB(e,t,n){const s=Math.max(t-TQ,0);return NP(n-e(s),t-s)}const js={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Fv=.001;function kQ({duration:e=js.duration,bounce:t=js.bounce,velocity:n=js.velocity,mass:s=js.mass}){let i,r,a=1-t;a=ll(js.minDamping,js.maxDamping,a),e=ll(js.minDuration,js.maxDuration,Jo(e)),a<1?(i=u=>{const d=u*a,f=d*e,h=d-n,p=_S(u,a),m=Math.exp(-f);return Fv-h/p*m},r=u=>{const f=u*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-f),b=_S(Math.pow(u,2),a);return(-i(u)+Fv>0?-1:1)*((h-p)*m)/b}):(i=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-Fv+d*f},r=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=CQ(i,r,l);if(e=Zo(e),isNaN(c))return{stiffness:js.stiffness,damping:js.damping,duration:e};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:a*2*Math.sqrt(s*u),duration:e}}}const AQ=12;function CQ(e,t,n){let s=n;for(let i=1;ie[n]!==void 0)}function RQ(e){let t={velocity:js.velocity,stiffness:js.stiffness,damping:js.damping,mass:js.mass,isResolvedFromDuration:!1,...e};if(!Bj(e,jQ)&&Bj(e,IQ))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*ll(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:js.mass,stiffness:i,damping:r}}else{const n=kQ(e);t={...t,...n,mass:js.mass},t.isResolvedFromDuration=!0}return t}function sB(e=js.visualDuration,t=js.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=RQ({...n,velocity:-Jo(n.velocity||0)}),m=h||0,b=u/(2*Math.sqrt(c*d)),v=a-r,y=Jo(Math.sqrt(c/d)),x=Math.abs(v)<5;s||(s=x?js.restSpeed.granular:js.restSpeed.default),i||(i=x?js.restDelta.granular:js.restDelta.default);let E;if(b<1){const S=_S(y,b);E=_=>{const T=Math.exp(-b*y*_);return a-T*((m+b*y*v)/S*Math.sin(S*_)+v*Math.cos(S*_))}}else if(b===1)E=S=>a-Math.exp(-y*S)*(v+(m+y*v)*S);else{const S=y*Math.sqrt(b*b-1);E=_=>{const T=Math.exp(-b*y*_),k=Math.min(S*_,300);return a-T*((m+b*y*v)*Math.sinh(k)+S*v*Math.cosh(k))/S}}const w={calculatedDuration:p&&f||null,next:S=>{const _=E(S);if(p)l.done=S>=f;else{let T=0;b<1&&(T=S===0?Zo(m):nB(E,S,_));const k=Math.abs(T)<=s,A=Math.abs(a-_)<=i;l.done=k&&A}return l.value=l.done?a:_,l},toString:()=>{const S=Math.min(JP(w),vS),_=kP(T=>w.next(S*T).value,S,30);return S+"ms "+_}};return w}function Uj({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=k=>l!==void 0&&kc,m=k=>l===void 0?c:c===void 0||Math.abs(l-k)-b*Math.exp(-k/s),E=k=>y+x(k),w=k=>{const A=x(k),j=E(k);h.done=Math.abs(A)<=u,h.value=h.done?y:j};let S,_;const T=k=>{p(h.value)&&(S=k,_=sB({keyframes:[h.value,m(h.value)],velocity:nB(E,k,h.value),damping:i,stiffness:r,restDelta:u,restSpeed:d}))};return T(0),{calculatedDuration:null,next:k=>{let A=!1;return!_&&S===void 0&&(A=!0,w(k),T(k)),S!==void 0&&k>=S?_.next(k-S):(!A&&w(k),h)}}}const OQ=bg(.42,0,1,1),MQ=bg(0,0,.58,1),iB=bg(.42,0,.58,1),LQ=e=>Array.isArray(e)&&typeof e[0]!="number",DQ={linear:Br,easeIn:OQ,easeInOut:iB,easeOut:MQ,circIn:Lk,circInOut:PP,circOut:DP,backIn:Mk,backInOut:MP,backOut:OP,anticipate:LP},Fj=e=>{if(Ok(e)){sP(e.length===4);const[t,n,s,i]=e;return bg(t,n,s,i)}else if(typeof e=="string")return DQ[e];return e};function PQ(e,t,n){const s=[],i=n||tB,r=e.length-1;for(let a=0;at[0];if(r===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=PQ(t,s,i),c=l.length,u=d=>{if(a&&d1)for(;fu(ll(e[0],e[r-1],d)):u}function UQ(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=_f(0,t,s);e.push(ws(n,1,i))}}function FQ(e){const t=[0];return UQ(t,e.length-1),t}function $Q(e,t){return e.map(n=>n*t)}function HQ(e,t){return e.map(()=>t||iB).splice(0,e.length-1)}function Qy({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=LQ(s)?s.map(Fj):Fj(s),r={done:!1,value:t[0]},a=$Q(n&&n.length===t.length?n:FQ(t),e),l=BQ(a,t,{ease:Array.isArray(i)?i:HQ(t,i)});return{calculatedDuration:e,next:c=>(r.value=l(c),r.done=c>=e,r)}}const zQ=e=>{const t=({timestamp:n})=>e(n);return{start:()=>as.update(t,!0),stop:()=>lc(t),now:()=>Si.isProcessing?Si.timestamp:uo.now()}},VQ={decay:Uj,inertia:Uj,tween:Qy,keyframes:Qy,spring:sB},GQ=e=>e/100;class $k extends ZP{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:s,element:i,keyframes:r}=this.options,a=(i==null?void 0:i.KeyframeResolver)||Uk,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(r,l,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=this.options,l=Rk(n)?n:VQ[n]||Qy;let c,u;l!==Qy&&typeof t[0]!="number"&&(c=yg(GQ,tB(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});r==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=JP(d));const{calculatedDuration:f}=d,h=f+i,p=h*(s+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:s}=this;if(!s){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=s;if(this.startTime===null)return r.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:b,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),x=this.speed>=0?y<0:y>d;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let E=this.currentTime,w=r;if(p){const k=Math.min(this.currentTime,d)/f;let A=Math.floor(k),j=k%1;!j&&k>=1&&(j=1),j===1&&A--,A=Math.min(A,p+1),!!(A%2)&&(m==="reverse"?(j=1-j,b&&(j-=b/f)):m==="mirror"&&(w=a)),E=ll(0,1,j)*f}const S=x?{done:!1,value:c[0]}:w.next(E);l&&(S.value=l(S.value));let{done:_}=S;!x&&u!==null&&(_=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return T&&i!==void 0&&(S.value=mx(c,this.options,i)),v&&v(S.value),T&&this.finish(),S}get duration(){const{resolved:t}=this;return t?Jo(t.calculatedDuration):0}get time(){return Jo(this.currentTime)}set time(t){t=Zo(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Jo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=zQ,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const KQ=new Set(["opacity","clipPath","filter","transform"]);function qQ(e,t,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:l="easeInOut",times:c}={}){const u={[t]:n};c&&(u.offset=c);const d=CP(l,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"})}const YQ=jk(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Zy=10,WQ=2e4;function XQ(e){return Rk(e.type)||e.type==="spring"||!AP(e.ease)}function QQ(e,t){const n=new $k({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:e[0]};const i=[];let r=0;for(;!s.done&&rthis.onKeyframesResolved(a,l),n,s,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:s=300,times:i,ease:r,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof r=="string"&&Wy()&&ZQ(r)&&(r=rB[r]),XQ(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...b}=this.options,v=QQ(t,b);t=v.keyframes,t.length===1&&(t[1]=t[0]),s=v.duration,i=v.times,r=v.ease,a="keyframes"}const d=qQ(l.owner.current,c,t,{...this.options,duration:s,times:i,ease:r});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Cj(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(mx(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:i,type:a,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Jo(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Jo(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=Zo(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Br;const{animation:s}=n;Cj(s,t)}return Br}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:s,duration:i,type:r,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:h,...p}=this.options,m=new $k({...p,keyframes:s,duration:i,type:r,ease:a,times:l,isGenerator:!0}),b=Zo(this.time);u.setWithVelocity(m.sample(b-Zy).value,m.sample(b).value,Zy)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:s,repeatDelay:i,repeatType:r,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return YQ()&&s&&KQ.has(s)&&!c&&!u&&!i&&r!=="mirror"&&a!==0&&l!=="inertia"}}const JQ={type:"spring",stiffness:500,damping:25,restSpeed:10},eZ=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),tZ={type:"keyframes",duration:.8},nZ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sZ=(e,{keyframes:t})=>t.length>2?tZ:ju.has(e)?e.startsWith("scale")?eZ(t[1]):JQ:nZ;function iZ({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Hk=(e,t,n,s={},i,r)=>a=>{const l=kk(s,e)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Zo(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:r?void 0:i};iZ(l)||(d={...d,...sZ(e,d)}),d.duration&&(d.duration=Zo(d.duration)),d.repeatDelay&&(d.repeatDelay=Zo(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),f&&!r&&t.get()!==void 0){const h=mx(d.keyframes,l);if(h!==void 0)return as.update(()=>{d.onUpdate(h),d.onComplete()}),new DX([])}return!r&&$j.supports(d)?new $j(d):new $k(d)};function rZ({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function aB(e,t,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:a=e.getDefaultTransition(),transitionEnd:l,...c}=t;s&&(a=s);const u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in c){const h=e.getValue(f,(r=e.latestValues[f])!==null&&r!==void 0?r:null),p=c[f];if(p===void 0||d&&rZ(d,f))continue;const m={delay:n,...kk(a||{},f)};let b=!1;if(window.MotionHandoffAnimation){const y=TP(e);if(y){const x=window.MotionHandoffAnimation(y,f,as);x!==null&&(m.startTime=x,b=!0)}}mS(e,f),h.start(Hk(f,h,p,e.shouldReduceMotion&&SP.has(f)?{type:!1}:m,e,b));const v=h.animation;v&&u.push(v)}return l&&Promise.all(u).then(()=>{as.update(()=>{l&&RX(e,l)})}),u}function SS(e,t,n={}){var s;const i=px(e,t,n.type==="exit"?(s=e.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const a=i?()=>Promise.all(aB(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=r;return aZ(e,t,d+u,f,h,n)}:()=>Promise.resolve(),{when:c}=r;if(c){const[u,d]=c==="beforeChildren"?[a,l]:[l,a];return u().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function aZ(e,t,n=0,s=0,i=1,r){const a=[],l=(e.variantChildren.size-1)*s,c=i===1?(u=0)=>u*s:(u=0)=>l-u*s;return Array.from(e.variantChildren).sort(oZ).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(SS(u,t,{...r,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function oZ(e,t){return e.sortNodePosition(t)}function lZ(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(r=>SS(e,r,n));s=Promise.all(i)}else if(typeof t=="string")s=SS(e,t,n);else{const i=typeof t=="function"?px(e,t,n.custom):t;s=Promise.all(aB(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const cZ=mk.length;function oB(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?oB(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:s})=>lZ(e,n,s)))}function hZ(e){let t=fZ(e),n=Hj(),s=!0;const i=c=>(u,d)=>{var f;const h=px(e,d,c==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...b}=h;u={...u,...b,...m}}return u};function r(c){t=c(e)}function a(c){const{props:u}=e,d=oB(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let v=0;vm&&w,A=!1;const j=Array.isArray(E)?E:[E];let R=j.reduce(i(y),{});S===!1&&(R={});const{prevResolvedValues:B={}}=x,z={...B,...R},L=I=>{k=!0,h.has(I)&&(A=!0,h.delete(I)),x.needsAnimating[I]=!0;const D=e.getValue(I);D&&(D.liveStyle=!1)};for(const I in z){const D=R[I],$=B[I];if(p.hasOwnProperty(I))continue;let O=!1;pS(D)&&pS($)?O=!_P(D,$):O=D!==$,O?D!=null?L(I):h.add(I):D!==void 0&&h.has(I)?L(I):x.protectedKeys[I]=!0}x.prevProp=E,x.prevResolvedValues=R,x.isActive&&(p={...p,...R}),s&&e.blockInitialAnimation&&(k=!1),k&&(!(_&&T)||A)&&f.push(...j.map(I=>({animation:I,options:{type:y}})))}if(h.size){const v={};h.forEach(y=>{const x=e.getBaseTarget(y),E=e.getValue(y);E&&(E.liveStyle=!0),v[y]=x??null}),f.push({animation:v})}let b=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(f):Promise.resolve()}function l(c,u){var d;if(n[c].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,u)}),n[c].isActive=u;const f=a(c);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Hj(),s=!0}}}function pZ(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!_P(t,e):!1}function kc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hj(){return{animate:kc(!0),whileInView:kc(),whileHover:kc(),whileTap:kc(),whileDrag:kc(),whileFocus:kc(),exit:kc()}}class gc{constructor(t){this.isMounted=!1,this.node=t}update(){}}class mZ extends gc{constructor(t){super(t),t.animationState||(t.animationState=hZ(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fx(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let gZ=0;class bZ extends gc{constructor(){super(...arguments),this.id=gZ++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const yZ={animation:{Feature:mZ},exit:{Feature:bZ}},Ta={x:!1,y:!1};function lB(){return Ta.x||Ta.y}function xZ(e){return e==="x"||e==="y"?Ta[e]?null:(Ta[e]=!0,()=>{Ta[e]=!1}):Ta.x||Ta.y?null:(Ta.x=Ta.y=!0,()=>{Ta.x=Ta.y=!1})}const zk=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Cm(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function xg(e){return{point:{x:e.pageX,y:e.pageY}}}const EZ=e=>t=>zk(t)&&e(t,xg(t));function zp(e,t,n,s){return Cm(e,t,EZ(n),s)}const zj=(e,t)=>Math.abs(e-t);function vZ(e,t){const n=zj(e.x,t.x),s=zj(e.y,t.y);return Math.sqrt(n**2+s**2)}class cB{constructor(t,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Hv(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=vZ(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:b}=Si;this.history.push({...m,timestamp:b});const{onStart:v,onMove:y}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=$v(h,this.transformPagePoint),as.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Hv(f.type==="pointercancel"?this.lastMoveEventInfo:$v(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,v),m&&m(f,v)},!zk(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const a=xg(t),l=$v(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Si;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,Hv(l,this.history)),this.removeListeners=yg(zp(this.contextWindow,"pointermove",this.handlePointerMove),zp(this.contextWindow,"pointerup",this.handlePointerUp),zp(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),lc(this.updatePoint)}}function $v(e,t){return t?{point:t(e.point)}:e}function Vj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Hv({point:e},t){return{point:e,delta:Vj(e,uB(t)),offset:Vj(e,wZ(t)),velocity:_Z(t,.1)}}function wZ(e){return e[0]}function uB(e){return e[e.length-1]}function _Z(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const i=uB(e);for(;n>=0&&(s=e[n],!(i.timestamp-s.timestamp>Zo(t)));)n--;if(!s)return{x:0,y:0};const r=Jo(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const a={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const dB=1e-4,SZ=1-dB,NZ=1+dB,fB=.01,TZ=0-fB,kZ=0+fB;function Hr(e){return e.max-e.min}function AZ(e,t,n){return Math.abs(e-t)<=n}function Gj(e,t,n,s=.5){e.origin=s,e.originPoint=ws(t.min,t.max,e.origin),e.scale=Hr(n)/Hr(t),e.translate=ws(n.min,n.max,e.origin)-e.originPoint,(e.scale>=SZ&&e.scale<=NZ||isNaN(e.scale))&&(e.scale=1),(e.translate>=TZ&&e.translate<=kZ||isNaN(e.translate))&&(e.translate=0)}function Vp(e,t,n,s){Gj(e.x,t.x,n.x,s?s.originX:void 0),Gj(e.y,t.y,n.y,s?s.originY:void 0)}function Kj(e,t,n){e.min=n.min+t.min,e.max=e.min+Hr(t)}function CZ(e,t,n){Kj(e.x,t.x,n.x),Kj(e.y,t.y,n.y)}function qj(e,t,n){e.min=t.min-n.min,e.max=e.min+Hr(t)}function Gp(e,t,n){qj(e.x,t.x,n.x),qj(e.y,t.y,n.y)}function IZ(e,{min:t,max:n},s){return t!==void 0&&en&&(e=s?ws(n,e,s.max):Math.min(e,n)),e}function Yj(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function jZ(e,{top:t,left:n,bottom:s,right:i}){return{x:Yj(e.x,n,i),y:Yj(e.y,t,s)}}function Wj(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.mins?n=_f(t.min,t.max-s,e.min):s>i&&(n=_f(e.min,e.max-i,t.min)),ll(0,1,n)}function MZ(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const NS=.35;function LZ(e=NS){return e===!1?e=0:e===!0&&(e=NS),{x:Xj(e,"left","right"),y:Xj(e,"top","bottom")}}function Xj(e,t,n){return{min:Qj(e,t),max:Qj(e,n)}}function Qj(e,t){return typeof e=="number"?e:e[t]||0}const Zj=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ld=()=>({x:Zj(),y:Zj()}),Jj=()=>({min:0,max:0}),Us=()=>({x:Jj(),y:Jj()});function Xr(e){return[e("x"),e("y")]}function hB({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function DZ({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PZ(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function zv(e){return e===void 0||e===1}function TS({scale:e,scaleX:t,scaleY:n}){return!zv(e)||!zv(t)||!zv(n)}function Lc(e){return TS(e)||pB(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function pB(e){return eR(e.x)||eR(e.y)}function eR(e){return e&&e!=="0%"}function Jy(e,t,n){const s=e-n,i=t*s;return n+i}function tR(e,t,n,s,i){return i!==void 0&&(e=Jy(e,i,s)),Jy(e,n,s)+t}function kS(e,t=0,n=1,s,i){e.min=tR(e.min,t,n,s,i),e.max=tR(e.max,t,n,s,i)}function mB(e,{x:t,y:n}){kS(e.x,t.translate,t.scale,t.originPoint),kS(e.y,n.translate,n.scale,n.originPoint)}const nR=.999999999999,sR=1.0000000000001;function BZ(e,t,n,s=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,a;for(let l=0;lnR&&(t.x=1),t.ynR&&(t.y=1)}function Dd(e,t){e.min=e.min+t,e.max=e.max+t}function iR(e,t,n,s,i=.5){const r=ws(e.min,e.max,i);kS(e,t,n,r,s)}function Pd(e,t){iR(e.x,t.x,t.scaleX,t.scale,t.originX),iR(e.y,t.y,t.scaleY,t.scale,t.originY)}function gB(e,t){return hB(PZ(e.getBoundingClientRect(),t))}function UZ(e,t,n){const s=gB(e,n),{scroll:i}=t;return i&&(Dd(s.x,i.offset.x),Dd(s.y,i.offset.y)),s}const bB=({current:e})=>e?e.ownerDocument.defaultView:null,FZ=new WeakMap;class $Z{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Us(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(xg(d).point)},r=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xZ(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Xr(v=>{let y=this.getAxisMotionValue(v).get()||0;if(co.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const E=x.layout.layoutBox[v];E&&(y=Hr(E)*(parseFloat(y)/100))}}this.originPoint[v]=y}),m&&as.postRender(()=>m(d,f)),mS(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=HZ(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),b&&b(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Xr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new cB(t,{onSessionStart:i,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:bB(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&as.postRender(()=>r(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:i}=this.getProps();if(!s||!H0(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let a=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(a=IZ(a,this.constraints[t],this.elastic[t])),r.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,r=this.constraints;n&&Od(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=jZ(i.layoutBox,n):this.constraints=!1,this.elastic=LZ(s),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Xr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=MZ(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Od(t))return!1;const s=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=UZ(s,i.root,this.visualElement.getTransformPagePoint());let a=RZ(i.layout.layoutBox,r);if(n){const l=n(DZ(a));this.hasMutatedConstraints=!!l,l&&(a=hB(l))}return a}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Xr(d=>{if(!H0(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:s?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...r,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return mS(this.visualElement,t),s.start(Hk(t,s,0,n,this.visualElement,!1))}stopAnimation(){Xr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Xr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Xr(n=>{const{drag:s}=this.getProps();if(!H0(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:l}=i.layout.layoutBox[n];r.set(t[n]-ws(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Od(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Xr(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();i[a]=OZ({min:c,max:c},this.constraints[a])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Xr(a=>{if(!H0(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(ws(c,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;FZ.set(this.visualElement,this);const t=this.visualElement.current,n=zp(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();Od(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),as.read(s);const a=Cm(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Xr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),r(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:a=NS,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:a,dragMomentum:l}}}function H0(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function HZ(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class zZ extends gc{constructor(t){super(t),this.removeGroupControls=Br,this.removeListeners=Br,this.controls=new $Z(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Br}unmount(){this.removeGroupControls(),this.removeListeners()}}const rR=e=>(t,n)=>{e&&as.postRender(()=>e(t,n))};class VZ extends gc{constructor(){super(...arguments),this.removePointerDownListener=Br}onPointerDown(t){this.session=new cB(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:bB(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:rR(t),onStart:rR(n),onMove:s,onEnd:(r,a)=>{delete this.session,i&&as.postRender(()=>i(r,a))}}}mount(){this.removePointerDownListener=zp(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Kb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function aR(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gh={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(gt.test(e))e=parseFloat(e);else return e;const n=aR(e,t.target.x),s=aR(e,t.target.y);return`${n}% ${s}%`}},GZ={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=cc.parse(e);if(i.length>5)return s;const r=cc.createTransformer(e),a=typeof i[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;i[0+a]/=l,i[1+a]/=c;const u=ws(l,c,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),r(i)}};class KZ extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=t;yX(qZ),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Kb.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,a=s.projection;return a&&(a.isPresent=r,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?a.promote():a.relegate()||as.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),bk.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function yB(e){const[t,n]=tP(),s=g.useContext(fk);return o.jsx(KZ,{...e,layoutGroup:s,switchLayoutGroup:g.useContext(uP),isPresent:t,safeToRemove:n})}const qZ={borderRadius:{...Gh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gh,borderTopRightRadius:Gh,borderBottomLeftRadius:Gh,borderBottomRightRadius:Gh,boxShadow:GZ};function YZ(e,t,n){const s=Pi(e)?e:km(e);return s.start(Hk("",s,t,n)),s.animation}function WZ(e){return e instanceof SVGElement&&e.tagName!=="svg"}const XZ=(e,t)=>e.depth-t.depth;class QZ{constructor(){this.children=[],this.isDirty=!1}add(t){Ak(this.children,t),this.isDirty=!0}remove(t){Ck(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(XZ),this.isDirty=!1,this.children.forEach(t)}}function ZZ(e,t){const n=uo.now(),s=({timestamp:i})=>{const r=i-n;r>=t&&(lc(s),e(r-t))};return as.read(s,!0),()=>lc(s)}const xB=["TopLeft","TopRight","BottomLeft","BottomRight"],JZ=xB.length,oR=e=>typeof e=="string"?parseFloat(e):e,lR=e=>typeof e=="number"||gt.test(e);function eJ(e,t,n,s,i,r){i?(e.opacity=ws(0,n.opacity!==void 0?n.opacity:1,tJ(s)),e.opacityExit=ws(t.opacity!==void 0?t.opacity:1,0,nJ(s))):r&&(e.opacity=ws(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let a=0;ast?1:n(_f(e,t,s))}function uR(e,t){e.min=t.min,e.max=t.max}function Wr(e,t){uR(e.x,t.x),uR(e.y,t.y)}function dR(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function fR(e,t,n,s,i){return e-=t,e=Jy(e,1/n,s),i!==void 0&&(e=Jy(e,1/i,s)),e}function sJ(e,t=0,n=1,s=.5,i,r=e,a=e){if(co.test(t)&&(t=parseFloat(t),t=ws(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=ws(r.min,r.max,s);e===r&&(l-=t),e.min=fR(e.min,t,n,l,i),e.max=fR(e.max,t,n,l,i)}function hR(e,t,[n,s,i],r,a){sJ(e,t[n],t[s],t[i],t.scale,r,a)}const iJ=["x","scaleX","originX"],rJ=["y","scaleY","originY"];function pR(e,t,n,s){hR(e.x,t,iJ,n?n.x:void 0,s?s.x:void 0),hR(e.y,t,rJ,n?n.y:void 0,s?s.y:void 0)}function mR(e){return e.translate===0&&e.scale===1}function vB(e){return mR(e.x)&&mR(e.y)}function gR(e,t){return e.min===t.min&&e.max===t.max}function aJ(e,t){return gR(e.x,t.x)&&gR(e.y,t.y)}function bR(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wB(e,t){return bR(e.x,t.x)&&bR(e.y,t.y)}function yR(e){return Hr(e.x)/Hr(e.y)}function xR(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class oJ{constructor(){this.members=[]}add(t){Ak(this.members,t),t.scheduleRender()}remove(t){if(Ck(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function lJ(e,t,n){let s="";const i=e.x.translate/t.x,r=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||r||a)&&(s=`translate3d(${i}px, ${r}px, ${a}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}deg) `),p&&(s+=`skewX(${p}deg) `),m&&(s+=`skewY(${m}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const Dc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},mp=typeof window<"u"&&window.MotionDebug!==void 0,Vv=["","X","Y","Z"],cJ={visibility:"hidden"},ER=1e3;let uJ=0;function Gv(e,t,n,s){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),s&&(s[e]=0))}function _B(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=TP(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",as,!(i||r))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&_B(s)}function SB({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(a={},l=t==null?void 0:t()){this.id=uJ++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,mp&&(Dc.totalNodes=Dc.resolvedTargetDeltas=Dc.recalculatedProjection=0),this.nodes.forEach(hJ),this.nodes.forEach(yJ),this.nodes.forEach(xJ),this.nodes.forEach(pJ),mp&&window.MotionDebug.record(Dc)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=ZZ(h,250),Kb.hasAnimatedSinceResize&&(Kb.hasAnimatedSinceResize=!1,this.nodes.forEach(wR))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||SJ,{onLayoutAnimationStart:v,onLayoutAnimationComplete:y}=d.getProps(),x=!this.targetLayout||!wB(this.targetLayout,m)||p,E=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,E);const w={...kk(b,"layout"),onPlay:v,onComplete:y};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||wR(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,lc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(EJ),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_B(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const S=w/1e3;_R(f.x,a.x,S),_R(f.y,a.y,S),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Gp(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wJ(this.relativeTarget,this.relativeTargetOrigin,h,S),E&&aJ(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=Us()),Wr(E,this.relativeTarget)),b&&(this.animationValues=d,eJ(d,u,this.latestValues,S,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(lc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=as.update(()=>{Kb.hasAnimatedSinceResize=!0,this.currentAnimation=YZ(0,ER,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ER),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&NB(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Us();const f=Hr(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const h=Hr(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+h}Wr(l,c),Pd(l,d),Vp(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new oJ),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:l}=this.options;return l?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:l}=this.options;return l?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Gv("z",a,u,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(vR),this.root.sharedNodes.clear()}}}function dJ(e){e.updateLayout()}function fJ(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=e.layout,{animationType:r}=e.options,a=n.source!==e.layout.source;r==="size"?Xr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Hr(h);h.min=s[f].min,h.max=h.min+p}):NB(r,n.layoutBox,s)&&Xr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Hr(s[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const l=Ld();Vp(l,s,n.layoutBox);const c=Ld();a?Vp(c,e.applyTransform(i,!0),n.measuredBox):Vp(c,s,n.layoutBox);const u=!vB(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=Us();Gp(m,n.layoutBox,h.layoutBox);const b=Us();Gp(b,s,p.layoutBox),wB(m,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function hJ(e){mp&&Dc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function pJ(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function mJ(e){e.clearSnapshot()}function vR(e){e.clearMeasurements()}function gJ(e){e.isLayoutDirty=!1}function bJ(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function wR(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function yJ(e){e.resolveTargetDelta()}function xJ(e){e.calcProjection()}function EJ(e){e.resetSkewAndRotation()}function vJ(e){e.removeLeadSnapshot()}function _R(e,t,n){e.translate=ws(t.translate,0,n),e.scale=ws(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function SR(e,t,n,s){e.min=ws(t.min,n.min,s),e.max=ws(t.max,n.max,s)}function wJ(e,t,n,s){SR(e.x,t.x,n.x,s),SR(e.y,t.y,n.y,s)}function _J(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const SJ={duration:.45,ease:[.4,0,.1,1]},NR=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),TR=NR("applewebkit/")&&!NR("chrome/")?Math.round:Br;function kR(e){e.min=TR(e.min),e.max=TR(e.max)}function NJ(e){kR(e.x),kR(e.y)}function NB(e,t,n){return e==="position"||e==="preserve-aspect"&&!AZ(yR(t),yR(n),.2)}function TJ(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const kJ=SB({attachResizeListener:(e,t)=>Cm(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Kv={current:void 0},TB=SB({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kv.current){const e=new kJ({});e.mount(window),e.setOptions({layoutScroll:!0}),Kv.current=e}return Kv.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),AJ={pan:{Feature:VZ},drag:{Feature:zZ,ProjectionNode:TB,MeasureLayout:yB}};function CJ(e,t,n){var s;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const r=(s=void 0)!==null&&s!==void 0?s:i.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e)}function kB(e,t){const n=CJ(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function AR(e){return t=>{t.pointerType==="touch"||lB()||e(t)}}function IJ(e,t,n={}){const[s,i,r]=kB(e,n),a=AR(l=>{const{target:c}=l,u=t(l);if(typeof u!="function"||!c)return;const d=AR(f=>{u(f),c.removeEventListener("pointerleave",d)});c.addEventListener("pointerleave",d,i)});return s.forEach(l=>{l.addEventListener("pointerenter",a,i)}),r}function CR(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&as.postRender(()=>r(t,xg(t)))}class jJ extends gc{mount(){const{current:t}=this.node;t&&(this.unmount=IJ(t,n=>(CR(this.node,n,"Start"),s=>CR(this.node,s,"End"))))}unmount(){}}class RJ extends gc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yg(Cm(this.node.current,"focus",()=>this.onFocus()),Cm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const AB=(e,t)=>t?e===t?!0:AB(e,t.parentElement):!1,OJ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function MJ(e){return OJ.has(e.tagName)||e.tabIndex!==-1}const gp=new WeakSet;function IR(e){return t=>{t.key==="Enter"&&e(t)}}function qv(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const LJ=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=IR(()=>{if(gp.has(n))return;qv(n,"down");const i=IR(()=>{qv(n,"up")}),r=()=>qv(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function jR(e){return zk(e)&&!lB()}function DJ(e,t,n={}){const[s,i,r]=kB(e,n),a=l=>{const c=l.currentTarget;if(!jR(l)||gp.has(c))return;gp.add(c);const u=t(l),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!jR(p)||!gp.has(c))&&(gp.delete(c),typeof u=="function"&&u(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||AB(c,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return s.forEach(l=>{!MJ(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,i),l.addEventListener("focus",u=>LJ(u,i),i)}),r}function RR(e,t,n){const{props:s}=e;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&as.postRender(()=>r(t,xg(t)))}class PJ extends gc{mount(){const{current:t}=this.node;t&&(this.unmount=DJ(t,n=>(RR(this.node,n,"Start"),(s,{success:i})=>RR(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const AS=new WeakMap,Yv=new WeakMap,BJ=e=>{const t=AS.get(e.target);t&&t(e)},UJ=e=>{e.forEach(BJ)};function FJ({root:e,...t}){const n=e||document;Yv.has(n)||Yv.set(n,{});const s=Yv.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(UJ,{root:e,...t})),s[i]}function $J(e,t,n){const s=FJ(t);return AS.set(e,n),s.observe(e),()=>{AS.delete(e),s.unobserve(e)}}const HJ={some:0,all:1};class zJ extends gc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=t,a={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:HJ[i]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=u?d:f;h&&h(c)};return $J(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(VJ(t,n))&&this.startObserver()}unmount(){}}function VJ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const GJ={inView:{Feature:zJ},tap:{Feature:PJ},focus:{Feature:RJ},hover:{Feature:jJ}},KJ={layout:{ProjectionNode:TB,MeasureLayout:yB}},CS={current:null},CB={current:!1};function qJ(){if(CB.current=!0,!!hk)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>CS.current=e.matches;e.addListener(t),t()}else CS.current=!1}const YJ=[...XP,Di,cc],WJ=e=>YJ.find(WP(e)),OR=new WeakMap;function XJ(e,t,n){for(const s in t){const i=t[s],r=n[s];if(Pi(i))e.addValue(s,i);else if(Pi(r))e.addValue(s,km(i,{owner:e}));else if(r!==i)if(e.hasValue(s)){const a=e.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(s);e.addValue(s,km(a!==void 0?a:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const MR=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class QJ{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Uk,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=uo.now();this.renderScheduledAtthis.bindToMotionValue(s,n)),CB.current||qJ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:CS.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){OR.delete(this.current),this.projection&&this.projection.unmount(),lc(this.notifyUpdate),lc(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=ju.has(t),i=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&as.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in wf){const n=wf[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Us()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;sn.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=km(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(qP(i)||BP(i))?i=parseFloat(i):!WJ(i)&&cc.test(n)&&(i=VP(t,n)),this.setBaseTarget(t,Pi(i)?i.get():i)),Pi(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const a=xk(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(i=a[t])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!Pi(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ik),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class IB extends QJ{constructor(){super(...arguments),this.KeyframeResolver=QP}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Pi(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function ZJ(e){return window.getComputedStyle(e)}class JJ extends IB{constructor(){super(...arguments),this.type="html",this.renderInstance=bP}readValueFromInstance(t,n){if(ju.has(n)){const s=Bk(n);return s&&s.default||0}else{const s=ZJ(t),i=(pP(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return gB(t,n)}build(t,n,s){wk(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Tk(t,n,s)}}class eee extends IB{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Us}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ju.has(n)){const s=Bk(n);return s&&s.default||0}return n=yP.has(n)?n:gk(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return vP(t,n,s)}build(t,n,s){_k(t,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,n,s,i){xP(t,n,s,i)}mount(t){this.isSVGTag=Nk(t.tagName),super.mount(t)}}const tee=(e,t)=>yk(e)?new eee(t):new JJ(t,{allowProjection:e!==g.Fragment}),nee=kX({...yZ,...GJ,...AJ,...KJ},tee),is=HW(nee);function ui(){return ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?g.useEffect:g.useLayoutEffect;function pd(e,t,n){var s=g.useRef(t);s.current=t,g.useEffect(function(){function i(r){s.current(r)}return e&&window.addEventListener(e,i,n),function(){e&&window.removeEventListener(e,i)}},[e])}var see=["container"];function iee(e){var t=e.container,n=t===void 0?document.body:t,s=gx(e,see);return wi.createPortal(Lt.createElement("div",ui({},s)),n)}function ree(e){return Lt.createElement("svg",ui({width:"44",height:"44",viewBox:"0 0 768 768"},e),Lt.createElement("path",{d:"M607.5 205.5l-178.5 178.5 178.5 178.5-45 45-178.5-178.5-178.5 178.5-45-45 178.5-178.5-178.5-178.5 45-45 178.5 178.5 178.5-178.5z"}))}function aee(e){return Lt.createElement("svg",ui({width:"44",height:"44",viewBox:"0 0 768 768"},e),Lt.createElement("path",{d:"M640.5 352.5v63h-390l178.5 180-45 45-256.5-256.5 256.5-256.5 45 45-178.5 180h390z"}))}function oee(e){return Lt.createElement("svg",ui({width:"44",height:"44",viewBox:"0 0 768 768"},e),Lt.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function lee(){return g.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function DR(e){var t=e.touches[0],n=t.clientX,s=t.clientY;if(e.touches.length>=2){var i=e.touches[1],r=i.clientX,a=i.clientY;return[(n+r)/2,(s+a)/2,Math.sqrt(Math.pow(r-n,2)+Math.pow(a-s,2))]}return[n,s,0]}var jl=function(e,t,n,s){var i,r=n*t,a=(r-s)/2,l=e;return r<=s?(i=1,l=0):e>0&&a-e<=0?(i=2,l=a):e<0&&a+e<=0&&(i=3,l=-a),[i,l]};function Wv(e,t,n,s,i,r,a,l,c,u){a===void 0&&(a=innerWidth/2),l===void 0&&(l=innerHeight/2),c===void 0&&(c=0),u===void 0&&(u=0);var d=jl(e,r,n,innerWidth)[0],f=jl(t,r,s,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-r/i*(a-(h+e))-h+(s/n>=3&&n*r===innerWidth?0:d?c/2:c),y:l-r/i*(l-(p+t))-p+(f[0]?u/2:u),lastCX:a,lastCY:l}}function RS(e,t,n){var s=e%180!=0;return s?[n,t,s]:[t,n,s]}function Xv(e,t,n){var s=RS(n,innerWidth,innerHeight),i=s[0],r=s[1],a=0,l=i,c=r,u=e/t*r,d=t/e*i;return e=r?l=u:e>=i&&ti/r?c=d:t/e>=3&&!s[2]?a=((c=d)-r)/2:l=u,{width:l,height:c,x:0,y:a,pause:!0}}function V0(e,t){var n=t.leading,s=n!==void 0&&n,i=t.maxWait,r=t.wait,a=r===void 0?i||0:r,l=g.useRef(e);l.current=e;var c=g.useRef(0),u=g.useRef(),d=function(){return u.current&&clearTimeout(u.current)},f=g.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){c.current=p,d(),l.current.apply(null,h)}var b=c.current,v=p-b;if(b===0&&(s&&m(),c.current=p),i!==void 0){if(v>i)return void m()}else v=1&&r&&r())};d()}function d(){c=requestAnimationFrame(u)}}var uee={T:0,L:0,W:0,H:0,FIT:void 0},RB=function(){var e=g.useRef(!1);return g.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},dee=["className"];function fee(e){var t=e.className,n=t===void 0?"":t,s=gx(e,dee);return Lt.createElement("div",ui({className:"PhotoView__Spinner "+n},s),Lt.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Lt.createElement("path",{opacity:".25",d:"M16 0 A16 16 0 0 0 16 32 A16 16 0 0 0 16 0 M16 4 A12 12 0 0 1 16 28 A12 12 0 0 1 16 4"}),Lt.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var hee=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function pee(e){var t=e.src,n=e.loaded,s=e.broken,i=e.className,r=e.onPhotoLoad,a=e.loadingElement,l=e.brokenElement,c=gx(e,hee),u=RB();return t&&!s?Lt.createElement(Lt.Fragment,null,Lt.createElement("img",ui({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(d){var f=d.target;u.current&&r({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){u.current&&r({broken:!0})},draggable:!1,alt:""},c)),!n&&(a?Lt.createElement("span",{className:"PhotoView__icon"},a):Lt.createElement(fee,{className:"PhotoView__icon"}))):l?Lt.createElement("span",{className:"PhotoView__icon"},typeof l=="function"?l({src:t}):l):null}var mee={naturalWidth:void 0,naturalHeight:void 0,width:void 0,height:void 0,loaded:void 0,broken:!1,x:0,y:0,touched:!1,maskTouched:!1,rotate:0,scale:1,CX:0,CY:0,lastX:0,lastY:0,lastCX:0,lastCY:0,lastScale:1,touchTime:0,touchLength:0,pause:!0,stopRaf:!0,reach:void 0};function gee(e){var t=e.item,n=t.src,s=t.render,i=t.width,r=i===void 0?0:i,a=t.height,l=a===void 0?0:a,c=t.originRef,u=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,b=e.loadingElement,v=e.brokenElement,y=e.onPhotoTap,x=e.onMaskTap,E=e.onReachMove,w=e.onReachUp,S=e.onPhotoResize,_=e.isActive,T=e.expose,k=e1(mee),A=k[0],j=k[1],R=g.useRef(0),B=RB(),z=A.naturalWidth,L=z===void 0?r:z,F=A.naturalHeight,C=F===void 0?l:F,I=A.width,D=I===void 0?r:I,$=A.height,O=$===void 0?l:$,te=A.loaded,se=te===void 0?!n:te,P=A.broken,Q=A.x,ee=A.y,V=A.touched,X=A.stopRaf,K=A.maskTouched,ce=A.rotate,he=A.scale,be=A.CX,ue=A.CY,we=A.lastX,Le=A.lastY,Ne=A.lastCX,ae=A.lastCY,me=A.lastScale,_e=A.touchTime,Je=A.touchLength,Pe=A.pause,Fe=A.reach,Ye=tu({onScale:function(ye){return Ce(z0(ye))},onRotate:function(ye){ce!==ye&&(T({rotate:ye}),j(ui({rotate:ye},Xv(L,C,ye))))}});function Ce(ye,We,Ge){he!==ye&&(T({scale:ye}),j(ui({scale:ye},Wv(Q,ee,D,O,he,ye,We,Ge),ye<=1&&{x:0,y:0})))}var Ve=V0(function(ye,We,Ge){if(Ge===void 0&&(Ge=0),(V||K)&&_){var ht=RS(ce,D,O),Vn=ht[0],un=ht[1];if(Ge===0&&R.current===0){var Ht=Math.abs(ye-be)<=20,sn=Math.abs(We-ue)<=20;if(Ht&&sn)return void j({lastCX:ye,lastCY:We});R.current=Ht?We>ue?3:2:1}var kn,zt=ye-Ne,ot=We-ae;if(Ge===0){var An=jl(zt+we,he,Vn,innerWidth)[0],mn=jl(ot+Le,he,un,innerHeight);kn=function(Os,Ms,bs,vn){return Ms&&Os===1||vn==="x"?"x":bs&&Os>1||vn==="y"?"y":void 0}(R.current,An,mn[0],Fe),kn!==void 0&&E(kn,ye,We,he)}if(kn==="x"||K)return void j({reach:"x"});var At=z0(he+(Ge-Je)/100/2*he,L/D,.2);T({scale:At}),j(ui({touchLength:Ge,reach:kn,scale:At},Wv(Q,ee,D,O,he,At,ye,We,zt,ot)))}},{maxWait:8});function Ue(ye){return!X&&!V&&(B.current&&j(ui({},ye,{pause:u})),B.current)}var W,oe,Z,Ee,Me,lt,Ot,ut,xn=(Me=function(ye){return Ue({x:ye})},lt=function(ye){return Ue({y:ye})},Ot=function(ye){return B.current&&(T({scale:ye}),j({scale:ye})),!V&&B.current},ut=tu({X:function(ye){return Me(ye)},Y:function(ye){return lt(ye)},S:function(ye){return Ot(ye)}}),function(ye,We,Ge,ht,Vn,un,Ht,sn,kn,zt,ot){var An=RS(zt,Vn,un),mn=An[0],At=An[1],Os=jl(ye,sn,mn,innerWidth),Ms=Os[0],bs=Os[1],vn=jl(We,sn,At,innerHeight),Gn=vn[0],ls=vn[1],Kn=Date.now()-ot;if(Kn>=200||sn!==Ht||Math.abs(kn-Ht)>1){var Ss=Wv(ye,We,Vn,un,Ht,sn),Ns=Ss.x,hi=Ss.y,Cn=Ms?bs:Ns!==ye?Ns:null,Ks=Gn?ls:hi!==We?hi:null;return Cn!==null&&Hc(ye,Cn,ut.X),Ks!==null&&Hc(We,Ks,ut.Y),void(sn!==Ht&&Hc(Ht,sn,ut.S))}var cs=(ye-Ge)/Kn,qn=(We-ht)/Kn,Yn=Math.sqrt(Math.pow(cs,2)+Math.pow(qn,2)),Wn=!1,Ls=!1;(function(ys,gn){var fn,dn=ys,rn=0,an=0,xs=function(Be){fn||(fn=Be);var it=Be-fn,et=Math.sign(ys),Et=-.001*et,je=Math.sign(-dn)*Math.pow(dn,2)*2e-4,Ln=dn*it+(Et+je)*Math.pow(it,2)/2;rn+=Ln,fn=Be,et*(dn+=(Et+je)*it)<=0?Ie():gn(rn)?de():Ie()};function de(){an=requestAnimationFrame(xs)}function Ie(){cancelAnimationFrame(an)}de()})(Yn,function(ys){var gn=ye+ys*(cs/Yn),fn=We+ys*(qn/Yn),dn=jl(gn,Ht,mn,innerWidth),rn=dn[0],an=dn[1],xs=jl(fn,Ht,At,innerHeight),de=xs[0],Ie=xs[1];if(rn&&!Wn&&(Wn=!0,Ms?Hc(gn,an,ut.X):PR(an,gn+(gn-an),ut.X)),de&&!Ls&&(Ls=!0,Gn?Hc(fn,Ie,ut.Y):PR(Ie,fn+(fn-Ie),ut.Y)),Wn&&Ls)return!1;var Be=Wn||ut.X(an),it=Ls||ut.Y(Ie);return Be&&it})}),xt=(W=y,oe=function(ye,We){Fe||Ce(he!==1?1:Math.max(2,L/D),ye,We)},Z=g.useRef(0),Ee=V0(function(){Z.current=0,W.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var ye=[].slice.call(arguments);Z.current+=1,Ee.apply(void 0,ye),Z.current>=2&&(Ee.cancel(),Z.current=0,oe.apply(void 0,ye))});function wt(ye,We){if(R.current=0,(V||K)&&_){j({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Ge=z0(he,L/D);if(xn(Q,ee,we,Le,D,O,he,Ge,me,ce,_e),w(ye,We),be===ye&&ue===We){if(V)return void xt(ye,We);K&&x(ye,We)}}}function En(ye,We,Ge){Ge===void 0&&(Ge=0),j({touched:!0,CX:ye,CY:We,lastCX:ye,lastCY:We,lastX:Q,lastY:ee,lastScale:he,touchLength:Ge,touchTime:Date.now()})}function Ut(ye){j({maskTouched:!0,CX:ye.clientX,CY:ye.clientY,lastX:Q,lastY:ee})}pd(Bo?void 0:"mousemove",function(ye){ye.preventDefault(),Ve(ye.clientX,ye.clientY)}),pd(Bo?void 0:"mouseup",function(ye){wt(ye.clientX,ye.clientY)}),pd(Bo?"touchmove":void 0,function(ye){ye.preventDefault();var We=DR(ye);Ve.apply(void 0,We)},{passive:!1}),pd(Bo?"touchend":void 0,function(ye){var We=ye.changedTouches[0];wt(We.clientX,We.clientY)},{passive:!1}),pd("resize",V0(function(){se&&!V&&(j(Xv(L,C,ce)),S())},{maxWait:8})),jS(function(){_&&T(ui({scale:he,rotate:ce},Ye))},[_]);var Pt=function(ye,We,Ge,ht,Vn,un,Ht,sn,kn,zt){var ot=function(Ns,hi,Cn,Ks,cs){var qn=g.useRef(!1),Yn=e1({lead:!0,scale:Cn}),Wn=Yn[0],Ls=Wn.lead,ys=Wn.scale,gn=Yn[1],fn=V0(function(dn){try{return cs(!0),gn({lead:!1,scale:dn}),Promise.resolve()}catch(rn){return Promise.reject(rn)}},{wait:Ks});return jS(function(){qn.current?(cs(!1),gn({lead:!0}),fn(Cn)):qn.current=!0},[Cn]),Ls?[Ns*ys,hi*ys,Cn/ys]:[Ns*Cn,hi*Cn,1]}(un,Ht,sn,kn,zt),An=ot[0],mn=ot[1],At=ot[2],Os=function(Ns,hi,Cn,Ks,cs){var qn=g.useState(uee),Yn=qn[0],Wn=qn[1],Ls=g.useState(0),ys=Ls[0],gn=Ls[1],fn=g.useRef(),dn=tu({OK:function(){return Ns&&gn(4)}});function rn(an){cs(!1),gn(an)}return g.useEffect(function(){if(fn.current||(fn.current=Date.now()),Cn){if(function(an,xs){var de=an&&an.current;if(de&&de.nodeType===1){var Ie=de.getBoundingClientRect();xs({T:Ie.top,L:Ie.left,W:Ie.width,H:Ie.height,FIT:de.tagName==="IMG"?getComputedStyle(de).objectFit:void 0})}}(hi,Wn),Ns)return Date.now()-fn.current<250?(gn(1),requestAnimationFrame(function(){gn(2),requestAnimationFrame(function(){return rn(3)})}),void setTimeout(dn.OK,Ks)):void gn(4);rn(5)}},[Ns,Cn]),[ys,Yn]}(ye,We,Ge,kn,zt),Ms=Os[0],bs=Os[1],vn=bs.W,Gn=bs.FIT,ls=innerWidth/2,Kn=innerHeight/2,Ss=Ms<3||Ms>4;return[Ss?vn?bs.L:ls:ht+(ls-un*sn/2),Ss?vn?bs.T:Kn:Vn+(Kn-Ht*sn/2),An,Ss&&Gn?An*(bs.H/vn):mn,Ms===0?At:Ss?vn/(un*sn)||.01:At,Ss?Gn?1:0:1,Ms,Gn]}(u,c,se,Q,ee,D,O,he,d,function(ye){return j({pause:ye})}),at=Pt[4],ft=Pt[6],He="transform "+d+"ms "+f,_t={className:p,onMouseDown:Bo?void 0:function(ye){ye.stopPropagation(),ye.button===0&&En(ye.clientX,ye.clientY,0)},onTouchStart:Bo?function(ye){ye.stopPropagation(),En.apply(void 0,DR(ye))}:void 0,onWheel:function(ye){if(!Fe){var We=z0(he-ye.deltaY/100/2,L/D);j({stopRaf:!0}),Ce(We,ye.clientX,ye.clientY)}},style:{width:Pt[2]+"px",height:Pt[3]+"px",opacity:Pt[5],objectFit:ft===4?void 0:Pt[7],transform:ce?"rotate("+ce+"deg)":void 0,transition:ft>2?He+", opacity "+d+"ms ease, height "+(ft<4?d/2:ft>4?d:0)+"ms "+f:void 0}};return Lt.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Bo&&_?Ut:void 0,onTouchStart:Bo&&_?function(ye){return Ut(ye.touches[0])}:void 0},Lt.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+at+", 0, 0, "+at+", "+Pt[0]+", "+Pt[1]+")",transition:V||Pe?void 0:He,willChange:_?"transform":void 0}},n?Lt.createElement(pee,ui({src:n,loaded:se,broken:P},_t,{onPhotoLoad:function(ye){j(ui({},ye,ye.loaded&&Xv(ye.naturalWidth||0,ye.naturalHeight||0,ce)))},loadingElement:b,brokenElement:v})):s&&s({attrs:_t,scale:at,rotate:ce})))}var BR={x:0,touched:!1,pause:!1,lastCX:void 0,lastCY:void 0,bg:void 0,lastBg:void 0,overlay:!0,minimal:!0,scale:1,rotate:0};function bee(e){var t=e.loop,n=t===void 0?3:t,s=e.speed,i=e.easing,r=e.photoClosable,a=e.maskClosable,l=a===void 0||a,c=e.maskOpacity,u=c===void 0?1:c,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,b=e.toolbarRender,v=e.className,y=e.maskClassName,x=e.photoClassName,E=e.photoWrapClassName,w=e.loadingElement,S=e.brokenElement,_=e.images,T=e.index,k=T===void 0?0:T,A=e.onIndexChange,j=e.visible,R=e.onClose,B=e.afterClose,z=e.portalContainer,L=e1(BR),F=L[0],C=L[1],I=g.useState(0),D=I[0],$=I[1],O=F.x,te=F.touched,se=F.pause,P=F.lastCX,Q=F.lastCY,ee=F.bg,V=ee===void 0?u:ee,X=F.lastBg,K=F.overlay,ce=F.minimal,he=F.scale,be=F.rotate,ue=F.onScale,we=F.onRotate,Le=e.hasOwnProperty("index"),Ne=Le?k:D,ae=Le?A:$,me=g.useRef(Ne),_e=_.length,Je=_[Ne],Pe=typeof n=="boolean"?n:_e>n,Fe=function(at,ft){var He=g.useReducer(function(Ge){return!Ge},!1)[1],_t=g.useRef(0),ye=function(Ge){var ht=g.useRef(Ge);function Vn(un){ht.current=un}return g.useMemo(function(){(function(un){at?(un(at),_t.current=1):_t.current=2})(Vn)},[Ge]),[ht.current,Vn]}(at),We=ye[1];return[ye[0],_t.current,function(){He(),_t.current===2&&(We(!1),ft&&ft()),_t.current=0}]}(j,B),Ye=Fe[0],Ce=Fe[1],Ve=Fe[2];jS(function(){if(Ye)return C({pause:!0,x:Ne*-(innerWidth+Ju)}),void(me.current=Ne);C(BR)},[Ye]);var Ue=tu({close:function(at){we&&we(0),C({overlay:!0,lastBg:V}),R(at)},changeIndex:function(at,ft){ft===void 0&&(ft=!1);var He=Pe?me.current+(at-Ne):at,_t=_e-1,ye=IS(He,0,_t),We=Pe?He:ye,Ge=innerWidth+Ju;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-Ge*We,pause:ft}),me.current=We,ae&&ae(Pe?at<0?_t:at>_t?0:at:ye)}}),W=Ue.close,oe=Ue.changeIndex;function Z(at){return at?W():C({overlay:!K})}function Ee(){C({x:-(innerWidth+Ju)*Ne,lastCX:void 0,lastCY:void 0,pause:!0}),me.current=Ne}function Me(at,ft,He,_t){at==="x"?function(ye){if(P!==void 0){var We=ye-P,Ge=We;!Pe&&(Ne===0&&We>0||Ne===_e-1&&We<0)&&(Ge=We/2),C({touched:!0,lastCX:P,x:-(innerWidth+Ju)*me.current+Ge,pause:!1})}else C({touched:!0,lastCX:ye,x:O,pause:!1})}(ft):at==="y"&&function(ye,We){if(Q!==void 0){var Ge=u===null?null:IS(u,.01,u-Math.abs(ye-Q)/100/4);C({touched:!0,lastCY:Q,bg:We===1?Ge:u,minimal:We===1})}else C({touched:!0,lastCY:ye,bg:V,minimal:!0})}(He,_t)}function lt(at,ft){var He=at-(P??at),_t=ft-(Q??ft),ye=!1;if(He<-40)oe(Ne+1);else if(He>40)oe(Ne-1);else{var We=-(innerWidth+Ju)*me.current;Math.abs(_t)>100&&ce&&f&&(ye=!0,W()),C({touched:!1,x:We,lastCX:void 0,lastCY:void 0,bg:u,overlay:!!ye||K})}}pd("keydown",function(at){if(j)switch(at.key){case"ArrowLeft":oe(Ne-1,!0);break;case"ArrowRight":oe(Ne+1,!0);break;case"Escape":W()}});var Ot=function(at,ft,He){return g.useMemo(function(){var _t=at.length;return He?at.concat(at).concat(at).slice(_t+ft-1,_t+ft+2):at.slice(Math.max(ft-1,0),Math.min(ft+2,_t+1))},[at,ft,He])}(_,Ne,Pe);if(!Ye)return null;var ut=K&&!Ce,xn=j?V:X,xt=ue&&we&&{images:_,index:Ne,visible:j,onClose:W,onIndexChange:oe,overlayVisible:ut,overlay:Je&&Je.overlay,scale:he,rotate:be,onScale:ue,onRotate:we},wt=s?s(Ce):400,En=i?i(Ce):LR,Ut=s?s(3):600,Pt=i?i(3):LR;return Lt.createElement(iee,{className:"PhotoView-Portal"+(ut?"":" PhotoView-Slider__clean")+(j?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(at){return at.stopPropagation()},container:z},j&&Lt.createElement(lee,null),Lt.createElement("div",{className:"PhotoView-Slider__Backdrop"+(y?" "+y:"")+(Ce===1?" PhotoView-Slider__fadeIn":Ce===2?" PhotoView-Slider__fadeOut":""),style:{background:xn?"rgba(0, 0, 0, "+xn+")":void 0,transitionTimingFunction:En,transitionDuration:(te?0:wt)+"ms",animationDuration:wt+"ms"},onAnimationEnd:Ve}),p&&Lt.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Lt.createElement("div",{className:"PhotoView-Slider__Counter"},Ne+1," / ",_e),Lt.createElement("div",{className:"PhotoView-Slider__BannerRight"},b&&xt&&b(xt),Lt.createElement(ree,{className:"PhotoView-Slider__toolbarIcon",onClick:W}))),Ot.map(function(at,ft){var He=Pe||Ne!==0?me.current-1+ft:Ne+ft;return Lt.createElement(gee,{key:Pe?at.key+"/"+at.src+"/"+He:at.key,item:at,speed:wt,easing:En,visible:j,onReachMove:Me,onReachUp:lt,onPhotoTap:function(){return Z(r)},onMaskTap:function(){return Z(l)},wrapClassName:E,className:x,style:{left:(innerWidth+Ju)*He+"px",transform:"translate3d("+O+"px, 0px, 0)",transition:te||se?void 0:"transform "+Ut+"ms "+Pt},loadingElement:w,brokenElement:S,onPhotoResize:Ee,isActive:me.current===He,expose:C})}),!Bo&&p&&Lt.createElement(Lt.Fragment,null,(Pe||Ne!==0)&&Lt.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return oe(Ne-1,!0)}},Lt.createElement(aee,null)),(Pe||Ne+1<_e)&&Lt.createElement("div",{className:"PhotoView-Slider__ArrowRight",onClick:function(){return oe(Ne+1,!0)}},Lt.createElement(oee,null))),m&&xt&&Lt.createElement("div",{className:"PhotoView-Slider__Overlay"},m(xt)))}var yee=["children","onIndexChange","onVisibleChange"],xee={images:[],visible:!1,index:0};function Eee(e){var t=e.children,n=e.onIndexChange,s=e.onVisibleChange,i=gx(e,yee),r=e1(xee),a=r[0],l=r[1],c=g.useRef(0),u=a.images,d=a.visible,f=a.index,h=tu({nextId:function(){return c.current+=1},update:function(b){var v=u.findIndex(function(x){return x.key===b.key});if(v>-1){var y=u.slice();return y.splice(v,1,b),void l({images:y})}l(function(x){return{images:x.images.concat(b)}})},remove:function(b){l(function(v){var y=v.images.filter(function(x){return x.key!==b});return{images:y,index:Math.min(y.length-1,f)}})},show:function(b){var v=u.findIndex(function(y){return y.key===b});l({visible:!0,index:v}),s&&s(!0,v,a)}}),p=tu({close:function(){l({visible:!1}),s&&s(!1,f,a)},changeIndex:function(b){l({index:b}),n&&n(b,a)}}),m=g.useMemo(function(){return ui({},a,h)},[a,h]);return Lt.createElement(jB.Provider,{value:m},t,Lt.createElement(bee,ui({images:u,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},i)))}var OB=function(e){var t,n,s=e.src,i=e.render,r=e.overlay,a=e.width,l=e.height,c=e.triggers,u=c===void 0?["onClick"]:c,d=e.children,f=g.useContext(jB),h=(t=function(){return f.nextId()},(n=g.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=g.useRef(null);g.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),g.useEffect(function(){return function(){f.remove(h)}},[]);var m=tu({render:function(v){return i&&i(v)},show:function(v,y){f.show(h),function(x,E){if(d){var w=d.props[x];w&&w(E)}}(v,y)}}),b=g.useMemo(function(){var v={};return u.forEach(function(y){v[y]=m.show.bind(null,y)}),v},[]);return g.useEffect(function(){f.update({key:h,src:s,originRef:p,render:m.render,overlay:r,width:a,height:l})},[s]),d?g.Children.only(g.cloneElement(d,ui({},b,{ref:p}))):null};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Eee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),OB=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/** + */const vee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MB=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var vee={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"};/** + */var wee={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.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wee=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:r,iconNode:a,...l},c)=>g.createElement("svg",{ref:c,...vee,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:OB("lucide",i),...l},[...a.map(([u,d])=>g.createElement(u,d)),...Array.isArray(r)?r:[r]]));/** + */const _ee=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:r,iconNode:a,...l},c)=>g.createElement("svg",{ref:c,...wee,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:MB("lucide",i),...l},[...a.map(([u,d])=>g.createElement(u,d)),...Array.isArray(r)?r:[r]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ze=(e,t)=>{const n=g.forwardRef(({className:s,...i},r)=>g.createElement(wee,{ref:r,iconNode:t,className:OB(`lucide-${Eee(e)}`,s),...i}));return n.displayName=`${e}`,n};/** + */const $e=(e,t)=>{const n=g.forwardRef(({className:s,...i},r)=>g.createElement(_ee,{ref:r,iconNode:t,className:MB(`lucide-${vee(e)}`,s),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.460.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=ze("Activity",[["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"}]]);/** + */const See=$e("Activity",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vk=ze("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const Vk=$e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MB=ze("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + */const LB=$e("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wm=ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const Kp=$e("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LB=ze("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const DB=$e("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DB=ze("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** + */const PB=$e("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const See=ze("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + */const Nee=$e("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fu=ze("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const pu=$e("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Nee=ze("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const Tee=$e("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tee=ze("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + */const kee=$e("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kee=ze("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const Aee=$e("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pa=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Ha=$e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PB=ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const BB=$e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oc=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const uc=$e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gk=ze("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const Gk=$e("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Aee=ze("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const Cee=$e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UR=ze("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const UR=$e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cee=ze("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** + */const Iee=$e("Cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kk=ze("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const Kk=$e("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gx=ze("Copy",[["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"}]]);/** + */const bx=$e("Copy",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Iee=ze("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** + */const jee=$e("CornerDownRight",[["polyline",{points:"15 10 20 15 15 20",key:"1q7qjw"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const jee=ze("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const Ree=$e("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kb=ze("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const qb=$e("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bx=ze("Download",[["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"}]]);/** + */const yx=$e("Download",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ree=ze("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** + */const Oee=$e("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Op=ze("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const Im=$e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Oee=ze("Eye",[["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"}]]);/** + */const Mee=$e("Eye",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FR=ze("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** + */const FR=$e("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mee=ze("FileDown",[["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:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + */const Lee=$e("FileDown",[["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:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lee=ze("FilePlus",[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** + */const Dee=$e("FilePlus",[["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:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qk=ze("FileText",[["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"}]]);/** + */const qk=$e("FileText",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dee=ze("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** + */const Pee=$e("FileType2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 13v-1h6v1",key:"1dh9dg"}],["path",{d:"M5 12v6",key:"150t9c"}],["path",{d:"M4 18h2",key:"1xrofg"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BB=ze("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** + */const UB=$e("FileVideo2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["rect",{width:"8",height:"6",x:"2",y:"12",rx:"1",key:"1a6c1e"}],["path",{d:"m10 15.5 4 2.5v-6l-4 2.5",key:"t7cp39"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pee=ze("File",[["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"}]]);/** + */const Bee=$e("File",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Bee=ze("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + */const Uee=$e("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Uee=ze("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/** + */const Fee=$e("FolderTree",[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yk=ze("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** + */const Yk=$e("FolderUp",[["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"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UB=ze("Folder",[["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"}]]);/** + */const FB=$e("Folder",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fee=ze("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const $ee=$e("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.460.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=ze("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** + */const Hee=$e("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yx=ze("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const xx=$e("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Hee=ze("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + */const zee=$e("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zee=ze("Headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]);/** + */const Vee=$e("Headset",[["path",{d:"M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z",key:"12oyoe"}],["path",{d:"M21 16v2a4 4 0 0 1-4 4h-5",key:"1x7m43"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wk=ze("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const Wk=$e("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mc=ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const bc=$e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vee=ze("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** + */const Gee=$e("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FB=ze("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const $B=$e("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gee=ze("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/** + */const Kee=$e("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $B=ze("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** + */const HB=$e("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bn=ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const yn=$e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Kee=ze("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** + */const qee=$e("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qee=ze("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const Yee=$e("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eu=ze("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const nu=$e("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yee=ze("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** + */const Wee=$e("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HB=ze("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + */const zB=$e("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wee=ze("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** + */const Xee=$e("MessagesSquare",[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xee=ze("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/** + */const Qee=$e("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qee=ze("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const Zee=$e("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zee=ze("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** + */const Jee=$e("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Jee=ze("Network",[["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"}]]);/** + */const ete=$e("Network",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ete=ze("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** + */const tte=$e("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tte=ze("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/** + */const nte=$e("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nte=ze("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const ste=$e("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ste=ze("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const ite=$e("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ii=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const ji=$e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ite=ze("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const rte=$e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xk=ze("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** + */const Xk=$e("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rte=ze("Rocket",[["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"}]]);/** + */const ate=$e("Rocket",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ate=ze("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** + */const ote=$e("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e1=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const t1=$e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ote=ze("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** + */const lte=$e("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lte=ze("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** + */const cte=$e("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $R=ze("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const $R=$e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hu=ze("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const mu=$e("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cte=ze("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** + */const ute=$e("Split",[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lc=ze("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const dc=$e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ute=ze("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const dte=$e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dte=ze("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + */const fte=$e("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fte=ze("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + */const hte=$e("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hte=ze("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** + */const pte=$e("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mte=ze("Workflow",[["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"}]]);/** + */const mte=$e("Workflow",[["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"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zB=ze("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const VB=$e("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ri=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),HR="veadk_auth_qs";let Wh=null;function pte(){if(Wh!==null)return Wh;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(HR,t),Wh=t):Wh=sessionStorage.getItem(HR)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),Wh}function Rn(e){const t=pte();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((s,i)=>{n.searchParams.has(i)||n.searchParams.set(i,s)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const pc=3e4,_g=12e4,Qk=1e4;function Bn(e,t=pc){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const t1="veadk_local_user",n1="veadk_local_user_tab",gte=/^[A-Za-z0-9]{1,16}$/;function VB(){try{const e=sessionStorage.getItem(n1);if(e)return e;const t=localStorage.getItem(t1);return t&&sessionStorage.setItem(n1,t),t}catch{try{return localStorage.getItem(t1)}catch{return null}}}function zR(e){try{sessionStorage.setItem(n1,e)}catch{}try{localStorage.setItem(t1,e)}catch{}}function bte(){try{sessionStorage.removeItem(n1)}catch{}try{localStorage.removeItem(t1)}catch{}}function xx(e){const t=new Headers(e),n=VB();return n&&t.set("X-VeADK-Local-User",n),t}async function GB(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:Bn(void 0,Qk)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error("无法加载登录配置,请检查网络后重试。")}if(!e.ok)throw new Error(`登录配置服务异常(HTTP ${e.status}),请稍后重试。`);try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error("登录配置服务返回了无法解析的响应,请稍后重试。")}}function yte(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function xte(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function Ete(){const[e,t]=await Promise.all([OS(),GB()]);return e.status==="unauthenticated"&&t.length>0}function vte(){window.location.assign("/oauth2/logout")}async function OS(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:Bn(void 0,Qk)})}catch(n){throw console.warn("[identity] /oauth2/userinfo is unreachable:",n),new Error("无法连接身份服务,请检查网络后重试。")}if(e.ok){let n;try{n=await e.json()}catch(i){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",i),new Error("身份服务返回了无法解析的响应,请稍后重试。")}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(`身份服务异常(HTTP ${e.status}),请稍后重试。`);const t=VB();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function wte(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function _te(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const MS="veadk:authentication-required";let Xm=null,Em=null;function Ste(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Nte(e){Xm||(Xm=new Promise(n=>{Em=n}),window.dispatchEvent(new Event(MS)));const t=Xm;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,s)=>{const i=()=>s(e.reason??new Error("Request aborted"));e.addEventListener("abort",i,{once:!0}),t.then(()=>{e.removeEventListener("abort",i),n()},r=>{e.removeEventListener("abort",i),s(r)})}):t}function Tte(){return Xm!==null}function kte(){Em==null||Em(),Em=null,Xm=null}async function Ex(e,t){var s;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const i=((s=e.headers.get("content-type"))==null?void 0:s.split(";",1)[0])||"Content-Type 缺失",r=n.trim().slice(0,2e3),a=r?` -响应:${r}`:"";throw new Error(`${t}:服务端返回非 JSON 响应(HTTP ${e.status},${i})${a}`)}}const Ate=/\brun_sse\s*failed\s*:\s*404\b/i,Cte=/session not found/i,Ite=/(?:^|[::\s])not found\s*$/i,jte=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,VR="提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",GR="提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",KR="提示:模型生成的工具参数格式不完整,请重新发送一次。";function V0(e){const t=String(e);return jte.test(t)?t.includes(KR)?t:`${t} + */const Oi=$e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),HR="veadk_auth_qs";let Kh=null;function gte(){if(Kh!==null)return Kh;const t=new URLSearchParams(window.location.search).toString();return t?(sessionStorage.setItem(HR,t),Kh=t):Kh=sessionStorage.getItem(HR)??"",window.location.search&&window.history.replaceState(null,"",window.location.pathname+window.location.hash),Kh}function Rn(e){const t=gte();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((s,i)=>{n.searchParams.has(i)||n.searchParams.set(i,s)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const yc=3e4,Eg=12e4,Qk=1e4;function Bn(e,t=yc){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const n1="veadk_local_user",s1="veadk_local_user_tab",bte=/^[A-Za-z0-9]{1,16}$/;function GB(){try{const e=sessionStorage.getItem(s1);if(e)return e;const t=localStorage.getItem(n1);return t&&sessionStorage.setItem(s1,t),t}catch{try{return localStorage.getItem(n1)}catch{return null}}}function zR(e){try{sessionStorage.setItem(s1,e)}catch{}try{localStorage.setItem(n1,e)}catch{}}function yte(){try{sessionStorage.removeItem(s1)}catch{}try{localStorage.removeItem(n1)}catch{}}function Ex(e){const t=new Headers(e),n=GB();return n&&t.set("X-VeADK-Local-User",n),t}async function KB(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:Bn(void 0,Qk)})}catch(t){throw console.warn("[identity] /web/auth-config is unreachable:",t),new Error("无法加载登录配置,请检查网络后重试。")}if(!e.ok)throw new Error(`登录配置服务异常(HTTP ${e.status}),请稍后重试。`);try{const t=await e.json();if(!Array.isArray(t.providers))throw new TypeError("providers is not an array");return t.providers}catch(t){throw console.warn("[identity] /web/auth-config returned an invalid response:",t),new Error("登录配置服务返回了无法解析的响应,请稍后重试。")}}function xte(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function Ete(){const e=window.location.pathname+window.location.search+window.location.hash,t=window.open("about:blank","_blank","popup,width=520,height=720");if(!t)return null;try{t.opener=null,t.location.replace(`/oauth2/login?redirect=${encodeURIComponent(e)}`)}catch{return t.close(),null}return t}async function vte(){const[e,t]=await Promise.all([OS(),KB()]);return e.status==="unauthenticated"&&t.length>0}function wte(){window.location.assign("/oauth2/logout")}async function OS(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:Bn(void 0,Qk)})}catch(n){throw console.warn("[identity] /oauth2/userinfo is unreachable:",n),new Error("无法连接身份服务,请检查网络后重试。")}if(e.ok){let n;try{n=await e.json()}catch(i){throw console.warn("[identity] /oauth2/userinfo returned a non-JSON response:",i),new Error("身份服务返回了无法解析的响应,请稍后重试。")}return{status:"authenticated",userId:String(n.sub??n.user_id??n.email??""),info:n}}if(e.status===401)return{status:"unauthenticated",userId:"",local:!1};if(e.status!==404)throw new Error(`身份服务异常(HTTP ${e.status}),请稍后重试。`);const t=GB();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function _te(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function Ste(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const MS="veadk:authentication-required";let qp=null,bp=null;function Nte(e){if(!e.redirected||!e.url)return!1;try{const t=new URL(e.url);return t.pathname.includes("/authorize")||t.pathname.includes("/oauth2/login")||t.hostname.includes(".userpool.auth.")}catch{return!1}}function Tte(e){qp||(qp=new Promise(n=>{bp=n}),window.dispatchEvent(new Event(MS)));const t=qp;return e?e.aborted?Promise.reject(e.reason??new Error("Request aborted")):new Promise((n,s)=>{const i=()=>s(e.reason??new Error("Request aborted"));e.addEventListener("abort",i,{once:!0}),t.then(()=>{e.removeEventListener("abort",i),n()},r=>{e.removeEventListener("abort",i),s(r)})}):t}function kte(){return qp!==null}function Ate(){bp==null||bp(),bp=null,qp=null}async function vx(e,t){var s;const n=await e.text().catch(()=>"");try{return JSON.parse(n)}catch{const i=((s=e.headers.get("content-type"))==null?void 0:s.split(";",1)[0])||"Content-Type 缺失",r=n.trim().slice(0,2e3),a=r?` +响应:${r}`:"";throw new Error(`${t}:服务端返回非 JSON 响应(HTTP ${e.status},${i})${a}`)}}const Cte=/\brun_sse\s*failed\s*:\s*404\b/i,Ite=/session not found/i,jte=/(?:^|[::\s])not found\s*$/i,Rte=/Expecting (?:'[^']+'|\w+)(?: delimiter)?: line \d+ column \d+ \(char \d+\)/i,VR="提示:会话已不存在。使用 in-memory 或 SQLite 短期记忆时,多实例、进程重启或滚动发布都可能导致会话丢失;建议改用基于数据库的持久化短期记忆存储。",GR="提示:该 Runtime 未提供会话能力运行接口,可能是 Runtime 版本与当前 Studio 不兼容。",KR="提示:模型生成的工具参数格式不完整,请重新发送一次。";function G0(e){const t=String(e);return Rte.test(t)?t.includes(KR)?t:`${t} -${KR}`:Ate.test(t)?Cte.test(t)?t.includes(VR)?t:`${t} +${KR}`:Cte.test(t)?Ite.test(t)?t.includes(VR)?t:`${t} -${VR}`:Ite.test(t)?t.includes(GR)?t:`${t} +${VR}`:jte.test(t)?t.includes(GR)?t:`${t} ${GR}`:t:t}async function*Zk(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let s="";try{for(;;){const{done:i,value:r}=await t.read();if(i)break;s+=n.decode(r,{stream:!0});let a=s.match(/\r?\n\r?\n/);for(;(a==null?void 0:a.index)!==void 0;){const l=s.slice(0,a.index);s=s.slice(a.index+a[0].length);const c=l.split(/\r?\n/).filter(u=>u.startsWith("data:")).map(u=>u.slice(5).trimStart()).join(` -`);if(c)try{yield JSON.parse(c)}catch{c!=="[DONE]"&&c!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${c.length} chars):`,c.slice(0,200))}a=s.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Rte=255,Ote=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Mte(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let s=0,i="";for(const r of t){if(!Ote.test(r))continue;const a=n.encode(r).byteLength;if(s+a>Rte)break;i+=r,s+=a}return i.replace(/ +/g," ").trimEnd()}const Lte="ap-southeast-1",Jk="cn-beijing",KB="https://ark.ap-southeast.bytepluses.com/api/v3",e2="https://ark.cn-beijing.volces.com/api/v3/",qB="seed-2-0-lite-260228",t2="doubao-seed-2-1-pro-260628",Dte="skylark-embedding-vision-250615",Pte="doubao-embedding-vision-250615",Bte="seed-2-0-lite-260228",Ute="doubao-seed-2-0-lite-260428",YB=[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}],WB=[{value:Lte,label:"ap-southeast-1 (Singapore)"}];function vx(e){return e==="byteplus"?WB:YB}function Ni(e){var t;return((t=vx(e)[0])==null?void 0:t.value)||Jk}function kf(e,t){var s;return((s=(t?vx(t):[...YB,...WB]).find(i=>i.value===e))==null?void 0:s.label)||e||"-"}function s1(e){return e==="byteplus"?qB:t2}function i1(e){return e==="byteplus"?KB:e2}function Fte(e){return e==="byteplus"?Dte:Pte}function $te(e){return e==="byteplus"?Bte:Ute}const n2="veadk.messageFeedback.v1";function s2(e,t,n,s){return[e,t,n,s].join(":")}function i2(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(n2)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function Hte(e,t,n){if(typeof window>"u")return;const s=i2();s[e]={...s[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(n2,JSON.stringify(s))}function XB(e){if(typeof window>"u")return;const t=s2(e.runtimeId,e.appName,e.userId,e.sessionId),n=i2(),s=n[t];if(s){for(const i of e.eventIds)delete s[`veadk_feedback:${i}`];Object.keys(s).length===0?delete n[t]:n[t]=s,localStorage.setItem(n2,JSON.stringify(n))}}const qb="",r2=new Map;function QB(e,t){r2.set(e,t)}function ZB(){r2.clear()}function si(e){const t=r2.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}async function ut(e,t={},n={},s=pc){const i=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",r={...t,...i?{method:"POST"}:{},headers:xx(t.headers)},a=()=>{const u={...r,signal:Bn(t.signal,s)};if(n.runtimeId){const d=new URLSearchParams;n.region&&d.set("region",n.region),n.retryProbe&&d.set("probe_retry","connect"),i&&d.set("_method","DELETE");const f=d.toString()?`${e.includes("?")?"&":"?"}${d.toString()}`:"";return fetch(Rn(`${qb}/web/runtime-proxy/${n.runtimeId}${e}${f}`),u)}if(n.base){const d=new Headers(u.headers);return d.set("X-AgentKit-Base",n.base),n.apiKey&&d.set("X-AgentKit-Key",n.apiKey),fetch(Rn(`${qb}/agentkit-proxy${e}`),{...u,headers:d})}return fetch(Rn(`${qb}${e}`),u)},l=async u=>{if(Ste(u))return!0;if(u.status!==401)return!1;try{return await Ete()}catch{return!1}};let c=await a();for(;await l(c);)await Nte(t.signal),c=await a();return c}function JB(e,t={},n=pc){return ut(e,t,{},n)}function zte(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const s=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",i=String(t.msg??"");return s?`${s}: ${i}`:i}return String(t)}).filter(Boolean).join(` -`):e&&typeof e=="object"?JSON.stringify(e):""}async function Kt(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const s=JSON.parse(n);return zte(s.detail??s.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function e8(){const e=await ut("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class rh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Ir extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const t8="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",n8="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",qR=["cn-beijing","cn-shanghai"],Vte=3e4,wx=5*60*1e3,s8=60*1e3,Yb=new Map,Lc=new Map,Dc=new Map,Sa=new Map;function i8(e,t){return`${t}:${e}`}function ah(e){const t=e||Jk;return qR.includes(t)?[t,...qR.filter(n=>n!==t)]:[t]}function oh(...e){return e.map(t=>String(t??"")).join("")}function lh(e,t,n){const s=e.get(t);return s!=null&&s.value&&Date.now()-s.updatedAt<=n?s.value:null}function a2(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}async function r8(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function _x(e,t,n){const s=await ut("/list-apps",{},n??{base:e,apiKey:t}),i=n!=null&&n.runtimeId?await r8(s):"";if(n!=null&&n.runtimeId&&i==="runtime_access_denied")throw new rh;if(n!=null&&n.runtimeId&&i==="runtime_private_endpoint_unreachable")throw new Ir(t8);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(i))throw new Ir(n8);if(n!=null&&n.runtimeId&&s.status===404)throw new Ir("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Ir("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!s.ok)throw new Error(await Kt(s,"读取 Agent 列表失败"));const r=await s.json();return n!=null&&n.runtimeId&&Yb.set(i8(n.runtimeId,n.region??""),{apps:r,expiresAt:Date.now()+Vte}),r}async function r1(e,t){const{app:n,ep:s}=si(e),i=await ut(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},s);if(!i.ok){const a=`创建会话失败 (${i.status})`,l=await Kt(i,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await i.json()).id}async function o2(e,t){const{app:n,ep:s}=si(e),i=await ut(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},s);if(!i.ok)throw new Error(`list sessions failed: ${i.status}`);return i.json()}async function a1(e,t,n){const{app:s,ep:i}=si(e),r=await ut(`/apps/${s}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},i);if(!r.ok){const l=await Kt(r,"读取会话失败");throw new Error(`get session failed: ${r.status}:${l}`)}const a=await r.json();if(i.runtimeId){const l=s2(i.runtimeId,s,t,n);a.state={...i2()[l]??{},...a.state??{}}}return a}async function a8(e){const{app:t,ep:n}=si(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const s=await ut("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},_g);if(!s.ok)throw new Error(await Kt(s,"提交反馈失败"));const i=await s.json(),r=s2(n.runtimeId,t,e.userId,e.sessionId);return Hte(r,e.eventId,i),i}async function Sx(e,t={}){const n=oh(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),s=lh(Sa,n,s8);if(!t.force&&s)return s;const i=Sa.get(n);if(!t.force&&(i!=null&&i.promise))return i.promise;let r=null;const a=(async()=>{for(const l of ah(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await ut(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return a2(Sa,n,await u.json());r=new Error(await Kt(u,"读取评测集失败"))}throw r??new Error("读取评测集失败")})();Sa.set(n,{...i,promise:a,updatedAt:(i==null?void 0:i.updatedAt)??0});try{return await a}finally{const l=Sa.get(n);(l==null?void 0:l.promise)===a&&Sa.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function o8(e){let t=null;for(const n of ah(e.region)){const s=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),i=await ut(`/web/evaluation/statuses?${s.toString()}`);if(i.ok)return i.json();t=new Error(await Kt(i,"读取自动评测状态失败"))}throw t??new Error("读取自动评测状态失败")}async function l8(e){let t=null;for(const n of ah(e.region)){const s=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),i=await ut(`/web/evaluation/optimizations?${s.toString()}`);if(i.ok)return i.json();t=new Error(await Kt(i,"读取优化项失败"))}throw t??new Error("读取优化项失败")}function c8(e){return lh(Sa,oh(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),s8)}function LS(e){Sx(e).catch(()=>{})}function u8(e){Sx(e,{force:!0}).catch(()=>{})}function d8(e,t){return["good","bad"].map(n=>{const s=e.find(i=>i.kind===n);return{kind:n,evaluationSetId:(s==null?void 0:s.evaluationSetId)??null,evaluationSetName:(s==null?void 0:s.evaluationSetName)??null,workspaceId:(s==null?void 0:s.workspaceId)??null,itemCount:t.filter(i=>i.kind===n).length}})}function Wb(e){for(const[t,n]of Sa.entries()){const s=n.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const i=s.items.filter(a=>a.sessionId!==e.sessionId||a.messageId!==e.messageId),r=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:"",agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:""},...i]:i;Sa.set(t,{value:{...s,sets:d8(s.sets,r),items:r},updatedAt:Date.now(),promise:n.promise})}}async function f8(e){let t=null;for(const n of ah(e.region)){const s=await ut("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},_g);if(s.ok){const i=await s.json(),r=new Set(e.itemIds);for(const[a,l]of Sa.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!r.has(d.id));Sa.set(a,{value:{...c,sets:d8(c.sets,u),items:u},updatedAt:Date.now()})}return i}t=new Error(await Kt(s,"删除评测案例失败"))}throw t??new Error("删除评测案例失败")}async function DS(e,t,n){const{app:s,ep:i}=si(e),r=await ut(`/apps/${s}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},i);if(!r.ok&&r.status!==404)throw new Error(`delete session failed: ${r.status}`)}function Gte(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),s=window.atob(n),i=new Uint8Array(s.length);for(let r=0;rURL.revokeObjectURL(l),0)}async function m8(e,t,n,s,i){const{app:r,ep:a}=si(e),l=i==null?"":`?version=${encodeURIComponent(i)}`,c=`/apps/${encodeURIComponent(r)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(s)}${l}`,u=await ut(c,{},a,_g);if(!u.ok)throw new Error(await Kt(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=Gte(f.data),m=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([m],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??s}}async function p8(e,t,n,s,i){const{blob:r}=await m8(e,t,n,s,i);return URL.createObjectURL(r)}async function Kte(e){const t=await ut("/web/media/capabilities");if(!t.ok)throw new Error(await Kt(t,"media capabilities failed"));return t.json()}async function g8(e,t,n,s){const{app:i}=si(e),r=new FormData;r.set("app_name",i),r.set("user_id",t),r.set("session_id",n),r.set("file",s);const a=await ut("/web/media",{method:"POST",body:r},{},_g);if(!a.ok)throw new Error(await Kt(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function PS(e,t,n){const{app:s}=si(e),i=`/web/media/${encodeURIComponent(s)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,r=await ut(i,{method:"POST"});if(!r.ok&&r.status!==404)throw new Error(await Kt(r,"media cleanup failed"))}function b8(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((s,i)=>![1,3,5].includes(i)).join("/")}`}catch{return}}async function Xb(e,t){const n=b8(t);if(!n)throw new Error("Invalid VeADK media URI");const s=await ut(`${n}/delete`,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await Kt(s,"media cleanup failed"))}function y8(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=b8(t);if(!n)return t;const s=`${n}/content`;return Rn(`${qb}${s}`)}async function o1(e,t,n){const{app:s,ep:i}=si(e);let r;if(i.runtimeId){const c=new URLSearchParams({runtimeId:i.runtimeId,sessionId:t,region:i.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),r=await ut(`/web/runtime-trace?${c.toString()}`),r.status===404)throw new Error("该 Agent 暂未开启链路观测,请到控制台打开后使用。")}else r=await ut(`/dev/apps/${encodeURIComponent(s)}/debug/trace/session/${encodeURIComponent(t)}`,{},i);if(!r.ok)throw new Error(await Kt(r,"加载调用链路失败"));const a=r.headers.get("content-type")??"";if(!a.includes("application/json")){const c=a.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${c}),请检查 Studio API 代理配置`)}const l=await r.json();if(!Array.isArray(l))throw new Error("trace failed: 返回格式无效");return l}async function BS(e){const t=await ut("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Kt(t,"问题反馈上报失败"));if((await t.json()).submitted!==!0)throw new Error("问题反馈上报失败:服务端未确认提交结果");return{submitted:!0}}function l2(e){const t=n=>({id:String(n.id??""),kind:n.kind==="skill"?"skill":"tool",name:String(n.name??""),custom:n.custom===!0,description:typeof n.description=="string"?n.description:void 0,skillSourceId:typeof n.skill_source_id=="string"?n.skill_source_id:void 0,version:typeof n.version=="string"?n.version:void 0});return{schemaVersion:Number(e.schema_version??1),revision:Number(e.revision??0),tools:Array.isArray(e.tools)?e.tools.map(n=>t(n)):[],skills:Array.isArray(e.skills)?e.skills.map(n=>t(n)):[]}}function c2(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function US(e,t,n){const{app:s,ep:i}=si(e),r=await ut(c2(s,t,n),{},i);if(!r.ok)throw new Error(await Kt(r,"读取会话能力失败"));return l2(await r.json())}async function u2(e){const{ep:t}=si(e),n=await ut("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await Kt(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(i=>{var r;return((r=i.name)==null?void 0:r.trim())??""}).filter(Boolean)}async function qte(e){const{ep:t}=si(e),n=await ut("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await Kt(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function Yte(e,t,n){const{ep:s}=si(e),i=new URLSearchParams({region:n||"cn-beijing"}),r=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${i.toString()}`,a=await ut(r,{},s);if(!a.ok)throw new Error(await Kt(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function x8(e,t,n=1,s=20){const{ep:i}=si(e),r=new URLSearchParams({query:t,page_number:String(n),page_size:String(s)}),a=await ut(`/harness/skills/findskill?${r.toString()}`,{},i);if(!a.ok)throw new Error(await Kt(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function FS(e,t,n,s,i){const{app:r,ep:a}=si(e),l=await ut(c2(r,t,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:s.kind,name:s.name,skill_source_id:s.skillSourceId,description:s.description,version:s.version,expected_revision:i})},a);if(!l.ok)throw new Error(await Kt(l,"添加会话能力失败"));return l2(await l.json())}async function E8(e,t,n,s,i){const{app:r,ep:a}=si(e),l=`${c2(r,t,n)}/${encodeURIComponent(s)}?expected_revision=${i}`,c=await ut(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await Kt(c,"移除会话能力失败"));return l2(await c.json())}async function v8(e,t,n=!0){const s=await ut(`/web/agent-info/${e}`,{},t);if(!s.ok)throw new Error(`agent-info failed: ${s.status}`);const i=await s.json();if(n&&!i.draft)try{const r=await ut(`/web/agent-draft/${e}`,{},t);if(r.ok){const a=await r.json();i.draft=a.draft}}catch{}return{appName:e,name:i.name??e,description:i.description??"",type:i.type,model:i.model??"",tools:i.tools??[],skillsPreviewSupported:Array.isArray(i.skills),skills:i.skills??[],subAgents:i.subAgents??[],components:i.components??[],searchSources:i.searchSources??[],graph:i.graph,draft:i.draft}}async function d2(e){const{app:t,ep:n}=si(e);return v8(t,n,!1)}async function Wte(e,t,n){let s=null;for(const i of ah(t)){const r={runtimeId:e,region:i};try{const a=i8(e,i),l=Yb.get(a);l&&l.expiresAt<=Date.now()&&Yb.delete(a);const c=Yb.get(a),u=n||(c==null?void 0:c.apps[0])||(await _x("","",r))[0];if(!u)throw new Error("该 Runtime 未提供可预览的 Agent。");return v8(u,r)}catch(a){if(a instanceof rh||a instanceof Ir&&!a.unsupported)throw a;s=a instanceof Error?a:new Error(String(a))}}throw s??new Error("该 Runtime 未提供可预览的 Agent。")}async function l1(e,t,n={},s={}){const i=typeof n=="string"?n:void 0,r=typeof n=="string"?s:n,a=oh(e,t||"cn-beijing",i??""),l=lh(Lc,a,wx);if(!r.force&&l)return l;const c=Lc.get(a);if(!r.force&&(c!=null&&c.promise))return c.promise;const u=Wte(e,t,i).then(d=>a2(Lc,a,d));Lc.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=Lc.get(a);(d==null?void 0:d.promise)===u&&Lc.set(a,{value:d.value,updatedAt:d.updatedAt})}}function w8(e,t,n=""){return lh(Lc,oh(e,t||"cn-beijing",n),wx)}function _8(e,t,n=""){l1(e,t,n).catch(()=>{})}async function S8(e,t,n,s){const{app:i,ep:r}=si(e),a=new URLSearchParams({source:t,app_name:i,q:n,user_id:s}),l=await ut(`/web/search?${a.toString()}`,{},r);if(!l.ok)throw new Error(await Kt(l,"Agent 检索失败"));return l.json()}async function N8(e,t){const{app:n}=si(e),s=await ut(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!s.ok)throw new Error(`web search failed: ${s.status}`);return s.json()}async function*Mp({appName:e,userId:t,sessionId:n,text:s,attachments:i=[],invocation:r,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=si(e),f=i.flatMap(b=>b.status&&b.status!=="ready"?[]:b.uri?[{fileData:{mimeType:b.mimeType,fileUri:b.uri,displayName:b.name},partMetadata:{veadkMedia:{id:b.id,uri:b.uri,name:b.name,mimeType:b.mimeType,sizeBytes:b.sizeBytes}}}]:b.data?[{inlineData:{mimeType:b.mimeType,data:b.data,displayName:b.name}}]:[]),h=r&&(r.skills.length>0||r.targetAgent)?r:void 0,m=[...f,...a.map(b=>({functionResponse:{id:b.id,name:b.name,response:b.response}})),...s.trim()?[{text:s}]:[]];if(h&&m.length>0){const b=m[0],v=b.partMetadata;m[0]={...b,partMetadata:{...v,veadkInvocation:h}}}const p=await ut(c?"/harness/run_sse":"/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:u,user_id:t,session_id:n,new_message:{role:"user",parts:m},streaming:!0,custom_metadata:h?{veadkInvocation:h}:void 0}),signal:l},d,0);if(!p.ok){const b=await Kt(p,"运行会话失败");throw new Error(V0(`run_sse failed: ${p.status}:${b}`))}for await(const b of Zk(p)){const v=b;typeof v.error=="string"&&(v.error=V0(v.error)),typeof v.errorMessage=="string"&&(v.errorMessage=V0(v.errorMessage)),typeof v.error_message=="string"&&(v.error_message=V0(v.error_message)),yield v}}async function T8(e){const t=await ut("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await Kt(t,"加载用户池失败"));const n=await t.json();if(!Array.isArray(n.items))throw new Error("用户池列表响应格式无效");return n.items.map(s=>{if(!s||typeof s!="object"||typeof s.uid!="string"||typeof s.name!="string"||typeof s.domain!="string"||typeof s.region!="string"||typeof s.isCurrent!="boolean")throw new Error("用户池列表响应格式无效");return s})}const Qm=new Map;async function Sg(e,t,n,s){var u,d,f;const i=s==null?void 0:s.taskId,r=i?new AbortController:void 0;i&&r&&Qm.set(i,r);const a=()=>{i&&Qm.get(i)===r&&Qm.delete(i)};let l;try{(u=s==null?void 0:s.onStage)==null||u.call(s,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=await ut("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:r==null?void 0:r.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:i,runtimeId:s==null?void 0:s.runtimeId,appName:s==null?void 0:s.appName,sessionStorage:s==null?void 0:s.sessionStorage,minInstance:s==null?void 0:s.minInstance,maxInstance:s==null?void 0:s.maxInstance,createEvaluationSets:s==null?void 0:s.createEvaluationSets,description:Mte((s==null?void 0:s.description)??""),authentication:s==null?void 0:s.authentication,im:s==null?void 0:s.im,envs:s==null?void 0:s.envs})},{},0),(d=s==null?void 0:s.onStage)==null||d.call(s,{level:"success",phase:"upload",message:"代码包上传完成",pct:100})}catch(h){throw a(),h}if(!l.ok){const h=await Kt(l,"部署失败");throw a(),new Error(h)}let c=null;try{for await(const h of Zk(l)){const m=h;if(m&&m.done){c=m;break}m&&m.message&&((f=s==null?void 0:s.onStage)==null||f.call(s,m))}}catch(h){throw a(),h}if(a(),!c)throw new Error("部署失败:连接中断");if(!c.success)throw new Error(c.error||"部署失败");if(!c.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!c.runtimeId&&!c.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:c.apikey??"",url:c.url??"",agentName:c.agentName,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,warnings:c.warnings,feishuChannel:c.feishuChannel}}async function k8(e){var n;const t=await ut("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const s=await t.text().catch(()=>"");throw new Error(s||`取消部署失败 (${t.status})`)}(n=Qm.get(e))==null||n.abort(),Qm.delete(e)}async function Xte(e=Jk){const t=await ut(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Lp={title:"AgentKit Studio",logoUrl:""},Qb={enabled:!1},Qv={studio:!1,version:"",provider:"volcengine",branding:Lp,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Qb};function Qte(e){if(!e||typeof e!="object")return Qb;const t=e;if(!t.enabled)return Qb;const n=t.apmplus;if(!n||typeof n.aid!="number"||!Number.isFinite(n.aid)||typeof n.token!="string"||!n.token)return Qb;const s=t.studio??{};return{enabled:!0,provider:t.provider==="apmplus"?"apmplus":void 0,apmplus:{aid:n.aid,token:n.token,domain:typeof n.domain=="string"&&n.domain?n.domain:"apmplus.volces.com",env:typeof n.env=="string"&&n.env?n.env:"production"},studio:{deployId:typeof s.deployId=="string"?s.deployId:"",userPoolId:typeof s.userPoolId=="string"?s.userPoolId:"",applicationId:typeof s.applicationId=="string"?s.applicationId:"",functionId:typeof s.functionId=="string"?s.functionId:"",region:typeof s.region=="string"?s.region:"",project:typeof s.project=="string"?s.project:"",version:typeof s.version=="string"?s.version:""}}}async function A8(){var e,t;try{const n=await ut("/web/ui-config");if(!n.ok)return Qv;const s=await n.json(),i=typeof((e=s.branding)==null?void 0:e.logoUrl)=="string"?s.branding.logoUrl:Lp.logoUrl;return{studio:s.studio??!1,version:typeof s.version=="string"?s.version:"",provider:s.provider==="byteplus"?"byteplus":"volcengine",branding:{title:typeof((t=s.branding)==null?void 0:t.title)=="string"?s.branding.title:Lp.title,logoUrl:i?Rn(i):""},features:{...Qv.features,...s.features??{}},defaultView:s.defaultView??"chat",agentsSource:s.agentsSource==="cloud"?"cloud":"local",telemetry:Qte(s.telemetry)}}catch{return Qv}}const C8={role:"user",telemetry:{userId:""},capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function I8(){var n,s,i,r;const e=await ut("/web/access");if(!e.ok)throw new Error(`加载权限失败 (${e.status})`);const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||typeof((s=t.capabilities)==null?void 0:s.createAgents)!="boolean"||typeof((i=t.capabilities)==null?void 0:i.manageAgents)!="boolean"||!["all","mine"].includes((r=t.capabilities)==null?void 0:r.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function j8(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const s=n.size?`?${n.toString()}`:"",i=await ut(`/web/studio-update${s}`);if(!i.ok)throw new Error(`检查 Studio 更新失败 (${i.status})`);return await i.json()}async function R8(e){const t=await ut("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},_g);if(!t.ok){let n="";try{const s=await t.json();n=typeof s.detail=="string"?s.detail:""}catch{n=""}throw new Error(n||`提交 Studio 更新失败 (${t.status})`)}return await t.json()}async function Nx(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await ut(`/web/runtimes?${t.toString()}`);if(!n.ok){const i=await Kt(n,"加载 Runtime 失败"),r=`加载 Runtime 失败(HTTP ${n.status})`;throw new Error(i===`加载 Runtime 失败 (${n.status})`?r:`${r}:${i}`)}const s=await n.json();return{runtimes:s.runtimes??[],nextToken:s.nextToken??""}}async function f2(e,t,n={}){try{const s={runtimeId:e,region:t};return n.retryProbe&&(s.retryProbe=!0),await _x("","",s)}catch(s){if(s instanceof rh||s instanceof Ir)throw s;return null}}async function O8(e,t,n={}){const s={runtimeId:e,region:t};n.retryProbe&&(s.retryProbe=!0);const i=await ut("/.well-known/agent-card.json",{},s),r=await r8(i);if(r==="runtime_access_denied")throw new rh;if(r==="runtime_private_endpoint_unreachable")throw new Ir(t8);if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(r))throw new Ir(n8);if(i.status===404)return null;if(i.status===401||i.status===403)throw new Ir("Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。");if(!i.ok)throw new Error(await Kt(i,"读取 A2A Agent Card 失败"));const a=await i.json().catch(()=>null),l=typeof(a==null?void 0:a.url)=="string"?a.url.trim():"";return l?{name:typeof(a==null?void 0:a.name)=="string"?a.name:"",description:typeof(a==null?void 0:a.description)=="string"?a.description:"",endpoint:l}:null}async function M8(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),s=await ut(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!s.ok)throw new Error(await Kt(s,"读取 Runtime API Key 失败"));const i=await s.json();if(typeof i.apiKey!="string"||!i.apiKey)throw new Error("Runtime 未返回可用的 API Key");return i.apiKey}async function L8(e,t){const n=await ut("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(s||`删除失败 (${n.status})`)}}async function D8({runtimeId:e,region:t,signal:n}){const s=new URLSearchParams({runtimeId:e,region:t}),i=await ut(`/web/runtime-update-capability?${s.toString()}`,{signal:n});if(!i.ok)throw new Error(await Kt(i,"检查 Runtime 更新能力失败"));return await i.json()}async function Zte(e,t){let n=null;for(const s of ah(t)){const i=await ut(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(s)}`);if(i.ok)return i.json();n=new Error(await Kt(i,"加载 Runtime 详情失败"))}throw n??new Error("加载 Runtime 详情失败")}async function h2(e,t="cn-beijing",n={}){const s=oh(e,t||"cn-beijing"),i=lh(Dc,s,wx);if(!n.force&&i)return i;const r=Dc.get(s);if(!n.force&&(r!=null&&r.promise))return r.promise;const a=Zte(e,t).then(l=>a2(Dc,s,l));Dc.set(s,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=Dc.get(s);(l==null?void 0:l.promise)===a&&Dc.set(s,{value:l.value,updatedAt:l.updatedAt})}}function P8(e,t="cn-beijing"){return lh(Dc,oh(e,t||"cn-beijing"),wx)}function B8(e,t="cn-beijing"){h2(e,t).catch(()=>{})}async function Tx(e){const t=await ut("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Kt(t,"生成项目失败"));return t.json()}const Jte=19e4;async function U8(e){const t=await ut("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Jte);if(!t.ok)throw new Error(await Kt(t,"生成 Agent 配置失败"));return Ex(t,"生成 Agent 配置失败")}async function F8(e,t){const n=await ut("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region})});if(!n.ok)throw new Error(await Kt(n,"创建调试运行失败"));return Ex(n,"创建调试运行失败")}async function $8(e,t){const n=await ut(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await Kt(n,"创建调试会话失败"));return(await Ex(n,"创建调试会话失败")).id}async function H8(e,t){const n=await ut(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Kt(n,"加载调试调用链路失败"));const s=await Ex(n,"加载调试调用链路失败");if(!Array.isArray(s))throw new Error("加载调试调用链路失败:返回格式无效");return s}async function*z8({runId:e,userId:t,sessionId:n,text:s,signal:i}){const r=s.trim()?[{text:s}]:[],a=await ut(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:r},streaming:!0}),signal:i},{},0);if(!a.ok)throw new Error(await Kt(a,"调试运行失败"));for await(const l of Zk(a))yield l}async function bd(e){const t=await ut(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Kt(t,"清理调试运行失败"))}const ene=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Lp,DEFAULT_STUDIO_ACCESS:C8,RuntimeAccessDeniedError:rh,RuntimeProbeError:Ir,addSessionCapability:FS,cancelAgentkitDeployment:k8,clearMessageFeedbackCache:XB,clearRemoteApps:ZB,componentSearch:S8,createGeneratedAgentTestRun:F8,createGeneratedAgentTestSession:$8,createSession:r1,deleteAgentFeedbackCases:f8,deleteGeneratedAgentTestRun:bd,deleteMedia:Xb,deleteRuntime:L8,deleteSession:DS,deleteSessionMedia:PS,deployAgentkitProject:Sg,downloadArtifact:h8,fetchRemoteApps:_x,generateAgentDraftFromRequirement:U8,generateAgentProject:Tx,getAgentFeedbackCases:Sx,getAgentInfo:d2,getAgentOptimizations:l8,getAutomaticEvaluationStatuses:o8,getCachedAgentFeedbackCases:c8,getCachedRuntimeAgentInfo:w8,getCachedRuntimeDetail:P8,getGeneratedAgentTestTrace:H8,getMediaCapabilities:Kte,getMyRuntimes:Xte,getRuntimeAgentInfo:l1,getRuntimeDetail:h2,getRuntimeUpdateCapability:D8,getRuntimes:Nx,getSession:a1,getSessionCapabilities:US,getSessionTrace:o1,getStudioAccess:I8,getStudioUpdateStatus:j8,getUiConfig:A8,listApps:e8,listIdentityUserPools:T8,listSessionBuiltinTools:u2,listSessionSkillSpaces:qte,listSessionSkillsInSpace:Yte,listSessions:o2,mediaContentUrl:y8,prefetchAgentFeedbackCases:LS,prefetchRuntimeAgentInfo:_8,prefetchRuntimeDetail:B8,previewArtifact:p8,probeRuntimeA2a:O8,probeRuntimeApps:f2,refreshAgentFeedbackCases:u8,registerRemoteApp:QB,removeSessionCapability:E8,revealRuntimeApiKey:M8,runGeneratedAgentTestSSE:z8,runSSE:Mp,searchSessionPublicSkills:x8,startStudioUpdate:R8,studioFetch:JB,submitIssueFeedback:BS,submitMessageFeedback:a8,uploadMedia:g8,upsertCachedAgentFeedbackCase:Wb,webSearch:N8},Symbol.toStringTag,{value:"Module"}));function YR(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function tne(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function nne(e,t){if(!t)return e;const n=new Set(e.filter(i=>tne(i)===t).map(i=>i.trace_id)),s=e.filter(i=>n.has(i.trace_id));return s.length>0?s:e}function Zv(e){return!!(e&&[...e.tools,...e.skills].some(t=>t.custom))}const sne="send_a2ui_json_to_client",ine="validated_a2ui_json",$S="adk_request_credential",WR="transfer_to_agent";function rne(e){var s,i,r,a;const t=e,n=((s=t==null?void 0:t.exchangedAuthCredential)==null?void 0:s.oauth2)??((i=t==null?void 0:t.exchanged_auth_credential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.rawAuthCredential)==null?void 0:r.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function Aa(){return{blocks:[],liveStart:0}}const XR=e=>e.functionCall??e.function_call,HS=e=>e.functionResponse??e.function_response;function ane(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function one(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function V8(e){const t=[];for(const[n,s]of e.entries()){const i=s.partMetadata??s.part_metadata,r=i==null?void 0:i.veadkTransport;if((r==null?void 0:r.hidden)===!0)continue;const a=i==null?void 0:i.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const l=s.inlineData??s.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:one(l.data),name:l.displayName??l.display_name});continue}const c=s.fileData??s.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function zS(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const lne=new Set(["llm","sequential","parallel","loop","a2a"]);function cne(e){var t;for(const n of e){const s=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.skills)?i.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const l=i.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&lne.has(u)&&Array.isArray(c.path)&&(a={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(r.length>0||a)return{skills:r,targetAgent:a}}}function une(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function dne(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const s of t)n.files.some(i=>i.filename===s.filename&&i.version===s.version)||n.files.push(s);return}e.push({kind:"artifact",files:t})}function QR(e,t,n){const s=e[e.length-1];s&&s.kind===t?s.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function G0(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Af(e,t){var l,c,u,d,f,h;const n=e.blocks.map(m=>({...m}));let s=e.liveStart;const i=((l=t.content)==null?void 0:l.parts)??[],r=i.some(m=>XR(m)||HS(m));if(t.partial&&!r){for(const m of i){const p=zS(m);typeof p=="string"&&p&&QR(n,m.thought?"thinking":"text",p)}return{blocks:n,liveStart:s}}n.length=s;for(const m of i){const p=XR(m),b=HS(m),v=V8([m]),y=zS(m);if(typeof y=="string"&&y)QR(n,m.thought?"thinking":"text",y);else if(v.length)G0(n),une(n,v);else if(p)if(G0(n),p.name===WR){const x=ane(p.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:x,done:!1})}else if(p.name===$S){const x=p.args??{},E=x.authConfig??x.auth_config??x,S=String(x.functionCallId??x.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:p.id??"",label:S,authUri:rne(E),authConfig:E,done:!1})}else n.push({kind:"tool",name:p.name??"",args:p.args,done:!1});else if(b){if(G0(n),b.name===WR)for(let x=n.length-1;x>=0;x--){const E=n[x];if(E.kind==="agent-transfer"&&!E.done){E.done=!0;break}}if(b.name===$S)for(let x=n.length-1;x>=0;x--){const E=n[x];if(E.kind==="auth"&&!E.done){E.done=!0;break}}for(let x=n.length-1;x>=0;x--){const E=n[x];if(E.kind==="tool"&&!E.done&&E.name===b.name){E.done=!0,E.response=b.response;break}}if(b.name===sne){const x=((d=b.response)==null?void 0:d[ine])??[];if(x.length){const E=n[n.length-1];E&&E.kind==="a2ui"?E.messages.push(...x):n.push({kind:"a2ui",messages:x})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&dne(n,Object.entries(a).map(([m,p])=>({filename:m,version:p}))),G0(n),s=n.length,{blocks:n,liveStart:s}}function fne(e,t={}){var i,r;const n=[];let s=Aa();for(const a of e)if(a.author==="user"){const c=((i=a.content)==null?void 0:i.parts)??[];if(c.some(m=>{var p;return((p=HS(m))==null?void 0:p.name)===$S})){for(let m=n.length-1;m>=0;m--)if(n[m].role==="assistant"){for(let p=n[m].blocks.length-1;p>=0;p--){const b=n[m].blocks[p];if(b.kind==="auth"){b.done=!0;break}}break}}const u=c.map(zS).filter(m=>!!m).join(""),d=V8(c),f=cne(c);if(!u&&!d.length&&!f){s=Aa();continue}const h=[];f&&h.push({kind:"invocation",value:f}),d.length&&h.push({kind:"attachment",files:d}),u&&h.push({kind:"text",text:u}),n.push({role:"user",blocks:h,meta:{ts:a.timestamp}}),s=Aa()}else{const c=a.author??"";let u=n[n.length-1];(!u||u.role!=="assistant"||c&&((r=u.meta)==null?void 0:r.author)!==c)&&(u={role:"assistant",blocks:[],meta:{author:c||void 0}},n.push(u),s=Aa()),s=Af(s,a),u.blocks=s.blocks;const d=a.usageMetadata??a.usage_metadata,f=u.meta??(u.meta={});c&&(f.author=c),d!=null&&d.totalTokenCount&&(f.tokens=d.totalTokenCount),a.timestamp&&(f.ts=a.timestamp),a.id&&(f.eventId=a.id);const h=a.invocationId??a.invocation_id;h&&(f.invocationId=h)}for(const a of n){const l=a.meta,c=l==null?void 0:l.eventId;if(!c)continue;const u=t[`veadk_feedback:${c}`];if(!u||typeof u!="object")continue;const d=u;d.rating!=="good"&&d.rating!=="bad"||(l.feedback=u)}return n}function hne(e){var t,n;for(const s of e??[])if(s.author==="user"||((t=s.content)==null?void 0:t.role)==="user"){const i=(((n=s.content)==null?void 0:n.parts)??[]).map(r=>r.text).find(Boolean);if(i)return i}return"新会话"}const mne=50,ZR=48;function pne(e){return(e.events??[]).flatMap(t=>{var i,r;const s=(((i=t.content)==null?void 0:i.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return s?[{text:s,role:t.author??((r=t.content)==null?void 0:r.role)??"",ts:t.timestamp}]:[]})}function gne(e){var t,n;for(const s of e.events??[])if(s.author==="user"||((t=s.content)==null?void 0:t.role)==="user"){const i=(((n=s.content)==null?void 0:n.parts)??[]).map(r=>r.text).find(Boolean);if(i)return i}return"未命名会话"}function bne(e,t,n){const s=Math.max(0,t-ZR),i=Math.min(e.length,t+n+ZR);return(s>0?"…":"")+e.slice(s,i).trim()+(i{var c;if((c=l.events)!=null&&c.length)return l;try{return await a1(t,e,l.id)}catch{return l}})),a=[];for(const l of r)for(const{text:c,role:u,ts:d}of pne(l)){const f=c.toLowerCase().indexOf(s);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:gne(l),snippet:bne(c,f,s.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,mne)}async function xne(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await N8(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:s,results:i,error:r}=n;return s?r?{results:[],note:r}:{results:i.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function Ene(e,t,n,s){if(!t||!s.trim())return{results:[]};const i=await S8(t,e,s.trim(),n);if(!i.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(i.error)return{results:[],note:i.error};const r=i.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:i.results.map((a,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:r,sourceType:i.sourceType}:{type:"memory",index:l,content:a.content,sourceName:r,sourceType:i.sourceType,author:a.author,ts:a.timestamp})}}async function vne(e,t,n){return e==="session"?{results:await yne(n.userId,n.appId,t)}:e==="web"?xne(n.appId,t):Ene(e,n.appId,n.userId,t)}function G8({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function wne({open:e}){return o.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function _ne({active:e=!1,onClick:t}){return o.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":"搜索","aria-current":e?"page":void 0,title:"搜索",children:[o.jsx(G8,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function Sne(e,t,n){const s=!!e,i=new Set((t==null?void 0:t.searchSources)??[]),r=a=>s?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:s,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:s&&i.has("web"),description:"通过 web_search 工具检索",unavailableLabel:r(" web_search 工具")},{id:"knowledge",label:"知识库",ready:s&&i.has("knowledge"),unavailableLabel:r("知识库")},{id:"memory",label:"长期记忆",ready:s&&i.has("memory"),unavailableLabel:r("长期记忆")}]}function c1(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function JR(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function Nne({userId:e,appId:t,agentInfo:n,capabilitiesLoading:s,agentLabel:i,onOpenSession:r}){var F,C;const[a,l]=g.useState("session"),[c,u]=g.useState(""),[d,f]=g.useState([]),[h,m]=g.useState(),[p,b]=g.useState(!1),[v,y]=g.useState(!1),[x,E]=g.useState(!1),w=g.useRef(0),S=g.useRef(null),_=Sne(t,n,s),k=_.find(I=>I.id===a),T=a==="knowledge"?(F=n==null?void 0:n.components)==null?void 0:F.find(I=>I.source==="knowledgebase"||I.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(I=>I.source==="long_term_memory"||I.kind==="memory"):void 0;g.useEffect(()=>{w.current+=1,l("session"),f([]),m(void 0),y(!1),b(!1),E(!1)},[t]),g.useEffect(()=>{if(!x)return;function I(D){var $;($=S.current)!=null&&$.contains(D.target)||E(!1)}return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[x]);async function A(I,D){var ne;const $=I.trim();if(!$||!((ne=_.find(P=>P.id===D))!=null&&ne.ready))return;const O=++w.current;b(!0),y(!0);let te;try{te=await vne(D,$,{userId:e,appId:t})}catch(P){const Q=P instanceof Error?P.message:String(P);te={results:[],note:`搜索失败:${Q}`}}O===w.current&&(f(te.results),m(te.note),b(!1))}function j(I){w.current+=1,u(I),f([]),m(void 0),y(!1),b(!1)}function R(I){w.current+=1,l(I),E(!1),f([]),m(void 0),y(!1),b(!1)}const B=!!(k!=null&&k.ready),z=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(T==null?void 0:T.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(T==null?void 0:T.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",L=T!=null&&T.backend?c1(T.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:S,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(k==null?void 0:k.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":x,onClick:()=>E(I=>!I),children:[o.jsx("span",{children:(k==null?void 0:k.label)??"搜索类型"}),L&&o.jsx("small",{children:L}),o.jsx(wne,{open:x})]}),x&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:_.map(I=>{var O,te;const D=I.id==="knowledge"?(O=n==null?void 0:n.components)==null?void 0:O.find(ne=>ne.source==="knowledgebase"||ne.kind==="knowledgebase"):I.id==="memory"?(te=n==null?void 0:n.components)==null?void 0:te.find(ne=>ne.source==="long_term_memory"||ne.kind==="memory"):void 0,$=D?[D.name,D.backend?c1(D.backend):""].filter(Boolean).join(" · "):I.ready?I.description:I.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===I.id,disabled:!I.ready,onClick:()=>R(I.id),children:[o.jsx("span",{children:I.label}),$&&o.jsx("small",{children:$})]},I.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:I=>j(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),A(c,a))},placeholder:z,disabled:!B,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void A(c,a),disabled:!c.trim()||p,"aria-label":"搜索",children:p?o.jsx(bn,{className:"icon spin"}):o.jsx(G8,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:B?v?p?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&v?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((I,D)=>o.jsx(Tne,{result:I,agentLabel:i,onOpen:r},D)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?s?"正在读取当前 Agent 的检索能力…":(k==null?void 0:k.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function Tne({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(HB,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${JR(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(yx,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(Op,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(eO,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${c1(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(eO,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${c1(e.sourceType)}`:"",e.ts?` · ${JR(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function eO({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function tu({className:e="icon"}){return o.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function kne({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function Ane({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function K8(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),o.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),o.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),o.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),o.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const m2="/assets/logo-DCsNZy-k.svg",p2="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e",tO="(max-width: 860px)";function Cne(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function Ine(e){let t=2166136261;for(const s of e)t^=s.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const jne={admin:"管理员",developer:"开发者",user:"普通用户"};function nO({role:e}){const t=jne[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function Rne({version:e,onClose:t}){return g.useEffect(()=>{const n=s=>{s.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),yi.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(Ri,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function One({access:e,userInfo:t,version:n,onLogout:s}){const[i,r]=g.useState(!1),[a,l]=g.useState(!1),[c,u]=g.useState("");if(!t)return null;const d=wte(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),m=Ine(d||f||h),p=_te(t),b=p===c?"":p;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>r(v=>!v),title:f?`${d} -${f}`:d,children:[o.jsxs("span",{className:`account-avatar${b?" has-image":""}`,style:m,children:[h,b?o.jsx("img",{className:"account-avatar-image",src:b,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(b)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(nO,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>r(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${b?" has-image":""}`,style:m,children:[h,b?o.jsx("img",{className:"account-avatar-image",src:b,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(b)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(nO,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{r(!1),l(!0)},children:[o.jsx(mc,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{r(!1),s()},children:[o.jsx(qee,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(Rne,{version:n,onClose:()=>l(!1)}):null]})}function Mne({branding:e,cloudProvider:t,sessions:n,currentSessionId:s,activePage:i,features:r,access:a,streamingSids:l,evaluatingSids:c,onNewChat:u,onSearch:d,onQuickCreate:f,onSkillCenter:h,onAddAgent:m,onMyAgents:p,onApplications:b,onIssueFeedback:v,onPickSession:y,onDeleteSession:x,userInfo:E,version:w,onLogout:S}){const _=F=>(r==null?void 0:r[F])!==!1,[k,T]=g.useState(null),A=g.useRef(typeof window<"u"&&window.matchMedia(tO).matches),[j,R]=g.useState(A.current),B=[...n].sort((F,C)=>(C.lastUpdateTime??0)-(F.lastUpdateTime??0)),z=()=>{A.current=!1,R(F=>!F),T(null)};g.useEffect(()=>{const F=window.matchMedia(tO),C=I=>{I.matches?R(D=>D||(A.current=!0,!0)):A.current&&(A.current=!1,R(!1))};return F.addEventListener("change",C),()=>F.removeEventListener("change",C)},[]);const L=t==="byteplus"?p2:m2;return o.jsxs("aside",{className:`sidebar ${j?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:u,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||L,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:z,"aria-label":j?"展开侧边栏":"收起侧边栏",title:j?"展开侧边栏":"收起侧边栏",children:j?o.jsx(tte,{className:"icon"}):o.jsx(ete,{className:"icon"})})]}),_("newChat")&&o.jsxs("button",{className:`new-chat new-chat--conversation${i==="new-chat"?" is-active":""}`,onClick:u,"aria-label":"新会话","aria-current":i==="new-chat"?"page":void 0,title:"新会话",children:[o.jsx(Ii,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:`new-chat new-chat--agents${i==="agents"?" is-active":""}`,onClick:p,"aria-label":"智能体","aria-current":i==="agents"?"page":void 0,title:"智能体",children:[o.jsx(tu,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),_("search")&&o.jsx(_ne,{active:i==="search",onClick:d}),o.jsxs("button",{className:`new-chat new-chat--applications${i==="applications"?" is-active":""}`,onClick:b,"aria-label":"自动化","aria-current":i==="applications"?"page":void 0,title:"自动化",children:[o.jsx(Cne,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"自动化"}),o.jsx("span",{className:"sidebar-beta-badge",children:"Beta"})]})]}),_("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),_("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:u,"aria-label":"新建会话",title:"新建会话",children:o.jsx(Ii,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[B.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),B.map(F=>{const C=hne(F.events),I=(l==null?void 0:l.has(F.id))===!0,D=!I&&(c==null?void 0:c.has(F.id))===!0;return o.jsxs("div",{className:`history-item ${F.id===s?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>y(F.id),"aria-current":F.id===s?"page":void 0,title:C,children:[I&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:C}),D&&o.jsxs("span",{className:"history-evaluating-status",title:"正在自动评测",children:[o.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),"评测中"]})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>T($=>$===F.id?null:F.id),children:o.jsx(Ree,{className:"icon"})}),k===F.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>T(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{T(null),x(F.id)},children:[o.jsx(lc,{className:"icon"})," 删除"]})})]})]},F.id)})]})]}),o.jsxs("div",{className:"sidebar-footer",children:[o.jsxs("button",{type:"button",className:`sidebar-feedback${i==="feedback"?" is-active":""}`,onClick:v,"aria-label":"问题反馈","aria-current":i==="feedback"?"page":void 0,title:"问题反馈",children:[o.jsx(K8,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"问题反馈"})]}),o.jsx(One,{access:a,userInfo:E,version:w,onLogout:S})]})]})}function ii(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n{}};function kx(){for(var e=0,t=arguments.length,n={},s;e=0&&(s=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Zb.prototype=kx.prototype={constructor:Zb,on:function(e,t){var n=this._,s=Dne(e+"",n),i,r=-1,a=s.length;if(arguments.length<2){for(;++r0)for(var n=new Array(i),s=0,i,r;s=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),iO.hasOwnProperty(t)?{space:iO[t],local:e}:e}function Bne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===VS&&t.documentElement.namespaceURI===VS?t.createElement(e):t.createElementNS(n,e)}}function Une(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function q8(e){var t=Ax(e);return(t.local?Une:Bne)(t)}function Fne(){}function g2(e){return e==null?Fne:function(){return this.querySelector(e)}}function $ne(e){typeof e!="function"&&(e=g2(e));for(var t=this._groups,n=t.length,s=new Array(n),i=0;i=E&&(E=x+1);!(S=v[E])&&++E=0;)(a=s[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function fse(e){e||(e=hse);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,s=n.length,i=new Array(s),r=0;rt?1:e>=t?0:NaN}function mse(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pse(){return Array.from(this)}function gse(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?kse:typeof t=="function"?Cse:Ase)(e,t,n??"")):Cf(this.node(),e)}function Cf(e,t){return e.style.getPropertyValue(t)||Z8(e).getComputedStyle(e,null).getPropertyValue(t)}function jse(e){return function(){delete this[e]}}function Rse(e,t){return function(){this[e]=t}}function Ose(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Mse(e,t){return arguments.length>1?this.each((t==null?jse:typeof t=="function"?Ose:Rse)(e,t)):this.node()[e]}function J8(e){return e.trim().split(/^|\s+/)}function b2(e){return e.classList||new e9(e)}function e9(e){this._node=e,this._names=J8(e.getAttribute("class")||"")}e9.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function t9(e,t){for(var n=b2(e),s=-1,i=t.length;++s=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function lie(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,i=t.length,r;n()=>e;function GS(e,{sourceEvent:t,subject:n,target:s,identifier:i,active:r,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}GS.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yie(e){return!e.ctrlKey&&!e.button}function xie(){return this.parentNode}function Eie(e,t){return t??{x:e.x,y:e.y}}function vie(){return navigator.maxTouchPoints||"ontouchstart"in this}function o9(){var e=yie,t=xie,n=Eie,s=vie,i={},r=kx("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",m).filter(s).on("touchstart.drag",v).on("touchmove.drag",y,bie).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(w,S){if(!(d||!e.call(this,w,S))){var _=E(this,t.call(this,w,S),w,S,"mouse");_&&(Ar(w.view).on("mousemove.drag",p,Dp).on("mouseup.drag",b,Dp),r9(w.view),Jv(w),u=!1,l=w.clientX,c=w.clientY,_("start",w))}}function p(w){if(rf(w),!u){var S=w.clientX-l,_=w.clientY-c;u=S*S+_*_>f}i.mouse("drag",w)}function b(w){Ar(w.view).on("mousemove.drag mouseup.drag",null),a9(w.view,u),rf(w),i.mouse("end",w)}function v(w,S){if(e.call(this,w,S)){var _=w.changedTouches,k=t.call(this,w,S),T=_.length,A,j;for(A=0;A>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?q0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?q0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_ie.exec(e))?new fr(t[1],t[2],t[3],1):(t=Sie.exec(e))?new fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nie.exec(e))?q0(t[1],t[2],t[3],t[4]):(t=Tie.exec(e))?q0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=kie.exec(e))?dO(t[1],t[2]/100,t[3]/100,1):(t=Aie.exec(e))?dO(t[1],t[2]/100,t[3]/100,t[4]):rO.hasOwnProperty(e)?lO(rO[e]):e==="transparent"?new fr(NaN,NaN,NaN,0):null}function lO(e){return new fr(e>>16&255,e>>8&255,e&255,1)}function q0(e,t,n,s){return s<=0&&(e=t=n=NaN),new fr(e,t,n,s)}function jie(e){return e instanceof Tg||(e=mu(e)),e?(e=e.rgb(),new fr(e.r,e.g,e.b,e.opacity)):new fr}function KS(e,t,n,s){return arguments.length===1?jie(e):new fr(e,t,n,s??1)}function fr(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}y2(fr,KS,l9(Tg,{brighter(e){return e=e==null?d1:Math.pow(d1,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pp:Math.pow(Pp,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fr(nu(this.r),nu(this.g),nu(this.b),f1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cO,formatHex:cO,formatHex8:Rie,formatRgb:uO,toString:uO}));function cO(){return`#${zc(this.r)}${zc(this.g)}${zc(this.b)}`}function Rie(){return`#${zc(this.r)}${zc(this.g)}${zc(this.b)}${zc((isNaN(this.opacity)?1:this.opacity)*255)}`}function uO(){const e=f1(this.opacity);return`${e===1?"rgb(":"rgba("}${nu(this.r)}, ${nu(this.g)}, ${nu(this.b)}${e===1?")":`, ${e})`}`}function f1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zc(e){return e=nu(e),(e<16?"0":"")+e.toString(16)}function dO(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ka(e,t,n,s)}function c9(e){if(e instanceof ka)return new ka(e.h,e.s,e.l,e.opacity);if(e instanceof Tg||(e=mu(e)),!e)return new ka;if(e instanceof ka)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,i=Math.min(t,n,s),r=Math.max(t,n,s),a=NaN,l=r-i,c=(r+i)/2;return l?(t===r?a=(n-s)/l+(n0&&c<1?0:a,new ka(a,l,c,e.opacity)}function Oie(e,t,n,s){return arguments.length===1?c9(e):new ka(e,t,n,s??1)}function ka(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}y2(ka,Oie,l9(Tg,{brighter(e){return e=e==null?d1:Math.pow(d1,e),new ka(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pp:Math.pow(Pp,e),new ka(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,i=2*n-s;return new fr(ew(e>=240?e-240:e+120,i,s),ew(e,i,s),ew(e<120?e+240:e-120,i,s),this.opacity)},clamp(){return new ka(fO(this.h),Y0(this.s),Y0(this.l),f1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=f1(this.opacity);return`${e===1?"hsl(":"hsla("}${fO(this.h)}, ${Y0(this.s)*100}%, ${Y0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fO(e){return e=(e||0)%360,e<0?e+360:e}function Y0(e){return Math.max(0,Math.min(1,e||0))}function ew(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const x2=e=>()=>e;function Mie(e,t){return function(n){return e+n*t}}function Lie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function Die(e){return(e=+e)==1?u9:function(t,n){return n-t?Lie(t,n,e):x2(isNaN(t)?n:t)}}function u9(e,t){var n=t-e;return n?Mie(e,n):x2(isNaN(e)?t:e)}const h1=function e(t){var n=Die(t);function s(i,r){var a=n((i=KS(i)).r,(r=KS(r)).r),l=n(i.g,r.g),c=n(i.b,r.b),u=u9(i.opacity,r.opacity);return function(d){return i.r=a(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return s.gamma=e,s}(1);function Pie(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),i;return function(r){for(i=0;in&&(r=t.slice(n,r),l[a]?l[a]+=r:l[++a]=r),(s=s[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,c.push({i:a,x:Xa(s,i)})),n=tw.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,s)-2,x:Xa(u,d)})):d&&f.push(i(f)+"rotate("+d+s)}function l(u,d,f,h){u!==d?h.push({i:f.push(i(f)+"skewX(",null,s)-2,x:Xa(u,d)}):d&&f.push(i(f)+"skewX("+d+s)}function c(u,d,f,h,m,p){if(u!==f||d!==h){var b=m.push(i(m)+"scale(",null,",",null,")");p.push({i:b-4,x:Xa(u,f)},{i:b-2,x:Xa(d,h)})}else(f!==1||h!==1)&&m.push(i(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),r(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var p=-1,b=h.length,v;++p=0&&e._call.call(void 0,t),e=e._next;--If}function pO(){pu=(p1=Up.now())+Cx,If=vm=0;try{Zie()}finally{If=0,ere(),pu=0}}function Jie(){var e=Up.now(),t=e-p1;t>m9&&(Cx-=t,p1=e)}function ere(){for(var e,t=m1,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:m1=n);wm=e,WS(s)}function WS(e){if(!If){vm&&(vm=clearTimeout(vm));var t=e-pu;t>24?(e<1/0&&(vm=setTimeout(pO,e-Up.now()-Cx)),Xh&&(Xh=clearInterval(Xh))):(Xh||(p1=Up.now(),Xh=setInterval(Jie,m9)),If=1,p9(pO))}}function gO(e,t,n){var s=new g1;return t=t==null?0:+t,s.restart(i=>{s.stop(),e(i+t)},t,n),s}var tre=kx("start","end","cancel","interrupt"),nre=[],b9=0,bO=1,XS=2,ey=3,yO=4,QS=5,ty=6;function Ix(e,t,n,s,i,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;sre(e,n,{name:t,index:s,group:i,on:tre,tween:nre,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:b9})}function v2(e,t){var n=Ba(e,t);if(n.state>b9)throw new Error("too late; already scheduled");return n}function uo(e,t){var n=Ba(e,t);if(n.state>ey)throw new Error("too late; already running");return n}function Ba(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function sre(e,t,n){var s=e.__transition,i;s[t]=n,n.timer=g9(r,0,n.time);function r(u){n.state=bO,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,m;if(n.state!==bO)return c();for(d in s)if(m=s[d],m.name===n.name){if(m.state===ey)return gO(a);m.state===yO?(m.state=ty,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete s[d]):+dXS&&s.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Ore(e,t,n){var s,i,r=Rre(t)?v2:uo;return function(){var a=r(this,e),l=a.on;l!==s&&(i=(s=l).copy()).on(t,n),a.on=i}}function Mre(e,t){var n=this._id;return arguments.length<2?Ba(this.node(),n).on.on(e):this.each(Ore(n,e,t))}function Lre(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Dre(){return this.on("end.remove",Lre(this._id))}function Pre(e){var t=this._name,n=this._id;typeof e!="function"&&(e=g2(e));for(var s=this._groups,i=s.length,r=new Array(i),a=0;a()=>e;function lae(e,{sourceEvent:t,target:n,transform:s,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:i}})}function Uo(e,t,n){this.k=e,this.x=t,this.y=n}Uo.prototype={constructor:Uo,scale:function(e){return e===1?this:new Uo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Uo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var jx=new Uo(1,0,0);v9.prototype=Uo.prototype;function v9(e){for(;!e.__zoom;)if(!(e=e.parentNode))return jx;return e.__zoom}function nw(e){e.stopImmediatePropagation()}function Qh(e){e.preventDefault(),e.stopImmediatePropagation()}function cae(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uae(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function xO(){return this.__zoom||jx}function dae(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function fae(){return navigator.maxTouchPoints||"ontouchstart"in this}function hae(e,t,n){var s=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function w9(){var e=cae,t=uae,n=hae,s=dae,i=fae,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Jb,u=kx("start","zoom","end"),d,f,h,m=500,p=150,b=0,v=10;function y(L){L.property("__zoom",xO).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",j).filter(i).on("touchstart.zoom",R).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,F,C,I){var D=L.selection?L.selection():L;D.property("__zoom",xO),L!==D?S(L,F,C,I):D.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},y.scaleBy=function(L,F,C,I){y.scaleTo(L,function(){var D=this.__zoom.k,$=typeof F=="function"?F.apply(this,arguments):F;return D*$},C,I)},y.scaleTo=function(L,F,C,I){y.transform(L,function(){var D=t.apply(this,arguments),$=this.__zoom,O=C==null?w(D):typeof C=="function"?C.apply(this,arguments):C,te=$.invert(O),ne=typeof F=="function"?F.apply(this,arguments):F;return n(E(x($,ne),O,te),D,a)},C,I)},y.translateBy=function(L,F,C,I){y.transform(L,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,I)},y.translateTo=function(L,F,C,I,D){y.transform(L,function(){var $=t.apply(this,arguments),O=this.__zoom,te=I==null?w($):typeof I=="function"?I.apply(this,arguments):I;return n(jx.translate(te[0],te[1]).scale(O.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof C=="function"?-C.apply(this,arguments):-C),$,a)},I,D)};function x(L,F){return F=Math.max(r[0],Math.min(r[1],F)),F===L.k?L:new Uo(F,L.x,L.y)}function E(L,F,C){var I=F[0]-C[0]*L.k,D=F[1]-C[1]*L.k;return I===L.x&&D===L.y?L:new Uo(L.k,I,D)}function w(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function S(L,F,C,I){L.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var D=this,$=arguments,O=_(D,$).event(I),te=t.apply(D,$),ne=C==null?w(te):typeof C=="function"?C.apply(D,$):C,P=Math.max(te[1][0]-te[0][0],te[1][1]-te[0][1]),Q=D.__zoom,ee=typeof F=="function"?F.apply(D,$):F,V=c(Q.invert(ne).concat(P/Q.k),ee.invert(ne).concat(P/ee.k));return function(X){if(X===1)X=ee;else{var K=V(X),ce=P/K[2];X=new Uo(ce,ne[0]-K[0]*ce,ne[1]-K[1]*ce)}O.zoom(null,X)}})}function _(L,F,C){return!C&&L.__zooming||new k(L,F)}function k(L,F){this.that=L,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,F),this.taps=0}k.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,F){return this.mouse&&L!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var F=Ar(this.that).datum();u.call(L,this.that,new lae(L,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),F)}};function T(L,...F){if(!e.apply(this,arguments))return;var C=_(this,F).event(L),I=this.__zoom,D=Math.max(r[0],Math.min(r[1],I.k*Math.pow(2,s.apply(this,arguments)))),$=_a(L);if(C.wheel)(C.mouse[0][0]!==$[0]||C.mouse[0][1]!==$[1])&&(C.mouse[1]=I.invert(C.mouse[0]=$)),clearTimeout(C.wheel);else{if(I.k===D)return;C.mouse=[$,I.invert($)],ny(this),C.start()}Qh(L),C.wheel=setTimeout(O,p),C.zoom("mouse",n(E(x(I,D),C.mouse[0],C.mouse[1]),C.extent,a));function O(){C.wheel=null,C.end()}}function A(L,...F){if(h||!e.apply(this,arguments))return;var C=L.currentTarget,I=_(this,F,!0).event(L),D=Ar(L.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",P,!0),$=_a(L,C),O=L.clientX,te=L.clientY;r9(L.view),nw(L),I.mouse=[$,this.__zoom.invert($)],ny(this),I.start();function ne(Q){if(Qh(Q),!I.moved){var ee=Q.clientX-O,V=Q.clientY-te;I.moved=ee*ee+V*V>b}I.event(Q).zoom("mouse",n(E(I.that.__zoom,I.mouse[0]=_a(Q,C),I.mouse[1]),I.extent,a))}function P(Q){D.on("mousemove.zoom mouseup.zoom",null),a9(Q.view,I.moved),Qh(Q),I.event(Q).end()}}function j(L,...F){if(e.apply(this,arguments)){var C=this.__zoom,I=_a(L.changedTouches?L.changedTouches[0]:L,this),D=C.invert(I),$=C.k*(L.shiftKey?.5:2),O=n(E(x(C,$),I,D),t.apply(this,F),a);Qh(L),l>0?Ar(this).transition().duration(l).call(S,O,I,L):Ar(this).call(y.transform,O,I,L)}}function R(L,...F){if(e.apply(this,arguments)){var C=L.touches,I=C.length,D=_(this,F,L.changedTouches.length===I).event(L),$,O,te,ne;for(nw(L),O=0;O`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Fp=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],_9=["Enter"," ","Escape"],S9={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var jf;(function(e){e.Strict="strict",e.Loose="loose"})(jf||(jf={}));var su;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(su||(su={}));var $p;(function(e){e.Partial="partial",e.Full="full"})($p||($p={}));const N9={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ml;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ml||(Ml={}));var Rf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Rf||(Rf={}));var Ze;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ze||(Ze={}));const EO={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function T9(e){return e===null?null:e?"valid":"invalid"}const k9=e=>"id"in e&&"source"in e&&"target"in e,mae=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),_2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),kg=(e,t=[0,0])=>{const{width:n,height:s}=rl(e),i=e.origin??t,r=n*i[0],a=s*i[1];return{x:e.position.x-r,y:e.position.y-a}},pae=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,i)=>{const r=typeof i=="string";let a=!t.nodeLookup&&!r?i:void 0;t.nodeLookup&&(a=r?t.nodeLookup.get(i):_2(i)?i:t.nodeLookup.get(i.id));const l=a?b1(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Rx(s,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ox(n)},Ag=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Rx(n,b1(i)),s=!0)}),s?Ox(n):{x:0,y:0,width:0,height:0}},S2=(e,t,[n,s,i]=[0,0,1],r=!1,a=!1)=>{const l={...ch(t,[n,s,i]),width:t.width/i,height:t.height/i},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,p=d.height??u.height??u.initialHeight??null,b=Hp(l,Mf(u)),v=(m??0)*(p??0),y=r&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},gae=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function bae(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!s||s.has(i.id))&&n.set(i.id,i)}),n}async function yae({nodes:e,width:t,height:n,panZoom:s,minZoom:i,maxZoom:r},a){if(e.size===0)return!0;const l=bae(e,a),c=Ag(l),u=T2(c,t,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??r,(a==null?void 0:a.padding)??.1);return await s.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function A9({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:i,onError:r}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??s;let f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)r==null||r("005",La.error005());else{const m=l.measured.width,p=l.measured.height;m&&p&&(f=[[c,u],[c+m,u+p]])}else l&&bu(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=bu(f)?gu(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(r==null||r("015",La.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function xae({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:i}){const r=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const m=r.has(h.id),p=!m&&h.parentId&&a.find(b=>b.id===h.parentId);(m||p)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=s.filter(h=>h.deletable!==!1),d=gae(a,c);for(const h of c)l.has(h.id)&&!d.find(p=>p.id===h.id)&&d.push(h);if(!i)return{edges:d,nodes:a};const f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const Of=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),gu=(e={x:0,y:0},t,n)=>({x:Of(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Of(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function C9(e,t,n){const{width:s,height:i}=rl(n),{x:r,y:a}=n.internals.positionAbsolute;return gu(e,[[r,a],[r+s,a+i]],t)}const vO=(e,t,n)=>en?-Of(Math.abs(e-n),1,t)/t:0,N2=(e,t,n=15,s=40)=>{const i=vO(e.x,s,t.width-s)*n,r=vO(e.y,s,t.height-s)*n;return[i,r]},Rx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),ZS=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Ox=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Mf=(e,t=[0,0])=>{var i,r;const{x:n,y:s}=_2(e)?e.internals.positionAbsolute:kg(e,t);return{x:n,y:s,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}},b1=(e,t=[0,0])=>{var i,r;const{x:n,y:s}=_2(e)?e.internals.positionAbsolute:kg(e,t);return{x:n,y:s,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:s+(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0)}},I9=(e,t)=>Ox(Rx(ZS(e),ZS(t))),Hp=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},wO=e=>Ca(e.width)&&Ca(e.height)&&Ca(e.x)&&Ca(e.y),Ca=e=>!isNaN(e)&&isFinite(e),j9=(e,t)=>(n,s)=>{},Cg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ch=({x:e,y:t},[n,s,i],r=!1,a=[1,1])=>{const l={x:(e-n)/i,y:(t-s)/i};return r?Cg(l,a):l},Lf=({x:e,y:t},[n,s,i])=>({x:e*i+n,y:t*i+s});function nd(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Eae(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=nd(e,n),i=nd(e,t);return{top:s,right:i,bottom:s,left:i,x:i*2,y:s*2}}if(typeof e=="object"){const s=nd(e.top??e.y??0,n),i=nd(e.bottom??e.y??0,n),r=nd(e.left??e.x??0,t),a=nd(e.right??e.x??0,t);return{top:s,right:a,bottom:i,left:r,x:r+a,y:s+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vae(e,t,n,s,i,r){const{x:a,y:l}=Lf(e,[t,n,s]),{x:c,y:u}=Lf({x:e.x+e.width,y:e.y+e.height},[t,n,s]),d=i-c,f=r-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const T2=(e,t,n,s,i,r)=>{const a=Eae(r,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=Of(u,s,i),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,p=n/2-h*d,b=vae(e,m,p,d,t,n),v={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:m-v.left+v.right,y:p-v.top+v.bottom,zoom:d}},zp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function bu(e){return e!=null&&e!=="parent"}function rl(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function k2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function R9(e,t={width:0,height:0},n,s,i){const r={...e},a=s.get(n);if(a){const l=a.origin||i;r.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],r.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return r}function _O(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function wae(){let e,t;return{promise:new Promise((s,i)=>{e=s,t=i}),resolve:e,reject:t}}function _ae(e){return{...S9,...e||{}}}function Jm(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:i}){const{x:r,y:a}=Ia(e),l=ch({x:r-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},s),{x:c,y:u}=n?Cg(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const A2=e=>({width:e.offsetWidth,height:e.offsetHeight}),O9=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Sae=["INPUT","SELECT","TEXTAREA"];function M9(e){var s,i;const t=((i=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Sae.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const L9=e=>"clientX"in e,Ia=(e,t)=>{var r,a;const n=L9(e),s=n?e.clientX:(r=e.touches)==null?void 0:r[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},SO=(e,t,n,s,i)=>{const r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/s,y:(l.top-n.top)/s,...A2(a)}})};function D9({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:l}){const c=e*.125+i*.375+a*.375+n*.125,u=t*.125+r*.375+l*.375+s*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Q0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function NO({pos:e,x1:t,y1:n,x2:s,y2:i,c:r}){switch(e){case Ze.Left:return[t-Q0(t-s,r),n];case Ze.Right:return[t+Q0(s-t,r),n];case Ze.Top:return[t,n-Q0(n-i,r)];case Ze.Bottom:return[t,n+Q0(i-n,r)]}}function P9({sourceX:e,sourceY:t,sourcePosition:n=Ze.Bottom,targetX:s,targetY:i,targetPosition:r=Ze.Top,curvature:a=.25}){const[l,c]=NO({pos:n,x1:e,y1:t,x2:s,y2:i,c:a}),[u,d]=NO({pos:r,x1:s,y1:i,x2:e,y2:t,c:a}),[f,h,m,p]=D9({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${s},${i}`,f,h,m,p]}function B9({sourceX:e,sourceY:t,targetX:n,targetY:s}){const i=Math.abs(n-e)/2,r=n0}const kae=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Aae=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Cae=(e,t,n={})=>{var r;if(!e.source||!e.target)return(r=n.onError)==null||r.call(n,"006",La.error006()),t;const s=n.getEdgeId||kae;let i;return k9(e)?i={...e}:i={...e,id:s(e)},Aae(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function U9({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[i,r,a,l]=B9({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,i,r,a,l]}const TO={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},Iae=({source:e,sourcePosition:t=Ze.Bottom,target:n})=>t===Ze.Left||t===Ze.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function jae({source:e,sourcePosition:t=Ze.Bottom,target:n,targetPosition:s=Ze.Top,center:i,offset:r,stepPosition:a}){const l=TO[t],c=TO[s],u={x:e.x+l.x*r,y:e.y+l.y*r},d={x:n.x+c.x*r,y:n.y+c.y*r},f=Iae({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let p=[],b,v;const y={x:0,y:0},x={x:0,y:0},[,,E,w]=B9({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=i.x??u.x+(d.x-u.x)*a,v=i.y??(u.y+d.y)/2):(b=i.x??(u.x+d.x)/2,v=i.y??u.y+(d.y-u.y)*a);const T=[{x:b,y:u.y},{x:b,y:d.y}],A=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===m?p=h==="x"?T:A:p=h==="x"?A:T}else{const T=[{x:u.x,y:d.y}],A=[{x:d.x,y:u.y}];if(h==="x"?p=l.x===m?A:T:p=l.y===m?T:A,t===s){const L=Math.abs(e[h]-n[h]);if(L<=r){const F=Math.min(r-1,r-L);l[h]===m?y[h]=(u[h]>e[h]?-1:1)*F:x[h]=(d[h]>n[h]?-1:1)*F}}if(t!==s){const L=h==="x"?"y":"x",F=l[h]===c[L],C=u[L]>d[L],I=u[L]=z?(b=(j.x+R.x)/2,v=p[0].y):(b=p[0].x,v=(j.y+R.y)/2)}const S={x:u.x+y.x,y:u.y+y.y},_={x:d.x+x.x,y:d.y+x.y};return[[e,...S.x!==p[0].x||S.y!==p[0].y?[S]:[],...p,..._.x!==p[p.length-1].x||_.y!==p[p.length-1].y?[_]:[],n],b,v,E,w]}function Rae(e,t,n,s){const i=Math.min(kO(e,t)/2,kO(t,n)/2,s),{x:r,y:a}=t;if(e.x===r&&r===n.x||e.y===a&&a===n.y)return`L${r} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function JS(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Mae(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:i}){const r=new Set;return e.reduce((a,l)=>([l.markerStart||s,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const u=JS(c,t);r.has(u)||(a.push({id:u,color:c.color||n,...c}),r.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const F9=1e3,Lae=10,C2={nodeOrigin:[0,0],nodeExtent:Fp,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Dae={...C2,checkEquality:!0};function I2(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Pae(e,t,n){const s=I2(C2,n);for(const i of e.values())if(i.parentId)R2(i,e,t,s);else{const r=kg(i,s.nodeOrigin),a=bu(i.extent)?i.extent:s.nodeExtent,l=gu(r,a,rl(i));i.internals.positionAbsolute=l}}function Bae(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],s=[];for(const i of e.handles){const r={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(r):i.type==="target"&&s.push(r)}return{source:n,target:s}}function j2(e){return e==="manual"}function eN(e,t,n,s={}){var d,f;const i=I2(Dae,s),r={i:0},a=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!j2(i.zIndexMode)?F9:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let m=a.get(h.id);if(i.checkEquality&&h===(m==null?void 0:m.internals.userNode))t.set(h.id,m);else{const p=kg(h,i.nodeOrigin),b=bu(h.extent)?h.extent:i.nodeExtent,v=gu(p,b,rl(h));m={...i.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:Bae(h,m),z:$9(h,l,i.zIndexMode),userNode:h}},t.set(h.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),h.parentId&&R2(m,t,n,s,r),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Uae(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function R2(e,t,n,s,i){const{elevateNodesOnSelect:r,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=I2(C2,s),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Uae(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*Lae),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);const f=r&&!j2(c)?F9:0,{x:h,y:m,z:p}=Fae(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||m!==b.y;(v||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:m}:b,z:p}})}function $9(e,t,n){const s=Ca(e.zIndex)?e.zIndex:0;return j2(n)?s:s+(e.selected?t:0)}function Fae(e,t,n,s,i,r){const{x:a,y:l}=t.internals.positionAbsolute,c=rl(e),u=kg(e,n),d=bu(e.extent)?gu(u,e.extent,c):u;let f=gu({x:a+d.x,y:l+d.y},s,c);e.extent==="parent"&&(f=C9(f,c,t));const h=$9(e,i,r),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function O2(e,t,n,s=[0,0]){var a;const i=[],r=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=r.get(l.parentId))==null?void 0:a.expandedRect)??Mf(c),d=I9(u,l.rect);r.set(l.parentId,{expandedRect:d,parent:c})}return r.size>0&&r.forEach(({expandedRect:l,parent:c},u)=>{var E;const d=c.internals.positionAbsolute,f=rl(c),h=c.origin??s,m=l.x0||p>0||y||x)&&(i.push({id:u,type:"position",position:{x:c.position.x-m+y,y:c.position.y-p+x}}),(E=n.get(u))==null||E.forEach(w=>{e.some(S=>S.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+m,y:w.position.y+p}})})),(f.width0){const m=O2(h,t,n,i);u.push(...m)}return{changes:u,updatedInternals:c}}async function Hae({delta:e,panZoom:t,transform:n,translateExtent:s,width:i,height:r}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,r]],s);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function jO(e,t,n,s,i,r){let a=i;const l=s.get(a)||new Map;s.set(a,l.set(n,t)),a=`${i}-${e}`;const c=s.get(a)||new Map;if(s.set(a,c.set(n,t)),r){a=`${i}-${e}-${r}`;const u=s.get(a)||new Map;s.set(a,u.set(n,t))}}function H9(e,t,n){e.clear(),t.clear();for(const s of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:l=null}=s,c={edgeId:s.id,source:i,target:r,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${r}-${l}`,d=`${r}-${l}--${i}-${a}`;jO("source",c,d,e,i,a),jO("target",c,u,e,r,l),t.set(s.id,s)}}function z9(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:z9(n,t):!1}function RO(e,t,n){var i;let s=e;do{if((i=s==null?void 0:s.matches)!=null&&i.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function zae(e,t,n,s){const i=new Map;for(const[r,a]of e)if((a.selected||a.id===s)&&(!a.parentId||!z9(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(r);l&&i.set(r,{id:r,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function sw({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var a,l,c;const i=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&i.push({...f,position:d.position,dragging:s})}if(!e)return[i[0],i];const r=(l=n.get(e))==null?void 0:l.internals.userNode;return[r?{...r,position:((c=t.get(e))==null?void 0:c.position)||r.position,dragging:s}:i[0],i]}function Vae({dragItems:e,snapGrid:t,x:n,y:s}){const i=e.values().next().value;if(!i)return null;const r={x:n-i.distance.x,y:s-i.distance.y},a=Cg(r,t);return{x:a.x-r.x,y:a.y-r.y}}function Gae({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:i}){let r={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,p=!1,b=null;function v({noDragClassName:x,handleSelector:E,domNode:w,isSelectable:S,nodeId:_,nodeClickDistance:k=0}){h=Ar(w);function T({x:B,y:z}){const{nodeLookup:L,nodeExtent:F,snapGrid:C,snapToGrid:I,nodeOrigin:D,onNodeDrag:$,onSelectionDrag:O,onError:te,updateNodePositions:ne}=t();r={x:B,y:z};let P=!1;const Q=l.size>1,ee=Q&&F?ZS(Ag(l)):null,V=Q&&I?Vae({dragItems:l,snapGrid:C,x:B,y:z}):null;for(const[X,K]of l){if(!L.has(X))continue;let ce={x:B-K.distance.x,y:z-K.distance.y};I&&(ce=V?{x:Math.round(ce.x+V.x),y:Math.round(ce.y+V.y)}:Cg(ce,C));let he=null;if(Q&&F&&!K.extent&&ee){const{positionAbsolute:we}=K.internals,De=we.x-ee.x+F[0][0],Se=we.x+K.measured.width-ee.x2+F[1][0],ae=we.y-ee.y+F[0][1],pe=we.y+K.measured.height-ee.y2+F[1][1];he=[[De,ae],[Se,pe]]}const{position:ye,positionAbsolute:ue}=A9({nodeId:X,nextPosition:ce,nodeLookup:L,nodeExtent:he||F,nodeOrigin:D,onError:te});P=P||K.position.x!==ye.x||K.position.y!==ye.y,K.position=ye,K.internals.positionAbsolute=ue}if(p=p||P,!!P&&(ne(l,!0),b&&(s||$||!_&&O))){const[X,K]=sw({nodeId:_,dragItems:l,nodeLookup:L});s==null||s(b,l,X,K),$==null||$(b,X,K),_||O==null||O(b,K)}}async function A(){if(!d)return;const{transform:B,panBy:z,autoPanSpeed:L,autoPanOnNodeDrag:F}=t();if(!F){c=!1,cancelAnimationFrame(a);return}const[C,I]=N2(u,d,L);(C!==0||I!==0)&&(r.x=(r.x??0)-C/B[2],r.y=(r.y??0)-I/B[2],await z({x:C,y:I})&&T(r)),a=requestAnimationFrame(A)}function j(B){var Q;const{nodeLookup:z,multiSelectionActive:L,nodesDraggable:F,transform:C,snapGrid:I,snapToGrid:D,selectNodesOnDrag:$,onNodeDragStart:O,onSelectionDragStart:te,unselectNodesAndEdges:ne}=t();f=!0,(!$||!S)&&!L&&_&&((Q=z.get(_))!=null&&Q.selected||ne()),S&&$&&_&&(e==null||e(_));const P=Jm(B.sourceEvent,{transform:C,snapGrid:I,snapToGrid:D,containerBounds:d});if(r=P,l=zae(z,F,P,_),l.size>0&&(n||O||!_&&te)){const[ee,V]=sw({nodeId:_,dragItems:l,nodeLookup:z});n==null||n(B.sourceEvent,l,ee,V),O==null||O(B.sourceEvent,ee,V),_||te==null||te(B.sourceEvent,V)}}const R=o9().clickDistance(k).on("start",B=>{const{domNode:z,nodeDragThreshold:L,transform:F,snapGrid:C,snapToGrid:I}=t();d=(z==null?void 0:z.getBoundingClientRect())||null,m=!1,p=!1,b=B.sourceEvent,L===0&&j(B),r=Jm(B.sourceEvent,{transform:F,snapGrid:C,snapToGrid:I,containerBounds:d}),u=Ia(B.sourceEvent,d)}).on("drag",B=>{const{autoPanOnNodeDrag:z,transform:L,snapGrid:F,snapToGrid:C,nodeDragThreshold:I,nodeLookup:D}=t(),$=Jm(B.sourceEvent,{transform:L,snapGrid:F,snapToGrid:C,containerBounds:d});if(b=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||_&&!D.has(_))&&(m=!0),!m){if(!c&&z&&f&&(c=!0,A()),!f){const O=Ia(B.sourceEvent,d),te=O.x-u.x,ne=O.y-u.y;Math.sqrt(te*te+ne*ne)>I&&j(B)}(r.x!==$.xSnapped||r.y!==$.ySnapped)&&l&&f&&(u=Ia(B.sourceEvent,d),T($))}}).on("end",B=>{if(!f||m){m&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:z,updateNodePositions:L,onNodeDragStop:F,onSelectionDragStop:C}=t();if(p&&(L(l,!1),p=!1),i||F||!_&&C){const[I,D]=sw({nodeId:_,dragItems:l,nodeLookup:z,dragging:!1});i==null||i(B.sourceEvent,l,I,D),F==null||F(B.sourceEvent,I,D),_||C==null||C(B.sourceEvent,D)}}}).filter(B=>{const z=B.target;return!B.button&&(!x||!RO(z,`.${x}`,w))&&(!E||RO(z,E,w))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function Kae(e,t,n){const s=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())Hp(i,Mf(r))>0&&s.push(r);return s}const qae=250;function Yae(e,t,n,s){var l,c;let i=[],r=1/0;const a=Kae(e,n,t+qae);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(s.nodeId===f.nodeId&&s.type===f.type&&s.id===f.id)continue;const{x:h,y:m}=yu(u,f,f.position,!0),p=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));p>t||(p1){const u=s.type==="source"?"target":"source";return i.find(d=>d.type===u)??i[0]}return i[0]}function V9(e,t,n,s,i,r=!1){var u,d,f;const a=s.get(e);if(!a)return null;const l=i==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&r?{...c,...yu(a,c,c.position,!0)}:c}function G9(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Wae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const K9=()=>!0;function Xae(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:i,edgeUpdaterType:r,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:p,onConnect:b,onConnectEnd:v,isValidConnection:y=K9,onReconnectEnd:x,updateConnection:E,getTransform:w,getFromHandle:S,autoPanSpeed:_,dragThreshold:k=1,handleDomNode:T}){const A=O9(e.target);let j=0,R;const{x:B,y:z}=Ia(e),L=G9(r,T),F=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!F||!L)return;const I=V9(i,L,s,c,t);if(!I)return;let D=Ia(e,F),$=!1,O=null,te=!1,ne=null;function P(){if(!d||!F)return;const[ye,ue]=N2(D,F,_);h({x:ye,y:ue}),j=requestAnimationFrame(P)}const Q={...I,nodeId:i,type:L,position:I.position},ee=c.get(i);let X={inProgress:!0,isValid:null,from:yu(ee,Q,Ze.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:ee,to:D,toHandle:null,toPosition:EO[Q.position],toNode:null,pointer:D};function K(){C=!0,E(X),p==null||p(e,{nodeId:i,handleId:s,handleType:L})}k===0&&K();function ce(ye){if(!C){const{x:pe,y:_e}=Ia(ye),et=pe-B,Be=_e-z;if(!(et*et+Be*Be>k*k))return;K()}if(!S()||!Q){he(ye);return}const ue=w();D=Ia(ye,F),R=Yae(ch(D,ue,!1,[1,1]),n,c,Q),$||(P(),$=!0);const we=q9(ye,{handle:R,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:a?"target":"source",isValidConnection:y,doc:A,lib:u,flowId:f,nodeLookup:c});ne=we.handleDomNode,O=we.connection,te=Wae(!!R,we.isValid);const De=c.get(i),Se=De?yu(De,Q,Ze.Left,!0):X.from,ae={...X,from:Se,isValid:te,to:we.toHandle&&te?Lf({x:we.toHandle.x,y:we.toHandle.y},ue):D,toHandle:we.toHandle,toPosition:te&&we.toHandle?we.toHandle.position:EO[Q.position],toNode:we.toHandle?c.get(we.toHandle.nodeId):null,pointer:D};E(ae),X=ae}function he(ye){if(!("touches"in ye&&ye.touches.length>0)){if(C){(R||ne)&&O&&te&&(b==null||b(O));const{inProgress:ue,...we}=X,De={...we,toPosition:X.toHandle?X.toPosition:null};v==null||v(ye,De),r&&(x==null||x(ye,De))}m(),cancelAnimationFrame(j),$=!1,te=!1,O=null,ne=null,A.removeEventListener("mousemove",ce),A.removeEventListener("mouseup",he),A.removeEventListener("touchmove",ce),A.removeEventListener("touchend",he)}}A.addEventListener("mousemove",ce),A.addEventListener("mouseup",he),A.addEventListener("touchmove",ce),A.addEventListener("touchend",he)}function q9(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:i,fromType:r,doc:a,lib:l,flowId:c,isValidConnection:u=K9,nodeLookup:d}){const f=r==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:p}=Ia(e),b=a.elementFromPoint(m,p),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=G9(void 0,v),E=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),S=v.classList.contains("connectable"),_=v.classList.contains("connectableend");if(!E||!x)return y;const k={source:f?E:s,sourceHandle:f?w:i,target:f?s:E,targetHandle:f?i:w};y.connection=k;const A=S&&_&&(n===jf.Strict?f&&x==="source"||!f&&x==="target":E!==s||w!==i);y.isValid=A&&u(k),y.toHandle=V9(E,x,w,d,n,!0)}return y}const tN={onPointerDown:Xae,isValid:q9};function Qae({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const i=Ar(e);function r({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const p=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const w=n(),S=E.sourceEvent.ctrlKey&&zp()?10:1,_=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*d,k=w[2]*Math.pow(2,_*S);t.scaleTo(k)};let b=[0,0];const v=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(b=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},y=E=>{const w=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const S=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],_=[S[0]-b[0],S[1]-b[1]];b=S;const k=s()*Math.max(w[2],Math.log(w[2]))*(m?-1:1),T={x:w[0]-_[0]*k,y:w[1]-_[1]*k},A=[[0,0],[c,u]];t.setViewportConstrained({x:T.x,y:T.y,zoom:w[2]},A,l)},x=w9().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?p:null);i.call(x,{})}function a(){i.on("zoom",null)}return{update:r,destroy:a,pointer:_a}}const Mx=e=>({x:e.x,y:e.y,zoom:e.k}),iw=({x:e,y:t,zoom:n})=>jx.translate(e,t).scale(n),Fd=(e,t)=>e.target.closest(`.${t}`),Y9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Zae=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rw=(e,t=0,n=Zae,s=()=>{})=>{const i=typeof t=="number"&&t>0;return i||s(),i?e.transition().duration(t).ease(n).on("end",s):e},W9=e=>{const t=e.ctrlKey&&zp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Jae({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:i,panOnScrollSpeed:r,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Fd(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const v=_a(d),y=W9(d),x=f*Math.pow(2,y);s.scaleTo(n,x,v,d);return}const h=d.deltaMode===1?20:1;let m=i===su.Vertical?0:d.deltaX*h,p=i===su.Horizontal?0:d.deltaY*h;!zp()&&d.shiftKey&&i!==su.Vertical&&(m=d.deltaY*h,p=0),s.translateBy(n,-(m/f)*r,-(p/f)*r,{internal:!0});const b=Mx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function eoe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,i){const r=s.type==="wheel",a=!t&&r&&!s.ctrlKey,l=Fd(s,e);if(s.ctrlKey&&r&&l&&s.preventDefault(),a||l)return null;s.preventDefault(),n.call(this,s,i)}}function toe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,a,l;if((r=s.sourceEvent)!=null&&r.internal)return;const i=Mx(s.transform);e.mouseButton=((a=s.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=s.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,i))}}function noe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:i}){return r=>{var a,l;e.usedRightMouseButton=!!(n&&Y9(t,e.mouseButton??0)),(a=r.sourceEvent)!=null&&a.sync||s([r.transform.x,r.transform.y,r.transform.k]),i&&!((l=r.sourceEvent)!=null&&l.internal)&&(i==null||i(r.sourceEvent,Mx(r.transform)))}}function soe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:i,onPaneContextMenu:r}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,r&&Y9(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&r(a.sourceEvent),e.usedRightMouseButton=!1,s(!1),i)){const c=Mx(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,c)},n?150:0)}}}function ioe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:i,zoomOnDoubleClick:r,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,m=n&&f.ctrlKey,p=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Fd(f,`${u}-flow__node`)||Fd(f,`${u}-flow__edge`)))return!0;if(!s&&!h&&!i&&!r&&!n||a||d&&!p||Fd(f,l)&&p||Fd(f,c)&&(!p||i&&p&&!e)||!n&&f.ctrlKey&&p)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!i&&!m&&p||!s&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(s)&&!s.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(s)&&s.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||p)&&b}}function roe({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:i,onPanZoom:r,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=w9().scaleExtent([t,n]).translateExtent(s),h=Ar(e).call(f);x({x:i.x,y:i.y,zoom:Of(i.zoom,t,n)},[[0,0],[d.width,d.height]],s);const m=h.on("wheel.zoom"),p=h.on("dblclick.zoom");f.wheelDelta(W9);async function b(R,B){return h?new Promise(z=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?Zm:Jb).transform(rw(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>z(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:B,onPaneContextMenu:z,userSelectionActive:L,panOnScroll:F,panOnDrag:C,panOnScrollMode:I,panOnScrollSpeed:D,preventScrolling:$,zoomOnPinch:O,zoomOnScroll:te,zoomOnDoubleClick:ne,zoomActivationKeyPressed:P,lib:Q,onTransformChange:ee,connectionInProgress:V,paneClickDistance:X,selectionOnDrag:K}){L&&!u.isZoomingOrPanning&&y();const ce=F&&!P&&!L;f.clickDistance(K?1/0:!Ca(X)||X<0?0:X);const he=ce?Jae({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:I,panOnScrollSpeed:D,zoomOnPinch:O,onPanZoomStart:a,onPanZoom:r,onPanZoomEnd:l}):eoe({noWheelClassName:R,preventScrolling:$,d3ZoomHandler:m});h.on("wheel.zoom",he,{passive:!1});const ye=toe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",ye);const ue=noe({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!z,onPanZoom:r,onTransformChange:ee});f.on("zoom",ue);const we=soe({zoomPanValues:u,panOnDrag:C,panOnScroll:F,onPaneContextMenu:z,onPanZoomEnd:l,onDraggingChange:c});f.on("end",we);const De=ioe({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:te,panOnScroll:F,zoomOnDoubleClick:ne,zoomOnPinch:O,userSelectionActive:L,noPanClassName:B,noWheelClassName:R,lib:Q,connectionInProgress:V});f.filter(De),ne?h.on("dblclick.zoom",p):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x(R,B,z){const L=iw(R),F=f==null?void 0:f.constrain()(L,B,z);return F&&await b(F),F}async function E(R,B){const z=iw(R);return await b(z,B),z}function w(R){if(h){const B=iw(R),z=h.property("__zoom");(z.k!==R.zoom||z.x!==R.x||z.y!==R.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function S(){const R=h?v9(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function _(R,B){return h?new Promise(z=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?Zm:Jb).scaleTo(rw(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>z(!0)),R)}):!1}async function k(R,B){return h?new Promise(z=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?Zm:Jb).scaleBy(rw(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>z(!0)),R)}):!1}function T(R){f==null||f.scaleExtent(R)}function A(R){f==null||f.translateExtent(R)}function j(R){const B=!Ca(R)||R<0?0:R;f==null||f.clickDistance(B)}return{update:v,destroy:y,setViewport:E,setViewportConstrained:x,getViewport:S,scaleTo:_,scaleBy:k,setScaleExtent:T,setTranslateExtent:A,syncViewport:w,setClickDistance:j}}var Df;(function(e){e.Line="line",e.Handle="handle"})(Df||(Df={}));function aoe({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:i,affectsY:r}){const a=e-t,l=n-s,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&r&&(c[1]=c[1]*-1),c}function OO(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:i}}function xl(e,t){return Math.max(0,t-e)}function El(e,t){return Math.max(0,e-t)}function Z0(e,t,n){return Math.max(0,t-e,e-n)}function MO(e,t){return e?!t:t}function ooe(e,t,n,s,i,r,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:p}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:x}=s,{x:E,y:w,width:S,height:_,aspectRatio:k}=e;let T=Math.floor(d?m-e.pointerX:0),A=Math.floor(f?p-e.pointerY:0);const j=S+(c?-T:T),R=_+(u?-A:A),B=-r[0]*S,z=-r[1]*_;let L=Z0(j,b,v),F=Z0(R,y,x);if(a){let D=0,$=0;c&&T<0?D=xl(E+T+B,a[0][0]):!c&&T>0&&(D=El(E+j+B,a[1][0])),u&&A<0?$=xl(w+A+z,a[0][1]):!u&&A>0&&($=El(w+R+z,a[1][1])),L=Math.max(L,D),F=Math.max(F,$)}if(l){let D=0,$=0;c&&T>0?D=El(E+T,l[0][0]):!c&&T<0&&(D=xl(E+j,l[1][0])),u&&A>0?$=El(w+A,l[0][1]):!u&&A<0&&($=xl(w+R,l[1][1])),L=Math.max(L,D),F=Math.max(F,$)}if(i){if(d){const D=Z0(j/k,y,x)*k;if(L=Math.max(L,D),a){let $=0;!c&&!u||c&&!u&&h?$=El(w+z+j/k,a[1][1])*k:$=xl(w+z+(c?T:-T)/k,a[0][1])*k,L=Math.max(L,$)}if(l){let $=0;!c&&!u||c&&!u&&h?$=xl(w+j/k,l[1][1])*k:$=El(w+(c?T:-T)/k,l[0][1])*k,L=Math.max(L,$)}}if(f){const D=Z0(R*k,b,v)/k;if(F=Math.max(F,D),a){let $=0;!c&&!u||u&&!c&&h?$=El(E+R*k+B,a[1][0])/k:$=xl(E+(u?A:-A)*k+B,a[0][0])/k,F=Math.max(F,$)}if(l){let $=0;!c&&!u||u&&!c&&h?$=xl(E+R*k,l[1][0])/k:$=El(E+(u?A:-A)*k,l[0][0])/k,F=Math.max(F,$)}}}A=A+(A<0?F:-F),T=T+(T<0?L:-L),i&&(h?j>R*k?A=(MO(c,u)?-T:T)/k:T=(MO(c,u)?-A:A)*k:d?(A=T/k,u=c):(T=A*k,c=u));const C=c?E+T:E,I=u?w+A:w;return{width:S+(c?-T:T),height:_+(u?-A:A),x:r[0]*T*(c?-1:1)+C,y:r[1]*A*(u?-1:1)+I}}const X9={width:0,height:0,x:0,y:0},loe={...X9,pointerX:0,pointerY:0,aspectRatio:1};function coe(e,t,n){const s=t.position.x+e.position.x,i=t.position.y+e.position.y,r=e.measured.width??0,a=e.measured.height??0,l=n[0]*r,c=n[1]*a;return[[s-l,i-c],[s+r-l,i+a-c]]}function uoe({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:i}){const r=Ar(e);let a={controlDirection:OO("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:p,onResizeEnd:b,shouldResize:v}){let y={...X9},x={...loe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:OO(u)};let E,w=null,S=[],_,k,T,A=!1;const j=o9().on("start",R=>{const{nodeLookup:B,transform:z,snapGrid:L,snapToGrid:F,nodeOrigin:C,paneDomNode:I}=n();if(E=B.get(t),!E)return;w=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:D,ySnapped:$}=Jm(R.sourceEvent,{transform:z,snapGrid:L,snapToGrid:F,containerBounds:w});y={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},x={...y,pointerX:D,pointerY:$,aspectRatio:y.width/y.height},_=void 0,k=bu(E.extent)?E.extent:void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(_=B.get(E.parentId)),_&&E.extent==="parent"&&(k=[[0,0],[_.measured.width,_.measured.height]]),S=[],T=void 0;for(const[O,te]of B)if(te.parentId===t&&(S.push({id:O,position:{...te.position},extent:te.extent}),te.extent==="parent"||te.expandParent)){const ne=coe(te,E,te.origin??C);T?T=[[Math.min(ne[0][0],T[0][0]),Math.min(ne[0][1],T[0][1])],[Math.max(ne[1][0],T[1][0]),Math.max(ne[1][1],T[1][1])]]:T=ne}m==null||m(R,{...y})}).on("drag",R=>{const{transform:B,snapGrid:z,snapToGrid:L,nodeOrigin:F}=n(),C=Jm(R.sourceEvent,{transform:B,snapGrid:z,snapToGrid:L,containerBounds:w}),I=[];if(!E)return;const{x:D,y:$,width:O,height:te}=y,ne={},P=E.origin??F,{width:Q,height:ee,x:V,y:X}=ooe(x,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,k,T),K=Q!==O,ce=ee!==te,he=V!==D&&K,ye=X!==$&&ce;if(!he&&!ye&&!K&&!ce)return;if((he||ye||P[0]===1||P[1]===1)&&(ne.x=he?V:y.x,ne.y=ye?X:y.y,y.x=ne.x,y.y=ne.y,S.length>0)){const Se=V-D,ae=X-$;for(const pe of S)pe.position={x:pe.position.x-Se+P[0]*(Q-O),y:pe.position.y-ae+P[1]*(ee-te)},I.push(pe)}if((K||ce)&&(ne.width=K&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Q:y.width,ne.height=ce&&(!a.resizeDirection||a.resizeDirection==="vertical")?ee:y.height,y.width=ne.width,y.height=ne.height),_&&E.expandParent){const Se=P[0]*(ne.width??0);ne.x&&ne.x{A&&(b==null||b(R,{...y}),i==null||i({...y}),A=!1)});r.call(j)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var Q9={exports:{}},Z9={},J9={exports:{}},eU={};/** +`);if(c)try{yield JSON.parse(c)}catch{c!=="[DONE]"&&c!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${c.length} chars):`,c.slice(0,200))}a=s.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Ote=255,Mte=/[\p{L}\p{M}\p{N}\p{P}\p{Zs}]/u;function Lte(e){const t=e.normalize("NFKC").replace(/\s+/gu," ").trim(),n=new TextEncoder;let s=0,i="";for(const r of t){if(!Mte.test(r))continue;const a=n.encode(r).byteLength;if(s+a>Ote)break;i+=r,s+=a}return i.replace(/ +/g," ").trimEnd()}const qR="ap-southeast-1",Jk="cn-beijing",qB="https://ark.ap-southeast.bytepluses.com/api/v3",e2="https://ark.cn-beijing.volces.com/api/v3/",YB="seed-2-0-lite-260228",t2="doubao-seed-2-1-pro-260628",Dte="skylark-embedding-vision-250615",Pte="doubao-embedding-vision-250615",Bte="seed-2-0-lite-260228",Ute="doubao-seed-2-0-lite-260428",WB=[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}],XB=[{value:qR,label:qR}];function wx(e){return e==="byteplus"?XB:WB}function Ti(e){var t;return((t=wx(e)[0])==null?void 0:t.value)||Jk}function Nf(e,t){var s;return((s=(t?wx(t):[...WB,...XB]).find(i=>i.value===e))==null?void 0:s.label)||e||"-"}function i1(e){return e==="byteplus"?YB:t2}function r1(e){return e==="byteplus"?qB:e2}function Fte(e){return e==="byteplus"?Dte:Pte}function $te(e){return e==="byteplus"?Bte:Ute}const n2="veadk.messageFeedback.v1";function s2(e,t,n,s){return[e,t,n,s].join(":")}function i2(){if(typeof window>"u")return{};try{const e=JSON.parse(localStorage.getItem(n2)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}}function Hte(e,t,n){if(typeof window>"u")return;const s=i2();s[e]={...s[e]??{},[`veadk_feedback:${t}`]:n},localStorage.setItem(n2,JSON.stringify(s))}function QB(e){if(typeof window>"u")return;const t=s2(e.runtimeId,e.appName,e.userId,e.sessionId),n=i2(),s=n[t];if(s){for(const i of e.eventIds)delete s[`veadk_feedback:${i}`];Object.keys(s).length===0?delete n[t]:n[t]=s,localStorage.setItem(n2,JSON.stringify(n))}}const Yb="",r2=new Map;function ZB(e,t){r2.set(e,t)}function JB(){r2.clear()}function si(e){const t=r2.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}async function dt(e,t={},n={},s=yc){const i=!!n.runtimeId&&String(t.method??"GET").toUpperCase()==="DELETE",r={...t,...i?{method:"POST"}:{},headers:Ex(t.headers)},a=()=>{const u={...r,signal:Bn(t.signal,s)};if(n.runtimeId){const d=new URLSearchParams;n.region&&d.set("region",n.region),n.retryProbe&&d.set("probe_retry","connect"),i&&d.set("_method","DELETE");const f=d.toString()?`${e.includes("?")?"&":"?"}${d.toString()}`:"";return fetch(Rn(`${Yb}/web/runtime-proxy/${n.runtimeId}${e}${f}`),u)}if(n.base){const d=new Headers(u.headers);return d.set("X-AgentKit-Base",n.base),n.apiKey&&d.set("X-AgentKit-Key",n.apiKey),fetch(Rn(`${Yb}/agentkit-proxy${e}`),{...u,headers:d})}return fetch(Rn(`${Yb}${e}`),u)},l=async u=>{if(Nte(u))return!0;if(u.status!==401)return!1;try{return await vte()}catch{return!1}};let c=await a();for(;await l(c);)await Tte(t.signal),c=await a();return c}function e8(e,t={},n=yc){return dt(e,t,{},n)}function zte(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const s=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",i=String(t.msg??"");return s?`${s}: ${i}`:i}return String(t)}).filter(Boolean).join(` +`):e&&typeof e=="object"?JSON.stringify(e):""}async function $t(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const s=JSON.parse(n);return zte(s.detail??s.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function t8(){const e=await dt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class sh extends Error{constructor(){super("当前账号无权访问该 Runtime,请刷新列表或重新登录后重试。"),this.name="RuntimeAccessDeniedError"}}class Or extends Error{constructor(t,n=!1){super(t),this.unsupported=n,this.name="RuntimeProbeError"}}const n8="Runtime 已部署成功,但当前 Studio 无法访问私网 Runtime。请使用已绑定相同 VPC 的 Studio 访问,或改用公网 / 公网+VPC 部署。",s8="Runtime 已部署成功,但 Studio 暂时无法连接服务。网关域名可能仍在生效,或当前网络/DNS 无法访问该 Runtime,请稍后在智能体管理页重试连接。",YR=["cn-beijing","cn-shanghai"],Vte=3e4,_x=5*60*1e3,i8=60*1e3,Wb=new Map,Pc=new Map,Bc=new Map,Ca=new Map;function r8(e,t){return`${t}:${e}`}function ih(e){const t=e||Jk;return YR.includes(t)?[t,...YR.filter(n=>n!==t)]:[t]}function rh(...e){return e.map(t=>String(t??"")).join("")}function ah(e,t,n){const s=e.get(t);return s!=null&&s.value&&Date.now()-s.updatedAt<=n?s.value:null}function a2(e,t,n){return e.set(t,{value:n,updatedAt:Date.now()}),n}async function a8(e){try{const t=await e.clone().json();return typeof t.detail=="string"?t.detail:""}catch{return""}}async function Sx(e,t,n){const s=await dt("/list-apps",{},n??{base:e,apiKey:t}),i=n!=null&&n.runtimeId?await a8(s):"";if(n!=null&&n.runtimeId&&i==="runtime_access_denied")throw new sh;if(n!=null&&n.runtimeId&&i==="runtime_private_endpoint_unreachable")throw new Or(n8);if(n!=null&&n.runtimeId&&["runtime_proxy_connect_error","runtime_proxy_timeout","runtime_json_connect_error","runtime_json_timeout"].includes(i))throw new Or(s8);if(n!=null&&n.runtimeId&&s.status===404)throw new Or("该 Runtime 的 Agent Server 未提供连接接口,请确认 Runtime 已就绪且版本兼容。",!0);if(n!=null&&n.runtimeId&&(s.status===401||s.status===403))throw new Or("Runtime 服务拒绝了连接请求,请检查 Runtime 的鉴权配置。");if(!s.ok)throw new Error(await $t(s,"读取 Agent 列表失败"));const r=await s.json();return n!=null&&n.runtimeId&&Wb.set(r8(n.runtimeId,n.region??""),{apps:r,expiresAt:Date.now()+Vte}),r}async function a1(e,t){const{app:n,ep:s}=si(e),i=await dt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},s);if(!i.ok){const a=`创建会话失败 (${i.status})`,l=await $t(i,"创建会话失败");throw new Error(l===a?a:`${a}:${l}`)}return(await i.json()).id}async function o2(e,t){const{app:n,ep:s}=si(e),i=await dt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},s);if(!i.ok)throw new Error(`list sessions failed: ${i.status}`);return i.json()}async function o1(e,t,n){const{app:s,ep:i}=si(e),r=await dt(`/apps/${s}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}`,{},i);if(!r.ok){const l=await $t(r,"读取会话失败");throw new Error(`get session failed: ${r.status}:${l}`)}const a=await r.json();if(i.runtimeId){const l=s2(i.runtimeId,s,t,n);a.state={...i2()[l]??{},...a.state??{}}}return a}async function o8(e){const{app:t,ep:n}=si(e.appName);if(!n.runtimeId)throw new Error("只有连接到 AgentKit Runtime 的会话支持反馈回流");if(!n.region)throw new Error("Runtime 缺少地域信息,无法提交反馈");const s=await dt("/web/evaluation/feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:n.runtimeId,region:n.region,appName:t,userId:e.userId,sessionId:e.sessionId,eventId:e.eventId,rating:e.rating,comment:e.comment??""})},{},Eg);if(!s.ok)throw new Error(await $t(s,"提交反馈失败"));const i=await s.json(),r=s2(n.runtimeId,t,e.userId,e.sessionId);return Hte(r,e.eventId,i),i}async function Nx(e,t={}){const n=rh(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),s=ah(Ca,n,i8);if(!t.force&&s)return s;const i=Ca.get(n);if(!t.force&&(i!=null&&i.promise))return i.promise;let r=null;const a=(async()=>{for(const l of ih(e.region)){const c=new URLSearchParams({runtimeId:e.runtimeId,region:l,appName:e.appName,page_size:String(e.pageSize??100)}),u=await dt(`/web/evaluation/feedback-cases?${c.toString()}`);if(u.ok)return a2(Ca,n,await u.json());r=new Error(await $t(u,"读取评测集失败"))}throw r??new Error("读取评测集失败")})();Ca.set(n,{...i,promise:a,updatedAt:(i==null?void 0:i.updatedAt)??0});try{return await a}finally{const l=Ca.get(n);(l==null?void 0:l.promise)===a&&Ca.set(n,{value:l.value,updatedAt:l.updatedAt})}}async function l8(e){let t=null;for(const n of ih(e.region)){const s=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName,userId:e.userId}),i=await dt(`/web/evaluation/statuses?${s.toString()}`);if(i.ok)return i.json();t=new Error(await $t(i,"读取自动评测状态失败"))}throw t??new Error("读取自动评测状态失败")}async function c8(e){let t=null;for(const n of ih(e.region)){const s=new URLSearchParams({runtimeId:e.runtimeId,region:n,appName:e.appName}),i=await dt(`/web/evaluation/optimizations?${s.toString()}`);if(i.ok)return i.json();t=new Error(await $t(i,"读取优化项失败"))}throw t??new Error("读取优化项失败")}function u8(e){return ah(Ca,rh(e.runtimeId,e.region||"cn-beijing",e.appName,e.pageSize??100),i8)}function LS(e){Nx(e).catch(()=>{})}function d8(e){Nx(e,{force:!0}).catch(()=>{})}function f8(e,t){return["good","bad"].map(n=>{const s=e.find(i=>i.kind===n);return{kind:n,evaluationSetId:(s==null?void 0:s.evaluationSetId)??null,evaluationSetName:(s==null?void 0:s.evaluationSetName)??null,workspaceId:(s==null?void 0:s.workspaceId)??null,itemCount:t.filter(i=>i.kind===n).length}})}function Xb(e){for(const[t,n]of Ca.entries()){const s=n.value;if(!s||s.runtimeId!==e.runtimeId||s.agentName!==e.appName)continue;const i=s.items.filter(a=>a.sessionId!==e.sessionId||a.messageId!==e.messageId),r=e.rating?[{id:`local:${e.runtimeId}:${e.sessionId}:${e.messageId}`,itemKey:`local:${e.messageId}`,kind:e.rating,input:e.input,output:e.output,referenceOutput:e.referenceOutput??e.output,comment:"",agentName:e.appName,sessionId:e.sessionId,messageId:e.messageId,runtimeId:e.runtimeId,invocationId:e.invocationId??"",userId:e.userId,createdAt:e.createdAt??new Date().toISOString(),evaluationSetId:"",evaluationSetName:"",workspaceId:""},...i]:i;Ca.set(t,{value:{...s,sets:f8(s.sets,r),items:r},updatedAt:Date.now(),promise:n.promise})}}async function h8(e){let t=null;for(const n of ih(e.region)){const s=await dt("/web/evaluation/feedback-cases/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e.runtimeId,region:n,appName:e.appName,itemIds:e.itemIds})},{},Eg);if(s.ok){const i=await s.json(),r=new Set(e.itemIds);for(const[a,l]of Ca.entries()){const c=l.value;if(!c||c.runtimeId!==e.runtimeId||c.agentName!==e.appName)continue;const u=c.items.filter(d=>!r.has(d.id));Ca.set(a,{value:{...c,sets:f8(c.sets,u),items:u},updatedAt:Date.now()})}return i}t=new Error(await $t(s,"删除评测案例失败"))}throw t??new Error("删除评测案例失败")}async function DS(e,t,n){const{app:s,ep:i}=si(e),r=await dt(`/apps/${s}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},i);if(!r.ok&&r.status!==404)throw new Error(`delete session failed: ${r.status}`)}function Gte(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"="),s=window.atob(n),i=new Uint8Array(s.length);for(let r=0;rURL.revokeObjectURL(l),0)}async function m8(e,t,n,s,i){const{app:r,ep:a}=si(e),l=i==null?"":`?version=${encodeURIComponent(i)}`,c=`/apps/${encodeURIComponent(r)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/artifacts/${encodeURIComponent(s)}${l}`,u=await dt(c,{},a,Eg);if(!u.ok)throw new Error(await $t(u,"下载文件失败"));const d=await u.json(),f=d.inlineData??d.inline_data;if(!(f!=null&&f.data))throw new Error("文件内容不可用");const h=Gte(f.data),p=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength);return{blob:new Blob([p],{type:f.mimeType??f.mime_type??"application/octet-stream"}),downloadName:f.displayName??f.display_name??s}}async function g8(e,t,n,s,i){const{blob:r}=await m8(e,t,n,s,i);return URL.createObjectURL(r)}async function Kte(e){const t=await dt("/web/media/capabilities");if(!t.ok)throw new Error(await $t(t,"media capabilities failed"));return t.json()}async function b8(e,t,n,s){const{app:i}=si(e),r=new FormData;r.set("app_name",i),r.set("user_id",t),r.set("session_id",n),r.set("file",s);const a=await dt("/web/media",{method:"POST",body:r},{},Eg);if(!a.ok)throw new Error(await $t(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function PS(e,t,n){const{app:s}=si(e),i=`/web/media/${encodeURIComponent(s)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}/delete`,r=await dt(i,{method:"POST"});if(!r.ok&&r.status!==404)throw new Error(await $t(r,"media cleanup failed"))}function y8(e){try{const t=new URL(e);if(t.protocol!=="veadk-media:"||t.hostname!=="apps")return;const n=t.pathname.split("/").filter(Boolean).map(decodeURIComponent);return n.length!==7||n[1]!=="users"||n[3]!=="sessions"||n[5]!=="media"?void 0:`/web/media/${n.map(encodeURIComponent).filter((s,i)=>![1,3,5].includes(i)).join("/")}`}catch{return}}async function Qb(e,t){const n=y8(t);if(!n)throw new Error("Invalid VeADK media URI");const s=await dt(`${n}/delete`,{method:"POST"});if(!s.ok&&s.status!==404)throw new Error(await $t(s,"media cleanup failed"))}function x8(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=y8(t);if(!n)return t;const s=`${n}/content`;return Rn(`${Yb}${s}`)}async function l1(e,t,n){const{app:s,ep:i}=si(e);let r;if(i.runtimeId){const c=new URLSearchParams({runtimeId:i.runtimeId,sessionId:t,region:i.region??"cn-beijing"});if(n&&c.set("endTimeMs",String(Math.round(n))),r=await dt(`/web/runtime-trace?${c.toString()}`),r.status===404)throw new Error("该 Agent 暂未开启链路观测,请到控制台打开后使用。")}else r=await dt(`/dev/apps/${encodeURIComponent(s)}/debug/trace/session/${encodeURIComponent(t)}`,{},i);if(!r.ok)throw new Error(await $t(r,"加载调用链路失败"));const a=r.headers.get("content-type")??"";if(!a.includes("application/json")){const c=a.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${c}),请检查 Studio API 代理配置`)}const l=await r.json();if(!Array.isArray(l))throw new Error("trace failed: 返回格式无效");return l}async function BS(e){const t=await dt("/web/issue-feedback",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await $t(t,"问题反馈上报失败"));if((await t.json()).submitted!==!0)throw new Error("问题反馈上报失败:服务端未确认提交结果");return{submitted:!0}}function l2(e){const t=n=>({id:String(n.id??""),kind:n.kind==="skill"?"skill":"tool",name:String(n.name??""),custom:n.custom===!0,description:typeof n.description=="string"?n.description:void 0,skillSourceId:typeof n.skill_source_id=="string"?n.skill_source_id:void 0,version:typeof n.version=="string"?n.version:void 0});return{schemaVersion:Number(e.schema_version??1),revision:Number(e.revision??0),tools:Array.isArray(e.tools)?e.tools.map(n=>t(n)):[],skills:Array.isArray(e.skills)?e.skills.map(n=>t(n)):[]}}function c2(e,t,n){return`/harness/apps/${encodeURIComponent(e)}/users/${encodeURIComponent(t)}/sessions/${encodeURIComponent(n)}/capabilities`}async function US(e,t,n){const{app:s,ep:i}=si(e),r=await dt(c2(s,t,n),{},i);if(!r.ok)throw new Error(await $t(r,"读取会话能力失败"));return l2(await r.json())}async function u2(e){const{ep:t}=si(e),n=await dt("/harness/capabilities/tools",{},t);if(!n.ok)throw new Error(await $t(n,"读取内置工具失败"));return((await n.json()).tools??[]).map(i=>{var r;return((r=i.name)==null?void 0:r.trim())??""}).filter(Boolean)}async function qte(e){const{ep:t}=si(e),n=await dt("/harness/skills/spaces?region=all",{},t);if(!n.ok)throw new Error(await $t(n,"读取 Skill Space 失败"));return(await n.json()).items??[]}async function Yte(e,t,n){const{ep:s}=si(e),i=new URLSearchParams({region:n||"cn-beijing"}),r=`/harness/skills/spaces/${encodeURIComponent(t)}/skills?${i.toString()}`,a=await dt(r,{},s);if(!a.ok)throw new Error(await $t(a,"读取 Skill 列表失败"));return(await a.json()).items??[]}async function E8(e,t,n=1,s=20){const{ep:i}=si(e),r=new URLSearchParams({query:t,page_number:String(n),page_size:String(s)}),a=await dt(`/harness/skills/findskill?${r.toString()}`,{},i);if(!a.ok)throw new Error(await $t(a,"搜索 Skill Hub 失败"));const l=await a.json();return{items:l.items??[],totalCount:Number(l.totalCount??0)}}async function FS(e,t,n,s,i){const{app:r,ep:a}=si(e),l=await dt(c2(r,t,n),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:s.kind,name:s.name,skill_source_id:s.skillSourceId,description:s.description,version:s.version,expected_revision:i})},a);if(!l.ok)throw new Error(await $t(l,"添加会话能力失败"));return l2(await l.json())}async function v8(e,t,n,s,i){const{app:r,ep:a}=si(e),l=`${c2(r,t,n)}/${encodeURIComponent(s)}?expected_revision=${i}`,c=await dt(l,{method:"DELETE"},a);if(!c.ok)throw new Error(await $t(c,"移除会话能力失败"));return l2(await c.json())}async function w8(e,t,n=!0){const s=await dt(`/web/agent-info/${e}`,{},t);if(!s.ok)throw new Error(`agent-info failed: ${s.status}`);const i=await s.json();if(n&&!i.draft)try{const r=await dt(`/web/agent-draft/${e}`,{},t);if(r.ok){const a=await r.json();i.draft=a.draft}}catch{}return{appName:e,name:i.name??e,description:i.description??"",type:i.type,model:i.model??"",tools:i.tools??[],skillsPreviewSupported:Array.isArray(i.skills),skills:i.skills??[],subAgents:i.subAgents??[],components:i.components??[],searchSources:i.searchSources??[],graph:i.graph,draft:i.draft}}async function d2(e){const{app:t,ep:n}=si(e);return w8(t,n,!1)}async function Wte(e,t,n){let s=null;for(const i of ih(t)){const r={runtimeId:e,region:i};try{const a=r8(e,i),l=Wb.get(a);l&&l.expiresAt<=Date.now()&&Wb.delete(a);const c=Wb.get(a),u=n||(c==null?void 0:c.apps[0])||(await Sx("","",r))[0];if(!u)throw new Error("该 Runtime 未提供可预览的 Agent。");return w8(u,r)}catch(a){if(a instanceof sh||a instanceof Or&&!a.unsupported)throw a;s=a instanceof Error?a:new Error(String(a))}}throw s??new Error("该 Runtime 未提供可预览的 Agent。")}async function c1(e,t,n={},s={}){const i=typeof n=="string"?n:void 0,r=typeof n=="string"?s:n,a=rh(e,t||"cn-beijing",i??""),l=ah(Pc,a,_x);if(!r.force&&l)return l;const c=Pc.get(a);if(!r.force&&(c!=null&&c.promise))return c.promise;const u=Wte(e,t,i).then(d=>a2(Pc,a,d));Pc.set(a,{...c,promise:u,updatedAt:(c==null?void 0:c.updatedAt)??0});try{return await u}finally{const d=Pc.get(a);(d==null?void 0:d.promise)===u&&Pc.set(a,{value:d.value,updatedAt:d.updatedAt})}}function _8(e,t,n=""){return ah(Pc,rh(e,t||"cn-beijing",n),_x)}function S8(e,t,n=""){c1(e,t,n).catch(()=>{})}async function N8(e,t,n,s){const{app:i,ep:r}=si(e),a=new URLSearchParams({source:t,app_name:i,q:n,user_id:s}),l=await dt(`/web/search?${a.toString()}`,{},r);if(!l.ok)throw new Error(await $t(l,"Agent 检索失败"));return l.json()}async function T8(e,t){const{app:n}=si(e),s=await dt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!s.ok)throw new Error(`web search failed: ${s.status}`);return s.json()}async function*jm({appName:e,userId:t,sessionId:n,text:s,attachments:i=[],invocation:r,functionResponses:a=[],signal:l,sessionCapabilities:c=!1}){const{app:u,ep:d}=si(e),f=i.flatMap(b=>b.status&&b.status!=="ready"?[]:b.uri?[{fileData:{mimeType:b.mimeType,fileUri:b.uri,displayName:b.name},partMetadata:{veadkMedia:{id:b.id,uri:b.uri,name:b.name,mimeType:b.mimeType,sizeBytes:b.sizeBytes}}}]:b.data?[{inlineData:{mimeType:b.mimeType,data:b.data,displayName:b.name}}]:[]),h=r&&(r.skills.length>0||r.targetAgent)?r:void 0,p=[...f,...a.map(b=>({functionResponse:{id:b.id,name:b.name,response:b.response}})),...s.trim()?[{text:s}]:[]];if(h&&p.length>0){const b=p[0],v=b.partMetadata;p[0]={...b,partMetadata:{...v,veadkInvocation:h}}}const m=await dt(c?"/harness/run_sse":"/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:u,user_id:t,session_id:n,new_message:{role:"user",parts:p},streaming:!0,custom_metadata:h?{veadkInvocation:h}:void 0}),signal:l},d,0);if(!m.ok){const b=await $t(m,"运行会话失败");throw new Error(G0(`run_sse failed: ${m.status}:${b}`))}for await(const b of Zk(m)){const v=b;typeof v.error=="string"&&(v.error=G0(v.error)),typeof v.errorMessage=="string"&&(v.errorMessage=G0(v.errorMessage)),typeof v.error_message=="string"&&(v.error_message=G0(v.error_message)),yield v}}async function k8(e){const t=await dt("/web/identity/user-pools",{signal:e});if(!t.ok)throw new Error(await $t(t,"加载用户池失败"));const n=await t.json();if(!Array.isArray(n.items))throw new Error("用户池列表响应格式无效");return n.items.map(s=>{if(!s||typeof s!="object"||typeof s.uid!="string"||typeof s.name!="string"||typeof s.domain!="string"||typeof s.region!="string"||typeof s.isCurrent!="boolean")throw new Error("用户池列表响应格式无效");return s})}const Yp=new Map;async function vg(e,t,n,s){var u,d,f;const i=s==null?void 0:s.taskId,r=i?new AbortController:void 0;i&&r&&Yp.set(i,r);const a=()=>{i&&Yp.get(i)===r&&Yp.delete(i)};let l;try{(u=s==null?void 0:s.onStage)==null||u.call(s,{level:"info",phase:"upload",message:"正在上传代码包",pct:0}),l=await dt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:r==null?void 0:r.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:i,runtimeId:s==null?void 0:s.runtimeId,appName:s==null?void 0:s.appName,sessionStorage:s==null?void 0:s.sessionStorage,minInstance:s==null?void 0:s.minInstance,maxInstance:s==null?void 0:s.maxInstance,createEvaluationSets:s==null?void 0:s.createEvaluationSets,description:Lte((s==null?void 0:s.description)??""),authentication:s==null?void 0:s.authentication,im:s==null?void 0:s.im,envs:s==null?void 0:s.envs})},{},0),(d=s==null?void 0:s.onStage)==null||d.call(s,{level:"success",phase:"upload",message:"代码包上传完成",pct:100})}catch(h){throw a(),h}if(!l.ok){const h=await $t(l,"部署失败");throw a(),new Error(h)}let c=null;try{for await(const h of Zk(l)){const p=h;if(p&&p.done){c=p;break}p&&p.message&&((f=s==null?void 0:s.onStage)==null||f.call(s,p))}}catch(h){throw a(),h}if(a(),!c)throw new Error("部署失败:连接中断");if(!c.success)throw new Error(c.error||"部署失败");if(!c.agentName)throw new Error("部署失败:返回缺少 Agent 名称");if(!c.runtimeId&&!c.url)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:c.apikey??"",url:c.url??"",agentName:c.agentName,runtimeId:c.runtimeId,consoleUrl:c.consoleUrl,region:c.region,version:c.version,warnings:c.warnings,feishuChannel:c.feishuChannel}}async function A8(e){var n;const t=await dt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const s=await t.text().catch(()=>"");throw new Error(s||`取消部署失败 (${t.status})`)}(n=Yp.get(e))==null||n.abort(),Yp.delete(e)}async function Xte(e=Jk){const t=await dt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Rm={title:"AgentKit Studio",logoUrl:""},Zb={enabled:!1},Qv={studio:!1,version:"",provider:"volcengine",branding:Rm,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local",telemetry:Zb};function Qte(e){if(!e||typeof e!="object")return Zb;const t=e;if(!t.enabled)return Zb;const n=t.apmplus;if(!n||typeof n.aid!="number"||!Number.isFinite(n.aid)||typeof n.token!="string"||!n.token)return Zb;const s=t.studio??{};return{enabled:!0,provider:t.provider==="apmplus"?"apmplus":void 0,apmplus:{aid:n.aid,token:n.token,domain:typeof n.domain=="string"&&n.domain?n.domain:"apmplus.volces.com",env:typeof n.env=="string"&&n.env?n.env:"production"},studio:{deployId:typeof s.deployId=="string"?s.deployId:"",userPoolId:typeof s.userPoolId=="string"?s.userPoolId:"",applicationId:typeof s.applicationId=="string"?s.applicationId:"",functionId:typeof s.functionId=="string"?s.functionId:"",region:typeof s.region=="string"?s.region:"",project:typeof s.project=="string"?s.project:"",version:typeof s.version=="string"?s.version:""}}}async function C8(){var e,t;try{const n=await dt("/web/ui-config");if(!n.ok)return Qv;const s=await n.json(),i=typeof((e=s.branding)==null?void 0:e.logoUrl)=="string"?s.branding.logoUrl:Rm.logoUrl;return{studio:s.studio??!1,version:typeof s.version=="string"?s.version:"",provider:s.provider==="byteplus"?"byteplus":"volcengine",branding:{title:typeof((t=s.branding)==null?void 0:t.title)=="string"?s.branding.title:Rm.title,logoUrl:i?Rn(i):""},features:{...Qv.features,...s.features??{}},defaultView:s.defaultView??"chat",agentsSource:s.agentsSource==="cloud"?"cloud":"local",telemetry:Qte(s.telemetry)}}catch{return Qv}}const I8={role:"user",telemetry:{userId:""},capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function j8(){var n,s,i,r;const e=await dt("/web/access");if(!e.ok)throw new Error(`加载权限失败 (${e.status})`);const t=await e.json();if(!["admin","developer","user"].includes(t.role)||typeof((n=t.telemetry)==null?void 0:n.userId)!="string"||typeof((s=t.capabilities)==null?void 0:s.createAgents)!="boolean"||typeof((i=t.capabilities)==null?void 0:i.manageAgents)!="boolean"||!["all","mine"].includes((r=t.capabilities)==null?void 0:r.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function R8(e,t){const n=new URLSearchParams;e&&n.set("targetVersion",e),t&&n.set("startedAt",String(t));const s=n.size?`?${n.toString()}`:"",i=await dt(`/web/studio-update${s}`);if(!i.ok)throw new Error(`检查 Studio 更新失败 (${i.status})`);return await i.json()}async function O8(e){const t=await dt("/web/studio-update",{method:"POST",headers:{"Content-Type":"application/json","X-VeADK-Studio-Update":"1"},body:JSON.stringify({version:e})},{},Eg);if(!t.ok){let n="";try{const s=await t.json();n=typeof s.detail=="string"?s.detail:""}catch{n=""}throw new Error(n||`提交 Studio 更新失败 (${t.status})`)}return await t.json()}async function Tx(e={}){const t=new URLSearchParams({scope:e.scope??"all",page_size:String(e.pageSize??30),region:e.region??"all"});e.nextToken&&t.set("next_token",e.nextToken);const n=await dt(`/web/runtimes?${t.toString()}`);if(!n.ok){const i=await $t(n,"加载 Runtime 失败"),r=`加载 Runtime 失败(HTTP ${n.status})`;throw new Error(i===`加载 Runtime 失败 (${n.status})`?r:`${r}:${i}`)}const s=await n.json();return{runtimes:s.runtimes??[],nextToken:s.nextToken??""}}async function f2(e,t,n={}){try{const s={runtimeId:e,region:t};return n.retryProbe&&(s.retryProbe=!0),await Sx("","",s)}catch(s){if(s instanceof sh||s instanceof Or)throw s;return null}}async function M8(e,t,n={}){const s={runtimeId:e,region:t};n.retryProbe&&(s.retryProbe=!0);const i=await dt("/.well-known/agent-card.json",{},s),r=await a8(i);if(r==="runtime_access_denied")throw new sh;if(r==="runtime_private_endpoint_unreachable")throw new Or(n8);if(["runtime_proxy_connect_error","runtime_proxy_timeout"].includes(r))throw new Or(s8);if(i.status===404)return null;if(i.status===401||i.status===403)throw new Or("Runtime 服务拒绝了 A2A 探测请求,请检查 Runtime 的鉴权配置。");if(!i.ok)throw new Error(await $t(i,"读取 A2A Agent Card 失败"));const a=await i.json().catch(()=>null),l=typeof(a==null?void 0:a.url)=="string"?a.url.trim():"";return l?{name:typeof(a==null?void 0:a.name)=="string"?a.name:"",description:typeof(a==null?void 0:a.description)=="string"?a.description:"",endpoint:l}:null}async function L8(e,t){const n=new URLSearchParams({runtimeId:e,region:t}),s=await dt(`/web/runtime-api-key/reveal?${n.toString()}`,{method:"POST",cache:"no-store"});if(!s.ok)throw new Error(await $t(s,"读取 Runtime API Key 失败"));const i=await s.json();if(typeof i.apiKey!="string"||!i.apiKey)throw new Error("Runtime 未返回可用的 API Key");return i.apiKey}async function D8(e,t){const n=await dt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const s=await n.text().catch(()=>"");throw new Error(s||`删除失败 (${n.status})`)}}async function P8({runtimeId:e,region:t,signal:n}){const s=new URLSearchParams({runtimeId:e,region:t}),i=await dt(`/web/runtime-update-capability?${s.toString()}`,{signal:n});if(!i.ok)throw new Error(await $t(i,"检查 Runtime 更新能力失败"));return await i.json()}async function Zte(e,t){let n=null;for(const s of ih(t)){const i=await dt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(s)}`);if(i.ok)return i.json();n=new Error(await $t(i,"加载 Runtime 详情失败"))}throw n??new Error("加载 Runtime 详情失败")}async function h2(e,t="cn-beijing",n={}){const s=rh(e,t||"cn-beijing"),i=ah(Bc,s,_x);if(!n.force&&i)return i;const r=Bc.get(s);if(!n.force&&(r!=null&&r.promise))return r.promise;const a=Zte(e,t).then(l=>a2(Bc,s,l));Bc.set(s,{...r,promise:a,updatedAt:(r==null?void 0:r.updatedAt)??0});try{return await a}finally{const l=Bc.get(s);(l==null?void 0:l.promise)===a&&Bc.set(s,{value:l.value,updatedAt:l.updatedAt})}}function B8(e,t="cn-beijing"){return ah(Bc,rh(e,t||"cn-beijing"),_x)}function U8(e,t="cn-beijing"){h2(e,t).catch(()=>{})}async function kx(e){const t=await dt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await $t(t,"生成项目失败"));return t.json()}const Jte=19e4;async function F8(e){const t=await dt("/web/generated-agent-drafts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({requirement:e})},{},Jte);if(!t.ok)throw new Error(await $t(t,"生成 Agent 配置失败"));return vx(t,"生成 Agent 配置失败")}async function $8(e,t){const n=await dt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e,runtimeId:t==null?void 0:t.runtimeId,runtimeRegion:t==null?void 0:t.region})});if(!n.ok)throw new Error(await $t(n,"创建调试运行失败"));return vx(n,"创建调试运行失败")}async function H8(e,t){const n=await dt(`/web/generated-agent-test-runs/${e}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t})});if(!n.ok)throw new Error(await $t(n,"创建调试会话失败"));return(await vx(n,"创建调试会话失败")).id}async function z8(e,t){const n=await dt(`/web/generated-agent-test-runs/${encodeURIComponent(e)}/trace/session/${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await $t(n,"加载调试调用链路失败"));const s=await vx(n,"加载调试调用链路失败");if(!Array.isArray(s))throw new Error("加载调试调用链路失败:返回格式无效");return s}async function*V8({runId:e,userId:t,sessionId:n,text:s,signal:i}){const r=s.trim()?[{text:s}]:[],a=await dt(`/web/generated-agent-test-runs/${e}/run_sse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_id:t,session_id:n,new_message:{role:"user",parts:r},streaming:!0}),signal:i},{},0);if(!a.ok)throw new Error(await $t(a,"调试运行失败"));for await(const l of Zk(a))yield l}async function md(e){const t=await dt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await $t(t,"清理调试运行失败"))}const ene=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Rm,DEFAULT_STUDIO_ACCESS:I8,RuntimeAccessDeniedError:sh,RuntimeProbeError:Or,addSessionCapability:FS,cancelAgentkitDeployment:A8,clearMessageFeedbackCache:QB,clearRemoteApps:JB,componentSearch:N8,createGeneratedAgentTestRun:$8,createGeneratedAgentTestSession:H8,createSession:a1,deleteAgentFeedbackCases:h8,deleteGeneratedAgentTestRun:md,deleteMedia:Qb,deleteRuntime:D8,deleteSession:DS,deleteSessionMedia:PS,deployAgentkitProject:vg,downloadArtifact:p8,fetchRemoteApps:Sx,generateAgentDraftFromRequirement:F8,generateAgentProject:kx,getAgentFeedbackCases:Nx,getAgentInfo:d2,getAgentOptimizations:c8,getAutomaticEvaluationStatuses:l8,getCachedAgentFeedbackCases:u8,getCachedRuntimeAgentInfo:_8,getCachedRuntimeDetail:B8,getGeneratedAgentTestTrace:z8,getMediaCapabilities:Kte,getMyRuntimes:Xte,getRuntimeAgentInfo:c1,getRuntimeDetail:h2,getRuntimeUpdateCapability:P8,getRuntimes:Tx,getSession:o1,getSessionCapabilities:US,getSessionTrace:l1,getStudioAccess:j8,getStudioUpdateStatus:R8,getUiConfig:C8,listApps:t8,listIdentityUserPools:k8,listSessionBuiltinTools:u2,listSessionSkillSpaces:qte,listSessionSkillsInSpace:Yte,listSessions:o2,mediaContentUrl:x8,prefetchAgentFeedbackCases:LS,prefetchRuntimeAgentInfo:S8,prefetchRuntimeDetail:U8,previewArtifact:g8,probeRuntimeA2a:M8,probeRuntimeApps:f2,refreshAgentFeedbackCases:d8,registerRemoteApp:ZB,removeSessionCapability:v8,revealRuntimeApiKey:L8,runGeneratedAgentTestSSE:V8,runSSE:jm,searchSessionPublicSkills:E8,startStudioUpdate:O8,studioFetch:e8,submitIssueFeedback:BS,submitMessageFeedback:o8,uploadMedia:b8,upsertCachedAgentFeedbackCase:Xb,webSearch:T8},Symbol.toStringTag,{value:"Module"}));function WR(e){return e.blocks.flatMap(t=>t.kind==="tool"?[{name:t.name,args:t.args,response:t.response,done:t.done}]:[])}function tne(e){const t=e.attributes;return String(t["invocation.id"]??t["gen_ai.invocation.id"]??t["gcp.vertex.agent.invocation_id"]??"")}function nne(e,t){if(!t)return e;const n=new Set(e.filter(i=>tne(i)===t).map(i=>i.trace_id)),s=e.filter(i=>n.has(i.trace_id));return s.length>0?s:e}function Zv(e){return!!(e&&[...e.tools,...e.skills].some(t=>t.custom))}const sne="send_a2ui_json_to_client",ine="validated_a2ui_json",$S="adk_request_credential",XR="transfer_to_agent";function rne(e){var s,i,r,a;const t=e,n=((s=t==null?void 0:t.exchangedAuthCredential)==null?void 0:s.oauth2)??((i=t==null?void 0:t.exchanged_auth_credential)==null?void 0:i.oauth2)??((r=t==null?void 0:t.rawAuthCredential)==null?void 0:r.oauth2)??((a=t==null?void 0:t.raw_auth_credential)==null?void 0:a.oauth2);return(n==null?void 0:n.authUri)??(n==null?void 0:n.auth_uri)}function Oa(){return{blocks:[],liveStart:0}}const QR=e=>e.functionCall??e.function_call,HS=e=>e.functionResponse??e.function_response;function ane(e){if(!e||typeof e!="object")return"";const t=e,n=t.agentName??t.agent_name;return typeof n=="string"?n:""}function one(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function G8(e){const t=[];for(const[n,s]of e.entries()){const i=s.partMetadata??s.part_metadata,r=i==null?void 0:i.veadkTransport;if((r==null?void 0:r.hidden)===!0)continue;const a=i==null?void 0:i.veadkMedia;if(typeof(a==null?void 0:a.uri)=="string"){t.push({id:String(a.id??a.uri),mimeType:typeof a.mimeType=="string"?a.mimeType:void 0,uri:a.uri,name:typeof a.name=="string"?a.name:void 0,sizeBytes:typeof a.sizeBytes=="number"?a.sizeBytes:void 0});continue}const l=s.inlineData??s.inline_data;if(l&&l.data){t.push({id:`inline-${n}-${l.displayName??l.display_name??"media"}`,mimeType:l.mimeType??l.mime_type,data:one(l.data),name:l.displayName??l.display_name});continue}const c=s.fileData??s.file_data,u=(c==null?void 0:c.fileUri)??(c==null?void 0:c.file_uri);c&&u&&t.push({id:u,mimeType:c.mimeType??c.mime_type,uri:u,name:c.displayName??c.display_name})}return t}function zS(e){const t=e.partMetadata??e.part_metadata,n=t==null?void 0:t.veadkTransport;return(n==null?void 0:n.hideText)===!0?void 0:e.text}const lne=new Set(["llm","sequential","parallel","loop","a2a"]);function cne(e){var t;for(const n of e){const s=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!s||typeof s!="object")continue;const i=s,r=Array.isArray(i.skills)?i.skills.flatMap(c=>{if(!c||typeof c!="object")return[];const u=c;return typeof u.name=="string"?[{name:u.name,description:typeof u.description=="string"?u.description:""}]:[]}):[];let a;const l=i.targetAgent;if(l&&typeof l=="object"){const c=l,u=c.type;typeof c.name=="string"&&typeof u=="string"&&lne.has(u)&&Array.isArray(c.path)&&(a={name:c.name,description:typeof c.description=="string"?c.description:"",type:u,path:c.path.filter(d=>typeof d=="string")})}if(r.length>0||a)return{skills:r,targetAgent:a}}}function une(e,t){if(!t.length)return;const n=e[e.length-1];(n==null?void 0:n.kind)==="attachment"?n.files.push(...t):e.push({kind:"attachment",files:t})}function dne(e,t){if(!t.length)return;const n=e[e.length-1];if((n==null?void 0:n.kind)==="artifact"){for(const s of t)n.files.some(i=>i.filename===s.filename&&i.version===s.version)||n.files.push(s);return}e.push({kind:"artifact",files:t})}function ZR(e,t,n){const s=e[e.length-1];s&&s.kind===t?s.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function K0(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function Tf(e,t){var l,c,u,d,f,h;const n=e.blocks.map(p=>({...p}));let s=e.liveStart;const i=((l=t.content)==null?void 0:l.parts)??[],r=i.some(p=>QR(p)||HS(p));if(t.partial&&!r){for(const p of i){const m=zS(p);typeof m=="string"&&m&&ZR(n,p.thought?"thinking":"text",m)}return{blocks:n,liveStart:s}}n.length=s;for(const p of i){const m=QR(p),b=HS(p),v=G8([p]),y=zS(p);if(typeof y=="string"&&y)ZR(n,p.thought?"thinking":"text",y);else if(v.length)K0(n),une(n,v);else if(m)if(K0(n),m.name===XR){const x=ane(m.args)||((c=t.actions)==null?void 0:c.transferToAgent)||((u=t.actions)==null?void 0:u.transfer_to_agent)||"未知 Agent";n.push({kind:"agent-transfer",agentName:x,done:!1})}else if(m.name===$S){const x=m.args??{},E=x.authConfig??x.auth_config??x,S=String(x.functionCallId??x.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:m.id??"",label:S,authUri:rne(E),authConfig:E,done:!1})}else n.push({kind:"tool",name:m.name??"",args:m.args,done:!1});else if(b){if(K0(n),b.name===XR)for(let x=n.length-1;x>=0;x--){const E=n[x];if(E.kind==="agent-transfer"&&!E.done){E.done=!0;break}}if(b.name===$S)for(let x=n.length-1;x>=0;x--){const E=n[x];if(E.kind==="auth"&&!E.done){E.done=!0;break}}for(let x=n.length-1;x>=0;x--){const E=n[x];if(E.kind==="tool"&&!E.done&&E.name===b.name){E.done=!0,E.response=b.response;break}}if(b.name===sne){const x=((d=b.response)==null?void 0:d[ine])??[];if(x.length){const E=n[n.length-1];E&&E.kind==="a2ui"?E.messages.push(...x):n.push({kind:"a2ui",messages:x})}}}}const a=((f=t.actions)==null?void 0:f.artifactDelta)??((h=t.actions)==null?void 0:h.artifact_delta);return a&&dne(n,Object.entries(a).map(([p,m])=>({filename:p,version:m}))),K0(n),s=n.length,{blocks:n,liveStart:s}}function fne(e,t={}){var i,r;const n=[];let s=Oa();for(const a of e)if(a.author==="user"){const c=((i=a.content)==null?void 0:i.parts)??[];if(c.some(p=>{var m;return((m=HS(p))==null?void 0:m.name)===$S})){for(let p=n.length-1;p>=0;p--)if(n[p].role==="assistant"){for(let m=n[p].blocks.length-1;m>=0;m--){const b=n[p].blocks[m];if(b.kind==="auth"){b.done=!0;break}}break}}const u=c.map(zS).filter(p=>!!p).join(""),d=G8(c),f=cne(c);if(!u&&!d.length&&!f){s=Oa();continue}const h=[];f&&h.push({kind:"invocation",value:f}),d.length&&h.push({kind:"attachment",files:d}),u&&h.push({kind:"text",text:u}),n.push({role:"user",blocks:h,meta:{ts:a.timestamp}}),s=Oa()}else{const c=a.author??"";let u=n[n.length-1];(!u||u.role!=="assistant"||c&&((r=u.meta)==null?void 0:r.author)!==c)&&(u={role:"assistant",blocks:[],meta:{author:c||void 0}},n.push(u),s=Oa()),s=Tf(s,a),u.blocks=s.blocks;const d=a.usageMetadata??a.usage_metadata,f=u.meta??(u.meta={});c&&(f.author=c),d!=null&&d.totalTokenCount&&(f.tokens=d.totalTokenCount),a.timestamp&&(f.ts=a.timestamp),a.id&&(f.eventId=a.id);const h=a.invocationId??a.invocation_id;h&&(f.invocationId=h)}for(const a of n){const l=a.meta,c=l==null?void 0:l.eventId;if(!c)continue;const u=t[`veadk_feedback:${c}`];if(!u||typeof u!="object")continue;const d=u;d.rating!=="good"&&d.rating!=="bad"||(l.feedback=u)}return n}function hne(e){var t,n;for(const s of e??[])if(s.author==="user"||((t=s.content)==null?void 0:t.role)==="user"){const i=(((n=s.content)==null?void 0:n.parts)??[]).map(r=>r.text).find(Boolean);if(i)return i}return"新会话"}const pne=50,JR=48;function mne(e){return(e.events??[]).flatMap(t=>{var i,r;const s=(((i=t.content)==null?void 0:i.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return s?[{text:s,role:t.author??((r=t.content)==null?void 0:r.role)??"",ts:t.timestamp}]:[]})}function gne(e){var t,n;for(const s of e.events??[])if(s.author==="user"||((t=s.content)==null?void 0:t.role)==="user"){const i=(((n=s.content)==null?void 0:n.parts)??[]).map(r=>r.text).find(Boolean);if(i)return i}return"未命名会话"}function bne(e,t,n){const s=Math.max(0,t-JR),i=Math.min(e.length,t+n+JR);return(s>0?"…":"")+e.slice(s,i).trim()+(i{var c;if((c=l.events)!=null&&c.length)return l;try{return await o1(t,e,l.id)}catch{return l}})),a=[];for(const l of r)for(const{text:c,role:u,ts:d}of mne(l)){const f=c.toLowerCase().indexOf(s);if(f!==-1){a.push({type:"session",appId:t,sessionId:l.id,title:gne(l),snippet:bne(c,f,s.length),role:u,ts:d??l.lastUpdateTime});break}}return a.sort((l,c)=>(c.ts??0)-(l.ts??0)),a.slice(0,pne)}async function xne(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await T8(e,t.trim())}catch(a){const l=String(a);return{results:[],note:l.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${l}`}}const{mounted:s,results:i,error:r}=n;return s?r?{results:[],note:r}:{results:i.map((a,l)=>({type:"web",index:l,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function Ene(e,t,n,s){if(!t||!s.trim())return{results:[]};const i=await N8(t,e,s.trim(),n);if(!i.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(i.error)return{results:[],note:i.error};const r=i.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:i.results.map((a,l)=>e==="knowledge"?{type:"knowledge",index:l,content:a.content,sourceName:r,sourceType:i.sourceType}:{type:"memory",index:l,content:a.content,sourceName:r,sourceType:i.sourceType,author:a.author,ts:a.timestamp})}}async function vne(e,t,n){return e==="session"?{results:await yne(n.userId,n.appId,t)}:e==="web"?xne(n.appId,t):Ene(e,n.appId,n.userId,t)}function K8({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),o.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function wne({open:e}){return o.jsx("svg",{className:`search-source-chevron ${e?"open":""}`,viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function _ne({active:e=!1,onClick:t}){return o.jsxs("button",{className:`new-chat${e?" is-active":""}`,onClick:t,"aria-label":"搜索","aria-current":e?"page":void 0,title:"搜索",children:[o.jsx(K8,{}),o.jsx("span",{className:"sidebar-nav-label",children:"搜索"})]})}function Sne(e,t,n){const s=!!e,i=new Set((t==null?void 0:t.searchSources)??[]),r=a=>s?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:s,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:s&&i.has("web"),description:"通过 web_search 工具检索",unavailableLabel:r(" web_search 工具")},{id:"knowledge",label:"知识库",ready:s&&i.has("knowledge"),unavailableLabel:r("知识库")},{id:"memory",label:"长期记忆",ready:s&&i.has("memory"),unavailableLabel:r("长期记忆")}]}function u1(e){return{context_search:"Context Search",local:"本地",mem0:"Mem0",milvus:"Milvus",opensearch:"OpenSearch",openviking:"OpenViking",redis:"Redis",tos_vector:"TOS Vector",viking:"VikingDB"}[e.toLowerCase()]??e}function eO(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function Nne({userId:e,appId:t,agentInfo:n,capabilitiesLoading:s,agentLabel:i,onOpenSession:r}){var F,C;const[a,l]=g.useState("session"),[c,u]=g.useState(""),[d,f]=g.useState([]),[h,p]=g.useState(),[m,b]=g.useState(!1),[v,y]=g.useState(!1),[x,E]=g.useState(!1),w=g.useRef(0),S=g.useRef(null),_=Sne(t,n,s),T=_.find(I=>I.id===a),k=a==="knowledge"?(F=n==null?void 0:n.components)==null?void 0:F.find(I=>I.source==="knowledgebase"||I.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(I=>I.source==="long_term_memory"||I.kind==="memory"):void 0;g.useEffect(()=>{w.current+=1,l("session"),f([]),p(void 0),y(!1),b(!1),E(!1)},[t]),g.useEffect(()=>{if(!x)return;function I(D){var $;($=S.current)!=null&&$.contains(D.target)||E(!1)}return document.addEventListener("pointerdown",I),()=>document.removeEventListener("pointerdown",I)},[x]);async function A(I,D){var se;const $=I.trim();if(!$||!((se=_.find(P=>P.id===D))!=null&&se.ready))return;const O=++w.current;b(!0),y(!0);let te;try{te=await vne(D,$,{userId:e,appId:t})}catch(P){const Q=P instanceof Error?P.message:String(P);te={results:[],note:`搜索失败:${Q}`}}O===w.current&&(f(te.results),p(te.note),b(!1))}function j(I){w.current+=1,u(I),f([]),p(void 0),y(!1),b(!1)}function R(I){w.current+=1,l(I),E(!1),f([]),p(void 0),y(!1),b(!1)}const B=!!(T!=null&&T.ready),z=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(k==null?void 0:k.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(k==null?void 0:k.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",L=k!=null&&k.backend?u1(k.backend):"";return o.jsxs("div",{className:"search",children:[o.jsxs("div",{className:"search-box",children:[o.jsxs("div",{className:"search-source-picker-wrap",ref:S,children:[o.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(T==null?void 0:T.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":x,onClick:()=>E(I=>!I),children:[o.jsx("span",{children:(T==null?void 0:T.label)??"搜索类型"}),L&&o.jsx("small",{children:L}),o.jsx(wne,{open:x})]}),x&&o.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:_.map(I=>{var O,te;const D=I.id==="knowledge"?(O=n==null?void 0:n.components)==null?void 0:O.find(se=>se.source==="knowledgebase"||se.kind==="knowledgebase"):I.id==="memory"?(te=n==null?void 0:n.components)==null?void 0:te.find(se=>se.source==="long_term_memory"||se.kind==="memory"):void 0,$=D?[D.name,D.backend?u1(D.backend):""].filter(Boolean).join(" · "):I.ready?I.description:I.unavailableLabel;return o.jsxs("button",{type:"button",role:"option","aria-selected":a===I.id,disabled:!I.ready,onClick:()=>R(I.id),children:[o.jsx("span",{children:I.label}),$&&o.jsx("small",{children:$})]},I.id)})})]}),o.jsx("span",{className:"search-box-divider","aria-hidden":!0}),o.jsx("input",{className:"search-input",value:c,onChange:I=>j(I.target.value),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),A(c,a))},placeholder:z,disabled:!B,autoFocus:!0}),o.jsx("button",{className:"search-go",onClick:()=>void A(c,a),disabled:!c.trim()||m,"aria-label":"搜索",children:m?o.jsx(yn,{className:"icon spin"}):o.jsx(K8,{className:"icon"})})]}),o.jsx("div",{className:"search-results",children:B?v?m?null:h?o.jsx("div",{className:"search-empty",children:h}):d.length===0&&v?o.jsxs("div",{className:"search-empty",children:["未找到匹配「",c.trim(),"」的结果。"]}):d.map((I,D)=>o.jsx(Tne,{result:I,agentLabel:i,onOpen:r},D)):o.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):o.jsx("div",{className:"search-empty",children:t?s?"正在读取当前 Agent 的检索能力…":(T==null?void 0:T.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function Tne({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return o.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[o.jsx(zB,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title}),o.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${eO(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return o.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[o.jsx(xx,{className:"search-result-icon"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsx("span",{className:"search-result-title",children:e.title||e.url}),o.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&o.jsx(Im,{className:"search-result-ext"})]})]}),e.summary&&o.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(tO,{source:"knowledge"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${u1(e.sourceType)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return o.jsxs("div",{className:"search-result search-result-static",children:[o.jsx(tO,{source:"memory"}),o.jsxs("div",{className:"search-result-body",children:[o.jsxs("div",{className:"search-result-head",children:[o.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),o.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${u1(e.sourceType)}`:"",e.ts?` · ${eO(e.ts)}`:""]})]}),o.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function tO({source:e,className:t="search-result-icon"}){return e==="knowledge"?o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M5 5.5h10.5A3.5 3.5 0 0 1 19 9v9.5H8.5A3.5 3.5 0 0 1 5 15V5.5Z"}),o.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):o.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),o.jsx("path",{d:"M12 8a4 4 0 1 0 4 4M12 11.3a.7.7 0 1 0 0 1.4.7.7 0 0 0 0-1.4Z"})]})}function su({className:e="icon"}){return o.jsxs("svg",{className:`${e} sidebar-agent-face`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"4.25",y:"5.25",width:"15.5",height:"13.5",rx:"4.75"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M8.5 10.7v2"}),o.jsx("path",{className:"sidebar-agent-face__eye",d:"M15.5 10.7v2"})]})}function kne({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"9.3",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 10.2 11.3 4.8c.5-.8 1.7-.45 1.7.5v3.8h4.2a2.1 2.1 0 0 1 2.04 2.6l-1.4 5.75A2.1 2.1 0 0 1 15.8 19H8"})]})}function Ane({filled:e=!1,...t}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"4.5",height:"10.2",rx:"1.5"}),o.jsx("path",{d:"M8 13.8 11.3 19.2c.5.8 1.7.45 1.7-.5v-3.8h4.2a2.1 2.1 0 0 0 2.04-2.6l-1.4-5.75A2.1 2.1 0 0 0 15.8 5H8"})]})}function q8(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5.25 4.25h9.5a2.5 2.5 0 0 1 2.5 2.5v3.5"}),o.jsx("path",{d:"M13.25 17.75h-8a2.5 2.5 0 0 1-2.5-2.5v-8a3 3 0 0 1 3-3"}),o.jsx("path",{d:"M7 8.25h5.5M7 11.75h3.25"}),o.jsx("path",{d:"m13.35 16.65.42-2.16 4.76-4.76a1.35 1.35 0 0 1 1.91 1.91l-4.76 4.76-2.33.25Z"}),o.jsx("path",{d:"m17.65 10.6 1.9 1.9"})]})}const p2="/assets/logo-DCsNZy-k.svg",m2="data:image/svg+xml,%3csvg%20width='28'%20height='23'%20viewBox='0%200%2028%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17.1957%209.44218C17.0253%209.58161%2016.7774%209.47317%2016.7774%209.24079V8.01696V0.611967C16.7774%200.395085%2016.514%200.271152%2016.3591%200.410576L6.04172%209.16334C5.87132%209.30276%205.62345%209.19432%205.62345%208.96194V2.98218C5.62345%202.81178%205.48403%202.67235%205.31362%202.67235H0.309832C0.139424%202.67235%200%202.81178%200%202.98218V21.7115C0%2021.9284%200.263357%2022.0524%200.418273%2021.9129L10.7202%2013.1602C10.8906%2013.0207%2011.1385%2013.1292%2011.1385%2013.3616V22.0059C11.1385%2022.2228%2011.4018%2022.3467%2011.5567%2022.2073L21.8586%2013.4545C22.0291%2013.3151%2022.2769%2013.4235%2022.2769%2013.6559V19.6357C22.2769%2019.8061%2022.4163%2019.9455%2022.5868%2019.9455H27.5905C27.7609%2019.9455%2027.9004%2019.8061%2027.9004%2019.6357V0.890816C27.9004%200.673934%2027.637%200.550001%2027.4821%200.689425L17.1957%209.44218Z'%20fill='%230066FC'/%3e%3c/svg%3e",nO="(max-width: 860px)";function Cne(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"7",r:"2.25"}),o.jsx("circle",{cx:"7",cy:"17",r:"2.25"}),o.jsx("circle",{cx:"17",cy:"17",r:"2.25"})]})}function Ine(e){let t=2166136261;for(const s of e)t^=s.charCodeAt(0),t=Math.imul(t,16777619);const n=t>>>0;return{"--avatar-hue-a":194+n%22,"--avatar-hue-b":214+(n>>>6)%25,"--avatar-hue-c":176+(n>>>12)%25,"--avatar-x":`${22+(n>>>18)%55}%`,"--avatar-y":`${18+(n>>>24)%58}%`}}const jne={admin:"管理员",developer:"开发者",user:"普通用户"};function sO({role:e}){const t=jne[e];return o.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function Rne({version:e,onClose:t}){return g.useEffect(()=>{const n=s=>{s.key==="Escape"&&t()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t]),wi.createPortal(o.jsx("div",{className:"confirm-scrim",onMouseDown:t,children:o.jsxs("section",{className:"confirm-box system-info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"system-info-title",onMouseDown:n=>n.stopPropagation(),children:[o.jsxs("header",{className:"system-info-head",children:[o.jsx("h2",{id:"system-info-title",children:"系统信息"}),o.jsx("button",{type:"button",className:"icon-btn",onClick:t,"aria-label":"关闭系统信息",autoFocus:!0,children:o.jsx(Oi,{className:"icon","aria-hidden":"true"})})]}),o.jsx("dl",{className:"system-info-meta",children:o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:e||"—"})]})})]})}),document.body)}function One({access:e,userInfo:t,version:n,onLogout:s}){const[i,r]=g.useState(!1),[a,l]=g.useState(!1),[c,u]=g.useState("");if(!t)return null;const d=_te(t),f=typeof t.email=="string"?t.email:"",h=(d||"U").slice(0,1).toUpperCase(),p=Ine(d||f||h),m=Ste(t),b=m===c?"":m;return o.jsxs("div",{className:"sidebar-user",children:[o.jsxs("button",{className:"sidebar-user-btn",onClick:()=>r(v=>!v),title:f?`${d} +${f}`:d,children:[o.jsxs("span",{className:`account-avatar${b?" has-image":""}`,style:p,children:[h,b?o.jsx("img",{className:"account-avatar-image",src:b,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(b)}):null]}),o.jsxs("span",{className:"sidebar-user-identity",children:[o.jsxs("span",{className:"sidebar-user-primary",children:[o.jsx("span",{className:"sidebar-user-name",children:d}),o.jsx(sO,{role:e.role})]}),f&&f!==d&&o.jsx("span",{className:"sidebar-user-email",children:f})]})]}),i&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>r(!1)}),o.jsxs("div",{className:"account-pop sidebar-user-pop",children:[o.jsxs("div",{className:"account-head",children:[o.jsxs("span",{className:`account-avatar account-avatar--lg${b?" has-image":""}`,style:p,children:[h,b?o.jsx("img",{className:"account-avatar-image",src:b,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>u(b)}):null]}),o.jsxs("div",{className:"account-id",children:[o.jsxs("div",{className:"account-name-row",children:[o.jsx("div",{className:"account-name",children:d}),o.jsx(sO,{role:e.role})]}),f&&f!==d&&o.jsx("div",{className:"account-sub",children:f})]})]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{r(!1),l(!0)},children:[o.jsx(bc,{className:"icon"})," 系统信息"]}),o.jsxs("button",{type:"button",className:"account-action",onClick:()=>{r(!1),s()},children:[o.jsx(Yee,{className:"icon"})," 退出登录"]})]})]}),a?o.jsx(Rne,{version:n,onClose:()=>l(!1)}):null]})}function Mne({branding:e,cloudProvider:t,sessions:n,currentSessionId:s,activePage:i,features:r,access:a,streamingSids:l,evaluatingSids:c,onNewChat:u,onSearch:d,onQuickCreate:f,onSkillCenter:h,onAddAgent:p,onMyAgents:m,onApplications:b,onIssueFeedback:v,onPickSession:y,onDeleteSession:x,userInfo:E,version:w,onLogout:S}){const _=F=>(r==null?void 0:r[F])!==!1,[T,k]=g.useState(null),A=g.useRef(typeof window<"u"&&window.matchMedia(nO).matches),[j,R]=g.useState(A.current),B=[...n].sort((F,C)=>(C.lastUpdateTime??0)-(F.lastUpdateTime??0)),z=()=>{A.current=!1,R(F=>!F),k(null)};g.useEffect(()=>{const F=window.matchMedia(nO),C=I=>{I.matches?R(D=>D||(A.current=!0,!0)):A.current&&(A.current=!1,R(!1))};return F.addEventListener("change",C),()=>F.removeEventListener("change",C)},[]);const L=t==="byteplus"?m2:p2;return o.jsxs("aside",{className:`sidebar ${j?"is-collapsed":""}`,children:[o.jsxs("div",{className:"sidebar-top",children:[o.jsxs("div",{className:"sidebar-brand-row",children:[o.jsxs("button",{type:"button",className:"brand",onClick:u,"aria-label":"返回首页",title:"返回首页",children:[o.jsx("img",{className:"brand-logo",src:e.logoUrl||L,width:20,height:20,alt:"","aria-hidden":!0}),o.jsx("span",{className:"brand-title",children:e.title})]}),o.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:z,"aria-label":j?"展开侧边栏":"收起侧边栏",title:j?"展开侧边栏":"收起侧边栏",children:j?o.jsx(nte,{className:"icon"}):o.jsx(tte,{className:"icon"})})]}),_("newChat")&&o.jsxs("button",{className:`new-chat new-chat--conversation${i==="new-chat"?" is-active":""}`,onClick:u,"aria-label":"新会话","aria-current":i==="new-chat"?"page":void 0,title:"新会话",children:[o.jsx(ji,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),o.jsxs("button",{className:`new-chat new-chat--agents${i==="agents"?" is-active":""}`,onClick:m,"aria-label":"智能体","aria-current":i==="agents"?"page":void 0,title:"智能体",children:[o.jsx(su,{}),o.jsx("span",{className:"sidebar-nav-label",children:"智能体"})]}),_("search")&&o.jsx(_ne,{active:i==="search",onClick:d}),o.jsxs("button",{className:`new-chat new-chat--applications${i==="applications"?" is-active":""}`,onClick:b,"aria-label":"自动化","aria-current":i==="applications"?"page":void 0,title:"自动化",children:[o.jsx(Cne,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"自动化"}),o.jsx("span",{className:"sidebar-beta-badge",children:"Beta"})]})]}),_("history")&&o.jsxs("div",{className:"sidebar-history",children:[o.jsxs("div",{className:"history-head",children:[o.jsx("span",{children:"历史会话"}),_("newChat")&&o.jsx("button",{type:"button",className:"history-new-chat",onClick:u,"aria-label":"新建会话",title:"新建会话",children:o.jsx(ji,{className:"icon"})})]}),o.jsxs("div",{className:"history-list",children:[B.length===0&&o.jsx("div",{className:"history-empty",children:"暂无会话"}),B.map(F=>{const C=hne(F.events),I=(l==null?void 0:l.has(F.id))===!0,D=!I&&(c==null?void 0:c.has(F.id))===!0;return o.jsxs("div",{className:`history-item ${F.id===s?"active":""}`,children:[o.jsxs("button",{className:"history-item-btn",onClick:()=>y(F.id),"aria-current":F.id===s?"page":void 0,title:C,children:[I&&o.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),o.jsx("span",{className:"history-title",children:C}),D&&o.jsxs("span",{className:"history-evaluating-status",title:"正在自动评测",children:[o.jsx("span",{className:"history-evaluating","aria-hidden":"true"}),"评测中"]})]}),o.jsx("button",{className:"history-more",title:"更多",onClick:()=>k($=>$===F.id?null:F.id),children:o.jsx(Oee,{className:"icon"})}),T===F.id&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>k(null)}),o.jsx("div",{className:"history-menu",children:o.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{k(null),x(F.id)},children:[o.jsx(dc,{className:"icon"})," 删除"]})})]})]},F.id)})]})]}),o.jsxs("div",{className:"sidebar-footer",children:[o.jsxs("button",{type:"button",className:`sidebar-feedback${i==="feedback"?" is-active":""}`,onClick:v,"aria-label":"问题反馈","aria-current":i==="feedback"?"page":void 0,title:"问题反馈",children:[o.jsx(q8,{className:"icon"}),o.jsx("span",{className:"sidebar-nav-label",children:"问题反馈"})]}),o.jsx(One,{access:a,userInfo:E,version:w,onLogout:S})]})]})}function ii(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,s;n{}};function Ax(){for(var e=0,t=arguments.length,n={},s;e=0&&(s=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:s}})}Jb.prototype=Ax.prototype={constructor:Jb,on:function(e,t){var n=this._,s=Dne(e+"",n),i,r=-1,a=s.length;if(arguments.length<2){for(;++r0)for(var n=new Array(i),s=0,i,r;s=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),rO.hasOwnProperty(t)?{space:rO[t],local:e}:e}function Bne(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===VS&&t.documentElement.namespaceURI===VS?t.createElement(e):t.createElementNS(n,e)}}function Une(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Y8(e){var t=Cx(e);return(t.local?Une:Bne)(t)}function Fne(){}function g2(e){return e==null?Fne:function(){return this.querySelector(e)}}function $ne(e){typeof e!="function"&&(e=g2(e));for(var t=this._groups,n=t.length,s=new Array(n),i=0;i=E&&(E=x+1);!(S=v[E])&&++E=0;)(a=s[i])&&(r&&a.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(a,r),r=a);return this}function fse(e){e||(e=hse);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,s=n.length,i=new Array(s),r=0;rt?1:e>=t?0:NaN}function pse(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function mse(){return Array.from(this)}function gse(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?kse:typeof t=="function"?Cse:Ase)(e,t,n??"")):kf(this.node(),e)}function kf(e,t){return e.style.getPropertyValue(t)||J8(e).getComputedStyle(e,null).getPropertyValue(t)}function jse(e){return function(){delete this[e]}}function Rse(e,t){return function(){this[e]=t}}function Ose(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Mse(e,t){return arguments.length>1?this.each((t==null?jse:typeof t=="function"?Ose:Rse)(e,t)):this.node()[e]}function e9(e){return e.trim().split(/^|\s+/)}function b2(e){return e.classList||new t9(e)}function t9(e){this._node=e,this._names=e9(e.getAttribute("class")||"")}t9.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function n9(e,t){for(var n=b2(e),s=-1,i=t.length;++s=0&&(n=t.slice(s+1),t=t.slice(0,s)),{type:t,name:n}})}function lie(e){return function(){var t=this.__on;if(t){for(var n=0,s=-1,i=t.length,r;n()=>e;function GS(e,{sourceEvent:t,subject:n,target:s,identifier:i,active:r,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}GS.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function yie(e){return!e.ctrlKey&&!e.button}function xie(){return this.parentNode}function Eie(e,t){return t??{x:e.x,y:e.y}}function vie(){return navigator.maxTouchPoints||"ontouchstart"in this}function l9(){var e=yie,t=xie,n=Eie,s=vie,i={},r=Ax("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",p).filter(s).on("touchstart.drag",v).on("touchmove.drag",y,bie).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,S){if(!(d||!e.call(this,w,S))){var _=E(this,t.call(this,w,S),w,S,"mouse");_&&(jr(w.view).on("mousemove.drag",m,Om).on("mouseup.drag",b,Om),a9(w.view),Jv(w),u=!1,l=w.clientX,c=w.clientY,_("start",w))}}function m(w){if(nf(w),!u){var S=w.clientX-l,_=w.clientY-c;u=S*S+_*_>f}i.mouse("drag",w)}function b(w){jr(w.view).on("mousemove.drag mouseup.drag",null),o9(w.view,u),nf(w),i.mouse("end",w)}function v(w,S){if(e.call(this,w,S)){var _=w.changedTouches,T=t.call(this,w,S),k=_.length,A,j;for(A=0;A>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Y0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Y0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=_ie.exec(e))?new pr(t[1],t[2],t[3],1):(t=Sie.exec(e))?new pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nie.exec(e))?Y0(t[1],t[2],t[3],t[4]):(t=Tie.exec(e))?Y0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=kie.exec(e))?fO(t[1],t[2]/100,t[3]/100,1):(t=Aie.exec(e))?fO(t[1],t[2]/100,t[3]/100,t[4]):aO.hasOwnProperty(e)?cO(aO[e]):e==="transparent"?new pr(NaN,NaN,NaN,0):null}function cO(e){return new pr(e>>16&255,e>>8&255,e&255,1)}function Y0(e,t,n,s){return s<=0&&(e=t=n=NaN),new pr(e,t,n,s)}function jie(e){return e instanceof _g||(e=gu(e)),e?(e=e.rgb(),new pr(e.r,e.g,e.b,e.opacity)):new pr}function KS(e,t,n,s){return arguments.length===1?jie(e):new pr(e,t,n,s??1)}function pr(e,t,n,s){this.r=+e,this.g=+t,this.b=+n,this.opacity=+s}y2(pr,KS,c9(_g,{brighter(e){return e=e==null?f1:Math.pow(f1,e),new pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mm:Math.pow(Mm,e),new pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pr(iu(this.r),iu(this.g),iu(this.b),h1(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uO,formatHex:uO,formatHex8:Rie,formatRgb:dO,toString:dO}));function uO(){return`#${Gc(this.r)}${Gc(this.g)}${Gc(this.b)}`}function Rie(){return`#${Gc(this.r)}${Gc(this.g)}${Gc(this.b)}${Gc((isNaN(this.opacity)?1:this.opacity)*255)}`}function dO(){const e=h1(this.opacity);return`${e===1?"rgb(":"rgba("}${iu(this.r)}, ${iu(this.g)}, ${iu(this.b)}${e===1?")":`, ${e})`}`}function h1(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function iu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gc(e){return e=iu(e),(e<16?"0":"")+e.toString(16)}function fO(e,t,n,s){return s<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ra(e,t,n,s)}function u9(e){if(e instanceof Ra)return new Ra(e.h,e.s,e.l,e.opacity);if(e instanceof _g||(e=gu(e)),!e)return new Ra;if(e instanceof Ra)return e;e=e.rgb();var t=e.r/255,n=e.g/255,s=e.b/255,i=Math.min(t,n,s),r=Math.max(t,n,s),a=NaN,l=r-i,c=(r+i)/2;return l?(t===r?a=(n-s)/l+(n0&&c<1?0:a,new Ra(a,l,c,e.opacity)}function Oie(e,t,n,s){return arguments.length===1?u9(e):new Ra(e,t,n,s??1)}function Ra(e,t,n,s){this.h=+e,this.s=+t,this.l=+n,this.opacity=+s}y2(Ra,Oie,c9(_g,{brighter(e){return e=e==null?f1:Math.pow(f1,e),new Ra(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mm:Math.pow(Mm,e),new Ra(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,s=n+(n<.5?n:1-n)*t,i=2*n-s;return new pr(ew(e>=240?e-240:e+120,i,s),ew(e,i,s),ew(e<120?e+240:e-120,i,s),this.opacity)},clamp(){return new Ra(hO(this.h),W0(this.s),W0(this.l),h1(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=h1(this.opacity);return`${e===1?"hsl(":"hsla("}${hO(this.h)}, ${W0(this.s)*100}%, ${W0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hO(e){return e=(e||0)%360,e<0?e+360:e}function W0(e){return Math.max(0,Math.min(1,e||0))}function ew(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const x2=e=>()=>e;function Mie(e,t){return function(n){return e+n*t}}function Lie(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(s){return Math.pow(e+s*t,n)}}function Die(e){return(e=+e)==1?d9:function(t,n){return n-t?Lie(t,n,e):x2(isNaN(t)?n:t)}}function d9(e,t){var n=t-e;return n?Mie(e,n):x2(isNaN(e)?t:e)}const p1=function e(t){var n=Die(t);function s(i,r){var a=n((i=KS(i)).r,(r=KS(r)).r),l=n(i.g,r.g),c=n(i.b,r.b),u=d9(i.opacity,r.opacity);return function(d){return i.r=a(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return s.gamma=e,s}(1);function Pie(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,s=t.slice(),i;return function(r){for(i=0;in&&(r=t.slice(n,r),l[a]?l[a]+=r:l[++a]=r),(s=s[0])===(i=i[0])?l[a]?l[a]+=i:l[++a]=i:(l[++a]=null,c.push({i:a,x:no(s,i)})),n=tw.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(i(f)+"rotate(",null,s)-2,x:no(u,d)})):d&&f.push(i(f)+"rotate("+d+s)}function l(u,d,f,h){u!==d?h.push({i:f.push(i(f)+"skewX(",null,s)-2,x:no(u,d)}):d&&f.push(i(f)+"skewX("+d+s)}function c(u,d,f,h,p,m){if(u!==f||d!==h){var b=p.push(i(p)+"scale(",null,",",null,")");m.push({i:b-4,x:no(u,f)},{i:b-2,x:no(d,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),r(u.translateX,u.translateY,d.translateX,d.translateY,f,h),a(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(p){for(var m=-1,b=h.length,v;++m=0&&e._call.call(void 0,t),e=e._next;--Af}function gO(){bu=(g1=Dm.now())+Ix,Af=yp=0;try{Zie()}finally{Af=0,ere(),bu=0}}function Jie(){var e=Dm.now(),t=e-g1;t>m9&&(Ix-=t,g1=e)}function ere(){for(var e,t=m1,n,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:m1=n);xp=e,WS(s)}function WS(e){if(!Af){yp&&(yp=clearTimeout(yp));var t=e-bu;t>24?(e<1/0&&(yp=setTimeout(gO,e-Dm.now()-Ix)),qh&&(qh=clearInterval(qh))):(qh||(g1=Dm.now(),qh=setInterval(Jie,m9)),Af=1,g9(gO))}}function bO(e,t,n){var s=new b1;return t=t==null?0:+t,s.restart(i=>{s.stop(),e(i+t)},t,n),s}var tre=Ax("start","end","cancel","interrupt"),nre=[],y9=0,yO=1,XS=2,ty=3,xO=4,QS=5,ny=6;function jx(e,t,n,s,i,r){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;sre(e,n,{name:t,index:s,group:i,on:tre,tween:nre,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:y9})}function v2(e,t){var n=za(e,t);if(n.state>y9)throw new Error("too late; already scheduled");return n}function bo(e,t){var n=za(e,t);if(n.state>ty)throw new Error("too late; already running");return n}function za(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function sre(e,t,n){var s=e.__transition,i;s[t]=n,n.timer=b9(r,0,n.time);function r(u){n.state=yO,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var d,f,h,p;if(n.state!==yO)return c();for(d in s)if(p=s[d],p.name===n.name){if(p.state===ty)return bO(a);p.state===xO?(p.state=ny,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete s[d]):+dXS&&s.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Ore(e,t,n){var s,i,r=Rre(t)?v2:bo;return function(){var a=r(this,e),l=a.on;l!==s&&(i=(s=l).copy()).on(t,n),a.on=i}}function Mre(e,t){var n=this._id;return arguments.length<2?za(this.node(),n).on.on(e):this.each(Ore(n,e,t))}function Lre(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Dre(){return this.on("end.remove",Lre(this._id))}function Pre(e){var t=this._name,n=this._id;typeof e!="function"&&(e=g2(e));for(var s=this._groups,i=s.length,r=new Array(i),a=0;a()=>e;function lae(e,{sourceEvent:t,target:n,transform:s,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:i}})}function qo(e,t,n){this.k=e,this.x=t,this.y=n}qo.prototype={constructor:qo,scale:function(e){return e===1?this:new qo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Rx=new qo(1,0,0);w9.prototype=qo.prototype;function w9(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Rx;return e.__zoom}function nw(e){e.stopImmediatePropagation()}function Yh(e){e.preventDefault(),e.stopImmediatePropagation()}function cae(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uae(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function EO(){return this.__zoom||Rx}function dae(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function fae(){return navigator.maxTouchPoints||"ontouchstart"in this}function hae(e,t,n){var s=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}function _9(){var e=cae,t=uae,n=hae,s=dae,i=fae,r=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=ey,u=Ax("start","zoom","end"),d,f,h,p=500,m=150,b=0,v=10;function y(L){L.property("__zoom",EO).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",j).filter(i).on("touchstart.zoom",R).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(L,F,C,I){var D=L.selection?L.selection():L;D.property("__zoom",EO),L!==D?S(L,F,C,I):D.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},y.scaleBy=function(L,F,C,I){y.scaleTo(L,function(){var D=this.__zoom.k,$=typeof F=="function"?F.apply(this,arguments):F;return D*$},C,I)},y.scaleTo=function(L,F,C,I){y.transform(L,function(){var D=t.apply(this,arguments),$=this.__zoom,O=C==null?w(D):typeof C=="function"?C.apply(this,arguments):C,te=$.invert(O),se=typeof F=="function"?F.apply(this,arguments):F;return n(E(x($,se),O,te),D,a)},C,I)},y.translateBy=function(L,F,C,I){y.transform(L,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,I)},y.translateTo=function(L,F,C,I,D){y.transform(L,function(){var $=t.apply(this,arguments),O=this.__zoom,te=I==null?w($):typeof I=="function"?I.apply(this,arguments):I;return n(Rx.translate(te[0],te[1]).scale(O.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof C=="function"?-C.apply(this,arguments):-C),$,a)},I,D)};function x(L,F){return F=Math.max(r[0],Math.min(r[1],F)),F===L.k?L:new qo(F,L.x,L.y)}function E(L,F,C){var I=F[0]-C[0]*L.k,D=F[1]-C[1]*L.k;return I===L.x&&D===L.y?L:new qo(L.k,I,D)}function w(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function S(L,F,C,I){L.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var D=this,$=arguments,O=_(D,$).event(I),te=t.apply(D,$),se=C==null?w(te):typeof C=="function"?C.apply(D,$):C,P=Math.max(te[1][0]-te[0][0],te[1][1]-te[0][1]),Q=D.__zoom,ee=typeof F=="function"?F.apply(D,$):F,V=c(Q.invert(se).concat(P/Q.k),ee.invert(se).concat(P/ee.k));return function(X){if(X===1)X=ee;else{var K=V(X),ce=P/K[2];X=new qo(ce,se[0]-K[0]*ce,se[1]-K[1]*ce)}O.zoom(null,X)}})}function _(L,F,C){return!C&&L.__zooming||new T(L,F)}function T(L,F){this.that=L,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,F),this.taps=0}T.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,F){return this.mouse&&L!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var F=jr(this.that).datum();u.call(L,this.that,new lae(L,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:u}),F)}};function k(L,...F){if(!e.apply(this,arguments))return;var C=_(this,F).event(L),I=this.__zoom,D=Math.max(r[0],Math.min(r[1],I.k*Math.pow(2,s.apply(this,arguments)))),$=Aa(L);if(C.wheel)(C.mouse[0][0]!==$[0]||C.mouse[0][1]!==$[1])&&(C.mouse[1]=I.invert(C.mouse[0]=$)),clearTimeout(C.wheel);else{if(I.k===D)return;C.mouse=[$,I.invert($)],sy(this),C.start()}Yh(L),C.wheel=setTimeout(O,m),C.zoom("mouse",n(E(x(I,D),C.mouse[0],C.mouse[1]),C.extent,a));function O(){C.wheel=null,C.end()}}function A(L,...F){if(h||!e.apply(this,arguments))return;var C=L.currentTarget,I=_(this,F,!0).event(L),D=jr(L.view).on("mousemove.zoom",se,!0).on("mouseup.zoom",P,!0),$=Aa(L,C),O=L.clientX,te=L.clientY;a9(L.view),nw(L),I.mouse=[$,this.__zoom.invert($)],sy(this),I.start();function se(Q){if(Yh(Q),!I.moved){var ee=Q.clientX-O,V=Q.clientY-te;I.moved=ee*ee+V*V>b}I.event(Q).zoom("mouse",n(E(I.that.__zoom,I.mouse[0]=Aa(Q,C),I.mouse[1]),I.extent,a))}function P(Q){D.on("mousemove.zoom mouseup.zoom",null),o9(Q.view,I.moved),Yh(Q),I.event(Q).end()}}function j(L,...F){if(e.apply(this,arguments)){var C=this.__zoom,I=Aa(L.changedTouches?L.changedTouches[0]:L,this),D=C.invert(I),$=C.k*(L.shiftKey?.5:2),O=n(E(x(C,$),I,D),t.apply(this,F),a);Yh(L),l>0?jr(this).transition().duration(l).call(S,O,I,L):jr(this).call(y.transform,O,I,L)}}function R(L,...F){if(e.apply(this,arguments)){var C=L.touches,I=C.length,D=_(this,F,L.changedTouches.length===I).event(L),$,O,te,se;for(nw(L),O=0;O`Seems like you have not used zustand provider as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:s}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Pm=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],S9=["Enter"," ","Escape"],N9={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Cf;(function(e){e.Strict="strict",e.Loose="loose"})(Cf||(Cf={}));var ru;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ru||(ru={}));var Bm;(function(e){e.Partial="partial",e.Full="full"})(Bm||(Bm={}));const T9={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Pl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Pl||(Pl={}));var If;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(If||(If={}));var Qe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Qe||(Qe={}));const vO={[Qe.Left]:Qe.Right,[Qe.Right]:Qe.Left,[Qe.Top]:Qe.Bottom,[Qe.Bottom]:Qe.Top};function k9(e){return e===null?null:e?"valid":"invalid"}const A9=e=>"id"in e&&"source"in e&&"target"in e,pae=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),_2=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Sg=(e,t=[0,0])=>{const{width:n,height:s}=hl(e),i=e.origin??t,r=n*i[0],a=s*i[1];return{x:e.position.x-r,y:e.position.y-a}},mae=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((s,i)=>{const r=typeof i=="string";let a=!t.nodeLookup&&!r?i:void 0;t.nodeLookup&&(a=r?t.nodeLookup.get(i):_2(i)?i:t.nodeLookup.get(i.id));const l=a?y1(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ox(s,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Mx(n)},Ng=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Ox(n,y1(i)),s=!0)}),s?Mx(n):{x:0,y:0,width:0,height:0}},S2=(e,t,[n,s,i]=[0,0,1],r=!1,a=!1)=>{const l={...oh(t,[n,s,i]),width:t.width/i,height:t.height/i},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(a&&!f||h)continue;const p=d.width??u.width??u.initialWidth??null,m=d.height??u.height??u.initialHeight??null,b=Um(l,Rf(u)),v=(p??0)*(m??0),y=r&&b>0;(!u.internals.handleBounds||y||b>=v||u.dragging)&&c.push(u)}return c},gae=(e,t)=>{const n=new Set;return e.forEach(s=>{n.add(s.id)}),t.filter(s=>n.has(s.source)||n.has(s.target))};function bae(e,t){const n=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!s||s.has(i.id))&&n.set(i.id,i)}),n}async function yae({nodes:e,width:t,height:n,panZoom:s,minZoom:i,maxZoom:r},a){if(e.size===0)return!0;const l=bae(e,a),c=Ng(l),u=T2(c,t,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??r,(a==null?void 0:a.padding)??.1);return await s.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function C9({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:s=[0,0],nodeExtent:i,onError:r}){const a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??s;let f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)r==null||r("005",Fa.error005());else{const p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&xu(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const h=xu(f)?yu(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(r==null||r("015",Fa.error015())),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function xae({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:s,onBeforeDelete:i}){const r=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=r.has(h.id),m=!p&&h.parentId&&a.find(b=>b.id===h.parentId);(p||m)&&a.push(h)}const l=new Set(t.map(h=>h.id)),c=s.filter(h=>h.deletable!==!1),d=gae(a,c);for(const h of c)l.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!i)return{edges:d,nodes:a};const f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}const jf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),yu=(e={x:0,y:0},t,n)=>({x:jf(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:jf(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function I9(e,t,n){const{width:s,height:i}=hl(n),{x:r,y:a}=n.internals.positionAbsolute;return yu(e,[[r,a],[r+s,a+i]],t)}const wO=(e,t,n)=>en?-jf(Math.abs(e-n),1,t)/t:0,N2=(e,t,n=15,s=40)=>{const i=wO(e.x,s,t.width-s)*n,r=wO(e.y,s,t.height-s)*n;return[i,r]},Ox=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),ZS=({x:e,y:t,width:n,height:s})=>({x:e,y:t,x2:e+n,y2:t+s}),Mx=({x:e,y:t,x2:n,y2:s})=>({x:e,y:t,width:n-e,height:s-t}),Rf=(e,t=[0,0])=>{var i,r;const{x:n,y:s}=_2(e)?e.internals.positionAbsolute:Sg(e,t);return{x:n,y:s,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}},y1=(e,t=[0,0])=>{var i,r;const{x:n,y:s}=_2(e)?e.internals.positionAbsolute:Sg(e,t);return{x:n,y:s,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:s+(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0)}},j9=(e,t)=>Mx(Ox(ZS(e),ZS(t))),Um=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*s)},_O=e=>Ma(e.width)&&Ma(e.height)&&Ma(e.x)&&Ma(e.y),Ma=e=>!isNaN(e)&&isFinite(e),R9=(e,t)=>(n,s)=>{},Tg=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),oh=({x:e,y:t},[n,s,i],r=!1,a=[1,1])=>{const l={x:(e-n)/i,y:(t-s)/i};return r?Tg(l,a):l},Of=({x:e,y:t},[n,s,i])=>({x:e*i+n,y:t*i+s});function ed(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Eae(e,t,n){if(typeof e=="string"||typeof e=="number"){const s=ed(e,n),i=ed(e,t);return{top:s,right:i,bottom:s,left:i,x:i*2,y:s*2}}if(typeof e=="object"){const s=ed(e.top??e.y??0,n),i=ed(e.bottom??e.y??0,n),r=ed(e.left??e.x??0,t),a=ed(e.right??e.x??0,t);return{top:s,right:a,bottom:i,left:r,x:r+a,y:s+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vae(e,t,n,s,i,r){const{x:a,y:l}=Of(e,[t,n,s]),{x:c,y:u}=Of({x:e.x+e.width,y:e.y+e.height},[t,n,s]),d=i-c,f=r-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const T2=(e,t,n,s,i,r)=>{const a=Eae(r,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=jf(u,s,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,b=vae(e,p,m,d,t,n),v={left:Math.min(b.left-a.left,0),top:Math.min(b.top-a.top,0),right:Math.min(b.right-a.right,0),bottom:Math.min(b.bottom-a.bottom,0)};return{x:p-v.left+v.right,y:m-v.top+v.bottom,zoom:d}},Fm=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xu(e){return e!=null&&e!=="parent"}function hl(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function k2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function O9(e,t={width:0,height:0},n,s,i){const r={...e},a=s.get(n);if(a){const l=a.origin||i;r.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],r.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return r}function SO(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function wae(){let e,t;return{promise:new Promise((s,i)=>{e=s,t=i}),resolve:e,reject:t}}function _ae(e){return{...N9,...e||{}}}function Xp(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:s,containerBounds:i}){const{x:r,y:a}=La(e),l=oh({x:r-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},s),{x:c,y:u}=n?Tg(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const A2=e=>({width:e.offsetWidth,height:e.offsetHeight}),M9=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Sae=["INPUT","SELECT","TEXTAREA"];function L9(e){var s,i;const t=((i=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Sae.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const D9=e=>"clientX"in e,La=(e,t)=>{var r,a;const n=D9(e),s=n?e.clientX:(r=e.touches)==null?void 0:r[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},NO=(e,t,n,s,i)=>{const r=t.querySelectorAll(`.${e}`);return!r||!r.length?null:Array.from(r).map(a=>{const l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/s,y:(l.top-n.top)/s,...A2(a)}})};function P9({sourceX:e,sourceY:t,targetX:n,targetY:s,sourceControlX:i,sourceControlY:r,targetControlX:a,targetControlY:l}){const c=e*.125+i*.375+a*.375+n*.125,u=t*.125+r*.375+l*.375+s*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Z0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function TO({pos:e,x1:t,y1:n,x2:s,y2:i,c:r}){switch(e){case Qe.Left:return[t-Z0(t-s,r),n];case Qe.Right:return[t+Z0(s-t,r),n];case Qe.Top:return[t,n-Z0(n-i,r)];case Qe.Bottom:return[t,n+Z0(i-n,r)]}}function B9({sourceX:e,sourceY:t,sourcePosition:n=Qe.Bottom,targetX:s,targetY:i,targetPosition:r=Qe.Top,curvature:a=.25}){const[l,c]=TO({pos:n,x1:e,y1:t,x2:s,y2:i,c:a}),[u,d]=TO({pos:r,x1:s,y1:i,x2:e,y2:t,c:a}),[f,h,p,m]=P9({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${s},${i}`,f,h,p,m]}function U9({sourceX:e,sourceY:t,targetX:n,targetY:s}){const i=Math.abs(n-e)/2,r=n0}const kae=({source:e,sourceHandle:t,target:n,targetHandle:s})=>`xy-edge__${e}${t||""}-${n}${s||""}`,Aae=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Cae=(e,t,n={})=>{var r;if(!e.source||!e.target)return(r=n.onError)==null||r.call(n,"006",Fa.error006()),t;const s=n.getEdgeId||kae;let i;return A9(e)?i={...e}:i={...e,id:s(e)},Aae(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function F9({sourceX:e,sourceY:t,targetX:n,targetY:s}){const[i,r,a,l]=U9({sourceX:e,sourceY:t,targetX:n,targetY:s});return[`M ${e},${t}L ${n},${s}`,i,r,a,l]}const kO={[Qe.Left]:{x:-1,y:0},[Qe.Right]:{x:1,y:0},[Qe.Top]:{x:0,y:-1},[Qe.Bottom]:{x:0,y:1}},Iae=({source:e,sourcePosition:t=Qe.Bottom,target:n})=>t===Qe.Left||t===Qe.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function jae({source:e,sourcePosition:t=Qe.Bottom,target:n,targetPosition:s=Qe.Top,center:i,offset:r,stepPosition:a}){const l=kO[t],c=kO[s],u={x:e.x+l.x*r,y:e.y+l.y*r},d={x:n.x+c.x*r,y:n.y+c.y*r},f=Iae({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],b,v;const y={x:0,y:0},x={x:0,y:0},[,,E,w]=U9({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(b=i.x??u.x+(d.x-u.x)*a,v=i.y??(u.y+d.y)/2):(b=i.x??(u.x+d.x)/2,v=i.y??u.y+(d.y-u.y)*a);const k=[{x:b,y:u.y},{x:b,y:d.y}],A=[{x:u.x,y:v},{x:d.x,y:v}];l[h]===p?m=h==="x"?k:A:m=h==="x"?A:k}else{const k=[{x:u.x,y:d.y}],A=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?A:k:m=l.y===p?k:A,t===s){const L=Math.abs(e[h]-n[h]);if(L<=r){const F=Math.min(r-1,r-L);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*F:x[h]=(d[h]>n[h]?-1:1)*F}}if(t!==s){const L=h==="x"?"y":"x",F=l[h]===c[L],C=u[L]>d[L],I=u[L]=z?(b=(j.x+R.x)/2,v=m[0].y):(b=m[0].x,v=(j.y+R.y)/2)}const S={x:u.x+y.x,y:u.y+y.y},_={x:d.x+x.x,y:d.y+x.y};return[[e,...S.x!==m[0].x||S.y!==m[0].y?[S]:[],...m,..._.x!==m[m.length-1].x||_.y!==m[m.length-1].y?[_]:[],n],b,v,E,w]}function Rae(e,t,n,s){const i=Math.min(AO(e,t)/2,AO(t,n)/2,s),{x:r,y:a}=t;if(e.x===r&&r===n.x||e.y===a&&a===n.y)return`L${r} ${a}`;if(e.y===a){const u=e.xn.id===t):e[0])||null}function JS(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function Mae(e,{id:t,defaultColor:n,defaultMarkerStart:s,defaultMarkerEnd:i}){const r=new Set;return e.reduce((a,l)=>([l.markerStart||s,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){const u=JS(c,t);r.has(u)||(a.push({id:u,color:c.color||n,...c}),r.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}const $9=1e3,Lae=10,C2={nodeOrigin:[0,0],nodeExtent:Pm,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Dae={...C2,checkEquality:!0};function I2(e,t){const n={...e};for(const s in t)t[s]!==void 0&&(n[s]=t[s]);return n}function Pae(e,t,n){const s=I2(C2,n);for(const i of e.values())if(i.parentId)R2(i,e,t,s);else{const r=Sg(i,s.nodeOrigin),a=xu(i.extent)?i.extent:s.nodeExtent,l=yu(r,a,hl(i));i.internals.positionAbsolute=l}}function Bae(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],s=[];for(const i of e.handles){const r={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(r):i.type==="target"&&s.push(r)}return{source:n,target:s}}function j2(e){return e==="manual"}function eN(e,t,n,s={}){var d,f;const i=I2(Dae,s),r={i:0},a=new Map(t),l=i!=null&&i.elevateNodesOnSelect&&!j2(i.zIndexMode)?$9:0;let c=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=a.get(h.id);if(i.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const m=Sg(h,i.nodeOrigin),b=xu(h.extent)?h.extent:i.nodeExtent,v=yu(m,b,hl(h));p={...i.defaults,...h,measured:{width:(d=h.measured)==null?void 0:d.width,height:(f=h.measured)==null?void 0:f.height},internals:{positionAbsolute:v,handleBounds:Bae(h,p),z:H9(h,l,i.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(c=!1),h.parentId&&R2(p,t,n,s,r),u||(u=h.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function Uae(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function R2(e,t,n,s,i){const{elevateNodesOnSelect:r,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=I2(C2,s),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Uae(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*Lae),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);const f=r&&!j2(c)?$9:0,{x:h,y:p,z:m}=Fae(e,d,a,l,f,c),{positionAbsolute:b}=e.internals,v=h!==b.x||p!==b.y;(v||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:p}:b,z:m}})}function H9(e,t,n){const s=Ma(e.zIndex)?e.zIndex:0;return j2(n)?s:s+(e.selected?t:0)}function Fae(e,t,n,s,i,r){const{x:a,y:l}=t.internals.positionAbsolute,c=hl(e),u=Sg(e,n),d=xu(e.extent)?yu(u,e.extent,c):u;let f=yu({x:a+d.x,y:l+d.y},s,c);e.extent==="parent"&&(f=I9(f,c,t));const h=H9(e,i,r),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function O2(e,t,n,s=[0,0]){var a;const i=[],r=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((a=r.get(l.parentId))==null?void 0:a.expandedRect)??Rf(c),d=j9(u,l.rect);r.set(l.parentId,{expandedRect:d,parent:c})}return r.size>0&&r.forEach(({expandedRect:l,parent:c},u)=>{var E;const d=c.internals.positionAbsolute,f=hl(c),h=c.origin??s,p=l.x0||m>0||y||x)&&(i.push({id:u,type:"position",position:{x:c.position.x-p+y,y:c.position.y-m+x}}),(E=n.get(u))==null||E.forEach(w=>{e.some(S=>S.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+m}})})),(f.width0){const p=O2(h,t,n,i);u.push(...p)}return{changes:u,updatedInternals:c}}async function Hae({delta:e,panZoom:t,transform:n,translateExtent:s,width:i,height:r}){if(!t||!e.x&&!e.y)return!1;const a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,r]],s);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function RO(e,t,n,s,i,r){let a=i;const l=s.get(a)||new Map;s.set(a,l.set(n,t)),a=`${i}-${e}`;const c=s.get(a)||new Map;if(s.set(a,c.set(n,t)),r){a=`${i}-${e}-${r}`;const u=s.get(a)||new Map;s.set(a,u.set(n,t))}}function z9(e,t,n){e.clear(),t.clear();for(const s of n){const{source:i,target:r,sourceHandle:a=null,targetHandle:l=null}=s,c={edgeId:s.id,source:i,target:r,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${r}-${l}`,d=`${r}-${l}--${i}-${a}`;RO("source",c,d,e,i,a),RO("target",c,u,e,r,l),t.set(s.id,s)}}function V9(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:V9(n,t):!1}function OO(e,t,n){var i;let s=e;do{if((i=s==null?void 0:s.matches)!=null&&i.call(s,t))return!0;if(s===n)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function zae(e,t,n,s){const i=new Map;for(const[r,a]of e)if((a.selected||a.id===s)&&(!a.parentId||!V9(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const l=e.get(r);l&&i.set(r,{id:r,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}function sw({nodeId:e,dragItems:t,nodeLookup:n,dragging:s=!0}){var a,l,c;const i=[];for(const[u,d]of t){const f=(a=n.get(u))==null?void 0:a.internals.userNode;f&&i.push({...f,position:d.position,dragging:s})}if(!e)return[i[0],i];const r=(l=n.get(e))==null?void 0:l.internals.userNode;return[r?{...r,position:((c=t.get(e))==null?void 0:c.position)||r.position,dragging:s}:i[0],i]}function Vae({dragItems:e,snapGrid:t,x:n,y:s}){const i=e.values().next().value;if(!i)return null;const r={x:n-i.distance.x,y:s-i.distance.y},a=Tg(r,t);return{x:a.x-r.x,y:a.y-r.y}}function Gae({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:s,onDragStop:i}){let r={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,b=null;function v({noDragClassName:x,handleSelector:E,domNode:w,isSelectable:S,nodeId:_,nodeClickDistance:T=0}){h=jr(w);function k({x:B,y:z}){const{nodeLookup:L,nodeExtent:F,snapGrid:C,snapToGrid:I,nodeOrigin:D,onNodeDrag:$,onSelectionDrag:O,onError:te,updateNodePositions:se}=t();r={x:B,y:z};let P=!1;const Q=l.size>1,ee=Q&&F?ZS(Ng(l)):null,V=Q&&I?Vae({dragItems:l,snapGrid:C,x:B,y:z}):null;for(const[X,K]of l){if(!L.has(X))continue;let ce={x:B-K.distance.x,y:z-K.distance.y};I&&(ce=V?{x:Math.round(ce.x+V.x),y:Math.round(ce.y+V.y)}:Tg(ce,C));let he=null;if(Q&&F&&!K.extent&&ee){const{positionAbsolute:we}=K.internals,Le=we.x-ee.x+F[0][0],Ne=we.x+K.measured.width-ee.x2+F[1][0],ae=we.y-ee.y+F[0][1],me=we.y+K.measured.height-ee.y2+F[1][1];he=[[Le,ae],[Ne,me]]}const{position:be,positionAbsolute:ue}=C9({nodeId:X,nextPosition:ce,nodeLookup:L,nodeExtent:he||F,nodeOrigin:D,onError:te});P=P||K.position.x!==be.x||K.position.y!==be.y,K.position=be,K.internals.positionAbsolute=ue}if(m=m||P,!!P&&(se(l,!0),b&&(s||$||!_&&O))){const[X,K]=sw({nodeId:_,dragItems:l,nodeLookup:L});s==null||s(b,l,X,K),$==null||$(b,X,K),_||O==null||O(b,K)}}async function A(){if(!d)return;const{transform:B,panBy:z,autoPanSpeed:L,autoPanOnNodeDrag:F}=t();if(!F){c=!1,cancelAnimationFrame(a);return}const[C,I]=N2(u,d,L);(C!==0||I!==0)&&(r.x=(r.x??0)-C/B[2],r.y=(r.y??0)-I/B[2],await z({x:C,y:I})&&k(r)),a=requestAnimationFrame(A)}function j(B){var Q;const{nodeLookup:z,multiSelectionActive:L,nodesDraggable:F,transform:C,snapGrid:I,snapToGrid:D,selectNodesOnDrag:$,onNodeDragStart:O,onSelectionDragStart:te,unselectNodesAndEdges:se}=t();f=!0,(!$||!S)&&!L&&_&&((Q=z.get(_))!=null&&Q.selected||se()),S&&$&&_&&(e==null||e(_));const P=Xp(B.sourceEvent,{transform:C,snapGrid:I,snapToGrid:D,containerBounds:d});if(r=P,l=zae(z,F,P,_),l.size>0&&(n||O||!_&&te)){const[ee,V]=sw({nodeId:_,dragItems:l,nodeLookup:z});n==null||n(B.sourceEvent,l,ee,V),O==null||O(B.sourceEvent,ee,V),_||te==null||te(B.sourceEvent,V)}}const R=l9().clickDistance(T).on("start",B=>{const{domNode:z,nodeDragThreshold:L,transform:F,snapGrid:C,snapToGrid:I}=t();d=(z==null?void 0:z.getBoundingClientRect())||null,p=!1,m=!1,b=B.sourceEvent,L===0&&j(B),r=Xp(B.sourceEvent,{transform:F,snapGrid:C,snapToGrid:I,containerBounds:d}),u=La(B.sourceEvent,d)}).on("drag",B=>{const{autoPanOnNodeDrag:z,transform:L,snapGrid:F,snapToGrid:C,nodeDragThreshold:I,nodeLookup:D}=t(),$=Xp(B.sourceEvent,{transform:L,snapGrid:F,snapToGrid:C,containerBounds:d});if(b=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||_&&!D.has(_))&&(p=!0),!p){if(!c&&z&&f&&(c=!0,A()),!f){const O=La(B.sourceEvent,d),te=O.x-u.x,se=O.y-u.y;Math.sqrt(te*te+se*se)>I&&j(B)}(r.x!==$.xSnapped||r.y!==$.ySnapped)&&l&&f&&(u=La(B.sourceEvent,d),k($))}}).on("end",B=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){const{nodeLookup:z,updateNodePositions:L,onNodeDragStop:F,onSelectionDragStop:C}=t();if(m&&(L(l,!1),m=!1),i||F||!_&&C){const[I,D]=sw({nodeId:_,dragItems:l,nodeLookup:z,dragging:!1});i==null||i(B.sourceEvent,l,I,D),F==null||F(B.sourceEvent,I,D),_||C==null||C(B.sourceEvent,D)}}}).filter(B=>{const z=B.target;return!B.button&&(!x||!OO(z,`.${x}`,w))&&(!E||OO(z,E,w))});h.call(R)}function y(){h==null||h.on(".drag",null)}return{update:v,destroy:y}}function Kae(e,t,n){const s=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const r of t.values())Um(i,Rf(r))>0&&s.push(r);return s}const qae=250;function Yae(e,t,n,s){var l,c;let i=[],r=1/0;const a=Kae(e,n,t+qae);for(const u of a){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(s.nodeId===f.nodeId&&s.type===f.type&&s.id===f.id)continue;const{x:h,y:p}=Eu(u,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m1){const u=s.type==="source"?"target":"source";return i.find(d=>d.type===u)??i[0]}return i[0]}function G9(e,t,n,s,i,r=!1){var u,d,f;const a=s.get(e);if(!a)return null;const l=i==="strict"?(u=a.internals.handleBounds)==null?void 0:u[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&r?{...c,...Eu(a,c,c.position,!0)}:c}function K9(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Wae(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const q9=()=>!0;function Xae(e,{connectionMode:t,connectionRadius:n,handleId:s,nodeId:i,edgeUpdaterType:r,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:b,onConnectEnd:v,isValidConnection:y=q9,onReconnectEnd:x,updateConnection:E,getTransform:w,getFromHandle:S,autoPanSpeed:_,dragThreshold:T=1,handleDomNode:k}){const A=M9(e.target);let j=0,R;const{x:B,y:z}=La(e),L=K9(r,k),F=l==null?void 0:l.getBoundingClientRect();let C=!1;if(!F||!L)return;const I=G9(i,L,s,c,t);if(!I)return;let D=La(e,F),$=!1,O=null,te=!1,se=null;function P(){if(!d||!F)return;const[be,ue]=N2(D,F,_);h({x:be,y:ue}),j=requestAnimationFrame(P)}const Q={...I,nodeId:i,type:L,position:I.position},ee=c.get(i);let X={inProgress:!0,isValid:null,from:Eu(ee,Q,Qe.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:ee,to:D,toHandle:null,toPosition:vO[Q.position],toNode:null,pointer:D};function K(){C=!0,E(X),m==null||m(e,{nodeId:i,handleId:s,handleType:L})}T===0&&K();function ce(be){if(!C){const{x:me,y:_e}=La(be),Je=me-B,Pe=_e-z;if(!(Je*Je+Pe*Pe>T*T))return;K()}if(!S()||!Q){he(be);return}const ue=w();D=La(be,F),R=Yae(oh(D,ue,!1,[1,1]),n,c,Q),$||(P(),$=!0);const we=Y9(be,{handle:R,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:a?"target":"source",isValidConnection:y,doc:A,lib:u,flowId:f,nodeLookup:c});se=we.handleDomNode,O=we.connection,te=Wae(!!R,we.isValid);const Le=c.get(i),Ne=Le?Eu(Le,Q,Qe.Left,!0):X.from,ae={...X,from:Ne,isValid:te,to:we.toHandle&&te?Of({x:we.toHandle.x,y:we.toHandle.y},ue):D,toHandle:we.toHandle,toPosition:te&&we.toHandle?we.toHandle.position:vO[Q.position],toNode:we.toHandle?c.get(we.toHandle.nodeId):null,pointer:D};E(ae),X=ae}function he(be){if(!("touches"in be&&be.touches.length>0)){if(C){(R||se)&&O&&te&&(b==null||b(O));const{inProgress:ue,...we}=X,Le={...we,toPosition:X.toHandle?X.toPosition:null};v==null||v(be,Le),r&&(x==null||x(be,Le))}p(),cancelAnimationFrame(j),$=!1,te=!1,O=null,se=null,A.removeEventListener("mousemove",ce),A.removeEventListener("mouseup",he),A.removeEventListener("touchmove",ce),A.removeEventListener("touchend",he)}}A.addEventListener("mousemove",ce),A.addEventListener("mouseup",he),A.addEventListener("touchmove",ce),A.addEventListener("touchend",he)}function Y9(e,{handle:t,connectionMode:n,fromNodeId:s,fromHandleId:i,fromType:r,doc:a,lib:l,flowId:c,isValidConnection:u=q9,nodeLookup:d}){const f=r==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=La(e),b=a.elementFromPoint(p,m),v=b!=null&&b.classList.contains(`${l}-flow__handle`)?b:h,y={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=K9(void 0,v),E=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),S=v.classList.contains("connectable"),_=v.classList.contains("connectableend");if(!E||!x)return y;const T={source:f?E:s,sourceHandle:f?w:i,target:f?s:E,targetHandle:f?i:w};y.connection=T;const A=S&&_&&(n===Cf.Strict?f&&x==="source"||!f&&x==="target":E!==s||w!==i);y.isValid=A&&u(T),y.toHandle=G9(E,x,w,d,n,!0)}return y}const tN={onPointerDown:Xae,isValid:Y9};function Qae({domNode:e,panZoom:t,getTransform:n,getViewScale:s}){const i=jr(e);function r({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=E=>{if(E.sourceEvent.type!=="wheel"||!t)return;const w=n(),S=E.sourceEvent.ctrlKey&&Fm()?10:1,_=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*d,T=w[2]*Math.pow(2,_*S);t.scaleTo(T)};let b=[0,0];const v=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(b=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},y=E=>{const w=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!t)return;const S=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],_=[S[0]-b[0],S[1]-b[1]];b=S;const T=s()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),k={x:w[0]-_[0]*T,y:w[1]-_[1]*T},A=[[0,0],[c,u]];t.setViewportConstrained({x:k.x,y:k.y,zoom:w[2]},A,l)},x=_9().on("start",v).on("zoom",f?y:null).on("zoom.wheel",h?m:null);i.call(x,{})}function a(){i.on("zoom",null)}return{update:r,destroy:a,pointer:Aa}}const Lx=e=>({x:e.x,y:e.y,zoom:e.k}),iw=({x:e,y:t,zoom:n})=>Rx.translate(e,t).scale(n),Bd=(e,t)=>e.target.closest(`.${t}`),W9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Zae=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,rw=(e,t=0,n=Zae,s=()=>{})=>{const i=typeof t=="number"&&t>0;return i||s(),i?e.transition().duration(t).ease(n).on("end",s):e},X9=e=>{const t=e.ctrlKey&&Fm()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Jae({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:s,panOnScrollMode:i,panOnScrollSpeed:r,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(Bd(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&a){const v=Aa(d),y=X9(d),x=f*Math.pow(2,y);s.scaleTo(n,x,v,d);return}const h=d.deltaMode===1?20:1;let p=i===ru.Vertical?0:d.deltaX*h,m=i===ru.Horizontal?0:d.deltaY*h;!Fm()&&d.shiftKey&&i!==ru.Vertical&&(p=d.deltaY*h,m=0),s.translateBy(n,-(p/f)*r,-(m/f)*r,{internal:!0});const b=Lx(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,b),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,b),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,b))}}function eoe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(s,i){const r=s.type==="wheel",a=!t&&r&&!s.ctrlKey,l=Bd(s,e);if(s.ctrlKey&&r&&l&&s.preventDefault(),a||l)return null;s.preventDefault(),n.call(this,s,i)}}function toe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return s=>{var r,a,l;if((r=s.sourceEvent)!=null&&r.internal)return;const i=Lx(s.transform);e.mouseButton=((a=s.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((l=s.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(s.sourceEvent,i))}}function noe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:s,onPanZoom:i}){return r=>{var a,l;e.usedRightMouseButton=!!(n&&W9(t,e.mouseButton??0)),(a=r.sourceEvent)!=null&&a.sync||s([r.transform.x,r.transform.y,r.transform.k]),i&&!((l=r.sourceEvent)!=null&&l.internal)&&(i==null||i(r.sourceEvent,Lx(r.transform)))}}function soe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:s,onPanZoomEnd:i,onPaneContextMenu:r}){return a=>{var l;if(!((l=a.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,r&&W9(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&r(a.sourceEvent),e.usedRightMouseButton=!1,s(!1),i)){const c=Lx(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,c)},n?150:0)}}}function ioe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:s,panOnScroll:i,zoomOnDoubleClick:r,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var v;const h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Bd(f,`${u}-flow__node`)||Bd(f,`${u}-flow__edge`)))return!0;if(!s&&!h&&!i&&!r&&!n||a||d&&!m||Bd(f,l)&&m||Bd(f,c)&&(!m||i&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&((v=f.touches)==null?void 0:v.length)>1)return f.preventDefault(),!1;if(!h&&!i&&!p&&m||!s&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(s)&&!s.includes(f.button)&&f.type==="mousedown")return!1;const b=Array.isArray(s)&&s.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&b}}function roe({domNode:e,minZoom:t,maxZoom:n,translateExtent:s,viewport:i,onPanZoom:r,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=_9().scaleExtent([t,n]).translateExtent(s),h=jr(e).call(f);x({x:i.x,y:i.y,zoom:jf(i.zoom,t,n)},[[0,0],[d.width,d.height]],s);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(X9);async function b(R,B){return h?new Promise(z=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?Wp:ey).transform(rw(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>z(!0)),R)}):!1}function v({noWheelClassName:R,noPanClassName:B,onPaneContextMenu:z,userSelectionActive:L,panOnScroll:F,panOnDrag:C,panOnScrollMode:I,panOnScrollSpeed:D,preventScrolling:$,zoomOnPinch:O,zoomOnScroll:te,zoomOnDoubleClick:se,zoomActivationKeyPressed:P,lib:Q,onTransformChange:ee,connectionInProgress:V,paneClickDistance:X,selectionOnDrag:K}){L&&!u.isZoomingOrPanning&&y();const ce=F&&!P&&!L;f.clickDistance(K?1/0:!Ma(X)||X<0?0:X);const he=ce?Jae({zoomPanValues:u,noWheelClassName:R,d3Selection:h,d3Zoom:f,panOnScrollMode:I,panOnScrollSpeed:D,zoomOnPinch:O,onPanZoomStart:a,onPanZoom:r,onPanZoomEnd:l}):eoe({noWheelClassName:R,preventScrolling:$,d3ZoomHandler:p});h.on("wheel.zoom",he,{passive:!1});const be=toe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",be);const ue=noe({zoomPanValues:u,panOnDrag:C,onPaneContextMenu:!!z,onPanZoom:r,onTransformChange:ee});f.on("zoom",ue);const we=soe({zoomPanValues:u,panOnDrag:C,panOnScroll:F,onPaneContextMenu:z,onPanZoomEnd:l,onDraggingChange:c});f.on("end",we);const Le=ioe({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:te,panOnScroll:F,zoomOnDoubleClick:se,zoomOnPinch:O,userSelectionActive:L,noPanClassName:B,noWheelClassName:R,lib:Q,connectionInProgress:V});f.filter(Le),se?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function y(){f.on("zoom",null)}async function x(R,B,z){const L=iw(R),F=f==null?void 0:f.constrain()(L,B,z);return F&&await b(F),F}async function E(R,B){const z=iw(R);return await b(z,B),z}function w(R){if(h){const B=iw(R),z=h.property("__zoom");(z.k!==R.zoom||z.x!==R.x||z.y!==R.y)&&(f==null||f.transform(h,B,null,{sync:!0}))}}function S(){const R=h?w9(h.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}async function _(R,B){return h?new Promise(z=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?Wp:ey).scaleTo(rw(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>z(!0)),R)}):!1}async function T(R,B){return h?new Promise(z=>{f==null||f.interpolate((B==null?void 0:B.interpolate)==="linear"?Wp:ey).scaleBy(rw(h,B==null?void 0:B.duration,B==null?void 0:B.ease,()=>z(!0)),R)}):!1}function k(R){f==null||f.scaleExtent(R)}function A(R){f==null||f.translateExtent(R)}function j(R){const B=!Ma(R)||R<0?0:R;f==null||f.clickDistance(B)}return{update:v,destroy:y,setViewport:E,setViewportConstrained:x,getViewport:S,scaleTo:_,scaleBy:T,setScaleExtent:k,setTranslateExtent:A,syncViewport:w,setClickDistance:j}}var Mf;(function(e){e.Line="line",e.Handle="handle"})(Mf||(Mf={}));function aoe({width:e,prevWidth:t,height:n,prevHeight:s,affectsX:i,affectsY:r}){const a=e-t,l=n-s,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&r&&(c[1]=c[1]*-1),c}function MO(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),s=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:s,affectsY:i}}function wl(e,t){return Math.max(0,t-e)}function _l(e,t){return Math.max(0,e-t)}function J0(e,t,n){return Math.max(0,t-e,e-n)}function LO(e,t){return e?!t:t}function ooe(e,t,n,s,i,r,a,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:b,maxWidth:v,minHeight:y,maxHeight:x}=s,{x:E,y:w,width:S,height:_,aspectRatio:T}=e;let k=Math.floor(d?p-e.pointerX:0),A=Math.floor(f?m-e.pointerY:0);const j=S+(c?-k:k),R=_+(u?-A:A),B=-r[0]*S,z=-r[1]*_;let L=J0(j,b,v),F=J0(R,y,x);if(a){let D=0,$=0;c&&k<0?D=wl(E+k+B,a[0][0]):!c&&k>0&&(D=_l(E+j+B,a[1][0])),u&&A<0?$=wl(w+A+z,a[0][1]):!u&&A>0&&($=_l(w+R+z,a[1][1])),L=Math.max(L,D),F=Math.max(F,$)}if(l){let D=0,$=0;c&&k>0?D=_l(E+k,l[0][0]):!c&&k<0&&(D=wl(E+j,l[1][0])),u&&A>0?$=_l(w+A,l[0][1]):!u&&A<0&&($=wl(w+R,l[1][1])),L=Math.max(L,D),F=Math.max(F,$)}if(i){if(d){const D=J0(j/T,y,x)*T;if(L=Math.max(L,D),a){let $=0;!c&&!u||c&&!u&&h?$=_l(w+z+j/T,a[1][1])*T:$=wl(w+z+(c?k:-k)/T,a[0][1])*T,L=Math.max(L,$)}if(l){let $=0;!c&&!u||c&&!u&&h?$=wl(w+j/T,l[1][1])*T:$=_l(w+(c?k:-k)/T,l[0][1])*T,L=Math.max(L,$)}}if(f){const D=J0(R*T,b,v)/T;if(F=Math.max(F,D),a){let $=0;!c&&!u||u&&!c&&h?$=_l(E+R*T+B,a[1][0])/T:$=wl(E+(u?A:-A)*T+B,a[0][0])/T,F=Math.max(F,$)}if(l){let $=0;!c&&!u||u&&!c&&h?$=wl(E+R*T,l[1][0])/T:$=_l(E+(u?A:-A)*T,l[0][0])/T,F=Math.max(F,$)}}}A=A+(A<0?F:-F),k=k+(k<0?L:-L),i&&(h?j>R*T?A=(LO(c,u)?-k:k)/T:k=(LO(c,u)?-A:A)*T:d?(A=k/T,u=c):(k=A*T,c=u));const C=c?E+k:E,I=u?w+A:w;return{width:S+(c?-k:k),height:_+(u?-A:A),x:r[0]*k*(c?-1:1)+C,y:r[1]*A*(u?-1:1)+I}}const Q9={width:0,height:0,x:0,y:0},loe={...Q9,pointerX:0,pointerY:0,aspectRatio:1};function coe(e,t,n){const s=t.position.x+e.position.x,i=t.position.y+e.position.y,r=e.measured.width??0,a=e.measured.height??0,l=n[0]*r,c=n[1]*a;return[[s-l,i-c],[s+r-l,i+a-c]]}function uoe({domNode:e,nodeId:t,getStoreItems:n,onChange:s,onEnd:i}){const r=jr(e);let a={controlDirection:MO("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:b,shouldResize:v}){let y={...Q9},x={...loe};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:MO(u)};let E,w=null,S=[],_,T,k,A=!1;const j=l9().on("start",R=>{const{nodeLookup:B,transform:z,snapGrid:L,snapToGrid:F,nodeOrigin:C,paneDomNode:I}=n();if(E=B.get(t),!E)return;w=(I==null?void 0:I.getBoundingClientRect())??null;const{xSnapped:D,ySnapped:$}=Xp(R.sourceEvent,{transform:z,snapGrid:L,snapToGrid:F,containerBounds:w});y={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},x={...y,pointerX:D,pointerY:$,aspectRatio:y.width/y.height},_=void 0,T=xu(E.extent)?E.extent:void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(_=B.get(E.parentId)),_&&E.extent==="parent"&&(T=[[0,0],[_.measured.width,_.measured.height]]),S=[],k=void 0;for(const[O,te]of B)if(te.parentId===t&&(S.push({id:O,position:{...te.position},extent:te.extent}),te.extent==="parent"||te.expandParent)){const se=coe(te,E,te.origin??C);k?k=[[Math.min(se[0][0],k[0][0]),Math.min(se[0][1],k[0][1])],[Math.max(se[1][0],k[1][0]),Math.max(se[1][1],k[1][1])]]:k=se}p==null||p(R,{...y})}).on("drag",R=>{const{transform:B,snapGrid:z,snapToGrid:L,nodeOrigin:F}=n(),C=Xp(R.sourceEvent,{transform:B,snapGrid:z,snapToGrid:L,containerBounds:w}),I=[];if(!E)return;const{x:D,y:$,width:O,height:te}=y,se={},P=E.origin??F,{width:Q,height:ee,x:V,y:X}=ooe(x,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,T,k),K=Q!==O,ce=ee!==te,he=V!==D&&K,be=X!==$&&ce;if(!he&&!be&&!K&&!ce)return;if((he||be||P[0]===1||P[1]===1)&&(se.x=he?V:y.x,se.y=be?X:y.y,y.x=se.x,y.y=se.y,S.length>0)){const Ne=V-D,ae=X-$;for(const me of S)me.position={x:me.position.x-Ne+P[0]*(Q-O),y:me.position.y-ae+P[1]*(ee-te)},I.push(me)}if((K||ce)&&(se.width=K&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Q:y.width,se.height=ce&&(!a.resizeDirection||a.resizeDirection==="vertical")?ee:y.height,y.width=se.width,y.height=se.height),_&&E.expandParent){const Ne=P[0]*(se.width??0);se.x&&se.x{A&&(b==null||b(R,{...y}),i==null||i({...y}),A=!1)});r.call(j)}function c(){r.on(".drag",null)}return{update:l,destroy:c}}var Z9={exports:{}},J9={},eU={exports:{}},tU={};/** * @license React * use-sync-external-store-shim.production.js * @@ -508,7 +508,7 @@ ${f}`:d,children:[o.jsxs("span",{className:`account-avatar${b?" has-image":""}`, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Pf=g;function doe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var foe=typeof Object.is=="function"?Object.is:doe,hoe=Pf.useState,moe=Pf.useEffect,poe=Pf.useLayoutEffect,goe=Pf.useDebugValue;function boe(e,t){var n=t(),s=hoe({inst:{value:n,getSnapshot:t}}),i=s[0].inst,r=s[1];return poe(function(){i.value=n,i.getSnapshot=t,aw(i)&&r({inst:i})},[e,n,t]),moe(function(){return aw(i)&&r({inst:i}),e(function(){aw(i)&&r({inst:i})})},[e]),goe(n),n}function aw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!foe(e,n)}catch{return!0}}function yoe(e,t){return t()}var xoe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?yoe:boe;eU.useSyncExternalStore=Pf.useSyncExternalStore!==void 0?Pf.useSyncExternalStore:xoe;J9.exports=eU;var Eoe=J9.exports;/** + */var Lf=g;function doe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var foe=typeof Object.is=="function"?Object.is:doe,hoe=Lf.useState,poe=Lf.useEffect,moe=Lf.useLayoutEffect,goe=Lf.useDebugValue;function boe(e,t){var n=t(),s=hoe({inst:{value:n,getSnapshot:t}}),i=s[0].inst,r=s[1];return moe(function(){i.value=n,i.getSnapshot=t,aw(i)&&r({inst:i})},[e,n,t]),poe(function(){return aw(i)&&r({inst:i}),e(function(){aw(i)&&r({inst:i})})},[e]),goe(n),n}function aw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!foe(e,n)}catch{return!0}}function yoe(e,t){return t()}var xoe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?yoe:boe;tU.useSyncExternalStore=Lf.useSyncExternalStore!==void 0?Lf.useSyncExternalStore:xoe;eU.exports=tU;var Eoe=eU.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -516,64 +516,64 @@ ${f}`:d,children:[o.jsxs("span",{className:`account-avatar${b?" has-image":""}`, * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Lx=g,voe=Eoe;function woe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _oe=typeof Object.is=="function"?Object.is:woe,Soe=voe.useSyncExternalStore,Noe=Lx.useRef,Toe=Lx.useEffect,koe=Lx.useMemo,Aoe=Lx.useDebugValue;Z9.useSyncExternalStoreWithSelector=function(e,t,n,s,i){var r=Noe(null);if(r.current===null){var a={hasValue:!1,value:null};r.current=a}else a=r.current;r=koe(function(){function c(m){if(!u){if(u=!0,d=m,m=s(m),i!==void 0&&a.hasValue){var p=a.value;if(i(p,m))return f=p}return f=m}if(p=f,_oe(d,m))return p;var b=s(m);return i!==void 0&&i(p,b)?(d=m,p):(d=m,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,s,i]);var l=Soe(e,r[0],r[1]);return Toe(function(){a.hasValue=!0,a.value=l},[l]),Aoe(l),l};Q9.exports=Z9;var Coe=Q9.exports;const Ioe=qf(Coe),joe={},LO=e=>{let t;const n=new Set,s=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(p=>p(t,m))}},i=()=>t,c={setState:s,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(joe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(s,i,c);return c},Roe=e=>e?LO(e):LO,{useDebugValue:Ooe}=Pt,{useSyncExternalStoreWithSelector:Moe}=Ioe,Loe=e=>e;function tU(e,t=Loe,n){const s=Moe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ooe(s),s}const DO=(e,t)=>{const n=Roe(e),s=(i,r=t)=>tU(n,i,r);return Object.assign(s,n),s},Doe=(e,t)=>e?DO(e,t):DO;function hs(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,i]of e)if(!Object.is(i,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Dx=g.createContext(null),Poe=Dx.Provider,nU=La.error001("react");function Jt(e,t){const n=g.useContext(Dx);if(n===null)throw new Error(nU);return tU(n,e,t)}function ms(){const e=g.useContext(Dx);if(e===null)throw new Error(nU);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const PO={display:"none"},Boe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sU="react-flow__node-desc",iU="react-flow__edge-desc",Uoe="react-flow__aria-live",Foe=e=>e.ariaLiveMessage,$oe=e=>e.ariaLabelConfig;function Hoe({rfId:e}){const t=Jt(Foe);return o.jsx("div",{id:`${Uoe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Boe,children:t})}function zoe({rfId:e,disableKeyboardA11y:t}){const n=Jt($oe);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${sU}-${e}`,style:PO,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${iU}-${e}`,style:PO,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(Hoe,{rfId:e})]})}const Px=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...i},r)=>{const a=`${e}`.split("-");return o.jsx("div",{className:ii(["react-flow__panel",n,...a]),style:s,ref:r,...i,children:t})});Px.displayName="Panel";function Voe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(Px,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Goe=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},J0=e=>e.id;function Koe(e,t){return hs(e.selectedNodes.map(J0),t.selectedNodes.map(J0))&&hs(e.selectedEdges.map(J0),t.selectedEdges.map(J0))}function qoe({onSelectionChange:e}){const t=ms(),{selectedNodes:n,selectedEdges:s}=Jt(Goe,Koe);return g.useEffect(()=>{const i={nodes:n,edges:s};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(r=>r(i))},[n,s,e]),null}const Yoe=e=>!!e.onSelectionChangeHandlers;function Woe({onSelectionChange:e}){const t=Jt(Yoe);return e||t?o.jsx(qoe,{onSelectionChange:e}):null}const rU=[0,0],Xoe={x:0,y:0,zoom:1},Qoe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],BO=[...Qoe,"rfId"],Zoe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),UO={translateExtent:Fp,nodeOrigin:rU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Joe(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:i,setTranslateExtent:r,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Jt(Zoe,hs),u=ms();g.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=UO,l()}),[]);const d=g.useRef(UO);return g.useEffect(()=>{for(const f of BO){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?s(h):f==="maxZoom"?i(h):f==="translateExtent"?r(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:_ae(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},BO.map(f=>e[f])),null}function FO(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function ele(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const i=FO(),r=()=>n(i!=null&&i.matches?"dark":"light");return r(),i==null||i.addEventListener("change",r),()=>{i==null||i.removeEventListener("change",r)}},[e]),t!==null?t:(s=FO())!=null&&s.matches?"dark":"light"}const $O=typeof document<"u"?document:null;function Vp(e=null,t={target:$O,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),i=g.useRef(!1),r=g.useRef(new Set([])),[a,l]=g.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` + */var Dx=g,voe=Eoe;function woe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _oe=typeof Object.is=="function"?Object.is:woe,Soe=voe.useSyncExternalStore,Noe=Dx.useRef,Toe=Dx.useEffect,koe=Dx.useMemo,Aoe=Dx.useDebugValue;J9.useSyncExternalStoreWithSelector=function(e,t,n,s,i){var r=Noe(null);if(r.current===null){var a={hasValue:!1,value:null};r.current=a}else a=r.current;r=koe(function(){function c(p){if(!u){if(u=!0,d=p,p=s(p),i!==void 0&&a.hasValue){var m=a.value;if(i(m,p))return f=m}return f=p}if(m=f,_oe(d,p))return m;var b=s(p);return i!==void 0&&i(m,b)?(d=p,m):(d=p,f=b)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,s,i]);var l=Soe(e,r[0],r[1]);return Toe(function(){a.hasValue=!0,a.value=l},[l]),Aoe(l),l};Z9.exports=J9;var Coe=Z9.exports;const Ioe=Gf(Coe),joe={},DO=e=>{let t;const n=new Set,s=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},i=()=>t,c={setState:s,getState:i,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(joe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(s,i,c);return c},Roe=e=>e?DO(e):DO,{useDebugValue:Ooe}=Lt,{useSyncExternalStoreWithSelector:Moe}=Ioe,Loe=e=>e;function nU(e,t=Loe,n){const s=Moe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Ooe(s),s}const PO=(e,t)=>{const n=Roe(e),s=(i,r=t)=>nU(n,i,r);return Object.assign(s,n),s},Doe=(e,t)=>e?PO(e,t):PO;function ms(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,i]of e)if(!Object.is(i,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const s of n)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}const Px=g.createContext(null),Poe=Px.Provider,sU=Fa.error001("react");function Xt(e,t){const n=g.useContext(Px);if(n===null)throw new Error(sU);return nU(n,e,t)}function gs(){const e=g.useContext(Px);if(e===null)throw new Error(sU);return g.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const BO={display:"none"},Boe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},iU="react-flow__node-desc",rU="react-flow__edge-desc",Uoe="react-flow__aria-live",Foe=e=>e.ariaLiveMessage,$oe=e=>e.ariaLabelConfig;function Hoe({rfId:e}){const t=Xt(Foe);return o.jsx("div",{id:`${Uoe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Boe,children:t})}function zoe({rfId:e,disableKeyboardA11y:t}){const n=Xt($oe);return o.jsxs(o.Fragment,{children:[o.jsx("div",{id:`${iU}-${e}`,style:BO,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),o.jsx("div",{id:`${rU}-${e}`,style:BO,children:n["edge.a11yDescription.default"]}),!t&&o.jsx(Hoe,{rfId:e})]})}const Bx=g.forwardRef(({position:e="top-left",children:t,className:n,style:s,...i},r)=>{const a=`${e}`.split("-");return o.jsx("div",{className:ii(["react-flow__panel",n,...a]),style:s,ref:r,...i,children:t})});Bx.displayName="Panel";function Voe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:o.jsx(Bx,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:o.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Goe=e=>{const t=[],n=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&n.push(s);return{selectedNodes:t,selectedEdges:n}},eb=e=>e.id;function Koe(e,t){return ms(e.selectedNodes.map(eb),t.selectedNodes.map(eb))&&ms(e.selectedEdges.map(eb),t.selectedEdges.map(eb))}function qoe({onSelectionChange:e}){const t=gs(),{selectedNodes:n,selectedEdges:s}=Xt(Goe,Koe);return g.useEffect(()=>{const i={nodes:n,edges:s};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(r=>r(i))},[n,s,e]),null}const Yoe=e=>!!e.onSelectionChangeHandlers;function Woe({onSelectionChange:e}){const t=Xt(Yoe);return e||t?o.jsx(qoe,{onSelectionChange:e}):null}const aU=[0,0],Xoe={x:0,y:0,zoom:1},Qoe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],UO=[...Qoe,"rfId"],Zoe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),FO={translateExtent:Pm,nodeOrigin:aU,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Joe(e){const{setNodes:t,setEdges:n,setMinZoom:s,setMaxZoom:i,setTranslateExtent:r,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=Xt(Zoe,ms),u=gs();g.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=FO,l()}),[]);const d=g.useRef(FO);return g.useEffect(()=>{for(const f of UO){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?s(h):f==="maxZoom"?i(h):f==="translateExtent"?r(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:_ae(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},UO.map(f=>e[f])),null}function $O(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function ele(e){var s;const[t,n]=g.useState(e==="system"?null:e);return g.useEffect(()=>{if(e!=="system"){n(e);return}const i=$O(),r=()=>n(i!=null&&i.matches?"dark":"light");return r(),i==null||i.addEventListener("change",r),()=>{i==null||i.removeEventListener("change",r)}},[e]),t!==null?t:(s=$O())!=null&&s.matches?"dark":"light"}const HO=typeof document<"u"?document:null;function $m(e=null,t={target:HO,actInsideInputWithModifier:!0}){const[n,s]=g.useState(!1),i=g.useRef(!1),r=g.useRef(new Set([])),[a,l]=g.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return g.useEffect(()=>{const c=(t==null?void 0:t.target)??$O,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var v,y;if(i.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!i.current||i.current&&!u)&&M9(m))return!1;const b=zO(m.code,l);if(r.current.add(m[b]),HO(a,r.current,!1)){const x=((y=(v=m.composedPath)==null?void 0:v.call(m))==null?void 0:y[0])||m.target,E=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(i.current||!E)&&m.preventDefault(),s(!0)}},f=m=>{const p=zO(m.code,l);HO(a,r.current,!0)?(s(!1),r.current.clear()):r.current.delete(m[p]),m.key==="Meta"&&r.current.clear(),i.current=!1},h=()=>{r.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,s]),n}function HO(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(i=>t.has(i)))}function zO(e,t){return t.includes(e)?"code":"key"}const tle=()=>{const e=ms();return g.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,i,r],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??s,y:t.y??i,zoom:t.zoom??r},n),!0):!1},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:i,minZoom:r,maxZoom:a,panZoom:l}=e.getState(),c=T2(t,s,i,r,a,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:i,snapToGrid:r,domNode:a}=e.getState();if(!a)return t;const{x:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??i,f=n.snapToGrid??r;return ch(u,s,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:i,y:r}=s.getBoundingClientRect(),a=Lf(t,n);return{x:a.x+i,y:a.y+r}}}),[])};function aU(e,t){const n=[],s=new Map,i=[];for(const r of e)if(r.type==="add"){i.push(r);continue}else if(r.type==="remove"||r.type==="replace")s.set(r.id,[r]);else{const a=s.get(r.id);a?a.push(r):s.set(r.id,[r])}for(const r of t){const a=s.get(r.id);if(!a){n.push(r);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...r};for(const c of a)nle(c,l);n.push(l)}return i.length&&i.forEach(r=>{r.index!==void 0?n.splice(r.index,0,{...r.item}):n.push({...r.item})}),n}function nle(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function oU(e,t){return aU(e,t)}function lU(e,t){return aU(e,t)}function Pc(e,t){return{id:e,type:"select",selected:t}}function $d(e,t=new Set,n=!1){const s=[];for(const[i,r]of e){const a=t.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),s.push(Pc(r.id,a)))}return s}function VO({items:e=[],lookup:t}){var i;const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,a]of e.entries()){const l=t.get(a.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function GO(e){return{id:e.id,type:"remove"}}const sle=j9();function cU(e,t,n={}){return Cae(e,t,{...n,onError:n.onError??sle})}const KO=e=>mae(e),ile=e=>k9(e);function uU(e){return g.forwardRef(e)}const rle=typeof window<"u"?g.useLayoutEffect:g.useEffect;function qO(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>ale(()=>n(i=>i+BigInt(1))));return rle(()=>{const i=s.get();i.length&&(e(i),s.reset())},[t]),s}function ale(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const dU=g.createContext(null);function ole({children:e}){const t=ms(),n=g.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:p}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=VO({items:b,lookup:h});for(const y of p.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:x,setNodes:E}=t.getState();y&&E(x)})},[]),s=qO(n),i=g.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const p of l)m=typeof p=="function"?p(m):p;d?u(m):f&&f(VO({items:m,lookup:h}))},[]),r=qO(i),a=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return o.jsx(dU.Provider,{value:a,children:e})}function lle(){const e=g.useContext(dU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const cle=e=>!!e.panZoom;function Bx(){const e=tle(),t=ms(),n=lle(),s=Jt(cle),i=g.useMemo(()=>{const r=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,x;const{nodeLookup:h,nodeOrigin:m}=t.getState(),p=KO(f)?f:h.get(f.id),b=p.parentId?R9(p.position,p.measured,p.parentId,h,m):p.position,v={...p,position:b,width:((y=p.measured)==null?void 0:y.width)??p.width,height:((x=p.measured)==null?void 0:x.height)??p.height};return Mf(v)},u=(f,h,m={replace:!1})=>{a(p=>p.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&KO(v)?v:{...b,...v}}return b}))},d=(f,h,m={replace:!1})=>{l(p=>p.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return m.replace&&ile(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=r(f))==null?void 0:h.internals.userNode},getInternalNode:r,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[p,b,v]=m;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:p,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:p,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:E,onBeforeDelete:w}=t.getState(),{nodes:S,edges:_}=await xae({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:p,onBeforeDelete:w}),k=_.length>0,T=S.length>0;if(k){const A=_.map(GO);v==null||v(_),x(A)}if(T){const A=S.map(GO);b==null||b(S),y(A)}return(T||k)&&(E==null||E({nodes:S,edges:_})),{deletedNodes:S,deletedEdges:_}},getIntersectingNodes:(f,h=!0,m)=>{const p=wO(f),b=p?f:c(f),v=m!==void 0;return b?(m||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!p&&(y.id===f.id||!x.internals.positionAbsolute))return!1;const E=Mf(v?y:x),w=Hp(E,b);return h&&w>0||w>=E.width*E.height||w>=b.width*b.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const b=wO(f)?f:c(f);if(!b)return!1;const v=Hp(b,h);return m&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,p=>{const b=typeof h=="function"?h(p):h;return m.replace?{...p,data:b}:{...p,data:{...p.data,...b}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,p=>{const b=typeof h=="function"?h(p):h;return m.replace?{...p,data:b}:{...p,data:{...p.data,...b}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return pae(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var p;return Array.from(((p=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:p.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var p;return Array.from(((p=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:p.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??wae();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return g.useMemo(()=>({...i,...e,viewportInitialized:s}),[s])}const YO=e=>e.selected,ule=typeof window<"u"?window:void 0;function dle({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ms(),{deleteElements:s}=Bx(),i=Vp(e,{actInsideInputWithModifier:!1}),r=Vp(t,{target:ule});g.useEffect(()=>{if(i){const{edges:a,nodes:l}=n.getState();s({nodes:l.filter(YO),edges:a.filter(YO)}),n.setState({nodesSelectionActive:!1})}},[i]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function fle(e){const t=ms();g.useEffect(()=>{const n=()=>{var i,r,a,l;if(!e.current||!(((r=(i=e.current).checkVisibility)==null?void 0:r.call(i))??!0))return!1;const s=A2(e.current);(s.height===0||s.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",La.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Ux={position:"absolute",width:"100%",height:"100%",top:0,left:0},hle=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function mle({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:i=.5,panOnScrollMode:r=su.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:p,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:x,paneClickDistance:E,selectionOnDrag:w}){const S=ms(),_=g.useRef(null),{userSelectionActive:k,lib:T,connectionInProgress:A}=Jt(hle,hs),j=Vp(h),R=g.useRef();fle(_);const B=g.useCallback(z=>{y==null||y({x:z[0],y:z[1],zoom:z[2]}),x||S.setState({transform:z})},[y,x]);return g.useEffect(()=>{if(_.current){R.current=roe({domNode:_.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>S.setState(I=>I.paneDragging===C?I:{paneDragging:C}),onPanZoomStart:(C,I)=>{const{onViewportChangeStart:D,onMoveStart:$}=S.getState();$==null||$(C,I),D==null||D(I)},onPanZoom:(C,I)=>{const{onViewportChange:D,onMove:$}=S.getState();$==null||$(C,I),D==null||D(I)},onPanZoomEnd:(C,I)=>{const{onViewportChangeEnd:D,onMoveEnd:$}=S.getState();$==null||$(C,I),D==null||D(I)}});const{x:z,y:L,zoom:F}=R.current.getViewport();return S.setState({panZoom:R.current,transform:[z,L,F],domNode:_.current.closest(".react-flow")}),()=>{var C;(C=R.current)==null||C.destroy()}}},[]),g.useEffect(()=>{var z;(z=R.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:i,panOnScrollMode:r,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:j,preventScrolling:m,noPanClassName:v,userSelectionActive:k,noWheelClassName:b,lib:T,onTransformChange:B,connectionInProgress:A,selectionOnDrag:w,paneClickDistance:E})},[e,t,n,s,i,r,a,l,j,m,v,k,b,T,B,A,w,E]),o.jsx("div",{className:"react-flow__renderer",ref:_,style:Ux,children:p})}const ple=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function gle(){const{userSelectionActive:e,userSelectionRect:t}=Jt(ple,hs);return e&&t?o.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const ow=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ble=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function yle({isSelecting:e,selectionKeyPressed:t,selectionMode:n=$p.Full,panOnDrag:s,autoPanOnSelection:i,paneClickDistance:r,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:m,onPaneMouseLeave:p,children:b}){const v=g.useRef(0),y=ms(),{userSelectionActive:x,elementsSelectable:E,dragging:w,connectionInProgress:S,panBy:_,autoPanSpeed:k}=Jt(ble,hs),T=E&&(e||x),A=g.useRef(null),j=g.useRef(),R=g.useRef(new Set),B=g.useRef(new Set),z=g.useRef(!1),L=g.useRef({x:0,y:0}),F=g.useRef(!1),C=K=>{if(z.current||S){z.current=!1;return}u==null||u(K),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},I=K=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){K.preventDefault();return}d==null||d(K)},D=f?K=>f(K):void 0,$=K=>{z.current&&(K.stopPropagation(),z.current=!1)},O=K=>{var pe,_e;const{domNode:ce,transform:he}=y.getState();if(j.current=ce==null?void 0:ce.getBoundingClientRect(),!j.current)return;const ye=K.target===A.current;if(!ye&&!!K.target.closest(".nokey")||!e||!(a&&ye||t)||K.button!==0||!K.isPrimary)return;(_e=(pe=K.target)==null?void 0:pe.setPointerCapture)==null||_e.call(pe,K.pointerId),z.current=!1;const{x:De,y:Se}=Ia(K.nativeEvent,j.current),ae=ch({x:De,y:Se},he);y.setState({userSelectionRect:{width:0,height:0,startX:ae.x,startY:ae.y,x:De,y:Se}}),ye||(K.stopPropagation(),K.preventDefault())};function te(K,ce){const{userSelectionRect:he}=y.getState();if(!he)return;const{transform:ye,nodeLookup:ue,edgeLookup:we,connectionLookup:De,triggerNodeChanges:Se,triggerEdgeChanges:ae,defaultEdgeOptions:pe}=y.getState(),_e={x:he.startX,y:he.startY},{x:et,y:Be}=Lf(_e,ye),Fe={startX:_e.x,startY:_e.y,x:KUe.id)),B.current=new Set;const Ke=(pe==null?void 0:pe.selectable)??!0;for(const Ue of R.current){const W=De.get(Ue);if(W)for(const{edgeId:oe}of W.values()){const Z=we.get(oe);Z&&(Z.selectable??Ke)&&B.current.add(oe)}}if(!_O(We,R.current)){const Ue=$d(ue,R.current,!0);Se(Ue)}if(!_O(Ae,B.current)){const Ue=$d(we,B.current);ae(Ue)}y.setState({userSelectionRect:Fe,userSelectionActive:!0,nodesSelectionActive:!1})}function ne(){if(!i||!j.current)return;const[K,ce]=N2(L.current,j.current,k);_({x:K,y:ce}).then(he=>{if(!z.current||!he){v.current=requestAnimationFrame(ne);return}const{x:ye,y:ue}=L.current;te(ye,ue),v.current=requestAnimationFrame(ne)})}const P=()=>{cancelAnimationFrame(v.current),v.current=0,F.current=!1};g.useEffect(()=>()=>P(),[]);const Q=K=>{const{userSelectionRect:ce,transform:he,resetSelectedElements:ye}=y.getState();if(!j.current||!ce)return;const{x:ue,y:we}=Ia(K.nativeEvent,j.current);L.current={x:ue,y:we};const De=Lf({x:ce.startX,y:ce.startY},he);if(!z.current){const Se=t?0:r;if(Math.hypot(ue-De.x,we-De.y)<=Se)return;ye(),l==null||l(K)}z.current=!0,F.current||(ne(),F.current=!0),te(ue,we)},ee=K=>{var ce,he;K.button===0&&((he=(ce=K.target)==null?void 0:ce.releasePointerCapture)==null||he.call(ce,K.pointerId),!x&&K.target===A.current&&y.getState().userSelectionRect&&(C==null||C(K)),y.setState({userSelectionActive:!1,userSelectionRect:null}),z.current&&(c==null||c(K),y.setState({nodesSelectionActive:R.current.size>0})),P())},V=K=>{var ce,he;(he=(ce=K.target)==null?void 0:ce.releasePointerCapture)==null||he.call(ce,K.pointerId),P()},X=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxs("div",{className:ii(["react-flow__pane",{draggable:X,dragging:w,selection:e}]),onClick:T?void 0:ow(C,A),onContextMenu:ow(I,A),onWheel:ow(D,A),onPointerEnter:T?void 0:h,onPointerMove:T?Q:m,onPointerUp:T?ee:void 0,onPointerCancel:T?V:void 0,onPointerDownCapture:T?O:void 0,onClickCapture:T?$:void 0,onPointerLeave:p,ref:A,style:Ux,children:[b,o.jsx(gle,{})]})}function nN({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:i,unselectNodesAndEdges:r,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",La.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(r({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):i([e])}function fU({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:i,isSelectable:r,nodeClickDistance:a}){const l=ms(),[c,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=Gae({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{nN({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),g.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:r,nodeId:i,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,s,t,r,e,i,a]),c}const xle=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function hU(){const e=ms();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:i,snapGrid:r,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=xle(a),m=i?r[0]:5,p=i?r[1]:5,b=n.direction.x*m*n.factor,v=n.direction.y*p*n.factor;for(const[,y]of u){if(!h(y))continue;let x={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};i&&(x=Cg(x,r));const{position:E,positionAbsolute:w}=A9({nodeId:y.id,nextPosition:x,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:l});y.position=E,y.internals.positionAbsolute=w,f.set(y.id,y)}c(f)},[])}const M2=g.createContext(null),Ele=M2.Provider;M2.Consumer;const mU=()=>g.useContext(M2),vle=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),wle=(e,t,n)=>s=>{const{connectionClickStartHandle:i,connectionMode:r,connection:a}=s,{fromHandle:l,toHandle:c,isValid:u}=a,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:r===jf.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:d&&u}};function _le({type:e="source",position:t=Ze.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:i=!0,isConnectableEnd:r=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var F,C;const p=a||null,b=e==="target",v=ms(),y=mU(),{connectOnClick:x,noPanClassName:E,rfId:w}=Jt(vle,hs),{connectingFrom:S,connectingTo:_,clickConnecting:k,isPossibleEndHandle:T,connectionInProcess:A,clickConnectionInProcess:j,valid:R}=Jt(wle(y,p,e),hs);y||(C=(F=v.getState()).onError)==null||C.call(F,"010",La.error010());const B=I=>{const{defaultEdgeOptions:D,onConnect:$,hasDefaultEdges:O}=v.getState(),te={...D,...I};if(O){const{edges:ne,setEdges:P,onError:Q}=v.getState();P(cU(te,ne,{onError:Q}))}$==null||$(te),l==null||l(te)},z=I=>{if(!y)return;const D=L9(I.nativeEvent);if(i&&(D&&I.button===0||!D)){const $=v.getState();tN.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:b,handleId:p,nodeId:y,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...O)=>{var te,ne;return(ne=(te=v.getState()).onConnectEnd)==null?void 0:ne.call(te,...O)},updateConnection:$.updateConnection,onConnect:B,isValidConnection:n||((...O)=>{var te,ne;return((ne=(te=v.getState()).isValidConnection)==null?void 0:ne.call(te,...O))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}D?d==null||d(I):f==null||f(I)},L=I=>{const{onClickConnectStart:D,onClickConnectEnd:$,connectionClickStartHandle:O,connectionMode:te,isValidConnection:ne,lib:P,rfId:Q,nodeLookup:ee,connection:V}=v.getState();if(!y||!O&&!i)return;if(!O){D==null||D(I.nativeEvent,{nodeId:y,handleId:p,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:p}});return}const X=O9(I.target),K=n||ne,{connection:ce,isValid:he}=tN.isValid(I.nativeEvent,{handle:{nodeId:y,id:p,type:e},connectionMode:te,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:K,flowId:Q,doc:X,lib:P,nodeLookup:ee});he&&ce&&B(ce);const ye=structuredClone(V);delete ye.inProgress,ye.toPosition=ye.toHandle?ye.toHandle.position:null,$==null||$(I,ye),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":p,"data-nodeid":y,"data-handlepos":t,"data-id":`${w}-${y}-${p}-${e}`,className:ii(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,u,{source:!b,target:b,connectable:s,connectablestart:i,connectableend:r,clickconnecting:k,connectingfrom:S,connectingto:_,valid:R,connectionindicator:s&&(!A||T)&&(A||j?r:i)}]),onMouseDown:z,onTouchStart:z,onClick:x?L:void 0,ref:m,...h,children:c})}const Fi=g.memo(uU(_le));function Sle({data:e,isConnectable:t,sourcePosition:n=Ze.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(Fi,{type:"source",position:n,isConnectable:t})]})}function Nle({data:e,isConnectable:t,targetPosition:n=Ze.Top,sourcePosition:s=Ze.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(Fi,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(Fi,{type:"source",position:s,isConnectable:t})]})}function Tle(){return null}function kle({data:e,isConnectable:t,targetPosition:n=Ze.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(Fi,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const x1={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},WO={input:Sle,default:Nle,output:kle,group:Tle};function Ale(e){var t,n,s,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Cle=e=>{const{width:t,height:n,x:s,y:i}=Ag(e.nodeLookup,{filter:r=>!!r.selected});return{width:Ca(t)?t:null,height:Ca(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${i}px)`}};function Ile({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=ms(),{width:i,height:r,transformString:a,userSelectionActive:l}=Jt(Cle,hs),c=hU(),u=g.useRef(null);g.useEffect(()=>{var m;n||(m=u.current)==null||m.focus({preventScroll:!0})},[n]);const d=!l&&i!==null&&r!==null;if(fU({nodeRef:u,disabled:!d}),!d)return null;const f=e?m=>{const p=s.getState().nodes.filter(b=>b.selected);e(m,p)}:void 0,h=m=>{Object.prototype.hasOwnProperty.call(x1,m.key)&&(m.preventDefault(),c({direction:x1[m.key],factor:m.shiftKey?4:1}))};return o.jsx("div",{className:ii(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:r}})})}const XO=typeof window<"u"?window:void 0,jle=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function pU({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:r,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:p,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:w,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:k,panOnDrag:T,autoPanOnSelection:A,defaultViewport:j,translateExtent:R,minZoom:B,maxZoom:z,preventScrolling:L,onSelectionContextMenu:F,noWheelClassName:C,noPanClassName:I,disableKeyboardA11y:D,onViewportChange:$,isControlledViewport:O}){const{nodesSelectionActive:te,userSelectionActive:ne}=Jt(jle,hs),P=Vp(u,{target:XO}),Q=Vp(b,{target:XO}),ee=Q||T,V=Q||w,X=d&&ee!==!0,K=P||ne||X;return dle({deleteKeyCode:c,multiSelectionKeyCode:p}),o.jsx(mle,{onPaneContextMenu:r,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:V,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:k,panOnDrag:!P&&ee,defaultViewport:j,translateExtent:R,minZoom:B,maxZoom:z,zoomActivationKeyCode:v,preventScrolling:L,noWheelClassName:C,noPanClassName:I,onViewportChange:$,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:X,children:o.jsxs(yle,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:r,onPaneScroll:a,panOnDrag:ee,autoPanOnSelection:A,isSelecting:!!K,selectionMode:f,selectionKeyPressed:P,paneClickDistance:l,selectionOnDrag:X,children:[e,te&&o.jsx(Ile,{onSelectionContextMenu:F,noPanClassName:I,disableKeyboardA11y:D})]})})}pU.displayName="FlowRenderer";const Rle=g.memo(pU),Ole=e=>t=>e?S2(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Mle(e){return Jt(g.useCallback(Ole(e),[e]),hs)}const Lle=e=>e.updateNodeInternals;function Dle(){const e=Jt(Lle),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(i=>{const r=i.target.getAttribute("data-id");s.set(r,{id:r,nodeElement:i.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Ple({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const i=ms(),r=g.useRef(null),a=g.useRef(null),l=g.useRef(e.sourcePosition),c=g.useRef(e.targetPosition),u=g.useRef(t),d=n&&!!e.internals.handleBounds;return g.useEffect(()=>{r.current&&!e.hidden&&(!d||a.current!==r.current)&&(a.current&&(s==null||s.unobserve(a.current)),s==null||s.observe(r.current),a.current=r.current)},[d,e.hidden]),g.useEffect(()=>()=>{a.current&&(s==null||s.unobserve(a.current),a.current=null)},[]),g.useEffect(()=>{if(r.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:r.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),r}function Ble({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:i,onContextMenu:r,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:p,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:x}){const{node:E,internals:w,isParent:S}=Jt(K=>{const ce=K.nodeLookup.get(e),he=K.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:he}},hs);let _=E.type||"default",k=(v==null?void 0:v[_])||WO[_];k===void 0&&(x==null||x("003",La.error003(_)),_="default",k=(v==null?void 0:v.default)||WO.default);const T=!!(E.draggable||l&&typeof E.draggable>"u"),A=!!(E.selectable||c&&typeof E.selectable>"u"),j=!!(E.connectable||u&&typeof E.connectable>"u"),R=!!(E.focusable||d&&typeof E.focusable>"u"),B=ms(),z=k2(E),L=Ple({node:E,nodeType:_,hasDimensions:z,resizeObserver:f}),F=fU({nodeRef:L,disabled:E.hidden||!T,noDragClassName:h,handleSelector:E.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:y}),C=hU();if(E.hidden)return null;const I=rl(E),D=Ale(E),$=A||T||t||n||s||i,O=n?K=>n(K,{...w.userNode}):void 0,te=s?K=>s(K,{...w.userNode}):void 0,ne=i?K=>i(K,{...w.userNode}):void 0,P=r?K=>r(K,{...w.userNode}):void 0,Q=a?K=>a(K,{...w.userNode}):void 0,ee=K=>{const{selectNodesOnDrag:ce,nodeDragThreshold:he}=B.getState();A&&(!ce||!T||he>0)&&nN({id:e,store:B,nodeRef:L}),t&&t(K,{...w.userNode})},V=K=>{if(!(M9(K.nativeEvent)||p)){if(_9.includes(K.key)&&A){const ce=K.key==="Escape";nN({id:e,store:B,unselect:ce,nodeRef:L})}else if(T&&E.selected&&Object.prototype.hasOwnProperty.call(x1,K.key)){K.preventDefault();const{ariaLabelConfig:ce}=B.getState();B.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),C({direction:x1[K.key],factor:K.shiftKey?4:1})}}},X=()=>{var De;if(p||!((De=L.current)!=null&&De.matches(":focus-visible")))return;const{transform:K,width:ce,height:he,autoPanOnNodeFocus:ye,setCenter:ue}=B.getState();if(!ye)return;S2(new Map([[e,E]]),{x:0,y:0,width:ce,height:he},K,!0).length>0||ue(E.position.x+I.width/2,E.position.y+I.height/2,{zoom:K[2]})};return o.jsx("div",{className:ii(["react-flow__node",`react-flow__node-${_}`,{[m]:T},E.className,{selected:E.selected,selectable:A,parent:S,draggable:T,dragging:F}]),ref:L,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:z?"visible":"hidden",...E.style,...D},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:te,onMouseLeave:ne,onContextMenu:P,onClick:ee,onDoubleClick:Q,onKeyDown:R?V:void 0,tabIndex:R?0:void 0,onFocus:R?X:void 0,role:E.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${sU}-${b}`,"aria-label":E.ariaLabel,...E.domAttributes,children:o.jsx(Ele,{value:e,children:o.jsx(k,{id:e,data:E.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:E.selected??!1,selectable:A,draggable:T,deletable:E.deletable??!0,isConnectable:j,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:F,dragHandle:E.dragHandle,zIndex:w.z,parentId:E.parentId,...I})})})}var Ule=g.memo(Ble);const Fle=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function gU(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:i,onError:r}=Jt(Fle,hs),a=Mle(e.onlyRenderVisibleElements),l=Dle();return o.jsx("div",{className:"react-flow__nodes",style:Ux,children:a.map(c=>o.jsx(Ule,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:r},c))})}gU.displayName="NodeRenderer";const $le=g.memo(gU);function Hle(e){return Jt(g.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const s=[];if(n.width&&n.height)for(const i of n.edges){const r=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);r&&a&&Tae({sourceNode:r,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&s.push(i.id)}return s},[e]),hs)}const zle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Vle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},QO={[Rf.Arrow]:zle,[Rf.ArrowClosed]:Vle};function Gle(e){const t=ms();return g.useMemo(()=>{var i,r;return Object.prototype.hasOwnProperty.call(QO,e)?QO[e]:((r=(i=t.getState()).onError)==null||r.call(i,"009",La.error009(e)),null)},[e])}const Kle=({id:e,type:t,color:n,width:s=12.5,height:i=12.5,markerUnits:r="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=Gle(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},bU=({defaultColor:e,rfId:t})=>{const n=Jt(r=>r.edges),s=Jt(r=>r.defaultEdgeOptions),i=g.useMemo(()=>Mae(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return i.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:i.map(r=>o.jsx(Kle,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})}):null};bU.displayName="MarkerDefinitions";var qle=g.memo(bU);function yU({x:e,y:t,label:n,labelStyle:s,labelShowBg:i=!0,labelBgStyle:r,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=g.useState({x:1,y:0,width:0,height:0}),m=ii(["react-flow__edge-textwrapper",u]),p=g.useRef(null);return g.useEffect(()=>{if(p.current){const b=p.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[i&&o.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:r,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:s,children:n}),c]}):null}yU.displayName="EdgeText";const Yle=g.memo(yU);function Ig({path:e,labelX:t,labelY:n,label:s,labelStyle:i,labelShowBg:r,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:ii(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,s&&Ca(t)&&Ca(n)?o.jsx(Yle,{x:t,y:n,label:s,labelStyle:i,labelShowBg:r,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function ZO({pos:e,x1:t,y1:n,x2:s,y2:i}){return e===Ze.Left||e===Ze.Right?[.5*(t+s),n]:[t,.5*(n+i)]}function xU({sourceX:e,sourceY:t,sourcePosition:n=Ze.Bottom,targetX:s,targetY:i,targetPosition:r=Ze.Top}){const[a,l]=ZO({pos:n,x1:e,y1:t,x2:s,y2:i}),[c,u]=ZO({pos:r,x1:s,y1:i,x2:e,y2:t}),[d,f,h,m]=D9({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${s},${i}`,d,f,h,m]}function EU(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[x,E,w]=xU({sourceX:n,sourceY:s,sourcePosition:a,targetX:i,targetY:r,targetPosition:l}),S=e.isInternal?void 0:t;return o.jsx(Ig,{id:S,path:x,labelX:E,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:b,markerStart:v,interactionWidth:y})})}const Wle=EU({isInternal:!1}),vU=EU({isInternal:!0});Wle.displayName="SimpleBezierEdge";vU.displayName="SimpleBezierEdgeInternal";function wU(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=Ze.Bottom,targetPosition:p=Ze.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[E,w,S]=y1({sourceX:n,sourceY:s,sourcePosition:m,targetX:i,targetY:r,targetPosition:p,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),_=e.isInternal?void 0:t;return o.jsx(Ig,{id:_,path:E,labelX:w,labelY:S,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:x})})}const _U=wU({isInternal:!1}),SU=wU({isInternal:!0});_U.displayName="SmoothStepEdge";SU.displayName="SmoothStepEdgeInternal";function NU(e){return g.memo(({id:t,...n})=>{var i;const s=e.isInternal?void 0:t;return o.jsx(_U,{...n,id:s,pathOptions:g.useMemo(()=>{var r;return{borderRadius:0,offset:(r=n.pathOptions)==null?void 0:r.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Xle=NU({isInternal:!1}),TU=NU({isInternal:!0});Xle.displayName="StepEdge";TU.displayName="StepEdgeInternal";function kU(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:p,interactionWidth:b})=>{const[v,y,x]=U9({sourceX:n,sourceY:s,targetX:i,targetY:r}),E=e.isInternal?void 0:t;return o.jsx(Ig,{id:E,path:v,labelX:y,labelY:x,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:p,interactionWidth:b})})}const Qle=kU({isInternal:!1}),AU=kU({isInternal:!0});Qle.displayName="StraightEdge";AU.displayName="StraightEdgeInternal";function CU(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,sourcePosition:a=Ze.Bottom,targetPosition:l=Ze.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[E,w,S]=P9({sourceX:n,sourceY:s,sourcePosition:a,targetX:i,targetY:r,targetPosition:l,curvature:y==null?void 0:y.curvature}),_=e.isInternal?void 0:t;return o.jsx(Ig,{id:_,path:E,labelX:w,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:b,markerStart:v,interactionWidth:x})})}const Zle=CU({isInternal:!1}),IU=CU({isInternal:!0});Zle.displayName="BezierEdge";IU.displayName="BezierEdgeInternal";const JO={default:IU,straight:AU,step:TU,smoothstep:SU,simplebezier:vU},eM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Jle=(e,t,n)=>n===Ze.Left?e-t:n===Ze.Right?e+t:e,ece=(e,t,n)=>n===Ze.Top?e-t:n===Ze.Bottom?e+t:e,tM="react-flow__edgeupdater";function nM({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:i,onMouseEnter:r,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:i,onMouseEnter:r,onMouseOut:a,className:ii([tM,`${tM}-${l}`]),cx:Jle(t,s,e),cy:ece(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function tce({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:i,targetX:r,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const p=ms(),b=(w,S)=>{if(w.button!==0)return;const{autoPanOnConnect:_,domNode:k,connectionMode:T,connectionRadius:A,lib:j,onConnectStart:R,cancelConnection:B,nodeLookup:z,rfId:L,panBy:F,updateConnection:C}=p.getState(),I=S.type==="target",D=(te,ne)=>{h(!1),f==null||f(te,n,S.type,ne)},$=te=>u==null?void 0:u(n,te),O=(te,ne)=>{h(!0),d==null||d(w,n,S.type),R==null||R(te,ne)};tN.onPointerDown(w.nativeEvent,{autoPanOnConnect:_,connectionMode:T,connectionRadius:A,domNode:k,handleId:S.id,nodeId:S.nodeId,nodeLookup:z,isTarget:I,edgeUpdaterType:S.type,lib:j,flowId:L,cancelConnection:B,panBy:F,isValidConnection:(...te)=>{var ne,P;return((P=(ne=p.getState()).isValidConnection)==null?void 0:P.call(ne,...te))??!0},onConnect:$,onConnectStart:O,onConnectEnd:(...te)=>{var ne,P;return(P=(ne=p.getState()).onConnectEnd)==null?void 0:P.call(ne,...te)},onReconnectEnd:D,updateConnection:C,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>b(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=w=>b(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>m(!0),E=()=>m(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(nM,{position:l,centerX:s,centerY:i,radius:t,onMouseDown:v,onMouseEnter:x,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&o.jsx(nM,{position:c,centerX:r,centerY:a,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:E,type:"target"})]})}function nce({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:i,onDoubleClick:r,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:p,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:x}){let E=Jt(ue=>ue.edgeLookup.get(e));const w=Jt(ue=>ue.defaultEdgeOptions);E=w?{...w,...E}:E;let S=E.type||"default",_=(b==null?void 0:b[S])||JO[S];_===void 0&&(y==null||y("011",La.error011(S)),S="default",_=(b==null?void 0:b.default)||JO.default);const k=!!(E.focusable||t&&typeof E.focusable>"u"),T=typeof f<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),A=!!(E.selectable||s&&typeof E.selectable>"u"),j=g.useRef(null),[R,B]=g.useState(!1),[z,L]=g.useState(!1),F=ms(),{zIndex:C,sourceX:I,sourceY:D,targetX:$,targetY:O,sourcePosition:te,targetPosition:ne}=Jt(g.useCallback(ue=>{const we=ue.nodeLookup.get(E.source),De=ue.nodeLookup.get(E.target);if(!we||!De)return{zIndex:E.zIndex,...eM};const Se=Oae({id:e,sourceNode:we,targetNode:De,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ue.connectionMode,onError:y});return{zIndex:Nae({selected:E.selected,zIndex:E.zIndex,sourceNode:we,targetNode:De,elevateOnSelect:ue.elevateEdgesOnSelect,zIndexMode:ue.zIndexMode}),...Se||eM}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),hs),P=g.useMemo(()=>E.markerStart?`url('#${JS(E.markerStart,p)}')`:void 0,[E.markerStart,p]),Q=g.useMemo(()=>E.markerEnd?`url('#${JS(E.markerEnd,p)}')`:void 0,[E.markerEnd,p]);if(E.hidden||I===null||D===null||$===null||O===null)return null;const ee=ue=>{var ae;const{addSelectedEdges:we,unselectNodesAndEdges:De,multiSelectionActive:Se}=F.getState();A&&(F.setState({nodesSelectionActive:!1}),E.selected&&Se?(De({nodes:[],edges:[E]}),(ae=j.current)==null||ae.blur()):we([e])),i&&i(ue,E)},V=r?ue=>{r(ue,{...E})}:void 0,X=a?ue=>{a(ue,{...E})}:void 0,K=l?ue=>{l(ue,{...E})}:void 0,ce=c?ue=>{c(ue,{...E})}:void 0,he=u?ue=>{u(ue,{...E})}:void 0,ye=ue=>{var we;if(!x&&_9.includes(ue.key)&&A){const{unselectNodesAndEdges:De,addSelectedEdges:Se}=F.getState();ue.key==="Escape"?((we=j.current)==null||we.blur(),De({edges:[E]})):Se([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:ii(["react-flow__edge",`react-flow__edge-${S}`,E.className,v,{selected:E.selected,animated:E.animated,inactive:!A&&!i,updating:R,selectable:A}]),onClick:ee,onDoubleClick:V,onContextMenu:X,onMouseEnter:K,onMouseMove:ce,onMouseLeave:he,onKeyDown:k?ye:void 0,tabIndex:k?0:void 0,role:E.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":k?`${iU}-${p}`:void 0,ref:j,...E.domAttributes,children:[!z&&o.jsx(_,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:A,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:I,sourceY:D,targetX:$,targetY:O,sourcePosition:te,targetPosition:ne,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:P,markerEnd:Q,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),T&&o.jsx(tce,{edge:E,isReconnectable:T,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:I,sourceY:D,targetX:$,targetY:O,sourcePosition:te,targetPosition:ne,setUpdateHover:B,setReconnecting:L})]})})}var sce=g.memo(nce);const ice=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function jU({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:i,onReconnect:r,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:p,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,onError:E}=Jt(ice,hs),w=Hle(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(qle,{defaultColor:e,rfId:n}),w.map(S=>o.jsx(sce,{id:S,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,noPanClassName:i,onReconnect:r,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:p,rfId:n,onError:E,edgeTypes:s,disableKeyboardA11y:b},S))]})}jU.displayName="EdgeRenderer";const rce=g.memo(jU),ace=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function oce({children:e}){const t=Jt(ace);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function lce(e){const t=Bx(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const cce=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function uce(e){const t=Jt(cce),n=ms();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function dce(e){return e.connection.inProgress?{...e.connection,to:ch(e.connection.to,e.transform)}:{...e.connection}}function fce(e){return dce}function hce(e){const t=fce();return Jt(t,hs)}const mce=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function pce({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:i,width:r,height:a,isValid:l,inProgress:c}=Jt(mce,hs);return!(r&&i&&c)?null:o.jsx("svg",{style:e,width:r,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:ii(["react-flow__connection",T9(l)]),children:o.jsx(RU,{style:t,type:n,CustomComponent:s,isValid:l})})})}const RU=({style:e,type:t=Ml.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:i,from:r,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=hce();if(!i)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:r.x,fromY:r.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:T9(s),toNode:d,toHandle:f,pointer:m});let p="";const b={sourceX:r.x,sourceY:r.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Ml.Bezier:[p]=P9(b);break;case Ml.SimpleBezier:[p]=xU(b);break;case Ml.Step:[p]=y1({...b,borderRadius:0});break;case Ml.SmoothStep:[p]=y1(b);break;default:[p]=U9(b)}return o.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};RU.displayName="ConnectionLine";const gce={};function sM(e=gce){g.useRef(e),ms(),g.useEffect(()=>{},[e])}function bce(){ms(),g.useRef(!1),g.useEffect(()=>{},[])}function OU({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:i,onNodeDoubleClick:r,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:p,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:E,selectionMode:w,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:k,deleteKeyCode:T,onlyRenderVisibleElements:A,elementsSelectable:j,defaultViewport:R,translateExtent:B,minZoom:z,maxZoom:L,preventScrolling:F,defaultMarkerColor:C,zoomOnScroll:I,zoomOnPinch:D,panOnScroll:$,panOnScrollSpeed:O,panOnScrollMode:te,zoomOnDoubleClick:ne,panOnDrag:P,autoPanOnSelection:Q,onPaneClick:ee,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:K,onPaneScroll:ce,onPaneContextMenu:he,paneClickDistance:ye,nodeClickDistance:ue,onEdgeContextMenu:we,onEdgeMouseEnter:De,onEdgeMouseMove:Se,onEdgeMouseLeave:ae,reconnectRadius:pe,onReconnect:_e,onReconnectStart:et,onReconnectEnd:Be,noDragClassName:Fe,noWheelClassName:We,noPanClassName:Ae,disableKeyboardA11y:Ke,nodeExtent:Ue,rfId:W,viewport:oe,onViewportChange:Z}){return sM(e),sM(t),bce(),lce(n),uce(oe),o.jsx(Rle,{onPaneClick:ee,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:K,onPaneContextMenu:he,onPaneScroll:ce,paneClickDistance:ye,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:E,selectionMode:w,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:k,elementsSelectable:j,zoomOnScroll:I,zoomOnPinch:D,zoomOnDoubleClick:ne,panOnScroll:$,panOnScrollSpeed:O,panOnScrollMode:te,panOnDrag:P,autoPanOnSelection:Q,defaultViewport:R,translateExtent:B,minZoom:z,maxZoom:L,onSelectionContextMenu:f,preventScrolling:F,noDragClassName:Fe,noWheelClassName:We,noPanClassName:Ae,disableKeyboardA11y:Ke,onViewportChange:Z,isControlledViewport:!!oe,children:o.jsxs(oce,{children:[o.jsx(rce,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:_e,onReconnectStart:et,onReconnectEnd:Be,onlyRenderVisibleElements:A,onEdgeContextMenu:we,onEdgeMouseEnter:De,onEdgeMouseMove:Se,onEdgeMouseLeave:ae,reconnectRadius:pe,defaultMarkerColor:C,noPanClassName:Ae,disableKeyboardA11y:Ke,rfId:W}),o.jsx(pce,{style:b,type:p,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx($le,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ue,onlyRenderVisibleElements:A,noPanClassName:Ae,noDragClassName:Fe,disableKeyboardA11y:Ke,nodeExtent:Ue,rfId:W}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}OU.displayName="GraphView";const yce=g.memo(OU),xce=j9(),iM=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:r,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,p=new Map,b=new Map,v=new Map,y=s??t??[],x=n??e??[],E=d??[0,0],w=f??Fp;H9(b,v,y);const{nodesInitialized:S}=eN(x,m,p,{nodeOrigin:E,nodeExtent:w,zIndexMode:h});let _=[0,0,1];if(a&&i&&r){const k=Ag(m,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:T,y:A,zoom:j}=T2(k,i,r,c,u,(l==null?void 0:l.padding)??.1);_=[T,A,j]}return{rfId:"1",width:i??0,height:r??0,transform:_,nodes:x,nodesInitialized:S,nodeLookup:m,parentLookup:p,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Fp,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:jf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...N9},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:xce,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:S9,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Ece=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Doe((m,p)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:x,fitViewResolver:E,width:w,height:S,minZoom:_,maxZoom:k}=p();y&&(await yae({nodes:v,width:w,height:S,panZoom:y,minZoom:_,maxZoom:k},x),E==null||E.resolve(!0),m({fitViewResolver:null}))}return{...iM({nodes:e,edges:t,width:i,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:s,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:E,elevateNodesOnSelect:w,fitViewQueued:S,zIndexMode:_,nodesSelectionActive:k}=p(),{nodesInitialized:T,hasSelectedNodes:A}=eN(v,y,x,{nodeOrigin:E,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:_}),j=k&&A;S&&T?(b(),m({nodes:v,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:j})):m({nodes:v,nodesInitialized:T,nodesSelectionActive:j})},setEdges:v=>{const{connectionLookup:y,edgeLookup:x}=p();H9(y,x,v),m({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:x}=p();x(v),m({hasDefaultNodes:!0})}if(y){const{setEdges:x}=p();x(y),m({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:E,domNode:w,nodeOrigin:S,nodeExtent:_,debug:k,fitViewQueued:T,zIndexMode:A}=p(),{changes:j,updatedInternals:R}=$ae(v,x,E,w,S,_,A);R&&(Pae(x,E,{nodeOrigin:S,nodeExtent:_,zIndexMode:A}),T?(b(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(j==null?void 0:j.length)>0&&(k&&console.log("React Flow: trigger node changes",j),y==null||y(j)))},updateNodePositions:(v,y=!1)=>{const x=[];let E=[];const{nodeLookup:w,triggerNodeChanges:S,connection:_,updateConnection:k,onNodesChangeMiddlewareMap:T}=p();for(const[A,j]of v){const R=w.get(A),B=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(j!=null&&j.position)),z={id:A,type:"position",position:B?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:y};if(R&&_.inProgress&&_.fromNode.id===R.id){const L=yu(R,_.fromHandle,Ze.Left,!0);k({..._,from:L})}B&&R.parentId&&x.push({id:A,parentId:R.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),E.push(z)}if(x.length>0){const{parentLookup:A,nodeOrigin:j}=p(),R=O2(x,w,A,j);E.push(...R)}for(const A of T.values())E=A(E);S(E)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:x,nodes:E,hasDefaultNodes:w,debug:S}=p();if(v!=null&&v.length){if(w){const _=oU(v,E);x(_)}S&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:x,edges:E,hasDefaultEdges:w,debug:S}=p();if(v!=null&&v.length){if(w){const _=lU(v,E);x(_)}S&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:E,triggerNodeChanges:w,triggerEdgeChanges:S}=p();if(y){const _=v.map(k=>Pc(k,!0));w(_);return}w($d(E,new Set([...v]),!0)),S($d(x))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:E,triggerNodeChanges:w,triggerEdgeChanges:S}=p();if(y){const _=v.map(k=>Pc(k,!0));S(_);return}S($d(x,new Set([...v]))),w($d(E,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:x,nodes:E,nodeLookup:w,triggerNodeChanges:S,triggerEdgeChanges:_}=p(),k=v||E,T=y||x,A=[];for(const R of k){if(!R.selected)continue;const B=w.get(R.id);B&&(B.selected=!1),A.push(Pc(R.id,!1))}const j=[];for(const R of T)R.selected&&j.push(Pc(R.id,!1));S(A),_(j)},setMinZoom:v=>{const{panZoom:y,maxZoom:x}=p();y==null||y.setScaleExtent([v,x]),m({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:x}=p();y==null||y.setScaleExtent([x,v]),m({maxZoom:v})},setTranslateExtent:v=>{var y;(y=p().panZoom)==null||y.setTranslateExtent(v),m({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:x,triggerEdgeChanges:E,elementsSelectable:w}=p();if(!w)return;const S=y.reduce((k,T)=>T.selected?[...k,Pc(T.id,!1)]:k,[]),_=v.reduce((k,T)=>T.selected?[...k,Pc(T.id,!1)]:k,[]);x(S),E(_)},setNodeExtent:v=>{const{nodes:y,nodeLookup:x,parentLookup:E,nodeOrigin:w,elevateNodesOnSelect:S,nodeExtent:_,zIndexMode:k}=p();v[0][0]===_[0][0]&&v[0][1]===_[0][1]&&v[1][0]===_[1][0]&&v[1][1]===_[1][1]||(eN(y,x,E,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:k}),m({nodeExtent:v}))},panBy:v=>{const{transform:y,width:x,height:E,panZoom:w,translateExtent:S}=p();return Hae({delta:v,panZoom:w,transform:y,translateExtent:S,width:x,height:E})},setCenter:async(v,y,x)=>{const{width:E,height:w,maxZoom:S,panZoom:_}=p();if(!_)return!1;const k=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:S;return await _.setViewport({x:E/2-v*k,y:w/2-y*k,zoom:k},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{m({connection:{...N9}})},updateConnection:v=>{m({connection:v})},reset:()=>m({...iM()})}},Object.is);function L2({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:i,initialHeight:r,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[p]=g.useState(()=>Ece({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:r,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Poe,{value:p,children:o.jsx(ole,{children:m})})}function vce({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:i,width:r,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return g.useContext(Dx)?o.jsx(o.Fragment,{children:e}):o.jsx(L2,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:i,initialWidth:r,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const wce={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function _ce({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:i,nodeTypes:r,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:p,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:E,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:k,onNodeDrag:T,onNodeDragStop:A,onNodesDelete:j,onEdgesDelete:R,onDelete:B,onSelectionChange:z,onSelectionDragStart:L,onSelectionDrag:F,onSelectionDragStop:C,onSelectionContextMenu:I,onSelectionStart:D,onSelectionEnd:$,onBeforeDelete:O,connectionMode:te,connectionLineType:ne=Ml.Bezier,connectionLineStyle:P,connectionLineComponent:Q,connectionLineContainerStyle:ee,deleteKeyCode:V="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:K=!1,selectionMode:ce=$p.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:ye=zp()?"Meta":"Control",zoomActivationKeyCode:ue=zp()?"Meta":"Control",snapToGrid:we,snapGrid:De,onlyRenderVisibleElements:Se=!1,selectNodesOnDrag:ae,nodesDraggable:pe,autoPanOnNodeFocus:_e,nodesConnectable:et,nodesFocusable:Be,nodeOrigin:Fe=rU,edgesFocusable:We,edgesReconnectable:Ae,elementsSelectable:Ke=!0,defaultViewport:Ue=Xoe,minZoom:W=.5,maxZoom:oe=2,translateExtent:Z=Fp,preventScrolling:Ee=!0,nodeExtent:Oe,defaultMarkerColor:at="#b1b1b7",zoomOnScroll:Lt=!0,zoomOnPinch:ct=!0,panOnScroll:yn=!1,panOnScrollSpeed:Et=.5,panOnScrollMode:vt=su.Free,zoomOnDoubleClick:xn=!0,panOnDrag:Vt=!0,onPaneClick:Ft,onPaneMouseEnter:it,onPaneMouseMove:dt,onPaneMouseLeave:He,onPaneScroll:St,onPaneContextMenu:ge,paneClickDistance:$e=1,nodeClickDistance:nt=0,children:$t,onReconnect:qn,onReconnectStart:nn,onReconnectEnd:qt,onEdgeContextMenu:mn,onEdgeDoubleClick:wt,onEdgeMouseEnter:Bt,onEdgeMouseMove:Tt,onEdgeMouseLeave:En,reconnectRadius:vn=10,onNodesChange:Ht,onEdgesChange:os,noDragClassName:Os="nodrag",noWheelClassName:Ms="nowheel",noPanClassName:wn="nopan",fitView:ls,fitViewOptions:Yn,connectOnClick:Wn,attributionPosition:ri,proOptions:ps,defaultEdgeOptions:Ls,elevateNodesOnSelect:Ln=!0,elevateEdgesOnSelect:Ds=!1,disableKeyboardA11y:Cn=!1,autoPanOnConnect:Ss,autoPanOnNodeDrag:Ps,autoPanOnSelection:cs=!0,autoPanSpeed:gs,connectionRadius:Dn,isValidConnection:pn,onError:on,style:Yt,id:_n,nodeDragThreshold:de,connectionDragThreshold:Ie,viewport:Me,onViewportChange:Xe,width:ot,height:mt,colorMode:bt="light",debug:$n,onScroll:Le,ariaLabelConfig:bs,zIndexMode:ys="basic",...Ns},en){const Ut=_n||"1",Oi=ele(bt),gn=g.useCallback(Ts=>{Ts.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Le==null||Le(Ts)},[Le]);return o.jsx("div",{"data-testid":"rf__wrapper",...Ns,onScroll:gn,style:{...Yt,...wce},ref:en,className:ii(["react-flow",i,Oi]),id:_n,role:"application",children:o.jsxs(vce,{nodes:e,edges:t,width:ot,height:mt,fitView:ls,fitViewOptions:Yn,minZoom:W,maxZoom:oe,nodeOrigin:Fe,nodeExtent:Oe,zIndexMode:ys,children:[o.jsx(Joe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:m,onConnectStart:p,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:pe,autoPanOnNodeFocus:_e,nodesConnectable:et,nodesFocusable:Be,edgesFocusable:We,edgesReconnectable:Ae,elementsSelectable:Ke,elevateNodesOnSelect:Ln,elevateEdgesOnSelect:Ds,minZoom:W,maxZoom:oe,nodeExtent:Oe,onNodesChange:Ht,onEdgesChange:os,snapToGrid:we,snapGrid:De,connectionMode:te,translateExtent:Z,connectOnClick:Wn,defaultEdgeOptions:Ls,fitView:ls,fitViewOptions:Yn,onNodesDelete:j,onEdgesDelete:R,onDelete:B,onNodeDragStart:k,onNodeDrag:T,onNodeDragStop:A,onSelectionDrag:F,onSelectionDragStart:L,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:wn,nodeOrigin:Fe,rfId:Ut,autoPanOnConnect:Ss,autoPanOnNodeDrag:Ps,autoPanSpeed:gs,onError:on,connectionRadius:Dn,isValidConnection:pn,selectNodesOnDrag:ae,nodeDragThreshold:de,connectionDragThreshold:Ie,onBeforeDelete:O,debug:$n,ariaLabelConfig:bs,zIndexMode:ys}),o.jsx(yce,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:E,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:r,edgeTypes:a,connectionLineType:ne,connectionLineStyle:P,connectionLineComponent:Q,connectionLineContainerStyle:ee,selectionKeyCode:X,selectionOnDrag:K,selectionMode:ce,deleteKeyCode:V,multiSelectionKeyCode:ye,panActivationKeyCode:he,zoomActivationKeyCode:ue,onlyRenderVisibleElements:Se,defaultViewport:Ue,translateExtent:Z,minZoom:W,maxZoom:oe,preventScrolling:Ee,zoomOnScroll:Lt,zoomOnPinch:ct,zoomOnDoubleClick:xn,panOnScroll:yn,panOnScrollSpeed:Et,panOnScrollMode:vt,panOnDrag:Vt,autoPanOnSelection:cs,onPaneClick:Ft,onPaneMouseEnter:it,onPaneMouseMove:dt,onPaneMouseLeave:He,onPaneScroll:St,onPaneContextMenu:ge,paneClickDistance:$e,nodeClickDistance:nt,onSelectionContextMenu:I,onSelectionStart:D,onSelectionEnd:$,onReconnect:qn,onReconnectStart:nn,onReconnectEnd:qt,onEdgeContextMenu:mn,onEdgeDoubleClick:wt,onEdgeMouseEnter:Bt,onEdgeMouseMove:Tt,onEdgeMouseLeave:En,reconnectRadius:vn,defaultMarkerColor:at,noDragClassName:Os,noWheelClassName:Ms,noPanClassName:wn,rfId:Ut,disableKeyboardA11y:Cn,nodeExtent:Oe,viewport:Me,onViewportChange:Xe}),o.jsx(Woe,{onSelectionChange:z}),$t,o.jsx(Voe,{proOptions:ps,position:ri}),o.jsx(zoe,{rfId:Ut,disableKeyboardA11y:Cn})]})})}var MU=uU(_ce);const Sce=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Nce({children:e}){const t=Jt(Sce);return t?yi.createPortal(e,t):null}function LU(e){const[t,n]=g.useState(e),s=g.useCallback(i=>n(r=>oU(i,r)),[]);return[t,n,s]}function DU(e){const[t,n]=g.useState(e),s=g.useCallback(i=>n(r=>lU(i,r)),[]);return[t,n,s]}const Tce=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!k2(n.userNode))return!1;return!0};function kce(e={includeHiddenNodes:!1}){return Jt(Tce(e))}function Ace({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ii(["react-flow__background-pattern",n,s])})}function Cce({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:ii(["react-flow__background-pattern","dots",t])})}var Zl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Zl||(Zl={}));const Ice={[Zl.Dots]:1,[Zl.Lines]:1,[Zl.Cross]:6},jce=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function PU({id:e,variant:t=Zl.Dots,gap:n=20,size:s,lineWidth:i=1,offset:r=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=g.useRef(null),{transform:h,patternId:m}=Jt(jce,hs),p=s||Ice[t],b=t===Zl.Dots,v=t===Zl.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*h[2]||1,y[1]*h[2]||1],E=p*h[2],w=Array.isArray(r)?r:[r,r],S=v?[E,E]:x,_=[w[0]*h[2]||1+S[0]/2,w[1]*h[2]||1+S[1]/2],k=`${m}${e||""}`;return o.jsxs("svg",{className:ii(["react-flow__background",u]),style:{...c,...Ux,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:k,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:b?o.jsx(Cce,{radius:E/2,className:d}):o.jsx(Ace,{dimensions:S,lineWidth:i,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}PU.displayName="Background";const BU=g.memo(PU);function Rce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Oce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Mce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Lce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Dce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function eb({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:ii(["react-flow__controls-button",t]),...n,children:e})}const Pce=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function UU({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:i,onZoomIn:r,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const p=ms(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:x}=Jt(Pce,hs),{zoomIn:E,zoomOut:w,fitView:S}=Bx(),_=()=>{E(),r==null||r()},k=()=>{w(),a==null||a()},T=()=>{S(i),l==null||l()},A=()=>{p.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},j=h==="horizontal"?"horizontal":"vertical";return o.jsxs(Px,{className:ii(["react-flow__controls",j,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??x["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(eb,{onClick:_,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(Rce,{})}),o.jsx(eb,{onClick:k,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(Oce,{})})]}),n&&o.jsx(eb,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:o.jsx(Mce,{})}),s&&o.jsx(eb,{className:"react-flow__controls-interactive",onClick:A,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:b?o.jsx(Dce,{}):o.jsx(Lce,{})}),d]})}UU.displayName="Controls";const FU=g.memo(UU);function Bce({id:e,x:t,y:n,width:s,height:i,style:r,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:p,backgroundColor:b}=r||{},v=a||p||b;return o.jsx("rect",{className:ii(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:s,height:i,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?y=>m(y,e):void 0})}const Uce=g.memo(Bce),Fce=e=>e.nodes.map(t=>t.id),lw=e=>e instanceof Function?e:()=>e;function $ce({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:i,nodeComponent:r=Uce,onClick:a}){const l=Jt(Fce,hs),c=lw(t),u=lw(e),d=lw(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(zce,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:i,NodeComponent:r,onClick:a,shapeRendering:f},h))})}function Hce({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:i,nodeStrokeWidth:r,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=Jt(p=>{const b=p.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:x}=b.internals.positionAbsolute,{width:E,height:w}=rl(v);return{node:v,x:y,y:x,width:E,height:w}},hs);return!u||u.hidden||!k2(u)?null:o.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:r,shapeRendering:a,onClick:c,id:u.id})}const zce=g.memo(Hce);var Vce=g.memo($ce);const Gce=200,Kce=150,qce=e=>!e.hidden,Yce=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?I9(Ag(e.nodeLookup,{filter:qce}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Wce="react-flow__minimap-desc";function $U({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:i="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:p,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:x,zoomStep:E=1,offsetScale:w=5}){const S=ms(),_=g.useRef(null),{boundingRect:k,viewBB:T,rfId:A,panZoom:j,translateExtent:R,flowWidth:B,flowHeight:z,ariaLabelConfig:L}=Jt(Yce,hs),F=(e==null?void 0:e.width)??Gce,C=(e==null?void 0:e.height)??Kce,I=k.width/F,D=k.height/C,$=Math.max(I,D),O=$*F,te=$*C,ne=w*$,P=k.x-(O-k.width)/2-ne,Q=k.y-(te-k.height)/2-ne,ee=O+ne*2,V=te+ne*2,X=`${Wce}-${A}`,K=g.useRef(0),ce=g.useRef();K.current=$,g.useEffect(()=>{if(_.current&&j)return ce.current=Qae({domNode:_.current,panZoom:j,getTransform:()=>S.getState().transform,getViewScale:()=>K.current}),()=>{var we;(we=ce.current)==null||we.destroy()}},[j]),g.useEffect(()=>{var we;(we=ce.current)==null||we.update({translateExtent:R,width:B,height:z,inversePan:x,pannable:b,zoomStep:E,zoomable:v})},[b,v,x,E,R,B,z]);const he=m?we=>{var ae;const[De,Se]=((ae=ce.current)==null?void 0:ae.pointer(we))||[0,0];m(we,{x:De,y:Se})}:void 0,ye=p?g.useCallback((we,De)=>{const Se=S.getState().nodeLookup.get(De).internals.userNode;p(we,Se)},[]):void 0,ue=y??L["minimap.ariaLabel"];return o.jsx(Px,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*$:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ii(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:F,height:C,viewBox:`${P} ${Q} ${ee} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:_,onClick:he,children:[ue&&o.jsx("title",{id:X,children:ue}),o.jsx(Vce,{onClick:ye,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:r,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-ne},${Q-ne}h${ee+ne*2}v${V+ne*2}h${-ee-ne*2}z - M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}$U.displayName="MiniMap";const Xce=g.memo($U),Qce=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Zce={[Df.Line]:"right",[Df.Handle]:"bottom-right"};function Jce({nodeId:e,position:t,variant:n=Df.Handle,className:s,style:i=void 0,children:r,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:p,onResizeStart:b,onResize:v,onResizeEnd:y}){const x=mU(),E=typeof e=="string"?e:x,w=ms(),S=g.useRef(null),_=n===Df.Handle,k=Jt(g.useCallback(Qce(_&&m),[_,m]),hs),T=g.useRef(null),A=t??Zce[n];g.useEffect(()=>{if(!(!S.current||!E))return T.current||(T.current=uoe({domNode:S.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:R,transform:B,snapGrid:z,snapToGrid:L,nodeOrigin:F,domNode:C}=w.getState();return{nodeLookup:R,transform:B,snapGrid:z,snapToGrid:L,nodeOrigin:F,paneDomNode:C}},onChange:(R,B)=>{const{triggerNodeChanges:z,nodeLookup:L,parentLookup:F,nodeOrigin:C}=w.getState(),I=[],D={x:R.x,y:R.y},$=L.get(E);if($&&$.expandParent&&$.parentId){const O=$.origin??C,te=R.width??$.measured.width??0,ne=R.height??$.measured.height??0,P={id:$.id,parentId:$.parentId,rect:{width:te,height:ne,...R9({x:R.x??$.position.x,y:R.y??$.position.y},{width:te,height:ne},$.parentId,L,O)}},Q=O2([P],L,F,C);I.push(...Q),D.x=R.x?Math.max(O[0]*te,R.x):void 0,D.y=R.y?Math.max(O[1]*ne,R.y):void 0}if(D.x!==void 0&&D.y!==void 0){const O={id:E,type:"position",position:{...D}};I.push(O)}if(R.width!==void 0&&R.height!==void 0){const te={id:E,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};I.push(te)}for(const O of B){const te={...O,type:"position"};I.push(te)}z(I)},onEnd:({width:R,height:B})=>{const z={id:E,type:"dimensions",resizing:!1,dimensions:{width:R,height:B}};w.getState().triggerNodeChanges([z])}})),T.current.update({controlPosition:A,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:p}),()=>{var R;(R=T.current)==null||R.destroy()}},[A,l,c,u,d,f,b,v,y,p]);const j=A.split("-");return o.jsx("div",{className:ii(["react-flow__resize-control","nodrag",...j,n,s]),ref:S,style:{...i,scale:k,...a&&{[_?"backgroundColor":"borderColor"]:a}},children:r})}g.memo(Jce);var HU=Object.defineProperty,eue=(e,t,n)=>t in e?HU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tue=(e,t)=>{for(var n in t)HU(e,n,{get:t[n],enumerable:!0})},nue=(e,t,n)=>eue(e,t+"",n),zU={};tue(zU,{Graph:()=>ua,alg:()=>D2,json:()=>GU,version:()=>rue});var sue=Object.defineProperty,VU=(e,t)=>{for(var n in t)sue(e,n,{get:t[n],enumerable:!0})},ua=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,n){return t.forEach(s=>{n!==void 0?this.setNode(s,n):this.setNode(s)}),this}setNode(t,n){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let n=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(s=>{this.setParent(s)}),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n="\0";else{n+="";for(let s=n;s!==void 0;s=this.parent(s))if(s===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}parent(t){if(this._isCompound){let n=this._parent[t];if(n!=="\0")return n}}children(t="\0"){if(this._isCompound){let n=this._children[t];if(n)return Object.keys(n)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let n=this._preds[t];if(n)return Object.keys(n)}successors(t){let n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){let n=this.predecessors(t);if(n){let s=new Set(n);for(let i of this.successors(t))s.add(i);return Array.from(s.values())}}isLeaf(t){let n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){let n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,a])=>{t(r)&&n.setNode(r,a)}),Object.values(this._edgeObjs).forEach(r=>{n.hasNode(r.v)&&n.hasNode(r.w)&&n.setEdge(r,this.edge(r))});let s={},i=r=>{let a=this.parent(r);return!a||n.hasNode(a)?(s[r]=a??void 0,a??void 0):a in s?s[a]:i(a)};return this._isCompound&&n.nodes().forEach(r=>n.setParent(r,i(r))),n}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){return t.reduce((s,i)=>(n!==void 0?this.setEdge(s,i,n):this.setEdge(s,i),i)),this}setEdge(t,n,s,i){let r,a,l,c,u=!1;typeof t=="object"&&t!==null&&"v"in t?(r=t.v,a=t.w,l=t.name,arguments.length===2&&(c=n,u=!0)):(r=t,a=n,l=i,arguments.length>2&&(c=s,u=!0)),r=""+r,a=""+a,l!==void 0&&(l=""+l);let d=_m(this._isDirected,r,a,l);if(d in this._edgeLabels)return u&&(this._edgeLabels[d]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(a),this._edgeLabels[d]=u?c:this._defaultEdgeLabelFn(r,a,l);let f=iue(this._isDirected,r,a,l);return r=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,rM(this._preds[a],r),rM(this._sucs[r],a),this._in[a][d]=f,this._out[r][d]=f,this._edgeCount++,this}edge(t,n,s){let i=arguments.length===1?cw(this._isDirected,t):_m(this._isDirected,t,n,s);return this._edgeLabels[i]}edgeAsObj(t,n,s){let i=arguments.length===1?this.edge(t):this.edge(t,n,s);return typeof i!="object"?{label:i}:i}hasEdge(t,n,s){return(arguments.length===1?cw(this._isDirected,t):_m(this._isDirected,t,n,s))in this._edgeLabels}removeEdge(t,n,s){let i=arguments.length===1?cw(this._isDirected,t):_m(this._isDirected,t,n,s),r=this._edgeObjs[i];if(r){let a=r.v,l=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],aM(this._preds[l],a),aM(this._sucs[a],l),delete this._in[l][i],delete this._out[a][i],this._edgeCount--}return this}inEdges(t,n){return this.isDirected()?this.filterEdges(this._in[t],t,n):this.nodeEdges(t,n)}outEdges(t,n){return this.isDirected()?this.filterEdges(this._out[t],t,n):this.nodeEdges(t,n)}nodeEdges(t,n){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,n)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,n,s){if(!t)return;let i=Object.values(t);return s?i.filter(r=>r.v===n&&r.w===s||r.v===s&&r.w===n):i}};function rM(e,t){e[t]?e[t]++:e[t]=1}function aM(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function _m(e,t,n,s){let i=""+t,r=""+n;if(!e&&i>r){let a=i;i=r,r=a}return i+""+r+""+(s===void 0?"\0":s)}function iue(e,t,n,s){let i=""+t,r=""+n;if(!e&&i>r){let l=i;i=r,r=l}let a={v:i,w:r};return s&&(a.name=s),a}function cw(e,t){return _m(e,t.v,t.w,t.name)}var rue="4.0.1",GU={};VU(GU,{read:()=>cue,write:()=>aue});function aue(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:oue(e),edges:lue(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function oue(e){return e.nodes().map(t=>{let n=e.node(t),s=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),s!==void 0&&(i.parent=s),i})}function lue(e){return e.edges().map(t=>{let n=e.edge(t),s={v:t.v,w:t.w};return t.name!==void 0&&(s.name=t.name),n!==void 0&&(s.value=n),s})}function cue(e){let t=new ua(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var D2={};VU(D2,{CycleException:()=>v1,bellmanFord:()=>KU,components:()=>fue,dijkstra:()=>E1,dijkstraAll:()=>pue,findCycles:()=>gue,floydWarshall:()=>yue,isAcyclic:()=>Eue,postorder:()=>wue,preorder:()=>_ue,prim:()=>Sue,shortestPaths:()=>Nue,tarjan:()=>YU,topsort:()=>WU});var uue=()=>1;function KU(e,t,n,s){return due(e,String(t),n||uue,s||function(i){return e.outEdges(i)})}function due(e,t,n,s){let i={},r,a=0,l=e.nodes(),c=function(f){let h=n(f);i[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,s=String(e);if(!(s in n)){let i=this._arr,r=i.length;return n[s]=r,i.push({key:s,priority:t}),this._decrease(r),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let s=this._arr[n].priority;if(t>s)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${s} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,s=n+1,i=e;n>1,!(t[s].priority1;function E1(e,t,n,s){let i=function(r){return e.outEdges(r)};return mue(e,String(t),n||hue,s||i)}function mue(e,t,n,s){let i={},r=new qU,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=i[d],h=n(u),m=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);m0&&(a=r.removeMin(),l=i[a],l.distance!==Number.POSITIVE_INFINITY);)s(a).forEach(c);return i}function pue(e,t,n){return e.nodes().reduce(function(s,i){return s[i]=E1(e,i,t,n),s},{})}function YU(e){let t=0,n=[],s={},i=[];function r(a){let l=s[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in s?s[c].onStack&&(l.lowlink=Math.min(l.lowlink,s[c].index)):(r(c),l.lowlink=Math.min(l.lowlink,s[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),s[u].onStack=!1,c.push(u);while(a!==u);i.push(c)}}return e.nodes().forEach(function(a){a in s||r(a)}),i}function gue(e){return YU(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var bue=()=>1;function yue(e,t,n){return xue(e,t||bue,n||function(s){return e.outEdges(s)})}function xue(e,t,n){let s={},i=e.nodes();return i.forEach(function(r){s[r]={},s[r][r]={distance:0,predecessor:""},i.forEach(function(a){r!==a&&(s[r][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(r).forEach(function(a){let l=a.v===r?a.w:a.v,c=t(a);s[r][l]={distance:c,predecessor:r}})}),i.forEach(function(r){let a=s[r];i.forEach(function(l){let c=s[l];i.forEach(function(u){let d=c[r],f=a[u],h=c[u],m=d.distance+f.distance;m{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);i=XU(e,l,n==="post",a,r,s,i)}),i}function XU(e,t,n,s,i,r,a){return t in s||(s[t]=!0,n||(a=r(a,t)),i(t).forEach(function(l){a=XU(e,l,n,s,i,r,a)}),n&&(a=r(a,t))),a}function QU(e,t,n){return vue(e,t,n,function(s,i){return s.push(i),s},[])}function wue(e,t){return QU(e,t,"post")}function _ue(e,t){return QU(e,t,"pre")}function Sue(e,t){let n=new ua,s={},i=new qU,r;function a(c){let u=c.v===r?c.w:c.v,d=i.priority(u);if(d!==void 0){let f=t(c);f0;){if(r=i.removeMin(),r in s)n.setEdge(r,s[r]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(r).forEach(a)}return n}function Nue(e,t,n,s){return Tue(e,t,n,s??(i=>{let r=e.outEdges(i);return r??[]}))}function Tue(e,t,n,s){if(n===void 0)return E1(e,t,n,s);let i=!1,r=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let s=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:s.weight+i.weight,minlen:Math.max(s.minlen,i.minlen)})}),t}function ZU(e){let t=new ua({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function oM(e,t){let n=e.x,s=e.y,i=t.x-n,r=t.y-s,a=e.width/2,l=e.height/2;if(!i&&!r)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(r)*a>Math.abs(i)*l?(r<0&&(l=-l),c=l*i/r,u=l):(i<0&&(a=-a),c=a,u=a*r/i),{x:n+c,y:s+u}}function jg(e){let t=Gp(e7(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let s=e.node(n),i=s.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][s.order]=n)}),t}function Aue(e){let t=e.nodes().map(s=>{let i=e.node(s).rank;return i===void 0?Number.MAX_VALUE:i}),n=to(Math.min,t);e.nodes().forEach(s=>{let i=e.node(s);Object.hasOwn(i,"rank")&&(i.rank-=n)})}function Cue(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=to(Math.min,t),s=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;s[l]||(s[l]=[]),s[l].push(a)});let i=0,r=e.graph().nodeRankFactor;Array.from(s).forEach((a,l)=>{a===void 0&&l%r!==0?--i:a!==void 0&&i&&a.forEach(c=>e.node(c).rank+=i)})}function lM(e,t,n,s){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=s),uh(e,"border",i,t)}function Iue(e,t=JU){let n=[];for(let s=0;sJU){let n=Iue(t);return e(...n.map(s=>e(...s)))}else return e(...t)}function e7(e){let t=e.nodes().map(n=>{let s=e.node(n).rank;return s===void 0?Number.MIN_VALUE:s});return to(Math.max,t)}function jue(e,t){let n={lhs:[],rhs:[]};return e.forEach(s=>{t(s)?n.lhs.push(s):n.rhs.push(s)}),n}function t7(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function n7(e,t){return t()}var Rue=0;function P2(e){let t=++Rue;return e+(""+t)}function Gp(e,t,n=1){t==null&&(t=e,e=0);let s=r=>rts[t]:n=t,Object.entries(e).reduce((s,[i,r])=>(s[i]=n(r,i),s),{})}function Oue(e,t){return e.reduce((n,s,i)=>(n[s]=t[i],n),{})}var $x="\0",Mue="3.0.0",Lue=class{constructor(){nue(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return cM(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&cM(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Due)),n=n._prev;return"["+e.join(", ")+"]"}};function cM(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Due(e,t){if(e!=="_next"&&e!=="_prev")return t}var Pue=Lue,Bue=()=>1;function Uue(e,t){if(e.nodeCount()<=1)return[];let n=$ue(e,t||Bue);return Fue(n.graph,n.buckets,n.zeroIdx).flatMap(s=>e.outEdges(s.v,s.w)||[])}function Fue(e,t,n){var s;let i=[],r=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)uw(e,t,n,l);for(;l=r.dequeue();)uw(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(s=t[c])==null?void 0:s.dequeue(),l){i=i.concat(uw(e,t,n,l,!0)||[]);break}}}return i}function uw(e,t,n,s,i){let r=[],a=i?r:void 0;return(e.inEdges(s.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);i&&r.push({v:l.v,w:l.w}),u.out-=c,sN(t,n,u)}),(e.outEdges(s.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,sN(t,n,d)}),e.removeNode(s.v),a}function $ue(e,t){let n=new ua,s=0,i=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);i=Math.max(i,f.out+=u),s=Math.max(s,h.in+=u)});let r=Hue(i+s+3).map(()=>new Pue),a=s+1;return n.nodes().forEach(l=>{sN(r,a,n.node(l))}),{graph:n,buckets:r,zeroIdx:a}}function sN(e,t,n){var s,i,r;n.out?n.in?(r=e[n.out-n.in+t])==null||r.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(s=e[0])==null||s.enqueue(n)}function Hue(e){let t=[];for(let n=0;n{let s=e.edge(n);e.removeEdge(n),s.forwardName=n.name,s.reversed=!0,e.setEdge(n.w,n.v,s,P2("rev"))});function t(n){return s=>n.edge(s).weight}}function Vue(e){let t=[],n={},s={};function i(r){Object.hasOwn(s,r)||(s[r]=!0,n[r]=!0,e.outEdges(r).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):i(a.w)}),delete n[r])}return e.nodes().forEach(i),t}function Gue(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let s=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,s)}})}function Kue(e){e.graph().dummyChains=[],e.edges().forEach(t=>que(e,t))}function que(e,t){let n=t.v,s=e.node(n).rank,i=t.w,r=e.node(i).rank,a=t.name,l=e.edge(t),c=l.labelRank;if(r===s+1)return;e.removeEdge(t);let u,d,f;for(f=0,++s;s{let n=e.node(t),s=n.edgeLabel,i;for(e.setEdge(n.edgeObj,s);n.dummy;)i=e.successors(t)[0],e.removeNode(t),s.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height),t=i,n=e.node(t)})}function B2(e){let t={};function n(s){let i=e.node(s);if(Object.hasOwn(t,s))return i.rank;t[s]=!0;let r=e.outEdges(s),a=r?r.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=to(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),i.rank=l}e.sources().forEach(n)}function Bf(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var s7=Wue;function Wue(e){let t=new ua({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let s=n[0],i=e.nodeCount();t.setNode(s,{});let r,a;for(;Xue(t,e){let a=r.v,l=s===a?r.w:a;!e.hasNode(l)&&!Bf(t,r)&&(e.setNode(l,{}),e.setEdge(s,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function Que(e,t){return t.edges().reduce((n,s)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(s.v)!==e.hasNode(s.w)&&(i=Bf(t,s)),it.node(s).rank+=n)}var{preorder:Jue,postorder:ede}=D2,tde=Iu;Iu.initLowLimValues=F2;Iu.initCutValues=U2;Iu.calcCutValue=i7;Iu.leaveEdge=a7;Iu.enterEdge=o7;Iu.exchangeEdges=l7;function Iu(e){e=kue(e),B2(e);let t=s7(e);F2(t),U2(t,e);let n,s;for(;n=a7(t);)s=o7(t,e,n),l7(t,e,n,s)}function U2(e,t){let n=ede(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(s=>nde(e,t,s))}function nde(e,t,n){let s=e.node(n).parent,i=e.edge(n,s);i.cutvalue=i7(e,t,n)}function i7(e,t,n){let s=e.node(n).parent,i=!0,r=t.edge(n,s),a=0;r||(i=!1,r=t.edge(s,n)),a=r.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==s){let f=u===i,h=t.edge(c).weight;if(a+=f?h:-h,ide(e,n,d)){let m=e.edge(n,d).cutvalue;a+=f?-m:m}}}),a}function F2(e,t){arguments.length<2&&(t=e.nodes()[0]),r7(e,{},1,t)}function r7(e,t,n,s,i){let r=n,a=e.node(s);t[s]=!0;let l=e.neighbors(s);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=r7(e,t,n,c,s))}),a.low=r,a.lim=n++,i?a.parent=i:delete a.parent,n}function a7(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function o7(e,t,n){let s=n.v,i=n.w;t.hasEdge(s,i)||(s=n.w,i=n.v);let r=e.node(s),a=e.node(i),l=r,c=!1;return r.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===uM(e,e.node(u.v),l)&&c!==uM(e,e.node(u.w),l)).reduce((u,d)=>Bf(t,d)!e.node(i).parent);if(!n)return;let s=Jue(e,[n]);s=s.slice(1),s.forEach(i=>{let r=e.node(i).parent,a=t.edge(i,r),l=!1;a||(a=t.edge(r,i),l=!0),t.node(i).rank=t.node(r).rank+(l?a.minlen:-a.minlen)})}function ide(e,t,n){return e.hasEdge(t,n)}function uM(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var rde=ade;function ade(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":dM(e);break;case"tight-tree":lde(e);break;case"longest-path":ode(e);break;case"none":break;default:dM(e)}}var ode=B2;function lde(e){B2(e),s7(e)}function dM(e){tde(e)}var cde=ude;function ude(e){let t=fde(e);e.graph().dummyChains.forEach(n=>{let s=e.node(n),i=s.edgeObj,r=dde(e,t,i.v,i.w),a=r.path,l=r.lca,c=0,u=a[c],d=!0;for(;n!==i.w;){if(s=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>t[c].lim));let u=c,d=s;for(;(d=e.parent(d))!==u;)r.push(d);return{path:i.concat(r.reverse()),lca:u}}function fde(e){let t={},n=0;function s(i){let r=n;e.children(i).forEach(s),t[i]={low:r,lim:n++}}return e.children($x).forEach(s),t}function hde(e){let t=uh(e,"root",{},"_root"),n=mde(e),s=Object.values(n),i=to(Math.max,s)-1,r=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=r);let a=pde(e)+1;e.children($x).forEach(l=>c7(e,t,r,a,i,n,l)),e.graph().nodeRankFactor=r}function c7(e,t,n,s,i,r,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=lM(e,"_bt"),d=lM(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var m;c7(e,t,n,s,i,r,h);let p=e.node(h),b=p.borderTop?p.borderTop:h,v=p.borderBottom?p.borderBottom:h,y=p.borderTop?s:2*s,x=b!==v?1:i-((m=r[a])!=null?m:0)+1;e.setEdge(u,b,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:i+((l=r[a])!=null?l:0)})}function mde(e){let t={};function n(s,i){let r=e.children(s);r&&r.length&&r.forEach(a=>n(a,i+1)),t[s]=i}return e.children($x).forEach(s=>n(s,1)),t}function pde(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function gde(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var bde=yde;function yde(e){function t(n){let s=e.children(n),i=e.node(n);if(s.length&&s.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let r=i.minRank,a=i.maxRank+1;rhM(e.node(t))),e.edges().forEach(t=>hM(e.edge(t)))}function hM(e){let t=e.width;e.width=e.height,e.height=t}function vde(e){e.nodes().forEach(t=>dw(e.node(t))),e.edges().forEach(t=>{var n;let s=e.edge(t);(n=s.points)==null||n.forEach(dw),Object.hasOwn(s,"y")&&dw(s)})}function dw(e){e.y=-e.y}function wde(e){e.nodes().forEach(t=>fw(e.node(t))),e.edges().forEach(t=>{var n;let s=e.edge(t);(n=s.points)==null||n.forEach(fw),Object.hasOwn(s,"x")&&fw(s)})}function fw(e){let t=e.x;e.x=e.y,e.y=t}function _de(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),s=n.map(l=>e.node(l).rank),i=to(Math.max,s),r=Gp(i+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);r[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),r}function Sde(e,t){let n=0;for(let s=1;sd)),i=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:s[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),r=1;for(;r{let d=u.pos+r;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function Tde(e,t=[]){return t.map(n=>{let s=e.inEdges(n);if(!s||!s.length)return{v:n};{let i=s.reduce((r,a)=>{let l=e.edge(a),c=e.node(a.v);return{sum:r.sum+l.weight*c.order,weight:r.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function kde(e,t){let n={};e.forEach((i,r)=>{let a={indegree:0,in:[],out:[],vs:[i.v],i:r};i.barycenter!==void 0&&(a.barycenter=i.barycenter,a.weight=i.weight),n[i.v]=a}),t.edges().forEach(i=>{let r=n[i.v],a=n[i.w];r!==void 0&&a!==void 0&&(a.indegree++,r.out.push(a))});let s=Object.values(n).filter(i=>!i.indegree);return Ade(s)}function Ade(e){let t=[];function n(i){return r=>{r.merged||(r.barycenter===void 0||i.barycenter===void 0||r.barycenter>=i.barycenter)&&Cde(i,r)}}function s(i){return r=>{r.in.push(i),--r.indegree===0&&e.push(r)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(s(i))}return t.filter(i=>!i.merged).map(i=>w1(i,["vs","i","barycenter","weight"]))}function Cde(e,t){let n=0,s=0;e.weight&&(n+=e.barycenter*e.weight,s+=e.weight),t.weight&&(n+=t.barycenter*t.weight,s+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/s,e.weight=s,e.i=Math.min(t.i,e.i),t.merged=!0}function Ide(e,t){let n=jue(e,d=>Object.hasOwn(d,"barycenter")),s=n.lhs,i=n.rhs.sort((d,f)=>f.i-d.i),r=[],a=0,l=0,c=0;s.sort(jde(!!t)),c=mM(r,i,c),s.forEach(d=>{c+=d.vs.length,r.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=mM(r,i,c)});let u={vs:r.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function mM(e,t,n){let s;for(;t.length&&(s=t[t.length-1]).i<=n;)t.pop(),e.push(s.vs),n++;return n}function jde(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function d7(e,t,n,s){let i=e.children(t),r=e.node(t),a=r?r.borderLeft:void 0,l=r?r.borderRight:void 0,c={};a&&(i=i.filter(h=>h!==a&&h!==l));let u=Tde(e,i);u.forEach(h=>{if(e.children(h.v).length){let m=d7(e,h.v,n,s);c[h.v]=m,Object.hasOwn(m,"barycenter")&&Ode(h,m)}});let d=kde(u,n);Rde(d,c);let f=Ide(d,s);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let m=e.node(h[0]),p=e.predecessors(l),b=e.node(p[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+m.order+b.order)/(f.weight+2),f.weight+=2}}return f}function Rde(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(s=>t[s]?t[s].vs:s)})}function Ode(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function Mde(e,t,n,s){s||(s=e.nodes());let i=Lde(e),r=new ua({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(a=>e.node(a));return s.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){r.setNode(a),r.setParent(a,c||i);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=r.edge(f,a),m=h!==void 0?h.weight:0;r.setEdge(f,a,{weight:e.edge(d).weight+m})}),Object.hasOwn(l,"minRank")&&r.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),r}function Lde(e){let t;for(;e.hasNode(t=P2("_root")););return t}function Dde(e,t,n){let s={},i;n.forEach(r=>{let a=e.parent(r),l,c;for(;a;){if(l=e.parent(a),l?(c=s[l],s[l]=a):(c=i,i=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function f7(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,f7);return}let n=e7(e),s=pM(e,Gp(1,n+1),"inEdges"),i=pM(e,Gp(n-1,-1,-1),"outEdges"),r=_de(e);if(gM(e,r),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Pde(u%2?s:i,u%4>=2,c),r=jg(e);let f=Sde(e,r);f{s.has(r)||s.set(r,[]),s.get(r).push(a)};for(let r of e.nodes()){let a=e.node(r);if(typeof a.rank=="number"&&i(a.rank,r),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&i(l,r)}return t.map(function(r){return Mde(e,r,n,s.get(r)||[])})}function Pde(e,t,n){let s=new ua;e.forEach(function(i){n.forEach(l=>s.setEdge(l.left,l.right));let r=i.graph().root,a=d7(i,r,s,t);a.vs.forEach((l,c)=>i.node(l).order=c),Dde(i,s,a.vs)})}function gM(e,t){Object.values(t).forEach(n=>n.forEach((s,i)=>e.node(s).order=i))}function Bde(e,t){let n={};function s(i,r){let a=0,l=0,c=i.length,u=r[r.length-1];return r.forEach((d,f)=>{let h=Fde(e,d),m=h?e.node(h).order:c;(h||d===u)&&(r.slice(l,f+1).forEach(p=>{let b=e.predecessors(p);b&&b.forEach(v=>{let y=e.node(v),x=y.order;(x{let f=r[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(m=>{if(m===void 0)return;let p=e.node(m);p.dummy&&(p.orderu)&&h7(n,m,f)})}})}function i(r,a){let l=-1,c=-1,u=0;return a.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let m=h[0];if(m===void 0)return;c=e.node(m).order,s(a,u,f,l,c),u=f,l=c}}s(a,u,a.length,c,r.length)}),a}return t.length&&t.reduce(i),n}function Fde(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(s=>e.node(s).dummy)}}function h7(e,t,n){if(t>n){let i=t;t=n,n=i}let s=e[t];s||(e[t]=s={}),s[n]=!0}function $de(e,t,n){if(t>n){let i=t;t=n,n=i}let s=e[t];return s!==void 0&&Object.hasOwn(s,n)}function Hde(e,t,n,s){let i={},r={},a={};return t.forEach(l=>{l.forEach((c,u)=>{i[c]=c,r[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=s(u);if(d&&d.length){let f=d.sort((m,p)=>{let b=a[m],v=a[p];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let m=Math.floor(h),p=Math.ceil(h);m<=p;++m){let b=f[m];if(b===void 0)continue;let v=a[b];if(v!==void 0&&r[u]===u&&c{var y;let x=(y=r[v.v])!=null?y:0,E=a.edge(v);return Math.max(b,x+(E!==void 0?E:0))},0):r[m]=0}function d(m){let p=a.outEdges(m),b=Number.POSITIVE_INFINITY;p&&(b=p.reduce((y,x)=>{let E=r[x.w],w=a.edge(x);return Math.min(y,(E!==void 0?E:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let v=e.node(m);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(r[m]=Math.max(r[m]!==void 0?r[m]:0,b))}function f(m){return a.predecessors(m)||[]}function h(m){return a.successors(m)||[]}return c(u,f),c(d,h),Object.keys(s).forEach(m=>{var p;let b=n[m];b!==void 0&&(r[m]=(p=r[b])!=null?p:0)}),r}function Vde(e,t,n,s){let i=new ua,r=e.graph(),a=Wde(r.nodesep,r.edgesep,s);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(i.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=i.edge(f,d);i.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),i}function Gde(e,t){return Object.values(t).reduce((n,s)=>{let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;Object.entries(s).forEach(([l,c])=>{let u=Xde(e,l)/2;i=Math.max(c+u,i),r=Math.min(c-u,r)});let a=i-r;return a{["l","r"].forEach(a=>{let l=r+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=s-to(Math.min,u);a!=="l"&&(d=i-to(Math.max,u)),d&&(e[l]=Fx(c,f=>f+d))})})}function qde(e,t=void 0){let n=e.ul;return n?Fx(n,(s,i)=>{var r,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[i]!==void 0)return u[i]}let l=Object.values(e).map(c=>{let u=c[i];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((r=l[1])!=null?r:0)+((a=l[2])!=null?a:0))/2}):{}}function Yde(e){let t=jg(e),n=Object.assign(Bde(e,t),Ude(e,t)),s={},i;["u","d"].forEach(a=>{i=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(i=i.map(d=>Object.values(d).reverse()));let c=Hde(e,i,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=zde(e,i,c.root,c.align,l==="r");l==="r"&&(u=Fx(u,d=>-d)),s[a+l]=u})});let r=Gde(e,s);return Kde(s,r),qde(s,e.graph().align)}function Wde(e,t,n){return(s,i,r)=>{let a=s.node(i),l=s.node(r),c=0,u;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(a.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function Xde(e,t){return e.node(t).width}function Qde(e){e=ZU(e),Zde(e),Object.entries(Yde(e)).forEach(([t,n])=>e.node(t).x=n)}function Zde(e){let t=jg(e),n=e.graph(),s=n.ranksep,i=n.rankalign,r=0;t.forEach(a=>{let l=a.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);a.forEach(c=>{let u=e.node(c);i==="top"?u.y=r+u.height/2:i==="bottom"?u.y=r+l-u.height/2:u.y=r+l/2}),r+=l+s})}function Jde(e,t={}){let n=t.debugTiming?t7:n7;return n("layout",()=>{let s=n(" buildLayoutGraph",()=>cfe(e));return n(" runLayout",()=>efe(s,n,t)),n(" updateInputGraph",()=>tfe(e,s)),s})}function efe(e,t,n){t(" makeSpaceForEdgeLabels",()=>ufe(e)),t(" removeSelfEdges",()=>xfe(e)),t(" acyclic",()=>zue(e)),t(" nestingGraph.run",()=>hde(e)),t(" rank",()=>rde(ZU(e))),t(" injectEdgeLabelProxies",()=>dfe(e)),t(" removeEmptyRanks",()=>Cue(e)),t(" nestingGraph.cleanup",()=>gde(e)),t(" normalizeRanks",()=>Aue(e)),t(" assignRankMinMax",()=>ffe(e)),t(" removeEdgeLabelProxies",()=>hfe(e)),t(" normalize.run",()=>Kue(e)),t(" parentDummyChains",()=>cde(e)),t(" addBorderSegments",()=>bde(e)),t(" order",()=>f7(e,n)),t(" insertSelfEdges",()=>Efe(e)),t(" adjustCoordinateSystem",()=>xde(e)),t(" position",()=>Qde(e)),t(" positionSelfEdges",()=>vfe(e)),t(" removeBorderNodes",()=>yfe(e)),t(" normalize.undo",()=>Yue(e)),t(" fixupEdgeLabelCoords",()=>gfe(e)),t(" undoCoordinateSystem",()=>Ede(e)),t(" translateGraph",()=>mfe(e)),t(" assignNodeIntersects",()=>pfe(e)),t(" reversePoints",()=>bfe(e)),t(" acyclic.undo",()=>Gue(e))}function tfe(e,t){e.nodes().forEach(n=>{let s=e.node(n),i=t.node(n);s&&(s.x=i.x,s.y=i.y,s.order=i.order,s.rank=i.rank,t.children(n).length&&(s.width=i.width,s.height=i.height))}),e.edges().forEach(n=>{let s=e.edge(n),i=t.edge(n);s.points=i.points,Object.hasOwn(i,"x")&&(s.x=i.x,s.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var nfe=["nodesep","edgesep","ranksep","marginx","marginy"],sfe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},ife=["acyclicer","ranker","rankdir","align","rankalign"],rfe=["width","height","rank"],bM={width:0,height:0},afe=["minlen","weight","width","height","labeloffset"],ofe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},lfe=["labelpos"];function cfe(e){let t=new ua({multigraph:!0,compound:!0}),n=mw(e.graph());return t.setGraph(Object.assign({},sfe,hw(n,nfe),w1(n,ife))),e.nodes().forEach(s=>{let i=mw(e.node(s)),r=hw(i,rfe);Object.keys(bM).forEach(l=>{r[l]===void 0&&(r[l]=bM[l])}),t.setNode(s,r);let a=e.parent(s);a!==void 0&&t.setParent(s,a)}),e.edges().forEach(s=>{let i=mw(e.edge(s));t.setEdge(s,Object.assign({},ofe,hw(i,afe),w1(i,lfe)))}),t}function ufe(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let s=e.edge(n);s.minlen*=2,s.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?s.width+=s.labeloffset:s.height+=s.labeloffset)})}function dfe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let s=e.node(t.v),i={rank:(e.node(t.w).rank-s.rank)/2+s.rank,e:t};uh(e,"edge-proxy",i,"_ep")}})}function ffe(e){let t=0;e.nodes().forEach(n=>{let s=e.node(n);s.borderTop&&(s.minRank=e.node(s.borderTop).rank,s.maxRank=e.node(s.borderBottom).rank,t=Math.max(t,s.maxRank))}),e.graph().maxRank=t}function hfe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let s=n;e.edge(s.e).labelRank=n.rank,e.removeNode(t)}})}function mfe(e){let t=Number.POSITIVE_INFINITY,n=0,s=Number.POSITIVE_INFINITY,i=0,r=e.graph(),a=r.marginx||0,l=r.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,m=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),s=Math.min(s,f-m/2),i=Math.max(i,f+m/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=a,s-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=s}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=s}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=s)}),r.width=n-t+a,r.height=i-s+l}function pfe(e){e.edges().forEach(t=>{let n=e.edge(t),s=e.node(t.v),i=e.node(t.w),r,a;n.points?(r=n.points[0],a=n.points[n.points.length-1]):(n.points=[],r=i,a=s),n.points.unshift(oM(s,r)),n.points.push(oM(i,a))})}function gfe(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function bfe(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function yfe(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),s=e.node(n.borderTop),i=e.node(n.borderBottom),r=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-r.x),n.height=Math.abs(i.y-s.y),n.x=r.x+n.width/2,n.y=s.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function xfe(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Efe(e){jg(e).forEach(t=>{let n=0;t.forEach((s,i)=>{let r=e.node(s);r.order=i+n,(r.selfEdges||[]).forEach(a=>{uh(e,"selfedge",{width:a.label.width,height:a.label.height,rank:r.rank,order:i+ ++n,e:a.e,label:a.label},"_se")}),delete r.selfEdges})})}function vfe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let s=n,i=e.node(s.e.v),r=i.x+i.width/2,a=i.y,l=n.x-r,c=i.height/2;e.setEdge(s.e,s.label),e.removeNode(t),s.label.points=[{x:r+2*l/3,y:a-c},{x:r+5*l/6,y:a-c},{x:r+l,y:a},{x:r+5*l/6,y:a+c},{x:r+2*l/3,y:a+c}],s.label.x=n.x,s.label.y=n.y}})}function hw(e,t){return Fx(w1(e,t),Number)}function mw(e){let t={};return e&&Object.entries(e).forEach(([n,s])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=s}),t}function wfe(e){let t=jg(e),n=new ua({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(s=>{n.setNode(s,{label:s}),n.setParent(s,"layer"+e.node(s).rank)}),e.edges().forEach(s=>n.setEdge(s.v,s.w,{},s.name)),t.forEach((s,i)=>{let r="layer"+i;n.setNode(r,{rank:"same"}),s.reduce((a,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var _fe={graphlib:zU,version:Mue,layout:Jde,debug:wfe,util:{time:t7,notime:n7}},yM=_fe;/*! For license information please see dagre.esm.js.LEGAL.txt */const Sm={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:fu},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:$B},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:MB},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:Xk},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:yx}},iN=220,rN=88,xM=96,EM=34,ep=64,pw=310,Hd=24,m7=56,aN=40,vM=40,Sfe=18,Nfe=58,Tfe=!1,kfe=e=>e==="sequential"||e==="parallel"||e==="loop";function oN(e,t){const n=e.agentType??"llm";return kfe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function lN(e,t=[],n="horizontal",s=!1){const i=e.agentType??"llm";if(!oN(e,t))return{width:iN,height:rN};if(s&&e.subAgents.length===0)return{width:pw,height:ep};const r=e.subAgents.map((f,h)=>lN(f,[...t,h],n,s)),a=r.length?Math.max(...r.map(f=>f.width)):0,l=r.length?Math.max(...r.map(f=>f.height)):0,c=r.length&&i!=="parallel"?m7:Hd,u=n==="horizontal"?i!=="parallel":i==="parallel",d=r.length?i==="parallel"?Sfe+vM:i==="loop"?Nfe:0:vM;return u?{width:Math.max(pw,r.reduce((f,h)=>f+h.width,0)+aN*Math.max(0,r.length-1)+c*2),height:ep+Hd+l+d+Hd}:{width:Math.max(pw,a+Hd*2),height:ep+c+r.reduce((f,h)=>f+h.height,0)+aN*Math.max(0,r.length-1)+d+c}}function Zh(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function Afe(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}function wM(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Jh(e,t,n,s){const i=(s==null?void 0:s.tone)==="sequential"?"hsl(213 40% 40%)":(s==null?void 0:s.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${s!=null&&s.loop?"-loop":""}`,source:e,target:t,sourceHandle:s!=null&&s.loop?"loop-source":void 0,targetHandle:s!=null&&s.loop?"loop-target":void 0,label:n,type:"insertStep",data:s?{insert:s.insert,loop:s.loop,tone:s.tone}:void 0,animated:s==null?void 0:s.loop,markerEnd:{type:Rf.ArrowClosed,width:16,height:16,color:i},style:{stroke:i,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function _M(e,t,n=!1){const s=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"用户请求"},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"最终回复"},selectable:!1,draggable:!1}],i=[];function r(d,f,h,m,p){const b=d.agentType??"llm",v=Zh(f);return oN(d,f)?(a(d,f,h,m,p),v):(s.push({id:v,type:"agent",parentId:h,extent:"parent",position:m,data:{kind:"agent",path:f,agent:d,title:b==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:b,description:d.description.trim()||Sm[b].description,childCount:d.subAgents.length,containedIn:p}}),v)}function a(d,f,h,m={x:0,y:0},p){const b=d.agentType??"sequential",v=Zh(f),y=lN(d,f,t,n);s.push({id:v,type:"group",parentId:h,extent:h?"parent":void 0,position:m,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":Sm[b].label),pattern:b,description:d.description.trim()||Sm[b].description,childCount:d.subAgents.length,containedIn:p,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const x=d.subAgents.map((k,T)=>lN(k,[...f,T],t,n)),E=x.length&&b!=="parallel"?m7:Hd,w=t==="horizontal"?b!=="parallel":b==="parallel";let S=E;const _=d.subAgents.map((k,T)=>{const A=x[T],j=w?{x:S,y:ep+Hd}:{x:(y.width-A.width)/2,y:ep+S};return S+=(w?A.width:A.height)+aN,r(k,[...f,T],v,j,b)});if(b==="sequential"||b==="loop"){for(let k=0;k<_.length-1;k+=1)i.push(Jh(_[k],_[k+1],"然后",{tone:b,insert:{parentPath:f,index:k+1}}));b==="loop"&&_.length>1&&i.push(Jh(_[_.length-1],_[0],"继续循环",{loop:!0,tone:"loop"}))}return v}const l=(d,f)=>{const h=d.agentType??"llm",m=Zh(f);if(oN(d,f))return a(d,f),[m];if(s.push({id:m,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||Sm[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[m];const p=[];return d.subAgents.forEach((b,v)=>{const y=[...f,v],x=Zh(y);i.push(Jh(m,x,"调用",{insert:{parentPath:f,index:v}})),p.push(...l(b,y))}),p},c=Zh([]),u=l(e,[]);return i.push(Jh("terminal-input",c)),u.forEach(d=>i.push(Jh(d,"terminal-output"))),Cfe(s,i,t)}function Cfe(e,t,n){const s=new yM.graphlib.Graph().setDefaultEdgeLabel(()=>({}));s.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const i=new Set(e.filter(r=>!r.parentId).map(r=>r.id));return e.filter(r=>!r.parentId).forEach(r=>{const a=r.data.kind==="terminal";s.setNode(r.id,{width:a?xM:r.data.layoutWidth??iN,height:a?EM:r.data.layoutHeight??rN})}),t.filter(r=>i.has(r.source)&&i.has(r.target)).forEach(r=>s.setEdge(r.source,r.target)),yM.layout(s),{nodes:e.map(r=>{if(r.parentId)return r;const a=s.node(r.id),l=r.data.kind==="terminal",c=l?xM:r.data.layoutWidth??iN,u=l?EM:r.data.layoutHeight??rN;return{...r,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const Hx=g.createContext(null),zx=g.createContext("horizontal");function Ife({id:e,sourceX:t,sourceY:n,targetX:s,targetY:i,sourcePosition:r,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=g.useContext(Hx),[h,m]=g.useState(!1),[p,b,v]=y1({sourceX:t,sourceY:n,targetX:s,targetY:i,sourcePosition:r,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(Ig,{id:e,path:p,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:p,className:"abc-edge-hover-path",onPointerEnter:()=>m(!0),onPointerLeave:()=>m(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx(Nce,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${b}px, ${v}px)`},onPointerEnter:()=>m(!0),onPointerLeave:()=>m(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(Ii,{})})]})})]})}function jfe({data:e,selected:t}){const n=g.useContext(Hx),s=g.useContext(zx),i=s==="vertical"?Ze.Top:Ze.Left,r=s==="vertical"?Ze.Bottom:Ze.Right,a=s==="vertical"?Ze.Right:Ze.Bottom,l=e.pattern??"llm",c=Sm[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(Fi,{type:"target",position:i,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:d=>{d.stopPropagation(),n==null||n.onDelete(e.path)},children:o.jsx(lc,{})}),o.jsx(Fi,{type:"source",position:r,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Fi,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Fi,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Rfe({data:e,selected:t}){const n=g.useContext(Hx),s=g.useContext(zx),i=s==="vertical"?Ze.Top:Ze.Left,r=s==="vertical"?Ze.Bottom:Ze.Right,a=s==="vertical"?Ze.Right:Ze.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(Fi,{type:"target",position:i,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(Ii,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(Ii,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(Ii,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(Ii,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:d=>{d.stopPropagation(),n==null||n.onDelete(e.path)},children:o.jsx(lc,{})}),o.jsx(Fi,{type:"source",position:r,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Fi,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Fi,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Ofe({data:e}){const t=g.useContext(zx);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(Fi,{type:"target",position:t==="vertical"?Ze.Top:Ze.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(Fi,{type:"source",position:t==="vertical"?Ze.Bottom:Ze.Right,className:"abc-handle"})]})}const Mfe={agent:jfe,group:Rfe,terminal:Ofe},Lfe={insertStep:Ife};function Dfe({draft:e,selectedPath:t,onSelect:n,onAdd:s,onInsert:i,onDelete:r,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=g.useMemo(()=>_M(e,c,a),[]),[d,f,h]=LU(u.nodes),[m,p,b]=DU(u.edges),v=kce(),y=g.useRef(`${c}:${a?"readonly":"editable"}:${wM(e)}`),x=g.useRef(null),{fitView:E}=Bx(),w=g.useMemo(()=>_M(e,c,a),[c,e,a]),[S,_]=g.useState(()=>window.matchMedia("(max-width: 860px)").matches),k=g.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,a]),T=g.useCallback((j=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const R=x.current;if(R&&(R.clientWidth===0||R.clientHeight===0)&&j<8){T(j+1);return}E(k)})})},[k,E]);g.useEffect(()=>{const j=window.matchMedia("(max-width: 860px)"),R=B=>_(B.matches);return j.addEventListener("change",R),()=>j.removeEventListener("change",R)},[]),g.useEffect(()=>{const j=`${c}:${a?"readonly":"editable"}:${wM(e)}`,R=j!==y.current;y.current=j,p(w.edges),f(B=>{const z=new Map(B.map(L=>[L.id,L]));return w.nodes.map(L=>{const F=z.get(L.id);return{...L,measured:!R&&F&&F.type===L.type?F.measured:void 0,position:!R&&F?F.position:L.position,selected:L.data.kind==="agent"&&!!L.data.path&&Afe(L.data.path,t)}})}),R&&T()},[w,e,T,t,p,f]),g.useEffect(()=>{T()},[S,T]),g.useEffect(()=>{v&&T()},[w,T,v]),g.useEffect(()=>{if(!a||!x.current)return;const j=new ResizeObserver(()=>T());return j.observe(x.current),T(),()=>j.disconnect()},[T,a]);const A=g.useMemo(()=>a?null:{onAdd:s,onInsert:i,onDelete:r},[s,r,i,a]);return o.jsx(zx.Provider,{value:c,children:o.jsx(Hx.Provider,{value:A,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:x,className:"abc-canvas",children:o.jsxs(MU,{nodes:d,edges:m,nodeTypes:Mfe,edgeTypes:Lfe,onNodesChange:h,onEdgesChange:b,onNodeClick:(j,R)=>{!a&&R.data.kind==="agent"&&R.data.path&&n(R.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:k,onInit:()=>T(),minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(BU,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx(FU,{showInteractive:!1}),Tfe]})})})})})}function Kp(e){return o.jsx(L2,{children:o.jsx(Dfe,{...e})})}const Pfe="https://ark.cn-beijing.volces.com/api/v3/",sy=[{key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615",comment:"向量化模型(记忆/知识库需要)"},{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:Pfe}],qp=[],SM={label:"控制台",url:"https://console.volcengine.com/vikingdb/openviking"},Bfe={label:"文档",url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},Ufe="https://api.vikingdb.cn-beijing.volces.com/openviking",Ffe=`{ +`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return g.useEffect(()=>{const c=(t==null?void 0:t.target)??HO,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var v,y;if(i.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!i.current||i.current&&!u)&&L9(p))return!1;const b=VO(p.code,l);if(r.current.add(p[b]),zO(a,r.current,!1)){const x=((y=(v=p.composedPath)==null?void 0:v.call(p))==null?void 0:y[0])||p.target,E=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(i.current||!E)&&p.preventDefault(),s(!0)}},f=p=>{const m=VO(p.code,l);zO(a,r.current,!0)?(s(!1),r.current.clear()):r.current.delete(p[m]),p.key==="Meta"&&r.current.clear(),i.current=!1},h=()=>{r.current.clear(),s(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,s]),n}function zO(e,t,n){return e.filter(s=>n||s.length===t.size).some(s=>s.every(i=>t.has(i)))}function VO(e,t){return t.includes(e)?"code":"key"}const tle=()=>{const e=gs();return g.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[s,i,r],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??s,y:t.y??i,zoom:t.zoom??r},n),!0):!1},getViewport:()=>{const[t,n,s]=e.getState().transform;return{x:t,y:n,zoom:s}},setCenter:async(t,n,s)=>e.getState().setCenter(t,n,s),fitBounds:async(t,n)=>{const{width:s,height:i,minZoom:r,maxZoom:a,panZoom:l}=e.getState(),c=T2(t,s,i,r,a,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:s,snapGrid:i,snapToGrid:r,domNode:a}=e.getState();if(!a)return t;const{x:l,y:c}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-c},d=n.snapGrid??i,f=n.snapToGrid??r;return oh(u,s,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:s}=e.getState();if(!s)return t;const{x:i,y:r}=s.getBoundingClientRect(),a=Of(t,n);return{x:a.x+i,y:a.y+r}}}),[])};function oU(e,t){const n=[],s=new Map,i=[];for(const r of e)if(r.type==="add"){i.push(r);continue}else if(r.type==="remove"||r.type==="replace")s.set(r.id,[r]);else{const a=s.get(r.id);a?a.push(r):s.set(r.id,[r])}for(const r of t){const a=s.get(r.id);if(!a){n.push(r);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const l={...r};for(const c of a)nle(c,l);n.push(l)}return i.length&&i.forEach(r=>{r.index!==void 0?n.splice(r.index,0,{...r.item}):n.push({...r.item})}),n}function nle(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function lU(e,t){return oU(e,t)}function cU(e,t){return oU(e,t)}function Uc(e,t){return{id:e,type:"select",selected:t}}function Ud(e,t=new Set,n=!1){const s=[];for(const[i,r]of e){const a=t.has(i);!(r.selected===void 0&&!a)&&r.selected!==a&&(n&&(r.selected=a),s.push(Uc(r.id,a)))}return s}function GO({items:e=[],lookup:t}){var i;const n=[],s=new Map(e.map(r=>[r.id,r]));for(const[r,a]of e.entries()){const l=t.get(a.id),c=((i=l==null?void 0:l.internals)==null?void 0:i.userNode)??l;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:r})}for(const[r]of t)s.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function KO(e){return{id:e.id,type:"remove"}}const sle=R9();function uU(e,t,n={}){return Cae(e,t,{...n,onError:n.onError??sle})}const qO=e=>pae(e),ile=e=>A9(e);function dU(e){return g.forwardRef(e)}const rle=typeof window<"u"?g.useLayoutEffect:g.useEffect;function YO(e){const[t,n]=g.useState(BigInt(0)),[s]=g.useState(()=>ale(()=>n(i=>i+BigInt(1))));return rle(()=>{const i=s.get();i.length&&(e(i),s.reset())},[t]),s}function ale(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const fU=g.createContext(null);function ole({children:e}){const t=gs(),n=g.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let b=c;for(const y of l)b=typeof y=="function"?y(b):y;let v=GO({items:b,lookup:h});for(const y of m.values())v=y(v);d&&u(b),v.length>0?f==null||f(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:x,setNodes:E}=t.getState();y&&E(x)})},[]),s=YO(n),i=g.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=c;for(const m of l)p=typeof m=="function"?m(p):m;d?u(p):f&&f(GO({items:p,lookup:h}))},[]),r=YO(i),a=g.useMemo(()=>({nodeQueue:s,edgeQueue:r}),[]);return o.jsx(fU.Provider,{value:a,children:e})}function lle(){const e=g.useContext(fU);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const cle=e=>!!e.panZoom;function Ux(){const e=tle(),t=gs(),n=lle(),s=Xt(cle),i=g.useMemo(()=>{const r=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var y,x;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=qO(f)?f:h.get(f.id),b=m.parentId?O9(m.position,m.measured,m.parentId,h,p):m.position,v={...m,position:b,width:((y=m.measured)==null?void 0:y.width)??m.width,height:((x=m.measured)==null?void 0:x.height)??m.height};return Rf(v)},u=(f,h,p={replace:!1})=>{a(m=>m.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return p.replace&&qO(v)?v:{...b,...v}}return b}))},d=(f,h,p={replace:!1})=>{l(m=>m.map(b=>{if(b.id===f){const v=typeof h=="function"?h(b):h;return p.replace&&ile(v)?v:{...b,...v}}return b}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=r(f))==null?void 0:h.internals.userNode},getInternalNode:r,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:p}=t.getState(),[m,b,v]=p;return{nodes:f.map(y=>({...y})),edges:h.map(y=>({...y})),viewport:{x:m,y:b,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:b,onEdgesDelete:v,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:E,onBeforeDelete:w}=t.getState(),{nodes:S,edges:_}=await xae({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:w}),T=_.length>0,k=S.length>0;if(T){const A=_.map(KO);v==null||v(_),x(A)}if(k){const A=S.map(KO);b==null||b(S),y(A)}return(k||T)&&(E==null||E({nodes:S,edges:_})),{deletedNodes:S,deletedEdges:_}},getIntersectingNodes:(f,h=!0,p)=>{const m=_O(f),b=m?f:c(f),v=p!==void 0;return b?(p||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!m&&(y.id===f.id||!x.internals.positionAbsolute))return!1;const E=Rf(v?y:x),w=Um(E,b);return h&&w>0||w>=E.width*E.height||w>=b.width*b.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const b=_O(f)?f:c(f);if(!b)return!1;const v=Um(b,h);return p&&v>0||v>=h.width*h.height||v>=b.width*b.height},updateNode:u,updateNodeData:(f,h,p={replace:!1})=>{u(f,m=>{const b=typeof h=="function"?h(m):h;return p.replace?{...m,data:b}:{...m,data:{...m.data,...b}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const b=typeof h=="function"?h(m):h;return p.replace?{...m,data:b}:{...m,data:{...m.data,...b}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return mae(f,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:f,id:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${f}${h?`-${h}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:m.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??wae();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return g.useMemo(()=>({...i,...e,viewportInitialized:s}),[s])}const WO=e=>e.selected,ule=typeof window<"u"?window:void 0;function dle({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=gs(),{deleteElements:s}=Ux(),i=$m(e,{actInsideInputWithModifier:!1}),r=$m(t,{target:ule});g.useEffect(()=>{if(i){const{edges:a,nodes:l}=n.getState();s({nodes:l.filter(WO),edges:a.filter(WO)}),n.setState({nodesSelectionActive:!1})}},[i]),g.useEffect(()=>{n.setState({multiSelectionActive:r})},[r])}function fle(e){const t=gs();g.useEffect(()=>{const n=()=>{var i,r,a,l;if(!e.current||!(((r=(i=e.current).checkVisibility)==null?void 0:r.call(i))??!0))return!1;const s=A2(e.current);(s.height===0||s.width===0)&&((l=(a=t.getState()).onError)==null||l.call(a,"004",Fa.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){n(),window.addEventListener("resize",n);const s=new ResizeObserver(()=>n());return s.observe(e.current),()=>{window.removeEventListener("resize",n),s&&e.current&&s.unobserve(e.current)}}},[])}const Fx={position:"absolute",width:"100%",height:"100%",top:0,left:0},hle=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ple({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:s=!1,panOnScrollSpeed:i=.5,panOnScrollMode:r=ru.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:b,noPanClassName:v,onViewportChange:y,isControlledViewport:x,paneClickDistance:E,selectionOnDrag:w}){const S=gs(),_=g.useRef(null),{userSelectionActive:T,lib:k,connectionInProgress:A}=Xt(hle,ms),j=$m(h),R=g.useRef();fle(_);const B=g.useCallback(z=>{y==null||y({x:z[0],y:z[1],zoom:z[2]}),x||S.setState({transform:z})},[y,x]);return g.useEffect(()=>{if(_.current){R.current=roe({domNode:_.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:C=>S.setState(I=>I.paneDragging===C?I:{paneDragging:C}),onPanZoomStart:(C,I)=>{const{onViewportChangeStart:D,onMoveStart:$}=S.getState();$==null||$(C,I),D==null||D(I)},onPanZoom:(C,I)=>{const{onViewportChange:D,onMove:$}=S.getState();$==null||$(C,I),D==null||D(I)},onPanZoomEnd:(C,I)=>{const{onViewportChangeEnd:D,onMoveEnd:$}=S.getState();$==null||$(C,I),D==null||D(I)}});const{x:z,y:L,zoom:F}=R.current.getViewport();return S.setState({panZoom:R.current,transform:[z,L,F],domNode:_.current.closest(".react-flow")}),()=>{var C;(C=R.current)==null||C.destroy()}}},[]),g.useEffect(()=>{var z;(z=R.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:s,panOnScrollSpeed:i,panOnScrollMode:r,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:j,preventScrolling:p,noPanClassName:v,userSelectionActive:T,noWheelClassName:b,lib:k,onTransformChange:B,connectionInProgress:A,selectionOnDrag:w,paneClickDistance:E})},[e,t,n,s,i,r,a,l,j,p,v,T,b,k,B,A,w,E]),o.jsx("div",{className:"react-flow__renderer",ref:_,style:Fx,children:m})}const mle=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function gle(){const{userSelectionActive:e,userSelectionRect:t}=Xt(mle,ms);return e&&t?o.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const ow=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},ble=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function yle({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Bm.Full,panOnDrag:s,autoPanOnSelection:i,paneClickDistance:r,selectionOnDrag:a,onSelectionStart:l,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:b}){const v=g.useRef(0),y=gs(),{userSelectionActive:x,elementsSelectable:E,dragging:w,connectionInProgress:S,panBy:_,autoPanSpeed:T}=Xt(ble,ms),k=E&&(e||x),A=g.useRef(null),j=g.useRef(),R=g.useRef(new Set),B=g.useRef(new Set),z=g.useRef(!1),L=g.useRef({x:0,y:0}),F=g.useRef(!1),C=K=>{if(z.current||S){z.current=!1;return}u==null||u(K),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},I=K=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){K.preventDefault();return}d==null||d(K)},D=f?K=>f(K):void 0,$=K=>{z.current&&(K.stopPropagation(),z.current=!1)},O=K=>{var me,_e;const{domNode:ce,transform:he}=y.getState();if(j.current=ce==null?void 0:ce.getBoundingClientRect(),!j.current)return;const be=K.target===A.current;if(!be&&!!K.target.closest(".nokey")||!e||!(a&&be||t)||K.button!==0||!K.isPrimary)return;(_e=(me=K.target)==null?void 0:me.setPointerCapture)==null||_e.call(me,K.pointerId),z.current=!1;const{x:Le,y:Ne}=La(K.nativeEvent,j.current),ae=oh({x:Le,y:Ne},he);y.setState({userSelectionRect:{width:0,height:0,startX:ae.x,startY:ae.y,x:Le,y:Ne}}),be||(K.stopPropagation(),K.preventDefault())};function te(K,ce){const{userSelectionRect:he}=y.getState();if(!he)return;const{transform:be,nodeLookup:ue,edgeLookup:we,connectionLookup:Le,triggerNodeChanges:Ne,triggerEdgeChanges:ae,defaultEdgeOptions:me}=y.getState(),_e={x:he.startX,y:he.startY},{x:Je,y:Pe}=Of(_e,be),Fe={startX:_e.x,startY:_e.y,x:KUe.id)),B.current=new Set;const Ve=(me==null?void 0:me.selectable)??!0;for(const Ue of R.current){const W=Le.get(Ue);if(W)for(const{edgeId:oe}of W.values()){const Z=we.get(oe);Z&&(Z.selectable??Ve)&&B.current.add(oe)}}if(!SO(Ye,R.current)){const Ue=Ud(ue,R.current,!0);Ne(Ue)}if(!SO(Ce,B.current)){const Ue=Ud(we,B.current);ae(Ue)}y.setState({userSelectionRect:Fe,userSelectionActive:!0,nodesSelectionActive:!1})}function se(){if(!i||!j.current)return;const[K,ce]=N2(L.current,j.current,T);_({x:K,y:ce}).then(he=>{if(!z.current||!he){v.current=requestAnimationFrame(se);return}const{x:be,y:ue}=L.current;te(be,ue),v.current=requestAnimationFrame(se)})}const P=()=>{cancelAnimationFrame(v.current),v.current=0,F.current=!1};g.useEffect(()=>()=>P(),[]);const Q=K=>{const{userSelectionRect:ce,transform:he,resetSelectedElements:be}=y.getState();if(!j.current||!ce)return;const{x:ue,y:we}=La(K.nativeEvent,j.current);L.current={x:ue,y:we};const Le=Of({x:ce.startX,y:ce.startY},he);if(!z.current){const Ne=t?0:r;if(Math.hypot(ue-Le.x,we-Le.y)<=Ne)return;be(),l==null||l(K)}z.current=!0,F.current||(se(),F.current=!0),te(ue,we)},ee=K=>{var ce,he;K.button===0&&((he=(ce=K.target)==null?void 0:ce.releasePointerCapture)==null||he.call(ce,K.pointerId),!x&&K.target===A.current&&y.getState().userSelectionRect&&(C==null||C(K)),y.setState({userSelectionActive:!1,userSelectionRect:null}),z.current&&(c==null||c(K),y.setState({nodesSelectionActive:R.current.size>0})),P())},V=K=>{var ce,he;(he=(ce=K.target)==null?void 0:ce.releasePointerCapture)==null||he.call(ce,K.pointerId),P()},X=s===!0||Array.isArray(s)&&s.includes(0);return o.jsxs("div",{className:ii(["react-flow__pane",{draggable:X,dragging:w,selection:e}]),onClick:k?void 0:ow(C,A),onContextMenu:ow(I,A),onWheel:ow(D,A),onPointerEnter:k?void 0:h,onPointerMove:k?Q:p,onPointerUp:k?ee:void 0,onPointerCancel:k?V:void 0,onPointerDownCapture:k?O:void 0,onClickCapture:k?$:void 0,onPointerLeave:m,ref:A,style:Fx,children:[b,o.jsx(gle,{})]})}function nN({id:e,store:t,unselect:n=!1,nodeRef:s}){const{addSelectedNodes:i,unselectNodesAndEdges:r,multiSelectionActive:a,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",Fa.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(r({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=s==null?void 0:s.current)==null?void 0:d.blur()})):i([e])}function hU({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:s,nodeId:i,isSelectable:r,nodeClickDistance:a}){const l=gs(),[c,u]=g.useState(!1),d=g.useRef();return g.useEffect(()=>{d.current=Gae({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{nN({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),g.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:s,domNode:e.current,isSelectable:r,nodeId:i,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,s,t,r,e,i,a]),c}const xle=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function pU(){const e=gs();return g.useCallback(n=>{const{nodeExtent:s,snapToGrid:i,snapGrid:r,nodesDraggable:a,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=xle(a),p=i?r[0]:5,m=i?r[1]:5,b=n.direction.x*p*n.factor,v=n.direction.y*m*n.factor;for(const[,y]of u){if(!h(y))continue;let x={x:y.internals.positionAbsolute.x+b,y:y.internals.positionAbsolute.y+v};i&&(x=Tg(x,r));const{position:E,positionAbsolute:w}=C9({nodeId:y.id,nextPosition:x,nodeLookup:u,nodeExtent:s,nodeOrigin:d,onError:l});y.position=E,y.internals.positionAbsolute=w,f.set(y.id,y)}c(f)},[])}const M2=g.createContext(null),Ele=M2.Provider;M2.Consumer;const mU=()=>g.useContext(M2),vle=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),wle=(e,t,n)=>s=>{const{connectionClickStartHandle:i,connectionMode:r,connection:a}=s,{fromHandle:l,toHandle:c,isValid:u}=a,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:r===Cf.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!i,valid:d&&u}};function _le({type:e="source",position:t=Qe.Top,isValidConnection:n,isConnectable:s=!0,isConnectableStart:i=!0,isConnectableEnd:r=!0,id:a,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},p){var F,C;const m=a||null,b=e==="target",v=gs(),y=mU(),{connectOnClick:x,noPanClassName:E,rfId:w}=Xt(vle,ms),{connectingFrom:S,connectingTo:_,clickConnecting:T,isPossibleEndHandle:k,connectionInProcess:A,clickConnectionInProcess:j,valid:R}=Xt(wle(y,m,e),ms);y||(C=(F=v.getState()).onError)==null||C.call(F,"010",Fa.error010());const B=I=>{const{defaultEdgeOptions:D,onConnect:$,hasDefaultEdges:O}=v.getState(),te={...D,...I};if(O){const{edges:se,setEdges:P,onError:Q}=v.getState();P(uU(te,se,{onError:Q}))}$==null||$(te),l==null||l(te)},z=I=>{if(!y)return;const D=D9(I.nativeEvent);if(i&&(D&&I.button===0||!D)){const $=v.getState();tN.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:b,handleId:m,nodeId:y,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...O)=>{var te,se;return(se=(te=v.getState()).onConnectEnd)==null?void 0:se.call(te,...O)},updateConnection:$.updateConnection,onConnect:B,isValidConnection:n||((...O)=>{var te,se;return((se=(te=v.getState()).isValidConnection)==null?void 0:se.call(te,...O))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}D?d==null||d(I):f==null||f(I)},L=I=>{const{onClickConnectStart:D,onClickConnectEnd:$,connectionClickStartHandle:O,connectionMode:te,isValidConnection:se,lib:P,rfId:Q,nodeLookup:ee,connection:V}=v.getState();if(!y||!O&&!i)return;if(!O){D==null||D(I.nativeEvent,{nodeId:y,handleId:m,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:y,type:e,id:m}});return}const X=M9(I.target),K=n||se,{connection:ce,isValid:he}=tN.isValid(I.nativeEvent,{handle:{nodeId:y,id:m,type:e},connectionMode:te,fromNodeId:O.nodeId,fromHandleId:O.id||null,fromType:O.type,isValidConnection:K,flowId:Q,doc:X,lib:P,nodeLookup:ee});he&&ce&&B(ce);const be=structuredClone(V);delete be.inProgress,be.toPosition=be.toHandle?be.toHandle.position:null,$==null||$(I,be),v.setState({connectionClickStartHandle:null})};return o.jsx("div",{"data-handleid":m,"data-nodeid":y,"data-handlepos":t,"data-id":`${w}-${y}-${m}-${e}`,className:ii(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",E,u,{source:!b,target:b,connectable:s,connectablestart:i,connectableend:r,clickconnecting:T,connectingfrom:S,connectingto:_,valid:R,connectionindicator:s&&(!A||k)&&(A||j?r:i)}]),onMouseDown:z,onTouchStart:z,onClick:x?L:void 0,ref:p,...h,children:c})}const Bi=g.memo(dU(_le));function Sle({data:e,isConnectable:t,sourcePosition:n=Qe.Bottom}){return o.jsxs(o.Fragment,{children:[e==null?void 0:e.label,o.jsx(Bi,{type:"source",position:n,isConnectable:t})]})}function Nle({data:e,isConnectable:t,targetPosition:n=Qe.Top,sourcePosition:s=Qe.Bottom}){return o.jsxs(o.Fragment,{children:[o.jsx(Bi,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,o.jsx(Bi,{type:"source",position:s,isConnectable:t})]})}function Tle(){return null}function kle({data:e,isConnectable:t,targetPosition:n=Qe.Top}){return o.jsxs(o.Fragment,{children:[o.jsx(Bi,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const E1={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},XO={input:Sle,default:Nle,output:kle,group:Tle};function Ale(e){var t,n,s,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Cle=e=>{const{width:t,height:n,x:s,y:i}=Ng(e.nodeLookup,{filter:r=>!!r.selected});return{width:Ma(t)?t:null,height:Ma(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${i}px)`}};function Ile({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const s=gs(),{width:i,height:r,transformString:a,userSelectionActive:l}=Xt(Cle,ms),c=pU(),u=g.useRef(null);g.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const d=!l&&i!==null&&r!==null;if(hU({nodeRef:u,disabled:!d}),!d)return null;const f=e?p=>{const m=s.getState().nodes.filter(b=>b.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(E1,p.key)&&(p.preventDefault(),c({direction:E1[p.key],factor:p.shiftKey?4:1}))};return o.jsx("div",{className:ii(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:o.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:r}})})}const QO=typeof window<"u"?window:void 0,jle=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function gU({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:r,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:b,zoomActivationKeyCode:v,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:w,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:T,panOnDrag:k,autoPanOnSelection:A,defaultViewport:j,translateExtent:R,minZoom:B,maxZoom:z,preventScrolling:L,onSelectionContextMenu:F,noWheelClassName:C,noPanClassName:I,disableKeyboardA11y:D,onViewportChange:$,isControlledViewport:O}){const{nodesSelectionActive:te,userSelectionActive:se}=Xt(jle,ms),P=$m(u,{target:QO}),Q=$m(b,{target:QO}),ee=Q||k,V=Q||w,X=d&&ee!==!0,K=P||se||X;return dle({deleteKeyCode:c,multiSelectionKeyCode:m}),o.jsx(ple,{onPaneContextMenu:r,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:E,panOnScroll:V,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:T,panOnDrag:!P&&ee,defaultViewport:j,translateExtent:R,minZoom:B,maxZoom:z,zoomActivationKeyCode:v,preventScrolling:L,noWheelClassName:C,noPanClassName:I,onViewportChange:$,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:X,children:o.jsxs(yle,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:s,onPaneMouseLeave:i,onPaneContextMenu:r,onPaneScroll:a,panOnDrag:ee,autoPanOnSelection:A,isSelecting:!!K,selectionMode:f,selectionKeyPressed:P,paneClickDistance:l,selectionOnDrag:X,children:[e,te&&o.jsx(Ile,{onSelectionContextMenu:F,noPanClassName:I,disableKeyboardA11y:D})]})})}gU.displayName="FlowRenderer";const Rle=g.memo(gU),Ole=e=>t=>e?S2(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Mle(e){return Xt(g.useCallback(Ole(e),[e]),ms)}const Lle=e=>e.updateNodeInternals;function Dle(){const e=Xt(Lle),[t]=g.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const s=new Map;n.forEach(i=>{const r=i.target.getAttribute("data-id");s.set(r,{id:r,nodeElement:i.target,force:!0})}),e(s)}));return g.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Ple({node:e,nodeType:t,hasDimensions:n,resizeObserver:s}){const i=gs(),r=g.useRef(null),a=g.useRef(null),l=g.useRef(e.sourcePosition),c=g.useRef(e.targetPosition),u=g.useRef(t),d=n&&!!e.internals.handleBounds;return g.useEffect(()=>{r.current&&!e.hidden&&(!d||a.current!==r.current)&&(a.current&&(s==null||s.unobserve(a.current)),s==null||s.observe(r.current),a.current=r.current)},[d,e.hidden]),g.useEffect(()=>()=>{a.current&&(s==null||s.unobserve(a.current),a.current=null)},[]),g.useEffect(()=>{if(r.current){const f=u.current!==t,h=l.current!==e.sourcePosition,p=c.current!==e.targetPosition;(f||h||p)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:r.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),r}function Ble({id:e,onClick:t,onMouseEnter:n,onMouseMove:s,onMouseLeave:i,onContextMenu:r,onDoubleClick:a,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:b,nodeTypes:v,nodeClickDistance:y,onError:x}){const{node:E,internals:w,isParent:S}=Xt(K=>{const ce=K.nodeLookup.get(e),he=K.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:he}},ms);let _=E.type||"default",T=(v==null?void 0:v[_])||XO[_];T===void 0&&(x==null||x("003",Fa.error003(_)),_="default",T=(v==null?void 0:v.default)||XO.default);const k=!!(E.draggable||l&&typeof E.draggable>"u"),A=!!(E.selectable||c&&typeof E.selectable>"u"),j=!!(E.connectable||u&&typeof E.connectable>"u"),R=!!(E.focusable||d&&typeof E.focusable>"u"),B=gs(),z=k2(E),L=Ple({node:E,nodeType:_,hasDimensions:z,resizeObserver:f}),F=hU({nodeRef:L,disabled:E.hidden||!k,noDragClassName:h,handleSelector:E.dragHandle,nodeId:e,isSelectable:A,nodeClickDistance:y}),C=pU();if(E.hidden)return null;const I=hl(E),D=Ale(E),$=A||k||t||n||s||i,O=n?K=>n(K,{...w.userNode}):void 0,te=s?K=>s(K,{...w.userNode}):void 0,se=i?K=>i(K,{...w.userNode}):void 0,P=r?K=>r(K,{...w.userNode}):void 0,Q=a?K=>a(K,{...w.userNode}):void 0,ee=K=>{const{selectNodesOnDrag:ce,nodeDragThreshold:he}=B.getState();A&&(!ce||!k||he>0)&&nN({id:e,store:B,nodeRef:L}),t&&t(K,{...w.userNode})},V=K=>{if(!(L9(K.nativeEvent)||m)){if(S9.includes(K.key)&&A){const ce=K.key==="Escape";nN({id:e,store:B,unselect:ce,nodeRef:L})}else if(k&&E.selected&&Object.prototype.hasOwnProperty.call(E1,K.key)){K.preventDefault();const{ariaLabelConfig:ce}=B.getState();B.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),C({direction:E1[K.key],factor:K.shiftKey?4:1})}}},X=()=>{var Le;if(m||!((Le=L.current)!=null&&Le.matches(":focus-visible")))return;const{transform:K,width:ce,height:he,autoPanOnNodeFocus:be,setCenter:ue}=B.getState();if(!be)return;S2(new Map([[e,E]]),{x:0,y:0,width:ce,height:he},K,!0).length>0||ue(E.position.x+I.width/2,E.position.y+I.height/2,{zoom:K[2]})};return o.jsx("div",{className:ii(["react-flow__node",`react-flow__node-${_}`,{[p]:k},E.className,{selected:E.selected,selectable:A,parent:S,draggable:k,dragging:F}]),ref:L,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:z?"visible":"hidden",...E.style,...D},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:O,onMouseMove:te,onMouseLeave:se,onContextMenu:P,onClick:ee,onDoubleClick:Q,onKeyDown:R?V:void 0,tabIndex:R?0:void 0,onFocus:R?X:void 0,role:E.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${iU}-${b}`,"aria-label":E.ariaLabel,...E.domAttributes,children:o.jsx(Ele,{value:e,children:o.jsx(T,{id:e,data:E.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:E.selected??!1,selectable:A,draggable:k,deletable:E.deletable??!0,isConnectable:j,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:F,dragHandle:E.dragHandle,zIndex:w.z,parentId:E.parentId,...I})})})}var Ule=g.memo(Ble);const Fle=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function bU(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:i,onError:r}=Xt(Fle,ms),a=Mle(e.onlyRenderVisibleElements),l=Dle();return o.jsx("div",{className:"react-flow__nodes",style:Fx,children:a.map(c=>o.jsx(Ule,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:s,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:r},c))})}bU.displayName="NodeRenderer";const $le=g.memo(bU);function Hle(e){return Xt(g.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const s=[];if(n.width&&n.height)for(const i of n.edges){const r=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);r&&a&&Tae({sourceNode:r,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&s.push(i.id)}return s},[e]),ms)}const zle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return o.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Vle=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return o.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ZO={[If.Arrow]:zle,[If.ArrowClosed]:Vle};function Gle(e){const t=gs();return g.useMemo(()=>{var i,r;return Object.prototype.hasOwnProperty.call(ZO,e)?ZO[e]:((r=(i=t.getState()).onError)==null||r.call(i,"009",Fa.error009(e)),null)},[e])}const Kle=({id:e,type:t,color:n,width:s=12.5,height:i=12.5,markerUnits:r="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const c=Gle(t);return c?o.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:r,orient:l,refX:"0",refY:"0",children:o.jsx(c,{color:n,strokeWidth:a})}):null},yU=({defaultColor:e,rfId:t})=>{const n=Xt(r=>r.edges),s=Xt(r=>r.defaultEdgeOptions),i=g.useMemo(()=>Mae(n,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[n,s,t,e]);return i.length?o.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:o.jsx("defs",{children:i.map(r=>o.jsx(Kle,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})}):null};yU.displayName="MarkerDefinitions";var qle=g.memo(yU);function xU({x:e,y:t,label:n,labelStyle:s,labelShowBg:i=!0,labelBgStyle:r,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=g.useState({x:1,y:0,width:0,height:0}),p=ii(["react-flow__edge-textwrapper",u]),m=g.useRef(null);return g.useEffect(()=>{if(m.current){const b=m.current.getBBox();h({x:b.x,y:b.y,width:b.width,height:b.height})}},[n]),n?o.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[i&&o.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:r,rx:l,ry:l}),o.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:s,children:n}),c]}):null}xU.displayName="EdgeText";const Yle=g.memo(xU);function kg({path:e,labelX:t,labelY:n,label:s,labelStyle:i,labelShowBg:r,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return o.jsxs(o.Fragment,{children:[o.jsx("path",{...d,d:e,fill:"none",className:ii(["react-flow__edge-path",d.className])}),u?o.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,s&&Ma(t)&&Ma(n)?o.jsx(Yle,{x:t,y:n,label:s,labelStyle:i,labelShowBg:r,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function JO({pos:e,x1:t,y1:n,x2:s,y2:i}){return e===Qe.Left||e===Qe.Right?[.5*(t+s),n]:[t,.5*(n+i)]}function EU({sourceX:e,sourceY:t,sourcePosition:n=Qe.Bottom,targetX:s,targetY:i,targetPosition:r=Qe.Top}){const[a,l]=JO({pos:n,x1:e,y1:t,x2:s,y2:i}),[c,u]=JO({pos:r,x1:s,y1:i,x2:e,y2:t}),[d,f,h,p]=P9({sourceX:e,sourceY:t,targetX:s,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${a},${l} ${c},${u} ${s},${i}`,d,f,h,p]}function vU(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,sourcePosition:a,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:v,interactionWidth:y})=>{const[x,E,w]=EU({sourceX:n,sourceY:s,sourcePosition:a,targetX:i,targetY:r,targetPosition:l}),S=e.isInternal?void 0:t;return o.jsx(kg,{id:S,path:x,labelX:E,labelY:w,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:v,interactionWidth:y})})}const Wle=vU({isInternal:!1}),wU=vU({isInternal:!0});Wle.displayName="SimpleBezierEdge";wU.displayName="SimpleBezierEdgeInternal";function _U(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Qe.Bottom,targetPosition:m=Qe.Top,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[E,w,S]=x1({sourceX:n,sourceY:s,sourcePosition:p,targetX:i,targetY:r,targetPosition:m,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),_=e.isInternal?void 0:t;return o.jsx(kg,{id:_,path:E,labelX:w,labelY:S,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:b,markerStart:v,interactionWidth:x})})}const SU=_U({isInternal:!1}),NU=_U({isInternal:!0});SU.displayName="SmoothStepEdge";NU.displayName="SmoothStepEdgeInternal";function TU(e){return g.memo(({id:t,...n})=>{var i;const s=e.isInternal?void 0:t;return o.jsx(SU,{...n,id:s,pathOptions:g.useMemo(()=>{var r;return{borderRadius:0,offset:(r=n.pathOptions)==null?void 0:r.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const Xle=TU({isInternal:!1}),kU=TU({isInternal:!0});Xle.displayName="StepEdge";kU.displayName="StepEdgeInternal";function AU(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:b})=>{const[v,y,x]=F9({sourceX:n,sourceY:s,targetX:i,targetY:r}),E=e.isInternal?void 0:t;return o.jsx(kg,{id:E,path:v,labelX:y,labelY:x,label:a,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:b})})}const Qle=AU({isInternal:!1}),CU=AU({isInternal:!0});Qle.displayName="StraightEdge";CU.displayName="StraightEdgeInternal";function IU(e){return g.memo(({id:t,sourceX:n,sourceY:s,targetX:i,targetY:r,sourcePosition:a=Qe.Bottom,targetPosition:l=Qe.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:v,pathOptions:y,interactionWidth:x})=>{const[E,w,S]=B9({sourceX:n,sourceY:s,sourcePosition:a,targetX:i,targetY:r,targetPosition:l,curvature:y==null?void 0:y.curvature}),_=e.isInternal?void 0:t;return o.jsx(kg,{id:_,path:E,labelX:w,labelY:S,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:b,markerStart:v,interactionWidth:x})})}const Zle=IU({isInternal:!1}),jU=IU({isInternal:!0});Zle.displayName="BezierEdge";jU.displayName="BezierEdgeInternal";const eM={default:jU,straight:CU,step:kU,smoothstep:NU,simplebezier:wU},tM={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Jle=(e,t,n)=>n===Qe.Left?e-t:n===Qe.Right?e+t:e,ece=(e,t,n)=>n===Qe.Top?e-t:n===Qe.Bottom?e+t:e,nM="react-flow__edgeupdater";function sM({position:e,centerX:t,centerY:n,radius:s=10,onMouseDown:i,onMouseEnter:r,onMouseOut:a,type:l}){return o.jsx("circle",{onMouseDown:i,onMouseEnter:r,onMouseOut:a,className:ii([nM,`${nM}-${l}`]),cx:Jle(t,s,e),cy:ece(n,s,e),r:s,stroke:"transparent",fill:"transparent"})}function tce({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:s,sourceY:i,targetX:r,targetY:a,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=gs(),b=(w,S)=>{if(w.button!==0)return;const{autoPanOnConnect:_,domNode:T,connectionMode:k,connectionRadius:A,lib:j,onConnectStart:R,cancelConnection:B,nodeLookup:z,rfId:L,panBy:F,updateConnection:C}=m.getState(),I=S.type==="target",D=(te,se)=>{h(!1),f==null||f(te,n,S.type,se)},$=te=>u==null?void 0:u(n,te),O=(te,se)=>{h(!0),d==null||d(w,n,S.type),R==null||R(te,se)};tN.onPointerDown(w.nativeEvent,{autoPanOnConnect:_,connectionMode:k,connectionRadius:A,domNode:T,handleId:S.id,nodeId:S.nodeId,nodeLookup:z,isTarget:I,edgeUpdaterType:S.type,lib:j,flowId:L,cancelConnection:B,panBy:F,isValidConnection:(...te)=>{var se,P;return((P=(se=m.getState()).isValidConnection)==null?void 0:P.call(se,...te))??!0},onConnect:$,onConnectStart:O,onConnectEnd:(...te)=>{var se,P;return(P=(se=m.getState()).onConnectEnd)==null?void 0:P.call(se,...te)},onReconnectEnd:D,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>b(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=w=>b(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>p(!0),E=()=>p(!1);return o.jsxs(o.Fragment,{children:[(e===!0||e==="source")&&o.jsx(sM,{position:l,centerX:s,centerY:i,radius:t,onMouseDown:v,onMouseEnter:x,onMouseOut:E,type:"source"}),(e===!0||e==="target")&&o.jsx(sM,{position:c,centerX:r,centerY:a,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:E,type:"target"})]})}function nce({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:s,onClick:i,onDoubleClick:r,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:b,noPanClassName:v,onError:y,disableKeyboardA11y:x}){let E=Xt(ue=>ue.edgeLookup.get(e));const w=Xt(ue=>ue.defaultEdgeOptions);E=w?{...w,...E}:E;let S=E.type||"default",_=(b==null?void 0:b[S])||eM[S];_===void 0&&(y==null||y("011",Fa.error011(S)),S="default",_=(b==null?void 0:b.default)||eM.default);const T=!!(E.focusable||t&&typeof E.focusable>"u"),k=typeof f<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),A=!!(E.selectable||s&&typeof E.selectable>"u"),j=g.useRef(null),[R,B]=g.useState(!1),[z,L]=g.useState(!1),F=gs(),{zIndex:C,sourceX:I,sourceY:D,targetX:$,targetY:O,sourcePosition:te,targetPosition:se}=Xt(g.useCallback(ue=>{const we=ue.nodeLookup.get(E.source),Le=ue.nodeLookup.get(E.target);if(!we||!Le)return{zIndex:E.zIndex,...tM};const Ne=Oae({id:e,sourceNode:we,targetNode:Le,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ue.connectionMode,onError:y});return{zIndex:Nae({selected:E.selected,zIndex:E.zIndex,sourceNode:we,targetNode:Le,elevateOnSelect:ue.elevateEdgesOnSelect,zIndexMode:ue.zIndexMode}),...Ne||tM}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),ms),P=g.useMemo(()=>E.markerStart?`url('#${JS(E.markerStart,m)}')`:void 0,[E.markerStart,m]),Q=g.useMemo(()=>E.markerEnd?`url('#${JS(E.markerEnd,m)}')`:void 0,[E.markerEnd,m]);if(E.hidden||I===null||D===null||$===null||O===null)return null;const ee=ue=>{var ae;const{addSelectedEdges:we,unselectNodesAndEdges:Le,multiSelectionActive:Ne}=F.getState();A&&(F.setState({nodesSelectionActive:!1}),E.selected&&Ne?(Le({nodes:[],edges:[E]}),(ae=j.current)==null||ae.blur()):we([e])),i&&i(ue,E)},V=r?ue=>{r(ue,{...E})}:void 0,X=a?ue=>{a(ue,{...E})}:void 0,K=l?ue=>{l(ue,{...E})}:void 0,ce=c?ue=>{c(ue,{...E})}:void 0,he=u?ue=>{u(ue,{...E})}:void 0,be=ue=>{var we;if(!x&&S9.includes(ue.key)&&A){const{unselectNodesAndEdges:Le,addSelectedEdges:Ne}=F.getState();ue.key==="Escape"?((we=j.current)==null||we.blur(),Le({edges:[E]})):Ne([e])}};return o.jsx("svg",{style:{zIndex:C},children:o.jsxs("g",{className:ii(["react-flow__edge",`react-flow__edge-${S}`,E.className,v,{selected:E.selected,animated:E.animated,inactive:!A&&!i,updating:R,selectable:A}]),onClick:ee,onDoubleClick:V,onContextMenu:X,onMouseEnter:K,onMouseMove:ce,onMouseLeave:he,onKeyDown:T?be:void 0,tabIndex:T?0:void 0,role:E.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":T?`${rU}-${m}`:void 0,ref:j,...E.domAttributes,children:[!z&&o.jsx(_,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:A,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:I,sourceY:D,targetX:$,targetY:O,sourcePosition:te,targetPosition:se,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:P,markerEnd:Q,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),k&&o.jsx(tce,{edge:E,isReconnectable:k,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:I,sourceY:D,targetX:$,targetY:O,sourcePosition:te,targetPosition:se,setUpdateHover:B,setReconnecting:L})]})})}var sce=g.memo(nce);const ice=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function RU({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:s,noPanClassName:i,onReconnect:r,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:b}){const{edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,onError:E}=Xt(ice,ms),w=Hle(t);return o.jsxs("div",{className:"react-flow__edges",children:[o.jsx(qle,{defaultColor:e,rfId:n}),w.map(S=>o.jsx(sce,{id:S,edgesFocusable:v,edgesReconnectable:y,elementsSelectable:x,noPanClassName:i,onReconnect:r,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:E,edgeTypes:s,disableKeyboardA11y:b},S))]})}RU.displayName="EdgeRenderer";const rce=g.memo(RU),ace=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function oce({children:e}){const t=Xt(ace);return o.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function lce(e){const t=Ux(),n=g.useRef(!1);g.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const cce=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function uce(e){const t=Xt(cce),n=gs();return g.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function dce(e){return e.connection.inProgress?{...e.connection,to:oh(e.connection.to,e.transform)}:{...e.connection}}function fce(e){return dce}function hce(e){const t=fce();return Xt(t,ms)}const pce=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function mce({containerStyle:e,style:t,type:n,component:s}){const{nodesConnectable:i,width:r,height:a,isValid:l,inProgress:c}=Xt(pce,ms);return!(r&&i&&c)?null:o.jsx("svg",{style:e,width:r,height:a,className:"react-flow__connectionline react-flow__container",children:o.jsx("g",{className:ii(["react-flow__connection",k9(l)]),children:o.jsx(OU,{style:t,type:n,CustomComponent:s,isValid:l})})})}const OU=({style:e,type:t=Pl.Bezier,CustomComponent:n,isValid:s})=>{const{inProgress:i,from:r,fromNode:a,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:p}=hce();if(!i)return;if(n)return o.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:r.x,fromY:r.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:k9(s),toNode:d,toHandle:f,pointer:p});let m="";const b={sourceX:r.x,sourceY:r.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Pl.Bezier:[m]=B9(b);break;case Pl.SimpleBezier:[m]=EU(b);break;case Pl.Step:[m]=x1({...b,borderRadius:0});break;case Pl.SmoothStep:[m]=x1(b);break;default:[m]=F9(b)}return o.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};OU.displayName="ConnectionLine";const gce={};function iM(e=gce){g.useRef(e),gs(),g.useEffect(()=>{},[e])}function bce(){gs(),g.useRef(!1),g.useEffect(()=>{},[])}function MU({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:s,onEdgeClick:i,onNodeDoubleClick:r,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:b,connectionLineComponent:v,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:E,selectionMode:w,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:T,deleteKeyCode:k,onlyRenderVisibleElements:A,elementsSelectable:j,defaultViewport:R,translateExtent:B,minZoom:z,maxZoom:L,preventScrolling:F,defaultMarkerColor:C,zoomOnScroll:I,zoomOnPinch:D,panOnScroll:$,panOnScrollSpeed:O,panOnScrollMode:te,zoomOnDoubleClick:se,panOnDrag:P,autoPanOnSelection:Q,onPaneClick:ee,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:K,onPaneScroll:ce,onPaneContextMenu:he,paneClickDistance:be,nodeClickDistance:ue,onEdgeContextMenu:we,onEdgeMouseEnter:Le,onEdgeMouseMove:Ne,onEdgeMouseLeave:ae,reconnectRadius:me,onReconnect:_e,onReconnectStart:Je,onReconnectEnd:Pe,noDragClassName:Fe,noWheelClassName:Ye,noPanClassName:Ce,disableKeyboardA11y:Ve,nodeExtent:Ue,rfId:W,viewport:oe,onViewportChange:Z}){return iM(e),iM(t),bce(),lce(n),uce(oe),o.jsx(Rle,{onPaneClick:ee,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:K,onPaneContextMenu:he,onPaneScroll:ce,paneClickDistance:be,deleteKeyCode:k,selectionKeyCode:x,selectionOnDrag:E,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:T,elementsSelectable:j,zoomOnScroll:I,zoomOnPinch:D,zoomOnDoubleClick:se,panOnScroll:$,panOnScrollSpeed:O,panOnScrollMode:te,panOnDrag:P,autoPanOnSelection:Q,defaultViewport:R,translateExtent:B,minZoom:z,maxZoom:L,onSelectionContextMenu:f,preventScrolling:F,noDragClassName:Fe,noWheelClassName:Ye,noPanClassName:Ce,disableKeyboardA11y:Ve,onViewportChange:Z,isControlledViewport:!!oe,children:o.jsxs(oce,{children:[o.jsx(rce,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:_e,onReconnectStart:Je,onReconnectEnd:Pe,onlyRenderVisibleElements:A,onEdgeContextMenu:we,onEdgeMouseEnter:Le,onEdgeMouseMove:Ne,onEdgeMouseLeave:ae,reconnectRadius:me,defaultMarkerColor:C,noPanClassName:Ce,disableKeyboardA11y:Ve,rfId:W}),o.jsx(mce,{style:b,type:m,component:v,containerStyle:y}),o.jsx("div",{className:"react-flow__edgelabel-renderer"}),o.jsx($le,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:r,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ue,onlyRenderVisibleElements:A,noPanClassName:Ce,noDragClassName:Fe,disableKeyboardA11y:Ve,nodeExtent:Ue,rfId:W}),o.jsx("div",{className:"react-flow__viewport-portal"})]})})}MU.displayName="GraphView";const yce=g.memo(MU),xce=R9(),rM=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:r,fitView:a,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,b=new Map,v=new Map,y=s??t??[],x=n??e??[],E=d??[0,0],w=f??Pm;z9(b,v,y);const{nodesInitialized:S}=eN(x,p,m,{nodeOrigin:E,nodeExtent:w,zIndexMode:h});let _=[0,0,1];if(a&&i&&r){const T=Ng(p,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:k,y:A,zoom:j}=T2(T,i,r,c,u,(l==null?void 0:l.padding)??.1);_=[k,A,j]}return{rfId:"1",width:i??0,height:r??0,transform:_,nodes:x,nodesInitialized:S,nodeLookup:p,parentLookup:m,edges:y,edgeLookup:v,connectionLookup:b,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Pm,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Cf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:l,fitViewResolver:null,connection:{...T9},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:xce,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:N9,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Ece=({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Doe((p,m)=>{async function b(){const{nodeLookup:v,panZoom:y,fitViewOptions:x,fitViewResolver:E,width:w,height:S,minZoom:_,maxZoom:T}=m();y&&(await yae({nodes:v,width:w,height:S,panZoom:y,minZoom:_,maxZoom:T},x),E==null||E.resolve(!0),p({fitViewResolver:null}))}return{...rM({nodes:e,edges:t,width:i,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:s,zIndexMode:h}),setNodes:v=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:E,elevateNodesOnSelect:w,fitViewQueued:S,zIndexMode:_,nodesSelectionActive:T}=m(),{nodesInitialized:k,hasSelectedNodes:A}=eN(v,y,x,{nodeOrigin:E,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:_}),j=T&&A;S&&k?(b(),p({nodes:v,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:j})):p({nodes:v,nodesInitialized:k,nodesSelectionActive:j})},setEdges:v=>{const{connectionLookup:y,edgeLookup:x}=m();z9(y,x,v),p({edges:v})},setDefaultNodesAndEdges:(v,y)=>{if(v){const{setNodes:x}=m();x(v),p({hasDefaultNodes:!0})}if(y){const{setEdges:x}=m();x(y),p({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:E,domNode:w,nodeOrigin:S,nodeExtent:_,debug:T,fitViewQueued:k,zIndexMode:A}=m(),{changes:j,updatedInternals:R}=$ae(v,x,E,w,S,_,A);R&&(Pae(x,E,{nodeOrigin:S,nodeExtent:_,zIndexMode:A}),k?(b(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(j==null?void 0:j.length)>0&&(T&&console.log("React Flow: trigger node changes",j),y==null||y(j)))},updateNodePositions:(v,y=!1)=>{const x=[];let E=[];const{nodeLookup:w,triggerNodeChanges:S,connection:_,updateConnection:T,onNodesChangeMiddlewareMap:k}=m();for(const[A,j]of v){const R=w.get(A),B=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(j!=null&&j.position)),z={id:A,type:"position",position:B?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:y};if(R&&_.inProgress&&_.fromNode.id===R.id){const L=Eu(R,_.fromHandle,Qe.Left,!0);T({..._,from:L})}B&&R.parentId&&x.push({id:A,parentId:R.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),E.push(z)}if(x.length>0){const{parentLookup:A,nodeOrigin:j}=m(),R=O2(x,w,A,j);E.push(...R)}for(const A of k.values())E=A(E);S(E)},triggerNodeChanges:v=>{const{onNodesChange:y,setNodes:x,nodes:E,hasDefaultNodes:w,debug:S}=m();if(v!=null&&v.length){if(w){const _=lU(v,E);x(_)}S&&console.log("React Flow: trigger node changes",v),y==null||y(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:y,setEdges:x,edges:E,hasDefaultEdges:w,debug:S}=m();if(v!=null&&v.length){if(w){const _=cU(v,E);x(_)}S&&console.log("React Flow: trigger edge changes",v),y==null||y(v)}},addSelectedNodes:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:E,triggerNodeChanges:w,triggerEdgeChanges:S}=m();if(y){const _=v.map(T=>Uc(T,!0));w(_);return}w(Ud(E,new Set([...v]),!0)),S(Ud(x))},addSelectedEdges:v=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:E,triggerNodeChanges:w,triggerEdgeChanges:S}=m();if(y){const _=v.map(T=>Uc(T,!0));S(_);return}S(Ud(x,new Set([...v]))),w(Ud(E,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:y}={})=>{const{edges:x,nodes:E,nodeLookup:w,triggerNodeChanges:S,triggerEdgeChanges:_}=m(),T=v||E,k=y||x,A=[];for(const R of T){if(!R.selected)continue;const B=w.get(R.id);B&&(B.selected=!1),A.push(Uc(R.id,!1))}const j=[];for(const R of k)R.selected&&j.push(Uc(R.id,!1));S(A),_(j)},setMinZoom:v=>{const{panZoom:y,maxZoom:x}=m();y==null||y.setScaleExtent([v,x]),p({minZoom:v})},setMaxZoom:v=>{const{panZoom:y,minZoom:x}=m();y==null||y.setScaleExtent([x,v]),p({maxZoom:v})},setTranslateExtent:v=>{var y;(y=m().panZoom)==null||y.setTranslateExtent(v),p({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:y,triggerNodeChanges:x,triggerEdgeChanges:E,elementsSelectable:w}=m();if(!w)return;const S=y.reduce((T,k)=>k.selected?[...T,Uc(k.id,!1)]:T,[]),_=v.reduce((T,k)=>k.selected?[...T,Uc(k.id,!1)]:T,[]);x(S),E(_)},setNodeExtent:v=>{const{nodes:y,nodeLookup:x,parentLookup:E,nodeOrigin:w,elevateNodesOnSelect:S,nodeExtent:_,zIndexMode:T}=m();v[0][0]===_[0][0]&&v[0][1]===_[0][1]&&v[1][0]===_[1][0]&&v[1][1]===_[1][1]||(eN(y,x,E,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:T}),p({nodeExtent:v}))},panBy:v=>{const{transform:y,width:x,height:E,panZoom:w,translateExtent:S}=m();return Hae({delta:v,panZoom:w,transform:y,translateExtent:S,width:x,height:E})},setCenter:async(v,y,x)=>{const{width:E,height:w,maxZoom:S,panZoom:_}=m();if(!_)return!1;const T=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:S;return await _.setViewport({x:E/2-v*T,y:w/2-y*T,zoom:T},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{p({connection:{...T9}})},updateConnection:v=>{p({connection:v})},reset:()=>p({...rM()})}},Object.is);function L2({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:s,initialWidth:i,initialHeight:r,initialMinZoom:a,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=g.useState(()=>Ece({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,width:i,height:r,fitView:u,minZoom:a,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return o.jsx(Poe,{value:m,children:o.jsx(ole,{children:p})})}function vce({children:e,nodes:t,edges:n,defaultNodes:s,defaultEdges:i,width:r,height:a,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return g.useContext(Px)?o.jsx(o.Fragment,{children:e}):o.jsx(L2,{initialNodes:t,initialEdges:n,defaultNodes:s,defaultEdges:i,initialWidth:r,initialHeight:a,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const wce={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function _ce({nodes:e,edges:t,defaultNodes:n,defaultEdges:s,className:i,nodeTypes:r,edgeTypes:a,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:E,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:T,onNodeDrag:k,onNodeDragStop:A,onNodesDelete:j,onEdgesDelete:R,onDelete:B,onSelectionChange:z,onSelectionDragStart:L,onSelectionDrag:F,onSelectionDragStop:C,onSelectionContextMenu:I,onSelectionStart:D,onSelectionEnd:$,onBeforeDelete:O,connectionMode:te,connectionLineType:se=Pl.Bezier,connectionLineStyle:P,connectionLineComponent:Q,connectionLineContainerStyle:ee,deleteKeyCode:V="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:K=!1,selectionMode:ce=Bm.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:be=Fm()?"Meta":"Control",zoomActivationKeyCode:ue=Fm()?"Meta":"Control",snapToGrid:we,snapGrid:Le,onlyRenderVisibleElements:Ne=!1,selectNodesOnDrag:ae,nodesDraggable:me,autoPanOnNodeFocus:_e,nodesConnectable:Je,nodesFocusable:Pe,nodeOrigin:Fe=aU,edgesFocusable:Ye,edgesReconnectable:Ce,elementsSelectable:Ve=!0,defaultViewport:Ue=Xoe,minZoom:W=.5,maxZoom:oe=2,translateExtent:Z=Pm,preventScrolling:Ee=!0,nodeExtent:Me,defaultMarkerColor:lt="#b1b1b7",zoomOnScroll:Ot=!0,zoomOnPinch:ut=!0,panOnScroll:xn=!1,panOnScrollSpeed:xt=.5,panOnScrollMode:wt=ru.Free,zoomOnDoubleClick:En=!0,panOnDrag:Ut=!0,onPaneClick:Pt,onPaneMouseEnter:at,onPaneMouseMove:ft,onPaneMouseLeave:He,onPaneScroll:_t,onPaneContextMenu:ye,paneClickDistance:We=1,nodeClickDistance:Ge=0,children:ht,onReconnect:Vn,onReconnectStart:un,onReconnectEnd:Ht,onEdgeContextMenu:sn,onEdgeDoubleClick:kn,onEdgeMouseEnter:zt,onEdgeMouseMove:ot,onEdgeMouseLeave:An,reconnectRadius:mn=10,onNodesChange:At,onEdgesChange:Os,noDragClassName:Ms="nodrag",noWheelClassName:bs="nowheel",noPanClassName:vn="nopan",fitView:Gn,fitViewOptions:ls,connectOnClick:Kn,attributionPosition:Ss,proOptions:Ns,defaultEdgeOptions:hi,elevateNodesOnSelect:Cn=!0,elevateEdgesOnSelect:Ks=!1,disableKeyboardA11y:cs=!1,autoPanOnConnect:qn,autoPanOnNodeDrag:Yn,autoPanOnSelection:Wn=!0,autoPanSpeed:Ls,connectionRadius:ys,isValidConnection:gn,onError:fn,style:dn,id:rn,nodeDragThreshold:an,connectionDragThreshold:xs,viewport:de,onViewportChange:Ie,width:Be,height:it,colorMode:et="light",debug:Et,onScroll:je,ariaLabelConfig:Ln,zIndexMode:us="basic",...pi},ri){const Xn=rn||"1",Jt=ele(et),vt=g.useCallback(Dn=>{Dn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),je==null||je(Dn)},[je]);return o.jsx("div",{"data-testid":"rf__wrapper",...pi,onScroll:vt,style:{...dn,...wce},ref:ri,className:ii(["react-flow",i,Jt]),id:rn,role:"application",children:o.jsxs(vce,{nodes:e,edges:t,width:Be,height:it,fitView:Gn,fitViewOptions:ls,minZoom:W,maxZoom:oe,nodeOrigin:Fe,nodeExtent:Me,zIndexMode:us,children:[o.jsx(Joe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:s,onConnect:p,onConnectStart:m,onConnectEnd:b,onClickConnectStart:v,onClickConnectEnd:y,nodesDraggable:me,autoPanOnNodeFocus:_e,nodesConnectable:Je,nodesFocusable:Pe,edgesFocusable:Ye,edgesReconnectable:Ce,elementsSelectable:Ve,elevateNodesOnSelect:Cn,elevateEdgesOnSelect:Ks,minZoom:W,maxZoom:oe,nodeExtent:Me,onNodesChange:At,onEdgesChange:Os,snapToGrid:we,snapGrid:Le,connectionMode:te,translateExtent:Z,connectOnClick:Kn,defaultEdgeOptions:hi,fitView:Gn,fitViewOptions:ls,onNodesDelete:j,onEdgesDelete:R,onDelete:B,onNodeDragStart:T,onNodeDrag:k,onNodeDragStop:A,onSelectionDrag:F,onSelectionDragStart:L,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:vn,nodeOrigin:Fe,rfId:Xn,autoPanOnConnect:qn,autoPanOnNodeDrag:Yn,autoPanSpeed:Ls,onError:fn,connectionRadius:ys,isValidConnection:gn,selectNodesOnDrag:ae,nodeDragThreshold:an,connectionDragThreshold:xs,onBeforeDelete:O,debug:Et,ariaLabelConfig:Ln,zIndexMode:us}),o.jsx(yce,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:E,onNodeMouseLeave:w,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:r,edgeTypes:a,connectionLineType:se,connectionLineStyle:P,connectionLineComponent:Q,connectionLineContainerStyle:ee,selectionKeyCode:X,selectionOnDrag:K,selectionMode:ce,deleteKeyCode:V,multiSelectionKeyCode:be,panActivationKeyCode:he,zoomActivationKeyCode:ue,onlyRenderVisibleElements:Ne,defaultViewport:Ue,translateExtent:Z,minZoom:W,maxZoom:oe,preventScrolling:Ee,zoomOnScroll:Ot,zoomOnPinch:ut,zoomOnDoubleClick:En,panOnScroll:xn,panOnScrollSpeed:xt,panOnScrollMode:wt,panOnDrag:Ut,autoPanOnSelection:Wn,onPaneClick:Pt,onPaneMouseEnter:at,onPaneMouseMove:ft,onPaneMouseLeave:He,onPaneScroll:_t,onPaneContextMenu:ye,paneClickDistance:We,nodeClickDistance:Ge,onSelectionContextMenu:I,onSelectionStart:D,onSelectionEnd:$,onReconnect:Vn,onReconnectStart:un,onReconnectEnd:Ht,onEdgeContextMenu:sn,onEdgeDoubleClick:kn,onEdgeMouseEnter:zt,onEdgeMouseMove:ot,onEdgeMouseLeave:An,reconnectRadius:mn,defaultMarkerColor:lt,noDragClassName:Ms,noWheelClassName:bs,noPanClassName:vn,rfId:Xn,disableKeyboardA11y:cs,nodeExtent:Me,viewport:de,onViewportChange:Ie}),o.jsx(Woe,{onSelectionChange:z}),ht,o.jsx(Voe,{proOptions:Ns,position:Ss}),o.jsx(zoe,{rfId:Xn,disableKeyboardA11y:cs})]})})}var LU=dU(_ce);const Sce=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Nce({children:e}){const t=Xt(Sce);return t?wi.createPortal(e,t):null}function DU(e){const[t,n]=g.useState(e),s=g.useCallback(i=>n(r=>lU(i,r)),[]);return[t,n,s]}function PU(e){const[t,n]=g.useState(e),s=g.useCallback(i=>n(r=>cU(i,r)),[]);return[t,n,s]}const Tce=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(t.nodeLookup.size===0)return!1;for(const[,{internals:n}]of t.nodeLookup)if(n.handleBounds===void 0||!k2(n.userNode))return!1;return!0};function kce(e={includeHiddenNodes:!1}){return Xt(Tce(e))}function Ace({dimensions:e,lineWidth:t,variant:n,className:s}){return o.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ii(["react-flow__background-pattern",n,s])})}function Cce({radius:e,className:t}){return o.jsx("circle",{cx:e,cy:e,r:e,className:ii(["react-flow__background-pattern","dots",t])})}var tc;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(tc||(tc={}));const Ice={[tc.Dots]:1,[tc.Lines]:1,[tc.Cross]:6},jce=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function BU({id:e,variant:t=tc.Dots,gap:n=20,size:s,lineWidth:i=1,offset:r=0,color:a,bgColor:l,style:c,className:u,patternClassName:d}){const f=g.useRef(null),{transform:h,patternId:p}=Xt(jce,ms),m=s||Ice[t],b=t===tc.Dots,v=t===tc.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*h[2]||1,y[1]*h[2]||1],E=m*h[2],w=Array.isArray(r)?r:[r,r],S=v?[E,E]:x,_=[w[0]*h[2]||1+S[0]/2,w[1]*h[2]||1+S[1]/2],T=`${p}${e||""}`;return o.jsxs("svg",{className:ii(["react-flow__background",u]),style:{...c,...Fx,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[o.jsx("pattern",{id:T,x:h[0]%x[0],y:h[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:b?o.jsx(Cce,{radius:E/2,className:d}):o.jsx(Ace,{dimensions:S,lineWidth:i,variant:t,className:d})}),o.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}BU.displayName="Background";const UU=g.memo(BU);function Rce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:o.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Oce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:o.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Mce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:o.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Lce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Dce(){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:o.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function tb({children:e,className:t,...n}){return o.jsx("button",{type:"button",className:ii(["react-flow__controls-button",t]),...n,children:e})}const Pce=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function FU({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:s=!0,fitViewOptions:i,onZoomIn:r,onZoomOut:a,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=gs(),{isInteractive:b,minZoomReached:v,maxZoomReached:y,ariaLabelConfig:x}=Xt(Pce,ms),{zoomIn:E,zoomOut:w,fitView:S}=Ux(),_=()=>{E(),r==null||r()},T=()=>{w(),a==null||a()},k=()=>{S(i),l==null||l()},A=()=>{m.setState({nodesDraggable:!b,nodesConnectable:!b,elementsSelectable:!b}),c==null||c(!b)},j=h==="horizontal"?"horizontal":"vertical";return o.jsxs(Bx,{className:ii(["react-flow__controls",j,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??x["controls.ariaLabel"],children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(tb,{onClick:_,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:o.jsx(Rce,{})}),o.jsx(tb,{onClick:T,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:o.jsx(Oce,{})})]}),n&&o.jsx(tb,{className:"react-flow__controls-fitview",onClick:k,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:o.jsx(Mce,{})}),s&&o.jsx(tb,{className:"react-flow__controls-interactive",onClick:A,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:b?o.jsx(Dce,{}):o.jsx(Lce,{})}),d]})}FU.displayName="Controls";const $U=g.memo(FU);function Bce({id:e,x:t,y:n,width:s,height:i,style:r,color:a,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:b}=r||{},v=a||m||b;return o.jsx("rect",{className:ii(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:s,height:i,style:{fill:v,stroke:l,strokeWidth:c},shapeRendering:f,onClick:p?y=>p(y,e):void 0})}const Uce=g.memo(Bce),Fce=e=>e.nodes.map(t=>t.id),lw=e=>e instanceof Function?e:()=>e;function $ce({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:s=5,nodeStrokeWidth:i,nodeComponent:r=Uce,onClick:a}){const l=Xt(Fce,ms),c=lw(t),u=lw(e),d=lw(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return o.jsx(o.Fragment,{children:l.map(h=>o.jsx(zce,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:s,nodeStrokeWidth:i,NodeComponent:r,onClick:a,shapeRendering:f},h))})}function Hce({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:s,nodeBorderRadius:i,nodeStrokeWidth:r,shapeRendering:a,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:p}=Xt(m=>{const b=m.nodeLookup.get(e);if(!b)return{node:void 0,x:0,y:0,width:0,height:0};const v=b.internals.userNode,{x:y,y:x}=b.internals.positionAbsolute,{width:E,height:w}=hl(v);return{node:v,x:y,y:x,width:E,height:w}},ms);return!u||u.hidden||!k2(u)?null:o.jsx(l,{x:d,y:f,width:h,height:p,style:u.style,selected:!!u.selected,className:s(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:r,shapeRendering:a,onClick:c,id:u.id})}const zce=g.memo(Hce);var Vce=g.memo($ce);const Gce=200,Kce=150,qce=e=>!e.hidden,Yce=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?j9(Ng(e.nodeLookup,{filter:qce}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Wce="react-flow__minimap-desc";function HU({style:e,className:t,nodeStrokeColor:n,nodeColor:s,nodeClassName:i="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:b=!1,zoomable:v=!1,ariaLabel:y,inversePan:x,zoomStep:E=1,offsetScale:w=5}){const S=gs(),_=g.useRef(null),{boundingRect:T,viewBB:k,rfId:A,panZoom:j,translateExtent:R,flowWidth:B,flowHeight:z,ariaLabelConfig:L}=Xt(Yce,ms),F=(e==null?void 0:e.width)??Gce,C=(e==null?void 0:e.height)??Kce,I=T.width/F,D=T.height/C,$=Math.max(I,D),O=$*F,te=$*C,se=w*$,P=T.x-(O-T.width)/2-se,Q=T.y-(te-T.height)/2-se,ee=O+se*2,V=te+se*2,X=`${Wce}-${A}`,K=g.useRef(0),ce=g.useRef();K.current=$,g.useEffect(()=>{if(_.current&&j)return ce.current=Qae({domNode:_.current,panZoom:j,getTransform:()=>S.getState().transform,getViewScale:()=>K.current}),()=>{var we;(we=ce.current)==null||we.destroy()}},[j]),g.useEffect(()=>{var we;(we=ce.current)==null||we.update({translateExtent:R,width:B,height:z,inversePan:x,pannable:b,zoomStep:E,zoomable:v})},[b,v,x,E,R,B,z]);const he=p?we=>{var ae;const[Le,Ne]=((ae=ce.current)==null?void 0:ae.pointer(we))||[0,0];p(we,{x:Le,y:Ne})}:void 0,be=m?g.useCallback((we,Le)=>{const Ne=S.getState().nodeLookup.get(Le).internals.userNode;m(we,Ne)},[]):void 0,ue=y??L["minimap.ariaLabel"];return o.jsx(Bx,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*$:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:ii(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:o.jsxs("svg",{width:F,height:C,viewBox:`${P} ${Q} ${ee} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:_,onClick:he,children:[ue&&o.jsx("title",{id:X,children:ue}),o.jsx(Vce,{onClick:be,nodeColor:s,nodeStrokeColor:n,nodeBorderRadius:r,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:l}),o.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-se},${Q-se}h${ee+se*2}v${V+se*2}h${-ee-se*2}z + M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}HU.displayName="MiniMap";const Xce=g.memo(HU),Qce=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Zce={[Mf.Line]:"right",[Mf.Handle]:"bottom-right"};function Jce({nodeId:e,position:t,variant:n=Mf.Handle,className:s,style:i=void 0,children:r,color:a,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:b,onResize:v,onResizeEnd:y}){const x=mU(),E=typeof e=="string"?e:x,w=gs(),S=g.useRef(null),_=n===Mf.Handle,T=Xt(g.useCallback(Qce(_&&p),[_,p]),ms),k=g.useRef(null),A=t??Zce[n];g.useEffect(()=>{if(!(!S.current||!E))return k.current||(k.current=uoe({domNode:S.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:R,transform:B,snapGrid:z,snapToGrid:L,nodeOrigin:F,domNode:C}=w.getState();return{nodeLookup:R,transform:B,snapGrid:z,snapToGrid:L,nodeOrigin:F,paneDomNode:C}},onChange:(R,B)=>{const{triggerNodeChanges:z,nodeLookup:L,parentLookup:F,nodeOrigin:C}=w.getState(),I=[],D={x:R.x,y:R.y},$=L.get(E);if($&&$.expandParent&&$.parentId){const O=$.origin??C,te=R.width??$.measured.width??0,se=R.height??$.measured.height??0,P={id:$.id,parentId:$.parentId,rect:{width:te,height:se,...O9({x:R.x??$.position.x,y:R.y??$.position.y},{width:te,height:se},$.parentId,L,O)}},Q=O2([P],L,F,C);I.push(...Q),D.x=R.x?Math.max(O[0]*te,R.x):void 0,D.y=R.y?Math.max(O[1]*se,R.y):void 0}if(D.x!==void 0&&D.y!==void 0){const O={id:E,type:"position",position:{...D}};I.push(O)}if(R.width!==void 0&&R.height!==void 0){const te={id:E,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};I.push(te)}for(const O of B){const te={...O,type:"position"};I.push(te)}z(I)},onEnd:({width:R,height:B})=>{const z={id:E,type:"dimensions",resizing:!1,dimensions:{width:R,height:B}};w.getState().triggerNodeChanges([z])}})),k.current.update({controlPosition:A,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:b,onResize:v,onResizeEnd:y,shouldResize:m}),()=>{var R;(R=k.current)==null||R.destroy()}},[A,l,c,u,d,f,b,v,y,m]);const j=A.split("-");return o.jsx("div",{className:ii(["react-flow__resize-control","nodrag",...j,n,s]),ref:S,style:{...i,scale:T,...a&&{[_?"backgroundColor":"borderColor"]:a}},children:r})}g.memo(Jce);var zU=Object.defineProperty,eue=(e,t,n)=>t in e?zU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tue=(e,t)=>{for(var n in t)zU(e,n,{get:t[n],enumerable:!0})},nue=(e,t,n)=>eue(e,t+"",n),VU={};tue(VU,{Graph:()=>ma,alg:()=>D2,json:()=>KU,version:()=>rue});var sue=Object.defineProperty,GU=(e,t)=>{for(var n in t)sue(e,n,{get:t[n],enumerable:!0})},ma=class{constructor(t){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},t&&(this._isDirected="directed"in t?t.directed:!0,this._isMultigraph="multigraph"in t?t.multigraph:!1,this._isCompound="compound"in t?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return typeof t!="function"?this._defaultNodeLabelFn=()=>t:this._defaultNodeLabelFn=t,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(t=>Object.keys(this._in[t]).length===0)}sinks(){return this.nodes().filter(t=>Object.keys(this._out[t]).length===0)}setNodes(t,n){return t.forEach(s=>{n!==void 0?this.setNode(s,n):this.setNode(s)}),this}setNode(t,n){return t in this._nodes?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return t in this._nodes}removeNode(t){if(t in this._nodes){let n=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(s=>{this.setParent(s)}),delete this._children[t]),Object.keys(this._in[t]).forEach(n),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n="\0";else{n+="";for(let s=n;s!==void 0;s=this.parent(s))if(s===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}parent(t){if(this._isCompound){let n=this._parent[t];if(n!=="\0")return n}}children(t="\0"){if(this._isCompound){let n=this._children[t];if(n)return Object.keys(n)}else{if(t==="\0")return this.nodes();if(this.hasNode(t))return[]}return[]}predecessors(t){let n=this._preds[t];if(n)return Object.keys(n)}successors(t){let n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){let n=this.predecessors(t);if(n){let s=new Set(n);for(let i of this.successors(t))s.add(i);return Array.from(s.values())}}isLeaf(t){let n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){let n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph()),Object.entries(this._nodes).forEach(([r,a])=>{t(r)&&n.setNode(r,a)}),Object.values(this._edgeObjs).forEach(r=>{n.hasNode(r.v)&&n.hasNode(r.w)&&n.setEdge(r,this.edge(r))});let s={},i=r=>{let a=this.parent(r);return!a||n.hasNode(a)?(s[r]=a??void 0,a??void 0):a in s?s[a]:i(a)};return this._isCompound&&n.nodes().forEach(r=>n.setParent(r,i(r))),n}setDefaultEdgeLabel(t){return typeof t!="function"?this._defaultEdgeLabelFn=()=>t:this._defaultEdgeLabelFn=t,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){return t.reduce((s,i)=>(n!==void 0?this.setEdge(s,i,n):this.setEdge(s,i),i)),this}setEdge(t,n,s,i){let r,a,l,c,u=!1;typeof t=="object"&&t!==null&&"v"in t?(r=t.v,a=t.w,l=t.name,arguments.length===2&&(c=n,u=!0)):(r=t,a=n,l=i,arguments.length>2&&(c=s,u=!0)),r=""+r,a=""+a,l!==void 0&&(l=""+l);let d=Ep(this._isDirected,r,a,l);if(d in this._edgeLabels)return u&&(this._edgeLabels[d]=c),this;if(l!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(r),this.setNode(a),this._edgeLabels[d]=u?c:this._defaultEdgeLabelFn(r,a,l);let f=iue(this._isDirected,r,a,l);return r=f.v,a=f.w,Object.freeze(f),this._edgeObjs[d]=f,aM(this._preds[a],r),aM(this._sucs[r],a),this._in[a][d]=f,this._out[r][d]=f,this._edgeCount++,this}edge(t,n,s){let i=arguments.length===1?cw(this._isDirected,t):Ep(this._isDirected,t,n,s);return this._edgeLabels[i]}edgeAsObj(t,n,s){let i=arguments.length===1?this.edge(t):this.edge(t,n,s);return typeof i!="object"?{label:i}:i}hasEdge(t,n,s){return(arguments.length===1?cw(this._isDirected,t):Ep(this._isDirected,t,n,s))in this._edgeLabels}removeEdge(t,n,s){let i=arguments.length===1?cw(this._isDirected,t):Ep(this._isDirected,t,n,s),r=this._edgeObjs[i];if(r){let a=r.v,l=r.w;delete this._edgeLabels[i],delete this._edgeObjs[i],oM(this._preds[l],a),oM(this._sucs[a],l),delete this._in[l][i],delete this._out[a][i],this._edgeCount--}return this}inEdges(t,n){return this.isDirected()?this.filterEdges(this._in[t],t,n):this.nodeEdges(t,n)}outEdges(t,n){return this.isDirected()?this.filterEdges(this._out[t],t,n):this.nodeEdges(t,n)}nodeEdges(t,n){if(t in this._nodes)return this.filterEdges({...this._in[t],...this._out[t]},t,n)}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}filterEdges(t,n,s){if(!t)return;let i=Object.values(t);return s?i.filter(r=>r.v===n&&r.w===s||r.v===s&&r.w===n):i}};function aM(e,t){e[t]?e[t]++:e[t]=1}function oM(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Ep(e,t,n,s){let i=""+t,r=""+n;if(!e&&i>r){let a=i;i=r,r=a}return i+""+r+""+(s===void 0?"\0":s)}function iue(e,t,n,s){let i=""+t,r=""+n;if(!e&&i>r){let l=i;i=r,r=l}let a={v:i,w:r};return s&&(a.name=s),a}function cw(e,t){return Ep(e,t.v,t.w,t.name)}var rue="4.0.1",KU={};GU(KU,{read:()=>cue,write:()=>aue});function aue(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:oue(e),edges:lue(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function oue(e){return e.nodes().map(t=>{let n=e.node(t),s=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),s!==void 0&&(i.parent=s),i})}function lue(e){return e.edges().map(t=>{let n=e.edge(t),s={v:t.v,w:t.w};return t.name!==void 0&&(s.name=t.name),n!==void 0&&(s.value=n),s})}function cue(e){let t=new ma(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(n=>{t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(n=>{t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var D2={};GU(D2,{CycleException:()=>w1,bellmanFord:()=>qU,components:()=>fue,dijkstra:()=>v1,dijkstraAll:()=>mue,findCycles:()=>gue,floydWarshall:()=>yue,isAcyclic:()=>Eue,postorder:()=>wue,preorder:()=>_ue,prim:()=>Sue,shortestPaths:()=>Nue,tarjan:()=>WU,topsort:()=>XU});var uue=()=>1;function qU(e,t,n,s){return due(e,String(t),n||uue,s||function(i){return e.outEdges(i)})}function due(e,t,n,s){let i={},r,a=0,l=e.nodes(),c=function(f){let h=n(f);i[f.v].distance+he.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(e,t){let n=this._keyIndices,s=String(e);if(!(s in n)){let i=this._arr,r=i.length;return n[s]=r,i.push({key:s,priority:t}),this._decrease(r),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw new Error(`Key not found: ${e}`);let s=this._arr[n].priority;if(t>s)throw new Error(`New priority is greater than current priority. Key: ${e} Old: ${s} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,s=n+1,i=e;n>1,!(t[s].priority1;function v1(e,t,n,s){let i=function(r){return e.outEdges(r)};return pue(e,String(t),n||hue,s||i)}function pue(e,t,n,s){let i={},r=new YU,a,l,c=function(u){let d=u.v!==a?u.v:u.w,f=i[d],h=n(u),p=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+h);p0&&(a=r.removeMin(),l=i[a],l.distance!==Number.POSITIVE_INFINITY);)s(a).forEach(c);return i}function mue(e,t,n){return e.nodes().reduce(function(s,i){return s[i]=v1(e,i,t,n),s},{})}function WU(e){let t=0,n=[],s={},i=[];function r(a){let l=s[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){c in s?s[c].onStack&&(l.lowlink=Math.min(l.lowlink,s[c].index)):(r(c),l.lowlink=Math.min(l.lowlink,s[c].lowlink))}),l.lowlink===l.index){let c=[],u;do u=n.pop(),s[u].onStack=!1,c.push(u);while(a!==u);i.push(c)}}return e.nodes().forEach(function(a){a in s||r(a)}),i}function gue(e){return WU(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var bue=()=>1;function yue(e,t,n){return xue(e,t||bue,n||function(s){return e.outEdges(s)})}function xue(e,t,n){let s={},i=e.nodes();return i.forEach(function(r){s[r]={},s[r][r]={distance:0,predecessor:""},i.forEach(function(a){r!==a&&(s[r][a]={distance:Number.POSITIVE_INFINITY,predecessor:""})}),n(r).forEach(function(a){let l=a.v===r?a.w:a.v,c=t(a);s[r][l]={distance:c,predecessor:r}})}),i.forEach(function(r){let a=s[r];i.forEach(function(l){let c=s[l];i.forEach(function(u){let d=c[r],f=a[u],h=c[u],p=d.distance+f.distance;p{var c;return(c=e.isDirected()?e.successors(l):e.neighbors(l))!=null?c:[]},a={};return t.forEach(function(l){if(!e.hasNode(l))throw new Error("Graph does not have node: "+l);i=QU(e,l,n==="post",a,r,s,i)}),i}function QU(e,t,n,s,i,r,a){return t in s||(s[t]=!0,n||(a=r(a,t)),i(t).forEach(function(l){a=QU(e,l,n,s,i,r,a)}),n&&(a=r(a,t))),a}function ZU(e,t,n){return vue(e,t,n,function(s,i){return s.push(i),s},[])}function wue(e,t){return ZU(e,t,"post")}function _ue(e,t){return ZU(e,t,"pre")}function Sue(e,t){let n=new ma,s={},i=new YU,r;function a(c){let u=c.v===r?c.w:c.v,d=i.priority(u);if(d!==void 0){let f=t(c);f0;){if(r=i.removeMin(),r in s)n.setEdge(r,s[r]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(r).forEach(a)}return n}function Nue(e,t,n,s){return Tue(e,t,n,s??(i=>{let r=e.outEdges(i);return r??[]}))}function Tue(e,t,n,s){if(n===void 0)return v1(e,t,n,s);let i=!1,r=e.nodes();for(let a=0;at.setNode(n,e.node(n))),e.edges().forEach(n=>{let s=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:s.weight+i.weight,minlen:Math.max(s.minlen,i.minlen)})}),t}function JU(e){let t=new ma({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function lM(e,t){let n=e.x,s=e.y,i=t.x-n,r=t.y-s,a=e.width/2,l=e.height/2;if(!i&&!r)throw new Error("Not possible to find intersection inside of the rectangle");let c,u;return Math.abs(r)*a>Math.abs(i)*l?(r<0&&(l=-l),c=l*i/r,u=l):(i<0&&(a=-a),c=a,u=a*r/i),{x:n+c,y:s+u}}function Ag(e){let t=Hm(t7(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let s=e.node(n),i=s.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][s.order]=n)}),t}function Aue(e){let t=e.nodes().map(s=>{let i=e.node(s).rank;return i===void 0?Number.MAX_VALUE:i}),n=oo(Math.min,t);e.nodes().forEach(s=>{let i=e.node(s);Object.hasOwn(i,"rank")&&(i.rank-=n)})}function Cue(e){let t=e.nodes().map(a=>e.node(a).rank).filter(a=>a!==void 0),n=oo(Math.min,t),s=[];e.nodes().forEach(a=>{let l=e.node(a).rank-n;s[l]||(s[l]=[]),s[l].push(a)});let i=0,r=e.graph().nodeRankFactor;Array.from(s).forEach((a,l)=>{a===void 0&&l%r!==0?--i:a!==void 0&&i&&a.forEach(c=>e.node(c).rank+=i)})}function cM(e,t,n,s){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=s),lh(e,"border",i,t)}function Iue(e,t=e7){let n=[];for(let s=0;se7){let n=Iue(t);return e(...n.map(s=>e(...s)))}else return e(...t)}function t7(e){let t=e.nodes().map(n=>{let s=e.node(n).rank;return s===void 0?Number.MIN_VALUE:s});return oo(Math.max,t)}function jue(e,t){let n={lhs:[],rhs:[]};return e.forEach(s=>{t(s)?n.lhs.push(s):n.rhs.push(s)}),n}function n7(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function s7(e,t){return t()}var Rue=0;function P2(e){let t=++Rue;return e+(""+t)}function Hm(e,t,n=1){t==null&&(t=e,e=0);let s=r=>rts[t]:n=t,Object.entries(e).reduce((s,[i,r])=>(s[i]=n(r,i),s),{})}function Oue(e,t){return e.reduce((n,s,i)=>(n[s]=t[i],n),{})}var Hx="\0",Mue="3.0.0",Lue=class{constructor(){nue(this,"_sentinel");let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return uM(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&uM(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Due)),n=n._prev;return"["+e.join(", ")+"]"}};function uM(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Due(e,t){if(e!=="_next"&&e!=="_prev")return t}var Pue=Lue,Bue=()=>1;function Uue(e,t){if(e.nodeCount()<=1)return[];let n=$ue(e,t||Bue);return Fue(n.graph,n.buckets,n.zeroIdx).flatMap(s=>e.outEdges(s.v,s.w)||[])}function Fue(e,t,n){var s;let i=[],r=t[t.length-1],a=t[0],l;for(;e.nodeCount();){for(;l=a.dequeue();)uw(e,t,n,l);for(;l=r.dequeue();)uw(e,t,n,l);if(e.nodeCount()){for(let c=t.length-2;c>0;--c)if(l=(s=t[c])==null?void 0:s.dequeue(),l){i=i.concat(uw(e,t,n,l,!0)||[]);break}}}return i}function uw(e,t,n,s,i){let r=[],a=i?r:void 0;return(e.inEdges(s.v)||[]).forEach(l=>{let c=e.edge(l),u=e.node(l.v);i&&r.push({v:l.v,w:l.w}),u.out-=c,sN(t,n,u)}),(e.outEdges(s.v)||[]).forEach(l=>{let c=e.edge(l),u=l.w,d=e.node(u);d.in-=c,sN(t,n,d)}),e.removeNode(s.v),a}function $ue(e,t){let n=new ma,s=0,i=0;e.nodes().forEach(l=>{n.setNode(l,{v:l,in:0,out:0})}),e.edges().forEach(l=>{let c=n.edge(l.v,l.w)||0,u=t(l),d=c+u;n.setEdge(l.v,l.w,d);let f=n.node(l.v),h=n.node(l.w);i=Math.max(i,f.out+=u),s=Math.max(s,h.in+=u)});let r=Hue(i+s+3).map(()=>new Pue),a=s+1;return n.nodes().forEach(l=>{sN(r,a,n.node(l))}),{graph:n,buckets:r,zeroIdx:a}}function sN(e,t,n){var s,i,r;n.out?n.in?(r=e[n.out-n.in+t])==null||r.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(s=e[0])==null||s.enqueue(n)}function Hue(e){let t=[];for(let n=0;n{let s=e.edge(n);e.removeEdge(n),s.forwardName=n.name,s.reversed=!0,e.setEdge(n.w,n.v,s,P2("rev"))});function t(n){return s=>n.edge(s).weight}}function Vue(e){let t=[],n={},s={};function i(r){Object.hasOwn(s,r)||(s[r]=!0,n[r]=!0,e.outEdges(r).forEach(a=>{Object.hasOwn(n,a.w)?t.push(a):i(a.w)}),delete n[r])}return e.nodes().forEach(i),t}function Gue(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let s=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,s)}})}function Kue(e){e.graph().dummyChains=[],e.edges().forEach(t=>que(e,t))}function que(e,t){let n=t.v,s=e.node(n).rank,i=t.w,r=e.node(i).rank,a=t.name,l=e.edge(t),c=l.labelRank;if(r===s+1)return;e.removeEdge(t);let u,d,f;for(f=0,++s;s{let n=e.node(t),s=n.edgeLabel,i;for(e.setEdge(n.edgeObj,s);n.dummy;)i=e.successors(t)[0],e.removeNode(t),s.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height),t=i,n=e.node(t)})}function B2(e){let t={};function n(s){let i=e.node(s);if(Object.hasOwn(t,s))return i.rank;t[s]=!0;let r=e.outEdges(s),a=r?r.map(c=>c==null?Number.POSITIVE_INFINITY:n(c.w)-e.edge(c).minlen):[],l=oo(Math.min,a);return l===Number.POSITIVE_INFINITY&&(l=0),i.rank=l}e.sources().forEach(n)}function Df(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var i7=Wue;function Wue(e){let t=new ma({directed:!1}),n=e.nodes();if(n.length===0)throw new Error("Graph must have at least one node");let s=n[0],i=e.nodeCount();t.setNode(s,{});let r,a;for(;Xue(t,e){let a=r.v,l=s===a?r.w:a;!e.hasNode(l)&&!Df(t,r)&&(e.setNode(l,{}),e.setEdge(s,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function Que(e,t){return t.edges().reduce((n,s)=>{let i=Number.POSITIVE_INFINITY;return e.hasNode(s.v)!==e.hasNode(s.w)&&(i=Df(t,s)),it.node(s).rank+=n)}var{preorder:Jue,postorder:ede}=D2,tde=Ru;Ru.initLowLimValues=F2;Ru.initCutValues=U2;Ru.calcCutValue=r7;Ru.leaveEdge=o7;Ru.enterEdge=l7;Ru.exchangeEdges=c7;function Ru(e){e=kue(e),B2(e);let t=i7(e);F2(t),U2(t,e);let n,s;for(;n=o7(t);)s=l7(t,e,n),c7(t,e,n,s)}function U2(e,t){let n=ede(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(s=>nde(e,t,s))}function nde(e,t,n){let s=e.node(n).parent,i=e.edge(n,s);i.cutvalue=r7(e,t,n)}function r7(e,t,n){let s=e.node(n).parent,i=!0,r=t.edge(n,s),a=0;r||(i=!1,r=t.edge(s,n)),a=r.weight;let l=t.nodeEdges(n);return l&&l.forEach(c=>{let u=c.v===n,d=u?c.w:c.v;if(d!==s){let f=u===i,h=t.edge(c).weight;if(a+=f?h:-h,ide(e,n,d)){let p=e.edge(n,d).cutvalue;a+=f?-p:p}}}),a}function F2(e,t){arguments.length<2&&(t=e.nodes()[0]),a7(e,{},1,t)}function a7(e,t,n,s,i){let r=n,a=e.node(s);t[s]=!0;let l=e.neighbors(s);return l&&l.forEach(c=>{Object.hasOwn(t,c)||(n=a7(e,t,n,c,s))}),a.low=r,a.lim=n++,i?a.parent=i:delete a.parent,n}function o7(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function l7(e,t,n){let s=n.v,i=n.w;t.hasEdge(s,i)||(s=n.w,i=n.v);let r=e.node(s),a=e.node(i),l=r,c=!1;return r.lim>a.lim&&(l=a,c=!0),t.edges().filter(u=>c===dM(e,e.node(u.v),l)&&c!==dM(e,e.node(u.w),l)).reduce((u,d)=>Df(t,d)!e.node(i).parent);if(!n)return;let s=Jue(e,[n]);s=s.slice(1),s.forEach(i=>{let r=e.node(i).parent,a=t.edge(i,r),l=!1;a||(a=t.edge(r,i),l=!0),t.node(i).rank=t.node(r).rank+(l?a.minlen:-a.minlen)})}function ide(e,t,n){return e.hasEdge(t,n)}function dM(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var rde=ade;function ade(e){let t=e.graph().ranker;if(typeof t=="function")return t(e);switch(t){case"network-simplex":fM(e);break;case"tight-tree":lde(e);break;case"longest-path":ode(e);break;case"none":break;default:fM(e)}}var ode=B2;function lde(e){B2(e),i7(e)}function fM(e){tde(e)}var cde=ude;function ude(e){let t=fde(e);e.graph().dummyChains.forEach(n=>{let s=e.node(n),i=s.edgeObj,r=dde(e,t,i.v,i.w),a=r.path,l=r.lca,c=0,u=a[c],d=!0;for(;n!==i.w;){if(s=e.node(n),d){for(;(u=a[c])!==l&&e.node(u).maxRanka||l>t[c].lim));let u=c,d=s;for(;(d=e.parent(d))!==u;)r.push(d);return{path:i.concat(r.reverse()),lca:u}}function fde(e){let t={},n=0;function s(i){let r=n;e.children(i).forEach(s),t[i]={low:r,lim:n++}}return e.children(Hx).forEach(s),t}function hde(e){let t=lh(e,"root",{},"_root"),n=pde(e),s=Object.values(n),i=oo(Math.max,s)-1,r=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(l=>e.edge(l).minlen*=r);let a=mde(e)+1;e.children(Hx).forEach(l=>u7(e,t,r,a,i,n,l)),e.graph().nodeRankFactor=r}function u7(e,t,n,s,i,r,a){var l;let c=e.children(a);if(!c.length){a!==t&&e.setEdge(t,a,{weight:0,minlen:n});return}let u=cM(e,"_bt"),d=cM(e,"_bb"),f=e.node(a);e.setParent(u,a),f.borderTop=u,e.setParent(d,a),f.borderBottom=d,c.forEach(h=>{var p;u7(e,t,n,s,i,r,h);let m=e.node(h),b=m.borderTop?m.borderTop:h,v=m.borderBottom?m.borderBottom:h,y=m.borderTop?s:2*s,x=b!==v?1:i-((p=r[a])!=null?p:0)+1;e.setEdge(u,b,{weight:y,minlen:x,nestingEdge:!0}),e.setEdge(v,d,{weight:y,minlen:x,nestingEdge:!0})}),e.parent(a)||e.setEdge(t,u,{weight:0,minlen:i+((l=r[a])!=null?l:0)})}function pde(e){let t={};function n(s,i){let r=e.children(s);r&&r.length&&r.forEach(a=>n(a,i+1)),t[s]=i}return e.children(Hx).forEach(s=>n(s,1)),t}function mde(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function gde(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{e.edge(n).nestingEdge&&e.removeEdge(n)})}var bde=yde;function yde(e){function t(n){let s=e.children(n),i=e.node(n);if(s.length&&s.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let r=i.minRank,a=i.maxRank+1;rpM(e.node(t))),e.edges().forEach(t=>pM(e.edge(t)))}function pM(e){let t=e.width;e.width=e.height,e.height=t}function vde(e){e.nodes().forEach(t=>dw(e.node(t))),e.edges().forEach(t=>{var n;let s=e.edge(t);(n=s.points)==null||n.forEach(dw),Object.hasOwn(s,"y")&&dw(s)})}function dw(e){e.y=-e.y}function wde(e){e.nodes().forEach(t=>fw(e.node(t))),e.edges().forEach(t=>{var n;let s=e.edge(t);(n=s.points)==null||n.forEach(fw),Object.hasOwn(s,"x")&&fw(s)})}function fw(e){let t=e.x;e.x=e.y,e.y=t}function _de(e){let t={},n=e.nodes().filter(l=>!e.children(l).length),s=n.map(l=>e.node(l).rank),i=oo(Math.max,s),r=Hm(i+1).map(()=>[]);function a(l){if(t[l])return;t[l]=!0;let c=e.node(l);r[c.rank].push(l);let u=e.successors(l);u&&u.forEach(a)}return n.sort((l,c)=>e.node(l).rank-e.node(c).rank).forEach(a),r}function Sde(e,t){let n=0;for(let s=1;sd)),i=t.flatMap(u=>{let d=e.outEdges(u);return d?d.map(f=>({pos:s[f.w],weight:e.edge(f).weight})).sort((f,h)=>f.pos-h.pos):[]}),r=1;for(;r{let d=u.pos+r;l[d]+=u.weight;let f=0;for(;d>0;)d%2&&(f+=l[d+1]),d=d-1>>1,l[d]+=u.weight;c+=u.weight*f}),c}function Tde(e,t=[]){return t.map(n=>{let s=e.inEdges(n);if(!s||!s.length)return{v:n};{let i=s.reduce((r,a)=>{let l=e.edge(a),c=e.node(a.v);return{sum:r.sum+l.weight*c.order,weight:r.weight+l.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}})}function kde(e,t){let n={};e.forEach((i,r)=>{let a={indegree:0,in:[],out:[],vs:[i.v],i:r};i.barycenter!==void 0&&(a.barycenter=i.barycenter,a.weight=i.weight),n[i.v]=a}),t.edges().forEach(i=>{let r=n[i.v],a=n[i.w];r!==void 0&&a!==void 0&&(a.indegree++,r.out.push(a))});let s=Object.values(n).filter(i=>!i.indegree);return Ade(s)}function Ade(e){let t=[];function n(i){return r=>{r.merged||(r.barycenter===void 0||i.barycenter===void 0||r.barycenter>=i.barycenter)&&Cde(i,r)}}function s(i){return r=>{r.in.push(i),--r.indegree===0&&e.push(r)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(s(i))}return t.filter(i=>!i.merged).map(i=>_1(i,["vs","i","barycenter","weight"]))}function Cde(e,t){let n=0,s=0;e.weight&&(n+=e.barycenter*e.weight,s+=e.weight),t.weight&&(n+=t.barycenter*t.weight,s+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/s,e.weight=s,e.i=Math.min(t.i,e.i),t.merged=!0}function Ide(e,t){let n=jue(e,d=>Object.hasOwn(d,"barycenter")),s=n.lhs,i=n.rhs.sort((d,f)=>f.i-d.i),r=[],a=0,l=0,c=0;s.sort(jde(!!t)),c=mM(r,i,c),s.forEach(d=>{c+=d.vs.length,r.push(d.vs),a+=d.barycenter*d.weight,l+=d.weight,c=mM(r,i,c)});let u={vs:r.flat(1)};return l&&(u.barycenter=a/l,u.weight=l),u}function mM(e,t,n){let s;for(;t.length&&(s=t[t.length-1]).i<=n;)t.pop(),e.push(s.vs),n++;return n}function jde(e){return(t,n)=>t.barycentern.barycenter?1:e?n.i-t.i:t.i-n.i}function f7(e,t,n,s){let i=e.children(t),r=e.node(t),a=r?r.borderLeft:void 0,l=r?r.borderRight:void 0,c={};a&&(i=i.filter(h=>h!==a&&h!==l));let u=Tde(e,i);u.forEach(h=>{if(e.children(h.v).length){let p=f7(e,h.v,n,s);c[h.v]=p,Object.hasOwn(p,"barycenter")&&Ode(h,p)}});let d=kde(u,n);Rde(d,c);let f=Ide(d,s);if(a&&l){f.vs=[a,f.vs,l].flat(1);let h=e.predecessors(a);if(h&&h.length){let p=e.node(h[0]),m=e.predecessors(l),b=e.node(m[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+b.order)/(f.weight+2),f.weight+=2}}return f}function Rde(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(s=>t[s]?t[s].vs:s)})}function Ode(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}function Mde(e,t,n,s){s||(s=e.nodes());let i=Lde(e),r=new ma({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(a=>e.node(a));return s.forEach(a=>{let l=e.node(a),c=e.parent(a);if(l.rank===t||l.minRank<=t&&t<=l.maxRank){r.setNode(a),r.setParent(a,c||i);let u=e[n](a);u&&u.forEach(d=>{let f=d.v===a?d.w:d.v,h=r.edge(f,a),p=h!==void 0?h.weight:0;r.setEdge(f,a,{weight:e.edge(d).weight+p})}),Object.hasOwn(l,"minRank")&&r.setNode(a,{borderLeft:l.borderLeft[t],borderRight:l.borderRight[t]})}}),r}function Lde(e){let t;for(;e.hasNode(t=P2("_root")););return t}function Dde(e,t,n){let s={},i;n.forEach(r=>{let a=e.parent(r),l,c;for(;a;){if(l=e.parent(a),l?(c=s[l],s[l]=a):(c=i,i=a),c&&c!==a){t.setEdge(c,a);return}a=l}})}function h7(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,h7);return}let n=t7(e),s=gM(e,Hm(1,n+1),"inEdges"),i=gM(e,Hm(n-1,-1,-1),"outEdges"),r=_de(e);if(bM(e,r),t.disableOptimalOrderHeuristic)return;let a=Number.POSITIVE_INFINITY,l,c=t.constraints||[];for(let u=0,d=0;d<4;++u,++d){Pde(u%2?s:i,u%4>=2,c),r=Ag(e);let f=Sde(e,r);f{s.has(r)||s.set(r,[]),s.get(r).push(a)};for(let r of e.nodes()){let a=e.node(r);if(typeof a.rank=="number"&&i(a.rank,r),typeof a.minRank=="number"&&typeof a.maxRank=="number")for(let l=a.minRank;l<=a.maxRank;l++)l!==a.rank&&i(l,r)}return t.map(function(r){return Mde(e,r,n,s.get(r)||[])})}function Pde(e,t,n){let s=new ma;e.forEach(function(i){n.forEach(l=>s.setEdge(l.left,l.right));let r=i.graph().root,a=f7(i,r,s,t);a.vs.forEach((l,c)=>i.node(l).order=c),Dde(i,s,a.vs)})}function bM(e,t){Object.values(t).forEach(n=>n.forEach((s,i)=>e.node(s).order=i))}function Bde(e,t){let n={};function s(i,r){let a=0,l=0,c=i.length,u=r[r.length-1];return r.forEach((d,f)=>{let h=Fde(e,d),p=h?e.node(h).order:c;(h||d===u)&&(r.slice(l,f+1).forEach(m=>{let b=e.predecessors(m);b&&b.forEach(v=>{let y=e.node(v),x=y.order;(x{let f=r[d];if(f!==void 0&&e.node(f).dummy){let h=e.predecessors(f);h&&h.forEach(p=>{if(p===void 0)return;let m=e.node(p);m.dummy&&(m.orderu)&&p7(n,p,f)})}})}function i(r,a){let l=-1,c=-1,u=0;return a.forEach((d,f)=>{if(e.node(d).dummy==="border"){let h=e.predecessors(d);if(h&&h.length){let p=h[0];if(p===void 0)return;c=e.node(p).order,s(a,u,f,l,c),u=f,l=c}}s(a,u,a.length,c,r.length)}),a}return t.length&&t.reduce(i),n}function Fde(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(s=>e.node(s).dummy)}}function p7(e,t,n){if(t>n){let i=t;t=n,n=i}let s=e[t];s||(e[t]=s={}),s[n]=!0}function $de(e,t,n){if(t>n){let i=t;t=n,n=i}let s=e[t];return s!==void 0&&Object.hasOwn(s,n)}function Hde(e,t,n,s){let i={},r={},a={};return t.forEach(l=>{l.forEach((c,u)=>{i[c]=c,r[c]=c,a[c]=u})}),t.forEach(l=>{let c=-1;l.forEach(u=>{let d=s(u);if(d&&d.length){let f=d.sort((p,m)=>{let b=a[p],v=a[m];return(b!==void 0?b:0)-(v!==void 0?v:0)}),h=(f.length-1)/2;for(let p=Math.floor(h),m=Math.ceil(h);p<=m;++p){let b=f[p];if(b===void 0)continue;let v=a[b];if(v!==void 0&&r[u]===u&&c{var y;let x=(y=r[v.v])!=null?y:0,E=a.edge(v);return Math.max(b,x+(E!==void 0?E:0))},0):r[p]=0}function d(p){let m=a.outEdges(p),b=Number.POSITIVE_INFINITY;m&&(b=m.reduce((y,x)=>{let E=r[x.w],w=a.edge(x);return Math.min(y,(E!==void 0?E:0)-(w!==void 0?w:0))},Number.POSITIVE_INFINITY));let v=e.node(p);b!==Number.POSITIVE_INFINITY&&v.borderType!==l&&(r[p]=Math.max(r[p]!==void 0?r[p]:0,b))}function f(p){return a.predecessors(p)||[]}function h(p){return a.successors(p)||[]}return c(u,f),c(d,h),Object.keys(s).forEach(p=>{var m;let b=n[p];b!==void 0&&(r[p]=(m=r[b])!=null?m:0)}),r}function Vde(e,t,n,s){let i=new ma,r=e.graph(),a=Wde(r.nodesep,r.edgesep,s);return t.forEach(l=>{let c;l.forEach(u=>{let d=n[u];if(d!==void 0){if(i.setNode(d),c!==void 0){let f=n[c];if(f!==void 0){let h=i.edge(f,d);i.setEdge(f,d,Math.max(a(e,u,c),h||0))}}c=u}})}),i}function Gde(e,t){return Object.values(t).reduce((n,s)=>{let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;Object.entries(s).forEach(([l,c])=>{let u=Xde(e,l)/2;i=Math.max(c+u,i),r=Math.min(c-u,r)});let a=i-r;return a{["l","r"].forEach(a=>{let l=r+a,c=e[l];if(!c||c===t)return;let u=Object.values(c),d=s-oo(Math.min,u);a!=="l"&&(d=i-oo(Math.max,u)),d&&(e[l]=$x(c,f=>f+d))})})}function qde(e,t=void 0){let n=e.ul;return n?$x(n,(s,i)=>{var r,a;if(t){let c=t.toLowerCase(),u=e[c];if(u&&u[i]!==void 0)return u[i]}let l=Object.values(e).map(c=>{let u=c[i];return u!==void 0?u:0}).sort((c,u)=>c-u);return(((r=l[1])!=null?r:0)+((a=l[2])!=null?a:0))/2}):{}}function Yde(e){let t=Ag(e),n=Object.assign(Bde(e,t),Ude(e,t)),s={},i;["u","d"].forEach(a=>{i=a==="u"?t:Object.values(t).reverse(),["l","r"].forEach(l=>{l==="r"&&(i=i.map(d=>Object.values(d).reverse()));let c=Hde(e,i,n,d=>(a==="u"?e.predecessors(d):e.successors(d))||[]),u=zde(e,i,c.root,c.align,l==="r");l==="r"&&(u=$x(u,d=>-d)),s[a+l]=u})});let r=Gde(e,s);return Kde(s,r),qde(s,e.graph().align)}function Wde(e,t,n){return(s,i,r)=>{let a=s.node(i),l=s.node(r),c=0,u;if(c+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=-a.width/2;break;case"r":u=a.width/2;break}if(u&&(c+=n?u:-u),u=void 0,c+=(a.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=l.width/2;break;case"r":u=-l.width/2;break}return u&&(c+=n?u:-u),c}}function Xde(e,t){return e.node(t).width}function Qde(e){e=JU(e),Zde(e),Object.entries(Yde(e)).forEach(([t,n])=>e.node(t).x=n)}function Zde(e){let t=Ag(e),n=e.graph(),s=n.ranksep,i=n.rankalign,r=0;t.forEach(a=>{let l=a.reduce((c,u)=>{var d;let f=(d=e.node(u).height)!=null?d:0;return c>f?c:f},0);a.forEach(c=>{let u=e.node(c);i==="top"?u.y=r+u.height/2:i==="bottom"?u.y=r+l-u.height/2:u.y=r+l/2}),r+=l+s})}function Jde(e,t={}){let n=t.debugTiming?n7:s7;return n("layout",()=>{let s=n(" buildLayoutGraph",()=>cfe(e));return n(" runLayout",()=>efe(s,n,t)),n(" updateInputGraph",()=>tfe(e,s)),s})}function efe(e,t,n){t(" makeSpaceForEdgeLabels",()=>ufe(e)),t(" removeSelfEdges",()=>xfe(e)),t(" acyclic",()=>zue(e)),t(" nestingGraph.run",()=>hde(e)),t(" rank",()=>rde(JU(e))),t(" injectEdgeLabelProxies",()=>dfe(e)),t(" removeEmptyRanks",()=>Cue(e)),t(" nestingGraph.cleanup",()=>gde(e)),t(" normalizeRanks",()=>Aue(e)),t(" assignRankMinMax",()=>ffe(e)),t(" removeEdgeLabelProxies",()=>hfe(e)),t(" normalize.run",()=>Kue(e)),t(" parentDummyChains",()=>cde(e)),t(" addBorderSegments",()=>bde(e)),t(" order",()=>h7(e,n)),t(" insertSelfEdges",()=>Efe(e)),t(" adjustCoordinateSystem",()=>xde(e)),t(" position",()=>Qde(e)),t(" positionSelfEdges",()=>vfe(e)),t(" removeBorderNodes",()=>yfe(e)),t(" normalize.undo",()=>Yue(e)),t(" fixupEdgeLabelCoords",()=>gfe(e)),t(" undoCoordinateSystem",()=>Ede(e)),t(" translateGraph",()=>pfe(e)),t(" assignNodeIntersects",()=>mfe(e)),t(" reversePoints",()=>bfe(e)),t(" acyclic.undo",()=>Gue(e))}function tfe(e,t){e.nodes().forEach(n=>{let s=e.node(n),i=t.node(n);s&&(s.x=i.x,s.y=i.y,s.order=i.order,s.rank=i.rank,t.children(n).length&&(s.width=i.width,s.height=i.height))}),e.edges().forEach(n=>{let s=e.edge(n),i=t.edge(n);s.points=i.points,Object.hasOwn(i,"x")&&(s.x=i.x,s.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var nfe=["nodesep","edgesep","ranksep","marginx","marginy"],sfe={ranksep:50,edgesep:20,nodesep:50,rankdir:"TB",rankalign:"center"},ife=["acyclicer","ranker","rankdir","align","rankalign"],rfe=["width","height","rank"],yM={width:0,height:0},afe=["minlen","weight","width","height","labeloffset"],ofe={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},lfe=["labelpos"];function cfe(e){let t=new ma({multigraph:!0,compound:!0}),n=pw(e.graph());return t.setGraph(Object.assign({},sfe,hw(n,nfe),_1(n,ife))),e.nodes().forEach(s=>{let i=pw(e.node(s)),r=hw(i,rfe);Object.keys(yM).forEach(l=>{r[l]===void 0&&(r[l]=yM[l])}),t.setNode(s,r);let a=e.parent(s);a!==void 0&&t.setParent(s,a)}),e.edges().forEach(s=>{let i=pw(e.edge(s));t.setEdge(s,Object.assign({},ofe,hw(i,afe),_1(i,lfe)))}),t}function ufe(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let s=e.edge(n);s.minlen*=2,s.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?s.width+=s.labeloffset:s.height+=s.labeloffset)})}function dfe(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let s=e.node(t.v),i={rank:(e.node(t.w).rank-s.rank)/2+s.rank,e:t};lh(e,"edge-proxy",i,"_ep")}})}function ffe(e){let t=0;e.nodes().forEach(n=>{let s=e.node(n);s.borderTop&&(s.minRank=e.node(s.borderTop).rank,s.maxRank=e.node(s.borderBottom).rank,t=Math.max(t,s.maxRank))}),e.graph().maxRank=t}function hfe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="edge-proxy"){let s=n;e.edge(s.e).labelRank=n.rank,e.removeNode(t)}})}function pfe(e){let t=Number.POSITIVE_INFINITY,n=0,s=Number.POSITIVE_INFINITY,i=0,r=e.graph(),a=r.marginx||0,l=r.marginy||0;function c(u){let d=u.x,f=u.y,h=u.width,p=u.height;t=Math.min(t,d-h/2),n=Math.max(n,d+h/2),s=Math.min(s,f-p/2),i=Math.max(i,f+p/2)}e.nodes().forEach(u=>c(e.node(u))),e.edges().forEach(u=>{let d=e.edge(u);Object.hasOwn(d,"x")&&c(d)}),t-=a,s-=l,e.nodes().forEach(u=>{let d=e.node(u);d.x-=t,d.y-=s}),e.edges().forEach(u=>{let d=e.edge(u);d.points.forEach(f=>{f.x-=t,f.y-=s}),Object.hasOwn(d,"x")&&(d.x-=t),Object.hasOwn(d,"y")&&(d.y-=s)}),r.width=n-t+a,r.height=i-s+l}function mfe(e){e.edges().forEach(t=>{let n=e.edge(t),s=e.node(t.v),i=e.node(t.w),r,a;n.points?(r=n.points[0],a=n.points[n.points.length-1]):(n.points=[],r=i,a=s),n.points.unshift(lM(s,r)),n.points.push(lM(i,a))})}function gfe(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function bfe(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function yfe(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),s=e.node(n.borderTop),i=e.node(n.borderBottom),r=e.node(n.borderLeft[n.borderLeft.length-1]),a=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(a.x-r.x),n.height=Math.abs(i.y-s.y),n.x=r.x+n.width/2,n.y=s.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function xfe(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Efe(e){Ag(e).forEach(t=>{let n=0;t.forEach((s,i)=>{let r=e.node(s);r.order=i+n,(r.selfEdges||[]).forEach(a=>{lh(e,"selfedge",{width:a.label.width,height:a.label.height,rank:r.rank,order:i+ ++n,e:a.e,label:a.label},"_se")}),delete r.selfEdges})})}function vfe(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy==="selfedge"){let s=n,i=e.node(s.e.v),r=i.x+i.width/2,a=i.y,l=n.x-r,c=i.height/2;e.setEdge(s.e,s.label),e.removeNode(t),s.label.points=[{x:r+2*l/3,y:a-c},{x:r+5*l/6,y:a-c},{x:r+l,y:a},{x:r+5*l/6,y:a+c},{x:r+2*l/3,y:a+c}],s.label.x=n.x,s.label.y=n.y}})}function hw(e,t){return $x(_1(e,t),Number)}function pw(e){let t={};return e&&Object.entries(e).forEach(([n,s])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=s}),t}function wfe(e){let t=Ag(e),n=new ma({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(s=>{n.setNode(s,{label:s}),n.setParent(s,"layer"+e.node(s).rank)}),e.edges().forEach(s=>n.setEdge(s.v,s.w,{},s.name)),t.forEach((s,i)=>{let r="layer"+i;n.setNode(r,{rank:"same"}),s.reduce((a,l)=>(n.setEdge(a,l,{style:"invis"}),l))}),n}var _fe={graphlib:VU,version:Mue,layout:Jde,debug:wfe,util:{time:n7,notime:s7}},xM=_fe;/*! For license information please see dagre.esm.js.LEGAL.txt */const vp={llm:{label:"智能体",description:"理解任务并直接完成一个具体工作",icon:pu},sequential:{label:"分步协作",description:"内部步骤按照顺序依次执行",icon:HB},parallel:{label:"同时处理",description:"内部步骤同时工作,完成后统一汇总",icon:LB},loop:{label:"循环执行",description:"重复执行内部步骤,直到满足停止条件",icon:Xk},a2a:{label:"远程智能体",description:"调用已经存在的远程 Agent",icon:xx}},iN=220,rN=88,EM=96,vM=34,Qp=64,mw=310,Fd=24,m7=56,aN=40,wM=40,Sfe=18,Nfe=58,Tfe=!1,kfe=e=>e==="sequential"||e==="parallel"||e==="loop";function oN(e,t){const n=e.agentType??"llm";return kfe(n)||n==="llm"&&(t.length===0||e.subAgents.length>0)}function lN(e,t=[],n="horizontal",s=!1){const i=e.agentType??"llm";if(!oN(e,t))return{width:iN,height:rN};if(s&&e.subAgents.length===0)return{width:mw,height:Qp};const r=e.subAgents.map((f,h)=>lN(f,[...t,h],n,s)),a=r.length?Math.max(...r.map(f=>f.width)):0,l=r.length?Math.max(...r.map(f=>f.height)):0,c=r.length&&i!=="parallel"?m7:Fd,u=n==="horizontal"?i!=="parallel":i==="parallel",d=r.length?i==="parallel"?Sfe+wM:i==="loop"?Nfe:0:wM;return u?{width:Math.max(mw,r.reduce((f,h)=>f+h.width,0)+aN*Math.max(0,r.length-1)+c*2),height:Qp+Fd+l+d+Fd}:{width:Math.max(mw,a+Fd*2),height:Qp+c+r.reduce((f,h)=>f+h.height,0)+aN*Math.max(0,r.length-1)+d+c}}function Wh(e){return e.length===0?"agent-root":`agent-${e.join("-")}`}function Afe(e,t){return e.length===t.length&&e.every((n,s)=>n===t[s])}function _M(e){const t=n=>[n.agentType??"llm",n.subAgents.map(t)];return JSON.stringify(t(e))}function Xh(e,t,n,s){const i=(s==null?void 0:s.tone)==="sequential"?"hsl(213 40% 40%)":(s==null?void 0:s.tone)==="loop"?"hsl(151 34% 34%)":"hsl(220 9% 38%)";return{id:`${e}-${t}${s!=null&&s.loop?"-loop":""}`,source:e,target:t,sourceHandle:s!=null&&s.loop?"loop-source":void 0,targetHandle:s!=null&&s.loop?"loop-target":void 0,label:n,type:"insertStep",data:s?{insert:s.insert,loop:s.loop,tone:s.tone}:void 0,animated:s==null?void 0:s.loop,markerEnd:{type:If.ArrowClosed,width:16,height:16,color:i},style:{stroke:i,strokeWidth:1.5},labelStyle:{fill:"hsl(215 14% 42%)",fontSize:10,fontWeight:600},labelBgStyle:{fill:"hsl(var(--background))",fillOpacity:.92}}}function SM(e,t,n=!1){const s=[{id:"terminal-input",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"用户请求"},selectable:!1,draggable:!1},{id:"terminal-output",type:"terminal",position:{x:0,y:0},data:{kind:"terminal",title:"最终回复"},selectable:!1,draggable:!1}],i=[];function r(d,f,h,p,m){const b=d.agentType??"llm",v=Wh(f);return oN(d,f)?(a(d,f,h,p,m),v):(s.push({id:v,type:"agent",parentId:h,extent:"parent",position:p,data:{kind:"agent",path:f,agent:d,title:b==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:b,description:d.description.trim()||vp[b].description,childCount:d.subAgents.length,containedIn:m}}),v)}function a(d,f,h,p={x:0,y:0},m){const b=d.agentType??"sequential",v=Wh(f),y=lN(d,f,t,n);s.push({id:v,type:"group",parentId:h,extent:h?"parent":void 0,position:p,style:{width:y.width,height:y.height},data:{kind:"agent",path:f,agent:d,title:d.name.trim()||(f.length===0?"主 Agent":vp[b].label),pattern:b,description:d.description.trim()||vp[b].description,childCount:d.subAgents.length,containedIn:m,layoutWidth:y.width,layoutHeight:y.height,compactEmptyGroup:n&&d.subAgents.length===0}});const x=d.subAgents.map((T,k)=>lN(T,[...f,k],t,n)),E=x.length&&b!=="parallel"?m7:Fd,w=t==="horizontal"?b!=="parallel":b==="parallel";let S=E;const _=d.subAgents.map((T,k)=>{const A=x[k],j=w?{x:S,y:Qp+Fd}:{x:(y.width-A.width)/2,y:Qp+S};return S+=(w?A.width:A.height)+aN,r(T,[...f,k],v,j,b)});if(b==="sequential"||b==="loop"){for(let T=0;T<_.length-1;T+=1)i.push(Xh(_[T],_[T+1],"然后",{tone:b,insert:{parentPath:f,index:T+1}}));b==="loop"&&_.length>1&&i.push(Xh(_[_.length-1],_[0],"继续循环",{loop:!0,tone:"loop"}))}return v}const l=(d,f)=>{const h=d.agentType??"llm",p=Wh(f);if(oN(d,f))return a(d,f),[p];if(s.push({id:p,type:"agent",position:{x:0,y:0},data:{kind:"agent",path:f,agent:d,title:h==="a2a"?"远程智能体":d.name.trim()||(f.length===0?"主 Agent":"未命名步骤"),pattern:h,description:d.description.trim()||vp[h].description,childCount:d.subAgents.length}}),d.subAgents.length===0)return[p];const m=[];return d.subAgents.forEach((b,v)=>{const y=[...f,v],x=Wh(y);i.push(Xh(p,x,"调用",{insert:{parentPath:f,index:v}})),m.push(...l(b,y))}),m},c=Wh([]),u=l(e,[]);return i.push(Xh("terminal-input",c)),u.forEach(d=>i.push(Xh(d,"terminal-output"))),Cfe(s,i,t)}function Cfe(e,t,n){const s=new xM.graphlib.Graph().setDefaultEdgeLabel(()=>({}));s.setGraph({rankdir:n==="vertical"?"TB":"LR",ranksep:50,nodesep:34,edgesep:14,marginx:24,marginy:24});const i=new Set(e.filter(r=>!r.parentId).map(r=>r.id));return e.filter(r=>!r.parentId).forEach(r=>{const a=r.data.kind==="terminal";s.setNode(r.id,{width:a?EM:r.data.layoutWidth??iN,height:a?vM:r.data.layoutHeight??rN})}),t.filter(r=>i.has(r.source)&&i.has(r.target)).forEach(r=>s.setEdge(r.source,r.target)),xM.layout(s),{nodes:e.map(r=>{if(r.parentId)return r;const a=s.node(r.id),l=r.data.kind==="terminal",c=l?EM:r.data.layoutWidth??iN,u=l?vM:r.data.layoutHeight??rN;return{...r,position:{x:a.x-c/2,y:a.y-u/2}}}),edges:t}}const zx=g.createContext(null),Vx=g.createContext("horizontal");function Ife({id:e,sourceX:t,sourceY:n,targetX:s,targetY:i,sourcePosition:r,targetPosition:a,markerEnd:l,style:c,label:u,data:d}){const f=g.useContext(zx),[h,p]=g.useState(!1),[m,b,v]=x1({sourceX:t,sourceY:n,targetX:s,targetY:i,sourcePosition:r,targetPosition:a,offset:d!=null&&d.loop?28:20});return o.jsxs(o.Fragment,{children:[o.jsx(kg,{id:e,path:m,markerEnd:l,style:c}),f&&(d==null?void 0:d.insert)&&o.jsx("path",{d:m,className:"abc-edge-hover-path",onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1)}),(u||f&&(d==null?void 0:d.insert))&&o.jsx(Nce,{children:o.jsxs("div",{className:`abc-edge-tools${f&&(d!=null&&d.insert)?" can-insert":""}${h?" is-visible":""}`,style:{transform:`translate(-50%, -50%) translate(${b}px, ${v}px)`},onPointerEnter:()=>p(!0),onPointerLeave:()=>p(!1),children:[u&&o.jsx("span",{className:"abc-edge-label",children:u}),f&&(d==null?void 0:d.insert)&&o.jsx("button",{type:"button",className:"abc-edge-add nodrag nopan","aria-label":"在这里插入步骤",title:"在这里插入步骤",onClick:y=>{y.stopPropagation(),f==null||f.onInsert(d.insert.parentPath,d.insert.index)},children:o.jsx(ji,{})})]})})]})}function jfe({data:e,selected:t}){const n=g.useContext(zx),s=g.useContext(Vx),i=s==="vertical"?Qe.Top:Qe.Left,r=s==="vertical"?Qe.Bottom:Qe.Right,a=s==="vertical"?Qe.Right:Qe.Bottom,l=e.pattern??"llm",c=vp[l],u=c.icon;return o.jsxs("div",{className:`abc-node is-${l}${e.containedIn?` is-contained-in-${e.containedIn}`:""}${t?" is-selected":""}`,children:[o.jsx(Bi,{type:"target",position:i,className:"abc-handle"}),l!=="llm"&&o.jsx("span",{className:"abc-node-icon",children:o.jsx(u,{})}),o.jsxs("span",{className:"abc-node-copy",children:[o.jsx("span",{className:"abc-node-meta",children:o.jsx("span",{children:c.label})}),o.jsx("strong",{children:e.title}),o.jsx("small",{children:e.description})]}),n&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:d=>{d.stopPropagation(),n==null||n.onDelete(e.path)},children:o.jsx(dc,{})}),o.jsx(Bi,{type:"source",position:r,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Bi,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Bi,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Rfe({data:e,selected:t}){const n=g.useContext(zx),s=g.useContext(Vx),i=s==="vertical"?Qe.Top:Qe.Left,r=s==="vertical"?Qe.Bottom:Qe.Right,a=s==="vertical"?Qe.Right:Qe.Bottom,l=e.pattern??"sequential",c=e.childCount??0,u=l==="llm"?"添加子 Agent":l==="parallel"?"添加一个同时处理的步骤":l==="loop"?"添加循环步骤":"添加下一个步骤";return o.jsxs("div",{className:`abc-group is-${l}${e.compactEmptyGroup?" is-compact-empty":""}${t?" is-selected":""}`,children:[o.jsx(Bi,{type:"target",position:i,className:"abc-handle"}),o.jsx("header",{className:"abc-group-head",children:o.jsxs("span",{children:[o.jsx("strong",{title:e.title,children:e.title}),o.jsx("small",{children:e.description})]})}),n&&e.path!==void 0&&c>0&&l!=="parallel"&&o.jsxs("div",{className:"abc-group-boundary-actions",children:[o.jsx("button",{type:"button",className:"abc-group-boundary-add is-start nodrag nopan","aria-label":"添加到最前",title:"添加到最前",onClick:d=>{d.stopPropagation(),n.onInsert(e.path,0)},children:o.jsx(ji,{})}),o.jsx("button",{type:"button",className:"abc-group-boundary-add is-end nodrag nopan","aria-label":"添加到最后",title:"添加到最后",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:o.jsx(ji,{})})]}),n&&e.path!==void 0&&c>0&&l==="parallel"&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-bottom nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(ji,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&c===0&&o.jsxs("button",{type:"button",className:"abc-group-add abc-group-add-empty nodrag nopan",onClick:d=>{d.stopPropagation(),n.onAdd(e.path)},children:[o.jsx(ji,{}),o.jsx("span",{children:u})]}),n&&e.path!==void 0&&e.path.length>0&&o.jsx("button",{type:"button",className:"abc-node-delete nodrag nopan","aria-label":`删除 ${e.title}`,title:"删除节点",onClick:d=>{d.stopPropagation(),n==null||n.onDelete(e.path)},children:o.jsx(dc,{})}),o.jsx(Bi,{type:"source",position:r,className:"abc-handle"}),e.containedIn==="loop"&&o.jsxs(o.Fragment,{children:[o.jsx(Bi,{id:"loop-target",type:"target",position:a,className:"abc-handle abc-loop-handle"}),o.jsx(Bi,{id:"loop-source",type:"source",position:a,className:"abc-handle abc-loop-handle"})]})]})}function Ofe({data:e}){const t=g.useContext(Vx);return o.jsxs("div",{className:"abc-terminal",children:[o.jsx(Bi,{type:"target",position:t==="vertical"?Qe.Top:Qe.Left,className:"abc-handle"}),o.jsx("span",{children:e.title}),o.jsx(Bi,{type:"source",position:t==="vertical"?Qe.Bottom:Qe.Right,className:"abc-handle"})]})}const Mfe={agent:jfe,group:Rfe,terminal:Ofe},Lfe={insertStep:Ife};function Dfe({draft:e,selectedPath:t,onSelect:n,onAdd:s,onInsert:i,onDelete:r,readOnly:a=!1,interactivePreview:l=!1,direction:c="horizontal"}){const u=g.useMemo(()=>SM(e,c,a),[]),[d,f,h]=DU(u.nodes),[p,m,b]=PU(u.edges),v=kce(),y=g.useRef(`${c}:${a?"readonly":"editable"}:${_M(e)}`),x=g.useRef(null),{fitView:E}=Ux(),w=g.useMemo(()=>SM(e,c,a),[c,e,a]),[S,_]=g.useState(()=>window.matchMedia("(max-width: 860px)").matches),T=g.useMemo(()=>a?{padding:.16,minZoom:.05,maxZoom:.9}:S?{padding:.08,minZoom:.35,maxZoom:.9}:{padding:.14,minZoom:.42,maxZoom:1.1},[S,a]),k=g.useCallback((j=0)=>{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{const R=x.current;if(R&&(R.clientWidth===0||R.clientHeight===0)&&j<8){k(j+1);return}E(T)})})},[T,E]);g.useEffect(()=>{const j=window.matchMedia("(max-width: 860px)"),R=B=>_(B.matches);return j.addEventListener("change",R),()=>j.removeEventListener("change",R)},[]),g.useEffect(()=>{const j=`${c}:${a?"readonly":"editable"}:${_M(e)}`,R=j!==y.current;y.current=j,m(w.edges),f(B=>{const z=new Map(B.map(L=>[L.id,L]));return w.nodes.map(L=>{const F=z.get(L.id);return{...L,measured:!R&&F&&F.type===L.type?F.measured:void 0,position:!R&&F?F.position:L.position,selected:L.data.kind==="agent"&&!!L.data.path&&Afe(L.data.path,t)}})}),R&&k()},[w,e,k,t,m,f]),g.useEffect(()=>{k()},[S,k]),g.useEffect(()=>{v&&k()},[w,k,v]),g.useEffect(()=>{if(!a||!x.current)return;const j=new ResizeObserver(()=>k());return j.observe(x.current),k(),()=>j.disconnect()},[k,a]);const A=g.useMemo(()=>a?null:{onAdd:s,onInsert:i,onDelete:r},[s,r,i,a]);return o.jsx(Vx.Provider,{value:c,children:o.jsx(zx.Provider,{value:A,children:o.jsx("section",{className:`abc-root is-${c}${a?" is-readonly":""}`,"aria-label":a?"只读 Agent 执行画布":"Agent 执行画布",children:o.jsx("div",{ref:x,className:"abc-canvas",children:o.jsxs(LU,{nodes:d,edges:p,nodeTypes:Mfe,edgeTypes:Lfe,onNodesChange:h,onEdgesChange:b,onNodeClick:(j,R)=>{!a&&R.data.kind==="agent"&&R.data.path&&n(R.data.path)},nodesDraggable:!a,nodesConnectable:!1,nodesFocusable:!a,elementsSelectable:!a,edgesFocusable:!1,edgesReconnectable:!1,panOnDrag:!a||l,zoomOnDoubleClick:l,zoomOnPinch:!a||l,zoomOnScroll:!a||l,fitView:!0,fitViewOptions:T,onInit:()=>k(),minZoom:a?.05:.35,maxZoom:1.6,proOptions:{hideAttribution:!0},children:[o.jsx(UU,{gap:20,size:1.2,color:"hsl(34 20% 82%)"}),(!a||l)&&o.jsx($U,{showInteractive:!1}),Tfe]})})})})})}function zm(e){return o.jsx(L2,{children:o.jsx(Dfe,{...e})})}const Pfe="https://ark.cn-beijing.volces.com/api/v3/",iy=[{key:"MODEL_EMBEDDING_NAME",required:!1,placeholder:"doubao-embedding-vision-250615",comment:"向量化模型(记忆/知识库需要)"},{key:"MODEL_EMBEDDING_DIM",required:!1,placeholder:"2048"},{key:"MODEL_EMBEDDING_API_BASE",required:!1,placeholder:Pfe}],Vm=[],NM={label:"控制台",url:"https://console.volcengine.com/vikingdb/openviking"},Bfe={label:"文档",url:"https://github.com/volcengine/OpenViking/blob/main/docs/zh/api/05-sessions.md"},Ufe="https://api.vikingdb.cn-beijing.volces.com/openviking",Ffe=`{ "self": {"enabled": true}, "peer": {"enabled": true}, "working_memory": {"enabled": true}, "memory_types": null -}`,$fe=[{key:"DATABASE_VIKING_PROJECT",required:!1,placeholder:"default"},{key:"DATABASE_VIKING_REGION",required:!1},{key:"DATABASE_VIKING_COLLECTION_KIND",required:!1},{key:"DATABASE_VIKING_RESOURCE_ID",required:!1}],em=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],ja={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},p7=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:ja.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:ja.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:ja.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],ju=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:qp},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:qp},{id:"link_reader",label:"网页读取",desc:"抓取并阅读给定链接的正文内容。",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",label:"网页爬取",desc:"结构化爬取网页(需要 Scraper 服务)。",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",label:"图像生成",desc:"文生图(Doubao Seedream)。",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",label:"图像编辑",desc:"图生图 / 编辑(Doubao SeedEdit)。",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",label:"视频生成",desc:"文/图生视频(Doubao Seedance),含任务查询。",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",label:"语音合成 (TTS)",desc:"把文本转成语音(火山语音)。",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"run_code",label:"代码执行",desc:"在沙箱中执行代码",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",comment:"代码执行沙箱 ID"},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",comment:"AgentKit Tools 地域"}]},{id:"vesearch",label:"VeSearch 智能搜索",desc:"火山 VeSearch(需要 bot 端点)。",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],Hfe=new Set(["web_scraper","text_to_speech","vesearch"]),g7=ju.filter(e=>!Hfe.has(e.id)),cN=[{id:"local",label:"本地内存",desc:"进程内,不持久化。适合开发调试。",env:[]},{id:"sqlite",label:"SQLite 文件",desc:"持久化到本地 .db 文件。",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",label:"MySQL",desc:"持久化到 MySQL。",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",label:"PostgreSQL",desc:"持久化到 PostgreSQL。",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],uN=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:sy,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...sy],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",label:"Redis",desc:"Redis 向量检索。",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...sy],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"VikingDB 记忆库(支持用户画像)。",env:qp},{id:"openviking",label:"OpenViking Memory",desc:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:Ufe,comment:"OpenViking 服务地址",link:SM},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:SM},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:Ffe,comment:"记忆策略",multiline:!0,format:"json",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。",link:Bfe}]},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],xu="viking",dN=[{id:"viking",label:"VikingDB Knowledge",desc:"VikingDB 知识库。",env:$fe},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...sy],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...qp,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],zfe=[{id:"apmplus",label:"APMPlus",desc:"火山 APMPlus 应用性能监控。",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",label:"CozeLoop",desc:"扣子 CozeLoop 链路观测。",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",label:"TLS (日志服务)",desc:"火山 TLS 日志服务导出。",enableFlag:"ENABLE_TLS",env:[...qp,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],Vfe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Gfe=`你是一个专业、可靠的智能助手。 +}`,$fe=[{key:"DATABASE_VIKING_PROJECT",required:!1,placeholder:"default"},{key:"DATABASE_VIKING_REGION",required:!1},{key:"DATABASE_VIKING_COLLECTION_KIND",required:!1},{key:"DATABASE_VIKING_RESOURCE_ID",required:!1}],Qh=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],Da={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},g7=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请选择智能体中心",comment:"AgentKit 智能体中心"},{key:"REGISTRY_TOP_K",required:!1,placeholder:Da.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:Da.region,comment:"AgentKit 智能体中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:Da.endpoint,comment:"AgentKit 智能体中心 OpenAPI 地址"}],Ou=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:Vm},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:Vm},{id:"link_reader",label:"网页读取",desc:"抓取并阅读给定链接的正文内容。",importLine:"from veadk.tools.builtin_tools.link_reader import link_reader",toolNames:["link_reader"],env:[]},{id:"web_scraper",label:"网页爬取",desc:"结构化爬取网页(需要 Scraper 服务)。",importLine:"from veadk.tools.builtin_tools.web_scraper import web_scraper",toolNames:["web_scraper"],env:[{key:"TOOL_WEB_SCRAPER_ENDPOINT",required:!0},{key:"TOOL_WEB_SCRAPER_API_KEY",required:!0}]},{id:"image_generate",label:"图像生成",desc:"文生图(Doubao Seedream)。",importLine:"from veadk.tools.builtin_tools.image_generate import image_generate",toolNames:["image_generate"],env:[{key:"MODEL_IMAGE_NAME",required:!1,placeholder:"doubao-seedream-5-0-260128"}]},{id:"image_edit",label:"图像编辑",desc:"图生图 / 编辑(Doubao SeedEdit)。",importLine:"from veadk.tools.builtin_tools.image_edit import image_edit",toolNames:["image_edit"],env:[{key:"MODEL_EDIT_NAME",required:!1,placeholder:"doubao-seededit-3-0-i2i-250628"}]},{id:"video_generate",label:"视频生成",desc:"文/图生视频(Doubao Seedance),含任务查询。",importLine:"from veadk.tools.builtin_tools.video_generate import video_generate, video_task_query",toolNames:["video_generate","video_task_query"],env:[{key:"MODEL_VIDEO_NAME",required:!1,placeholder:"doubao-seedance-2-0-260128"}]},{id:"text_to_speech",label:"语音合成 (TTS)",desc:"把文本转成语音(火山语音)。",importLine:"from veadk.tools.builtin_tools.tts import text_to_speech",toolNames:["text_to_speech"],env:[{key:"TOOL_VESPEECH_APP_ID",required:!0},{key:"TOOL_VESPEECH_SPEAKER",required:!1,placeholder:"zh_female_vv_uranus_bigtts"}]},{id:"run_code",label:"代码执行",desc:"在沙箱中执行代码",importLine:"from veadk.tools.builtin_tools.run_code import run_code",toolNames:["run_code"],env:[{key:"AGENTKIT_TOOL_ID",required:!0,placeholder:"t-xxxx",comment:"代码执行沙箱 ID"},{key:"AGENTKIT_TOOL_REGION",required:!1,placeholder:"cn-beijing",comment:"AgentKit Tools 地域"}]},{id:"vesearch",label:"VeSearch 智能搜索",desc:"火山 VeSearch(需要 bot 端点)。",importLine:"from veadk.tools.builtin_tools.vesearch import vesearch",toolNames:["vesearch"],env:[{key:"TOOL_VESEARCH_ENDPOINT",required:!0,comment:"VeSearch bot_id"}]}],Hfe=new Set(["web_scraper","text_to_speech","vesearch"]),b7=Ou.filter(e=>!Hfe.has(e.id)),cN=[{id:"local",label:"本地内存",desc:"进程内,不持久化。适合开发调试。",env:[]},{id:"sqlite",label:"SQLite 文件",desc:"持久化到本地 .db 文件。",extraArgs:'local_database_path="./short_term_memory.db"',env:[]},{id:"mysql",label:"MySQL",desc:"持久化到 MySQL。",env:[{key:"DATABASE_MYSQL_HOST",required:!0},{key:"DATABASE_MYSQL_USER",required:!0},{key:"DATABASE_MYSQL_PASSWORD",required:!0},{key:"DATABASE_MYSQL_DATABASE",required:!0}]},{id:"postgresql",label:"PostgreSQL",desc:"持久化到 PostgreSQL。",env:[{key:"DATABASE_POSTGRESQL_HOST",required:!0},{key:"DATABASE_POSTGRESQL_PORT",required:!1,placeholder:"5432"},{key:"DATABASE_POSTGRESQL_USER",required:!0},{key:"DATABASE_POSTGRESQL_PASSWORD",required:!0},{key:"DATABASE_POSTGRESQL_DATABASE",required:!0}]}],uN=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:iy,pipExtra:"extensions",needsEmbedding:!0},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...iy],pipExtra:"extensions",needsEmbedding:!0},{id:"redis",label:"Redis",desc:"Redis 向量检索。",env:[{key:"DATABASE_REDIS_HOST",required:!0},{key:"DATABASE_REDIS_PORT",required:!1,placeholder:"6379"},{key:"DATABASE_REDIS_PASSWORD",required:!1},...iy],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"VikingDB 记忆库(支持用户画像)。",env:Vm},{id:"openviking",label:"OpenViking Memory",desc:"OpenViking 长期记忆,按用户维度保存和检索偏好、事件与实体。",env:[{key:"DATABASE_OPENVIKING_URL",required:!0,placeholder:Ufe,comment:"OpenViking 服务地址",link:NM},{key:"DATABASE_OPENVIKING_API_KEY",required:!0,comment:"OpenViking API Key",link:NM},{key:"DATABASE_OPENVIKING_USER_ID",required:!1,placeholder:"default",comment:"记忆归属 ID",help:"对应 viking://user/<此值>/peers/<请求用户>/memories 中的 user 段;用于隔离 Agent、租户或业务场景,默认 default。"},{key:"DATABASE_OPENVIKING_MEMORY_POLICY",required:!1,placeholder:Ffe,comment:"记忆策略",multiline:!0,format:"json",help:"记忆的抽取策略和隔离策略,不填写时使用官方默认策略。",link:Bfe}]},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}],pipExtra:"database"}],vu="viking",dN=[{id:"viking",label:"VikingDB Knowledge",desc:"VikingDB 知识库。",env:$fe},{id:"opensearch",label:"OpenSearch",desc:"OpenSearch 向量检索。",env:[{key:"DATABASE_OPENSEARCH_HOST",required:!0},{key:"DATABASE_OPENSEARCH_PORT",required:!1,placeholder:"9200"},{key:"DATABASE_OPENSEARCH_USERNAME",required:!0},{key:"DATABASE_OPENSEARCH_PASSWORD",required:!0},...iy],pipExtra:"extensions",needsEmbedding:!0},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...Vm,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],zfe=[{id:"apmplus",label:"APMPlus",desc:"火山 APMPlus 应用性能监控。",enableFlag:"ENABLE_APMPLUS",env:[{key:"OBSERVABILITY_OPENTELEMETRY_APMPLUS_SERVICE_NAME",required:!1}]},{id:"cozeloop",label:"CozeLoop",desc:"扣子 CozeLoop 链路观测。",enableFlag:"ENABLE_COZELOOP",env:[{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_API_KEY",required:!0},{key:"OBSERVABILITY_OPENTELEMETRY_COZELOOP_SERVICE_NAME",required:!1,comment:"CozeLoop space_id"}]},{id:"tls",label:"TLS (日志服务)",desc:"火山 TLS 日志服务导出。",enableFlag:"ENABLE_TLS",env:[...Vm,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],Vfe="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",Gfe=`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Ai(e="volcengine"){return{name:"",description:Vfe,instruction:Gfe,agentType:"llm",cloudProvider:e,maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],a2aRegistry:{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},modelName:s1(e),modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:xu,knowledgebaseIndex:"",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}async function Rg(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Bn(void 0,pc)});if(t.status===409)throw new Error("服务端未配置云厂商 AK/SK,无法访问 AgentKit Skills 中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit Skills 中心");if(t.status===404)throw new Error("技能不存在或无 SKILL.md 内容");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function b7(){return(await Rg("/web/skill-spaces?region=all")).items||[]}async function Kfe(e){const t=new URLSearchParams({region:e.region,page:String(e.page),page_size:String(e.pageSize)});return e.project&&t.set("project",e.project),Rg(`/web/skill-spaces?${t.toString()}`)}async function y7(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await Rg(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}async function qfe(e,t){const n=new URLSearchParams({region:t.region,page:String(t.page),page_size:String(t.pageSize)});return t.project&&n.set("project",t.project),Rg(`/web/skill-spaces/${encodeURIComponent(e)}/skills?${n.toString()}`)}async function Yfe(e,t,n,s,i){const r=[];n&&r.push(`version=${encodeURIComponent(n)}`),s&&r.push(`region=${encodeURIComponent(s)}`),i&&r.push(`project=${encodeURIComponent(i)}`);const a=r.length>0?`?${r.join("&")}`:"";return Rg(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function Wfe(e,t){return{source:"skillspace",id:`ss:${e.id}/${t.skillId}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:t.skillId,version:t.version}}function Xfe(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function NM({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}const Qfe={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function fN(e){const t=ju.find(n=>n.id===e||n.toolNames.includes(e));return Qfe[e]??(t==null?void 0:t.label)??e}function TM(e){const t=ju.find(s=>s.id===e||s.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function Zfe(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Jfe(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function kM(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function x7({title:e,description:t,icon:n,wide:s=!1,onClose:i,children:r}){const a=g.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return g.useEffect(()=>{const l=document.body.style.overflow;document.body.style.overflow="hidden";const c=u=>{u.key==="Escape"&&i()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=l}},[i]),yi.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:i}),o.jsxs("section",{className:`session-capability-dialog${s?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:i,children:o.jsx(Zfe,{})})]}),r]})]}),document.body)}function iy({value:e,placeholder:t,label:n,onChange:s,autoFocus:i=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(Jfe,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:i,onChange:r=>s(r.target.value)})]})}function ehe({agentName:e,tools:t,selectedNames:n,mutating:s,onAdd:i,onClose:r}){const[a,l]=g.useState(""),[c,u]=g.useState(""),d=g.useMemo(()=>new Set(n),[n]),f=g.useMemo(()=>{const m=a.trim().toLowerCase();return t.filter(p=>m?`${fN(p)} ${p} ${TM(p)}`.toLowerCase().includes(m):!0)},[a,t]),h=async m=>{u(m);const p=await i({kind:"tool",name:m});u(""),p&&r()};return o.jsx(x7,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(NM,{}),onClose:r,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(iy,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(m=>{const p=d.has(m),b=c===m;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(NM,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:fN(m)}),o.jsx("code",{children:m}),o.jsx("span",{children:TM(m)})]}),o.jsx("button",{type:"button",disabled:p||s||!!c,onClick:()=>void h(m),children:p?"已添加":b?"添加中…":"添加"})]},m)})})]})})}function the({appName:e,agentName:t,selectedNames:n,mutating:s,onAdd:i,onClose:r}){const[a,l]=g.useState("public"),[c,u]=g.useState(""),[d,f]=g.useState([]),[h,m]=g.useState(0),[p,b]=g.useState(!0),[v,y]=g.useState(""),[x,E]=g.useState([]),[w,S]=g.useState(null),[_,k]=g.useState([]),[T,A]=g.useState(""),[j,R]=g.useState(""),[B,z]=g.useState(!0),[L,F]=g.useState(!1),[C,I]=g.useState(""),[D,$]=g.useState(""),O=g.useMemo(()=>new Set(n),[n]);g.useEffect(()=>{if(a!=="public")return;let ee=!0;const V=window.setTimeout(()=>{b(!0),y(""),x8(e,c.trim()).then(X=>{ee&&(f(X.items),m(X.totalCount))}).catch(X=>{ee&&(f([]),m(0),y(X instanceof Error?X.message:"搜索 Skill Hub 失败"))}).finally(()=>{ee&&b(!1)})},250);return()=>{ee=!1,window.clearTimeout(V)}},[e,c,a]),g.useEffect(()=>{if(a!=="agentkit")return;let ee=!0;return z(!0),I(""),b7().then(V=>{ee&&(E(V),S(V[0]??null))}).catch(V=>{ee&&I(V instanceof Error?V.message:"读取 Skill Space 失败")}).finally(()=>{ee&&z(!1)}),()=>{ee=!1}},[a]),g.useEffect(()=>{if(a!=="agentkit")return;if(!w){k([]);return}let ee=!0;return F(!0),I(""),y7(w.id,w.region).then(V=>{ee&&k(V)}).catch(V=>{ee&&I(V instanceof Error?V.message:"读取技能失败")}).finally(()=>{ee&&F(!1)}),()=>{ee=!1}},[w,a]);const te=g.useMemo(()=>{const ee=T.trim().toLowerCase();return ee?x.filter(V=>`${V.name} ${V.id} ${V.description}`.toLowerCase().includes(ee)):x},[T,x]),ne=g.useMemo(()=>{const ee=j.trim().toLowerCase();return ee?_.filter(V=>`${V.skillName} ${V.skillDescription}`.toLowerCase().includes(ee)):_},[j,_]),P=async ee=>{if(!w)return;$(ee.skillId);const V=await i({kind:"skill",name:ee.skillName,skillSourceId:w.id,description:ee.skillDescription,version:ee.version});$(""),V&&r()},Q=async ee=>{$(ee.slug);const V=await i({kind:"skill",name:ee.name,skillSourceId:`findskill:${ee.slug}`,description:ee.description,version:ee.version||ee.updatedAt});$(""),V&&r()};return o.jsx(x7,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:r,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(iy,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:v?o.jsx("div",{className:"session-capability-error",children:v}):p?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(ee=>{const V=O.has(ee.name),X=D===ee.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:ee.name}),o.jsx("span",{children:ee.description||"暂无描述"}),o.jsxs("small",{children:[ee.sourceRepo||ee.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),ee.downloadCount.toLocaleString()," 次下载",ee.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),ee.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:V||s||!!D,onClick:()=>void Q(ee),children:V?"已添加":X?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(kM,{}),"添加"]})})]},ee.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:x.length})]}),o.jsx(iy,{value:T,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:A,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:B?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):te.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):te.map(ee=>o.jsx("button",{type:"button",className:`session-skill-space${(w==null?void 0:w.id)===ee.id?" is-active":""}`,onClick:()=>{S(ee),R("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:ee.name||ee.id}),o.jsx("small",{children:ee.description||ee.id}),o.jsxs("em",{children:[ee.skillCount??0," 个技能"]})]})},`${ee.projectName??"default"}:${ee.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:w==null?void 0:w.name,children:(w==null?void 0:w.name)||"选择 Skill Space"}),o.jsx("span",{children:_.length})]}),o.jsx(iy,{value:j,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:R})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):w?L?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):ne.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):ne.map(ee=>{const V=O.has(ee.skillName),X=D===ee.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:ee.skillName}),o.jsx("span",{children:ee.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",ee.version||"—"]})]}),o.jsx("button",{type:"button",disabled:V||s||!!D,onClick:()=>void P(ee),children:V?"已添加":X?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(kM,{}),"添加"]})})]},`${ee.skillId}:${ee.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function Ra({as:e="span",className:t="",duration:n=4,spread:s=20,children:i,style:r,...a}){const l=Math.min(Math.max(s,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...r,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:i})}function E7(e){return 1+e.children.reduce((t,n)=>t+E7(n),0)}function v7(e){return e.id||e.name}function nhe(e,t){const n=v7(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const s=/^agent_sub_(\d+)$/.exec(n);return s?`子 Agent ${s[1]}`:e.name||n}function w7(e,t=!0){return{...e,id:v7(e),name:nhe(e,t),children:e.children.map(n=>w7(n,!1))}}function _7(e){const t=Ai();return{...t,name:e.name,description:e.description,instruction:e.instruction||t.instruction,agentType:e.type,modelName:e.model,tools:e.tools??[],skills:(e.skills??[]).map(n=>n.name),subAgents:e.children.map(_7)}}function she(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function ihe(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function gw({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function rhe({appName:e,info:t,loading:n,variant:s="rail",capabilities:i=null,capabilityLoading:r=!1,capabilityMutating:a=!1,builtinTools:l=[],onAddCapability:c,onRemoveCapability:u}){const[d,f]=g.useState(null),[h,m]=g.useState(!1),p=g.useRef(null),b=()=>{m(!1),window.requestAnimationFrame(()=>{var _;return(_=p.current)==null?void 0:_.focus()})};if(g.useEffect(()=>{if(!h)return;const _=document.body.style.overflow,k=T=>{T.key==="Escape"&&b()};return document.body.style.overflow="hidden",document.addEventListener("keydown",k),()=>{document.body.style.overflow=_,document.removeEventListener("keydown",k)}},[h]),n&&!t)return o.jsx("aside",{className:`topo is-loading${s==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(Ra,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const v=w7(t.graph??{id:t.name,name:t.name,description:t.description,type:t.type??"llm",model:t.model,tools:t.tools,skills:t.skills,path:[t.name],mentionable:!1,children:[]}),y=(i==null?void 0:i.tools)??she(t.tools).map(_=>({id:`base:tool:${_}`,kind:"tool",name:_,custom:!1})),x=(i==null?void 0:i.skills)??ihe(t.skills).map(_=>({id:`base:skill:${_.name}`,kind:"skill",name:_.name,description:_.description,custom:!1})),E=!!(i&&c&&u),w=_7(v),S=_=>o.jsx(Kp,{draft:w,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},_);return o.jsxs(o.Fragment,{children:[o.jsxs("aside",{className:`topo${s==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(gw,{title:"工具",count:y.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:y.length>0?o.jsx("div",{className:"topo-tool-list",children:y.map(_=>o.jsxs("div",{className:"topo-tool",title:_.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:fN(_.name)}),o.jsx("code",{children:_.name})]}),_.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),_.custom&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除工具 ${_.name}`,title:"移除",disabled:a,onClick:()=>u==null?void 0:u(_.id),children:"×"})]},_.id))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),E&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:r||a,onClick:()=>f("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(gw,{title:"技能",count:t.skillsPreviewSupported?x.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?x.length>0?o.jsx("div",{className:"topo-skill-list",children:x.map(_=>o.jsxs("div",{className:"topo-skill",title:_.description||_.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:_.name}),_.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),_.custom&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除技能 ${_.name}`,title:"移除",disabled:a,onClick:()=>u==null?void 0:u(_.id),children:"×"})]}),_.description&&o.jsx("span",{className:"topo-skill-description",children:_.description})]},`${_.name}:${_.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),E&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:r||a,onClick:()=>f("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 画布",children:[o.jsxs("div",{className:"topo-canvas-heading",children:[o.jsx(gw,{title:"结构拓扑",count:E7(v)}),o.jsx("button",{ref:p,type:"button",className:"topo-canvas-expand","aria-label":"全屏查看 Agent 画布",title:"全屏查看",onClick:()=>m(!0),children:o.jsx(eu,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-preview",role:"region","aria-label":"Agent 执行画布",children:S(`conversation-canvas:${e}`)})]})]}),d==="tool"&&c&&o.jsx(ehe,{agentName:t.name,tools:l,selectedNames:y.map(_=>_.name),mutating:a,onAdd:c,onClose:()=>f(null)}),d==="skill"&&c&&o.jsx(the,{appName:e,agentName:t.name,selectedNames:x.map(_=>_.name),mutating:a,onAdd:c,onClose:()=>f(null)})]}),h&&yi.createPortal(o.jsxs("section",{className:"topo-canvas-dialog",role:"dialog","aria-modal":"true","aria-label":"全屏 Agent 执行画布",children:[o.jsxs("header",{className:"topo-canvas-dialog-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Agent 执行画布"}),o.jsx("span",{children:t.name})]}),o.jsx("button",{type:"button","aria-label":"关闭全屏画布",title:"关闭",onClick:b,autoFocus:!0,children:o.jsx(Ri,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-dialog-body",children:S(`conversation-canvas-fullscreen:${e}`)})]}),document.body)]})}function sLe(){}function AM(e){const t=[],n=String(e||"");let s=n.indexOf(","),i=0,r=!1;for(;!r;){s===-1&&(s=n.length,r=!0);const a=n.slice(i,s).trim();(a||!r)&&t.push(a),i=s+1,s=n.indexOf(",",i)}return t}function S7(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ahe=/[$_\p{ID_Start}]/u,ohe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,lhe=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,che=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uhe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N7={};function iLe(e){return e?ahe.test(String.fromCodePoint(e)):!1}function rLe(e,t){const s=(t||N7).jsx?lhe:ohe;return e?s.test(String.fromCodePoint(e)):!1}function CM(e,t){return(N7.jsx?uhe:che).test(e)}const dhe=/[ \t\n\f\r]/g;function fhe(e){return typeof e=="object"?e.type==="text"?IM(e.value):!1:IM(e)}function IM(e){return e.replace(dhe,"")===""}let Og=class{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}};Og.prototype.normal={};Og.prototype.property={};Og.prototype.space=void 0;function T7(e,t){const n={},s={};for(const i of e)Object.assign(n,i.property),Object.assign(s,i.normal);return new Og(n,s,t)}function Yp(e){return e.toLowerCase()}class yr{constructor(t,n){this.attribute=n,this.property=t}}yr.prototype.attribute="";yr.prototype.booleanish=!1;yr.prototype.boolean=!1;yr.prototype.commaOrSpaceSeparated=!1;yr.prototype.commaSeparated=!1;yr.prototype.defined=!1;yr.prototype.mustUseProperty=!1;yr.prototype.number=!1;yr.prototype.overloadedBoolean=!1;yr.prototype.property="";yr.prototype.spaceSeparated=!1;yr.prototype.space=void 0;let hhe=0;const Dt=Ru(),Zs=Ru(),hN=Ru(),Pe=Ru(),Vn=Ru(),of=Ru(),_r=Ru();function Ru(){return 2**++hhe}const mN=Object.freeze(Object.defineProperty({__proto__:null,boolean:Dt,booleanish:Zs,commaOrSpaceSeparated:_r,commaSeparated:of,number:Pe,overloadedBoolean:hN,spaceSeparated:Vn},Symbol.toStringTag,{value:"Module"})),bw=Object.keys(mN);class $2 extends yr{constructor(t,n,s,i){let r=-1;if(super(t,n),jM(this,"space",i),typeof s=="number")for(;++r4&&n.slice(0,4)==="data"&&yhe.test(t)){if(t.charAt(4)==="-"){const r=t.slice(5).replace(RM,Ehe);s="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=t.slice(4);if(!RM.test(r)){let a=r.replace(bhe,xhe);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=$2}return new i(s,t)}function xhe(e){return"-"+e.toLowerCase()}function Ehe(e){return e.charAt(1).toUpperCase()}const Mg=T7([k7,mhe,I7,j7,R7],"html"),gc=T7([k7,phe,I7,j7,R7],"svg");function OM(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function O7(e){return e.join(" ").trim()}var H2={},MM=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,vhe=/\n/g,whe=/^\s*/,_he=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,She=/^:\s*/,Nhe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,The=/^[;\s]*/,khe=/^\s+|\s+$/g,Ahe=` -`,LM="/",DM="*",$c="",Che="comment",Ihe="declaration";function jhe(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,s=1;function i(p){var b=p.match(vhe);b&&(n+=b.length);var v=p.lastIndexOf(Ahe);s=~v?p.length-v:s+p.length}function r(){var p={line:n,column:s};return function(b){return b.position=new a(p),u(),b}}function a(p){this.start=p,this.end={line:n,column:s},this.source=t.source}a.prototype.content=e;function l(p){var b=new Error(t.source+":"+n+":"+s+": "+p);if(b.reason=p,b.filename=t.source,b.line=n,b.column=s,b.source=e,!t.silent)throw b}function c(p){var b=p.exec(e);if(b){var v=b[0];return i(v),e=e.slice(v.length),b}}function u(){c(whe)}function d(p){var b;for(p=p||[];b=f();)b!==!1&&p.push(b);return p}function f(){var p=r();if(!(LM!=e.charAt(0)||DM!=e.charAt(1))){for(var b=2;$c!=e.charAt(b)&&(DM!=e.charAt(b)||LM!=e.charAt(b+1));)++b;if(b+=2,$c===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return s+=2,i(v),e=e.slice(b),s+=2,p({type:Che,comment:v})}}function h(){var p=r(),b=c(_he);if(b){if(f(),!c(She))return l("property missing ':'");var v=c(Nhe),y=p({type:Ihe,property:PM(b[0].replace(MM,$c)),value:v?PM(v[0].replace(MM,$c)):$c});return c(The),y}}function m(){var p=[];d(p);for(var b;b=h();)b!==!1&&(p.push(b),d(p));return p}return u(),m()}function PM(e){return e?e.replace(khe,$c):$c}var Rhe=jhe,Ohe=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(H2,"__esModule",{value:!0});H2.default=Lhe;const Mhe=Ohe(Rhe);function Lhe(e,t){let n=null;if(!e||typeof e!="string")return n;const s=(0,Mhe.default)(e),i=typeof t=="function";return s.forEach(r=>{if(r.type!=="declaration")return;const{property:a,value:l}=r;i?t(a,l,r):l&&(n=n||{},n[a]=l)}),n}var Gx={};Object.defineProperty(Gx,"__esModule",{value:!0});Gx.camelCase=void 0;var Dhe=/^--[a-zA-Z0-9_-]+$/,Phe=/-([a-z])/g,Bhe=/^[^-]+$/,Uhe=/^-(webkit|moz|ms|o|khtml)-/,Fhe=/^-(ms)-/,$he=function(e){return!e||Bhe.test(e)||Dhe.test(e)},Hhe=function(e,t){return t.toUpperCase()},BM=function(e,t){return"".concat(t,"-")},zhe=function(e,t){return t===void 0&&(t={}),$he(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Fhe,BM):e=e.replace(Uhe,BM),e.replace(Phe,Hhe))};Gx.camelCase=zhe;var Vhe=Ll&&Ll.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ghe=Vhe(H2),Khe=Gx;function pN(e,t){var n={};return!e||typeof e!="string"||(0,Ghe.default)(e,function(s,i){s&&i&&(n[(0,Khe.camelCase)(s,t)]=i)}),n}pN.default=pN;var qhe=pN;const Yhe=qf(qhe),Kx=M7("end"),fo=M7("start");function M7(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function Whe(e){const t=fo(e),n=Kx(e);if(t&&n)return{start:t,end:n}}function tp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?UM(e.position):"start"in e||"end"in e?UM(e):"line"in e||"column"in e?gN(e):""}function gN(e){return FM(e&&e.line)+":"+FM(e&&e.column)}function UM(e){return gN(e&&e.start)+"-"+gN(e&&e.end)}function FM(e){return e&&typeof e=="number"?e:1}class zi extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let i="",r={},a=!1;if(n&&("line"in n&&"column"in n?r={place:n}:"start"in n&&"end"in n?r={place:n}:"type"in n?r={ancestors:[n],place:n.position}:r={...n}),typeof t=="string"?i=t:!r.cause&&t&&(a=!0,i=t.message,r.cause=t),!r.ruleId&&!r.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?r.ruleId=s:(r.source=s.slice(0,c),r.ruleId=s.slice(c+1))}if(!r.place&&r.ancestors&&r.ancestors){const c=r.ancestors[r.ancestors.length-1];c&&(r.place=c.position)}const l=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=tp(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=a&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zi.prototype.file="";zi.prototype.name="";zi.prototype.reason="";zi.prototype.message="";zi.prototype.stack="";zi.prototype.column=void 0;zi.prototype.line=void 0;zi.prototype.ancestors=void 0;zi.prototype.cause=void 0;zi.prototype.fatal=void 0;zi.prototype.place=void 0;zi.prototype.ruleId=void 0;zi.prototype.source=void 0;const z2={}.hasOwnProperty,Xhe=new Map,Qhe=/[A-Z]/g,Zhe=new Set(["table","tbody","thead","tfoot","tr"]),Jhe=new Set(["td","th"]),L7="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eme(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=lme(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=ome(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gc:Mg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},r=D7(i,e,void 0);return r&&typeof r!="string"?r:i.create(e,i.Fragment,{children:r||void 0},void 0)}function D7(e,t,n){if(t.type==="element")return tme(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return nme(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ime(e,t,n);if(t.type==="mdxjsEsm")return sme(e,t);if(t.type==="root")return rme(e,t,n);if(t.type==="text")return ame(e,t)}function tme(e,t,n){const s=e.schema;let i=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(i=gc,e.schema=i),e.ancestors.push(t);const r=B7(e,t.tagName,!1),a=cme(e,t);let l=G2(e,t);return Zhe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!fhe(c):!0})),P7(e,a,r,t),V2(a,l),e.ancestors.pop(),e.schema=s,e.create(t,r,a,n)}function nme(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Wp(e,t.position)}function sme(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Wp(e,t.position)}function ime(e,t,n){const s=e.schema;let i=s;t.name==="svg"&&s.space==="html"&&(i=gc,e.schema=i),e.ancestors.push(t);const r=t.name===null?e.Fragment:B7(e,t.name,!0),a=ume(e,t),l=G2(e,t);return P7(e,a,r,t),V2(a,l),e.ancestors.pop(),e.schema=s,e.create(t,r,a,n)}function rme(e,t,n){const s={};return V2(s,G2(e,t)),e.create(t,e.Fragment,s,n)}function ame(e,t){return t.value}function P7(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function V2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ome(e,t,n){return s;function s(i,r,a,l){const u=Array.isArray(a.children)?n:t;return l?u(r,a,l):u(r,a)}}function lme(e,t){return n;function n(s,i,r,a){const l=Array.isArray(r.children),c=fo(s);return t(i,r,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function cme(e,t){const n={};let s,i;for(i in t.properties)if(i!=="children"&&z2.call(t.properties,i)){const r=dme(e,i,t.properties[i]);if(r){const[a,l]=r;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Jhe.has(t.tagName)?s=l:n[a]=l}}if(s){const r=n.style||(n.style={});r[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function ume(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const r=s.data.estree.body[0];r.type;const a=r.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Wp(e,t.position);else{const i=s.name;let r;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const l=s.value.data.estree.body[0];l.type,r=e.evaluater.evaluateExpression(l.expression)}else Wp(e,t.position);else r=s.value===null?!0:s.value;n[i]=r}return n}function G2(e,t){const n=[];let s=-1;const i=e.passKeys?new Map:Xhe;for(;++si?0:i+t:t=t>i?i:t,n=n>0?n:0,s.length<1e4)a=Array.from(s),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);r0?(Dr(e,e.length,0,t),e):t}const zM={}.hasOwnProperty;function F7(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Oa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qi=bc(/[A-Za-z]/),$i=bc(/[\dA-Za-z]/),Eme=bc(/[#-'*+\--9=?A-Z^-~]/);function _1(e){return e!==null&&(e<32||e===127)}const bN=bc(/\d/),vme=bc(/[\dA-Fa-f]/),wme=bc(/[!-/:-@[-`{-~]/);function ht(e){return e!==null&&e<-2}function Fn(e){return e!==null&&(e<0||e===32)}function Qt(e){return e===-2||e===-1||e===32}const qx=bc(new RegExp("\\p{P}|\\p{S}","u")),Eu=bc(/\s/);function bc(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function fh(e){const t=[];let n=-1,s=0,i=0;for(;++n55295&&r<57344){const l=e.charCodeAt(n+1);r<56320&&l>56319&&l<57344?(a=String.fromCharCode(r,l),i=1):a="�"}else a=String.fromCharCode(r);a&&(t.push(e.slice(s,n),encodeURIComponent(a)),s=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(s)}function an(e,t,n,s){const i=s?s-1:Number.POSITIVE_INFINITY;let r=0;return a;function a(c){return Qt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Qt(c)&&r++a))return;const k=t.events.length;let T=k,A,j;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(A){j=t.events[T][1].end;break}A=!0}for(y(s),_=k;_E;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=E}function x(){i.write([null]),r=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kme(e,t,n){return an(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Uf(e){if(e===null||Fn(e)||Eu(e))return 1;if(qx(e))return 2}function Yx(e,t,n){const s=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[s][1].end},h={...e[n][1].start};GM(f,-c),GM(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[s][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},r={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[s][1].end={...a.start},e[n][1].start={...l.end},u=[],e[s][1].end.offset-e[s][1].start.offset&&(u=Xr(u,[["enter",e[s][1],t],["exit",e[s][1],t]])),u=Xr(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",r,t]]),u=Xr(u,Yx(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),u=Xr(u,[["exit",r,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=Xr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Dr(e,s-1,n-s+3,u),n=s+u.length-d-2;break}}for(n=-1;++n0&&Qt(_)?an(e,x,"linePrefix",r+1)(_):x(_)}function x(_){return _===null||ht(_)?e.check(KM,b,w)(_):(e.enter("codeFlowValue"),E(_))}function E(_){return _===null||ht(_)?(e.exit("codeFlowValue"),x(_)):(e.consume(_),E)}function w(_){return e.exit("codeFenced"),t(_)}function S(_,k,T){let A=0;return j;function j(F){return _.enter("lineEnding"),_.consume(F),_.exit("lineEnding"),R}function R(F){return _.enter("codeFencedFence"),Qt(F)?an(_,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):B(F)}function B(F){return F===l?(_.enter("codeFencedFenceSequence"),z(F)):T(F)}function z(F){return F===l?(A++,_.consume(F),z):A>=a?(_.exit("codeFencedFenceSequence"),Qt(F)?an(_,L,"whitespace")(F):L(F)):T(F)}function L(F){return F===null||ht(F)?(_.exit("codeFencedFence"),k(F)):T(F)}}}function Ume(e,t,n){const s=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r)}function r(a){return s.parser.lazy[s.now().line]?n(a):t(a)}}const xw={name:"codeIndented",tokenize:$me},Fme={partial:!0,tokenize:Hme};function $me(e,t,n){const s=this;return i;function i(u){return e.enter("codeIndented"),an(e,r,"linePrefix",5)(u)}function r(u){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):ht(u)?e.attempt(Fme,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||ht(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Hme(e,t,n){const s=this;return i;function i(a){return s.parser.lazy[s.now().line]?n(a):ht(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):an(e,r,"linePrefix",5)(a)}function r(a){const l=s.events[s.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):ht(a)?i(a):n(a)}}const zme={name:"codeText",previous:Gme,resolve:Vme,tokenize:Kme};function Vme(e){let t=e.length-4,n=3,s,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const i=n||0;this.setCursor(Math.trunc(t));const r=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return s&&tm(this.left,s),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),tm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),tm(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(s.parser.constructs.flow,n,t)(a)}}function K7(e,t,n,s,i,r,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(s),e.enter(i),e.enter(r),e.consume(y),e.exit(r),h):y===null||y===32||y===41||_1(y)?n(y):(e.enter(s),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(r),e.consume(y),e.exit(r),e.exit(i),e.exit(s),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||ht(y)?n(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function b(y){return!d&&(y===null||y===41||Fn(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(s),t(y)):d999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(r),e.enter(i),e.consume(m),e.exit(i),e.exit(s),t):ht(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||ht(m)||l++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!Qt(m)),m===92?h:f)}function h(m){return m===91||m===92||m===93?(e.consume(m),l++,f):f(m)}}function Y7(e,t,n,s,i,r){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(s),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(s),t):(e.enter(r),u(h))}function u(h){return h===a?(e.exit(r),c(a)):h===null?n(h):ht(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),an(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||ht(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function np(e,t){let n;return s;function s(i){return ht(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,s):Qt(i)?an(e,s,n?"linePrefix":"lineSuffix")(i):t(i)}}const epe={name:"definition",tokenize:npe},tpe={partial:!0,tokenize:spe};function npe(e,t,n){const s=this;let i;return r;function r(m){return e.enter("definition"),a(m)}function a(m){return q7.call(s,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return i=Oa(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Fn(m)?np(e,u)(m):u(m)}function u(m){return K7(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(tpe,f,f)(m)}function f(m){return Qt(m)?an(e,h,"whitespace")(m):h(m)}function h(m){return m===null||ht(m)?(e.exit("definition"),s.parser.defined.push(i),t(m)):n(m)}}function spe(e,t,n){return s;function s(l){return Fn(l)?np(e,i)(l):n(l)}function i(l){return Y7(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function r(l){return Qt(l)?an(e,a,"whitespace")(l):a(l)}function a(l){return l===null||ht(l)?t(l):n(l)}}const ipe={name:"hardBreakEscape",tokenize:rpe};function rpe(e,t,n){return s;function s(r){return e.enter("hardBreakEscape"),e.consume(r),i}function i(r){return ht(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const ape={name:"headingAtx",resolve:ope,tokenize:lpe};function ope(e,t){let n=e.length-2,s=3,i,r;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(i={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},r={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Dr(e,s,n-s+1,[["enter",i,t],["enter",r,t],["exit",r,t],["exit",i,t]])),e}function lpe(e,t,n){let s=0;return i;function i(d){return e.enter("atxHeading"),r(d)}function r(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&s++<6?(e.consume(d),a):d===null||Fn(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||ht(d)?(e.exit("atxHeading"),t(d)):Qt(d)?an(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Fn(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const cpe=["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"],YM=["pre","script","style","textarea"],upe={concrete:!0,name:"htmlFlow",resolveTo:hpe,tokenize:mpe},dpe={partial:!0,tokenize:gpe},fpe={partial:!0,tokenize:ppe};function hpe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function mpe(e,t,n){const s=this;let i,r,a,l,c;return u;function u(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),r=!0,b):P===63?(e.consume(P),i=3,s.interrupt?t:O):Qi(P)?(e.consume(P),a=String.fromCharCode(P),v):n(P)}function h(P){return P===45?(e.consume(P),i=2,m):P===91?(e.consume(P),i=5,l=0,p):Qi(P)?(e.consume(P),i=4,s.interrupt?t:O):n(P)}function m(P){return P===45?(e.consume(P),s.interrupt?t:O):n(P)}function p(P){const Q="CDATA[";return P===Q.charCodeAt(l++)?(e.consume(P),l===Q.length?s.interrupt?t:B:p):n(P)}function b(P){return Qi(P)?(e.consume(P),a=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||Fn(P)){const Q=P===47,ee=a.toLowerCase();return!Q&&!r&&YM.includes(ee)?(i=1,s.interrupt?t(P):B(P)):cpe.includes(a.toLowerCase())?(i=6,Q?(e.consume(P),y):s.interrupt?t(P):B(P)):(i=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(P):r?x(P):E(P))}return P===45||$i(P)?(e.consume(P),a+=String.fromCharCode(P),v):n(P)}function y(P){return P===62?(e.consume(P),s.interrupt?t:B):n(P)}function x(P){return Qt(P)?(e.consume(P),x):j(P)}function E(P){return P===47?(e.consume(P),j):P===58||P===95||Qi(P)?(e.consume(P),w):Qt(P)?(e.consume(P),E):j(P)}function w(P){return P===45||P===46||P===58||P===95||$i(P)?(e.consume(P),w):S(P)}function S(P){return P===61?(e.consume(P),_):Qt(P)?(e.consume(P),S):E(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,k):Qt(P)?(e.consume(P),_):T(P)}function k(P){return P===c?(e.consume(P),c=null,A):P===null||ht(P)?n(P):(e.consume(P),k)}function T(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Fn(P)?S(P):(e.consume(P),T)}function A(P){return P===47||P===62||Qt(P)?E(P):n(P)}function j(P){return P===62?(e.consume(P),R):n(P)}function R(P){return P===null||ht(P)?B(P):Qt(P)?(e.consume(P),R):n(P)}function B(P){return P===45&&i===2?(e.consume(P),C):P===60&&i===1?(e.consume(P),I):P===62&&i===4?(e.consume(P),te):P===63&&i===3?(e.consume(P),O):P===93&&i===5?(e.consume(P),$):ht(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(dpe,ne,z)(P)):P===null||ht(P)?(e.exit("htmlFlowData"),z(P)):(e.consume(P),B)}function z(P){return e.check(fpe,L,ne)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),F}function F(P){return P===null||ht(P)?z(P):(e.enter("htmlFlowData"),B(P))}function C(P){return P===45?(e.consume(P),O):B(P)}function I(P){return P===47?(e.consume(P),a="",D):B(P)}function D(P){if(P===62){const Q=a.toLowerCase();return YM.includes(Q)?(e.consume(P),te):B(P)}return Qi(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),D):B(P)}function $(P){return P===93?(e.consume(P),O):B(P)}function O(P){return P===62?(e.consume(P),te):P===45&&i===2?(e.consume(P),O):B(P)}function te(P){return P===null||ht(P)?(e.exit("htmlFlowData"),ne(P)):(e.consume(P),te)}function ne(P){return e.exit("htmlFlow"),t(P)}}function ppe(e,t,n){const s=this;return i;function i(a){return ht(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):n(a)}function r(a){return s.parser.lazy[s.now().line]?n(a):t(a)}}function gpe(e,t,n){return s;function s(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Lg,t,n)}}const bpe={name:"htmlText",tokenize:ype};function ype(e,t,n){const s=this;let i,r,a;return l;function l(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),S):O===63?(e.consume(O),E):Qi(O)?(e.consume(O),T):n(O)}function u(O){return O===45?(e.consume(O),d):O===91?(e.consume(O),r=0,p):Qi(O)?(e.consume(O),x):n(O)}function d(O){return O===45?(e.consume(O),m):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),h):ht(O)?(a=f,I(O)):(e.consume(O),f)}function h(O){return O===45?(e.consume(O),m):f(O)}function m(O){return O===62?C(O):O===45?h(O):f(O)}function p(O){const te="CDATA[";return O===te.charCodeAt(r++)?(e.consume(O),r===te.length?b:p):n(O)}function b(O){return O===null?n(O):O===93?(e.consume(O),v):ht(O)?(a=b,I(O)):(e.consume(O),b)}function v(O){return O===93?(e.consume(O),y):b(O)}function y(O){return O===62?C(O):O===93?(e.consume(O),y):b(O)}function x(O){return O===null||O===62?C(O):ht(O)?(a=x,I(O)):(e.consume(O),x)}function E(O){return O===null?n(O):O===63?(e.consume(O),w):ht(O)?(a=E,I(O)):(e.consume(O),E)}function w(O){return O===62?C(O):E(O)}function S(O){return Qi(O)?(e.consume(O),_):n(O)}function _(O){return O===45||$i(O)?(e.consume(O),_):k(O)}function k(O){return ht(O)?(a=k,I(O)):Qt(O)?(e.consume(O),k):C(O)}function T(O){return O===45||$i(O)?(e.consume(O),T):O===47||O===62||Fn(O)?A(O):n(O)}function A(O){return O===47?(e.consume(O),C):O===58||O===95||Qi(O)?(e.consume(O),j):ht(O)?(a=A,I(O)):Qt(O)?(e.consume(O),A):C(O)}function j(O){return O===45||O===46||O===58||O===95||$i(O)?(e.consume(O),j):R(O)}function R(O){return O===61?(e.consume(O),B):ht(O)?(a=R,I(O)):Qt(O)?(e.consume(O),R):A(O)}function B(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,z):ht(O)?(a=B,I(O)):Qt(O)?(e.consume(O),B):(e.consume(O),L)}function z(O){return O===i?(e.consume(O),i=void 0,F):O===null?n(O):ht(O)?(a=z,I(O)):(e.consume(O),z)}function L(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Fn(O)?A(O):(e.consume(O),L)}function F(O){return O===47||O===62||Fn(O)?A(O):n(O)}function C(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function I(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),D}function D(O){return Qt(O)?an(e,$,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):$(O)}function $(O){return e.enter("htmlTextData"),a(O)}}const Y2={name:"labelEnd",resolveAll:wpe,resolveTo:_pe,tokenize:Spe},xpe={tokenize:Npe},Epe={tokenize:Tpe},vpe={tokenize:kpe};function wpe(e){let t=-1;const n=[];for(;++t=3&&(u===null||ht(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),s++,c):(e.exit("thematicBreakSequence"),Qt(u)?an(e,l,"whitespace")(u):l(u))}}const lr={continuation:{tokenize:Ppe},exit:Upe,name:"list",tokenize:Dpe},Mpe={partial:!0,tokenize:Fpe},Lpe={partial:!0,tokenize:Bpe};function Dpe(e,t,n){const s=this,i=s.events[s.events.length-1];let r=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(m){const p=s.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!s.containerState.marker||m===s.containerState.marker:bN(m)){if(s.containerState.type||(s.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ry,n,u)(m):u(m);if(!s.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return bN(m)&&++a<10?(e.consume(m),c):(!s.interrupt||a<2)&&(s.containerState.marker?m===s.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||m,e.check(Lg,s.interrupt?n:d,e.attempt(Mpe,h,f))}function d(m){return s.containerState.initialBlankLine=!0,r++,h(m)}function f(m){return Qt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return s.containerState.size=r+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Ppe(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Lg,i,r);function i(l){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,an(e,t,"listItemIndent",s.containerState.size+1)(l)}function r(l){return s.containerState.furtherBlankLines||!Qt(l)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,a(l)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(Lpe,t,a)(l))}function a(l){return s.containerState._closeFlow=!0,s.interrupt=void 0,an(e,e.attempt(lr,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Bpe(e,t,n){const s=this;return an(e,i,"listItemIndent",s.containerState.size+1);function i(r){const a=s.events[s.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===s.containerState.size?t(r):n(r)}}function Upe(e){e.exit(this.containerState.type)}function Fpe(e,t,n){const s=this;return an(e,i,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(r){const a=s.events[s.events.length-1];return!Qt(r)&&a&&a[1].type==="listItemPrefixWhitespace"?t(r):n(r)}}const WM={name:"setextUnderline",resolveTo:$pe,tokenize:Hpe};function $pe(e,t){let n=e.length,s,i,r;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!r&&e[n][1].type==="definition"&&(r=n);const a={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",r?(e.splice(i,0,["enter",a,t]),e.splice(r+1,0,["exit",e[s][1],t]),e[s][1].end={...e[r][1].end}):e[s][1]=a,e.push(["exit",a,t]),e}function Hpe(e,t,n){const s=this;let i;return r;function r(u){let d=s.events.length,f;for(;d--;)if(s.events[d][1].type!=="lineEnding"&&s.events[d][1].type!=="linePrefix"&&s.events[d][1].type!=="content"){f=s.events[d][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Qt(u)?an(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||ht(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const zpe={tokenize:Vpe};function Vpe(e){const t=this,n=e.attempt(Lg,s,e.attempt(this.parser.constructs.flowInitial,i,an(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Wme,i)),"linePrefix")));return n;function s(r){if(r===null){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Gpe={resolveAll:X7()},Kpe=W7("string"),qpe=W7("text");function W7(e){return{resolveAll:X7(e==="text"?Ype:void 0),tokenize:t};function t(n){const s=this,i=this.parser.constructs[e],r=n.attempt(i,a,l);return a;function a(d){return u(d)?r(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),r(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h-1){const l=a[0];typeof l=="string"?a[0]=l.slice(s):a.shift()}r>0&&a.push(e[i].slice(0,r))}return a}function oge(e,t){let n=-1;const s=[];let i;for(;++n0?`?${r.join("&")}`:"";return Cg(`/web/skill-spaces/${encodeURIComponent(e)}/skills/${encodeURIComponent(t)}${a}`)}function Wfe(e,t){return{source:"skillspace",id:`ss:${e.id}/${t.skillId}/${t.version}`,name:t.skillName,description:t.skillDescription,folder:t.skillName,skillSpaceId:e.id,skillSpaceName:e.name,skillSpaceRegion:e.region,skillId:t.skillId,version:t.version}}function Xfe(e,t,n="volcengine"){return n==="byteplus"?"":`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function TM({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),o.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),o.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),o.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}const Qfe={coding:"智能编程",get_city_weather:"城市天气查询",get_location_weather:"位置天气查询",web_fetch:"网页内容获取"};function fN(e){const t=Ou.find(n=>n.id===e||n.toolNames.includes(e));return Qfe[e]??(t==null?void 0:t.label)??e}function kM(e){const t=Ou.find(s=>s.id===e||s.toolNames.includes(e));return((t==null?void 0:t.desc)??"由 VeADK 提供的内置工具").replace(/[。.]+$/,"")}function Zfe(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m7 7 10 10M17 7 7 17",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function Jfe(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"5.8",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.2 15.2 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function AM(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M12 5.5v13M5.5 12h13",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function E7({title:e,description:t,icon:n,wide:s=!1,onClose:i,children:r}){const a=g.useRef(`session-capability-${Math.random().toString(36).slice(2)}`);return g.useEffect(()=>{const l=document.body.style.overflow;document.body.style.overflow="hidden";const c=u=>{u.key==="Escape"&&i()};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),document.body.style.overflow=l}},[i]),wi.createPortal(o.jsxs("div",{className:"session-capability-dialog-layer",children:[o.jsx("button",{type:"button",className:"session-capability-dialog-scrim","aria-label":"关闭弹窗",onClick:i}),o.jsxs("section",{className:`session-capability-dialog${s?" is-wide":""}`,role:"dialog","aria-modal":"true","aria-labelledby":a.current,children:[o.jsxs("header",{className:`session-capability-dialog-head${n?"":" is-iconless"}`,children:[n&&o.jsx("span",{className:"session-capability-dialog-mark",children:n}),o.jsxs("div",{children:[o.jsx("h2",{id:a.current,children:e}),o.jsx("p",{children:t})]}),o.jsx("button",{type:"button",className:"session-capability-dialog-close","aria-label":`关闭${e}`,onClick:i,children:o.jsx(Zfe,{})})]}),r]})]}),document.body)}function ry({value:e,placeholder:t,label:n,onChange:s,autoFocus:i=!1}){return o.jsxs("label",{className:"session-capability-search",children:[o.jsx(Jfe,{}),o.jsx("input",{value:e,"aria-label":n,placeholder:t,autoFocus:i,onChange:r=>s(r.target.value)})]})}function ehe({agentName:e,tools:t,selectedNames:n,mutating:s,onAdd:i,onClose:r}){const[a,l]=g.useState(""),[c,u]=g.useState(""),d=g.useMemo(()=>new Set(n),[n]),f=g.useMemo(()=>{const p=a.trim().toLowerCase();return t.filter(m=>p?`${fN(m)} ${m} ${kM(m)}`.toLowerCase().includes(p):!0)},[a,t]),h=async p=>{u(p);const m=await i({kind:"tool",name:p});u(""),m&&r()};return o.jsx(E7,{title:"添加内置工具",description:`添加后仅对 ${e} 的当前会话生效`,icon:o.jsx(TM,{}),onClose:r,children:o.jsxs("div",{className:"session-tool-dialog-body",children:[o.jsx(ry,{value:a,label:"搜索内置工具",placeholder:"搜索中文名称或工具标识",onChange:l,autoFocus:!0}),o.jsx("div",{className:"session-tool-picker",role:"list","aria-label":"可用内置工具",children:f.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的内置工具"}):f.map(p=>{const m=d.has(p),b=c===p;return o.jsxs("article",{className:"session-tool-option",role:"listitem",children:[o.jsx("span",{className:"session-tool-option-icon",children:o.jsx(TM,{})}),o.jsxs("span",{className:"session-tool-option-copy",children:[o.jsx("strong",{children:fN(p)}),o.jsx("code",{children:p}),o.jsx("span",{children:kM(p)})]}),o.jsx("button",{type:"button",disabled:m||s||!!c,onClick:()=>void h(p),children:m?"已添加":b?"添加中…":"添加"})]},p)})})]})})}function the({appName:e,agentName:t,selectedNames:n,mutating:s,onAdd:i,onClose:r}){const[a,l]=g.useState("public"),[c,u]=g.useState(""),[d,f]=g.useState([]),[h,p]=g.useState(0),[m,b]=g.useState(!0),[v,y]=g.useState(""),[x,E]=g.useState([]),[w,S]=g.useState(null),[_,T]=g.useState([]),[k,A]=g.useState(""),[j,R]=g.useState(""),[B,z]=g.useState(!0),[L,F]=g.useState(!1),[C,I]=g.useState(""),[D,$]=g.useState(""),O=g.useMemo(()=>new Set(n),[n]);g.useEffect(()=>{if(a!=="public")return;let ee=!0;const V=window.setTimeout(()=>{b(!0),y(""),E8(e,c.trim()).then(X=>{ee&&(f(X.items),p(X.totalCount))}).catch(X=>{ee&&(f([]),p(0),y(X instanceof Error?X.message:"搜索 Skill Hub 失败"))}).finally(()=>{ee&&b(!1)})},250);return()=>{ee=!1,window.clearTimeout(V)}},[e,c,a]),g.useEffect(()=>{if(a!=="agentkit")return;let ee=!0;return z(!0),I(""),y7().then(V=>{ee&&(E(V),S(V[0]??null))}).catch(V=>{ee&&I(V instanceof Error?V.message:"读取 Skill Space 失败")}).finally(()=>{ee&&z(!1)}),()=>{ee=!1}},[a]),g.useEffect(()=>{if(a!=="agentkit")return;if(!w){T([]);return}let ee=!0;return F(!0),I(""),x7(w.id,w.region).then(V=>{ee&&T(V)}).catch(V=>{ee&&I(V instanceof Error?V.message:"读取技能失败")}).finally(()=>{ee&&F(!1)}),()=>{ee=!1}},[w,a]);const te=g.useMemo(()=>{const ee=k.trim().toLowerCase();return ee?x.filter(V=>`${V.name} ${V.id} ${V.description}`.toLowerCase().includes(ee)):x},[k,x]),se=g.useMemo(()=>{const ee=j.trim().toLowerCase();return ee?_.filter(V=>`${V.skillName} ${V.skillDescription}`.toLowerCase().includes(ee)):_},[j,_]),P=async ee=>{if(!w)return;$(ee.skillId);const V=await i({kind:"skill",name:ee.skillName,skillSourceId:w.id,description:ee.skillDescription,version:ee.version});$(""),V&&r()},Q=async ee=>{$(ee.slug);const V=await i({kind:"skill",name:ee.name,skillSourceId:`findskill:${ee.slug}`,description:ee.description,version:ee.version||ee.updatedAt});$(""),V&&r()};return o.jsx(E7,{title:"添加技能",description:`从公域 Skill Hub 或 AgentKit Skill 中心添加到 ${t} 当前会话`,wide:!0,onClose:r,children:o.jsxs("div",{className:"session-skill-dialog-body",children:[o.jsxs("div",{className:"session-skill-source-tabs",role:"tablist","aria-label":"技能来源",children:[o.jsxs("button",{type:"button",role:"tab","aria-selected":a==="public",className:a==="public"?"is-active":"",onClick:()=>l("public"),children:["Skill Hub",o.jsx("span",{children:"公域"})]}),o.jsx("button",{type:"button",role:"tab","aria-selected":a==="agentkit",className:a==="agentkit"?"is-active":"",onClick:()=>l("agentkit"),children:"AgentKit Skill 中心"})]}),a==="public"?o.jsxs("section",{className:"session-public-skill-browser","aria-label":"Skill Hub 公域技能",children:[o.jsxs("div",{className:"session-public-skill-head",children:[o.jsx(ry,{value:c,label:"搜索 Skill Hub",placeholder:"搜索技能名称、用途或关键词",onChange:u,autoFocus:!0}),o.jsxs("span",{children:[h.toLocaleString()," 个公域技能"]})]}),o.jsx("div",{className:"session-public-skill-list",children:v?o.jsx("div",{className:"session-capability-error",children:v}):m?o.jsx("div",{className:"session-capability-loading",children:"正在搜索 Skill Hub…"}):d.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的公域技能"}):d.map(ee=>{const V=O.has(ee.name),X=D===ee.slug;return o.jsxs("article",{className:"session-skill-option session-public-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:ee.name}),o.jsx("span",{children:ee.description||"暂无描述"}),o.jsxs("small",{children:[ee.sourceRepo||ee.sourceType||"FindSkill",o.jsx("span",{"aria-hidden":"true",children:" · "}),ee.downloadCount.toLocaleString()," 次下载",ee.evaluationScore>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{"aria-hidden":"true",children:" · "}),ee.evaluationScore.toFixed(1)," 分"]})]})]}),o.jsx("button",{type:"button",disabled:V||s||!!D,onClick:()=>void Q(ee),children:V?"已添加":X?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(AM,{}),"添加"]})})]},ee.slug)})})]}):o.jsxs("div",{className:"session-skill-browser",children:[o.jsxs("section",{className:"session-skill-spaces","aria-label":"Skill Space 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Skill Space"}),o.jsx("span",{children:x.length})]}),o.jsx(ry,{value:k,label:"搜索 Skill Space",placeholder:"搜索空间",onChange:A,autoFocus:!0})]}),o.jsx("div",{className:"session-skill-pane-list",children:B?o.jsx("div",{className:"session-capability-loading",children:"正在读取 Skill Space…"}):te.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的 Skill Space"}):te.map(ee=>o.jsx("button",{type:"button",className:`session-skill-space${(w==null?void 0:w.id)===ee.id?" is-active":""}`,onClick:()=>{S(ee),R("")},children:o.jsxs("span",{children:[o.jsx("strong",{children:ee.name||ee.id}),o.jsx("small",{children:ee.description||ee.id}),o.jsxs("em",{children:[ee.skillCount??0," 个技能"]})]})},`${ee.projectName??"default"}:${ee.id}`))})]}),o.jsxs("section",{className:"session-skill-results","aria-label":"AgentKit Skill 列表",children:[o.jsxs("div",{className:"session-skill-pane-head",children:[o.jsxs("div",{children:[o.jsx("strong",{title:w==null?void 0:w.name,children:(w==null?void 0:w.name)||"选择 Skill Space"}),o.jsx("span",{children:_.length})]}),o.jsx(ry,{value:j,label:"搜索 AgentKit 技能",placeholder:"搜索技能名称或描述",onChange:R})]}),o.jsx("div",{className:"session-skill-pane-list",children:C?o.jsx("div",{className:"session-capability-error",children:C}):w?L?o.jsx("div",{className:"session-capability-loading",children:"正在读取技能…"}):se.length===0?o.jsx("div",{className:"session-capability-empty",children:"没有匹配的技能"}):se.map(ee=>{const V=O.has(ee.skillName),X=D===ee.skillId;return o.jsxs("article",{className:"session-skill-option",children:[o.jsxs("span",{className:"session-skill-option-copy",children:[o.jsx("strong",{children:ee.skillName}),o.jsx("span",{children:ee.skillDescription||"暂无描述"}),o.jsxs("small",{children:["版本 ",ee.version||"—"]})]}),o.jsx("button",{type:"button",disabled:V||s||!!D,onClick:()=>void P(ee),children:V?"已添加":X?"添加中…":o.jsxs(o.Fragment,{children:[o.jsx(AM,{}),"添加"]})})]},`${ee.skillId}:${ee.version}`)}):o.jsx("div",{className:"session-capability-empty",children:"选择一个 Skill Space 查看技能"})})]})]})]})})}function Pa({as:e="span",className:t="",duration:n=4,spread:s=20,children:i,style:r,...a}){const l=Math.min(Math.max(s,5),45);return o.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...r,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-l}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+l}%)`,animationDuration:`${n}s`},...a,children:i})}function v7(e){return 1+e.children.reduce((t,n)=>t+v7(n),0)}function w7(e){return e.id||e.name}function nhe(e,t){const n=w7(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const s=/^agent_sub_(\d+)$/.exec(n);return s?`子 Agent ${s[1]}`:e.name||n}function _7(e,t=!0){return{...e,id:w7(e),name:nhe(e,t),children:e.children.map(n=>_7(n,!1))}}function S7(e){const t=Ci();return{...t,name:e.name,description:e.description,instruction:e.instruction||t.instruction,agentType:e.type,modelName:e.model,tools:e.tools??[],skills:(e.skills??[]).map(n=>n.name),subAgents:e.children.map(S7)}}function she(e){return[...new Set(e.map(t=>t.trim()).filter(Boolean))]}function ihe(e){return[...new Map(e.filter(t=>t.name.trim()).map(t=>[t.name.trim(),{...t,name:t.name.trim()}])).values()]}function gw({title:e,count:t}){return o.jsxs("div",{className:"topo-module-title",children:[o.jsx("span",{className:"topo-module-label",title:e,children:e}),t!==void 0&&o.jsx("span",{className:"topo-section-count","aria-label":`${t} 项`,children:t})]})}function rhe({appName:e,info:t,loading:n,variant:s="rail",capabilities:i=null,capabilityLoading:r=!1,capabilityMutating:a=!1,builtinTools:l=[],onAddCapability:c,onRemoveCapability:u}){const[d,f]=g.useState(null),[h,p]=g.useState(!1),m=g.useRef(null),b=()=>{p(!1),window.requestAnimationFrame(()=>{var _;return(_=m.current)==null?void 0:_.focus()})};if(g.useEffect(()=>{if(!h)return;const _=document.body.style.overflow,T=k=>{k.key==="Escape"&&b()};return document.body.style.overflow="hidden",document.addEventListener("keydown",T),()=>{document.body.style.overflow=_,document.removeEventListener("keydown",T)}},[h]),n&&!t)return o.jsx("aside",{className:`topo is-loading${s==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息","aria-live":"polite",children:o.jsx(Pa,{as:"span",className:"topo-loading-label",duration:2.2,children:"正在读取 Agent 信息…"})});if(!t)return null;const v=_7(t.graph??{id:t.name,name:t.name,description:t.description,type:t.type??"llm",model:t.model,tools:t.tools,skills:t.skills,path:[t.name],mentionable:!1,children:[]}),y=(i==null?void 0:i.tools)??she(t.tools).map(_=>({id:`base:tool:${_}`,kind:"tool",name:_,custom:!1})),x=(i==null?void 0:i.skills)??ihe(t.skills).map(_=>({id:`base:skill:${_.name}`,kind:"skill",name:_.name,description:_.description,custom:!1})),E=!!(i&&c&&u),w=S7(v),S=_=>o.jsx(zm,{draft:w,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},_);return o.jsxs(o.Fragment,{children:[o.jsxs("aside",{className:`topo${s==="drawer"?" is-drawer":""}`,"aria-label":"Agent 信息与拓扑",children:[o.jsxs("section",{className:"topo-agent-card","aria-label":"Agent 信息",children:[o.jsxs("div",{className:"topo-agent-heading",children:[o.jsx("h2",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&o.jsx("span",{title:t.model,children:t.model})]}),t.description&&o.jsx("p",{className:"topo-description",title:t.description,children:t.description})]}),o.jsxs("div",{className:"topo-module-stack",children:[o.jsxs("section",{className:"topo-module-card topo-tools-card","aria-label":"工具",children:[o.jsx(gw,{title:"工具",count:y.length}),o.jsx("div",{className:"topo-module-scroll topo-tools-scroll",role:"region","aria-label":"工具列表",tabIndex:0,children:y.length>0?o.jsx("div",{className:"topo-tool-list",children:y.map(_=>o.jsxs("div",{className:"topo-tool",title:_.name,children:[o.jsxs("span",{className:"topo-capability-title",children:[o.jsxs("span",{className:"topo-capability-copy",children:[o.jsx("span",{className:"topo-capability-name",children:fN(_.name)}),o.jsx("code",{children:_.name})]}),_.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"})]}),_.custom&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除工具 ${_.name}`,title:"移除",disabled:a,onClick:()=>u==null?void 0:u(_.id),children:"×"})]},_.id))}):o.jsx("div",{className:"topo-empty",children:"未配置"})}),E&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加内置工具",disabled:r||a,onClick:()=>f("tool"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加工具"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-skills-card","aria-label":"技能",children:[o.jsx(gw,{title:"技能",count:t.skillsPreviewSupported?x.length:void 0}),o.jsx("div",{className:"topo-module-scroll topo-skills-scroll",role:"region","aria-label":"技能列表",tabIndex:0,children:t.skillsPreviewSupported?x.length>0?o.jsx("div",{className:"topo-skill-list",children:x.map(_=>o.jsxs("div",{className:"topo-skill",title:_.description||_.name,children:[o.jsxs("div",{className:"topo-skill-title",children:[o.jsx("span",{className:"topo-skill-name",children:_.name}),_.custom&&o.jsx("span",{className:"topo-custom-badge",children:"自定义"}),_.custom&&o.jsx("button",{type:"button",className:"topo-remove-capability","aria-label":`移除技能 ${_.name}`,title:"移除",disabled:a,onClick:()=>u==null?void 0:u(_.id),children:"×"})]}),_.description&&o.jsx("span",{className:"topo-skill-description",children:_.description})]},`${_.name}:${_.description}`))}):o.jsx("div",{className:"topo-empty",children:"未配置"}):o.jsx("div",{className:"topo-empty",children:"暂不支持预览"})}),E&&o.jsx("div",{className:"topo-capability-add-dock",children:o.jsxs("button",{type:"button",className:"topo-capability-add-slot","aria-label":"添加技能",disabled:r||a,onClick:()=>f("skill"),children:[o.jsx("span",{"aria-hidden":"true",children:"+"}),o.jsx("span",{children:"在此对话中添加技能"})]})})]}),o.jsxs("section",{className:"topo-module-card topo-topology","aria-label":"Agent 画布",children:[o.jsxs("div",{className:"topo-canvas-heading",children:[o.jsx(gw,{title:"结构拓扑",count:v7(v)}),o.jsx("button",{ref:m,type:"button",className:"topo-canvas-expand","aria-label":"全屏查看 Agent 画布",title:"全屏查看",onClick:()=>p(!0),children:o.jsx(nu,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-preview",role:"region","aria-label":"Agent 执行画布",children:S(`conversation-canvas:${e}`)})]})]}),d==="tool"&&c&&o.jsx(ehe,{agentName:t.name,tools:l,selectedNames:y.map(_=>_.name),mutating:a,onAdd:c,onClose:()=>f(null)}),d==="skill"&&c&&o.jsx(the,{appName:e,agentName:t.name,selectedNames:x.map(_=>_.name),mutating:a,onAdd:c,onClose:()=>f(null)})]}),h&&wi.createPortal(o.jsxs("section",{className:"topo-canvas-dialog",role:"dialog","aria-modal":"true","aria-label":"全屏 Agent 执行画布",children:[o.jsxs("header",{className:"topo-canvas-dialog-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Agent 执行画布"}),o.jsx("span",{children:t.name})]}),o.jsx("button",{type:"button","aria-label":"关闭全屏画布",title:"关闭",onClick:b,autoFocus:!0,children:o.jsx(Oi,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"topo-canvas-dialog-body",children:S(`conversation-canvas-fullscreen:${e}`)})]}),document.body)]})}function sLe(){}function CM(e){const t=[],n=String(e||"");let s=n.indexOf(","),i=0,r=!1;for(;!r;){s===-1&&(s=n.length,r=!0);const a=n.slice(i,s).trim();(a||!r)&&t.push(a),i=s+1,s=n.indexOf(",",i)}return t}function N7(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ahe=/[$_\p{ID_Start}]/u,ohe=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,lhe=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,che=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uhe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T7={};function iLe(e){return e?ahe.test(String.fromCodePoint(e)):!1}function rLe(e,t){const s=(t||T7).jsx?lhe:ohe;return e?s.test(String.fromCodePoint(e)):!1}function IM(e,t){return(T7.jsx?uhe:che).test(e)}const dhe=/[ \t\n\f\r]/g;function fhe(e){return typeof e=="object"?e.type==="text"?jM(e.value):!1:jM(e)}function jM(e){return e.replace(dhe,"")===""}let Ig=class{constructor(t,n,s){this.normal=n,this.property=t,s&&(this.space=s)}};Ig.prototype.normal={};Ig.prototype.property={};Ig.prototype.space=void 0;function k7(e,t){const n={},s={};for(const i of e)Object.assign(n,i.property),Object.assign(s,i.normal);return new Ig(n,s,t)}function Gm(e){return e.toLowerCase()}class Er{constructor(t,n){this.attribute=n,this.property=t}}Er.prototype.attribute="";Er.prototype.booleanish=!1;Er.prototype.boolean=!1;Er.prototype.commaOrSpaceSeparated=!1;Er.prototype.commaSeparated=!1;Er.prototype.defined=!1;Er.prototype.mustUseProperty=!1;Er.prototype.number=!1;Er.prototype.overloadedBoolean=!1;Er.prototype.property="";Er.prototype.spaceSeparated=!1;Er.prototype.space=void 0;let hhe=0;const Mt=Mu(),Zs=Mu(),hN=Mu(),De=Mu(),$n=Mu(),rf=Mu(),Tr=Mu();function Mu(){return 2**++hhe}const pN=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mt,booleanish:Zs,commaOrSpaceSeparated:Tr,commaSeparated:rf,number:De,overloadedBoolean:hN,spaceSeparated:$n},Symbol.toStringTag,{value:"Module"})),bw=Object.keys(pN);class $2 extends Er{constructor(t,n,s,i){let r=-1;if(super(t,n),RM(this,"space",i),typeof s=="number")for(;++r4&&n.slice(0,4)==="data"&&yhe.test(t)){if(t.charAt(4)==="-"){const r=t.slice(5).replace(OM,Ehe);s="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=t.slice(4);if(!OM.test(r)){let a=r.replace(bhe,xhe);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=$2}return new i(s,t)}function xhe(e){return"-"+e.toLowerCase()}function Ehe(e){return e.charAt(1).toUpperCase()}const jg=k7([A7,phe,j7,R7,O7],"html"),xc=k7([A7,mhe,j7,R7,O7],"svg");function MM(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function M7(e){return e.join(" ").trim()}var H2={},LM=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,vhe=/\n/g,whe=/^\s*/,_he=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,She=/^:\s*/,Nhe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,The=/^[;\s]*/,khe=/^\s+|\s+$/g,Ahe=` +`,DM="/",PM="*",zc="",Che="comment",Ihe="declaration";function jhe(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,s=1;function i(m){var b=m.match(vhe);b&&(n+=b.length);var v=m.lastIndexOf(Ahe);s=~v?m.length-v:s+m.length}function r(){var m={line:n,column:s};return function(b){return b.position=new a(m),u(),b}}function a(m){this.start=m,this.end={line:n,column:s},this.source=t.source}a.prototype.content=e;function l(m){var b=new Error(t.source+":"+n+":"+s+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=s,b.source=e,!t.silent)throw b}function c(m){var b=m.exec(e);if(b){var v=b[0];return i(v),e=e.slice(v.length),b}}function u(){c(whe)}function d(m){var b;for(m=m||[];b=f();)b!==!1&&m.push(b);return m}function f(){var m=r();if(!(DM!=e.charAt(0)||PM!=e.charAt(1))){for(var b=2;zc!=e.charAt(b)&&(PM!=e.charAt(b)||DM!=e.charAt(b+1));)++b;if(b+=2,zc===e.charAt(b-1))return l("End of comment missing");var v=e.slice(2,b-2);return s+=2,i(v),e=e.slice(b),s+=2,m({type:Che,comment:v})}}function h(){var m=r(),b=c(_he);if(b){if(f(),!c(She))return l("property missing ':'");var v=c(Nhe),y=m({type:Ihe,property:BM(b[0].replace(LM,zc)),value:v?BM(v[0].replace(LM,zc)):zc});return c(The),y}}function p(){var m=[];d(m);for(var b;b=h();)b!==!1&&(m.push(b),d(m));return m}return u(),p()}function BM(e){return e?e.replace(khe,zc):zc}var Rhe=jhe,Ohe=Bl&&Bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(H2,"__esModule",{value:!0});H2.default=Lhe;const Mhe=Ohe(Rhe);function Lhe(e,t){let n=null;if(!e||typeof e!="string")return n;const s=(0,Mhe.default)(e),i=typeof t=="function";return s.forEach(r=>{if(r.type!=="declaration")return;const{property:a,value:l}=r;i?t(a,l,r):l&&(n=n||{},n[a]=l)}),n}var Kx={};Object.defineProperty(Kx,"__esModule",{value:!0});Kx.camelCase=void 0;var Dhe=/^--[a-zA-Z0-9_-]+$/,Phe=/-([a-z])/g,Bhe=/^[^-]+$/,Uhe=/^-(webkit|moz|ms|o|khtml)-/,Fhe=/^-(ms)-/,$he=function(e){return!e||Bhe.test(e)||Dhe.test(e)},Hhe=function(e,t){return t.toUpperCase()},UM=function(e,t){return"".concat(t,"-")},zhe=function(e,t){return t===void 0&&(t={}),$he(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Fhe,UM):e=e.replace(Uhe,UM),e.replace(Phe,Hhe))};Kx.camelCase=zhe;var Vhe=Bl&&Bl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Ghe=Vhe(H2),Khe=Kx;function mN(e,t){var n={};return!e||typeof e!="string"||(0,Ghe.default)(e,function(s,i){s&&i&&(n[(0,Khe.camelCase)(s,t)]=i)}),n}mN.default=mN;var qhe=mN;const Yhe=Gf(qhe),qx=L7("end"),yo=L7("start");function L7(e){return t;function t(n){const s=n&&n.position&&n.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function Whe(e){const t=yo(e),n=qx(e);if(t&&n)return{start:t,end:n}}function Zp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?FM(e.position):"start"in e||"end"in e?FM(e):"line"in e||"column"in e?gN(e):""}function gN(e){return $M(e&&e.line)+":"+$M(e&&e.column)}function FM(e){return gN(e&&e.start)+"-"+gN(e&&e.end)}function $M(e){return e&&typeof e=="number"?e:1}class $i extends Error{constructor(t,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let i="",r={},a=!1;if(n&&("line"in n&&"column"in n?r={place:n}:"start"in n&&"end"in n?r={place:n}:"type"in n?r={ancestors:[n],place:n.position}:r={...n}),typeof t=="string"?i=t:!r.cause&&t&&(a=!0,i=t.message,r.cause=t),!r.ruleId&&!r.source&&typeof s=="string"){const c=s.indexOf(":");c===-1?r.ruleId=s:(r.source=s.slice(0,c),r.ruleId=s.slice(c+1))}if(!r.place&&r.ancestors&&r.ancestors){const c=r.ancestors[r.ancestors.length-1];c&&(r.place=c.position)}const l=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Zp(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=a&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}$i.prototype.file="";$i.prototype.name="";$i.prototype.reason="";$i.prototype.message="";$i.prototype.stack="";$i.prototype.column=void 0;$i.prototype.line=void 0;$i.prototype.ancestors=void 0;$i.prototype.cause=void 0;$i.prototype.fatal=void 0;$i.prototype.place=void 0;$i.prototype.ruleId=void 0;$i.prototype.source=void 0;const z2={}.hasOwnProperty,Xhe=new Map,Qhe=/[A-Z]/g,Zhe=new Set(["table","tbody","thead","tfoot","tr"]),Jhe=new Set(["td","th"]),D7="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function epe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=lpe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=ope(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?xc:jg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},r=P7(i,e,void 0);return r&&typeof r!="string"?r:i.create(e,i.Fragment,{children:r||void 0},void 0)}function P7(e,t,n){if(t.type==="element")return tpe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return npe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ipe(e,t,n);if(t.type==="mdxjsEsm")return spe(e,t);if(t.type==="root")return rpe(e,t,n);if(t.type==="text")return ape(e,t)}function tpe(e,t,n){const s=e.schema;let i=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(i=xc,e.schema=i),e.ancestors.push(t);const r=U7(e,t.tagName,!1),a=cpe(e,t);let l=G2(e,t);return Zhe.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!fhe(c):!0})),B7(e,a,r,t),V2(a,l),e.ancestors.pop(),e.schema=s,e.create(t,r,a,n)}function npe(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}Km(e,t.position)}function spe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Km(e,t.position)}function ipe(e,t,n){const s=e.schema;let i=s;t.name==="svg"&&s.space==="html"&&(i=xc,e.schema=i),e.ancestors.push(t);const r=t.name===null?e.Fragment:U7(e,t.name,!0),a=upe(e,t),l=G2(e,t);return B7(e,a,r,t),V2(a,l),e.ancestors.pop(),e.schema=s,e.create(t,r,a,n)}function rpe(e,t,n){const s={};return V2(s,G2(e,t)),e.create(t,e.Fragment,s,n)}function ape(e,t){return t.value}function B7(e,t,n,s){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=s)}function V2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function ope(e,t,n){return s;function s(i,r,a,l){const u=Array.isArray(a.children)?n:t;return l?u(r,a,l):u(r,a)}}function lpe(e,t){return n;function n(s,i,r,a){const l=Array.isArray(r.children),c=yo(s);return t(i,r,a,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function cpe(e,t){const n={};let s,i;for(i in t.properties)if(i!=="children"&&z2.call(t.properties,i)){const r=dpe(e,i,t.properties[i]);if(r){const[a,l]=r;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Jhe.has(t.tagName)?s=l:n[a]=l}}if(s){const r=n.style||(n.style={});r[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return n}function upe(e,t){const n={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const r=s.data.estree.body[0];r.type;const a=r.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Km(e,t.position);else{const i=s.name;let r;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const l=s.value.data.estree.body[0];l.type,r=e.evaluater.evaluateExpression(l.expression)}else Km(e,t.position);else r=s.value===null?!0:s.value;n[i]=r}return n}function G2(e,t){const n=[];let s=-1;const i=e.passKeys?new Map:Xhe;for(;++si?0:i+t:t=t>i?i:t,n=n>0?n:0,s.length<1e4)a=Array.from(s),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);r0?(Ur(e,e.length,0,t),e):t}const VM={}.hasOwnProperty;function $7(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ba(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qi=Ec(/[A-Za-z]/),Ui=Ec(/[\dA-Za-z]/),Epe=Ec(/[#-'*+\--9=?A-Z^-~]/);function S1(e){return e!==null&&(e<32||e===127)}const bN=Ec(/\d/),vpe=Ec(/[\dA-Fa-f]/),wpe=Ec(/[!-/:-@[-`{-~]/);function pt(e){return e!==null&&e<-2}function Fn(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const Yx=Ec(new RegExp("\\p{P}|\\p{S}","u")),wu=Ec(/\s/);function Ec(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function uh(e){const t=[];let n=-1,s=0,i=0;for(;++n55295&&r<57344){const l=e.charCodeAt(n+1);r<56320&&l>56319&&l<57344?(a=String.fromCharCode(r,l),i=1):a="�"}else a=String.fromCharCode(r);a&&(t.push(e.slice(s,n),encodeURIComponent(a)),s=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(s)}function nn(e,t,n,s){const i=s?s-1:Number.POSITIVE_INFINITY;let r=0;return a;function a(c){return Kt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Kt(c)&&r++a))return;const T=t.events.length;let k=T,A,j;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(A){j=t.events[k][1].end;break}A=!0}for(y(s),_=T;_E;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=E}function x(){i.write([null]),r=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kpe(e,t,n){return nn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pf(e){if(e===null||Fn(e)||wu(e))return 1;if(Yx(e))return 2}function Wx(e,t,n){const s=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[s][1].end},h={...e[n][1].start};KM(f,-c),KM(h,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[s][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},r={type:c>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...l.end}},e[s][1].end={...a.start},e[n][1].start={...l.end},u=[],e[s][1].end.offset-e[s][1].start.offset&&(u=ta(u,[["enter",e[s][1],t],["exit",e[s][1],t]])),u=ta(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",r,t]]),u=ta(u,Wx(t.parser.constructs.insideSpan.null,e.slice(s+1,n),t)),u=ta(u,[["exit",r,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ta(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Ur(e,s-1,n-s+3,u),n=s+u.length-d-2;break}}for(n=-1;++n0&&Kt(_)?nn(e,x,"linePrefix",r+1)(_):x(_)}function x(_){return _===null||pt(_)?e.check(qM,b,w)(_):(e.enter("codeFlowValue"),E(_))}function E(_){return _===null||pt(_)?(e.exit("codeFlowValue"),x(_)):(e.consume(_),E)}function w(_){return e.exit("codeFenced"),t(_)}function S(_,T,k){let A=0;return j;function j(F){return _.enter("lineEnding"),_.consume(F),_.exit("lineEnding"),R}function R(F){return _.enter("codeFencedFence"),Kt(F)?nn(_,B,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):B(F)}function B(F){return F===l?(_.enter("codeFencedFenceSequence"),z(F)):k(F)}function z(F){return F===l?(A++,_.consume(F),z):A>=a?(_.exit("codeFencedFenceSequence"),Kt(F)?nn(_,L,"whitespace")(F):L(F)):k(F)}function L(F){return F===null||pt(F)?(_.exit("codeFencedFence"),T(F)):k(F)}}}function Upe(e,t,n){const s=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r)}function r(a){return s.parser.lazy[s.now().line]?n(a):t(a)}}const xw={name:"codeIndented",tokenize:$pe},Fpe={partial:!0,tokenize:Hpe};function $pe(e,t,n){const s=this;return i;function i(u){return e.enter("codeIndented"),nn(e,r,"linePrefix",5)(u)}function r(u){const d=s.events[s.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):pt(u)?e.attempt(Fpe,a,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||pt(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Hpe(e,t,n){const s=this;return i;function i(a){return s.parser.lazy[s.now().line]?n(a):pt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):nn(e,r,"linePrefix",5)(a)}function r(a){const l=s.events[s.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):pt(a)?i(a):n(a)}}const zpe={name:"codeText",previous:Gpe,resolve:Vpe,tokenize:Kpe};function Vpe(e){let t=e.length-4,n=3,s,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=n;++s=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,n,s){const i=n||0;this.setCursor(Math.trunc(t));const r=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return s&&Zh(this.left,s),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Zh(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Zh(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(s.parser.constructs.flow,n,t)(a)}}function q7(e,t,n,s,i,r,a,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return f;function f(y){return y===60?(e.enter(s),e.enter(i),e.enter(r),e.consume(y),e.exit(r),h):y===null||y===32||y===41||S1(y)?n(y):(e.enter(s),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(r),e.consume(y),e.exit(r),e.exit(i),e.exit(s),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),h(y)):y===null||y===60||pt(y)?n(y):(e.consume(y),y===92?m:p)}function m(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!d&&(y===null||y===41||Fn(y))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(s),t(y)):d999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(r),e.enter(i),e.consume(p),e.exit(i),e.exit(s),t):pt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||pt(p)||l++>999?(e.exit("chunkString"),d(p)):(e.consume(p),c||(c=!Kt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,f):f(p)}}function W7(e,t,n,s,i,r){let a;return l;function l(h){return h===34||h===39||h===40?(e.enter(s),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,c):n(h)}function c(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(s),t):(e.enter(r),u(h))}function u(h){return h===a?(e.exit(r),c(a)):h===null?n(h):pt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),nn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||pt(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Jp(e,t){let n;return s;function s(i){return pt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,s):Kt(i)?nn(e,s,n?"linePrefix":"lineSuffix")(i):t(i)}}const eme={name:"definition",tokenize:nme},tme={partial:!0,tokenize:sme};function nme(e,t,n){const s=this;let i;return r;function r(p){return e.enter("definition"),a(p)}function a(p){return Y7.call(s,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Ba(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Fn(p)?Jp(e,u)(p):u(p)}function u(p){return q7(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(tme,f,f)(p)}function f(p){return Kt(p)?nn(e,h,"whitespace")(p):h(p)}function h(p){return p===null||pt(p)?(e.exit("definition"),s.parser.defined.push(i),t(p)):n(p)}}function sme(e,t,n){return s;function s(l){return Fn(l)?Jp(e,i)(l):n(l)}function i(l){return W7(e,r,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function r(l){return Kt(l)?nn(e,a,"whitespace")(l):a(l)}function a(l){return l===null||pt(l)?t(l):n(l)}}const ime={name:"hardBreakEscape",tokenize:rme};function rme(e,t,n){return s;function s(r){return e.enter("hardBreakEscape"),e.consume(r),i}function i(r){return pt(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}const ame={name:"headingAtx",resolve:ome,tokenize:lme};function ome(e,t){let n=e.length-2,s=3,i,r;return e[s][1].type==="whitespace"&&(s+=2),n-2>s&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(s===n-1||n-4>s&&e[n-2][1].type==="whitespace")&&(n-=s+1===n?2:4),n>s&&(i={type:"atxHeadingText",start:e[s][1].start,end:e[n][1].end},r={type:"chunkText",start:e[s][1].start,end:e[n][1].end,contentType:"text"},Ur(e,s,n-s+1,[["enter",i,t],["enter",r,t],["exit",r,t],["exit",i,t]])),e}function lme(e,t,n){let s=0;return i;function i(d){return e.enter("atxHeading"),r(d)}function r(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&s++<6?(e.consume(d),a):d===null||Fn(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||pt(d)?(e.exit("atxHeading"),t(d)):Kt(d)?nn(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Fn(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const cme=["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"],WM=["pre","script","style","textarea"],ume={concrete:!0,name:"htmlFlow",resolveTo:hme,tokenize:pme},dme={partial:!0,tokenize:gme},fme={partial:!0,tokenize:mme};function hme(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function pme(e,t,n){const s=this;let i,r,a,l,c;return u;function u(P){return d(P)}function d(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),h):P===47?(e.consume(P),r=!0,b):P===63?(e.consume(P),i=3,s.interrupt?t:O):Qi(P)?(e.consume(P),a=String.fromCharCode(P),v):n(P)}function h(P){return P===45?(e.consume(P),i=2,p):P===91?(e.consume(P),i=5,l=0,m):Qi(P)?(e.consume(P),i=4,s.interrupt?t:O):n(P)}function p(P){return P===45?(e.consume(P),s.interrupt?t:O):n(P)}function m(P){const Q="CDATA[";return P===Q.charCodeAt(l++)?(e.consume(P),l===Q.length?s.interrupt?t:B:m):n(P)}function b(P){return Qi(P)?(e.consume(P),a=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||Fn(P)){const Q=P===47,ee=a.toLowerCase();return!Q&&!r&&WM.includes(ee)?(i=1,s.interrupt?t(P):B(P)):cme.includes(a.toLowerCase())?(i=6,Q?(e.consume(P),y):s.interrupt?t(P):B(P)):(i=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(P):r?x(P):E(P))}return P===45||Ui(P)?(e.consume(P),a+=String.fromCharCode(P),v):n(P)}function y(P){return P===62?(e.consume(P),s.interrupt?t:B):n(P)}function x(P){return Kt(P)?(e.consume(P),x):j(P)}function E(P){return P===47?(e.consume(P),j):P===58||P===95||Qi(P)?(e.consume(P),w):Kt(P)?(e.consume(P),E):j(P)}function w(P){return P===45||P===46||P===58||P===95||Ui(P)?(e.consume(P),w):S(P)}function S(P){return P===61?(e.consume(P),_):Kt(P)?(e.consume(P),S):E(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),c=P,T):Kt(P)?(e.consume(P),_):k(P)}function T(P){return P===c?(e.consume(P),c=null,A):P===null||pt(P)?n(P):(e.consume(P),T)}function k(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Fn(P)?S(P):(e.consume(P),k)}function A(P){return P===47||P===62||Kt(P)?E(P):n(P)}function j(P){return P===62?(e.consume(P),R):n(P)}function R(P){return P===null||pt(P)?B(P):Kt(P)?(e.consume(P),R):n(P)}function B(P){return P===45&&i===2?(e.consume(P),C):P===60&&i===1?(e.consume(P),I):P===62&&i===4?(e.consume(P),te):P===63&&i===3?(e.consume(P),O):P===93&&i===5?(e.consume(P),$):pt(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(dme,se,z)(P)):P===null||pt(P)?(e.exit("htmlFlowData"),z(P)):(e.consume(P),B)}function z(P){return e.check(fme,L,se)(P)}function L(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),F}function F(P){return P===null||pt(P)?z(P):(e.enter("htmlFlowData"),B(P))}function C(P){return P===45?(e.consume(P),O):B(P)}function I(P){return P===47?(e.consume(P),a="",D):B(P)}function D(P){if(P===62){const Q=a.toLowerCase();return WM.includes(Q)?(e.consume(P),te):B(P)}return Qi(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),D):B(P)}function $(P){return P===93?(e.consume(P),O):B(P)}function O(P){return P===62?(e.consume(P),te):P===45&&i===2?(e.consume(P),O):B(P)}function te(P){return P===null||pt(P)?(e.exit("htmlFlowData"),se(P)):(e.consume(P),te)}function se(P){return e.exit("htmlFlow"),t(P)}}function mme(e,t,n){const s=this;return i;function i(a){return pt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r):n(a)}function r(a){return s.parser.lazy[s.now().line]?n(a):t(a)}}function gme(e,t,n){return s;function s(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Rg,t,n)}}const bme={name:"htmlText",tokenize:yme};function yme(e,t,n){const s=this;let i,r,a;return l;function l(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),c}function c(O){return O===33?(e.consume(O),u):O===47?(e.consume(O),S):O===63?(e.consume(O),E):Qi(O)?(e.consume(O),k):n(O)}function u(O){return O===45?(e.consume(O),d):O===91?(e.consume(O),r=0,m):Qi(O)?(e.consume(O),x):n(O)}function d(O){return O===45?(e.consume(O),p):n(O)}function f(O){return O===null?n(O):O===45?(e.consume(O),h):pt(O)?(a=f,I(O)):(e.consume(O),f)}function h(O){return O===45?(e.consume(O),p):f(O)}function p(O){return O===62?C(O):O===45?h(O):f(O)}function m(O){const te="CDATA[";return O===te.charCodeAt(r++)?(e.consume(O),r===te.length?b:m):n(O)}function b(O){return O===null?n(O):O===93?(e.consume(O),v):pt(O)?(a=b,I(O)):(e.consume(O),b)}function v(O){return O===93?(e.consume(O),y):b(O)}function y(O){return O===62?C(O):O===93?(e.consume(O),y):b(O)}function x(O){return O===null||O===62?C(O):pt(O)?(a=x,I(O)):(e.consume(O),x)}function E(O){return O===null?n(O):O===63?(e.consume(O),w):pt(O)?(a=E,I(O)):(e.consume(O),E)}function w(O){return O===62?C(O):E(O)}function S(O){return Qi(O)?(e.consume(O),_):n(O)}function _(O){return O===45||Ui(O)?(e.consume(O),_):T(O)}function T(O){return pt(O)?(a=T,I(O)):Kt(O)?(e.consume(O),T):C(O)}function k(O){return O===45||Ui(O)?(e.consume(O),k):O===47||O===62||Fn(O)?A(O):n(O)}function A(O){return O===47?(e.consume(O),C):O===58||O===95||Qi(O)?(e.consume(O),j):pt(O)?(a=A,I(O)):Kt(O)?(e.consume(O),A):C(O)}function j(O){return O===45||O===46||O===58||O===95||Ui(O)?(e.consume(O),j):R(O)}function R(O){return O===61?(e.consume(O),B):pt(O)?(a=R,I(O)):Kt(O)?(e.consume(O),R):A(O)}function B(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),i=O,z):pt(O)?(a=B,I(O)):Kt(O)?(e.consume(O),B):(e.consume(O),L)}function z(O){return O===i?(e.consume(O),i=void 0,F):O===null?n(O):pt(O)?(a=z,I(O)):(e.consume(O),z)}function L(O){return O===null||O===34||O===39||O===60||O===61||O===96?n(O):O===47||O===62||Fn(O)?A(O):(e.consume(O),L)}function F(O){return O===47||O===62||Fn(O)?A(O):n(O)}function C(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),t):n(O)}function I(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),D}function D(O){return Kt(O)?nn(e,$,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):$(O)}function $(O){return e.enter("htmlTextData"),a(O)}}const Y2={name:"labelEnd",resolveAll:wme,resolveTo:_me,tokenize:Sme},xme={tokenize:Nme},Eme={tokenize:Tme},vme={tokenize:kme};function wme(e){let t=-1;const n=[];for(;++t=3&&(u===null||pt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),s++,c):(e.exit("thematicBreakSequence"),Kt(u)?nn(e,l,"whitespace")(u):l(u))}}const ur={continuation:{tokenize:Pme},exit:Ume,name:"list",tokenize:Dme},Mme={partial:!0,tokenize:Fme},Lme={partial:!0,tokenize:Bme};function Dme(e,t,n){const s=this,i=s.events[s.events.length-1];let r=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(p){const m=s.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!s.containerState.marker||p===s.containerState.marker:bN(p)){if(s.containerState.type||(s.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(ay,n,u)(p):u(p);if(!s.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return bN(p)&&++a<10?(e.consume(p),c):(!s.interrupt||a<2)&&(s.containerState.marker?p===s.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||p,e.check(Rg,s.interrupt?n:d,e.attempt(Mme,h,f))}function d(p){return s.containerState.initialBlankLine=!0,r++,h(p)}function f(p){return Kt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return s.containerState.size=r+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Pme(e,t,n){const s=this;return s.containerState._closeFlow=void 0,e.check(Rg,i,r);function i(l){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,nn(e,t,"listItemIndent",s.containerState.size+1)(l)}function r(l){return s.containerState.furtherBlankLines||!Kt(l)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,a(l)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(Lme,t,a)(l))}function a(l){return s.containerState._closeFlow=!0,s.interrupt=void 0,nn(e,e.attempt(ur,t,n),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Bme(e,t,n){const s=this;return nn(e,i,"listItemIndent",s.containerState.size+1);function i(r){const a=s.events[s.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===s.containerState.size?t(r):n(r)}}function Ume(e){e.exit(this.containerState.type)}function Fme(e,t,n){const s=this;return nn(e,i,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(r){const a=s.events[s.events.length-1];return!Kt(r)&&a&&a[1].type==="listItemPrefixWhitespace"?t(r):n(r)}}const XM={name:"setextUnderline",resolveTo:$me,tokenize:Hme};function $me(e,t){let n=e.length,s,i,r;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){s=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!r&&e[n][1].type==="definition"&&(r=n);const a={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",r?(e.splice(i,0,["enter",a,t]),e.splice(r+1,0,["exit",e[s][1],t]),e[s][1].end={...e[r][1].end}):e[s][1]=a,e.push(["exit",a,t]),e}function Hme(e,t,n){const s=this;let i;return r;function r(u){let d=s.events.length,f;for(;d--;)if(s.events[d][1].type!=="lineEnding"&&s.events[d][1].type!=="linePrefix"&&s.events[d][1].type!=="content"){f=s.events[d][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||f)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),Kt(u)?nn(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||pt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const zme={tokenize:Vme};function Vme(e){const t=this,n=e.attempt(Rg,s,e.attempt(this.parser.constructs.flowInitial,i,nn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Wpe,i)),"linePrefix")));return n;function s(r){if(r===null){e.consume(r);return}return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Gme={resolveAll:Q7()},Kme=X7("string"),qme=X7("text");function X7(e){return{resolveAll:Q7(e==="text"?Yme:void 0),tokenize:t};function t(n){const s=this,i=this.parser.constructs[e],r=n.attempt(i,a,l);return a;function a(d){return u(d)?r(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),r(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h-1){const l=a[0];typeof l=="string"?a[0]=l.slice(s):a.shift()}r>0&&a.push(e[i].slice(0,r))}return a}function oge(e,t){let n=-1;const s=[];let i;for(;++n0){const at=Z.tokenStack[Z.tokenStack.length-1];(at[1]||QM).call(Z,void 0,at[0])}for(oe.position={start:vl(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:vl(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe0){const lt=Z.tokenStack[Z.tokenStack.length-1];(lt[1]||ZM).call(Z,void 0,lt[0])}for(oe.position={start:Sl(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Sl(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Me=-1;++Me0&&(s.className=["language-"+i[0]]);let r={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(r.data={meta:t.meta}),e.patch(t,r),r=e.applyData(t,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(t,r),r}function vge(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wge(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _ge(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),i=fh(s.toLowerCase()),r=e.footnoteOrder.indexOf(s);let a,l=e.footnoteCounts.get(s);l===void 0?(l=0,e.footnoteOrder.push(s),a=e.footnoteOrder.length):a=r+1,l+=1,e.footnoteCounts.set(s,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function Sge(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nge(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function J7(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const i=e.all(t),r=i[0];r&&r.type==="text"?r.value="["+r.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=s:i.push({type:"text",value:s}),i}function Tge(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return J7(e,t);const i={src:fh(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(i.title=s.title);const r={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,r),e.applyData(t,r)}function kge(e,t){const n={src:fh(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function Age(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function Cge(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return J7(e,t);const i={href:fh(s.url||"")};s.title!==null&&s.title!==void 0&&(i.title=s.title);const r={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ige(e,t){const n={href:fh(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function jge(e,t,n){const s=e.all(t),i=n?Rge(n):eF(t),r={},a=[];if(typeof t.checked=="boolean"){const d=s[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},s.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let l=-1;for(;++l0&&(s.className=["language-"+i[0]]);let r={type:"element",tagName:"code",properties:s,children:[{type:"text",value:n}]};return t.meta&&(r.data={meta:t.meta}),e.patch(t,r),r=e.applyData(t,r),r={type:"element",tagName:"pre",properties:{},children:[r]},e.patch(t,r),r}function vge(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wge(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _ge(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),i=uh(s.toLowerCase()),r=e.footnoteOrder.indexOf(s);let a,l=e.footnoteCounts.get(s);l===void 0?(l=0,e.footnoteOrder.push(s),a=e.footnoteOrder.length):a=r+1,l+=1,e.footnoteCounts.set(s,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function Sge(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nge(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function eF(e,t){const n=t.referenceType;let s="]";if(n==="collapsed"?s+="[]":n==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const i=e.all(t),r=i[0];r&&r.type==="text"?r.value="["+r.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=s:i.push({type:"text",value:s}),i}function Tge(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return eF(e,t);const i={src:uh(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(i.title=s.title);const r={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,r),e.applyData(t,r)}function kge(e,t){const n={src:uh(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,s),e.applyData(t,s)}function Age(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const s={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,s),e.applyData(t,s)}function Cge(e,t){const n=String(t.identifier).toUpperCase(),s=e.definitionById.get(n);if(!s)return eF(e,t);const i={href:uh(s.url||"")};s.title!==null&&s.title!==void 0&&(i.title=s.title);const r={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ige(e,t){const n={href:uh(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const s={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function jge(e,t,n){const s=e.all(t),i=n?Rge(n):tF(t),r={},a=[];if(typeof t.checked=="boolean"){const d=s[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},s.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let l=-1;for(;++l1}function Oge(e,t){const n={},s=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=fo(t.children[1]),c=Kx(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),i.push(a)}const r={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,r),e.applyData(t,r)}function Bge(e,t,n){const s=n?n.children:void 0,r=(s?s.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),s[0]),i=s.index+s[0].length,s=n.exec(t);return r.push(eL(t.slice(i),i>0,!1)),r.join("")}function eL(e,t,n){let s=0,i=e.length;if(t){let r=e.codePointAt(s);for(;r===ZM||r===JM;)s++,r=e.codePointAt(s)}if(n){let r=e.codePointAt(i-1);for(;r===ZM||r===JM;)i--,r=e.codePointAt(i-1)}return i>s?e.slice(s,i):""}function $ge(e,t){const n={type:"text",value:Fge(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Hge(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zge={blockquote:yge,break:xge,code:Ege,delete:vge,emphasis:wge,footnoteReference:_ge,heading:Sge,html:Nge,imageReference:Tge,image:kge,inlineCode:Age,linkReference:Cge,link:Ige,listItem:jge,list:Oge,paragraph:Mge,root:Lge,strong:Dge,table:Pge,tableCell:Uge,tableRow:Bge,text:$ge,thematicBreak:Hge,toml:tb,yaml:tb,definition:tb,footnoteDefinition:tb};function tb(){}const tF=-1,Wx=0,sp=1,S1=2,W2=3,X2=4,Q2=5,Z2=6,nF=7,sF=8,Vge=typeof self=="object"?self:globalThis,tL=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Vge[e](t)},Gge=(e,t)=>{const n=(i,r)=>(e.set(r,i),i),s=i=>{if(e.has(i))return e.get(i);const[r,a]=t[i];switch(r){case Wx:case tF:return n(a,i);case sp:{const l=n([],i);for(const c of a)l.push(s(c));return l}case S1:{const l=n({},i);for(const[c,u]of a)l[s(c)]=s(u);return l}case W2:return n(new Date(a),i);case X2:{const{source:l,flags:c}=a;return n(new RegExp(l,c),i)}case Q2:{const l=n(new Map,i);for(const[c,u]of a)l.set(s(c),s(u));return l}case Z2:{const l=n(new Set,i);for(const c of a)l.add(s(c));return l}case nF:{const{name:l,message:c}=a;return n(tL(l,c),i)}case sF:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(tL(r,a),i)};return s},nL=e=>Gge(new Map,e)(0),sd="",{toString:Kge}={},{keys:qge}=Object,nm=e=>{const t=typeof e;if(t!=="object"||!e)return[Wx,t];const n=Kge.call(e).slice(8,-1);switch(n){case"Array":return[sp,sd];case"Object":return[S1,sd];case"Date":return[W2,sd];case"RegExp":return[X2,sd];case"Map":return[Q2,sd];case"Set":return[Z2,sd];case"DataView":return[sp,n]}return n.includes("Array")?[sp,n]:n.includes("Error")?[nF,n]:[S1,n]},nb=([e,t])=>e===Wx&&(t==="function"||t==="symbol"),Yge=(e,t,n,s)=>{const i=(a,l)=>{const c=s.push(a)-1;return n.set(l,c),c},r=a=>{if(n.has(a))return n.get(a);let[l,c]=nm(a);switch(l){case Wx:{let d=a;switch(c){case"bigint":l=sF,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([tF],a)}return i([l,d],a)}case sp:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),i([c,[...h]],a)}const d=[],f=i([l,d],a);for(const h of a)d.push(r(h));return f}case S1:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return r(a.toJSON());const d=[],f=i([l,d],a);for(const h of qge(a))(e||!nb(nm(a[h])))&&d.push([r(h),r(a[h])]);return f}case W2:return i([l,a.toISOString()],a);case X2:{const{source:d,flags:f}=a;return i([l,{source:d,flags:f}],a)}case Q2:{const d=[],f=i([l,d],a);for(const[h,m]of a)(e||!(nb(nm(h))||nb(nm(m))))&&d.push([r(h),r(m)]);return f}case Z2:{const d=[],f=i([l,d],a);for(const h of a)(e||!nb(nm(h)))&&d.push(r(h));return f}}const{message:u}=a;return i([l,{name:c,message:u}],a)};return r},sL=(e,{json:t,lossy:n}={})=>{const s=[];return Yge(!(t||n),!!t,new Map,s)(e),s},Ff=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?nL(sL(e,t)):structuredClone(e):(e,t)=>nL(sL(e,t));function Wge(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Xge(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Qge(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Wge,s=e.options.footnoteBackLabel||Xge,i=e.options.footnoteLabel||"Footnotes",r=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&p.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,m);typeof x=="string"&&(x={type:"text",value:x}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,m),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...p)}else d.push(...p);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...Ff(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const u={type:"element",tagName:"li",properties:r,children:a};return e.patch(t,u),e.applyData(t,u)}function Rge(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let s=-1;for(;!t&&++s1}function Oge(e,t){const n={},s=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=yo(t.children[1]),c=qx(t.children[t.children.length-1]);l&&c&&(a.position={start:l,end:c}),i.push(a)}const r={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,r),e.applyData(t,r)}function Bge(e,t,n){const s=n?n.children:void 0,r=(s?s.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),s[0]),i=s.index+s[0].length,s=n.exec(t);return r.push(tL(t.slice(i),i>0,!1)),r.join("")}function tL(e,t,n){let s=0,i=e.length;if(t){let r=e.codePointAt(s);for(;r===JM||r===eL;)s++,r=e.codePointAt(s)}if(n){let r=e.codePointAt(i-1);for(;r===JM||r===eL;)i--,r=e.codePointAt(i-1)}return i>s?e.slice(s,i):""}function $ge(e,t){const n={type:"text",value:Fge(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Hge(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const zge={blockquote:yge,break:xge,code:Ege,delete:vge,emphasis:wge,footnoteReference:_ge,heading:Sge,html:Nge,imageReference:Tge,image:kge,inlineCode:Age,linkReference:Cge,link:Ige,listItem:jge,list:Oge,paragraph:Mge,root:Lge,strong:Dge,table:Pge,tableCell:Uge,tableRow:Bge,text:$ge,thematicBreak:Hge,toml:nb,yaml:nb,definition:nb,footnoteDefinition:nb};function nb(){}const nF=-1,Xx=0,em=1,N1=2,W2=3,X2=4,Q2=5,Z2=6,sF=7,iF=8,Vge=typeof self=="object"?self:globalThis,nL=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Vge[e](t)},Gge=(e,t)=>{const n=(i,r)=>(e.set(r,i),i),s=i=>{if(e.has(i))return e.get(i);const[r,a]=t[i];switch(r){case Xx:case nF:return n(a,i);case em:{const l=n([],i);for(const c of a)l.push(s(c));return l}case N1:{const l=n({},i);for(const[c,u]of a)l[s(c)]=s(u);return l}case W2:return n(new Date(a),i);case X2:{const{source:l,flags:c}=a;return n(new RegExp(l,c),i)}case Q2:{const l=n(new Map,i);for(const[c,u]of a)l.set(s(c),s(u));return l}case Z2:{const l=n(new Set,i);for(const c of a)l.add(s(c));return l}case sF:{const{name:l,message:c}=a;return n(nL(l,c),i)}case iF:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:l}=new Uint8Array(a);return n(new DataView(l),a)}}return n(nL(r,a),i)};return s},sL=e=>Gge(new Map,e)(0),td="",{toString:Kge}={},{keys:qge}=Object,Jh=e=>{const t=typeof e;if(t!=="object"||!e)return[Xx,t];const n=Kge.call(e).slice(8,-1);switch(n){case"Array":return[em,td];case"Object":return[N1,td];case"Date":return[W2,td];case"RegExp":return[X2,td];case"Map":return[Q2,td];case"Set":return[Z2,td];case"DataView":return[em,n]}return n.includes("Array")?[em,n]:n.includes("Error")?[sF,n]:[N1,n]},sb=([e,t])=>e===Xx&&(t==="function"||t==="symbol"),Yge=(e,t,n,s)=>{const i=(a,l)=>{const c=s.push(a)-1;return n.set(l,c),c},r=a=>{if(n.has(a))return n.get(a);let[l,c]=Jh(a);switch(l){case Xx:{let d=a;switch(c){case"bigint":l=iF,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([nF],a)}return i([l,d],a)}case em:{if(c){let h=a;return c==="DataView"?h=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(a)),i([c,[...h]],a)}const d=[],f=i([l,d],a);for(const h of a)d.push(r(h));return f}case N1:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return r(a.toJSON());const d=[],f=i([l,d],a);for(const h of qge(a))(e||!sb(Jh(a[h])))&&d.push([r(h),r(a[h])]);return f}case W2:return i([l,a.toISOString()],a);case X2:{const{source:d,flags:f}=a;return i([l,{source:d,flags:f}],a)}case Q2:{const d=[],f=i([l,d],a);for(const[h,p]of a)(e||!(sb(Jh(h))||sb(Jh(p))))&&d.push([r(h),r(p)]);return f}case Z2:{const d=[],f=i([l,d],a);for(const h of a)(e||!sb(Jh(h)))&&d.push(r(h));return f}}const{message:u}=a;return i([l,{name:c,message:u}],a)};return r},iL=(e,{json:t,lossy:n}={})=>{const s=[];return Yge(!(t||n),!!t,new Map,s)(e),s},Bf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?sL(iL(e,t)):structuredClone(e):(e,t)=>sL(iL(e,t));function Wge(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Xge(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Qge(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Wge,s=e.options.footnoteBackLabel||Xge,i=e.options.footnoteLabel||"Footnotes",r=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(c,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else d.push(...m);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...Bf(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const Dg=function(e){if(e==null)return t0e;if(typeof e=="function")return Xx(e);if(typeof e=="object")return Array.isArray(e)?Zge(e):Jge(e);if(typeof e=="string")return e0e(e);throw new Error("Expected function, string, or object as test")};function Zge(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let m=iF,p,b,v;if((!t||r(c,u,d[d.length-1]||void 0))&&(m=r0e(n(c,d)),m[0]===xN))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==i0e)for(b=(s?y.children.length:-1)+a,v=d.concat(y);b>-1&&b":""))+")"})}return h;function h(){let p=rF,m,b,v;if((!t||r(c,u,d[d.length-1]||void 0))&&(p=r0e(n(c,d)),p[0]===xN))return p;if("children"in c&&c.children){const y=c;if(y.children&&p[0]!==i0e)for(b=(s?y.children.length:-1)+a,v=d.concat(y);b>-1&&b0&&n.push({type:"text",value:` -`}),n}function iL(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function rL(e,t){const n=o0e(e,t),s=n.one(e,void 0),i=Qge(n),r=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return i&&r.children.push({type:"text",value:` -`},i),r}function f0e(e,t){return e&&"run"in e?async function(n,s){const i=rL(n,{file:s,...t});await e.run(i,s)}:function(n,s){return rL(n,{file:s,...e||t})}}function aL(e){if(e)throw e}var ay=Object.prototype.hasOwnProperty,aF=Object.prototype.toString,oL=Object.defineProperty,lL=Object.getOwnPropertyDescriptor,cL=function(t){return typeof Array.isArray=="function"?Array.isArray(t):aF.call(t)==="[object Array]"},uL=function(t){if(!t||aF.call(t)!=="[object Object]")return!1;var n=ay.call(t,"constructor"),s=t.constructor&&t.constructor.prototype&&ay.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!s)return!1;var i;for(i in t);return typeof i>"u"||ay.call(t,i)},dL=function(t,n){oL&&n.name==="__proto__"?oL(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},fL=function(t,n){if(n==="__proto__")if(ay.call(t,n)){if(lL)return lL(t,n).value}else return;return t[n]},h0e=function e(){var t,n,s,i,r,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(i);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(r,i):c instanceof Error?i(c):r(c))}function i(a,...l){n||(n=!0,t(a,...l))}function r(a){i(null,a)}}const Wa={basename:g0e,dirname:b0e,extname:y0e,join:x0e,sep:"/"};function g0e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Bg(e);let n=0,s=-1,i=e.length,r;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(r){n=i+1;break}}else s<0&&(r=!0,s=i+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(r){n=i+1;break}}else a<0&&(r=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(s=i):(l=-1,s=a));return n===s?s=a:s<0&&(s=e.length),e.slice(n,s)}function b0e(e){if(Bg(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function y0e(e){Bg(e);let t=e.length,n=-1,s=0,i=-1,r=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){s=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:r!==1&&(r=1):i>-1&&(r=-1)}return i<0||n<0||r===0||r===1&&i===n-1&&i===s+1?"":e.slice(i,n)}function x0e(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function v0e(e,t){let n="",s=0,i=-1,r=0,a=-1,l,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",s=0):(n=n.slice(0,c),s=n.length-1-n.lastIndexOf("/")),i=a,r=0;continue}}else if(n.length>0){n="",s=0,i=a,r=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),s=a-i-1;i=a,r=0}else l===46&&r>-1?r++:r=-1}return n}function Bg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const w0e={cwd:_0e};function _0e(){return"/"}function wN(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function S0e(e){if(typeof e=="string")e=new URL(e);else if(!wN(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return N0e(e)}function N0e(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n0){let[m,...p]=d;const b=s[h][1];vN(b)&&vN(m)&&(m=vw(!0,b,m)),s[h]=[u,m,...p]}}}}const C0e=new J2().freeze();function Nw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Tw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function kw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function mL(e){if(!vN(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function pL(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function sb(e){return I0e(e)?e:new oF(e)}function I0e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function j0e(e){return typeof e=="string"||R0e(e)}function R0e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const O0e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gL=[],bL={allowDangerousHtml:!0},M0e=/^(https?|ircs?|mailto|xmpp)$/i,L0e=[{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:"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 D0e(e){const t=P0e(e),n=B0e(e);return U0e(t.runSync(t.parse(n),n),e)}function P0e(e){const t=e.rehypePlugins||gL,n=e.remarkPlugins||gL,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bL}:bL;return C0e().use(bge).use(n).use(f0e,s).use(t)}function B0e(e){const t=e.children||"",n=new oF;return typeof t=="string"&&(n.value=t),n}function U0e(e,t){const n=t.allowedElements,s=t.allowElement,i=t.components,r=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||F0e;for(const d of L0e)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+O0e+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Pg(e,u),eme(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let m;for(m in yw)if(Object.hasOwn(yw,m)&&Object.hasOwn(d.properties,m)){const p=d.properties[m],b=yw[m];(b===null||b.includes(d.tagName))&&(d.properties[m]=c(String(p||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):r?r.includes(d.tagName):!1;if(!m&&s&&typeof f=="number"&&(m=!s(d,f,h)),m&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function F0e(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||s!==-1&&t>s||M0e.test(e.slice(0,t))?e:""}function yL(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,i=n.indexOf(t);for(;i!==-1;)s++,i=n.indexOf(t,i+t.length);return s}function $0e(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function H0e(e,t,n){const i=Dg((n||{}).ignore||[]),r=z0e(t);let a=-1;for(;++a0?{type:"text",value:_}:void 0),_===!1?h.lastIndex=w+1:(p!==w&&x.push({type:"text",value:u.value.slice(p,w)}),Array.isArray(_)?x.push(..._):_&&x.push(_),p=w+E[0].length,y=!0),!h.global)break;E=h.exec(u.value)}return y?(p?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const i=yL(e,"(");let r=yL(e,")");for(;s!==-1&&i>r;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),r++;return[e,n]}function lF(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Eu(n)||qx(n))&&(!t||n!==47)}cF.peek=fbe;function ibe(){this.buffer()}function rbe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function abe(){this.buffer()}function obe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lbe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cbe(e){this.exit(e)}function ube(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dbe(e){this.exit(e)}function fbe(){return"["}function cF(e,t,n,s){const i=n.createTracker(s);let r=i.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return r+=i.move(n.safe(n.associationId(e),{after:"]",before:r})),l(),a(),r+=i.move("]"),r}function hbe(){return{enter:{gfmFootnoteCallString:ibe,gfmFootnoteCall:rbe,gfmFootnoteDefinitionLabelString:abe,gfmFootnoteDefinition:obe},exit:{gfmFootnoteCallString:lbe,gfmFootnoteCall:cbe,gfmFootnoteDefinitionLabelString:ube,gfmFootnoteDefinition:dbe}}}function mbe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cF},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,i,r,a){const l=r.createTracker(a);let c=l.move("[^");const u=r.enter("footnoteDefinition"),d=r.enter("label");return c+=l.move(r.safe(r.associationId(s),{before:c,after:"]"})),d(),c+=l.move("]:"),s.children&&s.children.length>0&&(l.shift(4),c+=l.move((t?` -`:" ")+r.indentLines(r.containerFlow(s,l.current()),t?uF:pbe))),u(),c}}function pbe(e,t,n){return t===0?e:uF(e,t,n)}function uF(e,t,n){return(n?"":" ")+e}const gbe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];dF.peek=vbe;function bbe(){return{canContainEols:["delete"],enter:{strikethrough:xbe},exit:{strikethrough:Ebe}}}function ybe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gbe}],handlers:{delete:dF}}}function xbe(e){this.enter({type:"delete",children:[]},e)}function Ebe(e){this.exit(e)}function dF(e,t,n,s){const i=n.createTracker(s),r=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),r(),a}function vbe(){return"~"}function wbe(e){return e.length}function _be(e,t){const n=t||{},s=(n.align||[]).concat(),i=n.stringLength||wbe,r=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=E)}b.push(x)}a[d]=b,l[d]=v}let f=-1;if(typeof s=="object"&&"length"in s)for(;++fc[f]&&(c[f]=x),m[f]=x),h[f]=E}a.splice(1,0,h),l.splice(1,0,m),d=-1;const p=[];for(;++d "),r.shift(2);const a=n.indentLines(n.containerFlow(e,r.current()),Tbe);return i(),a}function Tbe(e,t,n){return">"+(n?"":" ")+e}function kbe(e,t){return vL(e,t.inConstruct,!0)&&!vL(e,t.notInConstruct,!1)}function vL(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++s"u"||oy.call(t,i)},fL=function(t,n){lL&&n.name==="__proto__"?lL(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},hL=function(t,n){if(n==="__proto__")if(oy.call(t,n)){if(cL)return cL(t,n).value}else return;return t[n]},h0e=function e(){var t,n,s,i,r,a,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});ca.length;let c;l&&a.push(i);try{c=e.apply(this,a)}catch(u){const d=u;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(r,i):c instanceof Error?i(c):r(c))}function i(a,...l){n||(n=!0,t(a,...l))}function r(a){i(null,a)}}const to={basename:g0e,dirname:b0e,extname:y0e,join:x0e,sep:"/"};function g0e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Lg(e);let n=0,s=-1,i=e.length,r;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(r){n=i+1;break}}else s<0&&(r=!0,s=i+1);return s<0?"":e.slice(n,s)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(r){n=i+1;break}}else a<0&&(r=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(s=i):(l=-1,s=a));return n===s?s=a:s<0&&(s=e.length),e.slice(n,s)}function b0e(e){if(Lg(e),e.length===0)return".";let t=-1,n=e.length,s;for(;--n;)if(e.codePointAt(n)===47){if(s){t=n;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function y0e(e){Lg(e);let t=e.length,n=-1,s=0,i=-1,r=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){s=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:r!==1&&(r=1):i>-1&&(r=-1)}return i<0||n<0||r===0||r===1&&i===n-1&&i===s+1?"":e.slice(i,n)}function x0e(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function v0e(e,t){let n="",s=0,i=-1,r=0,a=-1,l,c;for(;++a<=e.length;){if(a2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",s=0):(n=n.slice(0,c),s=n.length-1-n.lastIndexOf("/")),i=a,r=0;continue}}else if(n.length>0){n="",s=0,i=a,r=0;continue}}t&&(n=n.length>0?n+"/..":"..",s=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),s=a-i-1;i=a,r=0}else l===46&&r>-1?r++:r=-1}return n}function Lg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const w0e={cwd:_0e};function _0e(){return"/"}function wN(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function S0e(e){if(typeof e=="string")e=new URL(e);else if(!wN(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return N0e(e)}function N0e(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let n=-1;for(;++n0){let[p,...m]=d;const b=s[h][1];vN(b)&&vN(p)&&(p=vw(!0,b,p)),s[h]=[u,p,...m]}}}}const C0e=new J2().freeze();function Nw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Tw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function kw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function mL(e){if(!vN(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gL(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ib(e){return I0e(e)?e:new lF(e)}function I0e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function j0e(e){return typeof e=="string"||R0e(e)}function R0e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const O0e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bL=[],yL={allowDangerousHtml:!0},M0e=/^(https?|ircs?|mailto|xmpp)$/i,L0e=[{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:"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 D0e(e){const t=P0e(e),n=B0e(e);return U0e(t.runSync(t.parse(n),n),e)}function P0e(e){const t=e.rehypePlugins||bL,n=e.remarkPlugins||bL,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yL}:yL;return C0e().use(bge).use(n).use(f0e,s).use(t)}function B0e(e){const t=e.children||"",n=new lF;return typeof t=="string"&&(n.value=t),n}function U0e(e,t){const n=t.allowedElements,s=t.allowElement,i=t.components,r=t.disallowedElements,a=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||F0e;for(const d of L0e)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+O0e+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Mg(e,u),epe(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(d,f,h){if(d.type==="raw"&&h&&typeof f=="number")return a?h.children.splice(f,1):h.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let p;for(p in yw)if(Object.hasOwn(yw,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],b=yw[p];(b===null||b.includes(d.tagName))&&(d.properties[p]=c(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):r?r.includes(d.tagName):!1;if(!p&&s&&typeof f=="number"&&(p=!s(d,f,h)),p&&h&&typeof f=="number")return l&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function F0e(e){const t=e.indexOf(":"),n=e.indexOf("?"),s=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||s!==-1&&t>s||M0e.test(e.slice(0,t))?e:""}function xL(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let s=0,i=n.indexOf(t);for(;i!==-1;)s++,i=n.indexOf(t,i+t.length);return s}function $0e(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function H0e(e,t,n){const i=Og((n||{}).ignore||[]),r=z0e(t);let a=-1;for(;++a0?{type:"text",value:_}:void 0),_===!1?h.lastIndex=w+1:(m!==w&&x.push({type:"text",value:u.value.slice(m,w)}),Array.isArray(_)?x.push(..._):_&&x.push(_),m=w+E[0].length,y=!0),!h.global)break;E=h.exec(u.value)}return y?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],s=n.indexOf(")");const i=xL(e,"(");let r=xL(e,")");for(;s!==-1&&i>r;)e+=n.slice(0,s+1),n=n.slice(s+1),s=n.indexOf(")"),r++;return[e,n]}function cF(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wu(n)||Yx(n))&&(!t||n!==47)}uF.peek=fbe;function ibe(){this.buffer()}function rbe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function abe(){this.buffer()}function obe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lbe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ba(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cbe(e){this.exit(e)}function ube(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ba(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dbe(e){this.exit(e)}function fbe(){return"["}function uF(e,t,n,s){const i=n.createTracker(s);let r=i.move("[^");const a=n.enter("footnoteReference"),l=n.enter("reference");return r+=i.move(n.safe(n.associationId(e),{after:"]",before:r})),l(),a(),r+=i.move("]"),r}function hbe(){return{enter:{gfmFootnoteCallString:ibe,gfmFootnoteCall:rbe,gfmFootnoteDefinitionLabelString:abe,gfmFootnoteDefinition:obe},exit:{gfmFootnoteCallString:lbe,gfmFootnoteCall:cbe,gfmFootnoteDefinitionLabelString:ube,gfmFootnoteDefinition:dbe}}}function pbe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:uF},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(s,i,r,a){const l=r.createTracker(a);let c=l.move("[^");const u=r.enter("footnoteDefinition"),d=r.enter("label");return c+=l.move(r.safe(r.associationId(s),{before:c,after:"]"})),d(),c+=l.move("]:"),s.children&&s.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+r.indentLines(r.containerFlow(s,l.current()),t?dF:mbe))),u(),c}}function mbe(e,t,n){return t===0?e:dF(e,t,n)}function dF(e,t,n){return(n?"":" ")+e}const gbe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fF.peek=vbe;function bbe(){return{canContainEols:["delete"],enter:{strikethrough:xbe},exit:{strikethrough:Ebe}}}function ybe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gbe}],handlers:{delete:fF}}}function xbe(e){this.enter({type:"delete",children:[]},e)}function Ebe(e){this.exit(e)}function fF(e,t,n,s){const i=n.createTracker(s),r=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),r(),a}function vbe(){return"~"}function wbe(e){return e.length}function _be(e,t){const n=t||{},s=(n.align||[]).concat(),i=n.stringLength||wbe,r=[],a=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=E)}b.push(x)}a[d]=b,l[d]=v}let f=-1;if(typeof s=="object"&&"length"in s)for(;++fc[f]&&(c[f]=x),p[f]=x),h[f]=E}a.splice(1,0,h),l.splice(1,0,p),d=-1;const m=[];for(;++d "),r.shift(2);const a=n.indentLines(n.containerFlow(e,r.current()),Tbe);return i(),a}function Tbe(e,t,n){return">"+(n?"":" ")+e}function kbe(e,t){return wL(e,t.inConstruct,!0)&&!wL(e,t.notInConstruct,!1)}function wL(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let s=-1;for(;++sa&&(a=r):r=1,i=s+t.length,s=n.indexOf(t,i);return a}function Cbe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Ibe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function jbe(e,t,n,s){const i=Ibe(n),r=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(Cbe(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(r,Rbe);return f(),h}const l=n.createTracker(s),c=i.repeat(Math.max(Abe(r,i)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...l.current()})),f()}return d+=l.move(` `),r&&(d+=l.move(r+` `)),d+=l.move(c),u(),d}function Rbe(e,t,n){return(n?"":" ")+e}function eA(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Obe(e,t,n,s){const i=eA(n),r=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let l=n.enter("label");const c=n.createTracker(s);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` -`,...c.current()}))),l(),e.title&&(l=n.enter(`title${r}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),a(),u}function Mbe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xp(e){return"&#x"+e.toString(16).toUpperCase()+";"}function N1(e,t,n){const s=Uf(e),i=Uf(t);return s===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}hF.peek=Lbe;function hF(e,t,n,s){const i=Mbe(n),r=n.enter("emphasis"),a=n.createTracker(s),l=a.move(i);let c=a.move(n.containerPhrasing(e,{after:i,before:l,...a.current()}));const u=c.charCodeAt(0),d=N1(s.before.charCodeAt(s.before.length-1),u,i);d.inside&&(c=Xp(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=N1(s.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Xp(f));const m=a.move(i);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function Lbe(e,t,n){return n.options.emphasis||"*"}function Dbe(e,t){let n=!1;return Pg(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,xN}),!!((!e.depth||e.depth<3)&&K2(e)&&(t.options.setext||n))}function Pbe(e,t,n,s){const i=Math.max(Math.min(6,e.depth||1),1),r=n.createTracker(s);if(Dbe(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...r.current(),before:` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${r}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),a(),u}function Mbe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function qm(e){return"&#x"+e.toString(16).toUpperCase()+";"}function T1(e,t,n){const s=Pf(e),i=Pf(t);return s===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}pF.peek=Lbe;function pF(e,t,n,s){const i=Mbe(n),r=n.enter("emphasis"),a=n.createTracker(s),l=a.move(i);let c=a.move(n.containerPhrasing(e,{after:i,before:l,...a.current()}));const u=c.charCodeAt(0),d=T1(s.before.charCodeAt(s.before.length-1),u,i);d.inside&&(c=qm(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=T1(s.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+qm(f));const p=a.move(i);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Lbe(e,t,n){return n.options.emphasis||"*"}function Dbe(e,t){let n=!1;return Mg(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return n=!0,xN}),!!((!e.depth||e.depth<3)&&K2(e)&&(t.options.setext||n))}function Pbe(e,t,n,s){const i=Math.max(Math.min(6,e.depth||1),1),r=n.createTracker(s);if(Dbe(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...r.current(),before:` `,after:` `});return f(),d(),h+` `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const a="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");r.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:` -`,...r.current()});return/^[\t ]/.test(u)&&(u=Xp(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}mF.peek=Bbe;function mF(e){return e.value||""}function Bbe(){return"<"}pF.peek=Ube;function pF(e,t,n,s){const i=eA(n),r=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(s);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${r}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),u+=c.move(")"),a(),u}function Ube(){return"!"}gF.peek=Fbe;function gF(e,t,n,s){const i=e.referenceType,r=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,r(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Fbe(){return"!"}bF.peek=$be;function bF(e,t,n){let s=e.value||"",i="`",r=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(s);)i+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++r\u007F]/.test(e.url))}xF.peek=Hbe;function xF(e,t,n,s){const i=eA(n),r=i==='"'?"Quote":"Apostrophe",a=n.createTracker(s);let l,c;if(yF(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${r}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),l(),u}function Hbe(e,t,n){return yF(e,n)?"<":"["}EF.peek=zbe;function EF(e,t,n,s){const i=e.referenceType,r=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,r(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function zbe(){return"["}function tA(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Vbe(e){const t=tA(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Gbe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function vF(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Kbe(e,t,n,s){const i=n.enter("list"),r=n.bulletCurrent;let a=e.ordered?Gbe(n):tA(n);const l=e.ordered?a==="."?")":".":Vbe(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),vF(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+r);let a=r.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(s);l.move(r+" ".repeat(a-r.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,m){return h?(m?"":" ".repeat(a))+f:(m?r:r+" ".repeat(a-r.length))+f}}function Wbe(e,t,n,s){const i=n.enter("paragraph"),r=n.enter("phrasing"),a=n.containerPhrasing(e,s);return r(),i(),a}const Xbe=Dg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Qbe(e,t,n,s){return(e.children.some(function(a){return Xbe(a)})?n.containerPhrasing:n.containerFlow).call(n,e,s)}function Zbe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wF.peek=Jbe;function wF(e,t,n,s){const i=Zbe(n),r=n.enter("strong"),a=n.createTracker(s),l=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:l,...a.current()}));const u=c.charCodeAt(0),d=N1(s.before.charCodeAt(s.before.length-1),u,i);d.inside&&(c=Xp(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=N1(s.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+Xp(f));const m=a.move(i+i);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+m}function Jbe(e,t,n){return n.options.strong||"*"}function eye(e,t,n,s){return n.safe(e.value,s)}function tye(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function nye(e,t,n){const s=(vF(n)+(n.options.ruleSpaces?" ":"")).repeat(tye(n));return n.options.ruleSpaces?s.slice(0,-1):s}const _F={blockquote:Nbe,break:wL,code:jbe,definition:Obe,emphasis:hF,hardBreak:wL,heading:Pbe,html:mF,image:pF,imageReference:gF,inlineCode:bF,link:xF,linkReference:EF,list:Kbe,listItem:Ybe,paragraph:Wbe,root:Qbe,strong:wF,text:eye,thematicBreak:nye};function sye(){return{enter:{table:iye,tableData:_L,tableHeader:_L,tableRow:aye},exit:{codeText:oye,table:rye,tableData:jw,tableHeader:jw,tableRow:jw}}}function iye(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function rye(e){this.exit(e),this.data.inTable=void 0}function aye(e){this.enter({type:"tableRow",children:[]},e)}function jw(e){this.exit(e)}function _L(e){this.enter({type:"tableCell",children:[]},e)}function oye(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lye));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lye(e,t){return t==="|"?t:e}function cye(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,i=t.stringLength,r=n?" ":"|";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:h,table:a,tableCell:c,tableRow:l}};function a(m,p,b,v){return u(d(m,b,v),m.align)}function l(m,p,b,v){const y=f(m,b,v),x=u([y]);return x.slice(0,x.indexOf(` -`))}function c(m,p,b,v){const y=b.enter("tableCell"),x=b.enter("phrasing"),E=b.containerPhrasing(m,{...v,before:r,after:r});return x(),y(),E}function u(m,p){return _be(m,{align:p,alignDelimiters:s,padding:n,stringLength:i})}function d(m,p,b){const v=m.children;let y=-1;const x=[],E=p.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const kye={tokenize:Lye,partial:!0};function Aye(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Rye,continuation:{tokenize:Oye},exit:Mye}},text:{91:{name:"gfmFootnoteCall",tokenize:jye},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Cye,resolveTo:Iye}}}}function Cye(e,t,n){const s=this;let i=s.events.length;const r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let a;for(;i--;){const c=s.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const u=Oa(s.sliceSerialize({start:a.end,end:s.now()}));return u.codePointAt(0)!==94||!r.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Iye(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const r={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},l=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",r,t],["enter",a,t],["exit",a,t],["exit",r,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...l),e}function jye(e,t,n){const s=this,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let r=0,a;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(r>999||f===93&&!a||f===null||f===91||Fn(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Oa(s.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Fn(f)||(a=!0),r++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),r++,u):u(f)}}function Rye(e,t,n){const s=this,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let r,a=0,l;return c;function c(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(p)}function d(p){if(a>999||p===93&&!l||p===null||p===91||Fn(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return r=Oa(s.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Fn(p)||(l=!0),a++,e.consume(p),p===92?f:d}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(r)||i.push(r),an(e,m,"gfmFootnoteDefinitionWhitespace")):n(p)}function m(p){return t(p)}}function Oye(e,t,n){return e.check(Lg,t,e.attempt(kye,t,n))}function Mye(e){e.exit("gfmFootnoteDefinition")}function Lye(e,t,n){const s=this;return an(e,i,"gfmFootnoteDefinitionIndent",5);function i(r){const a=s.events[s.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(r):n(r)}}function Dye(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:r,resolveAll:i};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function i(a,l){let c=-1;for(;++c1?c(p):(a.consume(p),f++,m);if(f<2&&!n)return c(p);const v=a.exit("strikethroughSequenceTemporary"),y=Uf(p);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(p)}}}class Pye{constructor(){this.map=[]}add(t,n,s){Bye(this,t,n,s)}consume(t){if(this.map.sort(function(r,a){return r[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let i=s.pop();for(;i;){for(const r of i)t.push(r);i=s.pop()}this.map.length=0}}function Bye(e,t,n,s){let i=0;if(!(n===0&&s.length===0)){for(;i-1;){const L=s.events[R][1].type;if(L==="lineEnding"||L==="linePrefix")R--;else break}const B=R>-1?s.events[R][1].type:null,z=B==="tableHead"||B==="tableRow"?_:c;return z===_&&s.parser.lazy[s.now().line]?n(j):z(j)}function c(j){return e.enter("tableHead"),e.enter("tableRow"),u(j)}function u(j){return j===124||(a=!0,r+=1),d(j)}function d(j){return j===null?n(j):ht(j)?r>1?(r=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),m):n(j):Qt(j)?an(e,d,"whitespace")(j):(r+=1,a&&(a=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(j)))}function f(j){return j===null||j===124||Fn(j)?(e.exit("data"),d(j)):(e.consume(j),j===92?h:f)}function h(j){return j===92||j===124?(e.consume(j),f):f(j)}function m(j){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(j):(e.enter("tableDelimiterRow"),a=!1,Qt(j)?an(e,p,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):p(j))}function p(j){return j===45||j===58?v(j):j===124?(a=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),b):S(j)}function b(j){return Qt(j)?an(e,v,"whitespace")(j):v(j)}function v(j){return j===58?(r+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),y):j===45?(r+=1,y(j)):j===null||ht(j)?w(j):S(j)}function y(j){return j===45?(e.enter("tableDelimiterFiller"),x(j)):S(j)}function x(j){return j===45?(e.consume(j),x):j===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(j))}function E(j){return Qt(j)?an(e,w,"whitespace")(j):w(j)}function w(j){return j===124?p(j):j===null||ht(j)?!a||i!==r?S(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):S(j)}function S(j){return n(j)}function _(j){return e.enter("tableRow"),k(j)}function k(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),k):j===null||ht(j)?(e.exit("tableRow"),t(j)):Qt(j)?an(e,k,"whitespace")(j):(e.enter("data"),T(j))}function T(j){return j===null||j===124||Fn(j)?(e.exit("data"),k(j)):(e.consume(j),j===92?A:T)}function A(j){return j===92||j===124?(e.consume(j),T):T(j)}}function Hye(e,t){let n=-1,s=!0,i=0,r=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new Pye;for(;++nn[2]+1){const p=n[2]+1,b=n[3]-n[2]-1;e.add(p,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(r.end=Object.assign({},yd(t.events,i)),e.add(i,0,[["exit",r,t]]),r=void 0),r}function NL(e,t,n,s,i){const r=[],a=yd(t.events,n);i&&(i.end=Object.assign({},a),r.push(["exit",i,t])),s.end=Object.assign({},a),r.push(["exit",s,t]),e.add(n+1,0,r)}function yd(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const zye={name:"tasklistCheck",tokenize:Gye};function Vye(){return{text:{91:zye}}}function Gye(e,t,n){const s=this;return i;function i(c){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),r)}function r(c){return Fn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return ht(c)?t(c):Qt(c)?e.check({tokenize:Kye},t,n)(c):n(c)}}function Kye(e,t,n){return an(e,s,"whitespace");function s(i){return i===null?n(i):t(i)}}function qye(e){return F7([yye(),Aye(),Dye(e),Fye(),Vye()])}const Yye={};function Wye(e){const t=this,n=e||Yye,s=t.data(),i=s.micromarkExtensions||(s.micromarkExtensions=[]),r=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),a=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);i.push(qye(n)),r.push(mye()),a.push(pye(n))}const TL=function(e,t,n){const s=Dg(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` -`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function OF(e,t,n){return e.type==="element"?s1e(e,t,n):e.type==="text"?n.whitespace==="normal"?MF(e,n):i1e(e):[]}function s1e(e,t,n){const s=LF(e,n),i=e.children||[];let r=-1,a=[];if(t1e(e))return a;let l,c;for(SN(e)||IL(e)&&TL(t,e,IL)?c=` -`:e1e(e)?(l=2,c=2):RF(e)&&(l=1,c=1);++r]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},m=t.optional(i)+e.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:b,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:_.concat([{begin:/\(/,end:/\)/,keywords:w,contains:_.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:w,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function d1e(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=u1e(e),s=n.keywords;return s.type=[...s.type,...t.type],s.literal=[...s.literal,...t.literal],s.built_in=[...s.built_in,...t.built_in],s._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function DF(e){const t=e.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...x,...E,"set","shopt",...w,...S]},contains:[m,e.SHEBANG(),p,f,r,a,y,l,c,u,d,n]}}function f1e(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+s+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},m=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},E={begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:v,relevance:0},{begin:m,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function h1e(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+s+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},m=t.optional(i)+e.IDENT_RE+"\\s*\\(",p=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:b,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],k={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:_.concat([{begin:/\(/,end:/\)/,keywords:w,contains:_.concat(["self"]),relevance:0}]),relevance:0},T={className:"function",begin:"("+a+"[\\*&\\s]+)+"+m,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:w,relevance:0},{begin:m,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function m1e(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],r=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:i.concat(r),built_in:t,literal:s},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},m=e.inherit(h,{illegal:/\n/}),p={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,m]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]});h.contains=[b,p,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],m.contains=[v,p,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,p,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},E=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const p1e=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),g1e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],b1e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],y1e=[...g1e,...b1e],x1e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),E1e=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),v1e=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),w1e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function _1e(e){const t=e.regex,n=p1e(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",r=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,s,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+E1e.join("|")+")"},{begin:":(:)?("+v1e.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+w1e.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:r},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:x1e.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+y1e.join("|")+")\\b"}]}}function S1e(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function N1e(e){const r={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:r,illegal:"BF(e,t,n-1))}function k1e(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=n+BF("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,jL,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},jL,u]}}const RL="[A-Za-z$_][0-9A-Za-z$_]*",A1e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],C1e=["true","false","null","undefined","NaN","Infinity"],UF=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],FF=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$F=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],I1e=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],j1e=[].concat($F,UF,FF);function HF(e){const t=e.regex,n=(D,{after:$})=>{const O="",end:""},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,$)=>{const O=D[0].length+D.index,te=D.input[O];if(te==="<"||te===","){$.ignoreMatch();return}te===">"&&(n(D,{after:O})||$.ignoreMatch());let ne;const P=D.input.substring(O);if(ne=P.match(/^\s*=/)){$.ignoreMatch();return}if((ne=P.match(/^\s+extends\s+/))&&ne.index===0){$.ignoreMatch();return}}},l={$pattern:RL,keyword:A1e,literal:C1e,built_in:j1e,"variable.language":I1e},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,p,b,v,{match:/\$\d+/},f];h.contains=E.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(E)});const w=[].concat(x,h.contains),S=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},k={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...UF,...FF]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(D){return t.concat("(?!",D.join("|"),")")}const z={match:t.concat(/\b/,B([...$F,"super","import"].map(D=>`${D}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,p,b,v,x,{match:/\$\d+/},f,T,{scope:"attr",match:s+t.lookahead(":"),relevance:0},I,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:r},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},z,R,k,F,{match:/\$[(.]/}]}}function zF(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],i={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ed="[0-9](_*[0-9])*",ob=`\\.(${Ed})`,lb="[0-9a-fA-F](_*[0-9a-fA-F])*",R1e={className:"number",variants:[{begin:`(\\b(${Ed})((${ob})|\\.)?|(${ob}))[eE][+-]?(${Ed})[fFdD]?\\b`},{begin:`\\b(${Ed})((${ob})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ob})[fFdD]?\\b`},{begin:`\\b(${Ed})[fFdD]\\b`},{begin:`\\b0[xX]((${lb})\\.?|(${lb})?\\.(${lb}))[pP][+-]?(${Ed})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${lb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function O1e(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,i]}]};i.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=R1e,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,s,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},u]}}const M1e=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),L1e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],D1e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],P1e=[...L1e,...D1e],B1e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),VF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),GF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),U1e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),F1e=VF.concat(GF).sort().reverse();function $1e(e){const t=M1e(e),n=F1e,s="and or not only",i="[\\w-]+",r="("+i+"|@\\{"+i+"\\})",a=[],l=[],c=function(E){return{className:"string",begin:"~?"+E+".*?"+E}},u=function(E,w,S){return{className:E,begin:w,relevance:S}},d={$pattern:/[a-z-]+/,keyword:s,attribute:B1e.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:a}),m={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},p={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+U1e.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+P1e.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",r,0),u("selector-id","#"+r),u("selector-class","\\."+r,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+VF.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+GF.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,x,p,y,m,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function H1e(e){const t="\\[=*\\[",n="\\]=*\\]",s={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[s],relevance:5}])}}function KF(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},r={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let m=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(m)}),m=m.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,r,u,d,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},i,s,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function z1e(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function V1e(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},r={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,r,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const x=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,s)},m=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,s),p=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:m("(?:m|qr)?",/\//,/\//)},{begin:m("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:m("m|qr",/\(/,/\)/)},{begin:m("m|qr",/\[/,/\]/)},{begin:m("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return r.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:p}}function G1e(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,s=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),r=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+s},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(L,F)=>{F.data._beginMatch=L[1]||L[2]},"on:end":(L,F)=>{F.data._beginMatch!==L[1]&&F.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),m=`[ -]`,p={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:y,literal:(L=>{const F=[];return L.forEach(C=>{F.push(C),C.toLowerCase()===C?F.push(C.toUpperCase()):F.push(C.toLowerCase())}),F})(v),built_in:x},S=L=>L.map(F=>F.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,t.concat(m,"+"),t.concat("(?!",S(x).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},k=t.concat(s,"\\b(?!\\()"),T={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),k],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),k],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},j={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[A,a,T,e.C_BLOCK_COMMENT_MODE,p,b,_]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(x).join("\\b|"),"\\b)"),s,t.concat(m,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[j]};j.contains.push(R);const B=[A,T,e.C_BLOCK_COMMENT_MODE,p,b,_],z={begin:t.concat(/#\[\s*\\?/,t.either(i,r)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:i},{match:r}]}]};return{case_insensitive:!1,keywords:w,contains:[z,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,R,T,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",z,a,T,e.C_BLOCK_COMMENT_MODE,p,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},p,b]}}function K1e(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function q1e(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function YF(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",m=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,p=`\\b|${s.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${m}))[eE][+-]?(${h})[jJ]?(?=${p})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${h})[jJ](?=${p})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function Y1e(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function W1e(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[r,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function X1e(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(s,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",m="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${m}))?([eE][+-]?(${m})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},_=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=_,b.contains=_;const j=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:_}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(j).concat(u).concat(_)}}function Q1e(e){const t=e.regex,n=/(r#)?/,s=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),r={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},r]}}const Z1e=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),J1e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],exe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],txe=[...J1e,...exe],nxe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),sxe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ixe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rxe=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function axe(e){const t=Z1e(e),n=ixe,s=sxe,i="@[a-z-]+",r="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+txe.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rxe.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:nxe.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function oxe(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function lxe(e){const t=e.regex,n=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},r=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=d,p=[...u,...c].filter(S=>!d.includes(S)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function x(S){return t.concat(/\b/,t.either(...S.map(_=>_.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:x(h),relevance:0};function w(S,{exceptions:_,when:k}={}){const T=k;return _=_||[],S.map(A=>A.match(/\|\d+$/)||_.includes(A)?A:T(A)?`${A}|0`:A)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(p,{when:S=>S.length<3}),literal:r,type:l,built_in:f},contains:[{scope:"type",match:x(a)},E,y,b,s,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function WF(e){return e?typeof e=="string"?e:e.source:null}function sm(e){return jn("(?=",e,")")}function jn(...e){return e.map(n=>WF(n)).join("")}function cxe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Wi(...e){return"("+(cxe(e).capture?"":"?:")+e.map(s=>WF(s)).join("|")+")"}const iA=e=>jn(/\b/,e,/\w$/.test(e)?/\b/:/\B/),uxe=["Protocol","Type"].map(iA),OL=["init","self"].map(iA),dxe=["Any","Self"],Rw=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ML=["false","nil","true"],fxe=["assignment","associativity","higherThan","left","lowerThan","none","right"],hxe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],LL=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],XF=Wi(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),QF=Wi(XF,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ow=jn(XF,QF,"*"),ZF=Wi(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),T1=Wi(ZF,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ya=jn(ZF,T1,"*"),cb=jn(/[A-Z]/,T1,"*"),mxe=["attached","autoclosure",jn(/convention\(/,Wi("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",jn(/objc\(/,Ya,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],pxe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function gxe(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Wi(...uxe,...OL)],className:{2:"keyword"}},r={match:jn(/\./,Wi(...Rw)),relevance:0},a=Rw.filter(ae=>typeof ae=="string").concat(["_|0"]),l=Rw.filter(ae=>typeof ae!="string").concat(dxe).map(iA),c={variants:[{className:"keyword",match:Wi(...l,...OL)}]},u={$pattern:Wi(/\b\w+/,/#\w+/),keyword:a.concat(hxe),literal:ML},d=[i,r,c],f={match:jn(/\./,Wi(...LL)),relevance:0},h={className:"built_in",match:jn(/\b/,Wi(...LL),/(?=\()/)},m=[f,h],p={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:Ow},{match:`\\.(\\.|${QF})+`}]},v=[p,b],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",E={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(ae="")=>({className:"subst",variants:[{match:jn(/\\/,ae,/[0\\tnr"']/)},{match:jn(/\\/,ae,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ae="")=>({className:"subst",match:jn(/\\/,ae,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(ae="")=>({className:"subst",label:"interpol",begin:jn(/\\/,ae,/\(/),end:/\)/}),k=(ae="")=>({begin:jn(ae,/"""/),end:jn(/"""/,ae),contains:[w(ae),S(ae),_(ae)]}),T=(ae="")=>({begin:jn(ae,/"/),end:jn(/"/,ae),contains:[w(ae),_(ae)]}),A={className:"string",variants:[k(),k("#"),k("##"),k("###"),T(),T("#"),T("##"),T("###")]},j=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:j},B=ae=>{const pe=jn(ae,/\//),_e=jn(/\//,ae);return{begin:pe,end:_e,contains:[...j,{scope:"comment",begin:`#(?!.*${_e})`,end:/$/}]}},z={scope:"regexp",variants:[B("###"),B("##"),B("#"),R]},L={match:jn(/`/,Ya,/`/)},F={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${T1}+`},I=[L,F,C],D={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:pxe,contains:[...v,E,A]}]}},$={scope:"keyword",match:jn(/@/,Wi(...mxe),sm(Wi(/\(/,/\s+/)))},O={scope:"meta",match:jn(/@/,Ya)},te=[D,$,O],ne={match:sm(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:jn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,T1,"+")},{className:"type",match:cb,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:jn(/\s+&\s+/,sm(cb)),relevance:0}]},P={begin://,keywords:u,contains:[...s,...d,...te,p,ne]};ne.contains.push(P);const Q={match:jn(Ya,/\s*:/),keywords:"_|0",relevance:0},ee={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Q,...s,z,...d,...m,...v,E,A,...I,...te,ne]},V={begin://,keywords:"repeat each",contains:[...s,ne]},X={begin:Wi(sm(jn(Ya,/\s*:/)),sm(jn(Ya,/\s+/,Ya,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ya}]},K={begin:/\(/,end:/\)/,keywords:u,contains:[X,...s,...d,...v,E,A,...te,ne,ee],endsParent:!0,illegal:/["']/},ce={match:[/(func|macro)/,/\s+/,Wi(L.match,Ya,Ow)],className:{1:"keyword",3:"title.function"},contains:[V,K,t],illegal:[/\[/,/%/]},he={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[V,K,t],illegal:/\[|%/},ye={match:[/operator/,/\s+/,Ow],className:{1:"keyword",3:"title"}},ue={begin:[/precedencegroup/,/\s+/,cb],className:{1:"keyword",3:"title"},contains:[ne],keywords:[...fxe,...ML],end:/}/},we={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},De={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Se={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Ya,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[V,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:cb},...d],relevance:0}]};for(const ae of A.variants){const pe=ae.contains.find(et=>et.label==="interpol");pe.keywords=u;const _e=[...d,...m,...v,E,A,...I];pe.contains=[..._e,{begin:/\(/,end:/\)/,contains:["self",..._e]}]}return{name:"Swift",keywords:u,contains:[...s,ce,he,we,De,Se,ye,ue,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},z,...d,...m,...v,E,A,...I,...te,ne,ee]}}const k1="[A-Za-z$_][0-9A-Za-z$_]*",JF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],e$=["true","false","null","undefined","NaN","Infinity"],t$=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],n$=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],s$=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],i$=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],r$=[].concat(s$,t$,n$);function bxe(e){const t=e.regex,n=(D,{after:$})=>{const O="",end:""},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,$)=>{const O=D[0].length+D.index,te=D.input[O];if(te==="<"||te===","){$.ignoreMatch();return}te===">"&&(n(D,{after:O})||$.ignoreMatch());let ne;const P=D.input.substring(O);if(ne=P.match(/^\s*=/)){$.ignoreMatch();return}if((ne=P.match(/^\s+extends\s+/))&&ne.index===0){$.ignoreMatch();return}}},l={$pattern:k1,keyword:JF,literal:e$,built_in:r$,"variable.language":i$},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,p,b,v,{match:/\$\d+/},f];h.contains=E.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(E)});const w=[].concat(x,h.contains),S=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},k={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},T={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...t$,...n$]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(D){return t.concat("(?!",D.join("|"),")")}const z={match:t.concat(/\b/,B([...s$,"super","import"].map(D=>`${D}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,p,b,v,x,{match:/\$\d+/},f,T,{scope:"attr",match:s+t.lookahead(":"),relevance:0},I,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:r},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},z,R,k,F,{match:/\$[(.]/}]}}function a$(e){const t=e.regex,n=bxe(e),s=k1,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],r={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:k1,keyword:JF.concat(c),literal:e$,built_in:r$.concat(i),"variable.language":i$},d={className:"meta",begin:"@"+s},f=(b,v,y)=>{const x=b.contains.findIndex(E=>E.label===v);if(x===-1)throw new Error("can not find mode to replace");b.contains.splice(x,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),m=Object.assign({},h,{match:t.concat(s,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,m]),n.contains=n.contains.concat([d,r,a,m]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const p=n.contains.find(b=>b.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function yxe(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(r,i),/ +/,t.either(a,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,s,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function xxe(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},r={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},r,a,i,e.QUOTE_STRING_MODE,c,u,l]}}function Exe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(r,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[r,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[r,a,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function o$(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},r={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},v=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,b,r,a],y=[...v];return y.pop(),y.push(l),m.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const vxe={arduino:d1e,bash:DF,c:f1e,cpp:h1e,csharp:m1e,css:_1e,diff:S1e,go:N1e,graphql:T1e,ini:PF,java:k1e,javascript:HF,json:zF,kotlin:O1e,less:$1e,lua:H1e,makefile:KF,markdown:qF,objectivec:z1e,perl:V1e,php:G1e,"php-template":K1e,plaintext:q1e,python:YF,"python-repl":Y1e,r:W1e,ruby:X1e,rust:Q1e,scss:axe,shell:oxe,sql:lxe,swift:gxe,typescript:a$,vbnet:yxe,wasm:xxe,xml:Exe,yaml:o$};function l$(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&l$(n)}),e}let DL=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function c$(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function $l(e,...t){const n=Object.create(null);for(const s in e)n[s]=e[s];return t.forEach(function(s){for(const i in s)n[i]=s[i]}),n}const wxe="",PL=e=>!!e.scope,_xe=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((s,i)=>`${s}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class Sxe{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=c$(t)}openNode(t){if(!PL(t))return;const n=_xe(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){PL(t)&&(this.buffer+=wxe)}value(){return this.buffer}span(t){this.buffer+=``}}const BL=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class rA{constructor(){this.rootNode=BL(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=BL({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(s=>this._walk(t,s)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{rA._collapse(n)}))}}class Nxe extends rA{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const s=t.root;n&&(s.scope=`language:${n}`),this.add(s)}toHTML(){return new Sxe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Qp(e){return e?typeof e=="string"?e:e.source:null}function u$(e){return Mu("(?=",e,")")}function Txe(e){return Mu("(?:",e,")*")}function kxe(e){return Mu("(?:",e,")?")}function Mu(...e){return e.map(n=>Qp(n)).join("")}function Axe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function aA(...e){return"("+(Axe(e).capture?"":"?:")+e.map(s=>Qp(s)).join("|")+")"}function d$(e){return new RegExp(e.toString()+"|").exec("").length-1}function Cxe(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Ixe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function oA(e,{joinWith:t}){let n=0;return e.map(s=>{n+=1;const i=n;let r=Qp(s),a="";for(;r.length>0;){const l=Ixe.exec(r);if(!l){a+=r;break}a+=r.substring(0,l.index),r=r.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+i):(a+=l[0],l[0]==="("&&n++)}return a}).map(s=>`(${s})`).join(t)}const jxe=/\b\B/,f$="[a-zA-Z]\\w*",lA="[a-zA-Z_]\\w*",h$="\\b\\d+(\\.\\d+)?",m$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",p$="\\b(0b[01]+)",Rxe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Oxe=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Mu(t,/.*\b/,e.binary,/\b.*/)),$l({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,s)=>{n.index!==0&&s.ignoreMatch()}},e)},Zp={begin:"\\\\[\\s\\S]",relevance:0},Mxe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Zp]},Lxe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Zp]},Dxe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Qx=function(e,t,n={}){const s=$l({scope:"comment",begin:e,end:t,contains:[]},n);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=aA("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:Mu(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},Pxe=Qx("//","$"),Bxe=Qx("/\\*","\\*/"),Uxe=Qx("#","$"),Fxe={scope:"number",begin:h$,relevance:0},$xe={scope:"number",begin:m$,relevance:0},Hxe={scope:"number",begin:p$,relevance:0},zxe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Zp,{begin:/\[/,end:/\]/,relevance:0,contains:[Zp]}]},Vxe={scope:"title",begin:f$,relevance:0},Gxe={scope:"title",begin:lA,relevance:0},Kxe={begin:"\\.\\s*"+lA,relevance:0},qxe=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var ub=Object.freeze({__proto__:null,APOS_STRING_MODE:Mxe,BACKSLASH_ESCAPE:Zp,BINARY_NUMBER_MODE:Hxe,BINARY_NUMBER_RE:p$,COMMENT:Qx,C_BLOCK_COMMENT_MODE:Bxe,C_LINE_COMMENT_MODE:Pxe,C_NUMBER_MODE:$xe,C_NUMBER_RE:m$,END_SAME_AS_BEGIN:qxe,HASH_COMMENT_MODE:Uxe,IDENT_RE:f$,MATCH_NOTHING_RE:jxe,METHOD_GUARD:Kxe,NUMBER_MODE:Fxe,NUMBER_RE:h$,PHRASAL_WORDS_MODE:Dxe,QUOTE_STRING_MODE:Lxe,REGEXP_MODE:zxe,RE_STARTERS_RE:Rxe,SHEBANG:Oxe,TITLE_MODE:Vxe,UNDERSCORE_IDENT_RE:lA,UNDERSCORE_TITLE_MODE:Gxe});function Yxe(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Wxe(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Xxe(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Yxe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Qxe(e,t){Array.isArray(e.illegal)&&(e.illegal=aA(...e.illegal))}function Zxe(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Jxe(e,t){e.relevance===void 0&&(e.relevance=1)}const eEe=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(s=>{delete e[s]}),e.keywords=n.keywords,e.begin=Mu(n.beforeMatch,u$(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},tEe=["of","and","for","in","not","or","if","then","parent","list","value"],nEe="keyword";function g$(e,t,n=nEe){const s=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(r){Object.assign(s,g$(e[r],t,r))}),s;function i(r,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");s[c[0]]=[r,sEe(c[0],c[1])]})}}function sEe(e,t){return t?Number(t):iEe(e)?0:1}function iEe(e){return tEe.includes(e.toLowerCase())}const UL={},iu=e=>{console.error(e)},FL=(e,...t)=>{console.log(`WARN: ${e}`,...t)},id=(e,t)=>{UL[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),UL[`${e}/${t}`]=!0)},A1=new Error;function b$(e,t,{key:n}){let s=0;const i=e[n],r={},a={};for(let l=1;l<=t.length;l++)a[l+s]=i[l],r[l+s]=!0,s+=d$(t[l-1]);e[n]=a,e[n]._emit=r,e[n]._multi=!0}function rEe(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw iu("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),A1;if(typeof e.beginScope!="object"||e.beginScope===null)throw iu("beginScope must be object"),A1;b$(e,e.begin,{key:"beginScope"}),e.begin=oA(e.begin,{joinWith:""})}}function aEe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw iu("skip, excludeEnd, returnEnd not compatible with endScope: {}"),A1;if(typeof e.endScope!="object"||e.endScope===null)throw iu("endScope must be object"),A1;b$(e,e.end,{key:"endScope"}),e.end=oA(e.end,{joinWith:""})}}function oEe(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function lEe(e){oEe(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),rEe(e),aEe(e)}function cEe(e){function t(a,l){return new RegExp(Qp(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=d$(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(oA(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(a){const l=new s;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function r(a,l){const c=a;if(a.isCompiled)return c;[Wxe,Zxe,lEe,eEe].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Xxe,Qxe,Jxe].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=g$(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=Qp(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return uEe(d==="self"?a:d)})),a.contains.forEach(function(d){r(d,c)}),a.starts&&r(a.starts,l),c.matcher=i(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=$l(e.classNameAliases||{}),r(e)}function y$(e){return e?e.endsWithParent||y$(e.starts):!1}function uEe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return $l(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:y$(e)?$l(e,{starts:e.starts?$l(e.starts):null}):Object.isFrozen(e)?$l(e):e}var dEe="11.11.1";class fEe extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Mw=c$,$L=$l,HL=Symbol("nomatch"),hEe=7,x$=function(e){const t=Object.create(null),n=Object.create(null),s=[];let i=!0;const r="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Nxe};function c(C){return l.noHighlightRe.test(C)}function u(C){let I=C.className+" ";I+=C.parentNode?C.parentNode.className:"";const D=l.languageDetectRe.exec(I);if(D){const $=T(D[1]);return $||(FL(r.replace("{}",D[1])),FL("Falling back to no-highlight mode for this block.",C)),$?D[1]:"no-highlight"}return I.split(/\s+/).find($=>c($)||T($))}function d(C,I,D){let $="",O="";typeof I=="object"?($=C,D=I.ignoreIllegals,O=I.language):(id("10.7.0","highlight(lang, code, ...args) has been deprecated."),id("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),O=C,$=I),D===void 0&&(D=!0);const te={code:$,language:O};L("before:highlight",te);const ne=te.result?te.result:f(te.language,te.code,D);return ne.code=te.code,L("after:highlight",ne),ne}function f(C,I,D,$){const O=Object.create(null);function te(W,oe){return W.keywords[oe]}function ne(){if(!_e.keywords){Be.addText(Fe);return}let W=0;_e.keywordPatternRe.lastIndex=0;let oe=_e.keywordPatternRe.exec(Fe),Z="";for(;oe;){Z+=Fe.substring(W,oe.index);const Ee=Se.case_insensitive?oe[0].toLowerCase():oe[0],Oe=te(_e,Ee);if(Oe){const[at,Lt]=Oe;if(Be.addText(Z),Z="",O[Ee]=(O[Ee]||0)+1,O[Ee]<=hEe&&(We+=Lt),at.startsWith("_"))Z+=oe[0];else{const ct=Se.classNameAliases[at]||at;ee(oe[0],ct)}}else Z+=oe[0];W=_e.keywordPatternRe.lastIndex,oe=_e.keywordPatternRe.exec(Fe)}Z+=Fe.substring(W),Be.addText(Z)}function P(){if(Fe==="")return;let W=null;if(typeof _e.subLanguage=="string"){if(!t[_e.subLanguage]){Be.addText(Fe);return}W=f(_e.subLanguage,Fe,!0,et[_e.subLanguage]),et[_e.subLanguage]=W._top}else W=m(Fe,_e.subLanguage.length?_e.subLanguage:null);_e.relevance>0&&(We+=W.relevance),Be.__addSublanguage(W._emitter,W.language)}function Q(){_e.subLanguage!=null?P():ne(),Fe=""}function ee(W,oe){W!==""&&(Be.startScope(oe),Be.addText(W),Be.endScope())}function V(W,oe){let Z=1;const Ee=oe.length-1;for(;Z<=Ee;){if(!W._emit[Z]){Z++;continue}const Oe=Se.classNameAliases[W[Z]]||W[Z],at=oe[Z];Oe?ee(at,Oe):(Fe=at,ne(),Fe=""),Z++}}function X(W,oe){return W.scope&&typeof W.scope=="string"&&Be.openNode(Se.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(ee(Fe,Se.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Fe=""):W.beginScope._multi&&(V(W.beginScope,oe),Fe="")),_e=Object.create(W,{parent:{value:_e}}),_e}function K(W,oe,Z){let Ee=Cxe(W.endRe,Z);if(Ee){if(W["on:end"]){const Oe=new DL(W);W["on:end"](oe,Oe),Oe.isMatchIgnored&&(Ee=!1)}if(Ee){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return K(W.parent,oe,Z)}function ce(W){return _e.matcher.regexIndex===0?(Fe+=W[0],1):(Ue=!0,0)}function he(W){const oe=W[0],Z=W.rule,Ee=new DL(Z),Oe=[Z.__beforeBegin,Z["on:begin"]];for(const at of Oe)if(at&&(at(W,Ee),Ee.isMatchIgnored))return ce(oe);return Z.skip?Fe+=oe:(Z.excludeBegin&&(Fe+=oe),Q(),!Z.returnBegin&&!Z.excludeBegin&&(Fe=oe)),X(Z,W),Z.returnBegin?0:oe.length}function ye(W){const oe=W[0],Z=I.substring(W.index),Ee=K(_e,W,Z);if(!Ee)return HL;const Oe=_e;_e.endScope&&_e.endScope._wrap?(Q(),ee(oe,_e.endScope._wrap)):_e.endScope&&_e.endScope._multi?(Q(),V(_e.endScope,W)):Oe.skip?Fe+=oe:(Oe.returnEnd||Oe.excludeEnd||(Fe+=oe),Q(),Oe.excludeEnd&&(Fe=oe));do _e.scope&&Be.closeNode(),!_e.skip&&!_e.subLanguage&&(We+=_e.relevance),_e=_e.parent;while(_e!==Ee.parent);return Ee.starts&&X(Ee.starts,W),Oe.returnEnd?0:oe.length}function ue(){const W=[];for(let oe=_e;oe!==Se;oe=oe.parent)oe.scope&&W.unshift(oe.scope);W.forEach(oe=>Be.openNode(oe))}let we={};function De(W,oe){const Z=oe&&oe[0];if(Fe+=W,Z==null)return Q(),0;if(we.type==="begin"&&oe.type==="end"&&we.index===oe.index&&Z===""){if(Fe+=I.slice(oe.index,oe.index+1),!i){const Ee=new Error(`0 width match regex (${C})`);throw Ee.languageName=C,Ee.badRule=we.rule,Ee}return 1}if(we=oe,oe.type==="begin")return he(oe);if(oe.type==="illegal"&&!D){const Ee=new Error('Illegal lexeme "'+Z+'" for mode "'+(_e.scope||"")+'"');throw Ee.mode=_e,Ee}else if(oe.type==="end"){const Ee=ye(oe);if(Ee!==HL)return Ee}if(oe.type==="illegal"&&Z==="")return Fe+=` -`,1;if(Ke>1e5&&Ke>oe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fe+=Z,Z.length}const Se=T(C);if(!Se)throw iu(r.replace("{}",C)),new Error('Unknown language: "'+C+'"');const ae=cEe(Se);let pe="",_e=$||ae;const et={},Be=new l.__emitter(l);ue();let Fe="",We=0,Ae=0,Ke=0,Ue=!1;try{if(Se.__emitTokens)Se.__emitTokens(I,Be);else{for(_e.matcher.considerAll();;){Ke++,Ue?Ue=!1:_e.matcher.considerAll(),_e.matcher.lastIndex=Ae;const W=_e.matcher.exec(I);if(!W)break;const oe=I.substring(Ae,W.index),Z=De(oe,W);Ae=W.index+Z}De(I.substring(Ae))}return Be.finalize(),pe=Be.toHTML(),{language:C,value:pe,relevance:We,illegal:!1,_emitter:Be,_top:_e}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:C,value:Mw(I),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:Ae,context:I.slice(Ae-100,Ae+100),mode:W.mode,resultSoFar:pe},_emitter:Be};if(i)return{language:C,value:Mw(I),illegal:!1,relevance:0,errorRaised:W,_emitter:Be,_top:_e};throw W}}function h(C){const I={value:Mw(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return I._emitter.addText(C),I}function m(C,I){I=I||l.languages||Object.keys(t);const D=h(C),$=I.filter(T).filter(j).map(Q=>f(Q,C,!1));$.unshift(D);const O=$.sort((Q,ee)=>{if(Q.relevance!==ee.relevance)return ee.relevance-Q.relevance;if(Q.language&&ee.language){if(T(Q.language).supersetOf===ee.language)return 1;if(T(ee.language).supersetOf===Q.language)return-1}return 0}),[te,ne]=O,P=te;return P.secondBest=ne,P}function p(C,I,D){const $=I&&n[I]||D;C.classList.add("hljs"),C.classList.add(`language-${$}`)}function b(C){let I=null;const D=u(C);if(c(D))return;if(L("before:highlightElement",{el:C,language:D}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new fEe("One of your code blocks includes unescaped HTML.",C.innerHTML);I=C;const $=I.textContent,O=D?d($,{language:D,ignoreIllegals:!0}):m($);C.innerHTML=O.value,C.dataset.highlighted="yes",p(C,D,O.language),C.result={language:O.language,re:O.relevance,relevance:O.relevance},O.secondBest&&(C.secondBest={language:O.secondBest.language,relevance:O.secondBest.relevance}),L("after:highlightElement",{el:C,result:O,text:$})}function v(C){l=$L(l,C)}const y=()=>{w(),id("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){w(),id("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function w(){function C(){w()}if(document.readyState==="loading"){E||window.addEventListener("DOMContentLoaded",C,!1),E=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function S(C,I){let D=null;try{D=I(e)}catch($){if(iu("Language definition for '{}' could not be registered.".replace("{}",C)),i)iu($);else throw $;D=a}D.name||(D.name=C),t[C]=D,D.rawDefinition=I.bind(null,e),D.aliases&&A(D.aliases,{languageName:C})}function _(C){delete t[C];for(const I of Object.keys(n))n[I]===C&&delete n[I]}function k(){return Object.keys(t)}function T(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function A(C,{languageName:I}){typeof C=="string"&&(C=[C]),C.forEach(D=>{n[D.toLowerCase()]=I})}function j(C){const I=T(C);return I&&!I.disableAutodetect}function R(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=I=>{C["before:highlightBlock"](Object.assign({block:I.el},I))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=I=>{C["after:highlightBlock"](Object.assign({block:I.el},I))})}function B(C){R(C),s.push(C)}function z(C){const I=s.indexOf(C);I!==-1&&s.splice(I,1)}function L(C,I){const D=C;s.forEach(function($){$[D]&&$[D](I)})}function F(C){return id("10.7.0","highlightBlock will be removed entirely in v12.0"),id("10.7.0","Please use highlightElement now."),b(C)}Object.assign(e,{highlight:d,highlightAuto:m,highlightAll:w,highlightElement:b,highlightBlock:F,configure:v,initHighlighting:y,initHighlightingOnLoad:x,registerLanguage:S,unregisterLanguage:_,listLanguages:k,getLanguage:T,registerAliases:A,autoDetection:j,inherit:$L,addPlugin:B,removePlugin:z}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=dEe,e.regex={concat:Mu,lookahead:u$,either:aA,optional:kxe,anyNumberOfTimes:Txe};for(const C in ub)typeof ub[C]=="object"&&l$(ub[C]);return Object.assign(e,ub),e},$f=x$({});$f.newInstance=()=>x$({});var mEe=$f;$f.HighlightJS=$f;$f.default=$f;const mr=qf(mEe),zL={},pEe="hljs-";function gEe(e){const t=mr.newInstance();return e&&r(e),{highlight:n,highlightAuto:s,listLanguages:i,register:r,registerAlias:a,registered:l};function n(c,u,d){const f=d||zL,h=typeof f.prefix=="string"?f.prefix:pEe;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:bEe,classPrefix:h});const m=t.highlight(u,{ignoreIllegals:!0,language:c});if(m.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:m.errorRaised});const p=m._emitter.root,b=p.data;return b.language=m.language,b.relevance=m.relevance,p}function s(c,u){const f=(u||zL).subset||i();let h=-1,m=0,p;for(;++hm&&(m=v.data.relevance,p=v)}return p||{type:"root",children:[],data:{language:void 0,relevance:m}}}function i(){return t.listLanguages()}function r(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class bEe{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],s=n.children[n.children.length-1];s&&s.type==="text"?s.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const s=this.stack[this.stack.length-1],i=t.root.children;n?s.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):s.children.push(...i)}openNode(t){const n=this,s=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),i=this.stack[this.stack.length-1],r={type:"element",tagName:"span",properties:{className:s},children:[]};i.children.push(r),this.stack.push(r)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const yEe={};function VL(e){const t=e||yEe,n=t.aliases,s=t.detect||!1,i=t.languages||vxe,r=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=gEe(i);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){Pg(d,"element",function(h,m,p){if(h.tagName!=="code"||!p||p.type!=="element"||p.tagName!=="pre")return;const b=xEe(h);if(b===!1||!b&&!s||b&&r&&r.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=n1e(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(x){const E=x;if(b&&/Unknown language/.test(E.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[p,h],cause:E,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw E}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function xEe(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let s;for(;++n-1&&r<=t.length){let a=0;for(;;){let l=n[a];if(l===void 0){const c=qL(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>r)return{line:a+1,column:r-(a>0?n[a-1]:0)+1,offset:r};a++}}}function i(r){if(r&&typeof r.line=="number"&&typeof r.column=="number"&&!Number.isNaN(r.line)&&!Number.isNaN(r.column)){for(;n.length1?n[r.line-2]:0)+r.column-1;if(a=55296&&e<=57343}function GEe(e){return e>=56320&&e<=57343}function KEe(e,t){return(e-55296)*1024+9216+t}function N$(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function T$(e){return e>=64976&&e<=65007||VEe.has(e)}var ve;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ve||(ve={}));const qEe=65536;class YEe{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=qEe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:s,col:i,offset:r}=this,a=i+n,l=r+n;return{code:t,startLine:s,endLine:s,startCol:a,endCol:a,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(GEe(n))return this.pos++,this._addGap(),KEe(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,G.EOF;return this._err(ve.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let s=0;s=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;const s=this.html.charCodeAt(n);return s===G.CARRIAGE_RETURN?G.LINE_FEED:s}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let t=this.html.charCodeAt(this.pos);return t===G.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,G.LINE_FEED):t===G.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,S$(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===G.LINE_FEED||t===G.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){N$(t)?this._err(ve.controlCharacterInInputStream):T$(t)&&this._err(ve.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const WEe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),XEe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function QEe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=XEe.get(e))!==null&&t!==void 0?t:e}var gi;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(gi||(gi={}));const ZEe=32;var Hl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Hl||(Hl={}));function TN(e){return e>=gi.ZERO&&e<=gi.NINE}function JEe(e){return e>=gi.UPPER_A&&e<=gi.UPPER_F||e>=gi.LOWER_A&&e<=gi.LOWER_F}function eve(e){return e>=gi.UPPER_A&&e<=gi.UPPER_Z||e>=gi.LOWER_A&&e<=gi.LOWER_Z||TN(e)}function tve(e){return e===gi.EQUALS||eve(e)}var fi;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(fi||(fi={}));var Mo;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Mo||(Mo={}));class nve{constructor(t,n,s){this.decodeTree=t,this.emitCodePoint=n,this.errors=s,this.state=fi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Mo.Strict}startEntity(t){this.decodeMode=t,this.state=fi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case fi.EntityStart:return t.charCodeAt(n)===gi.NUM?(this.state=fi.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=fi.NamedEntity,this.stateNamedEntity(t,n));case fi.NumericStart:return this.stateNumericStart(t,n);case fi.NumericDecimal:return this.stateNumericDecimal(t,n);case fi.NumericHex:return this.stateNumericHex(t,n);case fi.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ZEe)===gi.LOWER_X?(this.state=fi.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=fi.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,s,i){if(n!==s){const r=s-n;this.result=this.result*Math.pow(i,r)+Number.parseInt(t.substr(n,r),i),this.consumed+=r}}stateNumericHex(t,n){const s=n;for(;n>14;for(;n>14,r!==0){if(a===gi.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==Mo.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:s}=this,i=(s[n]&Hl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,s){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Hl.VALUE_LENGTH:i[t+1],s),n===3&&this.emitCodePoint(i[t+2],s),s}end(){var t;switch(this.state){case fi.NamedEntity:return this.result!==0&&(this.decodeMode!==Mo.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fi.NumericDecimal:return this.emitNumericEntity(0,2);case fi.NumericHex:return this.emitNumericEntity(0,3);case fi.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fi.EntityStart:return 0}}}function sve(e,t,n,s){const i=(t&Hl.BRANCH_LENGTH)>>7,r=t&Hl.JUMP_TABLE;if(i===0)return r!==0&&s===r?n:-1;if(r){const c=s-r;return c<0||c>=i?-1:e[n+c]-1}let a=n,l=a+i-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(us)l=c-1;else return e[c+i]}return-1}var je;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(je||(je={}));var ru;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(ru||(ru={}));var Qr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Qr||(Qr={}));var me;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(me||(me={}));var N;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(N||(N={}));const ive=new Map([[me.A,N.A],[me.ADDRESS,N.ADDRESS],[me.ANNOTATION_XML,N.ANNOTATION_XML],[me.APPLET,N.APPLET],[me.AREA,N.AREA],[me.ARTICLE,N.ARTICLE],[me.ASIDE,N.ASIDE],[me.B,N.B],[me.BASE,N.BASE],[me.BASEFONT,N.BASEFONT],[me.BGSOUND,N.BGSOUND],[me.BIG,N.BIG],[me.BLOCKQUOTE,N.BLOCKQUOTE],[me.BODY,N.BODY],[me.BR,N.BR],[me.BUTTON,N.BUTTON],[me.CAPTION,N.CAPTION],[me.CENTER,N.CENTER],[me.CODE,N.CODE],[me.COL,N.COL],[me.COLGROUP,N.COLGROUP],[me.DD,N.DD],[me.DESC,N.DESC],[me.DETAILS,N.DETAILS],[me.DIALOG,N.DIALOG],[me.DIR,N.DIR],[me.DIV,N.DIV],[me.DL,N.DL],[me.DT,N.DT],[me.EM,N.EM],[me.EMBED,N.EMBED],[me.FIELDSET,N.FIELDSET],[me.FIGCAPTION,N.FIGCAPTION],[me.FIGURE,N.FIGURE],[me.FONT,N.FONT],[me.FOOTER,N.FOOTER],[me.FOREIGN_OBJECT,N.FOREIGN_OBJECT],[me.FORM,N.FORM],[me.FRAME,N.FRAME],[me.FRAMESET,N.FRAMESET],[me.H1,N.H1],[me.H2,N.H2],[me.H3,N.H3],[me.H4,N.H4],[me.H5,N.H5],[me.H6,N.H6],[me.HEAD,N.HEAD],[me.HEADER,N.HEADER],[me.HGROUP,N.HGROUP],[me.HR,N.HR],[me.HTML,N.HTML],[me.I,N.I],[me.IMG,N.IMG],[me.IMAGE,N.IMAGE],[me.INPUT,N.INPUT],[me.IFRAME,N.IFRAME],[me.KEYGEN,N.KEYGEN],[me.LABEL,N.LABEL],[me.LI,N.LI],[me.LINK,N.LINK],[me.LISTING,N.LISTING],[me.MAIN,N.MAIN],[me.MALIGNMARK,N.MALIGNMARK],[me.MARQUEE,N.MARQUEE],[me.MATH,N.MATH],[me.MENU,N.MENU],[me.META,N.META],[me.MGLYPH,N.MGLYPH],[me.MI,N.MI],[me.MO,N.MO],[me.MN,N.MN],[me.MS,N.MS],[me.MTEXT,N.MTEXT],[me.NAV,N.NAV],[me.NOBR,N.NOBR],[me.NOFRAMES,N.NOFRAMES],[me.NOEMBED,N.NOEMBED],[me.NOSCRIPT,N.NOSCRIPT],[me.OBJECT,N.OBJECT],[me.OL,N.OL],[me.OPTGROUP,N.OPTGROUP],[me.OPTION,N.OPTION],[me.P,N.P],[me.PARAM,N.PARAM],[me.PLAINTEXT,N.PLAINTEXT],[me.PRE,N.PRE],[me.RB,N.RB],[me.RP,N.RP],[me.RT,N.RT],[me.RTC,N.RTC],[me.RUBY,N.RUBY],[me.S,N.S],[me.SCRIPT,N.SCRIPT],[me.SEARCH,N.SEARCH],[me.SECTION,N.SECTION],[me.SELECT,N.SELECT],[me.SOURCE,N.SOURCE],[me.SMALL,N.SMALL],[me.SPAN,N.SPAN],[me.STRIKE,N.STRIKE],[me.STRONG,N.STRONG],[me.STYLE,N.STYLE],[me.SUB,N.SUB],[me.SUMMARY,N.SUMMARY],[me.SUP,N.SUP],[me.TABLE,N.TABLE],[me.TBODY,N.TBODY],[me.TEMPLATE,N.TEMPLATE],[me.TEXTAREA,N.TEXTAREA],[me.TFOOT,N.TFOOT],[me.TD,N.TD],[me.TH,N.TH],[me.THEAD,N.THEAD],[me.TITLE,N.TITLE],[me.TR,N.TR],[me.TRACK,N.TRACK],[me.TT,N.TT],[me.U,N.U],[me.UL,N.UL],[me.SVG,N.SVG],[me.VAR,N.VAR],[me.WBR,N.WBR],[me.XMP,N.XMP]]);function mh(e){var t;return(t=ive.get(e))!==null&&t!==void 0?t:N.UNKNOWN}const Re=N,rve={[je.HTML]:new Set([Re.ADDRESS,Re.APPLET,Re.AREA,Re.ARTICLE,Re.ASIDE,Re.BASE,Re.BASEFONT,Re.BGSOUND,Re.BLOCKQUOTE,Re.BODY,Re.BR,Re.BUTTON,Re.CAPTION,Re.CENTER,Re.COL,Re.COLGROUP,Re.DD,Re.DETAILS,Re.DIR,Re.DIV,Re.DL,Re.DT,Re.EMBED,Re.FIELDSET,Re.FIGCAPTION,Re.FIGURE,Re.FOOTER,Re.FORM,Re.FRAME,Re.FRAMESET,Re.H1,Re.H2,Re.H3,Re.H4,Re.H5,Re.H6,Re.HEAD,Re.HEADER,Re.HGROUP,Re.HR,Re.HTML,Re.IFRAME,Re.IMG,Re.INPUT,Re.LI,Re.LINK,Re.LISTING,Re.MAIN,Re.MARQUEE,Re.MENU,Re.META,Re.NAV,Re.NOEMBED,Re.NOFRAMES,Re.NOSCRIPT,Re.OBJECT,Re.OL,Re.P,Re.PARAM,Re.PLAINTEXT,Re.PRE,Re.SCRIPT,Re.SECTION,Re.SELECT,Re.SOURCE,Re.STYLE,Re.SUMMARY,Re.TABLE,Re.TBODY,Re.TD,Re.TEMPLATE,Re.TEXTAREA,Re.TFOOT,Re.TH,Re.THEAD,Re.TITLE,Re.TR,Re.TRACK,Re.UL,Re.WBR,Re.XMP]),[je.MATHML]:new Set([Re.MI,Re.MO,Re.MN,Re.MS,Re.MTEXT,Re.ANNOTATION_XML]),[je.SVG]:new Set([Re.TITLE,Re.FOREIGN_OBJECT,Re.DESC]),[je.XLINK]:new Set,[je.XML]:new Set,[je.XMLNS]:new Set},kN=new Set([Re.H1,Re.H2,Re.H3,Re.H4,Re.H5,Re.H6]);me.STYLE,me.SCRIPT,me.XMP,me.IFRAME,me.NOEMBED,me.NOFRAMES,me.PLAINTEXT;var q;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(q||(q={}));const zs={DATA:q.DATA,RCDATA:q.RCDATA,RAWTEXT:q.RAWTEXT,SCRIPT_DATA:q.SCRIPT_DATA,PLAINTEXT:q.PLAINTEXT,CDATA_SECTION:q.CDATA_SECTION};function ave(e){return e>=G.DIGIT_0&&e<=G.DIGIT_9}function Nm(e){return e>=G.LATIN_CAPITAL_A&&e<=G.LATIN_CAPITAL_Z}function ove(e){return e>=G.LATIN_SMALL_A&&e<=G.LATIN_SMALL_Z}function Sl(e){return ove(e)||Nm(e)}function WL(e){return Sl(e)||ave(e)}function db(e){return e+32}function A$(e){return e===G.SPACE||e===G.LINE_FEED||e===G.TABULATION||e===G.FORM_FEED}function XL(e){return A$(e)||e===G.SOLIDUS||e===G.GREATER_THAN_SIGN}function lve(e){return e===G.NULL?ve.nullCharacterReference:e>1114111?ve.characterReferenceOutsideUnicodeRange:S$(e)?ve.surrogateCharacterReference:T$(e)?ve.noncharacterCharacterReference:N$(e)||e===G.CARRIAGE_RETURN?ve.controlCharacterReference:null}class cve{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=q.DATA,this.returnState=q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new YEe(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new nve(WEe,(s,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(s)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ve.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:s=>{this._err(ve.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+s)},validateNumericCharacterReference:s=>{const i=lve(s);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var s,i;(i=(s=this.handler).onParseError)===null||i===void 0||i.call(s,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,s){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||s==null||s()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(ve.endTagWithAttributes),t.selfClosing&&this._err(ve.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Gt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Gt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Gt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Gt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=A$(t)?Gt.WHITESPACE_CHARACTER:t===G.NULL?Gt.NULL_CHARACTER:Gt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Gt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Mo.Attribute:Mo.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case q.DATA:{this._stateData(t);break}case q.RCDATA:{this._stateRcdata(t);break}case q.RAWTEXT:{this._stateRawtext(t);break}case q.SCRIPT_DATA:{this._stateScriptData(t);break}case q.PLAINTEXT:{this._statePlaintext(t);break}case q.TAG_OPEN:{this._stateTagOpen(t);break}case q.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case q.TAG_NAME:{this._stateTagName(t);break}case q.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case q.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case q.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case q.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case q.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case q.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case q.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case q.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case q.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case q.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case q.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case q.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case q.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case q.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case q.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case q.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case q.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case q.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case q.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case q.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case q.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case q.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case q.BOGUS_COMMENT:{this._stateBogusComment(t);break}case q.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case q.COMMENT_START:{this._stateCommentStart(t);break}case q.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case q.COMMENT:{this._stateComment(t);break}case q.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case q.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case q.COMMENT_END:{this._stateCommentEnd(t);break}case q.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case q.DOCTYPE:{this._stateDoctype(t);break}case q.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case q.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case q.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case q.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case q.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case q.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case q.CDATA_SECTION:{this._stateCdataSection(t);break}case q.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case q.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case q.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case q.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case G.LESS_THAN_SIGN:{this.state=q.TAG_OPEN;break}case G.AMPERSAND:{this._startCharacterReference();break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitCodePoint(t);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case G.AMPERSAND:{this._startCharacterReference();break}case G.LESS_THAN_SIGN:{this.state=q.RCDATA_LESS_THAN_SIGN;break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(us);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case G.LESS_THAN_SIGN:{this.state=q.RAWTEXT_LESS_THAN_SIGN;break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(us);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case G.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_LESS_THAN_SIGN;break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(us);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(us);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Sl(t))this._createStartTagToken(),this.state=q.TAG_NAME,this._stateTagName(t);else switch(t){case G.EXCLAMATION_MARK:{this.state=q.MARKUP_DECLARATION_OPEN;break}case G.SOLIDUS:{this.state=q.END_TAG_OPEN;break}case G.QUESTION_MARK:{this._err(ve.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=q.BOGUS_COMMENT,this._stateBogusComment(t);break}case G.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=q.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Sl(t))this._createEndTagToken(),this.state=q.TAG_NAME,this._stateTagName(t);else switch(t){case G.GREATER_THAN_SIGN:{this._err(ve.missingEndTagName),this.state=q.DATA;break}case G.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("");break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_ESCAPED,this._emitChars(us);break}case G.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===G.SOLIDUS?this.state=q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Sl(t)?(this._emitChars("<"),this.state=q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Sl(t)?(this.state=q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(us);break}case G.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===G.SOLIDUS?(this.state=q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(or.SCRIPT,!1)&&XL(this.preprocessor.peek(or.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const s=this._indexOf(t);this.items[s]=n,s===this.stackTop&&(this.current=n)}insertAfter(t,n,s){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,s),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==je.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;s--)if(t.has(this.tagIDs[s])&&this.treeAdapter.getNamespaceURI(this.items[s])===n)return s;return-1}clearBackTo(t,n){const s=this._indexOfTagNames(t,n);this.shortenToLength(s+1)}clearBackToTableContext(){this.clearBackTo(mve,je.HTML)}clearBackToTableBodyContext(){this.clearBackTo(hve,je.HTML)}clearBackToTableRowContext(){this.clearBackTo(fve,je.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===N.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===N.HTML}hasInDynamicScope(t,n){for(let s=this.stackTop;s>=0;s--){const i=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case je.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case je.SVG:{if(JL.has(i))return!1;break}case je.MATHML:{if(ZL.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,C1)}hasInListItemScope(t){return this.hasInDynamicScope(t,uve)}hasInButtonScope(t){return this.hasInDynamicScope(t,dve)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case je.HTML:{if(kN.has(n))return!0;if(C1.has(n))return!1;break}case je.SVG:{if(JL.has(n))return!1;break}case je.MATHML:{if(ZL.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===je.HTML)switch(this.tagIDs[n]){case t:return!0;case N.TABLE:case N.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===je.HTML)switch(this.tagIDs[t]){case N.TBODY:case N.THEAD:case N.TFOOT:return!0;case N.TABLE:case N.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===je.HTML)switch(this.tagIDs[n]){case t:return!0;case N.OPTION:case N.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&C$.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&QL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&QL.has(this.currentTagId);)this.pop()}}const Lw=3;var Qa;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Qa||(Qa={}));const e3={type:Qa.Marker};class bve{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const s=[],i=n.length,r=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[a.name,a.value]));let r=0;for(let a=0;ai.get(c.name)===c.value)&&(r+=1,r>=Lw&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(e3)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Qa.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const s=this.entries.indexOf(this.bookmark);this.entries.splice(s,0,{type:Qa.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(e3);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(s=>s.type===Qa.Marker||this.treeAdapter.getTagName(s.element)===t);return n&&n.type===Qa.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Qa.Element&&n.element===t)}}const Nl={createDocument(){return{nodeName:"#document",mode:Qr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const s=e.childNodes.indexOf(n);e.childNodes.splice(s,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,s){const i=e.childNodes.find(r=>r.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=s;else{const r={nodeName:"#documentType",name:t,publicId:n,systemId:s,parentNode:null};Nl.appendChild(e,r)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Nl.isTextNode(n)){n.value+=t;return}}Nl.appendChild(e,Nl.createTextNode(t))},insertTextBefore(e,t,n){const s=e.childNodes[e.childNodes.indexOf(n)-1];s&&Nl.isTextNode(s)?s.value+=t:Nl.insertBefore(e,Nl.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(s=>s.name));for(let s=0;se.startsWith(n))}function _ve(e){return e.name===I$&&e.publicId===null&&(e.systemId===null||e.systemId===yve)}function Sve(e){if(e.name!==I$)return Qr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===xve)return Qr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),vve.has(n))return Qr.QUIRKS;let s=t===null?Eve:j$;if(t3(n,s))return Qr.QUIRKS;if(s=t===null?R$:wve,t3(n,s))return Qr.LIMITED_QUIRKS}return Qr.NO_QUIRKS}const n3={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Nve="definitionurl",Tve="definitionURL",kve=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Ave=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:je.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:je.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:je.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:je.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:je.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:je.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:je.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:je.XML}],["xml:space",{prefix:"xml",name:"space",namespace:je.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:je.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:je.XMLNS}]]),Cve=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Ive=new Set([N.B,N.BIG,N.BLOCKQUOTE,N.BODY,N.BR,N.CENTER,N.CODE,N.DD,N.DIV,N.DL,N.DT,N.EM,N.EMBED,N.H1,N.H2,N.H3,N.H4,N.H5,N.H6,N.HEAD,N.HR,N.I,N.IMG,N.LI,N.LISTING,N.MENU,N.META,N.NOBR,N.OL,N.P,N.PRE,N.RUBY,N.S,N.SMALL,N.SPAN,N.STRONG,N.STRIKE,N.SUB,N.SUP,N.TABLE,N.TT,N.U,N.UL,N.VAR]);function jve(e){const t=e.tagID;return t===N.FONT&&e.attrs.some(({name:s})=>s===ru.COLOR||s===ru.SIZE||s===ru.FACE)||Ive.has(t)}function O$(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var s,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(s=this.treeAdapter).onItemPop)===null||i===void 0||i.call(s,t,this.openElements.current),n){let r,a;this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,a=this.fragmentContextID):{current:r,currentTagId:a}=this.openElements,this._setContextModes(r,a)}}_setContextModes(t,n){const s=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===je.HTML;this.currentNotInHTML=!s,this.tokenizer.inForeignNode=!s&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,je.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=J.TEXT}switchToPlaintextParsing(){this.insertionMode=J.TEXT,this.originalInsertionMode=J.IN_BODY,this.tokenizer.state=zs.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===me.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==je.HTML))switch(this.fragmentContextID){case N.TITLE:case N.TEXTAREA:{this.tokenizer.state=zs.RCDATA;break}case N.STYLE:case N.XMP:case N.IFRAME:case N.NOEMBED:case N.NOFRAMES:case N.NOSCRIPT:{this.tokenizer.state=zs.RAWTEXT;break}case N.SCRIPT:{this.tokenizer.state=zs.SCRIPT_DATA;break}case N.PLAINTEXT:{this.tokenizer.state=zs.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",s=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,s,i),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const s=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,s)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const s=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(s??this.document,t)}}_appendElement(t,n){const s=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(s,t.location)}_insertElement(t,n){const s=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(s,t.location),this.openElements.push(s,t.tagID)}_insertFakeElement(t,n){const s=this.treeAdapter.createElement(t,je.HTML,[]);this._attachElementToTree(s,null),this.openElements.push(s,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,je.HTML,t.attrs),s=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,s),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(me.HTML,je.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,N.HTML)}_appendCommentNode(t,n){const s=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,s),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_insertCharacters(t){let n,s;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:s}=this._findFosterParentingLocation(),s?this.treeAdapter.insertTextBefore(n,t.chars,s):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),r=s?i.lastIndexOf(s):i.length,a=i[r-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let s=this.treeAdapter.getFirstChild(t);s;s=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(s),this.treeAdapter.appendChild(n,s)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const s=n.location,i=this.treeAdapter.getTagName(t),r=n.type===Gt.END_TAG&&i===n.tagName?{endTag:{...s},endLine:s.endLine,endCol:s.endCol,endOffset:s.endOffset}:{endLine:s.startLine,endCol:s.startCol,endOffset:s.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,r)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,s;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,s=this.fragmentContextID):{current:n,currentTagId:s}=this.openElements,t.tagID===N.SVG&&this.treeAdapter.getTagName(n)===me.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===je.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===N.MGLYPH||t.tagID===N.MALIGNMARK)&&s!==void 0&&!this._isIntegrationPoint(s,n,je.HTML)}_processToken(t){switch(t.type){case Gt.CHARACTER:{this.onCharacter(t);break}case Gt.NULL_CHARACTER:{this.onNullCharacter(t);break}case Gt.COMMENT:{this.onComment(t);break}case Gt.DOCTYPE:{this.onDoctype(t);break}case Gt.START_TAG:{this._processStartTag(t);break}case Gt.END_TAG:{this.onEndTag(t);break}case Gt.EOF:{this.onEof(t);break}case Gt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,s){const i=this.treeAdapter.getNamespaceURI(n),r=this.treeAdapter.getAttrList(n);return Lve(t,i,r,s)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Qa.Marker||this.openElements.contains(i.element)),s=n===-1?t-1:n-1;for(let i=s;i>=0;i--){const r=this.activeFormattingElements.entries[i];this._insertElement(r.token,this.treeAdapter.getNamespaceURI(r.element)),r.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=J.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(N.P),this.openElements.popUntilTagNamePopped(N.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case N.TR:{this.insertionMode=J.IN_ROW;return}case N.TBODY:case N.THEAD:case N.TFOOT:{this.insertionMode=J.IN_TABLE_BODY;return}case N.CAPTION:{this.insertionMode=J.IN_CAPTION;return}case N.COLGROUP:{this.insertionMode=J.IN_COLUMN_GROUP;return}case N.TABLE:{this.insertionMode=J.IN_TABLE;return}case N.BODY:{this.insertionMode=J.IN_BODY;return}case N.FRAMESET:{this.insertionMode=J.IN_FRAMESET;return}case N.SELECT:{this._resetInsertionModeForSelect(t);return}case N.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case N.HTML:{this.insertionMode=this.headElement?J.AFTER_HEAD:J.BEFORE_HEAD;return}case N.TD:case N.TH:{if(t>0){this.insertionMode=J.IN_CELL;return}break}case N.HEAD:{if(t>0){this.insertionMode=J.IN_HEAD;return}break}}this.insertionMode=J.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const s=this.openElements.tagIDs[n];if(s===N.TEMPLATE)break;if(s===N.TABLE){this.insertionMode=J.IN_SELECT_IN_TABLE;return}}this.insertionMode=J.IN_SELECT}_isElementCausesFosterParenting(t){return L$.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case N.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===je.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case N.TABLE:{const s=this.treeAdapter.getParentNode(n);return s?{parent:s,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const s=this.treeAdapter.getNamespaceURI(t);return rve[s].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){p_e(this,t);return}switch(this.insertionMode){case J.INITIAL:{im(this,t);break}case J.BEFORE_HTML:{ip(this,t);break}case J.BEFORE_HEAD:{rp(this,t);break}case J.IN_HEAD:{ap(this,t);break}case J.IN_HEAD_NO_SCRIPT:{op(this,t);break}case J.AFTER_HEAD:{lp(this,t);break}case J.IN_BODY:case J.IN_CAPTION:case J.IN_CELL:case J.IN_TEMPLATE:{P$(this,t);break}case J.TEXT:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{Dw(this,t);break}case J.IN_TABLE_TEXT:{z$(this,t);break}case J.IN_COLUMN_GROUP:{I1(this,t);break}case J.AFTER_BODY:{j1(this,t);break}case J.AFTER_AFTER_BODY:{ly(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){m_e(this,t);return}switch(this.insertionMode){case J.INITIAL:{im(this,t);break}case J.BEFORE_HTML:{ip(this,t);break}case J.BEFORE_HEAD:{rp(this,t);break}case J.IN_HEAD:{ap(this,t);break}case J.IN_HEAD_NO_SCRIPT:{op(this,t);break}case J.AFTER_HEAD:{lp(this,t);break}case J.TEXT:{this._insertCharacters(t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{Dw(this,t);break}case J.IN_COLUMN_GROUP:{I1(this,t);break}case J.AFTER_BODY:{j1(this,t);break}case J.AFTER_AFTER_BODY:{ly(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){AN(this,t);return}switch(this.insertionMode){case J.INITIAL:case J.BEFORE_HTML:case J.BEFORE_HEAD:case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:case J.IN_BODY:case J.IN_TABLE:case J.IN_CAPTION:case J.IN_COLUMN_GROUP:case J.IN_TABLE_BODY:case J.IN_ROW:case J.IN_CELL:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:case J.IN_TEMPLATE:case J.IN_FRAMESET:case J.AFTER_FRAMESET:{AN(this,t);break}case J.IN_TABLE_TEXT:{rm(this,t);break}case J.AFTER_BODY:{Kve(this,t);break}case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{qve(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case J.INITIAL:{Yve(this,t);break}case J.BEFORE_HEAD:case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:{this._err(t,ve.misplacedDoctype);break}case J.IN_TABLE_TEXT:{rm(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ve.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?g_e(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case J.INITIAL:{im(this,t);break}case J.BEFORE_HTML:{Wve(this,t);break}case J.BEFORE_HEAD:{Qve(this,t);break}case J.IN_HEAD:{Ua(this,t);break}case J.IN_HEAD_NO_SCRIPT:{ewe(this,t);break}case J.AFTER_HEAD:{nwe(this,t);break}case J.IN_BODY:{Vi(this,t);break}case J.IN_TABLE:{Hf(this,t);break}case J.IN_TABLE_TEXT:{rm(this,t);break}case J.IN_CAPTION:{Zwe(this,t);break}case J.IN_COLUMN_GROUP:{mA(this,t);break}case J.IN_TABLE_BODY:{eE(this,t);break}case J.IN_ROW:{tE(this,t);break}case J.IN_CELL:{t_e(this,t);break}case J.IN_SELECT:{K$(this,t);break}case J.IN_SELECT_IN_TABLE:{s_e(this,t);break}case J.IN_TEMPLATE:{r_e(this,t);break}case J.AFTER_BODY:{o_e(this,t);break}case J.IN_FRAMESET:{l_e(this,t);break}case J.AFTER_FRAMESET:{u_e(this,t);break}case J.AFTER_AFTER_BODY:{f_e(this,t);break}case J.AFTER_AFTER_FRAMESET:{h_e(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?b_e(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case J.INITIAL:{im(this,t);break}case J.BEFORE_HTML:{Xve(this,t);break}case J.BEFORE_HEAD:{Zve(this,t);break}case J.IN_HEAD:{Jve(this,t);break}case J.IN_HEAD_NO_SCRIPT:{twe(this,t);break}case J.AFTER_HEAD:{swe(this,t);break}case J.IN_BODY:{Jx(this,t);break}case J.TEXT:{Hwe(this,t);break}case J.IN_TABLE:{Jp(this,t);break}case J.IN_TABLE_TEXT:{rm(this,t);break}case J.IN_CAPTION:{Jwe(this,t);break}case J.IN_COLUMN_GROUP:{e_e(this,t);break}case J.IN_TABLE_BODY:{CN(this,t);break}case J.IN_ROW:{G$(this,t);break}case J.IN_CELL:{n_e(this,t);break}case J.IN_SELECT:{q$(this,t);break}case J.IN_SELECT_IN_TABLE:{i_e(this,t);break}case J.IN_TEMPLATE:{a_e(this,t);break}case J.AFTER_BODY:{W$(this,t);break}case J.IN_FRAMESET:{c_e(this,t);break}case J.AFTER_FRAMESET:{d_e(this,t);break}case J.AFTER_AFTER_BODY:{ly(this,t);break}}}onEof(t){switch(this.insertionMode){case J.INITIAL:{im(this,t);break}case J.BEFORE_HTML:{ip(this,t);break}case J.BEFORE_HEAD:{rp(this,t);break}case J.IN_HEAD:{ap(this,t);break}case J.IN_HEAD_NO_SCRIPT:{op(this,t);break}case J.AFTER_HEAD:{lp(this,t);break}case J.IN_BODY:case J.IN_TABLE:case J.IN_CAPTION:case J.IN_COLUMN_GROUP:case J.IN_TABLE_BODY:case J.IN_ROW:case J.IN_CELL:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:{$$(this,t);break}case J.TEXT:{zwe(this,t);break}case J.IN_TABLE_TEXT:{rm(this,t);break}case J.IN_TEMPLATE:{Y$(this,t);break}case J.AFTER_BODY:case J.IN_FRAMESET:case J.AFTER_FRAMESET:case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{hA(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===G.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:case J.TEXT:case J.IN_COLUMN_GROUP:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:case J.IN_FRAMESET:case J.AFTER_FRAMESET:{this._insertCharacters(t);break}case J.IN_BODY:case J.IN_CAPTION:case J.IN_CELL:case J.IN_TEMPLATE:case J.AFTER_BODY:case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{D$(this,t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{Dw(this,t);break}case J.IN_TABLE_TEXT:{H$(this,t);break}}}};function Fve(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):F$(e,t),n}function $ve(e,t){let n=null,s=e.openElements.stackTop;for(;s>=0;s--){const i=e.openElements.items[s];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[s])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(s,0)),e.activeFormattingElements.removeEntry(t)),n}function Hve(e,t,n){let s=t,i=e.openElements.getCommonAncestor(t);for(let r=0,a=i;a!==n;r++,a=i){i=e.openElements.getCommonAncestor(a);const l=e.activeFormattingElements.getElementEntry(a),c=l&&r>=Bve;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=zve(e,l),s===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(a,s),s=a)}return s}function zve(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function Vve(e,t,n){const s=e.treeAdapter.getTagName(t),i=mh(s);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const r=e.treeAdapter.getNamespaceURI(t);i===N.TEMPLATE&&r===je.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Gve(e,t,n){const s=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,r=e.treeAdapter.createElement(i.tagName,s,i.attrs);e._adoptNodes(t,r),e.treeAdapter.appendChild(t,r),e.activeFormattingElements.insertElementAfterBookmark(r,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,r,i.tagID)}function fA(e,t){for(let n=0;n=n;s--)e._setEndLocation(e.openElements.items[s],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const s=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(s);if(i&&!i.endTag&&(e._setEndLocation(s,t),e.openElements.stackTop>=1)){const r=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(r);a&&!a.endTag&&e._setEndLocation(r,t)}}}}function Yve(e,t){e._setDocumentType(t);const n=t.forceQuirks?Qr.QUIRKS:Sve(t);_ve(t)||e._err(t,ve.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=J.BEFORE_HTML}function im(e,t){e._err(t,ve.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Qr.QUIRKS),e.insertionMode=J.BEFORE_HTML,e._processToken(t)}function Wve(e,t){t.tagID===N.HTML?(e._insertElement(t,je.HTML),e.insertionMode=J.BEFORE_HEAD):ip(e,t)}function Xve(e,t){const n=t.tagID;(n===N.HTML||n===N.HEAD||n===N.BODY||n===N.BR)&&ip(e,t)}function ip(e,t){e._insertFakeRootElement(),e.insertionMode=J.BEFORE_HEAD,e._processToken(t)}function Qve(e,t){switch(t.tagID){case N.HTML:{Vi(e,t);break}case N.HEAD:{e._insertElement(t,je.HTML),e.headElement=e.openElements.current,e.insertionMode=J.IN_HEAD;break}default:rp(e,t)}}function Zve(e,t){const n=t.tagID;n===N.HEAD||n===N.BODY||n===N.HTML||n===N.BR?rp(e,t):e._err(t,ve.endTagWithoutMatchingOpenElement)}function rp(e,t){e._insertFakeElement(me.HEAD,N.HEAD),e.headElement=e.openElements.current,e.insertionMode=J.IN_HEAD,e._processToken(t)}function Ua(e,t){switch(t.tagID){case N.HTML:{Vi(e,t);break}case N.BASE:case N.BASEFONT:case N.BGSOUND:case N.LINK:case N.META:{e._appendElement(t,je.HTML),t.ackSelfClosing=!0;break}case N.TITLE:{e._switchToTextParsing(t,zs.RCDATA);break}case N.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,zs.RAWTEXT):(e._insertElement(t,je.HTML),e.insertionMode=J.IN_HEAD_NO_SCRIPT);break}case N.NOFRAMES:case N.STYLE:{e._switchToTextParsing(t,zs.RAWTEXT);break}case N.SCRIPT:{e._switchToTextParsing(t,zs.SCRIPT_DATA);break}case N.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=J.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(J.IN_TEMPLATE);break}case N.HEAD:{e._err(t,ve.misplacedStartTagForHeadElement);break}default:ap(e,t)}}function Jve(e,t){switch(t.tagID){case N.HEAD:{e.openElements.pop(),e.insertionMode=J.AFTER_HEAD;break}case N.BODY:case N.BR:case N.HTML:{ap(e,t);break}case N.TEMPLATE:{Lu(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function Lu(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==N.TEMPLATE&&e._err(t,ve.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(N.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ve.endTagWithoutMatchingOpenElement)}function ap(e,t){e.openElements.pop(),e.insertionMode=J.AFTER_HEAD,e._processToken(t)}function ewe(e,t){switch(t.tagID){case N.HTML:{Vi(e,t);break}case N.BASEFONT:case N.BGSOUND:case N.HEAD:case N.LINK:case N.META:case N.NOFRAMES:case N.STYLE:{Ua(e,t);break}case N.NOSCRIPT:{e._err(t,ve.nestedNoscriptInHead);break}default:op(e,t)}}function twe(e,t){switch(t.tagID){case N.NOSCRIPT:{e.openElements.pop(),e.insertionMode=J.IN_HEAD;break}case N.BR:{op(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function op(e,t){const n=t.type===Gt.EOF?ve.openElementsLeftAfterEof:ve.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=J.IN_HEAD,e._processToken(t)}function nwe(e,t){switch(t.tagID){case N.HTML:{Vi(e,t);break}case N.BODY:{e._insertElement(t,je.HTML),e.framesetOk=!1,e.insertionMode=J.IN_BODY;break}case N.FRAMESET:{e._insertElement(t,je.HTML),e.insertionMode=J.IN_FRAMESET;break}case N.BASE:case N.BASEFONT:case N.BGSOUND:case N.LINK:case N.META:case N.NOFRAMES:case N.SCRIPT:case N.STYLE:case N.TEMPLATE:case N.TITLE:{e._err(t,ve.abandonedHeadElementChild),e.openElements.push(e.headElement,N.HEAD),Ua(e,t),e.openElements.remove(e.headElement);break}case N.HEAD:{e._err(t,ve.misplacedStartTagForHeadElement);break}default:lp(e,t)}}function swe(e,t){switch(t.tagID){case N.BODY:case N.HTML:case N.BR:{lp(e,t);break}case N.TEMPLATE:{Lu(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function lp(e,t){e._insertFakeElement(me.BODY,N.BODY),e.insertionMode=J.IN_BODY,Zx(e,t)}function Zx(e,t){switch(t.type){case Gt.CHARACTER:{P$(e,t);break}case Gt.WHITESPACE_CHARACTER:{D$(e,t);break}case Gt.COMMENT:{AN(e,t);break}case Gt.START_TAG:{Vi(e,t);break}case Gt.END_TAG:{Jx(e,t);break}case Gt.EOF:{$$(e,t);break}}}function D$(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function P$(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function iwe(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function rwe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function awe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,je.HTML),e.insertionMode=J.IN_FRAMESET)}function owe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,je.HTML)}function lwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&kN.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,je.HTML)}function cwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,je.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function uwe(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,je.HTML),n||(e.formElement=e.openElements.current))}function dwe(e,t){e.framesetOk=!1;const n=t.tagID;for(let s=e.openElements.stackTop;s>=0;s--){const i=e.openElements.tagIDs[s];if(n===N.LI&&i===N.LI||(n===N.DD||n===N.DT)&&(i===N.DD||i===N.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==N.ADDRESS&&i!==N.DIV&&i!==N.P&&e._isSpecialElement(e.openElements.items[s],i))break}e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,je.HTML)}function fwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,je.HTML),e.tokenizer.state=zs.PLAINTEXT}function hwe(e,t){e.openElements.hasInScope(N.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(N.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,je.HTML),e.framesetOk=!1}function mwe(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(me.A);n&&(fA(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,je.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pwe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,je.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gwe(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(N.NOBR)&&(fA(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,je.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bwe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,je.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function ywe(e,t){e.treeAdapter.getDocumentMode(e.document)!==Qr.QUIRKS&&e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,je.HTML),e.framesetOk=!1,e.insertionMode=J.IN_TABLE}function B$(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,je.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function U$(e){const t=k$(e,ru.TYPE);return t!=null&&t.toLowerCase()===Dve}function xwe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,je.HTML),U$(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Ewe(e,t){e._appendElement(t,je.HTML),t.ackSelfClosing=!0}function vwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._appendElement(t,je.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function wwe(e,t){t.tagName=me.IMG,t.tagID=N.IMG,B$(e,t)}function _we(e,t){e._insertElement(t,je.HTML),e.skipNextNewLine=!0,e.tokenizer.state=zs.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=J.TEXT}function Swe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,zs.RAWTEXT)}function Nwe(e,t){e.framesetOk=!1,e._switchToTextParsing(t,zs.RAWTEXT)}function r3(e,t){e._switchToTextParsing(t,zs.RAWTEXT)}function Twe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,je.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===J.IN_TABLE||e.insertionMode===J.IN_CAPTION||e.insertionMode===J.IN_TABLE_BODY||e.insertionMode===J.IN_ROW||e.insertionMode===J.IN_CELL?J.IN_SELECT_IN_TABLE:J.IN_SELECT}function kwe(e,t){e.openElements.currentTagId===N.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,je.HTML)}function Awe(e,t){e.openElements.hasInScope(N.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,je.HTML)}function Cwe(e,t){e.openElements.hasInScope(N.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(N.RTC),e._insertElement(t,je.HTML)}function Iwe(e,t){e._reconstructActiveFormattingElements(),O$(t),dA(t),t.selfClosing?e._appendElement(t,je.MATHML):e._insertElement(t,je.MATHML),t.ackSelfClosing=!0}function jwe(e,t){e._reconstructActiveFormattingElements(),M$(t),dA(t),t.selfClosing?e._appendElement(t,je.SVG):e._insertElement(t,je.SVG),t.ackSelfClosing=!0}function a3(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,je.HTML)}function Vi(e,t){switch(t.tagID){case N.I:case N.S:case N.B:case N.U:case N.EM:case N.TT:case N.BIG:case N.CODE:case N.FONT:case N.SMALL:case N.STRIKE:case N.STRONG:{pwe(e,t);break}case N.A:{mwe(e,t);break}case N.H1:case N.H2:case N.H3:case N.H4:case N.H5:case N.H6:{lwe(e,t);break}case N.P:case N.DL:case N.OL:case N.UL:case N.DIV:case N.DIR:case N.NAV:case N.MAIN:case N.MENU:case N.ASIDE:case N.CENTER:case N.FIGURE:case N.FOOTER:case N.HEADER:case N.HGROUP:case N.DIALOG:case N.DETAILS:case N.ADDRESS:case N.ARTICLE:case N.SEARCH:case N.SECTION:case N.SUMMARY:case N.FIELDSET:case N.BLOCKQUOTE:case N.FIGCAPTION:{owe(e,t);break}case N.LI:case N.DD:case N.DT:{dwe(e,t);break}case N.BR:case N.IMG:case N.WBR:case N.AREA:case N.EMBED:case N.KEYGEN:{B$(e,t);break}case N.HR:{vwe(e,t);break}case N.RB:case N.RTC:{Awe(e,t);break}case N.RT:case N.RP:{Cwe(e,t);break}case N.PRE:case N.LISTING:{cwe(e,t);break}case N.XMP:{Swe(e,t);break}case N.SVG:{jwe(e,t);break}case N.HTML:{iwe(e,t);break}case N.BASE:case N.LINK:case N.META:case N.STYLE:case N.TITLE:case N.SCRIPT:case N.BGSOUND:case N.BASEFONT:case N.TEMPLATE:{Ua(e,t);break}case N.BODY:{rwe(e,t);break}case N.FORM:{uwe(e,t);break}case N.NOBR:{gwe(e,t);break}case N.MATH:{Iwe(e,t);break}case N.TABLE:{ywe(e,t);break}case N.INPUT:{xwe(e,t);break}case N.PARAM:case N.TRACK:case N.SOURCE:{Ewe(e,t);break}case N.IMAGE:{wwe(e,t);break}case N.BUTTON:{hwe(e,t);break}case N.APPLET:case N.OBJECT:case N.MARQUEE:{bwe(e,t);break}case N.IFRAME:{Nwe(e,t);break}case N.SELECT:{Twe(e,t);break}case N.OPTION:case N.OPTGROUP:{kwe(e,t);break}case N.NOEMBED:case N.NOFRAMES:{r3(e,t);break}case N.FRAMESET:{awe(e,t);break}case N.TEXTAREA:{_we(e,t);break}case N.NOSCRIPT:{e.options.scriptingEnabled?r3(e,t):a3(e,t);break}case N.PLAINTEXT:{fwe(e,t);break}case N.COL:case N.TH:case N.TD:case N.TR:case N.HEAD:case N.FRAME:case N.TBODY:case N.TFOOT:case N.THEAD:case N.CAPTION:case N.COLGROUP:break;default:a3(e,t)}}function Rwe(e,t){if(e.openElements.hasInScope(N.BODY)&&(e.insertionMode=J.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Owe(e,t){e.openElements.hasInScope(N.BODY)&&(e.insertionMode=J.AFTER_BODY,W$(e,t))}function Mwe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Lwe(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(N.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(N.FORM):n&&e.openElements.remove(n))}function Dwe(e){e.openElements.hasInButtonScope(N.P)||e._insertFakeElement(me.P,N.P),e._closePElement()}function Pwe(e){e.openElements.hasInListItemScope(N.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(N.LI),e.openElements.popUntilTagNamePopped(N.LI))}function Bwe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Uwe(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Fwe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function $we(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(me.BR,N.BR),e.openElements.pop(),e.framesetOk=!1}function F$(e,t){const n=t.tagName,s=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const r=e.openElements.items[i],a=e.openElements.tagIDs[i];if(s===a&&(s!==N.UNKNOWN||e.treeAdapter.getTagName(r)===n)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(r,a))break}}function Jx(e,t){switch(t.tagID){case N.A:case N.B:case N.I:case N.S:case N.U:case N.EM:case N.TT:case N.BIG:case N.CODE:case N.FONT:case N.NOBR:case N.SMALL:case N.STRIKE:case N.STRONG:{fA(e,t);break}case N.P:{Dwe(e);break}case N.DL:case N.UL:case N.OL:case N.DIR:case N.DIV:case N.NAV:case N.PRE:case N.MAIN:case N.MENU:case N.ASIDE:case N.BUTTON:case N.CENTER:case N.FIGURE:case N.FOOTER:case N.HEADER:case N.HGROUP:case N.DIALOG:case N.ADDRESS:case N.ARTICLE:case N.DETAILS:case N.SEARCH:case N.SECTION:case N.SUMMARY:case N.LISTING:case N.FIELDSET:case N.BLOCKQUOTE:case N.FIGCAPTION:{Mwe(e,t);break}case N.LI:{Pwe(e);break}case N.DD:case N.DT:{Bwe(e,t);break}case N.H1:case N.H2:case N.H3:case N.H4:case N.H5:case N.H6:{Uwe(e);break}case N.BR:{$we(e);break}case N.BODY:{Rwe(e,t);break}case N.HTML:{Owe(e,t);break}case N.FORM:{Lwe(e);break}case N.APPLET:case N.OBJECT:case N.MARQUEE:{Fwe(e,t);break}case N.TEMPLATE:{Lu(e,t);break}default:F$(e,t)}}function $$(e,t){e.tmplInsertionModeStack.length>0?Y$(e,t):hA(e,t)}function Hwe(e,t){var n;t.tagID===N.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function zwe(e,t){e._err(t,ve.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Dw(e,t){if(e.openElements.currentTagId!==void 0&&L$.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=J.IN_TABLE_TEXT,t.type){case Gt.CHARACTER:{z$(e,t);break}case Gt.WHITESPACE_CHARACTER:{H$(e,t);break}}else Ug(e,t)}function Vwe(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,je.HTML),e.insertionMode=J.IN_CAPTION}function Gwe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,je.HTML),e.insertionMode=J.IN_COLUMN_GROUP}function Kwe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.COLGROUP,N.COLGROUP),e.insertionMode=J.IN_COLUMN_GROUP,mA(e,t)}function qwe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,je.HTML),e.insertionMode=J.IN_TABLE_BODY}function Ywe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(me.TBODY,N.TBODY),e.insertionMode=J.IN_TABLE_BODY,eE(e,t)}function Wwe(e,t){e.openElements.hasInTableScope(N.TABLE)&&(e.openElements.popUntilTagNamePopped(N.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Xwe(e,t){U$(t)?e._appendElement(t,je.HTML):Ug(e,t),t.ackSelfClosing=!0}function Qwe(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,je.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Hf(e,t){switch(t.tagID){case N.TD:case N.TH:case N.TR:{Ywe(e,t);break}case N.STYLE:case N.SCRIPT:case N.TEMPLATE:{Ua(e,t);break}case N.COL:{Kwe(e,t);break}case N.FORM:{Qwe(e,t);break}case N.TABLE:{Wwe(e,t);break}case N.TBODY:case N.TFOOT:case N.THEAD:{qwe(e,t);break}case N.INPUT:{Xwe(e,t);break}case N.CAPTION:{Vwe(e,t);break}case N.COLGROUP:{Gwe(e,t);break}default:Ug(e,t)}}function Jp(e,t){switch(t.tagID){case N.TABLE:{e.openElements.hasInTableScope(N.TABLE)&&(e.openElements.popUntilTagNamePopped(N.TABLE),e._resetInsertionMode());break}case N.TEMPLATE:{Lu(e,t);break}case N.BODY:case N.CAPTION:case N.COL:case N.COLGROUP:case N.HTML:case N.TBODY:case N.TD:case N.TFOOT:case N.TH:case N.THEAD:case N.TR:break;default:Ug(e,t)}}function Ug(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Zx(e,t),e.fosterParentingEnabled=n}function H$(e,t){e.pendingCharacterTokens.push(t)}function z$(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function rm(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===N.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===N.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===N.OPTGROUP&&e.openElements.pop();break}case N.OPTION:{e.openElements.currentTagId===N.OPTION&&e.openElements.pop();break}case N.SELECT:{e.openElements.hasInSelectScope(N.SELECT)&&(e.openElements.popUntilTagNamePopped(N.SELECT),e._resetInsertionMode());break}case N.TEMPLATE:{Lu(e,t);break}}}function s_e(e,t){const n=t.tagID;n===N.CAPTION||n===N.TABLE||n===N.TBODY||n===N.TFOOT||n===N.THEAD||n===N.TR||n===N.TD||n===N.TH?(e.openElements.popUntilTagNamePopped(N.SELECT),e._resetInsertionMode(),e._processStartTag(t)):K$(e,t)}function i_e(e,t){const n=t.tagID;n===N.CAPTION||n===N.TABLE||n===N.TBODY||n===N.TFOOT||n===N.THEAD||n===N.TR||n===N.TD||n===N.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(N.SELECT),e._resetInsertionMode(),e.onEndTag(t)):q$(e,t)}function r_e(e,t){switch(t.tagID){case N.BASE:case N.BASEFONT:case N.BGSOUND:case N.LINK:case N.META:case N.NOFRAMES:case N.SCRIPT:case N.STYLE:case N.TEMPLATE:case N.TITLE:{Ua(e,t);break}case N.CAPTION:case N.COLGROUP:case N.TBODY:case N.TFOOT:case N.THEAD:{e.tmplInsertionModeStack[0]=J.IN_TABLE,e.insertionMode=J.IN_TABLE,Hf(e,t);break}case N.COL:{e.tmplInsertionModeStack[0]=J.IN_COLUMN_GROUP,e.insertionMode=J.IN_COLUMN_GROUP,mA(e,t);break}case N.TR:{e.tmplInsertionModeStack[0]=J.IN_TABLE_BODY,e.insertionMode=J.IN_TABLE_BODY,eE(e,t);break}case N.TD:case N.TH:{e.tmplInsertionModeStack[0]=J.IN_ROW,e.insertionMode=J.IN_ROW,tE(e,t);break}default:e.tmplInsertionModeStack[0]=J.IN_BODY,e.insertionMode=J.IN_BODY,Vi(e,t)}}function a_e(e,t){t.tagID===N.TEMPLATE&&Lu(e,t)}function Y$(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(N.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):hA(e,t)}function o_e(e,t){t.tagID===N.HTML?Vi(e,t):j1(e,t)}function W$(e,t){var n;if(t.tagID===N.HTML){if(e.fragmentContext||(e.insertionMode=J.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===N.HTML){e._setEndLocation(e.openElements.items[0],t);const s=e.openElements.items[1];s&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(s))===null||n===void 0)&&n.endTag)&&e._setEndLocation(s,t)}}else j1(e,t)}function j1(e,t){e.insertionMode=J.IN_BODY,Zx(e,t)}function l_e(e,t){switch(t.tagID){case N.HTML:{Vi(e,t);break}case N.FRAMESET:{e._insertElement(t,je.HTML);break}case N.FRAME:{e._appendElement(t,je.HTML),t.ackSelfClosing=!0;break}case N.NOFRAMES:{Ua(e,t);break}}}function c_e(e,t){t.tagID===N.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==N.FRAMESET&&(e.insertionMode=J.AFTER_FRAMESET))}function u_e(e,t){switch(t.tagID){case N.HTML:{Vi(e,t);break}case N.NOFRAMES:{Ua(e,t);break}}}function d_e(e,t){t.tagID===N.HTML&&(e.insertionMode=J.AFTER_AFTER_FRAMESET)}function f_e(e,t){t.tagID===N.HTML?Vi(e,t):ly(e,t)}function ly(e,t){e.insertionMode=J.IN_BODY,Zx(e,t)}function h_e(e,t){switch(t.tagID){case N.HTML:{Vi(e,t);break}case N.NOFRAMES:{Ua(e,t);break}}}function m_e(e,t){t.chars=us,e._insertCharacters(t)}function p_e(e,t){e._insertCharacters(t),e.framesetOk=!1}function X$(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==je.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function g_e(e,t){if(jve(t))X$(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(n);s===je.MATHML?O$(t):s===je.SVG&&(Rve(t),M$(t)),dA(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0}}function b_e(e,t){if(t.tagID===N.P||t.tagID===N.BR){X$(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const s=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(s)===je.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(s);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}me.AREA,me.BASE,me.BASEFONT,me.BGSOUND,me.BR,me.COL,me.EMBED,me.FRAME,me.HR,me.IMG,me.INPUT,me.KEYGEN,me.LINK,me.META,me.PARAM,me.SOURCE,me.TRACK,me.WBR;const y_e=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,x_e=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),o3={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Q$(e,t){const n=C_e(e),s=fF("type",{handlers:{root:E_e,element:v_e,text:w_e,comment:J$,doctype:__e,raw:N_e},unknown:T_e}),i={parser:n?new i3(o3):i3.getFragmentParser(void 0,o3),handle(l){s(l,i)},stitches:!1,options:t||{}};s(e,i),ph(i,fo());const r=n?i.parser.document:i.parser.getFragment(),a=IEe(r,{file:i.options.file});return i.stitches&&Pg(a,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Z$(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Gt.CHARACTER,chars:e.value,location:Fg(e)};ph(t,fo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function __e(e,t){const n={type:Gt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Fg(e)};ph(t,fo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function S_e(e,t){t.stitches=!0;const n=I_e(e);if("children"in e&&"children"in n){const s=Q$({type:"root",children:e.children},t.options);n.children=s.children}J$({type:"comment",value:{stitch:n}},t)}function J$(e,t){const n=e.value,s={type:Gt.COMMENT,data:n,location:Fg(e)};ph(t,fo(e)),t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken)}function N_e(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,eH(t,fo(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(y_e,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function T_e(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))S_e(n,t);else{let s="";throw x_e.has(n.type)&&(s=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+s)}}function ph(e,t){eH(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=zs.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function eH(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function k_e(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===zs.PLAINTEXT)return;ph(t,fo(e));const s=t.parser.openElements.current;let i="namespaceURI"in s?s.namespaceURI:Vc.html;i===Vc.html&&n==="svg"&&(i=Vc.svg);const r=LEe({...e,children:[]},{space:i===Vc.svg?"svg":"html"}),a={type:Gt.START_TAG,tagName:n,tagID:mh(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in r?r.attrs:[],location:Fg(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function A_e(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&zEe.includes(n)||t.parser.tokenizer.state===zs.PLAINTEXT)return;ph(t,Kx(e));const s={type:Gt.END_TAG,tagName:n,tagID:mh(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Fg(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===zs.RCDATA||t.parser.tokenizer.state===zs.RAWTEXT||t.parser.tokenizer.state===zs.SCRIPT_DATA)&&(t.parser.tokenizer.state=zs.DATA)}function C_e(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Fg(e){const t=fo(e)||{line:void 0,column:void 0,offset:void 0},n=Kx(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function I_e(e){return"children"in e?Ff({...e,children:[]}):Ff(e)}function j_e(e){return function(t,n){return Q$(t,{...e,file:n})}}const tH=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function nH(e){if(!e)return!1;try{const t=e.toLowerCase();return tH.some(n=>t.includes(n))}catch{return!1}}function R_e(e){var s;const t=(s=e==null?void 0:e.properties)==null?void 0:s.href;if(!t)return!1;if(nH(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const i=n.map(r=>(r==null?void 0:r.value)||"").join("").toLowerCase();return tH.some(r=>i.includes(r))}return!1}function O_e({text:e,className:t,allowRawHtml:n=!0}){const[s,i]=g.useState(null),r=(c,u)=>{if(c.src)return c.src;if(u){const d=h=>{var m;if(!h)return null;if(h.type==="source"&&((m=h.properties)!=null&&m.src))return h.properties.src;if(h.children)for(const p of h.children){const b=d(p);if(b)return b}return null},f=d({children:u});if(f)return f}return""},a=c=>{try{const d=new URL(c).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},l=c=>c?Array.isArray(c)?c.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(c==null?void 0:c.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(D0e,{remarkPlugins:[Wye],rehypePlugins:n?[j_e,VL]:[VL],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(nH(d)||R_e(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>i({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(eu,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(RB,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(eu,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=r({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>i({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(eu,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>i(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||a(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||a(s.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(bx,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>i(null),children:o.jsx(Ri,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const gh=g.memo(O_e),l3=6,c3=7,M_e={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function IN(e){return M_e[(e||"").trim().toLowerCase()]||"未知"}function u3(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)?"is-positive":["creating","pending","running","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function L_e(e){if(!e)return"";const t=e.trim(),n=Number(t),s=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(s.getTime())?e:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(s)}function D_e(e){const t=e.replace(/\r\n/g,` +`,...r.current()});return/^[\t ]/.test(u)&&(u=qm(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),l(),u}mF.peek=Bbe;function mF(e){return e.value||""}function Bbe(){return"<"}gF.peek=Ube;function gF(e,t,n,s){const i=eA(n),r=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let l=n.enter("label");const c=n.createTracker(s);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${r}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),l()),u+=c.move(")"),a(),u}function Ube(){return"!"}bF.peek=Fbe;function bF(e,t,n,s){const i=e.referenceType,r=n.enter("imageReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,r(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Fbe(){return"!"}yF.peek=$be;function yF(e,t,n){let s=e.value||"",i="`",r=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(s);)i+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++r\u007F]/.test(e.url))}EF.peek=Hbe;function EF(e,t,n,s){const i=eA(n),r=i==='"'?"Quote":"Apostrophe",a=n.createTracker(s);let l,c;if(xF(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),l(),n.stack=d,f}l=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${r}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),l(),u}function Hbe(e,t,n){return xF(e,n)?"<":"["}vF.peek=zbe;function vF(e,t,n,s){const i=e.referenceType,r=n.enter("linkReference");let a=n.enter("label");const l=n.createTracker(s);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return a(),n.stack=d,r(),i==="full"||!u||u!==f?c+=l.move(f+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function zbe(){return"["}function tA(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Vbe(e){const t=tA(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Gbe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function wF(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Kbe(e,t,n,s){const i=n.enter("list"),r=n.bulletCurrent;let a=e.ordered?Gbe(n):tA(n);const l=e.ordered?a==="."?")":".":Vbe(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),wF(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+r);let a=r.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const l=n.createTracker(s);l.move(r+" ".repeat(a-r.length)),l.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?r:r+" ".repeat(a-r.length))+f}}function Wbe(e,t,n,s){const i=n.enter("paragraph"),r=n.enter("phrasing"),a=n.containerPhrasing(e,s);return r(),i(),a}const Xbe=Og(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Qbe(e,t,n,s){return(e.children.some(function(a){return Xbe(a)})?n.containerPhrasing:n.containerFlow).call(n,e,s)}function Zbe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_F.peek=Jbe;function _F(e,t,n,s){const i=Zbe(n),r=n.enter("strong"),a=n.createTracker(s),l=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:l,...a.current()}));const u=c.charCodeAt(0),d=T1(s.before.charCodeAt(s.before.length-1),u,i);d.inside&&(c=qm(u)+c.slice(1));const f=c.charCodeAt(c.length-1),h=T1(s.after.charCodeAt(0),f,i);h.inside&&(c=c.slice(0,-1)+qm(f));const p=a.move(i+i);return r(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},l+c+p}function Jbe(e,t,n){return n.options.strong||"*"}function eye(e,t,n,s){return n.safe(e.value,s)}function tye(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function nye(e,t,n){const s=(wF(n)+(n.options.ruleSpaces?" ":"")).repeat(tye(n));return n.options.ruleSpaces?s.slice(0,-1):s}const SF={blockquote:Nbe,break:_L,code:jbe,definition:Obe,emphasis:pF,hardBreak:_L,heading:Pbe,html:mF,image:gF,imageReference:bF,inlineCode:yF,link:EF,linkReference:vF,list:Kbe,listItem:Ybe,paragraph:Wbe,root:Qbe,strong:_F,text:eye,thematicBreak:nye};function sye(){return{enter:{table:iye,tableData:SL,tableHeader:SL,tableRow:aye},exit:{codeText:oye,table:rye,tableData:jw,tableHeader:jw,tableRow:jw}}}function iye(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function rye(e){this.exit(e),this.data.inTable=void 0}function aye(e){this.enter({type:"tableRow",children:[]},e)}function jw(e){this.exit(e)}function SL(e){this.enter({type:"tableCell",children:[]},e)}function oye(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lye));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lye(e,t){return t==="|"?t:e}function cye(e){const t=e||{},n=t.tableCellPadding,s=t.tablePipeAlign,i=t.stringLength,r=n?" ":"|";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:h,table:a,tableCell:c,tableRow:l}};function a(p,m,b,v){return u(d(p,b,v),p.align)}function l(p,m,b,v){const y=f(p,b,v),x=u([y]);return x.slice(0,x.indexOf(` +`))}function c(p,m,b,v){const y=b.enter("tableCell"),x=b.enter("phrasing"),E=b.containerPhrasing(p,{...v,before:r,after:r});return x(),y(),E}function u(p,m){return _be(p,{align:m,alignDelimiters:s,padding:n,stringLength:i})}function d(p,m,b){const v=p.children;let y=-1;const x=[],E=m.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const kye={tokenize:Lye,partial:!0};function Aye(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Rye,continuation:{tokenize:Oye},exit:Mye}},text:{91:{name:"gfmFootnoteCall",tokenize:jye},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Cye,resolveTo:Iye}}}}function Cye(e,t,n){const s=this;let i=s.events.length;const r=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let a;for(;i--;){const c=s.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!a||!a._balanced)return n(c);const u=Ba(s.sliceSerialize({start:a.end,end:s.now()}));return u.codePointAt(0)!==94||!r.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function Iye(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const r={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},r.start),end:Object.assign({},r.end)},l=[e[n+1],e[n+2],["enter",s,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",r,t],["enter",a,t],["exit",a,t],["exit",r,t],e[e.length-2],e[e.length-1],["exit",s,t]];return e.splice(n,e.length-n+1,...l),e}function jye(e,t,n){const s=this,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let r=0,a;return l;function l(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(r>999||f===93&&!a||f===null||f===91||Fn(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Ba(s.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Fn(f)||(a=!0),r++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),r++,u):u(f)}}function Rye(e,t,n){const s=this,i=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let r,a=0,l;return c;function c(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(m)}function d(m){if(a>999||m===93&&!l||m===null||m===91||Fn(m))return n(m);if(m===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return r=Ba(s.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Fn(m)||(l=!0),a++,e.consume(m),m===92?f:d}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(r)||i.push(r),nn(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function Oye(e,t,n){return e.check(Rg,t,e.attempt(kye,t,n))}function Mye(e){e.exit("gfmFootnoteDefinition")}function Lye(e,t,n){const s=this;return nn(e,i,"gfmFootnoteDefinitionIndent",5);function i(r){const a=s.events[s.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(r):n(r)}}function Dye(e){let n=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:r,resolveAll:i};return n==null&&(n=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function i(a,l){let c=-1;for(;++c1?c(m):(a.consume(m),f++,p);if(f<2&&!n)return c(m);const v=a.exit("strikethroughSequenceTemporary"),y=Pf(m);return v._open=!y||y===2&&!!b,v._close=!b||b===2&&!!y,l(m)}}}class Pye{constructor(){this.map=[]}add(t,n,s){Bye(this,t,n,s)}consume(t){if(this.map.sort(function(r,a){return r[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let i=s.pop();for(;i;){for(const r of i)t.push(r);i=s.pop()}this.map.length=0}}function Bye(e,t,n,s){let i=0;if(!(n===0&&s.length===0)){for(;i-1;){const L=s.events[R][1].type;if(L==="lineEnding"||L==="linePrefix")R--;else break}const B=R>-1?s.events[R][1].type:null,z=B==="tableHead"||B==="tableRow"?_:c;return z===_&&s.parser.lazy[s.now().line]?n(j):z(j)}function c(j){return e.enter("tableHead"),e.enter("tableRow"),u(j)}function u(j){return j===124||(a=!0,r+=1),d(j)}function d(j){return j===null?n(j):pt(j)?r>1?(r=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),p):n(j):Kt(j)?nn(e,d,"whitespace")(j):(r+=1,a&&(a=!1,i+=1),j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(j)))}function f(j){return j===null||j===124||Fn(j)?(e.exit("data"),d(j)):(e.consume(j),j===92?h:f)}function h(j){return j===92||j===124?(e.consume(j),f):f(j)}function p(j){return s.interrupt=!1,s.parser.lazy[s.now().line]?n(j):(e.enter("tableDelimiterRow"),a=!1,Kt(j)?nn(e,m,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):m(j))}function m(j){return j===45||j===58?v(j):j===124?(a=!0,e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),b):S(j)}function b(j){return Kt(j)?nn(e,v,"whitespace")(j):v(j)}function v(j){return j===58?(r+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),y):j===45?(r+=1,y(j)):j===null||pt(j)?w(j):S(j)}function y(j){return j===45?(e.enter("tableDelimiterFiller"),x(j)):S(j)}function x(j){return j===45?(e.consume(j),x):j===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(j),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(j))}function E(j){return Kt(j)?nn(e,w,"whitespace")(j):w(j)}function w(j){return j===124?m(j):j===null||pt(j)?!a||i!==r?S(j):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(j)):S(j)}function S(j){return n(j)}function _(j){return e.enter("tableRow"),T(j)}function T(j){return j===124?(e.enter("tableCellDivider"),e.consume(j),e.exit("tableCellDivider"),T):j===null||pt(j)?(e.exit("tableRow"),t(j)):Kt(j)?nn(e,T,"whitespace")(j):(e.enter("data"),k(j))}function k(j){return j===null||j===124||Fn(j)?(e.exit("data"),T(j)):(e.consume(j),j===92?A:k)}function A(j){return j===92||j===124?(e.consume(j),k):k(j)}}function Hye(e,t){let n=-1,s=!0,i=0,r=[0,0,0,0],a=[0,0,0,0],l=!1,c=0,u,d,f;const h=new Pye;for(;++nn[2]+1){const m=n[2]+1,b=n[3]-n[2]-1;e.add(m,b,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(r.end=Object.assign({},gd(t.events,i)),e.add(i,0,[["exit",r,t]]),r=void 0),r}function TL(e,t,n,s,i){const r=[],a=gd(t.events,n);i&&(i.end=Object.assign({},a),r.push(["exit",i,t])),s.end=Object.assign({},a),r.push(["exit",s,t]),e.add(n+1,0,r)}function gd(e,t){const n=e[t],s=n[0]==="enter"?"start":"end";return n[1][s]}const zye={name:"tasklistCheck",tokenize:Gye};function Vye(){return{text:{91:zye}}}function Gye(e,t,n){const s=this;return i;function i(c){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),r)}function r(c){return Fn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return pt(c)?t(c):Kt(c)?e.check({tokenize:Kye},t,n)(c):n(c)}}function Kye(e,t,n){return nn(e,s,"whitespace");function s(i){return i===null?n(i):t(i)}}function qye(e){return $7([yye(),Aye(),Dye(e),Fye(),Vye()])}const Yye={};function Wye(e){const t=this,n=e||Yye,s=t.data(),i=s.micromarkExtensions||(s.micromarkExtensions=[]),r=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),a=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);i.push(qye(n)),r.push(pye()),a.push(mye(n))}const kL=function(e,t,n){const s=Og(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` +`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function MF(e,t,n){return e.type==="element"?s1e(e,t,n):e.type==="text"?n.whitespace==="normal"?LF(e,n):i1e(e):[]}function s1e(e,t,n){const s=DF(e,n),i=e.children||[];let r=-1,a=[];if(t1e(e))return a;let l,c;for(SN(e)||jL(e)&&kL(t,e,jL)?c=` +`:e1e(e)?(l=2,c=2):OF(e)&&(l=1,c=1);++r]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:b,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:_.concat([{begin:/\(/,end:/\)/,keywords:w,contains:_.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function d1e(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=u1e(e),s=n.keywords;return s.type=[...s.type,...t.type],s.literal=[...s.literal,...t.literal],s.built_in=[...s.built_in,...t.built_in],s._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function PF(e){const t=e.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],w=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:v,built_in:[...x,...E,"set","shopt",...w,...S]},contains:[p,e.SHEBANG(),m,f,r,a,y,l,c,u,d,n]}}function f1e(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+s+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},E={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:v}}}function h1e(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+s+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],w={type:b,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},S={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[S,f,l,n,e.C_BLOCK_COMMENT_MODE,d,u],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:_.concat([{begin:/\(/,end:/\)/,keywords:w,contains:_.concat(["self"]),relevance:0}]),relevance:0},k={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:w,illegal:"",keywords:w,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function p1e(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],r=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:i.concat(r),built_in:t,literal:s},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},f=e.inherit(d,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},p=e.inherit(h,{illegal:/\n/}),m={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[b,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],p.contains=[v,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,b,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},E=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const m1e=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),g1e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],b1e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],y1e=[...g1e,...b1e],x1e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),E1e=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),v1e=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),w1e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function _1e(e){const t=e.regex,n=m1e(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",r=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,s,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+E1e.join("|")+")"},{begin:":(:)?("+v1e.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+w1e.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:r},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:x1e.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+y1e.join("|")+")\\b"}]}}function S1e(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function N1e(e){const r={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:r,illegal:"UF(e,t,n-1))}function k1e(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=n+UF("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,RL,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},RL,u]}}const OL="[A-Za-z$_][0-9A-Za-z$_]*",A1e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],C1e=["true","false","null","undefined","NaN","Infinity"],FF=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],$F=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],HF=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],I1e=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],j1e=[].concat(HF,FF,$F);function zF(e){const t=e.regex,n=(D,{after:$})=>{const O="",end:""},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,$)=>{const O=D[0].length+D.index,te=D.input[O];if(te==="<"||te===","){$.ignoreMatch();return}te===">"&&(n(D,{after:O})||$.ignoreMatch());let se;const P=D.input.substring(O);if(se=P.match(/^\s*=/)){$.ignoreMatch();return}if((se=P.match(/^\s+extends\s+/))&&se.index===0){$.ignoreMatch();return}}},l={$pattern:OL,keyword:A1e,literal:C1e,built_in:j1e,"variable.language":I1e},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,v,{match:/\$\d+/},f];h.contains=E.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(E)});const w=[].concat(x,h.contains),S=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},T={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...FF,...$F]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(D){return t.concat("(?!",D.join("|"),")")}const z={match:t.concat(/\b/,B([...HF,"super","import"].map(D=>`${D}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,v,x,{match:/\$\d+/},f,k,{scope:"attr",match:s+t.lookahead(":"),relevance:0},I,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:r},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},z,R,T,F,{match:/\$[(.]/}]}}function VF(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],i={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var yd="[0-9](_*[0-9])*",lb=`\\.(${yd})`,cb="[0-9a-fA-F](_*[0-9a-fA-F])*",R1e={className:"number",variants:[{begin:`(\\b(${yd})((${lb})|\\.)?|(${lb}))[eE][+-]?(${yd})[fFdD]?\\b`},{begin:`\\b(${yd})((${lb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${lb})[fFdD]?\\b`},{begin:`\\b(${yd})[fFdD]\\b`},{begin:`\\b0[xX]((${cb})\\.?|(${cb})?\\.(${cb}))[pP][+-]?(${yd})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${cb})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function O1e(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,i]}]};i.contains.push(a);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},u=R1e,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),f={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=f;return h.variants[1].contains=[f],f.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,s,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[f,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,a,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const M1e=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),L1e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],D1e=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],P1e=[...L1e,...D1e],B1e=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),GF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),KF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),U1e=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),F1e=GF.concat(KF).sort().reverse();function $1e(e){const t=M1e(e),n=F1e,s="and or not only",i="[\\w-]+",r="("+i+"|@\\{"+i+"\\})",a=[],l=[],c=function(E){return{className:"string",begin:"~?"+E+".*?"+E}},u=function(E,w,S){return{className:E,begin:w,relevance:S}},d={$pattern:/[a-z-]+/,keyword:s,attribute:B1e.join(" ")},f={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=l.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},m={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+U1e.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:h}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+P1e.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",r,0),u("selector-id","#"+r),u("selector-class","\\."+r,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+GF.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+KF.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,v,x,m,y,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function H1e(e){const t="\\[=*\\[",n="\\]=*\\]",s={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[s],relevance:5}])}}function qF(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},r={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},f=e.inherit(u,{contains:[]}),h=e.inherit(d,{contains:[]});u.contains.push(h),d.contains.push(f);let p=[n,c];return[u,d,f,h].forEach(y=>{y.contains=y.contains.concat(p)}),p=p.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,r,u,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,s,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function z1e(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function V1e(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},r={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,r,c],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(b,v,y="\\1")=>{const x=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,s)},p=(b,v,y)=>t.concat(t.concat("(?:",b,")"),v,/(?:\\.|[^\\\/])*?/,y,s),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:h("s|tr|y",t.either(...f,{capture:!0}))},{begin:h("s|tr|y","\\(","\\)")},{begin:h("s|tr|y","\\[","\\]")},{begin:h("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...f,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return r.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function G1e(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,s=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),r=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+s},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(L,F)=>{F.data._beginMatch=L[1]||L[2]},"on:end":(L,F)=>{F.data._beginMatch!==L[1]&&F.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:"string",variants:[d,u,f,h]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:y,literal:(L=>{const F=[];return L.forEach(C=>{F.push(C),C.toLowerCase()===C?F.push(C.toUpperCase()):F.push(C.toLowerCase())}),F})(v),built_in:x},S=L=>L.map(F=>F.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(x).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},T=t.concat(s,"\\b(?!\\()"),k={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),T],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:t.concat(s,t.lookahead(":"),t.lookahead(/(?!::)/))},j={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[A,a,k,e.C_BLOCK_COMMENT_MODE,m,b,_]},R={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(y).join("\\b|"),"|",S(x).join("\\b|"),"\\b)"),s,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[j]};j.contains.push(R);const B=[A,k,e.C_BLOCK_COMMENT_MODE,m,b,_],z={begin:t.concat(/#\[\s*\\?/,t.either(i,r)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...B]},...B,{scope:"meta",variants:[{match:i},{match:r}]}]};return{case_insensitive:!1,keywords:w,contains:[z,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},a,R,k,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",z,a,k,e.C_BLOCK_COMMENT_MODE,m,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,b]}}function K1e(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function q1e(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function WF(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},f={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${s.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${p}))[eE][+-]?(${h})[jJ]?(?=${m})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${h})[jJ](?=${m})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,b,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,f]}]}}function Y1e(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function W1e(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[r,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function X1e(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(s,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:a},f={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},h="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},_=[f,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[f,{begin:n}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=_,b.contains=_;const j=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:_}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(j).concat(u).concat(_)}}function Q1e(e){const t=e.regex,n=/(r#)?/,s=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),r={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},r]}}const Z1e=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),J1e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],exe=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],txe=[...J1e,...exe],nxe=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),sxe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),ixe=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rxe=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function axe(e){const t=Z1e(e),n=ixe,s=sxe,i="@[a-z-]+",r="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+txe.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rxe.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:nxe.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function oxe(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function lxe(e){const t=e.regex,n=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},r=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],f=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=d,m=[...u,...c].filter(S=>!d.includes(S)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function x(S){return t.concat(/\b/,t.either(...S.map(_=>_.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:x(h),relevance:0};function w(S,{exceptions:_,when:T}={}){const k=T;return _=_||[],S.map(A=>A.match(/\|\d+$/)||_.includes(A)?A:k(A)?`${A}|0`:A)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(m,{when:S=>S.length<3}),literal:r,type:l,built_in:f},contains:[{scope:"type",match:x(a)},E,y,b,s,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function XF(e){return e?typeof e=="string"?e:e.source:null}function ep(e){return jn("(?=",e,")")}function jn(...e){return e.map(n=>XF(n)).join("")}function cxe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Wi(...e){return"("+(cxe(e).capture?"":"?:")+e.map(s=>XF(s)).join("|")+")"}const iA=e=>jn(/\b/,e,/\w$/.test(e)?/\b/:/\B/),uxe=["Protocol","Type"].map(iA),ML=["init","self"].map(iA),dxe=["Any","Self"],Rw=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],LL=["false","nil","true"],fxe=["assignment","associativity","higherThan","left","lowerThan","none","right"],hxe=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],DL=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],QF=Wi(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),ZF=Wi(QF,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ow=jn(QF,ZF,"*"),JF=Wi(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),k1=Wi(JF,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),eo=jn(JF,k1,"*"),ub=jn(/[A-Z]/,k1,"*"),pxe=["attached","autoclosure",jn(/convention\(/,Wi("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",jn(/objc\(/,eo,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],mxe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function gxe(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Wi(...uxe,...ML)],className:{2:"keyword"}},r={match:jn(/\./,Wi(...Rw)),relevance:0},a=Rw.filter(ae=>typeof ae=="string").concat(["_|0"]),l=Rw.filter(ae=>typeof ae!="string").concat(dxe).map(iA),c={variants:[{className:"keyword",match:Wi(...l,...ML)}]},u={$pattern:Wi(/\b\w+/,/#\w+/),keyword:a.concat(hxe),literal:LL},d=[i,r,c],f={match:jn(/\./,Wi(...DL)),relevance:0},h={className:"built_in",match:jn(/\b/,Wi(...DL),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:Ow},{match:`\\.(\\.|${ZF})+`}]},v=[m,b],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",E={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(ae="")=>({className:"subst",variants:[{match:jn(/\\/,ae,/[0\\tnr"']/)},{match:jn(/\\/,ae,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(ae="")=>({className:"subst",match:jn(/\\/,ae,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(ae="")=>({className:"subst",label:"interpol",begin:jn(/\\/,ae,/\(/),end:/\)/}),T=(ae="")=>({begin:jn(ae,/"""/),end:jn(/"""/,ae),contains:[w(ae),S(ae),_(ae)]}),k=(ae="")=>({begin:jn(ae,/"/),end:jn(/"/,ae),contains:[w(ae),_(ae)]}),A={className:"string",variants:[T(),T("#"),T("##"),T("###"),k(),k("#"),k("##"),k("###")]},j=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],R={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:j},B=ae=>{const me=jn(ae,/\//),_e=jn(/\//,ae);return{begin:me,end:_e,contains:[...j,{scope:"comment",begin:`#(?!.*${_e})`,end:/$/}]}},z={scope:"regexp",variants:[B("###"),B("##"),B("#"),R]},L={match:jn(/`/,eo,/`/)},F={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${k1}+`},I=[L,F,C],D={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:mxe,contains:[...v,E,A]}]}},$={scope:"keyword",match:jn(/@/,Wi(...pxe),ep(Wi(/\(/,/\s+/)))},O={scope:"meta",match:jn(/@/,eo)},te=[D,$,O],se={match:ep(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:jn(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,k1,"+")},{className:"type",match:ub,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:jn(/\s+&\s+/,ep(ub)),relevance:0}]},P={begin://,keywords:u,contains:[...s,...d,...te,m,se]};se.contains.push(P);const Q={match:jn(eo,/\s*:/),keywords:"_|0",relevance:0},ee={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",Q,...s,z,...d,...p,...v,E,A,...I,...te,se]},V={begin://,keywords:"repeat each",contains:[...s,se]},X={begin:Wi(ep(jn(eo,/\s*:/)),ep(jn(eo,/\s+/,eo,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:eo}]},K={begin:/\(/,end:/\)/,keywords:u,contains:[X,...s,...d,...v,E,A,...te,se,ee],endsParent:!0,illegal:/["']/},ce={match:[/(func|macro)/,/\s+/,Wi(L.match,eo,Ow)],className:{1:"keyword",3:"title.function"},contains:[V,K,t],illegal:[/\[/,/%/]},he={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[V,K,t],illegal:/\[|%/},be={match:[/operator/,/\s+/,Ow],className:{1:"keyword",3:"title"}},ue={begin:[/precedencegroup/,/\s+/,ub],className:{1:"keyword",3:"title"},contains:[se],keywords:[...fxe,...LL],end:/}/},we={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Le={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,eo,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[V,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:ub},...d],relevance:0}]};for(const ae of A.variants){const me=ae.contains.find(Je=>Je.label==="interpol");me.keywords=u;const _e=[...d,...p,...v,E,A,...I];me.contains=[..._e,{begin:/\(/,end:/\)/,contains:["self",..._e]}]}return{name:"Swift",keywords:u,contains:[...s,ce,he,we,Le,Ne,be,ue,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},z,...d,...p,...v,E,A,...I,...te,se,ee]}}const A1="[A-Za-z$_][0-9A-Za-z$_]*",e$=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],t$=["true","false","null","undefined","NaN","Infinity"],n$=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s$=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],i$=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],r$=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],a$=[].concat(i$,n$,s$);function bxe(e){const t=e.regex,n=(D,{after:$})=>{const O="",end:""},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,$)=>{const O=D[0].length+D.index,te=D.input[O];if(te==="<"||te===","){$.ignoreMatch();return}te===">"&&(n(D,{after:O})||$.ignoreMatch());let se;const P=D.input.substring(O);if(se=P.match(/^\s*=/)){$.ignoreMatch();return}if((se=P.match(/^\s+extends\s+/))&&se.index===0){$.ignoreMatch();return}}},l={$pattern:A1,keyword:e$,literal:t$,built_in:a$,"variable.language":r$},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,v,{match:/\$\d+/},f];h.contains=E.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(E)});const w=[].concat(x,h.contains),S=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(w)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},T={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,t.concat(s,"(",t.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...n$,...s$]}},A={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},R={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function B(D){return t.concat("(?!",D.join("|"),")")}const z={match:t.concat(/\b/,B([...i$,"super","import"].map(D=>`${D}\\s*\\(`)),s,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},L={begin:t.concat(/\./,t.lookahead(t.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",I={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),A,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,b,v,x,{match:/\$\d+/},f,k,{scope:"attr",match:s+t.lookahead(":"),relevance:0},I,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:r},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},L,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},z,R,T,F,{match:/\$[(.]/}]}}function o$(e){const t=e.regex,n=bxe(e),s=A1,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],r={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:A1,keyword:e$.concat(c),literal:t$,built_in:a$.concat(i),"variable.language":r$},d={className:"meta",begin:"@"+s},f=(b,v,y)=>{const x=b.contains.findIndex(E=>E.label===v);if(x===-1)throw new Error("can not find mode to replace");b.contains.splice(x,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(b=>b.scope==="attr"),p=Object.assign({},h,{match:t.concat(s,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,r,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",l);const m=n.contains.find(b=>b.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function yxe(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(r,i),/ +/,t.either(a,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},f=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),h=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,s,c,u,d,f,h,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[h]}]}}function xxe(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},r={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},r,a,i,e.QUOTE_STRING_MODE,c,u,l]}}function Exe(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(r,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[r,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[r,a,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function l$(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},r={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,b,r,a],y=[...v];return y.pop(),y.push(l),p.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const vxe={arduino:d1e,bash:PF,c:f1e,cpp:h1e,csharp:p1e,css:_1e,diff:S1e,go:N1e,graphql:T1e,ini:BF,java:k1e,javascript:zF,json:VF,kotlin:O1e,less:$1e,lua:H1e,makefile:qF,markdown:YF,objectivec:z1e,perl:V1e,php:G1e,"php-template":K1e,plaintext:q1e,python:WF,"python-repl":Y1e,r:W1e,ruby:X1e,rust:Q1e,scss:axe,shell:oxe,sql:lxe,swift:gxe,typescript:o$,vbnet:yxe,wasm:xxe,xml:Exe,yaml:l$};function c$(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&c$(n)}),e}let PL=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function u$(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Vl(e,...t){const n=Object.create(null);for(const s in e)n[s]=e[s];return t.forEach(function(s){for(const i in s)n[i]=s[i]}),n}const wxe="",BL=e=>!!e.scope,_xe=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((s,i)=>`${s}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class Sxe{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=u$(t)}openNode(t){if(!BL(t))return;const n=_xe(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){BL(t)&&(this.buffer+=wxe)}value(){return this.buffer}span(t){this.buffer+=``}}const UL=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class rA{constructor(){this.rootNode=UL(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=UL({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(s=>this._walk(t,s)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{rA._collapse(n)}))}}class Nxe extends rA{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const s=t.root;n&&(s.scope=`language:${n}`),this.add(s)}toHTML(){return new Sxe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ym(e){return e?typeof e=="string"?e:e.source:null}function d$(e){return Du("(?=",e,")")}function Txe(e){return Du("(?:",e,")*")}function kxe(e){return Du("(?:",e,")?")}function Du(...e){return e.map(n=>Ym(n)).join("")}function Axe(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function aA(...e){return"("+(Axe(e).capture?"":"?:")+e.map(s=>Ym(s)).join("|")+")"}function f$(e){return new RegExp(e.toString()+"|").exec("").length-1}function Cxe(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Ixe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function oA(e,{joinWith:t}){let n=0;return e.map(s=>{n+=1;const i=n;let r=Ym(s),a="";for(;r.length>0;){const l=Ixe.exec(r);if(!l){a+=r;break}a+=r.substring(0,l.index),r=r.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?a+="\\"+String(Number(l[1])+i):(a+=l[0],l[0]==="("&&n++)}return a}).map(s=>`(${s})`).join(t)}const jxe=/\b\B/,h$="[a-zA-Z]\\w*",lA="[a-zA-Z_]\\w*",p$="\\b\\d+(\\.\\d+)?",m$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",g$="\\b(0b[01]+)",Rxe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Oxe=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Du(t,/.*\b/,e.binary,/\b.*/)),Vl({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,s)=>{n.index!==0&&s.ignoreMatch()}},e)},Wm={begin:"\\\\[\\s\\S]",relevance:0},Mxe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Wm]},Lxe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Wm]},Dxe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Zx=function(e,t,n={}){const s=Vl({scope:"comment",begin:e,end:t,contains:[]},n);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=aA("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:Du(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},Pxe=Zx("//","$"),Bxe=Zx("/\\*","\\*/"),Uxe=Zx("#","$"),Fxe={scope:"number",begin:p$,relevance:0},$xe={scope:"number",begin:m$,relevance:0},Hxe={scope:"number",begin:g$,relevance:0},zxe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Wm,{begin:/\[/,end:/\]/,relevance:0,contains:[Wm]}]},Vxe={scope:"title",begin:h$,relevance:0},Gxe={scope:"title",begin:lA,relevance:0},Kxe={begin:"\\.\\s*"+lA,relevance:0},qxe=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var db=Object.freeze({__proto__:null,APOS_STRING_MODE:Mxe,BACKSLASH_ESCAPE:Wm,BINARY_NUMBER_MODE:Hxe,BINARY_NUMBER_RE:g$,COMMENT:Zx,C_BLOCK_COMMENT_MODE:Bxe,C_LINE_COMMENT_MODE:Pxe,C_NUMBER_MODE:$xe,C_NUMBER_RE:m$,END_SAME_AS_BEGIN:qxe,HASH_COMMENT_MODE:Uxe,IDENT_RE:h$,MATCH_NOTHING_RE:jxe,METHOD_GUARD:Kxe,NUMBER_MODE:Fxe,NUMBER_RE:p$,PHRASAL_WORDS_MODE:Dxe,QUOTE_STRING_MODE:Lxe,REGEXP_MODE:zxe,RE_STARTERS_RE:Rxe,SHEBANG:Oxe,TITLE_MODE:Vxe,UNDERSCORE_IDENT_RE:lA,UNDERSCORE_TITLE_MODE:Gxe});function Yxe(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Wxe(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Xxe(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Yxe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Qxe(e,t){Array.isArray(e.illegal)&&(e.illegal=aA(...e.illegal))}function Zxe(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Jxe(e,t){e.relevance===void 0&&(e.relevance=1)}const eEe=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(s=>{delete e[s]}),e.keywords=n.keywords,e.begin=Du(n.beforeMatch,d$(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},tEe=["of","and","for","in","not","or","if","then","parent","list","value"],nEe="keyword";function b$(e,t,n=nEe){const s=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(r){Object.assign(s,b$(e[r],t,r))}),s;function i(r,a){t&&(a=a.map(l=>l.toLowerCase())),a.forEach(function(l){const c=l.split("|");s[c[0]]=[r,sEe(c[0],c[1])]})}}function sEe(e,t){return t?Number(t):iEe(e)?0:1}function iEe(e){return tEe.includes(e.toLowerCase())}const FL={},au=e=>{console.error(e)},$L=(e,...t)=>{console.log(`WARN: ${e}`,...t)},nd=(e,t)=>{FL[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),FL[`${e}/${t}`]=!0)},C1=new Error;function y$(e,t,{key:n}){let s=0;const i=e[n],r={},a={};for(let l=1;l<=t.length;l++)a[l+s]=i[l],r[l+s]=!0,s+=f$(t[l-1]);e[n]=a,e[n]._emit=r,e[n]._multi=!0}function rEe(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw au("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),C1;if(typeof e.beginScope!="object"||e.beginScope===null)throw au("beginScope must be object"),C1;y$(e,e.begin,{key:"beginScope"}),e.begin=oA(e.begin,{joinWith:""})}}function aEe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw au("skip, excludeEnd, returnEnd not compatible with endScope: {}"),C1;if(typeof e.endScope!="object"||e.endScope===null)throw au("endScope must be object"),C1;y$(e,e.end,{key:"endScope"}),e.end=oA(e.end,{joinWith:""})}}function oEe(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function lEe(e){oEe(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),rEe(e),aEe(e)}function cEe(e){function t(a,l){return new RegExp(Ym(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,l]),this.matchAt+=f$(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(oA(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(l);if(!c)return null;const u=c.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,d)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const c=new n;return this.rules.slice(l).forEach(([u,d])=>c.addRule(u,d)),c.compile(),this.multiRegexes[l]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,c){this.rules.push([l,c]),c.type==="begin"&&this.count++}exec(l){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(l);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(l)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(a){const l=new s;return a.contains.forEach(c=>l.addRule(c.begin,{rule:c,type:"begin"})),a.terminatorEnd&&l.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&l.addRule(a.illegal,{type:"illegal"}),l}function r(a,l){const c=a;if(a.isCompiled)return c;[Wxe,Zxe,lEe,eEe].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[Xxe,Qxe,Jxe].forEach(d=>d(a,l)),a.isCompiled=!0;let u=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),u=a.keywords.$pattern,delete a.keywords.$pattern),u=u||/\w+/,a.keywords&&(a.keywords=b$(a.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),l&&(a.begin||(a.begin=/\B|\b/),c.beginRe=t(c.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(c.endRe=t(c.end)),c.terminatorEnd=Ym(c.end)||"",a.endsWithParent&&l.terminatorEnd&&(c.terminatorEnd+=(a.end?"|":"")+l.terminatorEnd)),a.illegal&&(c.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return uEe(d==="self"?a:d)})),a.contains.forEach(function(d){r(d,c)}),a.starts&&r(a.starts,l),c.matcher=i(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Vl(e.classNameAliases||{}),r(e)}function x$(e){return e?e.endsWithParent||x$(e.starts):!1}function uEe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Vl(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:x$(e)?Vl(e,{starts:e.starts?Vl(e.starts):null}):Object.isFrozen(e)?Vl(e):e}var dEe="11.11.1";class fEe extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Mw=u$,HL=Vl,zL=Symbol("nomatch"),hEe=7,E$=function(e){const t=Object.create(null),n=Object.create(null),s=[];let i=!0;const r="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Nxe};function c(C){return l.noHighlightRe.test(C)}function u(C){let I=C.className+" ";I+=C.parentNode?C.parentNode.className:"";const D=l.languageDetectRe.exec(I);if(D){const $=k(D[1]);return $||($L(r.replace("{}",D[1])),$L("Falling back to no-highlight mode for this block.",C)),$?D[1]:"no-highlight"}return I.split(/\s+/).find($=>c($)||k($))}function d(C,I,D){let $="",O="";typeof I=="object"?($=C,D=I.ignoreIllegals,O=I.language):(nd("10.7.0","highlight(lang, code, ...args) has been deprecated."),nd("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),O=C,$=I),D===void 0&&(D=!0);const te={code:$,language:O};L("before:highlight",te);const se=te.result?te.result:f(te.language,te.code,D);return se.code=te.code,L("after:highlight",se),se}function f(C,I,D,$){const O=Object.create(null);function te(W,oe){return W.keywords[oe]}function se(){if(!_e.keywords){Pe.addText(Fe);return}let W=0;_e.keywordPatternRe.lastIndex=0;let oe=_e.keywordPatternRe.exec(Fe),Z="";for(;oe;){Z+=Fe.substring(W,oe.index);const Ee=Ne.case_insensitive?oe[0].toLowerCase():oe[0],Me=te(_e,Ee);if(Me){const[lt,Ot]=Me;if(Pe.addText(Z),Z="",O[Ee]=(O[Ee]||0)+1,O[Ee]<=hEe&&(Ye+=Ot),lt.startsWith("_"))Z+=oe[0];else{const ut=Ne.classNameAliases[lt]||lt;ee(oe[0],ut)}}else Z+=oe[0];W=_e.keywordPatternRe.lastIndex,oe=_e.keywordPatternRe.exec(Fe)}Z+=Fe.substring(W),Pe.addText(Z)}function P(){if(Fe==="")return;let W=null;if(typeof _e.subLanguage=="string"){if(!t[_e.subLanguage]){Pe.addText(Fe);return}W=f(_e.subLanguage,Fe,!0,Je[_e.subLanguage]),Je[_e.subLanguage]=W._top}else W=p(Fe,_e.subLanguage.length?_e.subLanguage:null);_e.relevance>0&&(Ye+=W.relevance),Pe.__addSublanguage(W._emitter,W.language)}function Q(){_e.subLanguage!=null?P():se(),Fe=""}function ee(W,oe){W!==""&&(Pe.startScope(oe),Pe.addText(W),Pe.endScope())}function V(W,oe){let Z=1;const Ee=oe.length-1;for(;Z<=Ee;){if(!W._emit[Z]){Z++;continue}const Me=Ne.classNameAliases[W[Z]]||W[Z],lt=oe[Z];Me?ee(lt,Me):(Fe=lt,se(),Fe=""),Z++}}function X(W,oe){return W.scope&&typeof W.scope=="string"&&Pe.openNode(Ne.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(ee(Fe,Ne.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Fe=""):W.beginScope._multi&&(V(W.beginScope,oe),Fe="")),_e=Object.create(W,{parent:{value:_e}}),_e}function K(W,oe,Z){let Ee=Cxe(W.endRe,Z);if(Ee){if(W["on:end"]){const Me=new PL(W);W["on:end"](oe,Me),Me.isMatchIgnored&&(Ee=!1)}if(Ee){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return K(W.parent,oe,Z)}function ce(W){return _e.matcher.regexIndex===0?(Fe+=W[0],1):(Ue=!0,0)}function he(W){const oe=W[0],Z=W.rule,Ee=new PL(Z),Me=[Z.__beforeBegin,Z["on:begin"]];for(const lt of Me)if(lt&&(lt(W,Ee),Ee.isMatchIgnored))return ce(oe);return Z.skip?Fe+=oe:(Z.excludeBegin&&(Fe+=oe),Q(),!Z.returnBegin&&!Z.excludeBegin&&(Fe=oe)),X(Z,W),Z.returnBegin?0:oe.length}function be(W){const oe=W[0],Z=I.substring(W.index),Ee=K(_e,W,Z);if(!Ee)return zL;const Me=_e;_e.endScope&&_e.endScope._wrap?(Q(),ee(oe,_e.endScope._wrap)):_e.endScope&&_e.endScope._multi?(Q(),V(_e.endScope,W)):Me.skip?Fe+=oe:(Me.returnEnd||Me.excludeEnd||(Fe+=oe),Q(),Me.excludeEnd&&(Fe=oe));do _e.scope&&Pe.closeNode(),!_e.skip&&!_e.subLanguage&&(Ye+=_e.relevance),_e=_e.parent;while(_e!==Ee.parent);return Ee.starts&&X(Ee.starts,W),Me.returnEnd?0:oe.length}function ue(){const W=[];for(let oe=_e;oe!==Ne;oe=oe.parent)oe.scope&&W.unshift(oe.scope);W.forEach(oe=>Pe.openNode(oe))}let we={};function Le(W,oe){const Z=oe&&oe[0];if(Fe+=W,Z==null)return Q(),0;if(we.type==="begin"&&oe.type==="end"&&we.index===oe.index&&Z===""){if(Fe+=I.slice(oe.index,oe.index+1),!i){const Ee=new Error(`0 width match regex (${C})`);throw Ee.languageName=C,Ee.badRule=we.rule,Ee}return 1}if(we=oe,oe.type==="begin")return he(oe);if(oe.type==="illegal"&&!D){const Ee=new Error('Illegal lexeme "'+Z+'" for mode "'+(_e.scope||"")+'"');throw Ee.mode=_e,Ee}else if(oe.type==="end"){const Ee=be(oe);if(Ee!==zL)return Ee}if(oe.type==="illegal"&&Z==="")return Fe+=` +`,1;if(Ve>1e5&&Ve>oe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Fe+=Z,Z.length}const Ne=k(C);if(!Ne)throw au(r.replace("{}",C)),new Error('Unknown language: "'+C+'"');const ae=cEe(Ne);let me="",_e=$||ae;const Je={},Pe=new l.__emitter(l);ue();let Fe="",Ye=0,Ce=0,Ve=0,Ue=!1;try{if(Ne.__emitTokens)Ne.__emitTokens(I,Pe);else{for(_e.matcher.considerAll();;){Ve++,Ue?Ue=!1:_e.matcher.considerAll(),_e.matcher.lastIndex=Ce;const W=_e.matcher.exec(I);if(!W)break;const oe=I.substring(Ce,W.index),Z=Le(oe,W);Ce=W.index+Z}Le(I.substring(Ce))}return Pe.finalize(),me=Pe.toHTML(),{language:C,value:me,relevance:Ye,illegal:!1,_emitter:Pe,_top:_e}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:C,value:Mw(I),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:Ce,context:I.slice(Ce-100,Ce+100),mode:W.mode,resultSoFar:me},_emitter:Pe};if(i)return{language:C,value:Mw(I),illegal:!1,relevance:0,errorRaised:W,_emitter:Pe,_top:_e};throw W}}function h(C){const I={value:Mw(C),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return I._emitter.addText(C),I}function p(C,I){I=I||l.languages||Object.keys(t);const D=h(C),$=I.filter(k).filter(j).map(Q=>f(Q,C,!1));$.unshift(D);const O=$.sort((Q,ee)=>{if(Q.relevance!==ee.relevance)return ee.relevance-Q.relevance;if(Q.language&&ee.language){if(k(Q.language).supersetOf===ee.language)return 1;if(k(ee.language).supersetOf===Q.language)return-1}return 0}),[te,se]=O,P=te;return P.secondBest=se,P}function m(C,I,D){const $=I&&n[I]||D;C.classList.add("hljs"),C.classList.add(`language-${$}`)}function b(C){let I=null;const D=u(C);if(c(D))return;if(L("before:highlightElement",{el:C,language:D}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(C)),l.throwUnescapedHTML))throw new fEe("One of your code blocks includes unescaped HTML.",C.innerHTML);I=C;const $=I.textContent,O=D?d($,{language:D,ignoreIllegals:!0}):p($);C.innerHTML=O.value,C.dataset.highlighted="yes",m(C,D,O.language),C.result={language:O.language,re:O.relevance,relevance:O.relevance},O.secondBest&&(C.secondBest={language:O.secondBest.language,relevance:O.secondBest.relevance}),L("after:highlightElement",{el:C,result:O,text:$})}function v(C){l=HL(l,C)}const y=()=>{w(),nd("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function x(){w(),nd("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function w(){function C(){w()}if(document.readyState==="loading"){E||window.addEventListener("DOMContentLoaded",C,!1),E=!0;return}document.querySelectorAll(l.cssSelector).forEach(b)}function S(C,I){let D=null;try{D=I(e)}catch($){if(au("Language definition for '{}' could not be registered.".replace("{}",C)),i)au($);else throw $;D=a}D.name||(D.name=C),t[C]=D,D.rawDefinition=I.bind(null,e),D.aliases&&A(D.aliases,{languageName:C})}function _(C){delete t[C];for(const I of Object.keys(n))n[I]===C&&delete n[I]}function T(){return Object.keys(t)}function k(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function A(C,{languageName:I}){typeof C=="string"&&(C=[C]),C.forEach(D=>{n[D.toLowerCase()]=I})}function j(C){const I=k(C);return I&&!I.disableAutodetect}function R(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=I=>{C["before:highlightBlock"](Object.assign({block:I.el},I))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=I=>{C["after:highlightBlock"](Object.assign({block:I.el},I))})}function B(C){R(C),s.push(C)}function z(C){const I=s.indexOf(C);I!==-1&&s.splice(I,1)}function L(C,I){const D=C;s.forEach(function($){$[D]&&$[D](I)})}function F(C){return nd("10.7.0","highlightBlock will be removed entirely in v12.0"),nd("10.7.0","Please use highlightElement now."),b(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:w,highlightElement:b,highlightBlock:F,configure:v,initHighlighting:y,initHighlightingOnLoad:x,registerLanguage:S,unregisterLanguage:_,listLanguages:T,getLanguage:k,registerAliases:A,autoDetection:j,inherit:HL,addPlugin:B,removePlugin:z}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=dEe,e.regex={concat:Du,lookahead:d$,either:aA,optional:kxe,anyNumberOfTimes:Txe};for(const C in db)typeof db[C]=="object"&&c$(db[C]);return Object.assign(e,db),e},Uf=E$({});Uf.newInstance=()=>E$({});var pEe=Uf;Uf.HighlightJS=Uf;Uf.default=Uf;const gr=Gf(pEe),VL={},mEe="hljs-";function gEe(e){const t=gr.newInstance();return e&&r(e),{highlight:n,highlightAuto:s,listLanguages:i,register:r,registerAlias:a,registered:l};function n(c,u,d){const f=d||VL,h=typeof f.prefix=="string"?f.prefix:mEe;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:bEe,classPrefix:h});const p=t.highlight(u,{ignoreIllegals:!0,language:c});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,b=m.data;return b.language=p.language,b.relevance=p.relevance,m}function s(c,u){const f=(u||VL).subset||i();let h=-1,p=0,m;for(;++hp&&(p=v.data.relevance,m=v)}return m||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function r(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function a(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const f=c[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class bEe{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],s=n.children[n.children.length-1];s&&s.type==="text"?s.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const s=this.stack[this.stack.length-1],i=t.root.children;n?s.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):s.children.push(...i)}openNode(t){const n=this,s=t.split(".").map(function(a,l){return l?a+"_".repeat(l):n.options.classPrefix+a}),i=this.stack[this.stack.length-1],r={type:"element",tagName:"span",properties:{className:s},children:[]};i.children.push(r),this.stack.push(r)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const yEe={};function GL(e){const t=e||yEe,n=t.aliases,s=t.detect||!1,i=t.languages||vxe,r=t.plainText,a=t.prefix,l=t.subset;let c="hljs";const u=gEe(i);if(n&&u.registerAlias(n),a){const d=a.indexOf("-");c=d===-1?a:a.slice(0,d)}return function(d,f){Mg(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const b=xEe(h);if(b===!1||!b&&!s||b&&r&&r.includes(b))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(c)||h.properties.className.unshift(c);const v=n1e(h,{whitespace:"pre"});let y;try{y=b?u.highlight(b,v,{prefix:a}):u.highlightAuto(v,{prefix:a,subset:l})}catch(x){const E=x;if(b&&/Unknown language/.test(E.message)){f.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[m,h],cause:E,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw E}!b&&y.data&&y.data.language&&h.properties.className.push("language-"+y.data.language),y.children.length>0&&(h.children=y.children)})}}function xEe(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let s;for(;++n-1&&r<=t.length){let a=0;for(;;){let l=n[a];if(l===void 0){const c=YL(t,n[a-1]);l=c===-1?t.length+1:c+1,n[a]=l}if(l>r)return{line:a+1,column:r-(a>0?n[a-1]:0)+1,offset:r};a++}}}function i(r){if(r&&typeof r.line=="number"&&typeof r.column=="number"&&!Number.isNaN(r.line)&&!Number.isNaN(r.column)){for(;n.length1?n[r.line-2]:0)+r.column-1;if(a=55296&&e<=57343}function GEe(e){return e>=56320&&e<=57343}function KEe(e,t){return(e-55296)*1024+9216+t}function T$(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function k$(e){return e>=64976&&e<=65007||VEe.has(e)}var ve;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ve||(ve={}));const qEe=65536;class YEe{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=qEe,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:s,col:i,offset:r}=this,a=i+n,l=r+n;return{code:t,startLine:s,endLine:s,startCol:a,endCol:a,startOffset:l,endOffset:l}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(GEe(n))return this.pos++,this._addGap(),KEe(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,G.EOF;return this._err(ve.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let s=0;s=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;const s=this.html.charCodeAt(n);return s===G.CARRIAGE_RETURN?G.LINE_FEED:s}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,G.EOF;let t=this.html.charCodeAt(this.pos);return t===G.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,G.LINE_FEED):t===G.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,N$(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===G.LINE_FEED||t===G.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){T$(t)?this._err(ve.controlCharacterInInputStream):k$(t)&&this._err(ve.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const WEe=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),XEe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function QEe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=XEe.get(e))!==null&&t!==void 0?t:e}var Ei;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ei||(Ei={}));const ZEe=32;var Gl;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Gl||(Gl={}));function TN(e){return e>=Ei.ZERO&&e<=Ei.NINE}function JEe(e){return e>=Ei.UPPER_A&&e<=Ei.UPPER_F||e>=Ei.LOWER_A&&e<=Ei.LOWER_F}function eve(e){return e>=Ei.UPPER_A&&e<=Ei.UPPER_Z||e>=Ei.LOWER_A&&e<=Ei.LOWER_Z||TN(e)}function tve(e){return e===Ei.EQUALS||eve(e)}var gi;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(gi||(gi={}));var Ho;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ho||(Ho={}));class nve{constructor(t,n,s){this.decodeTree=t,this.emitCodePoint=n,this.errors=s,this.state=gi.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ho.Strict}startEntity(t){this.decodeMode=t,this.state=gi.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case gi.EntityStart:return t.charCodeAt(n)===Ei.NUM?(this.state=gi.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=gi.NamedEntity,this.stateNamedEntity(t,n));case gi.NumericStart:return this.stateNumericStart(t,n);case gi.NumericDecimal:return this.stateNumericDecimal(t,n);case gi.NumericHex:return this.stateNumericHex(t,n);case gi.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|ZEe)===Ei.LOWER_X?(this.state=gi.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=gi.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,s,i){if(n!==s){const r=s-n;this.result=this.result*Math.pow(i,r)+Number.parseInt(t.substr(n,r),i),this.consumed+=r}}stateNumericHex(t,n){const s=n;for(;n>14;for(;n>14,r!==0){if(a===Ei.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==Ho.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:s}=this,i=(s[n]&Gl.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,s){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Gl.VALUE_LENGTH:i[t+1],s),n===3&&this.emitCodePoint(i[t+2],s),s}end(){var t;switch(this.state){case gi.NamedEntity:return this.result!==0&&(this.decodeMode!==Ho.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case gi.NumericDecimal:return this.emitNumericEntity(0,2);case gi.NumericHex:return this.emitNumericEntity(0,3);case gi.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case gi.EntityStart:return 0}}}function sve(e,t,n,s){const i=(t&Gl.BRANCH_LENGTH)>>7,r=t&Gl.JUMP_TABLE;if(i===0)return r!==0&&s===r?n:-1;if(r){const c=s-r;return c<0||c>=i?-1:e[n+c]-1}let a=n,l=a+i-1;for(;a<=l;){const c=a+l>>>1,u=e[c];if(us)l=c-1;else return e[c+i]}return-1}var Re;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(Re||(Re={}));var ou;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(ou||(ou={}));var na;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(na||(na={}));var pe;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(pe||(pe={}));var N;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(N||(N={}));const ive=new Map([[pe.A,N.A],[pe.ADDRESS,N.ADDRESS],[pe.ANNOTATION_XML,N.ANNOTATION_XML],[pe.APPLET,N.APPLET],[pe.AREA,N.AREA],[pe.ARTICLE,N.ARTICLE],[pe.ASIDE,N.ASIDE],[pe.B,N.B],[pe.BASE,N.BASE],[pe.BASEFONT,N.BASEFONT],[pe.BGSOUND,N.BGSOUND],[pe.BIG,N.BIG],[pe.BLOCKQUOTE,N.BLOCKQUOTE],[pe.BODY,N.BODY],[pe.BR,N.BR],[pe.BUTTON,N.BUTTON],[pe.CAPTION,N.CAPTION],[pe.CENTER,N.CENTER],[pe.CODE,N.CODE],[pe.COL,N.COL],[pe.COLGROUP,N.COLGROUP],[pe.DD,N.DD],[pe.DESC,N.DESC],[pe.DETAILS,N.DETAILS],[pe.DIALOG,N.DIALOG],[pe.DIR,N.DIR],[pe.DIV,N.DIV],[pe.DL,N.DL],[pe.DT,N.DT],[pe.EM,N.EM],[pe.EMBED,N.EMBED],[pe.FIELDSET,N.FIELDSET],[pe.FIGCAPTION,N.FIGCAPTION],[pe.FIGURE,N.FIGURE],[pe.FONT,N.FONT],[pe.FOOTER,N.FOOTER],[pe.FOREIGN_OBJECT,N.FOREIGN_OBJECT],[pe.FORM,N.FORM],[pe.FRAME,N.FRAME],[pe.FRAMESET,N.FRAMESET],[pe.H1,N.H1],[pe.H2,N.H2],[pe.H3,N.H3],[pe.H4,N.H4],[pe.H5,N.H5],[pe.H6,N.H6],[pe.HEAD,N.HEAD],[pe.HEADER,N.HEADER],[pe.HGROUP,N.HGROUP],[pe.HR,N.HR],[pe.HTML,N.HTML],[pe.I,N.I],[pe.IMG,N.IMG],[pe.IMAGE,N.IMAGE],[pe.INPUT,N.INPUT],[pe.IFRAME,N.IFRAME],[pe.KEYGEN,N.KEYGEN],[pe.LABEL,N.LABEL],[pe.LI,N.LI],[pe.LINK,N.LINK],[pe.LISTING,N.LISTING],[pe.MAIN,N.MAIN],[pe.MALIGNMARK,N.MALIGNMARK],[pe.MARQUEE,N.MARQUEE],[pe.MATH,N.MATH],[pe.MENU,N.MENU],[pe.META,N.META],[pe.MGLYPH,N.MGLYPH],[pe.MI,N.MI],[pe.MO,N.MO],[pe.MN,N.MN],[pe.MS,N.MS],[pe.MTEXT,N.MTEXT],[pe.NAV,N.NAV],[pe.NOBR,N.NOBR],[pe.NOFRAMES,N.NOFRAMES],[pe.NOEMBED,N.NOEMBED],[pe.NOSCRIPT,N.NOSCRIPT],[pe.OBJECT,N.OBJECT],[pe.OL,N.OL],[pe.OPTGROUP,N.OPTGROUP],[pe.OPTION,N.OPTION],[pe.P,N.P],[pe.PARAM,N.PARAM],[pe.PLAINTEXT,N.PLAINTEXT],[pe.PRE,N.PRE],[pe.RB,N.RB],[pe.RP,N.RP],[pe.RT,N.RT],[pe.RTC,N.RTC],[pe.RUBY,N.RUBY],[pe.S,N.S],[pe.SCRIPT,N.SCRIPT],[pe.SEARCH,N.SEARCH],[pe.SECTION,N.SECTION],[pe.SELECT,N.SELECT],[pe.SOURCE,N.SOURCE],[pe.SMALL,N.SMALL],[pe.SPAN,N.SPAN],[pe.STRIKE,N.STRIKE],[pe.STRONG,N.STRONG],[pe.STYLE,N.STYLE],[pe.SUB,N.SUB],[pe.SUMMARY,N.SUMMARY],[pe.SUP,N.SUP],[pe.TABLE,N.TABLE],[pe.TBODY,N.TBODY],[pe.TEMPLATE,N.TEMPLATE],[pe.TEXTAREA,N.TEXTAREA],[pe.TFOOT,N.TFOOT],[pe.TD,N.TD],[pe.TH,N.TH],[pe.THEAD,N.THEAD],[pe.TITLE,N.TITLE],[pe.TR,N.TR],[pe.TRACK,N.TRACK],[pe.TT,N.TT],[pe.U,N.U],[pe.UL,N.UL],[pe.SVG,N.SVG],[pe.VAR,N.VAR],[pe.WBR,N.WBR],[pe.XMP,N.XMP]]);function fh(e){var t;return(t=ive.get(e))!==null&&t!==void 0?t:N.UNKNOWN}const Oe=N,rve={[Re.HTML]:new Set([Oe.ADDRESS,Oe.APPLET,Oe.AREA,Oe.ARTICLE,Oe.ASIDE,Oe.BASE,Oe.BASEFONT,Oe.BGSOUND,Oe.BLOCKQUOTE,Oe.BODY,Oe.BR,Oe.BUTTON,Oe.CAPTION,Oe.CENTER,Oe.COL,Oe.COLGROUP,Oe.DD,Oe.DETAILS,Oe.DIR,Oe.DIV,Oe.DL,Oe.DT,Oe.EMBED,Oe.FIELDSET,Oe.FIGCAPTION,Oe.FIGURE,Oe.FOOTER,Oe.FORM,Oe.FRAME,Oe.FRAMESET,Oe.H1,Oe.H2,Oe.H3,Oe.H4,Oe.H5,Oe.H6,Oe.HEAD,Oe.HEADER,Oe.HGROUP,Oe.HR,Oe.HTML,Oe.IFRAME,Oe.IMG,Oe.INPUT,Oe.LI,Oe.LINK,Oe.LISTING,Oe.MAIN,Oe.MARQUEE,Oe.MENU,Oe.META,Oe.NAV,Oe.NOEMBED,Oe.NOFRAMES,Oe.NOSCRIPT,Oe.OBJECT,Oe.OL,Oe.P,Oe.PARAM,Oe.PLAINTEXT,Oe.PRE,Oe.SCRIPT,Oe.SECTION,Oe.SELECT,Oe.SOURCE,Oe.STYLE,Oe.SUMMARY,Oe.TABLE,Oe.TBODY,Oe.TD,Oe.TEMPLATE,Oe.TEXTAREA,Oe.TFOOT,Oe.TH,Oe.THEAD,Oe.TITLE,Oe.TR,Oe.TRACK,Oe.UL,Oe.WBR,Oe.XMP]),[Re.MATHML]:new Set([Oe.MI,Oe.MO,Oe.MN,Oe.MS,Oe.MTEXT,Oe.ANNOTATION_XML]),[Re.SVG]:new Set([Oe.TITLE,Oe.FOREIGN_OBJECT,Oe.DESC]),[Re.XLINK]:new Set,[Re.XML]:new Set,[Re.XMLNS]:new Set},kN=new Set([Oe.H1,Oe.H2,Oe.H3,Oe.H4,Oe.H5,Oe.H6]);pe.STYLE,pe.SCRIPT,pe.XMP,pe.IFRAME,pe.NOEMBED,pe.NOFRAMES,pe.PLAINTEXT;var q;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(q||(q={}));const $s={DATA:q.DATA,RCDATA:q.RCDATA,RAWTEXT:q.RAWTEXT,SCRIPT_DATA:q.SCRIPT_DATA,PLAINTEXT:q.PLAINTEXT,CDATA_SECTION:q.CDATA_SECTION};function ave(e){return e>=G.DIGIT_0&&e<=G.DIGIT_9}function wp(e){return e>=G.LATIN_CAPITAL_A&&e<=G.LATIN_CAPITAL_Z}function ove(e){return e>=G.LATIN_SMALL_A&&e<=G.LATIN_SMALL_Z}function kl(e){return ove(e)||wp(e)}function XL(e){return kl(e)||ave(e)}function fb(e){return e+32}function C$(e){return e===G.SPACE||e===G.LINE_FEED||e===G.TABULATION||e===G.FORM_FEED}function QL(e){return C$(e)||e===G.SOLIDUS||e===G.GREATER_THAN_SIGN}function lve(e){return e===G.NULL?ve.nullCharacterReference:e>1114111?ve.characterReferenceOutsideUnicodeRange:N$(e)?ve.surrogateCharacterReference:k$(e)?ve.noncharacterCharacterReference:T$(e)||e===G.CARRIAGE_RETURN?ve.controlCharacterReference:null}class cve{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=q.DATA,this.returnState=q.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new YEe(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new nve(WEe,(s,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(s)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ve.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:s=>{this._err(ve.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+s)},validateNumericCharacterReference:s=>{const i=lve(s);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var s,i;(i=(s=this.handler).onParseError)===null||i===void 0||i.call(s,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,s){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||s==null||s()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n0&&this._err(ve.endTagWithAttributes),t.selfClosing&&this._err(ve.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case Ft.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ft.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ft.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:Ft.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=C$(t)?Ft.WHITESPACE_CHARACTER:t===G.NULL?Ft.NULL_CHARACTER:Ft.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ft.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=q.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ho.Attribute:Ho.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===q.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===q.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===q.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case q.DATA:{this._stateData(t);break}case q.RCDATA:{this._stateRcdata(t);break}case q.RAWTEXT:{this._stateRawtext(t);break}case q.SCRIPT_DATA:{this._stateScriptData(t);break}case q.PLAINTEXT:{this._statePlaintext(t);break}case q.TAG_OPEN:{this._stateTagOpen(t);break}case q.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case q.TAG_NAME:{this._stateTagName(t);break}case q.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case q.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case q.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case q.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case q.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case q.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case q.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case q.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case q.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case q.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case q.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case q.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case q.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case q.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case q.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case q.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case q.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case q.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case q.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case q.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case q.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case q.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case q.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case q.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case q.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case q.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case q.BOGUS_COMMENT:{this._stateBogusComment(t);break}case q.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case q.COMMENT_START:{this._stateCommentStart(t);break}case q.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case q.COMMENT:{this._stateComment(t);break}case q.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case q.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case q.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case q.COMMENT_END:{this._stateCommentEnd(t);break}case q.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case q.DOCTYPE:{this._stateDoctype(t);break}case q.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case q.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case q.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case q.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case q.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case q.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case q.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case q.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case q.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case q.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case q.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case q.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case q.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case q.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case q.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case q.CDATA_SECTION:{this._stateCdataSection(t);break}case q.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case q.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case q.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case q.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case G.LESS_THAN_SIGN:{this.state=q.TAG_OPEN;break}case G.AMPERSAND:{this._startCharacterReference();break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitCodePoint(t);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case G.AMPERSAND:{this._startCharacterReference();break}case G.LESS_THAN_SIGN:{this.state=q.RCDATA_LESS_THAN_SIGN;break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(fs);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case G.LESS_THAN_SIGN:{this.state=q.RAWTEXT_LESS_THAN_SIGN;break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(fs);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case G.LESS_THAN_SIGN:{this.state=q.SCRIPT_DATA_LESS_THAN_SIGN;break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(fs);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case G.NULL:{this._err(ve.unexpectedNullCharacter),this._emitChars(fs);break}case G.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(kl(t))this._createStartTagToken(),this.state=q.TAG_NAME,this._stateTagName(t);else switch(t){case G.EXCLAMATION_MARK:{this.state=q.MARKUP_DECLARATION_OPEN;break}case G.SOLIDUS:{this.state=q.END_TAG_OPEN;break}case G.QUESTION_MARK:{this._err(ve.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=q.BOGUS_COMMENT,this._stateBogusComment(t);break}case G.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ve.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=q.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(kl(t))this._createEndTagToken(),this.state=q.TAG_NAME,this._stateTagName(t);else switch(t){case G.GREATER_THAN_SIGN:{this._err(ve.missingEndTagName),this.state=q.DATA;break}case G.EOF:{this._err(ve.eofBeforeTagName),this._emitChars("");break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_ESCAPED,this._emitChars(fs);break}case G.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===G.SOLIDUS?this.state=q.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:kl(t)?(this._emitChars("<"),this.state=q.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=q.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){kl(t)?(this.state=q.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case G.NULL:{this._err(ve.unexpectedNullCharacter),this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(fs);break}case G.EOF:{this._err(ve.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===G.SOLIDUS?(this.state=q.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=q.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(cr.SCRIPT,!1)&&QL(this.preprocessor.peek(cr.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const s=this._indexOf(t);this.items[s]=n,s===this.stackTop&&(this.current=n)}insertAfter(t,n,s){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,s),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==Re.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop=0;s--)if(t.has(this.tagIDs[s])&&this.treeAdapter.getNamespaceURI(this.items[s])===n)return s;return-1}clearBackTo(t,n){const s=this._indexOfTagNames(t,n);this.shortenToLength(s+1)}clearBackToTableContext(){this.clearBackTo(pve,Re.HTML)}clearBackToTableBodyContext(){this.clearBackTo(hve,Re.HTML)}clearBackToTableRowContext(){this.clearBackTo(fve,Re.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===N.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===N.HTML}hasInDynamicScope(t,n){for(let s=this.stackTop;s>=0;s--){const i=this.tagIDs[s];switch(this.treeAdapter.getNamespaceURI(this.items[s])){case Re.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case Re.SVG:{if(e3.has(i))return!1;break}case Re.MATHML:{if(JL.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,I1)}hasInListItemScope(t){return this.hasInDynamicScope(t,uve)}hasInButtonScope(t){return this.hasInDynamicScope(t,dve)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Re.HTML:{if(kN.has(n))return!0;if(I1.has(n))return!1;break}case Re.SVG:{if(e3.has(n))return!1;break}case Re.MATHML:{if(JL.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Re.HTML)switch(this.tagIDs[n]){case t:return!0;case N.TABLE:case N.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Re.HTML)switch(this.tagIDs[t]){case N.TBODY:case N.THEAD:case N.TFOOT:return!0;case N.TABLE:case N.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Re.HTML)switch(this.tagIDs[n]){case t:return!0;case N.OPTION:case N.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&I$.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ZL.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&ZL.has(this.currentTagId);)this.pop()}}const Lw=3;var so;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(so||(so={}));const t3={type:so.Marker};class bve{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const s=[],i=n.length,r=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let l=0;l[a.name,a.value]));let r=0;for(let a=0;ai.get(c.name)===c.value)&&(r+=1,r>=Lw&&this.entries.splice(l.idx,1))}}insertMarker(){this.entries.unshift(t3)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:so.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const s=this.entries.indexOf(this.bookmark);this.entries.splice(s,0,{type:so.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(t3);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(s=>s.type===so.Marker||this.treeAdapter.getTagName(s.element)===t);return n&&n.type===so.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===so.Element&&n.element===t)}}const Al={createDocument(){return{nodeName:"#document",mode:na.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const s=e.childNodes.indexOf(n);e.childNodes.splice(s,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,s){const i=e.childNodes.find(r=>r.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=s;else{const r={nodeName:"#documentType",name:t,publicId:n,systemId:s,parentNode:null};Al.appendChild(e,r)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Al.isTextNode(n)){n.value+=t;return}}Al.appendChild(e,Al.createTextNode(t))},insertTextBefore(e,t,n){const s=e.childNodes[e.childNodes.indexOf(n)-1];s&&Al.isTextNode(s)?s.value+=t:Al.insertBefore(e,Al.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(s=>s.name));for(let s=0;se.startsWith(n))}function _ve(e){return e.name===j$&&e.publicId===null&&(e.systemId===null||e.systemId===yve)}function Sve(e){if(e.name!==j$)return na.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===xve)return na.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),vve.has(n))return na.QUIRKS;let s=t===null?Eve:R$;if(n3(n,s))return na.QUIRKS;if(s=t===null?O$:wve,n3(n,s))return na.LIMITED_QUIRKS}return na.NO_QUIRKS}const s3={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Nve="definitionurl",Tve="definitionURL",kve=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Ave=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Re.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Re.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Re.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Re.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Re.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Re.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Re.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Re.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Re.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Re.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Re.XMLNS}]]),Cve=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Ive=new Set([N.B,N.BIG,N.BLOCKQUOTE,N.BODY,N.BR,N.CENTER,N.CODE,N.DD,N.DIV,N.DL,N.DT,N.EM,N.EMBED,N.H1,N.H2,N.H3,N.H4,N.H5,N.H6,N.HEAD,N.HR,N.I,N.IMG,N.LI,N.LISTING,N.MENU,N.META,N.NOBR,N.OL,N.P,N.PRE,N.RUBY,N.S,N.SMALL,N.SPAN,N.STRONG,N.STRIKE,N.SUB,N.SUP,N.TABLE,N.TT,N.U,N.UL,N.VAR]);function jve(e){const t=e.tagID;return t===N.FONT&&e.attrs.some(({name:s})=>s===ou.COLOR||s===ou.SIZE||s===ou.FACE)||Ive.has(t)}function M$(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var s,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(s=this.treeAdapter).onItemPop)===null||i===void 0||i.call(s,t,this.openElements.current),n){let r,a;this.openElements.stackTop===0&&this.fragmentContext?(r=this.fragmentContext,a=this.fragmentContextID):{current:r,currentTagId:a}=this.openElements,this._setContextModes(r,a)}}_setContextModes(t,n){const s=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Re.HTML;this.currentNotInHTML=!s,this.tokenizer.inForeignNode=!s&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Re.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=J.TEXT}switchToPlaintextParsing(){this.insertionMode=J.TEXT,this.originalInsertionMode=J.IN_BODY,this.tokenizer.state=$s.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===pe.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Re.HTML))switch(this.fragmentContextID){case N.TITLE:case N.TEXTAREA:{this.tokenizer.state=$s.RCDATA;break}case N.STYLE:case N.XMP:case N.IFRAME:case N.NOEMBED:case N.NOFRAMES:case N.NOSCRIPT:{this.tokenizer.state=$s.RAWTEXT;break}case N.SCRIPT:{this.tokenizer.state=$s.SCRIPT_DATA;break}case N.PLAINTEXT:{this.tokenizer.state=$s.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",s=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,s,i),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(l=>this.treeAdapter.isDocumentTypeNode(l));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const s=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,s)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const s=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(s??this.document,t)}}_appendElement(t,n){const s=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(s,t.location)}_insertElement(t,n){const s=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(s,t.location),this.openElements.push(s,t.tagID)}_insertFakeElement(t,n){const s=this.treeAdapter.createElement(t,Re.HTML,[]);this._attachElementToTree(s,null),this.openElements.push(s,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Re.HTML,t.attrs),s=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,s),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(pe.HTML,Re.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,N.HTML)}_appendCommentNode(t,n){const s=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,s),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_insertCharacters(t){let n,s;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:s}=this._findFosterParentingLocation(),s?this.treeAdapter.insertTextBefore(n,t.chars,s):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),r=s?i.lastIndexOf(s):i.length,a=i[r-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:c,endCol:u,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:c,endCol:u,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let s=this.treeAdapter.getFirstChild(t);s;s=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(s),this.treeAdapter.appendChild(n,s)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const s=n.location,i=this.treeAdapter.getTagName(t),r=n.type===Ft.END_TAG&&i===n.tagName?{endTag:{...s},endLine:s.endLine,endCol:s.endCol,endOffset:s.endOffset}:{endLine:s.startLine,endCol:s.startCol,endOffset:s.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,r)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,s;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,s=this.fragmentContextID):{current:n,currentTagId:s}=this.openElements,t.tagID===N.SVG&&this.treeAdapter.getTagName(n)===pe.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Re.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===N.MGLYPH||t.tagID===N.MALIGNMARK)&&s!==void 0&&!this._isIntegrationPoint(s,n,Re.HTML)}_processToken(t){switch(t.type){case Ft.CHARACTER:{this.onCharacter(t);break}case Ft.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ft.COMMENT:{this.onComment(t);break}case Ft.DOCTYPE:{this.onDoctype(t);break}case Ft.START_TAG:{this._processStartTag(t);break}case Ft.END_TAG:{this.onEndTag(t);break}case Ft.EOF:{this.onEof(t);break}case Ft.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,s){const i=this.treeAdapter.getNamespaceURI(n),r=this.treeAdapter.getAttrList(n);return Lve(t,i,r,s)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===so.Marker||this.openElements.contains(i.element)),s=n===-1?t-1:n-1;for(let i=s;i>=0;i--){const r=this.activeFormattingElements.entries[i];this._insertElement(r.token,this.treeAdapter.getNamespaceURI(r.element)),r.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=J.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(N.P),this.openElements.popUntilTagNamePopped(N.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case N.TR:{this.insertionMode=J.IN_ROW;return}case N.TBODY:case N.THEAD:case N.TFOOT:{this.insertionMode=J.IN_TABLE_BODY;return}case N.CAPTION:{this.insertionMode=J.IN_CAPTION;return}case N.COLGROUP:{this.insertionMode=J.IN_COLUMN_GROUP;return}case N.TABLE:{this.insertionMode=J.IN_TABLE;return}case N.BODY:{this.insertionMode=J.IN_BODY;return}case N.FRAMESET:{this.insertionMode=J.IN_FRAMESET;return}case N.SELECT:{this._resetInsertionModeForSelect(t);return}case N.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case N.HTML:{this.insertionMode=this.headElement?J.AFTER_HEAD:J.BEFORE_HEAD;return}case N.TD:case N.TH:{if(t>0){this.insertionMode=J.IN_CELL;return}break}case N.HEAD:{if(t>0){this.insertionMode=J.IN_HEAD;return}break}}this.insertionMode=J.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const s=this.openElements.tagIDs[n];if(s===N.TEMPLATE)break;if(s===N.TABLE){this.insertionMode=J.IN_SELECT_IN_TABLE;return}}this.insertionMode=J.IN_SELECT}_isElementCausesFosterParenting(t){return D$.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case N.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Re.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case N.TABLE:{const s=this.treeAdapter.getParentNode(n);return s?{parent:s,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const s=this.treeAdapter.getNamespaceURI(t);return rve[s].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){m_e(this,t);return}switch(this.insertionMode){case J.INITIAL:{tp(this,t);break}case J.BEFORE_HTML:{tm(this,t);break}case J.BEFORE_HEAD:{nm(this,t);break}case J.IN_HEAD:{sm(this,t);break}case J.IN_HEAD_NO_SCRIPT:{im(this,t);break}case J.AFTER_HEAD:{rm(this,t);break}case J.IN_BODY:case J.IN_CAPTION:case J.IN_CELL:case J.IN_TEMPLATE:{B$(this,t);break}case J.TEXT:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{Dw(this,t);break}case J.IN_TABLE_TEXT:{V$(this,t);break}case J.IN_COLUMN_GROUP:{j1(this,t);break}case J.AFTER_BODY:{R1(this,t);break}case J.AFTER_AFTER_BODY:{cy(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){p_e(this,t);return}switch(this.insertionMode){case J.INITIAL:{tp(this,t);break}case J.BEFORE_HTML:{tm(this,t);break}case J.BEFORE_HEAD:{nm(this,t);break}case J.IN_HEAD:{sm(this,t);break}case J.IN_HEAD_NO_SCRIPT:{im(this,t);break}case J.AFTER_HEAD:{rm(this,t);break}case J.TEXT:{this._insertCharacters(t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{Dw(this,t);break}case J.IN_COLUMN_GROUP:{j1(this,t);break}case J.AFTER_BODY:{R1(this,t);break}case J.AFTER_AFTER_BODY:{cy(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){AN(this,t);return}switch(this.insertionMode){case J.INITIAL:case J.BEFORE_HTML:case J.BEFORE_HEAD:case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:case J.IN_BODY:case J.IN_TABLE:case J.IN_CAPTION:case J.IN_COLUMN_GROUP:case J.IN_TABLE_BODY:case J.IN_ROW:case J.IN_CELL:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:case J.IN_TEMPLATE:case J.IN_FRAMESET:case J.AFTER_FRAMESET:{AN(this,t);break}case J.IN_TABLE_TEXT:{np(this,t);break}case J.AFTER_BODY:{Kve(this,t);break}case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{qve(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case J.INITIAL:{Yve(this,t);break}case J.BEFORE_HEAD:case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:{this._err(t,ve.misplacedDoctype);break}case J.IN_TABLE_TEXT:{np(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ve.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?g_e(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case J.INITIAL:{tp(this,t);break}case J.BEFORE_HTML:{Wve(this,t);break}case J.BEFORE_HEAD:{Qve(this,t);break}case J.IN_HEAD:{Va(this,t);break}case J.IN_HEAD_NO_SCRIPT:{ewe(this,t);break}case J.AFTER_HEAD:{nwe(this,t);break}case J.IN_BODY:{Hi(this,t);break}case J.IN_TABLE:{Ff(this,t);break}case J.IN_TABLE_TEXT:{np(this,t);break}case J.IN_CAPTION:{Zwe(this,t);break}case J.IN_COLUMN_GROUP:{pA(this,t);break}case J.IN_TABLE_BODY:{tE(this,t);break}case J.IN_ROW:{nE(this,t);break}case J.IN_CELL:{t_e(this,t);break}case J.IN_SELECT:{q$(this,t);break}case J.IN_SELECT_IN_TABLE:{s_e(this,t);break}case J.IN_TEMPLATE:{r_e(this,t);break}case J.AFTER_BODY:{o_e(this,t);break}case J.IN_FRAMESET:{l_e(this,t);break}case J.AFTER_FRAMESET:{u_e(this,t);break}case J.AFTER_AFTER_BODY:{f_e(this,t);break}case J.AFTER_AFTER_FRAMESET:{h_e(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?b_e(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case J.INITIAL:{tp(this,t);break}case J.BEFORE_HTML:{Xve(this,t);break}case J.BEFORE_HEAD:{Zve(this,t);break}case J.IN_HEAD:{Jve(this,t);break}case J.IN_HEAD_NO_SCRIPT:{twe(this,t);break}case J.AFTER_HEAD:{swe(this,t);break}case J.IN_BODY:{eE(this,t);break}case J.TEXT:{Hwe(this,t);break}case J.IN_TABLE:{Xm(this,t);break}case J.IN_TABLE_TEXT:{np(this,t);break}case J.IN_CAPTION:{Jwe(this,t);break}case J.IN_COLUMN_GROUP:{e_e(this,t);break}case J.IN_TABLE_BODY:{CN(this,t);break}case J.IN_ROW:{K$(this,t);break}case J.IN_CELL:{n_e(this,t);break}case J.IN_SELECT:{Y$(this,t);break}case J.IN_SELECT_IN_TABLE:{i_e(this,t);break}case J.IN_TEMPLATE:{a_e(this,t);break}case J.AFTER_BODY:{X$(this,t);break}case J.IN_FRAMESET:{c_e(this,t);break}case J.AFTER_FRAMESET:{d_e(this,t);break}case J.AFTER_AFTER_BODY:{cy(this,t);break}}}onEof(t){switch(this.insertionMode){case J.INITIAL:{tp(this,t);break}case J.BEFORE_HTML:{tm(this,t);break}case J.BEFORE_HEAD:{nm(this,t);break}case J.IN_HEAD:{sm(this,t);break}case J.IN_HEAD_NO_SCRIPT:{im(this,t);break}case J.AFTER_HEAD:{rm(this,t);break}case J.IN_BODY:case J.IN_TABLE:case J.IN_CAPTION:case J.IN_COLUMN_GROUP:case J.IN_TABLE_BODY:case J.IN_ROW:case J.IN_CELL:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:{H$(this,t);break}case J.TEXT:{zwe(this,t);break}case J.IN_TABLE_TEXT:{np(this,t);break}case J.IN_TEMPLATE:{W$(this,t);break}case J.AFTER_BODY:case J.IN_FRAMESET:case J.AFTER_FRAMESET:case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{hA(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===G.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case J.IN_HEAD:case J.IN_HEAD_NO_SCRIPT:case J.AFTER_HEAD:case J.TEXT:case J.IN_COLUMN_GROUP:case J.IN_SELECT:case J.IN_SELECT_IN_TABLE:case J.IN_FRAMESET:case J.AFTER_FRAMESET:{this._insertCharacters(t);break}case J.IN_BODY:case J.IN_CAPTION:case J.IN_CELL:case J.IN_TEMPLATE:case J.AFTER_BODY:case J.AFTER_AFTER_BODY:case J.AFTER_AFTER_FRAMESET:{P$(this,t);break}case J.IN_TABLE:case J.IN_TABLE_BODY:case J.IN_ROW:{Dw(this,t);break}case J.IN_TABLE_TEXT:{z$(this,t);break}}}};function Fve(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):$$(e,t),n}function $ve(e,t){let n=null,s=e.openElements.stackTop;for(;s>=0;s--){const i=e.openElements.items[s];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[s])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(s,0)),e.activeFormattingElements.removeEntry(t)),n}function Hve(e,t,n){let s=t,i=e.openElements.getCommonAncestor(t);for(let r=0,a=i;a!==n;r++,a=i){i=e.openElements.getCommonAncestor(a);const l=e.activeFormattingElements.getElementEntry(a),c=l&&r>=Bve;!l||c?(c&&e.activeFormattingElements.removeEntry(l),e.openElements.remove(a)):(a=zve(e,l),s===t&&(e.activeFormattingElements.bookmark=l),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(a,s),s=a)}return s}function zve(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function Vve(e,t,n){const s=e.treeAdapter.getTagName(t),i=fh(s);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const r=e.treeAdapter.getNamespaceURI(t);i===N.TEMPLATE&&r===Re.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Gve(e,t,n){const s=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,r=e.treeAdapter.createElement(i.tagName,s,i.attrs);e._adoptNodes(t,r),e.treeAdapter.appendChild(t,r),e.activeFormattingElements.insertElementAfterBookmark(r,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,r,i.tagID)}function fA(e,t){for(let n=0;n=n;s--)e._setEndLocation(e.openElements.items[s],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const s=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(s);if(i&&!i.endTag&&(e._setEndLocation(s,t),e.openElements.stackTop>=1)){const r=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(r);a&&!a.endTag&&e._setEndLocation(r,t)}}}}function Yve(e,t){e._setDocumentType(t);const n=t.forceQuirks?na.QUIRKS:Sve(t);_ve(t)||e._err(t,ve.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=J.BEFORE_HTML}function tp(e,t){e._err(t,ve.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,na.QUIRKS),e.insertionMode=J.BEFORE_HTML,e._processToken(t)}function Wve(e,t){t.tagID===N.HTML?(e._insertElement(t,Re.HTML),e.insertionMode=J.BEFORE_HEAD):tm(e,t)}function Xve(e,t){const n=t.tagID;(n===N.HTML||n===N.HEAD||n===N.BODY||n===N.BR)&&tm(e,t)}function tm(e,t){e._insertFakeRootElement(),e.insertionMode=J.BEFORE_HEAD,e._processToken(t)}function Qve(e,t){switch(t.tagID){case N.HTML:{Hi(e,t);break}case N.HEAD:{e._insertElement(t,Re.HTML),e.headElement=e.openElements.current,e.insertionMode=J.IN_HEAD;break}default:nm(e,t)}}function Zve(e,t){const n=t.tagID;n===N.HEAD||n===N.BODY||n===N.HTML||n===N.BR?nm(e,t):e._err(t,ve.endTagWithoutMatchingOpenElement)}function nm(e,t){e._insertFakeElement(pe.HEAD,N.HEAD),e.headElement=e.openElements.current,e.insertionMode=J.IN_HEAD,e._processToken(t)}function Va(e,t){switch(t.tagID){case N.HTML:{Hi(e,t);break}case N.BASE:case N.BASEFONT:case N.BGSOUND:case N.LINK:case N.META:{e._appendElement(t,Re.HTML),t.ackSelfClosing=!0;break}case N.TITLE:{e._switchToTextParsing(t,$s.RCDATA);break}case N.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$s.RAWTEXT):(e._insertElement(t,Re.HTML),e.insertionMode=J.IN_HEAD_NO_SCRIPT);break}case N.NOFRAMES:case N.STYLE:{e._switchToTextParsing(t,$s.RAWTEXT);break}case N.SCRIPT:{e._switchToTextParsing(t,$s.SCRIPT_DATA);break}case N.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=J.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(J.IN_TEMPLATE);break}case N.HEAD:{e._err(t,ve.misplacedStartTagForHeadElement);break}default:sm(e,t)}}function Jve(e,t){switch(t.tagID){case N.HEAD:{e.openElements.pop(),e.insertionMode=J.AFTER_HEAD;break}case N.BODY:case N.BR:case N.HTML:{sm(e,t);break}case N.TEMPLATE:{Pu(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function Pu(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==N.TEMPLATE&&e._err(t,ve.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(N.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ve.endTagWithoutMatchingOpenElement)}function sm(e,t){e.openElements.pop(),e.insertionMode=J.AFTER_HEAD,e._processToken(t)}function ewe(e,t){switch(t.tagID){case N.HTML:{Hi(e,t);break}case N.BASEFONT:case N.BGSOUND:case N.HEAD:case N.LINK:case N.META:case N.NOFRAMES:case N.STYLE:{Va(e,t);break}case N.NOSCRIPT:{e._err(t,ve.nestedNoscriptInHead);break}default:im(e,t)}}function twe(e,t){switch(t.tagID){case N.NOSCRIPT:{e.openElements.pop(),e.insertionMode=J.IN_HEAD;break}case N.BR:{im(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function im(e,t){const n=t.type===Ft.EOF?ve.openElementsLeftAfterEof:ve.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=J.IN_HEAD,e._processToken(t)}function nwe(e,t){switch(t.tagID){case N.HTML:{Hi(e,t);break}case N.BODY:{e._insertElement(t,Re.HTML),e.framesetOk=!1,e.insertionMode=J.IN_BODY;break}case N.FRAMESET:{e._insertElement(t,Re.HTML),e.insertionMode=J.IN_FRAMESET;break}case N.BASE:case N.BASEFONT:case N.BGSOUND:case N.LINK:case N.META:case N.NOFRAMES:case N.SCRIPT:case N.STYLE:case N.TEMPLATE:case N.TITLE:{e._err(t,ve.abandonedHeadElementChild),e.openElements.push(e.headElement,N.HEAD),Va(e,t),e.openElements.remove(e.headElement);break}case N.HEAD:{e._err(t,ve.misplacedStartTagForHeadElement);break}default:rm(e,t)}}function swe(e,t){switch(t.tagID){case N.BODY:case N.HTML:case N.BR:{rm(e,t);break}case N.TEMPLATE:{Pu(e,t);break}default:e._err(t,ve.endTagWithoutMatchingOpenElement)}}function rm(e,t){e._insertFakeElement(pe.BODY,N.BODY),e.insertionMode=J.IN_BODY,Jx(e,t)}function Jx(e,t){switch(t.type){case Ft.CHARACTER:{B$(e,t);break}case Ft.WHITESPACE_CHARACTER:{P$(e,t);break}case Ft.COMMENT:{AN(e,t);break}case Ft.START_TAG:{Hi(e,t);break}case Ft.END_TAG:{eE(e,t);break}case Ft.EOF:{H$(e,t);break}}}function P$(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function B$(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function iwe(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function rwe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function awe(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Re.HTML),e.insertionMode=J.IN_FRAMESET)}function owe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,Re.HTML)}function lwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&kN.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Re.HTML)}function cwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,Re.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function uwe(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,Re.HTML),n||(e.formElement=e.openElements.current))}function dwe(e,t){e.framesetOk=!1;const n=t.tagID;for(let s=e.openElements.stackTop;s>=0;s--){const i=e.openElements.tagIDs[s];if(n===N.LI&&i===N.LI||(n===N.DD||n===N.DT)&&(i===N.DD||i===N.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==N.ADDRESS&&i!==N.DIV&&i!==N.P&&e._isSpecialElement(e.openElements.items[s],i))break}e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,Re.HTML)}function fwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,Re.HTML),e.tokenizer.state=$s.PLAINTEXT}function hwe(e,t){e.openElements.hasInScope(N.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(N.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Re.HTML),e.framesetOk=!1}function pwe(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(pe.A);n&&(fA(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Re.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function mwe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Re.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gwe(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(N.NOBR)&&(fA(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Re.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function bwe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Re.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function ywe(e,t){e.treeAdapter.getDocumentMode(e.document)!==na.QUIRKS&&e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._insertElement(t,Re.HTML),e.framesetOk=!1,e.insertionMode=J.IN_TABLE}function U$(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Re.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function F$(e){const t=A$(e,ou.TYPE);return t!=null&&t.toLowerCase()===Dve}function xwe(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Re.HTML),F$(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Ewe(e,t){e._appendElement(t,Re.HTML),t.ackSelfClosing=!0}function vwe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._appendElement(t,Re.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function wwe(e,t){t.tagName=pe.IMG,t.tagID=N.IMG,U$(e,t)}function _we(e,t){e._insertElement(t,Re.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$s.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=J.TEXT}function Swe(e,t){e.openElements.hasInButtonScope(N.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function Nwe(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$s.RAWTEXT)}function a3(e,t){e._switchToTextParsing(t,$s.RAWTEXT)}function Twe(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Re.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===J.IN_TABLE||e.insertionMode===J.IN_CAPTION||e.insertionMode===J.IN_TABLE_BODY||e.insertionMode===J.IN_ROW||e.insertionMode===J.IN_CELL?J.IN_SELECT_IN_TABLE:J.IN_SELECT}function kwe(e,t){e.openElements.currentTagId===N.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Re.HTML)}function Awe(e,t){e.openElements.hasInScope(N.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Re.HTML)}function Cwe(e,t){e.openElements.hasInScope(N.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(N.RTC),e._insertElement(t,Re.HTML)}function Iwe(e,t){e._reconstructActiveFormattingElements(),M$(t),dA(t),t.selfClosing?e._appendElement(t,Re.MATHML):e._insertElement(t,Re.MATHML),t.ackSelfClosing=!0}function jwe(e,t){e._reconstructActiveFormattingElements(),L$(t),dA(t),t.selfClosing?e._appendElement(t,Re.SVG):e._insertElement(t,Re.SVG),t.ackSelfClosing=!0}function o3(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Re.HTML)}function Hi(e,t){switch(t.tagID){case N.I:case N.S:case N.B:case N.U:case N.EM:case N.TT:case N.BIG:case N.CODE:case N.FONT:case N.SMALL:case N.STRIKE:case N.STRONG:{mwe(e,t);break}case N.A:{pwe(e,t);break}case N.H1:case N.H2:case N.H3:case N.H4:case N.H5:case N.H6:{lwe(e,t);break}case N.P:case N.DL:case N.OL:case N.UL:case N.DIV:case N.DIR:case N.NAV:case N.MAIN:case N.MENU:case N.ASIDE:case N.CENTER:case N.FIGURE:case N.FOOTER:case N.HEADER:case N.HGROUP:case N.DIALOG:case N.DETAILS:case N.ADDRESS:case N.ARTICLE:case N.SEARCH:case N.SECTION:case N.SUMMARY:case N.FIELDSET:case N.BLOCKQUOTE:case N.FIGCAPTION:{owe(e,t);break}case N.LI:case N.DD:case N.DT:{dwe(e,t);break}case N.BR:case N.IMG:case N.WBR:case N.AREA:case N.EMBED:case N.KEYGEN:{U$(e,t);break}case N.HR:{vwe(e,t);break}case N.RB:case N.RTC:{Awe(e,t);break}case N.RT:case N.RP:{Cwe(e,t);break}case N.PRE:case N.LISTING:{cwe(e,t);break}case N.XMP:{Swe(e,t);break}case N.SVG:{jwe(e,t);break}case N.HTML:{iwe(e,t);break}case N.BASE:case N.LINK:case N.META:case N.STYLE:case N.TITLE:case N.SCRIPT:case N.BGSOUND:case N.BASEFONT:case N.TEMPLATE:{Va(e,t);break}case N.BODY:{rwe(e,t);break}case N.FORM:{uwe(e,t);break}case N.NOBR:{gwe(e,t);break}case N.MATH:{Iwe(e,t);break}case N.TABLE:{ywe(e,t);break}case N.INPUT:{xwe(e,t);break}case N.PARAM:case N.TRACK:case N.SOURCE:{Ewe(e,t);break}case N.IMAGE:{wwe(e,t);break}case N.BUTTON:{hwe(e,t);break}case N.APPLET:case N.OBJECT:case N.MARQUEE:{bwe(e,t);break}case N.IFRAME:{Nwe(e,t);break}case N.SELECT:{Twe(e,t);break}case N.OPTION:case N.OPTGROUP:{kwe(e,t);break}case N.NOEMBED:case N.NOFRAMES:{a3(e,t);break}case N.FRAMESET:{awe(e,t);break}case N.TEXTAREA:{_we(e,t);break}case N.NOSCRIPT:{e.options.scriptingEnabled?a3(e,t):o3(e,t);break}case N.PLAINTEXT:{fwe(e,t);break}case N.COL:case N.TH:case N.TD:case N.TR:case N.HEAD:case N.FRAME:case N.TBODY:case N.TFOOT:case N.THEAD:case N.CAPTION:case N.COLGROUP:break;default:o3(e,t)}}function Rwe(e,t){if(e.openElements.hasInScope(N.BODY)&&(e.insertionMode=J.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Owe(e,t){e.openElements.hasInScope(N.BODY)&&(e.insertionMode=J.AFTER_BODY,X$(e,t))}function Mwe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Lwe(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(N.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(N.FORM):n&&e.openElements.remove(n))}function Dwe(e){e.openElements.hasInButtonScope(N.P)||e._insertFakeElement(pe.P,N.P),e._closePElement()}function Pwe(e){e.openElements.hasInListItemScope(N.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(N.LI),e.openElements.popUntilTagNamePopped(N.LI))}function Bwe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Uwe(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Fwe(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function $we(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(pe.BR,N.BR),e.openElements.pop(),e.framesetOk=!1}function $$(e,t){const n=t.tagName,s=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const r=e.openElements.items[i],a=e.openElements.tagIDs[i];if(s===a&&(s!==N.UNKNOWN||e.treeAdapter.getTagName(r)===n)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(r,a))break}}function eE(e,t){switch(t.tagID){case N.A:case N.B:case N.I:case N.S:case N.U:case N.EM:case N.TT:case N.BIG:case N.CODE:case N.FONT:case N.NOBR:case N.SMALL:case N.STRIKE:case N.STRONG:{fA(e,t);break}case N.P:{Dwe(e);break}case N.DL:case N.UL:case N.OL:case N.DIR:case N.DIV:case N.NAV:case N.PRE:case N.MAIN:case N.MENU:case N.ASIDE:case N.BUTTON:case N.CENTER:case N.FIGURE:case N.FOOTER:case N.HEADER:case N.HGROUP:case N.DIALOG:case N.ADDRESS:case N.ARTICLE:case N.DETAILS:case N.SEARCH:case N.SECTION:case N.SUMMARY:case N.LISTING:case N.FIELDSET:case N.BLOCKQUOTE:case N.FIGCAPTION:{Mwe(e,t);break}case N.LI:{Pwe(e);break}case N.DD:case N.DT:{Bwe(e,t);break}case N.H1:case N.H2:case N.H3:case N.H4:case N.H5:case N.H6:{Uwe(e);break}case N.BR:{$we(e);break}case N.BODY:{Rwe(e,t);break}case N.HTML:{Owe(e,t);break}case N.FORM:{Lwe(e);break}case N.APPLET:case N.OBJECT:case N.MARQUEE:{Fwe(e,t);break}case N.TEMPLATE:{Pu(e,t);break}default:$$(e,t)}}function H$(e,t){e.tmplInsertionModeStack.length>0?W$(e,t):hA(e,t)}function Hwe(e,t){var n;t.tagID===N.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function zwe(e,t){e._err(t,ve.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Dw(e,t){if(e.openElements.currentTagId!==void 0&&D$.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=J.IN_TABLE_TEXT,t.type){case Ft.CHARACTER:{V$(e,t);break}case Ft.WHITESPACE_CHARACTER:{z$(e,t);break}}else Dg(e,t)}function Vwe(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Re.HTML),e.insertionMode=J.IN_CAPTION}function Gwe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Re.HTML),e.insertionMode=J.IN_COLUMN_GROUP}function Kwe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.COLGROUP,N.COLGROUP),e.insertionMode=J.IN_COLUMN_GROUP,pA(e,t)}function qwe(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Re.HTML),e.insertionMode=J.IN_TABLE_BODY}function Ywe(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(pe.TBODY,N.TBODY),e.insertionMode=J.IN_TABLE_BODY,tE(e,t)}function Wwe(e,t){e.openElements.hasInTableScope(N.TABLE)&&(e.openElements.popUntilTagNamePopped(N.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Xwe(e,t){F$(t)?e._appendElement(t,Re.HTML):Dg(e,t),t.ackSelfClosing=!0}function Qwe(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Re.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ff(e,t){switch(t.tagID){case N.TD:case N.TH:case N.TR:{Ywe(e,t);break}case N.STYLE:case N.SCRIPT:case N.TEMPLATE:{Va(e,t);break}case N.COL:{Kwe(e,t);break}case N.FORM:{Qwe(e,t);break}case N.TABLE:{Wwe(e,t);break}case N.TBODY:case N.TFOOT:case N.THEAD:{qwe(e,t);break}case N.INPUT:{Xwe(e,t);break}case N.CAPTION:{Vwe(e,t);break}case N.COLGROUP:{Gwe(e,t);break}default:Dg(e,t)}}function Xm(e,t){switch(t.tagID){case N.TABLE:{e.openElements.hasInTableScope(N.TABLE)&&(e.openElements.popUntilTagNamePopped(N.TABLE),e._resetInsertionMode());break}case N.TEMPLATE:{Pu(e,t);break}case N.BODY:case N.CAPTION:case N.COL:case N.COLGROUP:case N.HTML:case N.TBODY:case N.TD:case N.TFOOT:case N.TH:case N.THEAD:case N.TR:break;default:Dg(e,t)}}function Dg(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Jx(e,t),e.fosterParentingEnabled=n}function z$(e,t){e.pendingCharacterTokens.push(t)}function V$(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function np(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===N.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===N.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===N.OPTGROUP&&e.openElements.pop();break}case N.OPTION:{e.openElements.currentTagId===N.OPTION&&e.openElements.pop();break}case N.SELECT:{e.openElements.hasInSelectScope(N.SELECT)&&(e.openElements.popUntilTagNamePopped(N.SELECT),e._resetInsertionMode());break}case N.TEMPLATE:{Pu(e,t);break}}}function s_e(e,t){const n=t.tagID;n===N.CAPTION||n===N.TABLE||n===N.TBODY||n===N.TFOOT||n===N.THEAD||n===N.TR||n===N.TD||n===N.TH?(e.openElements.popUntilTagNamePopped(N.SELECT),e._resetInsertionMode(),e._processStartTag(t)):q$(e,t)}function i_e(e,t){const n=t.tagID;n===N.CAPTION||n===N.TABLE||n===N.TBODY||n===N.TFOOT||n===N.THEAD||n===N.TR||n===N.TD||n===N.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(N.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Y$(e,t)}function r_e(e,t){switch(t.tagID){case N.BASE:case N.BASEFONT:case N.BGSOUND:case N.LINK:case N.META:case N.NOFRAMES:case N.SCRIPT:case N.STYLE:case N.TEMPLATE:case N.TITLE:{Va(e,t);break}case N.CAPTION:case N.COLGROUP:case N.TBODY:case N.TFOOT:case N.THEAD:{e.tmplInsertionModeStack[0]=J.IN_TABLE,e.insertionMode=J.IN_TABLE,Ff(e,t);break}case N.COL:{e.tmplInsertionModeStack[0]=J.IN_COLUMN_GROUP,e.insertionMode=J.IN_COLUMN_GROUP,pA(e,t);break}case N.TR:{e.tmplInsertionModeStack[0]=J.IN_TABLE_BODY,e.insertionMode=J.IN_TABLE_BODY,tE(e,t);break}case N.TD:case N.TH:{e.tmplInsertionModeStack[0]=J.IN_ROW,e.insertionMode=J.IN_ROW,nE(e,t);break}default:e.tmplInsertionModeStack[0]=J.IN_BODY,e.insertionMode=J.IN_BODY,Hi(e,t)}}function a_e(e,t){t.tagID===N.TEMPLATE&&Pu(e,t)}function W$(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(N.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):hA(e,t)}function o_e(e,t){t.tagID===N.HTML?Hi(e,t):R1(e,t)}function X$(e,t){var n;if(t.tagID===N.HTML){if(e.fragmentContext||(e.insertionMode=J.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===N.HTML){e._setEndLocation(e.openElements.items[0],t);const s=e.openElements.items[1];s&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(s))===null||n===void 0)&&n.endTag)&&e._setEndLocation(s,t)}}else R1(e,t)}function R1(e,t){e.insertionMode=J.IN_BODY,Jx(e,t)}function l_e(e,t){switch(t.tagID){case N.HTML:{Hi(e,t);break}case N.FRAMESET:{e._insertElement(t,Re.HTML);break}case N.FRAME:{e._appendElement(t,Re.HTML),t.ackSelfClosing=!0;break}case N.NOFRAMES:{Va(e,t);break}}}function c_e(e,t){t.tagID===N.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==N.FRAMESET&&(e.insertionMode=J.AFTER_FRAMESET))}function u_e(e,t){switch(t.tagID){case N.HTML:{Hi(e,t);break}case N.NOFRAMES:{Va(e,t);break}}}function d_e(e,t){t.tagID===N.HTML&&(e.insertionMode=J.AFTER_AFTER_FRAMESET)}function f_e(e,t){t.tagID===N.HTML?Hi(e,t):cy(e,t)}function cy(e,t){e.insertionMode=J.IN_BODY,Jx(e,t)}function h_e(e,t){switch(t.tagID){case N.HTML:{Hi(e,t);break}case N.NOFRAMES:{Va(e,t);break}}}function p_e(e,t){t.chars=fs,e._insertCharacters(t)}function m_e(e,t){e._insertCharacters(t),e.framesetOk=!1}function Q$(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Re.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function g_e(e,t){if(jve(t))Q$(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(n);s===Re.MATHML?M$(t):s===Re.SVG&&(Rve(t),L$(t)),dA(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0}}function b_e(e,t){if(t.tagID===N.P||t.tagID===N.BR){Q$(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const s=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(s)===Re.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(s);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}pe.AREA,pe.BASE,pe.BASEFONT,pe.BGSOUND,pe.BR,pe.COL,pe.EMBED,pe.FRAME,pe.HR,pe.IMG,pe.INPUT,pe.KEYGEN,pe.LINK,pe.META,pe.PARAM,pe.SOURCE,pe.TRACK,pe.WBR;const y_e=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,x_e=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),l3={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Z$(e,t){const n=C_e(e),s=hF("type",{handlers:{root:E_e,element:v_e,text:w_e,comment:eH,doctype:__e,raw:N_e},unknown:T_e}),i={parser:n?new r3(l3):r3.getFragmentParser(void 0,l3),handle(l){s(l,i)},stitches:!1,options:t||{}};s(e,i),hh(i,yo());const r=n?i.parser.document:i.parser.getFragment(),a=IEe(r,{file:i.options.file});return i.stitches&&Mg(a,"comment",function(l,c,u){const d=l;if(d.value.stitch&&u&&c!==void 0){const f=u.children;return f[c]=d.value.stitch,c}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function J$(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Ft.CHARACTER,chars:e.value,location:Pg(e)};hh(t,yo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function __e(e,t){const n={type:Ft.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Pg(e)};hh(t,yo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function S_e(e,t){t.stitches=!0;const n=I_e(e);if("children"in e&&"children"in n){const s=Z$({type:"root",children:e.children},t.options);n.children=s.children}eH({type:"comment",value:{stitch:n}},t)}function eH(e,t){const n=e.value,s={type:Ft.COMMENT,data:n,location:Pg(e)};hh(t,yo(e)),t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken)}function N_e(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,tH(t,yo(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(y_e,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function T_e(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))S_e(n,t);else{let s="";throw x_e.has(n.type)&&(s=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+s)}}function hh(e,t){tH(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=$s.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function tH(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function k_e(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$s.PLAINTEXT)return;hh(t,yo(e));const s=t.parser.openElements.current;let i="namespaceURI"in s?s.namespaceURI:Kc.html;i===Kc.html&&n==="svg"&&(i=Kc.svg);const r=LEe({...e,children:[]},{space:i===Kc.svg?"svg":"html"}),a={type:Ft.START_TAG,tagName:n,tagID:fh(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in r?r.attrs:[],location:Pg(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function A_e(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&zEe.includes(n)||t.parser.tokenizer.state===$s.PLAINTEXT)return;hh(t,qx(e));const s={type:Ft.END_TAG,tagName:n,tagID:fh(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Pg(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$s.RCDATA||t.parser.tokenizer.state===$s.RAWTEXT||t.parser.tokenizer.state===$s.SCRIPT_DATA)&&(t.parser.tokenizer.state=$s.DATA)}function C_e(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Pg(e){const t=yo(e)||{line:void 0,column:void 0,offset:void 0},n=qx(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function I_e(e){return"children"in e?Bf({...e,children:[]}):Bf(e)}function j_e(e){return function(t,n){return Z$(t,{...e,file:n})}}const nH=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function sH(e){if(!e)return!1;try{const t=e.toLowerCase();return nH.some(n=>t.includes(n))}catch{return!1}}function R_e(e){var s;const t=(s=e==null?void 0:e.properties)==null?void 0:s.href;if(!t)return!1;if(sH(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const i=n.map(r=>(r==null?void 0:r.value)||"").join("").toLowerCase();return nH.some(r=>i.includes(r))}return!1}function O_e({text:e,className:t,allowRawHtml:n=!0}){const[s,i]=g.useState(null),r=(c,u)=>{if(c.src)return c.src;if(u){const d=h=>{var p;if(!h)return null;if(h.type==="source"&&((p=h.properties)!=null&&p.src))return h.properties.src;if(h.children)for(const m of h.children){const b=d(m);if(b)return b}return null},f=d({children:u});if(f)return f}return""},a=c=>{try{const d=new URL(c).pathname.split("/");return d[d.length-1]||"video.mp4"}catch{return"video.mp4"}},l=c=>c?Array.isArray(c)?c.map(u=>(u==null?void 0:u.value)||"").join("")||"video":(c==null?void 0:c.value)||"video":"video";return o.jsxs("div",{className:t?`md ${t}`:"md",children:[o.jsx(D0e,{remarkPlugins:[Wye],rehypePlugins:n?[j_e,GL]:[GL],components:{a:({node:c,...u})=>{const d=u.href;if(d&&(sH(d)||R_e(c))){const f=d,h=l(c==null?void 0:c.children);return o.jsxs("div",{className:"video-container",children:[o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${h}`,onClick:()=>i({src:f,title:h}),children:[o.jsx("video",{src:f,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(nu,{})})]}),o.jsx("div",{className:"video-caption",children:o.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:h})})]})}return o.jsx("a",{...u,target:"_blank",rel:"noopener noreferrer"})},img:({node:c,src:u,alt:d,...f})=>{const h=o.jsx("img",{...f,src:u,alt:d??"",loading:"lazy"});return u?o.jsx(OB,{src:u,children:o.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${d||"图片"}`,children:[h,o.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:o.jsx(nu,{})})]})}):h},video:({node:c,src:u,children:d,...f})=>{const h=r({src:u},d);return h?o.jsx("div",{className:"video-container",children:o.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>i({src:h}),children:[o.jsx("video",{src:h,...f,playsInline:!0,className:"video-thumbnail",children:d}),o.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:o.jsx(nu,{})})]})}):o.jsx("video",{src:u,controls:!0,playsInline:!0,className:"video-inline",...f,children:d})}},children:e}),s&&o.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>i(null),children:o.jsxs("div",{className:"video-viewer",onClick:c=>c.stopPropagation(),children:[o.jsxs("div",{className:"video-viewer-header",children:[o.jsx("div",{className:"video-viewer-title",children:s.title||a(s.src)}),o.jsxs("nav",{className:"video-viewer-nav",children:[o.jsx("a",{href:s.src,download:s.title||a(s.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:o.jsx(yx,{})}),o.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>i(null),children:o.jsx(Oi,{})})]})]}),o.jsx("div",{className:"video-viewer-body",children:o.jsx("video",{src:s.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const ph=g.memo(O_e),c3=6,u3=7,M_e={active:"可用",available:"可用",creating:"创建中",disabled:"已停用",enabled:"已启用",failed:"异常",inactive:"未启用",pending:"等待中",published:"已发布",ready:"就绪",released:"已发布",running:"运行中",success:"正常",unavailable:"不可用",unreleased:"未发布",updating:"更新中"};function IN(e){return M_e[(e||"").trim().toLowerCase()]||"未知"}function d3(e){const t=(e||"").toLowerCase();return["active","available","enabled","published","ready","released","success"].includes(t)?"is-positive":["creating","pending","running","updating"].includes(t)?"is-progress":["failed","unavailable"].includes(t)?"is-danger":"is-muted"}function L_e(e){if(!e)return"";const t=e.trim(),n=Number(t),s=/^\d+(?:\.\d+)?$/.test(t)?new Date(n<1e12?n*1e3:n):new Date(t);return Number.isNaN(s.getTime())?e:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(s)}function D_e(e){const t=e.replace(/\r\n/g,` `);if(!t.startsWith(`--- `))return e;const n=t.indexOf(` --- -`,4);return n>=0?t.slice(n+5).trimStart():e}function P_e({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.jsx("path",{d:"m17.85 13.85.42 1.13 1.13.42-1.13.42-.42 1.13-.42-1.13-1.13-.42 1.13-.42z",fill:"currentColor"})]})}function B_e(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function d3({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function jN(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function f3({page:e,total:t,pageSize:n,onPage:s}){const i=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>s(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(d3,{direction:"left"})}),o.jsxs("span",{children:[e," / ",i]}),o.jsx("button",{type:"button",onClick:()=>s(e+1),disabled:e>=i,"aria-label":"下一页",children:o.jsx(d3,{direction:"right"})})]})]})}function cy({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function U_e({skill:e,space:t,region:n,cloudProvider:s,detail:i,loading:r,error:a,onClose:l}){return g.useEffect(()=>{const c=u=>{u.key==="Escape"&&l()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[l]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:l,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:c=>c.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx(P_e,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(i==null?void 0:i.name)||e.skillName}),o.jsx("p",{children:(i==null?void 0:i.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:l,"aria-label":"关闭技能详情",children:o.jsx(B_e,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(i==null?void 0:i.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:IN(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:kf(n,s)})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),r?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(jN,{}),"正在读取技能内容…"]}):a?o.jsx("div",{className:"skillcenter-error",children:a}):i!=null&&i.skillMd?o.jsx(gh,{text:D_e(i.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(cy,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function F_e({cloudProvider:e="volcengine"}){const t=vx(e),[n,s]=g.useState(Ni(e)),[i,r]=g.useState([]),[a,l]=g.useState(1),[c,u]=g.useState(0),[d,f]=g.useState(!1),[h,m]=g.useState(""),[p,b]=g.useState(null),[v,y]=g.useState([]),[x,E]=g.useState(1),[w,S]=g.useState(0),[_,k]=g.useState(!1),[T,A]=g.useState(""),[j,R]=g.useState(null),[B,z]=g.useState(null),[L,F]=g.useState(!1),[C,I]=g.useState(""),D=g.useRef(0);g.useEffect(()=>{t.some(P=>P.value===n)||(te(),s(Ni(e)),l(1),E(1),b(null),y([]))},[e,n,t]),g.useEffect(()=>{let P=!0;return f(!0),m(""),Kfe({region:n,page:a,pageSize:l3}).then(Q=>{if(!P)return;const ee=Q.items||[];r(ee),u(Q.totalCount||0),b(V=>ee.find(X=>X.id===(V==null?void 0:V.id))||null)}).catch(Q=>{P&&(r([]),u(0),b(null),m(Q instanceof Error?Q.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{P&&f(!1)}),()=>{P=!1}},[n,a]),g.useEffect(()=>{if(!p){y([]),S(0);return}let P=!0;return k(!0),A(""),qfe(p.id,{region:n,page:x,pageSize:c3,project:p.projectName}).then(Q=>{P&&(y(Q.items||[]),S(Q.totalCount||0))}).catch(Q=>{P&&(y([]),S(0),A(Q instanceof Error?Q.message:"读取技能失败,请稍后重试"))}).finally(()=>{P&&k(!1)}),()=>{P=!1}},[n,p,x]);const $=P=>{P!==n&&(te(),s(P),l(1),E(1),b(null),y([]))},O=P=>{te(),b(P),E(1)},te=()=>{D.current+=1,R(null),z(null),I(""),F(!1)},ne=async P=>{if(!p)return;const Q=D.current+1;D.current=Q,R(P),z(null),I(""),F(!0);try{const ee=await Yfe(p.id,P.skillId,P.version,n,p.projectName);D.current===Q&&z(ee)}catch(ee){D.current===Q&&I(ee instanceof Error?ee.message:"读取技能详情失败,请稍后重试")}finally{D.current===Q&&F(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:c})]}),o.jsx("div",{className:"skillcenter-regions","aria-label":"地域",children:t.map(P=>o.jsx("button",{type:"button",className:n===P.value?"active":"",onClick:()=>$(P.value),children:P.label},P.value))})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[d&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(jN,{}),"正在读取技能空间…"]}),h?o.jsx("div",{className:"skillcenter-error",children:h}):i.length===0&&!d?o.jsx(cy,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:i.map(P=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(p==null?void 0:p.id)===P.id?"active":""}`,onClick:()=>O(P),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:P.name,children:P.name}),o.jsx("span",{className:"skillcenter-item-description",children:P.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${u3(P.status)}`,children:IN(P.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:P.projectName||"default",children:["Project · ",P.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[P.skillCount??0," 个技能"]}),P.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",L_e(P.updatedAt)]})]})]})},`${P.projectName||"default"}:${P.id}`))})]}),o.jsx(f3,{page:a,total:c,pageSize:l3,onPage:l})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:p?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:p.name,children:[p.name," · 技能"]})}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(jN,{}),"正在读取技能…"]}),T?o.jsx("div",{className:"skillcenter-error",children:T}):v.length===0&&!_?o.jsx(cy,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:v.map(P=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void ne(P),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:P.skillName,children:P.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:P.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${u3(P.skillStatus)}`,children:IN(P.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",P.version||"—"]})]})]})},`${P.skillId}:${P.version}`))})]}),o.jsx(f3,{page:x,total:w,pageSize:c3,onPage:E})]}):o.jsx(cy,{children:"点击 Skill 空间以查看详情"})})]}),j&&p&&o.jsx(U_e,{skill:j,space:p,region:n,cloudProvider:e,detail:B,loading:L,error:C,onClose:te})]})}const sH="veadk_agentkit_connections",h3=["cn-beijing","cn-shanghai"];function $_e(e){const t=e||"cn-beijing";return h3.includes(t)?[t,...h3.filter(n=>n!==t)]:[t]}function Na(){try{const e=localStorage.getItem(sH);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function nE(e){try{localStorage.setItem(sH,JSON.stringify(e))}catch{}}function ao(e,t){return`agentkit:${e}:${t}`}function iH(e){try{return new URL(e).host}catch{return e}}function bh(e){ZB();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)QB(ao(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function rH(e,t,n,s,i,r){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:s,appLabels:i,currentVersion:r},l=Na(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,nE(l),bh(l),a}async function uy(e,t,n,s){let i=null,r=n||"cn-beijing",a=null;for(const u of $_e(n))try{const d=await f2(e,u,{retryProbe:!0});if(d&&d.length>0){i=d,r=u;break}}catch(d){if(d instanceof rh)throw R1(e),d;if(d instanceof Ir&&d.unsupported){a=d;continue}throw d}if(!i||i.length===0)throw R1(e),a||new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const l=Object.fromEntries(i.map(u=>[u,t])),c=rH(e,t,r,i,l,s);return ao(c.id,i[0])}async function aH(e,t,n,s){const i=t.trim().replace(/\/+$/,""),r=await _x(i,n.trim()),a={id:Date.now().toString(36),name:e.trim()||iH(i),base:i,apiKey:n.trim(),apps:r,appLabels:s&&r.length>0?{[r[0]]:s}:void 0},l=[...Na().filter(c=>c.base!==i),a];return nE(l),bh(l),a}function H_e(e){const t=Na().filter(n=>n.id!==e);return nE(t),bh(t),t}function R1(e){const t=Na().filter(n=>n.runtimeId!==e);return nE(t),bh(t),t}function oH(e,t){const n=e.map(i=>({id:i,label:i,app:i,remote:!1})),s=t.flatMap(i=>i.apps.map(r=>{var l;const a=((l=i.appLabels)==null?void 0:l[r])??r;return{id:ao(i.id,r),label:a,app:r,remote:!0,host:i.runtimeId?i.name:iH(i.base??""),runtimeId:i.runtimeId,region:i.region,currentVersion:i.currentVersion}}));return[...n,...s]}const m3=Object.freeze(Object.defineProperty({__proto__:null,addConnection:aH,addRuntimeConnection:rH,buildAgentEntries:oH,connectRuntime:uy,loadConnections:Na,registerConnections:bh,remoteAppId:ao,removeConnection:H_e,removeRuntimeConnection:R1},Symbol.toStringTag,{value:"Module"}));function z_e({onAdded:e,onCancel:t}){const[n,s]=g.useState(""),[i,r]=g.useState(""),[a,l]=g.useState(""),[c,u]=g.useState(!1),[d,f]=g.useState(""),h=n.trim().length>0&&i.trim().length>0&&!c;async function m(){if(h){u(!0),f("");try{const p=await aH(a,n,i,a);if(p.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(ao(p.id,p.apps[0]))}catch(p){f(`连接失败:${String(p)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:p=>s(p.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:i,onChange:p=>r(p.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:p=>l(p.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:m,disabled:!h,children:[c?o.jsx(bn,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function V_e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 4.2 21 19H3L12 4.2Z"}),o.jsx("path",{d:"M12 9.4v4.2"}),o.jsx("path",{d:"M12 16.8h.01"})]})}function G_e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function pA({title:e,description:t,confirmLabel:n,cancelLabel:s="取消",closeLabel:i="关闭确认框",variant:r="warning",busy:a=!1,onCancel:l,onConfirm:c}){const u=g.useId(),d=g.useId(),f=g.useRef(null),h=g.useRef(a),m=g.useRef(l);return g.useEffect(()=>{h.current=a,m.current=l},[a,l]),g.useEffect(()=>{var y;const p=document.body.style.overflow,b=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(y=f.current)==null||y.focus();const v=x=>{x.key==="Escape"&&!h.current&&m.current()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=p,window.removeEventListener("keydown",v),b!=null&&b.isConnected&&b.focus()}},[]),yi.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&!a&&l()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${r}`,role:"alertdialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":d,"aria-busy":a||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(V_e,{})}),o.jsx("h2",{id:u,children:e})]}),o.jsx("button",{type:"button",className:"studio-confirm-close",onClick:l,disabled:a,"aria-label":i,children:o.jsx(G_e,{})})]}),o.jsx("div",{className:"studio-confirm-body",children:o.jsx("p",{id:d,children:t})}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx("button",{ref:f,type:"button",onClick:l,disabled:a,children:s}),o.jsx("button",{type:"button",className:"studio-confirm-primary",onClick:c,disabled:a,children:n})]})]})}),document.body)}const K_e=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结",source:"auto",score:.92,reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用",source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉",source:"auto",score:.28,reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率",source:"user"}],q_e=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],rd=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"},{id:"optimizations",label:"优化项"},{id:"integrations",label:"接入方法"}],am=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function Pw(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function Y_e(e,t){const n=e.trim();if(!n||!t)return n;try{const s=new URL(n),i=s.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(i))return n;const r=new URL(t);return s.protocol=r.protocol,s.hostname=r.hostname,s.port=r.port,s.toString()}catch{return n}}function p3(e){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":e==="none"?"无需鉴权":"暂无"}function RN(e){return JSON.stringify(e)}function lH(e){return e==="key_auth"?`API_KEY = "" +`,4);return n>=0?t.slice(n+5).trimStart():e}function P_e({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("path",{d:"M6.25 4.75h8.6l2.9 2.9v11.6h-11.5z",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),o.jsx("path",{d:"M14.75 4.9v3h2.85M8.9 11.1h4.2M8.9 14h5.7",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),o.jsx("path",{d:"m17.85 13.85.42 1.13 1.13.42-1.13.42-.42 1.13-.42-1.13-1.13-.42 1.13-.42z",fill:"currentColor"})]})}function B_e(){return o.jsx("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m7.5 7.5 9 9m0-9-9 9",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function f3({direction:e}){return o.jsx("svg",{className:"icon",viewBox:"0 0 20 20",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:e==="left"?"m11.7 5.5-4.2 4.5 4.2 4.5":"m8.3 5.5 4.2 4.5-4.2 4.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function jN(){return o.jsx("span",{className:"skillcenter-loading-mark","aria-hidden":!0})}function h3({page:e,total:t,pageSize:n,onPage:s}){const i=Math.max(1,Math.ceil(t/n));return o.jsxs("footer",{className:"skillcenter-pager",children:[o.jsxs("span",{children:["共 ",t," 项"]}),o.jsxs("div",{className:"skillcenter-pager-actions",children:[o.jsx("button",{type:"button",onClick:()=>s(e-1),disabled:e<=1,"aria-label":"上一页",children:o.jsx(f3,{direction:"left"})}),o.jsxs("span",{children:[e," / ",i]}),o.jsx("button",{type:"button",onClick:()=>s(e+1),disabled:e>=i,"aria-label":"下一页",children:o.jsx(f3,{direction:"right"})})]})]})}function uy({children:e}){return o.jsx("div",{className:"skillcenter-empty",children:e})}function U_e({skill:e,space:t,region:n,cloudProvider:s,detail:i,loading:r,error:a,onClose:l}){return g.useEffect(()=>{const c=u=>{u.key==="Escape"&&l()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[l]),o.jsx("div",{className:"skill-detail-backdrop",role:"presentation",onMouseDown:l,children:o.jsxs("section",{className:"skill-detail-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skill-detail-title",onMouseDown:c=>c.stopPropagation(),children:[o.jsxs("header",{className:"skill-detail-head",children:[o.jsxs("div",{className:"skill-detail-heading",children:[o.jsx("span",{className:"skillcenter-symbol skillcenter-symbol--skill",children:o.jsx(P_e,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"skill-detail-title",children:(i==null?void 0:i.name)||e.skillName}),o.jsx("p",{children:(i==null?void 0:i.description)||e.skillDescription||"暂无描述"})]})]}),o.jsx("button",{type:"button",className:"skill-detail-close",onClick:l,"aria-label":"关闭技能详情",children:o.jsx(B_e,{})})]}),o.jsxs("dl",{className:"skill-detail-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"技能 ID"}),o.jsx("dd",{title:e.skillId,children:e.skillId})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"版本"}),o.jsx("dd",{children:(i==null?void 0:i.version)||e.version||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:IN(e.skillStatus)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能空间"}),o.jsx("dd",{title:t.name,children:t.name})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Project"}),o.jsx("dd",{title:t.projectName||"default",children:t.projectName||"default"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"地域"}),o.jsx("dd",{children:Nf(n,s)})]})]}),o.jsxs("div",{className:"skill-detail-content",children:[o.jsx("div",{className:"skill-detail-content-title",children:"SKILL.md"}),r?o.jsxs("div",{className:"skillcenter-loading",children:[o.jsx(jN,{}),"正在读取技能内容…"]}):a?o.jsx("div",{className:"skillcenter-error",children:a}):i!=null&&i.skillMd?o.jsx(ph,{text:D_e(i.skillMd),className:"skill-detail-markdown",allowRawHtml:!1}):o.jsx(uy,{children:"该技能暂无 SKILL.md 内容"})]})]})})}function F_e({cloudProvider:e="volcengine"}){const t=wx(e),[n,s]=g.useState(Ti(e)),[i,r]=g.useState([]),[a,l]=g.useState(1),[c,u]=g.useState(0),[d,f]=g.useState(!1),[h,p]=g.useState(""),[m,b]=g.useState(null),[v,y]=g.useState([]),[x,E]=g.useState(1),[w,S]=g.useState(0),[_,T]=g.useState(!1),[k,A]=g.useState(""),[j,R]=g.useState(null),[B,z]=g.useState(null),[L,F]=g.useState(!1),[C,I]=g.useState(""),D=g.useRef(0);g.useEffect(()=>{t.some(P=>P.value===n)||(te(),s(Ti(e)),l(1),E(1),b(null),y([]))},[e,n,t]),g.useEffect(()=>{let P=!0;return f(!0),p(""),Kfe({region:n,page:a,pageSize:c3}).then(Q=>{if(!P)return;const ee=Q.items||[];r(ee),u(Q.totalCount||0),b(V=>ee.find(X=>X.id===(V==null?void 0:V.id))||null)}).catch(Q=>{P&&(r([]),u(0),b(null),p(Q instanceof Error?Q.message:"读取技能空间失败,请稍后重试"))}).finally(()=>{P&&f(!1)}),()=>{P=!1}},[n,a]),g.useEffect(()=>{if(!m){y([]),S(0);return}let P=!0;return T(!0),A(""),qfe(m.id,{region:n,page:x,pageSize:u3,project:m.projectName}).then(Q=>{P&&(y(Q.items||[]),S(Q.totalCount||0))}).catch(Q=>{P&&(y([]),S(0),A(Q instanceof Error?Q.message:"读取技能失败,请稍后重试"))}).finally(()=>{P&&T(!1)}),()=>{P=!1}},[n,m,x]);const $=P=>{P!==n&&(te(),s(P),l(1),E(1),b(null),y([]))},O=P=>{te(),b(P),E(1)},te=()=>{D.current+=1,R(null),z(null),I(""),F(!1)},se=async P=>{if(!m)return;const Q=D.current+1;D.current=Q,R(P),z(null),I(""),F(!0);try{const ee=await Yfe(m.id,P.skillId,P.version,n,m.projectName);D.current===Q&&z(ee)}catch(ee){D.current===Q&&I(ee instanceof Error?ee.message:"读取技能详情失败,请稍后重试")}finally{D.current===Q&&F(!1)}};return o.jsxs("section",{className:"skillcenter",children:[o.jsxs("div",{className:"skillcenter-browser",children:[o.jsxs("section",{className:"skillcenter-panel","aria-label":"技能空间列表",children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsxs("div",{children:[o.jsx("h2",{children:"技能空间"}),o.jsx("span",{className:"skillcenter-count-badge",children:c})]}),o.jsx("div",{className:"skillcenter-regions","aria-label":"地域",children:t.map(P=>o.jsx("button",{type:"button",className:n===P.value?"active":"",onClick:()=>$(P.value),children:P.label},P.value))})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[d&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(jN,{}),"正在读取技能空间…"]}),h?o.jsx("div",{className:"skillcenter-error",children:h}):i.length===0&&!d?o.jsx(uy,{children:"当前地域暂无可访问的技能空间"}):o.jsx("div",{className:"skillcenter-list",children:i.map(P=>o.jsx("button",{type:"button",className:`skillcenter-space-item ${(m==null?void 0:m.id)===P.id?"active":""}`,onClick:()=>O(P),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:P.name,children:P.name}),o.jsx("span",{className:"skillcenter-item-description",children:P.description||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${d3(P.status)}`,children:IN(P.status)}),o.jsxs("span",{className:"skillcenter-meta-text",title:P.projectName||"default",children:["Project · ",P.projectName||"default"]}),o.jsxs("span",{className:"skillcenter-meta-text",children:[P.skillCount??0," 个技能"]}),P.updatedAt&&o.jsxs("span",{className:"skillcenter-meta-text",children:["更新于 ",L_e(P.updatedAt)]})]})]})},`${P.projectName||"default"}:${P.id}`))})]}),o.jsx(h3,{page:a,total:c,pageSize:c3,onPage:l})]}),o.jsx("section",{className:"skillcenter-panel","aria-label":"技能列表",children:m?o.jsxs(o.Fragment,{children:[o.jsxs("header",{className:"skillcenter-panel-head",children:[o.jsx("div",{children:o.jsxs("h2",{title:m.name,children:[m.name," · 技能"]})}),o.jsx("span",{children:w})]}),o.jsxs("div",{className:"skillcenter-listwrap",children:[_&&o.jsxs("div",{className:"skillcenter-loading skillcenter-loading--overlay",children:[o.jsx(jN,{}),"正在读取技能…"]}),k?o.jsx("div",{className:"skillcenter-error",children:k}):v.length===0&&!_?o.jsx(uy,{children:"这个空间中暂无技能"}):o.jsx("div",{className:"skillcenter-list skillcenter-list--skills",children:v.map(P=>o.jsx("button",{type:"button",className:"skillcenter-skill-item",onClick:()=>void se(P),children:o.jsxs("span",{className:"skillcenter-item-body",children:[o.jsx("span",{className:"skillcenter-item-title",title:P.skillName,children:P.skillName}),o.jsx("span",{className:"skillcenter-item-description",children:P.skillDescription||"暂无描述"}),o.jsxs("span",{className:"skillcenter-item-meta",children:[o.jsx("span",{className:`skillcenter-status ${d3(P.skillStatus)}`,children:IN(P.skillStatus)}),o.jsxs("span",{className:"skillcenter-meta-text",children:["版本 · ",P.version||"—"]})]})]})},`${P.skillId}:${P.version}`))})]}),o.jsx(h3,{page:x,total:w,pageSize:u3,onPage:E})]}):o.jsx(uy,{children:"点击 Skill 空间以查看详情"})})]}),j&&m&&o.jsx(U_e,{skill:j,space:m,region:n,cloudProvider:e,detail:B,loading:L,error:C,onClose:te})]})}const iH="veadk_agentkit_connections",p3=["cn-beijing","cn-shanghai"];function $_e(e){const t=e||"cn-beijing";return p3.includes(t)?[t,...p3.filter(n=>n!==t)]:[t]}function Ia(){try{const e=localStorage.getItem(iH);return(e?JSON.parse(e):[]).filter(n=>!n.runtimeId||!!n.region)}catch{return[]}}function sE(e){try{localStorage.setItem(iH,JSON.stringify(e))}catch{}}function ho(e,t){return`agentkit:${e}:${t}`}function rH(e){try{return new URL(e).host}catch{return e}}function mh(e){JB();for(const t of e)if(!(t.runtimeId&&!t.region))for(const n of t.apps)ZB(ho(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function aH(e,t,n,s,i,r){const a={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:s,appLabels:i,currentVersion:r},l=Ia(),c=l.findIndex(u=>u.runtimeId===e);return c===-1?l.push(a):l[c]=a,sE(l),mh(l),a}async function dy(e,t,n,s){let i=null,r=n||"cn-beijing",a=null;for(const u of $_e(n))try{const d=await f2(e,u,{retryProbe:!0});if(d&&d.length>0){i=d,r=u;break}}catch(d){if(d instanceof sh)throw O1(e),d;if(d instanceof Or&&d.unsupported){a=d;continue}throw d}if(!i||i.length===0)throw O1(e),a||new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const l=Object.fromEntries(i.map(u=>[u,t])),c=aH(e,t,r,i,l,s);return ho(c.id,i[0])}async function oH(e,t,n,s){const i=t.trim().replace(/\/+$/,""),r=await Sx(i,n.trim()),a={id:Date.now().toString(36),name:e.trim()||rH(i),base:i,apiKey:n.trim(),apps:r,appLabels:s&&r.length>0?{[r[0]]:s}:void 0},l=[...Ia().filter(c=>c.base!==i),a];return sE(l),mh(l),a}function H_e(e){const t=Ia().filter(n=>n.id!==e);return sE(t),mh(t),t}function O1(e){const t=Ia().filter(n=>n.runtimeId!==e);return sE(t),mh(t),t}function lH(e,t){const n=e.map(i=>({id:i,label:i,app:i,remote:!1})),s=t.flatMap(i=>i.apps.map(r=>{var l;const a=((l=i.appLabels)==null?void 0:l[r])??r;return{id:ho(i.id,r),label:a,app:r,remote:!0,host:i.runtimeId?i.name:rH(i.base??""),runtimeId:i.runtimeId,region:i.region,currentVersion:i.currentVersion}}));return[...n,...s]}const m3=Object.freeze(Object.defineProperty({__proto__:null,addConnection:oH,addRuntimeConnection:aH,buildAgentEntries:lH,connectRuntime:dy,loadConnections:Ia,registerConnections:mh,remoteAppId:ho,removeConnection:H_e,removeRuntimeConnection:O1},Symbol.toStringTag,{value:"Module"}));function z_e({onAdded:e,onCancel:t}){const[n,s]=g.useState(""),[i,r]=g.useState(""),[a,l]=g.useState(""),[c,u]=g.useState(!1),[d,f]=g.useState(""),h=n.trim().length>0&&i.trim().length>0&&!c;async function p(){if(h){u(!0),f("");try{const m=await oH(a,n,i,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),u(!1);return}e(ho(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),u(!1)}}}return o.jsx("div",{className:"addagent",children:o.jsxs("div",{className:"addagent-card",children:[o.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),o.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),o.jsx("input",{className:"addagent-input",value:n,onChange:m=>s(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"API Key"}),o.jsx("input",{className:"addagent-input",type:"password",value:i,onChange:m=>r(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),o.jsxs("label",{className:"addagent-field",children:[o.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),o.jsx("input",{className:"addagent-input",value:a,onChange:m=>l(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&o.jsx("div",{className:"addagent-error",children:d}),o.jsxs("div",{className:"addagent-actions",children:[o.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:c,children:"取消"}),o.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[c?o.jsx(yn,{className:"icon spin"}):null,c?"连接中…":"连接并添加"]})]})]})})}function V_e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 4.2 21 19H3L12 4.2Z"}),o.jsx("path",{d:"M12 9.4v4.2"}),o.jsx("path",{d:"M12 16.8h.01"})]})}function G_e(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function mA({title:e,description:t,confirmLabel:n,cancelLabel:s="取消",closeLabel:i="关闭确认框",variant:r="warning",busy:a=!1,onCancel:l,onConfirm:c}){const u=g.useId(),d=g.useId(),f=g.useRef(null),h=g.useRef(a),p=g.useRef(l);return g.useEffect(()=>{h.current=a,p.current=l},[a,l]),g.useEffect(()=>{var y;const m=document.body.style.overflow,b=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(y=f.current)==null||y.focus();const v=x=>{x.key==="Escape"&&!h.current&&p.current()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=m,window.removeEventListener("keydown",v),b!=null&&b.isConnected&&b.focus()}},[]),wi.createPortal(o.jsx("div",{className:"studio-confirm-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&!a&&l()},children:o.jsxs("section",{className:`studio-confirm-dialog studio-confirm-dialog--${r}`,role:"alertdialog","aria-modal":"true","aria-labelledby":u,"aria-describedby":d,"aria-busy":a||void 0,children:[o.jsxs("header",{className:"studio-confirm-head",children:[o.jsxs("div",{className:"studio-confirm-title-wrap",children:[o.jsx("span",{className:"studio-confirm-title-icon","aria-hidden":"true",children:o.jsx(V_e,{})}),o.jsx("h2",{id:u,children:e})]}),o.jsx("button",{type:"button",className:"studio-confirm-close",onClick:l,disabled:a,"aria-label":i,children:o.jsx(G_e,{})})]}),o.jsx("div",{className:"studio-confirm-body",children:o.jsx("p",{id:d,children:t})}),o.jsxs("footer",{className:"studio-confirm-actions",children:[o.jsx("button",{ref:f,type:"button",onClick:l,disabled:a,children:s}),o.jsx("button",{type:"button",className:"studio-confirm-primary",onClick:c,disabled:a,children:n})]})]})}),document.body)}const K_e=[{id:"case-1",itemKey:"case-1",kind:"good",input:"总结本周客户反馈,并按优先级归类。",output:"覆盖主要问题,给出清晰的优先级与下一步动作。",referenceOutput:"覆盖主要问题,给出清晰的优先级与下一步动作。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T09:12:00+08:00",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"总结",source:"auto",score:.92,reason:"任务完整覆盖了用户目标,输出结构清晰,并给出了可执行的下一步动作。"},{id:"case-2",itemKey:"case-2",kind:"good",input:"查询最新公开资料并附上来源。",output:"调用搜索工具,结论与引用一一对应。",referenceOutput:"调用搜索工具,结论与引用一一对应。",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T08:47:00+08:00",evaluationSetId:"",evaluationSetName:"示例 good case",workspaceId:"",tag:"工具调用",source:"user"},{id:"case-3",itemKey:"case-3",kind:"bad",input:"在信息不足时直接给出确定结论。",output:"应明确说明未知,并主动询问缺失信息。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T07:35:00+08:00",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"幻觉",source:"auto",score:.28,reason:"信息不足时仍给出了确定结论,缺少必要的澄清步骤与不确定性说明。"},{id:"case-4",itemKey:"case-4",kind:"bad",input:"连续重复调用相同工具获取同一结果。",output:"复用已有结果,避免无意义的重复调用。",referenceOutput:"",comment:"",agentName:"示例 Agent",sessionId:"",messageId:"",runtimeId:"",invocationId:"",userId:"",createdAt:"2026-08-05T06:58:00+08:00",evaluationSetId:"",evaluationSetName:"示例 bad case",workspaceId:"",tag:"效率",source:"user"}],q_e=[{id:"eval-regression",name:"核心能力回归",agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量","工具调用"],concurrency:"4",history:[{id:"run-1",createdAt:"今天 10:32",score:88,status:"completed"},{id:"run-2",createdAt:"昨天 16:08",score:84,status:"completed"}]},{id:"eval-safety",name:"安全与幻觉检查",agentIds:[],caseSet:"安全边界集",evaluator:"事实一致性评估器",metrics:["事实准确性","拒答合理性"],concurrency:"2",history:[{id:"run-3",createdAt:"7 月 25 日 14:20",score:91,status:"completed"}]}],sd=[{id:"basic",label:"基本信息"},{id:"evaluations",label:"评测集"},{id:"optimizations",label:"优化项"},{id:"integrations",label:"接入方法"}],sp=[{id:"api-server",label:"API Server"},{id:"a2a",label:"A2A"}];function Pw(e,t){return e?`${e.replace(/\/+$/,"")}${t}`:""}function Y_e(e,t){const n=e.trim();if(!n||!t)return n;try{const s=new URL(n),i=s.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(!["localhost","127.0.0.1","::1"].includes(i))return n;const r=new URL(t);return s.protocol=r.protocol,s.hostname=r.hostname,s.port=r.port,s.toString()}catch{return n}}function g3(e){return e==="key_auth"?"API Key":e==="custom_jwt"?"OAuth / JWT":e==="none"?"无需鉴权":"暂无"}function RN(e){return JSON.stringify(e)}function cH(e){return e==="key_auth"?`API_KEY = "" HEADERS = {"Authorization": f"Bearer {API_KEY}"}`:e==="custom_jwt"?`ACCESS_TOKEN = "" HEADERS = {"Authorization": f"Bearer {ACCESS_TOKEN}"}`:e==="none"?"HEADERS = {}":`AUTH_TOKEN = "" HEADERS = {"Authorization": f"Bearer {AUTH_TOKEN}"}`}function W_e(e,t,n){const s=e.replace(/\/+$/,"");return`\`\`\`python @@ -585,7 +585,7 @@ BASE_URL = ${RN(s)} APP_NAME = ${RN(t)} USER_ID = "demo-user" SESSION_ID = str(uuid.uuid4()) -${lH(n)} +${cH(n)} session_response = requests.post( f"{BASE_URL}/apps/{APP_NAME}/users/{USER_ID}/sessions/{SESSION_ID}", @@ -621,7 +621,7 @@ import uuid import requests AGENT_URL = ${RN(e)} -${lH(t)} +${cH(t)} response = requests.post( AGENT_URL, @@ -642,11 +642,11 @@ response = requests.post( ) response.raise_for_status() print(response.json()) -\`\`\``}function Q_e({visible:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&o.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function g3({available:e,authType:t,value:n,visible:s,loading:i,error:r,onToggle:a}){return e?t==="none"?"无需 API Key":t==="custom_jwt"?"使用 OAuth / JWT":t!=="key_auth"?"暂无":o.jsxs("span",{className:"aw-integration-secret",children:[o.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:s&&n?n:"****"}),o.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":s?"隐藏 API Key":"显示 API Key",title:s?"隐藏 API Key":"显示 API Key",disabled:i,onClick:a,children:i?o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):o.jsx(Q_e,{visible:s})}),r&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:r})]}):"暂无"}function b3({protocol:e,title:t,available:n,fields:s,example:i}){return o.jsxs("section",{className:`aw-integration-panel${n&&i?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[o.jsx("header",{children:o.jsx("h3",{children:t})}),o.jsx("dl",{children:s.map(r=>o.jsxs("div",{children:[o.jsx("dt",{children:r.label}),o.jsx("dd",{children:r.value||"暂无"})]},r.label))}),n&&i&&o.jsxs("section",{className:"aw-integration-example",children:[o.jsx("h4",{children:"Python 示例"}),o.jsx(gh,{text:i,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function cH(e){const t=e.tools??[],n=ju.filter(i=>i.toolNames.some(r=>t.includes(r))),s=new Set(n.flatMap(i=>i.toolNames));return{...Ai(),name:e.name,description:e.description,instruction:e.instruction||Ai().instruction,agentType:e.type,modelName:e.model,tools:t.filter(i=>!s.has(i)),builtinTools:n.map(i=>i.id),skills:(e.skills??[]).map(i=>i.name),subAgents:(e.children??[]).map(cH)}}function Z_e(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?cH(e.graph):{...Ai(),name:(e==null?void 0:e.name)||t,description:(e==null?void 0:e.description)||"暂无描述",agentType:(e==null?void 0:e.type)??"llm",modelName:e==null?void 0:e.model,tools:(e==null?void 0:e.tools)??[],skills:((n=e==null?void 0:e.skills)==null?void 0:n.map(s=>s.name))??[]}}function uH(e){return e?1+e.children.reduce((t,n)=>t+uH(n),0):1}function dH(e){return 1+e.subAgents.reduce((t,n)=>t+dH(n),0)}function ON(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function J_e(e){const t=ON(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function eSe(e){return e.source!=="auto"||typeof e.score!="number"||!Number.isFinite(e.score)?"—":`${Math.round(e.score*100)} 分`}function tSe(e){return e==="high"?"高":e==="medium"?"中":"低"}const nSe={agent_structure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"};function sSe(e){var t;return e.module==="other"?((t=e.customModule)==null?void 0:t.trim())||"其他":nSe[e.module]}function iSe(e,t){return e.find(n=>n.kind===t)}function y3(e){return e.items.map(t=>({...t,tag:t.kind==="good"?"Good case":"Bad case"})).sort((t,n)=>ON(n.createdAt)-ON(t.createdAt))}function rSe(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(s=>s.name),(n.mcpTools??[]).map(s=>s.name),n.skills??[],(n.selectedSkills??[]).map(s=>s.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const Tm=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],aSe={phase:"evaluation",label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"};function oSe(e){return{phase:"update",label:"更新实例配置",description:`将 Runtime 实例数调整为 ${e.min}~${e.max}`}}const lSe=Tm.findIndex(e=>e.phase==="build");function fH(e){const t=e.instanceRange?[...Tm.slice(0,-1),oSe(e.instanceRange),Tm[Tm.length-1]]:Tm;return e.createEvaluationSets?[...t.slice(0,-1),aSe,t[t.length-1]]:t}function hH(e){const t=fH(e);if(e.status==="success")return t.length-1;const n=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation",部署完成:"complete"}[e.label],s=t.findIndex(i=>i.phase===n);return s<0?0:s}function cSe(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function uSe({task:e}){const t=e.buildLog,n=g.useRef(null),s=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&hH(e)===lSe,[i,r]=g.useState(s),[a,l]=g.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` +\`\`\``}function Q_e({visible:e}){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M2.8 12s3.3-5.4 9.2-5.4 9.2 5.4 9.2 5.4-3.3 5.4-9.2 5.4S2.8 12 2.8 12Z"}),o.jsx("circle",{cx:"12",cy:"12",r:"2.4"}),!e&&o.jsx("path",{d:"m4.2 4.2 15.6 15.6"})]})}function b3({available:e,authType:t,value:n,visible:s,loading:i,error:r,onToggle:a}){return e?t==="none"?"无需 API Key":t==="custom_jwt"?"使用 OAuth / JWT":t!=="key_auth"?"暂无":o.jsxs("span",{className:"aw-integration-secret",children:[o.jsx("span",{className:"aw-integration-secret-value","aria-live":"polite",children:s&&n?n:"****"}),o.jsx("button",{type:"button",className:"aw-integration-secret-toggle","aria-label":s?"隐藏 API Key":"显示 API Key",title:s?"隐藏 API Key":"显示 API Key",disabled:i,onClick:a,children:i?o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}):o.jsx(Q_e,{visible:s})}),r&&o.jsx("span",{className:"aw-integration-secret-error",role:"alert",children:r})]}):"暂无"}function y3({protocol:e,title:t,available:n,fields:s,example:i}){return o.jsxs("section",{className:`aw-integration-panel${n&&i?" has-example":""}`,id:`integration-${e}-panel`,role:"tabpanel","aria-labelledby":`integration-${e}-tab`,children:[o.jsx("header",{children:o.jsx("h3",{children:t})}),o.jsx("dl",{children:s.map(r=>o.jsxs("div",{children:[o.jsx("dt",{children:r.label}),o.jsx("dd",{children:r.value||"暂无"})]},r.label))}),n&&i&&o.jsxs("section",{className:"aw-integration-example",children:[o.jsx("h4",{children:"Python 示例"}),o.jsx(ph,{text:i,className:"aw-integration-example-code",allowRawHtml:!1})]})]})}function uH(e){const t=e.tools??[],n=Ou.filter(i=>i.toolNames.some(r=>t.includes(r))),s=new Set(n.flatMap(i=>i.toolNames));return{...Ci(),name:e.name,description:e.description,instruction:e.instruction||Ci().instruction,agentType:e.type,modelName:e.model,tools:t.filter(i=>!s.has(i)),builtinTools:n.map(i=>i.id),skills:(e.skills??[]).map(i=>i.name),subAgents:(e.children??[]).map(uH)}}function Z_e(e,t){var n;return e!=null&&e.draft?e.draft:e!=null&&e.graph?uH(e.graph):{...Ci(),name:(e==null?void 0:e.name)||t,description:(e==null?void 0:e.description)||"暂无描述",agentType:(e==null?void 0:e.type)??"llm",modelName:e==null?void 0:e.model,tools:(e==null?void 0:e.tools)??[],skills:((n=e==null?void 0:e.skills)==null?void 0:n.map(s=>s.name))??[]}}function dH(e){return e?1+e.children.reduce((t,n)=>t+dH(n),0):1}function fH(e){return 1+e.subAgents.reduce((t,n)=>t+fH(n),0)}function ON(e){if(!e)return 0;const t=Number(e);if(Number.isFinite(t))return t<1e12?t*1e3:t;const n=Date.parse(e);return Number.isFinite(n)?n:0}function J_e(e){const t=ON(e);return t?new Intl.DateTimeFormat("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"时间未知"}function eSe(e){return e.source!=="auto"||typeof e.score!="number"||!Number.isFinite(e.score)?"—":`${Math.round(e.score*100)} 分`}function tSe(e){return e==="high"?"高":e==="medium"?"中":"低"}const nSe={agent_structure:"Agent 结构",prompt:"提示词",tool:"工具",knowledge:"知识库",memory:"记忆",workflow:"工作流",other:"其他"};function sSe(e){var t;return e.module==="other"?((t=e.customModule)==null?void 0:t.trim())||"其他":nSe[e.module]}function iSe(e,t){return e.find(n=>n.kind===t)}function x3(e){return e.items.map(t=>({...t,tag:t.kind==="good"?"Good case":"Bad case"})).sort((t,n)=>ON(n.createdAt)-ON(t.createdAt))}function rSe(e){const t=n=>[n.name,n.description,n.agentType??"llm",n.modelName??"",n.tools??[],n.builtinTools??[],(n.customTools??[]).map(s=>s.name),(n.mcpTools??[]).map(s=>s.name),n.skills??[],(n.selectedSkills??[]).map(s=>s.name),(n.subAgents??[]).map(t)];return JSON.stringify(t(e))}const _p=[{phase:"prepare",label:"准备部署",description:"校验配置并创建部署任务"},{phase:"build",label:"构建镜像",description:"生成运行环境与智能体代码"},{phase:"deploy",label:"部署服务",description:"创建并启动 AgentKit Runtime"},{phase:"publish",label:"发布服务",description:"等待服务就绪并生成访问地址"},{phase:"complete",label:"部署完成",description:"智能体已可以正常使用"}],aSe={phase:"evaluation",label:"创建评测集",description:"自动创建 Good Case 和 Bad Case 评测集"};function oSe(e){return{phase:"update",label:"更新实例配置",description:`将 Runtime 实例数调整为 ${e.min}~${e.max}`}}const lSe=_p.findIndex(e=>e.phase==="build");function hH(e){const t=e.instanceRange?[..._p.slice(0,-1),oSe(e.instanceRange),_p[_p.length-1]]:_p;return e.createEvaluationSets?[...t.slice(0,-1),aSe,t[t.length-1]]:t}function pH(e){const t=hH(e);if(e.status==="success")return t.length-1;const n=e.phase??{准备部署:"prepare",构建镜像:"build",部署:"deploy",发布:"publish",创建评测集:"evaluation",部署完成:"complete"}[e.label],s=t.findIndex(i=>i.phase===n);return s<0?0:s}function cSe(e){if(!e)return"";try{return new Intl.DateTimeFormat("zh-CN",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(new Date(e))}catch{return""}}function uSe({task:e}){const t=e.buildLog,n=g.useRef(null),s=(t==null?void 0:t.status)!=="complete"&&(e.status==="running"||e.status==="error")&&pH(e)===lSe,[i,r]=g.useState(s),[a,l]=g.useState(!1),c=!!(t!=null&&t.text||t!=null&&t.error),u=(t==null?void 0:t.text)||(t==null?void 0:t.error)||"",d=u.split(` `),f=i?u:d.slice(-36).join(` -`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(g.useEffect(()=>{t&&r(s)},[e.id,t==null?void 0:t.status,s]),g.useEffect(()=>{if(!i||!c)return;const x=n.current;x&&(x.scrollTop=x.scrollHeight)},[i,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const m=cSe(t.updatedAt),p=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",b=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",v=[p,t.lineCount?`${t.lineCount} 行`:"",b,m].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${i?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:v})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>r(x=>!x),children:i?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(Pa,{"aria-hidden":!0}):o.jsx(gx,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),i&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function dSe({task:e}){const t=fH(e),n=hH(e),s=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),i=e.status==="running"?"正在部署":e.status==="success"?"部署完成":e.status==="error"?"部署失败":"部署已取消";return o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx(bn,{className:"spin"}):e.status==="success"?o.jsx(Aee,{}):e.status==="error"?o.jsx(Gk,{}):o.jsx(UR,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:i}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(s)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s),children:o.jsx("span",{style:{width:`${s}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:t.map((r,a)=>{const l=e.status==="success"||anew Set),[qn,nn]=g.useState(()=>new Set),[qt,mn]=g.useState(!1),[wt,Bt]=g.useState(""),[Tt,En]=g.useState(null),[vn,Ht]=g.useState([]),[os,Os]=g.useState([]),[Ms,wn]=g.useState(!1),[ls,Yn]=g.useState(""),[Wn,ri]=g.useState(0),[ps,Ls]=g.useState([]),[Ln,Ds]=g.useState(!1),[Cn,Ss]=g.useState(""),[Ps,cs]=g.useState(0),[gs,Dn]=g.useState(!1),[pn,on]=g.useState(()=>new Set),[Yt,_n]=g.useState(!1),[de,Ie]=g.useState(""),[Me,Xe]=g.useState(""),[ot,mt]=g.useState(()=>new Set),bt=g.useRef(!1),$n=g.useRef(""),Le=g.useRef(null),bs=g.useRef(0),ys=g.useRef(0),[Ns,en]=g.useState(q_e),[Ut,Oi]=g.useState("");g.useEffect(()=>{e.length!==0&&en(H=>H.map((le,fe)=>fe===0&&le.agentIds.length===0?{...le,agentIds:e.slice(0,2).map(Ce=>Ce.id)}:le))},[e]);const gn=g.useMemo(()=>{const H=new Map;for(const le of e)le.runtimeId&&H.set(le.runtimeId,le);return H},[e]),Ts=g.useMemo(()=>{var le;const H=new Map;for(const fe of t){const Ce=(le=fe.deploymentTarget)==null?void 0:le.runtimeId;if(!Ce||!gn.has(Ce))continue;const Ge=H.get(Ce);(!Ge||fe.updatedAt>Ge.updatedAt)&&H.set(Ce,fe)}return H},[gn,t]),Ha=g.useMemo(()=>{const H=new Map;for(const le of d){if(!le.runtimeId)continue;const fe=H.get(le.runtimeId);(!fe||le.startedAt>fe.startedAt)&&H.set(le.runtimeId,le)}return H},[d]),ol=g.useMemo(()=>{const H=Oe.trim().toLowerCase();return H?e.filter(le=>{const fe=le.runtimeId?Ts.get(le.runtimeId):void 0,Ce=le.runtimeId?Ha.get(le.runtimeId):void 0;return[le.label,le.app,le.host??"",(fe==null?void 0:fe.draft.name)??"",(fe==null?void 0:fe.draft.description)??"",(Ce==null?void 0:Ce.runtimeName)??""].join(" ").toLowerCase().includes(H)}):e},[e,Ha,Oe,Ts]),nr=g.useMemo(()=>{const H=Oe.trim().toLowerCase();return t.filter(le=>{var Ce;const fe=(Ce=le.deploymentTarget)==null?void 0:Ce.runtimeId;return fe&&gn.has(fe)?!1:H?`${le.draft.name} ${le.draft.description}`.toLowerCase().includes(H):!0})},[gn,t,Oe]),Fu=g.useMemo(()=>t.filter(H=>{var fe;const le=(fe=H.deploymentTarget)==null?void 0:fe.runtimeId;return!le||!gn.has(le)}).length,[gn,t]),xc=g.useMemo(()=>{const H=Oe.trim().toLowerCase();return H?Ns.filter(le=>le.name.toLowerCase().includes(H)):Ns},[Ns,Oe]),re=e.find(H=>H.id===C),yt=t.find(H=>H.id===D),Sn=f?d.find(H=>H.id===f):void 0,ks=re!=null&&re.runtimeId?Ts.get(re.runtimeId):void 0,sn=v?W:C&&i===C?s:null,As=(sn==null?void 0:sn.appName)||(re==null?void 0:re.runtimeApp)||(re==null?void 0:re.app)||"",za=`${(re==null?void 0:re.region)??"cn-beijing"}:${(re==null?void 0:re.runtimeId)??""}`,mo=(ue==null?void 0:ue.requestKey)===za?ue.value:"",Hn=(ne==null?void 0:ne.requestKey)===za?ne:null,Gi=!!((Ku=Hn==null?void 0:Hn.apiApps)!=null&&Ku.length),se=!!(Hn!=null&&Hn.a2a),Ne=((c0=Hn==null?void 0:Hn.apiApps)==null?void 0:c0[0])??As,be=(O==null?void 0:O.endpoint)??"",st=Y_e(((u0=Hn==null?void 0:Hn.a2a)==null?void 0:u0.endpoint)??"",be),un=JSON.stringify([(re==null?void 0:re.runtimeId)??"",(re==null?void 0:re.region)??""]),Ct=(Be==null?void 0:Be.requestKey)===un?Be.value:null;g.useEffect(()=>{const H=bs.current+1;bs.current=H,Fe(null),Ue("");const le=(re==null?void 0:re.runtimeId)??"",fe=(re==null?void 0:re.region)??"";if(!l||!le||!fe){Ae(!1);return}const Ce=new AbortController;return Ae(!0),D8({runtimeId:le,region:fe,signal:Ce.signal}).then(Ge=>{var _t;if(H===bs.current){if(Ge.runtime.runtimeId!==le||Ge.runtime.region!==fe||Ge.canUpdate&&!((_t=Ge.agent)!=null&&_t.appName)){Ue("Runtime 更新能力响应与当前选择不匹配。");return}Fe({requestKey:un,value:Ge})}}).catch(Ge=>{H!==bs.current||Ce.signal.aborted||Ue(Ge instanceof Error?Ge.message:"检查 Runtime 更新能力失败。")}).finally(()=>{H===bs.current&&!Ce.signal.aborted&&Ae(!1)}),()=>Ce.abort()},[l,re==null?void 0:re.region,re==null?void 0:re.runtimeId,un]);const ft=g.useMemo(()=>{const H=new Map(e.map((fe,Ce)=>[fe.id,Ce])),le=new Map(n.map((fe,Ce)=>[fe,Ce]));return[...ol].sort((fe,Ce)=>{const Ge=fe.runtimeId?Ha.get(fe.runtimeId):void 0,_t=Ce.runtimeId?Ha.get(Ce.runtimeId):void 0,zn=(Ge==null?void 0:Ge.status)==="running"?Ge.startedAt:0,dl=(_t==null?void 0:_t.status)==="running"?_t.startedAt:0;if(zn!==dl)return dl-zn;const dn=le.get(fe.id),vi=le.get(Ce.id);return dn!=null&&vi!=null?dn-vi:dn!=null?-1:vi!=null?1:(H.get(fe.id)??0)-(H.get(Ce.id)??0)})},[n,e,ol,Ha]),xs=(re==null?void 0:re.label)||(sn==null?void 0:sn.name)||(yt==null?void 0:yt.draft.name)||(Sn==null?void 0:Sn.runtimeName)||"未选择智能体",Bs=Ns.find(H=>H.id===Ut),Us=ft.filter(H=>H.canDelete===!0),Mi=ft.filter(H=>nt.has(H.id)&&H.canDelete===!0),xi=nr.filter(H=>qn.has(H.id)),fa=Us.length+nr.length,Xn=Mi.length+xi.length,Pn=g.useMemo(()=>(Sn==null?void 0:Sn.agentDraft)??(yt==null?void 0:yt.draft)??(ks==null?void 0:ks.draft)??Z_e(sn,(re==null?void 0:re.label)??"agent"),[sn,re==null?void 0:re.label,ks==null?void 0:ks.draft,yt==null?void 0:yt.draft,Sn==null?void 0:Sn.agentDraft]),Rt=yt?a?"":"当前账号没有新建 Agent 的权限。":l?re!=null&&re.runtimeId?re.region?We?"正在检查 Runtime 更新能力…":Ke||(Ct?Ct.canUpdate?(qu=Ct.agent)!=null&&qu.appName?"":"Runtime 更新能力响应缺少智能体信息。":Ct.reason||"当前 Runtime 不支持原地更新。":"尚未完成 Runtime 更新能力检查。"):"Runtime 缺少地域信息,无法更新。":"仅支持更新已部署的云端智能体。":"当前账号没有管理 Agent 的权限。",po="aw-update-disabled-reason",AE=Ct!=null&&Ct.agent?{runtimeId:Ct.runtime.runtimeId,name:Ct.runtime.name,region:Ct.runtime.region,appName:Ct.agent.appName,currentVersion:Ct.runtime.currentVersion}:ks==null?void 0:ks.deploymentTarget,e0=g.useMemo(()=>{if(sn)return sn.tools;const H=(Pn.builtinTools??[]).map(le=>{var fe;return((fe=ju.find(Ce=>Ce.id===le))==null?void 0:fe.label)??le});return Array.from(new Set([...Pn.tools,...H,...(Pn.customTools??[]).map(le=>le.name),...(Pn.mcpTools??[]).map(le=>le.name)].filter(Boolean)))},[Pn,sn]),$u=g.useMemo(()=>sn?sn.skillsPreviewSupported?sn.skills.map(H=>H.name):null:Array.from(new Set([...(Pn.selectedSkills??[]).map(H=>H.name),...Pn.skills].filter(Boolean))),[Pn,sn]),Ei=g.useMemo(()=>{if(Sn)return Sn;if(yt)return d.filter(H=>{var le,fe;return((le=H.agentDraft)==null?void 0:le.name)===yt.draft.name||H.runtimeName===yt.draft.name||!!((fe=yt.deploymentTarget)!=null&&fe.runtimeId)&&H.runtimeId===yt.deploymentTarget.runtimeId}).sort((H,le)=>le.startedAt-H.startedAt)[0];if(re)return d.filter(H=>!!re.runtimeId&&H.runtimeId===re.runtimeId||H.runtimeName===re.label).sort((H,le)=>le.startedAt-H.startedAt)[0]},[d,re,yt,Sn]),Ec=!!(f&&Ei&&Ei.id===f),Th=!!(Ei&&(Ei.status!=="success"||Ec)),t0=g.useMemo(()=>rSe(Pn),[Pn]),ll=(re==null?void 0:re.currentVersion)??(O==null?void 0:O.currentVersion)??null,CE=ll??(Sn==null?void 0:Sn.startedAt)??"unknown",Hu=sn?`runtime:${(re==null?void 0:re.runtimeId)??sn.name}:v${CE}:${t0}`:`draft:${(Sn==null?void 0:Sn.id)??(yt==null?void 0:yt.id)??(re==null?void 0:re.id)??xs}:${t0}`;g.useEffect(()=>{if(!f)return;const H=d.find(fe=>fe.id===f),le=H!=null&&H.runtimeId?gn.get(H.runtimeId):void 0;if(le){$(""),I(le.id),F("basic");return}I(""),$(""),F("basic")},[gn,d,f]),g.useEffect(()=>{if(!h){$n.current="";return}const H=`${h}:${m}:${p}`;$n.current!==H&&e.some(le=>le.id===h)&&($n.current=H,$(""),I(h),F(m),m==="evaluations"&&(ct(p),Et("")))},[e,h,m,p]),g.useEffect(()=>{for(const H of ft.slice(0,8)){if(!H.runtimeId)continue;const le=H.region??"cn-beijing";B8(H.runtimeId,le),_8(H.runtimeId,le,H.runtimeApp??""),l1(H.runtimeId,le,H.runtimeApp??"").then(fe=>{const Ce=fe.appName||H.app;Ce&&LS({runtimeId:H.runtimeId??"",region:le,appName:Ce,pageSize:100})}).catch(()=>{})}},[ft]),g.useEffect(()=>{!(re!=null&&re.runtimeId)||!As||LS({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:As,pageSize:100})},[As,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),g.useEffect(()=>{let H=!1;const le=(re==null?void 0:re.runtimeId)??"",fe=(re==null?void 0:re.region)??"cn-beijing",Ce=(re==null?void 0:re.runtimeApp)??"",Ge=le?w8(le,fe,Ce):null;if(oe(Ge),Ee(!!Ge||!v||!le),!(!v||!le))return l1(le,fe,Ce,{force:!0}).then(_t=>{H||oe(_t)}).catch(()=>{!H&&!Ge&&oe(null)}).finally(()=>{H||Ee(!0)}),()=>{H=!0}},[v,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeApp,re==null?void 0:re.runtimeId]),g.useEffect(()=>{let H=!1;const le=(re==null?void 0:re.runtimeId)??"",fe=(re==null?void 0:re.region)??"cn-beijing";if(Ls([]),Ss(""),L!=="optimizations"||!le){Ds(!1);return}if(v&&!As){Ds(!Z);return}return Ds(!0),l8({runtimeId:le,region:fe,appName:As}).then(Ce=>{H||Ls(Ce.groups)}).catch(Ce=>{H||Ss(Ce instanceof Error?Ce.message:String(Ce))}).finally(()=>{H||Ds(!1)}),()=>{H=!0}},[Z,v,Ps,L,As,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),g.useEffect(()=>{ys.current+=1,we(null),Se(!1),pe(!1),et(""),ye("api-server")},[za,L]);function n0(){ys.current+=1,we(null),Se(!1),pe(!1),et("")}function kh(H){H!==he&&(n0(),ye(H))}async function s0(){if(De){n0();return}const H=(re==null?void 0:re.runtimeId)??"",le=(re==null?void 0:re.region)??"cn-beijing";if(!H)return;const fe=ys.current+1;ys.current=fe,pe(!0),et("");try{const Ce=await M8(H,le);if(fe!==ys.current)return;we({requestKey:za,value:Ce}),Se(!0)}catch(Ce){if(fe!==ys.current)return;we(null),Se(!1),et(Ce instanceof Error?Ce.message:"读取 Runtime API Key 失败。")}finally{fe===ys.current&&pe(!1)}}g.useEffect(()=>{let H=!1;const le=(re==null?void 0:re.runtimeId)??"",fe=(re==null?void 0:re.region)??"cn-beijing",Ce=le?P8(le,fe):null;if(te(Ce),!!le)return h2(le,fe,{force:!0}).then(Ge=>{H||te(Ge)}).catch(()=>{!H&&!Ce&&te(null)}),()=>{H=!0}},[re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),g.useEffect(()=>{let H=!1;const le=(re==null?void 0:re.runtimeId)??"",fe=(re==null?void 0:re.region)??"cn-beijing",Ce=`${fe}:${le}`;if(X(""),L!=="integrations"||!le){ee(!1),le||P(null);return}ee(!0);const Ge=f2(le,fe,{retryProbe:!0}).catch(_t=>{if(_t instanceof Ir&&_t.unsupported)return null;throw _t});return Promise.all([Ge,O8(le,fe,{retryProbe:!0})]).then(([_t,zn])=>{H||P({requestKey:Ce,apiApps:_t,a2a:zn})}).catch(_t=>{H||(P(null),X(_t instanceof Error?_t.message:"探测集成方式失败。"))}).finally(()=>{H||ee(!1)}),()=>{H=!0}},[K,L,re==null?void 0:re.currentVersion,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),g.useEffect(()=>{let H=!1;const le=(re==null?void 0:re.runtimeId)??"",fe=(re==null?void 0:re.region)??"cn-beijing",Ce=le&&As?c8({runtimeId:le,region:fe,appName:As,pageSize:100}):null;if(Ht(Ce?y3(Ce):[]),Os((Ce==null?void 0:Ce.sets)??[]),Yn(""),L!=="evaluations"||!le){wn(!1);return}if(v&&!As){wn(!Z);return}return wn(!Ce),Sx({runtimeId:le,region:fe,appName:As,pageSize:100},{force:!0}).then(Ge=>{H||(Os(Ge.sets),Ht(y3(Ge)))}).catch(Ge=>{H||Yn(Ge instanceof Error?Ge.message:String(Ge))}).finally(()=>{H||wn(!1)}),()=>{H=!0}},[Z,v,Wn,L,As,sn==null?void 0:sn.appName,re==null?void 0:re.region,re==null?void 0:re.runtimeId]),g.useEffect(()=>{const H=new Set(vn.map(le=>le.id));on(le=>{const fe=new Set([...le].filter(Ce=>H.has(Ce)));return fe.size===le.size?le:fe}),mt(le=>{const fe=new Set([...le].filter(Ce=>H.has(Ce)));return fe.size===le.size?le:fe}),Me&&!H.has(Me)&&Xe("")},[vn,Me]),g.useEffect(()=>{Dn(!1),on(new Set),mt(new Set),Ie(""),Xe("")},[re==null?void 0:re.runtimeId]),g.useEffect(()=>{const H=new Set(ft.filter(le=>le.canDelete===!0).map(le=>le.id));$t(le=>{const fe=new Set([...le].filter(Ce=>H.has(Ce)));return fe.size===le.size?le:fe})},[ft]),g.useEffect(()=>{const H=new Set(nr.map(le=>le.id));nn(le=>{const fe=new Set([...le].filter(Ce=>H.has(Ce)));return fe.size===le.size?le:fe})},[nr]);const Er=g.useMemo(()=>!b||!(re!=null&&re.runtimeId)||b.runtimeId!==re.runtimeId||As&&b.agentName&&b.agentName!==As?null:{...b,tag:b.kind==="good"?"Good case":"Bad case"},[b,re==null?void 0:re.runtimeId,As]),zu=g.useMemo(()=>re!=null&&re.runtimeId?Er?[Er,...vn.filter(H=>H.id!==Er.id&&(!H.messageId||H.messageId!==Er.messageId))]:vn:K_e,[vn,Er,re==null?void 0:re.runtimeId]),go=zu.filter(H=>{if(H.kind!==Lt||(H.source==="auto"?"auto":"user")!==vt)return!1;const fe=yn.trim().toLowerCase();return fe?[H.input,H.output,H.referenceOutput,H.comment,H.tag??"",H.sessionId,H.messageId,H.userId,H.evaluationSetName].join(" ").toLowerCase().includes(fe):!0}),cl=go.filter(H=>pn.has(H.id)),i0=!!(re!=null&&re.runtimeId),ul=H=>{ct(H),Et(""),Ie("");const le=zu.find(fe=>fe.kind===H);Xe((le==null?void 0:le.id)??""),window.setTimeout(()=>{var fe;(fe=Le.current)==null||fe.scrollIntoView({behavior:"smooth",block:"start"})},0)},IE=H=>{Ie(""),on(le=>{const fe=new Set(le);return fe.has(H.id)?fe.delete(H.id):fe.add(H.id),fe})},Qn=()=>{Ie(""),on(new Set(go.map(H=>H.id)))},jE=()=>{Ie(""),on(new Set),Dn(!1)},RE=H=>{mt(le=>{const fe=new Set(le);return fe.has(H)?fe.delete(H):fe.add(H),fe})},OE=H=>{Xe(H.id),Ie(""),!(!H.sessionId||!H.messageId)&&(k==null||k(H))},Li=async H=>{if(!(re!=null&&re.runtimeId)||!As||Yt||H.length===0)return;const le=H.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${H.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(le))return;const fe=H.map(Ge=>Ge.id),Ce=new Set(fe);_n(!0),Ie("");try{await f8({runtimeId:re.runtimeId,region:re.region??"cn-beijing",appName:As,itemIds:fe});const Ge=new Map;for(const _t of H)Ge.set(_t.kind,(Ge.get(_t.kind)??0)+1);Ht(_t=>_t.filter(zn=>!Ce.has(zn.id))),Os(_t=>_t.map(zn=>({...zn,itemCount:Math.max(0,zn.itemCount-(Ge.get(zn.kind)??0))}))),on(_t=>new Set([..._t].filter(zn=>!Ce.has(zn)))),mt(_t=>new Set([..._t].filter(zn=>!Ce.has(zn)))),Me&&Ce.has(Me)&&Xe(""),H.length>1&&Dn(!1),T==null||T(H)}catch(Ge){Ie(Ge instanceof Error?Ge.message:String(Ge))}finally{_n(!1)}},Ah=H=>{en(le=>le.map(fe=>fe.id===H.id?H:fe))},Vu=()=>{const H=new Set(e.map(Ce=>Ce.id)),le=n.filter(Ce=>H.has(Ce)),fe=new Set(le);return[...le,...e.filter(Ce=>!fe.has(Ce.id)).map(Ce=>Ce.id)]},ME=(H,le,fe)=>{if(!x||H===le)return;const Ce=Vu().filter(zn=>zn!==H),Ge=Ce.indexOf(le),_t=Ge<0?Ce.length:fe==="after"?Ge+1:Ge;Ce.splice(_t,0,H),x(Ce)},r0=(H,le)=>{if(!Vt||Vt===le)return;const fe=H.currentTarget.getBoundingClientRect();dt(le),St(H.clientY>fe.top+fe.height/2?"after":"before")},Gu=(H,le)=>{if(!x)return;const fe=Vu(),Ce=fe.indexOf(H),Ge=Math.max(0,Math.min(fe.length-1,Ce+le));Ce<0||Ce===Ge||(fe.splice(Ce,1),fe.splice(Ge,0,H),x(fe))},Ch=H=>{H.canDelete===!0&&(Bt(""),$t(le=>{const fe=new Set(le);return fe.has(H.id)?fe.delete(H.id):fe.add(H.id),fe}))},Ih=H=>{Bt(""),nn(le=>{const fe=new Set(le);return fe.has(H.id)?fe.delete(H.id):fe.add(H.id),fe})},LE=()=>{Bt(""),$t(new Set(Us.map(H=>H.id))),nn(new Set(nr.map(H=>H.id)))},a0=()=>{Bt(""),$t(new Set),nn(new Set),$e(!1)},bo=()=>{if(Xn===0||qt)return;const H=Mi.length,le=xi.length;Bt(""),En({kind:"selection",title:H===1&&le===0?"删除 Agent?":H===0&&le===1?"删除草稿?":"删除所选项目?",description:H===1&&le===0?`"${Mi[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`:H===0&&le===1?`"${xi[0].draft.name||"未命名 Agent"}" 将从本地草稿中删除。`:`将删除选中的 ${Xn} 个项目。${H>0?`${H} 个云端 Runtime 将被永久删除,此操作不可撤销。`:"草稿删除后无法恢复。"}`,confirmLabel:H===0&&le===1?"删除草稿":"删除所选",agents:Mi,drafts:xi})},zt=async()=>{if(!(!Tt||qt)){mn(!0),Bt("");try{if(Tt.kind==="selection"){const{agents:H,drafts:le}=Tt;if(H.length>0){if(!E)throw new Error("当前页面不支持删除已部署 Agent。");await E(H)}le.length>0&&(w==null||w(le)),$t(new Set),nn(new Set),$e(!1),H.some(fe=>fe.id===C)&&I(""),le.some(fe=>fe.id===D)&&$("")}else if(Tt.kind==="agent"){if(!E)throw new Error("当前页面不支持删除已部署 Agent。");await E([Tt.agent]),C===Tt.agent.id&&I("")}else{if(!w)throw new Error("当前页面不支持删除草稿。");w([Tt.draft]),D===Tt.draft.id&&$("")}En(null)}catch(H){Bt(H instanceof Error?H.message:String(H))}finally{mn(!1)}}},o0=H=>{!E||H.canDelete!==!0||qt||(Bt(""),En({kind:"agent",title:"删除 Agent?",description:`"${H.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`,confirmLabel:"删除 Agent",agent:H}))},l0=H=>{if(!w||qt)return;const le=H.draft.name||"未命名 Agent";Bt(""),En({kind:"draft",title:"删除草稿?",description:`"${le}" 将从本地草稿中删除。`,confirmLabel:"删除草稿",draft:H})},DE=()=>{const H=`eval-${Date.now()}`,le={id:H,name:`新评测组 ${Ns.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};en(fe=>[le,...fe]),Oi(H)},jh=H=>{Ah({...H,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+H.history.length%7,status:"completed"},...H.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${v?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:B==="library"?"is-active":"","aria-pressed":B==="library",onClick:()=>{z("library"),at("")},children:"智能体库"}),o.jsx("button",{type:"button",className:B==="evaluation"?"is-active":"","aria-pressed":B==="evaluation",onClick:()=>{z("evaluation"),at("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":B==="evaluation"||void 0,ref:H=>{H==null||H.toggleAttribute("inert",B==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":B==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(e1,{"aria-hidden":!0}),o.jsx("input",{value:Oe,onChange:H=>at(H.currentTarget.value),placeholder:B==="library"?"搜索智能体":"搜索评测组","aria-label":B==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:B==="library"?A:DE,disabled:B==="library"&&!a,children:[o.jsx(Ii,{"aria-hidden":!0}),o.jsx("span",{children:B==="library"?"新建 Agent":"新建评测组"})]}),B==="library"&&(E||w)&&o.jsx("div",{className:`aw-selection-toolbar${ge?" is-active":""}`,children:ge?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Xn," 个"]}),o.jsx("button",{type:"button",onClick:LE,disabled:fa===0||qt,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void bo(),disabled:Xn===0||qt,children:qt?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:a0,disabled:qt,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{Bt(""),$e(!0)},disabled:fa===0,children:"选择"})}),B==="library"&&wt&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:wt}),o.jsx("div",{className:"aw-agent-list",children:B==="evaluation"?xc.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):xc.map(H=>o.jsxs("button",{type:"button",className:`aw-agent-item${H.id===Ut?" is-active":""}`,onClick:()=>Oi(H.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:H.name}),o.jsxs("small",{children:[H.agentIds.length," 个智能体 · ",H.history.length," 次运行"]})]}),o.jsx(Wm,{"aria-hidden":!0})]},H.id)):c&&ft.length===0&&nr.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&ft.length===0&&nr.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),y&&o.jsx("button",{type:"button",onClick:y,children:"重试"})]}):ft.length===0&&nr.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[nr.map(H=>{const le=d.filter(Ce=>{var Ge,_t;return((Ge=Ce.agentDraft)==null?void 0:Ge.name)===H.draft.name||Ce.runtimeName===H.draft.name||!!((_t=H.deploymentTarget)!=null&&_t.runtimeId)&&Ce.runtimeId===H.deploymentTarget.runtimeId}).sort((Ce,Ge)=>Ge.startedAt-Ce.startedAt)[0],fe=qn.has(H.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",ge?"is-selecting":"",fe?"is-selected-for-delete":"",H.id===D?"is-active":""].filter(Boolean).join(" "),"aria-pressed":ge?fe:void 0,onClick:()=>{if(ge){Ih(H);return}I(""),$(H.id),F("basic")},children:[ge&&o.jsx("span",{className:`aw-select-marker${fe?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:H.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(le==null?void 0:le.status)==="running"?" is-deploying":""}`,children:(le==null?void 0:le.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:H.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Wm,{"aria-hidden":!0})]},H.id)}),ft.map(H=>{const le=H.runtimeId?Ha.get(H.runtimeId):void 0,fe=H.runtimeId?Ts.get(H.runtimeId):void 0,Ce=nt.has(H.id),Ge=H.canDelete===!0,_t=(le==null?void 0:le.status)==="running"?{label:"部署中",className:" is-deploying"}:(le==null?void 0:le.status)==="error"?{label:"失败",className:" is-error"}:(le==null?void 0:le.status)==="cancelled"?{label:"已取消",className:" is-muted"}:fe?{label:"待更新",className:""}:null,zn=(le==null?void 0:le.status)==="running"?"正在更新部署":fe?"待更新":H.remote?H.host||"远程智能体":"本地智能体",dl=["aw-agent-item","aw-agent-item--sortable",H.id===C?"is-active":"",ge?"is-selecting":"",Ce?"is-selected-for-delete":"",ge&&!Ge?"is-selection-disabled":"",H.id===Vt?"is-dragging":"",H.id===it&&H.id!==Vt?`is-drop-target is-drop-${He}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!x&&!ge,className:dl,"aria-pressed":ge?Ce:void 0,"aria-keyshortcuts":x?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:dn=>{x&&(bt.current=!0,Ft(H.id),dn.dataTransfer.effectAllowed="move",dn.dataTransfer.setData("text/plain",H.id))},onDragEnter:dn=>{r0(dn,H.id)},onDragOver:dn=>{!Vt||Vt===H.id||(dn.preventDefault(),dn.dataTransfer.dropEffect="move",r0(dn,H.id))},onDragLeave:dn=>{const vi=dn.relatedTarget;vi instanceof Node&&dn.currentTarget.contains(vi)||it===H.id&&dt("")},onDrop:dn=>{dn.preventDefault();const vi=dn.dataTransfer.getData("text/plain")||Vt;ME(vi,H.id,He),Ft(""),dt(""),St("before")},onDragEnd:()=>{Ft(""),dt(""),St("before"),window.setTimeout(()=>{bt.current=!1},0)},onKeyDown:dn=>{dn.altKey&&(dn.key==="ArrowUp"?(dn.preventDefault(),Gu(H.id,-1)):dn.key==="ArrowDown"&&(dn.preventDefault(),Gu(H.id,1)))},onClick:dn=>{if(ge){dn.preventDefault(),Ch(H);return}if(bt.current){dn.preventDefault(),bt.current=!1;return}$(""),I(H.id),F("basic"),S(H.id)},children:[ge&&o.jsx("span",{className:`aw-select-marker${Ce?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:H.label}),H.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",H.currentVersion]}),_t&&o.jsx("span",{className:`aw-draft-badge${_t.className}`,children:_t.label})]}),o.jsx("small",{children:zn})]}),o.jsx(Wm,{"aria-hidden":!0})]},H.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",B==="library"?e.length+Fu:Ns.length," 个"]})]}),B==="evaluation"&&Bs?o.jsx(gSe,{group:Bs,agents:e,cases:zu,onChange:Ah,onRun:jh}):B==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!re&&!yt&&!Sn?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[re&&!sn&&r&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),L==="integrations"&&Q&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在探测接入方式"}),o.jsx("small",{children:"正在确认 API Server 与 A2A…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:xs}),ll!=null&&o.jsxs("span",{children:["v",ll]}),yt&&o.jsx("span",{children:"草稿"}),ks&&o.jsx("span",{children:"待更新"}),!re&&!yt&&Sn&&o.jsx("span",{children:Sn.label})]}),o.jsx("p",{children:Pn.description||(r||v&&!Z?"正在读取智能体信息…":"暂无描述")})]}),(yt||ks||(re==null?void 0:re.canDelete))&&o.jsxs("div",{className:"aw-head-actions",children:[(yt||ks)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const H=yt??ks;H&&l0(H)},disabled:qt,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(lc,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(re==null?void 0:re.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete",onClick:()=>void o0(re),disabled:qt,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(lc,{"aria-hidden":!0}),o.jsx("span",{children:qt?"删除中…":"删除 Agent"})]})]})]}),Ei&&Th&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(dSe,{task:Ei})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",role:"tablist",children:rd.map(H=>o.jsx("button",{type:"button",id:`agent-${H.id}-tab`,className:L===H.id?"is-active":"",role:"tab","aria-selected":L===H.id,"aria-controls":`agent-${H.id}-panel`,tabIndex:L===H.id?0:-1,onClick:()=>F(H.id),onKeyDown:le=>{var _t;if(!["ArrowLeft","ArrowRight","Home","End"].includes(le.key))return;le.preventDefault();const fe=rd.findIndex(zn=>zn.id===H.id),Ce=le.key==="Home"?0:le.key==="End"?rd.length-1:(fe+(le.key==="ArrowRight"?1:-1)+rd.length)%rd.length,Ge=rd[Ce];F(Ge.id),(_t=document.getElementById(`agent-${Ge.id}-tab`))==null||_t.focus()},children:H.label},H.id))}),o.jsxs("div",{className:"aw-content",id:`agent-${L}-panel`,role:"tabpanel","aria-labelledby":`agent-${L}-tab`,children:[L==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(O==null?void 0:O.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(O==null?void 0:O.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(O==null?void 0:O.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(O==null?void 0:O.region)||(re==null?void 0:re.region)||(Ei==null?void 0:Ei.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:O!=null&&O.networkTypes.length?O.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(Kp,{draft:Pn,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},Hu)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(sn==null?void 0:sn.model)||Pn.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:sn!=null&&sn.graph?uH(sn.graph):dH(Pn)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:e0.length?e0.map(H=>o.jsx("span",{children:H},H)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:$u===null?"暂不支持预览":$u.length?$u.map(H=>o.jsx("span",{children:H},H)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:ll!=null?`v${ll}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:yt?"草稿":(Ei==null?void 0:Ei.status)==="error"?"部署失败":(Ei==null?void 0:Ei.status)==="cancelled"?"已取消":ks?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]})]}),L==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:"接入方式"}),o.jsx("p",{children:"仅展示当前 Runtime 可确认的公开协议与地址。"})]}),V&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:V}),o.jsx("button",{type:"button",onClick:()=>ce(H=>H+1),children:"重试"})]}),!V&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${he==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":"接入协议",children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),am.map((H,le)=>o.jsx("button",{type:"button",id:`integration-${H.id}-tab`,role:"tab","aria-selected":he===H.id,"aria-controls":`integration-${H.id}-panel`,tabIndex:he===H.id?0:-1,onClick:()=>kh(H.id),onKeyDown:fe=>{var _t;if(!["ArrowLeft","ArrowRight","Home","End"].includes(fe.key))return;fe.preventDefault();const Ce=fe.key==="Home"?0:fe.key==="End"?am.length-1:(le+(fe.key==="ArrowRight"?1:-1)+am.length)%am.length,Ge=am[Ce];kh(Ge.id),(_t=document.getElementById(`integration-${Ge.id}-tab`))==null||_t.focus()},children:H.label},H.id))]}),he==="api-server"?o.jsx(b3,{protocol:"api-server",title:"API Server",available:Gi,fields:[{label:"Agent",value:Gi?((ai=Hn==null?void 0:Hn.apiApps)==null?void 0:ai.join("、"))??"":""},{label:"发现接口",value:Gi?Pw(be,"/list-apps"):""},{label:"调用接口",value:Gi?Pw(be,"/run_sse"):""},{label:"鉴权方式",value:Gi?p3(O==null?void 0:O.authType):""},{label:"API Key",value:o.jsx(g3,{available:Gi,authType:O==null?void 0:O.authType,value:mo,visible:De&&!!mo,loading:ae,error:_e,onToggle:()=>void s0()})}],example:Gi?W_e(be,Ne,O==null?void 0:O.authType):""}):o.jsx(b3,{protocol:"a2a",title:"A2A",available:se,fields:[{label:"Agent",value:((Rh=Hn==null?void 0:Hn.a2a)==null?void 0:Rh.name)??""},{label:"Agent Card",value:se?Pw(be,"/.well-known/agent-card.json"):""},{label:"调用地址",value:st},{label:"鉴权方式",value:se?p3(O==null?void 0:O.authType):""},{label:"API Key",value:o.jsx(g3,{available:se,authType:O==null?void 0:O.authType,value:mo,visible:De&&!!mo,loading:ae,error:_e,onToggle:()=>void s0()})}],example:se?X_e(st,O==null?void 0:O.authType):""})]})]}),L==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(re==null?void 0:re.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(H=>{const le=iSe(os,H),fe=zu.filter(Ge=>Ge.kind===H).length,Ce=Er?fe:(le==null?void 0:le.itemCount)??fe;return o.jsxs("button",{type:"button",onClick:()=>ul(H),children:[o.jsx("strong",{children:Ce}),o.jsx("span",{children:H==="good"?"Good cases":"Bad cases"})]},H)})}),o.jsxs("div",{className:"aw-case-filter-bar",children:[o.jsxs("div",{className:"aw-case-filter-stack",children:[o.jsx("div",{className:"aw-case-filters","aria-label":"案例结果筛选",children:["good","bad"].map(H=>o.jsx("button",{type:"button",className:Lt===H?"is-active":"","aria-pressed":Lt===H,onClick:()=>ct(H),children:H==="good"?"Good case":"Bad case"},H))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":"回流方式筛选",children:["auto","user"].map(H=>o.jsx("button",{type:"button",className:vt===H?"is-active":"","aria-pressed":vt===H,onClick:()=>xn(H),children:H==="auto"?"自动回流":"手动回流"},H))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(e1,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:yn,onChange:H=>Et(H.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]})]}),i0&&o.jsx("div",{className:`aw-case-toolbar${gs?" is-active":""}`,children:gs?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",cl.length," 条"]}),o.jsx("button",{type:"button",onClick:Qn,disabled:go.length===0||Yt,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void Li(cl),disabled:cl.length===0||Yt,children:Yt?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:jE,disabled:Yt,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{Ie(""),Dn(!0)},disabled:go.length===0||Yt,children:"选择案例"})}),de&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:de}),o.jsx("div",{ref:Le,children:o.jsx(pSe,{cases:go,loading:Ms&&go.length===0,error:ls,runtimeBacked:!!(re!=null&&re.runtimeId),selectionMode:gs,selectedCaseIds:pn,focusedCaseId:Me,expandedCaseIds:ot,deleting:Yt,canDelete:i0,onOpenCase:OE,onToggleCase:IE,onToggleExpanded:RE,onDeleteCase:H=>void Li([H]),onRetry:()=>ri(H=>H+1)})})]}),L==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"根据评测结果汇总需要优先处理的改进建议。"})]}),Ln?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在读取优化项"})]}):Cn?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:Cn}),o.jsx("button",{type:"button",onClick:()=>cs(H=>H+1),children:"重试"})]}):ps.length>0?o.jsx(hSe,{groups:ps}):o.jsx("div",{className:"aw-optimization-state",children:"暂无优化项,自动评测完成后会在这里生成建议。"})]})]}),L==="basic"&&(re||yt)&&o.jsxs("div",{className:"aw-basic-actions",children:[re&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>_==null?void 0:_(re),children:[o.jsx(Yee,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsxs("span",{className:`aw-update-wrap${Rt?" is-disabled":""}`,tabIndex:Rt?0:void 0,"aria-describedby":Rt?po:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!Rt,"aria-busy":We||void 0,"aria-describedby":Rt?po:void 0,onClick:()=>{var H;return yt?R==null?void 0:R(yt):ks?R==null?void 0:R({...ks,deploymentTarget:AE}):Ct?j(((H=Ct.agent)==null?void 0:H.draft)??Pn,Ct):void 0},children:We?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:"检测中"})]}):yt||ks?"继续编辑":"更新"}),Rt&&o.jsx("span",{id:po,className:"aw-update-disabled-reason",role:"tooltip",children:Rt})]})]})]})]}),B==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]}),Tt&&o.jsx(pA,{variant:"danger",title:Tt.title,description:Tt.description,confirmLabel:qt?"删除中...":Tt.confirmLabel,closeLabel:"关闭删除确认",busy:qt,onCancel:()=>En(null),onConfirm:()=>void zt()})]})}function hSe({groups:e}){return o.jsx("div",{className:"aw-optimization-table-wrap",children:o.jsxs("table",{className:"aw-optimization-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:"修复优先级"}),o.jsx("th",{scope:"col",children:"建议优化模块"}),o.jsx("th",{scope:"col",children:"优化建议和理由"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("span",{className:`aw-priority is-${t.priority}`,children:tSe(t.priority)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:sSe(t)})}),o.jsx("td",{children:o.jsx("ul",{className:"aw-optimization-list",children:t.items.map(n=>o.jsxs("li",{children:[o.jsx("strong",{children:n.suggestion}),o.jsx("p",{children:n.reason})]},`${n.suggestion}:${n.reason}`))})})]},`${t.priority}:${t.module}:${t.customModule??""}`))})]})})}function mSe(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.5 7h15"}),o.jsx("path",{d:"M9 7V4.8h6V7"}),o.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),o.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function pSe({cases:e,loading:t=!1,error:n="",runtimeBacked:s=!1,selectionMode:i=!1,selectedCaseIds:r,focusedCaseId:a="",expandedCaseIds:l,deleting:c=!1,canDelete:u=!1,onOpenCase:d,onToggleCase:f,onToggleExpanded:h,onDeleteCase:m,onRetry:p}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"评分"}),o.jsx("span",{children:"评分理由"}),o.jsx("span",{className:"aw-case-action-head",children:"操作"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),p&&o.jsx("button",{type:"button",onClick:p,children:"重试"})]}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:s?"暂无用户反馈案例":"没有匹配的案例"}):e.map(b=>{var k;const v=b.id.startsWith("local:"),y=(r==null?void 0:r.has(b.id))??!1,x=(l==null?void 0:l.has(b.id))??!1,w=b.output.length+b.referenceOutput.length>220||(((k=b.reason)==null?void 0:k.length)??0)>120,S=u&&!v,_=b.source==="auto";return o.jsxs("div",{className:["aw-case-row",a===b.id?"is-focused":"",i?"is-selecting":"",y?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":i?y:void 0,onClick:()=>{if(i){S&&(f==null||f(b));return}d==null||d(b)},onKeyDown:T=>{T.target===T.currentTarget&&(T.key!=="Enter"&&T.key!==" "||(T.preventDefault(),i?S&&(f==null||f(b)):d==null||d(b)))},children:[o.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":"用户输入",children:[o.jsxs("span",{className:"aw-case-title-line",children:[i&&S&&o.jsx("span",{className:`aw-select-marker${y?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:b.input,children:b.input||"无用户输入"})]}),b.comment&&o.jsxs("small",{title:b.comment,children:["备注:",b.comment]}),o.jsx("small",{className:"aw-case-time",children:J_e(b.createdAt)}),(b.userId||b.sessionId)&&o.jsx("small",{title:[b.userId,b.sessionId].filter(Boolean).join(" · "),children:[b.userId,b.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${x?" is-expanded":""}`,"data-label":"Agent 输出",children:[o.jsx("p",{className:"aw-case-output-preview",title:b.output,children:b.output||"无可见回复"}),b.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:b.referenceOutput,children:["Reference: ",b.referenceOutput]}),w&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:T=>{T.stopPropagation(),h==null||h(b.id)},children:x?"收起":"展开"})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":"评分",children:eSe(b)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${x?" is-expanded":""}`,"data-label":"评分理由",children:o.jsx("p",{title:_?b.reason:void 0,children:_?b.reason||"暂无评分理由":"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":"操作",children:S&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:T=>{T.stopPropagation(),m==null||m(b)},disabled:c,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(mSe,{})})})]},b.id)})]})}function gSe({group:e,agents:t,cases:n,onChange:s,onRun:i}){const[r,a]=g.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];g.useEffect(()=>a("config"),[e.id]);const u=f=>{s({...e,agentIds:e.agentIds.includes(f)?e.agentIds.filter(h=>h!==f):[...e.agentIds,f]})},d=f=>{s({...e,metrics:e.metrics.includes(f)?e.metrics.filter(h=>h!==f):[...e.metrics,f]})};return o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>i(e),disabled:!0,children:[o.jsx(Bee,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:r==="config"?"is-active":"","aria-pressed":r==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:r==="history"?"is-active":"","aria-pressed":r==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:r==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>s({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>s({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>s({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Pa,{}),"已完成"]}),o.jsx(Wm,{"aria-hidden":!0})]},f.id))})]})})]})}function mH(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let s=.985;n<=80?s=.96:n<=150?s=.97:n<=220?s=.98:n>600&&(s=.995),t.style.setProperty("--scale",s.toString())},MN=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!vSe||typeof window.requestAnimationFrame!="function"||gH&&document.visibilityState==="hidden")return n();let i=2,r=window.requestAnimationFrame(function a(){i-=1,i===0?e():r=window.requestAnimationFrame(a)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(r)}},wSe=e=>Object.keys(e).reduce((n,s)=>{const i=e[s];if(i||i===0){const r=s.startsWith("--")?"":"--",a=typeof i=="number"?`${i}px`:i;n[`${r}${s}`]=a}return n},{}),_Se=e=>{const t=g.Children.toArray(e),n=[];let s="";const i=()=>{s!==""&&(n.push(s),s="")};for(const r of t)if(!(r==null||typeof r=="boolean")){if(typeof r=="string"||typeof r=="number"){s+=String(r);continue}i(),n.push(r)}return i(),n},yH=e=>{const t=_Se(e),n=g.Children.count(t);return g.Children.map(t,s=>{if(typeof s=="string"&&s.trim())return n<=1?s:o.jsx("span",{children:s});if(g.isValidElement(s)){const i=s,{children:r,...a}=i.props;return r!=null?g.cloneElement(i,a,yH(r)):i}return s})};g.createContext(null);var SSe=typeof Ll=="object"&&Ll&&Ll.Object===Object&&Ll,NSe=typeof self=="object"&&self&&self.Object===Object&&self;SSe||NSe||Function("return this")();var TSe=typeof window<"u"?g.useLayoutEffect:g.useEffect;function kSe(){const e=g.useRef(!1);return g.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),g.useCallback(()=>e.current,[])}var x3={width:void 0,height:void 0};function ASe(e){const{ref:t,box:n="content-box"}=e,[{width:s,height:i},r]=g.useState(x3),a=kSe(),l=g.useRef({...x3}),c=g.useRef(void 0);return c.current=e.onResize,g.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=E3(d,f,"inlineSize"),m=E3(d,f,"blockSize");if(l.current.width!==h||l.current.height!==m){const b={width:h,height:m};l.current.width=h,l.current.height=m,c.current?c.current(b):a()&&r(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,a]),{width:s,height:i}}function E3(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function CSe(e,t){const n=g.useRef(e);TSe(()=>{n.current=e},[e]),g.useEffect(()=>{if(!t&&t!==0)return;const s=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(s)}},[t])}const ISe="_LoadingIndicator_7yl6f_1",jSe={LoadingIndicator:ISe},RSe=({className:e,size:t,strokeWidth:n,style:s,...i})=>o.jsx("div",{...i,className:da(jSe.LoadingIndicator,e),style:s||wSe({"indicator-size":t,"indicator-stroke":n})});function OSe(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const MSe=()=>pH,v3=(e,t=!1,n="TransitionGroup")=>{const s=[];return g.Children.forEach(e,i=>{if(i&&typeof i=="object"&&"key"in i&&i.key)s.push(i);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),s},ad=()=>{},od=e=>{const t=g.useRef(e);return t.current=e,g.useCallback(n=>t.current(n),[])};function LSe(e,t,n,s){const i=e.reduce((c,u)=>({...c,[u.key]:1}),{}),r=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),a=e.filter(c=>!r[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!i[c.component.key]}));return s==="append"?l.concat(a):a.concat(l)}function DSe(e,t,n){if((pH||ySe)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const PSe="_TransitionGroupChild_1hv1z_1",BSe={TransitionGroupChild:PSe},xH={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},USe=e=>({...xH,enter:!e}),FSe=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return xH}},$Se=({ref:e,as:t,children:n,className:s,transitionId:i,style:r,preventMountTransition:a,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:m,onExit:p,onExitActive:b,onExitComplete:v})=>{const[y,x]=g.useReducer(FSe,USe(a||!1)),E=g.useRef(!1),w=g.useRef(null),S=g.useRef(c);S.current=c;const _=g.useRef(u);_.current=u;const k=g.useRef(null),T=g.useCallback(A=>{const j=w.current;if(!(!j||A===k.current))switch(k.current=A,A){case"enter":f(j);break;case"enter-active":h(j);break;case"enter-complete":m(j);break;case"exit":p(j);break;case"exit-active":b(j);break;case"exit-complete":v(j);break}},[f,h,m,p,b,v]);return Pt.useLayoutEffect(()=>{if(!l){let R;x({type:"exit-before"}),T("exit");const B=MN(()=>{x({type:"exit-active"}),T("exit-active"),R=window.setTimeout(()=>{T("exit-complete"),d()},_.current)});return()=>{B(),R!==void 0&&clearTimeout(R)}}if(a&&!E.current){E.current=!0;return}let A;x({type:"enter-before"}),T("enter");const j=MN(()=>{x({type:"enter-active"}),T("enter-active"),A=window.setTimeout(()=>{x({type:"done"}),T("enter-complete")},S.current)});return()=>{j(),A!==void 0&&clearTimeout(A)}},[l,a,d,T]),g.useEffect(()=>()=>{E.current=!1},[]),o.jsx(t,{ref:OSe([w,e]),className:da(s,BSe.TransitionGroupChild),"data-transition-id":i,style:r,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},HSe=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,s=!n&&t!=null?t:null,[i,r]=g.useState(s==null);return CSe(()=>r(!0),i?null:s),i?o.jsx($Se,{...e}):null},zSe=e=>{const{ref:t,as:n="span",children:s,className:i,transitionId:r,style:a,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=MSe()}=e,m=od(e.onEnter??ad),p=od(e.onEnterActive??ad),b=od(e.onEnterComplete??ad),v=od(e.onExit??ad),y=od(e.onExitActive??ad),x=od(e.onExitComplete??ad);g.Children.forEach(s,_=>{if(_&&!_.key)throw new Error("Child elements of must include a `key`")});const E=g.useCallback(_=>({component:_,shouldRender:!0,removeChild:()=>{S(k=>k.filter(T=>_.key!==T.component.key))},onEnter:m,onEnterActive:p,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:x}),[m,p,b,v,y,x]),[w,S]=g.useState(()=>v3(s).map(_=>({...E(_),preventMountTransition:u})));return g.useLayoutEffect(()=>{S(_=>{const k=v3(s);return LSe(k,_,E,f)})},[s,f,E]),DSe("TransitionGroup",t,g.Children.count(s)),h?o.jsx(o.Fragment,{children:g.Children.map(s,_=>o.jsx(n,{ref:t,className:i,style:a,"data-transition-id":r,children:_}))}):o.jsx(o.Fragment,{children:w.map(({component:_,...k})=>o.jsx(HSe,{...k,as:n,className:i,transitionId:r,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:_},_.key))})},VSe="_Button_1864l_1",GSe="_ButtonInner_1864l_4",KSe="_ButtonLoader_1864l_749",Bw={Button:VSe,ButtonInner:GSe,ButtonLoader:KSe},w3=e=>{const{type:t="button",color:n="primary",variant:s="solid",pill:i=!0,uniform:r=!1,size:a="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:m,className:p,onClick:b,disabled:v,disabledTone:y,inert:x=u,...E}=e,w=v||x,S=g.useCallback(_=>{v||b==null||b(_)},[b,v]);return o.jsxs("button",{type:t,className:da(Bw.Button,p),"data-color":n,"data-variant":s,"data-pill":i?"":void 0,"data-uniform":r?"":void 0,"data-size":a,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:bH,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:S,...E,children:[o.jsx(zSe,{className:Bw.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(RSe,{},"loader")}),o.jsx("span",{className:Bw.ButtonInner,children:yH(m)})]})},qSe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),YSe="_EmptyMessage_1r5gu_1",WSe="_IconBadge_1r5gu_16",XSe="_Title_1r5gu_54",QSe="_Description_1r5gu_69",ZSe="_ActionRow_1r5gu_77",$g={EmptyMessage:YSe,IconBadge:WSe,Title:XSe,Description:QSe,ActionRow:ZSe},ts=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:da($g.EmptyMessage,t),"data-fill":n,children:e}),JSe=({size:e="md",color:t="secondary",children:n,className:s})=>o.jsx("div",{className:da($g.IconBadge,s),"data-size":e,"data-color":t,children:n}),eNe=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:da($g.Title,t),"data-color":n,children:e}),tNe=({children:e,className:t})=>o.jsx("div",{className:da($g.Description,t),children:e}),nNe=({children:e,className:t})=>o.jsx("div",{className:da($g.ActionRow,t),children:e});ts.Icon=JSe;ts.Title=eNe;ts.Description=tNe;ts.ActionRow=nNe;const cr="/web/sandbox/sessions",_3=3e4,S3=33e4,sNe=6e4,iNe=6e5,Uw=15e3,jo=6e4,rNe=33e4,N3=40;function sE(e){switch(e.trim().toLowerCase()){case"ready":return"就绪";case"creating":return"创建中";case"starting":case"initializing":return"启动中";case"pending":return"等待中";case"running":return"运行中";case"failed":case"error":return"异常";case"stopped":return"已停止";case"expired":return"已过期";case"deleting":return"删除中";case"deleted":return"已删除";default:return"未知状态"}}function oi(e){const t=xx(e);return t.has("Accept")||t.set("Accept","application/json"),t}async function li(e,t){const n=await e.text().catch(()=>"");let s={};try{s=JSON.parse(n)}catch{const c=`${t}(HTTP ${e.status})`;return new Error(n?`${c}:${n}`:c)}const i=s.detail,r=i&&typeof i=="object"&&"message"in i?i.message:i??s.error??s.message,a=typeof r=="string"?r:r==null?"":JSON.stringify(r),l=`${t}(HTTP ${e.status})`;return new Error(a?`${l}:${a}`:l)}function ld(e,t="codex"){if(!e.sessionId||!e.status)throw new Error("AgentKit 沙箱返回了无效的 Session 信息。");return{id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",toolType:e.toolType??"",createdBy:e.createdBy??"",threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:iE(e.permissions)}}const om={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function iE(e){if(!e||typeof e!="object")return{...om};const t=e,n=t.approvalPolicy,s=t.approvalsReviewer,i=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:om.approvalPolicy,approvalsReviewer:s==="user"||s==="auto_review"?s:om.approvalsReviewer,sandboxMode:i==="read-only"||i==="workspace-write"||i==="danger-full-access"?i:om.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:om.networkAccess}}function T3(e){if(!e||typeof e!="object")throw new Error("Sandbox 返回了无效设置。");const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:iE(t.permissions)}}function Ta(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function aNe(e){const t=Ta(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function oNe(e){const t=Ta(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function EH(e){const t=Ta(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function fb(e){const t=Ta(e),n=EH(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error("Sandbox 返回了无效 Thread 快照。");const s=t.messages.flatMap(i=>{const r=Ta(i);if(!r||typeof r.id!="string"||r.role!=="user"&&r.role!=="assistant"||typeof r.content!="string"||typeof r.timestamp!="number")return[];const a=Array.isArray(r.skillNames)?r.skillNames.filter(l=>typeof l=="string"&&!!l):[];return[{id:r.id,role:r.role,content:r.content,timestamp:r.timestamp,...a.length?{skillNames:a}:{}}]});return{thread:n,threadId:t.threadId,messages:s,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:iE(t.permissions)}}function LN(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(s=>typeof s!="number"||!Number.isFinite(s)||s<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function lNe(e){const t=LN(e.usage);if(!t||typeof e.turnId!="string")return;const n=LN(e.threadTotal),s=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof s=="number"&&Number.isFinite(s)&&s>=0?{modelContextWindow:Math.trunc(s)}:{}}}function cNe(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}async function uNe(e,t={}){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),s=new TextDecoder;let i="",r="";const a=[],l=new Map;let c;function u(){var m;(m=t.onBlocks)==null||m.call(t,a.map(p=>({...p})))}function d(m){r+=m;const p=a[a.length-1];(p==null?void 0:p.kind)==="text"?p.text+=m:a.push({kind:"text",text:m}),u()}function f(m){if(typeof m.id!="string"||m.kind!=="thinking"&&m.kind!=="tool"||m.status!=="running"&&m.status!=="done")return;const p=m.status==="done";let b;if(m.kind==="thinking"){if(typeof m.text!="string"||!m.text)return;b={kind:"thinking",text:m.text,done:p}}else{if(typeof m.name!="string"||!m.name)return;b={kind:"tool",name:m.name,args:m.args,response:m.response,done:p}}const v=l.get(m.id);v===void 0?(l.set(m.id,a.length),a.push(b)):a[v]=b,u()}function h(m){var y,x,E;let p="message";const b=[];for(const w of m.split(/\r?\n/))w.startsWith("event:")&&(p=w.slice(6).trim()),w.startsWith("data:")&&b.push(w.slice(5).trimStart());if(b.length===0)return;let v;try{v=JSON.parse(b.join(` -`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(p==="error")throw new Error(typeof v.message=="string"&&v.message?v.message:"沙箱对话失败,请稍后重试。");if(p==="activity"&&f(v),p==="approval"){const w=cNe(v);w&&((y=t.onApproval)==null||y.call(t,w))}if(p==="usage"){const w=lNe(v);w&&(c=w,(x=t.onUsage)==null||x.call(t,w))}p==="approval_resolved"&&typeof v.approvalId=="string"&&((E=t.onApprovalResolved)==null||E.call(t,v.approvalId)),p==="delta"&&typeof v.text=="string"&&d(v.text),p==="done"&&!r&&typeof v.text=="string"&&d(v.text)}for(;;){const{done:m,value:p}=await n.read();i+=s.decode(p,{stream:!m});const b=i.split(/\r?\n\r?\n/);if(i=b.pop()??"",b.forEach(h),m)break}if(i.trim()&&h(i),a.length===0)throw new Error("沙箱未返回有效回复,请重试。");return{text:r,blocks:a,...c?{usage:c}:{}}}async function qa(e,t,{method:n="GET",body:s,options:i={},fallback:r}){if(!e)throw new Error("缺少要操作的 AgentKit Session。");const a=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/${t}`),{method:n,headers:oi(s===void 0?void 0:{"Content-Type":"application/json"}),...s===void 0?{}:{body:JSON.stringify(s)},signal:Bn(i.signal,jo)});if(!a.ok)throw await li(a,r);return a.json()}const cn={async listSessions(e={}){const t=await fetch(Rn(cr),{method:"GET",headers:oi(),signal:Bn(e.signal,_3)});if(!t.ok)throw await li(t,"无法读取 Codex 智能体,请稍后重试。");const n=await t.json();if(!Array.isArray(n.sessions))throw new Error("AgentKit 沙箱返回了无效的 Session 列表。");return n.sessions.map(s=>ld(s))},async startSession(e={}){var n;const t=await fetch(Rn(cr),{method:"POST",headers:oi({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((n=e.displayName)==null?void 0:n.trim())??""}),signal:Bn(e.signal,S3)});if(!t.ok)throw await li(t,"无法启动 AgentKit 沙箱,请稍后重试。");return ld(await t.json())},async listAgentSessions(e,t={}){const n=await fetch(Rn(`/web/${e}/sessions`),{method:"GET",headers:oi(),signal:Bn(t.signal,_3)});if(!n.ok)throw await li(n,`无法读取 ${e} 智能体,请稍后重试。`);const s=await n.json();if(!Array.isArray(s.sessions))throw new Error(`AgentKit 返回了无效的 ${e} Session 列表。`);return s.sessions.map(i=>ld(i,e))},async startAgentSession(e,t={}){var s;const n=await fetch(Rn(`/web/${e}/sessions`),{method:"POST",headers:oi({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=t.displayName)==null?void 0:s.trim())??""}),signal:Bn(t.signal,S3)});if(!n.ok)throw await li(n,`无法创建 ${e} 智能体,请稍后重试。`);return ld(await n.json(),e)},async openAgentSession(e,t,n={}){if(!t)throw new Error("缺少要打开的 AgentKit Session。");const s=await fetch(Rn(`/web/${e}/sessions/${encodeURIComponent(t)}/open`),{method:"POST",headers:oi(),signal:Bn(n.signal,jo)});if(!s.ok)throw await li(s,`无法打开 ${e} 智能体。`);const i=await s.json();if(typeof i.webuiUrl!="string"||!i.webuiUrl.startsWith("/"))throw new Error(`${e} 智能体返回了无效的主页面地址。`);return{session:ld(i,e),kind:e,webuiUrl:Rn(i.webuiUrl)}},async launchAgentTerminal(e,t,n={}){if(!t)throw new Error("缺少要打开 Terminal 的 AgentKit Session。");const s=await fetch(Rn(`/web/${e}/sessions/${encodeURIComponent(t)}/terminal`),{method:"POST",headers:oi(),signal:Bn(n.signal,jo)});if(!s.ok)throw await li(s,`无法打开 ${e} Terminal。`);const i=await s.json();return{url:vH(i.url,`${e} Terminal`),...typeof i.shellSessionId=="string"?{shellSessionId:i.shellSessionId}:{}}},async deleteAgentSession(e,t,n={}){if(!t)return;const s=await fetch(Rn(`/web/${e}/sessions/${encodeURIComponent(t)}`),{method:"DELETE",headers:oi(),signal:Bn(n.signal,Uw)});if(!s.ok&&s.status!==404)throw await li(s,`无法删除 ${e} 智能体。`)},async connectSession(e,t={}){if(!e)throw new Error("缺少要连接的 AgentKit Session。");const n=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/connect`),{method:"POST",headers:oi({"Content-Type":"application/json"}),signal:Bn(t.signal,sNe)});if(!n.ok)throw await li(n,"无法连接 Codex 智能体,请稍后重试。");const s=ld(await n.json());if(s.status.toLowerCase()!=="ready")throw new Error(`AgentKit Session 尚未就绪,当前状态:${s.status}。`);return s},async sendMessage(e,t={}){var s;if(!e.sessionId||!e.text.trim())throw new Error("内置智能体会话缺少有效的消息内容。");const n=await fetch(Rn(`${cr}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:oi({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text,...(s=e.skillIds)!=null&&s.length?{skillIds:e.skillIds}:{}}),signal:Bn(t.signal,iNe)});if(!n.ok)throw await li(n,"沙箱对话失败,请稍后重试。");return uNe(n,t)},async getStatus(e,t={}){const n=await qa(e,"status",{options:t,fallback:"无法读取 Codex 状态。"}),s=T3(n),i=Ta(n),r=LN(i==null?void 0:i.threadTotal),a=i==null?void 0:i.modelContextWindow;return{...s,...r?{threadTotal:r}:{},...typeof a=="number"&&Number.isFinite(a)&&a>=0?{modelContextWindow:Math.trunc(a)}:{}}},async listModels(e,t={}){const n=Ta(await qa(e,"models",{options:t,fallback:"无法读取 Codex 模型列表。"}));if(!Array.isArray(n==null?void 0:n.models))throw new Error("Sandbox 返回了无效模型列表。");return n.models.flatMap(s=>{const i=aNe(s);return i?[i]:[]})},async setModel(e,t,n={}){const s=Ta(await qa(e,"model",{method:"PUT",body:{model:t},options:n,fallback:"无法切换 Codex 模型。"}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error("Sandbox 返回了无效模型。");return s.model},async listSkills(e,t=!1,n={}){const i=Ta(await qa(e,`skills${t?"?force_reload=true":""}`,{options:n,fallback:"无法读取 Codex Skills。"}));if(!Array.isArray(i==null?void 0:i.skills))throw new Error("Sandbox 返回了无效 Skill 列表。");return i.skills.flatMap(r=>{const a=oNe(r);return a?[a]:[]})},async listThreads(e,t={},n={}){const s=new URLSearchParams;t.cursor&&s.set("cursor",t.cursor),t.search&&s.set("search",t.search),t.archived&&s.set("archived","true");const i=s.size?`?${s}`:"",r=Ta(await qa(e,`threads${i}`,{options:n,fallback:"无法读取 Codex Thread 列表。"}));if(!Array.isArray(r==null?void 0:r.threads))throw new Error("Sandbox 返回了无效 Thread 列表。");return{threads:r.threads.flatMap(a=>{const l=EH(a);return l?[l]:[]}),...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{}}},async newThread(e,t={}){return fb(await qa(e,"threads/new",{method:"POST",options:t,fallback:"无法创建新的 Codex Thread。"}))},async resumeThread(e,t,n={}){return fb(await qa(e,"threads/resume",{method:"POST",body:{threadId:t},options:n,fallback:"无法恢复 Codex Thread。"}))},async forkThread(e,t={}){return fb(await qa(e,"threads/fork",{method:"POST",options:t,fallback:"无法分叉 Codex Thread。"}))},async archiveThread(e,t,n={}){const s=Ta(await qa(e,"threads/archive",{method:"POST",body:{threadId:t},options:n,fallback:"无法归档 Codex Thread。"}));if((s==null?void 0:s.archived)!==!0)throw new Error("Sandbox 返回了无效归档结果。");return{archived:!0,...s.thread?{snapshot:fb(s)}:{}}},async compactThread(e,t={}){await qa(e,"threads/compact",{method:"POST",options:t,fallback:"无法压缩 Codex Thread。"})},async getSettings(e,t={}){const n=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/settings`),{method:"GET",headers:oi(),signal:Bn(t.signal,jo)});if(!n.ok)throw await li(n,"无法读取 Codex 权限与工作空间。");return T3(await n.json())},async updatePermissions(e,t,n={}){const s=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/permissions`),{method:"PUT",headers:oi({"Content-Type":"application/json"}),body:JSON.stringify(t),signal:Bn(n.signal,jo)});if(!s.ok)throw await li(s,"无法更新 Codex 权限。");const i=await s.json();return iE(i.permissions)},async updateWorkspace(e,t,n={}){const s=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/workspace`),{method:"PUT",headers:oi({"Content-Type":"application/json"}),body:JSON.stringify({cwd:t}),signal:Bn(n.signal,jo)});if(!s.ok)throw await li(s,"无法更新 Codex 工作空间。");const i=await s.json();if(typeof i.cwd!="string"||!i.cwd)throw new Error("Sandbox 返回了无效工作目录。");return i.cwd},async listDirectories(e,t,n={}){const s=new URLSearchParams({path:t}),i=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/directories?${s}`),{method:"GET",headers:oi(),signal:Bn(n.signal,jo)});if(!i.ok)throw await li(i,"无法读取 Sandbox 目录。");const r=await i.json();if(typeof r.path!="string"||!Array.isArray(r.directories)||r.directories.some(a=>!a||typeof a.name!="string"||typeof a.path!="string"))throw new Error("Sandbox 返回了无效目录列表。");return{path:r.path,...typeof r.parent=="string"?{parent:r.parent}:{},directories:r.directories}},async resolveApproval(e,t,n,s={}){const i=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/approvals/${encodeURIComponent(t)}`),{method:"POST",headers:oi({"Content-Type":"application/json"}),body:JSON.stringify({decision:n}),signal:Bn(s.signal,jo)});if(!i.ok)throw await li(i,"无法提交 Codex 审批决定。")},async launchTerminal(e,t={}){return k3(e,"terminal",t)},async launchBrowser(e,t={}){return k3(e,"browser",t)},async uploadFile(e,t,n={}){const s=new FormData;s.set("file",t,t.name);const i=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/files`),{method:"POST",headers:oi(),body:s,signal:Bn(n.signal,rNe)});if(!i.ok)throw await li(i,"无法上传文件到 Sandbox。");const r=await i.json();if(typeof r.id!="string"||typeof r.path!="string"||typeof r.name!="string"||typeof r.mimeType!="string"||typeof r.sizeBytes!="number")throw new Error("Sandbox 返回了无效上传结果。");return r},async closeSession(e,t={}){if(!e)return;const n=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/disconnect`),{method:"POST",headers:oi(),signal:Bn(t.signal,Uw)});if(!n.ok&&n.status!==404)throw await li(n,"无法断开 Codex 智能体连接。")},async deleteSession(e,t={}){if(!e)return;const n=await fetch(Rn(`${cr}/${encodeURIComponent(e)}`),{method:"DELETE",headers:oi(),signal:Bn(t.signal,Uw)});if(!n.ok&&n.status!==404)throw await li(n,"无法删除 Codex 智能体。")}};async function k3(e,t,n){const s=await fetch(Rn(`${cr}/${encodeURIComponent(e)}/${t}`),{method:"POST",headers:oi(),signal:Bn(n.signal,jo)});if(!s.ok)throw await li(s,t==="terminal"?"无法打开 Sandbox Terminal。":"无法打开 Sandbox Browser。");const i=await s.json();return{url:vH(i.url,"Sandbox 工具"),...typeof i.shellSessionId=="string"?{shellSessionId:i.shellSessionId}:{}}}function vH(e,t){if(typeof e!="string")throw new Error(`${t} 返回了无效地址。`);if(e.startsWith("/"))return Rn(e);let n;try{n=new URL(e)}catch{throw new Error(`${t} 返回了无效地址。`)}const s=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!s)throw new Error(`${t} 返回了不安全的地址。`);return n.toString()}function Vd(e,t,n){const s=e instanceof Error?`${e.name}: ${e.message}`:String(e||"未知错误");return[`${t}失败`,`详细信息:${s}`,n?`请求:${n}`:""].filter(Boolean).join(` -`)}function dNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),o.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function fNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),o.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),o.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),o.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function hNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),o.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),o.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),o.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function eg({kind:e,...t}){return e==="codex"?o.jsx(dNe,{...t}):e==="openclaw"?o.jsx(fNe,{...t}):o.jsx(hNe,{...t})}const Fw=[{id:"general",label:"通用智能体"},{id:"codex",label:"Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体"}],mNe=24,pNe=3e4,Gd=new Map,cf=new Map,gNe=new Set;function hb(e){if(!e){Gd.clear(),cf.clear();return}const t=new Set(e);if(t.size!==0){for(const[n,s]of cf)s.page.runtimes.some(i=>t.has(i.runtimeId))&&cf.delete(n);Gd.clear()}}function bNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function $w(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function yNe({type:e}){return e==="general"?o.jsx(tu,{}):o.jsx(eg,{kind:e})}function gA(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function A3(e){var t;return{id:e.runtimeId,name:e.name,description:((t=e.description)==null?void 0:t.trim())||"暂无描述",createdAt:gA(e.createdAt??""),specificationLabel:"创建人",specification:e.author||"—",isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}function xNe(e){return{id:e.id,name:e.displayName||`${e.toolName} 智能体`,description:sE(e.status),createdAt:gA(e.createdAt),specificationLabel:"创建人",specification:e.createdBy||"—",sandbox:e}}function ENe(e){var t;return{id:e.id,name:e.draft.name||"未命名 Agent",description:((t=e.draft.description)==null?void 0:t.trim())||"暂无描述",createdAt:gA(new Date(e.updatedAt).toISOString()),specificationLabel:"存储位置",specification:"当前浏览器",draft:e}}async function vNe(e,t,n){const s=`${e}:all:${t}`,i=cf.get(s);if(i&&i.expiresAt>Date.now())return n(i.page.runtimes.map(A3)),i.page.nextToken;i&&cf.delete(s);let r=Gd.get(s);r||(r=Nx({scope:e,region:"all",pageSize:mNe,nextToken:t}),Gd.set(s,r),r.then(()=>Gd.delete(s),()=>Gd.delete(s)));const a=await r;return cf.set(s,{page:a,expiresAt:Date.now()+pNe}),n(a.runtimes.map(A3)),a.nextToken}function wNe({agent:e,cloudProvider:t,onUse:n,onViewDetails:s,connecting:i,connected:r,showOwnership:a,deploymentTask:l,onViewDeploymentTask:c,onEditDraft:u,onDeleteDraft:d}){const f=!!(e.runtime||e.sandbox);return o.jsxs("article",{className:"my-agent-card",children:[o.jsxs("div",{className:"my-agent-card-content",children:[o.jsxs("div",{className:"my-agent-card-title",children:[o.jsxs("div",{className:"my-agent-card-title-copy",children:[o.jsx("h3",{children:e.name}),e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:e.sandbox.id,children:e.sandbox.id}):null]}),e.draft?o.jsx("span",{className:"my-agent-draft-badge",children:l?"部署中":"草稿"}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":e.sandbox.status.toLowerCase()==="ready"||void 0,children:e.description}):e.runtime?o.jsxs("div",{className:"my-agent-card-badges",children:[l?o.jsx("span",{className:"my-agent-deploying-badge",children:"部署中"}):null,o.jsx("span",{className:"my-agent-region-badge",children:kf(e.runtime.region,t)}),a&&e.isMine?o.jsx("span",{className:"runtime-owner-badge",children:"我创建的"}):null]}):null]}),e.sandbox?null:o.jsx("p",{className:"my-agent-description",children:e.description}),o.jsxs("dl",{className:"my-agent-meta",children:[o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:e.draft?"更新时间":"创建时间"}),o.jsx("dd",{children:e.createdAt})]}),o.jsxs("div",{className:"my-agent-region",children:[o.jsx("dt",{children:e.specificationLabel}),o.jsx("dd",{children:e.specification})]})]})]}),o.jsx("footer",{className:"my-agent-actions",children:e.draft?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"my-agent-details","aria-label":l?`查看 ${e.name} 部署进度`:`编辑草稿 ${e.name}`,onClick:()=>l?c==null?void 0:c(l):u==null?void 0:u(e.draft),children:l?"查看进度":"编辑"}),o.jsx("button",{type:"button",className:"my-agent-delete","aria-label":`删除草稿 ${e.name}`,onClick:()=>d==null?void 0:d(e.draft),children:"删除"})]}):o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"my-agent-details",disabled:!f,"aria-label":l?`查看 ${e.name} 部署进度`:`查看 ${e.name} 详情`,onClick:()=>l?c==null?void 0:c(l):s==null?void 0:s(e),children:l?"查看进度":"查看详情"}),o.jsx("button",{type:"button",className:`my-agent-use${r?" is-connected":""}`,disabled:!f||i||r,"aria-busy":i||void 0,"aria-label":r?`${e.name} 已连接`:`使用 ${e.name}`,onClick:()=>void(n==null?void 0:n(e)),children:i?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{children:"连接中"})]}):r?"已连接":"使用"})]})})]})}function _Ne({cloudProvider:e,canCreate:t,runtimeScope:n,onCreateAgent:s,onUseAgent:i,onViewAgentDetails:r,onCreateSandboxAgent:a,onUseSandboxAgent:l,onViewSandboxAgentDetails:c,sandboxRefreshKey:u=0,connectedRuntimeId:d="",hiddenRuntimeIds:f=gNe,drafts:h=[],deploymentTasks:m=[],draftDeploymentTaskIds:p={},onViewDeploymentTask:b,onEditDraft:v,onDeleteDraft:y}){const x=g.useRef(null),E=g.useRef(null),w=g.useRef(0),S=g.useRef(0),_=g.useRef(null),[k,T]=g.useState("general"),[A,j]=g.useState(""),[R,B]=g.useState([]),[z,L]=g.useState(""),[F,C]=g.useState(!0),[I,D]=g.useState(""),[$,O]=g.useState([]),[te,ne]=g.useState(!1),[P,Q]=g.useState(""),[ee,V]=g.useState(""),[X,K]=g.useState(null),ce=g.useMemo(()=>h.map(ENe),[h]),he=g.useMemo(()=>{const Ae=new Map,Ke=new Map;for(const Ue of m){if(Ue.status!=="running"||(Ae.set(Ue.id,Ue),!Ue.runtimeId))continue;const W=Ke.get(Ue.runtimeId);(!W||Ue.startedAt>W.startedAt)&&Ke.set(Ue.runtimeId,Ue)}return{byId:Ae,byRuntimeId:Ke}},[m]),ye=g.useCallback(Ae=>{var Ue;if(Ae.draft){const W=p[Ae.draft.id];return W?he.byId.get(W):void 0}const Ke=(Ue=Ae.runtime)==null?void 0:Ue.runtimeId;return Ke?he.byRuntimeId.get(Ke):void 0},[he,p]),ue=g.useCallback((Ae,Ke)=>{const Ue=++w.current;return C(!0),D(""),vNe(n,Ae,W=>{w.current===Ue&&B(oe=>Ke?W:[...oe,...W])}).then(W=>{w.current===Ue&&L(W)}).catch(W=>{w.current===Ue&&D(Vd(W,"加载通用智能体","GET /web/runtimes"))}).finally(()=>{w.current===Ue&&C(!1)})},[n]);g.useEffect(()=>{if(k==="general")return B([]),L(""),ue("",!0),()=>{w.current+=1}},[k,ue]);const we=g.useCallback(async Ae=>{var W,oe;(W=_.current)==null||W.abort();const Ke=new AbortController;_.current=Ke;const Ue=++S.current;ne(!0),Q(""),O([]);try{const Z=Ae==="codex"?await cn.listSessions({signal:Ke.signal}):await cn.listAgentSessions(Ae,{signal:Ke.signal});if(S.current!==Ue)return;O(Z.map(xNe))}catch(Z){if((Z==null?void 0:Z.name)==="AbortError"||S.current!==Ue)return;Q(Vd(Z,`加载 ${((oe=Fw.find(Ee=>Ee.id===Ae))==null?void 0:oe.label)??Ae}`,`GET /web/${Ae==="codex"?"sandbox":Ae}/sessions`))}finally{_.current===Ke&&(_.current=null),S.current===Ue&&ne(!1)}},[]);function De(Ae){var Ke;Ae!==k&&(Ae==="general"?(w.current+=1,B([]),L(""),D(""),C(!0)):((Ke=_.current)==null||Ke.abort(),_.current=null,S.current+=1,O([]),Q(""),ne(!0)),T(Ae))}g.useEffect(()=>{var Ae;if(k==="general"){(Ae=_.current)==null||Ae.abort(),_.current=null,S.current+=1;return}return we(k),()=>{var Ke;(Ke=_.current)==null||Ke.abort(),_.current=null,S.current+=1}},[k,we,u]),g.useEffect(()=>{const Ae=E.current,Ke=x.current;if(!Ae||!Ke||k!=="general"||!z||F)return;const Ue=new IntersectionObserver(([W])=>{W.isIntersecting&&ue(z,!1)},{root:Ke,rootMargin:"240px 0px",threshold:.01});return Ue.observe(Ae),()=>Ue.disconnect()},[k,ue,F,z]);const Se=g.useCallback(async Ae=>{if(!ee){V(Ae.id);try{await new Promise(Ke=>requestAnimationFrame(()=>Ke())),Ae.sandbox?await l(Ae.sandbox):await i(Ae)}finally{V("")}}},[ee,i,l]),ae=g.useMemo(()=>{const Ae=A.trim().toLocaleLowerCase(),Ke=k==="general"?[...ce,...R]:$,Ue=Ae?Ke.filter(Z=>Z.name.toLocaleLowerCase().includes(Ae)):Ke;if(k!=="general")return Ue;const W=f.size>0?Ue.filter(Z=>!Z.runtime||!f.has(Z.runtime.runtimeId)):Ue,oe=W.findIndex(Z=>{var Ee;return((Ee=Z.runtime)==null?void 0:Ee.runtimeId)===d});return oe<=0?W:[W[oe],...W.slice(0,oe),...W.slice(oe+1)]},[k,d,ce,f,A,R,$]),pe=Fw.find(Ae=>Ae.id===k),_e=(pe==null?void 0:pe.label)??"智能体",et=k==="general"?F&&R.length===0&&ce.length===0:te&&$.length===0,Be=!et&&ae.length===0,Fe=t?k==="general"?()=>s(Ni(e)):()=>a(k):void 0,We=t?void 0:"当前账号没有创建智能体权限";return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsx("div",{className:"my-agents-title-row",children:o.jsx("h1",{children:"智能体"})}),o.jsx("p",{children:n==="all"?"在此处浏览所有智能体":"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(bNe,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:A,onChange:Ae=>j(Ae.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:Fw.map(Ae=>o.jsx("button",{type:"button",className:`my-agent-type-pill${k===Ae.id?" is-active":""}`,"aria-pressed":k===Ae.id,onClick:()=>De(Ae.id),children:Ae.label},Ae.id))}),o.jsxs("button",{type:"button",className:"my-agent-create-primary",disabled:!Fe,title:We,onClick:()=>Fe==null?void 0:Fe(),children:[o.jsx($w,{}),o.jsx("span",{children:"创建智能体"})]})]}),o.jsxs("section",{className:"my-agent-results",ref:x,"aria-label":`${_e}列表`,children:[et?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):(k==="general"?I:P)&&ae.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:k==="general"?I:P}),o.jsx("button",{type:"button",onClick:()=>{k==="general"?ue("",!0):we(k)},children:"重新加载"})]}):Be?A.trim()?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(ts,{fill:"none",children:[o.jsx(ts.Icon,{children:o.jsx(qSe,{})}),o.jsx(ts.Title,{children:"没有匹配的智能体"}),o.jsx(ts.Description,{children:"请尝试搜索其他名称"})]})}):k!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(ts,{fill:"none",children:[o.jsx(ts.Icon,{children:o.jsx(yNe,{type:k})}),o.jsxs(ts.Title,{children:["暂无 ",_e]}),t?o.jsx(ts.ActionRow,{children:o.jsxs(w3,{color:"primary",size:"lg",onClick:()=>a(k),children:[o.jsx($w,{}),"创建智能体"]})}):null]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(ts,{fill:"none",children:[o.jsx(ts.Icon,{children:o.jsx(tu,{})}),o.jsx(ts.Title,{children:"暂无通用智能体"}),o.jsx(ts.Description,{children:"创建一个通用智能体,开始构建和对话"}),t?o.jsx(ts.ActionRow,{children:o.jsxs(w3,{color:"primary",size:"lg",onClick:()=>s(Ni(e)),children:[o.jsx($w,{}),"创建智能体"]})}):null]})}):o.jsxs(o.Fragment,{children:[k==="general"&&I?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:I}),o.jsx("button",{type:"button",onClick:()=>void ue("",!0),children:"重新加载"})]}):null,o.jsx("div",{className:"my-agent-grid",children:ae.map(Ae=>{var Ke;return o.jsx(wNe,{agent:Ae,cloudProvider:e,deploymentTask:ye(Ae),onViewDeploymentTask:b,onUse:Se,onViewDetails:Ue=>{Ue.sandbox?c(Ue.sandbox):r(Ue)},connecting:Ae.id===ee,connected:((Ke=Ae.runtime)==null?void 0:Ke.runtimeId)===d,showOwnership:n==="all",onEditDraft:v,onDeleteDraft:K},Ae.id)})})]}),k==="general"&&!I&&!et&&(ae.length>0||!!z)&&o.jsx("div",{className:"my-agent-load-more",ref:E,"aria-live":"polite",children:F?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):z?o.jsx("span",{children:"继续下滑加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]}),X?o.jsx(pA,{title:"删除草稿?",description:`删除后将无法恢复“${X.draft.name||"未命名 Agent"}”。`,confirmLabel:"删除草稿",variant:"danger",onCancel:()=>K(null),onConfirm:()=>{y==null||y(X),K(null)}}):null]})}const SNe={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"配置 Coding Agents",badge:"本地",badgeTone:"success",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},NNe={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},TNe="https://api.github.com",kNe=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,C3=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,ANe=/^[A-Za-z0-9._/-]+$/;function CNe(e,t,n){return e===401||e===403?"GitHub Token 无效或没有仓库写入权限":e===404?"仓库、分支或文件不存在,或 Token 无权访问":e===422?"GitHub 拒绝了提交,请检查分支和文件状态":String((t==null?void 0:t.message)||"").split(n).join("***").trim().slice(0,240)||`GitHub 请求失败(HTTP ${e})`}async function kc(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let s;try{s=await fetch(`${TNe}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(r){throw t.signal.aborted?r:new Error("连接 GitHub 失败,请检查网络后重试")}const i=await s.json().catch(()=>null);if(!t.expected.includes(s.status))throw new Error(CNe(s.status,i,t.token));return{status:s.status,payload:i}}function Hw(e){return e.split("/").map(encodeURIComponent).join("/")}function INe(e){const t=new TextEncoder().encode(e);let n="";const s=32768;for(let i=0;i({...h,path:bA(h.path,"")})),r=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await kc(`${a}`,{token:e.token,expected:[200],signal:r});const c=(f=(await kc(`${a}/git/ref/heads/${Hw(s)}`,{token:e.token,expected:[200],signal:r})).payload.object)==null?void 0:f.sha;if(!c)throw new Error("目标分支缺少有效 Git SHA");const u=jNe(e.branchPrefix);await kc(`${a}/git/refs`,{token:e.token,expected:[201],signal:r,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const m of i){const p=Hw(m.path),b=await kc(`${a}/contents/${p}?ref=${encodeURIComponent(s)}`,{token:e.token,expected:[200,404],signal:r});if(m.mustBeNew&&b.status===200)throw new Error(`目标仓库中已存在 ${m.path},未覆盖现有文件`);if(b.status===200&&!b.payload.sha)throw new Error(`目标路径 ${m.path} 不是可更新的文件`);await kc(`${a}/contents/${p}`,{token:e.token,expected:[200,201],signal:r,method:"PUT",body:{message:m.commitMessage,content:INe(m.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await kc(`${a}/pulls`,{token:e.token,expected:[201],signal:r,method:"POST",body:{title:e.title,head:u,base:s,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error("GitHub 未返回有效的 Pull Request");return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await kc(`${a}/git/refs/heads/${Hw(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}const xA={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL",required:!0},EA={name:"baseBranch",label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base",required:!1},_H={name:"runtimeName",label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置",required:!0},SH={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime",required:!0};function vA(e={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",sandboxToolId:"",modelName:"",modelBaseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",region:"cn-beijing",token:"",...e}}function wA(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const RNe=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,ONe=/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/;function MNe(e){if(!RNe.test(e.sandboxToolId))throw new Error("Sandbox Tool ID 格式不正确");if(!ONe.test(e.modelName))throw new Error("模型名称格式不正确");let t;try{t=new URL(e.modelBaseUrl)}catch{throw new Error("模型 API 地址必须是安全的 HTTPS URL")}if(t.protocol!=="https:"||!t.hostname||t.username||t.password||t.search||t.hash)throw new Error("模型 API 地址必须是安全的 HTTPS URL")}function LNe(e){MNe(e);const t=String.raw`name: PR Automated Review +`),h=(t==null?void 0:t.pendingMessage)||"正在等待构建日志…";if(g.useEffect(()=>{t&&r(s)},[e.id,t==null?void 0:t.status,s]),g.useEffect(()=>{if(!i||!c)return;const x=n.current;x&&(x.scrollTop=x.scrollHeight)},[i,c,f]),!t||!t.text&&t.status!=="error"&&!t.pendingMessage)return null;const p=cSe(t.updatedAt),m=t.status==="complete"?"已同步":t.status==="error"?"读取失败":"同步中",b=t.omittedEarly?"已省略早期日志":t.snapshotTruncated?"仅显示最近的构建日志":t.truncated?"已省略部分日志":"",v=[m,t.lineCount?`${t.lineCount} 行`:"",b,p].filter(Boolean).join(" · ");async function y(){try{await navigator.clipboard.writeText(u),l(!0),window.setTimeout(()=>l(!1),1500)}catch{l(!1)}}return o.jsxs("section",{className:`aw-deploy-log is-${t.status}${i?"":" is-collapsed"}`,"aria-label":"构建日志",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"构建日志"}),o.jsx("span",{children:v})]}),o.jsxs("div",{className:"aw-deploy-log-actions",children:[c&&o.jsx("button",{type:"button",onClick:()=>r(x=>!x),children:i?"收起":"展开"}),c&&o.jsxs("button",{type:"button",onClick:()=>void y(),"aria-label":a?"已复制构建日志":"复制构建日志",title:a?"已复制":"复制构建日志",children:[a?o.jsx(Ha,{"aria-hidden":!0}):o.jsx(bx,{"aria-hidden":!0}),o.jsx("span",{children:a?"已复制":"复制"})]})]})]}),i&&(c?o.jsx("pre",{ref:n,children:f}):o.jsx("div",{className:"aw-deploy-log-empty",children:h}))]})}function dSe({task:e}){const t=hH(e),n=pH(e),s=e.status==="success"?100:Math.max(6,Math.min(100,e.pct??6)),i=e.status==="running"?"正在部署":e.status==="success"?"部署完成":e.status==="error"?"部署失败":"部署已取消";return o.jsxs("section",{className:`aw-deploy-progress-card is-${e.status}`,"aria-live":"polite",children:[o.jsxs("div",{className:"aw-deploy-progress-head",children:[o.jsxs("div",{children:[o.jsx("span",{className:"aw-deploy-progress-icon","aria-hidden":!0,children:e.status==="running"?o.jsx(yn,{className:"spin"}):e.status==="success"?o.jsx(Cee,{}):e.status==="error"?o.jsx(Gk,{}):o.jsx(UR,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:i}),o.jsx("p",{children:e.runtimeName})]})]}),o.jsx("strong",{children:e.status==="running"?`${Math.round(s)}%`:e.label})]}),o.jsx("div",{className:"aw-deploy-progress-track",role:"progressbar","aria-label":"部署进度","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s),children:o.jsx("span",{style:{width:`${s}%`}})}),o.jsx("ol",{className:"aw-deploy-steps",children:t.map((r,a)=>{const l=e.status==="success"||anew Set),[Vn,un]=g.useState(()=>new Set),[Ht,sn]=g.useState(!1),[kn,zt]=g.useState(""),[ot,An]=g.useState(null),[mn,At]=g.useState([]),[Os,Ms]=g.useState([]),[bs,vn]=g.useState(!1),[Gn,ls]=g.useState(""),[Kn,Ss]=g.useState(""),[Ns,hi]=g.useState(0),[Cn,Ks]=g.useState([]),[cs,qn]=g.useState(!1),[Yn,Wn]=g.useState(""),[Ls,ys]=g.useState(0),[gn,fn]=g.useState(!1),[dn,rn]=g.useState(()=>new Set),[an,xs]=g.useState(!1),[de,Ie]=g.useState(""),[Be,it]=g.useState(""),[et,Et]=g.useState(()=>new Set),je=g.useRef(!1),Ln=g.useRef(""),us=g.useRef(null),pi=g.useRef(0),ri=g.useRef(0),[Xn,Jt]=g.useState(q_e),[vt,Dn]=g.useState("");g.useEffect(()=>{e.length!==0&&Jt(H=>H.map((le,fe)=>fe===0&&le.agentIds.length===0?{...le,agentIds:e.slice(0,2).map(Ae=>Ae.id)}:le))},[e]);const mi=g.useMemo(()=>{const H=new Map;for(const le of e)le.runtimeId&&H.set(le.runtimeId,le);return H},[e]),qa=g.useMemo(()=>{var le;const H=new Map;for(const fe of t){const Ae=(le=fe.deploymentTarget)==null?void 0:le.runtimeId;if(!Ae||!mi.has(Ae))continue;const tt=H.get(Ae);(!tt||fe.updatedAt>tt.updatedAt)&&H.set(Ae,fe)}return H},[mi,t]),ba=g.useMemo(()=>{const H=new Map;for(const le of d){if(!le.runtimeId)continue;const fe=H.get(le.runtimeId);(!fe||le.startedAt>fe.startedAt)&&H.set(le.runtimeId,le)}return H},[d]),wc=g.useMemo(()=>{const H=Me.trim().toLowerCase();return H?e.filter(le=>{const fe=le.runtimeId?qa.get(le.runtimeId):void 0,Ae=le.runtimeId?ba.get(le.runtimeId):void 0;return[le.label,le.app,le.host??"",(fe==null?void 0:fe.draft.name)??"",(fe==null?void 0:fe.draft.description)??"",(Ae==null?void 0:Ae.runtimeName)??""].join(" ").toLowerCase().includes(H)}):e},[e,ba,Me,qa]),nr=g.useMemo(()=>{const H=Me.trim().toLowerCase();return t.filter(le=>{var Ae;const fe=(Ae=le.deploymentTarget)==null?void 0:Ae.runtimeId;return fe&&mi.has(fe)?!1:H?`${le.draft.name} ${le.draft.description}`.toLowerCase().includes(H):!0})},[mi,t,Me]),Hu=g.useMemo(()=>t.filter(H=>{var fe;const le=(fe=H.deploymentTarget)==null?void 0:fe.runtimeId;return!le||!mi.has(le)}).length,[mi,t]),qs=g.useMemo(()=>{const H=Me.trim().toLowerCase();return H?Xn.filter(le=>le.name.toLowerCase().includes(H)):Xn},[Xn,Me]),ie=e.find(H=>H.id===C),Qt=t.find(H=>H.id===D),Pn=f?d.find(H=>H.id===f):void 0,Ts=ie!=null&&ie.runtimeId?qa.get(ie.runtimeId):void 0,en=v?W:C&&i===C?s:null,ks=(en==null?void 0:en.appName)||(ie==null?void 0:ie.runtimeApp)||(ie==null?void 0:ie.app)||"",Vr=`${(ie==null?void 0:ie.region)??"cn-beijing"}:${(ie==null?void 0:ie.runtimeId)??""}`,Gr=(ue==null?void 0:ue.requestKey)===Vr?ue.value:"",ne=(se==null?void 0:se.requestKey)===Vr?se:null,Se=!!((d0=ne==null?void 0:ne.apiApps)!=null&&d0.length),ge=!!(ne!=null&&ne.a2a),st=((Ku=ne==null?void 0:ne.apiApps)==null?void 0:Ku[0])??ks,on=(O==null?void 0:O.endpoint)??"",bn=Y_e(((oi=ne==null?void 0:ne.a2a)==null?void 0:oi.endpoint)??"",on),St=JSON.stringify([(ie==null?void 0:ie.runtimeId)??"",(ie==null?void 0:ie.region)??""]),qt=(Pe==null?void 0:Pe.requestKey)===St?Pe.value:null;g.useEffect(()=>{const H=pi.current+1;pi.current=H,Fe(null),Ue("");const le=(ie==null?void 0:ie.runtimeId)??"",fe=(ie==null?void 0:ie.region)??"";if(!l||!le||!fe){Ce(!1);return}const Ae=new AbortController;return Ce(!0),P8({runtimeId:le,region:fe,signal:Ae.signal}).then(tt=>{var bt;if(H===pi.current){if(tt.runtime.runtimeId!==le||tt.runtime.region!==fe||tt.canUpdate&&!((bt=tt.agent)!=null&&bt.appName)){Ue("Runtime 更新能力响应与当前选择不匹配。");return}Fe({requestKey:St,value:tt})}}).catch(tt=>{H!==pi.current||Ae.signal.aborted||Ue(tt instanceof Error?tt.message:"检查 Runtime 更新能力失败。")}).finally(()=>{H===pi.current&&!Ae.signal.aborted&&Ce(!1)}),()=>Ae.abort()},[l,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId,St]);const wn=g.useMemo(()=>{const H=new Map(e.map((fe,Ae)=>[fe.id,Ae])),le=new Map(n.map((fe,Ae)=>[fe,Ae]));return[...wc].sort((fe,Ae)=>{const tt=fe.runtimeId?ba.get(fe.runtimeId):void 0,bt=Ae.runtimeId?ba.get(Ae.runtimeId):void 0,ds=(tt==null?void 0:tt.status)==="running"?tt.startedAt:0,_r=(bt==null?void 0:bt.status)==="running"?bt.startedAt:0;if(ds!==_r)return _r-ds;const Yt=le.get(fe.id),Gi=le.get(Ae.id);return Yt!=null&&Gi!=null?Yt-Gi:Yt!=null?-1:Gi!=null?1:(H.get(fe.id)??0)-(H.get(Ae.id)??0)})},[n,e,wc,ba]),Ds=(ie==null?void 0:ie.label)||(en==null?void 0:en.name)||(Qt==null?void 0:Qt.draft.name)||(Pn==null?void 0:Pn.runtimeName)||"未选择智能体",sr=Xn.find(H=>H.id===vt),zi=wn.filter(H=>H.canDelete===!0),wr=wn.filter(H=>Ge.has(H.id)&&H.canDelete===!0),Qn=nr.filter(H=>Vn.has(H.id)),ir=zi.length+nr.length,Dt=wr.length+Qn.length,Ps=g.useMemo(()=>(Pn==null?void 0:Pn.agentDraft)??(Qt==null?void 0:Qt.draft)??(Ts==null?void 0:Ts.draft)??Z_e(en,(ie==null?void 0:ie.label)??"agent"),[en,ie==null?void 0:ie.label,Ts==null?void 0:Ts.draft,Qt==null?void 0:Qt.draft,Pn==null?void 0:Pn.agentDraft]),Eo=Qt?a?"":"当前账号没有新建 Agent 的权限。":l?ie!=null&&ie.runtimeId?ie.region?Ye?"正在检查 Runtime 更新能力…":Ve||(qt?qt.canUpdate?(Ah=qt.agent)!=null&&Ah.appName?"":"Runtime 更新能力响应缺少智能体信息。":qt.reason||"当前 Runtime 不支持原地更新。":"尚未完成 Runtime 更新能力检查。"):"Runtime 缺少地域信息,无法更新。":"仅支持更新已部署的云端智能体。":"当前账号没有管理 Agent 的权限。",Sh="aw-update-disabled-reason",Qg=qt!=null&&qt.agent?{runtimeId:qt.runtime.runtimeId,name:qt.runtime.name,region:qt.runtime.region,appName:qt.agent.appName,currentVersion:qt.runtime.currentVersion}:Ts==null?void 0:Ts.deploymentTarget,Zg=g.useMemo(()=>{if(en)return en.tools;const H=(Ps.builtinTools??[]).map(le=>{var fe;return((fe=Ou.find(Ae=>Ae.id===le))==null?void 0:fe.label)??le});return Array.from(new Set([...Ps.tools,...H,...(Ps.customTools??[]).map(le=>le.name),...(Ps.mcpTools??[]).map(le=>le.name)].filter(Boolean)))},[Ps,en]),vo=g.useMemo(()=>en?en.skillsPreviewSupported?en.skills.map(H=>H.name):null:Array.from(new Set([...(Ps.selectedSkills??[]).map(H=>H.name),...Ps.skills].filter(Boolean))),[Ps,en]),ai=g.useMemo(()=>{if(Pn)return Pn;if(Qt)return d.filter(H=>{var le,fe;return((le=H.agentDraft)==null?void 0:le.name)===Qt.draft.name||H.runtimeName===Qt.draft.name||!!((fe=Qt.deploymentTarget)!=null&&fe.runtimeId)&&H.runtimeId===Qt.deploymentTarget.runtimeId}).sort((H,le)=>le.startedAt-H.startedAt)[0];if(ie)return d.filter(H=>!!ie.runtimeId&&H.runtimeId===ie.runtimeId||H.runtimeName===ie.label).sort((H,le)=>le.startedAt-H.startedAt)[0]},[d,ie,Qt,Pn]),CE=!!(f&&ai&&ai.id===f),Jg=!!(ai&&(ai.status!=="success"||CE)),e0=g.useMemo(()=>rSe(Ps),[Ps]),Ya=(ie==null?void 0:ie.currentVersion)??(O==null?void 0:O.currentVersion)??null,IE=Ya??(Pn==null?void 0:Pn.startedAt)??"unknown",t0=en?`runtime:${(ie==null?void 0:ie.runtimeId)??en.name}:v${IE}:${e0}`:`draft:${(Pn==null?void 0:Pn.id)??(Qt==null?void 0:Qt.id)??(ie==null?void 0:ie.id)??Ds}:${e0}`;g.useEffect(()=>{if(!f)return;const H=d.find(fe=>fe.id===f),le=H!=null&&H.runtimeId?mi.get(H.runtimeId):void 0;if(le){$(""),I(le.id),F("basic");return}I(""),$(""),F("basic")},[mi,d,f]),g.useEffect(()=>{if(!h){Ln.current="";return}const H=`${h}:${p}:${m}`;Ln.current!==H&&e.some(le=>le.id===h)&&(Ln.current=H,$(""),I(h),F(p),p==="evaluations"&&(ut(m),xt("")))},[e,h,p,m]),g.useEffect(()=>{for(const H of wn.slice(0,8)){if(!H.runtimeId)continue;const le=H.region??"cn-beijing";U8(H.runtimeId,le),S8(H.runtimeId,le,H.runtimeApp??""),c1(H.runtimeId,le,H.runtimeApp??"").then(fe=>{const Ae=fe.appName||H.app;Ae&&LS({runtimeId:H.runtimeId??"",region:le,appName:Ae,pageSize:100})}).catch(()=>{})}},[wn]),g.useEffect(()=>{!(ie!=null&&ie.runtimeId)||!ks||LS({runtimeId:ie.runtimeId,region:ie.region??"cn-beijing",appName:ks,pageSize:100})},[ks,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),g.useEffect(()=>{let H=!1;const le=(ie==null?void 0:ie.runtimeId)??"",fe=(ie==null?void 0:ie.region)??"cn-beijing",Ae=(ie==null?void 0:ie.runtimeApp)??"",tt=le?_8(le,fe,Ae):null;if(oe(tt),Ee(!!tt||!v||!le),!(!v||!le))return c1(le,fe,Ae,{force:!0}).then(bt=>{H||oe(bt)}).catch(()=>{!H&&!tt&&oe(null)}).finally(()=>{H||Ee(!0)}),()=>{H=!0}},[v,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeApp,ie==null?void 0:ie.runtimeId]),g.useEffect(()=>{let H=!1;const le=(ie==null?void 0:ie.runtimeId)??"",fe=(ie==null?void 0:ie.region)??"cn-beijing";if(Ks([]),Wn(""),L!=="optimizations"||!le){qn(!1);return}if(v&&!ks){qn(!Z);return}return qn(!0),c8({runtimeId:le,region:fe,appName:ks}).then(Ae=>{H||Ks(Ae.groups)}).catch(Ae=>{H||Wn(Ae instanceof Error?Ae.message:String(Ae))}).finally(()=>{H||qn(!1)}),()=>{H=!0}},[Z,v,Ls,L,ks,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),g.useEffect(()=>{ri.current+=1,we(null),Ne(!1),me(!1),Je(""),be("api-server")},[Vr,L]);function n0(){ri.current+=1,we(null),Ne(!1),me(!1),Je("")}function wo(H){H!==he&&(n0(),be(H))}async function s0(){if(Le){n0();return}const H=(ie==null?void 0:ie.runtimeId)??"",le=(ie==null?void 0:ie.region)??"cn-beijing";if(!H)return;const fe=ri.current+1;ri.current=fe,me(!0),Je("");try{const Ae=await L8(H,le);if(fe!==ri.current)return;we({requestKey:Vr,value:Ae}),Ne(!0)}catch(Ae){if(fe!==ri.current)return;we(null),Ne(!1),Je(Ae instanceof Error?Ae.message:"读取 Runtime API Key 失败。")}finally{fe===ri.current&&me(!1)}}g.useEffect(()=>{let H=!1;const le=(ie==null?void 0:ie.runtimeId)??"",fe=(ie==null?void 0:ie.region)??"cn-beijing",Ae=le?B8(le,fe):null;if(te(Ae),!!le)return h2(le,fe,{force:!0}).then(tt=>{H||te(tt)}).catch(()=>{!H&&!Ae&&te(null)}),()=>{H=!0}},[ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),g.useEffect(()=>{let H=!1;const le=(ie==null?void 0:ie.runtimeId)??"",fe=(ie==null?void 0:ie.region)??"cn-beijing",Ae=`${fe}:${le}`;if(X(""),L!=="integrations"||!le){ee(!1),le||P(null);return}ee(!0);const tt=f2(le,fe,{retryProbe:!0}).catch(bt=>{if(bt instanceof Or&&bt.unsupported)return null;throw bt});return Promise.all([tt,M8(le,fe,{retryProbe:!0})]).then(([bt,ds])=>{H||P({requestKey:Ae,apiApps:bt,a2a:ds})}).catch(bt=>{H||(P(null),X(bt instanceof Error?bt.message:"探测集成方式失败。"))}).finally(()=>{H||ee(!1)}),()=>{H=!0}},[K,L,ie==null?void 0:ie.currentVersion,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),g.useEffect(()=>{let H=!1;const le=(ie==null?void 0:ie.runtimeId)??"",fe=(ie==null?void 0:ie.region)??"cn-beijing",Ae=le&&ks?u8({runtimeId:le,region:fe,appName:ks,pageSize:100}):null;if(At(Ae?x3(Ae):[]),Ms((Ae==null?void 0:Ae.sets)??[]),ls(""),Ss((Ae==null?void 0:Ae.unsupportedMessage)??""),L!=="evaluations"||!le){vn(!1);return}if(v&&!ks){vn(!Z);return}return vn(!Ae),Nx({runtimeId:le,region:fe,appName:ks,pageSize:100},{force:!0}).then(tt=>{H||(Ms(tt.sets),At(x3(tt)),Ss(tt.unsupportedMessage??""))}).catch(tt=>{H||(ls(tt instanceof Error?tt.message:String(tt)),Ss(""))}).finally(()=>{H||vn(!1)}),()=>{H=!0}},[Z,v,Ns,L,ks,en==null?void 0:en.appName,ie==null?void 0:ie.region,ie==null?void 0:ie.runtimeId]),g.useEffect(()=>{const H=new Set(mn.map(le=>le.id));rn(le=>{const fe=new Set([...le].filter(Ae=>H.has(Ae)));return fe.size===le.size?le:fe}),Et(le=>{const fe=new Set([...le].filter(Ae=>H.has(Ae)));return fe.size===le.size?le:fe}),Be&&!H.has(Be)&&it("")},[mn,Be]),g.useEffect(()=>{fn(!1),rn(new Set),Et(new Set),Ie(""),it("")},[ie==null?void 0:ie.runtimeId]),g.useEffect(()=>{const H=new Set(wn.filter(le=>le.canDelete===!0).map(le=>le.id));ht(le=>{const fe=new Set([...le].filter(Ae=>H.has(Ae)));return fe.size===le.size?le:fe})},[wn]),g.useEffect(()=>{const H=new Set(nr.map(le=>le.id));un(le=>{const fe=new Set([...le].filter(Ae=>H.has(Ae)));return fe.size===le.size?le:fe})},[nr]);const _o=g.useMemo(()=>!b||!(ie!=null&&ie.runtimeId)||b.runtimeId!==ie.runtimeId||ks&&b.agentName&&b.agentName!==ks?null:{...b,tag:b.kind==="good"?"Good case":"Bad case"},[b,ie==null?void 0:ie.runtimeId,ks]),So=g.useMemo(()=>ie!=null&&ie.runtimeId?_o?[_o,...mn.filter(H=>H.id!==_o.id&&(!H.messageId||H.messageId!==_o.messageId))]:mn:K_e,[mn,_o,ie==null?void 0:ie.runtimeId]),ml=So.filter(H=>{if(H.kind!==Ot||(H.source==="auto"?"auto":"user")!==wt)return!1;const fe=xn.trim().toLowerCase();return fe?[H.input,H.output,H.referenceOutput,H.comment,H.tag??"",H.sessionId,H.messageId,H.userId,H.evaluationSetName].join(" ").toLowerCase().includes(fe):!0}),Wa=ml.filter(H=>dn.has(H.id)),i0=!!(ie!=null&&ie.runtimeId),Zn=H=>{ut(H),xt(""),Ie("");const le=So.find(fe=>fe.kind===H);it((le==null?void 0:le.id)??""),window.setTimeout(()=>{var fe;(fe=us.current)==null||fe.scrollIntoView({behavior:"smooth",block:"start"})},0)},jE=H=>{Ie(""),rn(le=>{const fe=new Set(le);return fe.has(H.id)?fe.delete(H.id):fe.add(H.id),fe})},RE=()=>{Ie(""),rn(new Set(ml.map(H=>H.id)))},OE=()=>{Ie(""),rn(new Set),fn(!1)},Vi=H=>{Et(le=>{const fe=new Set(le);return fe.has(H)?fe.delete(H):fe.add(H),fe})},r0=H=>{it(H.id),Ie(""),!(!H.sessionId||!H.messageId)&&(T==null||T(H))},zu=async H=>{if(!(ie!=null&&ie.runtimeId)||!ks||an||H.length===0)return;const le=H.length===1?"确定删除这条反馈案例?原始聊天记录不会被删除。":`确定删除选中的 ${H.length} 条反馈案例?原始聊天记录不会被删除。`;if(!window.confirm(le))return;const fe=H.map(tt=>tt.id),Ae=new Set(fe);xs(!0),Ie("");try{await h8({runtimeId:ie.runtimeId,region:ie.region??"cn-beijing",appName:ks,itemIds:fe});const tt=new Map;for(const bt of H)tt.set(bt.kind,(tt.get(bt.kind)??0)+1);At(bt=>bt.filter(ds=>!Ae.has(ds.id))),Ms(bt=>bt.map(ds=>({...ds,itemCount:Math.max(0,ds.itemCount-(tt.get(ds.kind)??0))}))),rn(bt=>new Set([...bt].filter(ds=>!Ae.has(ds)))),Et(bt=>new Set([...bt].filter(ds=>!Ae.has(ds)))),Be&&Ae.has(Be)&&it(""),H.length>1&&fn(!1),k==null||k(H)}catch(tt){Ie(tt instanceof Error?tt.message:String(tt))}finally{xs(!1)}},a0=H=>{Jt(le=>le.map(fe=>fe.id===H.id?H:fe))},o0=()=>{const H=new Set(e.map(Ae=>Ae.id)),le=n.filter(Ae=>H.has(Ae)),fe=new Set(le);return[...le,...e.filter(Ae=>!fe.has(Ae.id)).map(Ae=>Ae.id)]},Nh=(H,le,fe)=>{if(!x||H===le)return;const Ae=o0().filter(ds=>ds!==H),tt=Ae.indexOf(le),bt=tt<0?Ae.length:fe==="after"?tt+1:tt;Ae.splice(bt,0,H),x(Ae)},Vu=(H,le)=>{if(!Ut||Ut===le)return;const fe=H.currentTarget.getBoundingClientRect();ft(le),_t(H.clientY>fe.top+fe.height/2?"after":"before")},Gu=(H,le)=>{if(!x)return;const fe=o0(),Ae=fe.indexOf(H),tt=Math.max(0,Math.min(fe.length-1,Ae+le));Ae<0||Ae===tt||(fe.splice(Ae,1),fe.splice(tt,0,H),x(fe))},ME=H=>{H.canDelete===!0&&(zt(""),ht(le=>{const fe=new Set(le);return fe.has(H.id)?fe.delete(H.id):fe.add(H.id),fe}))},l0=H=>{zt(""),un(le=>{const fe=new Set(le);return fe.has(H.id)?fe.delete(H.id):fe.add(H.id),fe})},No=()=>{zt(""),ht(new Set(zi.map(H=>H.id))),un(new Set(nr.map(H=>H.id)))},Bt=()=>{zt(""),ht(new Set),un(new Set),We(!1)},c0=()=>{if(Dt===0||Ht)return;const H=wr.length,le=Qn.length;zt(""),An({kind:"selection",title:H===1&&le===0?"删除 Agent?":H===0&&le===1?"删除草稿?":"删除所选项目?",description:H===1&&le===0?`"${wr[0].label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`:H===0&&le===1?`"${Qn[0].draft.name||"未命名 Agent"}" 将从本地草稿中删除。`:`将删除选中的 ${Dt} 个项目。${H>0?`${H} 个云端 Runtime 将被永久删除,此操作不可撤销。`:"草稿删除后无法恢复。"}`,confirmLabel:H===0&&le===1?"删除草稿":"删除所选",agents:wr,drafts:Qn})},u0=async()=>{if(!(!ot||Ht)){sn(!0),zt("");try{if(ot.kind==="selection"){const{agents:H,drafts:le}=ot;if(H.length>0){if(!E)throw new Error("当前页面不支持删除已部署 Agent。");await E(H)}le.length>0&&(w==null||w(le)),ht(new Set),un(new Set),We(!1),H.some(fe=>fe.id===C)&&I(""),le.some(fe=>fe.id===D)&&$("")}else if(ot.kind==="agent"){if(!E)throw new Error("当前页面不支持删除已部署 Agent。");await E([ot.agent]),C===ot.agent.id&&I("")}else{if(!w)throw new Error("当前页面不支持删除草稿。");w([ot.draft]),D===ot.draft.id&&$("")}An(null)}catch(H){zt(H instanceof Error?H.message:String(H))}finally{sn(!1)}}},LE=H=>{!E||H.canDelete!==!0||Ht||(zt(""),An({kind:"agent",title:"删除 Agent?",description:`"${H.label}" 对应的云端 Runtime 将被永久删除,此操作不可撤销。`,confirmLabel:"删除 Agent",agent:H}))},Th=H=>{if(!w||Ht)return;const le=H.draft.name||"未命名 Agent";zt(""),An({kind:"draft",title:"删除草稿?",description:`"${le}" 将从本地草稿中删除。`,confirmLabel:"删除草稿",draft:H})},kh=()=>{const H=`eval-${Date.now()}`,le={id:H,name:`新评测组 ${Xn.length+1}`,agentIds:[],caseSet:"核心回归集",evaluator:"综合质量评估器",metrics:["回答质量"],concurrency:"4",history:[]};Jt(fe=>[le,...fe]),Dn(H)},DE=H=>{a0({...H,history:[{id:`run-${Date.now()}`,createdAt:"刚刚",score:86+H.history.length%7,status:"completed"},...H.history]})};return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:`aw-root${v?" is-detail-only":""}`,children:[o.jsxs("nav",{className:"aw-view-tabs","aria-label":"智能体工作台",children:[o.jsx("button",{type:"button",className:B==="library"?"is-active":"","aria-pressed":B==="library",onClick:()=>{z("library"),lt("")},children:"智能体库"}),o.jsx("button",{type:"button",className:B==="evaluation"?"is-active":"","aria-pressed":B==="evaluation",onClick:()=>{z("evaluation"),lt("")},children:"评测"})]}),o.jsxs("div",{className:"aw-workspace-frame",children:[o.jsxs("div",{className:"aw-workspace","aria-hidden":B==="evaluation"||void 0,ref:H=>{H==null||H.toggleAttribute("inert",B==="evaluation")},children:[o.jsxs("aside",{className:"aw-sidebar","aria-label":B==="library"?"智能体列表":"评测组列表",children:[o.jsxs("label",{className:"aw-search",children:[o.jsx(t1,{"aria-hidden":!0}),o.jsx("input",{value:Me,onChange:H=>lt(H.currentTarget.value),placeholder:B==="library"?"搜索智能体":"搜索评测组","aria-label":B==="library"?"搜索智能体":"搜索评测组"})]}),o.jsxs("button",{type:"button",className:"aw-create-card",onClick:B==="library"?A:kh,disabled:B==="library"&&!a,children:[o.jsx(ji,{"aria-hidden":!0}),o.jsx("span",{children:B==="library"?"新建 Agent":"新建评测组"})]}),B==="library"&&(E||w)&&o.jsx("div",{className:`aw-selection-toolbar${ye?" is-active":""}`,children:ye?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Dt," 个"]}),o.jsx("button",{type:"button",onClick:No,disabled:ir===0||Ht,children:"全选"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void c0(),disabled:Dt===0||Ht,children:Ht?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:Bt,disabled:Ht,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{zt(""),We(!0)},disabled:ir===0,children:"选择"})}),B==="library"&&kn&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:kn}),o.jsx("div",{className:"aw-agent-list",children:B==="evaluation"?qs.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的评测组"}):qs.map(H=>o.jsxs("button",{type:"button",className:`aw-agent-item${H.id===vt?" is-active":""}`,onClick:()=>Dn(H.id),children:[o.jsxs("span",{className:"aw-agent-copy aw-eval-group-copy",children:[o.jsx("strong",{children:H.name}),o.jsxs("small",{children:[H.agentIds.length," 个智能体 · ",H.history.length," 次运行"]})]}),o.jsx(Kp,{"aria-hidden":!0})]},H.id)):c&&wn.length===0&&nr.length===0?o.jsx("div",{className:"aw-list-empty",children:"正在读取云端智能体…"}):u&&wn.length===0&&nr.length===0?o.jsxs("div",{className:"aw-list-empty aw-list-error",children:[o.jsx("span",{children:u}),y&&o.jsx("button",{type:"button",onClick:y,children:"重试"})]}):wn.length===0&&nr.length===0?o.jsx("div",{className:"aw-list-empty",children:"没有匹配的智能体"}):o.jsxs(o.Fragment,{children:[nr.map(H=>{const le=d.filter(Ae=>{var tt,bt;return((tt=Ae.agentDraft)==null?void 0:tt.name)===H.draft.name||Ae.runtimeName===H.draft.name||!!((bt=H.deploymentTarget)!=null&&bt.runtimeId)&&Ae.runtimeId===H.deploymentTarget.runtimeId}).sort((Ae,tt)=>tt.startedAt-Ae.startedAt)[0],fe=Vn.has(H.id);return o.jsxs("button",{type:"button",className:["aw-agent-item",ye?"is-selecting":"",fe?"is-selected-for-delete":"",H.id===D?"is-active":""].filter(Boolean).join(" "),"aria-pressed":ye?fe:void 0,onClick:()=>{if(ye){l0(H);return}I(""),$(H.id),F("basic")},children:[ye&&o.jsx("span",{className:`aw-select-marker${fe?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:H.draft.name||"未命名 Agent"}),o.jsx("span",{className:`aw-draft-badge${(le==null?void 0:le.status)==="running"?" is-deploying":""}`,children:(le==null?void 0:le.status)==="running"?"部署中":"草稿"})]}),o.jsx("small",{children:H.deploymentTarget?"待更新":"尚未发布"})]}),o.jsx(Kp,{"aria-hidden":!0})]},H.id)}),wn.map(H=>{const le=H.runtimeId?ba.get(H.runtimeId):void 0,fe=H.runtimeId?qa.get(H.runtimeId):void 0,Ae=Ge.has(H.id),tt=H.canDelete===!0,bt=(le==null?void 0:le.status)==="running"?{label:"部署中",className:" is-deploying"}:(le==null?void 0:le.status)==="error"?{label:"失败",className:" is-error"}:(le==null?void 0:le.status)==="cancelled"?{label:"已取消",className:" is-muted"}:fe?{label:"待更新",className:""}:null,ds=(le==null?void 0:le.status)==="running"?"正在更新部署":fe?"待更新":H.remote?H.host||"远程智能体":"本地智能体",_r=["aw-agent-item","aw-agent-item--sortable",H.id===C?"is-active":"",ye?"is-selecting":"",Ae?"is-selected-for-delete":"",ye&&!tt?"is-selection-disabled":"",H.id===Ut?"is-dragging":"",H.id===at&&H.id!==Ut?`is-drop-target is-drop-${He}`:""].filter(Boolean).join(" ");return o.jsxs("button",{type:"button",draggable:!!x&&!ye,className:_r,"aria-pressed":ye?Ae:void 0,"aria-keyshortcuts":x?"Alt+ArrowUp Alt+ArrowDown":void 0,onDragStart:Yt=>{x&&(je.current=!0,Pt(H.id),Yt.dataTransfer.effectAllowed="move",Yt.dataTransfer.setData("text/plain",H.id))},onDragEnter:Yt=>{Vu(Yt,H.id)},onDragOver:Yt=>{!Ut||Ut===H.id||(Yt.preventDefault(),Yt.dataTransfer.dropEffect="move",Vu(Yt,H.id))},onDragLeave:Yt=>{const Gi=Yt.relatedTarget;Gi instanceof Node&&Yt.currentTarget.contains(Gi)||at===H.id&&ft("")},onDrop:Yt=>{Yt.preventDefault();const Gi=Yt.dataTransfer.getData("text/plain")||Ut;Nh(Gi,H.id,He),Pt(""),ft(""),_t("before")},onDragEnd:()=>{Pt(""),ft(""),_t("before"),window.setTimeout(()=>{je.current=!1},0)},onKeyDown:Yt=>{Yt.altKey&&(Yt.key==="ArrowUp"?(Yt.preventDefault(),Gu(H.id,-1)):Yt.key==="ArrowDown"&&(Yt.preventDefault(),Gu(H.id,1)))},onClick:Yt=>{if(ye){Yt.preventDefault(),ME(H);return}if(je.current){Yt.preventDefault(),je.current=!1;return}$(""),I(H.id),F("basic"),S(H.id)},children:[ye&&o.jsx("span",{className:`aw-select-marker${Ae?" is-checked":""}`,"aria-hidden":"true"}),o.jsxs("span",{className:"aw-agent-copy",children:[o.jsxs("span",{className:"aw-agent-name-row",children:[o.jsx("strong",{children:H.label}),H.currentVersion!=null&&o.jsxs("span",{className:"aw-version-badge",children:["v",H.currentVersion]}),bt&&o.jsx("span",{className:`aw-draft-badge${bt.className}`,children:bt.label})]}),o.jsx("small",{children:ds})]}),o.jsx(Kp,{"aria-hidden":!0})]},H.id)})]})}),o.jsxs("div",{className:"aw-list-count",children:["共 ",B==="library"?e.length+Hu:Xn.length," 个"]})]}),B==="evaluation"&&sr?o.jsx(gSe,{group:sr,agents:e,cases:So,onChange:a0,onRun:DE}):B==="evaluation"?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择评测组"})}):!ie&&!Qt&&!Pn?o.jsx("main",{className:"aw-main aw-empty-selection",children:o.jsx("p",{children:"未选择智能体"})}):o.jsxs("main",{className:"aw-main",children:[ie&&!en&&r&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在加载智能体"}),o.jsx("small",{children:"正在读取配置与运行信息…"})]})]})}),L==="integrations"&&Q&&o.jsx("div",{className:"aw-detail-loading",role:"status","aria-live":"polite",children:o.jsxs("div",{className:"aw-detail-loading-card",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsxs("span",{children:[o.jsx("strong",{children:"正在探测接入方式"}),o.jsx("small",{children:"正在确认 API Server 与 A2A…"})]})]})}),o.jsxs("div",{className:"aw-agent-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:Ds}),Ya!=null&&o.jsxs("span",{children:["v",Ya]}),Qt&&o.jsx("span",{children:"草稿"}),Ts&&o.jsx("span",{children:"待更新"}),!ie&&!Qt&&Pn&&o.jsx("span",{children:Pn.label})]}),o.jsx("p",{children:Ps.description||(r||v&&!Z?"正在读取智能体信息…":"暂无描述")})]}),(Qt||Ts||(ie==null?void 0:ie.canDelete))&&o.jsxs("div",{className:"aw-head-actions",children:[(Qt||Ts)&&o.jsxs("button",{type:"button",className:"aw-head-delete aw-head-delete--draft",onClick:()=>{const H=Qt??Ts;H&&Th(H)},disabled:Ht,"aria-label":"删除草稿",title:"删除草稿",children:[o.jsx(dc,{"aria-hidden":!0}),o.jsx("span",{children:"删除草稿"})]}),(ie==null?void 0:ie.canDelete)&&o.jsxs("button",{type:"button",className:"aw-head-delete",onClick:()=>void LE(ie),disabled:Ht,"aria-label":"删除 Agent",title:"删除 Agent",children:[o.jsx(dc,{"aria-hidden":!0}),o.jsx("span",{children:Ht?"删除中…":"删除 Agent"})]})]})]}),ai&&Jg&&o.jsx("div",{className:"aw-detail-deployment",children:o.jsx(dSe,{task:ai})}),o.jsx("nav",{className:"aw-agent-tabs","aria-label":"智能体详情",role:"tablist",children:sd.map(H=>o.jsx("button",{type:"button",id:`agent-${H.id}-tab`,className:L===H.id?"is-active":"",role:"tab","aria-selected":L===H.id,"aria-controls":`agent-${H.id}-panel`,tabIndex:L===H.id?0:-1,onClick:()=>F(H.id),onKeyDown:le=>{var bt;if(!["ArrowLeft","ArrowRight","Home","End"].includes(le.key))return;le.preventDefault();const fe=sd.findIndex(ds=>ds.id===H.id),Ae=le.key==="Home"?0:le.key==="End"?sd.length-1:(fe+(le.key==="ArrowRight"?1:-1)+sd.length)%sd.length,tt=sd[Ae];F(tt.id),(bt=document.getElementById(`agent-${tt.id}-tab`))==null||bt.focus()},children:H.label},H.id))}),o.jsxs("div",{className:"aw-content",id:`agent-${L}-panel`,role:"tabpanel","aria-labelledby":`agent-${L}-tab`,children:[L==="basic"&&o.jsxs("div",{className:"aw-basic-stack",children:[o.jsxs("section",{className:"aw-deployment-panel aw-settings-card",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"部署配置"}),o.jsx("p",{children:"配置目标环境与网络访问方式。"})]})}),o.jsxs("dl",{className:"aw-readonly-config",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"运行状态"}),o.jsxs("dd",{className:(O==null?void 0:O.status.toLowerCase())==="ready"?"is-ready":void 0,children:[(O==null?void 0:O.status.toLowerCase())==="ready"&&o.jsx("span",{className:"aw-status-dot"}),(O==null?void 0:O.status)||"读取中…"]})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"部署区域"}),o.jsx("dd",{children:(O==null?void 0:O.region)||(ie==null?void 0:ie.region)||(ai==null?void 0:ai.region)||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"网络访问"}),o.jsx("dd",{children:O!=null&&O.networkTypes.length?O.networkTypes.join(" / "):"暂未提供"})]})]})]}),o.jsxs("section",{className:"aw-canvas-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"执行流程"})}),o.jsx("div",{className:"aw-canvas",children:o.jsx(zm,{draft:Ps,direction:"horizontal",selectedPath:[],onSelect:()=>{},onAdd:()=>{},onInsert:()=>{},onDelete:()=>{},readOnly:!0,interactivePreview:!0},t0)})]}),o.jsxs("section",{className:"aw-details-card",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"详细信息"})}),o.jsxs("dl",{className:"aw-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:(en==null?void 0:en.model)||Ps.modelName||"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"智能体数量"}),o.jsx("dd",{children:en!=null&&en.graph?dH(en.graph):fH(Ps)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具"}),o.jsx("dd",{className:"aw-fact-badges",children:Zg.length?Zg.map(H=>o.jsx("span",{children:H},H)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"技能"}),o.jsx("dd",{className:"aw-fact-badges",children:vo===null?"暂不支持预览":vo.length?vo.map(H=>o.jsx("span",{children:H},H)):"暂无"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:Ya!=null?`v${Ya}`:"暂未提供"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:Qt?"草稿":(ai==null?void 0:ai.status)==="error"?"部署失败":(ai==null?void 0:ai.status)==="cancelled"?"已取消":Ts?"待更新":o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"aw-status-dot"}),"可用"]})})]})]})]})]}),L==="integrations"&&o.jsxs("div",{className:"aw-integration-stack",children:[o.jsxs("div",{className:"aw-integration-intro",children:[o.jsx("h3",{children:"接入方式"}),o.jsx("p",{children:"仅展示当前 Runtime 可确认的公开协议与地址。"})]}),V&&o.jsxs("div",{className:"aw-integration-error",role:"alert",children:[o.jsx("span",{children:V}),o.jsx("button",{type:"button",onClick:()=>ce(H=>H+1),children:"重试"})]}),!V&&o.jsxs("div",{className:"aw-integration-body",children:[o.jsxs("div",{className:`aw-integration-protocol-tabs${he==="a2a"?" is-a2a":""}`,role:"tablist","aria-label":"接入协议",children:[o.jsx("span",{className:"aw-integration-protocol-slider","aria-hidden":"true"}),sp.map((H,le)=>o.jsx("button",{type:"button",id:`integration-${H.id}-tab`,role:"tab","aria-selected":he===H.id,"aria-controls":`integration-${H.id}-panel`,tabIndex:he===H.id?0:-1,onClick:()=>wo(H.id),onKeyDown:fe=>{var bt;if(!["ArrowLeft","ArrowRight","Home","End"].includes(fe.key))return;fe.preventDefault();const Ae=fe.key==="Home"?0:fe.key==="End"?sp.length-1:(le+(fe.key==="ArrowRight"?1:-1)+sp.length)%sp.length,tt=sp[Ae];wo(tt.id),(bt=document.getElementById(`integration-${tt.id}-tab`))==null||bt.focus()},children:H.label},H.id))]}),he==="api-server"?o.jsx(y3,{protocol:"api-server",title:"API Server",available:Se,fields:[{label:"Agent",value:Se?((As=ne==null?void 0:ne.apiApps)==null?void 0:As.join("、"))??"":""},{label:"发现接口",value:Se?Pw(on,"/list-apps"):""},{label:"调用接口",value:Se?Pw(on,"/run_sse"):""},{label:"鉴权方式",value:Se?g3(O==null?void 0:O.authType):""},{label:"API Key",value:o.jsx(b3,{available:Se,authType:O==null?void 0:O.authType,value:Gr,visible:Le&&!!Gr,loading:ae,error:_e,onToggle:()=>void s0()})}],example:Se?W_e(on,st,O==null?void 0:O.authType):""}):o.jsx(y3,{protocol:"a2a",title:"A2A",available:ge,fields:[{label:"Agent",value:((Ch=ne==null?void 0:ne.a2a)==null?void 0:Ch.name)??""},{label:"Agent Card",value:ge?Pw(on,"/.well-known/agent-card.json"):""},{label:"调用地址",value:bn},{label:"鉴权方式",value:ge?g3(O==null?void 0:O.authType):""},{label:"API Key",value:o.jsx(b3,{available:ge,authType:O==null?void 0:O.authType,value:Gr,visible:Le&&!!Gr,loading:ae,error:_e,onToggle:()=>void s0()})}],example:ge?X_e(bn,O==null?void 0:O.authType):""})]})]}),L==="evaluations"&&o.jsxs("section",{className:"aw-cases",children:[(ie==null?void 0:ie.runtimeId)&&o.jsx("div",{className:"aw-case-summary",children:["good","bad"].map(H=>{const le=iSe(Os,H),fe=So.filter(tt=>tt.kind===H).length,Ae=_o?fe:(le==null?void 0:le.itemCount)??fe;return o.jsxs("button",{type:"button",onClick:()=>Zn(H),children:[o.jsx("strong",{children:Ae}),o.jsx("span",{children:H==="good"?"Good cases":"Bad cases"})]},H)})}),o.jsxs("div",{className:"aw-case-filter-bar",children:[o.jsxs("div",{className:"aw-case-filter-stack",children:[o.jsx("div",{className:"aw-case-filters","aria-label":"案例结果筛选",children:["good","bad"].map(H=>o.jsx("button",{type:"button",className:Ot===H?"is-active":"","aria-pressed":Ot===H,onClick:()=>ut(H),children:H==="good"?"Good case":"Bad case"},H))}),o.jsx("div",{className:"aw-case-source-filters","aria-label":"回流方式筛选",children:["auto","user"].map(H=>o.jsx("button",{type:"button",className:wt===H?"is-active":"","aria-pressed":wt===H,onClick:()=>En(H),children:H==="auto"?"自动回流":"手动回流"},H))})]}),o.jsxs("label",{className:"aw-case-search",children:[o.jsx(t1,{"aria-hidden":!0}),o.jsx("input",{type:"search",value:xn,onChange:H=>xt(H.currentTarget.value),placeholder:"搜索用户输入、期望行为或标签","aria-label":"搜索评测案例"})]})]}),i0&&o.jsx("div",{className:`aw-case-toolbar${gn?" is-active":""}`,children:gn?o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"aw-selection-count",children:["已选 ",Wa.length," 条"]}),o.jsx("button",{type:"button",onClick:RE,disabled:ml.length===0||an,children:"全选当前"}),o.jsx("button",{type:"button",className:"aw-selection-danger",onClick:()=>void zu(Wa),disabled:Wa.length===0||an,children:an?"删除中…":"删除所选"}),o.jsx("button",{type:"button",onClick:OE,disabled:an,children:"取消"})]}):o.jsx("button",{type:"button",onClick:()=>{Ie(""),fn(!0)},disabled:ml.length===0||an,children:"选择案例"})}),de&&o.jsx("div",{className:"aw-delete-error",role:"alert",children:de}),o.jsx("div",{ref:us,children:o.jsx(mSe,{cases:ml,loading:bs&&ml.length===0,error:Gn,notice:Kn,runtimeBacked:!!(ie!=null&&ie.runtimeId),selectionMode:gn,selectedCaseIds:dn,focusedCaseId:Be,expandedCaseIds:et,deleting:an,canDelete:i0,onOpenCase:r0,onToggleCase:jE,onToggleExpanded:Vi,onDeleteCase:H=>void zu([H]),onRetry:()=>hi(H=>H+1)})})]}),L==="optimizations"&&o.jsxs("section",{className:"aw-optimizations",children:[o.jsxs("div",{className:"aw-optimization-intro",children:[o.jsx("h3",{children:"优化项"}),o.jsx("p",{children:"根据评测结果汇总需要优先处理的改进建议。"})]}),cs?o.jsxs("div",{className:"aw-optimization-state",role:"status",children:[o.jsx("span",{className:"loading-gap-spinner","aria-hidden":"true"}),o.jsx("span",{children:"正在读取优化项"})]}):Yn?o.jsxs("div",{className:"aw-optimization-state is-error",role:"alert",children:[o.jsx("span",{children:Yn}),o.jsx("button",{type:"button",onClick:()=>ys(H=>H+1),children:"重试"})]}):Cn.length>0?o.jsx(hSe,{groups:Cn}):o.jsx("div",{className:"aw-optimization-state",children:"暂无优化项,自动评测完成后会在这里生成建议。"})]})]}),L==="basic"&&(ie||Qt)&&o.jsxs("div",{className:"aw-basic-actions",children:[ie&&o.jsxs("button",{type:"button",className:"aw-talk studio-update-action",onClick:()=>_==null?void 0:_(ie),children:[o.jsx(Wee,{"aria-hidden":!0}),o.jsx("span",{children:"去对话"})]}),o.jsxs("span",{className:`aw-update-wrap${Eo?" is-disabled":""}`,tabIndex:Eo?0:void 0,"aria-describedby":Eo?Sh:void 0,children:[o.jsx("button",{type:"button",className:"aw-update studio-update-action",disabled:!!Eo,"aria-busy":Ye||void 0,"aria-describedby":Eo?Sh:void 0,onClick:()=>{var H;return Qt?R==null?void 0:R(Qt):Ts?R==null?void 0:R({...Ts,deploymentTarget:Qg}):qt?j(((H=qt.agent)==null?void 0:H.draft)??Ps,qt):void 0},children:Ye?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading-gap-spinner aw-update-spinner","aria-hidden":"true"}),o.jsx("span",{children:"检测中"})]}):Qt||Ts?"继续编辑":"更新"}),Eo&&o.jsx("span",{id:Sh,className:"aw-update-disabled-reason",role:"tooltip",children:Eo})]})]})]})]}),B==="evaluation"&&o.jsx("div",{className:"aw-evaluation-glass",role:"status",children:o.jsx("span",{children:"敬请期待"})})]})]}),ot&&o.jsx(mA,{variant:"danger",title:ot.title,description:ot.description,confirmLabel:Ht?"删除中...":ot.confirmLabel,closeLabel:"关闭删除确认",busy:Ht,onCancel:()=>An(null),onConfirm:()=>void u0()})]})}function hSe({groups:e}){return o.jsx("div",{className:"aw-optimization-table-wrap",children:o.jsxs("table",{className:"aw-optimization-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{scope:"col",children:"修复优先级"}),o.jsx("th",{scope:"col",children:"建议优化模块"}),o.jsx("th",{scope:"col",children:"优化建议和理由"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("span",{className:`aw-priority is-${t.priority}`,children:tSe(t.priority)})}),o.jsx("td",{children:o.jsx("span",{className:"aw-optimization-module",children:sSe(t)})}),o.jsx("td",{children:o.jsx("ul",{className:"aw-optimization-list",children:t.items.map(n=>o.jsxs("li",{children:[o.jsx("strong",{children:n.suggestion}),o.jsx("p",{children:n.reason})]},`${n.suggestion}:${n.reason}`))})})]},`${t.priority}:${t.module}:${t.customModule??""}`))})]})})}function pSe(){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.5 7h15"}),o.jsx("path",{d:"M9 7V4.8h6V7"}),o.jsx("path",{d:"m6.5 7 .8 12h9.4l.8-12"}),o.jsx("path",{d:"M10 10.5v5M14 10.5v5"})]})}function mSe({cases:e,loading:t=!1,error:n="",notice:s="",runtimeBacked:i=!1,selectionMode:r=!1,selectedCaseIds:a,focusedCaseId:l="",expandedCaseIds:c,deleting:u=!1,canDelete:d=!1,onOpenCase:f,onToggleCase:h,onToggleExpanded:p,onDeleteCase:m,onRetry:b}){return o.jsxs("div",{className:"aw-case-table",children:[o.jsxs("div",{className:"aw-case-row aw-case-row-head",children:[o.jsx("span",{children:"用户输入"}),o.jsx("span",{children:"Agent 输出"}),o.jsx("span",{children:"评分"}),o.jsx("span",{children:"评分理由"}),o.jsx("span",{className:"aw-case-action-head",children:"操作"})]}),t?o.jsx("div",{className:"aw-case-empty",children:"正在读取 AgentKit 评测集…"}):n?o.jsxs("div",{className:"aw-case-empty aw-case-error",children:[o.jsx("span",{children:n}),b&&o.jsx("button",{type:"button",onClick:b,children:"重试"})]}):s?o.jsx("div",{className:"aw-case-empty",children:s}):e.length===0?o.jsx("div",{className:"aw-case-empty",children:i?"暂无用户反馈案例":"没有匹配的案例"}):e.map(v=>{var k;const y=v.id.startsWith("local:"),x=(a==null?void 0:a.has(v.id))??!1,E=(c==null?void 0:c.has(v.id))??!1,S=v.output.length+v.referenceOutput.length>220||(((k=v.reason)==null?void 0:k.length)??0)>120,_=d&&!y,T=v.source==="auto";return o.jsxs("div",{className:["aw-case-row",l===v.id?"is-focused":"",r?"is-selecting":"",x?"is-selected-for-delete":""].filter(Boolean).join(" "),role:"row",tabIndex:0,"aria-selected":r?x:void 0,onClick:()=>{if(r){_&&(h==null||h(v));return}f==null||f(v)},onKeyDown:A=>{A.target===A.currentTarget&&(A.key!=="Enter"&&A.key!==" "||(A.preventDefault(),r?_&&(h==null||h(v)):f==null||f(v)))},children:[o.jsxs("div",{className:"aw-case-text aw-case-cell","data-label":"用户输入",children:[o.jsxs("span",{className:"aw-case-title-line",children:[r&&_&&o.jsx("span",{className:`aw-select-marker${x?" is-checked":""}`,"aria-hidden":"true"}),o.jsx("strong",{title:v.input,children:v.input||"无用户输入"})]}),v.comment&&o.jsxs("small",{title:v.comment,children:["备注:",v.comment]}),o.jsx("small",{className:"aw-case-time",children:J_e(v.createdAt)}),(v.userId||v.sessionId)&&o.jsx("small",{title:[v.userId,v.sessionId].filter(Boolean).join(" · "),children:[v.userId,v.sessionId].filter(Boolean).join(" · ")})]}),o.jsxs("div",{className:`aw-case-output aw-case-cell${E?" is-expanded":""}`,"data-label":"Agent 输出",children:[o.jsx("p",{className:"aw-case-output-preview",title:v.output,children:v.output||"无可见回复"}),v.referenceOutput&&o.jsxs("small",{className:"aw-case-output-preview",title:v.referenceOutput,children:["Reference: ",v.referenceOutput]}),S&&o.jsx("button",{type:"button",className:"aw-case-expand",onClick:A=>{A.stopPropagation(),p==null||p(v.id)},children:E?"收起":"展开"})]}),o.jsx("div",{className:"aw-case-score aw-case-cell","data-label":"评分",children:eSe(v)}),o.jsx("div",{className:`aw-case-reason aw-case-cell${E?" is-expanded":""}`,"data-label":"评分理由",children:o.jsx("p",{title:T?v.reason:void 0,children:T?v.reason||"暂无评分理由":"—"})}),o.jsx("div",{className:"aw-case-actions aw-case-cell","data-label":"操作",children:_&&o.jsx("button",{type:"button",className:"aw-case-delete",onClick:A=>{A.stopPropagation(),m==null||m(v)},disabled:u,title:"删除反馈案例","aria-label":"删除反馈案例",children:o.jsx(pSe,{})})})]},v.id)})]})}function gSe({group:e,agents:t,cases:n,onChange:s,onRun:i}){const[r,a]=g.useState("config"),l=e.agentIds.map(f=>t.find(h=>h.id===f)).filter(f=>!!f),c=["回答质量","事实准确性","工具调用","响应效率"];g.useEffect(()=>a("config"),[e.id]);const u=f=>{s({...e,agentIds:e.agentIds.includes(f)?e.agentIds.filter(h=>h!==f):[...e.agentIds,f]})},d=f=>{s({...e,metrics:e.metrics.includes(f)?e.metrics.filter(h=>h!==f):[...e.metrics,f]})};return o.jsxs("main",{className:"aw-main",children:[o.jsxs("div",{className:"aw-eval-head",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"aw-agent-title-row",children:[o.jsx("h2",{children:e.name}),o.jsx("span",{children:"评测组"})]}),o.jsxs("p",{children:[l.length," 个参评智能体 · ",e.caseSet," · ",e.history.length," 次运行"]})]}),o.jsxs("button",{type:"button",className:"aw-run",onClick:()=>i(e),disabled:!0,children:[o.jsx(Uee,{"aria-hidden":!0}),"开始评测"]})]}),o.jsxs("nav",{className:"aw-agent-tabs","aria-label":"评测组详情",children:[o.jsx("button",{type:"button",className:r==="config"?"is-active":"","aria-pressed":r==="config",onClick:()=>a("config"),disabled:!0,children:"评测配置"}),o.jsx("button",{type:"button",className:r==="history"?"is-active":"","aria-pressed":r==="history",onClick:()=>a("history"),disabled:!0,children:"历史结果"})]}),o.jsx("div",{className:"aw-content",children:r==="config"?o.jsxs("div",{className:"aw-eval-setup",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"参评智能体"}),o.jsxs("span",{children:["已选择 ",l.length," 个"]})]}),o.jsx("div",{className:"aw-eval-agent-grid",children:t.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.agentIds.includes(f.id),onChange:()=>u(f.id)}),o.jsxs("span",{children:[o.jsx("strong",{children:f.label}),o.jsx("small",{children:f.remote?"远程":"本地"})]})]},f.id))})]}),o.jsxs("div",{className:"aw-eval-setting-grid",children:[o.jsxs("section",{className:"aw-eval-block",children:[o.jsx("div",{className:"aw-card-head",children:o.jsx("strong",{children:"评测资源"})}),o.jsxs("div",{className:"aw-eval-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"评测集"}),o.jsxs("select",{value:e.caseSet,onChange:f=>s({...e,caseSet:f.currentTarget.value}),children:[o.jsx("option",{children:"核心回归集"}),o.jsx("option",{children:"安全边界集"}),o.jsx("option",{children:"工具调用集"})]}),o.jsxs("small",{children:[n.length," 条案例"]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"评估器"}),o.jsxs("select",{value:e.evaluator,onChange:f=>s({...e,evaluator:f.currentTarget.value}),children:[o.jsx("option",{children:"综合质量评估器"}),o.jsx("option",{children:"事实一致性评估器"}),o.jsx("option",{children:"工具调用评估器"})]})]}),o.jsxs("label",{children:[o.jsx("span",{children:"并发数"}),o.jsxs("select",{value:e.concurrency,onChange:f=>s({...e,concurrency:f.currentTarget.value}),children:[o.jsx("option",{value:"2",children:"2"}),o.jsx("option",{value:"4",children:"4"}),o.jsx("option",{value:"8",children:"8"})]})]})]})]}),o.jsxs("section",{className:"aw-eval-block",children:[o.jsxs("div",{className:"aw-card-head",children:[o.jsx("strong",{children:"评测指标"}),o.jsxs("span",{children:["已选择 ",e.metrics.length," 项"]})]}),o.jsx("div",{className:"aw-metric-list",children:c.map(f=>o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:e.metrics.includes(f),onChange:()=>d(f)}),o.jsx("span",{children:f})]},f))})]})]})]}):o.jsxs("section",{className:"aw-eval-history",children:[o.jsx("div",{className:"aw-section-head",children:o.jsxs("div",{children:[o.jsx("h3",{children:"历史结果"}),o.jsx("p",{children:"查看该评测组历次运行的总体表现。"})]})}),e.history.length===0?o.jsxs("div",{className:"aw-results-empty",children:[o.jsx("strong",{children:"暂无历史结果"}),o.jsx("span",{children:"完成首次评测后,结果会出现在这里。"})]}):o.jsx("div",{className:"aw-history-list",children:e.history.map((f,h)=>o.jsxs("button",{type:"button",children:[o.jsxs("span",{children:[o.jsxs("strong",{children:["评测运行 #",e.history.length-h]}),o.jsxs("small",{children:[f.createdAt," · ",l.length," 个智能体"]})]}),o.jsxs("span",{className:"aw-history-score",children:[o.jsx("strong",{children:f.score}),o.jsx("small",{children:"综合得分"})]}),o.jsxs("span",{className:"aw-complete",children:[o.jsx(Ha,{}),"已完成"]}),o.jsx(Kp,{"aria-hidden":!0})]},f.id))})]})})]})}function mH(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.offsetWidth;let s=.985;n<=80?s=.96:n<=150?s=.97:n<=220?s=.98:n>600&&(s=.995),t.style.setProperty("--scale",s.toString())},MN=(e,t)=>{const n=()=>{const a=setTimeout(e);return()=>{clearTimeout(a)}};if(!vSe||typeof window.requestAnimationFrame!="function"||bH&&document.visibilityState==="hidden")return n();let i=2,r=window.requestAnimationFrame(function a(){i-=1,i===0?e():r=window.requestAnimationFrame(a)});return()=>{typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(r)}},wSe=e=>Object.keys(e).reduce((n,s)=>{const i=e[s];if(i||i===0){const r=s.startsWith("--")?"":"--",a=typeof i=="number"?`${i}px`:i;n[`${r}${s}`]=a}return n},{}),_Se=e=>{const t=g.Children.toArray(e),n=[];let s="";const i=()=>{s!==""&&(n.push(s),s="")};for(const r of t)if(!(r==null||typeof r=="boolean")){if(typeof r=="string"||typeof r=="number"){s+=String(r);continue}i(),n.push(r)}return i(),n},xH=e=>{const t=_Se(e),n=g.Children.count(t);return g.Children.map(t,s=>{if(typeof s=="string"&&s.trim())return n<=1?s:o.jsx("span",{children:s});if(g.isValidElement(s)){const i=s,{children:r,...a}=i.props;return r!=null?g.cloneElement(i,a,xH(r)):i}return s})};g.createContext(null);var SSe=typeof Bl=="object"&&Bl&&Bl.Object===Object&&Bl,NSe=typeof self=="object"&&self&&self.Object===Object&&self;SSe||NSe||Function("return this")();var TSe=typeof window<"u"?g.useLayoutEffect:g.useEffect;function kSe(){const e=g.useRef(!1);return g.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),g.useCallback(()=>e.current,[])}var E3={width:void 0,height:void 0};function ASe(e){const{ref:t,box:n="content-box"}=e,[{width:s,height:i},r]=g.useState(E3),a=kSe(),l=g.useRef({...E3}),c=g.useRef(void 0);return c.current=e.onResize,g.useEffect(()=>{if(!t.current||typeof window>"u"||!("ResizeObserver"in window))return;const u=new ResizeObserver(([d])=>{const f=n==="border-box"?"borderBoxSize":n==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",h=v3(d,f,"inlineSize"),p=v3(d,f,"blockSize");if(l.current.width!==h||l.current.height!==p){const b={width:h,height:p};l.current.width=h,l.current.height=p,c.current?c.current(b):a()&&r(b)}});return u.observe(t.current,{box:n}),()=>{u.disconnect()}},[n,t,a]),{width:s,height:i}}function v3(e,t,n){return e[t]?Array.isArray(e[t])?e[t][0][n]:e[t][n]:t==="contentBoxSize"?e.contentRect[n==="inlineSize"?"width":"height"]:void 0}function CSe(e,t){const n=g.useRef(e);TSe(()=>{n.current=e},[e]),g.useEffect(()=>{if(!t&&t!==0)return;const s=setTimeout(()=>{n.current()},t);return()=>{clearTimeout(s)}},[t])}const ISe="_LoadingIndicator_7yl6f_1",jSe={LoadingIndicator:ISe},RSe=({className:e,size:t,strokeWidth:n,style:s,...i})=>o.jsx("div",{...i,className:ga(jSe.LoadingIndicator,e),style:s||wSe({"indicator-size":t,"indicator-stroke":n})});function OSe(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}const MSe=()=>gH,w3=(e,t=!1,n="TransitionGroup")=>{const s=[];return g.Children.forEach(e,i=>{if(i&&typeof i=="object"&&"key"in i&&i.key)s.push(i);else if(t)throw new Error(`Child elements of <${n} /> must include a \`key\``)}),s},id=()=>{},rd=e=>{const t=g.useRef(e);return t.current=e,g.useCallback(n=>t.current(n),[])};function LSe(e,t,n,s){const i=e.reduce((c,u)=>({...c,[u.key]:1}),{}),r=t.reduce((c,u)=>({...c,[u.component.key]:1}),{}),a=e.filter(c=>!r[c.key]).map(n),l=t.map(c=>({...c,component:e.find(({key:u})=>u===c.component.key)||c.component,shouldRender:!!i[c.component.key]}));return s==="append"?l.concat(a):a.concat(l)}function DSe(e,t,n){if((gH||ySe)&&t&&n>1)throw new Error(`Cannot use forwardRef with multiple children in <${e} />`)}const PSe="_TransitionGroupChild_1hv1z_1",BSe={TransitionGroupChild:PSe},EH={enter:!1,enterActive:!1,exit:!1,exitActive:!1,interrupted:!1},USe=e=>({...EH,enter:!e}),FSe=(e,t)=>{switch(t.type){case"enter-before":return{enter:!0,enterActive:!1,exit:!1,exitActive:!1,interrupted:e.interrupted||e.exit};case"enter-active":return{enter:!0,enterActive:!0,exit:!1,exitActive:!1,interrupted:!1};case"exit-before":return{enter:!1,enterActive:!1,exit:!0,exitActive:!1,interrupted:e.interrupted||e.enter};case"exit-active":return{enter:!1,enterActive:!1,exit:!0,exitActive:!0,interrupted:!1};case"done":default:return EH}},$Se=({ref:e,as:t,children:n,className:s,transitionId:i,style:r,preventMountTransition:a,shouldRender:l,enterDuration:c,exitDuration:u,removeChild:d,onEnter:f,onEnterActive:h,onEnterComplete:p,onExit:m,onExitActive:b,onExitComplete:v})=>{const[y,x]=g.useReducer(FSe,USe(a||!1)),E=g.useRef(!1),w=g.useRef(null),S=g.useRef(c);S.current=c;const _=g.useRef(u);_.current=u;const T=g.useRef(null),k=g.useCallback(A=>{const j=w.current;if(!(!j||A===T.current))switch(T.current=A,A){case"enter":f(j);break;case"enter-active":h(j);break;case"enter-complete":p(j);break;case"exit":m(j);break;case"exit-active":b(j);break;case"exit-complete":v(j);break}},[f,h,p,m,b,v]);return Lt.useLayoutEffect(()=>{if(!l){let R;x({type:"exit-before"}),k("exit");const B=MN(()=>{x({type:"exit-active"}),k("exit-active"),R=window.setTimeout(()=>{k("exit-complete"),d()},_.current)});return()=>{B(),R!==void 0&&clearTimeout(R)}}if(a&&!E.current){E.current=!0;return}let A;x({type:"enter-before"}),k("enter");const j=MN(()=>{x({type:"enter-active"}),k("enter-active"),A=window.setTimeout(()=>{x({type:"done"}),k("enter-complete")},S.current)});return()=>{j(),A!==void 0&&clearTimeout(A)}},[l,a,d,k]),g.useEffect(()=>()=>{E.current=!1},[]),o.jsx(t,{ref:OSe([w,e]),className:ga(s,BSe.TransitionGroupChild),"data-transition-id":i,style:r,"data-entering":y.enter?"":void 0,"data-entering-active":y.enterActive?"":void 0,"data-exiting":y.exit?"":void 0,"data-exiting-active":y.exitActive?"":void 0,"data-interrupted":y.interrupted?"":void 0,children:n})},HSe=e=>{const{enterMountDelay:t,preventMountTransition:n}=e,s=!n&&t!=null?t:null,[i,r]=g.useState(s==null);return CSe(()=>r(!0),i?null:s),i?o.jsx($Se,{...e}):null},zSe=e=>{const{ref:t,as:n="span",children:s,className:i,transitionId:r,style:a,enterDuration:l=0,exitDuration:c=0,preventInitialTransition:u=!0,enterMountDelay:d,insertMethod:f="append",disableAnimations:h=MSe()}=e,p=rd(e.onEnter??id),m=rd(e.onEnterActive??id),b=rd(e.onEnterComplete??id),v=rd(e.onExit??id),y=rd(e.onExitActive??id),x=rd(e.onExitComplete??id);g.Children.forEach(s,_=>{if(_&&!_.key)throw new Error("Child elements of must include a `key`")});const E=g.useCallback(_=>({component:_,shouldRender:!0,removeChild:()=>{S(T=>T.filter(k=>_.key!==k.component.key))},onEnter:p,onEnterActive:m,onEnterComplete:b,onExit:v,onExitActive:y,onExitComplete:x}),[p,m,b,v,y,x]),[w,S]=g.useState(()=>w3(s).map(_=>({...E(_),preventMountTransition:u})));return g.useLayoutEffect(()=>{S(_=>{const T=w3(s);return LSe(T,_,E,f)})},[s,f,E]),DSe("TransitionGroup",t,g.Children.count(s)),h?o.jsx(o.Fragment,{children:g.Children.map(s,_=>o.jsx(n,{ref:t,className:i,style:a,"data-transition-id":r,children:_}))}):o.jsx(o.Fragment,{children:w.map(({component:_,...T})=>o.jsx(HSe,{...T,as:n,className:i,transitionId:r,enterDuration:l,exitDuration:c,enterMountDelay:d,style:a,ref:t,children:_},_.key))})},VSe="_Button_1864l_1",GSe="_ButtonInner_1864l_4",KSe="_ButtonLoader_1864l_749",Bw={Button:VSe,ButtonInner:GSe,ButtonLoader:KSe},_3=e=>{const{type:t="button",color:n="primary",variant:s="solid",pill:i=!0,uniform:r=!1,size:a="md",iconSize:l,gutterSize:c,loading:u,selected:d,block:f,opticallyAlign:h,children:p,className:m,onClick:b,disabled:v,disabledTone:y,inert:x=u,...E}=e,w=v||x,S=g.useCallback(_=>{v||b==null||b(_)},[b,v]);return o.jsxs("button",{type:t,className:ga(Bw.Button,m),"data-color":n,"data-variant":s,"data-pill":i?"":void 0,"data-uniform":r?"":void 0,"data-size":a,"data-gutter-size":c,"data-icon-size":l,"data-loading":u?"":void 0,"data-selected":d?"":void 0,"data-block":f?"":void 0,"data-optically-align":h,onPointerEnter:yH,disabled:w,"aria-disabled":w,tabIndex:w?-1:void 0,"data-disabled":v?"":void 0,"data-disabled-tone":v?y:void 0,onClick:S,...E,children:[o.jsx(zSe,{className:Bw.ButtonLoader,enterDuration:250,exitDuration:150,children:u&&o.jsx(RSe,{},"loader")}),o.jsx("span",{className:Bw.ButtonInner,children:xH(p)})]})},qSe=e=>o.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",...e,children:o.jsx("path",{fillRule:"evenodd",d:"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2Zm4.465 6.763a1 1 0 0 0-1.228-1.228l-5.5 1.5a1 1 0 0 0-.702.702l-1.5 5.5a1 1 0 0 0 1.228 1.228l5.5-1.5a1 1 0 0 0 .702-.702l1.5-5.5Zm-6.54 5.312.89-3.26 3.26-.89-.89 3.26-3.26.89Z",clipRule:"evenodd"})}),YSe="_EmptyMessage_1r5gu_1",WSe="_IconBadge_1r5gu_16",XSe="_Title_1r5gu_54",QSe="_Description_1r5gu_69",ZSe="_ActionRow_1r5gu_77",Bg={EmptyMessage:YSe,IconBadge:WSe,Title:XSe,Description:QSe,ActionRow:ZSe},ns=({children:e,className:t,fill:n="static"})=>o.jsx("div",{className:ga(Bg.EmptyMessage,t),"data-fill":n,children:e}),JSe=({size:e="md",color:t="secondary",children:n,className:s})=>o.jsx("div",{className:ga(Bg.IconBadge,s),"data-size":e,"data-color":t,children:n}),eNe=({children:e,className:t,color:n="secondary"})=>o.jsx("div",{className:ga(Bg.Title,t),"data-color":n,children:e}),tNe=({children:e,className:t})=>o.jsx("div",{className:ga(Bg.Description,t),children:e}),nNe=({children:e,className:t})=>o.jsx("div",{className:ga(Bg.ActionRow,t),children:e});ns.Icon=JSe;ns.Title=eNe;ns.Description=tNe;ns.ActionRow=nNe;const dr="/web/sandbox/sessions",S3=3e4,N3=33e4,sNe=6e4,iNe=6e5,Uw=15e3,Uo=6e4,rNe=33e4,T3=40;function iE(e){switch(e.trim().toLowerCase()){case"ready":return"就绪";case"creating":return"创建中";case"starting":case"initializing":return"启动中";case"pending":return"等待中";case"running":return"运行中";case"failed":case"error":return"异常";case"stopped":return"已停止";case"expired":return"已过期";case"deleting":return"删除中";case"deleted":return"已删除";default:return"未知状态"}}function li(e){const t=Ex(e);return t.has("Accept")||t.set("Accept","application/json"),t}async function ci(e,t){const n=await e.text().catch(()=>"");let s={};try{s=JSON.parse(n)}catch{const c=`${t}(HTTP ${e.status})`;return new Error(n?`${c}:${n}`:c)}const i=s.detail,r=i&&typeof i=="object"&&"message"in i?i.message:i??s.error??s.message,a=typeof r=="string"?r:r==null?"":JSON.stringify(r),l=`${t}(HTTP ${e.status})`;return new Error(a?`${l}:${a}`:l)}function ad(e,t="codex"){if(!e.sessionId||!e.status)throw new Error("AgentKit 沙箱返回了无效的 Session 信息。");return{id:e.sessionId,toolName:t,userSessionId:e.userSessionId??"",displayName:e.displayName??"",status:e.status,createdAt:e.createdAt??"",expireAt:e.expireAt??"",toolType:e.toolType??"",createdBy:e.createdBy??"",threadId:e.threadId??"",cwd:e.cwd??"",workspaceLocked:e.workspaceLocked===!0,busy:e.busy===!0,...typeof e.model=="string"?{model:e.model}:{},permissions:rE(e.permissions)}}const ip={approvalPolicy:"on-request",approvalsReviewer:"user",sandboxMode:"workspace-write",networkAccess:!1};function rE(e){if(!e||typeof e!="object")return{...ip};const t=e,n=t.approvalPolicy,s=t.approvalsReviewer,i=t.sandboxMode;return{approvalPolicy:n==="untrusted"||n==="on-request"||n==="never"?n:ip.approvalPolicy,approvalsReviewer:s==="user"||s==="auto_review"?s:ip.approvalsReviewer,sandboxMode:i==="read-only"||i==="workspace-write"||i==="danger-full-access"?i:ip.sandboxMode,networkAccess:typeof t.networkAccess=="boolean"?t.networkAccess:ip.networkAccess}}function k3(e){if(!e||typeof e!="object")throw new Error("Sandbox 返回了无效设置。");const t=e;return{threadId:typeof t.threadId=="string"?t.threadId:"",cwd:typeof t.cwd=="string"?t.cwd:"",...typeof t.model=="string"?{model:t.model}:{},workspaceLocked:t.workspaceLocked===!0,busy:t.busy===!0,permissions:rE(t.permissions)}}function ja(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function aNe(e){const t=ja(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,displayName:typeof t.displayName=="string"?t.displayName:t.id,description:typeof t.description=="string"?t.description:"",isDefault:t.isDefault===!0}}function oNe(e){const t=ja(e);if(!(!t||typeof t.id!="string"||!t.id||typeof t.name!="string"||!t.name))return{id:t.id,name:t.name,description:typeof t.description=="string"?t.description:""}}function vH(e){const t=ja(e);if(!(!t||typeof t.id!="string"||!t.id))return{id:t.id,...typeof t.name=="string"&&t.name?{name:t.name}:{},preview:typeof t.preview=="string"?t.preview:"",cwd:typeof t.cwd=="string"?t.cwd:"",modelProvider:typeof t.modelProvider=="string"?t.modelProvider:"",createdAt:typeof t.createdAt=="number"&&Number.isFinite(t.createdAt)?t.createdAt:0,updatedAt:typeof t.updatedAt=="number"&&Number.isFinite(t.updatedAt)?t.updatedAt:0,status:typeof t.status=="string"?t.status:"unknown"}}function hb(e){const t=ja(e),n=vH(t==null?void 0:t.thread);if(!t||!n||typeof t.threadId!="string"||!Array.isArray(t.messages))throw new Error("Sandbox 返回了无效 Thread 快照。");const s=t.messages.flatMap(i=>{const r=ja(i);if(!r||typeof r.id!="string"||r.role!=="user"&&r.role!=="assistant"||typeof r.content!="string"||typeof r.timestamp!="number")return[];const a=Array.isArray(r.skillNames)?r.skillNames.filter(l=>typeof l=="string"&&!!l):[];return[{id:r.id,role:r.role,content:r.content,timestamp:r.timestamp,...a.length?{skillNames:a}:{}}]});return{thread:n,threadId:t.threadId,messages:s,...typeof t.model=="string"?{model:t.model}:{},...typeof t.cwd=="string"?{cwd:t.cwd}:{},workspaceLocked:t.workspaceLocked===!0,permissions:rE(t.permissions)}}function LN(e){if(!e||typeof e!="object")return;const t=e;if(![t.totalTokens,t.inputTokens,t.cachedInputTokens,t.outputTokens,t.reasoningOutputTokens].some(s=>typeof s!="number"||!Number.isFinite(s)||s<0))return{totalTokens:Math.trunc(t.totalTokens),inputTokens:Math.trunc(t.inputTokens),cachedInputTokens:Math.trunc(t.cachedInputTokens),outputTokens:Math.trunc(t.outputTokens),reasoningOutputTokens:Math.trunc(t.reasoningOutputTokens)}}function lNe(e){const t=LN(e.usage);if(!t||typeof e.turnId!="string")return;const n=LN(e.threadTotal),s=e.modelContextWindow;return{turnId:e.turnId,usage:t,...n?{threadTotal:n}:{},...typeof s=="number"&&Number.isFinite(s)&&s>=0?{modelContextWindow:Math.trunc(s)}:{}}}function cNe(e){return typeof e.id!="string"||e.kind!=="command"&&e.kind!=="file"||typeof e.method!="string"?null:{id:e.id,kind:e.kind,method:e.method,...typeof e.reason=="string"?{reason:e.reason}:{},...typeof e.command=="string"?{command:e.command}:{},...typeof e.cwd=="string"?{cwd:e.cwd}:{},...typeof e.grantRoot=="string"?{grantRoot:e.grantRoot}:{},...e.changes!==void 0?{changes:e.changes}:{},...typeof e.threadId=="string"?{threadId:e.threadId}:{},...typeof e.turnId=="string"?{turnId:e.turnId}:{},...typeof e.itemId=="string"?{itemId:e.itemId}:{}}}async function uNe(e,t={}){if(!e.body)throw new Error("沙箱对话服务未返回内容。");const n=e.body.getReader(),s=new TextDecoder;let i="",r="";const a=[],l=new Map;let c;function u(){var p;(p=t.onBlocks)==null||p.call(t,a.map(m=>({...m})))}function d(p){r+=p;const m=a[a.length-1];(m==null?void 0:m.kind)==="text"?m.text+=p:a.push({kind:"text",text:p}),u()}function f(p){if(typeof p.id!="string"||p.kind!=="thinking"&&p.kind!=="tool"||p.status!=="running"&&p.status!=="done")return;const m=p.status==="done";let b;if(p.kind==="thinking"){if(typeof p.text!="string"||!p.text)return;b={kind:"thinking",text:p.text,done:m}}else{if(typeof p.name!="string"||!p.name)return;b={kind:"tool",name:p.name,args:p.args,response:p.response,done:m}}const v=l.get(p.id);v===void 0?(l.set(p.id,a.length),a.push(b)):a[v]=b,u()}function h(p){var y,x,E;let m="message";const b=[];for(const w of p.split(/\r?\n/))w.startsWith("event:")&&(m=w.slice(6).trim()),w.startsWith("data:")&&b.push(w.slice(5).trimStart());if(b.length===0)return;let v;try{v=JSON.parse(b.join(` +`))}catch{throw new Error("沙箱对话服务返回了无法解析的响应。")}if(m==="error")throw new Error(typeof v.message=="string"&&v.message?v.message:"沙箱对话失败,请稍后重试。");if(m==="activity"&&f(v),m==="approval"){const w=cNe(v);w&&((y=t.onApproval)==null||y.call(t,w))}if(m==="usage"){const w=lNe(v);w&&(c=w,(x=t.onUsage)==null||x.call(t,w))}m==="approval_resolved"&&typeof v.approvalId=="string"&&((E=t.onApprovalResolved)==null||E.call(t,v.approvalId)),m==="delta"&&typeof v.text=="string"&&d(v.text),m==="done"&&!r&&typeof v.text=="string"&&d(v.text)}for(;;){const{done:p,value:m}=await n.read();i+=s.decode(m,{stream:!p});const b=i.split(/\r?\n\r?\n/);if(i=b.pop()??"",b.forEach(h),p)break}if(i.trim()&&h(i),a.length===0)throw new Error("沙箱未返回有效回复,请重试。");return{text:r,blocks:a,...c?{usage:c}:{}}}async function Ja(e,t,{method:n="GET",body:s,options:i={},fallback:r}){if(!e)throw new Error("缺少要操作的 AgentKit Session。");const a=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/${t}`),{method:n,headers:li(s===void 0?void 0:{"Content-Type":"application/json"}),...s===void 0?{}:{body:JSON.stringify(s)},signal:Bn(i.signal,Uo)});if(!a.ok)throw await ci(a,r);return a.json()}const cn={async listSessions(e={}){const t=await fetch(Rn(dr),{method:"GET",headers:li(),signal:Bn(e.signal,S3)});if(!t.ok)throw await ci(t,"无法读取 Codex 智能体,请稍后重试。");const n=await t.json();if(!Array.isArray(n.sessions))throw new Error("AgentKit 沙箱返回了无效的 Session 列表。");return n.sessions.map(s=>ad(s))},async startSession(e={}){var n;const t=await fetch(Rn(dr),{method:"POST",headers:li({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((n=e.displayName)==null?void 0:n.trim())??""}),signal:Bn(e.signal,N3)});if(!t.ok)throw await ci(t,"无法启动 AgentKit 沙箱,请稍后重试。");return ad(await t.json())},async listAgentSessions(e,t={}){const n=await fetch(Rn(`/web/${e}/sessions`),{method:"GET",headers:li(),signal:Bn(t.signal,S3)});if(!n.ok)throw await ci(n,`无法读取 ${e} 智能体,请稍后重试。`);const s=await n.json();if(!Array.isArray(s.sessions))throw new Error(`AgentKit 返回了无效的 ${e} Session 列表。`);return s.sessions.map(i=>ad(i,e))},async startAgentSession(e,t={}){var s;const n=await fetch(Rn(`/web/${e}/sessions`),{method:"POST",headers:li({"Content-Type":"application/json"}),body:JSON.stringify({displayName:((s=t.displayName)==null?void 0:s.trim())??""}),signal:Bn(t.signal,N3)});if(!n.ok)throw await ci(n,`无法创建 ${e} 智能体,请稍后重试。`);return ad(await n.json(),e)},async openAgentSession(e,t,n={}){if(!t)throw new Error("缺少要打开的 AgentKit Session。");const s=await fetch(Rn(`/web/${e}/sessions/${encodeURIComponent(t)}/open`),{method:"POST",headers:li(),signal:Bn(n.signal,Uo)});if(!s.ok)throw await ci(s,`无法打开 ${e} 智能体。`);const i=await s.json();if(typeof i.webuiUrl!="string"||!i.webuiUrl.startsWith("/"))throw new Error(`${e} 智能体返回了无效的主页面地址。`);return{session:ad(i,e),kind:e,webuiUrl:Rn(i.webuiUrl)}},async launchAgentTerminal(e,t,n={}){if(!t)throw new Error("缺少要打开 Terminal 的 AgentKit Session。");const s=await fetch(Rn(`/web/${e}/sessions/${encodeURIComponent(t)}/terminal`),{method:"POST",headers:li(),signal:Bn(n.signal,Uo)});if(!s.ok)throw await ci(s,`无法打开 ${e} Terminal。`);const i=await s.json();return{url:wH(i.url,`${e} Terminal`),...typeof i.shellSessionId=="string"?{shellSessionId:i.shellSessionId}:{}}},async deleteAgentSession(e,t,n={}){if(!t)return;const s=await fetch(Rn(`/web/${e}/sessions/${encodeURIComponent(t)}`),{method:"DELETE",headers:li(),signal:Bn(n.signal,Uw)});if(!s.ok&&s.status!==404)throw await ci(s,`无法删除 ${e} 智能体。`)},async connectSession(e,t={}){if(!e)throw new Error("缺少要连接的 AgentKit Session。");const n=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/connect`),{method:"POST",headers:li({"Content-Type":"application/json"}),signal:Bn(t.signal,sNe)});if(!n.ok)throw await ci(n,"无法连接 Codex 智能体,请稍后重试。");const s=ad(await n.json());if(s.status.toLowerCase()!=="ready")throw new Error(`AgentKit Session 尚未就绪,当前状态:${s.status}。`);return s},async sendMessage(e,t={}){var s;if(!e.sessionId||!e.text.trim())throw new Error("内置智能体会话缺少有效的消息内容。");const n=await fetch(Rn(`${dr}/${encodeURIComponent(e.sessionId)}/messages`),{method:"POST",headers:li({Accept:"text/event-stream","Content-Type":"application/json"}),body:JSON.stringify({message:e.text,...(s=e.skillIds)!=null&&s.length?{skillIds:e.skillIds}:{}}),signal:Bn(t.signal,iNe)});if(!n.ok)throw await ci(n,"沙箱对话失败,请稍后重试。");return uNe(n,t)},async getStatus(e,t={}){const n=await Ja(e,"status",{options:t,fallback:"无法读取 Codex 状态。"}),s=k3(n),i=ja(n),r=LN(i==null?void 0:i.threadTotal),a=i==null?void 0:i.modelContextWindow;return{...s,...r?{threadTotal:r}:{},...typeof a=="number"&&Number.isFinite(a)&&a>=0?{modelContextWindow:Math.trunc(a)}:{}}},async listModels(e,t={}){const n=ja(await Ja(e,"models",{options:t,fallback:"无法读取 Codex 模型列表。"}));if(!Array.isArray(n==null?void 0:n.models))throw new Error("Sandbox 返回了无效模型列表。");return n.models.flatMap(s=>{const i=aNe(s);return i?[i]:[]})},async setModel(e,t,n={}){const s=ja(await Ja(e,"model",{method:"PUT",body:{model:t},options:n,fallback:"无法切换 Codex 模型。"}));if(typeof(s==null?void 0:s.model)!="string"||!s.model)throw new Error("Sandbox 返回了无效模型。");return s.model},async listSkills(e,t=!1,n={}){const i=ja(await Ja(e,`skills${t?"?force_reload=true":""}`,{options:n,fallback:"无法读取 Codex Skills。"}));if(!Array.isArray(i==null?void 0:i.skills))throw new Error("Sandbox 返回了无效 Skill 列表。");return i.skills.flatMap(r=>{const a=oNe(r);return a?[a]:[]})},async listThreads(e,t={},n={}){const s=new URLSearchParams;t.cursor&&s.set("cursor",t.cursor),t.search&&s.set("search",t.search),t.archived&&s.set("archived","true");const i=s.size?`?${s}`:"",r=ja(await Ja(e,`threads${i}`,{options:n,fallback:"无法读取 Codex Thread 列表。"}));if(!Array.isArray(r==null?void 0:r.threads))throw new Error("Sandbox 返回了无效 Thread 列表。");return{threads:r.threads.flatMap(a=>{const l=vH(a);return l?[l]:[]}),...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{}}},async newThread(e,t={}){return hb(await Ja(e,"threads/new",{method:"POST",options:t,fallback:"无法创建新的 Codex Thread。"}))},async resumeThread(e,t,n={}){return hb(await Ja(e,"threads/resume",{method:"POST",body:{threadId:t},options:n,fallback:"无法恢复 Codex Thread。"}))},async forkThread(e,t={}){return hb(await Ja(e,"threads/fork",{method:"POST",options:t,fallback:"无法分叉 Codex Thread。"}))},async archiveThread(e,t,n={}){const s=ja(await Ja(e,"threads/archive",{method:"POST",body:{threadId:t},options:n,fallback:"无法归档 Codex Thread。"}));if((s==null?void 0:s.archived)!==!0)throw new Error("Sandbox 返回了无效归档结果。");return{archived:!0,...s.thread?{snapshot:hb(s)}:{}}},async compactThread(e,t={}){await Ja(e,"threads/compact",{method:"POST",options:t,fallback:"无法压缩 Codex Thread。"})},async getSettings(e,t={}){const n=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/settings`),{method:"GET",headers:li(),signal:Bn(t.signal,Uo)});if(!n.ok)throw await ci(n,"无法读取 Codex 权限与工作空间。");return k3(await n.json())},async updatePermissions(e,t,n={}){const s=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/permissions`),{method:"PUT",headers:li({"Content-Type":"application/json"}),body:JSON.stringify(t),signal:Bn(n.signal,Uo)});if(!s.ok)throw await ci(s,"无法更新 Codex 权限。");const i=await s.json();return rE(i.permissions)},async updateWorkspace(e,t,n={}){const s=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/workspace`),{method:"PUT",headers:li({"Content-Type":"application/json"}),body:JSON.stringify({cwd:t}),signal:Bn(n.signal,Uo)});if(!s.ok)throw await ci(s,"无法更新 Codex 工作空间。");const i=await s.json();if(typeof i.cwd!="string"||!i.cwd)throw new Error("Sandbox 返回了无效工作目录。");return i.cwd},async listDirectories(e,t,n={}){const s=new URLSearchParams({path:t}),i=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/directories?${s}`),{method:"GET",headers:li(),signal:Bn(n.signal,Uo)});if(!i.ok)throw await ci(i,"无法读取 Sandbox 目录。");const r=await i.json();if(typeof r.path!="string"||!Array.isArray(r.directories)||r.directories.some(a=>!a||typeof a.name!="string"||typeof a.path!="string"))throw new Error("Sandbox 返回了无效目录列表。");return{path:r.path,...typeof r.parent=="string"?{parent:r.parent}:{},directories:r.directories}},async resolveApproval(e,t,n,s={}){const i=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/approvals/${encodeURIComponent(t)}`),{method:"POST",headers:li({"Content-Type":"application/json"}),body:JSON.stringify({decision:n}),signal:Bn(s.signal,Uo)});if(!i.ok)throw await ci(i,"无法提交 Codex 审批决定。")},async launchTerminal(e,t={}){return A3(e,"terminal",t)},async launchBrowser(e,t={}){return A3(e,"browser",t)},async uploadFile(e,t,n={}){const s=new FormData;s.set("file",t,t.name);const i=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/files`),{method:"POST",headers:li(),body:s,signal:Bn(n.signal,rNe)});if(!i.ok)throw await ci(i,"无法上传文件到 Sandbox。");const r=await i.json();if(typeof r.id!="string"||typeof r.path!="string"||typeof r.name!="string"||typeof r.mimeType!="string"||typeof r.sizeBytes!="number")throw new Error("Sandbox 返回了无效上传结果。");return r},async closeSession(e,t={}){if(!e)return;const n=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/disconnect`),{method:"POST",headers:li(),signal:Bn(t.signal,Uw)});if(!n.ok&&n.status!==404)throw await ci(n,"无法断开 Codex 智能体连接。")},async deleteSession(e,t={}){if(!e)return;const n=await fetch(Rn(`${dr}/${encodeURIComponent(e)}`),{method:"DELETE",headers:li(),signal:Bn(t.signal,Uw)});if(!n.ok&&n.status!==404)throw await ci(n,"无法删除 Codex 智能体。")}};async function A3(e,t,n){const s=await fetch(Rn(`${dr}/${encodeURIComponent(e)}/${t}`),{method:"POST",headers:li(),signal:Bn(n.signal,Uo)});if(!s.ok)throw await ci(s,t==="terminal"?"无法打开 Sandbox Terminal。":"无法打开 Sandbox Browser。");const i=await s.json();return{url:wH(i.url,"Sandbox 工具"),...typeof i.shellSessionId=="string"?{shellSessionId:i.shellSessionId}:{}}}function wH(e,t){if(typeof e!="string")throw new Error(`${t} 返回了无效地址。`);if(e.startsWith("/"))return Rn(e);let n;try{n=new URL(e)}catch{throw new Error(`${t} 返回了无效地址。`)}const s=n.protocol==="http:"&&window.location.protocol==="http:";if(n.protocol!=="https:"&&!s)throw new Error(`${t} 返回了不安全的地址。`);return n.toString()}function Hd(e,t,n){const s=e instanceof Error?`${e.name}: ${e.message}`:String(e||"未知错误");return[`${t}失败`,`详细信息:${s}`,n?`请求:${n}`:""].filter(Boolean).join(` +`)}function dNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M8.4 18.4H7.2a4.2 4.2 0 0 1-.65-8.35A5.7 5.7 0 0 1 17.3 8.2a4.6 4.6 0 0 1-.4 9.2h-3.2"}),o.jsx("path",{d:"m7.8 12.3 2 2-2 2M12.2 16.3h3.2"})]})}function fNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M18.9 6.25A8.4 8.4 0 1 0 19.6 16"}),o.jsx("path",{d:"M19 6.2c.1 2.1-.65 3.75-2.25 4.95-1.2.9-2.75 1.25-4.2.9"}),o.jsx("circle",{cx:"10.6",cy:"12.8",r:"2.45"}),o.jsx("path",{d:"m5.25 18.6 3.65-3.9M14.8 17.9c1.9-.45 3.55-1.65 4.65-3.35"})]})}function hNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6.2 20c.55-2.15.75-4.1.75-6.7V9.8A5.35 5.35 0 0 1 12.35 4c3.35 0 5.65 2.35 5.65 5.65v4.6c0 2.35.35 4.25 1.15 5.75"}),o.jsx("path",{d:"M8.05 10.2c1.35-.6 2.2-1.65 2.55-3.15.45 1.55 1.35 2.55 2.7 3.05.1-1 .4-1.95.85-2.75.45 1.25 1.2 2.2 2.15 2.75"}),o.jsx("path",{d:"M9.3 12.65h.01M14.9 12.65h.01M10.8 15.55c.8.5 1.65.5 2.45 0"}),o.jsx("path",{d:"M8.45 19.85c.95-.85 1.45-1.95 1.5-3.25M15.1 16.65c.05 1.2.55 2.3 1.55 3.2"})]})}function Qm({kind:e,...t}){return e==="codex"?o.jsx(dNe,{...t}):e==="openclaw"?o.jsx(fNe,{...t}):o.jsx(hNe,{...t})}const Fw=[{id:"general",label:"通用智能体"},{id:"codex",label:"Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体"}],pNe=24,mNe=3e4,zd=new Map,of=new Map,gNe=new Set;function pb(e){if(!e){zd.clear(),of.clear();return}const t=new Set(e);if(t.size!==0){for(const[n,s]of of)s.page.runtimes.some(i=>t.has(i.runtimeId))&&of.delete(n);zd.clear()}}function bNe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function $w(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M8 3.25v9.5M3.25 8h9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function yNe({type:e}){return e==="general"?o.jsx(su,{}):o.jsx(Qm,{kind:e})}function gA(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e.slice(0,10):new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t).replace(/\//g,"-")}function C3(e){var t;return{id:e.runtimeId,name:e.name,description:((t=e.description)==null?void 0:t.trim())||"暂无描述",createdAt:gA(e.createdAt??""),specificationLabel:"创建人",specification:e.author||"—",isMine:e.isMine,runtime:{runtimeId:e.runtimeId,region:e.region,currentVersion:e.currentVersion,canDelete:e.canDelete}}}function xNe(e){return{id:e.id,name:e.displayName||`${e.toolName} 智能体`,description:iE(e.status),createdAt:gA(e.createdAt),specificationLabel:"创建人",specification:e.createdBy||"—",sandbox:e}}function ENe(e){var t;return{id:e.id,name:e.draft.name||"未命名 Agent",description:((t=e.draft.description)==null?void 0:t.trim())||"暂无描述",createdAt:gA(new Date(e.updatedAt).toISOString()),specificationLabel:"存储位置",specification:"当前浏览器",draft:e}}async function vNe(e,t,n){const s=`${e}:all:${t}`,i=of.get(s);if(i&&i.expiresAt>Date.now())return n(i.page.runtimes.map(C3)),i.page.nextToken;i&&of.delete(s);let r=zd.get(s);r||(r=Tx({scope:e,region:"all",pageSize:pNe,nextToken:t}),zd.set(s,r),r.then(()=>zd.delete(s),()=>zd.delete(s)));const a=await r;return of.set(s,{page:a,expiresAt:Date.now()+mNe}),n(a.runtimes.map(C3)),a.nextToken}function wNe({agent:e,cloudProvider:t,onUse:n,onViewDetails:s,connecting:i,connected:r,showOwnership:a,deploymentTask:l,onViewDeploymentTask:c,onEditDraft:u,onDeleteDraft:d}){const f=!!(e.runtime||e.sandbox);return o.jsxs("article",{className:"my-agent-card",children:[o.jsxs("div",{className:"my-agent-card-content",children:[o.jsxs("div",{className:"my-agent-card-title",children:[o.jsxs("div",{className:"my-agent-card-title-copy",children:[o.jsx("h3",{children:e.name}),e.sandbox?o.jsx("span",{className:"my-agent-session-id",title:e.sandbox.id,children:e.sandbox.id}):null]}),e.draft?o.jsx("span",{className:"my-agent-draft-badge",children:l?"部署中":"草稿"}):e.sandbox?o.jsx("span",{className:"my-agent-status-label","data-ready":e.sandbox.status.toLowerCase()==="ready"||void 0,children:e.description}):e.runtime?o.jsxs("div",{className:"my-agent-card-badges",children:[l?o.jsx("span",{className:"my-agent-deploying-badge",children:"部署中"}):null,o.jsx("span",{className:"my-agent-region-badge",children:Nf(e.runtime.region,t)}),a&&e.isMine?o.jsx("span",{className:"runtime-owner-badge",children:"我创建的"}):null]}):null]}),e.sandbox?null:o.jsx("p",{className:"my-agent-description",children:e.description}),o.jsxs("dl",{className:"my-agent-meta",children:[o.jsxs("div",{className:"my-agent-created-at",children:[o.jsx("dt",{children:e.draft?"更新时间":"创建时间"}),o.jsx("dd",{children:e.createdAt})]}),o.jsxs("div",{className:"my-agent-region",children:[o.jsx("dt",{children:e.specificationLabel}),o.jsx("dd",{children:e.specification})]})]})]}),o.jsx("footer",{className:"my-agent-actions",children:e.draft?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"my-agent-details","aria-label":l?`查看 ${e.name} 部署进度`:`编辑草稿 ${e.name}`,onClick:()=>l?c==null?void 0:c(l):u==null?void 0:u(e.draft),children:l?"查看进度":"编辑"}),o.jsx("button",{type:"button",className:"my-agent-delete","aria-label":`删除草稿 ${e.name}`,onClick:()=>d==null?void 0:d(e.draft),children:"删除"})]}):o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"my-agent-details",disabled:!f,"aria-label":l?`查看 ${e.name} 部署进度`:`查看 ${e.name} 详情`,onClick:()=>l?c==null?void 0:c(l):s==null?void 0:s(e),children:l?"查看进度":"查看详情"}),o.jsx("button",{type:"button",className:`my-agent-use${r?" is-connected":""}`,disabled:!f||i||r,"aria-busy":i||void 0,"aria-label":r?`${e.name} 已连接`:`使用 ${e.name}`,onClick:()=>void(n==null?void 0:n(e)),children:i?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-use-spinner","aria-hidden":"true"}),o.jsx("span",{children:"连接中"})]}):r?"已连接":"使用"})]})})]})}function _Ne({cloudProvider:e,canCreate:t,runtimeScope:n,onCreateAgent:s,onUseAgent:i,onViewAgentDetails:r,onCreateSandboxAgent:a,onUseSandboxAgent:l,onViewSandboxAgentDetails:c,sandboxRefreshKey:u=0,connectedRuntimeId:d="",hiddenRuntimeIds:f=gNe,drafts:h=[],deploymentTasks:p=[],draftDeploymentTaskIds:m={},onViewDeploymentTask:b,onEditDraft:v,onDeleteDraft:y}){const x=g.useRef(null),E=g.useRef(null),w=g.useRef(0),S=g.useRef(0),_=g.useRef(null),[T,k]=g.useState("general"),[A,j]=g.useState(""),[R,B]=g.useState([]),[z,L]=g.useState(""),[F,C]=g.useState(!0),[I,D]=g.useState(""),[$,O]=g.useState([]),[te,se]=g.useState(!1),[P,Q]=g.useState(""),[ee,V]=g.useState(""),[X,K]=g.useState(null),ce=g.useMemo(()=>h.map(ENe),[h]),he=g.useMemo(()=>{const Ce=new Map,Ve=new Map;for(const Ue of p){if(Ue.status!=="running"||(Ce.set(Ue.id,Ue),!Ue.runtimeId))continue;const W=Ve.get(Ue.runtimeId);(!W||Ue.startedAt>W.startedAt)&&Ve.set(Ue.runtimeId,Ue)}return{byId:Ce,byRuntimeId:Ve}},[p]),be=g.useCallback(Ce=>{var Ue;if(Ce.draft){const W=m[Ce.draft.id];return W?he.byId.get(W):void 0}const Ve=(Ue=Ce.runtime)==null?void 0:Ue.runtimeId;return Ve?he.byRuntimeId.get(Ve):void 0},[he,m]),ue=g.useCallback((Ce,Ve)=>{const Ue=++w.current;return C(!0),D(""),vNe(n,Ce,W=>{w.current===Ue&&B(oe=>Ve?W:[...oe,...W])}).then(W=>{w.current===Ue&&L(W)}).catch(W=>{w.current===Ue&&D(Hd(W,"加载通用智能体","GET /web/runtimes"))}).finally(()=>{w.current===Ue&&C(!1)})},[n]);g.useEffect(()=>{if(T==="general")return B([]),L(""),ue("",!0),()=>{w.current+=1}},[T,ue]);const we=g.useCallback(async Ce=>{var W,oe;(W=_.current)==null||W.abort();const Ve=new AbortController;_.current=Ve;const Ue=++S.current;se(!0),Q(""),O([]);try{const Z=Ce==="codex"?await cn.listSessions({signal:Ve.signal}):await cn.listAgentSessions(Ce,{signal:Ve.signal});if(S.current!==Ue)return;O(Z.map(xNe))}catch(Z){if((Z==null?void 0:Z.name)==="AbortError"||S.current!==Ue)return;Q(Hd(Z,`加载 ${((oe=Fw.find(Ee=>Ee.id===Ce))==null?void 0:oe.label)??Ce}`,`GET /web/${Ce==="codex"?"sandbox":Ce}/sessions`))}finally{_.current===Ve&&(_.current=null),S.current===Ue&&se(!1)}},[]);function Le(Ce){var Ve;Ce!==T&&(Ce==="general"?(w.current+=1,B([]),L(""),D(""),C(!0)):((Ve=_.current)==null||Ve.abort(),_.current=null,S.current+=1,O([]),Q(""),se(!0)),k(Ce))}g.useEffect(()=>{var Ce;if(T==="general"){(Ce=_.current)==null||Ce.abort(),_.current=null,S.current+=1;return}return we(T),()=>{var Ve;(Ve=_.current)==null||Ve.abort(),_.current=null,S.current+=1}},[T,we,u]),g.useEffect(()=>{const Ce=E.current,Ve=x.current;if(!Ce||!Ve||T!=="general"||!z||F)return;const Ue=new IntersectionObserver(([W])=>{W.isIntersecting&&ue(z,!1)},{root:Ve,rootMargin:"240px 0px",threshold:.01});return Ue.observe(Ce),()=>Ue.disconnect()},[T,ue,F,z]);const Ne=g.useCallback(async Ce=>{if(!ee){V(Ce.id);try{await new Promise(Ve=>requestAnimationFrame(()=>Ve())),Ce.sandbox?await l(Ce.sandbox):await i(Ce)}finally{V("")}}},[ee,i,l]),ae=g.useMemo(()=>{const Ce=A.trim().toLocaleLowerCase(),Ve=T==="general"?[...ce,...R]:$,Ue=Ce?Ve.filter(Z=>Z.name.toLocaleLowerCase().includes(Ce)):Ve;if(T!=="general")return Ue;const W=f.size>0?Ue.filter(Z=>!Z.runtime||!f.has(Z.runtime.runtimeId)):Ue,oe=W.findIndex(Z=>{var Ee;return((Ee=Z.runtime)==null?void 0:Ee.runtimeId)===d});return oe<=0?W:[W[oe],...W.slice(0,oe),...W.slice(oe+1)]},[T,d,ce,f,A,R,$]),me=Fw.find(Ce=>Ce.id===T),_e=(me==null?void 0:me.label)??"智能体",Je=T==="general"?F&&R.length===0&&ce.length===0:te&&$.length===0,Pe=!Je&&ae.length===0,Fe=t?T==="general"?()=>s(Ti(e)):()=>a(T):void 0,Ye=t?void 0:"当前账号没有创建智能体权限";return o.jsxs("div",{className:"my-agents-page",children:[o.jsxs("header",{className:"my-agents-header",children:[o.jsxs("div",{className:"my-agents-heading",children:[o.jsx("div",{className:"my-agents-title-row",children:o.jsx("h1",{children:"智能体"})}),o.jsx("p",{children:n==="all"?"在此处浏览所有智能体":"在此处浏览您的所有智能体"})]}),o.jsxs("label",{className:"my-agent-search",children:[o.jsx(bNe,{}),o.jsx("input",{type:"search","aria-label":"搜索智能体",value:A,onChange:Ce=>j(Ce.target.value),placeholder:"搜索所有类型智能体名称"})]})]}),o.jsxs("div",{className:"my-agent-type-bar",children:[o.jsx("nav",{className:"my-agent-type-pills","aria-label":"智能体类型",children:Fw.map(Ce=>o.jsx("button",{type:"button",className:`my-agent-type-pill${T===Ce.id?" is-active":""}`,"aria-pressed":T===Ce.id,onClick:()=>Le(Ce.id),children:Ce.label},Ce.id))}),o.jsxs("button",{type:"button",className:"my-agent-create-primary",disabled:!Fe,title:Ye,onClick:()=>Fe==null?void 0:Fe(),children:[o.jsx($w,{}),o.jsx("span",{children:"创建智能体"})]})]}),o.jsxs("section",{className:"my-agent-results",ref:x,"aria-label":`${_e}列表`,children:[Je?o.jsxs("div",{className:"my-agent-initial-loading",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载智能体"})]}):(T==="general"?I:P)&&ae.length===0?o.jsxs("div",{className:"my-agent-empty",role:"alert",children:[o.jsx("p",{children:T==="general"?I:P}),o.jsx("button",{type:"button",onClick:()=>{T==="general"?ue("",!0):we(T)},children:"重新加载"})]}):Pe?A.trim()?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(ns,{fill:"none",children:[o.jsx(ns.Icon,{children:o.jsx(qSe,{})}),o.jsx(ns.Title,{children:"没有匹配的智能体"}),o.jsx(ns.Description,{children:"请尝试搜索其他名称"})]})}):T!=="general"?o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(ns,{fill:"none",children:[o.jsx(ns.Icon,{children:o.jsx(yNe,{type:T})}),o.jsxs(ns.Title,{children:["暂无 ",_e]}),t?o.jsx(ns.ActionRow,{children:o.jsxs(_3,{color:"primary",size:"lg",onClick:()=>a(T),children:[o.jsx($w,{}),"创建智能体"]})}):null]})}):o.jsx("div",{className:"my-agent-empty-message",children:o.jsxs(ns,{fill:"none",children:[o.jsx(ns.Icon,{children:o.jsx(su,{})}),o.jsx(ns.Title,{children:"暂无通用智能体"}),o.jsx(ns.Description,{children:"创建一个通用智能体,开始构建和对话"}),t?o.jsx(ns.ActionRow,{children:o.jsxs(_3,{color:"primary",size:"lg",onClick:()=>s(Ti(e)),children:[o.jsx($w,{}),"创建智能体"]})}):null]})}):o.jsxs(o.Fragment,{children:[T==="general"&&I?o.jsxs("div",{className:"my-agent-inline-error",role:"alert",children:[o.jsx("span",{children:I}),o.jsx("button",{type:"button",onClick:()=>void ue("",!0),children:"重新加载"})]}):null,o.jsx("div",{className:"my-agent-grid",children:ae.map(Ce=>{var Ve;return o.jsx(wNe,{agent:Ce,cloudProvider:e,deploymentTask:be(Ce),onViewDeploymentTask:b,onUse:Ne,onViewDetails:Ue=>{Ue.sandbox?c(Ue.sandbox):r(Ue)},connecting:Ce.id===ee,connected:((Ve=Ce.runtime)==null?void 0:Ve.runtimeId)===d,showOwnership:n==="all",onEditDraft:v,onDeleteDraft:K},Ce.id)})})]}),T==="general"&&!I&&!Je&&(ae.length>0||!!z)&&o.jsx("div",{className:"my-agent-load-more",ref:E,"aria-live":"polite",children:F?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"my-agent-loading-mark","aria-hidden":"true"}),o.jsx("span",{children:"正在加载更多智能体"})]}):z?o.jsx("span",{children:"继续下滑加载更多"}):o.jsx("span",{children:"已加载全部智能体"})})]}),X?o.jsx(mA,{title:"删除草稿?",description:`删除后将无法恢复“${X.draft.name||"未命名 Agent"}”。`,confirmLabel:"删除草稿",variant:"danger",onCancel:()=>K(null),onConfirm:()=>{y==null||y(X),K(null)}}):null]})}const SNe={id:"coding-agents",kind:"coding-agent",category:"development",icon:"coding-agents",name:"配置 Coding Agents",badge:"本地",badgeTone:"success",description:"将 VeADK 和 AgentKit 内置 Skills 全局配置到 Trae、Claude Code 或 Codex。"},NNe={id:"feishu",kind:"feishu",category:"channels",icon:"feishu",name:"飞书机器人",badge:"Beta",description:"创建飞书机器人,并将消息直接接入 AgentKit Runtime。"},TNe="https://api.github.com",kNe=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,I3=/^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/,ANe=/^[A-Za-z0-9._/-]+$/;function CNe(e,t,n){return e===401||e===403?"GitHub Token 无效或没有仓库写入权限":e===404?"仓库、分支或文件不存在,或 Token 无权访问":e===422?"GitHub 拒绝了提交,请检查分支和文件状态":String((t==null?void 0:t.message)||"").split(n).join("***").trim().slice(0,240)||`GitHub 请求失败(HTTP ${e})`}async function Cc(e,t){const n={Accept:"application/vnd.github+json",Authorization:`Bearer ${t.token}`,"X-GitHub-Api-Version":"2022-11-28"};t.body&&(n["Content-Type"]="application/json");let s;try{s=await fetch(`${TNe}${e}`,{method:t.method||"GET",headers:n,body:t.body?JSON.stringify(t.body):void 0,signal:t.signal})}catch(r){throw t.signal.aborted?r:new Error("连接 GitHub 失败,请检查网络后重试")}const i=await s.json().catch(()=>null);if(!t.expected.includes(s.status))throw new Error(CNe(s.status,i,t.token));return{status:s.status,payload:i}}function Hw(e){return e.split("/").map(encodeURIComponent).join("/")}function INe(e){const t=new TextEncoder().encode(e);let n="";const s=32768;for(let i=0;i({...h,path:bA(h.path,"")})),r=AbortSignal.any([t,AbortSignal.timeout(6e4)]),a=`/repos/${n}`;await Cc(`${a}`,{token:e.token,expected:[200],signal:r});const c=(f=(await Cc(`${a}/git/ref/heads/${Hw(s)}`,{token:e.token,expected:[200],signal:r})).payload.object)==null?void 0:f.sha;if(!c)throw new Error("目标分支缺少有效 Git SHA");const u=jNe(e.branchPrefix);await Cc(`${a}/git/refs`,{token:e.token,expected:[201],signal:r,method:"POST",body:{ref:`refs/heads/${u}`,sha:c}});let d=!0;try{for(const p of i){const m=Hw(p.path),b=await Cc(`${a}/contents/${m}?ref=${encodeURIComponent(s)}`,{token:e.token,expected:[200,404],signal:r});if(p.mustBeNew&&b.status===200)throw new Error(`目标仓库中已存在 ${p.path},未覆盖现有文件`);if(b.status===200&&!b.payload.sha)throw new Error(`目标路径 ${p.path} 不是可更新的文件`);await Cc(`${a}/contents/${m}`,{token:e.token,expected:[200,201],signal:r,method:"PUT",body:{message:p.commitMessage,content:INe(p.content),branch:u,...b.payload.sha?{sha:b.payload.sha}:{}}})}const h=await Cc(`${a}/pulls`,{token:e.token,expected:[201],signal:r,method:"POST",body:{title:e.title,head:u,base:s,body:e.description}});if(!h.payload.number||!h.payload.html_url)throw new Error("GitHub 未返回有效的 Pull Request");return d=!1,{number:h.payload.number,url:h.payload.html_url,branch:u}}finally{d&&await Cc(`${a}/git/refs/heads/${Hw(u)}`,{token:e.token,expected:[204],signal:AbortSignal.timeout(15e3),method:"DELETE"}).catch(()=>{})}}const xA={name:"repository",label:"GitHub Repo",placeholder:"owner/repository",help:"支持 owner/repository 或完整 github.com URL",required:!0},EA={name:"baseBranch",label:"目标分支",placeholder:"main",help:"留空时使用 main,PR 将以此分支为 base",required:!1},SH={name:"runtimeName",label:"Runtime 名称",placeholder:"support-agent",help:"用于 AgentKit 发布配置",required:!0},NH={name:"runtimeId",label:"Runtime ID",placeholder:"rt-xxxxxxxx",help:"持续更新的目标 AgentKit Runtime",required:!0};function vA(e={}){return{repository:"",baseBranch:"main",projectPath:".",runtimeName:"",runtimeId:"",sandboxToolId:"",modelName:"",modelBaseUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",region:"cn-beijing",token:"",...e}}function wA(e){return{repository:e.repository.trim(),baseBranch:e.baseBranch.trim()||"main",region:e.region,token:e.token.trim()}}const RNe=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/,ONe=/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/;function MNe(e){if(!RNe.test(e.sandboxToolId))throw new Error("Sandbox Tool ID 格式不正确");if(!ONe.test(e.modelName))throw new Error("模型名称格式不正确");let t;try{t=new URL(e.modelBaseUrl)}catch{throw new Error("模型 API 地址必须是安全的 HTTPS URL")}if(t.protocol!=="https:"||!t.hostname||t.username||t.password||t.search||t.hash)throw new Error("模型 API 地址必须是安全的 HTTPS URL")}function LNe(e){MNe(e);const t=String.raw`name: PR Automated Review "on": pull_request: @@ -730,7 +730,7 @@ jobs: gh pr review "__GH__ github.event.pull_request.number }}" \ --comment \ --body-file review-body.md -`,n={__GH__:"${{",__REGION__:JSON.stringify(e.region),__SANDBOX_TOOL_ID__:JSON.stringify(e.sandboxToolId),__MODEL_NAME__:JSON.stringify(e.modelName),__MODEL_BASE_URL__:JSON.stringify(e.modelBaseUrl)};return Object.entries(n).reduce((s,[i,r])=>s.split(i).join(r),t)}const DNe={id:"review",kind:"github",category:"development",icon:"github",name:"PR 自动评审",description:"在隔离 Sandbox 中评审代码变更,并将结果发布到 Pull Request。",title:"PR 自动评审",subtitle:"在隔离 Sandbox 中检查代码变更并把结果发布到 Pull Request",panel:"工作流仅评审同仓库的非草稿 PR;fork PR 不会读取仓库 Secrets。",submitLabel:"添加评审并提交 PR",fields:[xA,EA,{name:"sandboxToolId",label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv",required:!0},{name:"modelName",label:"评审模型",placeholder:"doubao-seed-code-preview",help:"注入 Sandbox 的代码评审模型名称",required:!0},{name:"modelBaseUrl",label:"模型 API 地址",placeholder:"https://ark.cn-beijing.volces.com/api/coding/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址",required:!0}],initialValues:vA(),regionHelp:"必须与 Sandbox Tool 所在地域一致",secrets:["VOLCENGINE_ACCESS_KEY、VOLCENGINE_SECRET_KEY(必填)","CODEX_MODEL_API_KEY(必填)","VOLCENGINE_SESSION_TOKEN(使用临时凭据时必填)"],submit(e,t){const n=wA(e);return yA({...n,files:[{path:".github/workflows/codex-pr-review.yml",content:LNe({sandboxToolId:e.sandboxToolId.trim(),modelName:e.modelName.trim(),modelBaseUrl:e.modelBaseUrl.trim(),region:n.region}),commitMessage:"chore: configure PR automated review"}],branchPrefix:"chore/pr-automated-review",title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},t)}},PNe=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,BNe=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;function UNe(e){if(!PNe.test(e.runtimeName))throw new Error("Runtime 名称需以字母开头,且只能包含字母、数字、下划线和连字符");if(!BNe.test(e.runtimeId))throw new Error("Runtime ID 格式不正确")}function NH(e){UNe(e);const t=`name: Publish to AgentKit Runtime +`,n={__GH__:"${{",__REGION__:JSON.stringify(e.region),__SANDBOX_TOOL_ID__:JSON.stringify(e.sandboxToolId),__MODEL_NAME__:JSON.stringify(e.modelName),__MODEL_BASE_URL__:JSON.stringify(e.modelBaseUrl)};return Object.entries(n).reduce((s,[i,r])=>s.split(i).join(r),t)}const DNe={id:"review",kind:"github",category:"development",icon:"github",name:"PR 自动评审",description:"在隔离 Sandbox 中评审代码变更,并将结果发布到 Pull Request。",title:"PR 自动评审",subtitle:"在隔离 Sandbox 中检查代码变更并把结果发布到 Pull Request",panel:"工作流仅评审同仓库的非草稿 PR;fork PR 不会读取仓库 Secrets。",submitLabel:"添加评审并提交 PR",fields:[xA,EA,{name:"sandboxToolId",label:"Sandbox Tool ID",placeholder:"tool-xxxxxxxx",help:"用于运行每次评审的 AgentKit CodeEnv",required:!0},{name:"modelName",label:"评审模型",placeholder:"doubao-seed-code-preview",help:"注入 Sandbox 的代码评审模型名称",required:!0},{name:"modelBaseUrl",label:"模型 API 地址",placeholder:"https://ark.cn-beijing.volces.com/api/coding/v3",help:"必须使用 OpenAI 兼容的 HTTPS 地址",required:!0}],initialValues:vA(),regionHelp:"必须与 Sandbox Tool 所在地域一致",secrets:["VOLCENGINE_ACCESS_KEY、VOLCENGINE_SECRET_KEY(必填)","CODEX_MODEL_API_KEY(必填)","VOLCENGINE_SESSION_TOKEN(使用临时凭据时必填)"],submit(e,t){const n=wA(e);return yA({...n,files:[{path:".github/workflows/codex-pr-review.yml",content:LNe({sandboxToolId:e.sandboxToolId.trim(),modelName:e.modelName.trim(),modelBaseUrl:e.modelBaseUrl.trim(),region:n.region}),commitMessage:"chore: configure PR automated review"}],branchPrefix:"chore/pr-automated-review",title:"chore: 配置 PR 自动评审",description:"新增 GitHub Actions 工作流,在隔离 Sandbox 中评审同仓库 PR,并将结果发布为 GitHub Review。合并前请配置工作流所需 Secrets。"},t)}},PNe=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,BNe=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;function UNe(e){if(!PNe.test(e.runtimeName))throw new Error("Runtime 名称需以字母开头,且只能包含字母、数字、下划线和连字符");if(!BNe.test(e.runtimeId))throw new Error("Runtime ID 格式不正确")}function TH(e){UNe(e);const t=`name: Publish to AgentKit Runtime on: push: @@ -826,7 +826,7 @@ jobs: if not result.success: raise SystemExit(f"AgentKit publish failed: {result.error}") PY -`,n={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(n).reduce((s,[i,r])=>s.split(i).join(r),t)}const FNe={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",fields:[xA,EA,{name:"projectPath",label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py",required:!1},_H,SH],initialValues:vA(),regionHelp:"必须与目标 Runtime 所在地域一致",secrets:["VOLCENGINE_ACCESS_KEY、VOLCENGINE_SECRET_KEY(必填)","VOLCENGINE_SESSION_TOKEN(使用临时凭据时必填)"],submit(e,t){const n=wA(e),s=bA(e.projectPath,".");return yA({...n,files:[{path:".github/workflows/publish-agentkit.yml",content:NH({baseBranch:n.baseBranch,projectPath:s,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:n.region}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 Volcengine Secrets。"},t)}};function $Ne(e,t){return e==="."?t:`${e}/${t}`}function HNe(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}function zNe(e){return Object.fromEntries(Object.entries({"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" +`,n={__BASE_BRANCH__:JSON.stringify(e.baseBranch),__PROJECT_PATH__:JSON.stringify(e.projectPath),__RUNTIME_NAME__:JSON.stringify(e.runtimeName),__RUNTIME_ID__:JSON.stringify(e.runtimeId),__REGION__:JSON.stringify(e.region),__CONCURRENCY_GROUP__:JSON.stringify(`agentkit-runtime-${e.runtimeId}`)};return Object.entries(n).reduce((s,[i,r])=>s.split(i).join(r),t)}const FNe={id:"delivery",kind:"github",category:"development",icon:"github",name:"AgentKit Runtime 持续交付",description:"为您的仓库添加持续交付到 AgentKit Runtime 的自动化工作流。",title:"AgentKit Runtime 持续交付",subtitle:"用 Pull Request 把持续发布配置安全地加入代码仓库",panel:"提交后将在目标仓库创建发布分支,并发起包含 GitHub Actions 工作流的 PR。",submitLabel:"确定并提交 PR",fields:[xA,EA,{name:"projectPath",label:"Agent 项目目录",placeholder:".",help:"留空时使用仓库根目录;目录内需包含挂载完整 Studio App Server 的 app.py",required:!1},SH,NH],initialValues:vA(),regionHelp:"必须与目标 Runtime 所在地域一致",secrets:["VOLCENGINE_ACCESS_KEY、VOLCENGINE_SECRET_KEY(必填)","VOLCENGINE_SESSION_TOKEN(使用临时凭据时必填)"],submit(e,t){const n=wA(e),s=bA(e.projectPath,".");return yA({...n,files:[{path:".github/workflows/publish-agentkit.yml",content:TH({baseBranch:n.baseBranch,projectPath:s,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:n.region}),commitMessage:"feat: publish Agent to AgentKit Runtime"}],branchPrefix:"feat/agentkit-release",title:"feat: 持续发布到 AgentKit Runtime",description:"新增 GitHub Actions 工作流,在目标分支更新时持续发布到 AgentKit Runtime。合并前请配置工作流所需的 Volcengine Secrets。"},t)}};function $Ne(e,t){return e==="."?t:`${e}/${t}`}function HNe(e){return`.github/workflows/publish-agentkit-${e.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"").toLowerCase()||"root"}.yml`}function zNe(e){return Object.fromEntries(Object.entries({"app.py":`"""__PROJECT_NAME__ — a VeADK agent with the full Studio App Server.""" from assistant import root_agent from veadk.integrations.agentkit import create_agentkit_app, run_agentkit_app @@ -934,91 +934,91 @@ __pycache__/ Dockerfile .dockerignore README.md -`}).map(([n,s])=>[n,s.split("__PROJECT_NAME__").join(e)]))}const VNe={id:"template",kind:"github",category:"development",icon:"github",name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",fields:[xA,EA,{name:"projectPath",label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动",required:!0},_H,SH],initialValues:vA({projectPath:"agentkit-basic-agent"}),regionHelp:"必须与目标 Runtime 所在地域一致",secrets:["VOLCENGINE_ACCESS_KEY、VOLCENGINE_SECRET_KEY(必填)","VOLCENGINE_SESSION_TOKEN(使用临时凭据时必填)"],submit(e,t){const n=wA(e),s=wH(n.repository),i=bA(e.projectPath,"agentkit-basic-agent"),r=i==="."?s.split("/").slice(-1)[0]||"agentkit-basic-agent":i.split("/").slice(-1)[0]||"agentkit-basic-agent",a=Object.entries(zNe(r)).map(([l,c])=>({path:$Ne(i,l),content:c,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return a.push({path:HNe(i),content:NH({baseBranch:n.baseBranch,projectPath:i,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:n.region}),commitMessage:"feat: add AgentKit Runtime delivery",mustBeNew:!0}),yA({...n,repository:s,files:a,branchPrefix:"feat/agentkit-basic-template",title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 Volcengine Secrets。"},t)}},I3=[{id:"development",label:"研发"},{id:"channels",label:"消息渠道"}],TH=[SNe,VNe,FNe,DNe,NNe],GNe=new Map(TH.map(e=>[e.id,e]));function KNe(e){const t=GNe.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function qNe(e){const t=KNe(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}const _A="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e";function kH(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}function j3(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function YNe(e){return o.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"m9.2 11.2-2.8 2.7 2.8 2.7M12.1 17.4h4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function WNe({onOpen:e}){var c;const[t,n]=g.useState("development"),[s,i]=g.useState(""),r=g.useDeferredValue(s),a=g.useMemo(()=>{const u=r.trim().toLocaleLowerCase();return TH.filter(d=>d.category===t).filter(d=>!u||`${d.name} ${d.description}`.toLocaleLowerCase().includes(u))},[t,r]),l=(c=I3.find(u=>u.id===t))==null?void 0:c.label;return o.jsxs("div",{className:"applications-page",children:[o.jsxs("header",{className:"applications-header",children:[o.jsxs("div",{children:[o.jsx("h1",{children:"自动化"}),o.jsx("p",{children:"连接研发工具,为智能体扩展自动化工作流"})]}),o.jsxs("label",{className:"applications-search",children:[o.jsx(j3,{}),o.jsx("input",{type:"search","aria-label":"搜索自动化",value:s,onChange:u=>i(u.target.value),placeholder:"搜索自动化"})]})]}),o.jsx("nav",{className:"applications-categories","aria-label":"自动化分类",children:I3.map(u=>o.jsx("button",{type:"button",className:t===u.id?"is-active":"","aria-pressed":t===u.id,onClick:()=>n(u.id),children:u.label},u.id))}),o.jsx("section",{className:"applications-results","aria-label":`${l}自动化列表`,children:a.length?o.jsx("div",{className:"applications-grid",children:a.map(u=>o.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(u.id),"aria-label":`打开${u.name}`,children:[u.icon==="feishu"?o.jsx("img",{className:"application-card-icon application-card-brand-icon",src:_A,alt:"","aria-hidden":"true"}):u.icon==="coding-agents"?o.jsx(YNe,{className:"application-card-icon"}):o.jsx(kH,{className:"application-card-icon"}),o.jsxs("div",{className:"application-card-copy",children:[o.jsxs("div",{className:"application-card-title",children:[o.jsx("h2",{children:u.name}),u.badge?o.jsx("span",{className:`application-card-badge is-${u.badgeTone||"default"}`,children:u.badge}):null]}),o.jsx("p",{children:u.description})]})]},u.id))}):o.jsxs("div",{className:"applications-empty",role:"status",children:[o.jsx(j3,{}),o.jsx("h2",{children:"没有匹配的自动化"}),o.jsx("p",{children:"请尝试搜索其他名称"})]})})]})}function XNe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function QNe({hidden:e,...t}){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),o.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?o.jsx("path",{d:"m4 4 12 12"}):null]})}function R3(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ZNe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function JNe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function zw(e,t,n){const s=t.trim();if(!s)return n?"此项不能为空":"";if(e==="repository"&&!/^(?:https:\/\/github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:\.git)?$/.test(s))return"请输入 owner/repository 或完整 GitHub Repo URL";if(e==="baseBranch"&&(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(s)||s.includes("..")))return"目标分支格式不正确";if(e==="projectPath"&&(s.startsWith("/")||s.split("/").includes("..")))return"请输入仓库内的相对目录";if(e==="runtimeName"&&!/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(s))return"以字母开头,仅支持字母、数字、下划线和连字符";if(e==="runtimeId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(s))return"Runtime ID 格式不正确";if(e==="sandboxToolId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(s))return"Sandbox Tool ID 格式不正确";if(e==="modelName"&&!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(s))return"模型名称格式不正确";if(e==="modelBaseUrl")try{const i=new URL(s);if(i.protocol!=="https:"||i.username||i.password||i.search||i.hash)return"请输入不含凭据、查询参数或锚点的 HTTPS 地址"}catch{return"请输入有效的 HTTPS 地址"}return""}function eTe({automation:e,onBack:t}){const n=qNe(e),[s,i]=g.useState(()=>({...n.initialValues})),[r,a]=g.useState({}),[l,c]=g.useState(""),[u,d]=g.useState(!1),[f,h]=g.useState(!1),[m,p]=g.useState(!1),[b,v]=g.useState(null),y=g.useRef(null);g.useEffect(()=>()=>{var k;return(k=y.current)==null?void 0:k.abort()},[]);const x=(k,T)=>{i(A=>({...A,[k]:T})),r[k]&&a(A=>({...A,[k]:""}))},E=k=>{var j;const T=k==="token"||((j=n.fields.find(R=>R.name===k))==null?void 0:j.required)===!0,A=zw(k,s[k],T);a(R=>({...R,[k]:A}))},w=async k=>{var R;k.preventDefault();const T={};for(const B of n.fields){const z=zw(B.name,s[B.name],B.required);z&&(T[B.name]=z)}const A=zw("token",s.token,!0);if(A&&(T.token=A),a(T),Object.keys(T).length)return;(R=y.current)==null||R.abort();const j=new AbortController;y.current=j,d(!0),c(""),v(null);try{const B=await n.submit(s,j.signal);if(y.current!==j)return;v(B),i(z=>({...z,token:""}))}catch(B){if(j.signal.aborted||y.current!==j)return;c(B instanceof Error?B.message:String(B))}finally{y.current===j&&(y.current=null,d(!1))}},S=k=>{k.key==="Enter"&&(k.nativeEvent.isComposing||k.nativeEvent.keyCode===229)&&k.preventDefault()},_=k=>{const{name:T,label:A,placeholder:j,help:R,required:B}=k;return o.jsxs("div",{className:"github-field",children:[o.jsxs("label",{htmlFor:`github-${T}`,children:[o.jsx("span",{children:A}),o.jsx("span",{className:`github-field-requirement${B?" is-required":""}`,children:B?"必填":"可选"})]}),o.jsx("input",{id:`github-${T}`,value:s[T],onChange:z=>x(T,z.target.value),onBlur:()=>E(T),placeholder:j,required:B,"aria-invalid":!!r[T],"aria-describedby":`github-${T}-help${r[T]?` github-${T}-error`:""}`}),o.jsx("span",{id:`github-${T}-help`,className:"github-field-help",children:R}),r[T]?o.jsx("span",{id:`github-${T}-error`,className:"github-field-error",role:"alert",children:r[T]}):null]},T)};return o.jsxs("div",{className:"github-integration-page",children:[o.jsxs("header",{className:"github-integration-header",children:[o.jsx("button",{type:"button",className:"github-back",onClick:t,"aria-label":"返回自动化列表",children:o.jsx(XNe,{})}),o.jsx(kH,{className:"github-integration-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:n.title}),o.jsx("p",{children:n.subtitle})]})]}),o.jsx("div",{className:"github-integration-layout",children:o.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[o.jsx("div",{className:"github-panel-heading",children:o.jsx("p",{children:n.panel})}),o.jsxs("form",{className:"github-release-form",onSubmit:w,onKeyDown:S,noValidate:!0,children:[o.jsxs("div",{className:"github-field-grid",children:[n.fields.map(_),o.jsxs("div",{className:"github-field",children:[o.jsxs("label",{id:"github-region-label",children:[o.jsx("span",{children:"地域"}),o.jsx("span",{className:"github-field-requirement is-required",children:"必填"})]}),o.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:k=>{k.key==="Escape"&&p(!1)},children:[o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":m,onClick:()=>p(k=>!k),children:[o.jsx("span",{children:s.region==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(ZNe,{className:`pp-region-chevron${m?" is-open":""}`})]}),m?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>p(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"地域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(k=>{const T=k.value===s.region;return o.jsxs("button",{type:"button",role:"option","aria-selected":T,className:`pp-region-option${T?" is-selected":""}`,onClick:()=>{x("region",k.value),p(!1)},children:[o.jsx("span",{children:k.label}),T?o.jsx(JNe,{}):null]},k.value)})})]}):null]}),o.jsx("span",{className:"github-field-help",children:n.regionHelp})]})]}),o.jsxs("div",{className:"github-field github-token-field",children:[o.jsxs("div",{className:"github-token-label-row",children:[o.jsxs("label",{htmlFor:"github-token",children:[o.jsx("span",{children:"GitHub Token"}),o.jsx("span",{className:"github-field-requirement is-required",children:"必填"})]}),o.jsxs("a",{href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Create%20a%20GitHub%20automation%20pull%20request&contents=write&pull_requests=write",target:"_blank",rel:"noreferrer",children:["获取 Token",o.jsx(R3,{})]})]}),o.jsxs("div",{className:"github-token-input",children:[o.jsx("input",{id:"github-token",type:f?"text":"password",value:s.token,onChange:k=>x("token",k.target.value),onBlur:()=>E("token"),autoComplete:"off",required:!0,placeholder:"需要仓库 Contents 与 Pull requests 写权限","aria-invalid":!!r.token,"aria-describedby":`github-token-help${r.token?" github-token-error":""}`}),o.jsx("button",{type:"button",onClick:()=>h(k=>!k),"aria-label":f?"隐藏 Token":"显示 Token",title:f?"隐藏 Token":"显示 Token",children:o.jsx(QNe,{hidden:f})})]}),o.jsx("span",{id:"github-token-help",className:"github-field-help",children:"Token 仅用于本次提交,不会保存在浏览器或写入 PR"}),r.token?o.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r.token}):null]}),l?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:l}):null,b?o.jsxs("div",{className:"github-submit-message is-success",role:"status",children:[o.jsxs("span",{children:["PR #",b.number," 已创建"]}),o.jsxs("a",{href:b.url,target:"_blank",rel:"noreferrer",children:["在 GitHub 查看",o.jsx(R3,{})]})]}):null,o.jsxs("div",{className:"github-form-actions",children:[o.jsxs("div",{className:"github-secrets-note",children:[o.jsx("strong",{children:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:"}),n.secrets.map(k=>o.jsx("span",{children:k},k))]}),o.jsx("button",{type:"submit",disabled:u,children:u?"提交 PR 中…":n.submitLabel})]})]})]})})]})}function tTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function nTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function sTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function iTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function rTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function aTe(e,t){return t==="build"?"build_failed":(e==null?void 0:e.name)==="RuntimeProbeError"?"runtime_probe_error":e instanceof DOMException&&e.name==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function yh(e){return(e instanceof Error?e.message:String(e)).replace(/\b((?:app[_-]?)?secret|token|api[_-]?key|password)\b\s*[:=]\s*["']?[^"',\s}]+/gi,"$1=").slice(0,300)}const oTe="modulepreload",lTe=function(e){return"/"+e},O3={},au=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=lTe(c),c in O3)return;O3[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":oTe,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})},M3=new Set;let O1={enabled:!1},es,zf=null,L3=null,Kd="",DN="unknown",AH="unknown",tg=[];function cTe(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}function uTe(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>[t,cTe(n)]))}function dTe(e){return e?Object.fromEntries(Object.entries(e).filter(([,t])=>Number.isFinite(t))):{}}function fTe(){return new Date().toISOString().slice(0,10)}function hTe(e){if(!e)return!0;if(e.dedupeKey){if(M3.has(e.dedupeKey))return!1;M3.add(e.dedupeKey)}if(e.dailyDedupeKey&&typeof localStorage<"u"){const t=`veadk.studio.telemetry.${fTe()}.${e.dailyDedupeKey}`;try{if(localStorage.getItem(t)==="1")return!1;localStorage.setItem(t,"1")}catch{}}return!0}function CH(e){if(zf){try{zf("report",{ev_type:"custom",payload:{...e,type:"event"},extra:{timestamp:Date.now()}})}catch(t){console.warn("[telemetry] failed to send Studio event:",t)}return}tg=[...tg.slice(-49),e]}function mTe(){if(!zf)return;const e=tg;tg=[];for(const t of e)CH(t)}function pTe(e){if(O1=e,es=e.studio,!e.enabled||!e.apmplus||L3)return;const t=e.apmplus;L3=au(()=>import("./index.esm-Bao40dC4.js"),[]).then(n=>{var i;const s=n.default;s("init",{aid:t.aid,token:t.token,domain:t.domain,env:t.env,release:(i=e.studio)==null?void 0:i.version,userId:Kd||void 0}),s("start"),zf=s,mTe()}).catch(n=>{console.warn("[telemetry] APMPlus SDK failed to initialize:",n),O1={enabled:!1},tg=[]})}function xr(e,t={},n,s){if(!O1.enabled||!O1.apmplus||!hTe(s))return;const i=e!=="studio_instance_loaded"?{user_id:Kd,user_role:DN,user_source:AH}:{};CH({name:e,categories:uTe({studio_deploy_id:es==null?void 0:es.deployId,user_pool_id:es==null?void 0:es.userPoolId,vefaas_application_id:es==null?void 0:es.applicationId,vefaas_function_id:es==null?void 0:es.functionId,studio_region:es==null?void 0:es.region,studio_project:es==null?void 0:es.project,studio_version:es==null?void 0:es.version,...i,...t}),metrics:dTe(n)})}function gTe(e){if(Kd=e.userId.trim(),!!Kd){if(DN=e.role??"unknown",AH=e.local?"local":"sso",zf)try{zf("config",{userId:Kd})}catch(t){console.warn("[telemetry] failed to update Studio user id:",t)}xr("studio_user_authenticated",{},void 0,{dailyDedupeKey:["studio_user_authenticated",(es==null?void 0:es.deployId)??"",Kd,DN].join(":")})}}function IH(e){return{deploy_source:e.telemetry.source,create_mode:e.telemetry.createMode,ai_assisted:e.telemetry.aiAssisted,deploy_action:e.action,deploy_region:e.region,runtime_network_type:e.networkType,feishu_enabled:e.feishuEnabled}}function jH(e){return{deploy_source:e.telemetry.source,create_mode:e.telemetry.createMode,ai_assisted:e.telemetry.aiAssisted,deploy_action:e.action}}function bTe(e){xr("studio_instance_loaded",{agents_source:e.agentsSource},void 0,{dedupeKey:"studio_instance_loaded"})}function RH(e){xr("studio_agent_deploy",{...IH(e),deploy_status:"succeeded",runtime_id:e.runtimeId})}function OH(e){xr("studio_agent_deploy",{...IH(e),deploy_status:"failed",failed_phase:e.phase,error_kind:aTe(e.error,e.phase),error_summary:yh(e.error)})}function yTe(e){xr("studio_sandbox_create",{sandbox_status:"succeeded",sandbox_kind:e.kind,sandbox_source:e.source,sandbox_session_id:e.sessionId})}function xTe(e){xr("studio_sandbox_create",{sandbox_status:"failed",sandbox_kind:e.kind,sandbox_source:e.source,error_kind:tTe(e.error),error_summary:yh(e.error)})}function ETe(e){xr("studio_agent_debug",{debug_status:"succeeded",variant_type:e.variantType},{duration_ms:e.durationMs})}function vTe(e){xr("studio_agent_debug",{debug_status:"failed",variant_type:e.variantType,failed_phase:e.phase,error_kind:nTe(e.error),error_summary:yh(e.error)},{duration_ms:e.durationMs})}function mb(e){xr("studio_agent_connect",{connect_status:"succeeded",agent_kind:e.kind,connect_source:e.source,runtime_region:e.runtimeRegion,runtime_is_mine:e.runtimeIsMine,sandbox_status:e.sandboxStatus},{duration_ms:e.durationMs})}function Vw(e){xr("studio_agent_connect",{connect_status:"failed",agent_kind:e.kind,connect_source:e.source,error_kind:sTe(e.error),error_summary:yh(e.error)},{duration_ms:e.durationMs})}function D3(e){xr("studio_agent_message",{message_status:"succeeded",agent_kind:e.kind,message_source:e.source,session_state:e.sessionState},{duration_ms:e.durationMs})}function lm(e){xr("studio_agent_message",{message_status:"failed",agent_kind:e.kind,message_source:e.source,session_state:e.sessionState,failed_phase:e.phase,error_kind:iTe(e.error),error_summary:yh(e.error)},{duration_ms:e.durationMs})}function wTe(e){xr("studio_agent_source_download",{...jH(e),download_status:"succeeded"},{duration_ms:e.durationMs,file_count:e.fileCount,zip_size_bytes:e.zipSizeBytes})}function _Te(e){xr("studio_agent_source_download",{...jH(e),download_status:"failed",error_kind:rTe(e.error),error_summary:yh(e.error)},{duration_ms:e.durationMs,file_count:e.fileCount})}const STe=/^[A-Za-z_][A-Za-z0-9_]*$/;function Jl(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":STe.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function MH(e){const t=new Set,n=new Set,s=i=>{Jl(i.name)===null&&(t.has(i.name)?n.add(i.name):t.add(i.name)),i.subAgents.forEach(s)};return s(e),n}function NTe(e){return{...Ai(),name:e,description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。",deployment:{feishuEnabled:!0}}}async function TTe(e){const t=NTe(e.agentName),n=await Tx(t);return Sg(n.name,n.files,{region:e.region,projectName:"default"},{taskId:e.taskId,sessionStorage:"in-memory",minInstance:1,maxInstance:1,description:t.description,im:{feishu:{enabled:!0}},envs:[{key:"FEISHU_APP_ID",value:e.appId},{key:"FEISHU_APP_SECRET",value:e.appSecret}],onStage:e.onStage})}const ga=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}],LH=[{phase:"prepare",label:"生成智能体"},{phase:"build",label:"构建镜像"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function kTe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ATe(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function P3(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function CTe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ITe(e){if(!e||e==="upload")return 0;const t=LH.findIndex(n=>n.phase===e);return t<0?0:t}function jTe({onBack:e}){var X;const[t,n]=g.useState("feishu_assistant"),[s,i]=g.useState(""),[r,a]=g.useState(""),[l,c]=g.useState(!1),[u,d]=g.useState("cn-beijing"),[f,h]=g.useState(!1),[m,p]=g.useState(""),[b,v]=g.useState(""),[y,x]=g.useState(""),[E,w]=g.useState("idle"),[S,_]=g.useState(null),[k,T]=g.useState(""),[A,j]=g.useState(null),R=g.useRef(null),B=g.useRef(null),z=g.useRef([]),L=g.useRef(0),F=g.useRef(null),C=g.useRef("prepare"),I=g.useRef(!1),D=g.useRef(!0),$=["preparing","running","cancelling"].includes(E);g.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]),g.useEffect(()=>{var he;if(!f)return;(he=z.current[L.current])==null||he.focus();const K=ye=>{ye.target instanceof Node&&R.current&&!R.current.contains(ye.target)&&h(!1)},ce=ye=>{var ue;ye.key==="Escape"&&(h(!1),(ue=B.current)==null||ue.focus())};return window.addEventListener("pointerdown",K),window.addEventListener("keydown",ce),()=>{window.removeEventListener("pointerdown",K),window.removeEventListener("keydown",ce)}},[f]);const O=K=>{K.key==="Enter"&&(K.nativeEvent.isComposing||K.nativeEvent.keyCode===229)&&K.preventDefault()},te=()=>{const K=Jl(t.trim())??"",ce=s.trim()?"":"请输入飞书 App ID",he=r.trim()?"":"请输入飞书 App Secret";return p(K),v(ce),x(he),!K&&!ce&&!he},ne=async K=>{if(K.preventDefault(),!te()||$)return;const ce=crypto.randomUUID();F.current=ce,C.current="prepare",I.current=!1,w("preparing"),_(null),T(""),j(null);try{const he=await TTe({agentName:t.trim(),appId:s.trim(),appSecret:r.trim(),region:u,taskId:ce,onStage:ye=>{C.current=ye.phase||"deploy",!(!D.current||I.current)&&(w("running"),_(ye))}});if(!D.current||I.current)return;RH({telemetry:{source:"feishu_automation",createMode:"feishu_template",aiAssisted:!1},action:"create",region:u,networkType:"public",feishuEnabled:!0,runtimeId:he.runtimeId||""}),j(he),a(""),c(!1),w("succeeded")}catch(he){if(!D.current||I.current)return;OH({telemetry:{source:"feishu_automation",createMode:"feishu_template",aiAssisted:!1},action:"create",region:u,networkType:"public",feishuEnabled:!0,phase:C.current,error:he}),w("failed"),T(he instanceof Error?he.message:String(he))}finally{F.current===ce&&(F.current=null)}},P=async()=>{const K=F.current;if(!(!K||E!=="running")&&window.confirm("取消部署将停止任务并清理已创建的 Runtime,确定继续吗?")){I.current=!0,w("cancelling"),T("");try{await k8(K),D.current&&w("cancelled")}catch(ce){if(I.current=!1,!D.current)return;w("failed"),T(ce instanceof Error?ce.message:String(ce))}}},Q=ITe((S==null?void 0:S.phase)??null),ee=!!(t.trim()&&s.trim()&&r.trim()&&!$),V=ga.find(K=>K.value===u);return o.jsxs("div",{className:"feishu-integration-page",children:[o.jsxs("header",{className:"feishu-integration-header",children:[o.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":"返回自动化列表",disabled:$,children:o.jsx(kTe,{})}),o.jsx("img",{className:"feishu-integration-logo",src:_A,alt:"","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("h1",{children:"飞书机器人"}),o.jsx("p",{children:"创建一个由 AgentKit Runtime 驱动的飞书智能体"})]})]}),o.jsx("div",{className:"feishu-integration-layout",children:o.jsxs("section",{className:"feishu-section-panel",children:[o.jsx("p",{className:"feishu-panel-description",children:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。"}),o.jsxs("form",{className:"feishu-form",onSubmit:ne,onKeyDown:O,noValidate:!0,children:[o.jsxs("div",{className:"feishu-field-grid",children:[o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-agent-name",children:"智能体名称"}),o.jsx("input",{id:"feishu-agent-name",value:t,maxLength:64,disabled:$,onChange:K=>{n(K.target.value),m&&p("")},onBlur:()=>p(Jl(t.trim())??""),"aria-invalid":!!m,"aria-describedby":`feishu-agent-name-help${m?" feishu-agent-name-error":""}`}),o.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:"将作为新 Runtime 中的根智能体名称"}),m?o.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:m}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{id:"feishu-region-label",children:"部署地域"}),o.jsxs("div",{className:"feishu-region-picker",ref:R,children:[o.jsxs("button",{ref:B,type:"button",className:"feishu-region-trigger",disabled:$,"aria-haspopup":"listbox","aria-expanded":f,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{L.current=ga.findIndex(K=>K.value===u),h(K=>!K)},onKeyDown:K=>{K.key!=="ArrowDown"&&K.key!=="ArrowUp"||(K.preventDefault(),L.current=K.key==="ArrowUp"?ga.length-1:ga.findIndex(ce=>ce.value===u),h(!0))},children:[o.jsx("span",{id:"feishu-region-value",children:V.label}),o.jsx(ATe,{})]}),f?o.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":"部署地域",onKeyDown:K=>{var ye;const ce=z.current.findIndex(ue=>ue===document.activeElement);let he=null;K.key==="ArrowDown"?he=(ce+1)%ga.length:K.key==="ArrowUp"?he=(ce-1+ga.length)%ga.length:K.key==="Home"?he=0:K.key==="End"?he=ga.length-1:K.key==="Tab"&&h(!1),he!==null&&(K.preventDefault(),(ye=z.current[he])==null||ye.focus())},children:ga.map(K=>o.jsx("button",{ref:ce=>{const he=ga.findIndex(ye=>ye.value===K.value);z.current[he]=ce},type:"button",role:"option","aria-selected":u===K.value,className:`feishu-region-option${u===K.value?" is-selected":""}`,onClick:()=>{var ce;d(K.value),h(!1),(ce=B.current)==null||ce.focus()},children:K.label},K.value))}):null]}),o.jsx("span",{className:"feishu-field-help",children:"Runtime 与构建产物将创建在该地域"})]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-id",children:"飞书 App ID"}),o.jsx("input",{id:"feishu-app-id",value:s,maxLength:128,autoComplete:"off",disabled:$,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:K=>{i(K.target.value),b&&v("")},onBlur:()=>v(s.trim()?"":"请输入飞书 App ID"),"aria-invalid":!!b,"aria-describedby":`feishu-app-id-help${b?" feishu-app-id-error":""}`}),o.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:"来自飞书开放平台的应用凭证"}),b?o.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:b}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-secret",children:"飞书 App Secret"}),o.jsxs("div",{className:"feishu-secret-input",children:[o.jsx("input",{id:"feishu-app-secret",type:l?"text":"password",value:r,maxLength:256,autoComplete:"off",disabled:$,placeholder:"请输入 App Secret",onChange:K=>{a(K.target.value),y&&x("")},onBlur:()=>x(r.trim()?"":"请输入飞书 App Secret"),"aria-invalid":!!y,"aria-describedby":`feishu-app-secret-help${y?" feishu-app-secret-error":""}`}),o.jsx("button",{type:"button",disabled:$,onClick:()=>c(K=>!K),"aria-label":l?"隐藏 App Secret":"显示 App Secret",children:l?"隐藏":"显示"})]}),o.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:"仅写入新 Runtime 的环境变量"}),y?o.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:y}):null]})]}),E!=="idle"?o.jsxs("div",{className:`feishu-deployment-status is-${E}`,role:E==="failed"?"alert":"status",children:[o.jsxs("div",{className:"feishu-deployment-heading",children:[E==="preparing"?o.jsx(Ra,{as:"strong",children:"正在生成 basic 智能体"}):null,E==="running"?o.jsx(Ra,{as:"strong",children:(S==null?void 0:S.message)||"正在创建 Runtime"}):null,E==="cancelling"?o.jsx(Ra,{as:"strong",children:"正在取消部署"}):null,E==="succeeded"?o.jsxs("strong",{children:[o.jsx(P3,{}),"飞书机器人 Runtime 已创建"]}):null,E==="cancelled"?o.jsx("strong",{children:"部署已取消"}):null,E==="failed"?o.jsx("strong",{children:"创建失败"}):null]}),E==="preparing"||E==="running"||E==="cancelling"?o.jsx("ol",{className:"feishu-deployment-steps",children:LH.map((K,ce)=>{const he=E==="running"&&ceK.value===(A.region||u)))==null?void 0:X.label)||A.region}),A.consoleUrl?o.jsxs("a",{href:A.consoleUrl,target:"_blank",rel:"noreferrer",children:["打开 Runtime 控制台",o.jsx(CTe,{})]}):null]}):null]}):null,o.jsxs("div",{className:"feishu-form-actions",children:[o.jsxs("div",{className:"feishu-secrets-note",children:[o.jsx("strong",{children:"凭据处理"}),o.jsx("span",{children:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"})]}),o.jsxs("div",{className:"feishu-action-buttons",children:[E==="running"?o.jsx("button",{type:"button",className:"feishu-cancel",onClick:()=>void P(),children:"取消部署"}):null,o.jsx("button",{type:"submit",className:"feishu-submit",disabled:!ee,children:$?"正在创建…":"创建飞书机器人 Runtime"})]})]})]})]})})]})}async function SA(e,t,n,s=pc){var r;const i=await JB(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},s);if(!i.ok){let a="";try{a=((r=(await i.json()).detail)==null?void 0:r.trim())||""}catch{}throw new Error(a||`请求失败 (${i.status})`)}return i.json()}function RTe(e){return SA("/web/coding-agents/capabilities",{method:"GET"},e,Qk)}function OTe(e,t){return SA(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function MTe(e,t){return SA("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const LTe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='16'%20height='16'%20rx='3.692'%20fill='%231A1B1D'/%3e%3cpath%20d='M13.235%205.829V4.332H2.758v5.987h1.496v1.496h8.981V5.828Zm-1.497%204.49H4.254V5.83h7.484v4.49Z'%20fill='%2332F08C'/%3e%3cpath%20d='M6.937%206.993%205.88%208.051%206.937%209.11%207.995%208.05%206.937%206.993ZM9.931%206.992%208.873%208.05%209.931%209.11%2010.99%208.05%209.93%206.992Z'%20fill='%2332F08C'/%3e%3c/svg%3e";function DTe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function B3(){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),o.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function U3(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function PTe(e){return e instanceof DOMException&&e.name==="AbortError"}function BTe(e){return e instanceof Error&&e.message?e.message:"读取 Skill 文件失败"}function UTe(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function FTe(e){const t=e.split("/");return t[t.length-1]??e}function $Te(e){const t=new Map;for(const n of e){const s=n.path.split("/"),i=s.length>1?s.slice(0,-1).join("/"):"";t.set(i,[...t.get(i)??[],n])}return Array.from(t,([n,s])=>({directory:n,files:s})).sort((n,s)=>n.directory?s.directory?n.directory.localeCompare(s.directory):1:-1)}function HTe({skill:e,onClose:t}){const n=g.useRef(null),s=g.useRef(null),i=g.useId(),r=g.useId(),[a,l]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(!0),[h,m]=g.useState(""),[p,b]=g.useState(0);g.useEffect(()=>{s.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=n.current;return x&&!x.open&&x.showModal(),()=>{var E;x!=null&&x.open&&x.close(),(E=s.current)==null||E.focus()}},[]),g.useEffect(()=>{const x=new AbortController;return f(!0),m(""),l(null),u(""),OTe(e.id,x.signal).then(E=>{if(x.signal.aborted)return;l(E);const w=E.files.find(S=>S.path==="SKILL.md")??E.files[0];u((w==null?void 0:w.path)??"")}).catch(E=>{!x.signal.aborted&&!PTe(E)&&m(BTe(E))}).finally(()=>{x.signal.aborted||f(!1)}),()=>x.abort()},[p,e.id]);const v=g.useMemo(()=>$Te((a==null?void 0:a.files)??[]),[a]),y=(a==null?void 0:a.files.find(x=>x.path===c))??null;return o.jsxs("dialog",{ref:n,className:"coding-agents-preview-dialog","aria-labelledby":i,"aria-describedby":r,onCancel:x=>{x.preventDefault(),t()},onMouseDown:x=>{const E=x.currentTarget.getBoundingClientRect();(x.clientXE.right||x.clientYE.bottom)&&t()},children:[o.jsxs("header",{className:"coding-agents-preview-header",children:[o.jsx("span",{className:"coding-agents-preview-mark",children:o.jsx(U3,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:i,children:e.name}),o.jsx("p",{id:r,children:"只读浏览随 Studio 提供的 Skill 文件"})]}),o.jsx("button",{type:"button",autoFocus:!0,"aria-label":"关闭文件预览",onClick:t,children:o.jsx(DTe,{})})]}),d?o.jsxs("div",{className:"coding-agents-preview-state",children:[o.jsx("i",{}),"正在读取文件…"]}):h?o.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[o.jsx("span",{children:h}),o.jsx("button",{type:"button",onClick:()=>b(x=>x+1),children:"重试"})]}):o.jsxs("div",{className:"coding-agents-preview-layout",children:[o.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":`${e.name} 文件`,children:[o.jsxs("div",{className:"coding-agents-preview-tree-title",children:[o.jsx("span",{children:"文件"}),o.jsx("small",{children:(a==null?void 0:a.files.length)??0})]}),o.jsx("div",{className:"coding-agents-preview-tree-scroll",children:v.map(x=>x.directory?o.jsxs("details",{open:!0,children:[o.jsxs("summary",{children:[o.jsx(U3,{}),o.jsx("span",{children:x.directory})]}),o.jsx("div",{children:x.files.map(E=>o.jsxs("button",{type:"button",className:c===E.path?"is-selected":"","aria-current":c===E.path?"true":void 0,onClick:()=>u(E.path),children:[o.jsx(B3,{}),o.jsx("span",{children:FTe(E.path)})]},E.path))})]},x.directory):x.files.map(E=>o.jsxs("button",{type:"button",className:c===E.path?"is-selected":"","aria-current":c===E.path?"true":void 0,onClick:()=>u(E.path),children:[o.jsx(B3,{}),o.jsx("span",{children:E.path})]},E.path)))})]}),o.jsx("section",{className:"coding-agents-preview-file","aria-label":"文件内容",children:y?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("strong",{children:y.path}),o.jsx("span",{children:UTe(y.size)})]}),y.previewable&&y.content!==null?o.jsx("pre",{tabIndex:0,children:o.jsx("code",{children:y.content})}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:"此文件不是可预览的 UTF-8 文本。"})]}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:"没有可预览的文件。"})})]})]})}function zTe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function VTe(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"m8.5 11-2.4 2.4 2.4 2.4M11 16.5h3.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function GTe(e){return o.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:o.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[o.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),o.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),o.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),o.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),o.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),o.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function KTe(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M15.8 4.2c2.4 0 4.5 1.2 5.7 3.1 2.2-.3 4.5.8 5.6 2.9 1.1 2 .8 4.4-.5 6.1 1.2 1.8 1.3 4.3.1 6.2-1.2 2-3.4 3-5.6 2.6-1.3 1.8-3.5 2.9-5.8 2.7-2.2-.2-4.1-1.5-5.1-3.4-2.2.1-4.4-1-5.4-3.1-1-2-.6-4.4.8-6.1-1.1-1.9-1.1-4.3.2-6.1 1.3-1.9 3.6-2.7 5.7-2.2 1.1-1.7 2.6-2.7 4.3-2.7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),o.jsx("path",{d:"m10.7 12.2 3.1 3.8-3.1 3.8M17.1 20h4.3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function F3(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function qTe(e){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M2.8 6.3h14.4v8.3a1.6 1.6 0 0 1-1.6 1.6H4.4a1.6 1.6 0 0 1-1.6-1.6V6.3Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),o.jsx("path",{d:"M2.8 6.3V5.1a1.4 1.4 0 0 1 1.4-1.4h3.4l1.5 1.6h6.5a1.6 1.6 0 0 1 1.6 1.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})]})}function YTe({agentId:e}){return e==="trae"?o.jsx("img",{src:LTe,alt:"","aria-hidden":"true"}):e==="claude-code"?o.jsx(GTe,{}):o.jsx(KTe,{})}function $3(e){return e instanceof DOMException&&e.name==="AbortError"}function H3(e,t){return e instanceof Error&&e.message?e.message:t}function WTe({onBack:e}){var j;const[t,n]=g.useState(null),[s,i]=g.useState(!0),[r,a]=g.useState(""),[l,c]=g.useState(0),[u,d]=g.useState(new Set),[f,h]=g.useState(new Set),[m,p]=g.useState(null),[b,v]=g.useState(!1),[y,x]=g.useState(null),E=g.useRef(null);g.useEffect(()=>{const R=new AbortController;return i(!0),a(""),RTe(R.signal).then(B=>{if(R.signal.aborted)return;n(B);const z=B.agents.filter(L=>L.available);d(L=>{const F=z.filter(C=>L.has(C.id));return new Set((F.length?F:z.slice(0,1)).map(C=>C.id))}),h(L=>{const F=B.skills.filter(C=>L.has(C.id));return new Set((F.length?F:B.skills).map(C=>C.id))})}).catch(B=>{!$3(B)&&!R.signal.aborted&&(n(null),a(H3(B,"检测本机客户端失败")))}).finally(()=>{R.signal.aborted||i(!1)}),()=>R.abort()},[l]),g.useEffect(()=>()=>{var R;return(R=E.current)==null?void 0:R.abort()},[]);const w=g.useMemo(()=>(t==null?void 0:t.agents.filter(R=>R.available&&u.has(R.id)))||[],[t,u]),S=g.useMemo(()=>(t==null?void 0:t.skills.filter(R=>f.has(R.id)))||[],[t,f]),_=!!(!b&&w.length&&S.length),k=(R,B)=>{!B||b||(x(null),d(z=>{const L=new Set(z);return L.has(R)?L.delete(R):L.add(R),L}))},T=R=>{b||(x(null),h(B=>{const z=new Set(B);return z.has(R)?z.delete(R):z.add(R),z}))},A=async()=>{var B;if(!_)return;(B=E.current)==null||B.abort();const R=new AbortController;E.current=R,v(!0),x(null);try{const z=await MTe({agents:w.map(F=>F.id),skills:S.map(F=>F.id)},R.signal);if(R.signal.aborted)return;const L=z.installations;x({tone:"success",message:`已为 ${w.length} 个客户端配置 ${S.length} 个 Skill`,details:L.map(F=>`${F.agentName} · ${F.skill} → ${F.displayPath}`)})}catch(z){!$3(z)&&!R.signal.aborted&&x({tone:"error",message:H3(z,"配置失败,请检查用户目录权限后重试")})}finally{E.current===R&&(E.current=null),R.signal.aborted||v(!1)}};return o.jsxs("section",{className:"coding-agents-page",children:[o.jsxs("header",{className:"coding-agents-header",children:[o.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:b,"aria-label":"返回自动化列表",children:o.jsx(zTe,{})}),o.jsx(VTe,{className:"coding-agents-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:"配置 Coding Agents"}),o.jsx("p",{children:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。"})]})]}),o.jsx("div",{className:"coding-agents-scroll",children:o.jsxs("div",{className:"coding-agents-content",children:[o.jsxs("section",{className:"coding-agents-section","aria-label":"选择 Coding Agent",children:[o.jsxs("div",{className:"coding-agents-section-heading",children:[o.jsxs("div",{children:[o.jsx("span",{children:"1"}),o.jsx("h2",{children:"本机客户端"})]}),o.jsx("button",{type:"button",onClick:()=>c(R=>R+1),disabled:s||b,children:"重新检测"})]}),s?o.jsxs("div",{className:"coding-agents-inline-state",children:[o.jsx("i",{}),"正在检测本机客户端…"]}):r?o.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[o.jsx("span",{children:r}),o.jsx("button",{type:"button",onClick:()=>c(R=>R+1),children:"重试"})]}):o.jsx("div",{className:"coding-agents-agent-grid",children:t==null?void 0:t.agents.map(R=>o.jsxs("button",{type:"button",className:`coding-agents-agent ${u.has(R.id)?"is-selected":""}`,"aria-pressed":u.has(R.id),disabled:!R.available||b,onClick:()=>k(R.id,R.available),title:R.available?R.name:R.reason,children:[o.jsx("span",{className:`coding-agents-agent-mark is-${R.id}`,children:o.jsx(YTe,{agentId:R.id})}),o.jsxs("span",{className:"coding-agents-agent-copy",children:[o.jsx("strong",{children:R.name}),o.jsx("small",{children:R.available?R.version||"已检测到客户端":R.reason})]}),o.jsx("span",{className:`coding-agents-status ${R.available?"is-ready":""}`,children:R.available?"可用":"未检测到"}),o.jsx("span",{className:"coding-agents-check",children:o.jsx(F3,{})})]},R.id))})]}),o.jsxs("section",{className:"coding-agents-section","aria-label":"选择内置 Skill",children:[o.jsx("div",{className:"coding-agents-section-heading",children:o.jsxs("div",{children:[o.jsx("span",{children:"2"}),o.jsx("h2",{children:"内置 Skills"})]})}),o.jsx("div",{className:"coding-agents-skill-list",children:t==null?void 0:t.skills.map(R=>o.jsxs("div",{className:`coding-agents-skill ${f.has(R.id)?"is-selected":""}`,children:[o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:f.has(R.id),onChange:()=>T(R.id),disabled:b}),o.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:o.jsx(F3,{})}),o.jsxs("span",{children:[o.jsx("strong",{children:R.name}),o.jsx("small",{children:R.description})]})]}),o.jsx("button",{type:"button",onClick:()=>p(R),children:"查看文件"})]},R.id))}),o.jsxs("div",{className:"coding-agents-global","aria-label":"全局安装目录",children:[o.jsxs("div",{className:"coding-agents-global-heading",children:[o.jsx(qTe,{}),o.jsxs("div",{children:[o.jsx("strong",{children:"全局安装"}),o.jsx("span",{children:"配置后可在本机其他项目中使用"})]})]}),w.length?o.jsx("dl",{children:w.map(R=>o.jsxs("div",{children:[o.jsx("dt",{children:R.name}),o.jsx("dd",{children:R.globalSkillsPath})]},R.id))}):o.jsx("p",{children:"选择客户端后显示对应安装目录。"})]})]}),y?o.jsxs("div",{className:`coding-agents-result is-${y.tone}`,role:y.tone==="error"?"alert":"status",children:[o.jsx("strong",{children:y.message}),(j=y.details)!=null&&j.length?o.jsx("ul",{children:y.details.map(R=>o.jsx("li",{children:R},R))}):null]}):null,o.jsxs("div",{className:"coding-agents-actions",children:[o.jsx("span",{children:w.length?`已选择 ${w.length} 个客户端、${S.length} 个 Skill`:"请先选择客户端"}),o.jsx("button",{type:"button",onClick:()=>void A(),disabled:!_,children:b?"正在配置…":"配置"})]})]})}),m?o.jsx(HTe,{skill:m,onClose:()=>p(null)}):null]})}const XTe={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function QTe(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(const i of n){if(s==null||typeof s!="object")return;s=s[i]}return s}function ZTe(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function JTe(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function NA(e,t){if(ZTe(e))return QTe(t,e.path);if(JTe(e)){const n=XTe[e.call],s={};for(const[i,r]of Object.entries(e.args??{}))s[i]=NA(r,t);return n?n(s):`[unknown fn: ${e.call}]`}return e}function eke(e,t){const n=NA(e,t);return n==null?"":typeof n=="string"?n:String(n)}const DH=new Map;function Du(e,t){DH.set(e,t)}function tke(e){return DH.get(e)}function nke(e,t,n){const s=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(let r=0;rNA(s,e.dataModel),resolveString:s=>eke(s,e.dataModel),dispatchAction:t,render:s=>{if(!s)return null;const i=e.components[s];if(!i)return null;const r=tke(i.component)??ske;return o.jsx(r,{node:i,ctx:n},s)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function rke(e){const t=g.useRef(null),n=g.useRef(!0),s=28,i=g.useCallback(()=>{const r=t.current;r&&(n.current=r.scrollHeight-r.scrollTop-r.clientHeight{const r=t.current;r&&n.current&&(r.scrollTop=r.scrollHeight)},[e]),{ref:t,onScroll:i}}function rE({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:s}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(i=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:i.description,children:[o.jsx(hu,{"aria-hidden":!0}),o.jsxs("span",{children:[t,i.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(i.name),"aria-label":`移除技能 ${i.name}`,children:o.jsx(Ri,{})}):null]},i.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(DB,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),s?o.jsx("button",{type:"button",onClick:s,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(Ri,{})}):null]}):null]})}function TA(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function BH(e){var n,s,i,r;const t=TA(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((s=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:s.toUpperCase())??"VIDEO":t==="image"?((r=(i=e.mimeType)==null?void 0:i.split("/")[1])==null?void 0:r.toUpperCase())??"IMAGE":"TXT"}function UH(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function FH(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?y8(t,e.uri):""}function ake({kind:e}){return e==="image"?o.jsx(Wk,{}):e==="video"?o.jsx(BB,{}):e==="pdf"?o.jsx(Dee,{}):o.jsx(qk,{})}function aE({appName:e,items:t,compact:n=!1,onRemove:s}){const[i,r]=g.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=TA(a.mimeType),c=FH(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:l==="image"?void 0:()=>r(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(ste,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(ake,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:BH(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(bn,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":UH(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(eu,{className:"media-card-open"}):null]});return o.jsxs(ss.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(RB,{src:c,children:d}):d,s?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>s(a.id),children:o.jsx(Ri,{})}):null]},a.id)})}),o.jsx(Bo,{children:i?o.jsx(oke,{appName:e,item:i,onClose:()=>r(null)}):null})]})}function oke({appName:e,item:t,onClose:n}){const s=g.useMemo(()=>FH(t,e),[e,t]),i=TA(t.mimeType),[r,a]=g.useState(""),[l,c]=g.useState(i==="text"||i==="markdown"),[u,d]=g.useState("");return g.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),g.useEffect(()=>{if(i!=="text"&&i!=="markdown")return;const f=new AbortController;return c(!0),d(""),fetch(s,{signal:f.signal}).then(h=>{if(!h.ok)throw new Error(`HTTP ${h.status}`);return h.text()}).then(a).catch(h=>{f.signal.aborted||d(h instanceof Error?h.message:String(h))}).finally(()=>{f.signal.aborted||c(!1)}),()=>f.abort()},[i,s]),o.jsx(ss.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":t.name??"附件预览",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&n()},children:o.jsxs(ss.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[BH(t),t.sizeBytes?` · ${UH(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:s,download:t.name,"aria-label":"下载",children:o.jsx(bx,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(Ri,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${i}`,children:[i==="image"?o.jsx("img",{src:s,alt:t.name??"图片"}):null,i==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:s,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,i==="pdf"?o.jsx("iframe",{src:s,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(bn,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&i==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(gh,{text:r})}):null,!l&&i==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:r}):null]})]})})}function lke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function cke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function $H(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function uke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function dke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),o.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function fke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function hke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),o.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),o.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function mke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function HH(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function pke({definition:e,label:t,done:n,open:s,onToggle:i}){const r=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:i,"aria-expanded":s,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(r,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(Ra,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(HH,{className:`builtin-tool-chevron${s?" is-open":""}`})]})}const gke={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:lke},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:mke},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:cke},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:$H},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:uke},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:dke},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:fke},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:hke}};function bke(e){return gke[e]}const zH="send_a2ui_json_to_client",yke=28;function xke(e,t,n){let s=t;for(let i=0;i65535?2:1}return s}function Eke(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function VH(e,t,n){const[s,i]=g.useState(()=>t?"":e),r=g.useRef(s),a=g.useRef(e),l=g.useRef(null),c=g.useRef(0),u=g.useRef(n);return a.current=e,u.current=n,g.useEffect(()=>{const d=r.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(r.current=e,i(e));return}if(d===e||l.current!==null)return;const h=m=>{const p=a.current,b=r.current;if(!p.startsWith(b)){r.current=p,i(p),l.current=null;return}if(m-c.current{var d;(d=u.current)==null||d.call(u)},[s]),g.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),s}function vke({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.jsx("path",{d:"M12 2.2l1.7 5.1a3 3 0 0 0 1.9 1.9L20.8 11l-5.1 1.7a3 3 0 0 0-1.9 1.9L12 19.8l-1.7-5.1a3 3 0 0 0-1.9-1.9L3.2 11l5.1-1.7a3 3 0 0 0 1.9-1.9L12 2.2z"})})}function wke(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function _ke(e,t){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const n=t.skill_name;if(!(typeof n!="string"||!n.trim()))return`使用 ${n.trim()} 技能`}function GH({text:e,done:t,answerStarted:n=!1,streaming:s=!1,onStreamFrame:i}){const[r,a]=g.useState(!(t||n)),l=g.useRef(!1);g.useEffect(()=>{l.current||a(!(t||n))},[n,t]);const c=()=>{l.current=!0,a(m=>!m)},u=e.replace(/^\s+/,""),d=VH(u,!t||s,i),{ref:f,onScroll:h}=rke(d);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:c,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(vke,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(Ra,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx(oc,{className:`chev ${r?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${r&&d?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:f,onScroll:h,children:d})})})]})}function KH(){return o.jsx(GH,{text:"",done:!1})}const Ske=g.memo(function({text:t,streaming:n,onStreamFrame:s}){const i=VH(t,n,s);return i?o.jsx("div",{className:"bubble",children:o.jsx(gh,{text:i})}):null});function Nke({name:e,args:t,response:n,done:s}){const[i,r]=g.useState(!1),a=e===zH?"渲染 UI":e,l=bke(e),c=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=c&&c.length>2e3?c.slice(0,2e3)+` -…(已截断)`:c;return o.jsxs(ss.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(pke,{definition:l,label:_ke(e,t),done:s,open:i,onToggle:()=>r(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>r(d=>!d),type:"button","aria-expanded":i,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(wke,{})}),s?o.jsx("span",{className:"tool-name",children:a}):o.jsx(Ra,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(HH,{className:`tool-chevron${i?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${i?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function Tke({block:e,onDownload:t,onPreview:n}){const[s,i]=g.useState(""),[r,a]=g.useState(""),[l,c]=g.useState(null);g.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(m,p)=>{if(t){i(`download:${m}`),a("");try{await t(m,p)}catch(b){a(b instanceof Error?b.message:String(b))}finally{i("")}}},f=async(m,p,b)=>{if(n){i(`preview:${b}`),a("");try{const v=await n(m,p);c({name:b,url:v})}catch(v){a(v instanceof Error?v.message:String(v))}finally{i("")}}},h=e.files.filter(m=>!m.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(m=>{const p=`${m.filename.replace(/\.pptx$/i,"")}.preview.webp`,b=e.files.find(v=>v.filename===p);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(qk,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:m.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[b&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||s!=="",onClick:()=>void f(b.filename,b.version,m.filename),children:[s===`preview:${m.filename}`?o.jsx(bn,{className:"spin"}):o.jsx(Oee,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||s!=="",onClick:()=>void d(m.filename,m.version),children:[s===`download:${m.filename}`?o.jsx(bn,{className:"spin"}):o.jsx(bx,{}),"下载"]})]})]},`${m.filename}:${m.version}`)}),r&&o.jsx("div",{className:"artifact-card__error",children:r}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(Ri,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function kke({block:e,onAuth:t}){const[n,s]=g.useState(e.done?"done":"idle"),[i,r]=g.useState(""),a=e.label||"MCP 工具集",l=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),c=async()=>{if(t){r(""),s("authorizing");try{await t(e),s("done")}catch(d){r(d instanceof Error?d.message:String(d)),s("idle")}}};return e.done||n==="done"?o.jsxs(ss.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx($R,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(ss.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx($R,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(bn,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),i&&o.jsx("div",{className:"auth-card-err",children:i})]})}function kA({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:s,onAction:i,onAuth:r,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":{const d=e.slice(u+1).some(f=>f.kind==="text"&&!!f.text.trim());return o.jsx(GH,{text:c.text,done:c.done,answerStarted:d,streaming:n,onStreamFrame:s},u)}case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(Ske,{text:d,streaming:n,onStreamFrame:s},u):null}case"attachment":return o.jsx(aE,{appName:t,items:c.files},u);case"artifact":return o.jsx(Tke,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(rE,{value:c.value},u);case"tool":return c.name===zH&&c.done?null:o.jsx(Nke,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(kke,{block:c,onAuth:r},u);case"a2ui":return PH(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(ss.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(ike,{surface:d,onAction:i})},`${u}-${d.surfaceId}`));default:return null}})})}function AA(e){return e.isComposing||e.keyCode===229}function Ake({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.jsx("path",{d:"m12 7.55 1.28 3.17L16.45 12l-3.17 1.28L12 16.45l-1.28-3.17L7.55 12l3.17-1.28L12 7.55Z",fill:"currentColor",stroke:"none"})]})}const ba=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],Cke=[{label:"ArkClaw",kind:"openclaw"},{label:"Hermes 智能体",kind:"hermes"}];function z3({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M10 2.2l1.35 4.1 4.15 1.35-4.15 1.35L10 13.1 8.65 9 4.5 7.65 8.65 6.3 10 2.2Z"}),o.jsx("path",{d:"M15.6 12.2l.6 1.8 1.8.6-1.8.6-.6 1.8-.6-1.8-1.8-.6 1.8-.6.6-1.8Z"})]}):e==="temporary"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Ake,{className:"new-chat-mode__agent-icon"})}function Ike(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function jke({value:e,onChange:t,disabled:n=!1,temporaryEnabled:s,skillCreateEnabled:i}){const[r,a]=g.useState(!1),[l,c]=g.useState(!1),[u,d]=g.useState(()=>ba.findIndex(S=>S.value===e)),f=g.useRef(null),h=g.useRef(null),m=ba.find(S=>S.value===e)??ba[0],p=m.value==="temporary"?"Codex 智能体":m.label;function b(S){return S.value==="temporary"?s:S.value==="skill-create"?i:!0}function v(S){return b(S)!==!0}function y(S){const _=b(S);return _===void 0?"正在检查配置":_?S.description:"管理员未配置"}g.useEffect(()=>{if(!r)return;const S=_=>{var k;(k=f.current)!=null&&k.contains(_.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[r]);function x(S){let _=u;do _=(_+S+ba.length)%ba.length;while(v(ba[_]));d(_),c(ba[_].value==="temporary")}function E(S){var _;if(!v(S)){if(S.value==="temporary"){c(!0);return}t(S.value),a(!1),c(!1),(_=h.current)==null||_.focus()}}function w(){t("temporary"),a(!1),c(!1)}return o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":r,disabled:n,onClick:()=>{d(ba.findIndex(S=>S.value===e)),a(S=>(S&&c(!1),!S))},onKeyDown:S=>{S.key==="ArrowDown"||S.key==="ArrowUp"?(S.preventDefault(),r?x(S.key==="ArrowDown"?1:-1):a(!0)):r&&(S.key==="Enter"||S.key===" ")?(S.preventDefault(),E(ba[u])):r&&S.key==="Escape"&&(S.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(z3,{mode:m.value})}),o.jsx("span",{className:"new-chat-mode__current",title:p,children:p}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),r?o.jsxs("div",{className:"new-chat-mode__menus",children:[o.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:S=>{var _;S.key==="ArrowDown"||S.key==="ArrowUp"?(S.preventDefault(),x(S.key==="ArrowDown"?1:-1)):S.key==="Enter"?(S.preventDefault(),E(ba[u])):S.key==="Escape"&&(S.preventDefault(),a(!1),c(!1),(_=h.current)==null||_.focus())},children:ba.map((S,_)=>{const k=S.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===S.value,"aria-haspopup":k?"menu":void 0,"aria-expanded":k?l:void 0,"aria-disabled":v(S),disabled:v(S),className:`new-chat-mode__option${_===u?" is-active":""}`,onMouseEnter:()=>{d(_),c(S.value==="temporary")},onClick:()=>E(S),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(z3,{mode:S.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[S.label,S.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(S)})]}),k?o.jsx(Ike,{}):e===S.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},S.value)})}),l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:w,children:[o.jsx(eg,{kind:"codex",className:"new-chat-mode__builtin-icon"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),Cke.map(({label:S,kind:_})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx(eg,{kind:_,className:"new-chat-mode__builtin-icon"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:S}),o.jsx("span",{children:"暂不可用"})]})]},S))]}):null]}):null]})}const cd=[{id:"general",label:"通用智能体"},{id:"codex",label:"Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体"}],Rke=15,Oke=15e3,Mke=120,Lke=180;function V3(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5.75 3.75 4.25 4.25-4.25 4.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dke(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.25 8.25 3 3 6.5-6.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Gw({type:e,className:t="new-chat-agent-picker__type-icon"}){return e==="general"?o.jsx(tu,{className:t}):o.jsx(eg,{kind:e,className:t})}function Pke({selectedAgentName:e="",selectedRuntimeId:t="",runtimeScope:n,disabled:s=!1,onSelectRuntime:i,onSelectSandboxSession:r}){var Se;const[a,l]=g.useState(!1),[c,u]=g.useState(null),[d,f]=g.useState(0),[h,m]=g.useState(0),[p,b]=g.useState("types"),[v,y]=g.useState(!1),[x,E]=g.useState([]),[w,S]=g.useState([]),[_,k]=g.useState(null),[T,A]=g.useState(""),[j,R]=g.useState(!1),[B,z]=g.useState(""),[L,F]=g.useState(""),C=g.useRef(null),I=g.useRef(null),D=g.useRef(null),$=g.useRef(0),O=g.useRef(null),te=g.useRef(null),ne=g.useRef(null),P=((Se=cd.find(ae=>ae.id===c))==null?void 0:Se.label)??"智能体",Q=g.useCallback((ae=!1)=>{var pe;te.current!==null&&(window.clearTimeout(te.current),te.current=null),ne.current!==null&&(window.clearTimeout(ne.current),ne.current=null),l(!1),u(null),b("types"),y(!1),ae&&((pe=I.current)==null||pe.focus())},[]),ee=g.useCallback(async(ae="",pe=!1)=>{const _e=++$.current;let et;R(!0),z("");try{const Be=await Promise.race([Nx({scope:n,region:"all",pageSize:Rke,nextToken:ae}),new Promise((Fe,We)=>{et=window.setTimeout(()=>{We(new Error("加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试"))},Oke)})]);if($.current!==_e)return;E(Fe=>{const We=pe?Be.runtimes:[...Fe,...Be.runtimes];return We.filter((Ae,Ke)=>We.findIndex(Ue=>Ue.runtimeId===Ae.runtimeId)===Ke)}),A(Be.nextToken),m(0)}catch(Be){if($.current!==_e)return;z(Vd(Be,"加载通用智能体","GET /web/runtimes"))}finally{window.clearTimeout(et),$.current===_e&&R(!1)}},[n]),V=g.useCallback(async ae=>{var et,Be;(et=O.current)==null||et.abort();const pe=new AbortController;O.current=pe;const _e=++$.current;R(!0),z(""),S([]);try{const Fe=ae==="codex"?await cn.listSessions({signal:pe.signal}):await cn.listAgentSessions(ae,{signal:pe.signal});if($.current!==_e)return;S(Fe),k(ae),m(0)}catch(Fe){if((Fe==null?void 0:Fe.name)==="AbortError"||$.current!==_e)return;z(Vd(Fe,`加载 ${((Be=cd.find(We=>We.id===ae))==null?void 0:Be.label)??ae}`,`GET /web/${ae==="codex"?"sandbox":ae}/sessions`)),k(ae)}finally{O.current===pe&&(O.current=null),$.current===_e&&R(!1)}},[]);g.useEffect(()=>{!a||c!=="general"||x.length>0||j||B||ee("",!0)},[c,B,ee,j,a,x.length]),g.useEffect(()=>{!a||c===null||c==="general"||_===c||V(c)},[c,V,_,a]),g.useEffect(()=>{if(!a)return;const ae=pe=>{var _e;(_e=C.current)!=null&&_e.contains(pe.target)||Q()};return document.addEventListener("mousedown",ae),()=>document.removeEventListener("mousedown",ae)},[Q,a]),g.useEffect(()=>()=>{var ae;$.current+=1,(ae=O.current)==null||ae.abort(),te.current!==null&&window.clearTimeout(te.current),ne.current!==null&&window.clearTimeout(ne.current)},[]);function X(ae,pe=!1){te.current!==null&&(window.clearTimeout(te.current),te.current=null),ne.current!==null&&(window.clearTimeout(ne.current),ne.current=null),l(!0),u(pe?"general":null),f(0),b("types"),y(pe),ae&&requestAnimationFrame(()=>{var _e;return(_e=D.current)==null?void 0:_e.focus()})}function K(){s||a||te.current!==null||(te.current=window.setTimeout(()=>{te.current=null,X(!1)},Mke))}function ce(){ne.current!==null&&(window.clearTimeout(ne.current),ne.current=null)}function he(){te.current!==null&&(window.clearTimeout(te.current),te.current=null),!(!a||ne.current!==null)&&(ne.current=window.setTimeout(()=>{ne.current=null,Q()},Lke))}function ye(ae){var et;const pe=(ae+cd.length)%cd.length,_e=cd[pe].id;_e!==c&&($.current+=1,(et=O.current)==null||et.abort(),O.current=null,R(!1),z("")),f(pe),u(_e),m(0)}async function ue(ae){if(!L){F(ae.runtimeId),z("");try{await i(ae),Q(!0)}catch(pe){z(Vd(pe,"连接通用智能体"))}finally{F("")}}}async function we(ae){if(!L){F(ae.id),z("");try{await r(ae),Q(!0)}catch(pe){z(Vd(pe,`打开 ${P}`))}finally{F("")}}}function De(ae){if(ae.key==="Escape"){ae.preventDefault(),Q(!0);return}if(["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(ae.key)&&y(!0),p==="types"){ae.key==="ArrowDown"||ae.key==="ArrowUp"?(ae.preventDefault(),ye(d+(ae.key==="ArrowDown"?1:-1))):(ae.key==="ArrowRight"||ae.key==="Enter")&&(ae.preventDefault(),c===null&&ye(d),b("runtimes"));return}if(ae.key==="ArrowLeft")ae.preventDefault(),b("types");else if((c==="general"?x:w).length>0&&(ae.key==="ArrowDown"||ae.key==="ArrowUp")){ae.preventDefault();const pe=ae.key==="ArrowDown"?1:-1,_e=c==="general"?x.length:w.length;m(et=>(et+pe+_e)%_e)}else ae.key==="Enter"&&c==="general"&&x[h]?(ae.preventDefault(),ue(x[h])):ae.key==="Enter"&&c!=="general"&&w[h]&&(ae.preventDefault(),we(w[h]))}return o.jsxs("div",{className:"new-chat-agent-picker",ref:C,onPointerEnter:ae=>{ae.pointerType==="mouse"&&ce()},onPointerLeave:ae=>{ae.pointerType==="mouse"&&he()},children:[o.jsxs("button",{ref:I,type:"button",className:"new-chat-agent-picker__trigger","aria-label":"选择智能体","aria-haspopup":"menu","aria-expanded":a,disabled:s,onPointerEnter:ae=>{ae.pointerType==="mouse"&&K()},onClick:()=>a?Q():X(!0),onKeyDown:ae=>{ae.key==="ArrowDown"||ae.key==="ArrowUp"?(ae.preventDefault(),a||X(!0,!0)):ae.key==="Escape"&&a&&(ae.preventDefault(),Q(!0))},children:[o.jsx(tu,{className:"new-chat-agent-picker__trigger-icon"}),o.jsx("span",{title:e||"选择智能体",children:e||"选择智能体"}),o.jsx(V3,{className:"new-chat-agent-picker__trigger-chevron"})]}),a?o.jsxs("div",{ref:D,className:"new-chat-agent-picker__menus",tabIndex:-1,onKeyDown:De,onPointerMove:ae=>{ae.pointerType==="mouse"&&y(!1)},children:[o.jsx("div",{className:"new-chat-agent-picker__menu",role:"menu","aria-label":"智能体类型",children:cd.map((ae,pe)=>o.jsxs("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":c===ae.id,className:`new-chat-agent-picker__type${v&&p==="types"&&d===pe?" is-keyboard-active":""}`,onMouseEnter:()=>ye(pe),onClick:()=>{ye(pe),b("runtimes")},children:[o.jsx(Gw,{type:ae.id}),o.jsx("span",{children:ae.label}),o.jsx(V3,{className:"new-chat-agent-picker__nested-chevron"})]},ae.id))}),c!==null?o.jsx("div",{className:"new-chat-agent-picker__submenu",role:"listbox","aria-label":`${P}列表`,children:c!=="general"&&j&&w.length===0?o.jsxs("div",{className:"new-chat-agent-picker__status",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"new-chat-agent-picker__spinner","aria-hidden":"true"}),"正在加载智能体"]}):c!=="general"&&B&&w.length===0?o.jsxs("div",{className:"new-chat-agent-picker__error",role:"alert",children:[o.jsx("span",{children:B}),o.jsx("button",{type:"button",onClick:()=>void V(c),children:"重新加载"})]}):c!=="general"&&w.length===0?o.jsxs(ts,{className:"new-chat-agent-picker__empty",fill:"none",children:[o.jsx(ts.Icon,{size:"sm",children:o.jsx(Gw,{type:c,className:"new-chat-agent-picker__empty-agent-icon"})}),o.jsx(ts.Title,{children:o.jsxs("span",{className:"new-chat-agent-picker__empty-title",children:["暂无 ",P]})}),o.jsx(ts.Description,{children:"请前往智能体页创建"})]}):c!=="general"?o.jsx("div",{className:"new-chat-agent-picker__runtime-list",children:w.map((ae,pe)=>{const _e=L===ae.id;return o.jsxs("button",{type:"button",role:"option","aria-selected":!1,"aria-busy":_e||void 0,className:`new-chat-agent-picker__runtime${v&&p==="runtimes"&&h===pe?" is-keyboard-active":""}`,disabled:!!L,title:`${ae.displayName||P} · ${ae.id}`,onMouseEnter:()=>m(pe),onClick:()=>void we(ae),children:[o.jsx(Gw,{type:c,className:"new-chat-agent-picker__runtime-icon"}),o.jsx("span",{children:ae.displayName||P}),o.jsx("small",{children:_e?"正在打开":sE(ae.status)})]},ae.id)})}):j&&x.length===0?o.jsxs("div",{className:"new-chat-agent-picker__status",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"new-chat-agent-picker__spinner","aria-hidden":"true"}),"正在加载智能体"]}):B&&x.length===0?o.jsxs("div",{className:"new-chat-agent-picker__error",role:"alert",children:[o.jsx("span",{children:B}),o.jsx("button",{type:"button",onClick:()=>void ee("",!0),children:"重新加载"})]}):x.length===0?o.jsxs(ts,{className:"new-chat-agent-picker__empty",fill:"none",children:[o.jsx(ts.Icon,{size:"sm",children:o.jsx(tu,{})}),o.jsx(ts.Title,{children:o.jsx("span",{className:"new-chat-agent-picker__empty-title",children:"暂无通用智能体"})}),o.jsx(ts.Description,{children:"请前往智能体页创建"})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"new-chat-agent-picker__runtime-list",children:x.map((ae,pe)=>{const _e=L===ae.runtimeId,et=ae.runtimeId===t;return o.jsxs("button",{type:"button",role:"option","aria-selected":et,"aria-busy":_e||void 0,className:`new-chat-agent-picker__runtime${v&&p==="runtimes"&&h===pe?" is-keyboard-active":""}`,disabled:!!L,title:ae.name,onMouseEnter:()=>m(pe),onClick:()=>void ue(ae),children:[o.jsx(tu,{className:"new-chat-agent-picker__runtime-icon"}),o.jsx("span",{children:ae.name}),_e?o.jsx("small",{children:"正在连接"}):et?o.jsx(Dke,{className:"new-chat-agent-picker__check"}):null]},ae.runtimeId)})}),B?o.jsx("div",{className:"new-chat-agent-picker__inline-error",role:"alert",children:B}):null,T?o.jsx("button",{type:"button",className:"new-chat-agent-picker__load-more",disabled:j||!!L,onClick:()=>void ee(T),children:j?"加载中":"加载更多"}):null]})}):null]}):null]})}const qH={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},Bke={ppt:[],image:[],video:["video_task_query"]},CA=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function G3(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}const K3=[{value:"ppt",label:"PPT",icon:Zee,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:Wk,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:$H,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function Uke({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:s,value:i,onChange:r,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:m,capabilitiesLoading:p=!1,allowAttachments:b=!0,onInvocationChange:v,onAddFiles:y,onRemoveAttachment:x,newChatMode:E="agent",newChatTask:w=null,newChatLayout:S=!1,showModeSelector:_=!1,onModeChange:k,onTaskChange:T,temporaryEnabled:A,skillCreateEnabled:j,harnessEnabled:R=!1,builtinTools:B=[],showAgentPicker:z=!1,agentPickerDisabled:L=!1,selectedRuntimeId:F="",runtimeScope:C="mine",onSelectRuntime:I,onSelectSandboxSession:D}){const $=g.useRef(null),O=g.useRef(null),te=g.useRef(null),ne=g.useRef(null),[P,Q]=g.useState(!1),[ee,V]=g.useState(null),[X,K]=g.useState(0),[ce,he]=g.useState(!1);async function ye(){if(e)try{await navigator.clipboard.writeText(e),he(!0),setTimeout(()=>he(!1),1500)}catch{he(!1)}}g.useLayoutEffect(()=>{const Z=$.current;Z&&(Z.style.height="auto",Z.style.height=`${Math.min(Z.scrollHeight,200)}px`)},[i]);const ue=E==="skill-create";g.useEffect(()=>{ue&&(Q(!1),V(null))},[ue]);const we=!ue&&d.some(Z=>Z.status!=="ready"),De=!l&&!c&&!we&&(i.trim().length>0||!ue&&d.length>0),Se=ue?`描述你想创建的 Skill,将使用 ${CA.join(" 和 ")} 并行创建…`:l?"请先选择智能体":`向 ${s} 发消息…`,ae=(ee==null?void 0:ee.query.toLocaleLowerCase())??"",pe=(ee==null?void 0:ee.kind)==="skill"?f.filter(Z=>!m.skills.some(Ee=>Ee.name===Z.name)).filter(Z=>`${Z.name} ${Z.description}`.toLocaleLowerCase().includes(ae)).map(Z=>({kind:"skill",value:Z})):(ee==null?void 0:ee.kind)==="agent"?h.filter(Z=>`${Z.name} ${Z.description}`.toLocaleLowerCase().includes(ae)).map(Z=>({kind:"agent",value:Z})):[];function _e(Z){var Ee;Q(!1),V(null),(Ee=Z.current)==null||Ee.click()}function et(Z){T==null||T(Z.value),Q(!1),V(null),requestAnimationFrame(()=>{var Ee,Oe;(Ee=$.current)==null||Ee.focus(),(Oe=$.current)==null||Oe.setSelectionRange(i.length,i.length)})}function Be(Z){r(Z),Q(!1),V(null),requestAnimationFrame(()=>{var at,Lt,ct;(at=$.current)==null||at.focus();const Ee=Z.indexOf("【"),Oe=Z.indexOf("】",Ee+1);Ee>=0&&Oe>Ee?(Lt=$.current)==null||Lt.setSelectionRange(Ee+1,Oe):(ct=$.current)==null||ct.setSelectionRange(Z.length,Z.length)})}function Fe(){T==null||T(null),r(""),Q(!1),V(null),requestAnimationFrame(()=>{var Z,Ee;(Z=$.current)==null||Z.focus(),(Ee=$.current)==null||Ee.setSelectionRange(0,0)})}const We=K3.find(Z=>Z.value===w),Ae=K3.filter(Z=>qH[Z.value].every(Ee=>B.includes(Ee)));function Ke(Z,Ee){const Oe=Z.slice(0,Ee),at=/(^|\s)([/@])([^\s/@]*)$/.exec(Oe);if(!at){V(null);return}const Lt=at[2].length+at[3].length,ct={kind:at[2]==="/"?"skill":"agent",query:at[3],start:Ee-Lt,end:Ee},yn=!ee||ee.kind!==ct.kind||ee.query!==ct.query||ee.start!==ct.start||ee.end!==ct.end;V(ct),yn&&K(0),Q(!1)}function Ue(Z){if(!ee)return;const Ee=i.slice(0,ee.start)+i.slice(ee.end);r(Ee),Z.kind==="skill"?v({...m,skills:[...m.skills,Z.value]}):v({skills:[],targetAgent:Z.value});const Oe=ee.start;V(null),requestAnimationFrame(()=>{var at,Lt;(at=$.current)==null||at.focus(),(Lt=$.current)==null||Lt.setSelectionRange(Oe,Oe)})}function W(){if(m.targetAgent){v({skills:[]});return}m.skills.length>0&&v({...m,skills:m.skills.slice(0,-1)})}function oe(Z){const Ee=Z.target.files?Array.from(Z.target.files):[];Ee.length&&y(Ee),Z.target.value=""}return o.jsxs("div",{className:`composer${S?" composer--new-chat":""}${ue?" composer--skill-mode":""}${We?` composer--has-task composer--task-${We.value}`:""}`,children:[ue?null:o.jsx(rE,{value:m,onRemoveSkill:Z=>v({...m,skills:m.skills.filter(Ee=>Ee.name!==Z)}),onRemoveAgent:()=>v({skills:[]})}),!ue&&d.length>0&&o.jsx(aE,{appName:n,compact:!0,items:d,onRemove:x}),o.jsxs("div",{className:"composer-box",children:[ee?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":ee.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[ee.kind==="skill"?o.jsx(hu,{}):o.jsx(DB,{}),o.jsx("span",{children:ee.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:ee.kind==="skill"?"/":"@"})]}),p?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(bn,{className:"spin"})," 正在读取 Agent 能力…"]}):pe.length===0?o.jsx("div",{className:"composer-command-empty",children:ee.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:pe.map((Z,Ee)=>o.jsxs("button",{type:"button",role:"option","aria-selected":Ee===X,className:`composer-command-item${Ee===X?" is-active":""}`,onMouseDown:Oe=>{Oe.preventDefault(),Ue(Z)},onMouseEnter:()=>K(Ee),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${Z.kind}`,children:Z.kind==="skill"?o.jsx(hu,{}):o.jsx(fu,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[Z.kind==="skill"?"/":"@",Z.value.name]}),o.jsx("span",{children:Z.value.description||(Z.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:Ee===X?"↵":Z.kind==="skill"?"技能":"Agent"})]},`${Z.kind}-${Z.value.name}`))})]}):null,ue?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!b,onClick:()=>{V(null),Q(Z=>!Z)},children:o.jsx(Ii,{className:"icon"})}),P&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>Q(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>_e(O),children:[o.jsx(Wk,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>_e(te),children:[o.jsx(qk,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>_e(ne),children:[o.jsx(BB,{className:"icon"}),"上传视频"]})]})]})]}),z&&I&&D?o.jsx(Pke,{selectedAgentName:n?s:"",selectedRuntimeId:F,runtimeScope:C,disabled:L,onSelectRuntime:I,onSelectSandboxSession:D}):null,_&&k?o.jsx(jke,{value:E,onChange:k,disabled:c,temporaryEnabled:A,skillCreateEnabled:j}):null,S&&E==="agent"&&We&&T?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${We.value}`,"aria-label":`取消${We.label}任务`,disabled:c,onClick:Fe,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(We.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(Ri,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:We.label})]}):null,S&&ue&&k?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>k("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(G3,{className:"new-chat-task-chip__task-icon"}),o.jsx(Ri,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsxs("div",{className:"composer-input-stack",children:[o.jsx("textarea",{ref:$,className:"comp-input scroll",rows:S?4:1,value:i,disabled:l,placeholder:Se,"aria-expanded":!!ee,onChange:Z=>{r(Z.target.value),ue||Ke(Z.target.value,Z.target.selectionStart)},onSelect:Z=>{ue||Ke(Z.currentTarget.value,Z.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>V(null),0),onKeyDown:Z=>{if(!AA(Z.nativeEvent)){if(ee){if(Z.key==="ArrowDown"&&pe.length>0){Z.preventDefault(),K(Ee=>(Ee+1)%pe.length);return}if(Z.key==="ArrowUp"&&pe.length>0){Z.preventDefault(),K(Ee=>(Ee-1+pe.length)%pe.length);return}if((Z.key==="Enter"||Z.key==="Tab")&&pe[X]){Z.preventDefault(),Ue(pe[X]);return}if(Z.key==="Escape"){Z.preventDefault(),V(null);return}}if(Z.key==="Backspace"&&!i&&Z.currentTarget.selectionStart===0&&Z.currentTarget.selectionEnd===0){W();return}Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),De&&a())}}}),S&&i.length===0?o.jsx("span",{className:"composer-placeholder-reveal","aria-hidden":"true",children:Se},Se):null]}),o.jsx(ss.button,{type:"button",className:"comp-send",disabled:!De,onClick:a,"aria-label":"发送",whileTap:De?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx(bn,{className:"icon spin"}):o.jsx(LB,{className:"icon"})})]}),S&&E==="agent"&&R&&!We?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[Ae.map(Z=>{const Ee=Z.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>et(Z),children:[o.jsx(Ee,{}),o.jsx("span",{children:Z.label})]},Z.value)}),j===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>k==null?void 0:k("skill-create"),children:[o.jsx(G3,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,S&&E==="agent"&&We?o.jsx("div",{className:"prompt-suggestions","aria-label":`${We.label}企业提示词`,children:We.prompts.map(Z=>{const Ee=We.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>Be(Z),children:[o.jsx(Ee,{}),o.jsx("span",{children:Z})]},Z)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:ce?"已复制":"复制会话 ID","aria-label":ce?"已复制会话 ID":"复制会话 ID",onClick:()=>void ye(),children:ce?o.jsx(Pa,{}):o.jsx(gx,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:oe}),o.jsx("input",{ref:te,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:oe}),o.jsx("input",{ref:ne,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:oe})]})}function YH({title:e,sub:t,cards:n,footer:s}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((i,r)=>o.jsxs(ss.button,{type:"button",className:`stk-card ${i.disabled?"stk-card-disabled":""}`,onClick:i.disabled?void 0:i.onClick,disabled:i.disabled,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18,ease:"easeOut",delay:r*.04},children:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(i.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:i.title}),o.jsx("span",{className:"stk-card-desc",children:i.desc})]}),i.status&&o.jsx("span",{className:"stk-card-status",children:i.status}),o.jsx(oc,{className:"stk-card-arrow"})]},i.key))}),s&&o.jsx("div",{className:"stk-footer",children:s})]})}const IA=Symbol.for("yaml.alias"),PN=Symbol.for("yaml.document"),ec=Symbol.for("yaml.map"),WH=Symbol.for("yaml.pair"),oo=Symbol.for("yaml.scalar"),xh=Symbol.for("yaml.seq"),la=Symbol.for("yaml.node.type"),Eh=e=>!!e&&typeof e=="object"&&e[la]===IA,Hg=e=>!!e&&typeof e=="object"&&e[la]===PN,zg=e=>!!e&&typeof e=="object"&&e[la]===ec,qs=e=>!!e&&typeof e=="object"&&e[la]===WH,Kn=e=>!!e&&typeof e=="object"&&e[la]===oo,Vg=e=>!!e&&typeof e=="object"&&e[la]===xh;function Vs(e){if(e&&typeof e=="object")switch(e[la]){case ec:case xh:return!0}return!1}function Ks(e){if(e&&typeof e=="object")switch(e[la]){case IA:case ec:case oo:case xh:return!0}return!1}const XH=e=>(Kn(e)||Vs(e))&&!!e.anchor,Bc=Symbol("break visit"),Fke=Symbol("skip children"),cp=Symbol("remove node");function vh(e,t){const n=$ke(t);Hg(e)?qd(null,e.contents,n,Object.freeze([e]))===cp&&(e.contents=null):qd(null,e,n,Object.freeze([]))}vh.BREAK=Bc;vh.SKIP=Fke;vh.REMOVE=cp;function qd(e,t,n,s){const i=Hke(e,t,n,s);if(Ks(i)||qs(i))return zke(e,s,i),qd(e,i,n,s);if(typeof i!="symbol"){if(Vs(t)){s=Object.freeze(s.concat(t));for(let r=0;re.replace(/[!,[\]{}]/g,t=>Vke[t]);class Xi{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Xi.defaultYaml,t),this.tags=Object.assign({},Xi.defaultTags,n)}clone(){const t=new Xi(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Xi(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Xi.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Xi.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Xi.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Xi.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,a]=s;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const a=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,a),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,s,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(a){return n(String(a)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+Gke(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(t&&s.length>0&&Ks(t.contents)){const r={};vh(t.contents,(a,l)=>{Ks(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,a]of s)r==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(l=>l.startsWith(a)))&&n.push(`%TAG ${r} ${a}`);return n.join(` -`)}}Xi.defaultYaml={explicit:!1,version:"1.2"};Xi.defaultTags={"!!":"tag:yaml.org,2002:"};function QH(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function ZH(e){const t=new Set;return vh(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function JH(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function Kke(e,t){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i??(i=ZH(e));const a=JH(t,i);return i.add(a),a},setAnchors:()=>{for(const r of n){const a=s.get(r);if(typeof a=="object"&&a.anchor&&(Kn(a.node)||Vs(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:s}}function Yd(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;iaa(s,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!XH(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class jA{constructor(t){Object.defineProperty(this,la,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Hg(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=aa(this,"",a);if(typeof i=="function")for(const{count:c,res:u}of a.anchors.values())i(u,c);return typeof r=="function"?Yd(r,{"":l},"",l):l}}class RA extends jA{constructor(t){super(IA),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],vh(t,{Node:(r,a)=>{(Eh(a)||XH(a))&&s.push(a)}}),n&&(n.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,a=this.resolve(i,n);if(!a){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=s.get(a);if(l||(aa(a,null,n),l=s.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=dy(i,a,s)),l.count*l.aliasCount>r)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,s){const i=`*${this.source}`;if(t){if(QH(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${i} `}return i}}function dy(e,t,n){if(Eh(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(Vs(t)){let s=0;for(const i of t.items){const r=dy(e,i,n);r>s&&(s=r)}return s}else if(qs(t)){const s=dy(e,t.key,n),i=dy(e,t.value,n);return Math.max(s,i)}return 1}const ez=e=>!e||typeof e!="function"&&typeof e!="object";class It extends jA{constructor(t){super(oo),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:aa(this.value,t,n)}toString(){return String(this.value)}}It.BLOCK_FOLDED="BLOCK_FOLDED";It.BLOCK_LITERAL="BLOCK_LITERAL";It.PLAIN="PLAIN";It.QUOTE_DOUBLE="QUOTE_DOUBLE";It.QUOTE_SINGLE="QUOTE_SINGLE";const qke="tag:yaml.org,2002:";function Yke(e,t,n){if(t){const s=n.filter(r=>r.tag===t),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(s=>{var i;return((i=s.identify)==null?void 0:i.call(s,e))&&!s.format})}function ng(e,t,n){var f,h,m;if(Hg(e)&&(e=e.contents),Ks(e))return e;if(qs(e)){const p=(h=(f=n.schema[ec]).createNode)==null?void 0:h.call(f,n.schema,null,n);return p.items.push(e),p}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:a,sourceObjects:l}=n;let c;if(s&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=i(e)),new RA(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=qke+t.slice(2));let u=Yke(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const p=new It(e);return c&&(c.node=p),p}u=e instanceof Map?a[ec]:Symbol.iterator in Object(e)?a[xh]:a[ec]}r&&(r(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((m=u==null?void 0:u.nodeClass)==null?void 0:m.from)=="function"?u.nodeClass.from(n.schema,e,n):new It(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function M1(e,t,n){let s=n;for(let i=t.length-1;i>=0;--i){const r=t[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const a=[];a[r]=s,s=a}else s=new Map([[r,s]])}return ng(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const km=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let tz=class extends jA{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>Ks(s)||qs(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(km(t))this.add(n);else{const[s,...i]=t,r=this.get(s,!0);if(Vs(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,M1(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(Vs(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...i]=t,r=this.get(s,!0);return i.length===0?!n&&Kn(r)?r.value:r:Vs(r)?r.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!qs(n))return!1;const s=n.value;return s==null||t&&Kn(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const i=this.get(n,!0);return Vs(i)?i.hasIn(s):!1}setIn(t,n){const[s,...i]=t;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(Vs(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,M1(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};const Wke=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Fo(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Gc=(e,t,n)=>e.endsWith(` -`)?Fo(n,t):n.includes(` +`}).map(([n,s])=>[n,s.split("__PROJECT_NAME__").join(e)]))}const VNe={id:"template",kind:"github",category:"development",icon:"github",name:"模板项目导入",description:"在您的仓库中创建一个可持续交付到 AgentKit Runtime 的最简智能体",title:"模板项目导入",subtitle:"把可直接启动 Studio 的 basic Agent 和持续交付配置加入仓库",panel:"提交后将创建一个 PR,同时导入 basic 项目和 AgentKit Runtime 发布工作流。",submitLabel:"导入模板并提交 PR",fields:[xA,EA,{name:"projectPath",label:"Agent 项目目录",placeholder:"agentkit-basic-agent",help:"将在此目录新增 basic 项目;app.py 挂载完整 Studio App Server,并作为服务入口启动",required:!0},SH,NH],initialValues:vA({projectPath:"agentkit-basic-agent"}),regionHelp:"必须与目标 Runtime 所在地域一致",secrets:["VOLCENGINE_ACCESS_KEY、VOLCENGINE_SECRET_KEY(必填)","VOLCENGINE_SESSION_TOKEN(使用临时凭据时必填)"],submit(e,t){const n=wA(e),s=_H(n.repository),i=bA(e.projectPath,"agentkit-basic-agent"),r=i==="."?s.split("/").slice(-1)[0]||"agentkit-basic-agent":i.split("/").slice(-1)[0]||"agentkit-basic-agent",a=Object.entries(zNe(r)).map(([l,c])=>({path:$Ne(i,l),content:c,commitMessage:"feat: import AgentKit basic template",mustBeNew:!0}));return a.push({path:HNe(i),content:TH({baseBranch:n.baseBranch,projectPath:i,runtimeName:e.runtimeName.trim(),runtimeId:e.runtimeId.trim(),region:n.region}),commitMessage:"feat: add AgentKit Runtime delivery",mustBeNew:!0}),yA({...n,repository:s,files:a,branchPrefix:"feat/agentkit-basic-template",title:"feat: 导入 AgentKit basic 模板",description:"导入带有 AgentKit Studio App Server 的 basic Agent 项目,并添加持续发布到 AgentKit Runtime 的工作流。合并前请配置 Volcengine Secrets。"},t)}},j3=[{id:"development",label:"研发"},{id:"channels",label:"消息渠道"}],kH=[SNe,VNe,FNe,DNe,NNe],GNe=new Map(kH.map(e=>[e.id,e]));function KNe(e){const t=GNe.get(e);if(!t)throw new Error(`Unknown automation: ${e}`);return t}function qNe(e){const t=KNe(e);if(t.kind!=="github")throw new Error(`Automation is not backed by GitHub: ${e}`);return t}const _A="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cimage%20width='48'%20height='48'%20href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAADbN2wMAAAH7UlEQVRoBdVZWWwbVRQ9492Onc1xTfaWLukq9oSqLKnYBZRSNgn6AagsAgmJRfzxg4SEEDtiER8IBKKAChK0FS1tKYWW0lZQKKV0gxCVJm3ikDiO17EdzrUzSdw4jj1OpeQqNzO237vvnHfvu/e9GWVwcBBDYue1mrqE2kI1UqeSJAnmIHUzNUCNUmGiKtQy6oPUR6geqnw/FSVOUH9R36KupfaDHnBQn6MGqEnqVJcEAfZTBbNL4b+lZPI1VbwwnaSfYO8z8N+TVMd0Qj6EVdbs3eIBP29cVFkL00kk+wSEwHAamgh9bDAJSQWTITZFnF+85J1tBPyOUC9OqqnsVdTIRkVBi70Msy125uriHJ8XAXFRfzKBTQM+rO0/hc54cSQE8iyzAx/XLcEltjIU44uCQijOaHvPfxIv97TjWCzEcMo7+sZ4TGa+2V6KT2rPQ73ZptsPBZE30fVrymvxTvUCtDoqYC0ijhMk/3MkgDd62xFheOqVggjIIAbOVaujEh/ULsaNzioUsxhVAv/A34GD0YBubxZMQJupWpMNr58zHytcHth1ekICsDcRx4u+fxBK6vOCbgKyEIXEK975WOmaoZuErKv1QR8ORQd0eUE3Ac0TNSYrXvI24fZSLxwGfebiDKW3e08gln9J0oYvKoMNG6kmiRdmzMOtTi8sOsJJJfANA93oiseGbeZ7k1EHZAKCEcApu4wCxUsSz3rm4HQiim3B/wpOsBJA2yP/4cZIJYIBFcGwCjWeSKEwm4wosZtR7rKizGXJQJZRB1TuttftAprnAbOrM9rl9UHqwg+s1o+eOow/GNN5CaPOklSgdKq4us+Ji7pt6Dw1AF9vBOGImjJht5lRVWFDY7UL58/3wOt2YPEcN2xWVpPRe6EQC+y9rwINPNKsuRaYX5cXhIxGkks+Y7V+6vQRdLBi5yx1bGwicFebivj+ARgOhZGMJMFyQyWpoV2GRIa2ZXOX2bDyqnPxzEPNKC+1Zj957eDBTbz34PXAwvoMfBN+kGV8Bxf00VgQz/vaEB6nSCnRQVj2h2DZG4TyZwQWlSils3m8RDDEhk2uaqlHaYklVb3Ha42dh4B3eMzZ//eEmMc0kGL3cEU9WksqU4XvzAYKZ9n6fQCOz3thORCGkhgCf2bDMz4bjQpW39yE65Y1QO5FxiUgP+76E3hzI7D1VyBcwP5NTFcZzXjaPRMNZmvGPkfA23YMwLHRD0Mf3ZwTgaBIi8GgYMGsSjx2z3kEP9Jp5E5rOeoqQH75C3htPfDpD4CskXxFvHC5vQKPVjSwPqQfcKTAfxuA/Ws/lBAXwEhUTGjWSAL3r1qYykSju+UkIFbZDx09wPvb0iH1W9uEYw03MHAV3ltew1CqgDkyCNtWgt/cnwY/3GriG5n9hbMrccNljRmzLz0nJCCNJBsEwsCH24E3NgDr96brhfyWS2Sm3EYLVsOL0i0DsG8h+LDkqcLExHhfc9siVDDrjJ59sZJRyHKZFRKybiSkTtIjR08CrXwEdtGcXL2A4+192LOuDeatfqg6wMvsL5lbhWuWysIdO995E9BgSkh19THX7wQOtANXLgKWLQSaarUWI9dNP7bjo68OY9uef6GqhcW8ZkViX2a/nBWYQ4+RggmIBfFGnHgOcD0c7wD2HgOW0xuXk0xN5SDaOwL4cnsb1m05joPHejKK0hgEOb4Q8Muba3H1pXUwZZl96aqLgHSU2RCbEe6/9hzh875OYPdhYF5NDLt/Oohd+46gNxBjm2zzJhZyi/RyV5TggdsvRJnTOm5j3QQ0i9ra6OHj1u9+B/YdNcLXVQdDmYNPy9oZ971IcIPHjUHadVrHHFfZNphtTtx508W4eJEHsg7Gk6IJaIZlDEn3EdUEl7sBg4la2MtqkYgNIOz/F9FgF6IhX6p5mozcjgbGasw/xWCCs7IeN7U24b4VddwZj26jjTZynTQCmknxSBqIETanh7ceWEpmpIiokT7E6JFosBvxaD/iJCeNDQYzTFYnzHY3SsobmfM9eOyucjTO0KyOf510AqOHkl2kiMlSQoAlsPLAk4hHSCaIJMMqmUgfYBQeggxGK4xmOxprXHh8lYK51em+E/0/qwQyBh8iY+Q52pjlOZD8XFcFPHELcGlT3stlbBaymtOROTReBoZJ+0DjZ9pv4SFq9fL0YWqcjJl1+AwP8OSGS+amq6y4P/fyyWqvoC9lDAG7ainPEJcBs7xMBGOLbU6bGQTMJHAnDUlG2biPFZevEM4GCZl9sSsnPgG+bAHfa+l8vZJxpNSo+oPp/c4XP6bPBN0kog2qtdFz1WzIkfXmZuAKVm6JewlbvZKVgGZMilMPwW9ngdr5B3CEG7iEbCY5ffl6RgPtYDGdybS4ogW4YDbgLefTD5s2kv5rTgKaWdlKi1fau4BDJ3jM5I70NDd0J7grzfZEUMg5CM5Tmg4TiW3ZtVYxTKpcgM2iWS7+mhcBbRiZ/TBTd4jPjtSEVF3AxxdUPgkxTrUUMTcBykKUmLZwhQlYPhWBeCBV5DRjk3QtiEC2McUDsjPVCEhWEQ8Umk2y2c7nOyEwrV/ySdbdQo3nw3aKtRHM3wiBtVQu02knISJ+SQh8Q32TyqTJJ6xTXyQzyzb2LeoBWQOy5pjwcDf1YSqzNIooLex99kTCppsq4N+l+oUArylhoku9sb+O18VU8c5UEiZu7KGyrKKTmgr7/wGxhy03aZIycwAAAABJRU5ErkJggg=='%20/%3e%3c/svg%3e";function AH(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91 .58 .11 .79-.25.79-.56v-2.02c-3.2.7-3.88-1.36-3.88-1.36-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.71 1.26 3.37.96.1-.75.4-1.26.73-1.55-2.56-.29-5.25-1.28-5.25-5.7 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.16 1.18A10.98 10.98 0 0 1 12 6.11c.98 0 1.96.13 2.87.39 2.19-1.49 3.16-1.18 3.16-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.43-2.7 5.4-5.27 5.69.42.36.78 1.06.78 2.14v3.04c0 .31.21.67.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.65 18.35.5 12 .5Z"})})}function R3(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.2",stroke:"currentColor",strokeWidth:"1.7"}),o.jsx("path",{d:"m15.4 15.4 4 4",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function YNe(e){return o.jsxs("svg",{viewBox:"0 0 36 36",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",fill:"currentColor",opacity:"0.1"}),o.jsx("rect",{x:"3.5",y:"5",width:"18",height:"18",rx:"5",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"m9.2 11.2-2.8 2.7 2.8 2.7M12.1 17.4h4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"26.5",cy:"12",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("circle",{cx:"27",cy:"26.5",r:"3",fill:"hsl(var(--background))",stroke:"currentColor",strokeWidth:"1.6"}),o.jsx("path",{d:"M21.5 12h2M19.3 21l5.6 3.8M27 15v8.5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function WNe({onOpen:e}){var c;const[t,n]=g.useState("development"),[s,i]=g.useState(""),r=g.useDeferredValue(s),a=g.useMemo(()=>{const u=r.trim().toLocaleLowerCase();return kH.filter(d=>d.category===t).filter(d=>!u||`${d.name} ${d.description}`.toLocaleLowerCase().includes(u))},[t,r]),l=(c=j3.find(u=>u.id===t))==null?void 0:c.label;return o.jsxs("div",{className:"applications-page",children:[o.jsxs("header",{className:"applications-header",children:[o.jsxs("div",{children:[o.jsx("h1",{children:"自动化"}),o.jsx("p",{children:"连接研发工具,为智能体扩展自动化工作流"})]}),o.jsxs("label",{className:"applications-search",children:[o.jsx(R3,{}),o.jsx("input",{type:"search","aria-label":"搜索自动化",value:s,onChange:u=>i(u.target.value),placeholder:"搜索自动化"})]})]}),o.jsx("nav",{className:"applications-categories","aria-label":"自动化分类",children:j3.map(u=>o.jsx("button",{type:"button",className:t===u.id?"is-active":"","aria-pressed":t===u.id,onClick:()=>n(u.id),children:u.label},u.id))}),o.jsx("section",{className:"applications-results","aria-label":`${l}自动化列表`,children:a.length?o.jsx("div",{className:"applications-grid",children:a.map(u=>o.jsxs("button",{type:"button",className:"application-card",onClick:()=>e(u.id),"aria-label":`打开${u.name}`,children:[u.icon==="feishu"?o.jsx("img",{className:"application-card-icon application-card-brand-icon",src:_A,alt:"","aria-hidden":"true"}):u.icon==="coding-agents"?o.jsx(YNe,{className:"application-card-icon"}):o.jsx(AH,{className:"application-card-icon"}),o.jsxs("div",{className:"application-card-copy",children:[o.jsxs("div",{className:"application-card-title",children:[o.jsx("h2",{children:u.name}),u.badge?o.jsx("span",{className:`application-card-badge is-${u.badgeTone||"default"}`,children:u.badge}):null]}),o.jsx("p",{children:u.description})]})]},u.id))}):o.jsxs("div",{className:"applications-empty",role:"status",children:[o.jsx(R3,{}),o.jsx("h2",{children:"没有匹配的自动化"}),o.jsx("p",{children:"请尝试搜索其他名称"})]})})]})}function XNe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function QNe({hidden:e,...t}){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M2.5 10s2.6-4 7.5-4 7.5 4 7.5 4-2.6 4-7.5 4-7.5-4-7.5-4Z"}),o.jsx("circle",{cx:"10",cy:"10",r:"1.8"}),e?o.jsx("path",{d:"m4 4 12 12"}):null]})}function O3(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ZNe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function JNe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function zw(e,t,n){const s=t.trim();if(!s)return n?"此项不能为空":"";if(e==="repository"&&!/^(?:https:\/\/github\.com\/)?[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+(?:\.git)?$/.test(s))return"请输入 owner/repository 或完整 GitHub Repo URL";if(e==="baseBranch"&&(!/^[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(s)||s.includes("..")))return"目标分支格式不正确";if(e==="projectPath"&&(s.startsWith("/")||s.split("/").includes("..")))return"请输入仓库内的相对目录";if(e==="runtimeName"&&!/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(s))return"以字母开头,仅支持字母、数字、下划线和连字符";if(e==="runtimeId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(s))return"Runtime ID 格式不正确";if(e==="sandboxToolId"&&!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/.test(s))return"Sandbox Tool ID 格式不正确";if(e==="modelName"&&!/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/.test(s))return"模型名称格式不正确";if(e==="modelBaseUrl")try{const i=new URL(s);if(i.protocol!=="https:"||i.username||i.password||i.search||i.hash)return"请输入不含凭据、查询参数或锚点的 HTTPS 地址"}catch{return"请输入有效的 HTTPS 地址"}return""}function eTe({automation:e,onBack:t}){const n=qNe(e),[s,i]=g.useState(()=>({...n.initialValues})),[r,a]=g.useState({}),[l,c]=g.useState(""),[u,d]=g.useState(!1),[f,h]=g.useState(!1),[p,m]=g.useState(!1),[b,v]=g.useState(null),y=g.useRef(null);g.useEffect(()=>()=>{var T;return(T=y.current)==null?void 0:T.abort()},[]);const x=(T,k)=>{i(A=>({...A,[T]:k})),r[T]&&a(A=>({...A,[T]:""}))},E=T=>{var j;const k=T==="token"||((j=n.fields.find(R=>R.name===T))==null?void 0:j.required)===!0,A=zw(T,s[T],k);a(R=>({...R,[T]:A}))},w=async T=>{var R;T.preventDefault();const k={};for(const B of n.fields){const z=zw(B.name,s[B.name],B.required);z&&(k[B.name]=z)}const A=zw("token",s.token,!0);if(A&&(k.token=A),a(k),Object.keys(k).length)return;(R=y.current)==null||R.abort();const j=new AbortController;y.current=j,d(!0),c(""),v(null);try{const B=await n.submit(s,j.signal);if(y.current!==j)return;v(B),i(z=>({...z,token:""}))}catch(B){if(j.signal.aborted||y.current!==j)return;c(B instanceof Error?B.message:String(B))}finally{y.current===j&&(y.current=null,d(!1))}},S=T=>{T.key==="Enter"&&(T.nativeEvent.isComposing||T.nativeEvent.keyCode===229)&&T.preventDefault()},_=T=>{const{name:k,label:A,placeholder:j,help:R,required:B}=T;return o.jsxs("div",{className:"github-field",children:[o.jsxs("label",{htmlFor:`github-${k}`,children:[o.jsx("span",{children:A}),o.jsx("span",{className:`github-field-requirement${B?" is-required":""}`,children:B?"必填":"可选"})]}),o.jsx("input",{id:`github-${k}`,value:s[k],onChange:z=>x(k,z.target.value),onBlur:()=>E(k),placeholder:j,required:B,"aria-invalid":!!r[k],"aria-describedby":`github-${k}-help${r[k]?` github-${k}-error`:""}`}),o.jsx("span",{id:`github-${k}-help`,className:"github-field-help",children:R}),r[k]?o.jsx("span",{id:`github-${k}-error`,className:"github-field-error",role:"alert",children:r[k]}):null]},k)};return o.jsxs("div",{className:"github-integration-page",children:[o.jsxs("header",{className:"github-integration-header",children:[o.jsx("button",{type:"button",className:"github-back",onClick:t,"aria-label":"返回自动化列表",children:o.jsx(XNe,{})}),o.jsx(AH,{className:"github-integration-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:n.title}),o.jsx("p",{children:n.subtitle})]})]}),o.jsx("div",{className:"github-integration-layout",children:o.jsxs("section",{id:`github-panel-${e}`,className:"github-section-panel",children:[o.jsx("div",{className:"github-panel-heading",children:o.jsx("p",{children:n.panel})}),o.jsxs("form",{className:"github-release-form",onSubmit:w,onKeyDown:S,noValidate:!0,children:[o.jsxs("div",{className:"github-field-grid",children:[n.fields.map(_),o.jsxs("div",{className:"github-field",children:[o.jsxs("label",{id:"github-region-label",children:[o.jsx("span",{children:"地域"}),o.jsx("span",{className:"github-field-requirement is-required",children:"必填"})]}),o.jsxs("div",{className:"pp-network-region github-region-picker",onKeyDown:T=>{T.key==="Escape"&&m(!1)},children:[o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-labelledby":"github-region-label","aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(T=>!T),children:[o.jsx("span",{children:s.region==="cn-shanghai"?"华东 2(上海)":"华北 2(北京)"}),o.jsx(ZNe,{className:`pp-region-chevron${p?" is-open":""}`})]}),p?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>m(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"地域",children:[{value:"cn-beijing",label:"华北 2(北京)"},{value:"cn-shanghai",label:"华东 2(上海)"}].map(T=>{const k=T.value===s.region;return o.jsxs("button",{type:"button",role:"option","aria-selected":k,className:`pp-region-option${k?" is-selected":""}`,onClick:()=>{x("region",T.value),m(!1)},children:[o.jsx("span",{children:T.label}),k?o.jsx(JNe,{}):null]},T.value)})})]}):null]}),o.jsx("span",{className:"github-field-help",children:n.regionHelp})]})]}),o.jsxs("div",{className:"github-field github-token-field",children:[o.jsxs("div",{className:"github-token-label-row",children:[o.jsxs("label",{htmlFor:"github-token",children:[o.jsx("span",{children:"GitHub Token"}),o.jsx("span",{className:"github-field-requirement is-required",children:"必填"})]}),o.jsxs("a",{href:"https://github.com/settings/personal-access-tokens/new?name=VeADK%20Studio&description=Create%20a%20GitHub%20automation%20pull%20request&contents=write&pull_requests=write",target:"_blank",rel:"noreferrer",children:["获取 Token",o.jsx(O3,{})]})]}),o.jsxs("div",{className:"github-token-input",children:[o.jsx("input",{id:"github-token",type:f?"text":"password",value:s.token,onChange:T=>x("token",T.target.value),onBlur:()=>E("token"),autoComplete:"off",required:!0,placeholder:"需要仓库 Contents 与 Pull requests 写权限","aria-invalid":!!r.token,"aria-describedby":`github-token-help${r.token?" github-token-error":""}`}),o.jsx("button",{type:"button",onClick:()=>h(T=>!T),"aria-label":f?"隐藏 Token":"显示 Token",title:f?"隐藏 Token":"显示 Token",children:o.jsx(QNe,{hidden:f})})]}),o.jsx("span",{id:"github-token-help",className:"github-field-help",children:"Token 仅用于本次提交,不会保存在浏览器或写入 PR"}),r.token?o.jsx("span",{id:"github-token-error",className:"github-field-error",role:"alert",children:r.token}):null]}),l?o.jsx("div",{className:"github-submit-message is-error",role:"alert",children:l}):null,b?o.jsxs("div",{className:"github-submit-message is-success",role:"status",children:[o.jsxs("span",{children:["PR #",b.number," 已创建"]}),o.jsxs("a",{href:b.url,target:"_blank",rel:"noreferrer",children:["在 GitHub 查看",o.jsx(O3,{})]})]}):null,o.jsxs("div",{className:"github-form-actions",children:[o.jsxs("div",{className:"github-secrets-note",children:[o.jsx("strong",{children:"合并 PR 前,请在仓库的 GitHub Actions Secrets 中配置:"}),n.secrets.map(T=>o.jsx("span",{children:T},T))]}),o.jsx("button",{type:"submit",disabled:u,children:u?"提交 PR 中…":n.submitLabel})]})]})]})})]})}function tTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function nTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function sTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function iTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function rTe(e){return(e==null?void 0:e.name)==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function aTe(e,t){return t==="build"?"build_failed":(e==null?void 0:e.name)==="RuntimeProbeError"?"runtime_probe_error":e instanceof DOMException&&e.name==="AbortError"?"abort":e instanceof Error&&e.name&&e.name!=="Error"?e.name:"unknown"}function gh(e){return(e instanceof Error?e.message:String(e)).replace(/\b((?:app[_-]?)?secret|token|api[_-]?key|password)\b\s*[:=]\s*["']?[^"',\s}]+/gi,"$1=").slice(0,300)}const oTe="modulepreload",lTe=function(e){return"/"+e},M3={},lu=function(t,n,s){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=lTe(c),c in M3)return;M3[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":oTe,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})},L3=new Set;let M1={enabled:!1},ts,$f=null,D3=null,Vd="",DN="unknown",CH="unknown",Zm=[];function cTe(e){return e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e)}function uTe(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>[t,cTe(n)]))}function dTe(e){return e?Object.fromEntries(Object.entries(e).filter(([,t])=>Number.isFinite(t))):{}}function fTe(){return new Date().toISOString().slice(0,10)}function hTe(e){if(!e)return!0;if(e.dedupeKey){if(L3.has(e.dedupeKey))return!1;L3.add(e.dedupeKey)}if(e.dailyDedupeKey&&typeof localStorage<"u"){const t=`veadk.studio.telemetry.${fTe()}.${e.dailyDedupeKey}`;try{if(localStorage.getItem(t)==="1")return!1;localStorage.setItem(t,"1")}catch{}}return!0}function IH(e){if($f){try{$f("report",{ev_type:"custom",payload:{...e,type:"event"},extra:{timestamp:Date.now()}})}catch(t){console.warn("[telemetry] failed to send Studio event:",t)}return}Zm=[...Zm.slice(-49),e]}function pTe(){if(!$f)return;const e=Zm;Zm=[];for(const t of e)IH(t)}function mTe(e){if(M1=e,ts=e.studio,!e.enabled||!e.apmplus||D3)return;const t=e.apmplus;D3=lu(()=>import("./index.esm-Bao40dC4.js"),[]).then(n=>{var i;const s=n.default;s("init",{aid:t.aid,token:t.token,domain:t.domain,env:t.env,release:(i=e.studio)==null?void 0:i.version,userId:Vd||void 0}),s("start"),$f=s,pTe()}).catch(n=>{console.warn("[telemetry] APMPlus SDK failed to initialize:",n),M1={enabled:!1},Zm=[]})}function vr(e,t={},n,s){if(!M1.enabled||!M1.apmplus||!hTe(s))return;const i=e!=="studio_instance_loaded"?{user_id:Vd,user_role:DN,user_source:CH}:{};IH({name:e,categories:uTe({studio_deploy_id:ts==null?void 0:ts.deployId,user_pool_id:ts==null?void 0:ts.userPoolId,vefaas_application_id:ts==null?void 0:ts.applicationId,vefaas_function_id:ts==null?void 0:ts.functionId,studio_region:ts==null?void 0:ts.region,studio_project:ts==null?void 0:ts.project,studio_version:ts==null?void 0:ts.version,...i,...t}),metrics:dTe(n)})}function gTe(e){if(Vd=e.userId.trim(),!!Vd){if(DN=e.role??"unknown",CH=e.local?"local":"sso",$f)try{$f("config",{userId:Vd})}catch(t){console.warn("[telemetry] failed to update Studio user id:",t)}vr("studio_user_authenticated",{},void 0,{dailyDedupeKey:["studio_user_authenticated",(ts==null?void 0:ts.deployId)??"",Vd,DN].join(":")})}}function jH(e){return{deploy_source:e.telemetry.source,create_mode:e.telemetry.createMode,ai_assisted:e.telemetry.aiAssisted,deploy_action:e.action,deploy_region:e.region,runtime_network_type:e.networkType,feishu_enabled:e.feishuEnabled}}function RH(e){return{deploy_source:e.telemetry.source,create_mode:e.telemetry.createMode,ai_assisted:e.telemetry.aiAssisted,deploy_action:e.action}}function bTe(e){vr("studio_instance_loaded",{agents_source:e.agentsSource},void 0,{dedupeKey:"studio_instance_loaded"})}function OH(e){vr("studio_agent_deploy",{...jH(e),deploy_status:"succeeded",runtime_id:e.runtimeId})}function MH(e){vr("studio_agent_deploy",{...jH(e),deploy_status:"failed",failed_phase:e.phase,error_kind:aTe(e.error,e.phase),error_summary:gh(e.error)})}function yTe(e){vr("studio_sandbox_create",{sandbox_status:"succeeded",sandbox_kind:e.kind,sandbox_source:e.source,sandbox_session_id:e.sessionId})}function xTe(e){vr("studio_sandbox_create",{sandbox_status:"failed",sandbox_kind:e.kind,sandbox_source:e.source,error_kind:tTe(e.error),error_summary:gh(e.error)})}function ETe(e){vr("studio_agent_debug",{debug_status:"succeeded",variant_type:e.variantType},{duration_ms:e.durationMs})}function vTe(e){vr("studio_agent_debug",{debug_status:"failed",variant_type:e.variantType,failed_phase:e.phase,error_kind:nTe(e.error),error_summary:gh(e.error)},{duration_ms:e.durationMs})}function mb(e){vr("studio_agent_connect",{connect_status:"succeeded",agent_kind:e.kind,connect_source:e.source,runtime_region:e.runtimeRegion,runtime_is_mine:e.runtimeIsMine,sandbox_status:e.sandboxStatus},{duration_ms:e.durationMs})}function Vw(e){vr("studio_agent_connect",{connect_status:"failed",agent_kind:e.kind,connect_source:e.source,error_kind:sTe(e.error),error_summary:gh(e.error)},{duration_ms:e.durationMs})}function P3(e){vr("studio_agent_message",{message_status:"succeeded",agent_kind:e.kind,message_source:e.source,session_state:e.sessionState},{duration_ms:e.durationMs})}function rp(e){vr("studio_agent_message",{message_status:"failed",agent_kind:e.kind,message_source:e.source,session_state:e.sessionState,failed_phase:e.phase,error_kind:iTe(e.error),error_summary:gh(e.error)},{duration_ms:e.durationMs})}function wTe(e){vr("studio_agent_source_download",{...RH(e),download_status:"succeeded"},{duration_ms:e.durationMs,file_count:e.fileCount,zip_size_bytes:e.zipSizeBytes})}function _Te(e){vr("studio_agent_source_download",{...RH(e),download_status:"failed",error_kind:rTe(e.error),error_summary:gh(e.error)},{duration_ms:e.durationMs,file_count:e.fileCount})}const STe=/^[A-Za-z_][A-Za-z0-9_]*$/;function nc(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":STe.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function LH(e){const t=new Set,n=new Set,s=i=>{nc(i.name)===null&&(t.has(i.name)?n.add(i.name):t.add(i.name)),i.subAgents.forEach(s)};return s(e),n}function NTe(e){return{...Ci(),name:e,description:"一个通过飞书接收消息并提供帮助的智能助手。",instruction:"你是一个通过飞书为用户提供帮助的智能助手。准确理解用户问题,给出简洁、可靠的回答;信息不足时先提问澄清,不要臆造事实。",deployment:{feishuEnabled:!0}}}async function TTe(e){const t=NTe(e.agentName),n=await kx(t);return vg(n.name,n.files,{region:e.region,projectName:"default"},{taskId:e.taskId,sessionStorage:"in-memory",minInstance:1,maxInstance:1,description:t.description,im:{feishu:{enabled:!0}},envs:[{key:"FEISHU_APP_ID",value:e.appId},{key:"FEISHU_APP_SECRET",value:e.appSecret}],onStage:e.onStage})}const va=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}],DH=[{phase:"prepare",label:"生成智能体"},{phase:"build",label:"构建镜像"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}];function kTe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ATe(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 7 4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function B3(e){return o.jsx("svg",{viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4 9.2 3.1 3.1L14 5.8",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"})})}function CTe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"M6.5 4H4.8A1.8 1.8 0 0 0 3 5.8v5.4A1.8 1.8 0 0 0 4.8 13h5.4a1.8 1.8 0 0 0 1.8-1.8V9.5M9 3h4v4M12.5 3.5 7.2 8.8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function ITe(e){if(!e||e==="upload")return 0;const t=DH.findIndex(n=>n.phase===e);return t<0?0:t}function jTe({onBack:e}){var X;const[t,n]=g.useState("feishu_assistant"),[s,i]=g.useState(""),[r,a]=g.useState(""),[l,c]=g.useState(!1),[u,d]=g.useState("cn-beijing"),[f,h]=g.useState(!1),[p,m]=g.useState(""),[b,v]=g.useState(""),[y,x]=g.useState(""),[E,w]=g.useState("idle"),[S,_]=g.useState(null),[T,k]=g.useState(""),[A,j]=g.useState(null),R=g.useRef(null),B=g.useRef(null),z=g.useRef([]),L=g.useRef(0),F=g.useRef(null),C=g.useRef("prepare"),I=g.useRef(!1),D=g.useRef(!0),$=["preparing","running","cancelling"].includes(E);g.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]),g.useEffect(()=>{var he;if(!f)return;(he=z.current[L.current])==null||he.focus();const K=be=>{be.target instanceof Node&&R.current&&!R.current.contains(be.target)&&h(!1)},ce=be=>{var ue;be.key==="Escape"&&(h(!1),(ue=B.current)==null||ue.focus())};return window.addEventListener("pointerdown",K),window.addEventListener("keydown",ce),()=>{window.removeEventListener("pointerdown",K),window.removeEventListener("keydown",ce)}},[f]);const O=K=>{K.key==="Enter"&&(K.nativeEvent.isComposing||K.nativeEvent.keyCode===229)&&K.preventDefault()},te=()=>{const K=nc(t.trim())??"",ce=s.trim()?"":"请输入飞书 App ID",he=r.trim()?"":"请输入飞书 App Secret";return m(K),v(ce),x(he),!K&&!ce&&!he},se=async K=>{if(K.preventDefault(),!te()||$)return;const ce=crypto.randomUUID();F.current=ce,C.current="prepare",I.current=!1,w("preparing"),_(null),k(""),j(null);try{const he=await TTe({agentName:t.trim(),appId:s.trim(),appSecret:r.trim(),region:u,taskId:ce,onStage:be=>{C.current=be.phase||"deploy",!(!D.current||I.current)&&(w("running"),_(be))}});if(!D.current||I.current)return;OH({telemetry:{source:"feishu_automation",createMode:"feishu_template",aiAssisted:!1},action:"create",region:u,networkType:"public",feishuEnabled:!0,runtimeId:he.runtimeId||""}),j(he),a(""),c(!1),w("succeeded")}catch(he){if(!D.current||I.current)return;MH({telemetry:{source:"feishu_automation",createMode:"feishu_template",aiAssisted:!1},action:"create",region:u,networkType:"public",feishuEnabled:!0,phase:C.current,error:he}),w("failed"),k(he instanceof Error?he.message:String(he))}finally{F.current===ce&&(F.current=null)}},P=async()=>{const K=F.current;if(!(!K||E!=="running")&&window.confirm("取消部署将停止任务并清理已创建的 Runtime,确定继续吗?")){I.current=!0,w("cancelling"),k("");try{await A8(K),D.current&&w("cancelled")}catch(ce){if(I.current=!1,!D.current)return;w("failed"),k(ce instanceof Error?ce.message:String(ce))}}},Q=ITe((S==null?void 0:S.phase)??null),ee=!!(t.trim()&&s.trim()&&r.trim()&&!$),V=va.find(K=>K.value===u);return o.jsxs("div",{className:"feishu-integration-page",children:[o.jsxs("header",{className:"feishu-integration-header",children:[o.jsx("button",{type:"button",className:"feishu-back",onClick:e,"aria-label":"返回自动化列表",disabled:$,children:o.jsx(kTe,{})}),o.jsx("img",{className:"feishu-integration-logo",src:_A,alt:"","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("h1",{children:"飞书机器人"}),o.jsx("p",{children:"创建一个由 AgentKit Runtime 驱动的飞书智能体"})]})]}),o.jsx("div",{className:"feishu-integration-layout",children:o.jsxs("section",{className:"feishu-section-panel",children:[o.jsx("p",{className:"feishu-panel-description",children:"填写已发布飞书应用的凭据,Studio 将生成 basic 智能体、创建独立 Runtime,并启用飞书消息长连接。"}),o.jsxs("form",{className:"feishu-form",onSubmit:se,onKeyDown:O,noValidate:!0,children:[o.jsxs("div",{className:"feishu-field-grid",children:[o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-agent-name",children:"智能体名称"}),o.jsx("input",{id:"feishu-agent-name",value:t,maxLength:64,disabled:$,onChange:K=>{n(K.target.value),p&&m("")},onBlur:()=>m(nc(t.trim())??""),"aria-invalid":!!p,"aria-describedby":`feishu-agent-name-help${p?" feishu-agent-name-error":""}`}),o.jsx("span",{id:"feishu-agent-name-help",className:"feishu-field-help",children:"将作为新 Runtime 中的根智能体名称"}),p?o.jsx("span",{id:"feishu-agent-name-error",className:"feishu-field-error",role:"alert",children:p}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{id:"feishu-region-label",children:"部署地域"}),o.jsxs("div",{className:"feishu-region-picker",ref:R,children:[o.jsxs("button",{ref:B,type:"button",className:"feishu-region-trigger",disabled:$,"aria-haspopup":"listbox","aria-expanded":f,"aria-labelledby":"feishu-region-label feishu-region-value",onClick:()=>{L.current=va.findIndex(K=>K.value===u),h(K=>!K)},onKeyDown:K=>{K.key!=="ArrowDown"&&K.key!=="ArrowUp"||(K.preventDefault(),L.current=K.key==="ArrowUp"?va.length-1:va.findIndex(ce=>ce.value===u),h(!0))},children:[o.jsx("span",{id:"feishu-region-value",children:V.label}),o.jsx(ATe,{})]}),f?o.jsx("div",{className:"feishu-region-menu",role:"listbox","aria-label":"部署地域",onKeyDown:K=>{var be;const ce=z.current.findIndex(ue=>ue===document.activeElement);let he=null;K.key==="ArrowDown"?he=(ce+1)%va.length:K.key==="ArrowUp"?he=(ce-1+va.length)%va.length:K.key==="Home"?he=0:K.key==="End"?he=va.length-1:K.key==="Tab"&&h(!1),he!==null&&(K.preventDefault(),(be=z.current[he])==null||be.focus())},children:va.map(K=>o.jsx("button",{ref:ce=>{const he=va.findIndex(be=>be.value===K.value);z.current[he]=ce},type:"button",role:"option","aria-selected":u===K.value,className:`feishu-region-option${u===K.value?" is-selected":""}`,onClick:()=>{var ce;d(K.value),h(!1),(ce=B.current)==null||ce.focus()},children:K.label},K.value))}):null]}),o.jsx("span",{className:"feishu-field-help",children:"Runtime 与构建产物将创建在该地域"})]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-id",children:"飞书 App ID"}),o.jsx("input",{id:"feishu-app-id",value:s,maxLength:128,autoComplete:"off",disabled:$,placeholder:"cli_xxxxxxxxxxxxxxxx",onChange:K=>{i(K.target.value),b&&v("")},onBlur:()=>v(s.trim()?"":"请输入飞书 App ID"),"aria-invalid":!!b,"aria-describedby":`feishu-app-id-help${b?" feishu-app-id-error":""}`}),o.jsx("span",{id:"feishu-app-id-help",className:"feishu-field-help",children:"来自飞书开放平台的应用凭证"}),b?o.jsx("span",{id:"feishu-app-id-error",className:"feishu-field-error",role:"alert",children:b}):null]}),o.jsxs("div",{className:"feishu-field",children:[o.jsx("label",{htmlFor:"feishu-app-secret",children:"飞书 App Secret"}),o.jsxs("div",{className:"feishu-secret-input",children:[o.jsx("input",{id:"feishu-app-secret",type:l?"text":"password",value:r,maxLength:256,autoComplete:"off",disabled:$,placeholder:"请输入 App Secret",onChange:K=>{a(K.target.value),y&&x("")},onBlur:()=>x(r.trim()?"":"请输入飞书 App Secret"),"aria-invalid":!!y,"aria-describedby":`feishu-app-secret-help${y?" feishu-app-secret-error":""}`}),o.jsx("button",{type:"button",disabled:$,onClick:()=>c(K=>!K),"aria-label":l?"隐藏 App Secret":"显示 App Secret",children:l?"隐藏":"显示"})]}),o.jsx("span",{id:"feishu-app-secret-help",className:"feishu-field-help",children:"仅写入新 Runtime 的环境变量"}),y?o.jsx("span",{id:"feishu-app-secret-error",className:"feishu-field-error",role:"alert",children:y}):null]})]}),E!=="idle"?o.jsxs("div",{className:`feishu-deployment-status is-${E}`,role:E==="failed"?"alert":"status",children:[o.jsxs("div",{className:"feishu-deployment-heading",children:[E==="preparing"?o.jsx(Pa,{as:"strong",children:"正在生成 basic 智能体"}):null,E==="running"?o.jsx(Pa,{as:"strong",children:(S==null?void 0:S.message)||"正在创建 Runtime"}):null,E==="cancelling"?o.jsx(Pa,{as:"strong",children:"正在取消部署"}):null,E==="succeeded"?o.jsxs("strong",{children:[o.jsx(B3,{}),"飞书机器人 Runtime 已创建"]}):null,E==="cancelled"?o.jsx("strong",{children:"部署已取消"}):null,E==="failed"?o.jsx("strong",{children:"创建失败"}):null]}),E==="preparing"||E==="running"||E==="cancelling"?o.jsx("ol",{className:"feishu-deployment-steps",children:DH.map((K,ce)=>{const he=E==="running"&&ceK.value===(A.region||u)))==null?void 0:X.label)||A.region}),A.consoleUrl?o.jsxs("a",{href:A.consoleUrl,target:"_blank",rel:"noreferrer",children:["打开 Runtime 控制台",o.jsx(CTe,{})]}):null]}):null]}):null,o.jsxs("div",{className:"feishu-form-actions",children:[o.jsxs("div",{className:"feishu-secrets-note",children:[o.jsx("strong",{children:"凭据处理"}),o.jsx("span",{children:"App Secret 仅用于本次部署,不会写入生成源码或浏览器存储。"})]}),o.jsxs("div",{className:"feishu-action-buttons",children:[E==="running"?o.jsx("button",{type:"button",className:"feishu-cancel",onClick:()=>void P(),children:"取消部署"}):null,o.jsx("button",{type:"submit",className:"feishu-submit",disabled:!ee,children:$?"正在创建…":"创建飞书机器人 Runtime"})]})]})]})]})})]})}async function SA(e,t,n,s=yc){var r;const i=await e8(e,{...t,headers:{accept:"application/json",...t.headers},signal:n},s);if(!i.ok){let a="";try{a=((r=(await i.json()).detail)==null?void 0:r.trim())||""}catch{}throw new Error(a||`请求失败 (${i.status})`)}return i.json()}function RTe(e){return SA("/web/coding-agents/capabilities",{method:"GET"},e,Qk)}function OTe(e,t){return SA(`/web/coding-agents/skills/${encodeURIComponent(e)}/preview`,{method:"GET"},t)}function MTe(e,t){return SA("/web/coding-agents/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)},t)}const LTe="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='16'%20height='16'%20rx='3.692'%20fill='%231A1B1D'/%3e%3cpath%20d='M13.235%205.829V4.332H2.758v5.987h1.496v1.496h8.981V5.828Zm-1.497%204.49H4.254V5.83h7.484v4.49Z'%20fill='%2332F08C'/%3e%3cpath%20d='M6.937%206.993%205.88%208.051%206.937%209.11%207.995%208.05%206.937%206.993ZM9.931%206.992%208.873%208.05%209.931%209.11%2010.99%208.05%209.93%206.992Z'%20fill='%2332F08C'/%3e%3c/svg%3e";function DTe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m4 4 8 8m0-8-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function U3(){return o.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("path",{d:"M4 1.8h5l3 3V14H4z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),o.jsx("path",{d:"M9 1.8V5h3M6 8h4M6 10.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function F3(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"M1.8 4.5h4l1.2-1.3h2.2l1.2 1.3h3.8v8H1.8z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function PTe(e){return e instanceof DOMException&&e.name==="AbortError"}function BTe(e){return e instanceof Error&&e.message?e.message:"读取 Skill 文件失败"}function UTe(e){return e<1024?`${e} B`:`${(e/1024).toFixed(e<10*1024?1:0)} KB`}function FTe(e){const t=e.split("/");return t[t.length-1]??e}function $Te(e){const t=new Map;for(const n of e){const s=n.path.split("/"),i=s.length>1?s.slice(0,-1).join("/"):"";t.set(i,[...t.get(i)??[],n])}return Array.from(t,([n,s])=>({directory:n,files:s})).sort((n,s)=>n.directory?s.directory?n.directory.localeCompare(s.directory):1:-1)}function HTe({skill:e,onClose:t}){const n=g.useRef(null),s=g.useRef(null),i=g.useId(),r=g.useId(),[a,l]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(!0),[h,p]=g.useState(""),[m,b]=g.useState(0);g.useEffect(()=>{s.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const x=n.current;return x&&!x.open&&x.showModal(),()=>{var E;x!=null&&x.open&&x.close(),(E=s.current)==null||E.focus()}},[]),g.useEffect(()=>{const x=new AbortController;return f(!0),p(""),l(null),u(""),OTe(e.id,x.signal).then(E=>{if(x.signal.aborted)return;l(E);const w=E.files.find(S=>S.path==="SKILL.md")??E.files[0];u((w==null?void 0:w.path)??"")}).catch(E=>{!x.signal.aborted&&!PTe(E)&&p(BTe(E))}).finally(()=>{x.signal.aborted||f(!1)}),()=>x.abort()},[m,e.id]);const v=g.useMemo(()=>$Te((a==null?void 0:a.files)??[]),[a]),y=(a==null?void 0:a.files.find(x=>x.path===c))??null;return o.jsxs("dialog",{ref:n,className:"coding-agents-preview-dialog","aria-labelledby":i,"aria-describedby":r,onCancel:x=>{x.preventDefault(),t()},onMouseDown:x=>{const E=x.currentTarget.getBoundingClientRect();(x.clientXE.right||x.clientYE.bottom)&&t()},children:[o.jsxs("header",{className:"coding-agents-preview-header",children:[o.jsx("span",{className:"coding-agents-preview-mark",children:o.jsx(F3,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:i,children:e.name}),o.jsx("p",{id:r,children:"只读浏览随 Studio 提供的 Skill 文件"})]}),o.jsx("button",{type:"button",autoFocus:!0,"aria-label":"关闭文件预览",onClick:t,children:o.jsx(DTe,{})})]}),d?o.jsxs("div",{className:"coding-agents-preview-state",children:[o.jsx("i",{}),"正在读取文件…"]}):h?o.jsxs("div",{className:"coding-agents-preview-state is-error",role:"alert",children:[o.jsx("span",{children:h}),o.jsx("button",{type:"button",onClick:()=>b(x=>x+1),children:"重试"})]}):o.jsxs("div",{className:"coding-agents-preview-layout",children:[o.jsxs("nav",{className:"coding-agents-preview-tree","aria-label":`${e.name} 文件`,children:[o.jsxs("div",{className:"coding-agents-preview-tree-title",children:[o.jsx("span",{children:"文件"}),o.jsx("small",{children:(a==null?void 0:a.files.length)??0})]}),o.jsx("div",{className:"coding-agents-preview-tree-scroll",children:v.map(x=>x.directory?o.jsxs("details",{open:!0,children:[o.jsxs("summary",{children:[o.jsx(F3,{}),o.jsx("span",{children:x.directory})]}),o.jsx("div",{children:x.files.map(E=>o.jsxs("button",{type:"button",className:c===E.path?"is-selected":"","aria-current":c===E.path?"true":void 0,onClick:()=>u(E.path),children:[o.jsx(U3,{}),o.jsx("span",{children:FTe(E.path)})]},E.path))})]},x.directory):x.files.map(E=>o.jsxs("button",{type:"button",className:c===E.path?"is-selected":"","aria-current":c===E.path?"true":void 0,onClick:()=>u(E.path),children:[o.jsx(U3,{}),o.jsx("span",{children:E.path})]},E.path)))})]}),o.jsx("section",{className:"coding-agents-preview-file","aria-label":"文件内容",children:y?o.jsxs(o.Fragment,{children:[o.jsxs("header",{children:[o.jsx("strong",{children:y.path}),o.jsx("span",{children:UTe(y.size)})]}),y.previewable&&y.content!==null?o.jsx("pre",{tabIndex:0,children:o.jsx("code",{children:y.content})}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:"此文件不是可预览的 UTF-8 文本。"})]}):o.jsx("div",{className:"coding-agents-preview-unavailable",children:"没有可预览的文件。"})})]})]})}function zTe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9.8 3.5-4.5 4.5 4.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function VTe(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"16",height:"16",rx:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"m8.5 11-2.4 2.4 2.4 2.4M11 16.5h3.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("circle",{cx:"24.5",cy:"10.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("circle",{cx:"24.5",cy:"24.5",r:"2.5",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M19.5 10.5H22M18.2 19l4.3 3.7M24.5 13v9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function GTe(e){return o.jsx("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:o.jsxs("g",{stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",children:[o.jsx("path",{d:"M16 4.5v7M16 20.5v7"}),o.jsx("path",{d:"m9.3 6.3 3.5 6.1M19.2 19.6l3.5 6.1"}),o.jsx("path",{d:"m5.9 11.1 6.2 3.5M19.9 17.4l6.2 3.5"}),o.jsx("path",{d:"M4.7 16h7M20.3 16h7"}),o.jsx("path",{d:"m5.9 20.9 6.2-3.5M19.9 14.6l6.2-3.5"}),o.jsx("path",{d:"m9.3 25.7 3.5-6.1M19.2 12.4l3.5-6.1"})]})})}function KTe(e){return o.jsxs("svg",{viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M15.8 4.2c2.4 0 4.5 1.2 5.7 3.1 2.2-.3 4.5.8 5.6 2.9 1.1 2 .8 4.4-.5 6.1 1.2 1.8 1.3 4.3.1 6.2-1.2 2-3.4 3-5.6 2.6-1.3 1.8-3.5 2.9-5.8 2.7-2.2-.2-4.1-1.5-5.1-3.4-2.2.1-4.4-1-5.4-3.1-1-2-.6-4.4.8-6.1-1.1-1.9-1.1-4.3.2-6.1 1.3-1.9 3.6-2.7 5.7-2.2 1.1-1.7 2.6-2.7 4.3-2.7Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinejoin:"round"}),o.jsx("path",{d:"m10.7 12.2 3.1 3.8-3.1 3.8M17.1 20h4.3",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function $3(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.4 8.2 3 3L12.8 5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function qTe(e){return o.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M2.8 6.3h14.4v8.3a1.6 1.6 0 0 1-1.6 1.6H4.4a1.6 1.6 0 0 1-1.6-1.6V6.3Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),o.jsx("path",{d:"M2.8 6.3V5.1a1.4 1.4 0 0 1 1.4-1.4h3.4l1.5 1.6h6.5a1.6 1.6 0 0 1 1.6 1.6",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})]})}function YTe({agentId:e}){return e==="trae"?o.jsx("img",{src:LTe,alt:"","aria-hidden":"true"}):e==="claude-code"?o.jsx(GTe,{}):o.jsx(KTe,{})}function H3(e){return e instanceof DOMException&&e.name==="AbortError"}function z3(e,t){return e instanceof Error&&e.message?e.message:t}function WTe({onBack:e}){var j;const[t,n]=g.useState(null),[s,i]=g.useState(!0),[r,a]=g.useState(""),[l,c]=g.useState(0),[u,d]=g.useState(new Set),[f,h]=g.useState(new Set),[p,m]=g.useState(null),[b,v]=g.useState(!1),[y,x]=g.useState(null),E=g.useRef(null);g.useEffect(()=>{const R=new AbortController;return i(!0),a(""),RTe(R.signal).then(B=>{if(R.signal.aborted)return;n(B);const z=B.agents.filter(L=>L.available);d(L=>{const F=z.filter(C=>L.has(C.id));return new Set((F.length?F:z.slice(0,1)).map(C=>C.id))}),h(L=>{const F=B.skills.filter(C=>L.has(C.id));return new Set((F.length?F:B.skills).map(C=>C.id))})}).catch(B=>{!H3(B)&&!R.signal.aborted&&(n(null),a(z3(B,"检测本机客户端失败")))}).finally(()=>{R.signal.aborted||i(!1)}),()=>R.abort()},[l]),g.useEffect(()=>()=>{var R;return(R=E.current)==null?void 0:R.abort()},[]);const w=g.useMemo(()=>(t==null?void 0:t.agents.filter(R=>R.available&&u.has(R.id)))||[],[t,u]),S=g.useMemo(()=>(t==null?void 0:t.skills.filter(R=>f.has(R.id)))||[],[t,f]),_=!!(!b&&w.length&&S.length),T=(R,B)=>{!B||b||(x(null),d(z=>{const L=new Set(z);return L.has(R)?L.delete(R):L.add(R),L}))},k=R=>{b||(x(null),h(B=>{const z=new Set(B);return z.has(R)?z.delete(R):z.add(R),z}))},A=async()=>{var B;if(!_)return;(B=E.current)==null||B.abort();const R=new AbortController;E.current=R,v(!0),x(null);try{const z=await MTe({agents:w.map(F=>F.id),skills:S.map(F=>F.id)},R.signal);if(R.signal.aborted)return;const L=z.installations;x({tone:"success",message:`已为 ${w.length} 个客户端配置 ${S.length} 个 Skill`,details:L.map(F=>`${F.agentName} · ${F.skill} → ${F.displayPath}`)})}catch(z){!H3(z)&&!R.signal.aborted&&x({tone:"error",message:z3(z,"配置失败,请检查用户目录权限后重试")})}finally{E.current===R&&(E.current=null),R.signal.aborted||v(!1)}};return o.jsxs("section",{className:"coding-agents-page",children:[o.jsxs("header",{className:"coding-agents-header",children:[o.jsx("button",{type:"button",className:"coding-agents-back",onClick:e,disabled:b,"aria-label":"返回自动化列表",children:o.jsx(zTe,{})}),o.jsx(VTe,{className:"coding-agents-logo"}),o.jsxs("div",{children:[o.jsx("h1",{children:"配置 Coding Agents"}),o.jsx("p",{children:"把随 Studio 提供的 AgentKit Skills 全局安装到本地编码客户端。"})]})]}),o.jsx("div",{className:"coding-agents-scroll",children:o.jsxs("div",{className:"coding-agents-content",children:[o.jsxs("section",{className:"coding-agents-section","aria-label":"选择 Coding Agent",children:[o.jsxs("div",{className:"coding-agents-section-heading",children:[o.jsxs("div",{children:[o.jsx("span",{children:"1"}),o.jsx("h2",{children:"本机客户端"})]}),o.jsx("button",{type:"button",onClick:()=>c(R=>R+1),disabled:s||b,children:"重新检测"})]}),s?o.jsxs("div",{className:"coding-agents-inline-state",children:[o.jsx("i",{}),"正在检测本机客户端…"]}):r?o.jsxs("div",{className:"coding-agents-error-row",role:"alert",children:[o.jsx("span",{children:r}),o.jsx("button",{type:"button",onClick:()=>c(R=>R+1),children:"重试"})]}):o.jsx("div",{className:"coding-agents-agent-grid",children:t==null?void 0:t.agents.map(R=>o.jsxs("button",{type:"button",className:`coding-agents-agent ${u.has(R.id)?"is-selected":""}`,"aria-pressed":u.has(R.id),disabled:!R.available||b,onClick:()=>T(R.id,R.available),title:R.available?R.name:R.reason,children:[o.jsx("span",{className:`coding-agents-agent-mark is-${R.id}`,children:o.jsx(YTe,{agentId:R.id})}),o.jsxs("span",{className:"coding-agents-agent-copy",children:[o.jsx("strong",{children:R.name}),o.jsx("small",{children:R.available?R.version||"已检测到客户端":R.reason})]}),o.jsx("span",{className:`coding-agents-status ${R.available?"is-ready":""}`,children:R.available?"可用":"未检测到"}),o.jsx("span",{className:"coding-agents-check",children:o.jsx($3,{})})]},R.id))})]}),o.jsxs("section",{className:"coding-agents-section","aria-label":"选择内置 Skill",children:[o.jsx("div",{className:"coding-agents-section-heading",children:o.jsxs("div",{children:[o.jsx("span",{children:"2"}),o.jsx("h2",{children:"内置 Skills"})]})}),o.jsx("div",{className:"coding-agents-skill-list",children:t==null?void 0:t.skills.map(R=>o.jsxs("div",{className:`coding-agents-skill ${f.has(R.id)?"is-selected":""}`,children:[o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:f.has(R.id),onChange:()=>k(R.id),disabled:b}),o.jsx("span",{className:"coding-agents-skill-check","aria-hidden":"true",children:o.jsx($3,{})}),o.jsxs("span",{children:[o.jsx("strong",{children:R.name}),o.jsx("small",{children:R.description})]})]}),o.jsx("button",{type:"button",onClick:()=>m(R),children:"查看文件"})]},R.id))}),o.jsxs("div",{className:"coding-agents-global","aria-label":"全局安装目录",children:[o.jsxs("div",{className:"coding-agents-global-heading",children:[o.jsx(qTe,{}),o.jsxs("div",{children:[o.jsx("strong",{children:"全局安装"}),o.jsx("span",{children:"配置后可在本机其他项目中使用"})]})]}),w.length?o.jsx("dl",{children:w.map(R=>o.jsxs("div",{children:[o.jsx("dt",{children:R.name}),o.jsx("dd",{children:R.globalSkillsPath})]},R.id))}):o.jsx("p",{children:"选择客户端后显示对应安装目录。"})]})]}),y?o.jsxs("div",{className:`coding-agents-result is-${y.tone}`,role:y.tone==="error"?"alert":"status",children:[o.jsx("strong",{children:y.message}),(j=y.details)!=null&&j.length?o.jsx("ul",{children:y.details.map(R=>o.jsx("li",{children:R},R))}):null]}):null,o.jsxs("div",{className:"coding-agents-actions",children:[o.jsx("span",{children:w.length?`已选择 ${w.length} 个客户端、${S.length} 个 Skill`:"请先选择客户端"}),o.jsx("button",{type:"button",onClick:()=>void A(),disabled:!_,children:b?"正在配置…":"配置"})]})]})}),p?o.jsx(HTe,{skill:p,onClose:()=>m(null)}):null]})}const XTe={formatDate(e){const t=e.value??e.date??e.timestamp;if(t==null)return"";const n=new Date(t);return isNaN(n.getTime())?String(t):n.toLocaleString()}};function QTe(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let s=e;for(const i of n){if(s==null||typeof s!="object")return;s=s[i]}return s}function ZTe(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function JTe(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function NA(e,t){if(ZTe(e))return QTe(t,e.path);if(JTe(e)){const n=XTe[e.call],s={};for(const[i,r]of Object.entries(e.args??{}))s[i]=NA(r,t);return n?n(s):`[unknown fn: ${e.call}]`}return e}function eke(e,t){const n=NA(e,t);return n==null?"":typeof n=="string"?n:String(n)}const PH=new Map;function Bu(e,t){PH.set(e,t)}function tke(e){return PH.get(e)}function nke(e,t,n){const s=t.replace(/^\//,"").split("/").map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(let r=0;rNA(s,e.dataModel),resolveString:s=>eke(s,e.dataModel),dispatchAction:t,render:s=>{if(!s)return null;const i=e.components[s];if(!i)return null;const r=tke(i.component)??ske;return o.jsx(r,{node:i,ctx:n},s)}};return o.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function rke(e){const t=g.useRef(null),n=g.useRef(!0),s=28,i=g.useCallback(()=>{const r=t.current;r&&(n.current=r.scrollHeight-r.scrollTop-r.clientHeight{const r=t.current;r&&n.current&&(r.scrollTop=r.scrollHeight)},[e]),{ref:t,onScroll:i}}function aE({value:e,skillPrefix:t="/",onRemoveSkill:n,onRemoveAgent:s}){return e.skills.length===0&&!e.targetAgent?null:o.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(i=>o.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:i.description,children:[o.jsx(mu,{"aria-hidden":!0}),o.jsxs("span",{children:[t,i.name]}),n?o.jsx("button",{type:"button",onClick:()=>n(i.name),"aria-label":`移除技能 ${i.name}`,children:o.jsx(Oi,{})}):null]},i.name)),e.targetAgent?o.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[o.jsx(PB,{"aria-hidden":!0}),o.jsx("span",{children:e.targetAgent.name}),s?o.jsx("button",{type:"button",onClick:s,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:o.jsx(Oi,{})}):null]}):null]})}function TA(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function UH(e){var n,s,i,r;const t=TA(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((s=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:s.toUpperCase())??"VIDEO":t==="image"?((r=(i=e.mimeType)==null?void 0:i.split("/")[1])==null?void 0:r.toUpperCase())??"IMAGE":"TXT"}function FH(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function $H(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?x8(t,e.uri):""}function ake({kind:e}){return e==="image"?o.jsx(Wk,{}):e==="video"?o.jsx(UB,{}):e==="pdf"?o.jsx(Pee,{}):o.jsx(qk,{})}function oE({appName:e,items:t,compact:n=!1,onRemove:s}){const[i,r]=g.useState(null);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const l=TA(a.mimeType),c=$H(a,e),u=a.status==="uploading"||a.status==="error"||!c,d=o.jsxs("button",{type:"button",className:"media-card-main",disabled:u,onClick:l==="image"?void 0:()=>r(a),"aria-label":`预览 ${a.name??"附件"}`,children:[l==="image"&&c?o.jsx("img",{className:"media-card-image",src:c,alt:a.name??"图片",loading:"lazy"}):l==="video"&&c?o.jsxs("div",{className:"media-card-video-container",children:[o.jsx("video",{className:"media-card-video",src:c,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),o.jsx("span",{className:"media-card-video-play",children:o.jsx(ite,{})})]}):o.jsx("span",{className:"media-card-icon",children:o.jsx(ake,{kind:l})}),o.jsxs("span",{className:"media-card-copy",children:[o.jsx("span",{className:"media-card-name",children:a.name??"附件"}),o.jsxs("span",{className:"media-card-meta",children:[o.jsx("span",{className:"media-card-type",children:UH(a)}),a.status==="uploading"?o.jsxs(o.Fragment,{children:[o.jsx(yn,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":FH(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?o.jsx(nu,{className:"media-card-open"}):null]});return o.jsxs(is.div,{className:`media-card media-card--${l}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[l==="image"&&!u?o.jsx(OB,{src:c,children:d}):d,s?o.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>s(a.id),children:o.jsx(Oi,{})}):null]},a.id)})}),o.jsx(Ko,{children:i?o.jsx(oke,{appName:e,item:i,onClose:()=>r(null)}):null})]})}function oke({appName:e,item:t,onClose:n}){const s=g.useMemo(()=>$H(t,e),[e,t]),i=TA(t.mimeType),[r,a]=g.useState(""),[l,c]=g.useState(i==="text"||i==="markdown"),[u,d]=g.useState("");return g.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),g.useEffect(()=>{if(i!=="text"&&i!=="markdown")return;const f=new AbortController;return c(!0),d(""),fetch(s,{signal:f.signal}).then(h=>{if(!h.ok)throw new Error(`HTTP ${h.status}`);return h.text()}).then(a).catch(h=>{f.signal.aborted||d(h instanceof Error?h.message:String(h))}).finally(()=>{f.signal.aborted||c(!1)}),()=>f.abort()},[i,s]),o.jsx(is.div,{className:"media-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":t.name??"附件预览",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onMouseDown:f=>{f.target===f.currentTarget&&n()},children:o.jsxs(is.div,{className:"media-viewer",initial:{opacity:0,y:18,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.99},transition:{type:"spring",stiffness:420,damping:30},children:[o.jsxs("header",{className:"media-viewer-header",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.name??"附件"}),o.jsxs("span",{children:[UH(t),t.sizeBytes?` · ${FH(t.sizeBytes)}`:""]})]}),o.jsxs("nav",{children:[o.jsx("a",{href:s,download:t.name,"aria-label":"下载",children:o.jsx(yx,{})}),o.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:o.jsx(Oi,{})})]})]}),o.jsxs("div",{className:`media-viewer-body media-viewer-body--${i}`,children:[i==="image"?o.jsx("img",{src:s,alt:t.name??"图片"}):null,i==="video"?o.jsx("div",{className:"media-viewer-video-wrapper",children:o.jsx("video",{src:s,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,i==="pdf"?o.jsx("iframe",{src:s,title:t.name??"PDF"}):null,l?o.jsxs("div",{className:"media-viewer-loading",children:[o.jsx(yn,{})," 正在读取文档…"]}):null,!l&&u?o.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",u]}):null,!l&&i==="markdown"?o.jsx("div",{className:"media-document",children:o.jsx(ph,{text:r})}):null,!l&&i==="text"?o.jsx("pre",{className:"media-document media-document--plain",children:r}):null]})]})})}function lke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),o.jsx("path",{d:"M4.15 10.25h12.2M10.25 4c1.65 1.72 2.5 3.8 2.5 6.25s-.85 4.53-2.5 6.25M10.25 4c-1.65 1.72-2.5 3.8-2.5 6.25s.85 4.53 2.5 6.25M14.8 14.8 20 20"})]})}function cke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),o.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),o.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),o.jsx("path",{d:"m19.4 2.75.48 1.37 1.37.48-1.37.48-.48 1.37-.48-1.37-1.37-.48 1.37-.48.48-1.37Z",fill:"currentColor",stroke:"none"})]})}function HH(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.25",y:"5.25",width:"17.5",height:"13.5",rx:"2.4"}),o.jsx("path",{d:"M3.25 9h17.5M6.75 5.25 9.3 9M12 5.25 14.55 9M17.25 5.25 19.8 9"}),o.jsx("path",{d:"m10.25 11.45 4 2.55-4 2.55v-5.1Z"})]})}function uke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 5.25h15.5v10.5H4.25zM8.25 19.75h7.5M12 15.75v4"}),o.jsx("path",{d:"m7.25 12.75 2.35-2.4 2.15 1.65 3.4-3.6 1.6 1.55"}),o.jsx("circle",{cx:"7.25",cy:"8.4",r:".7",fill:"currentColor",stroke:"none"})]})}function dke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M5 7.4c0-1.55 3.13-2.8 7-2.8s7 1.25 7 2.8-3.13 2.8-7 2.8-7-1.25-7-2.8Z"}),o.jsx("path",{d:"M5 7.4v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8V7.4M5 11.95v4.55c0 1.55 3.13 2.8 7 2.8s7-1.25 7-2.8v-4.55"}),o.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function fke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),o.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),o.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),o.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function hke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.25 6.25h6.25c1 0 1.5.55 1.5 1.45v11.05c0-.9-.5-1.45-1.5-1.45H4.25V6.25Z"}),o.jsx("path",{d:"M19.75 9.1v8.2H13.5c-1 0-1.5.55-1.5 1.45V7.7c0-.9.5-1.45 1.5-1.45h2.15"}),o.jsx("path",{d:"m19 3.2.58 1.62 1.62.58-1.62.58L19 7.6l-.58-1.62-1.62-.58 1.62-.58L19 3.2Z",fill:"currentColor",stroke:"none"})]})}function pke(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m4.2 8.4 1.15 10.2h13.3L19.8 8.4"}),o.jsx("path",{d:"M4.2 8.4h15.6L17.9 5H6.1L4.2 8.4Z"}),o.jsx("path",{d:"M7.2 12.2c1.1-1 2.25 1.25 3.4.25 1.05-.9 2.15 1.3 3.3.25"}),o.jsx("path",{d:"m8.2 15.1 1.45 1.35 1.45-1.35M13.55 16.45h2.35"})]})}function zH(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function mke({definition:e,label:t,done:n,open:s,onToggle:i}){const r=e.icon,a=t??(n?e.doneLabel:e.runningLabel);return o.jsxs("button",{type:"button",className:`builtin-tool-head${n?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:i,"aria-expanded":s,children:[o.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:o.jsx(r,{})}),n?o.jsx("span",{className:"builtin-tool-label",children:a}):o.jsx(Pa,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:a}),o.jsx(zH,{className:`builtin-tool-chevron${s?" is-open":""}`})]})}const gke={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:lke},run_code:{name:"run_code",runningLabel:"正在 AgentKit 沙箱中执行代码",doneLabel:"已在 AgentKit 沙箱中完成代码执行",tone:"sandbox",icon:pke},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:cke},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:HH},ppt_generate:{name:"ppt_generate",runningLabel:"正在生成 PPT",doneLabel:"已完成 PPT 生成",tone:"presentation",icon:uke},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:dke},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:fke},load_skill:{name:"load_skill",runningLabel:"正在加载技能",doneLabel:"已加载技能",tone:"skill",icon:hke}};function bke(e){return gke[e]}const VH="send_a2ui_json_to_client",yke=28;function xke(e,t,n){let s=t;for(let i=0;i65535?2:1}return s}function Eke(e){return e<=4?1:Math.min(18,Math.max(2,Math.ceil(e/6)))}function GH(e,t,n){const[s,i]=g.useState(()=>t?"":e),r=g.useRef(s),a=g.useRef(e),l=g.useRef(null),c=g.useRef(0),u=g.useRef(n);return a.current=e,u.current=n,g.useEffect(()=>{const d=r.current,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!t||f||!e.startsWith(d)){l.current!==null&&window.cancelAnimationFrame(l.current),l.current=null,d!==e&&(r.current=e,i(e));return}if(d===e||l.current!==null)return;const h=p=>{const m=a.current,b=r.current;if(!m.startsWith(b)){r.current=m,i(m),l.current=null;return}if(p-c.current{var d;(d=u.current)==null||d.call(u)},[s]),g.useEffect(()=>()=>{l.current!==null&&(window.cancelAnimationFrame(l.current),l.current=null)},[]),s}function vke({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:o.jsx("path",{d:"M12 2.2l1.7 5.1a3 3 0 0 0 1.9 1.9L20.8 11l-5.1 1.7a3 3 0 0 0-1.9 1.9L12 19.8l-1.7-5.1a3 3 0 0 0-1.9-1.9L3.2 11l5.1-1.7a3 3 0 0 0 1.9-1.9L12 2.2z"})})}function wke(){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M14.3 5.25a4.6 4.6 0 0 0-5.55 5.55L3.6 15.95a1.8 1.8 0 0 0 0 2.55l1.9 1.9a1.8 1.8 0 0 0 2.55 0l5.15-5.15a4.6 4.6 0 0 0 5.55-5.55l-2.9 2.9-2.45-.55-.55-2.45 2.9-2.9a4.6 4.6 0 0 0-1.45-1.45Z"})})}function _ke(e,t){if(e!=="load_skill"||t==null||typeof t!="object"||Array.isArray(t))return;const n=t.skill_name;if(!(typeof n!="string"||!n.trim()))return`使用 ${n.trim()} 技能`}function KH({text:e,done:t,answerStarted:n=!1,streaming:s=!1,onStreamFrame:i}){const[r,a]=g.useState(!(t||n)),l=g.useRef(!1);g.useEffect(()=>{l.current||a(!(t||n))},[n,t]);const c=()=>{l.current=!0,a(p=>!p)},u=e.replace(/^\s+/,""),d=GH(u,!t||s,i),{ref:f,onScroll:h}=rke(d);return o.jsxs("div",{className:"block-thinking",children:[o.jsxs("button",{className:"think-head",onClick:c,type:"button",children:[o.jsx("span",{className:"think-icon","aria-hidden":"true",children:o.jsx(vke,{className:`spark ${t?"":"pulse"}`})}),t?o.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):o.jsx(Pa,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),o.jsx(uc,{className:`chev ${r?"open":""}`})]}),o.jsx("div",{className:`think-collapse ${r&&d?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsx("div",{className:"think-body scroll",ref:f,onScroll:h,children:d})})})]})}function qH(){return o.jsx(KH,{text:"",done:!1})}const Ske=g.memo(function({text:t,streaming:n,onStreamFrame:s}){const i=GH(t,n,s);return i?o.jsx("div",{className:"bubble",children:o.jsx(ph,{text:i})}):null});function Nke({name:e,args:t,response:n,done:s}){const[i,r]=g.useState(!1),a=e===VH?"渲染 UI":e,l=bke(e),c=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),u=c&&c.length>2e3?c.slice(0,2e3)+` +…(已截断)`:c;return o.jsxs(is.div,{className:`block-tool${l?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[l?o.jsx(mke,{definition:l,label:_ke(e,t),done:s,open:i,onToggle:()=>r(d=>!d)}):o.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>r(d=>!d),type:"button","aria-expanded":i,children:[o.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:o.jsx(wke,{})}),s?o.jsx("span",{className:"tool-name",children:a}):o.jsx(Pa,{className:"tool-name",duration:2.2,spread:15,children:a}),o.jsx(zH,{className:`tool-chevron${i?" is-open":""}`})]}),o.jsx("div",{className:`think-collapse ${i?"open":""}`,children:o.jsx("div",{className:"think-collapse-inner",children:o.jsxs("div",{className:"tool-detail",children:[t!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"参数"}),o.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),u!=null&&o.jsxs("div",{className:"tool-section",children:[o.jsx("div",{className:"tool-section-label",children:"返回"}),o.jsx("pre",{className:"tool-args tool-result",children:u})]})]})})})]})}function Tke({block:e,onDownload:t,onPreview:n}){const[s,i]=g.useState(""),[r,a]=g.useState(""),[l,c]=g.useState(null);g.useEffect(()=>()=>{l&&URL.revokeObjectURL(l.url)},[l]);const u=()=>c(null),d=async(p,m)=>{if(t){i(`download:${p}`),a("");try{await t(p,m)}catch(b){a(b instanceof Error?b.message:String(b))}finally{i("")}}},f=async(p,m,b)=>{if(n){i(`preview:${b}`),a("");try{const v=await n(p,m);c({name:b,url:v})}catch(v){a(v instanceof Error?v.message:String(v))}finally{i("")}}},h=e.files.filter(p=>!p.filename.endsWith(".preview.webp"));return o.jsxs("div",{className:"artifact-list",children:[h.map(p=>{const m=`${p.filename.replace(/\.pptx$/i,"")}.preview.webp`,b=e.files.find(v=>v.filename===m);return o.jsxs("div",{className:"artifact-card",children:[o.jsx("span",{className:"artifact-card__icon","aria-hidden":"true",children:o.jsx(qk,{})}),o.jsxs("span",{className:"artifact-card__copy",children:[o.jsx("span",{className:"artifact-card__name",children:p.filename}),o.jsx("span",{className:"artifact-card__hint",children:"PowerPoint 演示文稿"})]}),o.jsxs("span",{className:"artifact-card__actions",children:[b&&o.jsxs("button",{className:"artifact-card__action",type:"button",disabled:!n||s!=="",onClick:()=>void f(b.filename,b.version,p.filename),children:[s===`preview:${p.filename}`?o.jsx(yn,{className:"spin"}):o.jsx(Mee,{}),"预览"]}),o.jsxs("button",{className:"artifact-card__action artifact-card__action--primary",type:"button",disabled:!t||s!=="",onClick:()=>void d(p.filename,p.version),children:[s===`download:${p.filename}`?o.jsx(yn,{className:"spin"}):o.jsx(yx,{}),"下载"]})]})]},`${p.filename}:${p.version}`)}),r&&o.jsx("div",{className:"artifact-card__error",children:r}),l&&o.jsxs("div",{className:"artifact-preview",role:"dialog","aria-modal":"true","aria-label":`${l.name} 预览`,children:[o.jsx("button",{className:"artifact-preview__backdrop",type:"button","aria-label":"关闭预览",onClick:u}),o.jsxs("div",{className:"artifact-preview__panel",children:[o.jsxs("div",{className:"artifact-preview__header",children:[o.jsx("span",{children:l.name}),o.jsx("button",{type:"button","aria-label":"关闭预览",onClick:u,children:o.jsx(Oi,{})})]}),o.jsx("div",{className:"artifact-preview__canvas",children:o.jsx("img",{src:l.url,alt:`${l.name} 幻灯片预览`})})]})]})]})}function kke({block:e,onAuth:t}){const[n,s]=g.useState(e.done?"done":"idle"),[i,r]=g.useState(""),a=e.label||"MCP 工具集",l=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),c=async()=>{if(t){r(""),s("authorizing");try{await t(e),s("done")}catch(d){r(d instanceof Error?d.message:String(d)),s("idle")}}};return e.done||n==="done"?o.jsxs(is.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[o.jsx($R,{className:"auth-card-icon auth-card-icon--done"}),o.jsxs("span",{children:["已授权 · ",a]})]}):o.jsxs(is.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o.jsxs("div",{className:"auth-card-head",children:[o.jsx($R,{className:"auth-card-icon"}),o.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),o.jsxs("p",{className:"auth-card-desc",children:["工具集 ",o.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",l&&o.jsxs(o.Fragment,{children:[" ","将跳转至 ",o.jsx("code",{className:"auth-card-code",children:l})," 完成登录,"]}),"授权完成后对话自动继续。"]}),o.jsx("button",{className:"auth-card-btn",onClick:c,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?o.jsxs(o.Fragment,{children:[o.jsx(yn,{className:"cw-i spin"})," 等待授权…"]}):o.jsx(o.Fragment,{children:"去授权"})}),!e.authUri&&o.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),i&&o.jsx("div",{className:"auth-card-err",children:i})]})}function kA({blocks:e,appName:t="",streaming:n=!1,onStreamFrame:s,onAction:i,onAuth:r,onArtifactDownload:a,onArtifactPreview:l}){return o.jsx(o.Fragment,{children:e.map((c,u)=>{switch(c.kind){case"thinking":{const d=e.slice(u+1).some(f=>f.kind==="text"&&!!f.text.trim());return o.jsx(KH,{text:c.text,done:c.done,answerStarted:d,streaming:n,onStreamFrame:s},u)}case"text":{const d=c.text.replace(/^\s+/,"");return d?o.jsx(Ske,{text:d,streaming:n,onStreamFrame:s},u):null}case"attachment":return o.jsx(oE,{appName:t,items:c.files},u);case"artifact":return o.jsx(Tke,{block:c,onDownload:a,onPreview:l},u);case"invocation":return o.jsx(aE,{value:c.value},u);case"tool":return c.name===VH&&c.done?null:o.jsx(Nke,{name:c.name,args:c.args,response:c.response,done:c.done},u);case"agent-transfer":return null;case"auth":return o.jsx(kke,{block:c,onAuth:r},u);case"a2ui":return BH(c.messages).filter(d=>d.components[d.rootId]).map(d=>o.jsx(is.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:o.jsx(ike,{surface:d,onAction:i})},`${u}-${d.surfaceId}`));default:return null}})})}function AA(e){return e.isComposing||e.keyCode===229}function Ake({className:e="icon"}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),o.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),o.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),o.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),o.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),o.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),o.jsx("path",{d:"m12 7.55 1.28 3.17L16.45 12l-3.17 1.28L12 16.45l-1.28-3.17L7.55 12l3.17-1.28L12 7.55Z",fill:"currentColor",stroke:"none"})]})}const wa=[{value:"agent",label:"Agent",description:"与当前选择的 Agent 对话"},{value:"temporary",label:"内置智能体",description:"使用平台提供的智能体"},{value:"skill-create",label:"创建 Skill",description:"使用两个模型生成并对比 Skill"}],Cke=[{label:"ArkClaw",kind:"openclaw"},{label:"Hermes 智能体",kind:"hermes"}];function V3({mode:e}){return e==="skill-create"?o.jsxs("svg",{className:"new-chat-mode__skill-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M10 2.2l1.35 4.1 4.15 1.35-4.15 1.35L10 13.1 8.65 9 4.5 7.65 8.65 6.3 10 2.2Z"}),o.jsx("path",{d:"M15.6 12.2l.6 1.8 1.8.6-1.8.6-.6 1.8-.6-1.8-1.8-.6 1.8-.6.6-1.8Z"})]}):e==="temporary"?o.jsxs("svg",{className:"new-chat-mode__temporary-icon",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"m10 2.8 6.1 3.45v7.5L10 17.2l-6.1-3.45v-7.5L10 2.8Z"}),o.jsx("path",{d:"m3.9 6.25 6.1 3.5 6.1-3.5M10 9.75v7.45"})]}):o.jsx(Ake,{className:"new-chat-mode__agent-icon"})}function Ike(){return o.jsx("svg",{className:"new-chat-mode__nested-chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m4.5 3 3 3-3 3"})})}function jke({value:e,onChange:t,disabled:n=!1,temporaryEnabled:s,skillCreateEnabled:i}){const[r,a]=g.useState(!1),[l,c]=g.useState(!1),[u,d]=g.useState(()=>wa.findIndex(S=>S.value===e)),f=g.useRef(null),h=g.useRef(null),p=wa.find(S=>S.value===e)??wa[0],m=p.value==="temporary"?"Codex 智能体":p.label;function b(S){return S.value==="temporary"?s:S.value==="skill-create"?i:!0}function v(S){return b(S)!==!0}function y(S){const _=b(S);return _===void 0?"正在检查配置":_?S.description:"管理员未配置"}g.useEffect(()=>{if(!r)return;const S=_=>{var T;(T=f.current)!=null&&T.contains(_.target)||(a(!1),c(!1))};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[r]);function x(S){let _=u;do _=(_+S+wa.length)%wa.length;while(v(wa[_]));d(_),c(wa[_].value==="temporary")}function E(S){var _;if(!v(S)){if(S.value==="temporary"){c(!0);return}t(S.value),a(!1),c(!1),(_=h.current)==null||_.focus()}}function w(){t("temporary"),a(!1),c(!1)}return o.jsxs("div",{className:"new-chat-mode",ref:f,children:[o.jsxs("button",{ref:h,type:"button",className:"new-chat-mode__trigger","aria-label":"选择新会话模式","aria-haspopup":"listbox","aria-expanded":r,disabled:n,onClick:()=>{d(wa.findIndex(S=>S.value===e)),a(S=>(S&&c(!1),!S))},onKeyDown:S=>{S.key==="ArrowDown"||S.key==="ArrowUp"?(S.preventDefault(),r?x(S.key==="ArrowDown"?1:-1):a(!0)):r&&(S.key==="Enter"||S.key===" ")?(S.preventDefault(),E(wa[u])):r&&S.key==="Escape"&&(S.preventDefault(),a(!1),c(!1))},children:[o.jsx("span",{className:"new-chat-mode__icon",children:o.jsx(V3,{mode:p.value})}),o.jsx("span",{className:"new-chat-mode__current",title:m,children:m}),o.jsx("svg",{className:"new-chat-mode__chevron",viewBox:"0 0 12 12","aria-hidden":"true",children:o.jsx("path",{d:"m3 4.5 3 3 3-3"})})]}),r?o.jsxs("div",{className:"new-chat-mode__menus",children:[o.jsx("div",{className:"new-chat-mode__menu",role:"listbox","aria-label":"新会话模式",tabIndex:-1,onKeyDown:S=>{var _;S.key==="ArrowDown"||S.key==="ArrowUp"?(S.preventDefault(),x(S.key==="ArrowDown"?1:-1)):S.key==="Enter"?(S.preventDefault(),E(wa[u])):S.key==="Escape"&&(S.preventDefault(),a(!1),c(!1),(_=h.current)==null||_.focus())},children:wa.map((S,_)=>{const T=S.value==="temporary";return o.jsxs("button",{type:"button",role:"option","aria-selected":e===S.value,"aria-haspopup":T?"menu":void 0,"aria-expanded":T?l:void 0,"aria-disabled":v(S),disabled:v(S),className:`new-chat-mode__option${_===u?" is-active":""}`,onMouseEnter:()=>{d(_),c(S.value==="temporary")},onClick:()=>E(S),children:[o.jsx("span",{className:"new-chat-mode__option-icon",children:o.jsx(V3,{mode:S.value})}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsxs("span",{className:"new-chat-mode__label",children:[S.label,S.value==="skill-create"?o.jsx("span",{className:"new-chat-mode__beta",children:"Beta"}):null]}),o.jsx("span",{children:y(S)})]}),T?o.jsx(Ike,{}):e===S.value?o.jsx("svg",{className:"new-chat-mode__check",viewBox:"0 0 16 16","aria-hidden":"true",children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})}):null]},S.value)})}),l?o.jsxs("div",{className:"new-chat-mode__submenu",role:"menu","aria-label":"内置智能体",children:[o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",onClick:w,children:[o.jsx(Qm,{kind:"codex",className:"new-chat-mode__builtin-icon"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:"Codex 智能体"}),o.jsx("span",{children:"在沙箱中执行任务"})]})]}),Cke.map(({label:S,kind:_})=>o.jsxs("button",{type:"button",role:"menuitem",className:"new-chat-mode__submenu-option",disabled:!0,children:[o.jsx(Qm,{kind:_,className:"new-chat-mode__builtin-icon"}),o.jsxs("span",{className:"new-chat-mode__copy",children:[o.jsx("span",{className:"new-chat-mode__label",children:S}),o.jsx("span",{children:"暂不可用"})]})]},S))]}):null]}):null]})}const od=[{id:"general",label:"通用智能体"},{id:"codex",label:"Codex 智能体"},{id:"openclaw",label:"OpenClaw 智能体"},{id:"hermes",label:"Hermes 智能体"}],Rke=15,Oke=15e3,Mke=120,Lke=180;function G3(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5.75 3.75 4.25 4.25-4.25 4.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Dke(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m3.25 8.25 3 3 6.5-6.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function Gw({type:e,className:t="new-chat-agent-picker__type-icon"}){return e==="general"?o.jsx(su,{className:t}):o.jsx(Qm,{kind:e,className:t})}function Pke({selectedAgentName:e="",selectedRuntimeId:t="",runtimeScope:n,disabled:s=!1,onSelectRuntime:i,onSelectSandboxSession:r}){var Ne;const[a,l]=g.useState(!1),[c,u]=g.useState(null),[d,f]=g.useState(0),[h,p]=g.useState(0),[m,b]=g.useState("types"),[v,y]=g.useState(!1),[x,E]=g.useState([]),[w,S]=g.useState([]),[_,T]=g.useState(null),[k,A]=g.useState(""),[j,R]=g.useState(!1),[B,z]=g.useState(""),[L,F]=g.useState(""),C=g.useRef(null),I=g.useRef(null),D=g.useRef(null),$=g.useRef(0),O=g.useRef(null),te=g.useRef(null),se=g.useRef(null),P=((Ne=od.find(ae=>ae.id===c))==null?void 0:Ne.label)??"智能体",Q=g.useCallback((ae=!1)=>{var me;te.current!==null&&(window.clearTimeout(te.current),te.current=null),se.current!==null&&(window.clearTimeout(se.current),se.current=null),l(!1),u(null),b("types"),y(!1),ae&&((me=I.current)==null||me.focus())},[]),ee=g.useCallback(async(ae="",me=!1)=>{const _e=++$.current;let Je;R(!0),z("");try{const Pe=await Promise.race([Tx({scope:n,region:"all",pageSize:Rke,nextToken:ae}),new Promise((Fe,Ye)=>{Je=window.setTimeout(()=>{Ye(new Error("加载智能体超时(15 秒),请检查网络或 Runtime 服务后重试"))},Oke)})]);if($.current!==_e)return;E(Fe=>{const Ye=me?Pe.runtimes:[...Fe,...Pe.runtimes];return Ye.filter((Ce,Ve)=>Ye.findIndex(Ue=>Ue.runtimeId===Ce.runtimeId)===Ve)}),A(Pe.nextToken),p(0)}catch(Pe){if($.current!==_e)return;z(Hd(Pe,"加载通用智能体","GET /web/runtimes"))}finally{window.clearTimeout(Je),$.current===_e&&R(!1)}},[n]),V=g.useCallback(async ae=>{var Je,Pe;(Je=O.current)==null||Je.abort();const me=new AbortController;O.current=me;const _e=++$.current;R(!0),z(""),S([]);try{const Fe=ae==="codex"?await cn.listSessions({signal:me.signal}):await cn.listAgentSessions(ae,{signal:me.signal});if($.current!==_e)return;S(Fe),T(ae),p(0)}catch(Fe){if((Fe==null?void 0:Fe.name)==="AbortError"||$.current!==_e)return;z(Hd(Fe,`加载 ${((Pe=od.find(Ye=>Ye.id===ae))==null?void 0:Pe.label)??ae}`,`GET /web/${ae==="codex"?"sandbox":ae}/sessions`)),T(ae)}finally{O.current===me&&(O.current=null),$.current===_e&&R(!1)}},[]);g.useEffect(()=>{!a||c!=="general"||x.length>0||j||B||ee("",!0)},[c,B,ee,j,a,x.length]),g.useEffect(()=>{!a||c===null||c==="general"||_===c||V(c)},[c,V,_,a]),g.useEffect(()=>{if(!a)return;const ae=me=>{var _e;(_e=C.current)!=null&&_e.contains(me.target)||Q()};return document.addEventListener("mousedown",ae),()=>document.removeEventListener("mousedown",ae)},[Q,a]),g.useEffect(()=>()=>{var ae;$.current+=1,(ae=O.current)==null||ae.abort(),te.current!==null&&window.clearTimeout(te.current),se.current!==null&&window.clearTimeout(se.current)},[]);function X(ae,me=!1){te.current!==null&&(window.clearTimeout(te.current),te.current=null),se.current!==null&&(window.clearTimeout(se.current),se.current=null),l(!0),u(me?"general":null),f(0),b("types"),y(me),ae&&requestAnimationFrame(()=>{var _e;return(_e=D.current)==null?void 0:_e.focus()})}function K(){s||a||te.current!==null||(te.current=window.setTimeout(()=>{te.current=null,X(!1)},Mke))}function ce(){se.current!==null&&(window.clearTimeout(se.current),se.current=null)}function he(){te.current!==null&&(window.clearTimeout(te.current),te.current=null),!(!a||se.current!==null)&&(se.current=window.setTimeout(()=>{se.current=null,Q()},Lke))}function be(ae){var Je;const me=(ae+od.length)%od.length,_e=od[me].id;_e!==c&&($.current+=1,(Je=O.current)==null||Je.abort(),O.current=null,R(!1),z("")),f(me),u(_e),p(0)}async function ue(ae){if(!L){F(ae.runtimeId),z("");try{await i(ae),Q(!0)}catch(me){z(Hd(me,"连接通用智能体"))}finally{F("")}}}async function we(ae){if(!L){F(ae.id),z("");try{await r(ae),Q(!0)}catch(me){z(Hd(me,`打开 ${P}`))}finally{F("")}}}function Le(ae){if(ae.key==="Escape"){ae.preventDefault(),Q(!0);return}if(["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Enter"].includes(ae.key)&&y(!0),m==="types"){ae.key==="ArrowDown"||ae.key==="ArrowUp"?(ae.preventDefault(),be(d+(ae.key==="ArrowDown"?1:-1))):(ae.key==="ArrowRight"||ae.key==="Enter")&&(ae.preventDefault(),c===null&&be(d),b("runtimes"));return}if(ae.key==="ArrowLeft")ae.preventDefault(),b("types");else if((c==="general"?x:w).length>0&&(ae.key==="ArrowDown"||ae.key==="ArrowUp")){ae.preventDefault();const me=ae.key==="ArrowDown"?1:-1,_e=c==="general"?x.length:w.length;p(Je=>(Je+me+_e)%_e)}else ae.key==="Enter"&&c==="general"&&x[h]?(ae.preventDefault(),ue(x[h])):ae.key==="Enter"&&c!=="general"&&w[h]&&(ae.preventDefault(),we(w[h]))}return o.jsxs("div",{className:"new-chat-agent-picker",ref:C,onPointerEnter:ae=>{ae.pointerType==="mouse"&&ce()},onPointerLeave:ae=>{ae.pointerType==="mouse"&&he()},children:[o.jsxs("button",{ref:I,type:"button",className:"new-chat-agent-picker__trigger","aria-label":"选择智能体","aria-haspopup":"menu","aria-expanded":a,disabled:s,onPointerEnter:ae=>{ae.pointerType==="mouse"&&K()},onClick:()=>a?Q():X(!0),onKeyDown:ae=>{ae.key==="ArrowDown"||ae.key==="ArrowUp"?(ae.preventDefault(),a||X(!0,!0)):ae.key==="Escape"&&a&&(ae.preventDefault(),Q(!0))},children:[o.jsx(su,{className:"new-chat-agent-picker__trigger-icon"}),o.jsx("span",{title:e||"选择智能体",children:e||"选择智能体"}),o.jsx(G3,{className:"new-chat-agent-picker__trigger-chevron"})]}),a?o.jsxs("div",{ref:D,className:"new-chat-agent-picker__menus",tabIndex:-1,onKeyDown:Le,onPointerMove:ae=>{ae.pointerType==="mouse"&&y(!1)},children:[o.jsx("div",{className:"new-chat-agent-picker__menu",role:"menu","aria-label":"智能体类型",children:od.map((ae,me)=>o.jsxs("button",{type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":c===ae.id,className:`new-chat-agent-picker__type${v&&m==="types"&&d===me?" is-keyboard-active":""}`,onMouseEnter:()=>be(me),onClick:()=>{be(me),b("runtimes")},children:[o.jsx(Gw,{type:ae.id}),o.jsx("span",{children:ae.label}),o.jsx(G3,{className:"new-chat-agent-picker__nested-chevron"})]},ae.id))}),c!==null?o.jsx("div",{className:"new-chat-agent-picker__submenu",role:"listbox","aria-label":`${P}列表`,children:c!=="general"&&j&&w.length===0?o.jsxs("div",{className:"new-chat-agent-picker__status",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"new-chat-agent-picker__spinner","aria-hidden":"true"}),"正在加载智能体"]}):c!=="general"&&B&&w.length===0?o.jsxs("div",{className:"new-chat-agent-picker__error",role:"alert",children:[o.jsx("span",{children:B}),o.jsx("button",{type:"button",onClick:()=>void V(c),children:"重新加载"})]}):c!=="general"&&w.length===0?o.jsxs(ns,{className:"new-chat-agent-picker__empty",fill:"none",children:[o.jsx(ns.Icon,{size:"sm",children:o.jsx(Gw,{type:c,className:"new-chat-agent-picker__empty-agent-icon"})}),o.jsx(ns.Title,{children:o.jsxs("span",{className:"new-chat-agent-picker__empty-title",children:["暂无 ",P]})}),o.jsx(ns.Description,{children:"请前往智能体页创建"})]}):c!=="general"?o.jsx("div",{className:"new-chat-agent-picker__runtime-list",children:w.map((ae,me)=>{const _e=L===ae.id;return o.jsxs("button",{type:"button",role:"option","aria-selected":!1,"aria-busy":_e||void 0,className:`new-chat-agent-picker__runtime${v&&m==="runtimes"&&h===me?" is-keyboard-active":""}`,disabled:!!L,title:`${ae.displayName||P} · ${ae.id}`,onMouseEnter:()=>p(me),onClick:()=>void we(ae),children:[o.jsx(Gw,{type:c,className:"new-chat-agent-picker__runtime-icon"}),o.jsx("span",{children:ae.displayName||P}),o.jsx("small",{children:_e?"正在打开":iE(ae.status)})]},ae.id)})}):j&&x.length===0?o.jsxs("div",{className:"new-chat-agent-picker__status",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"new-chat-agent-picker__spinner","aria-hidden":"true"}),"正在加载智能体"]}):B&&x.length===0?o.jsxs("div",{className:"new-chat-agent-picker__error",role:"alert",children:[o.jsx("span",{children:B}),o.jsx("button",{type:"button",onClick:()=>void ee("",!0),children:"重新加载"})]}):x.length===0?o.jsxs(ns,{className:"new-chat-agent-picker__empty",fill:"none",children:[o.jsx(ns.Icon,{size:"sm",children:o.jsx(su,{})}),o.jsx(ns.Title,{children:o.jsx("span",{className:"new-chat-agent-picker__empty-title",children:"暂无通用智能体"})}),o.jsx(ns.Description,{children:"请前往智能体页创建"})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"new-chat-agent-picker__runtime-list",children:x.map((ae,me)=>{const _e=L===ae.runtimeId,Je=ae.runtimeId===t;return o.jsxs("button",{type:"button",role:"option","aria-selected":Je,"aria-busy":_e||void 0,className:`new-chat-agent-picker__runtime${v&&m==="runtimes"&&h===me?" is-keyboard-active":""}`,disabled:!!L,title:ae.name,onMouseEnter:()=>p(me),onClick:()=>void ue(ae),children:[o.jsx(su,{className:"new-chat-agent-picker__runtime-icon"}),o.jsx("span",{children:ae.name}),_e?o.jsx("small",{children:"正在连接"}):Je?o.jsx(Dke,{className:"new-chat-agent-picker__check"}):null]},ae.runtimeId)})}),B?o.jsx("div",{className:"new-chat-agent-picker__inline-error",role:"alert",children:B}):null,k?o.jsx("button",{type:"button",className:"new-chat-agent-picker__load-more",disabled:j||!!L,onClick:()=>void ee(k),children:j?"加载中":"加载更多"}):null]})}):null]}):null]})}const YH={ppt:["ppt_generate"],image:["image_generate"],video:["video_generate"]},Bke={ppt:[],image:[],video:["video_task_query"]},CA=["doubao-seed-2-0-pro-260215","deepseek-v4-flash-260425"];function K3(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"4.25",y:"6.25",width:"13.5",height:"13.5",rx:"2.5"}),o.jsx("path",{d:"M11 10v6M8 13h6"}),o.jsx("path",{d:"m19.25 2.75.53 1.47 1.47.53-1.47.53-.53 1.47-.53-1.47-1.47-.53 1.47-.53.53-1.47Z",fill:"currentColor",stroke:"none"})]})}const q3=[{value:"ppt",label:"PPT",icon:Jee,prompts:["复盘【季度】经营表现,提炼指标差距、原因与行动建议","汇报【项目名称】进展:里程碑、风险、预算和资源诉求","为【客户行业】输出解决方案:痛点、架构、实施路径与收益","分析【行业主题】趋势,给出竞争格局、机会与战略建议"]},{value:"image",label:"图片生成",icon:Wk,prompts:["为【品牌或产品】设计【高级科技】风格的发布会主视觉","生成【产品名称】电商海报,突出【核心卖点】与品牌色","呈现【产品或空间】在【使用场景】中的写实概念效果图","围绕【传播主题】制作简洁专业的企业社媒配图"]},{value:"video",label:"视频生成",icon:HH,prompts:["制作【品牌名称】30 秒宣传片,突出【品牌价值】","为【产品名称】制作 45 秒发布视频:痛点、功能、场景与行动号召","制作【培训主题】企业培训视频,讲清【关键操作或规范】","生成【活动名称】20 秒预热视频,包含亮点、时间地点和报名信息"]}];function Uke({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:s,value:i,onChange:r,onSubmit:a,disabled:l,busy:c,showMeta:u,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,allowAttachments:b=!0,onInvocationChange:v,onAddFiles:y,onRemoveAttachment:x,newChatMode:E="agent",newChatTask:w=null,newChatLayout:S=!1,showModeSelector:_=!1,onModeChange:T,onTaskChange:k,temporaryEnabled:A,skillCreateEnabled:j,harnessEnabled:R=!1,builtinTools:B=[],showAgentPicker:z=!1,agentPickerDisabled:L=!1,selectedRuntimeId:F="",runtimeScope:C="mine",onSelectRuntime:I,onSelectSandboxSession:D}){const $=g.useRef(null),O=g.useRef(null),te=g.useRef(null),se=g.useRef(null),[P,Q]=g.useState(!1),[ee,V]=g.useState(null),[X,K]=g.useState(0),[ce,he]=g.useState(!1);async function be(){if(e)try{await navigator.clipboard.writeText(e),he(!0),setTimeout(()=>he(!1),1500)}catch{he(!1)}}g.useLayoutEffect(()=>{const Z=$.current;Z&&(Z.style.height="auto",Z.style.height=`${Math.min(Z.scrollHeight,200)}px`)},[i]);const ue=E==="skill-create";g.useEffect(()=>{ue&&(Q(!1),V(null))},[ue]);const we=!ue&&d.some(Z=>Z.status!=="ready"),Le=!l&&!c&&!we&&(i.trim().length>0||!ue&&d.length>0),Ne=ue?`描述你想创建的 Skill,将使用 ${CA.join(" 和 ")} 并行创建…`:l?"请先选择智能体":`向 ${s} 发消息…`,ae=(ee==null?void 0:ee.query.toLocaleLowerCase())??"",me=(ee==null?void 0:ee.kind)==="skill"?f.filter(Z=>!p.skills.some(Ee=>Ee.name===Z.name)).filter(Z=>`${Z.name} ${Z.description}`.toLocaleLowerCase().includes(ae)).map(Z=>({kind:"skill",value:Z})):(ee==null?void 0:ee.kind)==="agent"?h.filter(Z=>`${Z.name} ${Z.description}`.toLocaleLowerCase().includes(ae)).map(Z=>({kind:"agent",value:Z})):[];function _e(Z){var Ee;Q(!1),V(null),(Ee=Z.current)==null||Ee.click()}function Je(Z){k==null||k(Z.value),Q(!1),V(null),requestAnimationFrame(()=>{var Ee,Me;(Ee=$.current)==null||Ee.focus(),(Me=$.current)==null||Me.setSelectionRange(i.length,i.length)})}function Pe(Z){r(Z),Q(!1),V(null),requestAnimationFrame(()=>{var lt,Ot,ut;(lt=$.current)==null||lt.focus();const Ee=Z.indexOf("【"),Me=Z.indexOf("】",Ee+1);Ee>=0&&Me>Ee?(Ot=$.current)==null||Ot.setSelectionRange(Ee+1,Me):(ut=$.current)==null||ut.setSelectionRange(Z.length,Z.length)})}function Fe(){k==null||k(null),r(""),Q(!1),V(null),requestAnimationFrame(()=>{var Z,Ee;(Z=$.current)==null||Z.focus(),(Ee=$.current)==null||Ee.setSelectionRange(0,0)})}const Ye=q3.find(Z=>Z.value===w),Ce=q3.filter(Z=>YH[Z.value].every(Ee=>B.includes(Ee)));function Ve(Z,Ee){const Me=Z.slice(0,Ee),lt=/(^|\s)([/@])([^\s/@]*)$/.exec(Me);if(!lt){V(null);return}const Ot=lt[2].length+lt[3].length,ut={kind:lt[2]==="/"?"skill":"agent",query:lt[3],start:Ee-Ot,end:Ee},xn=!ee||ee.kind!==ut.kind||ee.query!==ut.query||ee.start!==ut.start||ee.end!==ut.end;V(ut),xn&&K(0),Q(!1)}function Ue(Z){if(!ee)return;const Ee=i.slice(0,ee.start)+i.slice(ee.end);r(Ee),Z.kind==="skill"?v({...p,skills:[...p.skills,Z.value]}):v({skills:[],targetAgent:Z.value});const Me=ee.start;V(null),requestAnimationFrame(()=>{var lt,Ot;(lt=$.current)==null||lt.focus(),(Ot=$.current)==null||Ot.setSelectionRange(Me,Me)})}function W(){if(p.targetAgent){v({skills:[]});return}p.skills.length>0&&v({...p,skills:p.skills.slice(0,-1)})}function oe(Z){const Ee=Z.target.files?Array.from(Z.target.files):[];Ee.length&&y(Ee),Z.target.value=""}return o.jsxs("div",{className:`composer${S?" composer--new-chat":""}${ue?" composer--skill-mode":""}${Ye?` composer--has-task composer--task-${Ye.value}`:""}`,children:[ue?null:o.jsx(aE,{value:p,onRemoveSkill:Z=>v({...p,skills:p.skills.filter(Ee=>Ee.name!==Z)}),onRemoveAgent:()=>v({skills:[]})}),!ue&&d.length>0&&o.jsx(oE,{appName:n,compact:!0,items:d,onRemove:x}),o.jsxs("div",{className:"composer-box",children:[ee?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":ee.kind==="skill"?"可用技能":"可用子 Agent",children:[o.jsxs("div",{className:"composer-command-head",children:[ee.kind==="skill"?o.jsx(mu,{}):o.jsx(PB,{}),o.jsx("span",{children:ee.kind==="skill"?"调用技能":"使用子 Agent"}),o.jsx("kbd",{children:ee.kind==="skill"?"/":"@"})]}),m?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(yn,{className:"spin"})," 正在读取 Agent 能力…"]}):me.length===0?o.jsx("div",{className:"composer-command-empty",children:ee.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):o.jsx("div",{className:"composer-command-list",children:me.map((Z,Ee)=>o.jsxs("button",{type:"button",role:"option","aria-selected":Ee===X,className:`composer-command-item${Ee===X?" is-active":""}`,onMouseDown:Me=>{Me.preventDefault(),Ue(Z)},onMouseEnter:()=>K(Ee),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${Z.kind}`,children:Z.kind==="skill"?o.jsx(mu,{}):o.jsx(pu,{})}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsxs("strong",{children:[Z.kind==="skill"?"/":"@",Z.value.name]}),o.jsx("span",{children:Z.value.description||(Z.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),o.jsx("kbd",{children:Ee===X?"↵":Z.kind==="skill"?"技能":"Agent"})]},`${Z.kind}-${Z.value.name}`))})]}):null,ue?null:o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:l||!b,onClick:()=>{V(null),Q(Z=>!Z)},children:o.jsx(ji,{className:"icon"})}),P&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>Q(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>_e(O),children:[o.jsx(Wk,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>_e(te),children:[o.jsx(qk,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>_e(se),children:[o.jsx(UB,{className:"icon"}),"上传视频"]})]})]})]}),z&&I&&D?o.jsx(Pke,{selectedAgentName:n?s:"",selectedRuntimeId:F,runtimeScope:C,disabled:L,onSelectRuntime:I,onSelectSandboxSession:D}):null,_&&T?o.jsx(jke,{value:E,onChange:T,disabled:c,temporaryEnabled:A,skillCreateEnabled:j}):null,S&&E==="agent"&&Ye&&k?o.jsxs("button",{type:"button",className:`new-chat-task-chip new-chat-task-chip--${Ye.value}`,"aria-label":`取消${Ye.label}任务`,disabled:c,onClick:Fe,children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(Ye.icon,{className:"new-chat-task-chip__task-icon"}),o.jsx(Oi,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:Ye.label})]}):null,S&&ue&&T?o.jsxs("button",{type:"button",className:"new-chat-task-chip new-chat-task-chip--skill","aria-label":"退出创建 Skill",disabled:c,onClick:()=>T("agent"),children:[o.jsxs("span",{className:"new-chat-task-chip__icon","aria-hidden":"true",children:[o.jsx(K3,{className:"new-chat-task-chip__task-icon"}),o.jsx(Oi,{className:"new-chat-task-chip__remove-icon"})]}),o.jsx("span",{children:"Skill"})]}):null,o.jsxs("div",{className:"composer-input-stack",children:[o.jsx("textarea",{ref:$,className:"comp-input scroll",rows:S?4:1,value:i,disabled:l,placeholder:Ne,"aria-expanded":!!ee,onChange:Z=>{r(Z.target.value),ue||Ve(Z.target.value,Z.target.selectionStart)},onSelect:Z=>{ue||Ve(Z.currentTarget.value,Z.currentTarget.selectionStart)},onBlur:()=>setTimeout(()=>V(null),0),onKeyDown:Z=>{if(!AA(Z.nativeEvent)){if(ee){if(Z.key==="ArrowDown"&&me.length>0){Z.preventDefault(),K(Ee=>(Ee+1)%me.length);return}if(Z.key==="ArrowUp"&&me.length>0){Z.preventDefault(),K(Ee=>(Ee-1+me.length)%me.length);return}if((Z.key==="Enter"||Z.key==="Tab")&&me[X]){Z.preventDefault(),Ue(me[X]);return}if(Z.key==="Escape"){Z.preventDefault(),V(null);return}}if(Z.key==="Backspace"&&!i&&Z.currentTarget.selectionStart===0&&Z.currentTarget.selectionEnd===0){W();return}Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),Le&&a())}}}),S&&i.length===0?o.jsx("span",{className:"composer-placeholder-reveal","aria-hidden":"true",children:Ne},Ne):null]}),o.jsx(is.button,{type:"button",className:"comp-send",disabled:!Le,onClick:a,"aria-label":"发送",whileTap:Le?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:c?o.jsx(yn,{className:"icon spin"}):o.jsx(DB,{className:"icon"})})]}),S&&E==="agent"&&R&&!Ye?o.jsxs("div",{className:"task-shortcuts","aria-label":"选择任务类型",children:[Ce.map(Z=>{const Ee=Z.icon;return o.jsxs("button",{type:"button",className:"task-shortcut",disabled:l||c,onClick:()=>Je(Z),children:[o.jsx(Ee,{}),o.jsx("span",{children:Z.label})]},Z.value)}),j===!0?o.jsxs("button",{type:"button",className:"task-shortcut",disabled:c,onClick:()=>T==null?void 0:T("skill-create"),children:[o.jsx(K3,{}),o.jsx("span",{children:"创建 Skill"})]}):null]}):null,S&&E==="agent"&&Ye?o.jsx("div",{className:"prompt-suggestions","aria-label":`${Ye.label}企业提示词`,children:Ye.prompts.map(Z=>{const Ee=Ye.icon;return o.jsxs("button",{type:"button",className:"prompt-suggestion",disabled:l||c,onClick:()=>Pe(Z),children:[o.jsx(Ee,{}),o.jsx("span",{children:Z})]},Z)})}):null,u&&o.jsxs("div",{className:"composer-meta",children:[o.jsxs("span",{className:"composer-session-line",children:["会话 ID:",o.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&o.jsx("button",{type:"button",className:"composer-session-copy",title:ce?"已复制":"复制会话 ID","aria-label":ce?"已复制会话 ID":"复制会话 ID",onClick:()=>void be(),children:ce?o.jsx(Ha,{}):o.jsx(bx,{})})]}),o.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),o.jsx("span",{children:"回答仅供参考"})]}),o.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:oe}),o.jsx("input",{ref:te,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:oe}),o.jsx("input",{ref:se,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:oe})]})}function WH({title:e,sub:t,cards:n,footer:s}){return o.jsxs("div",{className:"stk",children:[o.jsxs("div",{className:"stk-head",children:[o.jsx("h1",{className:"stk-title",children:e}),t&&o.jsx("p",{className:"stk-sub",children:t})]}),o.jsx("div",{className:"stk-list",children:n.map((i,r)=>o.jsxs(is.button,{type:"button",className:`stk-card ${i.disabled?"stk-card-disabled":""}`,onClick:i.disabled?void 0:i.onClick,disabled:i.disabled,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.18,ease:"easeOut",delay:r*.04},children:[o.jsx("span",{className:"stk-card-icon",children:o.jsx(i.icon,{})}),o.jsxs("span",{className:"stk-card-text",children:[o.jsx("span",{className:"stk-card-title",children:i.title}),o.jsx("span",{className:"stk-card-desc",children:i.desc})]}),i.status&&o.jsx("span",{className:"stk-card-status",children:i.status}),o.jsx(uc,{className:"stk-card-arrow"})]},i.key))}),s&&o.jsx("div",{className:"stk-footer",children:s})]})}const IA=Symbol.for("yaml.alias"),PN=Symbol.for("yaml.document"),sc=Symbol.for("yaml.map"),XH=Symbol.for("yaml.pair"),po=Symbol.for("yaml.scalar"),bh=Symbol.for("yaml.seq"),ha=Symbol.for("yaml.node.type"),yh=e=>!!e&&typeof e=="object"&&e[ha]===IA,Ug=e=>!!e&&typeof e=="object"&&e[ha]===PN,Fg=e=>!!e&&typeof e=="object"&&e[ha]===sc,Gs=e=>!!e&&typeof e=="object"&&e[ha]===XH,zn=e=>!!e&&typeof e=="object"&&e[ha]===po,$g=e=>!!e&&typeof e=="object"&&e[ha]===bh;function Hs(e){if(e&&typeof e=="object")switch(e[ha]){case sc:case bh:return!0}return!1}function Vs(e){if(e&&typeof e=="object")switch(e[ha]){case IA:case sc:case po:case bh:return!0}return!1}const QH=e=>(zn(e)||Hs(e))&&!!e.anchor,Fc=Symbol("break visit"),Fke=Symbol("skip children"),am=Symbol("remove node");function xh(e,t){const n=$ke(t);Ug(e)?Gd(null,e.contents,n,Object.freeze([e]))===am&&(e.contents=null):Gd(null,e,n,Object.freeze([]))}xh.BREAK=Fc;xh.SKIP=Fke;xh.REMOVE=am;function Gd(e,t,n,s){const i=Hke(e,t,n,s);if(Vs(i)||Gs(i))return zke(e,s,i),Gd(e,i,n,s);if(typeof i!="symbol"){if(Hs(t)){s=Object.freeze(s.concat(t));for(let r=0;re.replace(/[!,[\]{}]/g,t=>Vke[t]);class Xi{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Xi.defaultYaml,t),this.tags=Object.assign({},Xi.defaultTags,n)}clone(){const t=new Xi(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Xi(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Xi.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Xi.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Xi.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Xi.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),i=s.shift();switch(i){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[r,a]=s;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[r]=s;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{const a=/^\d+\.\d+$/.test(r);return n(6,`Unsupported YAML version ${r}`,a),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,s,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const r=this.tags[s];if(r)try{return r+decodeURIComponent(i)}catch(a){return n(String(a)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+Gke(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let i;if(t&&s.length>0&&Vs(t.contents)){const r={};xh(t.contents,(a,l)=>{Vs(l)&&l.tag&&(r[l.tag]=!0)}),i=Object.keys(r)}else i=[];for(const[r,a]of s)r==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(l=>l.startsWith(a)))&&n.push(`%TAG ${r} ${a}`);return n.join(` +`)}}Xi.defaultYaml={explicit:!1,version:"1.2"};Xi.defaultTags={"!!":"tag:yaml.org,2002:"};function ZH(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function JH(e){const t=new Set;return xh(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function ez(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function Kke(e,t){const n=[],s=new Map;let i=null;return{onAnchor:r=>{n.push(r),i??(i=JH(e));const a=ez(t,i);return i.add(a),a},setAnchors:()=>{for(const r of n){const a=s.get(r);if(typeof a=="object"&&a.anchor&&(zn(a.node)||Hs(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=r,l}}},sourceObjects:s}}function Kd(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let i=0,r=s.length;ida(s,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!QH(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=r=>{s.res=r,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class jA{constructor(t){Object.defineProperty(this,ha,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:i,reviver:r}={}){if(!Ug(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=da(this,"",a);if(typeof i=="function")for(const{count:c,res:u}of a.anchors.values())i(u,c);return typeof r=="function"?Kd(r,{"":l},"",l):l}}class RA extends jA{constructor(t){super(IA),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],xh(t,{Node:(r,a)=>{(yh(a)||QH(a))&&s.push(a)}}),n&&(n.aliasResolveCache=s));let i;for(const r of s){if(r===this)break;r.anchor===this.source&&(i=r)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:i,maxAliasCount:r}=n,a=this.resolve(i,n);if(!a){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=s.get(a);if(l||(da(a,null,n),l=s.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(r>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=fy(i,a,s)),l.count*l.aliasCount>r)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,s){const i=`*${this.source}`;if(t){if(ZH(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(t.implicitKey)return`${i} `}return i}}function fy(e,t,n){if(yh(t)){const s=t.resolve(e),i=n&&s&&n.get(s);return i?i.count*i.aliasCount:0}else if(Hs(t)){let s=0;for(const i of t.items){const r=fy(e,i,n);r>s&&(s=r)}return s}else if(Gs(t)){const s=fy(e,t.key,n),i=fy(e,t.value,n);return Math.max(s,i)}return 1}const tz=e=>!e||typeof e!="function"&&typeof e!="object";class Ct extends jA{constructor(t){super(po),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:da(this.value,t,n)}toString(){return String(this.value)}}Ct.BLOCK_FOLDED="BLOCK_FOLDED";Ct.BLOCK_LITERAL="BLOCK_LITERAL";Ct.PLAIN="PLAIN";Ct.QUOTE_DOUBLE="QUOTE_DOUBLE";Ct.QUOTE_SINGLE="QUOTE_SINGLE";const qke="tag:yaml.org,2002:";function Yke(e,t,n){if(t){const s=n.filter(r=>r.tag===t),i=s.find(r=>!r.format)??s[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(s=>{var i;return((i=s.identify)==null?void 0:i.call(s,e))&&!s.format})}function Jm(e,t,n){var f,h,p;if(Ug(e)&&(e=e.contents),Vs(e))return e;if(Gs(e)){const m=(h=(f=n.schema[sc]).createNode)==null?void 0:h.call(f,n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:i,onTagObj:r,schema:a,sourceObjects:l}=n;let c;if(s&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=i(e)),new RA(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=qke+t.slice(2));let u=Yke(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Ct(e);return c&&(c.node=m),m}u=e instanceof Map?a[sc]:Symbol.iterator in Object(e)?a[bh]:a[sc]}r&&(r(u),delete n.onTagObj);const d=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((p=u==null?void 0:u.nodeClass)==null?void 0:p.from)=="function"?u.nodeClass.from(n.schema,e,n):new Ct(e);return t?d.tag=t:u.default||(d.tag=u.tag),c&&(c.node=d),d}function L1(e,t,n){let s=n;for(let i=t.length-1;i>=0;--i){const r=t[i];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){const a=[];a[r]=s,s=a}else s=new Map([[r,s]])}return Jm(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Sp=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;let nz=class extends jA{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>Vs(s)||Gs(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Sp(t))this.add(n);else{const[s,...i]=t,r=this.get(s,!0);if(Hs(r))r.addIn(i,n);else if(r===void 0&&this.schema)this.set(s,L1(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const i=this.get(n,!0);if(Hs(i))return i.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...i]=t,r=this.get(s,!0);return i.length===0?!n&&zn(r)?r.value:r:Hs(r)?r.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Gs(n))return!1;const s=n.value;return s==null||t&&zn(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const i=this.get(n,!0);return Hs(i)?i.hasIn(s):!1}setIn(t,n){const[s,...i]=t;if(i.length===0)this.set(s,n);else{const r=this.get(s,!0);if(Hs(r))r.setIn(i,n);else if(r===void 0&&this.schema)this.set(s,L1(this.schema,i,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${i}`)}}};const Wke=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Yo(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const qc=(e,t,n)=>e.endsWith(` +`)?Yo(n,t):n.includes(` `)?` -`+Fo(n,t):(e.endsWith(" ")?"":" ")+n,nz="flow",BN="block",fy="quoted";function oE(e,t,n="flow",{indentAtStart:s,lineWidth:i=80,minContentWidth:r=20,onFold:a,onOverflow:l}={}){if(!i||i<0)return e;ii-Math.max(2,r)?u.push(0):f=i-s);let h,m,p=!1,b=-1,v=-1,y=-1;n===BN&&(b=q3(e,b,t.length),b!==-1&&(f=b+c));for(let E;E=e[b+=1];){if(n===fy&&E==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(E===` -`)n===BN&&(b=q3(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(E===" "&&m&&m!==" "&&m!==` -`&&m!==" "){const w=e[b+1];w&&w!==" "&&w!==` -`&&w!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===fy){for(;m===" "||m===" ";)m=E,E=e[b+=1],p=!0;const w=b>y+1?b-2:v-1;if(d[w])return e;u.push(w),d[w]=!0,f=w+c,h=void 0}else p=!0}m=E}if(p&&l&&l(),u.length===0)return e;a&&a();let x=e.slice(0,u[0]);for(let E=0;E({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),cE=e=>/^(%|---|\.\.\.)/m.test(e);function Xke(e,t,n){if(!t||t<0)return!1;const s=t-n,i=e.length;if(i<=s)return!1;for(let r=0,a=0;rs)return!0;if(a=r+1,i-a<=s)return!1}return!0}function up(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(cE(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.lengthi-Math.max(2,r)?u.push(0):f=i-s);let h,p,m=!1,b=-1,v=-1,y=-1;n===BN&&(b=Y3(e,b,t.length),b!==-1&&(f=b+c));for(let E;E=e[b+=1];){if(n===hy&&E==="\\"){switch(v=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}y=b}if(E===` +`)n===BN&&(b=Y3(e,b,t.length)),f=b+t.length+c,h=void 0;else{if(E===" "&&p&&p!==" "&&p!==` +`&&p!==" "){const w=e[b+1];w&&w!==" "&&w!==` +`&&w!==" "&&(h=b)}if(b>=f)if(h)u.push(h),f=h+c,h=void 0;else if(n===hy){for(;p===" "||p===" ";)p=E,E=e[b+=1],m=!0;const w=b>y+1?b-2:v-1;if(d[w])return e;u.push(w),d[w]=!0,f=w+c,h=void 0}else m=!0}p=E}if(m&&l&&l(),u.length===0)return e;a&&a();let x=e.slice(0,u[0]);for(let E=0;E({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),uE=e=>/^(%|---|\.\.\.)/m.test(e);function Xke(e,t,n){if(!t||t<0)return!1;const s=t-n,i=e.length;if(i<=s)return!1;for(let r=0,a=0;rs)return!0;if(a=r+1,i-a<=s)return!1}return!0}function om(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,i=t.options.doubleQuotedMinMultiLineLength,r=t.indent||(uE(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,c);const d=n.substr(c+2,4);switch(d){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:d.substr(0,2)==="00"?a+="\\x"+d.substr(2):a+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.length `;let f,h;for(h=n.length;h>0;--h){const S=n[h-1];if(S!==` -`&&S!==" "&&S!==" ")break}let m=n.substring(h);const p=m.indexOf(` -`);p===-1?f="-":n===m||p!==m.length-1?(f="+",r&&r()):f="",m&&(n=n.slice(0,-m.length),m[m.length-1]===` -`&&(m=m.slice(0,-1)),m=m.replace(FN,`$&${u}`));let b=!1,v,y=-1;for(v=0;v{_=!0});const T=oE(`${x}${S}${m}`,u,BN,k);if(!_)return`>${w} -${u}${T}`}return n=n.replace(/\n+/g,`$&${u}`),`|${w} -${u}${x}${n}${m}`}function Qke(e,t,n,s){const{type:i,value:r}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&r.includes(` -`)||d&&/[[\]{},]/.test(r))return Wd(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||d||!r.includes(` -`)?Wd(r,t):hy(e,t,n,s);if(!l&&!d&&i!==It.PLAIN&&r.includes(` -`))return hy(e,t,n,s);if(cE(r)){if(c==="")return t.forceBlockIndent=!0,hy(e,t,n,s);if(l&&c===u)return Wd(r,t)}const f=r.replace(/\n+/g,`$& -${c}`);if(a){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:m,tags:p}=t.doc.schema;if(p.some(h)||m!=null&&m.some(h))return Wd(r,t)}return l?f:oE(f,c,nz,lE(t,!1))}function OA(e,t,n,s){const{implicitKey:i,inFlow:r}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==It.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=It.QUOTE_DOUBLE);const c=d=>{switch(d){case It.BLOCK_FOLDED:case It.BLOCK_LITERAL:return i||r?Wd(a.value,t):hy(a,t,n,s);case It.QUOTE_DOUBLE:return up(a.value,t);case It.QUOTE_SINGLE:return UN(a.value,t);case It.PLAIN:return Qke(a,t,n,s);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=i&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function sz(e,t){const n=Object.assign({blockQuote:!0,commentString:Wke,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Zke(e,t){var i;if(t.tag){const r=e.filter(a=>a.tag===t.tag);if(r.length>0)return r.find(a=>a.format===t.format)??r[0]}let n,s;if(Kn(t)){s=t.value;let r=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,s)});if(r.length>1){const a=r.filter(l=>l.test);a.length>0&&(r=a)}n=r.find(a=>a.format===t.format)??r.find(a=>!a.format)}else s=t,n=e.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){const r=((i=s==null?void 0:s.constructor)==null?void 0:i.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function Jke(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(Kn(e)||Vs(e))&&e.anchor;r&&QH(r)&&(n.add(r),i.push(`&${r}`));const a=e.tag??(t.default?null:t.tag);return a&&i.push(s.directives.tagString(a)),i.join(" ")}function Vf(e,t,n,s){var c;if(qs(e))return e.toString(t,n,s);if(Eh(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const r=Ks(e)?e:t.doc.createNode(e,{onTagObj:u=>i=u});i??(i=Zke(t.doc.schema.tags,r));const a=Jke(r,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof i.stringify=="function"?i.stringify(r,t,n,s):Kn(r)?OA(r,t,n,s):r.toString(t,n,s);return a?Kn(r)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} -${t.indent}${l}`:l}function e2e({key:e,value:t},n,s,i){const{allNullValues:r,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Ks(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Vs(e)||!Ks(e)&&typeof e=="object"){const k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let m=!f&&(!e||h&&t==null&&!n.inFlow||Vs(e)||(Kn(e)?e.type===It.BLOCK_FOLDED||e.type===It.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(f||!r),indent:l+c});let p=!1,b=!1,v=Vf(e,n,()=>p=!0,()=>b=!0);if(!m&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(r||t==null)return p&&s&&s(),v===""?"?":m?`? ${v}`:v}else if(r&&!f||t==null&&m)return v=`? ${v}`,h&&!p?v+=Gc(v,n.indent,u(h)):b&&i&&i(),v;p&&(h=null),m?(h&&(v+=Gc(v,n.indent,u(h))),v=`? ${v} -${l}:`):(v=`${v}:`,h&&(v+=Gc(v,n.indent,u(h))));let y,x,E;Ks(t)?(y=!!t.spaceBefore,x=t.commentBefore,E=t.comment):(y=!1,x=null,E=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!m&&!h&&Kn(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!m&&Vg(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const S=Vf(t,n,()=>w=!0,()=>b=!0);let _=" ";if(h||y||x){if(_=y?` -`:"",x){const k=u(x);_+=` -${Fo(k,n.indent)}`}S===""&&!n.inFlow?_===` +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let _=!1;const T=cE(s,!0);a!=="folded"&&t!==Ct.BLOCK_FOLDED&&(T.onOverflow=()=>{_=!0});const k=lE(`${x}${S}${p}`,u,BN,T);if(!_)return`>${w} +${u}${k}`}return n=n.replace(/\n+/g,`$&${u}`),`|${w} +${u}${x}${n}${p}`}function Qke(e,t,n,s){const{type:i,value:r}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:d}=t;if(l&&r.includes(` +`)||d&&/[[\]{},]/.test(r))return qd(r,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(r))return l||d||!r.includes(` +`)?qd(r,t):py(e,t,n,s);if(!l&&!d&&i!==Ct.PLAIN&&r.includes(` +`))return py(e,t,n,s);if(uE(r)){if(c==="")return t.forceBlockIndent=!0,py(e,t,n,s);if(l&&c===u)return qd(r,t)}const f=r.replace(/\n+/g,`$& +${c}`);if(a){const h=b=>{var v;return b.default&&b.tag!=="tag:yaml.org,2002:str"&&((v=b.test)==null?void 0:v.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return qd(r,t)}return l?f:lE(f,c,sz,cE(t,!1))}function OA(e,t,n,s){const{implicitKey:i,inFlow:r}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==Ct.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=Ct.QUOTE_DOUBLE);const c=d=>{switch(d){case Ct.BLOCK_FOLDED:case Ct.BLOCK_LITERAL:return i||r?qd(a.value,t):py(a,t,n,s);case Ct.QUOTE_DOUBLE:return om(a.value,t);case Ct.QUOTE_SINGLE:return UN(a.value,t);case Ct.PLAIN:return Qke(a,t,n,s);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=i&&d||f;if(u=c(h),u===null)throw new Error(`Unsupported default string type ${h}`)}return u}function iz(e,t){const n=Object.assign({blockQuote:!0,commentString:Wke,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Zke(e,t){var i;if(t.tag){const r=e.filter(a=>a.tag===t.tag);if(r.length>0)return r.find(a=>a.format===t.format)??r[0]}let n,s;if(zn(t)){s=t.value;let r=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,s)});if(r.length>1){const a=r.filter(l=>l.test);a.length>0&&(r=a)}n=r.find(a=>a.format===t.format)??r.find(a=>!a.format)}else s=t,n=e.find(r=>r.nodeClass&&s instanceof r.nodeClass);if(!n){const r=((i=s==null?void 0:s.constructor)==null?void 0:i.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${r} value`)}return n}function Jke(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const i=[],r=(zn(e)||Hs(e))&&e.anchor;r&&ZH(r)&&(n.add(r),i.push(`&${r}`));const a=e.tag??(t.default?null:t.tag);return a&&i.push(s.directives.tagString(a)),i.join(" ")}function Hf(e,t,n,s){var c;if(Gs(e))return e.toString(t,n,s);if(yh(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i;const r=Vs(e)?e:t.doc.createNode(e,{onTagObj:u=>i=u});i??(i=Zke(t.doc.schema.tags,r));const a=Jke(r,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof i.stringify=="function"?i.stringify(r,t,n,s):zn(r)?OA(r,t,n,s):r.toString(t,n,s);return a?zn(r)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a} +${t.indent}${l}`:l}function e2e({key:e,value:t},n,s,i){const{allNullValues:r,doc:a,indent:l,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=n;let h=Vs(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(Hs(e)||!Vs(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||Hs(e)||(zn(e)?e.type===Ct.BLOCK_FOLDED||e.type===Ct.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!r),indent:l+c});let m=!1,b=!1,v=Hf(e,n,()=>m=!0,()=>b=!0);if(!p&&!n.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(r||t==null)return m&&s&&s(),v===""?"?":p?`? ${v}`:v}else if(r&&!f||t==null&&p)return v=`? ${v}`,h&&!m?v+=qc(v,n.indent,u(h)):b&&i&&i(),v;m&&(h=null),p?(h&&(v+=qc(v,n.indent,u(h))),v=`? ${v} +${l}:`):(v=`${v}:`,h&&(v+=qc(v,n.indent,u(h))));let y,x,E;Vs(t)?(y=!!t.spaceBefore,x=t.commentBefore,E=t.comment):(y=!1,x=null,E=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&zn(t)&&(n.indentAtStart=v.length+1),b=!1,!d&&c.length>=2&&!n.inFlow&&!p&&$g(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const S=Hf(t,n,()=>w=!0,()=>b=!0);let _=" ";if(h||y||x){if(_=y?` +`:"",x){const T=u(x);_+=` +${Yo(T,n.indent)}`}S===""&&!n.inFlow?_===` `&&E&&(_=` `):_+=` -${n.indent}`}else if(!m&&Vs(t)){const k=S[0],T=S.indexOf(` -`),A=T!==-1,j=n.inFlow??t.flow??t.items.length===0;if(A||!j){let R=!1;if(A&&(k==="&"||k==="!")){let B=S.indexOf(" ");k==="&"&&B!==-1&&Be===pb||typeof e=="symbol"&&e.description===pb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new It(Symbol(pb)),{addToJSMap:rz}),stringify:()=>pb},t2e=(e,t)=>(Ko.identify(t)||Kn(t)&&(!t.type||t.type===It.PLAIN)&&Ko.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Ko.tag&&n.default));function rz(e,t,n){const s=az(e,n);if(Vg(s))for(const i of s.items)Kw(e,t,i);else if(Array.isArray(s))for(const i of s)Kw(e,t,i);else Kw(e,t,s)}function Kw(e,t,n){const s=az(e,n);if(!zg(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,e,Map);for(const[r,a]of i)t instanceof Map?t.has(r)||t.set(r,a):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function az(e,t){return e&&Eh(t)?t.resolve(e.doc,e):t}function oz(e,t,{key:n,value:s}){if(Ks(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(t2e(e,n))rz(e,t,s);else{const i=aa(n,"",e);if(t instanceof Map)t.set(i,aa(s,i,e));else if(t instanceof Set)t.add(i);else{const r=n2e(n,i,e),a=aa(s,r,e);r in t?Object.defineProperty(t,r,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[r]=a}}return t}function n2e(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Ks(e)&&(n!=null&&n.doc)){const s=sz(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=e.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),iz(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function MA(e,t,n){const s=ng(e,void 0,n),i=ng(t,void 0,n);return new Ji(s,i)}class Ji{constructor(t,n=null){Object.defineProperty(this,la,{value:WH}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return Ks(n)&&(n=n.clone(t)),Ks(s)&&(s=s.clone(t)),new Ji(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return oz(n,s,this)}toString(t,n,s){return t!=null&&t.doc?e2e(this,t,n,s):JSON.stringify(this)}}function lz(e,t,n){return(t.inFlow??e.flow?i2e:s2e)(e,t,n)}function s2e({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:r,type:null});let f=!1;const h=[];for(let p=0;pv=null,()=>f=!0);v&&(y+=Gc(y,r,u(v))),f&&v&&(f=!1),h.push(s+y)}let m;if(h.length===0)m=i.start+i.end;else{m=h[0];for(let p=1;pe===gb||typeof e=="symbol"&&e.description===gb,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ct(Symbol(gb)),{addToJSMap:az}),stringify:()=>gb},t2e=(e,t)=>(el.identify(t)||zn(t)&&(!t.type||t.type===Ct.PLAIN)&&el.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===el.tag&&n.default));function az(e,t,n){const s=oz(e,n);if($g(s))for(const i of s.items)Kw(e,t,i);else if(Array.isArray(s))for(const i of s)Kw(e,t,i);else Kw(e,t,s)}function Kw(e,t,n){const s=oz(e,n);if(!Fg(s))throw new Error("Merge sources must be maps or map aliases");const i=s.toJSON(null,e,Map);for(const[r,a]of i)t instanceof Map?t.has(r)||t.set(r,a):t instanceof Set?t.add(r):Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function oz(e,t){return e&&yh(t)?t.resolve(e.doc,e):t}function lz(e,t,{key:n,value:s}){if(Vs(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(t2e(e,n))az(e,t,s);else{const i=da(n,"",e);if(t instanceof Map)t.set(i,da(s,i,e));else if(t instanceof Set)t.add(i);else{const r=n2e(n,i,e),a=da(s,r,e);r in t?Object.defineProperty(t,r,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[r]=a}}return t}function n2e(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Vs(e)&&(n!=null&&n.doc)){const s=iz(n.doc,{});s.anchors=new Set;for(const r of n.anchors.keys())s.anchors.add(r.anchor);s.inFlow=!0,s.inStringifyKey=!0;const i=e.toString(s);if(!n.mapKeyWarned){let r=JSON.stringify(i);r.length>40&&(r=r.substring(0,36)+'..."'),rz(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${r}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function MA(e,t,n){const s=Jm(e,void 0,n),i=Jm(t,void 0,n);return new Ji(s,i)}class Ji{constructor(t,n=null){Object.defineProperty(this,ha,{value:XH}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return Vs(n)&&(n=n.clone(t)),Vs(s)&&(s=s.clone(t)),new Ji(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return lz(n,s,this)}toString(t,n,s){return t!=null&&t.doc?e2e(this,t,n,s):JSON.stringify(this)}}function cz(e,t,n){return(t.inFlow??e.flow?i2e:s2e)(e,t,n)}function s2e({comment:e,items:t},n,{blockItemPrefix:s,flowChars:i,itemIndent:r,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,d=Object.assign({},n,{indent:r,type:null});let f=!1;const h=[];for(let m=0;mv=null,()=>f=!0);v&&(y+=qc(y,r,u(v))),f&&v&&(f=!1),h.push(s+y)}let p;if(h.length===0)p=i.start+i.end;else{p=h[0];for(let m=1;mv=null);u||(u=f.length>d||y.includes(` -`)),p0&&(u||(u=f.reduce((x,E)=>x+E.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=Gc(y,s,l(v))),f.push(y),d=f.length}const{start:h,end:m}=n;if(f.length===0)return h+m;if(!u){const p=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&p>t.options.lineWidth}if(u){let p=h;for(const b of f)p+=b?` +`}}return e?(p+=` +`+Yo(u(e),c),l&&l()):f&&a&&a(),p}function i2e({items:e},t,{flowChars:n,itemIndent:s}){const{indent:i,indentStep:r,flowCollectionPadding:a,options:{commentString:l}}=t;s+=r;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,d=0;const f=[];for(let m=0;mv=null);u||(u=f.length>d||y.includes(` +`)),m0&&(u||(u=f.reduce((x,E)=>x+E.length+2,2)+(y.length+2)>t.options.lineWidth)),u&&(y+=",")),v&&(y+=qc(y,s,l(v))),f.push(y),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!u){const m=f.reduce((b,v)=>b+v.length+2,2);u=t.options.lineWidth>0&&m>t.options.lineWidth}if(u){let m=h;for(const b of f)m+=b?` ${r}${i}${b}`:` -`;return`${p} -${i}${m}`}else return`${h}${a}${f.join(" ")}${a}${m}`}function L1({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=Fo(t(s),e);n.push(r.trimStart())}}function Kc(e,t){const n=Kn(t)?t.value:t;for(const s of e)if(qs(s)&&(s.key===t||s.key===n||Kn(s.key)&&s.key.value===n))return s}class na extends tz{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(ec,t),this.items=[]}static from(t,n,s){const{keepUndefined:i,replacer:r}=s,a=new this(t),l=(c,u)=>{if(typeof r=="function")u=r.call(n,c,u);else if(Array.isArray(r)&&!r.includes(c))return;(u!==void 0||i)&&a.items.push(MA(c,u,s))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let s;qs(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Ji(t,t==null?void 0:t.value):s=new Ji(t.key,t.value);const i=Kc(this.items,s.key),r=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);Kn(i.value)&&ez(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const l=this.items.findIndex(c=>r(s,c)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=Kc(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=Kc(this.items,t),i=s==null?void 0:s.value;return(!n&&Kn(i)?i.value:i)??void 0}has(t){return!!Kc(this.items,t)}set(t,n){this.add(new Ji(t,n),!0)}toJSON(t,n,s){const i=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items)oz(n,i,r);return i}toString(t,n,s){if(!t)return JSON.stringify(this);for(const i of this.items)if(!qs(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),lz(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const wh={collection:"map",default:!0,nodeClass:na,tag:"tag:yaml.org,2002:map",resolve(e,t){return zg(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>na.from(e,t,n)};class vu extends tz{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(xh,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=gb(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=gb(t);if(typeof s!="number")return;const i=this.items[s];return!n&&Kn(i)?i.value:i}has(t){const n=gb(t);return typeof n=="number"&&n=0?t:null}const _h={collection:"seq",default:!0,nodeClass:vu,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Vg(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>vu.from(e,t,n)},uE={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),OA(e,t,n,s)}},dE={identify:e=>e==null,createNode:()=>new It(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new It(null),stringify:({source:e},t)=>typeof e=="string"&&dE.test.test(e)?e:t.options.nullStr},LA={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new It(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&LA.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function Fa({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let a=r.indexOf(".");a<0&&(a=r.length,r+=".");let l=t-(r.length-a-1);for(;l-- >0;)r+="0"}return r}const cz={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Fa},uz={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Fa(e)}},dz={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new It(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Fa},fE=e=>typeof e=="bigint"||Number.isInteger(e),DA=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function fz(e,t,n){const{value:s}=e;return fE(s)&&s>=0?n+s.toString(t):Fa(e)}const hz={identify:e=>fE(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>DA(e,2,8,n),stringify:e=>fz(e,8,"0o")},mz={identify:fE,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>DA(e,0,10,n),stringify:Fa},pz={identify:e=>fE(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>DA(e,2,16,n),stringify:e=>fz(e,16,"0x")},r2e=[wh,_h,uE,dE,LA,hz,mz,pz,cz,uz,dz];function Y3(e){return typeof e=="bigint"||Number.isInteger(e)}const bb=({value:e})=>JSON.stringify(e),a2e=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:bb},{identify:e=>e==null,createNode:()=>new It(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:bb},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:bb},{identify:Y3,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Y3(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:bb}],o2e={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},l2e=[wh,_h].concat(a2e,o2e),PA={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i1&&t("Each pair must have its own sequence indicator");const i=s.items[0]||new Ji(new It(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore} +`;return`${m} +${i}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function D1({indent:e,options:{commentString:t}},n,s,i){if(s&&i&&(s=s.replace(/^\n+/,"")),s){const r=Yo(t(s),e);n.push(r.trimStart())}}function Yc(e,t){const n=zn(t)?t.value:t;for(const s of e)if(Gs(s)&&(s.key===t||s.key===n||zn(s.key)&&s.key.value===n))return s}class oa extends nz{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(sc,t),this.items=[]}static from(t,n,s){const{keepUndefined:i,replacer:r}=s,a=new this(t),l=(c,u)=>{if(typeof r=="function")u=r.call(n,c,u);else if(Array.isArray(r)&&!r.includes(c))return;(u!==void 0||i)&&a.items.push(MA(c,u,s))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let s;Gs(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Ji(t,t==null?void 0:t.value):s=new Ji(t.key,t.value);const i=Yc(this.items,s.key),r=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!n)throw new Error(`Key ${s.key} already set`);zn(i.value)&&tz(s.value)?i.value.value=s.value:i.value=s.value}else if(r){const l=this.items.findIndex(c=>r(s,c)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=Yc(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=Yc(this.items,t),i=s==null?void 0:s.value;return(!n&&zn(i)?i.value:i)??void 0}has(t){return!!Yc(this.items,t)}set(t,n){this.add(new Ji(t,n),!0)}toJSON(t,n,s){const i=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const r of this.items)lz(n,i,r);return i}toString(t,n,s){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Gs(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),cz(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const Eh={collection:"map",default:!0,nodeClass:oa,tag:"tag:yaml.org,2002:map",resolve(e,t){return Fg(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>oa.from(e,t,n)};class _u extends nz{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(bh,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=bb(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=bb(t);if(typeof s!="number")return;const i=this.items[s];return!n&&zn(i)?i.value:i}has(t){const n=bb(t);return typeof n=="number"&&n=0?t:null}const vh={collection:"seq",default:!0,nodeClass:_u,tag:"tag:yaml.org,2002:seq",resolve(e,t){return $g(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>_u.from(e,t,n)},dE={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),OA(e,t,n,s)}},fE={identify:e=>e==null,createNode:()=>new Ct(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ct(null),stringify:({source:e},t)=>typeof e=="string"&&fE.test.test(e)?e:t.options.nullStr},LA={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ct(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&LA.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function Ga({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const i=typeof s=="number"?s:Number(s);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let r=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(r)&&!r.includes("e")){let a=r.indexOf(".");a<0&&(a=r.length,r+=".");let l=t-(r.length-a-1);for(;l-- >0;)r+="0"}return r}const uz={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ga},dz={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Ga(e)}},fz={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Ct(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Ga},hE=e=>typeof e=="bigint"||Number.isInteger(e),DA=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function hz(e,t,n){const{value:s}=e;return hE(s)&&s>=0?n+s.toString(t):Ga(e)}const pz={identify:e=>hE(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>DA(e,2,8,n),stringify:e=>hz(e,8,"0o")},mz={identify:hE,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>DA(e,0,10,n),stringify:Ga},gz={identify:e=>hE(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>DA(e,2,16,n),stringify:e=>hz(e,16,"0x")},r2e=[Eh,vh,dE,fE,LA,pz,mz,gz,uz,dz,fz];function W3(e){return typeof e=="bigint"||Number.isInteger(e)}const yb=({value:e})=>JSON.stringify(e),a2e=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:yb},{identify:e=>e==null,createNode:()=>new Ct(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:yb},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:yb},{identify:W3,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>W3(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:yb}],o2e={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},l2e=[Eh,vh].concat(a2e,o2e),PA={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let i=0;i1&&t("Each pair must have its own sequence indicator");const i=s.items[0]||new Ji(new Ct(null));if(s.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${s.commentBefore} ${i.key.commentBefore}`:s.commentBefore),s.comment){const r=i.value??i.key;r.comment=r.comment?`${s.comment} -${r.comment}`:s.comment}s=i}e.items[n]=qs(s)?s:new Ji(s)}}else t("Expected a sequence for this tag");return e}function bz(e,t,n){const{replacer:s}=n,i=new vu(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof s=="function"&&(a=s.call(t,String(r++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;i.items.push(MA(l,c,n))}return i}const BA={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:gz,createNode:bz};class uf extends vu{constructor(){super(),this.add=na.prototype.add.bind(this),this.delete=na.prototype.delete.bind(this),this.get=na.prototype.get.bind(this),this.has=na.prototype.has.bind(this),this.set=na.prototype.set.bind(this),this.tag=uf.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items){let r,a;if(qs(i)?(r=aa(i.key,"",n),a=aa(i.value,r,n)):r=aa(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,a)}return s}static from(t,n,s){const i=bz(t,n,s),r=new this;return r.items=i.items,r}}uf.tag="tag:yaml.org,2002:omap";const UA={collection:"seq",identify:e=>e instanceof Map,nodeClass:uf,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=gz(e,t),s=[];for(const{key:i}of n.items)Kn(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new uf,n)},createNode:(e,t,n)=>uf.from(e,t,n)};function yz({value:e,source:t},n){return t&&(e?xz:Ez).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const xz={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new It(!0),stringify:yz},Ez={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new It(!1),stringify:yz},c2e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Fa},u2e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Fa(e)}},d2e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new It(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:Fa},Gg=e=>typeof e=="bigint"||Number.isInteger(e);function hE(e,t,n,{intAsBigInt:s}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return i==="-"?BigInt(-1)*a:a}const r=parseInt(e,n);return i==="-"?-1*r:r}function FA(e,t,n){const{value:s}=e;if(Gg(s)){const i=s.toString(t);return s<0?"-"+n+i.substr(1):n+i}return Fa(e)}const f2e={identify:Gg,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>hE(e,2,2,n),stringify:e=>FA(e,2,"0b")},h2e={identify:Gg,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>hE(e,1,8,n),stringify:e=>FA(e,8,"0")},m2e={identify:Gg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>hE(e,0,10,n),stringify:Fa},p2e={identify:Gg,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>hE(e,2,16,n),stringify:e=>FA(e,16,"0x")};class df extends na{constructor(t){super(t),this.tag=df.tag}add(t){let n;qs(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ji(t.key,null):n=new Ji(t,null),Kc(this.items,n.key)||this.items.push(n)}get(t,n){const s=Kc(this.items,t);return!n&&qs(s)?Kn(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=Kc(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Ji(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),r.items.push(MA(a,null,s));return r}}df.tag="tag:yaml.org,2002:set";const $A={collection:"map",identify:e=>e instanceof Set,nodeClass:df,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>df.from(e,t,n),resolve(e,t){if(zg(e)){if(e.hasAllNullValues(!0))return Object.assign(new df,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function HA(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),r=s.replace(/_/g,"").split(":").reduce((a,l)=>a*i(60)+i(l),i(0));return n==="-"?i(-1)*r:r}function vz(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Fa(e);let s="";t<0&&(s="-",t*=n(-1));const i=n(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),s+r.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const wz={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>HA(e,n),stringify:vz},_z={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>HA(e,!1),stringify:vz},mE={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(mE.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,a,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,i,r||0,a||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=HA(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},W3=[wh,_h,uE,dE,xz,Ez,f2e,h2e,m2e,p2e,c2e,u2e,d2e,PA,Ko,UA,BA,$A,wz,_z,mE],X3=new Map([["core",r2e],["failsafe",[wh,_h,uE]],["json",l2e],["yaml11",W3],["yaml-1.1",W3]]),Q3={binary:PA,bool:LA,float:dz,floatExp:uz,floatNaN:cz,floatTime:_z,int:mz,intHex:pz,intOct:hz,intTime:wz,map:wh,merge:Ko,null:dE,omap:UA,pairs:BA,seq:_h,set:$A,timestamp:mE},g2e={"tag:yaml.org,2002:binary":PA,"tag:yaml.org,2002:merge":Ko,"tag:yaml.org,2002:omap":UA,"tag:yaml.org,2002:pairs":BA,"tag:yaml.org,2002:set":$A,"tag:yaml.org,2002:timestamp":mE};function qw(e,t,n){const s=X3.get(t);if(s&&!e)return n&&!s.includes(Ko)?s.concat(Ko):s.slice();let i=s;if(!i)if(Array.isArray(e))i=[];else{const r=Array.from(X3.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)i=i.concat(r);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Ko)),i.reduce((r,a)=>{const l=typeof a=="string"?Q3[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(Q3).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return r.includes(l)||r.push(l),r},[])}const b2e=(e,t)=>e.keyt.key?1:0;class zA{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?qw(t,"compat"):t?qw(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?g2e:{},this.tags=qw(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,ec,{value:wh}),Object.defineProperty(this,oo,{value:uE}),Object.defineProperty(this,xh,{value:_h}),this.sortMapEntries=typeof a=="function"?a:a===!0?b2e:null}clone(){const t=Object.create(zA.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function y2e(e,t){var c;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const i=sz(e,t),{commentString:r}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=r(e.commentBefore);n.unshift(Fo(u,""))}let a=!1,l=null;if(e.contents){if(Ks(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const f=r(e.contents.commentBefore);n.push(Fo(f,""))}i.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=Vf(e.contents,i,()=>l=null,u);l&&(d+=Gc(d,"",r(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(Vf(e.contents,i));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=r(e.comment);u.includes(` -`)?(n.push("..."),n.push(Fo(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(Fo(r(u),"")))}return n.join(` +${r.comment}`:s.comment}s=i}e.items[n]=Gs(s)?s:new Ji(s)}}else t("Expected a sequence for this tag");return e}function yz(e,t,n){const{replacer:s}=n,i=new _u(e);i.tag="tag:yaml.org,2002:pairs";let r=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof s=="function"&&(a=s.call(t,String(r++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;i.items.push(MA(l,c,n))}return i}const BA={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:bz,createNode:yz};class lf extends _u{constructor(){super(),this.add=oa.prototype.add.bind(this),this.delete=oa.prototype.delete.bind(this),this.get=oa.prototype.get.bind(this),this.has=oa.prototype.has.bind(this),this.set=oa.prototype.set.bind(this),this.tag=lf.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const i of this.items){let r,a;if(Gs(i)?(r=da(i.key,"",n),a=da(i.value,r,n)):r=da(i,"",n),s.has(r))throw new Error("Ordered maps must not include duplicate keys");s.set(r,a)}return s}static from(t,n,s){const i=yz(t,n,s),r=new this;return r.items=i.items,r}}lf.tag="tag:yaml.org,2002:omap";const UA={collection:"seq",identify:e=>e instanceof Map,nodeClass:lf,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=bz(e,t),s=[];for(const{key:i}of n.items)zn(i)&&(s.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):s.push(i.value));return Object.assign(new lf,n)},createNode:(e,t,n)=>lf.from(e,t,n)};function xz({value:e,source:t},n){return t&&(e?Ez:vz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Ez={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ct(!0),stringify:xz},vz={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ct(!1),stringify:xz},c2e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Ga},u2e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Ga(e)}},d2e={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Ct(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:Ga},Hg=e=>typeof e=="bigint"||Number.isInteger(e);function pE(e,t,n,{intAsBigInt:s}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const a=BigInt(e);return i==="-"?BigInt(-1)*a:a}const r=parseInt(e,n);return i==="-"?-1*r:r}function FA(e,t,n){const{value:s}=e;if(Hg(s)){const i=s.toString(t);return s<0?"-"+n+i.substr(1):n+i}return Ga(e)}const f2e={identify:Hg,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>pE(e,2,2,n),stringify:e=>FA(e,2,"0b")},h2e={identify:Hg,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>pE(e,1,8,n),stringify:e=>FA(e,8,"0")},p2e={identify:Hg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>pE(e,0,10,n),stringify:Ga},m2e={identify:Hg,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>pE(e,2,16,n),stringify:e=>FA(e,16,"0x")};class cf extends oa{constructor(t){super(t),this.tag=cf.tag}add(t){let n;Gs(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ji(t.key,null):n=new Ji(t,null),Yc(this.items,n.key)||this.items.push(n)}get(t,n){const s=Yc(this.items,t);return!n&&Gs(s)?zn(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=Yc(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Ji(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:i}=s,r=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),r.items.push(MA(a,null,s));return r}}cf.tag="tag:yaml.org,2002:set";const $A={collection:"map",identify:e=>e instanceof Set,nodeClass:cf,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>cf.from(e,t,n),resolve(e,t){if(Fg(e)){if(e.hasAllNullValues(!0))return Object.assign(new cf,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function HA(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),r=s.replace(/_/g,"").split(":").reduce((a,l)=>a*i(60)+i(l),i(0));return n==="-"?i(-1)*r:r}function wz(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return Ga(e);let s="";t<0&&(s="-",t*=n(-1));const i=n(60),r=[t%i];return t<60?r.unshift(0):(t=(t-r[0])/i,r.unshift(t%i),t>=60&&(t=(t-r[0])/i,r.unshift(t))),s+r.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const _z={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>HA(e,n),stringify:wz},Sz={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>HA(e,!1),stringify:wz},mE={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(mE.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,i,r,a,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,i,r||0,a||0,l||0,c);const d=t[8];if(d&&d!=="Z"){let f=HA(d,!1);Math.abs(f)<30&&(f*=60),u-=6e4*f}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},X3=[Eh,vh,dE,fE,Ez,vz,f2e,h2e,p2e,m2e,c2e,u2e,d2e,PA,el,UA,BA,$A,_z,Sz,mE],Q3=new Map([["core",r2e],["failsafe",[Eh,vh,dE]],["json",l2e],["yaml11",X3],["yaml-1.1",X3]]),Z3={binary:PA,bool:LA,float:fz,floatExp:dz,floatNaN:uz,floatTime:Sz,int:mz,intHex:gz,intOct:pz,intTime:_z,map:Eh,merge:el,null:fE,omap:UA,pairs:BA,seq:vh,set:$A,timestamp:mE},g2e={"tag:yaml.org,2002:binary":PA,"tag:yaml.org,2002:merge":el,"tag:yaml.org,2002:omap":UA,"tag:yaml.org,2002:pairs":BA,"tag:yaml.org,2002:set":$A,"tag:yaml.org,2002:timestamp":mE};function qw(e,t,n){const s=Q3.get(t);if(s&&!e)return n&&!s.includes(el)?s.concat(el):s.slice();let i=s;if(!i)if(Array.isArray(e))i=[];else{const r=Array.from(Q3.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${r} or define customTags array`)}if(Array.isArray(e))for(const r of e)i=i.concat(r);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(el)),i.reduce((r,a)=>{const l=typeof a=="string"?Z3[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(Z3).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return r.includes(l)||r.push(l),r},[])}const b2e=(e,t)=>e.keyt.key?1:0;class zA{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:i,schema:r,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?qw(t,"compat"):t?qw(null,t):null,this.name=typeof r=="string"&&r||"core",this.knownTags=i?g2e:{},this.tags=qw(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,sc,{value:Eh}),Object.defineProperty(this,po,{value:dE}),Object.defineProperty(this,bh,{value:vh}),this.sortMapEntries=typeof a=="function"?a:a===!0?b2e:null}clone(){const t=Object.create(zA.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function y2e(e,t){var c;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const i=iz(e,t),{commentString:r}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=r(e.commentBefore);n.unshift(Yo(u,""))}let a=!1,l=null;if(e.contents){if(Vs(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const f=r(e.contents.commentBefore);n.push(Yo(f,""))}i.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let d=Hf(e.contents,i,()=>l=null,u);l&&(d+=qc(d,"",r(l))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(Hf(e.contents,i));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=r(e.comment);u.includes(` +`)?(n.push("..."),n.push(Yo(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(Yo(r(u),"")))}return n.join(` `)+` -`}class Kg{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,la,{value:PN});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:a}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Xi({version:a}),this.setSchema(a,s),this.contents=t===void 0?null:this.createNode(t,i,s)}clone(){const t=Object.create(Kg.prototype,{[la]:{value:PN}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ks(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ud(this.contents)&&this.contents.add(t)}addIn(t,n){ud(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=ZH(this);t.anchor=!n||s.has(n)?JH(n||"a",s):n}return new RA(t.anchor)}createNode(t,n,s){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const v=x=>typeof x=="number"||x instanceof String||x instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=s??{},{onAnchor:f,setAnchors:h,sourceObjects:m}=Kke(this,a||"a"),p={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:m},b=ng(t,d,p);return l&&Vs(b)&&(b.flow=!0),h(),b}createPair(t,n,s={}){const i=this.createNode(t,null,s),r=this.createNode(n,null,s);return new Ji(i,r)}delete(t){return ud(this.contents)?this.contents.delete(t):!1}deleteIn(t){return km(t)?this.contents==null?!1:(this.contents=null,!0):ud(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Vs(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return km(t)?!n&&Kn(this.contents)?this.contents.value:this.contents:Vs(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Vs(this.contents)?this.contents.has(t):!1}hasIn(t){return km(t)?this.contents!==void 0:Vs(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=M1(this.schema,[t],n):ud(this.contents)&&this.contents.set(t,n)}setIn(t,n){km(t)?this.contents=n:this.contents==null?this.contents=M1(this.schema,Array.from(t),n):ud(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Xi({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Xi({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new zA(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=aa(this.contents,n??"",l);if(typeof r=="function")for(const{count:u,res:d}of l.anchors.values())r(d,u);return typeof a=="function"?Yd(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return y2e(this,t)}}function ud(e){if(Vs(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Sz extends Error{constructor(t,n,s,i){super(),this.name=t,this.code=s,this.message=i,this.pos=n}}class Am extends Sz{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class x2e extends Sz{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const Z3=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,a=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&a.length>80){const l=Math.min(r-39,a.length-79);a="…"+a.substring(l),r-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),s>1&&/^ *$/.test(a.substring(0,r))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`… +`}class zg{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ha,{value:PN});let i=null;typeof n=="function"||Array.isArray(n)?i=n:s===void 0&&n&&(s=n,n=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=r;let{version:a}=r;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Xi({version:a}),this.setSchema(a,s),this.contents=t===void 0?null:this.createNode(t,i,s)}clone(){const t=Object.create(zg.prototype,{[ha]:{value:PN}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Vs(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ld(this.contents)&&this.contents.add(t)}addIn(t,n){ld(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=JH(this);t.anchor=!n||s.has(n)?ez(n||"a",s):n}return new RA(t.anchor)}createNode(t,n,s){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const v=x=>typeof x=="number"||x instanceof String||x instanceof Number,y=n.filter(v).map(String);y.length>0&&(n=n.concat(y)),i=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:r,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:d}=s??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=Kke(this,a||"a"),m={aliasDuplicateObjects:r??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:u,replacer:i,schema:this.schema,sourceObjects:p},b=Jm(t,d,m);return l&&Hs(b)&&(b.flow=!0),h(),b}createPair(t,n,s={}){const i=this.createNode(t,null,s),r=this.createNode(n,null,s);return new Ji(i,r)}delete(t){return ld(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Sp(t)?this.contents==null?!1:(this.contents=null,!0):ld(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Hs(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Sp(t)?!n&&zn(this.contents)?this.contents.value:this.contents:Hs(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Hs(this.contents)?this.contents.has(t):!1}hasIn(t){return Sp(t)?this.contents!==void 0:Hs(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=L1(this.schema,[t],n):ld(this.contents)&&this.contents.set(t,n)}setIn(t,n){Sp(t)?this.contents=n:this.contents==null?this.contents=L1(this.schema,Array.from(t),n):ld(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Xi({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Xi({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new zA(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:i,onAnchor:r,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=da(this.contents,n??"",l);if(typeof r=="function")for(const{count:u,res:d}of l.anchors.values())r(d,u);return typeof a=="function"?Kd(a,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return y2e(this,t)}}function ld(e){if(Hs(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Nz extends Error{constructor(t,n,s,i){super(),this.name=t,this.code=s,this.message=i,this.pos=n}}class Np extends Nz{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class x2e extends Nz{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const J3=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:s,col:i}=n.linePos[0];n.message+=` at line ${s}, column ${i}`;let r=i-1,a=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(r>=60&&a.length>80){const l=Math.min(r-39,a.length-79);a="…"+a.substring(l),r-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),s>1&&/^ *$/.test(a.substring(0,r))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`… `),a=l+a}if(/[^ ]/.test(a)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===s&&c.col>i&&(l=Math.max(1,Math.min(c.col-i,80-r)));const u=" ".repeat(r)+"^".repeat(l);n.message+=`: ${a} ${u} -`}};function Gf(e,{flow:t,indicator:n,next:s,offset:i,onError:r,parentIndent:a,startOnNewline:l}){let c=!1,u=l,d=l,f="",h="",m=!1,p=!1,b=null,v=null,y=null,x=null,E=null,w=null,S=null;for(const T of e)switch(p&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&r(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p=!1),b&&(u&&T.type!=="comment"&&T.type!=="newline"&&r(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),T.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&T.source.includes(" ")&&(b=T),d=!0;break;case"comment":{d||r(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const A=T.source.substring(1)||" ";f?f+=h+A:f=A,h="",u=!1;break}case"newline":u?f?f+=T.source:(!w||n!=="seq-item-ind")&&(c=!0):h+=T.source,u=!0,m=!0,(v||y)&&(x=T),d=!0;break;case"anchor":v&&r(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&r(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=T,S??(S=T.offset),u=!1,d=!1,p=!0;break;case"tag":{y&&r(T,"MULTIPLE_TAGS","A node can have at most one tag"),y=T,S??(S=T.offset),u=!1,d=!1,p=!0;break}case n:(v||y)&&r(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),w&&r(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),w=T,u=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){E&&r(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),E=T,u=!1,d=!1;break}default:r(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),u=!1,d=!1}const _=e[e.length-1],k=_?_.offset+_.source.length:i;return p&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&r(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(u&&b.indent<=a||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&r(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:E,found:w,spaceBefore:c,comment:f,hasNewline:m,anchor:v,tag:y,newlineAfterProp:x,end:k,start:S??k}}function sg(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(` -`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(sg(t.key)||sg(t.value))return!0}return!1;default:return!0}}function $N(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&sg(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Nz(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const i=typeof s=="function"?s:(r,a)=>r===a||Kn(r)&&Kn(a)&&r.value===a.value;return t.some(r=>i(r.key,n))}const J3="All mapping items must start at the same column";function E2e({composeNode:e,composeEmptyNode:t},n,s,i,r){var d;const a=(r==null?void 0:r.nodeClass)??na,l=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const f of s.items){const{start:h,key:m,sep:p,value:b}=f,v=Gf(h,{indicator:"explicit-key-ind",next:m??(p==null?void 0:p[0]),offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),y=!v.found;if(y){if(m&&(m.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==s.indent&&i(c,"BAD_INDENT",J3)),!v.anchor&&!v.tag&&!p){u=v.end,v.comment&&(l.comment?l.comment+=` -`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||sg(m))&&i(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==s.indent&&i(c,"BAD_INDENT",J3);n.atKey=!0;const x=v.end,E=m?e(n,m,v,i):t(n,x,h,null,v,i);n.schema.compat&&$N(s.indent,m,i),n.atKey=!1,Nz(n,l.items,E)&&i(x,"DUPLICATE_KEY","Map keys must be unique");const w=Gf(p??[],{indicator:"map-value-ind",next:b,offset:E.range[2],onError:i,parentIndent:s.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=w.end,w.found){y&&((b==null?void 0:b.type)==="block-map"&&!w.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function w2e({composeNode:e,composeEmptyNode:t},n,s,i,r){var v;const a=s.start.source==="{",l=a?"flow map":"flow sequence",c=(r==null?void 0:r.nodeClass)??(a?na:vu),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=s.offset+s.start.source.length;for(let y=0;y0){const y=qg(p,b,n.options.strict,i);y.comment&&(u.comment?u.comment+=` -`+y.comment:u.comment=y.comment),u.range=[s.offset,b,y.offset]}else u.range=[s.offset,b,b];return u}function Xw(e,t,n,s,i,r){const a=n.type==="block-map"?E2e(e,t,n,s,r):n.type==="block-seq"?v2e(e,t,n,s,r):w2e(e,t,n,s,r),l=a.constructor;return i==="!"||i===l.tagName?(a.tag=l.tagName,a):(i&&(a.tag=i),a)}function _2e(e,t,n,s,i){var h;const r=s.tag,a=r?t.directives.tagName(r.source,m=>i(r,"TAG_RESOLVE_FAILED",m)):null;if(n.type==="block-seq"){const{anchor:m,newlineAfterProp:p}=s,b=m&&r?m.offset>r.offset?m:r:m??r;b&&(!p||p.offsetm.tag===a&&m.collection===l);if(!c){const m=t.schema.knownTags[a];if((m==null?void 0:m.collection)===l)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?i(r,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Xw(e,t,n,i,a)}const u=Xw(e,t,n,i,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,m=>i(r,"TAG_RESOLVE_FAILED",m),t.options))??u,f=Ks(d)?d:new It(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function S2e(e,t,n){const s=t.offset,i=N2e(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?It.BLOCK_FOLDED:It.BLOCK_LITERAL,a=t.source?T2e(t.source):[];let l=a.length;for(let b=a.length-1;b>=0;--b){const v=a[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=i.chomp==="+"&&a.length>0?` -`.repeat(Math.max(1,a.length-1)):"";let v=s+i.length;return t.source&&(v+=t.source.length),{value:b,type:r,comment:i.comment,range:[s,v,v]}}let c=t.indent+i.indent,u=t.offset+i.length,d=0;for(let b=0;bc&&(c=v.length);else{v.length=l;--b)a[b][0].length>c&&(l=b+1);let f="",h="",m=!1;for(let b=0;br===a||zn(r)&&zn(a)&&r.value===a.value;return t.some(r=>i(r.key,n))}const eD="All mapping items must start at the same column";function E2e({composeNode:e,composeEmptyNode:t},n,s,i,r){var d;const a=(r==null?void 0:r.nodeClass)??oa,l=new a(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const f of s.items){const{start:h,key:p,sep:m,value:b}=f,v=zf(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:c,onError:i,parentIndent:s.indent,startOnNewline:!0}),y=!v.found;if(y){if(p&&(p.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==s.indent&&i(c,"BAD_INDENT",eD)),!v.anchor&&!v.tag&&!m){u=v.end,v.comment&&(l.comment?l.comment+=` +`+v.comment:l.comment=v.comment);continue}(v.newlineAfterProp||eg(p))&&i(p??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=v.found)==null?void 0:d.indent)!==s.indent&&i(c,"BAD_INDENT",eD);n.atKey=!0;const x=v.end,E=p?e(n,p,v,i):t(n,x,h,null,v,i);n.schema.compat&&$N(s.indent,p,i),n.atKey=!1,Tz(n,l.items,E)&&i(x,"DUPLICATE_KEY","Map keys must be unique");const w=zf(m??[],{indicator:"map-value-ind",next:b,offset:E.range[2],onError:i,parentIndent:s.indent,startOnNewline:!p||p.type==="block-scalar"});if(c=w.end,w.found){y&&((b==null?void 0:b.type)==="block-map"&&!w.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.starte&&(e.type==="block-map"||e.type==="block-seq");function w2e({composeNode:e,composeEmptyNode:t},n,s,i,r){var v;const a=s.start.source==="{",l=a?"flow map":"flow sequence",c=(r==null?void 0:r.nodeClass)??(a?oa:_u),u=new c(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=s.offset+s.start.source.length;for(let y=0;y0){const y=Vg(m,b,n.options.strict,i);y.comment&&(u.comment?u.comment+=` +`+y.comment:u.comment=y.comment),u.range=[s.offset,b,y.offset]}else u.range=[s.offset,b,b];return u}function Xw(e,t,n,s,i,r){const a=n.type==="block-map"?E2e(e,t,n,s,r):n.type==="block-seq"?v2e(e,t,n,s,r):w2e(e,t,n,s,r),l=a.constructor;return i==="!"||i===l.tagName?(a.tag=l.tagName,a):(i&&(a.tag=i),a)}function _2e(e,t,n,s,i){var h;const r=s.tag,a=r?t.directives.tagName(r.source,p=>i(r,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=s,b=p&&r?p.offset>r.offset?p:r:p??r;b&&(!m||m.offsetp.tag===a&&p.collection===l);if(!c){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===l)t.schema.tags.push(Object.assign({},p,{default:!1})),c=p;else return p?i(r,"BAD_COLLECTION_TYPE",`${p.tag} used for ${l} collection, but expects ${p.collection??"scalar"}`,!0):i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Xw(e,t,n,i,a)}const u=Xw(e,t,n,i,a,c),d=((h=c.resolve)==null?void 0:h.call(c,u,p=>i(r,"TAG_RESOLVE_FAILED",p),t.options))??u,f=Vs(d)?d:new Ct(d);return f.range=u.range,f.tag=a,c!=null&&c.format&&(f.format=c.format),f}function S2e(e,t,n){const s=t.offset,i=N2e(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[s,s,s]};const r=i.mode===">"?Ct.BLOCK_FOLDED:Ct.BLOCK_LITERAL,a=t.source?T2e(t.source):[];let l=a.length;for(let b=a.length-1;b>=0;--b){const v=a[b][1];if(v===""||v==="\r")l=b;else break}if(l===0){const b=i.chomp==="+"&&a.length>0?` +`.repeat(Math.max(1,a.length-1)):"";let v=s+i.length;return t.source&&(v+=t.source.length),{value:b,type:r,comment:i.comment,range:[s,v,v]}}let c=t.indent+i.indent,u=t.offset+i.length,d=0;for(let b=0;bc&&(c=v.length);else{v.length=l;--b)a[b][0].length>c&&(l=b+1);let f="",h="",p=!1;for(let b=0;bc||y[0]===" "?(h===" "?h=` -`:!m&&h===` +`:!p&&h===` `&&(h=` `),f+=h+v.slice(c)+y,h=` -`,m=!0):y===""?h===` +`,p=!0):y===""?h===` `?f+=` `:h=` -`:(f+=h+y,h=" ",m=!1)}switch(i.chomp){case"-":break;case"+":for(let b=l;bn(s+h,m,p);switch(i){case"scalar":l=It.PLAIN,c=A2e(r,u);break;case"single-quoted-scalar":l=It.QUOTE_SINGLE,c=C2e(r,u);break;case"double-quoted-scalar":l=It.QUOTE_DOUBLE,c=I2e(r,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const d=s+r.length,f=qg(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[s,d,f.offset]}}function A2e(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Tz(e)}function C2e(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Tz(e.slice(1,-1)).replace(/''/g,"'")}function Tz(e){let t,n;try{t=new RegExp(`(.*?)(?n(s+h,p,m);switch(i){case"scalar":l=Ct.PLAIN,c=A2e(r,u);break;case"single-quoted-scalar":l=Ct.QUOTE_SINGLE,c=C2e(r,u);break;case"double-quoted-scalar":l=Ct.QUOTE_DOUBLE,c=I2e(r,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[s,s+r.length,s+r.length]}}const d=s+r.length,f=Vg(a,d,t,n);return{value:c,type:l,comment:f.comment,range:[s,d,f.offset]}}function A2e(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),kz(e)}function C2e(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),kz(e.slice(1,-1)).replace(/''/g,"'")}function kz(e){let t,n;try{t=new RegExp(`(.*?)(?s(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[oo]:c?u=M2e(e.schema,i,c,n,s):t.type==="scalar"?u=L2e(e,i,t,s):u=e.schema[oo];let d;try{const f=u.resolve(i,h=>s(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Kn(f)?f:new It(f)}catch(f){const h=f instanceof Error?f.message:String(f);s(n??t,"TAG_RESOLVE_FAILED",h),d=new It(i)}return d.range=l,d.source=i,r&&(d.type=r),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function M2e(e,t,n,s,i){var l;if(n==="!")return e[oo];const r=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)r.push(c);else return c;for(const c of r)if((l=c.test)!=null&&l.test(t))return c;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[oo])}function L2e({atKey:e,directives:t,schema:n},s,i,r){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(s))})||n[oo];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[oo];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return a}function D2e(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let i=t[s];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++s];(i==null?void 0:i.type)==="space";)e+=i.source.length,i=t[++s];break}}return e}const P2e={composeNode:Az,composeEmptyNode:VA};function Az(e,t,n,s){const i=e.atKey,{spaceBefore:r,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=B2e(e,t,s),(l||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=kz(e,t,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=_2e(P2e,e,t,n,s),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);s(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=VA(e,t.offset,void 0,null,n,s)),l&&u.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Kn(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function VA(e,t,n,s,{spaceBefore:i,comment:r,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:D2e(t,n,s),indent:-1,source:""},f=kz(e,d,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=c),f}function B2e({options:e},{offset:t,source:n,end:s},i){const r=new RA(n.substring(1));r.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,l=qg(s,a,e.strict,i);return r.range=[t,a,l.offset],l.comment&&(r.comment=l.comment),r}function U2e(e,t,{offset:n,start:s,value:i,end:r},a){const l=Object.assign({_directives:t},e),c=new Kg(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Gf(s,{indicator:"doc-start",next:i??(r==null?void 0:r[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Az(u,i,d,a):VA(u,d.end,s,null,d,a);const f=c.contents.range[2],h=qg(r,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function cm(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function eD(e){var i;let t="",n=!1,s=!1;for(let r=0;rs(n,"TAG_RESOLVE_FAILED",f)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[po]:c?u=M2e(e.schema,i,c,n,s):t.type==="scalar"?u=L2e(e,i,t,s):u=e.schema[po];let d;try{const f=u.resolve(i,h=>s(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=zn(f)?f:new Ct(f)}catch(f){const h=f instanceof Error?f.message:String(f);s(n??t,"TAG_RESOLVE_FAILED",h),d=new Ct(i)}return d.range=l,d.source=i,r&&(d.type=r),c&&(d.tag=c),u.format&&(d.format=u.format),a&&(d.comment=a),d}function M2e(e,t,n,s,i){var l;if(n==="!")return e[po];const r=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)r.push(c);else return c;for(const c of r)if((l=c.test)!=null&&l.test(t))return c;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[po])}function L2e({atKey:e,directives:t,schema:n},s,i,r){const a=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(s))})||n[po];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[po];if(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),d=`Value may be parsed as either ${c} or ${u}`;r(i,"TAG_RESOLVE_FAILED",d,!0)}}return a}function D2e(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let i=t[s];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++s];(i==null?void 0:i.type)==="space";)e+=i.source.length,i=t[++s];break}}return e}const P2e={composeNode:Cz,composeEmptyNode:VA};function Cz(e,t,n,s){const i=e.atKey,{spaceBefore:r,comment:a,anchor:l,tag:c}=n;let u,d=!0;switch(t.type){case"alias":u=B2e(e,t,s),(l||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=Az(e,t,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=_2e(P2e,e,t,n,s),l&&(u.anchor=l.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);s(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",f),d=!1}}return u??(u=VA(e,t.offset,void 0,null,n,s)),l&&u.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!zn(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),r&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&d&&(u.srcToken=t),u}function VA(e,t,n,s,{spaceBefore:i,comment:r,anchor:a,tag:l,end:c},u){const d={type:"scalar",offset:D2e(t,n,s),indent:-1,source:""},f=Az(e,d,l,u);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),r&&(f.comment=r,f.range[2]=c),f}function B2e({options:e},{offset:t,source:n,end:s},i){const r=new RA(n.substring(1));r.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),r.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,l=Vg(s,a,e.strict,i);return r.range=[t,a,l.offset],l.comment&&(r.comment=l.comment),r}function U2e(e,t,{offset:n,start:s,value:i,end:r},a){const l=Object.assign({_directives:t},e),c=new zg(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=zf(s,{indicator:"doc-start",next:i??(r==null?void 0:r[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&a(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Cz(u,i,d,a):VA(u,d.end,s,null,d,a);const f=c.contents.range[2],h=Vg(r,f,!1,a);return h.comment&&(c.comment=h.comment),c.range=[n,f,h.offset],c}function ap(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function tD(e){var i;let t="",n=!1,s=!1;for(let r=0;r{const a=cm(n);r?this.warnings.push(new x2e(a,s,i)):this.errors.push(new Am(a,s,i))},this.directives=new Xi({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:i}=eD(this.prelude);if(s){const r=t.contents;if(n)t.comment=t.comment?`${t.comment} -${s}`:s;else if(i||t.directives.docStart||!r)t.commentBefore=s;else if(Vs(r)&&!r.flow&&r.items.length>0){let a=r.items[0];qs(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${s} +`)+(a.substring(1)||" "),n=!0,s=!1;break;case"%":((i=e[r+1])==null?void 0:i[0])!=="#"&&(r+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class F2e{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,i,r)=>{const a=ap(n);r?this.warnings.push(new x2e(a,s,i)):this.errors.push(new Np(a,s,i))},this.directives=new Xi({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:i}=tD(this.prelude);if(s){const r=t.contents;if(n)t.comment=t.comment?`${t.comment} +${s}`:s;else if(i||t.directives.docStart||!r)t.commentBefore=s;else if(Hs(r)&&!r.flow&&r.items.length>0){let a=r.items[0];Gs(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${s} ${l}`:s}else{const a=r.commentBefore;r.commentBefore=a?`${s} -${a}`:s}}if(n){for(let r=0;r{const r=cm(t);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=U2e(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new Am(cm(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Am(cm(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=qg(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Am(cm(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const s=Object.assign({_directives:this.directives},this.options),i=new Kg(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const Cz="\uFEFF",Iz="",jz="",HN="";function $2e(e){switch(e){case Cz:return"byte-order-mark";case Iz:return"doc-mode";case jz:return"flow-error-end";case HN:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${a}`:s}}if(n){for(let r=0;r{const r=ap(t);r[0]+=n,this.onError(r,"BAD_DIRECTIVE",s,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=U2e(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new Np(ap(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Np(ap(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Vg(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Np(ap(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const s=Object.assign({_directives:this.directives},this.options),i=new zg(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const Iz="\uFEFF",jz="",Rz="",HN="";function $2e(e){switch(e){case Iz:return"byte-order-mark";case jz:return"doc-mode";case Rz:return"flow-error-end";case HN:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` `:case`\r -`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ya(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const tD=new Set("0123456789ABCDEFabcdef"),H2e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),yb=new Set(",[]{}"),z2e=new Set(` ,[]{} +`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function _a(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const nD=new Set("0123456789ABCDEFabcdef"),H2e=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),xb=new Set(",[]{}"),z2e=new Set(` ,[]{} \r `),Qw=e=>!e||z2e.has(e);class V2e{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` `?!0:n==="\r"?this.buffer[t+1]===` `:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){const i=this.buffer[s+t+1];if(i===` `||!i&&!this.atEnd)return t+s+1}return n===` -`||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&ya(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ya(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ya(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Qw),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&_a(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!_a(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&_a(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Qw),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((s!==-1&&s"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ya(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":n+=1;break;case` +`,r)}i!==-1&&(n=i-(s[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>_a(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let r=this.pos;s=this.buffer[r];++r)switch(s){case" ":n+=1;break;case` `:t=r,n=0;break;case"\r":{const a=this.buffer[r+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` `)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const r=this.continueScalar(t+1);if(r===-1)break;t=this.buffer.indexOf(` `,r)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(s=this.buffer[i];s===" ";)s=this.buffer[++i];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===` `;)s=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let r=t-1,a=this.buffer[r];a==="\r"&&(a=this.buffer[--r]);const l=r;for(;a===" ";)a=this.buffer[--r];if(a===` -`&&r>=this.pos&&r+1+n>l)t=r;else break}while(!0);return yield HN,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(ya(r)||t&&yb.has(r))break;n=s}else if(ya(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===` +`&&r>=this.pos&&r+1+n>l)t=r;else break}while(!0);return yield HN,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,i;for(;i=this.buffer[++s];)if(i===":"){const r=this.buffer[s+1];if(_a(r)||t&&xb.has(r))break;n=s}else if(_a(i)){let r=this.buffer[s+1];if(i==="\r"&&(r===` `?(s+=1,i=` -`,r=this.buffer[s+1]):n=s),r==="#"||t&&yb.has(r))break;if(i===` -`){const a=this.continueScalar(s+1);if(a===-1)break;s=Math.max(s,a-2)}}else{if(t&&yb.has(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield HN,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Qw),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(ya(s)||n&&yb.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ya(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(H2e.has(n))n=this.buffer[++t];else if(n==="%"&&tD.has(this.buffer[t+1])&&tD.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` +`,r=this.buffer[s+1]):n=s),r==="#"||t&&xb.has(r))break;if(i===` +`){const a=this.continueScalar(s+1);if(a===-1)break;s=Math.max(s,a-2)}}else{if(t&&xb.has(i))break;n=s}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield HN,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Qw),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(_a(s)||n&&xb.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!_a(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(H2e.has(n))n=this.buffer[++t];else if(n==="%"&&nD.has(this.buffer[t+1])&&nD.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===` `?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===` -`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class G2e{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n>1;this.lineStarts[r]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function D1(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&sD(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&nD(i.start)===-1&&(n.indent===0||i.start.every(r=>r.type!=="comment"||r.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class G2e{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n>1;this.lineStarts[r]=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function P1(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&iD(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const i=s.items[s.items.length-1];if(i.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=s.items[s.items.length-1];i.value?s.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=s.items[s.items.length-1];!i||i.value?s.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&sD(i.start)===-1&&(n.indent===0||i.start.every(r=>r.type!=="comment"||r.indent=t.indent){const i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(r&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Cl(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(Rz(n.key)&&!Cl(n.sep,"newline")){const l=dd(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Cl(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=dd(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Cl(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);r||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Cl(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:a});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2],r=(s=i==null?void 0:i.value)==null?void 0:s.end;if(Array.isArray(r)){D1(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Cl(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=xb(s),r=dd(i);sD(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` +`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const i="end"in n.value?n.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2],r=(s=i==null?void 0:i.value)==null?void 0:s.end;if(Array.isArray(r)){P1(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const i=!this.onKeyLine&&this.indent===t.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(r&&n.sep&&!n.value){const l=[];for(let c=0;ct.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(a.push(this.sourceToken),t.items.push({start:a}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(a.push(this.sourceToken),t.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Rl(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(Oz(n.key)&&!Rl(n.sep,"newline")){const l=cd(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Rl(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=cd(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Rl(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);r||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Rl(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&t.items.push({start:a});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const i="end"in n.value?n.value.end:void 0,r=Array.isArray(i)?i[i.length-1]:void 0;(r==null?void 0:r.type)==="comment"?i==null||i.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const i=t.items[t.items.length-2],r=(s=i==null?void 0:i.value)==null?void 0:s.end;if(Array.isArray(r)){P1(r,n.start),r.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Rl(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const i=this.startBlockValue(t);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const i=Eb(s),r=cd(i);iD(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(` `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(` -`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=xb(t),s=dd(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=xb(t),s=dd(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function q2e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new G2e||null,prettyErrors:t}}function Y2e(e,t={}){const{lineCounter:n,prettyErrors:s}=q2e(t),i=new K2e(n==null?void 0:n.addNewLine),r=new F2e(t);let a=null;for(const l of r.compose(i.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Am(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(a.errors.forEach(Z3(e,n)),a.warnings.forEach(Z3(e,n))),a}function W2e(e,t,n){let s;const i=Y2e(e,n);if(!i)return null;if(i.warnings.forEach(r=>iz(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}function X2e(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:i}={};if(!i)return}return Hg(e)&&!s?e.toString(n):new Kg(e,s,n).toString(n)}const Oz=new Set(["local","sqlite","mysql","postgresql"]),Mz=new Set(["local","opensearch","redis","viking","openviking","mem0"]),Lz=new Set(["opensearch","viking","context_search"]),Dz=new Set(["apmplus","cozeloop","tls"]),Pz=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),Q2e=new Set(g7.map(e=>e.id)),Z2e=new Set(["llm","sequential","parallel","loop","a2a"]);function Ot(e,t=""){return typeof e=="string"?e:t}function Zr(e){return e===!0}function dp(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function J2e(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="string"))}function Bz(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:Ot(t.name),description:Ot(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function ff(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function Uz(e){return typeof e=="string"&&Z2e.has(e)?e:"llm"}function Fz(e){return e==="byteplus"?"byteplus":"volcengine"}function $z(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function Hz(e){const t=e&&typeof e=="object"?e:{};return{enabled:Zr(t.enabled),registrySpaceId:Ot(t.registrySpaceId),registryTopK:Ot(t.registryTopK),registryRegion:Ot(t.registryRegion),registryEndpoint:Ot(t.registryEndpoint)}}function zz(e,t="volcengine"){return Array.isArray(e)?e.map(n=>{const s=n&&typeof n=="object"?n:{},i=Fz(s.cloudProvider??t),r=s.memory&&typeof s.memory=="object"?s.memory:{},a=Hz(s.a2aRegistry),l=Uz(s.agentType),c=a.enabled&&l==="llm"?"a2a":l;return{...Ai(i),cloudProvider:i,name:Ot(s.name),description:Ot(s.description),instruction:Ot(s.instruction),agentType:c,maxIterations:$z(s.maxIterations),a2aUrl:Ot(s.a2aUrl),modelName:Ot(s.modelName),modelProvider:Ot(s.modelProvider),modelApiBase:Ot(s.modelApiBase),builtinTools:dp(s.builtinTools).filter(u=>Pz.has(u)),customTools:Bz(s.customTools),memory:{shortTerm:Zr(r.shortTerm),longTerm:Zr(r.longTerm)},shortTermBackend:ff(s.shortTermBackend,Oz,"local"),longTermBackend:ff(s.longTermBackend,Mz,"local"),autoSaveSession:Zr(s.autoSaveSession),knowledgebase:Zr(s.knowledgebase),knowledgebaseBackend:ff(s.knowledgebaseBackend,Lz,xu),knowledgebaseIndex:Ot(s.knowledgebaseIndex),tracing:Zr(s.tracing),tracingExporters:dp(s.tracingExporters).filter(u=>Dz.has(u)),a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,subAgents:zz(s.subAgents,i),selectedSkills:Vz(s)}}):[]}function Vz(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const s=n&&typeof n=="object"?n:{},i=Ot(s.source),r=i==="local"||i==="skillspace"||i==="skillhub"?i:"skillhub",a=Ot(s.name)||Ot(s.slug)||Ot(s.skillName)||Ot(s.skillId)||"skill",l=Ot(s.folder)||a,c=Ot(s.description);if(r==="skillhub"){const f=Ot(s.slug);if(!f)continue;t.push({source:r,folder:l,name:a,description:c,slug:f,namespace:Ot(s.namespace)||"public"});continue}if(r==="local"){const h=(Array.isArray(s.localFiles)?s.localFiles:[]).map(m=>{const p=m&&typeof m=="object"?m:{},b=Ot(p.path),v=Ot(p.content);return b?{path:b,content:v}:null}).filter(m=>m!==null);if(h.length===0)continue;t.push({source:r,folder:l,name:a,description:c,localFiles:h});continue}const u=Ot(s.skillSpaceId),d=Ot(s.skillId);!u||!d||t.push({source:r,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:Ot(s.skillSpaceName),skillId:d,version:Ot(s.version)})}return t}function GA(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},s=t.deployment&&typeof t.deployment=="object"?t.deployment:{},i=J2e(s.envValues),r=Hz(t.a2aRegistry),a=Uz(t.agentType),l=r.enabled&&a==="llm"?"a2a":a,c=Fz(t.cloudProvider),u=Array.isArray(t.mcpTools)?t.mcpTools.map(d=>{const f=d&&typeof d=="object"?d:{},h=f.transport==="stdio"?"stdio":"http";return{name:Ot(f.name),transport:h,url:Ot(f.url),authToken:Ot(f.authToken),authTokenEnv:Ot(f.authTokenEnv),command:Ot(f.command),args:dp(f.args)}}).filter(d=>d.transport==="http"?!!d.url:!!d.command):[];return{...Ai(c),cloudProvider:c,name:Ot(t.name)||"my_agent",description:Ot(t.description),instruction:Ot(t.instruction)||"You are a helpful assistant.",agentType:l,maxIterations:$z(t.maxIterations),a2aUrl:Ot(t.a2aUrl),modelName:Ot(t.modelName),modelProvider:Ot(t.modelProvider),modelApiBase:Ot(t.modelApiBase),builtinTools:dp(t.builtinTools).filter(d=>Pz.has(d)),customTools:Bz(t.customTools),mcpTools:u,a2aRegistry:l==="a2a"?{...r,enabled:!0}:r,memory:{shortTerm:Zr(n.shortTerm),longTerm:Zr(n.longTerm)},shortTermBackend:ff(t.shortTermBackend,Oz,"local"),longTermBackend:ff(t.longTermBackend,Mz,"local"),autoSaveSession:Zr(t.autoSaveSession),knowledgebase:Zr(t.knowledgebase),knowledgebaseBackend:ff(t.knowledgebaseBackend,Lz,xu),knowledgebaseIndex:Ot(t.knowledgebaseIndex),tracing:Zr(t.tracing),tracingExporters:dp(t.tracingExporters).filter(d=>Dz.has(d)),deployment:{feishuEnabled:Zr(s.feishuEnabled),...Object.keys(i).length>0?{envValues:i}:{}},subAgents:zz(t.subAgents,c),selectedSkills:Vz(t)}}function Gz(e){return{...e,builtinTools:(e.builtinTools??[]).filter(t=>Q2e.has(t)),tracing:!1,tracingExporters:[],memory:{shortTerm:!1,longTerm:!1},shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebase:!1,knowledgebaseBackend:xu,knowledgebaseIndex:"",subAgents:e.subAgents.map(Gz)}}const eAe=/^[A-Za-z_][A-Za-z0-9_]*$/,KA=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function iD(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function tAe(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function Kz(e){var n,s,i;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&eAe.test(t)?t:((i=(s=e.authToken)==null?void 0:s.trim().match(KA))==null?void 0:i[1])??""}function nAe(e){if(e.authToken)return e.authToken;const t=Kz(e);return t?`\${${t}}`:""}function sAe(e,t){if(!t){const s={...e};return delete s.authToken,delete s.authTokenEnv,s}const n=t.trim().match(KA);if(n){const s={...e,authTokenEnv:n[1]};return delete s.authToken,s}return{...e,authToken:t}}function iAe(e){if(!e.trim())return!1;try{return!new URL(e).pathname.replace(/\/+$/,"").endsWith("/mcp")}catch{return!1}}function pE(e){const t=new Set,n={},s=i=>{var u;const r=iD(i.name,"AGENT"),a=(u=i.mcpTools)==null?void 0:u.map((d,f)=>{var y,x;const h=((y=d.authToken)==null?void 0:y.trim())??"",m=((x=h.match(KA))==null?void 0:x[1])??"";let b=Kz(d);if(!b&&h){const E=iD(d.name,`TOOL_${f+1}`);b=tAe(`MCP_${r}_${E}_AUTH_TOKEN`,t)}b&&t.add(b),b&&h&&!m&&(n[b]=h);const v={...d};return delete v.authToken,b?v.authTokenEnv=b:delete v.authTokenEnv,v}),l=i.subAgents.map(s),c=i.workflow?{...i.workflow,nodes:i.workflow.nodes.map(d=>({...d,agent:s(d.agent)}))}:void 0;return{...i,subAgents:l,...a?{mcpTools:a}:{},...c?{workflow:c}:{}}};return{draft:s(e),envValues:n}}function qz(e){var n,s,i,r,a,l,c,u,d,f,h,m,p,b,v,y,x,E,w,S,_,k;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const T={enabled:!0};(s=e.a2aRegistry.registrySpaceId)!=null&&s.trim()&&(T.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),T.registryTopK=((i=e.a2aRegistry.registryTopK)==null?void 0:i.trim())||ja.topK,T.registryRegion=((r=e.a2aRegistry.registryRegion)==null?void 0:r.trim())||ja.region,T.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||ja.endpoint,t.a2aRegistry=T}return t}if(t.name=e.name,t.description=e.description,t.instruction=e.instruction,e.agentType==="loop"&&(t.maxIterations=e.maxIterations??3),(l=e.modelName)!=null&&l.trim()&&(t.modelName=e.modelName.trim()),(c=e.modelProvider)!=null&&c.trim()&&(t.modelProvider=e.modelProvider.trim()),(u=e.modelApiBase)!=null&&u.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(d=e.builtinTools)!=null&&d.length&&(t.builtinTools=[...e.builtinTools]),(f=e.customTools)!=null&&f.length&&(t.customTools=e.customTools.map(T=>({name:T.name,description:T.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(T=>{var j,R,B,z;const A={name:T.name,transport:T.transport};return(j=T.url)!=null&&j.trim()&&(A.url=T.url.trim()),(R=T.authTokenEnv)!=null&&R.trim()&&(A.authTokenEnv=T.authTokenEnv.trim()),(B=T.command)!=null&&B.trim()&&(A.command=T.command.trim()),(z=T.args)!=null&&z.length&&(A.args=T.args),A})),((m=e.memory)!=null&&m.shortTerm||(p=e.memory)!=null&&p.longTerm)&&(t.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(t.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(t.longTermBackend=e.longTermBackend||"local",t.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(t.knowledgebase=!0,t.knowledgebaseBackend=e.knowledgebaseBackend||"viking",(b=e.knowledgebaseIndex)!=null&&b.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((v=e.tracingExporters)!=null&&v.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled||Object.keys(((x=e.deployment)==null?void 0:x.envValues)??{}).length>0){const T={feishuEnabled:!!((E=e.deployment)!=null&&E.feishuEnabled)};Object.keys(((w=e.deployment)==null?void 0:w.envValues)??{}).length>0&&(T.envValues={...(S=e.deployment)==null?void 0:S.envValues}),t.deployment=T}return(_=e.selectedSkills)!=null&&_.length&&(t.selectedSkills=e.selectedSkills.map(T=>{const A={source:T.source,name:T.name,folder:T.folder};return T.description&&(A.description=T.description),T.source==="skillhub"?(A.slug=T.slug,A.namespace=T.namespace??"public"):T.source==="local"?A.localFiles=T.localFiles??[]:(A.skillSpaceId=T.skillSpaceId,A.skillSpaceName=T.skillSpaceName,A.skillId=T.skillId,T.version&&(A.version=T.version)),A})),(k=e.subAgents)!=null&&k.length&&(t.subAgents=e.subAgents.map(qz)),t}function rAe(e){var i;const t=pE(e),n={...((i=t.draft.deployment)==null?void 0:i.envValues)??{},...t.envValues},s={...t.draft,deployment:{...t.draft.deployment??{feishuEnabled:!1},envValues:n}};return`# VeADK Agent 结构配置 +`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Eb(t),s=cd(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Eb(t),s=cd(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function q2e(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new G2e||null,prettyErrors:t}}function Y2e(e,t={}){const{lineCounter:n,prettyErrors:s}=q2e(t),i=new K2e(n==null?void 0:n.addNewLine),r=new F2e(t);let a=null;for(const l of r.compose(i.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Np(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(a.errors.forEach(J3(e,n)),a.warnings.forEach(J3(e,n))),a}function W2e(e,t,n){let s;const i=Y2e(e,n);if(!i)return null;if(i.warnings.forEach(r=>rz(i.options.logLevel,r)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:s},n))}function X2e(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:i}={};if(!i)return}return Ug(e)&&!s?e.toString(n):new zg(e,s,n).toString(n)}const Mz=new Set(["local","sqlite","mysql","postgresql"]),Lz=new Set(["local","opensearch","redis","viking","openviking","mem0"]),Dz=new Set(["opensearch","viking","context_search"]),Pz=new Set(["apmplus","cozeloop","tls"]),Bz=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","run_code","vesearch"]),Q2e=new Set(b7.map(e=>e.id)),Z2e=new Set(["llm","sequential","parallel","loop","a2a"]);function jt(e,t=""){return typeof e=="string"?e:t}function sa(e){return e===!0}function lm(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function J2e(e){return!e||typeof e!="object"||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(t=>typeof t[1]=="string"))}function Uz(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:jt(t.name),description:jt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function uf(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function Fz(e){return typeof e=="string"&&Z2e.has(e)?e:"llm"}function $z(e){return e==="byteplus"?"byteplus":"volcengine"}function Hz(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function zz(e){const t=e&&typeof e=="object"?e:{};return{enabled:sa(t.enabled),registrySpaceId:jt(t.registrySpaceId),registryTopK:jt(t.registryTopK),registryRegion:jt(t.registryRegion),registryEndpoint:jt(t.registryEndpoint)}}function Vz(e,t="volcengine"){return Array.isArray(e)?e.map(n=>{const s=n&&typeof n=="object"?n:{},i=$z(s.cloudProvider??t),r=s.memory&&typeof s.memory=="object"?s.memory:{},a=zz(s.a2aRegistry),l=Fz(s.agentType),c=a.enabled&&l==="llm"?"a2a":l;return{...Ci(i),cloudProvider:i,name:jt(s.name),description:jt(s.description),instruction:jt(s.instruction),agentType:c,maxIterations:Hz(s.maxIterations),a2aUrl:jt(s.a2aUrl),modelName:jt(s.modelName),modelProvider:jt(s.modelProvider),modelApiBase:jt(s.modelApiBase),builtinTools:lm(s.builtinTools).filter(u=>Bz.has(u)),customTools:Uz(s.customTools),memory:{shortTerm:sa(r.shortTerm),longTerm:sa(r.longTerm)},shortTermBackend:uf(s.shortTermBackend,Mz,"local"),longTermBackend:uf(s.longTermBackend,Lz,"local"),autoSaveSession:sa(s.autoSaveSession),knowledgebase:sa(s.knowledgebase),knowledgebaseBackend:uf(s.knowledgebaseBackend,Dz,vu),knowledgebaseIndex:jt(s.knowledgebaseIndex),tracing:sa(s.tracing),tracingExporters:lm(s.tracingExporters).filter(u=>Pz.has(u)),a2aRegistry:c==="a2a"?{...a,enabled:!0}:a,subAgents:Vz(s.subAgents,i),selectedSkills:Gz(s)}}):[]}function Gz(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const s=n&&typeof n=="object"?n:{},i=jt(s.source),r=i==="local"||i==="skillspace"||i==="skillhub"?i:"skillhub",a=jt(s.name)||jt(s.slug)||jt(s.skillName)||jt(s.skillId)||"skill",l=jt(s.folder)||a,c=jt(s.description);if(r==="skillhub"){const f=jt(s.slug);if(!f)continue;t.push({source:r,folder:l,name:a,description:c,slug:f,namespace:jt(s.namespace)||"public"});continue}if(r==="local"){const h=(Array.isArray(s.localFiles)?s.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},b=jt(m.path),v=jt(m.content);return b?{path:b,content:v}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:r,folder:l,name:a,description:c,localFiles:h});continue}const u=jt(s.skillSpaceId),d=jt(s.skillId);!u||!d||t.push({source:r,folder:l,name:a,description:c,skillSpaceId:u,skillSpaceName:jt(s.skillSpaceName),skillId:d,version:jt(s.version)})}return t}function GA(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},s=t.deployment&&typeof t.deployment=="object"?t.deployment:{},i=J2e(s.envValues),r=zz(t.a2aRegistry),a=Fz(t.agentType),l=r.enabled&&a==="llm"?"a2a":a,c=$z(t.cloudProvider),u=Array.isArray(t.mcpTools)?t.mcpTools.map(d=>{const f=d&&typeof d=="object"?d:{},h=f.transport==="stdio"?"stdio":"http";return{name:jt(f.name),transport:h,url:jt(f.url),authToken:jt(f.authToken),authTokenEnv:jt(f.authTokenEnv),command:jt(f.command),args:lm(f.args)}}).filter(d=>d.transport==="http"?!!d.url:!!d.command):[];return{...Ci(c),cloudProvider:c,name:jt(t.name)||"my_agent",description:jt(t.description),instruction:jt(t.instruction)||"You are a helpful assistant.",agentType:l,maxIterations:Hz(t.maxIterations),a2aUrl:jt(t.a2aUrl),modelName:jt(t.modelName),modelProvider:jt(t.modelProvider),modelApiBase:jt(t.modelApiBase),builtinTools:lm(t.builtinTools).filter(d=>Bz.has(d)),customTools:Uz(t.customTools),mcpTools:u,a2aRegistry:l==="a2a"?{...r,enabled:!0}:r,memory:{shortTerm:sa(n.shortTerm),longTerm:sa(n.longTerm)},shortTermBackend:uf(t.shortTermBackend,Mz,"local"),longTermBackend:uf(t.longTermBackend,Lz,"local"),autoSaveSession:sa(t.autoSaveSession),knowledgebase:sa(t.knowledgebase),knowledgebaseBackend:uf(t.knowledgebaseBackend,Dz,vu),knowledgebaseIndex:jt(t.knowledgebaseIndex),tracing:sa(t.tracing),tracingExporters:lm(t.tracingExporters).filter(d=>Pz.has(d)),deployment:{feishuEnabled:sa(s.feishuEnabled),...Object.keys(i).length>0?{envValues:i}:{}},subAgents:Vz(t.subAgents,c),selectedSkills:Gz(t)}}function Kz(e){return{...e,builtinTools:(e.builtinTools??[]).filter(t=>Q2e.has(t)),tracing:!1,tracingExporters:[],memory:{shortTerm:!1,longTerm:!1},shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebase:!1,knowledgebaseBackend:vu,knowledgebaseIndex:"",subAgents:e.subAgents.map(Kz)}}const eAe=/^[A-Za-z_][A-Za-z0-9_]*$/,KA=/^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;function rD(e,t){return e.trim().toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")||t}function tAe(e,t){if(!t.has(e))return e;let n=2;for(;t.has(`${e}_${n}`);)n+=1;return`${e}_${n}`}function qz(e){var n,s,i;const t=(n=e.authTokenEnv)==null?void 0:n.trim();return t&&eAe.test(t)?t:((i=(s=e.authToken)==null?void 0:s.trim().match(KA))==null?void 0:i[1])??""}function nAe(e){if(e.authToken)return e.authToken;const t=qz(e);return t?`\${${t}}`:""}function sAe(e,t){if(!t){const s={...e};return delete s.authToken,delete s.authTokenEnv,s}const n=t.trim().match(KA);if(n){const s={...e,authTokenEnv:n[1]};return delete s.authToken,s}return{...e,authToken:t}}function iAe(e){if(!e.trim())return!1;try{return!new URL(e).pathname.replace(/\/+$/,"").endsWith("/mcp")}catch{return!1}}function gE(e){const t=new Set,n={},s=i=>{var u;const r=rD(i.name,"AGENT"),a=(u=i.mcpTools)==null?void 0:u.map((d,f)=>{var y,x;const h=((y=d.authToken)==null?void 0:y.trim())??"",p=((x=h.match(KA))==null?void 0:x[1])??"";let b=qz(d);if(!b&&h){const E=rD(d.name,`TOOL_${f+1}`);b=tAe(`MCP_${r}_${E}_AUTH_TOKEN`,t)}b&&t.add(b),b&&h&&!p&&(n[b]=h);const v={...d};return delete v.authToken,b?v.authTokenEnv=b:delete v.authTokenEnv,v}),l=i.subAgents.map(s),c=i.workflow?{...i.workflow,nodes:i.workflow.nodes.map(d=>({...d,agent:s(d.agent)}))}:void 0;return{...i,subAgents:l,...a?{mcpTools:a}:{},...c?{workflow:c}:{}}};return{draft:s(e),envValues:n}}function Yz(e){var n,s,i,r,a,l,c,u,d,f,h,p,m,b,v,y,x,E,w,S,_,T;const t={agentType:e.agentType??"llm"};if(e.agentType==="a2a"){if((n=e.a2aRegistry)!=null&&n.enabled){const k={enabled:!0};(s=e.a2aRegistry.registrySpaceId)!=null&&s.trim()&&(k.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),k.registryTopK=((i=e.a2aRegistry.registryTopK)==null?void 0:i.trim())||Da.topK,k.registryRegion=((r=e.a2aRegistry.registryRegion)==null?void 0:r.trim())||Da.region,k.registryEndpoint=((a=e.a2aRegistry.registryEndpoint)==null?void 0:a.trim())||Da.endpoint,t.a2aRegistry=k}return t}if(t.name=e.name,t.description=e.description,t.instruction=e.instruction,e.agentType==="loop"&&(t.maxIterations=e.maxIterations??3),(l=e.modelName)!=null&&l.trim()&&(t.modelName=e.modelName.trim()),(c=e.modelProvider)!=null&&c.trim()&&(t.modelProvider=e.modelProvider.trim()),(u=e.modelApiBase)!=null&&u.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(d=e.builtinTools)!=null&&d.length&&(t.builtinTools=[...e.builtinTools]),(f=e.customTools)!=null&&f.length&&(t.customTools=e.customTools.map(k=>({name:k.name,description:k.description}))),(h=e.mcpTools)!=null&&h.length&&(t.mcpTools=e.mcpTools.map(k=>{var j,R,B,z;const A={name:k.name,transport:k.transport};return(j=k.url)!=null&&j.trim()&&(A.url=k.url.trim()),(R=k.authTokenEnv)!=null&&R.trim()&&(A.authTokenEnv=k.authTokenEnv.trim()),(B=k.command)!=null&&B.trim()&&(A.command=k.command.trim()),(z=k.args)!=null&&z.length&&(A.args=k.args),A})),((p=e.memory)!=null&&p.shortTerm||(m=e.memory)!=null&&m.longTerm)&&(t.memory={shortTerm:!!e.memory.shortTerm,longTerm:!!e.memory.longTerm},e.memory.shortTerm&&(t.shortTermBackend=e.shortTermBackend||"local"),e.memory.longTerm&&(t.longTermBackend=e.longTermBackend||"local",t.autoSaveSession=!!e.autoSaveSession)),e.knowledgebase&&(t.knowledgebase=!0,t.knowledgebaseBackend=e.knowledgebaseBackend||"viking",(b=e.knowledgebaseIndex)!=null&&b.trim()&&(t.knowledgebaseIndex=e.knowledgebaseIndex.trim())),e.tracing&&((v=e.tracingExporters)!=null&&v.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(y=e.deployment)!=null&&y.feishuEnabled||Object.keys(((x=e.deployment)==null?void 0:x.envValues)??{}).length>0){const k={feishuEnabled:!!((E=e.deployment)!=null&&E.feishuEnabled)};Object.keys(((w=e.deployment)==null?void 0:w.envValues)??{}).length>0&&(k.envValues={...(S=e.deployment)==null?void 0:S.envValues}),t.deployment=k}return(_=e.selectedSkills)!=null&&_.length&&(t.selectedSkills=e.selectedSkills.map(k=>{const A={source:k.source,name:k.name,folder:k.folder};return k.description&&(A.description=k.description),k.source==="skillhub"?(A.slug=k.slug,A.namespace=k.namespace??"public"):k.source==="local"?A.localFiles=k.localFiles??[]:(A.skillSpaceId=k.skillSpaceId,A.skillSpaceName=k.skillSpaceName,A.skillId=k.skillId,k.version&&(A.version=k.version)),A})),(T=e.subAgents)!=null&&T.length&&(t.subAgents=e.subAgents.map(Yz)),t}function rAe(e){var i;const t=gE(e),n={...((i=t.draft.deployment)==null?void 0:i.envValues)??{},...t.envValues},s={...t.draft,deployment:{...t.draft.deployment??{feishuEnabled:!1},envValues:n}};return`# VeADK Agent 结构配置 # 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+X2e(qz(s))}function aAe(e){const t=W2e(e);return GA(t)}const oAe=[{kind:"custom",icon:hte,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:Wee,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:Gee,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:mte,title:"工作流",desc:"敬请期待",disabled:!0}];function lAe({onSelect:e,onImport:t}){const n=g.useRef(null),[s,i]=g.useState(""),r=oAe.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(aAe(d))}catch(d){i(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(YH,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:r,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(dte,{}),"导入 YAML 配置"]}),s&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:s}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}function gE(e,t){return t[e.key]??e.defaultValue??""}function Yz(e){const t=new Map,n={};for(const s of e){for(const i of s.env){const r=t.get(i.key);(!r||i.required&&!r.required)&&t.set(i.key,i)}s.enableFlag&&(t.set(s.enableFlag,{key:s.enableFlag,required:!0}),n[s.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function cAe(e,t){return Yz([{env:e}]).specs.map(s=>({...s,value:gE(s,t)}))}function Wz(e,t){const n=new Map;for(const s of e){const i=gE(s,t);i.trim()&&n.set(s.key,i)}return[...n].map(([s,i])=>({key:s,value:i}))}function rD(e,t){return e.find(n=>n.required&&!gE(n,t).trim())}function qA(e,t){if(e.format!=="json")return;const n=gE(e,t).trim();if(n)try{JSON.parse(n);return}catch{return"JSON 格式不正确"}}function Xz(e,t){for(const n of e){const s=qA(n,t);if(s)return{spec:n,error:s}}}const uAe=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function dAe(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function vs(e,t){e.push(t&255,t>>>8&255)}function wr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const aD=2048,Zw=20,oD=0;function fAe(e){const t=new TextEncoder,n=[],s=[];let i=0;for(const m of e){const p=t.encode(m.path),b=t.encode(m.content),v=dAe(b),y=b.length,x=[];wr(x,67324752),vs(x,Zw),vs(x,aD),vs(x,oD),vs(x,0),vs(x,0),wr(x,v),wr(x,y),wr(x,y),vs(x,p.length),vs(x,0);const E=Uint8Array.from(x);n.push(E,p,b),s.push({nameBytes:p,dataBytes:b,crc:v,size:y,offset:i}),i+=E.length+p.length+b.length}const r=i,a=[];let l=0;for(const m of s){const p=[];wr(p,33639248),vs(p,Zw),vs(p,Zw),vs(p,aD),vs(p,oD),vs(p,0),vs(p,0),wr(p,m.crc),wr(p,m.size),wr(p,m.size),vs(p,m.nameBytes.length),vs(p,0),vs(p,0),vs(p,0),vs(p,0),wr(p,0),wr(p,m.offset);const b=Uint8Array.from(p);a.push(b,m.nameBytes),l+=b.length+m.nameBytes.length}const c=[];wr(c,101010256),vs(c,0),vs(c,0),vs(c,s.length),vs(c,s.length),wr(c,l),wr(c,r),vs(c,0);const u=[...n,...a,Uint8Array.from(c)],d=u.reduce((m,p)=>m+p.length,0),f=new Uint8Array(d);let h=0;for(const m of u)f.set(m,h),h+=m.length;return new Blob([f],{type:"application/zip"})}const hAe=g.lazy(()=>au(()=>import("./CodeEditor-DsbJWtS8.js"),[]));function mAe(e){const t={name:"",children:new Map};for(const n of e){const s=n.path.split("/").filter(Boolean);let i=t;s.forEach((r,a)=>{let l=i.children.get(r);l||(l={name:r,children:new Map},i.children.set(r,l)),a===s.length-1&&(l.path=n.path),i=l})}return t}function pAe(e){return[...e.children.values()].sort((t,n)=>{const s=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return s!==i?s?-1:1:t.name.localeCompare(n.name)})}function Qz({project:e,open:t,onClose:n,onChange:s}){var p;const[i,r]=g.useState(((p=e.files[0])==null?void 0:p.path)??null),[a,l]=g.useState(new Set),c=g.useRef(null),u=g.useMemo(()=>mAe(e.files),[e.files]),d=e.files.find(b=>b.path===i)??null;if(g.useEffect(()=>{var y;if(!t)return;const b=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const v=x=>{x.key==="Escape"&&n()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=b,window.removeEventListener("keydown",v)}},[n,t]),g.useEffect(()=>{d||e.files.length===0||r(e.files[0].path)},[e.files,d]),!t)return null;function f(b){l(v=>{const y=new Set(v);return y.has(b)?y.delete(b):y.add(b),y})}function h(b,v,y){return pAe(b).map(x=>{const E=y?`${y}/${x.name}`:x.name;if(!(x.children.size>0&&x.path===void 0)&&x.path)return o.jsxs("button",{type:"button",className:`code-browser-file${i===x.path?" is-active":""}`,style:{paddingLeft:`${12+v*16}px`},onClick:()=>r(x.path??null),title:x.path,children:[o.jsx(FR,{"aria-hidden":"true"}),o.jsx("span",{children:x.name})]},E);const S=a.has(E);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+v*16}px`},onClick:()=>f(E),"aria-expanded":!S,children:[o.jsx(oc,{className:S?"":"is-open","aria-hidden":"true"}),o.jsx(UB,{"aria-hidden":"true"}),o.jsx("span",{children:x.name})]}),!S&&h(x,v+1,E)]},E)})}function m(b){d&&s({...e,files:e.files.map(v=>v.path===d.path?{...v,content:b}:v)})}return yi.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:b=>{b.target===b.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(Kk,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(Ri,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(FR,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(g.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx(hAe,{value:d.content,path:d.path,onChange:m})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function gAe({project:e,onChange:t,className:n="",label:s="查看源码"}){const[i,r]=g.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>r(!0),"aria-label":"查看和编辑项目源码",title:s,children:[o.jsx(Kk,{"aria-hidden":"true"}),o.jsx("span",{children:s})]}),o.jsx(Qz,{project:e,open:i,onClose:()=>r(!1),onChange:t})]})}function P1({message:e,className:t="",onRetry:n,retryLabel:s="重试部署",defaultExpanded:i=!0}){const[r,a]=g.useState(i),[l,c]=g.useState(!1),[u,d]=g.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),1500)}catch{c(!1)}},h=async()=>{if(!(!n||u)){d(!0);try{await n()}finally{d(!1)}}};return o.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:u,onClick:()=>void h(),children:[u?o.jsx(bn,{className:"spin"}):o.jsx(ate,{}),u?"重试中…":s]}),o.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>a(m=>!m),children:r?o.jsx(Qee,{}):o.jsx(eu,{})}),o.jsx("button",{type:"button",title:l?"已复制":"复制完整错误信息","aria-label":l?"已复制":"复制完整错误信息",onClick:()=>void f(),children:l?o.jsx(Pa,{}):o.jsx(gx,{})})]})]})}const bAe=5e4;function yAe(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` +`+X2e(Yz(s))}function aAe(e){const t=W2e(e);return GA(t)}const oAe=[{kind:"custom",icon:pte,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:Xee,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:Kee,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:mte,title:"工作流",desc:"敬请期待",disabled:!0}];function lAe({onSelect:e,onImport:t}){const n=g.useRef(null),[s,i]=g.useState(""),r=oAe.map(l=>({key:l.kind,icon:l.icon,title:l.title,desc:l.desc,disabled:l.disabled,onClick:()=>e(l.kind)})),a=async l=>{var u;const c=(u=l.target.files)==null?void 0:u[0];if(l.target.value="",!!c)try{const d=await c.text();t(aAe(d))}catch(d){i(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return o.jsx(WH,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:r,footer:o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[o.jsxs("button",{className:"stk-import",onClick:()=>{var l;return(l=n.current)==null?void 0:l.click()},children:[o.jsx(fte,{}),"导入 YAML 配置"]}),s&&o.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:s}),o.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}function bE(e,t){return t[e.key]??e.defaultValue??""}function Wz(e){const t=new Map,n={};for(const s of e){for(const i of s.env){const r=t.get(i.key);(!r||i.required&&!r.required)&&t.set(i.key,i)}s.enableFlag&&(t.set(s.enableFlag,{key:s.enableFlag,required:!0}),n[s.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function cAe(e,t){return Wz([{env:e}]).specs.map(s=>({...s,value:bE(s,t)}))}function Xz(e,t){const n=new Map;for(const s of e){const i=bE(s,t);i.trim()&&n.set(s.key,i)}return[...n].map(([s,i])=>({key:s,value:i}))}function aD(e,t){return e.find(n=>n.required&&!bE(n,t).trim())}function qA(e,t){if(e.format!=="json")return;const n=bE(e,t).trim();if(n)try{JSON.parse(n);return}catch{return"JSON 格式不正确"}}function Qz(e,t){for(const n of e){const s=qA(n,t);if(s)return{spec:n,error:s}}}const uAe=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function dAe(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function vs(e,t){e.push(t&255,t>>>8&255)}function Nr(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const oD=2048,Zw=20,lD=0;function fAe(e){const t=new TextEncoder,n=[],s=[];let i=0;for(const p of e){const m=t.encode(p.path),b=t.encode(p.content),v=dAe(b),y=b.length,x=[];Nr(x,67324752),vs(x,Zw),vs(x,oD),vs(x,lD),vs(x,0),vs(x,0),Nr(x,v),Nr(x,y),Nr(x,y),vs(x,m.length),vs(x,0);const E=Uint8Array.from(x);n.push(E,m,b),s.push({nameBytes:m,dataBytes:b,crc:v,size:y,offset:i}),i+=E.length+m.length+b.length}const r=i,a=[];let l=0;for(const p of s){const m=[];Nr(m,33639248),vs(m,Zw),vs(m,Zw),vs(m,oD),vs(m,lD),vs(m,0),vs(m,0),Nr(m,p.crc),Nr(m,p.size),Nr(m,p.size),vs(m,p.nameBytes.length),vs(m,0),vs(m,0),vs(m,0),vs(m,0),Nr(m,0),Nr(m,p.offset);const b=Uint8Array.from(m);a.push(b,p.nameBytes),l+=b.length+p.nameBytes.length}const c=[];Nr(c,101010256),vs(c,0),vs(c,0),vs(c,s.length),vs(c,s.length),Nr(c,l),Nr(c,r),vs(c,0);const u=[...n,...a,Uint8Array.from(c)],d=u.reduce((p,m)=>p+m.length,0),f=new Uint8Array(d);let h=0;for(const p of u)f.set(p,h),h+=p.length;return new Blob([f],{type:"application/zip"})}const hAe=g.lazy(()=>lu(()=>import("./CodeEditor-1lm8yIe5.js"),[]));function pAe(e){const t={name:"",children:new Map};for(const n of e){const s=n.path.split("/").filter(Boolean);let i=t;s.forEach((r,a)=>{let l=i.children.get(r);l||(l={name:r,children:new Map},i.children.set(r,l)),a===s.length-1&&(l.path=n.path),i=l})}return t}function mAe(e){return[...e.children.values()].sort((t,n)=>{const s=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return s!==i?s?-1:1:t.name.localeCompare(n.name)})}function Zz({project:e,open:t,onClose:n,onChange:s}){var m;const[i,r]=g.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,l]=g.useState(new Set),c=g.useRef(null),u=g.useMemo(()=>pAe(e.files),[e.files]),d=e.files.find(b=>b.path===i)??null;if(g.useEffect(()=>{var y;if(!t)return;const b=document.body.style.overflow;document.body.style.overflow="hidden",(y=c.current)==null||y.focus();const v=x=>{x.key==="Escape"&&n()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=b,window.removeEventListener("keydown",v)}},[n,t]),g.useEffect(()=>{d||e.files.length===0||r(e.files[0].path)},[e.files,d]),!t)return null;function f(b){l(v=>{const y=new Set(v);return y.has(b)?y.delete(b):y.add(b),y})}function h(b,v,y){return mAe(b).map(x=>{const E=y?`${y}/${x.name}`:x.name;if(!(x.children.size>0&&x.path===void 0)&&x.path)return o.jsxs("button",{type:"button",className:`code-browser-file${i===x.path?" is-active":""}`,style:{paddingLeft:`${12+v*16}px`},onClick:()=>r(x.path??null),title:x.path,children:[o.jsx(FR,{"aria-hidden":"true"}),o.jsx("span",{children:x.name})]},E);const S=a.has(E);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+v*16}px`},onClick:()=>f(E),"aria-expanded":!S,children:[o.jsx(uc,{className:S?"":"is-open","aria-hidden":"true"}),o.jsx(FB,{"aria-hidden":"true"}),o.jsx("span",{children:x.name})]}),!S&&h(x,v+1,E)]},E)})}function p(b){d&&s({...e,files:e.files.map(v=>v.path===d.path?{...v,content:b}:v)})}return wi.createPortal(o.jsx("div",{className:"code-browser-backdrop",onMouseDown:b=>{b.target===b.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[o.jsxs("header",{className:"code-browser-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:o.jsx(Kk,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"code-browser-title",children:"项目代码"}),o.jsx("p",{children:e.name||"Agent 项目"})]})]}),o.jsx("button",{ref:c,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:o.jsx(Oi,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"code-browser-workspace",children:[o.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[o.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",o.jsx("span",{children:e.files.length})]}),o.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(u,0,""):o.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),o.jsxs("main",{className:"code-browser-main",children:[o.jsxs("div",{className:"code-browser-path",children:[o.jsx(FR,{"aria-hidden":"true"}),o.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),o.jsx("div",{className:"code-browser-editor",children:d?o.jsx(g.Suspense,{fallback:o.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:o.jsx(hAe,{value:d.content,path:d.path,onChange:p})}):o.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function gAe({project:e,onChange:t,className:n="",label:s="查看源码"}){const[i,r]=g.useState(!1);return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>r(!0),"aria-label":"查看和编辑项目源码",title:s,children:[o.jsx(Kk,{"aria-hidden":"true"}),o.jsx("span",{children:s})]}),o.jsx(Zz,{project:e,open:i,onClose:()=>r(!1),onChange:t})]})}function B1({message:e,className:t="",onRetry:n,retryLabel:s="重试部署",defaultExpanded:i=!0}){const[r,a]=g.useState(i),[l,c]=g.useState(!1),[u,d]=g.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(e),c(!0),setTimeout(()=>c(!1),1500)}catch{c(!1)}},h=async()=>{if(!(!n||u)){d(!0);try{await n()}finally{d(!1)}}};return o.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,role:"alert",children:[o.jsx("p",{className:"deploy-error-message-text",children:e}),o.jsxs("div",{className:"deploy-error-message-actions",children:[n&&o.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:u,onClick:()=>void h(),children:[u?o.jsx(yn,{className:"spin"}):o.jsx(ote,{}),u?"重试中…":s]}),o.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>a(p=>!p),children:r?o.jsx(Zee,{}):o.jsx(nu,{})}),o.jsx("button",{type:"button",title:l?"已复制":"复制完整错误信息","aria-label":l?"已复制":"复制完整错误信息",onClick:()=>void f(),children:l?o.jsx(Ha,{}):o.jsx(bx,{})})]})]})}const bAe=5e4;function yAe(e,t){if(!e)return t;if(!t||e.endsWith(t))return e;if(t.startsWith(e))return t;const n=e.split(` `),s=t.split(` `),i=Math.min(n.length,s.length,260);for(let r=i;r>0;r-=1){const a=n.slice(-r).join(` `),l=s.slice(0,r).join(` @@ -1075,21 +1075,21 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus `);return c?`${e} ${c}`:e}}return`${e} ${t}`}function xAe(e,t){if(e.length<=t)return{text:e,omitted:!1};let n=e.slice(-t);const s=n.indexOf(` -`);return s>=0&&(n=n.slice(s+1)),{text:n,omitted:!0}}function lD(e,t,n=bAe){const s=yAe((e==null?void 0:e.text)??"",t.text??""),i=xAe(s,n),r=i.text?i.text.split(` -`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||i.omitted);return{...t,text:i.text,lineCount:r,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}mr.registerLanguage("python",YF);mr.registerLanguage("typescript",a$);mr.registerLanguage("javascript",HF);mr.registerLanguage("json",zF);mr.registerLanguage("yaml",o$);mr.registerLanguage("markdown",qF);mr.registerLanguage("bash",DF);mr.registerLanguage("ini",PF);mr.registerLanguage("dockerfile",c1e);mr.registerLanguage("makefile",KF);const EAe=g.lazy(()=>au(()=>import("./CodeEditor-DsbJWtS8.js"),[])),wl=()=>{};function vAe({open:e,isUpdate:t,onCancel:n,onConfirm:s}){const i=g.useRef(null);return g.useEffect(()=>{var l;if(!e)return;const r=document.body.style.overflow;document.body.style.overflow="hidden",(l=i.current)==null||l.focus();const a=c=>{c.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>{document.body.style.overflow=r,window.removeEventListener("keydown",a)}},[n,e]),e?yi.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:r=>{r.target===r.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog pp-confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"pp-confirm-title","aria-describedby":"pp-confirm-description",children:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(ute,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(Ri,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:i,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}function Zz({ariaLabel:e,value:t,placeholder:n,options:s,disabled:i=!1,onChange:r}){const a=g.useId(),l=g.useRef(null),c=g.useRef(null),u=g.useRef([]),[d,f]=g.useState(!1),[h,m]=g.useState(0),p=s.find(x=>x.value===t);g.useEffect(()=>{if(!d)return;const x=E=>{E.target instanceof Node&&l.current&&!l.current.contains(E.target)&&f(!1)};return window.addEventListener("pointerdown",x),()=>window.removeEventListener("pointerdown",x)},[d]),g.useEffect(()=>{var x;d&&((x=u.current[h])==null||x.focus())},[h,d]);const b=(x=1)=>{const E=s.findIndex(S=>S.value===t),w=E>=0?E:x===1?0:Math.max(0,s.length-1);m(w),f(!0)},v=x=>{s.length!==0&&m((x+s.length)%s.length)},y=x=>{var E;r(x.value),f(!1),(E=c.current)==null||E.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:l,onKeyDown:x=>{var E;if(x.key==="Escape"&&d){x.preventDefault(),f(!1),(E=c.current)==null||E.focus();return}if(x.key==="Tab"){f(!1);return}x.key==="ArrowDown"?(x.preventDefault(),d?v(h+1):b(1)):x.key==="ArrowUp"?(x.preventDefault(),d?v(h-1):b(-1)):d&&x.key==="Home"?(x.preventDefault(),m(0)):d&&x.key==="End"&&(x.preventDefault(),m(Math.max(0,s.length-1)))},children:[o.jsxs("button",{ref:c,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":d,"aria-controls":d?a:void 0,disabled:i||s.length===0,onClick:()=>{d?f(!1):b()},children:[o.jsx("span",{className:p?void 0:"is-placeholder",children:(p==null?void 0:p.label)??n}),o.jsx(PB,{"aria-hidden":"true",className:`pp-deployment-select-chevron${d?" is-open":""}`})]}),d&&o.jsx("div",{id:a,className:"pp-deployment-select-menu",role:"listbox","aria-label":e,children:s.map((x,E)=>{const w=x.value===t;return o.jsxs("button",{ref:S=>{u.current[E]=S},type:"button",role:"option","aria-selected":w,tabIndex:E===h?0:-1,className:`pp-deployment-select-option${w?" is-selected":""}`,title:x.description,onFocus:()=>m(E),onClick:()=>y(x),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[x.label,x.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:x.badge})]}),x.description&&o.jsx("small",{children:x.description})]}),w&&o.jsx(Pa,{"aria-hidden":"true"})]},x.value)})})]})}function wAe({value:e,disabled:t,onChange:n}){const[s,i]=g.useState([]),[r,a]=g.useState(!0),[l,c]=g.useState(null),[u,d]=g.useState(0);g.useEffect(()=>{const m=new AbortController;return a(!0),c(null),T8(m.signal).then(p=>i(p)).catch(p=>{p instanceof DOMException&&p.name==="AbortError"||(i([]),c(p instanceof Error?p.message:String(p)))}).finally(()=>{m.signal.aborted||a(!1)}),()=>m.abort()},[u]);const f=g.useMemo(()=>[...s].sort((m,p)=>Number(p.isCurrent)-Number(m.isCurrent)).map(m=>({value:m.uid,label:m.name.trim()||"未命名用户池",description:m.domain||m.uid,badge:m.isCurrent?"当前用户池":void 0})),[s]),h=s.find(m=>m.uid===e);return o.jsxs("div",{className:"pp-user-pool-picker",children:[o.jsx(Zz,{ariaLabel:"部署用户池",value:e,placeholder:r?"正在加载用户池…":"请选择用户池",options:f,disabled:t||r||!!l,onChange:n}),l?o.jsxs("div",{className:"pp-user-pool-error",role:"alert",children:[o.jsx("span",{children:l}),o.jsx("button",{type:"button",onClick:()=>d(m=>m+1),children:"重试"})]}):r?o.jsxs("span",{className:"pp-user-pool-status","aria-live":"polite",children:[o.jsx(bn,{"aria-hidden":"true",className:"pp-user-pool-spinner"}),"正在加载 Identity 用户池…"]}):s.length===0?o.jsx("span",{className:"pp-user-pool-status",children:"当前账号下暂无 Identity 用户池。"}):h!=null&&h.isCurrent?o.jsx("span",{className:"pp-user-pool-status",children:"当前 Studio 的登录 JWT 将透传访问此 Runtime。"}):h?o.jsx("div",{className:"pp-user-pool-error",role:"alert",children:o.jsx("span",{children:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。"})}):o.jsx("span",{className:"pp-user-pool-status",children:"当前 Studio 使用的用户池已在列表中标注。"})]})}const _Ae=[{value:"api_key",label:"API Key",description:"默认方式,使用 Runtime API Key 访问"},{value:"user_pool",label:"用户池",description:"使用 Identity 用户池签发的 JWT"}],SAe={py:"python",pyi:"python",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",env:"ini",txt:"plaintext"},cD={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function uD(e){return e.replace(/&/g,"&").replace(//g,">")}function NAe(e){const n=(e.split("/").pop()??e).toLowerCase();if(cD[n])return cD[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const s=n.lastIndexOf(".");if(s===-1)return null;const i=n.slice(s+1);return SAe[i]??null}function TAe(e,t){try{const n=NAe(t);return n&&mr.getLanguage(n)?mr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?mr.highlightAuto(e).value:uD(e)}catch{return uD(e)}}const kAe=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],AAe=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}],CAe={phase:"update",label:"更新实例配置"},IAe={phase:"evaluation",label:"创建评测集"};function jAe(e){return e?!e.memory.shortTerm||(e.shortTermBackend||"local")==="local":!1}function RAe(e,t){const n=Number(e),s=Number(t);return!e.trim()||!t.trim()||!Number.isSafeInteger(n)||!Number.isSafeInteger(s)||n<1||s<1?{valid:!1,error:"实例数必须为大于 0 的整数。"}:n>s?{valid:!1,error:"最小实例数不能大于最大实例数。"}:{valid:!0,min:n,max:s}}function OAe(e){const t={name:"",children:new Map};for(const n of e){const s=n.path.split("/").filter(Boolean);let i=t;s.forEach((r,a)=>{let l=i.children.get(r);l||(l={name:r,children:new Map},i.children.set(r,l)),a===s.length-1&&(l.path=n.path),i=l})}return t}function MAe(e){return[...e.children.values()].sort((t,n)=>{const s=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return s!==i?s?-1:1:t.name.localeCompare(n.name)})}function LAe(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function DAe({left:e,right:t}){const[n,s]=g.useState(null);return g.useLayoutEffect(()=>{const i=document.getElementById("veadk-page-header-left"),r=document.getElementById("veadk-page-header-actions");i&&r&&s({left:i,right:r})},[]),n?o.jsxs(o.Fragment,{children:[yi.createPortal(e,n.left),yi.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function bE({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:s,agentName:i,agentCount:r,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentActionTargetId:h,deploymentRuntimeId:m,onDeploymentStarted:p,onDeploymentTaskChange:b,feishuEnabled:v=!1,onFeishuEnabledChange:y,deploymentEnv:x=[],deploymentEnvValues:E={},onDeploymentEnvChange:w,network:S,onNetworkChange:_,cloudProvider:k="volcengine",deployRegion:T=Ni(k),onDeployRegionChange:A,deploymentTelemetry:j={source:"unknown",createMode:"unknown",aiAssisted:!1},onBack:R,backLabel:B="返回配置",onExportYaml:z,deploymentPrimaryPane:L,deployDisabled:F=!1}){var on,Yt,_n;const C=typeof l=="function",I=f.includes("更新"),D=jAe(s),[$,O]=g.useState(((Yt=(on=e==null?void 0:e.files)==null?void 0:on[0])==null?void 0:Yt.path)??null),[te,ne]=g.useState(new Set),[P,Q]=g.useState(!1),[ee,V]=g.useState(""),[X,K]=g.useState(!1),[ce,he]=g.useState(!1),[ye,ue]=g.useState(!1),[we,De]=g.useState(!1),[Se,ae]=g.useState(null),[pe,_e]=g.useState(null),[et,Be]=g.useState({}),[Fe,We]=g.useState(null),[Ae,Ke]=g.useState(!1),[Ue,W]=g.useState([]),[oe,Z]=g.useState(!1),Ee=g.useId(),[Oe,at]=g.useState("api_key"),[Lt,ct]=g.useState(""),yn=vx(k),Et=kf(T,k),[vt,xn]=g.useState("1"),[Vt,Ft]=g.useState(D?"1":"5"),[it,dt]=g.useState(!0),[He,St]=g.useState(null),ge=g.useRef(!0),$e=RAe(vt,Vt),nt=!I&&$e.valid&&($e.min!==1||$e.max!==5),$t=L?AAe:kAe,qn=nt?[...$t,CAe]:$t,nn=it?[...qn,IAe]:qn;g.useEffect(()=>{!A||I||yn.some(de=>de.value===T)||A(Ni(k))},[k,T,yn,I,A]),g.useEffect(()=>{if(!h){St(null);return}St(document.getElementById(h))},[h]);const qt=de=>o.jsxs("div",{className:`pp-network-region${oe?" is-open":""}`,onKeyDown:Ie=>{Ie.key==="Escape"&&Z(!1)},children:[de&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":oe,"aria-describedby":I?Ee:void 0,disabled:X||I||!A,onClick:()=>Z(Ie=>!Ie),children:[o.jsx("span",{children:Et}),o.jsx(PB,{className:`pp-region-chevron${oe?" is-open":""}`})]}),oe&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>Z(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:yn.map(Ie=>{const Me=Ie.value===T;return o.jsxs("button",{type:"button",role:"option","aria-selected":Me,className:`pp-region-option${Me?" is-selected":""}`,onClick:()=>{A==null||A(Ie.value),Z(!1)},children:[o.jsx("span",{children:Ie.label}),Me&&o.jsx(Pa,{"aria-hidden":"true"})]},Ie.value)})})]}),I&&o.jsx("span",{id:Ee,className:"pp-region-help",children:"更新时沿用现有 Runtime 的部署区域,无法修改。"})]});g.useEffect(()=>(ge.current=!0,()=>{ge.current=!1}),[]),g.useEffect(()=>{xn("1"),Ft(D?"1":"5")},[D]),g.useEffect(()=>{if(!ye)return;const de=document.body.style.overflow;document.body.style.overflow="hidden";const Ie=Me=>{Me.key==="Escape"&&ue(!1)};return window.addEventListener("keydown",Ie),()=>{document.body.style.overflow=de,window.removeEventListener("keydown",Ie)}},[ye]);const mn=g.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:OAe(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const wt=e.files.find(de=>de.path===$)??null,Bt=(S==null?void 0:S.mode)??"public",Tt=()=>({telemetry:j,action:m?"update":"create",region:T,networkType:Bt,feishuEnabled:v}),En=cAe(v?[...x,...em]:x,E),vn=En.length+Ue.length;function Ht(de){ne(Ie=>{const Me=new Set(Ie);return Me.has(de)?Me.delete(de):Me.add(de),Me})}function os(de,Ie){l&&(l({...e,files:de}),Ie!==void 0&&O(Ie))}function Os(de){wt&&os(e.files.map(Ie=>Ie.path===wt.path?{...Ie,content:de}:Ie))}function Ms(){const de=ee.trim();if(Q(!1),V(""),!!de){if(e.files.some(Ie=>Ie.path===de)){O(de);return}os([...e.files,{path:de,content:""}],de)}}function wn(){if(!wt)return;const de=window.prompt("重命名文件",wt.path),Ie=de==null?void 0:de.trim();!Ie||Ie===wt.path||e.files.some(Me=>Me.path===Ie)||os(e.files.map(Me=>Me.path===wt.path?{...Me,path:Ie}:Me),Ie)}function ls(){var Ie;if(!wt)return;const de=e.files.filter(Me=>Me.path!==wt.path);os(de,((Ie=de[0])==null?void 0:Ie.path)??null)}function Yn(de,Ie){W(Me=>Me.map(Xe=>Xe.id===de?{...Xe,...Ie}:Xe))}function Wn(de){W(Ie=>Ie.filter(Me=>Me.id!==de))}function ri(){W(de=>[...de,LAe()])}function ps(de){_&&_(de==="public"?void 0:{...S??{mode:de},mode:de})}function Ls(de){_==null||_({...S??{mode:"private"},...de})}function Ln(){const de=new Map(Ue.map(Me=>({key:Me.key.trim(),value:Me.value})).filter(Me=>Me.key.length>0).map(Me=>[Me.key,Me.value])),Ie=v?[...x,...em]:x;for(const Me of Wz(Ie,E))de.set(Me.key,Me.value);return[...de].map(([Me,Xe])=>({key:Me,value:Xe}))}async function Ds(){if(!(!y||X||we)){ae(null),De(!0);try{await y(!v)}catch(de){ge.current&&ae(`更新飞书配置失败:${de instanceof Error?de.message:String(de)}`)}finally{ge.current&&De(!1)}}}async function Cn(){var Me;if(!c||X||F)return;if(!$e.valid){ae($e.error);return}if(!I&&Oe==="user_pool"&&!Lt){ae("请选择用于 Runtime 鉴权的用户池。");return}if(Bt!=="public"&&!((Me=S==null?void 0:S.vpcId)!=null&&Me.trim())){ae("使用 VPC 网络时,请填写 VPC ID。");return}const de=rD(x,E);if(de){const Xe=x.find(ot=>ot.key===de.key);ae(`请返回配置页填写 ${(Xe==null?void 0:Xe.comment)||(Xe==null?void 0:Xe.key)}(${Xe==null?void 0:Xe.key})。`);return}const Ie=Xz(x,E);if(Ie){ae(`${Ie.spec.comment||Ie.spec.key}:${Ie.error}`);return}if(v){const Xe=rD(em,E);if(Xe){const ot=em.find(mt=>mt.key===Xe.key);ae(`启用飞书后,请填写${(ot==null?void 0:ot.comment)||(ot==null?void 0:ot.key)}。`);return}}he(!0)}async function Ss(){var Ns;if(!c||X)return;if(!$e.valid){he(!1),ae($e.error);return}he(!1);const de=Ln();ge.current&&(ae(null),_e(null),Be({}),We(null),K(!0));const Ie=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let Me=(i==null?void 0:i.trim())||e.name||"生成中…";const Xe=Date.now(),ot={id:Ie,runtimeName:Me,runtimeId:m,region:T,startedAt:Xe,status:"running",phase:"prepare",label:"准备部署",agentDraft:s,instanceRange:nt?{min:$e.min,max:$e.max}:void 0,createEvaluationSets:it};b==null||b(ot),p==null||p(ot);let mt,bt=ot.phase??"prepare";const $n=en=>mt?{...mt,status:en,updatedAt:Date.now()}:void 0,Le=en=>{const Ut=$n(en);return Ut?{buildLog:Ut}:{}},bs=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),ys=en=>{if(bt!=="build")return;const Ut=["","----- 构建失败 -----",en].join(` -`);return mt=lD(mt,{source:"code-pipeline",status:"error",text:Ut,lineCount:Ut.split(` -`).length,truncated:!1,updatedAt:Date.now()}),mt};try{const en=await c(e,Ut=>{var Oi;Ut.runtimeName&&(Me=Ut.runtimeName),bt=Ut.phase,Ut.buildLog?mt=lD(mt,Ut.buildLog):Ut.phase==="build"&&!mt&&(mt=bs()),ge.current&&(Be(gn=>({...gn,[Ut.phase]:Ut})),We(Ut.phase)),b==null||b({id:Ie,runtimeName:Me,runtimeId:m,region:T,startedAt:Xe,status:"running",phase:Ut.phase,label:((Oi=nn.find(gn=>gn.phase===Ut.phase))==null?void 0:Oi.label)??Ut.phase,message:Ut.message,pct:Ut.pct,...mt?{buildLog:mt}:{}})},{taskId:Ie,sessionStorage:D?"in-memory":"persistent",minInstance:$e.min,maxInstance:$e.max,...I?{}:{authentication:Oe==="user_pool"?{type:"user_pool",userPoolUid:Lt}:{type:"api_key"}},createEvaluationSets:it,...v?{im:{feishu:{enabled:!0}}}:{},envs:de});ge.current&&(_e(en),We(null)),RH({...Tt(),runtimeId:en.runtimeId||m||""}),b==null||b({id:Ie,runtimeName:en.agentName||Me,runtimeId:en.runtimeId||m,region:en.region||T,startedAt:Xe,status:"success",phase:"complete",label:"部署完成",message:(Ns=en.warnings)==null?void 0:Ns.join(";"),...Le("complete")});try{await(d==null?void 0:d(en))}catch(Ut){if(!(Ut instanceof Ir))throw Ut;b==null||b({id:Ie,runtimeName:en.agentName||Me,runtimeId:en.runtimeId||m,region:en.region||T,startedAt:Xe,status:"success",phase:"complete",label:"部署完成,暂未连接",message:Ut.message,...Le("complete")})}}catch(en){const Ut=en instanceof Error?en.message:String(en);if(en instanceof DOMException&&en.name==="AbortError"){ge.current&&(ae(null),We(null)),b==null||b({id:Ie,runtimeName:Me,runtimeId:m,region:T,startedAt:Xe,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...Le("complete")});return}ge.current&&ae(Ut);const Oi=ys(Ut),gn=!!Oi;OH({...Tt(),phase:bt,error:en}),b==null||b({id:Ie,runtimeName:Me,runtimeId:m,region:T,startedAt:Xe,status:"error",phase:bt,label:"部署失败",message:gn?"构建镜像失败,详见构建日志。":Ut,...Oi?{buildLog:Oi}:Le("complete"),retry:Cn})}finally{ge.current&&K(!1)}}function Ps(){he(!1)}async function cs(){if(!(!pe||Ae)){Ke(!0),ae(null);try{const{addConnection:de,addRuntimeConnection:Ie,remoteAppId:Me,loadConnections:Xe}=await au(async()=>{const{addConnection:bt,addRuntimeConnection:$n,remoteAppId:Le,loadConnections:bs}=await Promise.resolve().then(()=>m3);return{addConnection:bt,addRuntimeConnection:$n,remoteAppId:Le,loadConnections:bs}},void 0),{probeRuntimeApps:ot}=await au(async()=>{const{probeRuntimeApps:bt}=await Promise.resolve().then(()=>ene);return{probeRuntimeApps:bt}},void 0);let mt;if(pe.runtimeId){const bt=pe.region??T,$n=await ot(pe.runtimeId,bt,{retryProbe:!0})??[];mt=Ie(pe.runtimeId,pe.agentName,bt,$n,$n.length>0?{[$n[0]]:pe.agentName}:void 0,pe.version)}else mt=await de(pe.agentName,pe.url,pe.apikey,"");if(mt.apps.length===0)ae("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const bt={[mt.apps[0]]:pe.agentName},$n={...mt,appLabels:{...mt.appLabels??{},...bt}},bs=Xe().map(Ns=>Ns.id===mt.id?$n:Ns);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(bs));const{registerConnections:ys}=await au(async()=>{const{registerConnections:Ns}=await Promise.resolve().then(()=>m3);return{registerConnections:Ns}},void 0);if(ys(bs),u){const Ns=Me(mt.id,mt.apps[0]);u(Ns,pe.agentName)}else alert(`🎉 Agent "${pe.agentName}" 已添加到左上角下拉列表!`)}}catch(de){ae(`添加 Agent 失败:${de instanceof Error?de.message:String(de)}`)}finally{Ke(!1)}}}function gs(){const de=Date.now(),Ie=m?"update":"create";try{const Me=fAe(e.files),Xe=URL.createObjectURL(Me),ot=document.createElement("a");ot.href=Xe,ot.download=`${e.name||"project"}.zip`,document.body.appendChild(ot),ot.click(),document.body.removeChild(ot),URL.revokeObjectURL(Xe),wTe({telemetry:j,action:Ie,fileCount:e.files.length,zipSizeBytes:Me.size,durationMs:Date.now()-de})}catch(Me){throw _Te({telemetry:j,action:Ie,fileCount:e.files.length,durationMs:Date.now()-de,error:Me}),Me}}const Dn=o.jsxs("div",{className:`pp-artifact-actions${t?" is-rail":""}`,"aria-label":"发布产物操作",children:[z&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:z,children:[o.jsx(Mee,{className:"pp-ic"}),"导出 YAML"]}),C&&l&&o.jsx(gAe,{project:e,onChange:l,className:"pp-artifact-source",label:"查看源代码"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:gs,children:[o.jsx(bx,{className:"pp-ic"}),"下载源代码"]})]});function pn(de,Ie,Me){return MAe(de).map(Xe=>{const ot=Me?`${Me}/${Xe.name}`:Xe.name,mt=Xe.path!==void 0,bt={paddingLeft:8+Ie*14};if(mt){const Le=Xe.path===$;return o.jsxs("button",{type:"button",className:`pp-row pp-file${Le?" pp-active":""}`,style:bt,onClick:()=>O(Xe.path),title:Xe.path,children:[o.jsx(Pee,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Xe.name})]},ot)}const $n=te.has(ot);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:bt,onClick:()=>Ht(ot),children:[o.jsx(oc,{className:`pp-ic pp-chevron${$n?"":" pp-open"}`}),o.jsx(UB,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:Xe.name})]}),!$n&&pn(Xe,Ie+1,ot)]},ot)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${L?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(DAe,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[R&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:R,children:[o.jsx(Vk,{className:"pp-ic"}),B]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",i||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!L&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:`pp-release-preview${t?" is-embedded":""}`,children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[s&&o.jsx(Kp,{draft:s,direction:"horizontal",selectedPath:[],onSelect:wl,onAdd:wl,onInsert:wl,onDelete:wl,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>ue(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(eu,{"aria-hidden":!0})})]}),t&&Dn,!t&&o.jsxs("div",{className:"pp-release-info",children:[o.jsx("div",{className:"pp-release-card-head",children:"Agent 概览"}),o.jsxs("div",{className:"pp-release-info-body",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:i||e.name||"未命名 Agent"}),(s==null?void 0:s.description)&&o.jsx("p",{className:"pp-release-description",title:s.description,children:s.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:r??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),Dn]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),C&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{Q(!0),V("")},children:o.jsx(Lee,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[P&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:ee,onChange:de=>V(de.target.value),onBlur:Ms,onKeyDown:de=>{de.key==="Enter"&&Ms(),de.key==="Escape"&&(Q(!1),V(""))}}),e.files.length===0&&!P?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):pn(mn,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:wt==null?void 0:wt.path,children:(wt==null?void 0:wt.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:C&&wt&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:wn,children:o.jsx(nte,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:ls,children:o.jsx(lc,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:wt==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):C?o.jsx("div",{className:"pp-codemirror",children:o.jsx(g.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(EAe,{value:wt.content,path:wt.path,onChange:Os})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:TAe(wt.content,wt.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[L,!L&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),qt(!1)]}),!L&&o.jsxs("section",{className:"pp-config-section pp-auth-section",children:[o.jsx("div",{className:"pp-config-label",children:"访问鉴权"}),I?o.jsx("p",{className:"pp-config-note pp-auth-preserved-note",children:"更新时保持现有 Runtime 的鉴权方式不变。"}):o.jsxs("div",{className:"pp-auth-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"鉴权方式"}),o.jsx(Zz,{ariaLabel:"部署鉴权方式",value:Oe,placeholder:"请选择鉴权方式",options:_Ae,disabled:X,onChange:de=>{ae(null),at(de)}})]}),Oe==="user_pool"&&o.jsxs("label",{children:[o.jsx("span",{children:"用户池"}),o.jsx(wAe,{value:Lt,disabled:X,onChange:de=>{ae(null),ct(de)}})]})]})]}),!L&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${v?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":v,"aria-hidden":v,tabIndex:v?-1:0,onClick:()=>void Ds(),disabled:v||X||we||!y,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:_A,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:we?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!v,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:v?0:-1,onClick:()=>void Ds(),disabled:!v||X||we||!y,children:we?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:em.map(de=>o.jsxs("label",{children:[o.jsxs("span",{children:[de.comment||de.key,de.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:de.key.includes("SECRET")?"password":"text",value:E[de.key]??"",placeholder:de.placeholder,tabIndex:v?0:-1,disabled:!v||X||!w,autoComplete:"off",onChange:Ie=>w==null?void 0:w(de.key,Ie.currentTarget.value)})]},de.key))})]})]})})]}),!I&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"实例设置"}),o.jsxs("div",{className:"pp-instance-fields",children:[o.jsxs("label",{htmlFor:"runtime-min-instance",children:[o.jsx("span",{children:"最小实例数"}),o.jsx("input",{id:"runtime-min-instance",type:"number",min:"1",step:"1",inputMode:"numeric",value:vt,disabled:X,"aria-invalid":!$e.valid,onChange:de=>xn(de.currentTarget.value)})]}),o.jsxs("label",{htmlFor:"runtime-max-instance",children:[o.jsx("span",{children:"最大实例数"}),o.jsx("input",{id:"runtime-max-instance",type:"number",min:"1",step:"1",inputMode:"numeric",value:Vt,disabled:X,"aria-invalid":!$e.valid,onChange:de=>Ft(de.currentTarget.value)})]})]}),D&&o.jsx("p",{className:"pp-instance-note",role:"note",children:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1"}),!$e.valid&&o.jsx("p",{className:"pp-instance-error",role:"alert",children:$e.error})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),L&&qt(!0),I&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(de=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:de,checked:Bt===de,onChange:()=>ps(de),disabled:X||I||!_}),o.jsx("span",{children:de==="public"?"公网":de==="private"?"VPC":"公网 + VPC"})]},de))}),Bt!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(S==null?void 0:S.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:X||I,onChange:de=>Ls({vpcId:de.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(S==null?void 0:S.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:X||I,onChange:de=>Ls({subnetIds:de.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(S!=null&&S.enableSharedInternetAccess),disabled:X||I,onChange:de=>Ls({enableSharedInternetAccess:de.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"评测集"}),o.jsxs("label",{className:"pp-evaluation-set-option",children:[o.jsx("input",{type:"checkbox",checked:it,disabled:X,onChange:de=>dt(de.currentTarget.checked)}),o.jsxs("span",{children:[o.jsx("strong",{children:"自动创建评测集"}),o.jsx("small",{children:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。"})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsx("div",{className:"pp-env-head",children:o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[vn," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]})}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:ri,disabled:X,children:[o.jsx(Ii,{className:"pp-ic"}),"添加变量"]}),(En.length>0||Ue.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[En.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[En.length," 项"]})]}),En.map(de=>{const Ie=de.key.startsWith("ENABLE_"),Me=qA(de,E),Xe=de.multiline||de.format==="json";return o.jsxs("div",{className:`pp-env-row pp-env-row-derived${Xe?" is-multiline":""}`,children:[o.jsxs("div",{className:"pp-env-key-fixed pp-env-key-cell","aria-label":`${de.key} 环境变量名`,"aria-disabled":X,children:[o.jsx("span",{title:de.key,children:de.key}),(de.help||de.comment)&&o.jsxs("span",{className:"pp-env-help",tabIndex:0,"data-help":de.help||de.comment,"aria-label":`${de.key}说明:${de.help||de.comment}`,children:["?",o.jsx("span",{className:"pp-env-help-popover",role:"tooltip",children:de.help||de.comment})]}),de.link&&o.jsx("a",{className:"pp-env-link",href:de.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开 OpenViking ${de.link.label}`,"aria-label":`${de.key}:打开 OpenViking ${de.link.label}`,children:o.jsx(Op,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"pp-env-value-wrap",children:[Xe?o.jsx("textarea",{className:"pp-env-value pp-env-json-value",value:de.value,placeholder:de.required?"必填,尚未填写":"可选,尚未填写",readOnly:Ie,disabled:X||!Ie&&!w,autoComplete:"off",spellCheck:!1,"aria-invalid":!!Me,"aria-label":`${de.key} 环境变量值`,onChange:ot=>w==null?void 0:w(de.key,ot.currentTarget.value)}):o.jsx("input",{className:"pp-env-value",type:"text",value:de.value,placeholder:de.required?"必填,尚未填写":"可选,尚未填写",readOnly:Ie,disabled:X||!Ie&&!w,autoComplete:"off","aria-invalid":!!Me,"aria-label":`${de.key} 环境变量值`,onChange:ot=>w==null?void 0:w(de.key,ot.currentTarget.value)}),Me&&o.jsx("span",{className:"pp-env-error",children:Me})]}),o.jsx("span",{className:"pp-env-source",children:Ie?"自动":"同步"})]},de.key)})]}),Ue.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[Ue.length," 项"]})]}),Ue.map(de=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:de.key,placeholder:"名称",disabled:X,autoComplete:"off",onChange:Ie=>Yn(de.id,{key:Ie.currentTarget.value})}),o.jsx("input",{type:"text",value:de.value,placeholder:"值",disabled:X,autoComplete:"off",onChange:Ie=>Yn(de.id,{value:Ie.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:X,onClick:()=>Wn(de.id),children:o.jsx(Ri,{className:"pp-ic"})})]},de.id))]})]}),(X||pe||Object.keys(et).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:nn.map((de,Ie)=>{const Me=Fe?nn.findIndex(bt=>bt.phase===Fe):-1,Xe=!!Se&&(Me===-1?Ie===0:Ie===Me);let ot;pe?ot="done":Xe?ot="failed":Me===-1?ot=X?"active":"pending":Iede.phase===Fe))==null?void 0:_n.label)??Fe}阶段):`:""}${Se}`,onRetry:Cn,retryLabel:I?"重试更新":"重试部署"}),pe&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:I?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[pe.warnings&&pe.warnings.length>0&&o.jsx("div",{className:"pp-deploy-result-warning",role:"status",children:pe.warnings.map(de=>o.jsx("span",{children:de},de))}),pe.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:kf(pe.region,k)})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:pe.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:pe.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:cs,disabled:Ae,children:[Ae?o.jsx(bn,{className:"pp-ic spin"}):o.jsx(HB,{className:"pp-ic"}),Ae?"连接中…":"立即对话"]}),pe.consoleUrl&&o.jsxs("a",{href:pe.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(Op,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:`pp-config-actions${He?" is-external":""}`,children:He?yi.createPortal(o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Cn,disabled:X||we||F||!!n,title:n,children:X?`${f}中…`:Se?`重试${f}`:f}),He):o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Cn,disabled:X||we||F||!!n,title:n,children:X?`${f}中…`:Se?`重试${f}`:f})})]})]}),ye&&s&&yi.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:de=>{de.target===de.currentTarget&&ue(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>ue(!1),"aria-label":"关闭执行流程预览",children:o.jsx(Ri,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(Kp,{draft:s,direction:"horizontal",selectedPath:[],onSelect:wl,onAdd:wl,onInsert:wl,onDelete:wl,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(vAe,{open:ce,isUpdate:I,onCancel:Ps,onConfirm:()=>void Ss()})]})}const dD="dogfooding",Jw="dogfooding",e_="dogfooding_b";let PAe=0;const t_=()=>++PAe;function fD(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function BAe(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function hD(e,t="volcengine"){const n=[],s=BAe(e);n.push(s);const i=s.indexOf("{"),r=s.lastIndexOf("}");i>=0&&r>i&&n.push(s.slice(i,r+1));for(const a of n)try{const l=JSON.parse(a);if(l&&typeof l=="object"&&(typeof l.name=="string"||typeof l.instruction=="string"))return await Tx(GA({...l,cloudProvider:t}))}catch{}return null}function UAe({userId:e,cloudProvider:t="volcengine",onBack:n,onCreate:s,onAgentAdded:i,onDeploymentTaskChange:r}){const[a,l]=g.useState([{id:t_(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[c,u]=g.useState(""),[d,f]=g.useState(!1),[h,m]=g.useState(null),[p,b]=g.useState(null),[v,y]=g.useState(!1),[x,E]=g.useState(null),[w,S]=g.useState(null),[_,k]=g.useState(!1),[T,A]=g.useState(!1),[j,R]=g.useState({}),B=g.useRef(null),z=g.useRef(null),L=g.useRef(null),F=g.useRef(null),C=g.useRef(null);g.useEffect(()=>{const V=F.current;V&&V.scrollTo({top:V.scrollHeight,behavior:"smooth"})},[a,d]),g.useEffect(()=>{const V=C.current;V&&(V.style.height="auto",V.style.height=Math.min(V.scrollHeight,160)+"px")},[c]);const I=V=>l(X=>[...X,{id:t_(),role:"assistant",text:V}]);async function D(){if(B.current)return B.current;const V=await r1(dD,e);return B.current=V,V}async function $(V,X){if(X.current)return X.current;const K=await r1(V,e);return X.current=K,K}async function O(V,X){if(!j[V])try{const K=await d2(X);R(ce=>({...ce,[V]:K.model||X}))}catch{R(K=>({...K,[V]:X}))}}async function te(V,X,K){const ce=await $(V,X);let he=Aa();for await(const ue of Mp({appName:V,userId:e,sessionId:ce,text:K}))he=Af(he,ue);const ye=fD(he).trim();return{project:await hD(ye,t),finalText:ye}}const ne=async(V,X,K)=>Sg(V.name,V.files,{region:"cn-beijing",projectName:"default"},{...K,onStage:X}),P=async()=>{const V=c.trim();if(!(!V||d)){if(l(X=>[...X,{id:t_(),role:"user",text:V}]),u(""),m(null),f(!0),v){E(null),S(null),k(!0),A(!0),O("a",Jw),O("b",e_);const X=te(Jw,z,V).then(({project:ce})=>(E(ce),ce)).catch(ce=>{const he=ce instanceof Error?ce.message:String(ce);return m(he),null}).finally(()=>k(!1)),K=te(e_,L,V).then(({project:ce})=>(S(ce),ce)).catch(ce=>{const he=ce instanceof Error?ce.message:String(ce);return m(he),null}).finally(()=>A(!1));try{const[ce,he]=await Promise.all([X,K]),ye=[ce?`方案 A:${ce.name}`:null,he?`方案 B:${he.name}`:null].filter(Boolean);ye.length?I(`已生成两个方案(${ye.join(",")}),请在右侧对比后采用其一。`):I("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{f(!1)}return}try{const X=await D();let K=Aa();for await(const ye of Mp({appName:dD,userId:e,sessionId:X,text:V}))K=Af(K,ye);const ce=fD(K).trim(),he=await hD(ce,t);he?(b(he),I(`已生成项目:${he.name}(${he.files.length} 个文件),可在右侧预览和编辑。`)):I(ce||"(助手没有返回内容,请再描述一下你的需求。)")}catch(X){const K=X instanceof Error?X.message:String(X);m(K),I(`抱歉,调用智能构建助手失败:${K}`)}finally{f(!1)}}},Q=V=>{const X=V==="a"?x:w;if(!X)return;b(X),y(!1),E(null),S(null),k(!1),A(!1);const K=V==="a"?"A":"B",ce=V==="a"?j.a:j.b;I(`已采用方案 ${K}(${ce??(V==="a"?Jw:e_)}),可继续编辑。`)},ee=V=>{V.key==="Enter"&&!V.shiftKey&&!V.nativeEvent.isComposing&&(V.preventDefault(),P())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:F,children:[o.jsx(Bo,{initial:!1,children:a.map(V=>o.jsxs(ss.div,{className:`ic-turn ic-turn--${V.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[V.role==="assistant"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(fu,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:V.role==="assistant"?o.jsx(gh,{text:V.text}):V.text})]},V.id))}),d&&o.jsxs(ss.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(fu,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),h&&o.jsxs("div",{className:"ic-error",children:[o.jsx(Gk,{className:"ic-error-icon"}),h]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:C,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:c,onChange:V=>u(V.target.value),onKeyDown:ee,disabled:d}),o.jsx("button",{className:"ic-send",onClick:()=>void P(),disabled:!c.trim()||d,title:"发送 (Enter)",children:o.jsx(ote,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:v,disabled:d,onChange:V=>y(V.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:v?o.jsxs("div",{className:"ic-compare",children:[o.jsx(mD,{side:"a",project:x,loading:_,model:j.a,onAdopt:()=>Q("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(mD,{side:"b",project:w,loading:T,model:j.b,onAdopt:()=>Q("b")})]}):p?o.jsx(bE,{project:p,onChange:b,onDeploy:ne,onAgentAdded:i,onDeploymentTaskChange:r,deploymentTelemetry:{source:"scratch",createMode:"intelligent",aiAssisted:!0}}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(Uee,{className:"ic-preview-empty-glyph"}),o.jsx(hu,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function mD({side:e,project:t,loading:n,model:s,onAdopt:i}){const r=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:r}),s&&o.jsx("span",{className:"ic-pane-model",children:s})]}),o.jsxs("button",{className:"ic-adopt",onClick:i,disabled:!t||n,title:`采用${r}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx(bn,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(bE,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}var FAe=Object.defineProperty,YA=(e,t)=>FAe(e,"name",{value:t,configurable:!0});function zN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}YA(zN,"setRef");function Jz(...e){return t=>{let n=!1;const s=e.map(i=>{const r=zN(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i$Ae(e,"name",{value:t,configurable:!0});function Kf(e){const t=g.forwardRef((n,s)=>{let{children:i,...r}=n,a=null,l=!1;const c=[];VN(i)&&typeof Eb=="function"&&(i=Eb(i._payload)),g.Children.forEach(i,h=>{var m;if(sV(h)){l=!0;const p=h;let b="child"in p.props?p.props.child:p.props.children;VN(b)&&typeof Eb=="function"&&(b=Eb(b._payload)),a=zAe(p,b),c.push((m=a==null?void 0:a.props)==null?void 0:m.children)}else c.push(h)}),a?a=g.cloneElement(a,void 0,c):!l&&g.Children.count(i)===1&&g.isValidElement(i)&&(a=i);const u=a?nV(a):void 0,d=pr(s,u);if(!a){if(i||i===0)throw new Error(l?KAe(e):GAe(e));return i}const f=tV(r,a.props??{});return a.type!==g.Fragment&&(f.ref=s?d:u),g.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}$a(Kf,"createSlot");var eV=Symbol.for("radix.slottable");function HAe(e){const t=$a(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=eV,t}$a(HAe,"createSlottable");var zAe=$a((e,t)=>{if("child"in e.props){const n=e.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,e.props.children(n.props.children)):null}return g.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function tV(e,t){const n={...t};for(const s in t){const i=e[s],r=t[s];/^on[A-Z]/.test(s)?i&&r?n[s]=(...l)=>{const c=r(...l);return i(...l),c}:i&&(n[s]=i):s==="style"?n[s]={...i,...r}:s==="className"&&(n[s]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}$a(tV,"mergeProps");function nV(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}$a(nV,"getElementRef");function sV(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eV}$a(sV,"isSlottable");var VAe=Symbol.for("react.lazy");function VN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===VAe&&"_payload"in e&&iV(e._payload)}$a(VN,"isLazyComponent");function iV(e){return typeof e=="object"&&e!==null&&"then"in e}$a(iV,"isPromiseLike");var GAe=$a(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),KAe=$a(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Eb=Wf[" use ".trim().toString()],qAe=Object.defineProperty,YAe=(e,t)=>qAe(e,"name",{value:t,configurable:!0}),WAe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ca=WAe.reduce((e,t)=>{const n=Kf(`Primitive.${t}`),s=g.forwardRef((i,r)=>{const{asChild:a,...l}=i,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:r})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function XAe(e,t){e&&yi.flushSync(()=>e.dispatchEvent(t))}YAe(XAe,"dispatchDiscreteCustomEvent");var QAe=Object.defineProperty,sa=(e,t)=>QAe(e,"name",{value:t,configurable:!0});function ZAe(e,t){const n=g.createContext(t);n.displayName=e+"Context";const s=sa(r=>{const{children:a,...l}=r,c=g.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:a})},"Provider");s.displayName=e+"Provider";function i(r,a={}){const{optional:l=!1}=a,c=g.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${r}\` must be used within \`${e}\``)}return sa(i,"useContext"),[s,i]}sa(ZAe,"createContext");function yc(e,t=[]){let n=[];function s(r,a){const l=g.createContext(a);l.displayName=r+"Context";const c=n.length;n=[...n,a];const u=sa(f=>{var y;const{scope:h,children:m,...p}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=g.useMemo(()=>p,Object.values(p));return o.jsx(b.Provider,{value:v,children:m})},"Provider");u.displayName=r+"Provider";function d(f,h,m={}){var y;const{optional:p=!1}=m,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=g.useContext(b);if(v)return v;if(a!==void 0)return a;if(!p)throw new Error(`\`${f}\` must be used within \`${r}\``)}return sa(d,"useContext"),[u,d]}sa(s,"createContext");const i=sa(()=>{const r=n.map(a=>g.createContext(a));return sa(function(l){const c=(l==null?void 0:l[e])||r;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return i.scopeName=e,[s,rV(i,...t)]}sa(yc,"createContextScope");function rV(...e){const t=e[0];if(e.length===1)return t;const n=sa(()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return sa(function(r){const a=s.reduce((l,{useScope:c,scopeName:u})=>{const f=c(r)[`__scope${u}`];return{...l,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}sa(rV,"composeContextScopes");var JAe=Object.defineProperty,pi=(e,t)=>JAe(e,"name",{value:t,configurable:!0});function aV(e){const t=e+"CollectionProvider",[n,s]=yc(t),[i,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=pi(b=>{const{scope:v,children:y}=b,x=g.useRef(null),E=g.useRef(new Map).current;return o.jsx(i,{scope:v,itemMap:E,collectionRef:x,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=Kf(l),u=g.forwardRef((b,v)=>{const{scope:y,children:x}=b,E=r(l,y),w=pr(v,E.collectionRef);return o.jsx(c,{ref:w,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Kf(d),m=g.forwardRef((b,v)=>{const{scope:y,children:x,...E}=b,w=g.useRef(null),S=pr(v,w),_=r(d,y);return g.useEffect(()=>(_.itemMap.set(w,{ref:w,...E}),()=>void _.itemMap.delete(w))),o.jsx(h,{[f]:"",ref:S,children:x})});m.displayName=d;function p(b){const v=r(e+"CollectionConsumer",b);return g.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const E=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((_,k)=>E.indexOf(_.ref.current)-E.indexOf(k.ref.current))},[v.collectionRef,v.itemMap])}return pi(p,"useCollection"),[{Provider:a,Slot:u,ItemSlot:m},p,s]}pi(aV,"createCollection");var pD=new WeakMap,Qs,Nr,n_=(Nr=class extends Map{constructor(n){super(n);GC(this,Qs);ZE(this,Qs,[...super.keys()]),pD.set(this,!0)}set(n,s){return pD.get(this)&&(this.has(n)?Pi(this,Qs)[Pi(this,Qs).indexOf(n)]=n:Pi(this,Qs).push(n)),super.set(n,s),this}insert(n,s,i){const r=this.has(s),a=Pi(this,Qs).length,l=WA(n);let c=l>=0?l:a+l;const u=c<0||c>=a?-1:c;if(u===this.size||r&&u===this.size-1||u===-1)return this.set(s,i),this;const d=this.size+(r?0:1);l<0&&c++;const f=[...Pi(this,Qs)];let h,m=!1;for(let p=c;p=this.size&&(r=this.size-1),this.at(r)}keyFrom(n,s){const i=this.indexOf(n);if(i===-1)return;let r=i+s;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(n,s){let i=0;for(const r of this){if(Reflect.apply(n,s,[r,i,this]))return r;i++}}findIndex(n,s){let i=0;for(const r of this){if(Reflect.apply(n,s,[r,i,this]))return i;i++}return-1}filter(n,s){const i=[];let r=0;for(const a of this)Reflect.apply(n,s,[a,r,this])&&i.push(a),r++;return new Nr(i)}map(n,s){const i=[];let r=0;for(const a of this)i.push([a[0],Reflect.apply(n,s,[a,r,this])]),r++;return new Nr(i)}reduce(...n){const[s,i]=n;let r=0,a=i??this.at(0);for(const l of this)r===0&&n.length===1?a=l:a=Reflect.apply(s,this,[a,l,r,this]),r++;return a}reduceRight(...n){const[s,i]=n;let r=i??this.at(-1);for(let a=this.size-1;a>=0;a--){const l=this.at(a);a===this.size-1&&n.length===1?r=l:r=Reflect.apply(s,this,[r,l,a,this])}return r}toSorted(n){const s=[...this.entries()].sort(n);return new Nr(s)}toReversed(){const n=new Nr;for(let s=this.size-1;s>=0;s--){const i=this.keyAt(s),r=this.get(i);n.set(i,r)}return n}toSpliced(...n){const s=[...this.entries()];return s.splice(...n),new Nr(s)}slice(n,s){const i=new Nr;let r=this.size-1;if(n===void 0)return i;n<0&&(n=n+this.size),s!==void 0&&s>0&&(r=s-1);for(let a=n;a<=r;a++){const l=this.keyAt(a),c=this.get(l);i.set(l,c)}return i}every(n,s){let i=0;for(const r of this){if(!Reflect.apply(n,s,[r,i,this]))return!1;i++}return!0}some(n,s){let i=0;for(const r of this){if(Reflect.apply(n,s,[r,i,this]))return!0;i++}return!1}},Qs=new WeakMap,pi(Nr,"OrderedDict"),Nr);function my(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=oV(e,t);return n===-1?void 0:e[n]}pi(my,"at");function oV(e,t){const n=e.length,s=WA(t),i=s>=0?s:n+s;return i<0||i>=n?-1:i}pi(oV,"toSafeIndex");function WA(e){return e!==e||e===0?0:Math.trunc(e)}pi(WA,"toSafeInteger");function eCe(e){const t=e+"CollectionProvider",[n,s]=yc(t),[i,r]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new n_,setItemMap:pi(()=>{},"setItemMap")}),a=pi(({state:E,...w})=>E?o.jsx(c,{...w,state:E}):o.jsx(l,{...w}),"CollectionProvider");a.displayName=t;const l=pi(E=>{const w=v();return o.jsx(c,{...E,state:w})},"CollectionInit");l.displayName=t+"Init";const c=pi(E=>{const{scope:w,children:S,state:_}=E,k=g.useRef(null),[T,A]=g.useState(null),j=pr(k,A),[R,B]=_;return g.useEffect(()=>{if(!T)return;const z=uV(()=>{});return z.observe(T,{childList:!0,subtree:!0}),()=>{z.disconnect()}},[T]),o.jsx(i,{scope:w,itemMap:R,setItemMap:B,collectionRef:j,collectionRefObject:k,collectionElement:T,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Kf(u),f=g.forwardRef((E,w)=>{const{scope:S,children:_}=E,k=r(u,S),T=pr(w,k.collectionRef);return o.jsx(d,{ref:T,children:_})});f.displayName=u;const h=e+"CollectionItemSlot",m="data-radix-collection-item",p=Kf(h),b=g.forwardRef((E,w)=>{const{scope:S,children:_,...k}=E,T=g.useRef(null),[A,j]=g.useState(null),R=pr(w,T,j),B=r(h,S),{setItemMap:z}=B,L=g.useRef(k);lV(L.current,k)||(L.current=k);const F=L.current;return g.useEffect(()=>{const C=F;return z(I=>A?I.has(A)?I.set(A,{...C,element:A}).toSorted(GN):(I.set(A,{...C,element:A}),I.toSorted(GN)):I),()=>{z(I=>!A||!I.has(A)?I:(I.delete(A),new n_(I)))}},[A,F,z]),o.jsx(p,{[m]:"",ref:R,children:_})});b.displayName=h;function v(){return g.useState(new n_)}pi(v,"useInitCollection");function y(E){const{itemMap:w}=r(e+"CollectionConsumer",E);return w}return pi(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:s,useCollection:y,useInitCollection:v}]}pi(eCe,"createCollection");function lV(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}pi(lV,"shallowEqual");function cV(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}pi(cV,"isElementPreceding");function GN(e,t){return!e[1].element||!t[1].element?0:cV(e[1].element,t[1].element)?-1:1}pi(GN,"sortByDocumentPosition");function uV(e){return new MutationObserver(n=>{for(const s of n)if(s.type==="childList"){e();return}})}pi(uV,"getChildListObserver");var tCe=Object.defineProperty,Sh=(e,t)=>tCe(e,"name",{value:t,configurable:!0}),dV=!!(typeof window<"u"&&window.document&&window.document.createElement);function er(e,t,{checkForDefaultPrevented:n=!0}={}){return Sh(function(i){if(e==null||e(i),n===!1||!i||!i.defaultPrevented)return t==null?void 0:t(i)},"handleEvent")}Sh(er,"composeEventHandlers");function nCe(e){var t;if(!dV)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}Sh(nCe,"getOwnerWindow");function KN(e){if(!dV)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}Sh(KN,"getOwnerDocument");function fV(e,t=!1){const{activeElement:n}=KN(e);if(!(n!=null&&n.nodeName))return null;if(hV(n)&&n.contentDocument)return fV(n.contentDocument.body,t);if(t){const s=n.getAttribute("aria-activedescendant");if(s){const i=KN(n).getElementById(s);if(i)return i}}return n}Sh(fV,"getActiveElement");function hV(e){return e.tagName==="IFRAME"}Sh(hV,"isFrame");var wu=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},sCe=Object.defineProperty,iCe=(e,t)=>sCe(e,"name",{value:t,configurable:!0}),gD=Wf[" useEffectEvent ".trim().toString()],bD=Wf[" useInsertionEffect ".trim().toString()];function mV(e){if(typeof gD=="function")return gD(e);const t=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof bD=="function"?bD(()=>{t.current=e}):wu(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}iCe(mV,"useEffectEvent");var rCe=Object.defineProperty,Yg=(e,t)=>rCe(e,"name",{value:t,configurable:!0}),aCe=Wf[" useInsertionEffect ".trim().toString()]||wu;function Pu({prop:e,defaultProp:t,onChange:n=Yg(()=>{},"onChange"),caller:s}){const[i,r,a]=pV({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i,u=g.useCallback(d=>{var f;if(l){const h=gV(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else r(d)},[l,e,r,a]);return[c,u]}Yg(Pu,"useControllableState");function pV({defaultProp:e,onChange:t}){const[n,s]=g.useState(e),i=g.useRef(n),r=g.useRef(t);return aCe(()=>{r.current=t},[t]),g.useEffect(()=>{var a;i.current!==n&&((a=r.current)==null||a.call(r,n),i.current=n)},[n,i]),[n,s,r]}Yg(pV,"useUncontrolledState");function gV(e){return typeof e=="function"}Yg(gV,"isFunction");var yD=Symbol("RADIX:SYNC_STATE");function oCe(e,t,n,s){const{prop:i,defaultProp:r,onChange:a,caller:l}=t,c=i!==void 0,u=mV(a),d=[{...n,state:r}];s&&d.push(s);const[f,h]=g.useReducer((v,y)=>{if(y.type===yD)return{...v,state:y.state};const x=e(v,y);return c&&!Object.is(x.state,v.state)&&u(x.state),x},...d),m=f.state,p=g.useRef(m);g.useEffect(()=>{p.current!==m&&(p.current=m,c||u(m))},[m,p,c]);const b=g.useMemo(()=>i!==void 0?{...f,state:i}:f,[f,i]);return g.useEffect(()=>{c&&!Object.is(i,f.state)&&h({type:yD,state:i})},[i,f.state,c]),[b,h]}Yg(oCe,"useControllableStateReducer");var lCe=Object.defineProperty,nl=(e,t)=>lCe(e,"name",{value:t,configurable:!0});function bV(e,t){return g.useReducer((n,s)=>t[n][s]??n,e)}nl(bV,"useStateMachine");var yV=nl(e=>{const{present:t,children:n}=e,s=xV(t),i=typeof n=="function"?n({present:s.isPresent}):g.Children.only(n),r=EV(s.ref,vV(i));return typeof n=="function"||s.isPresent?g.cloneElement(i,{ref:r}):null},"Presence");function xV(e){const[t,n]=g.useState(),s=g.useRef(null),i=g.useRef(e),r=g.useRef("none"),a=g.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=bV(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(r.current=a.current??vd(s.current),a.current=void 0):r.current="none"},[c]),wu(()=>{const d=s.current,f=i.current;if(f!==e){const m=r.current,p=vd(d);e?(a.current=p,u("MOUNT")):p==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),wu(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=nl(p=>{const v=vd(s.current).includes(CSS.escape(p.animationName));if(p.target===t&&v&&(u("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),m=nl(p=>{p.target===t&&(r.current=vd(s.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(d=>{if(d){const f=getComputedStyle(d);s.current=f,a.current=vd(f)}else s.current=null;n(d)},[])}}nl(xV,"usePresence");function qN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}nl(qN,"setRef");function EV(...e){const t=g.useRef(e);return t.current=e,g.useCallback(n=>{const s=t.current;let i=!1;const r=s.map(a=>{const l=qN(a,n);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let a=0;acCe(e,"name",{value:t,configurable:!0}),dCe=Wf[" useId ".trim().toString()]||(()=>{}),fCe=0;function wV(e){const[t,n]=g.useState(dCe());return wu(()=>{e||n(s=>s??String(fCe++))},[e]),e||(t?`radix-${t}`:"")}uCe(wV,"useId");var hCe=Object.defineProperty,mCe=(e,t)=>hCe(e,"name",{value:t,configurable:!0}),pCe=g.createContext(void 0);function yE(e){const t=g.useContext(pCe);return e||t||"ltr"}mCe(yE,"useDirection");var gCe=Object.defineProperty,bCe=(e,t)=>gCe(e,"name",{value:t,configurable:!0});function _V(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}bCe(_V,"useCallbackRef");var yCe=Object.defineProperty,xCe=(e,t)=>yCe(e,"name",{value:t,configurable:!0});function XA(e){const[t,n]=g.useState(void 0);return wu(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const r=i[0];let a,l;if("borderBoxSize"in r){const c=r.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}xCe(XA,"useSize");var ECe=Object.defineProperty,sl=(e,t)=>ECe(e,"name",{value:t,configurable:!0}),QA="Checkbox",[vCe,uLe]=yc(QA),[wCe,ZA]=vCe(QA);function SV(e){const{__scopeCheckbox:t,checked:n,children:s,defaultChecked:i,disabled:r,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=Pu({prop:n,defaultProp:i??!1,onChange:c,caller:QA}),[p,b]=g.useState(null),[v,y]=g.useState(null),x=g.useRef(!1),[E,w]=g.useReducer(k=>k+1,0),S=p?!!a||!!p.closest("form"):!0,_={checked:h,disabled:r,setChecked:m,control:p,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:E,onUserInteraction:w,required:u,defaultChecked:qo(i)?!1:i,isFormControl:S,bubbleInput:v,setBubbleInput:y};return o.jsx(wCe,{scope:t,..._,children:NV(f)?f(_):s})}sl(SV,"CheckboxProvider");var _Ce="CheckboxTrigger",SCe=g.forwardRef(sl(function({__scopeCheckbox:t,onKeyDown:n,onClick:s,...i},r){const{control:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,onUserInteraction:p,isFormControl:b,bubbleInput:v}=ZA(_Ce,t),y=pr(r,f),x=g.useRef(u);return g.useEffect(()=>{const E=a==null?void 0:a.form;if(E){const w=sl(()=>h(x.current),"reset");return E.addEventListener("reset",w),()=>E.removeEventListener("reset",w)}},[a,h]),o.jsx(ca.button,{type:"button",role:"checkbox","aria-checked":qo(u)?"mixed":u,"aria-required":d,"data-state":JA(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onKeyDown:er(n,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:er(s,E=>{p(),h(w=>qo(w)?!0:!w),v&&b&&(m.current=E.isPropagationStopped(),m.current||E.stopPropagation())})})},"CheckboxTrigger")),NCe=g.forwardRef(sl(function(t,n){const{__scopeCheckbox:s,name:i,checked:r,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(SV,{__scopeCheckbox:s,checked:r,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:i,form:f,value:u,internal_do_not_use_render:({isFormControl:m})=>o.jsxs(o.Fragment,{children:[o.jsx(SCe,{...h,ref:n,__scopeCheckbox:s}),m&&o.jsx(CCe,{__scopeCheckbox:s})]})})},"Checkbox")),TCe="CheckboxIndicator",kCe=g.forwardRef(sl(function(t,n){const{__scopeCheckbox:s,forceMount:i,...r}=t,a=ZA(TCe,s);return o.jsx(yV,{present:i||qo(a.checked)||a.checked===!0,children:o.jsx(ca.span,{"data-state":JA(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),ACe="CheckboxBubbleInput",CCe=g.forwardRef(sl(function({__scopeCheckbox:t,onClick:n,...s},i){const{control:r,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:m,form:p,bubbleInput:b,setBubbleInput:v}=ZA(ACe,t),y=pr(i,v),x=XA(r),E=g.useRef(!1),w=g.useRef(c),S=g.useRef(l);g.useEffect(()=>{const k=b;if(!k)return;const T=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(T,"checked").set,R=l!==S.current;S.current=l;const B=w.current!==c;w.current=c;const z=!(R&&a.current);if(B&&j){E.current=!R;const L=new Event("click",{bubbles:z});k.indeterminate=qo(c),j.call(k,qo(c)?!1:c),k.dispatchEvent(L),E.current=!1}},[b,c,a,l]);const _=g.useRef(qo(c)?!1:c);return o.jsx(ca.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??_.current,required:d,disabled:f,name:h,value:m,form:p,...s,tabIndex:-1,ref:y,onClick:er(n,k=>{E.current&&k.stopPropagation()}),style:{...s.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function NV(e){return typeof e=="function"}sl(NV,"isFunction");function qo(e){return e==="indeterminate"}sl(qo,"isIndeterminate");function JA(e){return qo(e)?"indeterminate":e?"checked":"unchecked"}sl(JA,"getState");var ICe=Object.defineProperty,eC=(e,t)=>ICe(e,"name",{value:t,configurable:!0}),s_=!1;function TV(){const[e,t]=g.useState(s_);return g.useEffect(()=>{s_||(s_=!0,t(!0))},[]),e}eC(TV,"useIsHydrated");var kV=Wf[" useSyncExternalStore ".trim().toString()];function AV(){return()=>{}}eC(AV,"subscribe");function CV(){return kV(AV,()=>!0,()=>!1)}eC(CV,"useIsHydratedModern");var jCe=typeof kV=="function"?CV:TV,RCe=Object.defineProperty,Bu=(e,t)=>RCe(e,"name",{value:t,configurable:!0}),i_="rovingFocusGroup.onEntryFocus",OCe={bubbles:!1,cancelable:!0},xE="RovingFocusGroup",[YN,IV,MCe]=aV(xE),[LCe,EE]=yc(xE,[MCe]),[DCe,PCe]=LCe(xE),BCe=g.forwardRef(Bu(function(t,n){return o.jsx(YN.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(YN.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(UCe,{...t,ref:n})})})},"RovingFocusGroup")),UCe=g.forwardRef(Bu(function(t,n){const{__scopeRovingFocusGroup:s,orientation:i,loop:r=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,m=g.useRef(null),p=pr(n,m),b=yE(a),[v,y]=Pu({prop:l,defaultProp:c??null,onChange:u,caller:xE}),[x,E]=g.useState(!1),w=_V(d),S=IV(s),_=g.useRef(!1),[k,T]=g.useState(0);return g.useEffect(()=>{const A=m.current;if(A)return A.addEventListener(i_,w),()=>A.removeEventListener(i_,w)},[w]),o.jsx(DCe,{scope:s,orientation:i,dir:b,loop:r,currentTabStopId:v,onItemFocus:g.useCallback(A=>y(A),[y]),onItemShiftTab:g.useCallback(()=>E(!0),[]),onFocusableItemAdd:g.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:g.useCallback(()=>T(A=>A-1),[]),children:o.jsx(ca.div,{tabIndex:x||k===0?-1:0,"data-orientation":i,...h,ref:p,style:{outline:"none",...t.style},onMouseDown:er(t.onMouseDown,()=>{_.current=!0}),onFocus:er(t.onFocus,A=>{const j=!_.current;if(A.target===A.currentTarget&&j&&!x){const R=new CustomEvent(i_,OCe);if(A.currentTarget.dispatchEvent(R),!R.defaultPrevented){const B=S().filter(I=>I.focusable),z=B.find(I=>I.active),L=B.find(I=>I.id===v),C=[z,L,...B].filter(Boolean).map(I=>I.ref.current);tC(C,f)}}_.current=!1}),onBlur:er(t.onBlur,()=>E(!1))})})},"RovingFocusGroupImpl")),FCe="RovingFocusGroupItem",$Ce=g.forwardRef(Bu(function(t,n){const{__scopeRovingFocusGroup:s,focusable:i=!0,active:r=!1,tabStopId:a,children:l,...c}=t,u=wV(),d=a||u,f=PCe(FCe,s),h=f.currentTabStopId===d,m=IV(s),{onFocusableItemAdd:p,onFocusableItemRemove:b,currentTabStopId:v}=f,y=jCe();return wu(()=>{if(!(!y||!i))return p(),()=>b()},[y,i,p,b]),g.useEffect(()=>{if(!(y||!i))return p(),()=>b()},[y,i,p,b]),o.jsx(YN.ItemSlot,{scope:s,id:d,focusable:i,active:r,children:o.jsx(ca.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:er(t.onMouseDown,x=>{i?f.onItemFocus(d):x.preventDefault()}),onFocus:er(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:er(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const E=RV(x,f.orientation,f.dir);if(E!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=m().filter(_=>_.focusable).map(_=>_.ref.current);if(E==="last")S.reverse();else if(E==="prev"||E==="next"){E==="prev"&&S.reverse();const _=S.indexOf(x.currentTarget);S=f.loop?OV(S,_+1):S.slice(_+1)}setTimeout(()=>tC(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),HCe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jV(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Bu(jV,"getDirectionAwareKey");function RV(e,t,n){const s=jV(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return HCe[s]}Bu(RV,"getFocusIntent");function tC(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}Bu(tC,"focusFirst");function OV(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Bu(OV,"wrapArray");var MV=BCe,LV=$Ce,zCe=Object.defineProperty,Hi=(e,t)=>zCe(e,"name",{value:t,configurable:!0}),DV="Radio",[VCe,PV]=yc(DV),[GCe,vE]=VCe(DV);function BV(e){const{__scopeRadio:t,checked:n=!1,children:s,disabled:i,form:r,name:a,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=g.useState(null),[m,p]=g.useState(null),b=g.useRef(!1),[v,y]=g.useReducer(w=>w+1,0),x=f?!!r||!!f.closest("form"):!0,E={checked:n,disabled:i,required:c,name:a,form:r,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:x,bubbleInput:m,setBubbleInput:p,onCheck:Hi(()=>l==null?void 0:l(),"onCheck")};return o.jsx(GCe,{scope:t,...E,children:UV(d)?d(E):s})}Hi(BV,"RadioProvider");var KCe="RadioTrigger",qCe=g.forwardRef(Hi(function({__scopeRadio:t,onClick:n,...s},i){const{checked:r,disabled:a,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:m}=vE(KCe,t),p=pr(i,c);return o.jsx(ca.button,{type:"button",role:"radio","aria-checked":r,"data-state":nC(r),"data-disabled":a?"":void 0,disabled:a,value:l,...s,ref:p,onClick:er(n,b=>{r||(f(),u()),m&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),YCe="RadioIndicator",WCe=g.forwardRef(Hi(function(t,n){const{__scopeRadio:s,forceMount:i,...r}=t,a=vE(YCe,s);return o.jsx(yV,{present:i||a.checked,children:o.jsx(ca.span,{"data-state":nC(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n})})},"RadioIndicator")),XCe="RadioBubbleInput",QCe=g.forwardRef(Hi(function({__scopeRadio:t,onClick:n,...s},i){const{control:r,checked:a,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m,hasConsumerStoppedPropagationRef:p,userInteractionCount:b}=vE(XCe,t),v=pr(i,m),y=XA(r),x=g.useRef(!1),E=g.useRef(a),w=g.useRef(b);g.useEffect(()=>{const _=h;if(!_)return;const k=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(k,"checked").set,j=b!==w.current;w.current=b;const R=E.current!==a;E.current=a;const B=!(j&&p.current);if(R&&A){x.current=!j;const z=new Event("click",{bubbles:B});A.call(_,a),_.dispatchEvent(z),x.current=!1}},[h,a,p,b]);const S=g.useRef(a);return o.jsx(ca.input,{type:"radio","aria-hidden":!0,defaultChecked:S.current,required:l,disabled:c,name:u,value:d,form:f,...s,tabIndex:-1,ref:v,onClick:er(n,_=>{x.current&&_.stopPropagation()}),style:{...s.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function UV(e){return typeof e=="function"}Hi(UV,"isFunction");function nC(e){return e?"checked":"unchecked"}Hi(nC,"getState");var ZCe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],sC="RadioGroup",[JCe,dLe]=yc(sC,[EE,PV]),FV=EE(),wE=PV(),[eIe,tIe]=JCe(sC),nIe=g.forwardRef(Hi(function(t,n){const{__scopeRadioGroup:s,name:i,form:r,defaultValue:a,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:m,...p}=t,b=FV(s),v=yE(f),[y,x]=Pu({prop:l,defaultProp:a??null,onChange:m,caller:sC}),[E,w]=g.useState(null),S=pr(n,w),_=g.useRef(y);return g.useEffect(()=>{const k=r?E==null?void 0:E.ownerDocument.getElementById(r):E==null?void 0:E.closest("form");if(k instanceof HTMLFormElement){const T=Hi(()=>x(_.current),"reset");return k.addEventListener("reset",T),()=>k.removeEventListener("reset",T)}},[E,r,x]),o.jsx(eIe,{scope:s,name:i,form:r,required:c,disabled:u,value:y,onValueChange:x,children:o.jsx(MV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(ca.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...p,ref:S})})})},"RadioGroup")),sIe="RadioGroupItemProvider",iIe="RadioGroupItemTrigger";function $V(e){const{__scopeRadioGroup:t,value:n,disabled:s,children:i,internal_do_not_use_render:r}=e,a=tIe(sIe,t),l=wE(t),c=a.disabled||s;return o.jsx(BV,{...l,checked:a.value===n,disabled:c,required:a.required,name:a.name,form:a.form,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:r,children:i})}Hi($V,"RadioGroupItemProvider");var rIe=g.forwardRef(Hi(function(t,n){const{__scopeRadioGroup:s,...i}=t,r=FV(s),a=wE(s),{checked:l,disabled:c}=vE(iIe,a.__scopeRadio),u=g.useRef(null),d=pr(n,u),f=g.useRef(!1);return g.useEffect(()=>{const h=Hi(p=>{ZCe.includes(p.key)&&(f.current=!0)},"handleKeyDown"),m=Hi(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),o.jsx(LV,{asChild:!0,...r,focusable:!c,active:l,children:o.jsx(qCe,{...a,...i,ref:d,onKeyDown:er(i.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:er(i.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),aIe=g.forwardRef(Hi(function(t,n){const{__scopeRadioGroup:s,value:i,disabled:r,...a}=t;return o.jsx($V,{__scopeRadioGroup:s,value:i,disabled:r,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(rIe,{...a,ref:n,__scopeRadioGroup:s}),l&&o.jsx(oIe,{__scopeRadioGroup:s})]})})},"RadioGroupItem")),oIe=g.forwardRef(Hi(function(t,n){const{__scopeRadioGroup:s,...i}=t,r=wE(s);return o.jsx(QCe,{...r,...i,ref:n})},"RadioGroupItemBubbleInput")),lIe=g.forwardRef(Hi(function(t,n){const{__scopeRadioGroup:s,...i}=t,r=wE(s);return o.jsx(WCe,{...r,...i,ref:n})},"RadioGroupIndicator")),cIe=Object.defineProperty,uIe=(e,t)=>cIe(e,"name",{value:t,configurable:!0}),dIe="Toggle",fIe=g.forwardRef(uIe(function(t,n){const{pressed:s,defaultPressed:i,onPressedChange:r,...a}=t,[l,c]=Pu({prop:s,onChange:r,defaultProp:i??!1,caller:dIe});return o.jsx(ca.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:er(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),hIe=Object.defineProperty,cc=(e,t)=>hIe(e,"name",{value:t,configurable:!0}),Nh="ToggleGroup",[HV,fLe]=yc(Nh,[EE]),zV=EE(),mIe=g.forwardRef(cc(function(t,n){const{type:s,...i}=t;if(s==="single"){const r=i;return o.jsx(pIe,{role:"radiogroup",...r,ref:n})}if(s==="multiple"){const r=i;return o.jsx(gIe,{role:"toolbar",...r,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${Nh}\``)},"ToggleGroup")),[VV,GV]=HV(Nh),pIe=g.forwardRef(cc(function(t,n){const{value:s,defaultValue:i,onValueChange:r=cc(()=>{},"onValueChange"),...a}=t,[l,c]=Pu({prop:s,defaultProp:i??"",onChange:r,caller:Nh});return o.jsx(VV,{scope:t.__scopeToggleGroup,type:"single",value:g.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:g.useCallback(()=>c(""),[c]),children:o.jsx(KV,{...a,ref:n})})},"ToggleGroupImplSingle")),gIe=g.forwardRef(cc(function(t,n){const{value:s,defaultValue:i,onValueChange:r=cc(()=>{},"onValueChange"),...a}=t,[l,c]=Pu({prop:s,defaultProp:i??[],onChange:r,caller:Nh}),u=g.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=g.useCallback(f=>c((h=[])=>h.filter(m=>m!==f)),[c]);return o.jsx(VV,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(KV,{...a,ref:n})})},"ToggleGroupImplMultiple")),[bIe,yIe]=HV(Nh),KV=g.forwardRef(cc(function(t,n){const{__scopeToggleGroup:s,disabled:i=!1,rovingFocus:r=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=zV(s),f=yE(l),h={dir:f,...u};return o.jsx(bIe,{scope:s,rovingFocus:r,disabled:i,children:r?o.jsx(MV,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(ca.div,{...h,ref:n})}):o.jsx(ca.div,{...h,ref:n})})},"ToggleGroupImpl")),WN="ToggleGroupItem",xIe=g.forwardRef(cc(function(t,n){const s=GV(WN,t.__scopeToggleGroup),i=yIe(WN,t.__scopeToggleGroup),r=zV(t.__scopeToggleGroup),a=s.value.includes(t.value),l=i.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=g.useRef(null);return i.rovingFocus?o.jsx(LV,{asChild:!0,...r,focusable:!l,active:a,ref:u,children:o.jsx(xD,{...c,ref:n})}):o.jsx(xD,{...c,ref:n})},"ToggleGroupItem")),xD=g.forwardRef(cc(function(t,n){const{__scopeToggleGroup:s,value:i,...r}=t,a=GV(WN,s),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(fIe,{...c,...r,ref:n,onPressedChange:u=>{u?a.onItemActivate(i):a.onItemDeactivate(i)}})},"ToggleGroupItemImpl"));const EIe="_Container_1tuad_1",vIe="_Checkbox_1tuad_22",wIe="_CheckMark_1tuad_92",_Ie="_Label_1tuad_162",vb={Container:EIe,Checkbox:vIe,CheckMark:wIe,Label:_Ie},qV=({className:e,label:t,id:n,disabled:s,orientation:i="left",...r})=>{const a=g.useId(),l=n??a;return o.jsxs("div",{"data-disabled":s?"":void 0,"data-has-label":t?"":void 0,"data-orientation":i,className:da(e,vb.Container),children:[o.jsx(NCe,{className:vb.Checkbox,id:l,disabled:s,...r,children:o.jsx(kCe,{className:vb.CheckMark})}),t&&o.jsx("label",{htmlFor:l,className:vb.Label,onMouseDown:c=>{!c.defaultPrevented&&c.detail>1&&c.preventDefault()},children:t})]})},SIe="_RadioGroup_onrfm_1",NIe="_RadioLabel_onrfm_9",TIe="_RadioIndicatorWrapper_onrfm_26",kIe="_RadioItem_onrfm_43",AIe="_RadioIndicator_onrfm_26",Cm={RadioGroup:SIe,RadioLabel:NIe,RadioIndicatorWrapper:TIe,RadioItem:kIe,RadioIndicator:AIe},YV=g.createContext(null),CIe=()=>{const e=g.use(YV);if(!e)throw new Error("RadioGroup components must be wrapped in ");return e},XN=({onChange:e,children:t,className:n,direction:s="row",disabled:i=!1,...r})=>{const a=g.useMemo(()=>({disabled:i,direction:s}),[i,s]);return o.jsx(YV,{value:a,children:o.jsx(nIe,{className:da(Cm.RadioGroup,n),"data-direction":s,onValueChange:e,disabled:i,...r,children:t})})},IIe=({value:e,disabled:t=!1,required:n,children:s,className:i,block:r=!1,...a})=>{const{disabled:l}=CIe(),c=l||t,u=g.useId(),d=`${e}-${u}`;return o.jsx("div",{className:"flex",...a,children:o.jsxs("label",{htmlFor:d,className:da(Cm.RadioLabel,i),"data-disabled":c?"":void 0,"data-block":r?"":void 0,onMouseDown:f=>{!f.defaultPrevented&&f.detail>1&&f.preventDefault()},children:[o.jsx("div",{className:Cm.RadioIndicatorWrapper,children:o.jsx(aIe,{id:d,value:e,disabled:c,required:n,className:Cm.RadioItem,children:o.jsx(lIe,{className:Cm.RadioIndicator})})}),s]})})};XN.Item=IIe;function jIe({className:e,...t}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),o.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}const wd={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:jIe},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:Fee},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:cte},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:Xk},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:yx}},RIe=[wd.llm,wd.sequential,wd.parallel,wd.loop,wd.a2a];function WV(e){return wd[e??"llm"]}const XV=e=>e==="sequential"||e==="parallel"||e==="loop",_E=e=>e==="a2a";function uc(e){return e.trimEnd().replace(/[。.]+$/,"")}function B1(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(s=>s==null?void 0:s.toLocaleLowerCase().includes(n)):!0}function Ac(e,t){return e[t]|e[t+1]<<8}function fd(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function OIe(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function QV(e,t={}){let s=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(fd(e,u)===101010256){s=u;break}if(s<0)throw new Error("无效的 zip:找不到 EOCD");const i=Ac(e,s+10);if(t.maxEntries!==void 0&&i>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let r=fd(e,s+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const x=Ac(e,v+26),E=Ac(e,v+28),w=v+30+x+E,S=e.subarray(w,w+f);let _;if(d===0)_=S;else if(d===8)_=await OIe(S);else{r+=46+m+p+b;continue}l.push({name:y,text:a.decode(_)}),r+=46+m+p+b}return l}const MIe="/skillhub/v1/skills";async function LIe(e,t="public"){const n=e.trim(),s=`${MIe}?query=${encodeURIComponent(n)}&namespace=${encodeURIComponent(t)}`,i=await fetch(s,{headers:{accept:"application/json"},signal:Bn(void 0,pc)});if(!i.ok)throw new Error(`搜索失败 (${i.status})`);return((await i.json()).Skills??[]).map(a=>{var l;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((l=a.Metadata)==null?void 0:l.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function DIe({selected:e,onChange:t}){const[n,s]=g.useState(""),[i,r]=g.useState([]),[a,l]=g.useState(!1),[c,u]=g.useState(null),[d,f]=g.useState(!1),h=b=>e.some(v=>v.source==="skillhub"&&v.slug===b),m=b=>{b.slug&&(h(b.slug)?t(e.filter(v=>!(v.source==="skillhub"&&v.slug===b.slug))):t([...e,{source:"skillhub",slug:b.slug,name:b.name,folder:b.slug.split("/").pop()||b.name,namespace:b.namespace||"public",description:b.description}]))},p=async b=>{l(!0),u(null),f(!0);try{const v=await LIe(b);r(v)}catch(v){u(v instanceof Error?v.message:"搜索失败,请稍后重试。"),r([])}finally{l(!1)}};return g.useEffect(()=>{const b=n.trim();if(!b){r([]),f(!1),u(null);return}const v=setTimeout(()=>p(b),300);return()=>clearTimeout(v)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(e1,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:b=>s(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),n.trim()&&p(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&p(n),disabled:!n.trim()||a,children:[a?o.jsx(bn,{className:"cw-i cw-spin"}):o.jsx(e1,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mc,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&i.length===0?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(bn,{className:"cw-i cw-spin"})," 正在搜索…"]}):i.length>0?o.jsx("div",{className:"cw-skill-results",children:i.map(b=>{const v=h(b.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${v?"is-on":""}`,onClick:()=>m(b),"aria-pressed":v,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:v?o.jsx(Pa,{className:"cw-i cw-i-sm"}):o.jsx(Ii,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&o.jsx("span",{className:"cw-skill-result-desc",children:uc(b.description)}),b.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:b.sourceRepo})]})]},b.id||b.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const QN=/(^|\/)skill\.md$/i;function PIe(e){const t=(e??"").replace(/\r\n?/g,` +`);return s>=0&&(n=n.slice(s+1)),{text:n,omitted:!0}}function cD(e,t,n=bAe){const s=yAe((e==null?void 0:e.text)??"",t.text??""),i=xAe(s,n),r=i.text?i.text.split(` +`).length:0,a=!!(t.snapshotTruncated||t.truncated),l=!!(e!=null&&e.omittedEarly||i.omitted);return{...t,text:i.text,lineCount:r,truncated:!!(e!=null&&e.truncated||t.truncated||l),omittedEarly:l,snapshotTruncated:!!(e!=null&&e.snapshotTruncated||a)}}gr.registerLanguage("python",WF);gr.registerLanguage("typescript",o$);gr.registerLanguage("javascript",zF);gr.registerLanguage("json",VF);gr.registerLanguage("yaml",l$);gr.registerLanguage("markdown",YF);gr.registerLanguage("bash",PF);gr.registerLanguage("ini",BF);gr.registerLanguage("dockerfile",c1e);gr.registerLanguage("makefile",qF);const EAe=g.lazy(()=>lu(()=>import("./CodeEditor-1lm8yIe5.js"),[])),Nl=()=>{};function vAe({open:e,isUpdate:t,onCancel:n,onConfirm:s}){const i=g.useRef(null);return g.useEffect(()=>{var l;if(!e)return;const r=document.body.style.overflow;document.body.style.overflow="hidden",(l=i.current)==null||l.focus();const a=c=>{c.key==="Escape"&&n()};return window.addEventListener("keydown",a),()=>{document.body.style.overflow=r,window.removeEventListener("keydown",a)}},[n,e]),e?wi.createPortal(o.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:r=>{r.target===r.currentTarget&&n()},children:o.jsxs("section",{className:"code-browser-dialog pp-confirm-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"pp-confirm-title","aria-describedby":"pp-confirm-description",children:[o.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[o.jsxs("div",{className:"code-browser-title-wrap",children:[o.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:o.jsx(dte,{})}),o.jsx("h2",{id:"pp-confirm-title",children:t?"确认更新":"确认部署"})]}),o.jsx("button",{type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭部署确认",children:o.jsx(Oi,{"aria-hidden":"true"})})]}),o.jsx("div",{className:"pp-confirm-body",children:o.jsx("p",{id:"pp-confirm-description",children:t?"将更新并发布到当前云端 Runtime,过程可能需要几分钟。确定继续吗?":"将创建新的云端 Runtime,部署过程可能需要几分钟。确定继续吗?"})}),o.jsxs("footer",{className:"pp-confirm-actions",children:[o.jsx("button",{ref:i,type:"button",onClick:n,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:s,children:t?"确定更新":"确定部署"})]})]})}),document.body):null}function Jz({ariaLabel:e,value:t,placeholder:n,options:s,disabled:i=!1,onChange:r}){const a=g.useId(),l=g.useRef(null),c=g.useRef(null),u=g.useRef([]),[d,f]=g.useState(!1),[h,p]=g.useState(0),m=s.find(x=>x.value===t);g.useEffect(()=>{if(!d)return;const x=E=>{E.target instanceof Node&&l.current&&!l.current.contains(E.target)&&f(!1)};return window.addEventListener("pointerdown",x),()=>window.removeEventListener("pointerdown",x)},[d]),g.useEffect(()=>{var x;d&&((x=u.current[h])==null||x.focus())},[h,d]);const b=(x=1)=>{const E=s.findIndex(S=>S.value===t),w=E>=0?E:x===1?0:Math.max(0,s.length-1);p(w),f(!0)},v=x=>{s.length!==0&&p((x+s.length)%s.length)},y=x=>{var E;r(x.value),f(!1),(E=c.current)==null||E.focus()};return o.jsxs("div",{className:"pp-deployment-select",ref:l,onKeyDown:x=>{var E;if(x.key==="Escape"&&d){x.preventDefault(),f(!1),(E=c.current)==null||E.focus();return}if(x.key==="Tab"){f(!1);return}x.key==="ArrowDown"?(x.preventDefault(),d?v(h+1):b(1)):x.key==="ArrowUp"?(x.preventDefault(),d?v(h-1):b(-1)):d&&x.key==="Home"?(x.preventDefault(),p(0)):d&&x.key==="End"&&(x.preventDefault(),p(Math.max(0,s.length-1)))},children:[o.jsxs("button",{ref:c,type:"button",className:"pp-deployment-select-trigger","aria-label":e,"aria-haspopup":"listbox","aria-expanded":d,"aria-controls":d?a:void 0,disabled:i||s.length===0,onClick:()=>{d?f(!1):b()},children:[o.jsx("span",{className:m?void 0:"is-placeholder",children:(m==null?void 0:m.label)??n}),o.jsx(BB,{"aria-hidden":"true",className:`pp-deployment-select-chevron${d?" is-open":""}`})]}),d&&o.jsx("div",{id:a,className:"pp-deployment-select-menu",role:"listbox","aria-label":e,children:s.map((x,E)=>{const w=x.value===t;return o.jsxs("button",{ref:S=>{u.current[E]=S},type:"button",role:"option","aria-selected":w,tabIndex:E===h?0:-1,className:`pp-deployment-select-option${w?" is-selected":""}`,title:x.description,onFocus:()=>p(E),onClick:()=>y(x),children:[o.jsxs("span",{className:"pp-deployment-select-copy",children:[o.jsxs("span",{className:"pp-deployment-select-name",children:[x.label,x.badge&&o.jsx("span",{className:"pp-deployment-select-badge",children:x.badge})]}),x.description&&o.jsx("small",{children:x.description})]}),w&&o.jsx(Ha,{"aria-hidden":"true"})]},x.value)})})]})}function wAe({value:e,disabled:t,onChange:n}){const[s,i]=g.useState([]),[r,a]=g.useState(!0),[l,c]=g.useState(null),[u,d]=g.useState(0);g.useEffect(()=>{const p=new AbortController;return a(!0),c(null),k8(p.signal).then(m=>i(m)).catch(m=>{m instanceof DOMException&&m.name==="AbortError"||(i([]),c(m instanceof Error?m.message:String(m)))}).finally(()=>{p.signal.aborted||a(!1)}),()=>p.abort()},[u]);const f=g.useMemo(()=>[...s].sort((p,m)=>Number(m.isCurrent)-Number(p.isCurrent)).map(p=>({value:p.uid,label:p.name.trim()||"未命名用户池",description:p.domain||p.uid,badge:p.isCurrent?"当前用户池":void 0})),[s]),h=s.find(p=>p.uid===e);return o.jsxs("div",{className:"pp-user-pool-picker",children:[o.jsx(Jz,{ariaLabel:"部署用户池",value:e,placeholder:r?"正在加载用户池…":"请选择用户池",options:f,disabled:t||r||!!l,onChange:n}),l?o.jsxs("div",{className:"pp-user-pool-error",role:"alert",children:[o.jsx("span",{children:l}),o.jsx("button",{type:"button",onClick:()=>d(p=>p+1),children:"重试"})]}):r?o.jsxs("span",{className:"pp-user-pool-status","aria-live":"polite",children:[o.jsx(yn,{"aria-hidden":"true",className:"pp-user-pool-spinner"}),"正在加载 Identity 用户池…"]}):s.length===0?o.jsx("span",{className:"pp-user-pool-status",children:"当前账号下暂无 Identity 用户池。"}):h!=null&&h.isCurrent?o.jsx("span",{className:"pp-user-pool-status",children:"当前 Studio 的登录 JWT 将透传访问此 Runtime。"}):h?o.jsx("div",{className:"pp-user-pool-error",role:"alert",children:o.jsx("span",{children:"所选用户池不是当前 Studio 使用的用户池,部署后无法从 Studio 调用此 Runtime。"})}):o.jsx("span",{className:"pp-user-pool-status",children:"当前 Studio 使用的用户池已在列表中标注。"})]})}const _Ae=[{value:"api_key",label:"API Key",description:"默认方式,使用 Runtime API Key 访问"},{value:"user_pool",label:"用户池",description:"使用 Identity 用户池签发的 JWT"}],SAe={py:"python",pyi:"python",ts:"typescript",tsx:"typescript",mts:"typescript",cts:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",json:"json",jsonc:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",sh:"bash",bash:"bash",zsh:"bash",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",env:"ini",txt:"plaintext"},uD={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function dD(e){return e.replace(/&/g,"&").replace(//g,">")}function NAe(e){const n=(e.split("/").pop()??e).toLowerCase();if(uD[n])return uD[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const s=n.lastIndexOf(".");if(s===-1)return null;const i=n.slice(s+1);return SAe[i]??null}function TAe(e,t){try{const n=NAe(t);return n&&gr.getLanguage(n)?gr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?gr.highlightAuto(e).value:dD(e)}catch{return dD(e)}}const kAe=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}],AAe=[{phase:"upload",label:"上传代码包"},{phase:"build",label:"镜像打包"},{phase:"deploy",label:"创建 Runtime"},{phase:"publish",label:"发布服务"}],CAe={phase:"update",label:"更新实例配置"},IAe={phase:"evaluation",label:"创建评测集"};function jAe(e){return e?!e.memory.shortTerm||(e.shortTermBackend||"local")==="local":!1}function RAe(e,t){const n=Number(e),s=Number(t);return!e.trim()||!t.trim()||!Number.isSafeInteger(n)||!Number.isSafeInteger(s)||n<1||s<1?{valid:!1,error:"实例数必须为大于 0 的整数。"}:n>s?{valid:!1,error:"最小实例数不能大于最大实例数。"}:{valid:!0,min:n,max:s}}function OAe(e){const t={name:"",children:new Map};for(const n of e){const s=n.path.split("/").filter(Boolean);let i=t;s.forEach((r,a)=>{let l=i.children.get(r);l||(l={name:r,children:new Map},i.children.set(r,l)),a===s.length-1&&(l.path=n.path),i=l})}return t}function MAe(e){return[...e.children.values()].sort((t,n)=>{const s=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return s!==i?s?-1:1:t.name.localeCompare(n.name)})}function LAe(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function DAe({left:e,right:t}){const[n,s]=g.useState(null);return g.useLayoutEffect(()=>{const i=document.getElementById("veadk-page-header-left"),r=document.getElementById("veadk-page-header-actions");i&&r&&s({left:i,right:r})},[]),n?o.jsxs(o.Fragment,{children:[wi.createPortal(e,n.left),wi.createPortal(t,n.right)]}):o.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function yE({project:e,embedded:t=!1,deployDisabledReason:n,agentDraft:s,agentName:i,agentCount:r,releaseConfiguration:a,onChange:l,onDeploy:c,onAgentAdded:u,onDeploymentComplete:d,deploymentActionLabel:f="部署",deploymentActionTargetId:h,deploymentRuntimeId:p,onDeploymentStarted:m,onDeploymentTaskChange:b,feishuEnabled:v=!1,onFeishuEnabledChange:y,deploymentEnv:x=[],deploymentEnvValues:E={},onDeploymentEnvChange:w,network:S,onNetworkChange:_,cloudProvider:T="volcengine",deployRegion:k=Ti(T),onDeployRegionChange:A,deploymentTelemetry:j={source:"unknown",createMode:"unknown",aiAssisted:!1},onBack:R,backLabel:B="返回配置",onExportYaml:z,deploymentPrimaryPane:L,deployDisabled:F=!1}){var rn,an,xs;const C=typeof l=="function",I=f.includes("更新"),D=jAe(s),[$,O]=g.useState(((an=(rn=e==null?void 0:e.files)==null?void 0:rn[0])==null?void 0:an.path)??null),[te,se]=g.useState(new Set),[P,Q]=g.useState(!1),[ee,V]=g.useState(""),[X,K]=g.useState(!1),[ce,he]=g.useState(!1),[be,ue]=g.useState(!1),[we,Le]=g.useState(!1),[Ne,ae]=g.useState(null),[me,_e]=g.useState(null),[Je,Pe]=g.useState({}),[Fe,Ye]=g.useState(null),[Ce,Ve]=g.useState(!1),[Ue,W]=g.useState([]),[oe,Z]=g.useState(!1),Ee=g.useId(),[Me,lt]=g.useState("api_key"),[Ot,ut]=g.useState(""),xn=wx(T),xt=Nf(k,T),[wt,En]=g.useState("1"),[Ut,Pt]=g.useState(D?"1":"5"),[at,ft]=g.useState(!0),He=T!=="byteplus",_t=He&&at,[ye,We]=g.useState(null),Ge=g.useRef(!0),ht=RAe(wt,Ut),Vn=!I&&ht.valid&&(ht.min!==1||ht.max!==5),un=L?AAe:kAe,Ht=Vn?[...un,CAe]:un,sn=_t?[...Ht,IAe]:Ht;g.useEffect(()=>{!A||I||xn.some(de=>de.value===k)||A(Ti(T))},[T,k,xn,I,A]),g.useEffect(()=>{if(!h){We(null);return}We(document.getElementById(h))},[h]);const kn=de=>o.jsxs("div",{className:`pp-network-region${oe?" is-open":""}`,onKeyDown:Ie=>{Ie.key==="Escape"&&Z(!1)},children:[de&&o.jsx("span",{children:"发布区域"}),o.jsxs("button",{type:"button",className:"pp-region-trigger","aria-label":"部署区域","aria-haspopup":"listbox","aria-expanded":oe,"aria-describedby":I?Ee:void 0,disabled:X||I||!A,onClick:()=>Z(Ie=>!Ie),children:[o.jsx("span",{children:xt}),o.jsx(BB,{className:`pp-region-chevron${oe?" is-open":""}`})]}),oe&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>Z(!1)}),o.jsx("div",{className:"pp-region-menu",role:"listbox","aria-label":"部署区域",children:xn.map(Ie=>{const Be=Ie.value===k;return o.jsxs("button",{type:"button",role:"option","aria-selected":Be,className:`pp-region-option${Be?" is-selected":""}`,onClick:()=>{A==null||A(Ie.value),Z(!1)},children:[o.jsx("span",{children:Ie.label}),Be&&o.jsx(Ha,{"aria-hidden":"true"})]},Ie.value)})})]}),I&&o.jsx("span",{id:Ee,className:"pp-region-help",children:"更新时沿用现有 Runtime 的部署区域,无法修改。"})]});g.useEffect(()=>(Ge.current=!0,()=>{Ge.current=!1}),[]),g.useEffect(()=>{En("1"),Pt(D?"1":"5")},[D]),g.useEffect(()=>{if(!be)return;const de=document.body.style.overflow;document.body.style.overflow="hidden";const Ie=Be=>{Be.key==="Escape"&&ue(!1)};return window.addEventListener("keydown",Ie),()=>{document.body.style.overflow=de,window.removeEventListener("keydown",Ie)}},[be]);const zt=g.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:OAe(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return o.jsx("div",{className:"pp-error",children:"项目数据无效"});const ot=e.files.find(de=>de.path===$)??null,An=(S==null?void 0:S.mode)??"public",mn=()=>({telemetry:j,action:p?"update":"create",region:k,networkType:An,feishuEnabled:v}),At=cAe(v?[...x,...Qh]:x,E),Os=At.length+Ue.length;function Ms(de){se(Ie=>{const Be=new Set(Ie);return Be.has(de)?Be.delete(de):Be.add(de),Be})}function bs(de,Ie){l&&(l({...e,files:de}),Ie!==void 0&&O(Ie))}function vn(de){ot&&bs(e.files.map(Ie=>Ie.path===ot.path?{...Ie,content:de}:Ie))}function Gn(){const de=ee.trim();if(Q(!1),V(""),!!de){if(e.files.some(Ie=>Ie.path===de)){O(de);return}bs([...e.files,{path:de,content:""}],de)}}function ls(){if(!ot)return;const de=window.prompt("重命名文件",ot.path),Ie=de==null?void 0:de.trim();!Ie||Ie===ot.path||e.files.some(Be=>Be.path===Ie)||bs(e.files.map(Be=>Be.path===ot.path?{...Be,path:Ie}:Be),Ie)}function Kn(){var Ie;if(!ot)return;const de=e.files.filter(Be=>Be.path!==ot.path);bs(de,((Ie=de[0])==null?void 0:Ie.path)??null)}function Ss(de,Ie){W(Be=>Be.map(it=>it.id===de?{...it,...Ie}:it))}function Ns(de){W(Ie=>Ie.filter(Be=>Be.id!==de))}function hi(){W(de=>[...de,LAe()])}function Cn(de){_&&_(de==="public"?void 0:{...S??{mode:de},mode:de})}function Ks(de){_==null||_({...S??{mode:"private"},...de})}function cs(){const de=new Map(Ue.map(Be=>({key:Be.key.trim(),value:Be.value})).filter(Be=>Be.key.length>0).map(Be=>[Be.key,Be.value])),Ie=v?[...x,...Qh]:x;for(const Be of Xz(Ie,E))de.set(Be.key,Be.value);return[...de].map(([Be,it])=>({key:Be,value:it}))}async function qn(){if(!(!y||X||we)){ae(null),Le(!0);try{await y(!v)}catch(de){Ge.current&&ae(`更新飞书配置失败:${de instanceof Error?de.message:String(de)}`)}finally{Ge.current&&Le(!1)}}}async function Yn(){var Be;if(!c||X||F)return;if(!ht.valid){ae(ht.error);return}if(!I&&Me==="user_pool"&&!Ot){ae("请选择用于 Runtime 鉴权的用户池。");return}if(An!=="public"&&!((Be=S==null?void 0:S.vpcId)!=null&&Be.trim())){ae("使用 VPC 网络时,请填写 VPC ID。");return}const de=aD(x,E);if(de){const it=x.find(et=>et.key===de.key);ae(`请返回配置页填写 ${(it==null?void 0:it.comment)||(it==null?void 0:it.key)}(${it==null?void 0:it.key})。`);return}const Ie=Qz(x,E);if(Ie){ae(`${Ie.spec.comment||Ie.spec.key}:${Ie.error}`);return}if(v){const it=aD(Qh,E);if(it){const et=Qh.find(Et=>Et.key===it.key);ae(`启用飞书后,请填写${(et==null?void 0:et.comment)||(et==null?void 0:et.key)}。`);return}}he(!0)}async function Wn(){var Xn;if(!c||X)return;if(!ht.valid){he(!1),ae(ht.error);return}he(!1);const de=cs();Ge.current&&(ae(null),_e(null),Pe({}),Ye(null),K(!0));const Ie=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let Be=(i==null?void 0:i.trim())||e.name||"生成中…";const it=Date.now(),et={id:Ie,runtimeName:Be,runtimeId:p,region:k,startedAt:it,status:"running",phase:"prepare",label:"准备部署",agentDraft:s,instanceRange:Vn?{min:ht.min,max:ht.max}:void 0,createEvaluationSets:_t};b==null||b(et),m==null||m(et);let Et,je=et.phase??"prepare";const Ln=Jt=>Et?{...Et,status:Jt,updatedAt:Date.now()}:void 0,us=Jt=>{const vt=Ln(Jt);return vt?{buildLog:vt}:{}},pi=()=>({source:"code-pipeline",status:"running",text:"",lineCount:0,truncated:!1,updatedAt:Date.now(),pendingMessage:"正在等待构建日志…"}),ri=Jt=>{if(je!=="build")return;const vt=["","----- 构建失败 -----",Jt].join(` +`);return Et=cD(Et,{source:"code-pipeline",status:"error",text:vt,lineCount:vt.split(` +`).length,truncated:!1,updatedAt:Date.now()}),Et};try{const Jt=await c(e,vt=>{var Dn;vt.runtimeName&&(Be=vt.runtimeName),je=vt.phase,vt.buildLog?Et=cD(Et,vt.buildLog):vt.phase==="build"&&!Et&&(Et=pi()),Ge.current&&(Pe(mi=>({...mi,[vt.phase]:vt})),Ye(vt.phase)),b==null||b({id:Ie,runtimeName:Be,runtimeId:p,region:k,startedAt:it,status:"running",phase:vt.phase,label:((Dn=sn.find(mi=>mi.phase===vt.phase))==null?void 0:Dn.label)??vt.phase,message:vt.message,pct:vt.pct,...Et?{buildLog:Et}:{}})},{taskId:Ie,sessionStorage:D?"in-memory":"persistent",minInstance:ht.min,maxInstance:ht.max,...I?{}:{authentication:Me==="user_pool"?{type:"user_pool",userPoolUid:Ot}:{type:"api_key"}},createEvaluationSets:_t,...v?{im:{feishu:{enabled:!0}}}:{},envs:de});Ge.current&&(_e(Jt),Ye(null)),OH({...mn(),runtimeId:Jt.runtimeId||p||""}),b==null||b({id:Ie,runtimeName:Jt.agentName||Be,runtimeId:Jt.runtimeId||p,region:Jt.region||k,startedAt:it,status:"success",phase:"complete",label:"部署完成",message:(Xn=Jt.warnings)==null?void 0:Xn.join(";"),...us("complete")});try{await(d==null?void 0:d(Jt))}catch(vt){if(!(vt instanceof Or))throw vt;b==null||b({id:Ie,runtimeName:Jt.agentName||Be,runtimeId:Jt.runtimeId||p,region:Jt.region||k,startedAt:it,status:"success",phase:"complete",label:"部署完成,暂未连接",message:vt.message,...us("complete")})}}catch(Jt){const vt=Jt instanceof Error?Jt.message:String(Jt);if(Jt instanceof DOMException&&Jt.name==="AbortError"){Ge.current&&(ae(null),Ye(null)),b==null||b({id:Ie,runtimeName:Be,runtimeId:p,region:k,startedAt:it,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。",...us("complete")});return}Ge.current&&ae(vt);const Dn=ri(vt),mi=!!Dn;MH({...mn(),phase:je,error:Jt}),b==null||b({id:Ie,runtimeName:Be,runtimeId:p,region:k,startedAt:it,status:"error",phase:je,label:"部署失败",message:mi?"构建镜像失败,详见构建日志。":vt,...Dn?{buildLog:Dn}:us("complete"),retry:Yn})}finally{Ge.current&&K(!1)}}function Ls(){he(!1)}async function ys(){if(!(!me||Ce)){Ve(!0),ae(null);try{const{addConnection:de,addRuntimeConnection:Ie,remoteAppId:Be,loadConnections:it}=await lu(async()=>{const{addConnection:je,addRuntimeConnection:Ln,remoteAppId:us,loadConnections:pi}=await Promise.resolve().then(()=>m3);return{addConnection:je,addRuntimeConnection:Ln,remoteAppId:us,loadConnections:pi}},void 0),{probeRuntimeApps:et}=await lu(async()=>{const{probeRuntimeApps:je}=await Promise.resolve().then(()=>ene);return{probeRuntimeApps:je}},void 0);let Et;if(me.runtimeId){const je=me.region??k,Ln=await et(me.runtimeId,je,{retryProbe:!0})??[];Et=Ie(me.runtimeId,me.agentName,je,Ln,Ln.length>0?{[Ln[0]]:me.agentName}:void 0,me.version)}else Et=await de(me.agentName,me.url,me.apikey,"");if(Et.apps.length===0)ae("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const je={[Et.apps[0]]:me.agentName},Ln={...Et,appLabels:{...Et.appLabels??{},...je}},pi=it().map(Xn=>Xn.id===Et.id?Ln:Xn);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(pi));const{registerConnections:ri}=await lu(async()=>{const{registerConnections:Xn}=await Promise.resolve().then(()=>m3);return{registerConnections:Xn}},void 0);if(ri(pi),u){const Xn=Be(Et.id,Et.apps[0]);u(Xn,me.agentName)}else alert(`🎉 Agent "${me.agentName}" 已添加到左上角下拉列表!`)}}catch(de){ae(`添加 Agent 失败:${de instanceof Error?de.message:String(de)}`)}finally{Ve(!1)}}}function gn(){const de=Date.now(),Ie=p?"update":"create";try{const Be=fAe(e.files),it=URL.createObjectURL(Be),et=document.createElement("a");et.href=it,et.download=`${e.name||"project"}.zip`,document.body.appendChild(et),et.click(),document.body.removeChild(et),URL.revokeObjectURL(it),wTe({telemetry:j,action:Ie,fileCount:e.files.length,zipSizeBytes:Be.size,durationMs:Date.now()-de})}catch(Be){throw _Te({telemetry:j,action:Ie,fileCount:e.files.length,durationMs:Date.now()-de,error:Be}),Be}}const fn=o.jsxs("div",{className:`pp-artifact-actions${t?" is-rail":""}`,"aria-label":"发布产物操作",children:[z&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:z,children:[o.jsx(Lee,{className:"pp-ic"}),"导出 YAML"]}),C&&l&&o.jsx(gAe,{project:e,onChange:l,className:"pp-artifact-source",label:"查看源代码"}),e.files.length>0&&o.jsxs("button",{type:"button",className:"pp-secondary",onClick:gn,children:[o.jsx(yx,{className:"pp-ic"}),"下载源代码"]})]});function dn(de,Ie,Be){return MAe(de).map(it=>{const et=Be?`${Be}/${it.name}`:it.name,Et=it.path!==void 0,je={paddingLeft:8+Ie*14};if(Et){const us=it.path===$;return o.jsxs("button",{type:"button",className:`pp-row pp-file${us?" pp-active":""}`,style:je,onClick:()=>O(it.path),title:it.path,children:[o.jsx(Bee,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:it.name})]},et)}const Ln=te.has(et);return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:"pp-row pp-folder",style:je,onClick:()=>Ms(et),children:[o.jsx(uc,{className:`pp-ic pp-chevron${Ln?"":" pp-open"}`}),o.jsx(FB,{className:"pp-ic"}),o.jsx("span",{className:"pp-label",children:it.name})]}),!Ln&&dn(it,Ie+1,et)]},et)})}return o.jsxs("div",{className:`pp-root${c?" is-deploy":""}${t?" is-embedded":""}${L?" has-primary-pane":""}`,children:[c&&!t&&o.jsx(DAe,{left:o.jsxs("div",{className:"pp-toolbar-left",children:[R&&o.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:R,children:[o.jsx(Vk,{className:"pp-ic"}),B]}),o.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",i||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),o.jsxs("div",{className:"pp-body",children:[c&&!L&&o.jsx("section",{className:"pp-release-overview","aria-label":"发布概览",children:o.jsxs("div",{className:`pp-release-preview${t?" is-embedded":""}`,children:[o.jsxs("div",{className:"pp-flow-thumbnail",children:[s&&o.jsx(zm,{draft:s,direction:"horizontal",selectedPath:[],onSelect:Nl,onAdd:Nl,onInsert:Nl,onDelete:Nl,readOnly:!0,interactivePreview:!0}),o.jsx("button",{type:"button",className:"pp-flow-expand",onClick:()=>ue(!0),"aria-label":"放大查看执行流程",title:"放大查看",children:o.jsx(nu,{"aria-hidden":!0})})]}),t&&fn,!t&&o.jsxs("div",{className:"pp-release-info",children:[o.jsx("div",{className:"pp-release-card-head",children:"Agent 概览"}),o.jsxs("div",{className:"pp-release-info-body",children:[o.jsxs("div",{className:"pp-release-info-main",children:[o.jsx("h2",{children:i||e.name||"未命名 Agent"}),(s==null?void 0:s.description)&&o.jsx("p",{className:"pp-release-description",title:s.description,children:s.description}),o.jsxs("dl",{className:"pp-release-facts",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Agent 数量"}),o.jsx("dd",{children:r??1})]}),a&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"模型"}),o.jsx("dd",{children:a.modelName})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"描述"}),o.jsx("dd",{className:"pp-release-fact-long",children:a.description})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"系统提示词"}),o.jsx("dd",{className:"pp-release-fact-long pp-release-prompt",children:a.instruction})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"优化选项"}),o.jsx("dd",{children:a.optimizations.length>0?a.optimizations.join("、"):"未启用"})]})]})]})]}),fn]})]})]})}),o.jsxs("div",{className:"pp-files-area",children:[o.jsxs("div",{className:"pp-sidebar",children:[o.jsxs("div",{className:"pp-sidebar-head",children:[o.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),C&&o.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{Q(!0),V("")},children:o.jsx(Dee,{className:"pp-ic"})})]}),o.jsxs("div",{className:"pp-tree",children:[P&&o.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:ee,onChange:de=>V(de.target.value),onBlur:Gn,onKeyDown:de=>{de.key==="Enter"&&Gn(),de.key==="Escape"&&(Q(!1),V(""))}}),e.files.length===0&&!P?o.jsx("div",{className:"pp-empty",children:"暂无文件"}):dn(zt,0,"")]})]}),o.jsxs("div",{className:"pp-main",children:[o.jsxs("div",{className:"pp-main-head",children:[o.jsx("span",{className:"pp-path",title:ot==null?void 0:ot.path,children:(ot==null?void 0:ot.path)??"未选择文件"}),o.jsx("div",{className:"pp-actions",children:C&&ot&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:ls,children:o.jsx(ste,{className:"pp-ic"})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:Kn,children:o.jsx(dc,{className:"pp-ic"})})]})})]}),o.jsx("div",{className:"pp-content",children:ot==null?o.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):C?o.jsx("div",{className:"pp-codemirror",children:o.jsx(g.Suspense,{fallback:o.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:o.jsx(EAe,{value:ot.content,path:ot.path,onChange:vn})})}):o.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:TAe(ot.content,ot.path)}})})]})]}),c&&o.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[o.jsx("div",{className:"pp-config-head",children:o.jsx("div",{className:"pp-config-title",children:"部署配置"})}),o.jsxs("div",{className:"pp-config-scroll",children:[L,!L&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"发布区域"}),kn(!1)]}),!L&&o.jsxs("section",{className:"pp-config-section pp-auth-section",children:[o.jsx("div",{className:"pp-config-label",children:"访问鉴权"}),I?o.jsx("p",{className:"pp-config-note pp-auth-preserved-note",children:"更新时保持现有 Runtime 的鉴权方式不变。"}):o.jsxs("div",{className:"pp-auth-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"鉴权方式"}),o.jsx(Jz,{ariaLabel:"部署鉴权方式",value:Me,placeholder:"请选择鉴权方式",options:_Ae,disabled:X,onChange:de=>{ae(null),lt(de)}})]}),Me==="user_pool"&&o.jsxs("label",{children:[o.jsx("span",{children:"用户池"}),o.jsx(wAe,{value:Ot,disabled:X,onChange:de=>{ae(null),ut(de)}})]})]})]}),!L&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"消息渠道"}),o.jsx("div",{className:`pp-channel-card${v?" is-flipped":""}`,children:o.jsxs("div",{className:"pp-channel-card-inner",children:[o.jsxs("button",{type:"button",className:"pp-channel-card-face pp-channel-card-front","aria-pressed":v,"aria-hidden":v,tabIndex:v?-1:0,onClick:()=>void qn(),disabled:v||X||we||!y,children:[o.jsx("span",{className:"pp-channel-logo",children:o.jsx("img",{src:_A,alt:""})}),o.jsxs("span",{className:"pp-channel-card-copy",children:[o.jsx("strong",{children:"飞书"}),o.jsx("small",{children:we?"正在启用并更新配置…":"接收消息并通过飞书机器人回复"})]})]}),o.jsxs("div",{className:"pp-channel-card-face pp-channel-card-back","aria-hidden":!v,children:[o.jsxs("div",{className:"pp-channel-card-head",children:[o.jsx("strong",{children:"飞书配置"}),o.jsx("button",{type:"button",className:"pp-channel-remove",tabIndex:v?0:-1,onClick:()=>void qn(),disabled:!v||X||we||!y,children:we?"取消中…":"取消"})]}),o.jsx("div",{className:"pp-channel-fields",children:Qh.map(de=>o.jsxs("label",{children:[o.jsxs("span",{children:[de.comment||de.key,de.required&&o.jsx("small",{children:"必填"})]}),o.jsx("input",{type:de.key.includes("SECRET")?"password":"text",value:E[de.key]??"",placeholder:de.placeholder,tabIndex:v?0:-1,disabled:!v||X||!w,autoComplete:"off",onChange:Ie=>w==null?void 0:w(de.key,Ie.currentTarget.value)})]},de.key))})]})]})})]}),!I&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"实例设置"}),o.jsxs("div",{className:"pp-instance-fields",children:[o.jsxs("label",{htmlFor:"runtime-min-instance",children:[o.jsx("span",{children:"最小实例数"}),o.jsx("input",{id:"runtime-min-instance",type:"number",min:"1",step:"1",inputMode:"numeric",value:wt,disabled:X,"aria-invalid":!ht.valid,onChange:de=>En(de.currentTarget.value)})]}),o.jsxs("label",{htmlFor:"runtime-max-instance",children:[o.jsx("span",{children:"最大实例数"}),o.jsx("input",{id:"runtime-max-instance",type:"number",min:"1",step:"1",inputMode:"numeric",value:Ut,disabled:X,"aria-invalid":!ht.valid,onChange:de=>Pt(de.currentTarget.value)})]})]}),D&&o.jsx("p",{className:"pp-instance-note",role:"note",children:"为避免多实例间会话丢失,推荐将 Runtime 固定为 1~1"}),!ht.valid&&o.jsx("p",{className:"pp-instance-error",role:"alert",children:ht.error})]}),o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"网络"}),L&&kn(!0),I&&o.jsx("p",{className:"pp-config-note",children:"现有 Runtime 的区域与网络模式保持不变。"}),o.jsxs("div",{className:"pp-network-layout",children:[o.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(de=>o.jsxs("label",{className:"pp-network-option",children:[o.jsx("input",{type:"radio",name:"deployment-network-mode",value:de,checked:An===de,onChange:()=>Cn(de),disabled:X||I||!_}),o.jsx("span",{children:de==="public"?"公网":de==="private"?"VPC":"公网 + VPC"})]},de))}),An!=="public"&&o.jsxs("div",{className:"pp-network-fields",children:[o.jsxs("label",{children:[o.jsx("span",{children:"VPC ID"}),o.jsx("input",{value:(S==null?void 0:S.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:X||I,onChange:de=>Ks({vpcId:de.target.value})})]}),o.jsxs("label",{children:[o.jsxs("span",{children:["子网 ID ",o.jsx("small",{children:"可选,多个用逗号分隔"})]}),o.jsx("input",{value:(S==null?void 0:S.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:X||I,onChange:de=>Ks({subnetIds:de.target.value})})]}),o.jsxs("label",{className:"pp-network-check",children:[o.jsx("input",{type:"checkbox",checked:!!(S!=null&&S.enableSharedInternetAccess),disabled:X||I,onChange:de=>Ks({enableSharedInternetAccess:de.target.checked})}),"VPC 内共享公网出口"]})]})]})]}),He&&o.jsxs("section",{className:"pp-config-section",children:[o.jsx("div",{className:"pp-config-label",children:"评测集"}),o.jsxs("label",{className:"pp-evaluation-set-option",children:[o.jsx("input",{type:"checkbox",checked:at,disabled:X,onChange:de=>ft(de.currentTarget.checked)}),o.jsxs("span",{children:[o.jsx("strong",{children:"自动创建评测集"}),o.jsx("small",{children:"部署成功后,自动创建 Good Case 和 Bad Case 评测集。"})]})]})]}),o.jsxs("section",{className:"pp-config-section pp-env-section",children:[o.jsx("div",{className:"pp-env-head",children:o.jsxs("div",{children:[o.jsxs("div",{className:"pp-config-label",children:["环境变量",o.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[Os," 项"]})]}),o.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]})}),o.jsxs("button",{type:"button",className:"pp-env-add",onClick:hi,disabled:X,children:[o.jsx(ji,{className:"pp-ic"}),"添加变量"]}),(At.length>0||Ue.length>0)&&o.jsxs("div",{className:"pp-env-table",children:[At.length>0&&o.jsxs("div",{className:"pp-env-group",children:[o.jsxs("div",{className:"pp-env-group-head",children:[o.jsx("span",{children:"组件自动生成"}),o.jsxs("small",{children:[At.length," 项"]})]}),At.map(de=>{const Ie=de.key.startsWith("ENABLE_"),Be=qA(de,E),it=de.multiline||de.format==="json";return o.jsxs("div",{className:`pp-env-row pp-env-row-derived${it?" is-multiline":""}`,children:[o.jsxs("div",{className:"pp-env-key-fixed pp-env-key-cell","aria-label":`${de.key} 环境变量名`,"aria-disabled":X,children:[o.jsx("span",{title:de.key,children:de.key}),(de.help||de.comment)&&o.jsxs("span",{className:"pp-env-help",tabIndex:0,"data-help":de.help||de.comment,"aria-label":`${de.key}说明:${de.help||de.comment}`,children:["?",o.jsx("span",{className:"pp-env-help-popover",role:"tooltip",children:de.help||de.comment})]}),de.link&&o.jsx("a",{className:"pp-env-link",href:de.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开 OpenViking ${de.link.label}`,"aria-label":`${de.key}:打开 OpenViking ${de.link.label}`,children:o.jsx(Im,{"aria-hidden":"true"})})]}),o.jsxs("div",{className:"pp-env-value-wrap",children:[it?o.jsx("textarea",{className:"pp-env-value pp-env-json-value",value:de.value,placeholder:de.required?"必填,尚未填写":"可选,尚未填写",readOnly:Ie,disabled:X||!Ie&&!w,autoComplete:"off",spellCheck:!1,"aria-invalid":!!Be,"aria-label":`${de.key} 环境变量值`,onChange:et=>w==null?void 0:w(de.key,et.currentTarget.value)}):o.jsx("input",{className:"pp-env-value",type:"text",value:de.value,placeholder:de.required?"必填,尚未填写":"可选,尚未填写",readOnly:Ie,disabled:X||!Ie&&!w,autoComplete:"off","aria-invalid":!!Be,"aria-label":`${de.key} 环境变量值`,onChange:et=>w==null?void 0:w(de.key,et.currentTarget.value)}),Be&&o.jsx("span",{className:"pp-env-error",children:Be})]}),o.jsx("span",{className:"pp-env-source",children:Ie?"自动":"同步"})]},de.key)})]}),Ue.length>0&&o.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[o.jsx("span",{children:"自定义变量"}),o.jsxs("small",{children:[Ue.length," 项"]})]}),Ue.map(de=>o.jsxs("div",{className:"pp-env-row",children:[o.jsx("input",{value:de.key,placeholder:"名称",disabled:X,autoComplete:"off",onChange:Ie=>Ss(de.id,{key:Ie.currentTarget.value})}),o.jsx("input",{type:"text",value:de.value,placeholder:"值",disabled:X,autoComplete:"off",onChange:Ie=>Ss(de.id,{value:Ie.currentTarget.value})}),o.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:X,onClick:()=>Ns(de.id),children:o.jsx(Oi,{className:"pp-ic"})})]},de.id))]})]}),(X||me||Object.keys(Je).length>0)&&o.jsxs("section",{className:"pp-config-section pp-progress-section",children:[o.jsx("div",{className:"pp-config-label",children:"部署进度"}),o.jsx("ol",{className:"pp-steps",children:sn.map((de,Ie)=>{const Be=Fe?sn.findIndex(je=>je.phase===Fe):-1,it=!!Ne&&(Be===-1?Ie===0:Ie===Be);let et;me?et="done":it?et="failed":Be===-1?et=X?"active":"pending":Iede.phase===Fe))==null?void 0:xs.label)??Fe}阶段):`:""}${Ne}`,onRetry:Yn,retryLabel:I?"重试更新":"重试部署"}),me&&o.jsxs("section",{className:"pp-deploy-result",children:[o.jsx("div",{className:"pp-deploy-result-header",children:I?"更新成功":"部署成功"}),o.jsxs("div",{className:"pp-deploy-result-body",children:[me.warnings&&me.warnings.length>0&&o.jsx("div",{className:"pp-deploy-result-warning",role:"status",children:me.warnings.map(de=>o.jsx("span",{children:de},de))}),me.region&&o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"区域"}),o.jsx("code",{children:Nf(me.region,T)})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"Agent 名称"}),o.jsx("code",{children:me.agentName})]}),o.jsxs("div",{className:"pp-deploy-result-field",children:[o.jsx("label",{children:"API 端点"}),o.jsx("code",{className:"pp-deploy-result-url",children:me.url})]})]}),o.jsxs("div",{className:"pp-deploy-result-actions",children:[o.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:ys,disabled:Ce,children:[Ce?o.jsx(yn,{className:"pp-ic spin"}):o.jsx(zB,{className:"pp-ic"}),Ce?"连接中…":"立即对话"]}),me.consoleUrl&&o.jsxs("a",{href:me.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[o.jsx(Im,{className:"pp-ic"}),"控制台"]})]})]})]}),o.jsx("div",{className:`pp-config-actions${ye?" is-external":""}`,children:ye?wi.createPortal(o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Yn,disabled:X||we||F||!!n,title:n,children:X?`${f}中…`:Ne?`重试${f}`:f}),ye):o.jsx("button",{type:"button",className:"pp-deploy studio-update-action",onClick:Yn,disabled:X||we||F||!!n,title:n,children:X?`${f}中…`:Ne?`重试${f}`:f})})]})]}),be&&s&&wi.createPortal(o.jsx("div",{className:"pp-flow-backdrop",onMouseDown:de=>{de.target===de.currentTarget&&ue(!1)},children:o.jsxs("section",{className:"pp-flow-dialog",role:"dialog","aria-modal":"true","aria-label":"执行流程预览",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"执行流程"}),o.jsx("span",{children:"只读预览,可缩放与拖动画布"})]}),o.jsx("button",{type:"button",onClick:()=>ue(!1),"aria-label":"关闭执行流程预览",children:o.jsx(Oi,{"aria-hidden":!0})})]}),o.jsx("div",{className:"pp-flow-dialog-canvas",children:o.jsx(zm,{draft:s,direction:"horizontal",selectedPath:[],onSelect:Nl,onAdd:Nl,onInsert:Nl,onDelete:Nl,readOnly:!0,interactivePreview:!0})})]})}),document.body),o.jsx(vAe,{open:ce,isUpdate:I,onCancel:Ls,onConfirm:()=>void Wn()})]})}const fD="dogfooding",Jw="dogfooding",e_="dogfooding_b";let PAe=0;const t_=()=>++PAe;function hD(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function BAe(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function pD(e,t="volcengine"){const n=[],s=BAe(e);n.push(s);const i=s.indexOf("{"),r=s.lastIndexOf("}");i>=0&&r>i&&n.push(s.slice(i,r+1));for(const a of n)try{const l=JSON.parse(a);if(l&&typeof l=="object"&&(typeof l.name=="string"||typeof l.instruction=="string"))return await kx(GA({...l,cloudProvider:t}))}catch{}return null}function UAe({userId:e,cloudProvider:t="volcengine",onBack:n,onCreate:s,onAgentAdded:i,onDeploymentTaskChange:r}){const[a,l]=g.useState([{id:t_(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[c,u]=g.useState(""),[d,f]=g.useState(!1),[h,p]=g.useState(null),[m,b]=g.useState(null),[v,y]=g.useState(!1),[x,E]=g.useState(null),[w,S]=g.useState(null),[_,T]=g.useState(!1),[k,A]=g.useState(!1),[j,R]=g.useState({}),B=g.useRef(null),z=g.useRef(null),L=g.useRef(null),F=g.useRef(null),C=g.useRef(null);g.useEffect(()=>{const V=F.current;V&&V.scrollTo({top:V.scrollHeight,behavior:"smooth"})},[a,d]),g.useEffect(()=>{const V=C.current;V&&(V.style.height="auto",V.style.height=Math.min(V.scrollHeight,160)+"px")},[c]);const I=V=>l(X=>[...X,{id:t_(),role:"assistant",text:V}]);async function D(){if(B.current)return B.current;const V=await a1(fD,e);return B.current=V,V}async function $(V,X){if(X.current)return X.current;const K=await a1(V,e);return X.current=K,K}async function O(V,X){if(!j[V])try{const K=await d2(X);R(ce=>({...ce,[V]:K.model||X}))}catch{R(K=>({...K,[V]:X}))}}async function te(V,X,K){const ce=await $(V,X);let he=Oa();for await(const ue of jm({appName:V,userId:e,sessionId:ce,text:K}))he=Tf(he,ue);const be=hD(he).trim();return{project:await pD(be,t),finalText:be}}const se=async(V,X,K)=>vg(V.name,V.files,{region:"cn-beijing",projectName:"default"},{...K,onStage:X}),P=async()=>{const V=c.trim();if(!(!V||d)){if(l(X=>[...X,{id:t_(),role:"user",text:V}]),u(""),p(null),f(!0),v){E(null),S(null),T(!0),A(!0),O("a",Jw),O("b",e_);const X=te(Jw,z,V).then(({project:ce})=>(E(ce),ce)).catch(ce=>{const he=ce instanceof Error?ce.message:String(ce);return p(he),null}).finally(()=>T(!1)),K=te(e_,L,V).then(({project:ce})=>(S(ce),ce)).catch(ce=>{const he=ce instanceof Error?ce.message:String(ce);return p(he),null}).finally(()=>A(!1));try{const[ce,he]=await Promise.all([X,K]),be=[ce?`方案 A:${ce.name}`:null,he?`方案 B:${he.name}`:null].filter(Boolean);be.length?I(`已生成两个方案(${be.join(",")}),请在右侧对比后采用其一。`):I("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{f(!1)}return}try{const X=await D();let K=Oa();for await(const be of jm({appName:fD,userId:e,sessionId:X,text:V}))K=Tf(K,be);const ce=hD(K).trim(),he=await pD(ce,t);he?(b(he),I(`已生成项目:${he.name}(${he.files.length} 个文件),可在右侧预览和编辑。`)):I(ce||"(助手没有返回内容,请再描述一下你的需求。)")}catch(X){const K=X instanceof Error?X.message:String(X);p(K),I(`抱歉,调用智能构建助手失败:${K}`)}finally{f(!1)}}},Q=V=>{const X=V==="a"?x:w;if(!X)return;b(X),y(!1),E(null),S(null),T(!1),A(!1);const K=V==="a"?"A":"B",ce=V==="a"?j.a:j.b;I(`已采用方案 ${K}(${ce??(V==="a"?Jw:e_)}),可继续编辑。`)},ee=V=>{V.key==="Enter"&&!V.shiftKey&&!V.nativeEvent.isComposing&&(V.preventDefault(),P())};return o.jsx("div",{className:"ic-root",children:o.jsxs("div",{className:"ic-body",children:[o.jsxs("div",{className:"ic-chat",children:[o.jsxs("div",{className:"ic-transcript",ref:F,children:[o.jsx(Ko,{initial:!1,children:a.map(V=>o.jsxs(is.div,{className:`ic-turn ic-turn--${V.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[V.role==="assistant"&&o.jsx("div",{className:"ic-avatar",children:o.jsx(pu,{className:"ic-avatar-icon"})}),o.jsx("div",{className:"ic-bubble",children:V.role==="assistant"?o.jsx(ph,{text:V.text}):V.text})]},V.id))}),d&&o.jsxs(is.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[o.jsx("div",{className:"ic-avatar",children:o.jsx(pu,{className:"ic-avatar-icon"})}),o.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"}),o.jsx("span",{className:"ic-dot"})]})]})]}),h&&o.jsxs("div",{className:"ic-error",children:[o.jsx(Gk,{className:"ic-error-icon"}),h]}),o.jsxs("div",{className:"ic-composer",children:[o.jsxs("div",{className:"ic-composer-box",children:[o.jsx("textarea",{ref:C,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:c,onChange:V=>u(V.target.value),onKeyDown:ee,disabled:d}),o.jsx("button",{className:"ic-send",onClick:()=>void P(),disabled:!c.trim()||d,title:"发送 (Enter)",children:o.jsx(lte,{className:"ic-send-icon"})})]}),o.jsxs("div",{className:"ic-composer-foot",children:[o.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[o.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:v,disabled:d,onChange:V=>y(V.target.checked)}),o.jsx("span",{className:"ic-ab-track",children:o.jsx("span",{className:"ic-ab-thumb"})}),o.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),o.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),o.jsx("aside",{className:"ic-preview",children:v?o.jsxs("div",{className:"ic-compare",children:[o.jsx(mD,{side:"a",project:x,loading:_,model:j.a,onAdopt:()=>Q("a")}),o.jsx("div",{className:"ic-compare-divider"}),o.jsx(mD,{side:"b",project:w,loading:k,model:j.b,onAdopt:()=>Q("b")})]}):m?o.jsx(yE,{project:m,onChange:b,onDeploy:se,onAgentAdded:i,onDeploymentTaskChange:r,deploymentTelemetry:{source:"scratch",createMode:"intelligent",aiAssisted:!0}}):o.jsxs("div",{className:"ic-preview-empty",children:[o.jsxs("div",{className:"ic-preview-empty-icon",children:[o.jsx(Fee,{className:"ic-preview-empty-glyph"}),o.jsx(mu,{className:"ic-preview-empty-spark"})]}),o.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),o.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function mD({side:e,project:t,loading:n,model:s,onAdopt:i}){const r=e==="a"?"方案 A":"方案 B";return o.jsxs("div",{className:"ic-pane",children:[o.jsxs("div",{className:"ic-pane-head",children:[o.jsxs("div",{className:"ic-pane-title",children:[o.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:r}),s&&o.jsx("span",{className:"ic-pane-model",children:s})]}),o.jsxs("button",{className:"ic-adopt",onClick:i,disabled:!t||n,title:`采用${r}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),o.jsx("div",{className:"ic-pane-body",children:n?o.jsxs("div",{className:"ic-pane-loading",children:[o.jsx(yn,{className:"ic-pane-spinner"}),o.jsx("span",{children:"正在生成…"})]}):t?o.jsx(yE,{project:t}):o.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}var FAe=Object.defineProperty,YA=(e,t)=>FAe(e,"name",{value:t,configurable:!0});function zN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}YA(zN,"setRef");function eV(...e){return t=>{let n=!1;const s=e.map(i=>{const r=zN(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i$Ae(e,"name",{value:t,configurable:!0});function Vf(e){const t=g.forwardRef((n,s)=>{let{children:i,...r}=n,a=null,l=!1;const c=[];VN(i)&&typeof vb=="function"&&(i=vb(i._payload)),g.Children.forEach(i,h=>{var p;if(iV(h)){l=!0;const m=h;let b="child"in m.props?m.props.child:m.props.children;VN(b)&&typeof vb=="function"&&(b=vb(b._payload)),a=zAe(m,b),c.push((p=a==null?void 0:a.props)==null?void 0:p.children)}else c.push(h)}),a?a=g.cloneElement(a,void 0,c):!l&&g.Children.count(i)===1&&g.isValidElement(i)&&(a=i);const u=a?sV(a):void 0,d=br(s,u);if(!a){if(i||i===0)throw new Error(l?KAe(e):GAe(e));return i}const f=nV(r,a.props??{});return a.type!==g.Fragment&&(f.ref=s?d:u),g.cloneElement(a,f)});return t.displayName=`${e}.Slot`,t}Ka(Vf,"createSlot");var tV=Symbol.for("radix.slottable");function HAe(e){const t=Ka(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=tV,t}Ka(HAe,"createSlottable");var zAe=Ka((e,t)=>{if("child"in e.props){const n=e.props.child;return g.isValidElement(n)?g.cloneElement(n,void 0,e.props.children(n.props.children)):null}return g.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function nV(e,t){const n={...t};for(const s in t){const i=e[s],r=t[s];/^on[A-Z]/.test(s)?i&&r?n[s]=(...l)=>{const c=r(...l);return i(...l),c}:i&&(n[s]=i):s==="style"?n[s]={...i,...r}:s==="className"&&(n[s]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}Ka(nV,"mergeProps");function sV(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Ka(sV,"getElementRef");function iV(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tV}Ka(iV,"isSlottable");var VAe=Symbol.for("react.lazy");function VN(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===VAe&&"_payload"in e&&rV(e._payload)}Ka(VN,"isLazyComponent");function rV(e){return typeof e=="object"&&e!==null&&"then"in e}Ka(rV,"isPromiseLike");var GAe=Ka(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),KAe=Ka(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),vb=qf[" use ".trim().toString()],qAe=Object.defineProperty,YAe=(e,t)=>qAe(e,"name",{value:t,configurable:!0}),WAe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pa=WAe.reduce((e,t)=>{const n=Vf(`Primitive.${t}`),s=g.forwardRef((i,r)=>{const{asChild:a,...l}=i,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:r})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function XAe(e,t){e&&wi.flushSync(()=>e.dispatchEvent(t))}YAe(XAe,"dispatchDiscreteCustomEvent");var QAe=Object.defineProperty,la=(e,t)=>QAe(e,"name",{value:t,configurable:!0});function ZAe(e,t){const n=g.createContext(t);n.displayName=e+"Context";const s=la(r=>{const{children:a,...l}=r,c=g.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:a})},"Provider");s.displayName=e+"Provider";function i(r,a={}){const{optional:l=!1}=a,c=g.useContext(n);if(c)return c;if(t!==void 0)return t;if(!l)throw new Error(`\`${r}\` must be used within \`${e}\``)}return la(i,"useContext"),[s,i]}la(ZAe,"createContext");function vc(e,t=[]){let n=[];function s(r,a){const l=g.createContext(a);l.displayName=r+"Context";const c=n.length;n=[...n,a];const u=la(f=>{var y;const{scope:h,children:p,...m}=f,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=g.useMemo(()=>m,Object.values(m));return o.jsx(b.Provider,{value:v,children:p})},"Provider");u.displayName=r+"Provider";function d(f,h,p={}){var y;const{optional:m=!1}=p,b=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,v=g.useContext(b);if(v)return v;if(a!==void 0)return a;if(!m)throw new Error(`\`${f}\` must be used within \`${r}\``)}return la(d,"useContext"),[u,d]}la(s,"createContext");const i=la(()=>{const r=n.map(a=>g.createContext(a));return la(function(l){const c=(l==null?void 0:l[e])||r;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])},"useScope")},"createScope");return i.scopeName=e,[s,aV(i,...t)]}la(vc,"createContextScope");function aV(...e){const t=e[0];if(e.length===1)return t;const n=la(()=>{const s=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return la(function(r){const a=s.reduce((l,{useScope:c,scopeName:u})=>{const f=c(r)[`__scope${u}`];return{...l,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}la(aV,"composeContextScopes");var JAe=Object.defineProperty,xi=(e,t)=>JAe(e,"name",{value:t,configurable:!0});function oV(e){const t=e+"CollectionProvider",[n,s]=vc(t),[i,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=xi(b=>{const{scope:v,children:y}=b,x=g.useRef(null),E=g.useRef(new Map).current;return o.jsx(i,{scope:v,itemMap:E,collectionRef:x,children:y})},"CollectionProvider");a.displayName=t;const l=e+"CollectionSlot",c=Vf(l),u=g.forwardRef((b,v)=>{const{scope:y,children:x}=b,E=r(l,y),w=br(v,E.collectionRef);return o.jsx(c,{ref:w,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Vf(d),p=g.forwardRef((b,v)=>{const{scope:y,children:x,...E}=b,w=g.useRef(null),S=br(v,w),_=r(d,y);return g.useEffect(()=>(_.itemMap.set(w,{ref:w,...E}),()=>void _.itemMap.delete(w))),o.jsx(h,{[f]:"",ref:S,children:x})});p.displayName=d;function m(b){const v=r(e+"CollectionConsumer",b);return g.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const E=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((_,T)=>E.indexOf(_.ref.current)-E.indexOf(T.ref.current))},[v.collectionRef,v.itemMap])}return xi(m,"useCollection"),[{Provider:a,Slot:u,ItemSlot:p},m,s]}xi(oV,"createCollection");var gD=new WeakMap,Qs,Ar,n_=(Ar=class extends Map{constructor(n){super(n);GC(this,Qs);ZE(this,Qs,[...super.keys()]),gD.set(this,!0)}set(n,s){return gD.get(this)&&(this.has(n)?Li(this,Qs)[Li(this,Qs).indexOf(n)]=n:Li(this,Qs).push(n)),super.set(n,s),this}insert(n,s,i){const r=this.has(s),a=Li(this,Qs).length,l=WA(n);let c=l>=0?l:a+l;const u=c<0||c>=a?-1:c;if(u===this.size||r&&u===this.size-1||u===-1)return this.set(s,i),this;const d=this.size+(r?0:1);l<0&&c++;const f=[...Li(this,Qs)];let h,p=!1;for(let m=c;m=this.size&&(r=this.size-1),this.at(r)}keyFrom(n,s){const i=this.indexOf(n);if(i===-1)return;let r=i+s;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(n,s){let i=0;for(const r of this){if(Reflect.apply(n,s,[r,i,this]))return r;i++}}findIndex(n,s){let i=0;for(const r of this){if(Reflect.apply(n,s,[r,i,this]))return i;i++}return-1}filter(n,s){const i=[];let r=0;for(const a of this)Reflect.apply(n,s,[a,r,this])&&i.push(a),r++;return new Ar(i)}map(n,s){const i=[];let r=0;for(const a of this)i.push([a[0],Reflect.apply(n,s,[a,r,this])]),r++;return new Ar(i)}reduce(...n){const[s,i]=n;let r=0,a=i??this.at(0);for(const l of this)r===0&&n.length===1?a=l:a=Reflect.apply(s,this,[a,l,r,this]),r++;return a}reduceRight(...n){const[s,i]=n;let r=i??this.at(-1);for(let a=this.size-1;a>=0;a--){const l=this.at(a);a===this.size-1&&n.length===1?r=l:r=Reflect.apply(s,this,[r,l,a,this])}return r}toSorted(n){const s=[...this.entries()].sort(n);return new Ar(s)}toReversed(){const n=new Ar;for(let s=this.size-1;s>=0;s--){const i=this.keyAt(s),r=this.get(i);n.set(i,r)}return n}toSpliced(...n){const s=[...this.entries()];return s.splice(...n),new Ar(s)}slice(n,s){const i=new Ar;let r=this.size-1;if(n===void 0)return i;n<0&&(n=n+this.size),s!==void 0&&s>0&&(r=s-1);for(let a=n;a<=r;a++){const l=this.keyAt(a),c=this.get(l);i.set(l,c)}return i}every(n,s){let i=0;for(const r of this){if(!Reflect.apply(n,s,[r,i,this]))return!1;i++}return!0}some(n,s){let i=0;for(const r of this){if(Reflect.apply(n,s,[r,i,this]))return!0;i++}return!1}},Qs=new WeakMap,xi(Ar,"OrderedDict"),Ar);function my(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=lV(e,t);return n===-1?void 0:e[n]}xi(my,"at");function lV(e,t){const n=e.length,s=WA(t),i=s>=0?s:n+s;return i<0||i>=n?-1:i}xi(lV,"toSafeIndex");function WA(e){return e!==e||e===0?0:Math.trunc(e)}xi(WA,"toSafeInteger");function eCe(e){const t=e+"CollectionProvider",[n,s]=vc(t),[i,r]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new n_,setItemMap:xi(()=>{},"setItemMap")}),a=xi(({state:E,...w})=>E?o.jsx(c,{...w,state:E}):o.jsx(l,{...w}),"CollectionProvider");a.displayName=t;const l=xi(E=>{const w=v();return o.jsx(c,{...E,state:w})},"CollectionInit");l.displayName=t+"Init";const c=xi(E=>{const{scope:w,children:S,state:_}=E,T=g.useRef(null),[k,A]=g.useState(null),j=br(T,A),[R,B]=_;return g.useEffect(()=>{if(!k)return;const z=dV(()=>{});return z.observe(k,{childList:!0,subtree:!0}),()=>{z.disconnect()}},[k]),o.jsx(i,{scope:w,itemMap:R,setItemMap:B,collectionRef:j,collectionRefObject:T,collectionElement:k,children:S})},"CollectionProviderImpl");c.displayName=t+"Impl";const u=e+"CollectionSlot",d=Vf(u),f=g.forwardRef((E,w)=>{const{scope:S,children:_}=E,T=r(u,S),k=br(w,T.collectionRef);return o.jsx(d,{ref:k,children:_})});f.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",m=Vf(h),b=g.forwardRef((E,w)=>{const{scope:S,children:_,...T}=E,k=g.useRef(null),[A,j]=g.useState(null),R=br(w,k,j),B=r(h,S),{setItemMap:z}=B,L=g.useRef(T);cV(L.current,T)||(L.current=T);const F=L.current;return g.useEffect(()=>{const C=F;return z(I=>A?I.has(A)?I.set(A,{...C,element:A}).toSorted(GN):(I.set(A,{...C,element:A}),I.toSorted(GN)):I),()=>{z(I=>!A||!I.has(A)?I:(I.delete(A),new n_(I)))}},[A,F,z]),o.jsx(m,{[p]:"",ref:R,children:_})});b.displayName=h;function v(){return g.useState(new n_)}xi(v,"useInitCollection");function y(E){const{itemMap:w}=r(e+"CollectionConsumer",E);return w}return xi(y,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:s,useCollection:y,useInitCollection:v}]}xi(eCe,"createCollection");function cV(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}xi(cV,"shallowEqual");function uV(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}xi(uV,"isElementPreceding");function GN(e,t){return!e[1].element||!t[1].element?0:uV(e[1].element,t[1].element)?-1:1}xi(GN,"sortByDocumentPosition");function dV(e){return new MutationObserver(n=>{for(const s of n)if(s.type==="childList"){e();return}})}xi(dV,"getChildListObserver");var tCe=Object.defineProperty,wh=(e,t)=>tCe(e,"name",{value:t,configurable:!0}),fV=!!(typeof window<"u"&&window.document&&window.document.createElement);function er(e,t,{checkForDefaultPrevented:n=!0}={}){return wh(function(i){if(e==null||e(i),n===!1||!i||!i.defaultPrevented)return t==null?void 0:t(i)},"handleEvent")}wh(er,"composeEventHandlers");function nCe(e){var t;if(!fV)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}wh(nCe,"getOwnerWindow");function KN(e){if(!fV)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}wh(KN,"getOwnerDocument");function hV(e,t=!1){const{activeElement:n}=KN(e);if(!(n!=null&&n.nodeName))return null;if(pV(n)&&n.contentDocument)return hV(n.contentDocument.body,t);if(t){const s=n.getAttribute("aria-activedescendant");if(s){const i=KN(n).getElementById(s);if(i)return i}}return n}wh(hV,"getActiveElement");function pV(e){return e.tagName==="IFRAME"}wh(pV,"isFrame");var Su=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},sCe=Object.defineProperty,iCe=(e,t)=>sCe(e,"name",{value:t,configurable:!0}),bD=qf[" useEffectEvent ".trim().toString()],yD=qf[" useInsertionEffect ".trim().toString()];function mV(e){if(typeof bD=="function")return bD(e);const t=g.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof yD=="function"?yD(()=>{t.current=e}):Su(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}iCe(mV,"useEffectEvent");var rCe=Object.defineProperty,Gg=(e,t)=>rCe(e,"name",{value:t,configurable:!0}),aCe=qf[" useInsertionEffect ".trim().toString()]||Su;function Uu({prop:e,defaultProp:t,onChange:n=Gg(()=>{},"onChange"),caller:s}){const[i,r,a]=gV({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i,u=g.useCallback(d=>{var f;if(l){const h=bV(d)?d(e):d;h!==e&&((f=a.current)==null||f.call(a,h))}else r(d)},[l,e,r,a]);return[c,u]}Gg(Uu,"useControllableState");function gV({defaultProp:e,onChange:t}){const[n,s]=g.useState(e),i=g.useRef(n),r=g.useRef(t);return aCe(()=>{r.current=t},[t]),g.useEffect(()=>{var a;i.current!==n&&((a=r.current)==null||a.call(r,n),i.current=n)},[n,i]),[n,s,r]}Gg(gV,"useUncontrolledState");function bV(e){return typeof e=="function"}Gg(bV,"isFunction");var xD=Symbol("RADIX:SYNC_STATE");function oCe(e,t,n,s){const{prop:i,defaultProp:r,onChange:a,caller:l}=t,c=i!==void 0,u=mV(a),d=[{...n,state:r}];s&&d.push(s);const[f,h]=g.useReducer((v,y)=>{if(y.type===xD)return{...v,state:y.state};const x=e(v,y);return c&&!Object.is(x.state,v.state)&&u(x.state),x},...d),p=f.state,m=g.useRef(p);g.useEffect(()=>{m.current!==p&&(m.current=p,c||u(p))},[p,m,c]);const b=g.useMemo(()=>i!==void 0?{...f,state:i}:f,[f,i]);return g.useEffect(()=>{c&&!Object.is(i,f.state)&&h({type:xD,state:i})},[i,f.state,c]),[b,h]}Gg(oCe,"useControllableStateReducer");var lCe=Object.defineProperty,ul=(e,t)=>lCe(e,"name",{value:t,configurable:!0});function yV(e,t){return g.useReducer((n,s)=>t[n][s]??n,e)}ul(yV,"useStateMachine");var xV=ul(e=>{const{present:t,children:n}=e,s=EV(t),i=typeof n=="function"?n({present:s.isPresent}):g.Children.only(n),r=vV(s.ref,wV(i));return typeof n=="function"||s.isPresent?g.cloneElement(i,{ref:r}):null},"Presence");function EV(e){const[t,n]=g.useState(),s=g.useRef(null),i=g.useRef(e),r=g.useRef("none"),a=g.useRef(void 0),l=e?"mounted":"unmounted",[c,u]=yV(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{c==="mounted"?(r.current=a.current??xd(s.current),a.current=void 0):r.current="none"},[c]),Su(()=>{const d=s.current,f=i.current;if(f!==e){const p=r.current,m=xd(d);e?(a.current=m,u("MOUNT")):m==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),Su(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=ul(m=>{const v=xd(s.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(u("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),p=ul(m=>{m.target===t&&(r.current=xd(s.current))},"handleAnimationStart");return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:g.useCallback(d=>{if(d){const f=getComputedStyle(d);s.current=f,a.current=xd(f)}else s.current=null;n(d)},[])}}ul(EV,"usePresence");function qN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}ul(qN,"setRef");function vV(...e){const t=g.useRef(e);return t.current=e,g.useCallback(n=>{const s=t.current;let i=!1;const r=s.map(a=>{const l=qN(a,n);return!i&&typeof l=="function"&&(i=!0),l});if(i)return()=>{for(let a=0;acCe(e,"name",{value:t,configurable:!0}),dCe=qf[" useId ".trim().toString()]||(()=>{}),fCe=0;function _V(e){const[t,n]=g.useState(dCe());return Su(()=>{e||n(s=>s??String(fCe++))},[e]),e||(t?`radix-${t}`:"")}uCe(_V,"useId");var hCe=Object.defineProperty,pCe=(e,t)=>hCe(e,"name",{value:t,configurable:!0}),mCe=g.createContext(void 0);function xE(e){const t=g.useContext(mCe);return e||t||"ltr"}pCe(xE,"useDirection");var gCe=Object.defineProperty,bCe=(e,t)=>gCe(e,"name",{value:t,configurable:!0});function SV(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}bCe(SV,"useCallbackRef");var yCe=Object.defineProperty,xCe=(e,t)=>yCe(e,"name",{value:t,configurable:!0});function XA(e){const[t,n]=g.useState(void 0);return Su(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const r=i[0];let a,l;if("borderBoxSize"in r){const c=r.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else n(void 0)},[e]),t}xCe(XA,"useSize");var ECe=Object.defineProperty,dl=(e,t)=>ECe(e,"name",{value:t,configurable:!0}),QA="Checkbox",[vCe,uLe]=vc(QA),[wCe,ZA]=vCe(QA);function NV(e){const{__scopeCheckbox:t,checked:n,children:s,defaultChecked:i,disabled:r,form:a,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,p]=Uu({prop:n,defaultProp:i??!1,onChange:c,caller:QA}),[m,b]=g.useState(null),[v,y]=g.useState(null),x=g.useRef(!1),[E,w]=g.useReducer(T=>T+1,0),S=m?!!a||!!m.closest("form"):!0,_={checked:h,disabled:r,setChecked:p,control:m,setControl:b,name:l,form:a,value:d,hasConsumerStoppedPropagationRef:x,userInteractionCount:E,onUserInteraction:w,required:u,defaultChecked:tl(i)?!1:i,isFormControl:S,bubbleInput:v,setBubbleInput:y};return o.jsx(wCe,{scope:t,..._,children:TV(f)?f(_):s})}dl(NV,"CheckboxProvider");var _Ce="CheckboxTrigger",SCe=g.forwardRef(dl(function({__scopeCheckbox:t,onKeyDown:n,onClick:s,...i},r){const{control:a,value:l,disabled:c,checked:u,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:p,onUserInteraction:m,isFormControl:b,bubbleInput:v}=ZA(_Ce,t),y=br(r,f),x=g.useRef(u);return g.useEffect(()=>{const E=a==null?void 0:a.form;if(E){const w=dl(()=>h(x.current),"reset");return E.addEventListener("reset",w),()=>E.removeEventListener("reset",w)}},[a,h]),o.jsx(pa.button,{type:"button",role:"checkbox","aria-checked":tl(u)?"mixed":u,"aria-required":d,"data-state":JA(u),"data-disabled":c?"":void 0,disabled:c,value:l,...i,ref:y,onKeyDown:er(n,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:er(s,E=>{m(),h(w=>tl(w)?!0:!w),v&&b&&(p.current=E.isPropagationStopped(),p.current||E.stopPropagation())})})},"CheckboxTrigger")),NCe=g.forwardRef(dl(function(t,n){const{__scopeCheckbox:s,name:i,checked:r,defaultChecked:a,required:l,disabled:c,value:u,onCheckedChange:d,form:f,...h}=t;return o.jsx(NV,{__scopeCheckbox:s,checked:r,defaultChecked:a,disabled:c,required:l,onCheckedChange:d,name:i,form:f,value:u,internal_do_not_use_render:({isFormControl:p})=>o.jsxs(o.Fragment,{children:[o.jsx(SCe,{...h,ref:n,__scopeCheckbox:s}),p&&o.jsx(CCe,{__scopeCheckbox:s})]})})},"Checkbox")),TCe="CheckboxIndicator",kCe=g.forwardRef(dl(function(t,n){const{__scopeCheckbox:s,forceMount:i,...r}=t,a=ZA(TCe,s);return o.jsx(xV,{present:i||tl(a.checked)||a.checked===!0,children:o.jsx(pa.span,{"data-state":JA(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n,style:{pointerEvents:"none",...t.style}})})},"CheckboxIndicator")),ACe="CheckboxBubbleInput",CCe=g.forwardRef(dl(function({__scopeCheckbox:t,onClick:n,...s},i){const{control:r,hasConsumerStoppedPropagationRef:a,userInteractionCount:l,checked:c,defaultChecked:u,required:d,disabled:f,name:h,value:p,form:m,bubbleInput:b,setBubbleInput:v}=ZA(ACe,t),y=br(i,v),x=XA(r),E=g.useRef(!1),w=g.useRef(c),S=g.useRef(l);g.useEffect(()=>{const T=b;if(!T)return;const k=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(k,"checked").set,R=l!==S.current;S.current=l;const B=w.current!==c;w.current=c;const z=!(R&&a.current);if(B&&j){E.current=!R;const L=new Event("click",{bubbles:z});T.indeterminate=tl(c),j.call(T,tl(c)?!1:c),T.dispatchEvent(L),E.current=!1}},[b,c,a,l]);const _=g.useRef(tl(c)?!1:c);return o.jsx(pa.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??_.current,required:d,disabled:f,name:h,value:p,form:m,...s,tabIndex:-1,ref:y,onClick:er(n,T=>{E.current&&T.stopPropagation()}),style:{...s.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function TV(e){return typeof e=="function"}dl(TV,"isFunction");function tl(e){return e==="indeterminate"}dl(tl,"isIndeterminate");function JA(e){return tl(e)?"indeterminate":e?"checked":"unchecked"}dl(JA,"getState");var ICe=Object.defineProperty,eC=(e,t)=>ICe(e,"name",{value:t,configurable:!0}),s_=!1;function kV(){const[e,t]=g.useState(s_);return g.useEffect(()=>{s_||(s_=!0,t(!0))},[]),e}eC(kV,"useIsHydrated");var AV=qf[" useSyncExternalStore ".trim().toString()];function CV(){return()=>{}}eC(CV,"subscribe");function IV(){return AV(CV,()=>!0,()=>!1)}eC(IV,"useIsHydratedModern");var jCe=typeof AV=="function"?IV:kV,RCe=Object.defineProperty,Fu=(e,t)=>RCe(e,"name",{value:t,configurable:!0}),i_="rovingFocusGroup.onEntryFocus",OCe={bubbles:!1,cancelable:!0},EE="RovingFocusGroup",[YN,jV,MCe]=oV(EE),[LCe,vE]=vc(EE,[MCe]),[DCe,PCe]=LCe(EE),BCe=g.forwardRef(Fu(function(t,n){return o.jsx(YN.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(YN.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(UCe,{...t,ref:n})})})},"RovingFocusGroup")),UCe=g.forwardRef(Fu(function(t,n){const{__scopeRovingFocusGroup:s,orientation:i,loop:r=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=t,p=g.useRef(null),m=br(n,p),b=xE(a),[v,y]=Uu({prop:l,defaultProp:c??null,onChange:u,caller:EE}),[x,E]=g.useState(!1),w=SV(d),S=jV(s),_=g.useRef(!1),[T,k]=g.useState(0);return g.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(i_,w),()=>A.removeEventListener(i_,w)},[w]),o.jsx(DCe,{scope:s,orientation:i,dir:b,loop:r,currentTabStopId:v,onItemFocus:g.useCallback(A=>y(A),[y]),onItemShiftTab:g.useCallback(()=>E(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:g.useCallback(()=>k(A=>A-1),[]),children:o.jsx(pa.div,{tabIndex:x||T===0?-1:0,"data-orientation":i,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:er(t.onMouseDown,()=>{_.current=!0}),onFocus:er(t.onFocus,A=>{const j=!_.current;if(A.target===A.currentTarget&&j&&!x){const R=new CustomEvent(i_,OCe);if(A.currentTarget.dispatchEvent(R),!R.defaultPrevented){const B=S().filter(I=>I.focusable),z=B.find(I=>I.active),L=B.find(I=>I.id===v),C=[z,L,...B].filter(Boolean).map(I=>I.ref.current);tC(C,f)}}_.current=!1}),onBlur:er(t.onBlur,()=>E(!1))})})},"RovingFocusGroupImpl")),FCe="RovingFocusGroupItem",$Ce=g.forwardRef(Fu(function(t,n){const{__scopeRovingFocusGroup:s,focusable:i=!0,active:r=!1,tabStopId:a,children:l,...c}=t,u=_V(),d=a||u,f=PCe(FCe,s),h=f.currentTabStopId===d,p=jV(s),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:v}=f,y=jCe();return Su(()=>{if(!(!y||!i))return m(),()=>b()},[y,i,m,b]),g.useEffect(()=>{if(!(y||!i))return m(),()=>b()},[y,i,m,b]),o.jsx(YN.ItemSlot,{scope:s,id:d,focusable:i,active:r,children:o.jsx(pa.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...c,ref:n,onMouseDown:er(t.onMouseDown,x=>{i?f.onItemFocus(d):x.preventDefault()}),onFocus:er(t.onFocus,()=>f.onItemFocus(d)),onKeyDown:er(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const E=OV(x,f.orientation,f.dir);if(E!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=p().filter(_=>_.focusable).map(_=>_.ref.current);if(E==="last")S.reverse();else if(E==="prev"||E==="next"){E==="prev"&&S.reverse();const _=S.indexOf(x.currentTarget);S=f.loop?MV(S,_+1):S.slice(_+1)}setTimeout(()=>tC(S))}}),children:typeof l=="function"?l({isCurrentTabStop:h,hasTabStop:v!=null}):l})})},"RovingFocusGroupItem")),HCe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function RV(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Fu(RV,"getDirectionAwareKey");function OV(e,t,n){const s=RV(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return HCe[s]}Fu(OV,"getFocusIntent");function tC(e,t=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:t}),document.activeElement!==n))return}Fu(tC,"focusFirst");function MV(e,t){return e.map((n,s)=>e[(t+s)%e.length])}Fu(MV,"wrapArray");var LV=BCe,DV=$Ce,zCe=Object.defineProperty,Fi=(e,t)=>zCe(e,"name",{value:t,configurable:!0}),PV="Radio",[VCe,BV]=vc(PV),[GCe,wE]=VCe(PV);function UV(e){const{__scopeRadio:t,checked:n=!1,children:s,disabled:i,form:r,name:a,onCheck:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[f,h]=g.useState(null),[p,m]=g.useState(null),b=g.useRef(!1),[v,y]=g.useReducer(w=>w+1,0),x=f?!!r||!!f.closest("form"):!0,E={checked:n,disabled:i,required:c,name:a,form:r,value:u,control:f,setControl:h,hasConsumerStoppedPropagationRef:b,userInteractionCount:v,onUserInteraction:y,isFormControl:x,bubbleInput:p,setBubbleInput:m,onCheck:Fi(()=>l==null?void 0:l(),"onCheck")};return o.jsx(GCe,{scope:t,...E,children:FV(d)?d(E):s})}Fi(UV,"RadioProvider");var KCe="RadioTrigger",qCe=g.forwardRef(Fi(function({__scopeRadio:t,onClick:n,...s},i){const{checked:r,disabled:a,value:l,setControl:c,onCheck:u,hasConsumerStoppedPropagationRef:d,onUserInteraction:f,isFormControl:h,bubbleInput:p}=wE(KCe,t),m=br(i,c);return o.jsx(pa.button,{type:"button",role:"radio","aria-checked":r,"data-state":nC(r),"data-disabled":a?"":void 0,disabled:a,value:l,...s,ref:m,onClick:er(n,b=>{r||(f(),u()),p&&h&&(d.current=b.isPropagationStopped(),d.current||b.stopPropagation())})})},"RadioTrigger")),YCe="RadioIndicator",WCe=g.forwardRef(Fi(function(t,n){const{__scopeRadio:s,forceMount:i,...r}=t,a=wE(YCe,s);return o.jsx(xV,{present:i||a.checked,children:o.jsx(pa.span,{"data-state":nC(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:n})})},"RadioIndicator")),XCe="RadioBubbleInput",QCe=g.forwardRef(Fi(function({__scopeRadio:t,onClick:n,...s},i){const{control:r,checked:a,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p,hasConsumerStoppedPropagationRef:m,userInteractionCount:b}=wE(XCe,t),v=br(i,p),y=XA(r),x=g.useRef(!1),E=g.useRef(a),w=g.useRef(b);g.useEffect(()=>{const _=h;if(!_)return;const T=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(T,"checked").set,j=b!==w.current;w.current=b;const R=E.current!==a;E.current=a;const B=!(j&&m.current);if(R&&A){x.current=!j;const z=new Event("click",{bubbles:B});A.call(_,a),_.dispatchEvent(z),x.current=!1}},[h,a,m,b]);const S=g.useRef(a);return o.jsx(pa.input,{type:"radio","aria-hidden":!0,defaultChecked:S.current,required:l,disabled:c,name:u,value:d,form:f,...s,tabIndex:-1,ref:v,onClick:er(n,_=>{x.current&&_.stopPropagation()}),style:{...s.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"RadioBubbleInput"));function FV(e){return typeof e=="function"}Fi(FV,"isFunction");function nC(e){return e?"checked":"unchecked"}Fi(nC,"getState");var ZCe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],sC="RadioGroup",[JCe,dLe]=vc(sC,[vE,BV]),$V=vE(),_E=BV(),[eIe,tIe]=JCe(sC),nIe=g.forwardRef(Fi(function(t,n){const{__scopeRadioGroup:s,name:i,form:r,defaultValue:a,value:l,required:c=!1,disabled:u=!1,orientation:d,dir:f,loop:h=!0,onValueChange:p,...m}=t,b=$V(s),v=xE(f),[y,x]=Uu({prop:l,defaultProp:a??null,onChange:p,caller:sC}),[E,w]=g.useState(null),S=br(n,w),_=g.useRef(y);return g.useEffect(()=>{const T=r?E==null?void 0:E.ownerDocument.getElementById(r):E==null?void 0:E.closest("form");if(T instanceof HTMLFormElement){const k=Fi(()=>x(_.current),"reset");return T.addEventListener("reset",k),()=>T.removeEventListener("reset",k)}},[E,r,x]),o.jsx(eIe,{scope:s,name:i,form:r,required:c,disabled:u,value:y,onValueChange:x,children:o.jsx(LV,{asChild:!0,...b,orientation:d,dir:v,loop:h,children:o.jsx(pa.div,{role:"radiogroup","aria-required":c,"aria-orientation":d,"data-disabled":u?"":void 0,dir:v,...m,ref:S})})})},"RadioGroup")),sIe="RadioGroupItemProvider",iIe="RadioGroupItemTrigger";function HV(e){const{__scopeRadioGroup:t,value:n,disabled:s,children:i,internal_do_not_use_render:r}=e,a=tIe(sIe,t),l=_E(t),c=a.disabled||s;return o.jsx(UV,{...l,checked:a.value===n,disabled:c,required:a.required,name:a.name,form:a.form,value:n,onCheck:()=>a.onValueChange(n),internal_do_not_use_render:r,children:i})}Fi(HV,"RadioGroupItemProvider");var rIe=g.forwardRef(Fi(function(t,n){const{__scopeRadioGroup:s,...i}=t,r=$V(s),a=_E(s),{checked:l,disabled:c}=wE(iIe,a.__scopeRadio),u=g.useRef(null),d=br(n,u),f=g.useRef(!1);return g.useEffect(()=>{const h=Fi(m=>{ZCe.includes(m.key)&&(f.current=!0)},"handleKeyDown"),p=Fi(()=>f.current=!1,"handleKeyUp");return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),o.jsx(DV,{asChild:!0,...r,focusable:!c,active:l,children:o.jsx(qCe,{...a,...i,ref:d,onKeyDown:er(i.onKeyDown,h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:er(i.onFocus,()=>{var h;f.current&&((h=u.current)==null||h.click())})})})},"RadioGroupItemTrigger")),aIe=g.forwardRef(Fi(function(t,n){const{__scopeRadioGroup:s,value:i,disabled:r,...a}=t;return o.jsx(HV,{__scopeRadioGroup:s,value:i,disabled:r,internal_do_not_use_render:({isFormControl:l})=>o.jsxs(o.Fragment,{children:[o.jsx(rIe,{...a,ref:n,__scopeRadioGroup:s}),l&&o.jsx(oIe,{__scopeRadioGroup:s})]})})},"RadioGroupItem")),oIe=g.forwardRef(Fi(function(t,n){const{__scopeRadioGroup:s,...i}=t,r=_E(s);return o.jsx(QCe,{...r,...i,ref:n})},"RadioGroupItemBubbleInput")),lIe=g.forwardRef(Fi(function(t,n){const{__scopeRadioGroup:s,...i}=t,r=_E(s);return o.jsx(WCe,{...r,...i,ref:n})},"RadioGroupIndicator")),cIe=Object.defineProperty,uIe=(e,t)=>cIe(e,"name",{value:t,configurable:!0}),dIe="Toggle",fIe=g.forwardRef(uIe(function(t,n){const{pressed:s,defaultPressed:i,onPressedChange:r,...a}=t,[l,c]=Uu({prop:s,onChange:r,defaultProp:i??!1,caller:dIe});return o.jsx(pa.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":t.disabled?"":void 0,...a,ref:n,onClick:er(t.onClick,()=>{t.disabled||c(!l)})})},"Toggle")),hIe=Object.defineProperty,fc=(e,t)=>hIe(e,"name",{value:t,configurable:!0}),_h="ToggleGroup",[zV,fLe]=vc(_h,[vE]),VV=vE(),pIe=g.forwardRef(fc(function(t,n){const{type:s,...i}=t;if(s==="single"){const r=i;return o.jsx(mIe,{role:"radiogroup",...r,ref:n})}if(s==="multiple"){const r=i;return o.jsx(gIe,{role:"toolbar",...r,ref:n})}throw new Error(`Missing prop \`type\` expected on \`${_h}\``)},"ToggleGroup")),[GV,KV]=zV(_h),mIe=g.forwardRef(fc(function(t,n){const{value:s,defaultValue:i,onValueChange:r=fc(()=>{},"onValueChange"),...a}=t,[l,c]=Uu({prop:s,defaultProp:i??"",onChange:r,caller:_h});return o.jsx(GV,{scope:t.__scopeToggleGroup,type:"single",value:g.useMemo(()=>l?[l]:[],[l]),onItemActivate:c,onItemDeactivate:g.useCallback(()=>c(""),[c]),children:o.jsx(qV,{...a,ref:n})})},"ToggleGroupImplSingle")),gIe=g.forwardRef(fc(function(t,n){const{value:s,defaultValue:i,onValueChange:r=fc(()=>{},"onValueChange"),...a}=t,[l,c]=Uu({prop:s,defaultProp:i??[],onChange:r,caller:_h}),u=g.useCallback(f=>c((h=[])=>[...h,f]),[c]),d=g.useCallback(f=>c((h=[])=>h.filter(p=>p!==f)),[c]);return o.jsx(GV,{scope:t.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:u,onItemDeactivate:d,children:o.jsx(qV,{...a,ref:n})})},"ToggleGroupImplMultiple")),[bIe,yIe]=zV(_h),qV=g.forwardRef(fc(function(t,n){const{__scopeToggleGroup:s,disabled:i=!1,rovingFocus:r=!0,orientation:a,dir:l,loop:c=!0,...u}=t,d=VV(s),f=xE(l),h={dir:f,...u};return o.jsx(bIe,{scope:s,rovingFocus:r,disabled:i,children:r?o.jsx(LV,{asChild:!0,...d,orientation:a,dir:f,loop:c,children:o.jsx(pa.div,{...h,ref:n})}):o.jsx(pa.div,{...h,ref:n})})},"ToggleGroupImpl")),WN="ToggleGroupItem",xIe=g.forwardRef(fc(function(t,n){const s=KV(WN,t.__scopeToggleGroup),i=yIe(WN,t.__scopeToggleGroup),r=VV(t.__scopeToggleGroup),a=s.value.includes(t.value),l=i.disabled||t.disabled,c={...t,pressed:a,disabled:l},u=g.useRef(null);return i.rovingFocus?o.jsx(DV,{asChild:!0,...r,focusable:!l,active:a,ref:u,children:o.jsx(ED,{...c,ref:n})}):o.jsx(ED,{...c,ref:n})},"ToggleGroupItem")),ED=g.forwardRef(fc(function(t,n){const{__scopeToggleGroup:s,value:i,...r}=t,a=KV(WN,s),l={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},c=a.type==="single"?l:void 0;return o.jsx(fIe,{...c,...r,ref:n,onPressedChange:u=>{u?a.onItemActivate(i):a.onItemDeactivate(i)}})},"ToggleGroupItemImpl"));const EIe="_Container_1tuad_1",vIe="_Checkbox_1tuad_22",wIe="_CheckMark_1tuad_92",_Ie="_Label_1tuad_162",wb={Container:EIe,Checkbox:vIe,CheckMark:wIe,Label:_Ie},YV=({className:e,label:t,id:n,disabled:s,orientation:i="left",...r})=>{const a=g.useId(),l=n??a;return o.jsxs("div",{"data-disabled":s?"":void 0,"data-has-label":t?"":void 0,"data-orientation":i,className:ga(e,wb.Container),children:[o.jsx(NCe,{className:wb.Checkbox,id:l,disabled:s,...r,children:o.jsx(kCe,{className:wb.CheckMark})}),t&&o.jsx("label",{htmlFor:l,className:wb.Label,onMouseDown:c=>{!c.defaultPrevented&&c.detail>1&&c.preventDefault()},children:t})]})},SIe="_RadioGroup_onrfm_1",NIe="_RadioLabel_onrfm_9",TIe="_RadioIndicatorWrapper_onrfm_26",kIe="_RadioItem_onrfm_43",AIe="_RadioIndicator_onrfm_26",Tp={RadioGroup:SIe,RadioLabel:NIe,RadioIndicatorWrapper:TIe,RadioItem:kIe,RadioIndicator:AIe},WV=g.createContext(null),CIe=()=>{const e=g.use(WV);if(!e)throw new Error("RadioGroup components must be wrapped in ");return e},XN=({onChange:e,children:t,className:n,direction:s="row",disabled:i=!1,...r})=>{const a=g.useMemo(()=>({disabled:i,direction:s}),[i,s]);return o.jsx(WV,{value:a,children:o.jsx(nIe,{className:ga(Tp.RadioGroup,n),"data-direction":s,onValueChange:e,disabled:i,...r,children:t})})},IIe=({value:e,disabled:t=!1,required:n,children:s,className:i,block:r=!1,...a})=>{const{disabled:l}=CIe(),c=l||t,u=g.useId(),d=`${e}-${u}`;return o.jsx("div",{className:"flex",...a,children:o.jsxs("label",{htmlFor:d,className:ga(Tp.RadioLabel,i),"data-disabled":c?"":void 0,"data-block":r?"":void 0,onMouseDown:f=>{!f.defaultPrevented&&f.detail>1&&f.preventDefault()},children:[o.jsx("div",{className:Tp.RadioIndicatorWrapper,children:o.jsx(aIe,{id:d,value:e,disabled:c,required:n,className:Tp.RadioItem,children:o.jsx(lIe,{className:Tp.RadioIndicator})})}),s]})})};XN.Item=IIe;function jIe({className:e,...t}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[o.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}),o.jsx("path",{d:"M12 6.5c.4 2.4 1 3 3.4 3.4-2.4.4-3 1-3.4 3.4-.4-2.4-1-3-3.4-3.4 2.4-.4 3-1 3.4-3.4Z"})]})}const Ed={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:jIe},sequential:{id:"sequential",label:"顺序型智能体",desc:"子 Agent 按顺序依次执行",icon:$ee},parallel:{id:"parallel",label:"并行型智能体",desc:"子 Agent 并行执行后汇总",icon:ute},loop:{id:"loop",label:"循环型智能体",desc:"子 Agent 循环执行到满足条件",icon:Xk},a2a:{id:"a2a",label:"远程智能体",desc:"通过 A2A 协议调用远程 Agent",icon:xx}},RIe=[Ed.llm,Ed.sequential,Ed.parallel,Ed.loop,Ed.a2a];function XV(e){return Ed[e??"llm"]}const QV=e=>e==="sequential"||e==="parallel"||e==="loop",SE=e=>e==="a2a";function hc(e){return e.trimEnd().replace(/[。.]+$/,"")}function U1(e,t){const n=e.trim().toLocaleLowerCase();return n?t.some(s=>s==null?void 0:s.toLocaleLowerCase().includes(n)):!0}function Ic(e,t){return e[t]|e[t+1]<<8}function ud(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function OIe(e){const t=new DecompressionStream("deflate-raw"),n=new Blob([new Uint8Array(e)]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}async function ZV(e,t={}){let s=-1;for(let u=e.length-22;u>=0&&u>e.length-65557;u--)if(ud(e,u)===101010256){s=u;break}if(s<0)throw new Error("无效的 zip:找不到 EOCD");const i=Ic(e,s+10);if(t.maxEntries!==void 0&&i>t.maxEntries)throw new Error(`zip 文件数不能超过 ${t.maxEntries} 个`);let r=ud(e,s+16);const a=new TextDecoder("utf-8"),l=[];let c=0;for(let u=0;ut.maxUncompressedBytes)throw new Error("zip 解压后的内容过大");const x=Ic(e,v+26),E=Ic(e,v+28),w=v+30+x+E,S=e.subarray(w,w+f);let _;if(d===0)_=S;else if(d===8)_=await OIe(S);else{r+=46+p+m+b;continue}l.push({name:y,text:a.decode(_)}),r+=46+p+m+b}return l}const MIe="/harness/skills/findskill";async function LIe(e,t="public"){const n=e.trim(),s=new URLSearchParams({query:n,page_number:"1",page_size:"20"}),i=`${MIe}?${s.toString()}`,r=await fetch(i,{headers:{accept:"application/json"},signal:Bn(void 0,yc)});if(!r.ok)throw new Error(`搜索失败 (${r.status})`);return((await r.json()).items??[]).map(l=>({source:"skillhub",id:l.slug??l.name??"",slug:l.slug??"",name:l.name??l.slug??"",description:l.description??"",namespace:t,sourceRepo:l.sourceRepo,downloadCount:l.downloadCount,version:l.version}))}function DIe({selected:e,onChange:t}){const[n,s]=g.useState(""),[i,r]=g.useState([]),[a,l]=g.useState(!1),[c,u]=g.useState(null),[d,f]=g.useState(!1),h=b=>e.some(v=>v.source==="skillhub"&&v.slug===b),p=b=>{b.slug&&(h(b.slug)?t(e.filter(v=>!(v.source==="skillhub"&&v.slug===b.slug))):t([...e,{source:"skillhub",slug:b.slug,name:b.name,folder:b.slug.split("/").pop()||b.name,namespace:b.namespace||"public",description:b.description}]))},m=async b=>{l(!0),u(null),f(!0);try{const v=await LIe(b);r(v)}catch(v){u(v instanceof Error?v.message:"搜索失败,请稍后重试。"),r([])}finally{l(!1)}};return g.useEffect(()=>{const b=n.trim();if(!b){r([]),f(!1),u(null);return}const v=setTimeout(()=>m(b),300);return()=>clearTimeout(v)},[n]),o.jsxs("div",{className:"cw-skillhub",children:[o.jsxs("div",{className:"cw-skill-searchrow",children:[o.jsxs("div",{className:"cw-skill-searchbox",children:[o.jsx(t1,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),o.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:b=>s(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),n.trim()&&m(n))}})]}),o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?o.jsx(yn,{className:"cw-i cw-spin"}):o.jsx(t1,{className:"cw-i"}),"搜索"]})]}),c&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(bc,{className:"cw-i"}),o.jsx("span",{children:c})]}),a&&i.length===0?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(yn,{className:"cw-i cw-spin"})," 正在搜索…"]}):i.length>0?o.jsx("div",{className:"cw-skill-results",children:i.map(b=>{const v=h(b.slug||"");return o.jsxs("button",{type:"button",className:`cw-skill-result ${v?"is-on":""}`,onClick:()=>p(b),"aria-pressed":v,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:v?o.jsx(Ha,{className:"cw-i cw-i-sm"}):o.jsx(ji,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&o.jsx("span",{className:"cw-skill-result-desc",children:hc(b.description)}),b.sourceRepo&&o.jsx("span",{className:"cw-skill-result-repo",children:b.sourceRepo})]})]},b.id||b.slug)})}):d&&!c?o.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&o.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const QN=/(^|\/)skill\.md$/i;function PIe(e){const t=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let i=1;i=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function UIe(...e){var t;for(const n of e){const s=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(s)return s.slice(0,64)}return"local-skill"}function FIe(e,t){return t.trim()||e}function ZV(e){const t=e.map(s=>({path:s.path.replace(/\\/g,"/").replace(/^\.\//,""),text:s.text})).filter(s=>s.path.length>0&&!s.path.endsWith("/")),n=new Set(t.map(s=>s.path.split("/")[0]));if(n.size===1&&t.every(s=>s.path.includes("/"))){const s=[...n][0]+"/";return t.map(i=>({path:i.path.slice(s.length),text:i.text}))}return t}function $Ie(e){const t=new Map,n=new Set;for(const s of e)if(QN.test("/"+s.path)){const i=s.path.split("/");n.add(i.slice(0,-1).join("/"))}for(const s of e){const i=s.path.split("/");let r="";for(let u=i.length-1;u>=0;u--){const d=i.slice(0,u).join("/");if(n.has(d)){r=d;break}}const a=QN.test("/"+s.path);if(!r&&!a&&!n.has("")||!n.has(r)&&!a)continue;const l=r?s.path.slice(r.length+1):s.path,c=t.get(r)||[];c.push({path:l,text:s.text}),t.set(r,c)}return t}function HIe(e,t,n){const s=`${n}${e?"/"+e:""}`,i=t.find(c=>QN.test("/"+c.path));if(!i)return{hit:null,error:`${s} 缺少 SKILL.md`};const r=PIe(i.text),a=UIe(r.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:`${s} 包含非法路径(..):${c.path}`};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${s} 包含非法路径:${c.path}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:FIe(a,r.name),description:r.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function zIe(e){const t=new Uint8Array(await e.arrayBuffer()),s=(await QV(t)).map(i=>({path:i.name,text:i.text}));return JV(ZV(s),e.name)}async function VIe(e,t=new Map){const n=[];for(let s=0;se.file(t,n))}async function KIe(e){const t=e.createReader(),n=[];for(;;){const s=await new Promise((i,r)=>t.readEntries(i,r));if(s.length===0)return n;n.push(...s)}}async function eG(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await GIe(e),path:n}];if(!e.isDirectory)return[];const s=await KIe(e);return(await Promise.all(s.map(i=>eG(i,n)))).flat()}function qIe({selected:e,onChange:t}){const[n,s]=g.useState([]),[i,r]=g.useState([]),[a,l]=g.useState(!1),[c,u]=g.useState(!1),d=g.useRef(0),f=E=>e.some(w=>w.source==="local"&&w.folder===E),h=E=>{E.localFiles&&(f(E.folder||E.name)?t(e.filter(w=>!(w.source==="local"&&w.folder===(E.folder||E.name)))):t([...e,{source:"local",folder:E.folder||E.name,name:E.name,description:E.description,localFiles:E.localFiles}]))},m=g.useRef([]),p=g.useRef(e);g.useEffect(()=>{m.current=i},[i]),g.useEffect(()=>{p.current=e},[e]);const b=E=>{const w=new Set([...m.current.map(T=>T.folder||T.name),...p.current.filter(T=>T.source==="local").map(T=>T.folder)]),S=[],_=[];for(const T of E.hits){const A=T.folder||T.name;if(w.has(A)){S.push(T.name);continue}w.add(A),_.push(T)}r(T=>[...T,..._]);const k=[...E.errors];if(S.length>0&&k.push(`已跳过重复技能:${S.join("、")}`),s(k),_.length===1&&E.errors.length===0&&S.length===0){const T=_[0];T.localFiles&&t([...p.current,{source:"local",folder:T.folder||T.name,name:T.name,description:T.description,localFiles:T.localFiles}])}},v=E=>{E.preventDefault(),d.current+=1,u(!0)},y=E=>{E.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},x=async E=>{if(E.preventDefault(),d.current=0,u(!1),a)return;const w=Array.from(E.dataTransfer.items).map(S=>{var _;return(_=S.webkitGetAsEntry)==null?void 0:_.call(S)}).filter(S=>S!==null);if(w.length===0){s(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}l(!0);try{const S=(await Promise.all(w.map(T=>eG(T)))).flat(),_=w.some(T=>T.isDirectory);if(!_&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){b(await zIe(S[0].file));return}if(!_){s(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const k=new Map(S.map(({file:T,path:A})=>[T,A]));b(await VIe(S.map(({file:T})=>T),k))}catch(S){s([`读取失败:${S instanceof Error?S.message:String(S)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:v,onDragOver:E=>E.preventDefault(),onDragLeave:y,onDrop:E=>void x(E),children:[o.jsx(Yk,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(mc,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),i.length>0&&o.jsx("div",{className:"cw-skill-results",children:i.map(E=>{var S;const w=f(E.folder||E.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>h(E),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Pa,{className:"cw-i cw-i-sm"}):o.jsx(Ii,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:E.name}),E.description&&o.jsx("span",{className:"cw-skill-result-desc",children:uc(E.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((S=E.localFiles)==null?void 0:S.length)??0," 个文件"]})]})]},E.id)})})]})}function YIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const[s,i]=g.useState([]),[r,a]=g.useState([]),[l,c]=g.useState(""),[u,d]=g.useState(!0),[f,h]=g.useState(!1),[m,p]=g.useState(null);g.useEffect(()=>{let E=!1;return(async()=>{d(!0),p(null);try{const w=await b7();E||(i(w),w.length>0&&c(w[0].id))}catch(w){E||p(w instanceof Error?w.message:"加载失败")}finally{E||d(!1)}})(),()=>{E=!0}},[]),g.useEffect(()=>{if(!l){a([]);return}const E=s.find(S=>S.id===l);let w=!1;return(async()=>{h(!0),p(null);try{const S=await y7(l,E==null?void 0:E.region);w||a(S)}catch(S){w||p(S instanceof Error?S.message:"加载失败")}finally{w||h(!1)}})(),()=>{w=!0}},[l,s]);const b=s.find(E=>E.id===l),v=b?Xfe(b.id,b.region,n):"",y=(E,w)=>e.some(S=>S.source==="skillspace"&&S.skillId===E&&(S.version||"")===w),x=E=>{if(b)if(y(E.skillId,E.version))t(e.filter(w=>!(w.source==="skillspace"&&w.skillId===E.skillId&&(w.version||"")===E.version)));else{const w=Wfe(b,E);t([...e,{source:"skillspace",folder:w.folder||E.skillName,name:w.name,description:w.description,skillSpaceId:w.skillSpaceId,skillSpaceName:w.skillSpaceName,skillSpaceRegion:w.skillSpaceRegion,skillId:w.skillId,version:w.version}])}};return o.jsx("div",{className:"cw-skillspace",children:u?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(bn,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):m?o.jsxs("div",{className:"cw-banner",children:[o.jsx(mc,{className:"cw-i"}),o.jsx("span",{children:m})]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:l,onChange:E=>c(E.target.value),"aria-label":"选择 AgentKit Skills 中心",children:s.map(E=>o.jsxs("option",{value:E.id,children:[E.name||E.id,E.description?` — ${uc(E.description)}`:""]},E.id))}),b&&o.jsxs(o.Fragment,{children:[b.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:b.region,children:kf(b.region,n)}),v&&o.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开","aria-label":"在火山引擎控制台打开",children:o.jsx(Op,{className:"cw-i cw-i-sm"})})]})]}),f?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(bn,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):r.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:r.map(E=>{const w=y(E.skillId,E.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>x(E),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Pa,{className:"cw-i cw-i-sm"}):o.jsx(Ii,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[E.skillName,E.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",E.version]})]}),E.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:uc(E.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Cee,{className:"cw-i cw-i-sm"})," ",(b==null?void 0:b.name)||l]})]})]},`${E.skillId}/${E.version}`)})})]})})}async function WIe(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Bn(void 0,pc)});if(t.status===409)throw new Error("服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit 智能体中心");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function XIe(e={}){const t=new URLSearchParams({page_size:String(e.pageSize??100),project:e.project||"default"});return e.region&&t.set("region",e.region),(await WIe(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function QIe(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Bn(void 0,pc)});if(t.status===409)throw new Error("服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库");if(t.status===401)throw new Error("请先登录以访问 VikingDB 知识库");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function ZIe(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.region&&t.set("region",e.region);const n=t.toString();return(await QIe(`/web/viking-knowledgebases${n?`?${n}`:""}`)).items||[]}const ED=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function r_(e){let t=0;for(let n=0;n>>0;return ED[t%ED.length]}function JIe(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,s=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):s.push(u);const i=(u,d)=>u.start_time-d.start_time,r=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(i).map(f=>r(f,d+1))}),a=s.sort(i).map(u=>r(u,0)),l=e.length?Math.min(...e.map(u=>u.start_time)):0,c=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:l,total:c-l||1}}function eje(e,t){const n=[],s=i=>{n.push(i),t.has(i.span.span_id)||i.children.forEach(s)};return e.forEach(s),n}function vD(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const tje=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function wD(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const s=String(n);return{key:tje(t),value:s,long:s.length>80||s.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function tG({appName:e,testRunId:t,sessionId:n,endTimeMs:s,onClose:i,title:r="调用链路观测"}){const[a,l]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(new Set),[h,m]=g.useState(null);g.useEffect(()=>{l(null),u("");let S;if(t)S=H8(t,n);else if(e)S=o1(e,n,s);else{u("缺少调用链路来源");return}S.then(_=>{l(_),m(_.length?_.reduce((k,T)=>k.start_time<=T.start_time?k:T).span_id:null)}).catch(_=>u(_ instanceof Error?_.message:String(_)))},[e,s,n,t]);const{rootNodes:p,min:b,total:v}=g.useMemo(()=>JIe(a??[]),[a]),y=g.useMemo(()=>eje(p,d),[p,d]),x=(a==null?void 0:a.find(S=>S.span_id===h))??null,E=v/1e6,w=S=>f(_=>{const k=new Set(_);return k.has(S)?k.delete(S):k.add(S),k});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:i}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:r}),o.jsx("div",{className:"drawer-sub",children:a?`${a.length} 个调用 · ${E.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:i,"aria-label":"关闭",children:o.jsx(Ri,{className:"icon"})})]}),a==null&&!c&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx(bn,{className:"icon spin"})," 加载调用链路…"]}),c&&o.jsx("div",{className:"error",children:c}),a&&a.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),y.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:y.map(S=>{const _=S.span,k=(_.start_time-b)/v*100,T=Math.max((_.end_time-_.start_time)/v*100,.6),A=S.children.length>0;return o.jsxs("button",{className:`trace-row ${h===_.span_id?"active":""}`,onClick:()=>m(_.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:S.depth*14},children:[o.jsx("span",{className:`trace-caret ${A?"":"hidden"} ${d.has(_.span_id)?"":"open"}`,onClick:j=>{j.stopPropagation(),A&&w(_.span_id)},children:o.jsx(oc,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:r_(_.name)}}),o.jsx("span",{className:"trace-name",title:_.name,children:_.name})]}),o.jsx("span",{className:"trace-dur",children:vD(_.end_time-_.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${k}%`,width:`${T}%`,background:r_(_.name)}})})]},_.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:x?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:x.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:r_(x.name)}}),vD(x.end_time-x.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:wD(x).filter(S=>!S.long).map(S=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:S.key}),o.jsx("span",{className:"td-val",children:S.value})]},S.key))}),wD(x).filter(S=>S.long).map(S=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:S.key}),o.jsx("pre",{className:"td-pre",children:S.value})]},S.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const nje=g.lazy(()=>au(()=>import("./MarkdownPromptEditor-35Gi6h5-.js"),__vite__mapDeps([0,1]))),ZN="veadk.generatedAgentTestRuns",_D=4;function iC(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(ZN)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function nG(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(ZN,JSON.stringify(t)):window.sessionStorage.removeItem(ZN)}catch{}}function sje(e){nG([...iC(),e])}function um(e){nG(iC().filter(t=>t!==e))}function ije(e,t,n="text/plain"){const s=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement("a");i.href=s,i.download=e,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(s)}const rje=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:lte,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:mc,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:jee},{id:"tools",label:"工具",hint:"可调用的能力",icon:zB},{id:"skills",label:"技能",hint:"声明式技能",icon:hu},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:Kb},{id:"memory",label:"记忆",hint:"短期与长期记忆",icon:FB},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:Nee},{id:"review",label:"完成",hint:"预览并创建",icon:rte}];function aje({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function SD({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.75 7.25h14.5"}),o.jsx("path",{d:"M9.1 4.75h5.8l.75 2.5h-7.3l.75-2.5Z"}),o.jsx("path",{d:"m6.75 7.25.75 12h9l.75-12"}),o.jsx("path",{d:"M10 10.25v5.75M14 10.25v5.75"})]})}function sG({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function iG({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const oje={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},ND={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},rG="REGISTRY_SPACE_ID",lje=p7.filter(e=>e.key!==rG);function aG(e,t){var s,i,r;if(!(e!=null&&e.enabled))return{};const n={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(n.REGISTRY_TOP_K=((s=e.registryTopK)==null?void 0:s.trim())||ja.topK,n.REGISTRY_REGION=((i=e.registryRegion)==null?void 0:i.trim())||ja.region,n.REGISTRY_ENDPOINT=((r=e.registryEndpoint)==null?void 0:r.trim())||ja.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function wb(e,t){return t!=="byteplus"?e:e.map(n=>n.key==="MODEL_EMBEDDING_NAME"?{...n,placeholder:Fte(t)}:n.key==="MODEL_EMBEDDING_API_BASE"?{...n,placeholder:i1(t)}:n)}function cje({items:e,selected:t,onToggle:n,scrollRows:s}){return o.jsx("div",{className:`cw-checklist ${s?"cw-checklist-tools":""}`,style:s?{"--cw-checklist-max-height":`${s*40+(s-1)*8}px`}:void 0,children:e.map(i=>{const r=t.includes(i.id);return o.jsx(qV,{id:`cw-check-${i.id}`,className:`cw-check ${r?"is-on":""}`,checked:r,onCheckedChange:a=>{a!==r&&n(i.id)},label:o.jsx("span",{className:"cw-check-text",children:o.jsx("span",{className:"cw-check-title",children:i.label})})},i.id)})})}function a_({options:e,value:t,onChange:n}){return o.jsx("div",{className:"cw-segmented",children:e.map(s=>{var r;const i=(t??((r=e[0])==null?void 0:r.id))===s.id;return o.jsx("button",{type:"button",className:`cw-seg ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:o.jsx("span",{className:"cw-seg-title",children:s.label})},s.id)})})}function uje(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function dm({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(s=>{const i=t[s.key]??s.defaultValue??"",r=qA(s,t),a=`cw-env-${s.key}`;return o.jsxs("label",{className:"cw-env-field",htmlFor:a,children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-title",children:[o.jsxs("span",{className:"cw-env-field-label",children:[s.comment||s.key,s.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),s.help&&o.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":s.help,"aria-label":`${s.comment||s.key}说明:${s.help}`,children:["?",o.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:s.help})]}),s.link&&o.jsx("a",{className:"cw-env-link",href:s.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开 OpenViking ${s.link.label}`,"aria-label":`打开 OpenViking ${s.link.label}`,onClick:l=>l.stopPropagation(),children:o.jsx(Op,{"aria-hidden":"true"})})]}),s.comment&&o.jsx("code",{title:s.key,children:s.key})]}),s.multiline||s.format==="json"?o.jsx("textarea",{id:a,className:"cw-input cw-env-textarea",value:i,placeholder:s.placeholder||"请输入参数值",autoComplete:"off",spellCheck:!1,"aria-invalid":!!r,onChange:l=>n(s.key,l.currentTarget.value)}):o.jsx("input",{id:a,className:"cw-input",type:uje(s.key)?"password":"text",value:i,placeholder:s.placeholder||"请输入参数值",autoComplete:"off","aria-invalid":!!r,onChange:l=>n(s.key,l.currentTarget.value)}),r&&o.jsx("span",{className:"cw-env-error",children:r})]},s.key)})})}function o_(e){return e.name.trim()||"未命名智能体中心"}function l_(e){const t=e.name.trim()||e.id||"未命名知识库",n=[e.sourceLabel,e.projectName].filter(Boolean);return n.length?`${t} · ${n.join(" · ")}`:t}function dje({value:e,region:t,invalid:n,onChange:s}){const i=t.trim()||ja.region,[r,a]=g.useState([]),[l,c]=g.useState(!1),[u,d]=g.useState(null),[f,h]=g.useState(0),[m,p]=g.useState(!1),[b,v]=g.useState(""),y=g.useRef(null);g.useEffect(()=>{let A=!1;return c(!0),d(null),XIe({region:i}).then(j=>{A||a(j)}).catch(j=>{A||(a([]),d(j instanceof Error?j.message:"加载失败"))}).finally(()=>{A||c(!1)}),()=>{A=!0}},[i,f]);const x=!e||r.some(A=>A.id===e.trim()),E=r.find(A=>A.id===e.trim()),w=E?o_(E):e&&!x?"已选择的智能体中心":"请选择智能体中心",S=l&&r.length===0,_=g.useMemo(()=>r.filter(A=>B1(b,[o_(A),A.id,A.projectName])),[b,r]),k=!!(e&&!x&&B1(b,["已选择的智能体中心",e]));g.useEffect(()=>{if(!m)return;const A=R=>{const B=R.target;B instanceof Node&&y.current&&!y.current.contains(B)&&p(!1)},j=R=>{R.key==="Escape"&&p(!1)};return window.addEventListener("pointerdown",A),window.addEventListener("keydown",j),()=>{window.removeEventListener("pointerdown",A),window.removeEventListener("keydown",j)}},[m]);const T=A=>{s(A),p(!1)};return o.jsxs("div",{className:`cw-a2a-space-picker${m?" is-open":""}`,ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:S,"aria-haspopup":"listbox","aria-expanded":m,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{v(""),p(A=>!A)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:w}),o.jsx(sG,{className:"cw-a2a-space-trigger-icon"})]}),m&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:b,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:A=>v(A.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[k&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>T(e),children:"已选择的智能体中心"}),_.map(A=>{const j=o_(A),R=A.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":R,className:`cw-a2a-space-option ${R?"is-selected":""}`,title:`${j} (${A.id})`,onClick:()=>T(A.id),children:j},A.id)}),!k&&_.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(A=>A+1),children:l?o.jsx(bn,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(iG,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mc,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(bn,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):r.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",r.length," 个智能体中心,列表仅展示中心名称。"]})]})}function fje({value:e,onChange:t}){const[n,s]=g.useState([]),[i,r]=g.useState(!1),[a,l]=g.useState(null),[c,u]=g.useState(0),[d,f]=g.useState(!1),[h,m]=g.useState(""),p=g.useRef(null);g.useEffect(()=>{let _=!1;return r(!0),l(null),ZIe().then(k=>{_||s(k)}).catch(k=>{_||(s([]),l(k instanceof Error?k.message:"加载失败"))}).finally(()=>{_||r(!1)}),()=>{_=!0}},[c]);const b=!e||n.some(_=>_.id===e.trim()),v=n.find(_=>_.id===e.trim()),y=v?l_(v):e&&!b?e:"请选择 VikingDB 知识库",x=i&&n.length===0,E=g.useMemo(()=>n.filter(_=>B1(h,[l_(_),_.id,_.description,_.projectName,_.resourceId,_.agentkitKnowledgeId,_.providerKnowledgeId,_.sourceLabel])),[n,h]),w=!!(e&&!b&&B1(h,[e]));g.useEffect(()=>{if(!d)return;const _=T=>{const A=T.target;A instanceof Node&&p.current&&!p.current.contains(A)&&f(!1)},k=T=>{T.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",_),window.addEventListener("keydown",k),()=>{window.removeEventListener("pointerdown",_),window.removeEventListener("keydown",k)}},[d]);const S=_=>{t(_),f(!1)};return i&&n.length===0?o.jsxs("span",{className:"cw-viking-kb-inline-status",role:"status",children:[o.jsx(bn,{className:"cw-i cw-i-sm cw-spin"}),"正在加载…"]}):o.jsxs("div",{className:`cw-a2a-space-picker cw-viking-kb-picker${d?" is-open":""}`,ref:p,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:x,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{m(""),f(_=>!_)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(sG,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:h,autoFocus:!0,autoComplete:"off","aria-label":"搜索 VikingDB 知识库",placeholder:"搜索名称或 ID",onChange:_=>m(_.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[w&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S({id:e,name:e,description:"",projectName:"",region:"",sourceKind:"knowledge",sourceLabel:"Knowledge Engine",resourceId:""}),children:e}),E.map(_=>{const k=l_(_),T=_.id===e,A=[_.id,_.resourceId,_.agentkitKnowledgeId,_.providerKnowledgeId].filter(Boolean).join(" / ");return o.jsx("button",{type:"button",role:"option","aria-selected":T,className:`cw-a2a-space-option ${T?"is-selected":""}`,title:A?`${k} (${A})`:k,onClick:()=>S(_),children:k},_.id)}),!w&&E.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:"刷新知识库列表","aria-label":"刷新知识库列表",disabled:i,onClick:()=>u(_=>_+1),children:i?o.jsx(bn,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(iG,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(mc,{className:"cw-i"}),o.jsx("span",{children:a})]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function hje({tools:e,onChange:t}){const n=(r,a)=>t(e.map((l,c)=>c===r?{...l,...a}:l)),s=r=>t(e.filter((a,l)=>l!==r)),i=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(Bo,{initial:!1,children:e.map((r,a)=>o.jsxs(ss.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${r.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":r.transport==="http",children:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${r.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":r.transport==="stdio",children:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>s(a),"aria-label":"移除 MCP 工具",children:o.jsx(lc,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:r.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),r.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:r.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),iAe(r.url??"")&&o.jsxs("p",{className:"cw-mcp-warning",children:[o.jsx(mc,{"aria-hidden":"true"}),o.jsx("span",{children:"当前地址不是以 /mcp 结尾,请确认它是实际的 MCP Endpoint。Studio 会保留该地址,不会自动补充路径。"})]}),o.jsx("input",{className:"cw-input",value:nAe(r),placeholder:"Bearer Token(可选)",onChange:l=>t(e.map((c,u)=>u===a?sAe(c,l.target.value):c))})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:r.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(r.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:i,children:[o.jsx(Ii,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function oG({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function mje({s:e,onRemove:t}){let n=hu,s="火山 Find Skill 技能广场";return e.source==="local"?(n=Yk,s="本地"):e.source==="skillspace"&&(n=oG,s="AgentKit Skills 中心"),o.jsxs(ss.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[s,e.description?` · ${uc(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(Ri,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const c_=[{id:"local",label:"本地文件",icon:Yk},{id:"skillspace",label:"AgentKit Skills 中心",icon:oG},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:yx}];function pje({selected:e,onChange:t,cloudProvider:n}){const[s,i]=g.useState("local"),[r,a]=g.useState(!1),l=c_.findIndex(u=>u.id===s),c=u=>t(e.filter(d=>u_(d)!==u));return g.useEffect(()=>{if(!r)return;const u=d=>{d.key==="Escape"&&a(!1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[r]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>a(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(Ii,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(Bo,{initial:!1,children:e.map(u=>o.jsx(mje,{s:u,onRemove:()=>c(u_(u))},u_(u)))})})]}),o.jsx(Bo,{children:r&&o.jsx(ss.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:u=>{u.target===u.currentTarget&&a(!1)},children:o.jsxs(ss.div,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"cw-skill-dialog-title",initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>a(!1),children:o.jsx(Ri,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${c_.length})`,"--cw-active-skill-tab-offset":`calc(${l*100}% + ${l*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),c_.map(({id:u,label:d,icon:f})=>o.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${u}`,"aria-controls":"cw-skill-tabpanel","aria-selected":s===u,className:`cw-skill-pickertab ${s===u?"is-on":""}`,onClick:()=>i(u),children:[o.jsx(f,{className:"cw-i cw-i-sm"}),d]},u))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${s}`,children:[s==="skillhub"&&o.jsx(DIe,{selected:e,onChange:t}),s==="local"&&o.jsx(qIe,{selected:e,onChange:t}),s==="skillspace"&&o.jsx(YIe,{selected:e,onChange:t,cloudProvider:n})]})]})]})})})]})}function u_(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function _b({checked:e,onChange:t,title:n}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-text",children:o.jsx("span",{className:"cw-toggle-title",children:n})}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(ss.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function gje(e,t){var s;let n=e;for(const i of t)if(n=(s=n.subAgents)==null?void 0:s[i],!n)return!1;return!0}function Sb(e,t){let n=e;for(const s of t)n=n.subAgents[s];return n}function Wg(e,t,n){if(t.length===0)return n(e);const[s,...i]=t,r=e.subAgents.slice();return r[s]=Wg(r[s],i,n),{...e,subAgents:r}}function bje(e,t,n="volcengine"){return Wg(e,t,s=>({...s,subAgents:[...s.subAgents,Ai(n)]}))}function yje(e,t,n,s="volcengine"){return Wg(e,t,i=>{const r=i.subAgents.slice();return r.splice(n,0,Ai(s)),{...i,subAgents:r}})}function xje(e,t){if(t.length===0)return e;const n=t.slice(0,-1),s=t[t.length-1];return Wg(e,n,i=>({...i,subAgents:i.subAgents.filter((r,a)=>a!==s)}))}const JN=e=>!_E(e.agentType),TD=3;function Eje(e,t,n=!1){var i;if(_E(e.agentType))return n?"远程 Agent 只能作为子 Agent":(i=e.a2aRegistry)!=null&&i.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const s=Jl(e.name);return s||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":XV(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function lG(e,t,n=[]){const s=[],i=_E(e.agentType),r=Eje(e,t,n.length===0);return r&&s.push({path:n,name:i?"远程 Agent":e.name.trim()||"未命名",typeLabel:WV(e.agentType).label,problem:r}),JN(e)&&e.subAgents.forEach((a,l)=>s.push(...lG(a,t,[...n,l]))),s}function vje(e){return`${e.typeLabel}至少需要添加一个子 Agent 后才能调试或发布。`}function cG(e){return 1+e.subAgents.reduce((t,n)=>t+cG(n),0)}function uG(e){const t=pE(e),n=[],s={...t.envValues},i=t.draft.cloudProvider??"volcengine",r=l=>{var c,u,d,f;for(const h of l.builtinTools??[]){const m=ju.find(p=>p.id===h);m&&n.push({env:wb(m.env,i)})}for(const h of l.mcpTools??[])h.authTokenEnv&&n.push({env:[{key:h.authTokenEnv,required:!1,comment:`${h.name.trim()||"MCP"} Bearer Token`}]});if((c=l.a2aRegistry)!=null&&c.enabled&&(n.push({env:p7}),Object.assign(s,aG(l.a2aRegistry,{includeDefaults:!0}))),l.memory.shortTerm&&n.push({env:wb(((u=cN.find(h=>h.id===(l.shortTermBackend??"local")))==null?void 0:u.env)??[],i)}),l.memory.longTerm&&n.push({env:wb(((d=uN.find(h=>h.id===(l.longTermBackend??"local")))==null?void 0:d.env)??[],i)}),l.knowledgebase&&n.push({env:wb(((f=dN.find(h=>h.id===(l.knowledgebaseBackend??xu)))==null?void 0:f.env)??[],i)}),l.tracing)for(const h of l.tracingExporters??[]){const m=zfe.find(p=>p.id===h);m&&n.push({env:m.env,enableFlag:m.enableFlag})}l.subAgents.forEach(r)};r(t.draft);const a=Yz(n);return{specs:a.specs,fixedValues:{...a.fixedValues,...s}}}function dG(e){var n;return{...pE(e).draft,deployment:{feishuEnabled:!!((n=e.deployment)!=null&&n.feishuEnabled)}}}function eT(e){var n;const t=(n=e.modelName)==null?void 0:n.trim();if(t)return t;for(const s of e.subAgents){const i=eT(s);if(i)return i}return""}function fG(e){var s,i;const t=uG(e),n={...((s=e.deployment)==null?void 0:s.envValues)??{},...t.fixedValues};return{...dG(e),deployment:{feishuEnabled:!!((i=e.deployment)!=null&&i.feishuEnabled),envValues:Object.fromEntries(Wz(t.specs,n).map(({key:r,value:a})=>[r,a]))}}}function wje(e){return JSON.stringify(fG(e))}function U1(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function Xd(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function _je({enabled:e,disabledReason:t,variants:n,draftSnapshot:s,input:i,onInput:r,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:m,onOpenTrace:p}){const b=n.filter(x=>x.phase!=="ready"?!1:x.runtimeSnapshot===U1(s,x)),v=n.some(x=>x.phase==="sending"),y=b.length>0&&!v;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsx("div",{className:"cw-ab-grid",style:{"--cw-ab-column-count":n.length},children:n.map((x,E)=>{const w=x.modelName.trim(),S=x.description.trim(),_=x.instruction.trim(),k=Xd(x),T=!!(w&&S&&_&&n.findIndex(D=>Xd(D)===k)!==E),A=!w||!S||!_||T,j=!!(x.runtimeSnapshot&&x.runtimeSnapshot!==U1(s,x)),R=x.phase==="starting",B=x.phase==="ready"&&!j,z=R||x.phase==="sending",L=B&&x.phase!=="sending"&&x.messages.some(D=>D.role==="assistant"),F=z||x.configOpen||A,C=w?S?_?T?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",I=R?"正在启动":j?"应用配置并重启":B||x.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${x.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":x.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:x.name}),o.jsx("span",{children:x.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:x.configOpen||z,onClick:()=>f(x.id),children:"测试配置"}),x.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${x.name}`,disabled:x.configOpen||z,onClick:()=>d(x.id),children:o.jsx(SD,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:x.error?o.jsx(P1,{message:x.error,className:"cw-debug-error-detail",defaultExpanded:!0}):R?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx(bn,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):j?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):x.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:B?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):x.messages.map((D,$)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${D.role}`,children:o.jsx("div",{className:"cw-debug-content",children:D.role==="user"?D.content:D.error?o.jsx(P1,{message:D.error,className:"cw-debug-msg-error",defaultExpanded:!0}):D.blocks&&D.blocks.length>0?o.jsx(kA,{blocks:D.blocks,onAction:()=>{}}):D.content?D.content:$===x.messages.length-1&&x.phase==="sending"?o.jsx(KH,{}):null})},$))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!L,title:L?`查看${x.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>p(x.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:F,title:C||void 0,onClick:()=>l(x.id),children:[B||j||x.phase==="error"?o.jsx(ite,{className:"cw-i"}):o.jsx(aje,{className:"cw-i cw-debug-run-icon"}),I]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:z||!w,onClick:()=>c(x.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!x.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:x.name})]}),o.jsxs("div",{className:"cw-ab-config-head-actions",children:[x.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger cw-ab-config-remove","aria-label":`删除${x.name}`,title:"删除配置组",disabled:z,onClick:()=>d(x.id),children:o.jsx(SD,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!x.configOpen||A,onClick:()=>h(x.id),children:x.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:x.modelName,placeholder:"使用 Agent 当前模型",disabled:!x.configOpen,onChange:D=>m(x.id,"modelName",D.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:x.description,disabled:!x.configOpen,onChange:D=>m(x.id,"description",D.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:x.instruction,disabled:!x.configOpen,onChange:D=>m(x.id,"instruction",D.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:hG.map(D=>o.jsx(qV,{checked:x.optimizations.includes(D.id),disabled:!0,label:D.label,className:"cw-ab-optimization-checkbox"},D.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},x.id)})}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsxs("div",{className:"cw-ab-composer",children:[o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:i,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:x=>r(x.target.value),onKeyDown:x=>{AA(x.nativeEvent)||x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!i.trim(),onClick:a,children:v?o.jsx(bn,{className:"cw-i cw-spin"}):o.jsx(LB,{className:"cw-i"})})]}),e&&n.length<3&&o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft cw-ab-add",onClick:u,children:[o.jsx(Ii,{className:"cw-i"}),"添加对照组"]})]})]})}const Nb=[{id:"build",label:"架构"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],hG=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function Sje({mode:e}){const t=e==="validate"?"调试您的智能体":e==="publish"?"准备好部署您的智能体":"个性化您的智能体架构";return o.jsx("header",{className:"cw-workspace-header",children:o.jsx("h1",{children:t})})}function Nje({mode:e,busy:t,onChange:n,assistant:s}){const i=Nb.findIndex(l=>l.id===e),r=Nb[i-1],a=Nb[i+1];return o.jsxs("footer",{className:"cw-workspace-footer",children:[o.jsxs("div",{className:`cw-workspace-nav-actions${s?" has-assistant":""}`,children:[o.jsx("button",{type:"button",className:`cw-workspace-nav-button${e==="build"?" is-placeholder":""}`,"aria-hidden":e==="build"||void 0,tabIndex:e==="build"?-1:0,disabled:!r||t,onClick:()=>r&&n(r.id),children:"上一步"}),o.jsx("span",{"aria-hidden":"true"}),s?o.jsx("div",{className:"cw-workspace-ai-slot",children:s}):null,e==="publish"?o.jsx("div",{id:"cw-publish-primary-action",className:"cw-publish-action-slot"}):o.jsx("button",{type:"button",className:"cw-workspace-nav-button is-primary",disabled:!a||t,onClick:()=>a&&n(a.id),children:"下一步"})]}),o.jsx("nav",{className:"cw-workspace-progress","aria-label":"Agent 创建进度",children:Nb.map((l,c)=>{const u=l.id===e;return o.jsx("button",{type:"button",className:`${u?"is-active":""}${cn(l.id),children:o.jsx("span",{"aria-hidden":"true"})},l.id)})})]})}function Tje({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:s,features:i,onDeploymentTaskChange:r,createMode:a="custom",deploymentTarget:l,cloudProvider:c="volcengine",initialDeployRegion:u=Ni(c),onDeploymentComplete:d,onDeploymentStarted:f,onDraftChange:h,onDiscard:m}){var ol,nr,Fu,xc,re,yt,Sn,ks,sn,As,za,mo,Hn,Gi;const[p,b]=g.useState(()=>s??Ai(c));g.useEffect(()=>{const se=c==="byteplus"?t2:qB,Ne=c==="byteplus"?e2:KB;b(be=>{var Ct,ft;const st=((Ct=be.modelName)==null?void 0:Ct.trim())===se?s1(c):be.modelName,un=((ft=be.modelApiBase)==null?void 0:ft.trim())===Ne?i1(c):be.modelApiBase;return st===be.modelName&&un===be.modelApiBase?be:{...be,modelName:st,modelApiBase:un}})},[c]);const[v,y]=g.useState(""),[x,E]=g.useState(!1),[w,S]=g.useState(!1),[_,k]=g.useState(!1),[T,A]=g.useState(null),j=v.trim(),R=j.length>0&&j.length<_D?"请至少输入 4 个字符。":"",B=g.useRef(JSON.stringify(p)),z=g.useRef(B.current),L=JSON.stringify(p),F=L!==B.current,C=g.useRef(h);g.useEffect(()=>{C.current=h},[h]),g.useEffect(()=>{var se;L!==z.current&&(z.current=L,(se=C.current)==null||se.call(C,p,F))},[p,F,L]);const[I,D]=g.useState("build"),[$,O]=g.useState(!1),[te,ne]=g.useState(0),[P,Q]=g.useState(null),[ee,V]=g.useState(!1),[X,K]=g.useState((l==null?void 0:l.region)??u),ce=(i==null?void 0:i.generatedAgentTestRun)===!0,he=(i==null?void 0:i.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[ye,ue]=g.useState(()=>[{id:"baseline",name:"基准组",modelName:eT(s??Ai(c)),description:(s??Ai(c)).description,instruction:(s??Ai(c)).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[we,De]=g.useState("baseline"),Se=g.useRef(1),ae=g.useRef(!1),pe=g.useRef(new Map),[_e,et]=g.useState(0),[Be,Fe]=g.useState(""),[We,Ae]=g.useState(null),[Ke,Ue]=g.useState(!1),[W,oe]=g.useState(!1),Z=g.useRef(null),[Ee,Oe]=g.useState(""),[at,Lt]=g.useState(!1),[ct,yn]=g.useState(!1),[Et,vt]=g.useState([]),xn=g.useRef(null),Vt=g.useRef({});async function Ft(){const se=new Set([...pe.current.values()].map(({run:be})=>be.runId)),Ne=iC().filter(be=>!se.has(be));Ne.length&&await Promise.all(Ne.map(async be=>{try{await bd(be),um(be)}catch(st){console.warn("清理遗留调试运行失败",st)}}))}g.useEffect(()=>(Ft(),()=>{for(const{run:se}of pe.current.values())bd(se.runId).then(()=>um(se.runId)).catch(Ne=>console.warn("清理调试运行失败",Ne));pe.current.clear()}),[]),g.useEffect(()=>()=>{var se;(se=Z.current)==null||se.call(Z,!1),Z.current=null},[]);const it=g.useRef(null);it.current||(it.current=({meta:se,children:Ne})=>o.jsxs("section",{ref:be=>{Vt.current[se.id]=be},id:`cw-sec-${se.id}`,"data-step-id":se.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsx("h2",{className:"cw-sec-title",children:se.label})}),o.jsx("div",{className:"cw-sec-body",children:Ne})]}));const dt=gje(p,Et)?Et:[],He=Sb(p,dt),St=dt.length===0,ge=`cw-model-advanced-${dt.join("-")||"root"}`,$e=`cw-a2a-registry-advanced-${dt.join("-")||"root"}`,nt=se=>b(Ne=>Wg(Ne,dt,be=>({...be,...se}))),$t=(se,Ne)=>b(be=>{var st;return{...be,deployment:{...be.deployment??{feishuEnabled:!1},envValues:{...((st=be.deployment)==null?void 0:st.envValues)??{},[se]:Ne}}}}),qn=se=>nt({a2aRegistry:{...He.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...se}}),nn=(se,Ne)=>{if(!(se in ND))return;const be=ND[se];qn({[be]:Ne}),$t(se,Ne)},qt=se=>{if(!(St&&se==="a2a")){if(se==="a2a"){nt({agentType:se,a2aRegistry:{...He.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}nt({agentType:se,a2aRegistry:He.a2aRegistry?{...He.a2aRegistry,enabled:!1}:void 0})}},mn=(se,Ne)=>{b(se),Ne&&vt(Ne)},wt=async()=>{const se=v.trim();if(!(!se||x)&&!(se.length<_D)&&!(F&&!window.confirm("生成的新配置会替换当前画布和属性,确定继续吗?"))){E(!0),S(!1),A(null),Oe("");try{const Ne=await U8(se);b(Gz(GA(Ne.draft))),vt([]),Q(null),O(!1),Oe(""),S(!0),k(!0)}catch(Ne){A(Ne instanceof Error?Ne.message:String(Ne))}finally{E(!1)}}},Bt=se=>{const Ne=Sb(p,se);if(!JN(Ne)||se.length>=TD)return;const be=bje(p,se,c),st=Sb(be,se).subAgents.length-1;mn(be,[...se,st])},Tt=(se,Ne)=>{const be=Sb(p,se);if(!JN(be)||se.length>=TD)return;const st=Math.max(0,Math.min(Ne,be.subAgents.length)),un=yje(p,se,st,c);mn(un,[...se,st])},En=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(b(Ai(c)),vt([]),O(!1))},vn=se=>{if(se.length===0){En();return}mn(xje(p,se),se.slice(0,-1))},Ht=He.builtinTools??[],os=He.mcpTools??[],Os=He.selectedSkills??[],Ms=se=>nt({builtinTools:Ht.includes(se)?Ht.filter(Ne=>Ne!==se):[...Ht,se]}),wn=XV(He.agentType),ls=_E(He.agentType),Yn=g.useMemo(()=>MH(p),[p]),Wn=ls?null:Jl(He.name)??(Yn.has(He.name)?"Agent 名称在当前结构中必须唯一":null),ri=Wn!==null,ps=!ls&&He.description.trim().length===0,Ls=He.instruction.trim().length===0,Ln=ls&&!((ol=He.a2aRegistry)!=null&&ol.registrySpaceId.trim()),Ds=se=>$&&se?`is-error cw-error-shake-${te%2}`:"",Cn=g.useMemo(()=>lG(p,Yn),[p,Yn]),Ss=Cn.length===0,Ps=g.useMemo(()=>wje(p),[p]),cs=ye.find(se=>se.id===we)??ye[0],gs=g.useMemo(()=>uG(p),[p]),Dn=se=>{var Ne;(Ne=Vt.current[se])==null||Ne.scrollIntoView({behavior:"smooth",block:"start"})},pn=()=>Ss?!0:(O(!0),ne(se=>se+1),Cn[0]&&(vt(Cn[0].path),window.requestAnimationFrame(()=>Dn(Cn[0].problem==="缺少子 Agent"?"type":"basic"))),!1),on=async()=>{Ae(null);const se=[...pe.current.values()];pe.current.clear(),et(0),ue(Ne=>Ne.map(be=>({...be,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(se.map(async({run:Ne})=>{try{await bd(Ne.runId),um(Ne.runId)}catch(be){console.warn("清理调试运行失败",be)}}))},Yt=async se=>{const Ne=pe.current.get(se);if(Ne){pe.current.delete(se),et(pe.current.size);try{await bd(Ne.run.runId),um(Ne.run.runId)}catch(be){console.warn("清理调试运行失败",be)}}},_n=se=>{const Ne=pe.current.get(se),be=ye.find(st=>st.id===se);!Ne||!be||Ae({runId:Ne.run.runId,sessionId:Ne.sessionId,variantName:be.name})},de=se=>{const Ne=Z.current;Z.current=null,Ne==null||Ne(se)},Ie=()=>{W||(Ue(!1),de(!1))},Me=async()=>{if(!W){oe(!0);try{await on(),Ue(!1),de(!0)}finally{oe(!1)}}},Xe=async()=>I!=="validate"||_e===0?!0:Z.current?!1:new Promise(se=>{Z.current=se,Ue(!0)}),ot=async se=>{var be;if(!await Xe())return;if(Oe(""),!pn()){D("build");return}const Ne=Xz(gs.specs,((be=p.deployment)==null?void 0:be.envValues)??{});if(Ne){Oe(`${Ne.spec.comment||Ne.spec.key}:${Ne.error}`),D("build");return}V(!0);try{const st=se?ye.find(ft=>ft.id===se):cs;st&&De(st.id);const un=st?{...p,modelName:st.modelName||p.modelName,description:st.description,instruction:st.instruction}:p,Ct=await Tx(dG(un));un!==p&&b(un),Q(Ct),D("publish")}catch(st){Oe(st instanceof Error?st.message:String(st))}finally{V(!1)}},mt=async se=>{if(!ce||ee||!pn())return;const Ne=ye.find(Xn=>Xn.id===se);if(!Ne||Ne.phase==="starting"||Ne.phase==="sending")return;const be=Ne.modelName.trim(),st=Ne.description.trim(),un=Ne.instruction.trim(),Ct=Xd(Ne),ft=ye.findIndex(Xn=>Xn.id===se),xs=ye.findIndex(Xn=>Xd(Xn)===Ct);if(!be||!st||!un||xs!==ft)return;const Bs=U1(Ps,Ne);ue(Xn=>Xn.map(Pn=>Pn.id===se?{...Pn,configOpen:!1,phase:"starting",messages:[],error:null}:Pn)),Fe("");let Us=null,Mi;const xi=Date.now(),fa=se==="baseline"?"baseline":"comparison";try{await Yt(se),await Ft();const Xn={...p,modelName:Ne.modelName||p.modelName,description:Ne.description,instruction:Ne.instruction};Mi="create_test_run",Us=await F8(fG(Xn),l?{runtimeId:l.runtimeId,region:l.region}:void 0),sje(Us.runId),Mi="create_test_session";const Pn=await $8(Us.runId,"test_user");pe.current.set(se,{run:Us,sessionId:Pn}),et(pe.current.size),ue(Rt=>Rt.map(po=>po.id===se?{...po,phase:"ready",runtimeSnapshot:Bs}:po)),ETe({durationMs:Date.now()-xi,variantType:fa})}catch(Xn){if(Us)try{await bd(Us.runId),um(Us.runId)}catch(Pn){console.warn("清理调试运行失败",Pn)}ue(Pn=>Pn.map(Rt=>Rt.id===se?{...Rt,phase:"error",runtimeSnapshot:"",error:Xn instanceof Error?Xn.message:String(Xn)}:Rt)),vTe({durationMs:Date.now()-xi,variantType:fa,phase:Mi,error:Xn})}},bt=async()=>{const se=Be.trim(),Ne=ye.filter(st=>st.phase==="ready"&&st.runtimeSnapshot===U1(Ps,st)&&pe.current.has(st.id));if(!se||Ne.length===0)return;Fe("");const be=new Set(Ne.map(st=>st.id));ue(st=>st.map(un=>be.has(un.id)?{...un,phase:"sending",messages:[...un.messages,{role:"user",content:se},{role:"assistant",content:"",blocks:[]}]}:un)),await Promise.all(Ne.map(async st=>{const un=pe.current.get(st.id);if(un)try{let Ct=Aa();for await(const ft of z8({runId:un.run.runId,userId:"test_user",sessionId:un.sessionId,text:se})){const xs=ft.error||ft.errorMessage||ft.error_message;if(xs||(Ct=Af(Ct,ft)),ue(Bs=>Bs.map(Us=>{if(Us.id!==st.id)return Us;const Mi=[...Us.messages],xi={...Mi[Mi.length-1]};return xs?xi.error=String(xs):(xi.content=Ct.blocks.filter(fa=>fa.kind==="text").map(fa=>fa.text).join(""),xi.blocks=Ct.blocks),Mi[Mi.length-1]=xi,{...Us,messages:Mi}})),xs)break}}catch(Ct){ue(ft=>ft.map(xs=>{if(xs.id!==st.id)return xs;const Bs=[...xs.messages],Us={...Bs[Bs.length-1]};return Us.error=Ct instanceof Error?Ct.message:String(Ct),Bs[Bs.length-1]=Us,{...xs,messages:Bs}}))}finally{ue(Ct=>Ct.map(ft=>ft.id===st.id?{...ft,phase:"ready"}:ft))}}))},$n=()=>{ue(se=>{if(se.length>=3)return se;const Ne=Se.current++,be=`variant-${Ne}`;return[...se,{id:be,name:`对照组 ${Ne}`,modelName:p.modelName??"",description:p.description,instruction:p.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},Le=async se=>{await Yt(se),ue(Ne=>Ne.filter(be=>be.id!==se)),we===se&&De("baseline")},bs=(se,Ne)=>ue(be=>be.map(st=>st.id===se?{...st,...Ne}:st)),ys=(se,Ne,be)=>{se==="baseline"&&Ne==="modelName"&&(ae.current=!0),bs(se,{[Ne]:be}),!(we!==se||se==="baseline")&&De("baseline")},Ns=se=>{const Ne=ye.find(Bs=>Bs.id===se);if(!Ne)return;const be=Ne.modelName.trim(),st=Ne.description.trim(),un=Ne.instruction.trim(),Ct=Xd(Ne),ft=ye.findIndex(Bs=>Bs.id===se),xs=ye.findIndex(Bs=>Xd(Bs)===Ct);if(!(!be||!st||!un||xs!==ft)){if(se==="baseline"){bs(se,{configOpen:!1});return}mt(se)}},en=async(se,Ne,be)=>{var Ct;const st=(Ct=p.deployment)==null?void 0:Ct.network,un=st&&st.mode&&st.mode!=="public"?{mode:st.mode,vpc_id:st.vpcId,subnet_ids:st.subnetIds,enable_shared_internet_access:st.enableSharedInternetAccess}:void 0;return Sg(se.name,se.files,{region:(l==null?void 0:l.region)??X,projectName:"default",network:un},{...be,onStage:Ne,runtimeId:l==null?void 0:l.runtimeId,appName:l==null?void 0:l.appName,description:p.description})},Ut=()=>{pn()&&(ue(se=>se.map(Ne=>Ne.id==="baseline"&&!pe.current.has(Ne.id)?{...Ne,modelName:ae.current?Ne.modelName:eT(p),description:p.description,instruction:p.instruction}:Ne)),D("validate"))},Oi=async se=>{if(se==="publish"){if(!pn())return;P?D("publish"):ot();return}if(se==="validate"){Ut();return}await Xe()&&D(se)},gn=it.current,Ts=se=>rje.find(Ne=>Ne.id===se),Ha=o.jsx("section",{className:`cw-ai-compose${x?" is-generating":""}${w?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(Bo,{initial:!1,mode:"wait",children:w?o.jsxs(ss.div,{className:"cw-ai-compose-success",role:"status",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>S(!1),children:"重新生成"})]},"success"):o.jsxs(ss.div,{className:"cw-ai-compose-entry",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:[.22,1,.36,1]},children:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:se=>{se.preventDefault(),wt()},children:[o.jsx("input",{type:"text",value:v,maxLength:8e3,disabled:x,placeholder:`描述目标,使用 ${$te(c)} 模型一键生成配置`,"aria-invalid":!!R,"aria-describedby":R?"ai-requirement-error":void 0,onChange:se=>y(se.target.value),onKeyDown:se=>{se.key==="Enter"&&(se.preventDefault(),wt())}}),o.jsx("button",{type:"submit",disabled:x||!j||!!R,"aria-label":x?"正在智能生成":"智能生成",children:x?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),R&&o.jsx("p",{className:"cw-ai-requirement-error",id:"ai-requirement-error",role:"alert",children:R})]},"compose")})});return o.jsxs("div",{className:`cw-root is-${I}`,children:[o.jsx(Sje,{mode:I}),Ee&&o.jsx(P1,{className:"cw-workspace-alert",message:Ee}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[I==="build"&&o.jsx("div",{className:"cw-build-workspace",children:o.jsxs("div",{className:"cw-editor",children:[o.jsx(Kp,{draft:p,direction:"horizontal",selectedPath:dt,onSelect:vt,onAdd:Bt,onInsert:Tt,onDelete:vn}),o.jsx("div",{className:"cw-detail",children:o.jsx("div",{className:"cw-detail-scroll",ref:xn,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsx("div",{className:"cw-lower",children:o.jsxs("div",{className:"cw-form-col",children:[o.jsxs(gn,{meta:Ts("type"),children:[o.jsx(XN,{className:"cw-agent-type-options","aria-label":"Agent 类型",value:He.agentType??"llm",onChange:qt,children:RIe.map(se=>{const Ne=(He.agentType??"llm")===se.id,be=St&&se.id==="a2a",st=be?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("div",{"data-agent-type":se.id,className:`cw-agent-type-option ${Ne?"is-on":""} ${be?"is-disabled":""}`,tabIndex:be?0:void 0,"aria-describedby":st,children:[o.jsx(XN.Item,{value:se.id,disabled:be,block:!0,className:"cw-agent-type-control",children:o.jsx("span",{className:"cw-agent-type-copy",children:o.jsx("strong",{children:oje[se.id]})})}),be&&o.jsx("span",{id:st,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},se.id)})}),$&&wn&&He.subAgents.length===0&&o.jsx("span",{className:"cw-error-text",children:vje({name:He.name.trim()||"未命名",typeLabel:WV(He.agentType).label})})]}),o.jsx(gn,{meta:Ts("basic"),children:o.jsxs("div",{className:"cw-form",children:[!ls&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[St?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${Ds(ri)}`,value:He.name,placeholder:"assistant",onChange:se=>nt({name:se.target.value})}),$&&Wn?o.jsx("span",{className:"cw-error-text",children:Wn}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[St?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Ds(ps)}`,value:He.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:se=>nt({description:se.target.value})}),$&&ps?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:St?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),wn?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc cw-dependency-hint",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),He.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:He.maxIterations??3,onChange:se=>nt({maxIterations:Math.max(1,Number(se.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):ls?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx(dje,{value:((nr=He.a2aRegistry)==null?void 0:nr.registrySpaceId)??"",region:((Fu=He.a2aRegistry)==null?void 0:Fu.registryRegion)||ja.region,invalid:$&&Ln,onChange:se=>nn(rG,se)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ct,"aria-controls":$e,onClick:()=>yn(se=>!se),children:[o.jsx("span",{children:"更多选项"}),o.jsx(oc,{className:`cw-more-options-chevron ${ct?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(Bo,{initial:!1,children:ct&&o.jsx(ss.div,{id:$e,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:o.jsx(dm,{env:lje,values:aG(He.a2aRegistry,{includeDefaults:!1}),onChange:nn})})}),$&&Ln&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(g.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(nje,{value:He.instruction,invalid:Ls,onChange:se=>nt({instruction:se})})}),$&&Ls?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!wn&&!ls&&o.jsxs(o.Fragment,{children:[o.jsx(gn,{meta:Ts("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:He.modelName??"",placeholder:s1(c),onChange:se=>nt({modelName:se.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options cw-model-more-options","aria-expanded":at,"aria-controls":ge,onClick:()=>Lt(se=>!se),children:[o.jsx("span",{children:"更多选项"}),o.jsx(oc,{className:`cw-more-options-chevron ${at?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(Bo,{initial:!1,children:at&&o.jsxs(ss.div,{id:ge,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:He.modelProvider??"",placeholder:"openai",onChange:se=>nt({modelProvider:se.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:He.modelApiBase??"",placeholder:i1(c),onChange:se=>nt({modelApiBase:se.target.value})}),o.jsx("span",{className:"cw-help cw-dependency-hint",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(gn,{meta:Ts("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(cje,{items:g7,selected:Ht,onToggle:Ms,scrollRows:6})}),o.jsx(Bo,{initial:!1,children:Ht.includes("run_code")&&o.jsxs(ss.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx(dm,{env:((xc=ju.find(se=>se.id==="run_code"))==null?void 0:xc.env)??[],values:((re=p.deployment)==null?void 0:re.envValues)??{},onChange:$t})]})})]}),o.jsxs("div",{className:"cw-field cw-mcp-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx(hje,{tools:os,onChange:se=>nt({mcpTools:se})})]})]})}),o.jsx(gn,{meta:Ts("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(pje,{selected:Os,onChange:se=>nt({selectedSkills:se}),cloudProvider:c})})}),o.jsx(gn,{meta:Ts("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(_b,{checked:He.knowledgebase,onChange:se=>nt({knowledgebase:se}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:Kb}),He.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(a_,{options:dN,value:He.knowledgebaseBackend,onChange:se=>nt({knowledgebaseBackend:se,knowledgebaseIndex:se==="viking"?He.knowledgebaseIndex:""})}),(He.knowledgebaseBackend??xu)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(fje,{value:He.knowledgebaseIndex??"",onChange:se=>{nt({knowledgebaseIndex:se.id}),se.projectName&&$t("DATABASE_VIKING_PROJECT",se.projectName),se.region&&$t("DATABASE_VIKING_REGION",se.region),se.sourceKind&&$t("DATABASE_VIKING_COLLECTION_KIND",se.sourceKind),$t("DATABASE_VIKING_RESOURCE_ID",se.resourceId??"")}})]}),o.jsx(dm,{env:((yt=dN.find(se=>se.id===(He.knowledgebaseBackend??xu)))==null?void 0:yt.env)??[],values:((Sn=p.deployment)==null?void 0:Sn.envValues)??{},onChange:$t})]})]})}),St&&o.jsx(gn,{meta:Ts("memory"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(_b,{checked:He.memory.shortTerm,onChange:se=>nt({memory:{...He.memory,shortTerm:se}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:FB}),He.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(a_,{options:cN,value:He.shortTermBackend,onChange:se=>nt({shortTermBackend:se})}),o.jsx(dm,{env:((ks=cN.find(se=>se.id===(He.shortTermBackend??"local")))==null?void 0:ks.env)??[],values:((sn=p.deployment)==null?void 0:sn.envValues)??{},onChange:$t})]}),o.jsx(_b,{checked:He.memory.longTerm,onChange:se=>nt({memory:{...He.memory,longTerm:se}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:Kb}),He.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(a_,{options:uN,value:He.longTermBackend,onChange:se=>nt({longTermBackend:se})}),o.jsx(dm,{env:((As=uN.find(se=>se.id===(He.longTermBackend??"local")))==null?void 0:As.env)??[],values:((za=p.deployment)==null?void 0:za.envValues)??{},onChange:$t}),o.jsx(_b,{checked:!!He.autoSaveSession,onChange:se=>nt({autoSaveSession:se}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:Kb})]})]})})]})]})})})})})]})}),I==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(_je,{enabled:ce,disabledReason:he,variants:ye,draftSnapshot:Ps,input:Be,onInput:Fe,onSend:bt,onStartVariant:mt,onDeployVariant:se=>void ot(se),onAddVariant:$n,onRemoveVariant:Le,onToggleConfig:se=>{const Ne=ye.find(be=>be.id===se);Ne&&bs(se,{configOpen:!Ne.configOpen})},onCompleteConfig:Ns,onConfigChange:ys,onOpenTrace:_n})})}),I==="publish"&&o.jsx("div",{className:"cw-preview-body",children:P?o.jsx(bE,{embedded:!0,cloudProvider:c,project:P,agentDraft:p,agentName:p.name||"未命名 Agent",agentCount:cG(p),releaseConfiguration:cs?{modelName:cs.modelName||p.modelName||"默认模型",description:cs.description,instruction:cs.instruction,optimizations:cs.optimizations.flatMap(se=>{const Ne=hG.find(be=>be.id===se);return Ne?[Ne.label]:[]})}:void 0,onChange:Q,onDeploy:en,onAgentAdded:n,onDeploymentTaskChange:r,deploymentActionLabel:l?"更新并发布":"部署",deploymentActionTargetId:"cw-publish-primary-action",deploymentRuntimeId:l==null?void 0:l.runtimeId,onDeploymentStarted:f,onDeploymentComplete:d,feishuEnabled:!!((mo=p.deployment)!=null&&mo.feishuEnabled),onFeishuEnabledChange:se=>{const Ne={...p,deployment:{...p.deployment??{feishuEnabled:!1},feishuEnabled:se}};b(Ne)},deploymentEnv:gs.specs,deploymentEnvValues:{...(Hn=p.deployment)==null?void 0:Hn.envValues,...gs.fixedValues},onDeploymentEnvChange:$t,network:(Gi=p.deployment)==null?void 0:Gi.network,onNetworkChange:se=>b(Ne=>({...Ne,deployment:{...Ne.deployment??{feishuEnabled:!1},network:se}})),deployRegion:X,onDeployRegionChange:K,deploymentTelemetry:{source:"scratch",createMode:a,aiAssisted:_},onExportYaml:()=>ije(`${p.name||"agent"}.yaml`,rAe(p),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx(bn,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),o.jsx(Nje,{mode:I,busy:ee,onChange:Oi,assistant:I==="build"?Ha:void 0}),We&&o.jsx(tG,{testRunId:We.runId,sessionId:We.sessionId,title:`调用链路 · ${We.variantName}`,onClose:()=>Ae(null)}),Ke&&o.jsx(pA,{variant:"warning",title:"离开调试?",description:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",confirmLabel:W?"清理中...":"确定离开",closeLabel:"关闭离开调试确认",busy:W,onCancel:Ie,onConfirm:()=>void Me()}),T&&o.jsx("div",{className:"confirm-scrim",onClick:()=>A(null),children:o.jsxs("div",{className:"confirm-box cw-ai-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"ai-generate-error-title","aria-describedby":"ai-generate-error-message",onClick:se=>se.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:T}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>A(null),children:"关闭"})})]})})]})}function Ao(e){return{...Ai(),...e}}const kje=[{id:"support",icon:zee,draft:Ao({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:kee,draft:Ao({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:Vee,draft:Ao({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:Kk,draft:Ao({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:Xee,draft:Ao({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:fte,draft:Ao({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Ao({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Ao({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Ao({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function mG(e,t){if(t!=="byteplus")return e;const n=s1(t);return{...e,model:e.model==="doubao-1.5-pro-32k"?n:e.model,modelName:e.modelName===t2?n:e.modelName,modelApiBase:!e.modelApiBase||e.modelApiBase===e2?i1(t):e.modelApiBase,subAgents:e.subAgents.map(s=>mG(s,t))}}function Aje(e){const t=[];return e.tools.length&&t.push({icon:zB,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:Tee,label:"记忆"}),e.knowledgebase&&t.push({icon:See,label:"知识库"}),e.tracing&&t.push({icon:_ee,label:"观测"}),e.subAgents.length&&t.push({icon:Jee,label:`子Agent ${e.subAgents.length}`}),t}function Cje({cloudProvider:e="volcengine",onBack:t,onCreate:n}){const[s,i]=g.useState(null),r=g.useMemo(()=>kje.map(a=>({...a,draft:mG(a.draft,e)})),[e]);return o.jsx("div",{className:"tpl-root",children:s?o.jsx(jje,{template:s,onBack:()=>i(null),onCreate:n}):o.jsx(Ije,{templates:r,onPick:i})})}function Ije({templates:e,onPick:t}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:e.map((n,s)=>o.jsxs(ss.button,{type:"button",className:"tpl-card",onClick:()=>t(n),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:s*.03,duration:.24,ease:[.22,1,.36,1]},children:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(n.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:n.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:uc(n.draft.description)})]},n.id))})]})}function jje({template:e,onBack:t,onCreate:n}){const[s,i]=g.useState(e.draft.name),r=e.icon,a=Aje(e.draft);function l(){const c=s.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(Vk,{className:"icon"})," 返回模板列表"]}),o.jsxs(ss.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(r,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:uc(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:s,onChange:c=>i(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:Rje(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:uc(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx(oc,{className:"icon"})]})]})]})}function Rje(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const Oje=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:$B},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:MB},{type:"loop",label:"循环",desc:"节点循环执行",Icon:Xk}];let tT=0;function d_(){return tT+=1,`node_${tT}`}function f_(e,t,n="volcengine",s){const i=Ai(n);return{id:e,type:"agentNode",position:t,data:{agent:{...i,name:(s==null?void 0:s.name)??`agent_${e.replace("node_","")}`,...s}}}}function Mje({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(Fi,{type:"target",position:Ze.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(fu,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(Fi,{type:"source",position:Ze.Right,className:"wfb-handle"})]})}const Lje={agentNode:Mje},kD={type:"smoothstep",markerEnd:{type:Rf.ArrowClosed,width:16,height:16}};function Dje({cloudProvider:e="volcengine",onBack:t,onCreate:n}){const s=g.useRef(null),[i,r]=g.useState(""),[a,l]=g.useState(""),[c,u]=g.useState("sequential"),d=g.useMemo(()=>{tT=0;const I=d_();return f_(I,{x:80,y:120},e,{name:"agent_1"})},[e]),[f,h,m]=LU([d]),[p,b,v]=DU([]),[y,x]=g.useState(d.id),E=f.find(I=>I.id===y)??null,w=i.trim()||"workflow_agent",S=g.useMemo(()=>MH({name:w,subAgents:f.map(I=>I.data.agent)}),[w,f]),_=Jl(w)??(S.has(w)?"名称须与 Agent 节点名称保持唯一":null),k=E?Jl(E.data.agent.name)??(S.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,T=f.length>0&&_===null&&f.every(I=>Jl(I.data.agent.name)===null&&!S.has(I.data.agent.name)),A=g.useCallback(I=>b(D=>cU({...I,...kD},D)),[b]),j=g.useCallback(()=>{const I=d_(),D=f.length*28,$=f_(I,{x:80+D,y:120+D},e);h(O=>O.concat($)),x(I)},[e,f.length,h]),R=I=>{I.dataTransfer.setData("application/wfb-node","agentNode"),I.dataTransfer.effectAllowed="move"},B=g.useCallback(I=>{I.preventDefault(),I.dataTransfer.dropEffect="move"},[]),z=g.useCallback(I=>{if(I.preventDefault(),I.dataTransfer.getData("application/wfb-node")!=="agentNode"||!s.current)return;const $=s.current.screenToFlowPosition({x:I.clientX,y:I.clientY}),O=d_(),te=f_(O,$,e);h(ne=>ne.concat(te)),x(O)},[e,h]),L=g.useCallback(I=>{y&&h(D=>D.map($=>$.id===y?{...$,data:{...$.data,agent:{...$.data.agent,...I}}}:$))},[y,h]),F=g.useCallback(()=>{y&&(h(I=>I.filter(D=>D.id!==y)),b(I=>I.filter(D=>D.source!==y&&D.target!==y)),x(null))},[y,h,b]),C=g.useCallback(()=>{if(!T)return;const I=f.map($=>$.data.agent),D={...Ai(e),name:w,description:a.trim(),instruction:a.trim(),subAgents:I,workflow:{type:c,nodes:f.map($=>({id:$.id,agent:$.data.agent})),edges:p.map($=>({from:$.source,to:$.target}))}};n(D)},[T,e,f,p,w,a,c,n]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${_?"wfb-input--error":""}`,value:i,onChange:I=>r(I.target.value),placeholder:"my_workflow"}),_&&o.jsx("span",{className:"wfb-field-error",children:_})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:a,onChange:I=>l(I.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:Oje.map(({type:I,label:D,desc:$,Icon:O})=>o.jsxs("button",{type:"button",className:`wfb-type ${c===I?"wfb-type--active":""}`,onClick:()=>u(I),children:[o.jsx(O,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:D}),o.jsx("span",{className:"wfb-type-desc",children:$})]})]},I))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:R,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(Hee,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(fu,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:j,children:[o.jsx(Ii,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:C,disabled:!T,type:"button",children:[o.jsx(hu,{className:"icon"}),"创建工作流"]}),o.jsxs(MU,{nodes:f,edges:p,onNodesChange:m,onEdgesChange:v,onConnect:A,onInit:I=>s.current=I,nodeTypes:Lje,defaultEdgeOptions:kD,onDrop:z,onDragOver:B,onNodeClick:(I,D)=>x(D.id),onPaneClick:()=>x(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(BU,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx(FU,{showInteractive:!1}),o.jsx(Xce,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:F,title:"删除节点",children:o.jsx(lc,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${k?"wfb-input--error":""}`,value:E.data.agent.name,onChange:I=>L({name:I.target.value}),placeholder:"agent_name"}),k?o.jsx("span",{className:"wfb-field-error",children:k}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:I=>L({description:I.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:I=>L({instruction:I.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:I=>L({tools:I.target.value.split(",").map(D=>D.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(fu,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",f.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function Pje(e){return o.jsx(L2,{children:o.jsx(Dje,{...e})})}const AD=50*1024*1024,nT=800,Bje={name:"code_package",files:[]};function Uje(e){let n=e.replace(/\.zip$/i,"").trim().replace(/[^A-Za-z0-9_]+/g,"_").replace(/^_+|_+$/g,"");return n||(n="uploaded_agent"),/^[A-Za-z_]/.test(n)||(n=`agent_${n}`),n==="user"&&(n="uploaded_agent"),n.slice(0,64)}function Fje(e){const t=e.replace(/\\/g,"/").replace(/^\.\//,"");if(!t||t.endsWith("/"))return null;if(t.startsWith("/")||t.includes("\0"))throw new Error(`压缩包包含非法路径:${e}`);const n=t.split("/");if(n.some(s=>!s||s==="."||s===".."))throw new Error(`压缩包包含非法路径:${e}`);return n[0]==="__MACOSX"||n[n.length-1]===".DS_Store"?null:n.join("/")}function $je(e){const t=e.flatMap(a=>{const l=Fje(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>nT)throw new Error(`代码包文件数不能超过 ${nT} 个。`);const i=new Set(t.map(a=>a.path.split("/")[0])).size===1&&t.every(a=>a.path.includes("/"))?t.map(a=>({...a,path:a.path.split("/").slice(1).join("/")})):t,r=new Set;for(const a of i){if(r.has(a.path))throw new Error(`代码包包含重复文件:${a.path}`);r.add(a.path)}if(!r.has("app.py"))throw new Error("代码包根目录必须包含 app.py,作为 AgentKit 启动入口。");return i}function Hje({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:s,onDeploymentComplete:i,cloudProvider:r="volcengine",initialDeployRegion:a=Ni(r)}){const l=g.useRef(null),c=g.useRef(0),[u,d]=g.useState(null),[f,h]=g.useState(""),[m,p]=g.useState(!1),[b,v]=g.useState(!1),[y,x]=g.useState(!1),[E,w]=g.useState(""),[S,_]=g.useState(a),[k,T]=g.useState();g.useEffect(()=>()=>{c.current+=1},[]);async function A(z){const L=++c.current;if(w(""),!z.name.toLowerCase().endsWith(".zip")){w("请选择 .zip 格式的代码包。");return}if(z.size>AD){w("代码包不能超过 50 MB。");return}v(!0);try{const F=await QV(new Uint8Array(await z.arrayBuffer()),{maxEntries:nT,maxUncompressedBytes:AD}),C=$je(F);if(L!==c.current)return;h(z.name),d({name:Uje(z.name),files:C})}catch(F){if(L!==c.current)return;h(""),d(null),w(F instanceof Error?F.message:String(F))}finally{L===c.current&&v(!1)}}function j(z){var F;const L=(F=z.currentTarget.files)==null?void 0:F[0];z.currentTarget.value="",L&&A(L)}function R(z){var F;z.preventDefault(),x(!1);const L=(F=z.dataTransfer.files)==null?void 0:F[0];L&&A(L)}async function B(z,L,F){const C=k&&k.mode!=="public"?{mode:k.mode,vpc_id:k.vpcId,subnet_ids:k.subnetIds,enable_shared_internet_access:k.enableSharedInternetAccess}:void 0;return Sg(z.name,z.files,{region:S,projectName:"default",network:C},{...F,onStage:L})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(bE,{cloudProvider:r,project:u??Bje,agentName:(u==null?void 0:u.name)||"代码包",onChange:u?d:void 0,onDeploy:B,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:s,onDeploymentComplete:i,network:k,onNetworkChange:T,deployRegion:S,onDeployRegionChange:_,deploymentTelemetry:{source:"code_package",createMode:"code_package",aiAssisted:!1},onBack:e,backLabel:"返回创建方式",deployDisabled:!u||b,deployDisabledReason:b?"正在读取代码包":u?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${y?" is-dragging":""}${u?" is-ready":""}`,onDragEnter:z=>{z.preventDefault(),x(!0)},onDragOver:z=>z.preventDefault(),onDragLeave:z=>{z.currentTarget.contains(z.relatedTarget)||x(!1)},onDrop:R,onClick:()=>{var z;b||(z=l.current)==null||z.click()},onKeyDown:z=>{var L;!b&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),(L=l.current)==null||L.click())},role:"button",tabIndex:b?-1:0,"aria-label":u?"重新上传代码包":"上传代码包","aria-disabled":b,children:[o.jsx("strong",{children:b?"正在读取代码包…":u?f:"请上传代码包"}),o.jsx("span",{children:u?`已识别 ${u.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:u&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:z=>{z.stopPropagation(),p(!0)},onKeyDown:z=>z.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:l,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:j})]}),E&&o.jsx("div",{className:"package-create-error",role:"alert",children:E})]})}),u&&o.jsx(Qz,{project:u,open:m,onClose:()=>p(!1),onChange:d})]})}const pG=1;function F1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zje(e){return F1(e)&&typeof e.id=="string"&&typeof e.updatedAt=="number"&&F1(e.draft)}function SE(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function Vje(e){var s;const t=pE(e),n={...((s=t.draft.deployment)==null?void 0:s.envValues)??{},...t.envValues};return!t.draft.deployment&&Object.keys(n).length===0?t.draft:{...t.draft,deployment:{...t.draft.deployment??{feishuEnabled:!1},envValues:n}}}function gG(e){return{...e,draft:Vje(e.draft)}}function Gje(e){const t=Array.isArray(e)?e:F1(e)&&e.version===pG?e.drafts:void 0;if(!Array.isArray(t)||!t.every(zje))throw F1(e)&&typeof e.version=="number"?new Error("本机草稿版本暂不受支持,请升级 Studio 后重试。"):new Error("本机草稿数据格式无效。");return t.map(gG)}function Kje(e,t){if(!t)return[];const n=e.getItem(SE(t));if(!n)return[];try{return Gje(JSON.parse(n))}catch(s){throw s instanceof Error&&s.message.startsWith("本机草稿")?s:new Error("无法读取本机草稿,浏览器中的草稿数据可能已损坏。")}}function CD(e,t,n){if(!t)return;const s={version:pG,drafts:n.map(gG)};try{e.setItem(SE(t),JSON.stringify(s))}catch(i){throw i instanceof DOMException&&(i.name==="QuotaExceededError"||i.name==="NS_ERROR_DOM_QUOTA_REACHED")?new Error("浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。"):new Error("浏览器拒绝保存草稿,请检查站点存储权限后重试。")}}const qje="/web/skill-creator";class rC extends Error{constructor(n,s){super(n);zC(this,"status");this.name="SkillCreatorApiError",this.status=s}}function Uu(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function fs(e,...t){for(const n of t){const s=e[n];if(typeof s=="string"&&s)return s}}function bG(e,...t){for(const n of t){const s=e[n];if(typeof s=="number"&&Number.isFinite(s))return s}}async function Xg(e,t){return fetch(Rn(`${qje}${e}`),{...t,headers:xx({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function aC(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const i=Uu(await e.json(),"错误响应");return fs(i,"detail","message","error")??t}return(await e.text()).trim()||t}async function oC(e,t){if(!e.ok)throw new rC(await aC(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Yje(e){if(e==="queued")return"queued";if(e==="running")return"running";if(e==="succeeded")return"succeeded";if(e==="failed")return"failed";throw new Error(`未知的 Skill 生成状态:${String(e)}`)}function Wje(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Xje(e){return Array.isArray(e)?e.map((t,n)=>{const s=Uu(t,`文件 ${n+1}`),i=fs(s,"path");if(!i)throw new Error(`文件 ${n+1} 缺少 path`);const r=bG(s,"size");if(r===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:i,size:r}}):[]}function Qje(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Array.isArray(t.errors)?t.errors.map(String):[],s=Array.isArray(t.warnings)?t.warnings.map(String):[];return{valid:typeof t.valid=="boolean"?t.valid:n.length===0,errors:n,warnings:s}}function Zje(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const s=Uu(t,`活动 ${n+1}`),i=fs(s,"id"),r=fs(s,"kind"),a=fs(s,"status");if(!i||!r||!["status","thinking","tool","message"].includes(r))throw new Error(`活动 ${n+1} 格式错误`);if(a!=="running"&&a!=="done")throw new Error(`活动 ${n+1} 状态错误`);if(r==="tool"){const c=fs(s,"name");if(!c)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:i,kind:r,name:c,args:s.input,response:s.output,status:a}}const l=fs(s,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:i,kind:r,text:l,status:a}})}function Jje(e,t){const n=Uu(e,`候选方案 ${t+1}`),s=fs(n,"id","candidate_id","candidateId"),i=fs(n,"model","model_id","modelId");if(!s||!i)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:s,model:i,modelLabel:fs(n,"modelLabel","model_label")??i,status:Yje(n.status),stage:Wje(n.stage),name:fs(n,"name","skill_name","skillName"),description:fs(n,"description"),skillMd:fs(n,"skillMd","skill_md"),files:Xje(n.files),activities:Zje(n.activities),validation:Qje(n.validation),durationMs:bG(n,"elapsedMs","elapsed_ms"),error:fs(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:fs(n,"skill_id","skillId"),version:fs(n,"version")}}function sT(e,t=""){const n=Uu(e,"Skill 创建任务"),s=fs(n,"id","job_id","jobId");if(!s)throw new Error("Skill 创建任务缺少 id");const i=Array.isArray(n.candidates)?n.candidates.map(Jje):[],r=fs(n,"status")??"running";if(r!=="provisioning"&&r!=="running"&&r!=="completed")throw new Error(`未知的 Skill 任务状态:${r}`);return{id:s,prompt:fs(n,"prompt")??t,status:r,candidates:i}}async function eRe(e,t){const n=await Xg("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new rC(await aC(n,"创建 Skill 任务失败"),n.status);const s=n.headers.get("content-type")??"";if(s.includes("application/json")){const u=sT(await n.json(),e);return t==null||t(u),u}if(!s.includes("application/x-ndjson")||!n.body)throw new Error("创建 Skill 任务失败:服务端返回了非流式响应");const i=n.body.getReader(),r=new TextDecoder;let a="",l;const c=u=>{if(!u.trim())return;const d=Uu(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(fs(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=sT(d.job,e),t==null||t(l)};for(;;){const{done:u,value:d}=await i.read();a+=r.decode(d,{stream:!u});const f=a.split(` -`);if(a=f.pop()??"",f.forEach(c),u)break}if(c(a),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function tRe(e){const t=await Xg(`/jobs/${encodeURIComponent(e)}`);return sT(await oC(t,"读取 Skill 任务失败"))}async function nRe(e){const t=await Xg(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await oC(t,"清理 Skill 任务失败")}async function sRe(e,t){var l;const n=await Xg(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await aC(n,"下载 Skill 失败"));const i=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[1])??"skill.zip",r=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=r,a.download=i,a.click(),URL.revokeObjectURL(r)}async function iRe(e,t,n){const s=await Xg(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),i=Uu(await oC(s,"添加到 AgentKit 失败"),"发布结果"),r=fs(i,"skill_id","skillId","id");if(!r)throw new Error("发布结果缺少 skill_id");return{skillId:r,name:fs(i,"name"),version:fs(i,"version"),skillSpaceIds:Array.isArray(i.skillSpaceIds)?i.skillSpaceIds.map(String):Array.isArray(i.skill_space_ids)?i.skill_space_ids.map(String):[],message:fs(i,"message")}}const rRe=()=>{};function aRe(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error("不支持的 Skill 对话活动")}function oRe({activities:e}){const t=g.useMemo(()=>e.filter(n=>n.kind!=="status").map(aRe),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(kA,{blocks:t,onAction:rRe})})}const ID={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},jD=12e4;function lRe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function cRe(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function uRe(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function dRe({candidate:e}){var c,u;const[t,n]=g.useState("SKILL.md"),s=e.files.find(d=>d.path.endsWith("SKILL.md")),i=e.skillMd&&!s?[{path:"SKILL.md",size:new Blob([e.skillMd]).size},...e.files]:e.files,r=i.find(d=>d.path===t)??i[0],a=(c=e.skillMd)==null?void 0:c.slice(0,jD),l=(((u=e.skillMd)==null?void 0:u.length)??0)>jD;return i.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:i.map(d=>o.jsx("button",{type:"button",role:"tab","aria-selected":(r==null?void 0:r.path)===d.path,className:(r==null?void 0:r.path)===d.path?"is-active":"",onClick:()=>n(d.path),children:d.path},d.path))}),e.skillMd&&(r!=null&&r.path.endsWith("SKILL.md"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:r?`${r.path} · ${r.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function fRe({label:e,jobId:t,candidate:n,selected:s,publishing:i,publishDisabled:r,publishError:a,onSelect:l,onPublish:c}){const[u,d]=g.useState("conversation"),[f,h]=g.useState(!1),[m,p]=g.useState(!1),[b,v]=g.useState(""),[y,x]=g.useState(""),[E,w]=g.useState(""),[S,_]=g.useState(""),k=g.useRef(null),T=g.useRef(null),A=n.status==="queued"||n.status==="running",j=n.status==="succeeded",R=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${s?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),s?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(lRe,{status:n.status})}),A?o.jsx(Ra,{duration:2.2,spread:16,children:ID[n.stage]}):o.jsx("span",{children:ID[n.stage]}),n.durationMs!==void 0&&j?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(oRe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,j?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:k,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var B;return(B=T.current)==null?void 0:B.focus()})},children:[o.jsx(cRe,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:T,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var B;return(B=k.current)==null?void 0:B.focus()})},children:[o.jsx(uRe,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(R==null?void 0:R.valid)===!1?"is-invalid":"is-valid",children:(R==null?void 0:R.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,R&&(R.errors.length>0||R.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...R.errors,...R.warnings].map((B,z)=>o.jsx("div",{children:B},`${B}-${z}`))]}):null,o.jsx(dRe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":s,onClick:l,children:s?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:m,onClick:()=>{p(!0),v(""),sRe(t,n.id).catch(B=>{v(B instanceof Error?B.message:String(B))}).finally(()=>p(!1))},children:m?"正在下载…":"下载 ZIP"}),o.jsx("button",{type:"button",className:"skill-action",disabled:!s||i||r||n.published,title:s?void 0:"请先采用此方案",onClick:()=>h(B=>!B),children:n.published?"已添加到 AgentKit":i?"正在添加…":"添加到 AgentKit"})]}),b?o.jsx("div",{className:"skill-candidate__error",children:b}):null,f&&s&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:B=>{B.preventDefault();const z=y.split(",").map(L=>L.trim()).filter(Boolean);c({skillSpaceIds:z,...E.trim()?{projectName:E.trim()}:{},...S.trim()?{skillId:S.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:B=>x(B.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:E,onChange:B=>w(B.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:S,onChange:B=>_(B.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:i,children:i?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const RD=new Set(["completed"]),Tb=1100,hRe=3e4;function mRe(e,t){return{id:`pending-${t}`,model:e,modelLabel:e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}}function pRe({initialJob:e}){const[t,n]=g.useState(e),[s,i]=g.useState(""),[r,a]=g.useState(!1),[l,c]=g.useState(),[u,d]=g.useState(),[f,h]=g.useState(()=>new Set),[m,p]=g.useState({});g.useEffect(()=>{n(e),i(""),a(!1)},[e]),g.useEffect(()=>{if(RD.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,x;const E=Date.now()+hRe,w=async()=>{try{const S=await tRe(e.id);y||(n({...S,prompt:S.prompt||e.prompt}),i(""),RD.has(S.status)||(x=window.setTimeout(w,Tb)))}catch(S){if(!y){const _=S instanceof rC?S:void 0;if((_==null?void 0:_.status)===404&&Date.now(){y=!0,x!==void 0&&window.clearTimeout(x)}},[e.id,e.status]);const b=CA.map((y,x)=>t.candidates.find(E=>E.model===y)??t.candidates[x]??mRe(y,x));async function v(y,x){d(y.id),p(E=>({...E,[y.id]:""}));try{await iRe(t.id,y.id,x),h(E=>new Set(E).add(y.id))}catch(E){p(w=>({...w,[y.id]:E instanceof Error?E.message:String(E)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),s?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",s,"。",r?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:b.map((y,x)=>{const w=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(fRe,{label:`方案 ${x===0?"A":"B"}`,jobId:t.id,candidate:w,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:m[y.id],onSelect:()=>c(y.id),onPublish:S=>void v(y,S)},`${y.model}-${y.id}`)})})]})}function gRe(e){return Object.prototype.toString.call(e)==="[object Object]"}function OD(e){return gRe(e)||Array.isArray(e)}function bRe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function lC(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),r=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==r?!1:n.every(a=>{const l=e[a],c=t[a];return typeof l=="function"?`${l}`==`${c}`:!OD(l)||!OD(c)?l===c:lC(l,c)})}function MD(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function yRe(e,t){if(e.length!==t.length)return!1;const n=MD(e),s=MD(t);return n.every((i,r)=>{const a=s[r];return lC(i,a)})}function cC(e){return typeof e=="number"}function iT(e){return typeof e=="string"}function NE(e){return typeof e=="boolean"}function LD(e){return Object.prototype.toString.call(e)==="[object Object]"}function _s(e){return Math.abs(e)}function uC(e){return Math.sign(e)}function fp(e,t){return _s(e-t)}function xRe(e,t){if(e===0||t===0||_s(e)<=_s(t))return 0;const n=fp(_s(e),_s(t));return _s(n/e)}function ERe(e){return Math.round(e*100)/100}function ig(e){return rg(e).map(Number)}function Ma(e){return e[Qg(e)]}function Qg(e){return Math.max(0,e.length-1)}function dC(e,t){return t===Qg(e)}function DD(e,t=0){return Array.from(Array(e),(n,s)=>t+s)}function rg(e){return Object.keys(e)}function yG(e,t){return[e,t].reduce((n,s)=>(rg(s).forEach(i=>{const r=n[i],a=s[i],l=LD(r)&&LD(a);n[i]=l?yG(r,a):a}),n),{})}function rT(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function vRe(e,t){const n={start:s,center:i,end:r};function s(){return 0}function i(c){return r(c)/2}function r(c){return t-c}function a(c,u){return iT(e)?n[e](c):e(t,c,u)}return{measure:a}}function ag(){let e=[];function t(i,r,a,l={passive:!0}){let c;if("addEventListener"in i)i.addEventListener(r,a,l),c=()=>i.removeEventListener(r,a,l);else{const u=i;u.addListener(a),c=()=>u.removeListener(a)}return e.push(c),s}function n(){e=e.filter(i=>i())}const s={add:t,clear:n};return s}function wRe(e,t,n,s){const i=ag(),r=1e3/60;let a=null,l=0,c=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&p()})}function d(){m(),i.clear()}function f(v){if(!c)return;a||(a=v,n(),n());const y=v-a;for(a=v,l+=y;l>=r;)n(),l-=r;const x=l/r;s(x),c&&(c=t.requestAnimationFrame(f))}function h(){c||(c=t.requestAnimationFrame(f))}function m(){t.cancelAnimationFrame(c),a=null,l=0,c=0}function p(){a=null,l=0}return{init:u,destroy:d,start:h,stop:m,update:n,render:s}}function _Re(e,t){const n=t==="rtl",s=e==="y",i=s?"y":"x",r=s?"x":"y",a=!s&&n?-1:1,l=d(),c=f();function u(p){const{height:b,width:v}=p;return s?b:v}function d(){return s?"top":n?"right":"left"}function f(){return s?"bottom":n?"left":"right"}function h(p){return p*a}return{scroll:i,cross:r,startEdge:l,endEdge:c,measureSize:u,direction:h}}function _u(e=0,t=0){const n=_s(e-t);function s(u){return ut}function r(u){return s(u)||i(u)}function a(u){return r(u)?s(u)?e:t:u}function l(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:a,reachedAny:r,reachedMax:i,reachedMin:s,removeOffset:l}}function xG(e,t,n){const{constrain:s}=_u(0,e),i=e+1;let r=a(t);function a(h){return n?_s((i+h)%i):s(h)}function l(){return r}function c(h){return r=a(h),f}function u(h){return d().set(l()+h)}function d(){return xG(e,l(),n)}const f={get:l,set:c,add:u,clone:d};return f}function SRe(e,t,n,s,i,r,a,l,c,u,d,f,h,m,p,b,v,y,x){const{cross:E,direction:w}=e,S=["INPUT","SELECT","TEXTAREA"],_={passive:!1},k=ag(),T=ag(),A=_u(50,225).constrain(m.measure(20)),j={mouse:300,touch:400},R={mouse:500,touch:600},B=p?43:25;let z=!1,L=0,F=0,C=!1,I=!1,D=!1,$=!1;function O(ue){if(!x)return;function we(Se){(NE(x)||x(ue,Se))&&V(Se)}const De=t;k.add(De,"dragstart",Se=>Se.preventDefault(),_).add(De,"touchmove",()=>{},_).add(De,"touchend",()=>{}).add(De,"touchstart",we).add(De,"mousedown",we).add(De,"touchcancel",K).add(De,"contextmenu",K).add(De,"click",ce,!0)}function te(){k.clear(),T.clear()}function ne(){const ue=$?n:t;T.add(ue,"touchmove",X,_).add(ue,"touchend",K).add(ue,"mousemove",X,_).add(ue,"mouseup",K)}function P(ue){const we=ue.nodeName||"";return S.includes(we)}function Q(){return(p?R:j)[$?"mouse":"touch"]}function ee(ue,we){const De=f.add(uC(ue)*-1),Se=d.byDistance(ue,!p).distance;return p||_s(ue)=2,!(we&&ue.button!==0)&&(P(ue.target)||(C=!0,r.pointerDown(ue),u.useFriction(0).useDuration(0),i.set(a),ne(),L=r.readPoint(ue),F=r.readPoint(ue,E),h.emit("pointerDown")))}function X(ue){if(!rT(ue,s)&&ue.touches.length>=2)return K(ue);const De=r.readPoint(ue),Se=r.readPoint(ue,E),ae=fp(De,L),pe=fp(Se,F);if(!I&&!$&&(!ue.cancelable||(I=ae>pe,!I)))return K(ue);const _e=r.pointerMove(ue);ae>b&&(D=!0),u.useFriction(.3).useDuration(.75),l.start(),i.add(w(_e)),ue.preventDefault()}function K(ue){const De=d.byDistance(0,!1).index!==f.get(),Se=r.pointerUp(ue)*Q(),ae=ee(w(Se),De),pe=xRe(Se,ae),_e=B-10*pe,et=y+pe/50;I=!1,C=!1,T.clear(),u.useDuration(_e).useFriction(et),c.distance(ae,!p),$=!1,h.emit("pointerUp")}function ce(ue){D&&(ue.stopPropagation(),ue.preventDefault(),D=!1)}function he(){return C}return{init:O,destroy:te,pointerDown:he}}function NRe(e,t){let s,i;function r(f){return f.timeStamp}function a(f,h){const p=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(rT(f,t)?f:f.touches[0])[p]}function l(f){return s=f,i=f,a(f)}function c(f){const h=a(f)-a(i),m=r(f)-r(s)>170;return i=f,m&&(s=f),h}function u(f){if(!s||!i)return 0;const h=a(i)-a(s),m=r(f)-r(s),p=r(f)-r(i)>170,b=h/m;return m&&!p&&_s(b)>.1?b:0}return{pointerDown:l,pointerMove:c,pointerUp:u,readPoint:a}}function TRe(){function e(n){const{offsetTop:s,offsetLeft:i,offsetWidth:r,offsetHeight:a}=n;return{top:s,right:i+r,bottom:s+a,left:i,width:r,height:a}}return{measure:e}}function kRe(e){function t(s){return e*(s/100)}return{measure:t}}function ARe(e,t,n,s,i,r,a){const l=[e].concat(s);let c,u,d=[],f=!1;function h(v){return i.measureSize(a.measure(v))}function m(v){if(!r)return;u=h(e),d=s.map(h);function y(x){for(const E of x){if(f)return;const w=E.target===e,S=s.indexOf(E.target),_=w?u:d[S],k=h(w?e:s[S]);if(_s(k-_)>=.5){v.reInit(),t.emit("resize");break}}}c=new ResizeObserver(x=>{(NE(r)||r(v,x))&&y(x)}),n.requestAnimationFrame(()=>{l.forEach(x=>c.observe(x))})}function p(){f=!0,c&&c.disconnect()}return{init:m,destroy:p}}function CRe(e,t,n,s,i,r){let a=0,l=0,c=i,u=r,d=e.get(),f=0;function h(){const _=s.get()-e.get(),k=!c;let T=0;return k?(a=0,n.set(s),e.set(s),T=_):(n.set(e),a+=_/c,a*=u,d+=a,e.add(a),T=d-f),l=uC(T),f=d,S}function m(){const _=s.get()-t.get();return _s(_)<.001}function p(){return c}function b(){return l}function v(){return a}function y(){return E(i)}function x(){return w(r)}function E(_){return c=_,S}function w(_){return u=_,S}const S={direction:b,duration:p,velocity:v,seek:h,settled:m,useBaseFriction:x,useBaseDuration:y,useFriction:w,useDuration:E};return S}function IRe(e,t,n,s,i){const r=i.measure(10),a=i.measure(50),l=_u(.1,.99);let c=!1;function u(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function d(m){if(!u())return;const p=e.reachedMin(t.get())?"min":"max",b=_s(e[p]-t.get()),v=n.get()-t.get(),y=l.constrain(b/a);n.subtract(v*y),!m&&_s(v){const{min:v,max:y}=r,x=r.constrain(p),E=!b,w=dC(n,b);return E?y:w||u(v,x)?v:u(y,x)?y:x}).map(p=>parseFloat(p.toFixed(3)))}function h(){if(t<=e+i)return[r.max];if(s==="keepSnaps")return a;const{min:p,max:b}=l;return a.slice(p,b)}return{snapsContained:c,scrollContainLimit:l}}function RRe(e,t,n){const s=t[0],i=n?s-e:Ma(t);return{limit:_u(i,s)}}function ORe(e,t,n,s){const r=t.min+.1,a=t.max+.1,{reachedMin:l,reachedMax:c}=_u(r,a);function u(h){return h===1?c(n.get()):h===-1?l(n.get()):!1}function d(h){if(!u(h))return;const m=e*(h*-1);s.forEach(p=>p.add(m))}return{loop:d}}function MRe(e){const{max:t,length:n}=e;function s(r){const a=r-t;return n?a/-n:0}return{get:s}}function LRe(e,t,n,s,i){const{startEdge:r,endEdge:a}=e,{groupSlides:l}=i,c=f().map(t.measure),u=h(),d=m();function f(){return l(s).map(b=>Ma(b)[a]-b[0][r]).map(_s)}function h(){return s.map(b=>n[r]-b[r]).map(b=>-_s(b))}function m(){return l(u).map(b=>b[0]).map((b,v)=>b+c[v])}return{snaps:u,snapsAligned:d}}function DRe(e,t,n,s,i,r){const{groupSlides:a}=i,{min:l,max:c}=s,u=d();function d(){const h=a(r),m=!e||t==="keepSnaps";return n.length===1?[r]:m?h:h.slice(l,c).map((p,b,v)=>{const y=!b,x=dC(v,b);if(y){const E=Ma(v[0])+1;return DD(E)}if(x){const E=Qg(r)-Ma(v)[0]+1;return DD(E,Ma(v)[0])}return p})}return{slideRegistry:u}}function PRe(e,t,n,s,i){const{reachedAny:r,removeOffset:a,constrain:l}=s;function c(p){return p.concat().sort((b,v)=>_s(b)-_s(v))[0]}function u(p){const b=e?a(p):l(p),v=t.map((x,E)=>({diff:d(x-b,0),index:E})).sort((x,E)=>_s(x.diff)-_s(E.diff)),{index:y}=v[0];return{index:y,distance:b}}function d(p,b){const v=[p,p+n,p-n];if(!e)return p;if(!b)return c(v);const y=v.filter(x=>uC(x)===b);return y.length?c(y):Ma(v)-n}function f(p,b){const v=t[p]-i.get(),y=d(v,b);return{index:p,distance:y}}function h(p,b){const v=i.get()+p,{index:y,distance:x}=u(v),E=!e&&r(v);if(!b||E)return{index:y,distance:p};const w=t[y]-x,S=p+d(w,0);return{index:y,distance:S}}return{byDistance:h,byIndex:f,shortcut:d}}function BRe(e,t,n,s,i,r,a){function l(f){const h=f.distance,m=f.index!==t.get();r.add(h),h&&(s.duration()?e.start():(e.update(),e.render(1),e.update())),m&&(n.set(t.get()),t.set(f.index),a.emit("select"))}function c(f,h){const m=i.byDistance(f,h);l(m)}function u(f,h){const m=t.clone().set(f),p=i.byIndex(m.get(),h);l(p)}return{distance:c,index:u}}function URe(e,t,n,s,i,r,a,l){const c={passive:!0,capture:!0};let u=0;function d(m){if(!l)return;function p(b){if(new Date().getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const x=n.findIndex(E=>E.includes(b));cC(x)&&(i.useDuration(0),s.index(x,0),a.emit("slideFocus"))}r.add(document,"keydown",f,!1),t.forEach((b,v)=>{r.add(b,"focus",y=>{(NE(l)||l(m,y))&&p(v)},c)})}function f(m){m.code==="Tab"&&(u=new Date().getTime())}return{init:d}}function Im(e){let t=e;function n(){return t}function s(c){t=a(c)}function i(c){t+=a(c)}function r(c){t-=a(c)}function a(c){return cC(c)?c:c.get()}return{get:n,set:s,add:i,subtract:r}}function EG(e,t){const n=e.scroll==="x"?a:l,s=t.style;let i=null,r=!1;function a(h){return`translate3d(${h}px,0px,0px)`}function l(h){return`translate3d(0px,${h}px,0px)`}function c(h){if(r)return;const m=ERe(e.direction(h));m!==i&&(s.transform=n(m),i=m)}function u(h){r=!h}function d(){r||(s.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:d,to:c,toggleActive:u}}function FRe(e,t,n,s,i,r,a,l,c){const d=ig(i),f=ig(i).reverse(),h=y().concat(x());function m(k,T){return k.reduce((A,j)=>A-i[j],T)}function p(k,T){return k.reduce((A,j)=>m(A,T)>0?A.concat([j]):A,[])}function b(k){return r.map((T,A)=>({start:T-s[A]+.5+k,end:T+t-.5+k}))}function v(k,T,A){const j=b(T);return k.map(R=>{const B=A?0:-n,z=A?n:0,L=A?"end":"start",F=j[R][L];return{index:R,loopPoint:F,slideLocation:Im(-1),translate:EG(e,c[R]),target:()=>l.get()>F?B:z}})}function y(){const k=a[0],T=p(f,k);return v(T,n,!1)}function x(){const k=t-a[0]-1,T=p(d,k);return v(T,-n,!0)}function E(){return h.every(({index:k})=>{const T=d.filter(A=>A!==k);return m(T,t)<=.1})}function w(){h.forEach(k=>{const{target:T,translate:A,slideLocation:j}=k,R=T();R!==j.get()&&(A.to(R),j.set(R))})}function S(){h.forEach(k=>k.translate.clear())}return{canLoop:E,clear:S,loop:w,loopPoints:h}}function $Re(e,t,n){let s,i=!1;function r(c){if(!n)return;function u(d){for(const f of d)if(f.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}s=new MutationObserver(d=>{i||(NE(n)||n(c,d))&&u(d)}),s.observe(e,{childList:!0})}function a(){s&&s.disconnect(),i=!0}return{init:r,destroy:a}}function HRe(e,t,n,s){const i={};let r=null,a=null,l,c=!1;function u(){l=new IntersectionObserver(p=>{c||(p.forEach(b=>{const v=t.indexOf(b.target);i[v]=b}),r=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:s}),t.forEach(p=>l.observe(p))}function d(){l&&l.disconnect(),c=!0}function f(p){return rg(i).reduce((b,v)=>{const y=parseInt(v),{isIntersecting:x}=i[y];return(p&&x||!p&&!x)&&b.push(y),b},[])}function h(p=!0){if(p&&r)return r;if(!p&&a)return a;const b=f(p);return p&&(r=b),p||(a=b),b}return{init:u,destroy:d,get:h}}function zRe(e,t,n,s,i,r){const{measureSize:a,startEdge:l,endEdge:c}=e,u=n[0]&&i,d=p(),f=b(),h=n.map(a),m=v();function p(){if(!u)return 0;const x=n[0];return _s(t[l]-x[l])}function b(){if(!u)return 0;const x=r.getComputedStyle(Ma(s));return parseFloat(x.getPropertyValue(`margin-${c}`))}function v(){return n.map((x,E,w)=>{const S=!E,_=dC(w,E);return S?h[E]+d:_?h[E]+f:w[E+1][l]-x[l]}).map(_s)}return{slideSizes:h,slideSizesWithGaps:m,startGap:d,endGap:f}}function VRe(e,t,n,s,i,r,a,l,c){const{startEdge:u,endEdge:d,direction:f}=e,h=cC(n);function m(y,x){return ig(y).filter(E=>E%x===0).map(E=>y.slice(E,E+x))}function p(y){return y.length?ig(y).reduce((x,E,w)=>{const S=Ma(x)||0,_=S===0,k=E===Qg(y),T=i[u]-r[S][u],A=i[u]-r[E][d],j=!s&&_?f(a):0,R=!s&&k?f(l):0,B=_s(A-R-(T+j));return w&&B>t+c&&x.push(E),k&&x.push(y.length),x},[]).map((x,E,w)=>{const S=Math.max(w[E-1]||0);return y.slice(S,x)}):[]}function b(y){return h?m(y,n):p(y)}return{groupSlides:b}}function GRe(e,t,n,s,i,r,a){const{align:l,axis:c,direction:u,startIndex:d,loop:f,duration:h,dragFree:m,dragThreshold:p,inViewThreshold:b,slidesToScroll:v,skipSnaps:y,containScroll:x,watchResize:E,watchSlides:w,watchDrag:S,watchFocus:_}=r,k=2,T=TRe(),A=T.measure(t),j=n.map(T.measure),R=_Re(c,u),B=R.measureSize(A),z=kRe(B),L=vRe(l,B),F=!f&&!!x,C=f||!!x,{slideSizes:I,slideSizesWithGaps:D,startGap:$,endGap:O}=zRe(R,A,j,n,C,i),te=VRe(R,B,v,f,A,j,$,O,k),{snaps:ne,snapsAligned:P}=LRe(R,L,A,j,te),Q=-Ma(ne)+Ma(D),{snapsContained:ee,scrollContainLimit:V}=jRe(B,Q,P,x,k),X=F?ee:P,{limit:K}=RRe(Q,X,f),ce=xG(Qg(X),d,f),he=ce.clone(),ye=ig(n),ue=({dragHandler:Oe,scrollBody:at,scrollBounds:Lt,options:{loop:ct}})=>{ct||Lt.constrain(Oe.pointerDown()),at.seek()},we=({scrollBody:Oe,translate:at,location:Lt,offsetLocation:ct,previousLocation:yn,scrollLooper:Et,slideLooper:vt,dragHandler:xn,animation:Vt,eventHandler:Ft,scrollBounds:it,options:{loop:dt}},He)=>{const St=Oe.settled(),ge=!it.shouldConstrain(),$e=dt?St:St&&ge,nt=$e&&!xn.pointerDown();nt&&Vt.stop();const $t=Lt.get()*He+yn.get()*(1-He);ct.set($t),dt&&(Et.loop(Oe.direction()),vt.loop()),at.to(ct.get()),nt&&Ft.emit("settle"),$e||Ft.emit("scroll")},De=wRe(s,i,()=>ue(Ee),Oe=>we(Ee,Oe)),Se=.68,ae=X[ce.get()],pe=Im(ae),_e=Im(ae),et=Im(ae),Be=Im(ae),Fe=CRe(pe,et,_e,Be,h,Se),We=PRe(f,X,Q,K,Be),Ae=BRe(De,ce,he,Fe,We,Be,a),Ke=MRe(K),Ue=ag(),W=HRe(t,n,a,b),{slideRegistry:oe}=DRe(F,x,X,V,te,ye),Z=URe(e,n,oe,Ae,Fe,Ue,a,_),Ee={ownerDocument:s,ownerWindow:i,eventHandler:a,containerRect:A,slideRects:j,animation:De,axis:R,dragHandler:SRe(R,e,s,i,Be,NRe(R,i),pe,De,Ae,Fe,We,ce,a,z,m,p,y,Se,S),eventStore:Ue,percentOfView:z,index:ce,indexPrevious:he,limit:K,location:pe,offsetLocation:et,previousLocation:_e,options:r,resizeHandler:ARe(t,a,i,n,R,E,T),scrollBody:Fe,scrollBounds:IRe(K,et,Be,Fe,z),scrollLooper:ORe(Q,K,et,[pe,et,_e,Be]),scrollProgress:Ke,scrollSnapList:X.map(Ke.get),scrollSnaps:X,scrollTarget:We,scrollTo:Ae,slideLooper:FRe(R,B,Q,I,D,ne,X,et,n),slideFocus:Z,slidesHandler:$Re(t,a,w),slidesInView:W,slideIndexes:ye,slideRegistry:oe,slidesToScroll:te,target:Be,translate:EG(R,t)};return Ee}function KRe(){let e={},t;function n(u){t=u}function s(u){return e[u]||[]}function i(u){return s(u).forEach(d=>d(t,u)),c}function r(u,d){return e[u]=s(u).concat([d]),c}function a(u,d){return e[u]=s(u).filter(f=>f!==d),c}function l(){e={}}const c={init:n,emit:i,off:a,on:r,clear:l};return c}const qRe={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function YRe(e){function t(r,a){return yG(r,a||{})}function n(r){const a=r.breakpoints||{},l=rg(a).filter(c=>e.matchMedia(c).matches).map(c=>a[c]).reduce((c,u)=>t(c,u),{});return t(r,l)}function s(r){return r.map(a=>rg(a.breakpoints||{})).reduce((a,l)=>a.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:s}}function WRe(e){let t=[];function n(r,a){return t=a.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(r,e)),a.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function s(){t=t.filter(r=>r.destroy())}return{init:n,destroy:s}}function $1(e,t,n){const s=e.ownerDocument,i=s.defaultView,r=YRe(i),a=WRe(r),l=ag(),c=KRe(),{mergeOptions:u,optionsAtMedia:d,optionsMediaQueries:f}=r,{on:h,off:m,emit:p}=c,b=R;let v=!1,y,x=u(qRe,$1.globalOptions),E=u(x),w=[],S,_,k;function T(){const{container:ye,slides:ue}=E;_=(iT(ye)?e.querySelector(ye):ye)||e.children[0];const De=iT(ue)?_.querySelectorAll(ue):ue;k=[].slice.call(De||_.children)}function A(ye){const ue=GRe(e,_,k,s,i,ye,c);if(ye.loop&&!ue.slideLooper.canLoop()){const we=Object.assign({},ye,{loop:!1});return A(we)}return ue}function j(ye,ue){v||(x=u(x,ye),E=d(x),w=ue||w,T(),y=A(E),f([x,...w.map(({options:we})=>we)]).forEach(we=>l.add(we,"change",R)),E.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(he),y.eventHandler.init(he),y.resizeHandler.init(he),y.slidesHandler.init(he),y.options.loop&&y.slideLooper.loop(),_.offsetParent&&k.length&&y.dragHandler.init(he),S=a.init(he,w)))}function R(ye,ue){const we=te();B(),j(u({startIndex:we},ye),ue),c.emit("reInit")}function B(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),a.destroy(),l.clear()}function z(){v||(v=!0,l.clear(),B(),c.emit("destroy"),c.clear())}function L(ye,ue,we){!E.active||v||(y.scrollBody.useBaseFriction().useDuration(ue===!0?0:E.duration),y.scrollTo.index(ye,we||0))}function F(ye){const ue=y.index.add(1).get();L(ue,ye,-1)}function C(ye){const ue=y.index.add(-1).get();L(ue,ye,1)}function I(){return y.index.add(1).get()!==te()}function D(){return y.index.add(-1).get()!==te()}function $(){return y.scrollSnapList}function O(){return y.scrollProgress.get(y.offsetLocation.get())}function te(){return y.index.get()}function ne(){return y.indexPrevious.get()}function P(){return y.slidesInView.get()}function Q(){return y.slidesInView.get(!1)}function ee(){return S}function V(){return y}function X(){return e}function K(){return _}function ce(){return k}const he={canScrollNext:I,canScrollPrev:D,containerNode:K,internalEngine:V,destroy:z,off:m,on:h,emit:p,plugins:ee,previousScrollSnap:ne,reInit:b,rootNode:X,scrollNext:F,scrollPrev:C,scrollProgress:O,scrollSnapList:$,scrollTo:L,selectedScrollSnap:te,slideNodes:ce,slidesInView:P,slidesNotInView:Q};return j(t,n),setTimeout(()=>c.emit("init"),0),he}$1.globalOptions=void 0;function fC(e={},t=[]){const n=g.useRef(e),s=g.useRef(t),[i,r]=g.useState(),[a,l]=g.useState(),c=g.useCallback(()=>{i&&i.reInit(n.current,s.current)},[i]);return g.useEffect(()=>{lC(n.current,e)||(n.current=e,c())},[e,c]),g.useEffect(()=>{yRe(s.current,t)||(s.current=t,c())},[t,c]),g.useEffect(()=>{if(bRe()&&a){$1.globalOptions=fC.globalOptions;const u=$1(a,n.current,s.current);return r(u),()=>u.destroy()}else r(void 0)},[a,r]),[l,i]}fC.globalOptions=void 0;const vG=g.createContext(null);function Zg(...e){return e.filter(Boolean).join(" ")}function TE(){const e=g.useContext(vG);if(!e)throw new Error("useCarousel must be used within a ");return e}function XRe({orientation:e="horizontal",opts:t,setApi:n,plugins:s,className:i,children:r,...a}){const[l,c]=fC({...t,axis:e==="horizontal"?"x":"y"},s),[u,d]=g.useState(!1),[f,h]=g.useState(!1),m=g.useCallback(y=>{y&&(d(y.canScrollPrev()),h(y.canScrollNext()))},[]),p=g.useCallback(()=>c==null?void 0:c.scrollPrev(),[c]),b=g.useCallback(()=>c==null?void 0:c.scrollNext(),[c]),v=g.useCallback(y=>{y.key==="ArrowLeft"?(y.preventDefault(),p()):y.key==="ArrowRight"&&(y.preventDefault(),b())},[b,p]);return g.useEffect(()=>{c&&n&&n(c)},[c,n]),g.useEffect(()=>{if(c)return m(c),c.on("reInit",m),c.on("select",m),()=>{c.off("reInit",m),c.off("select",m)}},[c,m]),o.jsx(vG.Provider,{value:{carouselRef:l,api:c,opts:t,orientation:e,plugins:s,setApi:n,scrollPrev:p,scrollNext:b,canScrollPrev:u,canScrollNext:f},children:o.jsx("div",{onKeyDownCapture:v,className:Zg("ui-carousel",i),role:"region","aria-roledescription":"carousel","aria-orientation":e,"data-slot":"carousel",...a,children:r})})}function QRe({className:e,...t}){const{carouselRef:n,orientation:s}=TE();return o.jsx("div",{ref:n,className:"ui-carousel__viewport","data-slot":"carousel-content",children:o.jsx("div",{className:Zg("ui-carousel__track",s==="vertical"?"is-vertical":void 0,e),...t})})}function ZRe({className:e,...t}){const{orientation:n}=TE();return o.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:Zg("ui-carousel__item",n==="vertical"?"is-vertical":void 0,e),...t})}function wG({direction:e}){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:e==="left"?"m10 3.75-4.25 4.25L10 12.25":"m6 3.75 4.25 4.25L6 12.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function JRe({className:e,...t}){const{orientation:n,scrollPrev:s,canScrollPrev:i}=TE();return o.jsx("button",{type:"button","data-slot":"carousel-previous",className:Zg("ui-carousel__control ui-carousel__control--previous",n==="vertical"?"is-vertical":void 0,e),disabled:!i,onClick:s,"aria-label":"上一张",...t,children:o.jsx(wG,{direction:"left"})})}function eOe({className:e,...t}){const{orientation:n,scrollNext:s,canScrollNext:i}=TE();return o.jsx("button",{type:"button","data-slot":"carousel-next",className:Zg("ui-carousel__control ui-carousel__control--next",n==="vertical"?"is-vertical":void 0,e),disabled:!i,onClick:s,"aria-label":"下一张",...t,children:o.jsx(wG,{direction:"right"})})}const PD=[{title:"随心应变",description:"支持多类 Agent",illustration:"agents"},{title:"一键成型",description:"自动构建 Agent",illustration:"build"},{title:"一搜即达",description:"全局搜索",illustration:"search"},{title:"开箱即用",description:"丰富内置工具",illustration:"tools"}];function tOe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 4.25 7.5 7.5m0-7.5-7.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function nOe({kind:e}){return e==="agents"?o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsx("g",{className:"new-chat-feature-card__illustration-connectors",children:o.jsx("path",{d:"M43 27.5V33.5H22V38.5M43 33.5H64V38.5"})}),o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"33",y:"6.5",width:"20",height:"21",rx:"6"}),o.jsx("rect",{x:"9",y:"38.5",width:"26",height:"19",rx:"6"}),o.jsx("rect",{x:"51",y:"38.5",width:"26",height:"19",rx:"6"})]}),o.jsxs("g",{className:"new-chat-feature-card__illustration-details",children:[o.jsx("circle",{className:"new-chat-feature-card__illustration-dot",cx:"40",cy:"14.5",r:"1.25"}),o.jsx("circle",{className:"new-chat-feature-card__illustration-dot",cx:"46",cy:"14.5",r:"1.25"}),o.jsx("path",{d:"M39.5 21h7M17 46.5h10M17 51.5h7M59 46.5h10M59 51.5h7"})]})]}):e==="build"?o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsx("g",{className:"new-chat-feature-card__illustration-connectors",children:o.jsx("path",{d:"M26.5 39H36M50 39h9.5"})}),o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"5.5",y:"7.5",width:"75",height:"49",rx:"7.5"}),o.jsx("rect",{x:"12.5",y:"31.5",width:"14",height:"15",rx:"4"}),o.jsx("rect",{x:"36",y:"31.5",width:"14",height:"15",rx:"4"}),o.jsx("rect",{x:"59.5",y:"31.5",width:"14",height:"15",rx:"4"})]}),o.jsx("g",{className:"new-chat-feature-card__illustration-details",children:o.jsx("path",{d:"M6 20.5h74M13.5 14h.01m6 0h.01m6 0h.01M17 39h5m18.5 0h5m18-1 2.5 2.5 4-5"})})]}):e==="search"?o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"7.5",y:"9.5",width:"41",height:"16",rx:"5"}),o.jsx("rect",{x:"7.5",y:"35.5",width:"34",height:"18",rx:"5"}),o.jsx("circle",{cx:"61",cy:"33",r:"10.5"})]}),o.jsx("g",{className:"new-chat-feature-card__illustration-details",children:o.jsx("path",{d:"M14.5 16h21M14.5 21h14M14.5 42.5h17M14.5 47.5h11M68.5 40.5 77 49"})})]}):o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"8.5",y:"7.5",width:"29",height:"21",rx:"6"}),o.jsx("rect",{x:"48.5",y:"7.5",width:"29",height:"21",rx:"6"}),o.jsx("rect",{x:"8.5",y:"35.5",width:"29",height:"21",rx:"6"}),o.jsx("rect",{x:"48.5",y:"35.5",width:"29",height:"21",rx:"6"})]}),o.jsx("g",{className:"new-chat-feature-card__illustration-details",children:o.jsx("path",{d:"M23 13.5v9m-4.5-4.5h9M56.5 14.5h13M56.5 21.5h13M16.5 42.5h13M16.5 49.5h9M56.5 42.5h13M56.5 49.5h13"})})]})}function sOe(){const[e,t]=g.useState(),[n,s]=g.useState(!1),[i,r]=g.useState(!1),[a,l]=g.useState(!1),[c,u]=g.useState(!0);return g.useEffect(()=>{if(!c)return;const d=window.matchMedia("(prefers-reduced-motion: reduce)"),f=()=>l(d.matches);return f(),d.addEventListener("change",f),()=>d.removeEventListener("change",f)},[c]),g.useEffect(()=>{if(!c||!e||n||i||a)return;const d=window.setInterval(()=>e.scrollNext(),6e3);return()=>window.clearInterval(d)},[e,i,n,a,c]),c?o.jsxs(XRe,{className:"new-chat-feature-carousel",opts:{align:"start",loop:!0},setApi:t,"aria-label":"新特性预览",onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),onFocusCapture:()=>r(!0),onBlurCapture:d=>{d.currentTarget.contains(d.relatedTarget)||r(!1)},children:[o.jsx(JRe,{"aria-label":"上一张新特性"}),o.jsx(QRe,{children:PD.map((d,f)=>o.jsx(ZRe,{"aria-label":`${f+1} / ${PD.length}`,children:o.jsxs("article",{className:"new-chat-feature-card",children:[o.jsxs("div",{className:"new-chat-feature-card__copy",children:[o.jsx("strong",{children:d.title}),o.jsx("span",{children:d.description})]}),o.jsx(nOe,{kind:d.illustration})]})},d.title))}),o.jsx("button",{type:"button",className:"new-chat-feature-carousel__close","aria-label":"关闭新特性轮播",onClick:()=>u(!1),children:o.jsx(tOe,{})}),o.jsx(eOe,{"aria-label":"下一张新特性"})]}):null}const iOe=3*60*1e3,rOe=3e3,aOe=10*60*1e3,H1="veadk.studio.pending-update",BD=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],oOe={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function lOe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function cOe(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function uOe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(H1);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.targetVersion=="string"&&typeof t.startedAt=="number")return{targetVersion:t.targetVersion,startedAt:t.startedAt}}catch{}return window.localStorage.removeItem(H1),null}function h_(e,t){window.localStorage.setItem(H1,JSON.stringify({targetVersion:e,startedAt:t}))}function kb(){window.localStorage.removeItem(H1)}function UD({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function dOe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function fOe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function FD({lines:e,phase:t,copyState:n,onCopy:s}){const i=g.useRef(null),r=g.useRef(!0);return g.useEffect(()=>{const a=i.current;a&&r.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:s,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:i,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;r.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function hOe({variant:e="default"}){var L,F;const[t]=g.useState(uOe),[n,s]=g.useState(null),[i,r]=g.useState(t?"submitting":"idle"),[a,l]=g.useState(!1),[c,u]=g.useState(""),[d,f]=g.useState((t==null?void 0:t.targetVersion)??""),[h,m]=g.useState(!1),[p,b]=g.useState("idle"),[v,y]=g.useState(0),x=g.useRef(null),E=g.useRef((t==null?void 0:t.targetVersion)??""),w=g.useRef((t==null?void 0:t.startedAt)??0);g.useEffect(()=>{if(!h)return;const C=D=>{var $;D.target instanceof Node&&!(($=x.current)!=null&&$.contains(D.target))&&m(!1)},I=D=>{D.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",C),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",I)}},[h]);const S=g.useCallback(async()=>{const C=await j8(E.current||void 0,w.current||void 0);return s(C),C},[]);if(g.useEffect(()=>{let C=!0;const I=()=>{S().catch(()=>{C&&s($=>$)})};I();const D=window.setInterval(I,iOe);return()=>{C=!1,window.clearInterval(D)}},[S]),g.useEffect(()=>{if(i!=="submitting")return;const C=window.setInterval(()=>{S().then(I=>{const D=E.current;if(D&&cOe(I.currentVersion,D)||!D&&!I.available&&I.latestVersion){window.clearInterval(C),kb(),r("published"),u("Studio 已更新,刷新页面即可使用新版本");return}if(I.state==="error"){window.clearInterval(C),kb(),r("error"),u(I.message||"Studio 更新失败");return}Date.now()-w.current>aOe&&(window.clearInterval(C),kb(),r("error"),u("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},rOe);return()=>window.clearInterval(C)},[i,S]),g.useEffect(()=>{i!=="idle"||(n==null?void 0:n.state)!=="updating"||(E.current=n.targetVersion,w.current=n.startedAt||Date.now(),h_(n.targetVersion,w.current),f(n.targetVersion),r("submitting"))},[i,n]),g.useEffect(()=>{if(i!=="submitting"){y(0);return}const C=()=>{const D=w.current||Date.now();y(Math.max(0,Math.floor((Date.now()-D)/1e3)))};C();const I=window.setInterval(C,1e3);return()=>window.clearInterval(I)},[i]),!(n!=null&&n.enabled)||!(n.available||n.state==="updating"||i!=="idle"))return null;const k=n.releases??[],T=d||((L=k[0])==null?void 0:L.version)||n.latestVersion,A=k.find(C=>C.version===T),j=async()=>{E.current=T,w.current=Date.now(),h_(T,w.current),r("submitting"),u(""),b("idle");try{const C=await R8(T);E.current=C.version,h_(C.version,w.current),u("更新已提交,正在等待 VeFaaS 发布新版本")}catch(C){if(C instanceof TypeError){u("连接已切换,正在确认新版本状态");return}kb(),r("error");const I=C instanceof Error?C.message:"Studio 更新失败";try{const D=await S();u(D.message||I)}catch{u(I)}}},R=(F=n.updateLogs)!=null&&F.length?n.updateLogs:(n.errorLog||n.progressMessage||c).split(` +`);if(!t.length||t[0].trim()!=="---")return{name:"",description:""};let n=-1;for(let i=1;i=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function UIe(...e){var t;for(const n of e){const s=(t=n.trim().replace(/\\/g,"/").split("/").filter(Boolean).pop())==null?void 0:t.replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"");if(s)return s.slice(0,64)}return"local-skill"}function FIe(e,t){return t.trim()||e}function JV(e){const t=e.map(s=>({path:s.path.replace(/\\/g,"/").replace(/^\.\//,""),text:s.text})).filter(s=>s.path.length>0&&!s.path.endsWith("/")),n=new Set(t.map(s=>s.path.split("/")[0]));if(n.size===1&&t.every(s=>s.path.includes("/"))){const s=[...n][0]+"/";return t.map(i=>({path:i.path.slice(s.length),text:i.text}))}return t}function $Ie(e){const t=new Map,n=new Set;for(const s of e)if(QN.test("/"+s.path)){const i=s.path.split("/");n.add(i.slice(0,-1).join("/"))}for(const s of e){const i=s.path.split("/");let r="";for(let u=i.length-1;u>=0;u--){const d=i.slice(0,u).join("/");if(n.has(d)){r=d;break}}const a=QN.test("/"+s.path);if(!r&&!a&&!n.has("")||!n.has(r)&&!a)continue;const l=r?s.path.slice(r.length+1):s.path,c=t.get(r)||[];c.push({path:l,text:s.text}),t.set(r,c)}return t}function HIe(e,t,n){const s=`${n}${e?"/"+e:""}`,i=t.find(c=>QN.test("/"+c.path));if(!i)return{hit:null,error:`${s} 缺少 SKILL.md`};const r=PIe(i.text),a=UIe(r.name,e,n.replace(/\.[^.]+$/,"")),l=[];for(const c of t){if(c.path.split("/").some(f=>f===".."))return{hit:null,error:`${s} 包含非法路径(..):${c.path}`};const d=`skills/${a}/${c.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${s} 包含非法路径:${c.path}`};l.push({path:d,content:c.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:FIe(a,r.name),description:r.description||"本地 Skill",folder:a,localFiles:l},error:null}}async function zIe(e){const t=new Uint8Array(await e.arrayBuffer()),s=(await ZV(t)).map(i=>({path:i.name,text:i.text}));return eG(JV(s),e.name)}async function VIe(e,t=new Map){const n=[];for(let s=0;se.file(t,n))}async function KIe(e){const t=e.createReader(),n=[];for(;;){const s=await new Promise((i,r)=>t.readEntries(i,r));if(s.length===0)return n;n.push(...s)}}async function tG(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await GIe(e),path:n}];if(!e.isDirectory)return[];const s=await KIe(e);return(await Promise.all(s.map(i=>tG(i,n)))).flat()}function qIe({selected:e,onChange:t}){const[n,s]=g.useState([]),[i,r]=g.useState([]),[a,l]=g.useState(!1),[c,u]=g.useState(!1),d=g.useRef(0),f=E=>e.some(w=>w.source==="local"&&w.folder===E),h=E=>{E.localFiles&&(f(E.folder||E.name)?t(e.filter(w=>!(w.source==="local"&&w.folder===(E.folder||E.name)))):t([...e,{source:"local",folder:E.folder||E.name,name:E.name,description:E.description,localFiles:E.localFiles}]))},p=g.useRef([]),m=g.useRef(e);g.useEffect(()=>{p.current=i},[i]),g.useEffect(()=>{m.current=e},[e]);const b=E=>{const w=new Set([...p.current.map(k=>k.folder||k.name),...m.current.filter(k=>k.source==="local").map(k=>k.folder)]),S=[],_=[];for(const k of E.hits){const A=k.folder||k.name;if(w.has(A)){S.push(k.name);continue}w.add(A),_.push(k)}r(k=>[...k,..._]);const T=[...E.errors];if(S.length>0&&T.push(`已跳过重复技能:${S.join("、")}`),s(T),_.length===1&&E.errors.length===0&&S.length===0){const k=_[0];k.localFiles&&t([...m.current,{source:"local",folder:k.folder||k.name,name:k.name,description:k.description,localFiles:k.localFiles}])}},v=E=>{E.preventDefault(),d.current+=1,u(!0)},y=E=>{E.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&u(!1)},x=async E=>{if(E.preventDefault(),d.current=0,u(!1),a)return;const w=Array.from(E.dataTransfer.items).map(S=>{var _;return(_=S.webkitGetAsEntry)==null?void 0:_.call(S)}).filter(S=>S!==null);if(w.length===0){s(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}l(!0);try{const S=(await Promise.all(w.map(k=>tG(k)))).flat(),_=w.some(k=>k.isDirectory);if(!_&&S.length===1&&S[0].file.name.toLowerCase().endsWith(".zip")){b(await zIe(S[0].file));return}if(!_){s(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const T=new Map(S.map(({file:k,path:A})=>[k,A]));b(await VIe(S.map(({file:k})=>k),T))}catch(S){s([`读取失败:${S instanceof Error?S.message:String(S)}`])}finally{l(!1)}};return o.jsxs("div",{className:"cw-local",children:[o.jsxs("div",{className:`cw-local-dropzone ${c?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:v,onDragOver:E=>E.preventDefault(),onDragLeave:y,onDrop:E=>void x(E),children:[o.jsx(Yk,{className:"cw-local-drop-icon","aria-hidden":!0}),o.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),o.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md。支持包含多个技能的目录。"}),a&&o.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&o.jsxs("div",{className:"cw-banner",children:[o.jsx(bc,{className:"cw-i"}),o.jsx("span",{children:n.join(";")})]}),i.length>0&&o.jsx("div",{className:"cw-skill-results",children:i.map(E=>{var S;const w=f(E.folder||E.name);return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>h(E),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Ha,{className:"cw-i cw-i-sm"}):o.jsx(ji,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsx("span",{className:"cw-skill-result-name",children:E.name}),E.description&&o.jsx("span",{className:"cw-skill-result-desc",children:hc(E.description)}),o.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((S=E.localFiles)==null?void 0:S.length)??0," 个文件"]})]})]},E.id)})})]})}function YIe({selected:e,onChange:t,cloudProvider:n="volcengine"}){const[s,i]=g.useState([]),[r,a]=g.useState([]),[l,c]=g.useState(""),[u,d]=g.useState(!0),[f,h]=g.useState(!1),[p,m]=g.useState(null);g.useEffect(()=>{let E=!1;return(async()=>{d(!0),m(null);try{const w=await y7();E||(i(w),w.length>0&&c(w[0].id))}catch(w){E||m(w instanceof Error?w.message:"加载失败")}finally{E||d(!1)}})(),()=>{E=!0}},[]),g.useEffect(()=>{if(!l){a([]);return}const E=s.find(S=>S.id===l);let w=!1;return(async()=>{h(!0),m(null);try{const S=await x7(l,E==null?void 0:E.region);w||a(S)}catch(S){w||m(S instanceof Error?S.message:"加载失败")}finally{w||h(!1)}})(),()=>{w=!0}},[l,s]);const b=s.find(E=>E.id===l),v=b?Xfe(b.id,b.region,n):"",y=(E,w)=>e.some(S=>S.source==="skillspace"&&S.skillId===E&&(S.version||"")===w),x=E=>{if(b)if(y(E.skillId,E.version))t(e.filter(w=>!(w.source==="skillspace"&&w.skillId===E.skillId&&(w.version||"")===E.version)));else{const w=Wfe(b,E);t([...e,{source:"skillspace",folder:w.folder||E.skillName,name:w.name,description:w.description,skillSpaceId:w.skillSpaceId,skillSpaceName:w.skillSpaceName,skillSpaceRegion:w.skillSpaceRegion,skillId:w.skillId,version:w.version}])}};return o.jsx("div",{className:"cw-skillspace",children:u?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(yn,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):p?o.jsxs("div",{className:"cw-banner",children:[o.jsx(bc,{className:"cw-i"}),o.jsx("span",{children:p})]}):s.length===0?o.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-skillspace-header",children:[o.jsx("select",{className:"cw-input cw-skillspace-select",value:l,onChange:E=>c(E.target.value),"aria-label":"选择 AgentKit Skills 中心",children:s.map(E=>o.jsxs("option",{value:E.id,children:[E.name||E.id,E.description?` — ${hc(E.description)}`:""]},E.id))}),b&&o.jsxs(o.Fragment,{children:[b.region&&o.jsx("span",{className:"cw-skillspace-region-label",title:b.region,children:Nf(b.region,n)}),v&&o.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开","aria-label":"在火山引擎控制台打开",children:o.jsx(Im,{className:"cw-i cw-i-sm"})})]})]}),f?o.jsxs("p",{className:"cw-empty-line cw-skill-loading",role:"status",children:[o.jsx(yn,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):r.length===0?o.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):o.jsx("div",{className:"cw-skill-results",children:r.map(E=>{const w=y(E.skillId,E.version);return o.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>x(E),"aria-pressed":w,children:[o.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?o.jsx(Ha,{className:"cw-i cw-i-sm"}):o.jsx(ji,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-skill-result-meta",children:[o.jsxs("span",{className:"cw-skill-result-name",children:[E.skillName,E.version&&o.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",E.version]})]}),E.skillDescription&&o.jsx("span",{className:"cw-skill-result-desc",children:hc(E.skillDescription)}),o.jsxs("span",{className:"cw-skill-result-repo",children:[o.jsx(Iee,{className:"cw-i cw-i-sm"})," ",(b==null?void 0:b.name)||l]})]})]},`${E.skillId}/${E.version}`)})})]})})}async function WIe(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Bn(void 0,yc)});if(t.status===409)throw new Error("服务端未配置云厂商 AK/SK,无法访问 AgentKit 智能体中心");if(t.status===401)throw new Error("请先登录以访问 AgentKit 智能体中心");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function XIe(e={}){const t=new URLSearchParams({page_size:String(e.pageSize??100),project:e.project||"default"});return e.region&&t.set("region",e.region),(await WIe(`/web/a2a-spaces?${t.toString()}`)).items||[]}async function QIe(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Bn(void 0,yc)});if(t.status===409)throw new Error("服务端未配置云厂商 AK/SK,无法访问 VikingDB 知识库");if(t.status===401)throw new Error("请先登录以访问 VikingDB 知识库");if(!t.ok){let n="";try{n=(await t.json()).detail||""}catch{}throw new Error(`请求失败 (${t.status})${n?": "+n:""}`)}return t.json()}async function ZIe(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.region&&t.set("region",e.region);const n=t.toString();return(await QIe(`/web/viking-knowledgebases${n?`?${n}`:""}`)).items||[]}const vD=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function r_(e){let t=0;for(let n=0;n>>0;return vD[t%vD.length]}function JIe(e){const t=new Map;e.forEach(u=>t.set(u.span_id,u));const n=new Map,s=[];for(const u of e)u.parent_span_id!=null&&t.has(u.parent_span_id)?(n.get(u.parent_span_id)??n.set(u.parent_span_id,[]).get(u.parent_span_id)).push(u):s.push(u);const i=(u,d)=>u.start_time-d.start_time,r=(u,d)=>({span:u,depth:d,children:(n.get(u.span_id)??[]).sort(i).map(f=>r(f,d+1))}),a=s.sort(i).map(u=>r(u,0)),l=e.length?Math.min(...e.map(u=>u.start_time)):0,c=e.length?Math.max(...e.map(u=>u.end_time)):1;return{rootNodes:a,min:l,total:c-l||1}}function eje(e,t){const n=[],s=i=>{n.push(i),t.has(i.span.span_id)||i.children.forEach(s)};return e.forEach(s),n}function wD(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const tje=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function _D(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const s=String(n);return{key:tje(t),value:s,long:s.length>80||s.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function nG({appName:e,testRunId:t,sessionId:n,endTimeMs:s,onClose:i,title:r="调用链路观测"}){const[a,l]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(new Set),[h,p]=g.useState(null);g.useEffect(()=>{l(null),u("");let S;if(t)S=z8(t,n);else if(e)S=l1(e,n,s);else{u("缺少调用链路来源");return}S.then(_=>{l(_),p(_.length?_.reduce((T,k)=>T.start_time<=k.start_time?T:k).span_id:null)}).catch(_=>u(_ instanceof Error?_.message:String(_)))},[e,s,n,t]);const{rootNodes:m,min:b,total:v}=g.useMemo(()=>JIe(a??[]),[a]),y=g.useMemo(()=>eje(m,d),[m,d]),x=(a==null?void 0:a.find(S=>S.span_id===h))??null,E=v/1e6,w=S=>f(_=>{const T=new Set(_);return T.has(S)?T.delete(S):T.add(S),T});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"drawer-scrim",onClick:i}),o.jsxs("aside",{className:"drawer drawer--trace",children:[o.jsxs("header",{className:"drawer-head",children:[o.jsxs("div",{children:[o.jsx("div",{className:"drawer-title",children:r}),o.jsx("div",{className:"drawer-sub",children:a?`${a.length} 个调用 · ${E.toFixed(1)} ms`:"加载中"})]}),o.jsx("button",{className:"drawer-close",onClick:i,"aria-label":"关闭",children:o.jsx(Oi,{className:"icon"})})]}),a==null&&!c&&o.jsxs("div",{className:"drawer-loading",children:[o.jsx(yn,{className:"icon spin"})," 加载调用链路…"]}),c&&o.jsx("div",{className:"error",children:c}),a&&a.length===0&&o.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),y.length>0&&o.jsxs("div",{className:"trace-split",children:[o.jsx("div",{className:"trace-tree scroll",children:y.map(S=>{const _=S.span,T=(_.start_time-b)/v*100,k=Math.max((_.end_time-_.start_time)/v*100,.6),A=S.children.length>0;return o.jsxs("button",{className:`trace-row ${h===_.span_id?"active":""}`,onClick:()=>p(_.span_id),children:[o.jsxs("span",{className:"trace-label",style:{paddingLeft:S.depth*14},children:[o.jsx("span",{className:`trace-caret ${A?"":"hidden"} ${d.has(_.span_id)?"":"open"}`,onClick:j=>{j.stopPropagation(),A&&w(_.span_id)},children:o.jsx(uc,{className:"chev"})}),o.jsx("span",{className:"trace-dot",style:{background:r_(_.name)}}),o.jsx("span",{className:"trace-name",title:_.name,children:_.name})]}),o.jsx("span",{className:"trace-dur",children:wD(_.end_time-_.start_time)}),o.jsx("span",{className:"trace-track",children:o.jsx("span",{className:"trace-bar",style:{left:`${T}%`,width:`${k}%`,background:r_(_.name)}})})]},_.span_id)})}),o.jsx("div",{className:"trace-detail scroll",children:x?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"td-title",children:x.name}),o.jsxs("div",{className:"td-dur",children:[o.jsx("span",{className:"td-dot",style:{background:r_(x.name)}}),wD(x.end_time-x.start_time)]}),o.jsx("div",{className:"td-section",children:"属性"}),o.jsx("div",{className:"td-props",children:_D(x).filter(S=>!S.long).map(S=>o.jsxs("div",{className:"td-prop",children:[o.jsx("span",{className:"td-key",children:S.key}),o.jsx("span",{className:"td-val",children:S.value})]},S.key))}),_D(x).filter(S=>S.long).map(S=>o.jsxs("div",{className:"td-block",children:[o.jsx("div",{className:"td-section",children:S.key}),o.jsx("pre",{className:"td-pre",children:S.value})]},S.key))]}):o.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}const nje=g.lazy(()=>lu(()=>import("./MarkdownPromptEditor-BdhMqVzS.js"),__vite__mapDeps([0,1]))),ZN="veadk.generatedAgentTestRuns",SD=4;function iC(){if(typeof window>"u")return[];try{const e=JSON.parse(window.sessionStorage.getItem(ZN)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}catch{return[]}}function sG(e){if(typeof window>"u")return;const t=Array.from(new Set(e)).slice(-20);try{t.length?window.sessionStorage.setItem(ZN,JSON.stringify(t)):window.sessionStorage.removeItem(ZN)}catch{}}function sje(e){sG([...iC(),e])}function op(e){sG(iC().filter(t=>t!==e))}function ije(e,t,n="text/plain"){const s=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement("a");i.href=s,i.download=e,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(s)}const rje=[{id:"type",label:"Agent 类型",hint:"选择 Agent 类型",icon:cte,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:bc,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:Ree},{id:"tools",label:"工具",hint:"可调用的能力",icon:VB},{id:"skills",label:"技能",hint:"声明式技能",icon:mu},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:qb},{id:"memory",label:"记忆",hint:"短期与长期记忆",icon:$B},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:Tee},{id:"review",label:"完成",hint:"预览并创建",icon:ate}];function aje({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M9 7.15v9.7a1.15 1.15 0 0 0 1.78.96l7.2-4.85a1.15 1.15 0 0 0 0-1.92l-7.2-4.85A1.15 1.15 0 0 0 9 7.15Z"}),o.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),o.jsx("path",{d:"M3 10v4",opacity:"0.45"}),o.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}function ND({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M4.75 7.25h14.5"}),o.jsx("path",{d:"M9.1 4.75h5.8l.75 2.5h-7.3l.75-2.5Z"}),o.jsx("path",{d:"m6.75 7.25.75 12h9l.75-12"}),o.jsx("path",{d:"M10 10.25v5.75M14 10.25v5.75"})]})}function iG({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"m7 9 5 5 5-5"})})}function rG({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("path",{d:"M18.25 8.2A7.1 7.1 0 0 0 6.1 6.65L4.5 8.25"}),o.jsx("path",{d:"M4.5 4.75v3.5H8"}),o.jsx("path",{d:"M5.75 15.8A7.1 7.1 0 0 0 17.9 17.35l1.6-1.6"}),o.jsx("path",{d:"M19.5 19.25v-3.5H16"})]})}const oje={llm:"智能体",sequential:"分步协作",parallel:"同时处理",loop:"循环执行",a2a:"远程智能体"},TD={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"},aG="REGISTRY_SPACE_ID",lje=g7.filter(e=>e.key!==aG);function oG(e,t){var s,i,r;if(!(e!=null&&e.enabled))return{};const n={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(n.REGISTRY_TOP_K=((s=e.registryTopK)==null?void 0:s.trim())||Da.topK,n.REGISTRY_REGION=((i=e.registryRegion)==null?void 0:i.trim())||Da.region,n.REGISTRY_ENDPOINT=((r=e.registryEndpoint)==null?void 0:r.trim())||Da.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function _b(e,t){return t!=="byteplus"?e:e.map(n=>n.key==="MODEL_EMBEDDING_NAME"?{...n,placeholder:Fte(t)}:n.key==="MODEL_EMBEDDING_API_BASE"?{...n,placeholder:r1(t)}:n)}function cje({items:e,selected:t,onToggle:n,scrollRows:s}){return o.jsx("div",{className:`cw-checklist ${s?"cw-checklist-tools":""}`,style:s?{"--cw-checklist-max-height":`${s*40+(s-1)*8}px`}:void 0,children:e.map(i=>{const r=t.includes(i.id);return o.jsx(YV,{id:`cw-check-${i.id}`,className:`cw-check ${r?"is-on":""}`,checked:r,onCheckedChange:a=>{a!==r&&n(i.id)},label:o.jsx("span",{className:"cw-check-text",children:o.jsx("span",{className:"cw-check-title",children:i.label})})},i.id)})})}function a_({options:e,value:t,onChange:n}){return o.jsx("div",{className:"cw-segmented",children:e.map(s=>{var r;const i=(t??((r=e[0])==null?void 0:r.id))===s.id;return o.jsx("button",{type:"button",className:`cw-seg ${i?"is-on":""}`,onClick:()=>n(s.id),"aria-pressed":i,children:o.jsx("span",{className:"cw-seg-title",children:s.label})},s.id)})})}function uje(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function lp({env:e,values:t,onChange:n}){return e.length===0?o.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):o.jsx("div",{className:"cw-env-fields",children:e.map(s=>{const i=t[s.key]??s.defaultValue??"",r=qA(s,t),a=`cw-env-${s.key}`;return o.jsxs("label",{className:"cw-env-field",htmlFor:a,children:[o.jsxs("span",{className:"cw-env-field-head",children:[o.jsxs("span",{className:"cw-env-field-title",children:[o.jsxs("span",{className:"cw-env-field-label",children:[s.comment||s.key,s.required&&o.jsx("span",{className:"cw-req",children:"*"})]}),s.help&&o.jsxs("span",{className:"cw-env-help",tabIndex:0,"data-help":s.help,"aria-label":`${s.comment||s.key}说明:${s.help}`,children:["?",o.jsx("span",{className:"cw-env-help-popover",role:"tooltip",children:s.help})]}),s.link&&o.jsx("a",{className:"cw-env-link",href:s.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开 OpenViking ${s.link.label}`,"aria-label":`打开 OpenViking ${s.link.label}`,onClick:l=>l.stopPropagation(),children:o.jsx(Im,{"aria-hidden":"true"})})]}),s.comment&&o.jsx("code",{title:s.key,children:s.key})]}),s.multiline||s.format==="json"?o.jsx("textarea",{id:a,className:"cw-input cw-env-textarea",value:i,placeholder:s.placeholder||"请输入参数值",autoComplete:"off",spellCheck:!1,"aria-invalid":!!r,onChange:l=>n(s.key,l.currentTarget.value)}):o.jsx("input",{id:a,className:"cw-input",type:uje(s.key)?"password":"text",value:i,placeholder:s.placeholder||"请输入参数值",autoComplete:"off","aria-invalid":!!r,onChange:l=>n(s.key,l.currentTarget.value)}),r&&o.jsx("span",{className:"cw-env-error",children:r})]},s.key)})})}function o_(e){return e.name.trim()||"未命名智能体中心"}function l_(e){const t=e.name.trim()||e.id||"未命名知识库",n=[e.sourceLabel,e.projectName].filter(Boolean);return n.length?`${t} · ${n.join(" · ")}`:t}function dje({value:e,region:t,invalid:n,onChange:s}){const i=t.trim()||Da.region,[r,a]=g.useState([]),[l,c]=g.useState(!1),[u,d]=g.useState(null),[f,h]=g.useState(0),[p,m]=g.useState(!1),[b,v]=g.useState(""),y=g.useRef(null);g.useEffect(()=>{let A=!1;return c(!0),d(null),XIe({region:i}).then(j=>{A||a(j)}).catch(j=>{A||(a([]),d(j instanceof Error?j.message:"加载失败"))}).finally(()=>{A||c(!1)}),()=>{A=!0}},[i,f]);const x=!e||r.some(A=>A.id===e.trim()),E=r.find(A=>A.id===e.trim()),w=E?o_(E):e&&!x?"已选择的智能体中心":"请选择智能体中心",S=l&&r.length===0,_=g.useMemo(()=>r.filter(A=>U1(b,[o_(A),A.id,A.projectName])),[b,r]),T=!!(e&&!x&&U1(b,["已选择的智能体中心",e]));g.useEffect(()=>{if(!p)return;const A=R=>{const B=R.target;B instanceof Node&&y.current&&!y.current.contains(B)&&m(!1)},j=R=>{R.key==="Escape"&&m(!1)};return window.addEventListener("pointerdown",A),window.addEventListener("keydown",j),()=>{window.removeEventListener("pointerdown",A),window.removeEventListener("keydown",j)}},[p]);const k=A=>{s(A),m(!1)};return o.jsxs("div",{className:`cw-a2a-space-picker${p?" is-open":""}`,ref:y,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:`cw-a2a-space-trigger ${n?"is-error":""}`,disabled:S,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":"选择 AgentKit 智能体中心",onClick:()=>{v(""),m(A=>!A)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:w}),o.jsx(iG,{className:"cw-a2a-space-trigger-icon"})]}),p&&o.jsxs("div",{className:"cw-a2a-space-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:b,autoFocus:!0,autoComplete:"off","aria-label":"搜索 AgentKit 智能体中心",placeholder:"搜索名称或 ID",onChange:A=>v(A.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"AgentKit 智能体中心",children:[T&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>k(e),children:"已选择的智能体中心"}),_.map(A=>{const j=o_(A),R=A.id===e;return o.jsx("button",{type:"button",role:"option","aria-selected":R,className:`cw-a2a-space-option ${R?"is-selected":""}`,title:`${j} (${A.id})`,onClick:()=>k(A.id),children:j},A.id)}),!T&&_.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的智能体中心"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh",title:"刷新智能体中心列表","aria-label":"刷新智能体中心列表",disabled:l,onClick:()=>h(A=>A+1),children:l?o.jsx(yn,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(rG,{className:"cw-i cw-i-sm"})})]}),u?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(bc,{className:"cw-i"}),o.jsx("span",{children:u})]}):l?o.jsxs("span",{className:"cw-help cw-a2a-space-status",children:[o.jsx(yn,{className:"cw-i cw-i-sm cw-spin"}),"正在加载 AgentKit 智能体中心…"]}):r.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 AgentKit 智能体中心。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",r.length," 个智能体中心,列表仅展示中心名称。"]})]})}function fje({value:e,onChange:t}){const[n,s]=g.useState([]),[i,r]=g.useState(!1),[a,l]=g.useState(null),[c,u]=g.useState(0),[d,f]=g.useState(!1),[h,p]=g.useState(""),m=g.useRef(null);g.useEffect(()=>{let _=!1;return r(!0),l(null),ZIe().then(T=>{_||s(T)}).catch(T=>{_||(s([]),l(T instanceof Error?T.message:"加载失败"))}).finally(()=>{_||r(!1)}),()=>{_=!0}},[c]);const b=!e||n.some(_=>_.id===e.trim()),v=n.find(_=>_.id===e.trim()),y=v?l_(v):e&&!b?e:"请选择 VikingDB 知识库",x=i&&n.length===0,E=g.useMemo(()=>n.filter(_=>U1(h,[l_(_),_.id,_.description,_.projectName,_.resourceId,_.agentkitKnowledgeId,_.providerKnowledgeId,_.sourceLabel])),[n,h]),w=!!(e&&!b&&U1(h,[e]));g.useEffect(()=>{if(!d)return;const _=k=>{const A=k.target;A instanceof Node&&m.current&&!m.current.contains(A)&&f(!1)},T=k=>{k.key==="Escape"&&f(!1)};return window.addEventListener("pointerdown",_),window.addEventListener("keydown",T),()=>{window.removeEventListener("pointerdown",_),window.removeEventListener("keydown",T)}},[d]);const S=_=>{t(_),f(!1)};return i&&n.length===0?o.jsxs("span",{className:"cw-viking-kb-inline-status",role:"status",children:[o.jsx(yn,{className:"cw-i cw-i-sm cw-spin"}),"正在加载…"]}):o.jsxs("div",{className:`cw-a2a-space-picker cw-viking-kb-picker${d?" is-open":""}`,ref:m,children:[o.jsxs("div",{className:"cw-a2a-space-row",children:[o.jsxs("div",{className:"cw-a2a-space-select-wrap",children:[o.jsxs("button",{type:"button",className:"cw-a2a-space-trigger",disabled:x,"aria-haspopup":"listbox","aria-expanded":d,"aria-label":"选择 VikingDB 知识库",onClick:()=>{p(""),f(_=>!_)},children:[o.jsx("span",{className:e?void 0:"is-placeholder",children:y}),o.jsx(iG,{className:"cw-a2a-space-trigger-icon"})]}),d&&o.jsxs("div",{className:"cw-a2a-space-menu cw-viking-kb-menu",children:[o.jsx("div",{className:"cw-picker-search",children:o.jsx("input",{className:"cw-picker-search-input",type:"search",value:h,autoFocus:!0,autoComplete:"off","aria-label":"搜索 VikingDB 知识库",placeholder:"搜索名称或 ID",onChange:_=>p(_.currentTarget.value)})}),o.jsxs("div",{className:"cw-picker-options",role:"listbox","aria-label":"VikingDB 知识库",children:[w&&o.jsx("button",{type:"button",role:"option","aria-selected":!0,className:"cw-a2a-space-option is-selected",onClick:()=>S({id:e,name:e,description:"",projectName:"",region:"",sourceKind:"knowledge",sourceLabel:"Knowledge Engine",resourceId:""}),children:e}),E.map(_=>{const T=l_(_),k=_.id===e,A=[_.id,_.resourceId,_.agentkitKnowledgeId,_.providerKnowledgeId].filter(Boolean).join(" / ");return o.jsx("button",{type:"button",role:"option","aria-selected":k,className:`cw-a2a-space-option ${k?"is-selected":""}`,title:A?`${T} (${A})`:T,onClick:()=>S(_),children:T},_.id)}),!w&&E.length===0&&o.jsx("div",{className:"cw-picker-empty",children:"未找到匹配的知识库"})]})]})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-a2a-space-refresh cw-viking-kb-refresh",title:"刷新知识库列表","aria-label":"刷新知识库列表",disabled:i,onClick:()=>u(_=>_+1),children:i?o.jsx(yn,{className:"cw-i cw-i-sm cw-spin"}):o.jsx(rG,{className:"cw-i cw-i-sm"})})]}),a?o.jsxs("div",{className:"cw-banner cw-a2a-space-error",children:[o.jsx(bc,{className:"cw-i"}),o.jsx("span",{children:a})]}):n.length===0?o.jsx("span",{className:"cw-help",children:"此账号下暂无 VikingDB 知识库。"}):o.jsxs("span",{className:"cw-help",children:["已加载 ",n.length," 个知识库,选择的知识库会用于当前 Agent。"]})]})}function hje({tools:e,onChange:t}){const n=(r,a)=>t(e.map((l,c)=>c===r?{...l,...a}:l)),s=r=>t(e.filter((a,l)=>l!==r)),i=()=>t([...e,{name:"",transport:"http",url:""}]);return o.jsxs("div",{className:"cw-mcp",children:[e.length>0&&o.jsx("div",{className:"cw-mcp-list",children:o.jsx(Ko,{initial:!1,children:e.map((r,a)=>o.jsxs(is.div,{className:"cw-mcp-row",layout:!0,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.16},children:[o.jsxs("div",{className:"cw-mcp-rowhead",children:[o.jsxs("div",{className:"cw-mcp-transport",children:[o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${r.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":r.transport==="http",children:o.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),o.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${r.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":r.transport==="stdio",children:o.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>s(a),"aria-label":"移除 MCP 工具",children:o.jsx(dc,{className:"cw-i cw-i-sm"})})]}),o.jsx("input",{className:"cw-input",value:r.name,placeholder:"名称(用于命名,可留空)",onChange:l=>n(a,{name:l.target.value})}),r.transport==="http"?o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:r.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:l=>n(a,{url:l.target.value})}),iAe(r.url??"")&&o.jsxs("p",{className:"cw-mcp-warning",children:[o.jsx(bc,{"aria-hidden":"true"}),o.jsx("span",{children:"当前地址不是以 /mcp 结尾,请确认它是实际的 MCP Endpoint。Studio 会保留该地址,不会自动补充路径。"})]}),o.jsx("input",{className:"cw-input",value:nAe(r),placeholder:"Bearer Token(可选)",onChange:l=>t(e.map((c,u)=>u===a?sAe(c,l.target.value):c))})]}):o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"cw-input",value:r.command??"",placeholder:"启动命令,例如 npx",onChange:l=>n(a,{command:l.target.value})}),o.jsx("input",{className:"cw-input",value:(r.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:l=>n(a,{args:l.target.value.split(/\s+/).filter(Boolean)})}),o.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),o.jsxs("button",{type:"button",className:"cw-add-sub",onClick:i,children:[o.jsx(ji,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&o.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function lG({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M5.5 7.5h10.75a2 2 0 0 1 2 2v7.75a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V9.5a2 2 0 0 1 2-2Z"}),o.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),o.jsx("path",{d:"m11 10.25.72 1.48 1.63.24-1.18 1.15.28 1.62-1.45-.77-1.45.77.28-1.62-1.18-1.15 1.63-.24.72-1.48Z"}),o.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function pje({s:e,onRemove:t}){let n=mu,s="火山 Find Skill 技能广场";return e.source==="local"?(n=Yk,s="本地"):e.source==="skillspace"&&(n=lG,s="AgentKit Skills 中心"),o.jsxs(is.div,{className:"cw-selected-skill-row",layout:!0,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16},children:[o.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:o.jsx(n,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:"cw-selected-skill-meta",children:[o.jsx("span",{className:"cw-selected-skill-name",children:e.name}),o.jsxs("span",{className:"cw-selected-skill-detail",children:[s,e.description?` · ${hc(e.description)}`:""]})]}),o.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:o.jsx(Oi,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const c_=[{id:"local",label:"本地文件",icon:Yk},{id:"skillspace",label:"AgentKit Skills 中心",icon:lG},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:xx}];function mje({selected:e,onChange:t,cloudProvider:n}){const[s,i]=g.useState("local"),[r,a]=g.useState(!1),l=c_.findIndex(u=>u.id===s),c=u=>t(e.filter(d=>u_(d)!==u));return g.useEffect(()=>{if(!r)return;const u=d=>{d.key==="Escape"&&a(!1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[r]),o.jsxs("div",{className:"cw-skillspane",children:[o.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>a(!0),children:[o.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:o.jsx(ji,{className:"cw-i"})}),o.jsx("span",{children:"添加 Skill"})]}),e.length>0&&o.jsxs("div",{className:"cw-skill-selected",children:[o.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),o.jsx("div",{className:"cw-selected-skill-list",children:o.jsx(Ko,{initial:!1,children:e.map(u=>o.jsx(pje,{s:u,onRemove:()=>c(u_(u))},u_(u)))})})]}),o.jsx(Ko,{children:r&&o.jsx(is.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:u=>{u.target===u.currentTarget&&a(!1)},children:o.jsxs(is.div,{className:"cw-skill-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"cw-skill-dialog-title",initial:{opacity:0,y:10,scale:.985},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:6,scale:.99},transition:{duration:.18,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-skill-dialog-head",children:[o.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),o.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>a(!1),children:o.jsx(Oi,{className:"cw-i"})})]}),o.jsxs("div",{className:"cw-skill-dialog-body",children:[o.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${c_.length})`,"--cw-active-skill-tab-offset":`calc(${l*100}% + ${l*4}px)`},children:[o.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),c_.map(({id:u,label:d,icon:f})=>o.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${u}`,"aria-controls":"cw-skill-tabpanel","aria-selected":s===u,className:`cw-skill-pickertab ${s===u?"is-on":""}`,onClick:()=>i(u),children:[o.jsx(f,{className:"cw-i cw-i-sm"}),d]},u))]}),o.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${s}`,children:[s==="skillhub"&&o.jsx(DIe,{selected:e,onChange:t}),s==="local"&&o.jsx(qIe,{selected:e,onChange:t}),s==="skillspace"&&o.jsx(YIe,{selected:e,onChange:t,cloudProvider:n})]})]})]})})})]})}function u_(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function Sb({checked:e,onChange:t,title:n}){return o.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[o.jsx("span",{className:"cw-toggle-text",children:o.jsx("span",{className:"cw-toggle-title",children:n})}),o.jsx("span",{className:"cw-switch","aria-hidden":!0,children:o.jsx(is.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}function gje(e,t){var s;let n=e;for(const i of t)if(n=(s=n.subAgents)==null?void 0:s[i],!n)return!1;return!0}function Nb(e,t){let n=e;for(const s of t)n=n.subAgents[s];return n}function Kg(e,t,n){if(t.length===0)return n(e);const[s,...i]=t,r=e.subAgents.slice();return r[s]=Kg(r[s],i,n),{...e,subAgents:r}}function bje(e,t,n="volcengine"){return Kg(e,t,s=>({...s,subAgents:[...s.subAgents,Ci(n)]}))}function yje(e,t,n,s="volcengine"){return Kg(e,t,i=>{const r=i.subAgents.slice();return r.splice(n,0,Ci(s)),{...i,subAgents:r}})}function xje(e,t){if(t.length===0)return e;const n=t.slice(0,-1),s=t[t.length-1];return Kg(e,n,i=>({...i,subAgents:i.subAgents.filter((r,a)=>a!==s)}))}const JN=e=>!SE(e.agentType),kD=3;function Eje(e,t,n=!1){var i;if(SE(e.agentType))return n?"远程 Agent 只能作为子 Agent":(i=e.a2aRegistry)!=null&&i.registrySpaceId.trim()?null:"缺少 AgentKit 智能体中心";const s=nc(e.name);return s||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":QV(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function cG(e,t,n=[]){const s=[],i=SE(e.agentType),r=Eje(e,t,n.length===0);return r&&s.push({path:n,name:i?"远程 Agent":e.name.trim()||"未命名",typeLabel:XV(e.agentType).label,problem:r}),JN(e)&&e.subAgents.forEach((a,l)=>s.push(...cG(a,t,[...n,l]))),s}function vje(e){return`${e.typeLabel}至少需要添加一个子 Agent 后才能调试或发布。`}function uG(e){return 1+e.subAgents.reduce((t,n)=>t+uG(n),0)}function dG(e){const t=gE(e),n=[],s={...t.envValues},i=t.draft.cloudProvider??"volcengine",r=l=>{var c,u,d,f;for(const h of l.builtinTools??[]){const p=Ou.find(m=>m.id===h);p&&n.push({env:_b(p.env,i)})}for(const h of l.mcpTools??[])h.authTokenEnv&&n.push({env:[{key:h.authTokenEnv,required:!1,comment:`${h.name.trim()||"MCP"} Bearer Token`}]});if((c=l.a2aRegistry)!=null&&c.enabled&&(n.push({env:g7}),Object.assign(s,oG(l.a2aRegistry,{includeDefaults:!0}))),l.memory.shortTerm&&n.push({env:_b(((u=cN.find(h=>h.id===(l.shortTermBackend??"local")))==null?void 0:u.env)??[],i)}),l.memory.longTerm&&n.push({env:_b(((d=uN.find(h=>h.id===(l.longTermBackend??"local")))==null?void 0:d.env)??[],i)}),l.knowledgebase&&n.push({env:_b(((f=dN.find(h=>h.id===(l.knowledgebaseBackend??vu)))==null?void 0:f.env)??[],i)}),l.tracing)for(const h of l.tracingExporters??[]){const p=zfe.find(m=>m.id===h);p&&n.push({env:p.env,enableFlag:p.enableFlag})}l.subAgents.forEach(r)};r(t.draft);const a=Wz(n);return{specs:a.specs,fixedValues:{...a.fixedValues,...s}}}function fG(e){var n;return{...gE(e).draft,deployment:{feishuEnabled:!!((n=e.deployment)!=null&&n.feishuEnabled)}}}function eT(e){var n;const t=(n=e.modelName)==null?void 0:n.trim();if(t)return t;for(const s of e.subAgents){const i=eT(s);if(i)return i}return""}function hG(e){var s,i;const t=dG(e),n={...((s=e.deployment)==null?void 0:s.envValues)??{},...t.fixedValues};return{...fG(e),deployment:{feishuEnabled:!!((i=e.deployment)!=null&&i.feishuEnabled),envValues:Object.fromEntries(Xz(t.specs,n).map(({key:r,value:a})=>[r,a]))}}}function wje(e){return JSON.stringify(hG(e))}function F1(e,t){return JSON.stringify({draftSnapshot:e,modelName:t.modelName,description:t.description,instruction:t.instruction,optimizations:t.optimizations})}function Yd(e){return JSON.stringify({modelName:e.modelName.trim(),description:e.description.trim(),instruction:e.instruction.trim(),optimizations:e.optimizations})}function _je({enabled:e,disabledReason:t,variants:n,draftSnapshot:s,input:i,onInput:r,onSend:a,onStartVariant:l,onDeployVariant:c,onAddVariant:u,onRemoveVariant:d,onToggleConfig:f,onCompleteConfig:h,onConfigChange:p,onOpenTrace:m}){const b=n.filter(x=>x.phase!=="ready"?!1:x.runtimeSnapshot===F1(s,x)),v=n.some(x=>x.phase==="sending"),y=b.length>0&&!v;return o.jsxs("section",{className:"cw-ab-workspace","aria-label":"A/B 调试工作台",children:[o.jsx("div",{className:"cw-ab-stage",children:e?o.jsx("div",{className:"cw-ab-grid",style:{"--cw-ab-column-count":n.length},children:n.map((x,E)=>{const w=x.modelName.trim(),S=x.description.trim(),_=x.instruction.trim(),T=Yd(x),k=!!(w&&S&&_&&n.findIndex(D=>Yd(D)===T)!==E),A=!w||!S||!_||k,j=!!(x.runtimeSnapshot&&x.runtimeSnapshot!==F1(s,x)),R=x.phase==="starting",B=x.phase==="ready"&&!j,z=R||x.phase==="sending",L=B&&x.phase!=="sending"&&x.messages.some(D=>D.role==="assistant"),F=z||x.configOpen||A,C=w?S?_?k?"该配置与已有测试组相同":"":"请填写系统提示词":"请填写描述":"请先选择模型",I=R?"正在启动":j?"应用配置并重启":B||x.phase==="error"?"重新启动环境":"启动环境";return o.jsx("article",{className:"cw-ab-card",children:o.jsxs("div",{className:`cw-ab-card-inner${x.configOpen?" is-flipped":""}`,children:[o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-front","aria-hidden":x.configOpen,children:[o.jsxs("header",{className:"cw-ab-card-head",children:[o.jsxs("div",{className:"cw-ab-card-title",children:[o.jsx("strong",{children:x.name}),o.jsx("span",{children:x.modelName||"默认模型"})]}),o.jsxs("div",{className:"cw-ab-card-actions",children:[o.jsx("button",{type:"button",className:"cw-ab-config-trigger",disabled:x.configOpen||z,onClick:()=>f(x.id),children:"测试配置"}),x.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-ab-remove","aria-label":`删除${x.name}`,disabled:x.configOpen||z,onClick:()=>d(x.id),children:o.jsx(ND,{className:"cw-i"})})]})]}),o.jsx("div",{className:"cw-ab-conversation",children:x.error?o.jsx(B1,{message:x.error,className:"cw-debug-error-detail",defaultExpanded:!0}):R?o.jsxs("div",{className:"cw-ab-empty cw-ab-starting",children:[o.jsx(yn,{className:"cw-i cw-spin"}),o.jsx("span",{children:"正在创建独立测试环境"})]}):j?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:o.jsx("span",{children:"配置已变更,请重新启动此环境"})}):x.messages.length===0?o.jsx("div",{className:"cw-ab-empty cw-ab-launch",children:B?o.jsxs(o.Fragment,{children:[o.jsx("strong",{className:"cw-ab-ready-title",children:"已就绪"}),o.jsx("span",{className:"cw-ab-launch-hint",children:"可在下方输入测试消息"})]}):o.jsx("span",{className:"cw-ab-launch-hint",children:C||"启动环境后即可加入本轮测试"})}):x.messages.map((D,$)=>o.jsx("div",{className:`cw-debug-msg cw-debug-msg-${D.role}`,children:o.jsx("div",{className:"cw-debug-content",children:D.role==="user"?D.content:D.error?o.jsx(B1,{message:D.error,className:"cw-debug-msg-error",defaultExpanded:!0}):D.blocks&&D.blocks.length>0?o.jsx(kA,{blocks:D.blocks,onAction:()=>{}}):D.content?D.content:$===x.messages.length-1&&x.phase==="sending"?o.jsx(qH,{}):null})},$))}),o.jsxs("footer",{className:"cw-ab-deploy-footer",children:[o.jsx("button",{type:"button",className:"cw-ab-trace",disabled:!L,title:L?`查看${x.name}调用链路`:"完成一次调试后可查看调用链路",onClick:()=>m(x.id),children:"调用链路"}),o.jsxs("button",{type:"button",className:"cw-ab-start cw-ab-footer-start",disabled:F,title:C||void 0,onClick:()=>l(x.id),children:[B||j||x.phase==="error"?o.jsx(rte,{className:"cw-i"}):o.jsx(aje,{className:"cw-i cw-debug-run-icon"}),I]}),o.jsx("button",{type:"button",className:"cw-ab-deploy",disabled:z||!w,onClick:()=>c(x.id),children:"部署该配置"})]})]}),o.jsxs("section",{className:"cw-ab-card-face cw-ab-card-back","aria-hidden":!x.configOpen,children:[o.jsxs("header",{className:"cw-ab-config-head",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"测试配置"}),o.jsx("span",{children:x.name})]}),o.jsxs("div",{className:"cw-ab-config-head-actions",children:[x.id!=="baseline"&&o.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger cw-ab-config-remove","aria-label":`删除${x.name}`,title:"删除配置组",disabled:z,onClick:()=>d(x.id),children:o.jsx(ND,{className:"cw-i cw-i-sm"})}),o.jsxs("span",{className:`cw-ab-config-done-wrap${C?" is-disabled":""}`,tabIndex:C?0:void 0,children:[o.jsx("button",{type:"button",className:"cw-ab-config-done",disabled:!x.configOpen||A,onClick:()=>h(x.id),children:x.id==="baseline"?"完成配置":"完成并启动"}),C&&o.jsx("span",{className:"cw-ab-config-done-tip",role:"tooltip",children:C})]})]})]}),o.jsxs("div",{className:"cw-ab-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"模型"}),o.jsx("input",{value:x.modelName,placeholder:"使用 Agent 当前模型",disabled:!x.configOpen,onChange:D=>p(x.id,"modelName",D.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"描述"}),o.jsx("textarea",{rows:2,value:x.description,disabled:!x.configOpen,onChange:D=>p(x.id,"description",D.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"系统提示词"}),o.jsx("textarea",{rows:5,value:x.instruction,disabled:!x.configOpen,onChange:D=>p(x.id,"instruction",D.target.value)})]}),o.jsxs("fieldset",{className:"cw-ab-optimizations-disabled",children:[o.jsxs("legend",{children:[o.jsx("span",{children:"优化选项"}),o.jsx("em",{children:"待开放"})]}),o.jsx("div",{className:"cw-ab-optimization-list",children:pG.map(D=>o.jsx(YV,{checked:x.optimizations.includes(D.id),disabled:!0,label:D.label,className:"cw-ab-optimization-checkbox"},D.id))})]}),o.jsx("p",{children:"设置完成后返回正面,再启动当前测试环境。"})]})]})]})},x.id)})}):o.jsx("div",{className:"cw-debug-empty",children:t})}),o.jsxs("div",{className:"cw-ab-composer",children:[o.jsxs("div",{className:"cw-debug-composerbox",children:[o.jsx("textarea",{className:"cw-debug-input",rows:1,value:i,placeholder:y?"输入测试消息,将发送到所有已启动测试组...":"请先启动至少一个测试组",disabled:!y,onChange:x=>r(x.target.value),onKeyDown:x=>{AA(x.nativeEvent)||x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),a())}}),o.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!y||!i.trim(),onClick:a,children:v?o.jsx(yn,{className:"cw-i cw-spin"}):o.jsx(DB,{className:"cw-i"})})]}),e&&n.length<3&&o.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft cw-ab-add",onClick:u,children:[o.jsx(ji,{className:"cw-i"}),"添加对照组"]})]})]})}const Tb=[{id:"build",label:"架构"},{id:"validate",label:"调试"},{id:"publish",label:"发布"}],pG=[{id:"context",label:"上下文优化",description:"压缩历史对话,保留与当前任务相关的信息"},{id:"grounding",label:"幻觉抑制",description:"对不确定内容要求依据,并明确表达未知"},{id:"tools",label:"工具调用优化",description:"减少重复调用,优先复用可信的工具结果"},{id:"latency",label:"响应加速",description:"缓存稳定上下文,降低重复推理开销"}];function Sje({mode:e}){const t=e==="validate"?"调试您的智能体":e==="publish"?"准备好部署您的智能体":"个性化您的智能体架构";return o.jsx("header",{className:"cw-workspace-header",children:o.jsx("h1",{children:t})})}function Nje({mode:e,busy:t,onChange:n,assistant:s}){const i=Tb.findIndex(l=>l.id===e),r=Tb[i-1],a=Tb[i+1];return o.jsxs("footer",{className:"cw-workspace-footer",children:[o.jsxs("div",{className:`cw-workspace-nav-actions${s?" has-assistant":""}`,children:[o.jsx("button",{type:"button",className:`cw-workspace-nav-button${e==="build"?" is-placeholder":""}`,"aria-hidden":e==="build"||void 0,tabIndex:e==="build"?-1:0,disabled:!r||t,onClick:()=>r&&n(r.id),children:"上一步"}),o.jsx("span",{"aria-hidden":"true"}),s?o.jsx("div",{className:"cw-workspace-ai-slot",children:s}):null,e==="publish"?o.jsx("div",{id:"cw-publish-primary-action",className:"cw-publish-action-slot"}):o.jsx("button",{type:"button",className:"cw-workspace-nav-button is-primary",disabled:!a||t,onClick:()=>a&&n(a.id),children:"下一步"})]}),o.jsx("nav",{className:"cw-workspace-progress","aria-label":"Agent 创建进度",children:Tb.map((l,c)=>{const u=l.id===e;return o.jsx("button",{type:"button",className:`${u?"is-active":""}${cn(l.id),children:o.jsx("span",{"aria-hidden":"true"})},l.id)})})]})}function Tje({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:s,features:i,onDeploymentTaskChange:r,createMode:a="custom",deploymentTarget:l,cloudProvider:c="volcengine",initialDeployRegion:u=Ti(c),onDeploymentComplete:d,onDeploymentStarted:f,onDraftChange:h,onDiscard:p}){var qa,ba,wc,nr,Hu,qs,ie,Qt,Pn,Ts,en,ks,Vr,Gr;const[m,b]=g.useState(()=>s??Ci(c));g.useEffect(()=>{const ne=c==="byteplus"?t2:YB,Se=c==="byteplus"?e2:qB;b(ge=>{var bn,St;const st=((bn=ge.modelName)==null?void 0:bn.trim())===ne?i1(c):ge.modelName,on=((St=ge.modelApiBase)==null?void 0:St.trim())===Se?r1(c):ge.modelApiBase;return st===ge.modelName&&on===ge.modelApiBase?ge:{...ge,modelName:st,modelApiBase:on}})},[c]);const[v,y]=g.useState(""),[x,E]=g.useState(!1),[w,S]=g.useState(!1),[_,T]=g.useState(!1),[k,A]=g.useState(null),j=v.trim(),R=j.length>0&&j.length{C.current=h},[h]),g.useEffect(()=>{var ne;L!==z.current&&(z.current=L,(ne=C.current)==null||ne.call(C,m,F))},[m,F,L]);const[I,D]=g.useState("build"),[$,O]=g.useState(!1),[te,se]=g.useState(0),[P,Q]=g.useState(null),[ee,V]=g.useState(!1),[X,K]=g.useState((l==null?void 0:l.region)??u),ce=(i==null?void 0:i.generatedAgentTestRun)===!0,he=(i==null?void 0:i.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[be,ue]=g.useState(()=>[{id:"baseline",name:"基准组",modelName:eT(s??Ci(c)),description:(s??Ci(c)).description,instruction:(s??Ci(c)).instruction,optimizations:[],configOpen:!1,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]),[we,Le]=g.useState("baseline"),Ne=g.useRef(1),ae=g.useRef(!1),me=g.useRef(new Map),[_e,Je]=g.useState(0),[Pe,Fe]=g.useState(""),[Ye,Ce]=g.useState(null),[Ve,Ue]=g.useState(!1),[W,oe]=g.useState(!1),Z=g.useRef(null),[Ee,Me]=g.useState(""),[lt,Ot]=g.useState(!1),[ut,xn]=g.useState(!1),[xt,wt]=g.useState([]),En=g.useRef(null),Ut=g.useRef({});async function Pt(){const ne=new Set([...me.current.values()].map(({run:ge})=>ge.runId)),Se=iC().filter(ge=>!ne.has(ge));Se.length&&await Promise.all(Se.map(async ge=>{try{await md(ge),op(ge)}catch(st){console.warn("清理遗留调试运行失败",st)}}))}g.useEffect(()=>(Pt(),()=>{for(const{run:ne}of me.current.values())md(ne.runId).then(()=>op(ne.runId)).catch(Se=>console.warn("清理调试运行失败",Se));me.current.clear()}),[]),g.useEffect(()=>()=>{var ne;(ne=Z.current)==null||ne.call(Z,!1),Z.current=null},[]);const at=g.useRef(null);at.current||(at.current=({meta:ne,children:Se})=>o.jsxs("section",{ref:ge=>{Ut.current[ne.id]=ge},id:`cw-sec-${ne.id}`,"data-step-id":ne.id,className:"cw-section",children:[o.jsx("header",{className:"cw-sec-head",children:o.jsx("h2",{className:"cw-sec-title",children:ne.label})}),o.jsx("div",{className:"cw-sec-body",children:Se})]}));const ft=gje(m,xt)?xt:[],He=Nb(m,ft),_t=ft.length===0,ye=`cw-model-advanced-${ft.join("-")||"root"}`,We=`cw-a2a-registry-advanced-${ft.join("-")||"root"}`,Ge=ne=>b(Se=>Kg(Se,ft,ge=>({...ge,...ne}))),ht=(ne,Se)=>b(ge=>{var st;return{...ge,deployment:{...ge.deployment??{feishuEnabled:!1},envValues:{...((st=ge.deployment)==null?void 0:st.envValues)??{},[ne]:Se}}}}),Vn=ne=>Ge({a2aRegistry:{...He.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...ne}}),un=(ne,Se)=>{if(!(ne in TD))return;const ge=TD[ne];Vn({[ge]:Se}),ht(ne,Se)},Ht=ne=>{if(!(_t&&ne==="a2a")){if(ne==="a2a"){Ge({agentType:ne,a2aRegistry:{...He.a2aRegistry??{registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},enabled:!0}});return}Ge({agentType:ne,a2aRegistry:He.a2aRegistry?{...He.a2aRegistry,enabled:!1}:void 0})}},sn=(ne,Se)=>{b(ne),Se&&wt(Se)},kn=async()=>{const ne=v.trim();if(!(!ne||x)&&!(ne.length{const Se=Nb(m,ne);if(!JN(Se)||ne.length>=kD)return;const ge=bje(m,ne,c),st=Nb(ge,ne).subAgents.length-1;sn(ge,[...ne,st])},ot=(ne,Se)=>{const ge=Nb(m,ne);if(!JN(ge)||ne.length>=kD)return;const st=Math.max(0,Math.min(Se,ge.subAgents.length)),on=yje(m,ne,st,c);sn(on,[...ne,st])},An=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(b(Ci(c)),wt([]),O(!1))},mn=ne=>{if(ne.length===0){An();return}sn(xje(m,ne),ne.slice(0,-1))},At=He.builtinTools??[],Os=He.mcpTools??[],Ms=He.selectedSkills??[],bs=ne=>Ge({builtinTools:At.includes(ne)?At.filter(Se=>Se!==ne):[...At,ne]}),vn=QV(He.agentType),Gn=SE(He.agentType),ls=g.useMemo(()=>LH(m),[m]),Kn=Gn?null:nc(He.name)??(ls.has(He.name)?"Agent 名称在当前结构中必须唯一":null),Ss=Kn!==null,Ns=!Gn&&He.description.trim().length===0,hi=He.instruction.trim().length===0,Cn=Gn&&!((qa=He.a2aRegistry)!=null&&qa.registrySpaceId.trim()),Ks=ne=>$&&ne?`is-error cw-error-shake-${te%2}`:"",cs=g.useMemo(()=>cG(m,ls),[m,ls]),qn=cs.length===0,Yn=g.useMemo(()=>wje(m),[m]),Wn=be.find(ne=>ne.id===we)??be[0],Ls=g.useMemo(()=>dG(m),[m]),ys=ne=>{var Se;(Se=Ut.current[ne])==null||Se.scrollIntoView({behavior:"smooth",block:"start"})},gn=()=>qn?!0:(O(!0),se(ne=>ne+1),cs[0]&&(wt(cs[0].path),window.requestAnimationFrame(()=>ys(cs[0].problem==="缺少子 Agent"?"type":"basic"))),!1),fn=async()=>{Ce(null);const ne=[...me.current.values()];me.current.clear(),Je(0),ue(Se=>Se.map(ge=>({...ge,phase:"idle",runtimeSnapshot:"",messages:[],error:null}))),await Promise.all(ne.map(async({run:Se})=>{try{await md(Se.runId),op(Se.runId)}catch(ge){console.warn("清理调试运行失败",ge)}}))},dn=async ne=>{const Se=me.current.get(ne);if(Se){me.current.delete(ne),Je(me.current.size);try{await md(Se.run.runId),op(Se.run.runId)}catch(ge){console.warn("清理调试运行失败",ge)}}},rn=ne=>{const Se=me.current.get(ne),ge=be.find(st=>st.id===ne);!Se||!ge||Ce({runId:Se.run.runId,sessionId:Se.sessionId,variantName:ge.name})},an=ne=>{const Se=Z.current;Z.current=null,Se==null||Se(ne)},xs=()=>{W||(Ue(!1),an(!1))},de=async()=>{if(!W){oe(!0);try{await fn(),Ue(!1),an(!0)}finally{oe(!1)}}},Ie=async()=>I!=="validate"||_e===0?!0:Z.current?!1:new Promise(ne=>{Z.current=ne,Ue(!0)}),Be=async ne=>{var ge;if(!await Ie())return;if(Me(""),!gn()){D("build");return}const Se=Qz(Ls.specs,((ge=m.deployment)==null?void 0:ge.envValues)??{});if(Se){Me(`${Se.spec.comment||Se.spec.key}:${Se.error}`),D("build");return}V(!0);try{const st=ne?be.find(St=>St.id===ne):Wn;st&&Le(st.id);const on=st?{...m,modelName:st.modelName||m.modelName,description:st.description,instruction:st.instruction}:m,bn=await kx(fG(on));on!==m&&b(on),Q(bn),D("publish")}catch(st){Me(st instanceof Error?st.message:String(st))}finally{V(!1)}},it=async ne=>{if(!ce||ee||!gn())return;const Se=be.find(Qn=>Qn.id===ne);if(!Se||Se.phase==="starting"||Se.phase==="sending")return;const ge=Se.modelName.trim(),st=Se.description.trim(),on=Se.instruction.trim(),bn=Yd(Se),St=be.findIndex(Qn=>Qn.id===ne),qt=be.findIndex(Qn=>Yd(Qn)===bn);if(!ge||!st||!on||qt!==St)return;const wn=F1(Yn,Se);ue(Qn=>Qn.map(ir=>ir.id===ne?{...ir,configOpen:!1,phase:"starting",messages:[],error:null}:ir)),Fe("");let Ds=null,sr;const zi=Date.now(),wr=ne==="baseline"?"baseline":"comparison";try{await dn(ne),await Pt();const Qn={...m,modelName:Se.modelName||m.modelName,description:Se.description,instruction:Se.instruction};sr="create_test_run",Ds=await $8(hG(Qn),l?{runtimeId:l.runtimeId,region:l.region}:void 0),sje(Ds.runId),sr="create_test_session";const ir=await H8(Ds.runId,"test_user");me.current.set(ne,{run:Ds,sessionId:ir}),Je(me.current.size),ue(Dt=>Dt.map(Ps=>Ps.id===ne?{...Ps,phase:"ready",runtimeSnapshot:wn}:Ps)),ETe({durationMs:Date.now()-zi,variantType:wr})}catch(Qn){if(Ds)try{await md(Ds.runId),op(Ds.runId)}catch(ir){console.warn("清理调试运行失败",ir)}ue(ir=>ir.map(Dt=>Dt.id===ne?{...Dt,phase:"error",runtimeSnapshot:"",error:Qn instanceof Error?Qn.message:String(Qn)}:Dt)),vTe({durationMs:Date.now()-zi,variantType:wr,phase:sr,error:Qn})}},et=async()=>{const ne=Pe.trim(),Se=be.filter(st=>st.phase==="ready"&&st.runtimeSnapshot===F1(Yn,st)&&me.current.has(st.id));if(!ne||Se.length===0)return;Fe("");const ge=new Set(Se.map(st=>st.id));ue(st=>st.map(on=>ge.has(on.id)?{...on,phase:"sending",messages:[...on.messages,{role:"user",content:ne},{role:"assistant",content:"",blocks:[]}]}:on)),await Promise.all(Se.map(async st=>{const on=me.current.get(st.id);if(on)try{let bn=Oa();for await(const St of V8({runId:on.run.runId,userId:"test_user",sessionId:on.sessionId,text:ne})){const qt=St.error||St.errorMessage||St.error_message;if(qt||(bn=Tf(bn,St)),ue(wn=>wn.map(Ds=>{if(Ds.id!==st.id)return Ds;const sr=[...Ds.messages],zi={...sr[sr.length-1]};return qt?zi.error=String(qt):(zi.content=bn.blocks.filter(wr=>wr.kind==="text").map(wr=>wr.text).join(""),zi.blocks=bn.blocks),sr[sr.length-1]=zi,{...Ds,messages:sr}})),qt)break}}catch(bn){ue(St=>St.map(qt=>{if(qt.id!==st.id)return qt;const wn=[...qt.messages],Ds={...wn[wn.length-1]};return Ds.error=bn instanceof Error?bn.message:String(bn),wn[wn.length-1]=Ds,{...qt,messages:wn}}))}finally{ue(bn=>bn.map(St=>St.id===st.id?{...St,phase:"ready"}:St))}}))},Et=()=>{ue(ne=>{if(ne.length>=3)return ne;const Se=Ne.current++,ge=`variant-${Se}`;return[...ne,{id:ge,name:`对照组 ${Se}`,modelName:m.modelName??"",description:m.description,instruction:m.instruction,optimizations:[],configOpen:!0,phase:"idle",runtimeSnapshot:"",messages:[],error:null}]})},je=async ne=>{await dn(ne),ue(Se=>Se.filter(ge=>ge.id!==ne)),we===ne&&Le("baseline")},Ln=(ne,Se)=>ue(ge=>ge.map(st=>st.id===ne?{...st,...Se}:st)),us=(ne,Se,ge)=>{ne==="baseline"&&Se==="modelName"&&(ae.current=!0),Ln(ne,{[Se]:ge}),!(we!==ne||ne==="baseline")&&Le("baseline")},pi=ne=>{const Se=be.find(wn=>wn.id===ne);if(!Se)return;const ge=Se.modelName.trim(),st=Se.description.trim(),on=Se.instruction.trim(),bn=Yd(Se),St=be.findIndex(wn=>wn.id===ne),qt=be.findIndex(wn=>Yd(wn)===bn);if(!(!ge||!st||!on||qt!==St)){if(ne==="baseline"){Ln(ne,{configOpen:!1});return}it(ne)}},ri=async(ne,Se,ge)=>{var bn;const st=(bn=m.deployment)==null?void 0:bn.network,on=st&&st.mode&&st.mode!=="public"?{mode:st.mode,vpc_id:st.vpcId,subnet_ids:st.subnetIds,enable_shared_internet_access:st.enableSharedInternetAccess}:void 0;return vg(ne.name,ne.files,{region:(l==null?void 0:l.region)??X,projectName:"default",network:on},{...ge,onStage:Se,runtimeId:l==null?void 0:l.runtimeId,appName:l==null?void 0:l.appName,description:m.description})},Xn=()=>{gn()&&(ue(ne=>ne.map(Se=>Se.id==="baseline"&&!me.current.has(Se.id)?{...Se,modelName:ae.current?Se.modelName:eT(m),description:m.description,instruction:m.instruction}:Se)),D("validate"))},Jt=async ne=>{if(ne==="publish"){if(!gn())return;P?D("publish"):Be();return}if(ne==="validate"){Xn();return}await Ie()&&D(ne)},vt=at.current,Dn=ne=>rje.find(Se=>Se.id===ne),mi=o.jsx("section",{className:`cw-ai-compose${x?" is-generating":""}${w?" is-success":""}`,"aria-label":"AI 自动填写 Agent 配置",children:o.jsx(Ko,{initial:!1,mode:"wait",children:w?o.jsxs(is.div,{className:"cw-ai-compose-success",role:"status",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.22,ease:[.22,1,.36,1]},children:[o.jsx("span",{className:"cw-ai-success-check","aria-hidden":!0}),o.jsx("strong",{children:"生成成功"}),o.jsx("button",{type:"button",className:"cw-ai-regenerate",onClick:()=>S(!1),children:"重新生成"})]},"success"):o.jsxs(is.div,{className:"cw-ai-compose-entry",initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:[.22,1,.36,1]},children:[o.jsxs("form",{className:"cw-ai-compose-form",onSubmit:ne=>{ne.preventDefault(),kn()},children:[o.jsx("input",{type:"text",value:v,maxLength:8e3,disabled:x,placeholder:`描述目标,使用 ${$te(c)} 模型一键生成配置`,"aria-invalid":!!R,"aria-describedby":R?"ai-requirement-error":void 0,onChange:ne=>y(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&(ne.preventDefault(),kn())}}),o.jsx("button",{type:"submit",disabled:x||!j||!!R,"aria-label":x?"正在智能生成":"智能生成",children:x?o.jsx("span",{className:"cw-ai-orb","aria-hidden":!0,children:o.jsx("span",{})}):"智能生成"})]}),R&&o.jsx("p",{className:"cw-ai-requirement-error",id:"ai-requirement-error",role:"alert",children:R})]},"compose")})});return o.jsxs("div",{className:`cw-root is-${I}`,children:[o.jsx(Sje,{mode:I}),Ee&&o.jsx(B1,{className:"cw-workspace-alert",message:Ee}),o.jsxs("main",{className:"cw-workspace-main",id:"cw-workspace-main",children:[I==="build"&&o.jsx("div",{className:"cw-build-workspace",children:o.jsxs("div",{className:"cw-editor",children:[o.jsx(zm,{draft:m,direction:"horizontal",selectedPath:ft,onSelect:wt,onAdd:zt,onInsert:ot,onDelete:mn}),o.jsx("div",{className:"cw-detail",children:o.jsx("div",{className:"cw-detail-scroll",ref:En,children:o.jsx("div",{className:"cw-detail-inner",children:o.jsx("div",{className:"cw-lower",children:o.jsxs("div",{className:"cw-form-col",children:[o.jsxs(vt,{meta:Dn("type"),children:[o.jsx(XN,{className:"cw-agent-type-options","aria-label":"Agent 类型",value:He.agentType??"llm",onChange:Ht,children:RIe.map(ne=>{const Se=(He.agentType??"llm")===ne.id,ge=_t&&ne.id==="a2a",st=ge?"cw-remote-agent-disabled-hint":void 0;return o.jsxs("div",{"data-agent-type":ne.id,className:`cw-agent-type-option ${Se?"is-on":""} ${ge?"is-disabled":""}`,tabIndex:ge?0:void 0,"aria-describedby":st,children:[o.jsx(XN.Item,{value:ne.id,disabled:ge,block:!0,className:"cw-agent-type-control",children:o.jsx("span",{className:"cw-agent-type-copy",children:o.jsx("strong",{children:oje[ne.id]})})}),ge&&o.jsx("span",{id:st,className:"cw-agent-type-disabled-hint",role:"tooltip",children:"远程智能体只能作为子步骤使用"})]},ne.id)})}),$&&vn&&He.subAgents.length===0&&o.jsx("span",{className:"cw-error-text",children:vje({name:He.name.trim()||"未命名",typeLabel:XV(He.agentType).label})})]}),o.jsx(vt,{meta:Dn("basic"),children:o.jsxs("div",{className:"cw-form",children:[!Gn&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[_t?"Agent 名称":"名称",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("input",{className:`cw-input ${Ks(Ss)}`,value:He.name,placeholder:"assistant",onChange:ne=>Ge({name:ne.target.value})}),$&&Kn?o.jsx("span",{className:"cw-error-text",children:Kn}):o.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在执行流程中保持唯一。"})]}),o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:[_t?"描述":"智能体描述",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${Ks(Ns)}`,value:He.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:ne=>Ge({description:ne.target.value})}),$&&Ns?o.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):o.jsx("span",{className:"cw-help",children:_t?"完整描述会保留;部署时会自动整理为符合 Runtime 规范的单行描述。":"描述会显示在 Agent 列表与选择器中。"})]})]}),vn?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"cw-section-desc cw-dependency-hint",children:"这是一个协作容器,本身不生成回答。请在左侧画布中 添加任务步骤,并通过拖拽调整它们的位置。"}),He.agentType==="loop"&&o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"最大轮次"}),o.jsx("input",{className:"cw-input",type:"number",min:1,value:He.maxIterations??3,onChange:ne=>Ge({maxIterations:Math.max(1,Number(ne.target.value)||1)})}),o.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):Gn?o.jsxs("div",{className:"cw-field cw-remote-center-fields",children:[o.jsxs("div",{className:"cw-remote-center-head",children:[o.jsxs("div",{className:"cw-label",children:["AgentKit 智能体中心",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx("p",{className:"cw-help cw-remote-center-description",children:"远程 Agent 的名称、描述和能力来自中心返回的 Agent Card。 系统会根据每轮任务动态发现并挂载匹配的 Agent。"})]}),o.jsx(dje,{value:((ba=He.a2aRegistry)==null?void 0:ba.registrySpaceId)??"",region:((wc=He.a2aRegistry)==null?void 0:wc.registryRegion)||Da.region,invalid:$&&Cn,onChange:ne=>un(aG,ne)}),o.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ut,"aria-controls":We,onClick:()=>xn(ne=>!ne),children:[o.jsx("span",{children:"更多选项"}),o.jsx(uc,{className:`cw-more-options-chevron ${ut?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(Ko,{initial:!1,children:ut&&o.jsx(is.div,{id:We,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:o.jsx(lp,{env:lje,values:oG(He.a2aRegistry,{includeDefaults:!1}),onChange:un})})}),$&&Cn&&o.jsx("span",{className:"cw-error-text",children:"请选择 AgentKit 智能体中心"})]}):o.jsxs("div",{className:"cw-field",children:[o.jsxs("label",{className:"cw-label",children:["系统提示词",o.jsx("span",{className:"cw-req",children:"*"})]}),o.jsx(g.Suspense,{fallback:o.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:o.jsx(nje,{value:He.instruction,invalid:hi,onChange:ne=>Ge({instruction:ne})})}),$&&hi?o.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):o.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!vn&&!Gn&&o.jsxs(o.Fragment,{children:[o.jsx(vt,{meta:Dn("model"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"模型名称"}),o.jsx("input",{className:"cw-input",value:He.modelName??"",placeholder:i1(c),onChange:ne=>Ge({modelName:ne.target.value})})]}),o.jsxs("button",{type:"button",className:"cw-more-options cw-model-more-options","aria-expanded":lt,"aria-controls":ye,onClick:()=>Ot(ne=>!ne),children:[o.jsx("span",{children:"更多选项"}),o.jsx(uc,{className:`cw-more-options-chevron ${lt?"is-open":""}`,"aria-hidden":!0})]}),o.jsx(Ko,{initial:!1,children:lt&&o.jsxs(is.div,{id:ye,className:"cw-model-advanced",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"服务商 Provider"}),o.jsx("input",{className:"cw-input",value:He.modelProvider??"",placeholder:"openai",onChange:ne=>Ge({modelProvider:ne.target.value})})]}),o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"API Base"}),o.jsx("input",{className:"cw-input",value:He.modelApiBase??"",placeholder:r1(c),onChange:ne=>Ge({modelApiBase:ne.target.value})}),o.jsx("span",{className:"cw-help cw-dependency-hint",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),o.jsx(vt,{meta:Dn("tools"),children:o.jsxs("div",{className:"cw-form",children:[o.jsxs("div",{className:"cw-field",children:[o.jsx("label",{className:"cw-label",children:"内置工具"}),o.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),o.jsx("div",{className:"cw-tools-list-shell",children:o.jsx(cje,{items:b7,selected:At,onToggle:bs,scrollRows:6})}),o.jsx(Ko,{initial:!1,children:At.includes("run_code")&&o.jsxs(is.div,{className:"cw-tool-config",initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.16,ease:"easeOut"},children:[o.jsxs("div",{className:"cw-tool-config-head",children:[o.jsx("span",{className:"cw-label",children:"代码执行配置"}),o.jsx("span",{className:"cw-help",children:"指定 AgentKit 代码执行沙箱。"})]}),o.jsx(lp,{env:((nr=Ou.find(ne=>ne.id==="run_code"))==null?void 0:nr.env)??[],values:((Hu=m.deployment)==null?void 0:Hu.envValues)??{},onChange:ht})]})})]}),o.jsxs("div",{className:"cw-field cw-mcp-field",children:[o.jsx("label",{className:"cw-label",children:"MCP 工具"}),o.jsx(hje,{tools:Os,onChange:ne=>Ge({mcpTools:ne})})]})]})}),o.jsx(vt,{meta:Dn("skills"),children:o.jsx("div",{className:"cw-form",children:o.jsx(mje,{selected:Ms,onChange:ne=>Ge({selectedSkills:ne}),cloudProvider:c})})}),o.jsx(vt,{meta:Dn("knowledge"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(Sb,{checked:He.knowledgebase,onChange:ne=>Ge({knowledgebase:ne}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:qb}),He.knowledgebase&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"知识库后端"}),o.jsx(a_,{options:dN,value:He.knowledgebaseBackend,onChange:ne=>Ge({knowledgebaseBackend:ne,knowledgebaseIndex:ne==="viking"?He.knowledgebaseIndex:""})}),(He.knowledgebaseBackend??vu)==="viking"&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"VikingDB 知识库"}),o.jsx(fje,{value:He.knowledgebaseIndex??"",onChange:ne=>{Ge({knowledgebaseIndex:ne.id}),ne.projectName&&ht("DATABASE_VIKING_PROJECT",ne.projectName),ne.region&&ht("DATABASE_VIKING_REGION",ne.region),ne.sourceKind&&ht("DATABASE_VIKING_COLLECTION_KIND",ne.sourceKind),ht("DATABASE_VIKING_RESOURCE_ID",ne.resourceId??"")}})]}),o.jsx(lp,{env:((qs=dN.find(ne=>ne.id===(He.knowledgebaseBackend??vu)))==null?void 0:qs.env)??[],values:((ie=m.deployment)==null?void 0:ie.envValues)??{},onChange:ht})]})]})}),_t&&o.jsx(vt,{meta:Dn("memory"),children:o.jsxs("div",{className:"cw-form cw-toggle-stack",children:[o.jsx(Sb,{checked:He.memory.shortTerm,onChange:ne=>Ge({memory:{...He.memory,shortTerm:ne}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:$B}),He.memory.shortTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"短期记忆后端"}),o.jsx(a_,{options:cN,value:He.shortTermBackend,onChange:ne=>Ge({shortTermBackend:ne})}),o.jsx(lp,{env:((Qt=cN.find(ne=>ne.id===(He.shortTermBackend??"local")))==null?void 0:Qt.env)??[],values:((Pn=m.deployment)==null?void 0:Pn.envValues)??{},onChange:ht})]}),o.jsx(Sb,{checked:He.memory.longTerm,onChange:ne=>Ge({memory:{...He.memory,longTerm:ne}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:qb}),He.memory.longTerm&&o.jsxs("div",{className:"cw-field cw-subfield",children:[o.jsx("label",{className:"cw-label",children:"长期记忆后端"}),o.jsx(a_,{options:uN,value:He.longTermBackend,onChange:ne=>Ge({longTermBackend:ne})}),o.jsx(lp,{env:((Ts=uN.find(ne=>ne.id===(He.longTermBackend??"local")))==null?void 0:Ts.env)??[],values:((en=m.deployment)==null?void 0:en.envValues)??{},onChange:ht}),o.jsx(Sb,{checked:!!He.autoSaveSession,onChange:ne=>Ge({autoSaveSession:ne}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:qb})]})]})})]})]})})})})})]})}),I==="validate"&&o.jsx("div",{className:"cw-validation-workspace",children:o.jsx("div",{className:"cw-validation-content",children:o.jsx(_je,{enabled:ce,disabledReason:he,variants:be,draftSnapshot:Yn,input:Pe,onInput:Fe,onSend:et,onStartVariant:it,onDeployVariant:ne=>void Be(ne),onAddVariant:Et,onRemoveVariant:je,onToggleConfig:ne=>{const Se=be.find(ge=>ge.id===ne);Se&&Ln(ne,{configOpen:!Se.configOpen})},onCompleteConfig:pi,onConfigChange:us,onOpenTrace:rn})})}),I==="publish"&&o.jsx("div",{className:"cw-preview-body",children:P?o.jsx(yE,{embedded:!0,cloudProvider:c,project:P,agentDraft:m,agentName:m.name||"未命名 Agent",agentCount:uG(m),releaseConfiguration:Wn?{modelName:Wn.modelName||m.modelName||"默认模型",description:Wn.description,instruction:Wn.instruction,optimizations:Wn.optimizations.flatMap(ne=>{const Se=pG.find(ge=>ge.id===ne);return Se?[Se.label]:[]})}:void 0,onChange:Q,onDeploy:ri,onAgentAdded:n,onDeploymentTaskChange:r,deploymentActionLabel:l?"更新并发布":"部署",deploymentActionTargetId:"cw-publish-primary-action",deploymentRuntimeId:l==null?void 0:l.runtimeId,onDeploymentStarted:f,onDeploymentComplete:d,feishuEnabled:!!((ks=m.deployment)!=null&&ks.feishuEnabled),onFeishuEnabledChange:ne=>{const Se={...m,deployment:{...m.deployment??{feishuEnabled:!1},feishuEnabled:ne}};b(Se)},deploymentEnv:Ls.specs,deploymentEnvValues:{...(Vr=m.deployment)==null?void 0:Vr.envValues,...Ls.fixedValues},onDeploymentEnvChange:ht,network:(Gr=m.deployment)==null?void 0:Gr.network,onNetworkChange:ne=>b(Se=>({...Se,deployment:{...Se.deployment??{feishuEnabled:!1},network:ne}})),deployRegion:X,onDeployRegionChange:K,deploymentTelemetry:{source:"scratch",createMode:a,aiAssisted:_},onExportYaml:()=>ije(`${m.name||"agent"}.yaml`,rAe(m),"text/yaml")}):o.jsxs("div",{className:"cw-publish-loading",role:"status",children:[o.jsx(yn,{className:"cw-i cw-spin"}),o.jsx("strong",{children:"正在生成发布配置"}),o.jsx("span",{children:"校验 Agent 结构并准备部署快照…"})]})})]}),o.jsx(Nje,{mode:I,busy:ee,onChange:Jt,assistant:I==="build"?mi:void 0}),Ye&&o.jsx(nG,{testRunId:Ye.runId,sessionId:Ye.sessionId,title:`调用链路 · ${Ye.variantName}`,onClose:()=>Ce(null)}),Ve&&o.jsx(mA,{variant:"warning",title:"离开调试?",description:"离开调试页面后,当前环境将被清理。您可以通过重新启动环境进行新的测试。",confirmLabel:W?"清理中...":"确定离开",closeLabel:"关闭离开调试确认",busy:W,onCancel:xs,onConfirm:()=>void de()}),k&&o.jsx("div",{className:"confirm-scrim",onClick:()=>A(null),children:o.jsxs("div",{className:"confirm-box cw-ai-error-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"ai-generate-error-title","aria-describedby":"ai-generate-error-message",onClick:ne=>ne.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"ai-generate-error-title",children:"智能生成失败"}),o.jsx("div",{className:"cw-ai-error-message",id:"ai-generate-error-message",children:k}),o.jsx("div",{className:"confirm-actions",children:o.jsx("button",{type:"button",className:"confirm-btn cw-ai-error-close",onClick:()=>A(null),children:"关闭"})})]})})]})}function Do(e){return{...Ci(),...e}}const kje=[{id:"support",icon:Vee,draft:Do({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:Aee,draft:Do({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:Gee,draft:Do({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:Kk,draft:Do({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:Qee,draft:Do({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:hte,draft:Do({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Do({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Do({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Do({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function mG(e,t){if(t!=="byteplus")return e;const n=i1(t);return{...e,model:e.model==="doubao-1.5-pro-32k"?n:e.model,modelName:e.modelName===t2?n:e.modelName,modelApiBase:!e.modelApiBase||e.modelApiBase===e2?r1(t):e.modelApiBase,subAgents:e.subAgents.map(s=>mG(s,t))}}function Aje(e){const t=[];return e.tools.length&&t.push({icon:VB,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:kee,label:"记忆"}),e.knowledgebase&&t.push({icon:Nee,label:"知识库"}),e.tracing&&t.push({icon:See,label:"观测"}),e.subAgents.length&&t.push({icon:ete,label:`子Agent ${e.subAgents.length}`}),t}function Cje({cloudProvider:e="volcengine",onBack:t,onCreate:n}){const[s,i]=g.useState(null),r=g.useMemo(()=>kje.map(a=>({...a,draft:mG(a.draft,e)})),[e]);return o.jsx("div",{className:"tpl-root",children:s?o.jsx(jje,{template:s,onBack:()=>i(null),onCreate:n}):o.jsx(Ije,{templates:r,onPick:i})})}function Ije({templates:e,onPick:t}){return o.jsxs("div",{className:"tpl-scroll",children:[o.jsxs("div",{className:"tpl-head",children:[o.jsx("h1",{className:"tpl-title",children:"从模板新建"}),o.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),o.jsx("div",{className:"tpl-grid",children:e.map((n,s)=>o.jsxs(is.button,{type:"button",className:"tpl-card",onClick:()=>t(n),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:s*.03,duration:.24,ease:[.22,1,.36,1]},children:[o.jsx("span",{className:"tpl-card-icon",children:o.jsx(n.icon,{className:"icon"})}),o.jsx("span",{className:"tpl-card-name",children:n.draft.name}),o.jsx("span",{className:"tpl-card-desc",children:hc(n.draft.description)})]},n.id))})]})}function jje({template:e,onBack:t,onCreate:n}){const[s,i]=g.useState(e.draft.name),r=e.icon,a=Aje(e.draft);function l(){const c=s.trim()||e.draft.name;n({...e.draft,name:c})}return o.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[o.jsxs("button",{className:"tpl-back",onClick:t,children:[o.jsx(Vk,{className:"icon"})," 返回模板列表"]}),o.jsxs(is.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[o.jsxs("div",{className:"tpl-detail-head",children:[o.jsx("span",{className:"tpl-detail-icon",children:o.jsx(r,{className:"icon"})}),o.jsxs("div",{className:"tpl-detail-headtext",children:[o.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),o.jsx("div",{className:"tpl-detail-desc",children:hc(e.draft.description)})]})]}),a.length>0&&o.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(c=>o.jsxs("span",{className:"tpl-tag",children:[o.jsx(c.icon,{className:"tpl-tag-icon"})," ",c.label]},c.label))}),o.jsxs("label",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"名称"}),o.jsx("input",{className:"tpl-input",value:s,onChange:c=>i(c.target.value),placeholder:e.draft.name})]}),o.jsxs("div",{className:"tpl-field",children:[o.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),o.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),o.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"模型"}),o.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"工具"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"记忆"}),o.jsx("span",{className:"tpl-meta-val",children:Rje(e.draft)})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"知识库"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),o.jsxs("div",{className:"tpl-meta",children:[o.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),o.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&o.jsxs("div",{className:"tpl-field",children:[o.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),o.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((c,u)=>o.jsxs("div",{className:"tpl-subagent",children:[o.jsxs("div",{className:"tpl-subagent-top",children:[o.jsx("span",{className:"tpl-subagent-name",children:c.name}),c.tools.length>0&&o.jsx("span",{className:"tpl-subagent-tools",children:c.tools.join("、")})]}),o.jsx("div",{className:"tpl-subagent-desc",children:hc(c.description)})]},u))})]}),o.jsxs("button",{className:"tpl-create",onClick:l,children:["使用此模板创建 ",o.jsx(uc,{className:"icon"})]})]})]})}function Rje(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}const Oje=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:HB},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:LB},{type:"loop",label:"循环",desc:"节点循环执行",Icon:Xk}];let tT=0;function d_(){return tT+=1,`node_${tT}`}function f_(e,t,n="volcengine",s){const i=Ci(n);return{id:e,type:"agentNode",position:t,data:{agent:{...i,name:(s==null?void 0:s.name)??`agent_${e.replace("node_","")}`,...s}}}}function Mje({data:e,selected:t}){const n=e.agent;return o.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[o.jsx(Bi,{type:"target",position:Qe.Left,className:"wfb-handle"}),o.jsx("div",{className:"wfb-node-icon",children:o.jsx(pu,{className:"icon"})}),o.jsxs("div",{className:"wfb-node-body",children:[o.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),o.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),o.jsx(Bi,{type:"source",position:Qe.Right,className:"wfb-handle"})]})}const Lje={agentNode:Mje},AD={type:"smoothstep",markerEnd:{type:If.ArrowClosed,width:16,height:16}};function Dje({cloudProvider:e="volcengine",onBack:t,onCreate:n}){const s=g.useRef(null),[i,r]=g.useState(""),[a,l]=g.useState(""),[c,u]=g.useState("sequential"),d=g.useMemo(()=>{tT=0;const I=d_();return f_(I,{x:80,y:120},e,{name:"agent_1"})},[e]),[f,h,p]=DU([d]),[m,b,v]=PU([]),[y,x]=g.useState(d.id),E=f.find(I=>I.id===y)??null,w=i.trim()||"workflow_agent",S=g.useMemo(()=>LH({name:w,subAgents:f.map(I=>I.data.agent)}),[w,f]),_=nc(w)??(S.has(w)?"名称须与 Agent 节点名称保持唯一":null),T=E?nc(E.data.agent.name)??(S.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,k=f.length>0&&_===null&&f.every(I=>nc(I.data.agent.name)===null&&!S.has(I.data.agent.name)),A=g.useCallback(I=>b(D=>uU({...I,...AD},D)),[b]),j=g.useCallback(()=>{const I=d_(),D=f.length*28,$=f_(I,{x:80+D,y:120+D},e);h(O=>O.concat($)),x(I)},[e,f.length,h]),R=I=>{I.dataTransfer.setData("application/wfb-node","agentNode"),I.dataTransfer.effectAllowed="move"},B=g.useCallback(I=>{I.preventDefault(),I.dataTransfer.dropEffect="move"},[]),z=g.useCallback(I=>{if(I.preventDefault(),I.dataTransfer.getData("application/wfb-node")!=="agentNode"||!s.current)return;const $=s.current.screenToFlowPosition({x:I.clientX,y:I.clientY}),O=d_(),te=f_(O,$,e);h(se=>se.concat(te)),x(O)},[e,h]),L=g.useCallback(I=>{y&&h(D=>D.map($=>$.id===y?{...$,data:{...$.data,agent:{...$.data.agent,...I}}}:$))},[y,h]),F=g.useCallback(()=>{y&&(h(I=>I.filter(D=>D.id!==y)),b(I=>I.filter(D=>D.source!==y&&D.target!==y)),x(null))},[y,h,b]),C=g.useCallback(()=>{if(!k)return;const I=f.map($=>$.data.agent),D={...Ci(e),name:w,description:a.trim(),instruction:a.trim(),subAgents:I,workflow:{type:c,nodes:f.map($=>({id:$.id,agent:$.data.agent})),edges:m.map($=>({from:$.source,to:$.target}))}};n(D)},[k,e,f,m,w,a,c,n]);return o.jsx("div",{className:"wfb",children:o.jsxs("div",{className:"wfb-grid",children:[o.jsxs("aside",{className:"wfb-palette",children:[o.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${_?"wfb-input--error":""}`,value:i,onChange:I=>r(I.target.value),placeholder:"my_workflow"}),_&&o.jsx("span",{className:"wfb-field-error",children:_})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:a,onChange:I=>l(I.target.value),placeholder:"这个工作流做什么…",rows:2})]}),o.jsx("div",{className:"wfb-section-label",children:"执行方式"}),o.jsx("div",{className:"wfb-types",children:Oje.map(({type:I,label:D,desc:$,Icon:O})=>o.jsxs("button",{type:"button",className:`wfb-type ${c===I?"wfb-type--active":""}`,onClick:()=>u(I),children:[o.jsx(O,{className:"icon"}),o.jsxs("span",{className:"wfb-type-text",children:[o.jsx("span",{className:"wfb-type-name",children:D}),o.jsx("span",{className:"wfb-type-desc",children:$})]})]},I))}),o.jsx("div",{className:"wfb-section-label",children:"节点"}),o.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:R,title:"拖拽到画布,或点击下方按钮添加",children:[o.jsx(zee,{className:"icon wfb-grip"}),o.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:o.jsx(pu,{className:"icon"})}),o.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),o.jsxs("button",{className:"wfb-add",type:"button",onClick:j,children:[o.jsx(ji,{className:"icon"}),"添加节点"]}),o.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),o.jsxs("div",{className:"wfb-canvas",children:[o.jsxs("button",{className:"wfb-create",onClick:C,disabled:!k,type:"button",children:[o.jsx(mu,{className:"icon"}),"创建工作流"]}),o.jsxs(LU,{nodes:f,edges:m,onNodesChange:p,onEdgesChange:v,onConnect:A,onInit:I=>s.current=I,nodeTypes:Lje,defaultEdgeOptions:AD,onDrop:z,onDragOver:B,onNodeClick:(I,D)=>x(D.id),onPaneClick:()=>x(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[o.jsx(UU,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),o.jsx($U,{showInteractive:!1}),o.jsx(Xce,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),o.jsx("aside",{className:"wfb-inspector",children:E?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"wfb-inspector-head",children:[o.jsx("div",{className:"wfb-section-label",children:"节点配置"}),o.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:F,title:"删除节点",children:o.jsx(dc,{className:"icon"})})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"名称"}),o.jsx("input",{className:`wfb-input ${T?"wfb-input--error":""}`,value:E.data.agent.name,onChange:I=>L({name:I.target.value}),placeholder:"agent_name"}),T?o.jsx("span",{className:"wfb-field-error",children:T}):o.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"描述"}),o.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:I=>L({description:I.target.value}),placeholder:"这个 agent 做什么…"})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),o.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:I=>L({instruction:I.target.value}),placeholder:"你是一个…",rows:6})]}),o.jsxs("label",{className:"wfb-field",children:[o.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),o.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:I=>L({tools:I.target.value.split(",").map(D=>D.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),o.jsxs("div",{className:"wfb-inspector-meta",children:[o.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),o.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):o.jsxs("div",{className:"wfb-inspector-empty",children:[o.jsx(pu,{className:"wfb-empty-icon"}),o.jsx("p",{children:"选择一个节点以编辑其配置"}),o.jsxs("p",{className:"wfb-empty-sub",children:["共 ",f.length," 个节点 · ",m.length," 条连线"]})]})})]})})}function Pje(e){return o.jsx(L2,{children:o.jsx(Dje,{...e})})}const CD=50*1024*1024,nT=800,Bje={name:"code_package",files:[]};function Uje(e){let n=e.replace(/\.zip$/i,"").trim().replace(/[^A-Za-z0-9_]+/g,"_").replace(/^_+|_+$/g,"");return n||(n="uploaded_agent"),/^[A-Za-z_]/.test(n)||(n=`agent_${n}`),n==="user"&&(n="uploaded_agent"),n.slice(0,64)}function Fje(e){const t=e.replace(/\\/g,"/").replace(/^\.\//,"");if(!t||t.endsWith("/"))return null;if(t.startsWith("/")||t.includes("\0"))throw new Error(`压缩包包含非法路径:${e}`);const n=t.split("/");if(n.some(s=>!s||s==="."||s===".."))throw new Error(`压缩包包含非法路径:${e}`);return n[0]==="__MACOSX"||n[n.length-1]===".DS_Store"?null:n.join("/")}function $je(e){const t=e.flatMap(a=>{const l=Fje(a.name);return l?[{path:l,content:a.text}]:[]});if(t.length===0)throw new Error("压缩包中没有可部署的文件。");if(t.length>nT)throw new Error(`代码包文件数不能超过 ${nT} 个。`);const i=new Set(t.map(a=>a.path.split("/")[0])).size===1&&t.every(a=>a.path.includes("/"))?t.map(a=>({...a,path:a.path.split("/").slice(1).join("/")})):t,r=new Set;for(const a of i){if(r.has(a.path))throw new Error(`代码包包含重复文件:${a.path}`);r.add(a.path)}if(!r.has("app.py"))throw new Error("代码包根目录必须包含 app.py,作为 AgentKit 启动入口。");return i}function Hje({onBack:e,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:s,onDeploymentComplete:i,cloudProvider:r="volcengine",initialDeployRegion:a=Ti(r)}){const l=g.useRef(null),c=g.useRef(0),[u,d]=g.useState(null),[f,h]=g.useState(""),[p,m]=g.useState(!1),[b,v]=g.useState(!1),[y,x]=g.useState(!1),[E,w]=g.useState(""),[S,_]=g.useState(a),[T,k]=g.useState();g.useEffect(()=>()=>{c.current+=1},[]);async function A(z){const L=++c.current;if(w(""),!z.name.toLowerCase().endsWith(".zip")){w("请选择 .zip 格式的代码包。");return}if(z.size>CD){w("代码包不能超过 50 MB。");return}v(!0);try{const F=await ZV(new Uint8Array(await z.arrayBuffer()),{maxEntries:nT,maxUncompressedBytes:CD}),C=$je(F);if(L!==c.current)return;h(z.name),d({name:Uje(z.name),files:C})}catch(F){if(L!==c.current)return;h(""),d(null),w(F instanceof Error?F.message:String(F))}finally{L===c.current&&v(!1)}}function j(z){var F;const L=(F=z.currentTarget.files)==null?void 0:F[0];z.currentTarget.value="",L&&A(L)}function R(z){var F;z.preventDefault(),x(!1);const L=(F=z.dataTransfer.files)==null?void 0:F[0];L&&A(L)}async function B(z,L,F){const C=T&&T.mode!=="public"?{mode:T.mode,vpc_id:T.vpcId,subnet_ids:T.subnetIds,enable_shared_internet_access:T.enableSharedInternetAccess}:void 0;return vg(z.name,z.files,{region:S,projectName:"default",network:C},{...F,onStage:L})}return o.jsxs("div",{className:"package-create package-create-preview",children:[o.jsx(yE,{cloudProvider:r,project:u??Bje,agentName:(u==null?void 0:u.name)||"代码包",onChange:u?d:void 0,onDeploy:B,onAgentAdded:t,onDeploymentTaskChange:n,onDeploymentStarted:s,onDeploymentComplete:i,network:T,onNetworkChange:k,deployRegion:S,onDeployRegionChange:_,deploymentTelemetry:{source:"code_package",createMode:"code_package",aiAssisted:!1},onBack:e,backLabel:"返回创建方式",deployDisabled:!u||b,deployDisabledReason:b?"正在读取代码包":u?void 0:"请先上传代码包",deploymentPrimaryPane:o.jsxs("section",{className:"package-source-pane","aria-label":"代码包上传",children:[o.jsx("div",{className:"package-source-label",children:"代码包"}),o.jsxs("div",{className:`package-dropzone${y?" is-dragging":""}${u?" is-ready":""}`,onDragEnter:z=>{z.preventDefault(),x(!0)},onDragOver:z=>z.preventDefault(),onDragLeave:z=>{z.currentTarget.contains(z.relatedTarget)||x(!1)},onDrop:R,onClick:()=>{var z;b||(z=l.current)==null||z.click()},onKeyDown:z=>{var L;!b&&(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),(L=l.current)==null||L.click())},role:"button",tabIndex:b?-1:0,"aria-label":u?"重新上传代码包":"上传代码包","aria-disabled":b,children:[o.jsx("strong",{children:b?"正在读取代码包…":u?f:"请上传代码包"}),o.jsx("span",{children:u?`已识别 ${u.files.length} 个文件,点击区域可重新上传`:"点击或拖拽上传,支持 .zip 格式,最大 50 MB,根目录需包含 app.py"}),o.jsx("div",{className:"package-upload-actions",children:u&&o.jsx("button",{type:"button",className:"package-upload-secondary",onClick:z=>{z.stopPropagation(),m(!0)},onKeyDown:z=>z.stopPropagation(),children:"查看文件"})}),o.jsx("input",{ref:l,type:"file",accept:".zip,application/zip","aria-label":"选择代码包",onChange:j})]}),E&&o.jsx("div",{className:"package-create-error",role:"alert",children:E})]})}),u&&o.jsx(Zz,{project:u,open:p,onClose:()=>m(!1),onChange:d})]})}const gG=1;function $1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zje(e){return $1(e)&&typeof e.id=="string"&&typeof e.updatedAt=="number"&&$1(e.draft)}function NE(e){return`veadk.agentDrafts.${encodeURIComponent(e)}`}function Vje(e){var s;const t=gE(e),n={...((s=t.draft.deployment)==null?void 0:s.envValues)??{},...t.envValues};return!t.draft.deployment&&Object.keys(n).length===0?t.draft:{...t.draft,deployment:{...t.draft.deployment??{feishuEnabled:!1},envValues:n}}}function bG(e){return{...e,draft:Vje(e.draft)}}function Gje(e){const t=Array.isArray(e)?e:$1(e)&&e.version===gG?e.drafts:void 0;if(!Array.isArray(t)||!t.every(zje))throw $1(e)&&typeof e.version=="number"?new Error("本机草稿版本暂不受支持,请升级 Studio 后重试。"):new Error("本机草稿数据格式无效。");return t.map(bG)}function Kje(e,t){if(!t)return[];const n=e.getItem(NE(t));if(!n)return[];try{return Gje(JSON.parse(n))}catch(s){throw s instanceof Error&&s.message.startsWith("本机草稿")?s:new Error("无法读取本机草稿,浏览器中的草稿数据可能已损坏。")}}function ID(e,t,n){if(!t)return;const s={version:gG,drafts:n.map(bG)};try{e.setItem(NE(t),JSON.stringify(s))}catch(i){throw i instanceof DOMException&&(i.name==="QuotaExceededError"||i.name==="NS_ERROR_DOM_QUOTA_REACHED")?new Error("浏览器存储空间不足,草稿未保存。请删除不需要的草稿或清理此站点的浏览器存储后重试。"):new Error("浏览器拒绝保存草稿,请检查站点存储权限后重试。")}}const qje="/web/skill-creator";class rC extends Error{constructor(n,s){super(n);zC(this,"status");this.name="SkillCreatorApiError",this.status=s}}function $u(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} 格式错误`);return e}function ps(e,...t){for(const n of t){const s=e[n];if(typeof s=="string"&&s)return s}}function yG(e,...t){for(const n of t){const s=e[n];if(typeof s=="number"&&Number.isFinite(s))return s}}async function qg(e,t){return fetch(Rn(`${qje}${e}`),{...t,headers:Ex({Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers})})}async function aC(e,t){if((e.headers.get("content-type")??"").includes("application/json")){const i=$u(await e.json(),"错误响应");return ps(i,"detail","message","error")??t}return(await e.text()).trim()||t}async function oC(e,t){if(!e.ok)throw new rC(await aC(e,t),e.status);if(!(e.headers.get("content-type")??"").includes("application/json"))throw new Error(`${t}:服务端返回了非 JSON 响应`);return e.json()}function Yje(e){if(e==="queued")return"queued";if(e==="running")return"running";if(e==="succeeded")return"succeeded";if(e==="failed")return"failed";throw new Error(`未知的 Skill 生成状态:${String(e)}`)}function Wje(e){if(e==="provisioning"||e==="generating"||e==="validating"||e==="packaging"||e==="completed"||e==="failed")return e;throw new Error(`未知的 Skill 生成阶段:${String(e)}`)}function Xje(e){return Array.isArray(e)?e.map((t,n)=>{const s=$u(t,`文件 ${n+1}`),i=ps(s,"path");if(!i)throw new Error(`文件 ${n+1} 缺少 path`);const r=yG(s,"size");if(r===void 0)throw new Error(`文件 ${n+1} 缺少 size`);return{path:i,size:r}}):[]}function Qje(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e,n=Array.isArray(t.errors)?t.errors.map(String):[],s=Array.isArray(t.warnings)?t.warnings.map(String):[];return{valid:typeof t.valid=="boolean"?t.valid:n.length===0,errors:n,warnings:s}}function Zje(e){if(e===void 0)return[];if(!Array.isArray(e))throw new Error("Skill 生成活动记录格式错误");return e.map((t,n)=>{const s=$u(t,`活动 ${n+1}`),i=ps(s,"id"),r=ps(s,"kind"),a=ps(s,"status");if(!i||!r||!["status","thinking","tool","message"].includes(r))throw new Error(`活动 ${n+1} 格式错误`);if(a!=="running"&&a!=="done")throw new Error(`活动 ${n+1} 状态错误`);if(r==="tool"){const c=ps(s,"name");if(!c)throw new Error(`活动 ${n+1} 缺少工具名称`);return{id:i,kind:r,name:c,args:s.input,response:s.output,status:a}}const l=ps(s,"text");if(!l)throw new Error(`活动 ${n+1} 缺少文本`);return{id:i,kind:r,text:l,status:a}})}function Jje(e,t){const n=$u(e,`候选方案 ${t+1}`),s=ps(n,"id","candidate_id","candidateId"),i=ps(n,"model","model_id","modelId");if(!s||!i)throw new Error(`候选方案 ${t+1} 缺少 id 或 model`);return{id:s,model:i,modelLabel:ps(n,"modelLabel","model_label")??i,status:Yje(n.status),stage:Wje(n.stage),name:ps(n,"name","skill_name","skillName"),description:ps(n,"description"),skillMd:ps(n,"skillMd","skill_md"),files:Xje(n.files),activities:Zje(n.activities),validation:Qje(n.validation),durationMs:yG(n,"elapsedMs","elapsed_ms"),error:ps(n,"error","error_message","errorMessage"),published:n.published===!0,skillId:ps(n,"skill_id","skillId"),version:ps(n,"version")}}function sT(e,t=""){const n=$u(e,"Skill 创建任务"),s=ps(n,"id","job_id","jobId");if(!s)throw new Error("Skill 创建任务缺少 id");const i=Array.isArray(n.candidates)?n.candidates.map(Jje):[],r=ps(n,"status")??"running";if(r!=="provisioning"&&r!=="running"&&r!=="completed")throw new Error(`未知的 Skill 任务状态:${r}`);return{id:s,prompt:ps(n,"prompt")??t,status:r,candidates:i}}async function eRe(e,t){const n=await qg("/jobs",{method:"POST",body:JSON.stringify({prompt:e})});if(!n.ok)throw new rC(await aC(n,"创建 Skill 任务失败"),n.status);const s=n.headers.get("content-type")??"";if(s.includes("application/json")){const u=sT(await n.json(),e);return t==null||t(u),u}if(!s.includes("application/x-ndjson")||!n.body)throw new Error("创建 Skill 任务失败:服务端返回了非流式响应");const i=n.body.getReader(),r=new TextDecoder;let a="",l;const c=u=>{if(!u.trim())return;const d=$u(JSON.parse(u),"Skill 创建进度");if(d.type==="error")throw new Error(ps(d,"error")??"创建 Skill 任务失败");if(d.type!=="progress"&&d.type!=="complete")throw new Error("未知的 Skill 创建进度事件");l=sT(d.job,e),t==null||t(l)};for(;;){const{done:u,value:d}=await i.read();a+=r.decode(d,{stream:!u});const f=a.split(` +`);if(a=f.pop()??"",f.forEach(c),u)break}if(c(a),!l)throw new Error("创建 Skill 任务失败:服务端未返回任务");return l}async function tRe(e){const t=await qg(`/jobs/${encodeURIComponent(e)}`);return sT(await oC(t,"读取 Skill 任务失败"))}async function nRe(e){const t=await qg(`/jobs/${encodeURIComponent(e)}`,{method:"DELETE"});await oC(t,"清理 Skill 任务失败")}async function sRe(e,t){var l;const n=await qg(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/download`);if(!n.ok)throw new Error(await aC(n,"下载 Skill 失败"));const i=((l=(n.headers.get("content-disposition")??"").match(/filename="([^"]+)"/))==null?void 0:l[1])??"skill.zip",r=URL.createObjectURL(await n.blob()),a=document.createElement("a");a.href=r,a.download=i,a.click(),URL.revokeObjectURL(r)}async function iRe(e,t,n){const s=await qg(`/jobs/${encodeURIComponent(e)}/candidates/${encodeURIComponent(t)}/publish`,{method:"POST",body:JSON.stringify(n)}),i=$u(await oC(s,"添加到 AgentKit 失败"),"发布结果"),r=ps(i,"skill_id","skillId","id");if(!r)throw new Error("发布结果缺少 skill_id");return{skillId:r,name:ps(i,"name"),version:ps(i,"version"),skillSpaceIds:Array.isArray(i.skillSpaceIds)?i.skillSpaceIds.map(String):Array.isArray(i.skill_space_ids)?i.skill_space_ids.map(String):[],message:ps(i,"message")}}const rRe=()=>{};function aRe(e){if(e.kind==="message")return{kind:"text",text:e.text};if(e.kind==="thinking")return{kind:"thinking",text:e.text,done:e.status==="done"};if(e.kind==="tool")return{kind:"tool",name:e.name,args:e.args,response:e.response,done:e.status==="done"};throw new Error("不支持的 Skill 对话活动")}function oRe({activities:e}){const t=g.useMemo(()=>e.filter(n=>n.kind!=="status").map(aRe),[e]);return t.length===0?null:o.jsx("div",{className:"skill-conversation","aria-label":"Skill 生成对话","aria-live":"polite",children:o.jsx(kA,{blocks:t,onAction:rRe})})}const jD={provisioning:"正在准备 Sandbox",generating:"正在生成 Skill",validating:"正在校验结构",packaging:"正在打包",completed:"生成完成",failed:"生成失败"},RD=12e4;function lRe({status:e}){return e==="succeeded"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"m6.7 10.1 2.1 2.2 4.6-4.8"})]}):e==="failed"?o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 6.2v4.5M10 13.6h.01"})]}):o.jsxs("svg",{className:"skill-candidate__spinner",viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("circle",{cx:"10",cy:"10",r:"7"}),o.jsx("path",{d:"M10 3a7 7 0 0 1 7 7"})]})}function cRe(){return o.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[o.jsx("path",{d:"M4.2 3.5h7.1l4.5 4.6v8.4H4.2z"}),o.jsx("path",{d:"M11.3 3.5v4.6h4.5M7 11h6M7 13.8h4.2"})]})}function uRe(){return o.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:o.jsx("path",{d:"m9 5-5 5 5 5M4.5 10H16"})})}function dRe({candidate:e}){var c,u;const[t,n]=g.useState("SKILL.md"),s=e.files.find(d=>d.path.endsWith("SKILL.md")),i=e.skillMd&&!s?[{path:"SKILL.md",size:new Blob([e.skillMd]).size},...e.files]:e.files,r=i.find(d=>d.path===t)??i[0],a=(c=e.skillMd)==null?void 0:c.slice(0,RD),l=(((u=e.skillMd)==null?void 0:u.length)??0)>RD;return i.length===0?null:o.jsxs("div",{className:"skill-files",children:[o.jsx("div",{className:"skill-files__tabs",role:"tablist","aria-label":`${e.name??"Skill"} 文件`,children:i.map(d=>o.jsx("button",{type:"button",role:"tab","aria-selected":(r==null?void 0:r.path)===d.path,className:(r==null?void 0:r.path)===d.path?"is-active":"",onClick:()=>n(d.path),children:d.path},d.path))}),e.skillMd&&(r!=null&&r.path.endsWith("SKILL.md"))?o.jsxs(o.Fragment,{children:[o.jsx("pre",{className:"skill-files__content",children:o.jsx("code",{children:a})}),l?o.jsx("p",{className:"skill-files__truncated",children:"预览内容较长,完整文件请下载 ZIP 查看。"}):null]}):o.jsx("div",{className:"skill-files__unavailable",children:r?`${r.path} · ${r.size.toLocaleString()} bytes`:"文件内容将在下载包中提供"})]})}function fRe({label:e,jobId:t,candidate:n,selected:s,publishing:i,publishDisabled:r,publishError:a,onSelect:l,onPublish:c}){const[u,d]=g.useState("conversation"),[f,h]=g.useState(!1),[p,m]=g.useState(!1),[b,v]=g.useState(""),[y,x]=g.useState(""),[E,w]=g.useState(""),[S,_]=g.useState(""),T=g.useRef(null),k=g.useRef(null),A=n.status==="queued"||n.status==="running",j=n.status==="succeeded",R=n.validation;return o.jsxs("article",{className:`skill-candidate skill-candidate--${n.status}${s?" is-selected":""}`,"aria-label":`${e} ${n.model}`,children:[o.jsxs("header",{className:"skill-candidate__header",children:[o.jsx("h2",{children:n.model}),s?o.jsx("span",{className:"skill-candidate__selected",children:"已选方案"}):null]}),u==="conversation"?o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--conversation",children:[o.jsxs("div",{className:"skill-candidate__status","aria-live":"polite",children:[o.jsx("span",{className:"skill-candidate__status-icon",children:o.jsx(lRe,{status:n.status})}),A?o.jsx(Pa,{duration:2.2,spread:16,children:jD[n.stage]}):o.jsx("span",{children:jD[n.stage]}),n.durationMs!==void 0&&j?o.jsxs("span",{className:"skill-candidate__duration",children:[(n.durationMs/1e3).toFixed(1)," 秒"]}):null]}),o.jsx(oRe,{activities:n.activities}),n.error?o.jsx("div",{className:"skill-candidate__error",children:n.error}):null,j?o.jsx("div",{className:"skill-candidate__view-actions",children:o.jsxs("button",{ref:T,type:"button",className:"skill-action skill-action--preview",onClick:()=>{d("preview"),requestAnimationFrame(()=>{var B;return(B=k.current)==null?void 0:B.focus()})},children:[o.jsx(cRe,{}),"查看 Skill"]})}):null]}):o.jsxs("div",{className:"skill-candidate__view skill-candidate__view--preview",children:[o.jsx("div",{className:"skill-candidate__preview-nav",children:o.jsxs("button",{ref:k,type:"button",className:"skill-candidate__back",onClick:()=>{d("conversation"),requestAnimationFrame(()=>{var B;return(B=T.current)==null?void 0:B.focus()})},children:[o.jsx(uRe,{}),"返回对话"]})}),o.jsxs("div",{className:"skill-candidate__result",children:[o.jsxs("div",{className:"skill-candidate__summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"Skill"}),o.jsx("strong",{children:n.name??"未命名 Skill"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"文件"}),o.jsx("strong",{children:n.files.length})]}),o.jsxs("div",{children:[o.jsx("span",{children:"校验"}),o.jsx("strong",{className:(R==null?void 0:R.valid)===!1?"is-invalid":"is-valid",children:(R==null?void 0:R.valid)===!1?"未通过":"已通过"})]})]}),n.description?o.jsx("p",{className:"skill-candidate__description",children:n.description}):null,R&&(R.errors.length>0||R.warnings.length>0)?o.jsxs("details",{className:"skill-validation",children:[o.jsx("summary",{children:"查看校验详情"}),[...R.errors,...R.warnings].map((B,z)=>o.jsx("div",{children:B},`${B}-${z}`))]}):null,o.jsx(dRe,{candidate:n}),o.jsxs("div",{className:"skill-candidate__actions",children:[o.jsx("button",{type:"button",className:"skill-action skill-action--select","aria-pressed":s,onClick:l,children:s?"已采用此方案":"采用此方案"}),o.jsx("button",{type:"button",className:"skill-action",disabled:p,onClick:()=>{m(!0),v(""),sRe(t,n.id).catch(B=>{v(B instanceof Error?B.message:String(B))}).finally(()=>m(!1))},children:p?"正在下载…":"下载 ZIP"}),o.jsx("button",{type:"button",className:"skill-action",disabled:!s||i||r||n.published,title:s?void 0:"请先采用此方案",onClick:()=>h(B=>!B),children:n.published?"已添加到 AgentKit":i?"正在添加…":"添加到 AgentKit"})]}),b?o.jsx("div",{className:"skill-candidate__error",children:b}):null,f&&s&&!n.published?o.jsxs("form",{className:"skill-publish-form",onSubmit:B=>{B.preventDefault();const z=y.split(",").map(L=>L.trim()).filter(Boolean);c({skillSpaceIds:z,...E.trim()?{projectName:E.trim()}:{},...S.trim()?{skillId:S.trim()}:{}})},children:[o.jsxs("label",{children:[o.jsx("span",{children:"SkillSpace ID(可选)"}),o.jsx("input",{value:y,onChange:B=>x(B.target.value),placeholder:"多个 ID 用英文逗号分隔"})]}),o.jsxs("div",{className:"skill-publish-form__optional",children:[o.jsxs("label",{children:[o.jsx("span",{children:"项目名称(可选)"}),o.jsx("input",{value:E,onChange:B=>w(B.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:"已有 Skill ID(可选)"}),o.jsx("input",{value:S,onChange:B=>_(B.target.value)})]})]}),o.jsx("button",{type:"submit",className:"skill-action skill-action--select",disabled:i,children:i?"正在添加…":"确认添加"})]}):null,a?o.jsx("div",{className:"skill-candidate__error",children:a}):null]})]})]})}const OD=new Set(["completed"]),kb=1100,hRe=3e4;function pRe(e,t){return{id:`pending-${t}`,model:e,modelLabel:e,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}}function mRe({initialJob:e}){const[t,n]=g.useState(e),[s,i]=g.useState(""),[r,a]=g.useState(!1),[l,c]=g.useState(),[u,d]=g.useState(),[f,h]=g.useState(()=>new Set),[p,m]=g.useState({});g.useEffect(()=>{n(e),i(""),a(!1)},[e]),g.useEffect(()=>{if(OD.has(e.status)||e.id.startsWith("pending-"))return;let y=!1,x;const E=Date.now()+hRe,w=async()=>{try{const S=await tRe(e.id);y||(n({...S,prompt:S.prompt||e.prompt}),i(""),OD.has(S.status)||(x=window.setTimeout(w,kb)))}catch(S){if(!y){const _=S instanceof rC?S:void 0;if((_==null?void 0:_.status)===404&&Date.now(){y=!0,x!==void 0&&window.clearTimeout(x)}},[e.id,e.status]);const b=CA.map((y,x)=>t.candidates.find(E=>E.model===y)??t.candidates[x]??pRe(y,x));async function v(y,x){d(y.id),m(E=>({...E,[y.id]:""}));try{await iRe(t.id,y.id,x),h(E=>new Set(E).add(y.id))}catch(E){m(w=>({...w,[y.id]:E instanceof Error?E.message:String(E)}))}finally{d(void 0)}}return o.jsxs("section",{className:"skill-workspace",children:[o.jsx("header",{className:"skill-workspace__intro",children:o.jsx("h1",{children:"正在把需求变成可运行的 Skill"})}),s?o.jsxs("div",{className:"skill-workspace__poll-error",role:"alert",children:["状态刷新失败:",s,"。",r?"":"页面会继续重试。"]}):null,o.jsx("div",{className:"skill-workspace__grid",children:b.map((y,x)=>{const w=f.has(y.id)||y.published?{...y,published:!0}:y;return o.jsx(fRe,{label:`方案 ${x===0?"A":"B"}`,jobId:t.id,candidate:w,selected:l===y.id,publishing:u===y.id,publishDisabled:u!==void 0&&u!==y.id,publishError:p[y.id],onSelect:()=>c(y.id),onPublish:S=>void v(y,S)},`${y.model}-${y.id}`)})})]})}function gRe(e){return Object.prototype.toString.call(e)==="[object Object]"}function MD(e){return gRe(e)||Array.isArray(e)}function bRe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function lC(e,t){const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),r=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==r?!1:n.every(a=>{const l=e[a],c=t[a];return typeof l=="function"?`${l}`==`${c}`:!MD(l)||!MD(c)?l===c:lC(l,c)})}function LD(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function yRe(e,t){if(e.length!==t.length)return!1;const n=LD(e),s=LD(t);return n.every((i,r)=>{const a=s[r];return lC(i,a)})}function cC(e){return typeof e=="number"}function iT(e){return typeof e=="string"}function TE(e){return typeof e=="boolean"}function DD(e){return Object.prototype.toString.call(e)==="[object Object]"}function _s(e){return Math.abs(e)}function uC(e){return Math.sign(e)}function cm(e,t){return _s(e-t)}function xRe(e,t){if(e===0||t===0||_s(e)<=_s(t))return 0;const n=cm(_s(e),_s(t));return _s(n/e)}function ERe(e){return Math.round(e*100)/100}function tg(e){return ng(e).map(Number)}function Ua(e){return e[Yg(e)]}function Yg(e){return Math.max(0,e.length-1)}function dC(e,t){return t===Yg(e)}function PD(e,t=0){return Array.from(Array(e),(n,s)=>t+s)}function ng(e){return Object.keys(e)}function xG(e,t){return[e,t].reduce((n,s)=>(ng(s).forEach(i=>{const r=n[i],a=s[i],l=DD(r)&&DD(a);n[i]=l?xG(r,a):a}),n),{})}function rT(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function vRe(e,t){const n={start:s,center:i,end:r};function s(){return 0}function i(c){return r(c)/2}function r(c){return t-c}function a(c,u){return iT(e)?n[e](c):e(t,c,u)}return{measure:a}}function sg(){let e=[];function t(i,r,a,l={passive:!0}){let c;if("addEventListener"in i)i.addEventListener(r,a,l),c=()=>i.removeEventListener(r,a,l);else{const u=i;u.addListener(a),c=()=>u.removeListener(a)}return e.push(c),s}function n(){e=e.filter(i=>i())}const s={add:t,clear:n};return s}function wRe(e,t,n,s){const i=sg(),r=1e3/60;let a=null,l=0,c=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function d(){p(),i.clear()}function f(v){if(!c)return;a||(a=v,n(),n());const y=v-a;for(a=v,l+=y;l>=r;)n(),l-=r;const x=l/r;s(x),c&&(c=t.requestAnimationFrame(f))}function h(){c||(c=t.requestAnimationFrame(f))}function p(){t.cancelAnimationFrame(c),a=null,l=0,c=0}function m(){a=null,l=0}return{init:u,destroy:d,start:h,stop:p,update:n,render:s}}function _Re(e,t){const n=t==="rtl",s=e==="y",i=s?"y":"x",r=s?"x":"y",a=!s&&n?-1:1,l=d(),c=f();function u(m){const{height:b,width:v}=m;return s?b:v}function d(){return s?"top":n?"right":"left"}function f(){return s?"bottom":n?"left":"right"}function h(m){return m*a}return{scroll:i,cross:r,startEdge:l,endEdge:c,measureSize:u,direction:h}}function Nu(e=0,t=0){const n=_s(e-t);function s(u){return ut}function r(u){return s(u)||i(u)}function a(u){return r(u)?s(u)?e:t:u}function l(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:a,reachedAny:r,reachedMax:i,reachedMin:s,removeOffset:l}}function EG(e,t,n){const{constrain:s}=Nu(0,e),i=e+1;let r=a(t);function a(h){return n?_s((i+h)%i):s(h)}function l(){return r}function c(h){return r=a(h),f}function u(h){return d().set(l()+h)}function d(){return EG(e,l(),n)}const f={get:l,set:c,add:u,clone:d};return f}function SRe(e,t,n,s,i,r,a,l,c,u,d,f,h,p,m,b,v,y,x){const{cross:E,direction:w}=e,S=["INPUT","SELECT","TEXTAREA"],_={passive:!1},T=sg(),k=sg(),A=Nu(50,225).constrain(p.measure(20)),j={mouse:300,touch:400},R={mouse:500,touch:600},B=m?43:25;let z=!1,L=0,F=0,C=!1,I=!1,D=!1,$=!1;function O(ue){if(!x)return;function we(Ne){(TE(x)||x(ue,Ne))&&V(Ne)}const Le=t;T.add(Le,"dragstart",Ne=>Ne.preventDefault(),_).add(Le,"touchmove",()=>{},_).add(Le,"touchend",()=>{}).add(Le,"touchstart",we).add(Le,"mousedown",we).add(Le,"touchcancel",K).add(Le,"contextmenu",K).add(Le,"click",ce,!0)}function te(){T.clear(),k.clear()}function se(){const ue=$?n:t;k.add(ue,"touchmove",X,_).add(ue,"touchend",K).add(ue,"mousemove",X,_).add(ue,"mouseup",K)}function P(ue){const we=ue.nodeName||"";return S.includes(we)}function Q(){return(m?R:j)[$?"mouse":"touch"]}function ee(ue,we){const Le=f.add(uC(ue)*-1),Ne=d.byDistance(ue,!m).distance;return m||_s(ue)=2,!(we&&ue.button!==0)&&(P(ue.target)||(C=!0,r.pointerDown(ue),u.useFriction(0).useDuration(0),i.set(a),se(),L=r.readPoint(ue),F=r.readPoint(ue,E),h.emit("pointerDown")))}function X(ue){if(!rT(ue,s)&&ue.touches.length>=2)return K(ue);const Le=r.readPoint(ue),Ne=r.readPoint(ue,E),ae=cm(Le,L),me=cm(Ne,F);if(!I&&!$&&(!ue.cancelable||(I=ae>me,!I)))return K(ue);const _e=r.pointerMove(ue);ae>b&&(D=!0),u.useFriction(.3).useDuration(.75),l.start(),i.add(w(_e)),ue.preventDefault()}function K(ue){const Le=d.byDistance(0,!1).index!==f.get(),Ne=r.pointerUp(ue)*Q(),ae=ee(w(Ne),Le),me=xRe(Ne,ae),_e=B-10*me,Je=y+me/50;I=!1,C=!1,k.clear(),u.useDuration(_e).useFriction(Je),c.distance(ae,!m),$=!1,h.emit("pointerUp")}function ce(ue){D&&(ue.stopPropagation(),ue.preventDefault(),D=!1)}function he(){return C}return{init:O,destroy:te,pointerDown:he}}function NRe(e,t){let s,i;function r(f){return f.timeStamp}function a(f,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(rT(f,t)?f:f.touches[0])[m]}function l(f){return s=f,i=f,a(f)}function c(f){const h=a(f)-a(i),p=r(f)-r(s)>170;return i=f,p&&(s=f),h}function u(f){if(!s||!i)return 0;const h=a(i)-a(s),p=r(f)-r(s),m=r(f)-r(i)>170,b=h/p;return p&&!m&&_s(b)>.1?b:0}return{pointerDown:l,pointerMove:c,pointerUp:u,readPoint:a}}function TRe(){function e(n){const{offsetTop:s,offsetLeft:i,offsetWidth:r,offsetHeight:a}=n;return{top:s,right:i+r,bottom:s+a,left:i,width:r,height:a}}return{measure:e}}function kRe(e){function t(s){return e*(s/100)}return{measure:t}}function ARe(e,t,n,s,i,r,a){const l=[e].concat(s);let c,u,d=[],f=!1;function h(v){return i.measureSize(a.measure(v))}function p(v){if(!r)return;u=h(e),d=s.map(h);function y(x){for(const E of x){if(f)return;const w=E.target===e,S=s.indexOf(E.target),_=w?u:d[S],T=h(w?e:s[S]);if(_s(T-_)>=.5){v.reInit(),t.emit("resize");break}}}c=new ResizeObserver(x=>{(TE(r)||r(v,x))&&y(x)}),n.requestAnimationFrame(()=>{l.forEach(x=>c.observe(x))})}function m(){f=!0,c&&c.disconnect()}return{init:p,destroy:m}}function CRe(e,t,n,s,i,r){let a=0,l=0,c=i,u=r,d=e.get(),f=0;function h(){const _=s.get()-e.get(),T=!c;let k=0;return T?(a=0,n.set(s),e.set(s),k=_):(n.set(e),a+=_/c,a*=u,d+=a,e.add(a),k=d-f),l=uC(k),f=d,S}function p(){const _=s.get()-t.get();return _s(_)<.001}function m(){return c}function b(){return l}function v(){return a}function y(){return E(i)}function x(){return w(r)}function E(_){return c=_,S}function w(_){return u=_,S}const S={direction:b,duration:m,velocity:v,seek:h,settled:p,useBaseFriction:x,useBaseDuration:y,useFriction:w,useDuration:E};return S}function IRe(e,t,n,s,i){const r=i.measure(10),a=i.measure(50),l=Nu(.1,.99);let c=!1;function u(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function d(p){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",b=_s(e[m]-t.get()),v=n.get()-t.get(),y=l.constrain(b/a);n.subtract(v*y),!p&&_s(v){const{min:v,max:y}=r,x=r.constrain(m),E=!b,w=dC(n,b);return E?y:w||u(v,x)?v:u(y,x)?y:x}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[r.max];if(s==="keepSnaps")return a;const{min:m,max:b}=l;return a.slice(m,b)}return{snapsContained:c,scrollContainLimit:l}}function RRe(e,t,n){const s=t[0],i=n?s-e:Ua(t);return{limit:Nu(i,s)}}function ORe(e,t,n,s){const r=t.min+.1,a=t.max+.1,{reachedMin:l,reachedMax:c}=Nu(r,a);function u(h){return h===1?c(n.get()):h===-1?l(n.get()):!1}function d(h){if(!u(h))return;const p=e*(h*-1);s.forEach(m=>m.add(p))}return{loop:d}}function MRe(e){const{max:t,length:n}=e;function s(r){const a=r-t;return n?a/-n:0}return{get:s}}function LRe(e,t,n,s,i){const{startEdge:r,endEdge:a}=e,{groupSlides:l}=i,c=f().map(t.measure),u=h(),d=p();function f(){return l(s).map(b=>Ua(b)[a]-b[0][r]).map(_s)}function h(){return s.map(b=>n[r]-b[r]).map(b=>-_s(b))}function p(){return l(u).map(b=>b[0]).map((b,v)=>b+c[v])}return{snaps:u,snapsAligned:d}}function DRe(e,t,n,s,i,r){const{groupSlides:a}=i,{min:l,max:c}=s,u=d();function d(){const h=a(r),p=!e||t==="keepSnaps";return n.length===1?[r]:p?h:h.slice(l,c).map((m,b,v)=>{const y=!b,x=dC(v,b);if(y){const E=Ua(v[0])+1;return PD(E)}if(x){const E=Yg(r)-Ua(v)[0]+1;return PD(E,Ua(v)[0])}return m})}return{slideRegistry:u}}function PRe(e,t,n,s,i){const{reachedAny:r,removeOffset:a,constrain:l}=s;function c(m){return m.concat().sort((b,v)=>_s(b)-_s(v))[0]}function u(m){const b=e?a(m):l(m),v=t.map((x,E)=>({diff:d(x-b,0),index:E})).sort((x,E)=>_s(x.diff)-_s(E.diff)),{index:y}=v[0];return{index:y,distance:b}}function d(m,b){const v=[m,m+n,m-n];if(!e)return m;if(!b)return c(v);const y=v.filter(x=>uC(x)===b);return y.length?c(y):Ua(v)-n}function f(m,b){const v=t[m]-i.get(),y=d(v,b);return{index:m,distance:y}}function h(m,b){const v=i.get()+m,{index:y,distance:x}=u(v),E=!e&&r(v);if(!b||E)return{index:y,distance:m};const w=t[y]-x,S=m+d(w,0);return{index:y,distance:S}}return{byDistance:h,byIndex:f,shortcut:d}}function BRe(e,t,n,s,i,r,a){function l(f){const h=f.distance,p=f.index!==t.get();r.add(h),h&&(s.duration()?e.start():(e.update(),e.render(1),e.update())),p&&(n.set(t.get()),t.set(f.index),a.emit("select"))}function c(f,h){const p=i.byDistance(f,h);l(p)}function u(f,h){const p=t.clone().set(f),m=i.byIndex(p.get(),h);l(m)}return{distance:c,index:u}}function URe(e,t,n,s,i,r,a,l){const c={passive:!0,capture:!0};let u=0;function d(p){if(!l)return;function m(b){if(new Date().getTime()-u>10)return;a.emit("slideFocusStart"),e.scrollLeft=0;const x=n.findIndex(E=>E.includes(b));cC(x)&&(i.useDuration(0),s.index(x,0),a.emit("slideFocus"))}r.add(document,"keydown",f,!1),t.forEach((b,v)=>{r.add(b,"focus",y=>{(TE(l)||l(p,y))&&m(v)},c)})}function f(p){p.code==="Tab"&&(u=new Date().getTime())}return{init:d}}function kp(e){let t=e;function n(){return t}function s(c){t=a(c)}function i(c){t+=a(c)}function r(c){t-=a(c)}function a(c){return cC(c)?c:c.get()}return{get:n,set:s,add:i,subtract:r}}function vG(e,t){const n=e.scroll==="x"?a:l,s=t.style;let i=null,r=!1;function a(h){return`translate3d(${h}px,0px,0px)`}function l(h){return`translate3d(0px,${h}px,0px)`}function c(h){if(r)return;const p=ERe(e.direction(h));p!==i&&(s.transform=n(p),i=p)}function u(h){r=!h}function d(){r||(s.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:d,to:c,toggleActive:u}}function FRe(e,t,n,s,i,r,a,l,c){const d=tg(i),f=tg(i).reverse(),h=y().concat(x());function p(T,k){return T.reduce((A,j)=>A-i[j],k)}function m(T,k){return T.reduce((A,j)=>p(A,k)>0?A.concat([j]):A,[])}function b(T){return r.map((k,A)=>({start:k-s[A]+.5+T,end:k+t-.5+T}))}function v(T,k,A){const j=b(k);return T.map(R=>{const B=A?0:-n,z=A?n:0,L=A?"end":"start",F=j[R][L];return{index:R,loopPoint:F,slideLocation:kp(-1),translate:vG(e,c[R]),target:()=>l.get()>F?B:z}})}function y(){const T=a[0],k=m(f,T);return v(k,n,!1)}function x(){const T=t-a[0]-1,k=m(d,T);return v(k,-n,!0)}function E(){return h.every(({index:T})=>{const k=d.filter(A=>A!==T);return p(k,t)<=.1})}function w(){h.forEach(T=>{const{target:k,translate:A,slideLocation:j}=T,R=k();R!==j.get()&&(A.to(R),j.set(R))})}function S(){h.forEach(T=>T.translate.clear())}return{canLoop:E,clear:S,loop:w,loopPoints:h}}function $Re(e,t,n){let s,i=!1;function r(c){if(!n)return;function u(d){for(const f of d)if(f.type==="childList"){c.reInit(),t.emit("slidesChanged");break}}s=new MutationObserver(d=>{i||(TE(n)||n(c,d))&&u(d)}),s.observe(e,{childList:!0})}function a(){s&&s.disconnect(),i=!0}return{init:r,destroy:a}}function HRe(e,t,n,s){const i={};let r=null,a=null,l,c=!1;function u(){l=new IntersectionObserver(m=>{c||(m.forEach(b=>{const v=t.indexOf(b.target);i[v]=b}),r=null,a=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:s}),t.forEach(m=>l.observe(m))}function d(){l&&l.disconnect(),c=!0}function f(m){return ng(i).reduce((b,v)=>{const y=parseInt(v),{isIntersecting:x}=i[y];return(m&&x||!m&&!x)&&b.push(y),b},[])}function h(m=!0){if(m&&r)return r;if(!m&&a)return a;const b=f(m);return m&&(r=b),m||(a=b),b}return{init:u,destroy:d,get:h}}function zRe(e,t,n,s,i,r){const{measureSize:a,startEdge:l,endEdge:c}=e,u=n[0]&&i,d=m(),f=b(),h=n.map(a),p=v();function m(){if(!u)return 0;const x=n[0];return _s(t[l]-x[l])}function b(){if(!u)return 0;const x=r.getComputedStyle(Ua(s));return parseFloat(x.getPropertyValue(`margin-${c}`))}function v(){return n.map((x,E,w)=>{const S=!E,_=dC(w,E);return S?h[E]+d:_?h[E]+f:w[E+1][l]-x[l]}).map(_s)}return{slideSizes:h,slideSizesWithGaps:p,startGap:d,endGap:f}}function VRe(e,t,n,s,i,r,a,l,c){const{startEdge:u,endEdge:d,direction:f}=e,h=cC(n);function p(y,x){return tg(y).filter(E=>E%x===0).map(E=>y.slice(E,E+x))}function m(y){return y.length?tg(y).reduce((x,E,w)=>{const S=Ua(x)||0,_=S===0,T=E===Yg(y),k=i[u]-r[S][u],A=i[u]-r[E][d],j=!s&&_?f(a):0,R=!s&&T?f(l):0,B=_s(A-R-(k+j));return w&&B>t+c&&x.push(E),T&&x.push(y.length),x},[]).map((x,E,w)=>{const S=Math.max(w[E-1]||0);return y.slice(S,x)}):[]}function b(y){return h?p(y,n):m(y)}return{groupSlides:b}}function GRe(e,t,n,s,i,r,a){const{align:l,axis:c,direction:u,startIndex:d,loop:f,duration:h,dragFree:p,dragThreshold:m,inViewThreshold:b,slidesToScroll:v,skipSnaps:y,containScroll:x,watchResize:E,watchSlides:w,watchDrag:S,watchFocus:_}=r,T=2,k=TRe(),A=k.measure(t),j=n.map(k.measure),R=_Re(c,u),B=R.measureSize(A),z=kRe(B),L=vRe(l,B),F=!f&&!!x,C=f||!!x,{slideSizes:I,slideSizesWithGaps:D,startGap:$,endGap:O}=zRe(R,A,j,n,C,i),te=VRe(R,B,v,f,A,j,$,O,T),{snaps:se,snapsAligned:P}=LRe(R,L,A,j,te),Q=-Ua(se)+Ua(D),{snapsContained:ee,scrollContainLimit:V}=jRe(B,Q,P,x,T),X=F?ee:P,{limit:K}=RRe(Q,X,f),ce=EG(Yg(X),d,f),he=ce.clone(),be=tg(n),ue=({dragHandler:Me,scrollBody:lt,scrollBounds:Ot,options:{loop:ut}})=>{ut||Ot.constrain(Me.pointerDown()),lt.seek()},we=({scrollBody:Me,translate:lt,location:Ot,offsetLocation:ut,previousLocation:xn,scrollLooper:xt,slideLooper:wt,dragHandler:En,animation:Ut,eventHandler:Pt,scrollBounds:at,options:{loop:ft}},He)=>{const _t=Me.settled(),ye=!at.shouldConstrain(),We=ft?_t:_t&&ye,Ge=We&&!En.pointerDown();Ge&&Ut.stop();const ht=Ot.get()*He+xn.get()*(1-He);ut.set(ht),ft&&(xt.loop(Me.direction()),wt.loop()),lt.to(ut.get()),Ge&&Pt.emit("settle"),We||Pt.emit("scroll")},Le=wRe(s,i,()=>ue(Ee),Me=>we(Ee,Me)),Ne=.68,ae=X[ce.get()],me=kp(ae),_e=kp(ae),Je=kp(ae),Pe=kp(ae),Fe=CRe(me,Je,_e,Pe,h,Ne),Ye=PRe(f,X,Q,K,Pe),Ce=BRe(Le,ce,he,Fe,Ye,Pe,a),Ve=MRe(K),Ue=sg(),W=HRe(t,n,a,b),{slideRegistry:oe}=DRe(F,x,X,V,te,be),Z=URe(e,n,oe,Ce,Fe,Ue,a,_),Ee={ownerDocument:s,ownerWindow:i,eventHandler:a,containerRect:A,slideRects:j,animation:Le,axis:R,dragHandler:SRe(R,e,s,i,Pe,NRe(R,i),me,Le,Ce,Fe,Ye,ce,a,z,p,m,y,Ne,S),eventStore:Ue,percentOfView:z,index:ce,indexPrevious:he,limit:K,location:me,offsetLocation:Je,previousLocation:_e,options:r,resizeHandler:ARe(t,a,i,n,R,E,k),scrollBody:Fe,scrollBounds:IRe(K,Je,Pe,Fe,z),scrollLooper:ORe(Q,K,Je,[me,Je,_e,Pe]),scrollProgress:Ve,scrollSnapList:X.map(Ve.get),scrollSnaps:X,scrollTarget:Ye,scrollTo:Ce,slideLooper:FRe(R,B,Q,I,D,se,X,Je,n),slideFocus:Z,slidesHandler:$Re(t,a,w),slidesInView:W,slideIndexes:be,slideRegistry:oe,slidesToScroll:te,target:Pe,translate:vG(R,t)};return Ee}function KRe(){let e={},t;function n(u){t=u}function s(u){return e[u]||[]}function i(u){return s(u).forEach(d=>d(t,u)),c}function r(u,d){return e[u]=s(u).concat([d]),c}function a(u,d){return e[u]=s(u).filter(f=>f!==d),c}function l(){e={}}const c={init:n,emit:i,off:a,on:r,clear:l};return c}const qRe={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function YRe(e){function t(r,a){return xG(r,a||{})}function n(r){const a=r.breakpoints||{},l=ng(a).filter(c=>e.matchMedia(c).matches).map(c=>a[c]).reduce((c,u)=>t(c,u),{});return t(r,l)}function s(r){return r.map(a=>ng(a.breakpoints||{})).reduce((a,l)=>a.concat(l),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:s}}function WRe(e){let t=[];function n(r,a){return t=a.filter(({options:l})=>e.optionsAtMedia(l).active!==!1),t.forEach(l=>l.init(r,e)),a.reduce((l,c)=>Object.assign(l,{[c.name]:c}),{})}function s(){t=t.filter(r=>r.destroy())}return{init:n,destroy:s}}function H1(e,t,n){const s=e.ownerDocument,i=s.defaultView,r=YRe(i),a=WRe(r),l=sg(),c=KRe(),{mergeOptions:u,optionsAtMedia:d,optionsMediaQueries:f}=r,{on:h,off:p,emit:m}=c,b=R;let v=!1,y,x=u(qRe,H1.globalOptions),E=u(x),w=[],S,_,T;function k(){const{container:be,slides:ue}=E;_=(iT(be)?e.querySelector(be):be)||e.children[0];const Le=iT(ue)?_.querySelectorAll(ue):ue;T=[].slice.call(Le||_.children)}function A(be){const ue=GRe(e,_,T,s,i,be,c);if(be.loop&&!ue.slideLooper.canLoop()){const we=Object.assign({},be,{loop:!1});return A(we)}return ue}function j(be,ue){v||(x=u(x,be),E=d(x),w=ue||w,k(),y=A(E),f([x,...w.map(({options:we})=>we)]).forEach(we=>l.add(we,"change",R)),E.active&&(y.translate.to(y.location.get()),y.animation.init(),y.slidesInView.init(),y.slideFocus.init(he),y.eventHandler.init(he),y.resizeHandler.init(he),y.slidesHandler.init(he),y.options.loop&&y.slideLooper.loop(),_.offsetParent&&T.length&&y.dragHandler.init(he),S=a.init(he,w)))}function R(be,ue){const we=te();B(),j(u({startIndex:we},be),ue),c.emit("reInit")}function B(){y.dragHandler.destroy(),y.eventStore.clear(),y.translate.clear(),y.slideLooper.clear(),y.resizeHandler.destroy(),y.slidesHandler.destroy(),y.slidesInView.destroy(),y.animation.destroy(),a.destroy(),l.clear()}function z(){v||(v=!0,l.clear(),B(),c.emit("destroy"),c.clear())}function L(be,ue,we){!E.active||v||(y.scrollBody.useBaseFriction().useDuration(ue===!0?0:E.duration),y.scrollTo.index(be,we||0))}function F(be){const ue=y.index.add(1).get();L(ue,be,-1)}function C(be){const ue=y.index.add(-1).get();L(ue,be,1)}function I(){return y.index.add(1).get()!==te()}function D(){return y.index.add(-1).get()!==te()}function $(){return y.scrollSnapList}function O(){return y.scrollProgress.get(y.offsetLocation.get())}function te(){return y.index.get()}function se(){return y.indexPrevious.get()}function P(){return y.slidesInView.get()}function Q(){return y.slidesInView.get(!1)}function ee(){return S}function V(){return y}function X(){return e}function K(){return _}function ce(){return T}const he={canScrollNext:I,canScrollPrev:D,containerNode:K,internalEngine:V,destroy:z,off:p,on:h,emit:m,plugins:ee,previousScrollSnap:se,reInit:b,rootNode:X,scrollNext:F,scrollPrev:C,scrollProgress:O,scrollSnapList:$,scrollTo:L,selectedScrollSnap:te,slideNodes:ce,slidesInView:P,slidesNotInView:Q};return j(t,n),setTimeout(()=>c.emit("init"),0),he}H1.globalOptions=void 0;function fC(e={},t=[]){const n=g.useRef(e),s=g.useRef(t),[i,r]=g.useState(),[a,l]=g.useState(),c=g.useCallback(()=>{i&&i.reInit(n.current,s.current)},[i]);return g.useEffect(()=>{lC(n.current,e)||(n.current=e,c())},[e,c]),g.useEffect(()=>{yRe(s.current,t)||(s.current=t,c())},[t,c]),g.useEffect(()=>{if(bRe()&&a){H1.globalOptions=fC.globalOptions;const u=H1(a,n.current,s.current);return r(u),()=>u.destroy()}else r(void 0)},[a,r]),[l,i]}fC.globalOptions=void 0;const wG=g.createContext(null);function Wg(...e){return e.filter(Boolean).join(" ")}function kE(){const e=g.useContext(wG);if(!e)throw new Error("useCarousel must be used within a ");return e}function XRe({orientation:e="horizontal",opts:t,setApi:n,plugins:s,className:i,children:r,...a}){const[l,c]=fC({...t,axis:e==="horizontal"?"x":"y"},s),[u,d]=g.useState(!1),[f,h]=g.useState(!1),p=g.useCallback(y=>{y&&(d(y.canScrollPrev()),h(y.canScrollNext()))},[]),m=g.useCallback(()=>c==null?void 0:c.scrollPrev(),[c]),b=g.useCallback(()=>c==null?void 0:c.scrollNext(),[c]),v=g.useCallback(y=>{y.key==="ArrowLeft"?(y.preventDefault(),m()):y.key==="ArrowRight"&&(y.preventDefault(),b())},[b,m]);return g.useEffect(()=>{c&&n&&n(c)},[c,n]),g.useEffect(()=>{if(c)return p(c),c.on("reInit",p),c.on("select",p),()=>{c.off("reInit",p),c.off("select",p)}},[c,p]),o.jsx(wG.Provider,{value:{carouselRef:l,api:c,opts:t,orientation:e,plugins:s,setApi:n,scrollPrev:m,scrollNext:b,canScrollPrev:u,canScrollNext:f},children:o.jsx("div",{onKeyDownCapture:v,className:Wg("ui-carousel",i),role:"region","aria-roledescription":"carousel","aria-orientation":e,"data-slot":"carousel",...a,children:r})})}function QRe({className:e,...t}){const{carouselRef:n,orientation:s}=kE();return o.jsx("div",{ref:n,className:"ui-carousel__viewport","data-slot":"carousel-content",children:o.jsx("div",{className:Wg("ui-carousel__track",s==="vertical"?"is-vertical":void 0,e),...t})})}function ZRe({className:e,...t}){const{orientation:n}=kE();return o.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:Wg("ui-carousel__item",n==="vertical"?"is-vertical":void 0,e),...t})}function _G({direction:e}){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:e==="left"?"m10 3.75-4.25 4.25L10 12.25":"m6 3.75 4.25 4.25L6 12.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function JRe({className:e,...t}){const{orientation:n,scrollPrev:s,canScrollPrev:i}=kE();return o.jsx("button",{type:"button","data-slot":"carousel-previous",className:Wg("ui-carousel__control ui-carousel__control--previous",n==="vertical"?"is-vertical":void 0,e),disabled:!i,onClick:s,"aria-label":"上一张",...t,children:o.jsx(_G,{direction:"left"})})}function eOe({className:e,...t}){const{orientation:n,scrollNext:s,canScrollNext:i}=kE();return o.jsx("button",{type:"button","data-slot":"carousel-next",className:Wg("ui-carousel__control ui-carousel__control--next",n==="vertical"?"is-vertical":void 0,e),disabled:!i,onClick:s,"aria-label":"下一张",...t,children:o.jsx(_G,{direction:"right"})})}const BD=[{title:"随心应变",description:"支持多类 Agent",illustration:"agents"},{title:"一键成型",description:"自动构建 Agent",illustration:"build"},{title:"一搜即达",description:"全局搜索",illustration:"search"},{title:"开箱即用",description:"丰富内置工具",illustration:"tools"}];function tOe(e){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",...e,children:o.jsx("path",{d:"m4.25 4.25 7.5 7.5m0-7.5-7.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function nOe({kind:e}){return e==="agents"?o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsx("g",{className:"new-chat-feature-card__illustration-connectors",children:o.jsx("path",{d:"M43 27.5V33.5H22V38.5M43 33.5H64V38.5"})}),o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"33",y:"6.5",width:"20",height:"21",rx:"6"}),o.jsx("rect",{x:"9",y:"38.5",width:"26",height:"19",rx:"6"}),o.jsx("rect",{x:"51",y:"38.5",width:"26",height:"19",rx:"6"})]}),o.jsxs("g",{className:"new-chat-feature-card__illustration-details",children:[o.jsx("circle",{className:"new-chat-feature-card__illustration-dot",cx:"40",cy:"14.5",r:"1.25"}),o.jsx("circle",{className:"new-chat-feature-card__illustration-dot",cx:"46",cy:"14.5",r:"1.25"}),o.jsx("path",{d:"M39.5 21h7M17 46.5h10M17 51.5h7M59 46.5h10M59 51.5h7"})]})]}):e==="build"?o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsx("g",{className:"new-chat-feature-card__illustration-connectors",children:o.jsx("path",{d:"M26.5 39H36M50 39h9.5"})}),o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"5.5",y:"7.5",width:"75",height:"49",rx:"7.5"}),o.jsx("rect",{x:"12.5",y:"31.5",width:"14",height:"15",rx:"4"}),o.jsx("rect",{x:"36",y:"31.5",width:"14",height:"15",rx:"4"}),o.jsx("rect",{x:"59.5",y:"31.5",width:"14",height:"15",rx:"4"})]}),o.jsx("g",{className:"new-chat-feature-card__illustration-details",children:o.jsx("path",{d:"M6 20.5h74M13.5 14h.01m6 0h.01m6 0h.01M17 39h5m18.5 0h5m18-1 2.5 2.5 4-5"})})]}):e==="search"?o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"7.5",y:"9.5",width:"41",height:"16",rx:"5"}),o.jsx("rect",{x:"7.5",y:"35.5",width:"34",height:"18",rx:"5"}),o.jsx("circle",{cx:"61",cy:"33",r:"10.5"})]}),o.jsx("g",{className:"new-chat-feature-card__illustration-details",children:o.jsx("path",{d:"M14.5 16h21M14.5 21h14M14.5 42.5h17M14.5 47.5h11M68.5 40.5 77 49"})})]}):o.jsxs("svg",{className:"new-chat-feature-card__illustration",viewBox:"0 0 86 64","aria-hidden":"true",children:[o.jsxs("g",{className:"new-chat-feature-card__illustration-surfaces",children:[o.jsx("rect",{x:"8.5",y:"7.5",width:"29",height:"21",rx:"6"}),o.jsx("rect",{x:"48.5",y:"7.5",width:"29",height:"21",rx:"6"}),o.jsx("rect",{x:"8.5",y:"35.5",width:"29",height:"21",rx:"6"}),o.jsx("rect",{x:"48.5",y:"35.5",width:"29",height:"21",rx:"6"})]}),o.jsx("g",{className:"new-chat-feature-card__illustration-details",children:o.jsx("path",{d:"M23 13.5v9m-4.5-4.5h9M56.5 14.5h13M56.5 21.5h13M16.5 42.5h13M16.5 49.5h9M56.5 42.5h13M56.5 49.5h13"})})]})}function sOe(){const[e,t]=g.useState(),[n,s]=g.useState(!1),[i,r]=g.useState(!1),[a,l]=g.useState(!1),[c,u]=g.useState(!0);return g.useEffect(()=>{if(!c)return;const d=window.matchMedia("(prefers-reduced-motion: reduce)"),f=()=>l(d.matches);return f(),d.addEventListener("change",f),()=>d.removeEventListener("change",f)},[c]),g.useEffect(()=>{if(!c||!e||n||i||a)return;const d=window.setInterval(()=>e.scrollNext(),6e3);return()=>window.clearInterval(d)},[e,i,n,a,c]),c?o.jsxs(XRe,{className:"new-chat-feature-carousel",opts:{align:"start",loop:!0},setApi:t,"aria-label":"新特性预览",onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),onFocusCapture:()=>r(!0),onBlurCapture:d=>{d.currentTarget.contains(d.relatedTarget)||r(!1)},children:[o.jsx(JRe,{"aria-label":"上一张新特性"}),o.jsx(QRe,{children:BD.map((d,f)=>o.jsx(ZRe,{"aria-label":`${f+1} / ${BD.length}`,children:o.jsxs("article",{className:"new-chat-feature-card",children:[o.jsxs("div",{className:"new-chat-feature-card__copy",children:[o.jsx("strong",{children:d.title}),o.jsx("span",{children:d.description})]}),o.jsx(nOe,{kind:d.illustration})]})},d.title))}),o.jsx("button",{type:"button",className:"new-chat-feature-carousel__close","aria-label":"关闭新特性轮播",onClick:()=>u(!1),children:o.jsx(tOe,{})}),o.jsx(eOe,{"aria-label":"下一张新特性"})]}):null}const iOe=3*60*1e3,rOe=3e3,aOe=10*60*1e3,z1="veadk.studio.pending-update",UD=[{id:"resolving",label:"读取目标版本信息"},{id:"downloading",label:"下载并校验完整更新包"},{id:"preparing",label:"准备 VeFaaS Function 代码"},{id:"submitting",label:"提交 Function 更新"},{id:"publishing",label:"发布新 Revision 并重启服务"}],oOe={resolving:"读取版本信息",downloading:"下载更新包",preparing:"准备 Function 代码",submitting:"提交 Function 更新",publishing:"发布 Revision",checking:"检查更新",unknown:"未知阶段"};function lOe(e){return e<60?`${e} 秒`:`${Math.floor(e/60)} 分 ${e%60} 秒`}function cOe(e,t){return e===t?!0:/^\d{14}$/.test(e)&&/^\d{14}$/.test(t)&&e>t}function uOe(){if(typeof window>"u")return null;const e=window.localStorage.getItem(z1);if(!e)return null;try{const t=JSON.parse(e);if(typeof t.targetVersion=="string"&&typeof t.startedAt=="number")return{targetVersion:t.targetVersion,startedAt:t.startedAt}}catch{}return window.localStorage.removeItem(z1),null}function h_(e,t){window.localStorage.setItem(z1,JSON.stringify({targetVersion:e,startedAt:t}))}function Ab(){window.localStorage.removeItem(z1)}function FD({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[o.jsx("path",{d:"M19.2 8.3A8 8 0 1 0 20 13"}),o.jsx("path",{d:"M19.2 4.8v3.5h-3.5"}),o.jsx("path",{d:"M12 7.8v7.7"}),o.jsx("path",{d:"m9.2 12.7 2.8 2.8 2.8-2.8"})]})}function dOe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m4 6 4 4 4-4"})})}function fOe(){return o.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"m3.5 8.2 2.8 2.8 6.2-6"})})}function $D({lines:e,phase:t,copyState:n,onCopy:s}){const i=g.useRef(null),r=g.useRef(!0);return g.useEffect(()=>{const a=i.current;a&&r.current&&(a.scrollTop=a.scrollHeight)},[e]),o.jsxs("section",{className:"studio-update-live-log","aria-label":"VeFaaS 更新日志",children:[o.jsxs("div",{className:"studio-update-log-header",children:[o.jsxs("span",{children:[o.jsx("i",{className:`is-${t}`,"aria-hidden":!0}),"VeFaaS 更新日志",o.jsx("small",{children:t==="active"?"实时":t==="complete"?"已完成":"已停止"})]}),o.jsx("button",{type:"button",onClick:s,disabled:!e.length,children:n==="copied"?"已复制":n==="error"?"复制失败":"复制日志"})]}),o.jsx("div",{ref:i,className:"studio-update-log-lines",role:"log","aria-live":"off",tabIndex:0,onScroll:a=>{const l=a.currentTarget;r.current=l.scrollHeight-l.scrollTop-l.clientHeight<24},children:e.length?e.map((a,l)=>o.jsx("div",{children:a},`${l}-${a}`)):o.jsx("p",{children:t==="active"?"等待 VeFaaS 返回更新日志…":"本次更新未返回发布日志"})})]})}function hOe({variant:e="default"}){var L,F;const[t]=g.useState(uOe),[n,s]=g.useState(null),[i,r]=g.useState(t?"submitting":"idle"),[a,l]=g.useState(!1),[c,u]=g.useState(""),[d,f]=g.useState((t==null?void 0:t.targetVersion)??""),[h,p]=g.useState(!1),[m,b]=g.useState("idle"),[v,y]=g.useState(0),x=g.useRef(null),E=g.useRef((t==null?void 0:t.targetVersion)??""),w=g.useRef((t==null?void 0:t.startedAt)??0);g.useEffect(()=>{if(!h)return;const C=D=>{var $;D.target instanceof Node&&!(($=x.current)!=null&&$.contains(D.target))&&p(!1)},I=D=>{D.key==="Escape"&&p(!1)};return window.addEventListener("pointerdown",C),window.addEventListener("keydown",I),()=>{window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",I)}},[h]);const S=g.useCallback(async()=>{const C=await R8(E.current||void 0,w.current||void 0);return s(C),C},[]);if(g.useEffect(()=>{let C=!0;const I=()=>{S().catch(()=>{C&&s($=>$)})};I();const D=window.setInterval(I,iOe);return()=>{C=!1,window.clearInterval(D)}},[S]),g.useEffect(()=>{if(i!=="submitting")return;const C=window.setInterval(()=>{S().then(I=>{const D=E.current;if(D&&cOe(I.currentVersion,D)||!D&&!I.available&&I.latestVersion){window.clearInterval(C),Ab(),r("published"),u("Studio 已更新,刷新页面即可使用新版本");return}if(I.state==="error"){window.clearInterval(C),Ab(),r("error"),u(I.message||"Studio 更新失败");return}Date.now()-w.current>aOe&&(window.clearInterval(C),Ab(),r("error"),u("等待 VeFaaS 发布超时,请稍后重新检查版本"))}).catch(()=>{})},rOe);return()=>window.clearInterval(C)},[i,S]),g.useEffect(()=>{i!=="idle"||(n==null?void 0:n.state)!=="updating"||(E.current=n.targetVersion,w.current=n.startedAt||Date.now(),h_(n.targetVersion,w.current),f(n.targetVersion),r("submitting"))},[i,n]),g.useEffect(()=>{if(i!=="submitting"){y(0);return}const C=()=>{const D=w.current||Date.now();y(Math.max(0,Math.floor((Date.now()-D)/1e3)))};C();const I=window.setInterval(C,1e3);return()=>window.clearInterval(I)},[i]),!(n!=null&&n.enabled)||!(n.available||n.state==="updating"||i!=="idle"))return null;const T=n.releases??[],k=d||((L=T[0])==null?void 0:L.version)||n.latestVersion,A=T.find(C=>C.version===k),j=async()=>{E.current=k,w.current=Date.now(),h_(k,w.current),r("submitting"),u(""),b("idle");try{const C=await O8(k);E.current=C.version,h_(C.version,w.current),u("更新已提交,正在等待 VeFaaS 发布新版本")}catch(C){if(C instanceof TypeError){u("连接已切换,正在确认新版本状态");return}Ab(),r("error");const I=C instanceof Error?C.message:"Studio 更新失败";try{const D=await S();u(D.message||I)}catch{u(I)}}},R=(F=n.updateLogs)!=null&&F.length?n.updateLogs:(n.errorLog||n.progressMessage||c).split(` `).filter(Boolean),B=async()=>{try{await navigator.clipboard.writeText(R.join(` -`)),b("copied")}catch{b("error")}},z=()=>{var C;m(!1),b("idle"),u(""),f(E.current||((C=k[0])==null?void 0:C.version)||""),r("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:e==="feature-link"?"welcome-feature-link studio-update-trigger--feature":`studio-update-trigger is-${i}`,title:i==="submitting"?"正在更新 Studio":i==="published"?"Studio 已更新":`更新 Studio 至 ${n.latestVersion}`,onClick:()=>{var C;i==="published"?window.location.reload():(i==="submitting"||i==="error"||(f(((C=k[0])==null?void 0:C.version)||n.latestVersion),r("confirm")),l(!0))},children:[e!=="feature-link"&&o.jsx(UD,{className:"studio-update-icon"}),i==="submitting"?o.jsx(Ra,{as:"span",children:"正在更新"}):i==="published"?o.jsx("span",{children:"刷新使用新版"}):i==="error"?o.jsx("span",{children:"更新失败"}):e==="feature-link"?o.jsx("span",{children:"立即更新"}):o.jsx("span",{children:"有新版更新"})]}),a&&i!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(UD,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:i==="error"?"Studio 更新失败":i==="submitting"?"正在更新 Studio":i==="published"?"Studio 更新完成":"发现新版本"}),i==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:c}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:oOe[n.errorStage]||n.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:n.errorId||"未生成"})]})]}),o.jsx(FD,{lines:R,phase:"error",copyState:p,onCopy:()=>void B()}),n.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:n.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):i==="submitting"||i==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:E.current||T})]}),o.jsxs("div",{children:[o.jsx("span",{children:i==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:i==="published"?"已完成":lOe(v)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:BD.map((C,I)=>{const D=BD.findIndex(te=>te.id===n.progressStage),$=i==="published"||Ivoid B()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:x,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":h,onClick:()=>m(C=>!C),onKeyDown:C=>{(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),m(!0))},children:[o.jsx("span",{children:T}),o.jsx(dOe,{})]}),h&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:k.map(C=>{const I=C.version===T;return o.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`studio-update-version-option${I?" is-selected":""}`,onClick:()=>{f(C.version),m(!1)},children:[o.jsx("span",{children:C.version}),I&&o.jsx(fOe,{})]},C.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:n.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:T})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((A==null?void 0:A.gitSha)||n.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),A!=null&&A.changelog.length?o.jsx("ul",{children:A.changelog.map(C=>o.jsx("li",{children:C},C))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{l(!1),m(!1),i==="confirm"&&(r("idle"),u(""))},children:i==="submitting"?"后台运行":i==="confirm"?"取消":"关闭"}),i==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void j(),children:"立即更新"}),i==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:z,children:"重新尝试"})]})]})})]})}const mOe=[{title:"多地域智能体",description:"并行加载北京与上海 Runtime,列表下滑即可继续加载。"},{title:"会话内切换",description:"在输入框旁选择智能体,并直接开启一段新会话。"},{title:"可视化执行画布",description:"通过横向画布查看多智能体结构,并支持全屏浏览。"}];function pOe({canUpdate:e=!1}){return o.jsxs("div",{className:"welcome-feature-pill",children:[o.jsx("span",{children:"焕然一新"}),o.jsx("span",{className:"welcome-feature-divider","aria-hidden":"true"}),o.jsx("button",{type:"button",className:"welcome-feature-link","aria-describedby":"welcome-feature-popover",children:"查看新特性"}),o.jsxs("section",{id:"welcome-feature-popover",className:"welcome-feature-popover",role:"tooltip",children:[o.jsx("strong",{children:"本次更新"}),o.jsx("ul",{children:mOe.map(t=>o.jsxs("li",{children:[o.jsx("span",{children:t.title}),o.jsx("p",{children:t.description})]},t.title))})]}),e&&o.jsx(hOe,{variant:"feature-link"})]})}const gOe=1e4;async function _G(e){const t=await fetch(Rn(e),{headers:xx({Accept:"application/json"}),signal:Bn(void 0,gOe)});if(!t.ok)throw new Error(`读取会话模式能力失败(HTTP ${t.status})`);const n=await t.json();if(typeof n.enabled!="boolean")throw new Error("会话模式能力响应格式错误");return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:void 0}}async function bOe(){return _G("/web/sandbox/capabilities")}async function yOe(){return _G("/web/skill-creator/capabilities")}const xOe="我的智能体";function EOe({open:e,state:t,agentKind:n="codex",error:s,onCancel:i,onConfirm:r}){const a=n==="codex"?"Codex":n==="openclaw"?"OpenClaw":"Hermes",l=n==="codex"?xOe:`我的 ${a}`,c=g.useRef(null),u=g.useRef(null),d=g.useRef(null),f=g.useRef(!1),h=g.useRef(i),[m,p]=g.useState(l);if(h.current=i,g.useEffect(()=>{if(!e)return;p(l);const x=document.body.style.overflow;document.body.style.overflow="hidden";const E=window.requestAnimationFrame(()=>{var S,_;(S=u.current)==null||S.focus(),(_=u.current)==null||_.select()}),w=S=>{var A;if(S.key==="Escape"){S.preventDefault(),h.current();return}if(S.key!=="Tab")return;const _=(A=c.current)==null?void 0:A.querySelectorAll("input:not(:disabled), button:not(:disabled)");if(!(_!=null&&_.length))return;const k=_[0],T=_[_.length-1];S.shiftKey&&document.activeElement===k?(S.preventDefault(),T.focus()):!S.shiftKey&&document.activeElement===T&&(S.preventDefault(),k.focus())};return window.addEventListener("keydown",w),()=>{window.cancelAnimationFrame(E),document.body.style.overflow=x,window.removeEventListener("keydown",w)}},[l,e]),!e)return null;const b=t==="loading",v=m.trim(),y=b?`正在创建 ${a} 智能体`:t==="error"?"启动失败":`创建 ${a} 智能体`;return yi.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!b&&i()},children:o.jsxs("form",{ref:c,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":t==="confirm"?void 0:"sandbox-dialog-description",onSubmit:x=>{x.preventDefault(),!b&&!f.current&&v&&r(v)},children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:b?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(eg,{kind:n})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:y}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:s||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):b?o.jsxs("p",{id:"sandbox-dialog-description","aria-live":"polite",children:["正在创建并等待 ",a," 智能体就绪,这通常需要半分钟"]}):null,o.jsxs("label",{className:"sandbox-dialog-field",children:[o.jsxs("span",{className:"sandbox-dialog-field-label",children:[o.jsx("span",{children:"智能体名称"}),o.jsxs("span",{"aria-hidden":"true",children:[m.length,"/",N3]})]}),o.jsx("input",{ref:u,type:"text",required:!0,value:m,maxLength:N3,disabled:b,placeholder:l,autoComplete:"off",onChange:x=>p(x.target.value),onCompositionStart:()=>{f.current=!0},onCompositionEnd:()=>{f.current=!1},onKeyDown:x=>{const{nativeEvent:E}=x;x.key==="Enter"&&(f.current||E.isComposing||E.keyCode===229)&&x.preventDefault()}})]})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:d,type:"button",onClick:i,children:b?"取消创建":"取消"}),!b&&o.jsx("button",{type:"submit",className:"is-primary",disabled:!v,children:t==="error"?"重新尝试":"确认创建"})]})]})}),document.body)}function vOe({agentName:e,onExit:t}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsxs("span",{className:"sandbox-session-warning-copy",children:["当前您在使用 ",e," 智能体"]}),o.jsx("button",{type:"button",onClick:t,children:"退出内置智能体"})]})}function wOe({activity:e,time:t}){var n;return o.jsxs("aside",{className:"sandbox-activity-record",role:"status","aria-label":"Sandbox 操作记录",children:[o.jsxs("div",{className:"sandbox-activity-summary",children:[o.jsx("span",{className:"sandbox-activity-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-activity-label",children:"操作记录"}),o.jsx("strong",{children:e.title}),t?o.jsx("time",{children:t}):null]}),(n=e.details)!=null&&n.length?o.jsx("dl",{className:"sandbox-activity-details",children:e.details.map(s=>o.jsxs("div",{children:[o.jsx("dt",{children:s.label}),o.jsx("dd",{title:s.value,children:s.code?o.jsx("code",{children:s.value}):s.value})]},`${s.label}:${s.value}`))}):null]})}function _Oe(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function SOe({usage:e}){const t=[["Total",e.totalTokens],["Input",e.inputTokens],...e.cachedInputTokens>0?[["Cached input",e.cachedInputTokens]]:[],["Output",e.outputTokens],...e.reasoningOutputTokens>0?[["Reasoning output",e.reasoningOutputTokens]]:[]];return o.jsx("div",{className:"sandbox-token-usage","aria-label":"Codex Token 用量",children:t.map(([n,s])=>o.jsxs("span",{title:`${n}: ${s.toLocaleString()} tokens`,children:[o.jsx("small",{children:n}),o.jsx("strong",{children:_Oe(s)})]},n))})}function SG(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),o.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function NG(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"M3.8 8h16.4"}),o.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function hC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),o.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function py(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),o.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),o.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function NOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function TOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function kOe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),o.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function AOe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),o.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function COe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),o.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function IOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function jOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function aT(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9 6 6 6-6 6"})})}function ROe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),o.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function Yo(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function Jg({open:e,title:t,subtitle:n,icon:s,className:i="",onClose:r,children:a}){const l=g.useId(),c=g.useRef(null),u=g.useRef(null),d=g.useRef(r);return d.current=r,g.useEffect(()=>{var m;if(!e)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const f=document.body.style.overflow;document.body.style.overflow="hidden",(m=c.current)==null||m.focus();const h=p=>{var E;if(p.key==="Escape"){p.preventDefault(),d.current();return}if(p.key!=="Tab")return;const b=(E=c.current)==null?void 0:E.closest("[role=dialog]"),v=Array.from((b==null?void 0:b.querySelectorAll('button:not(:disabled), input:not(:disabled), iframe, [tabindex]:not([tabindex="-1"])'))??[]);if(v.length===0)return;const y=v[0],x=v[v.length-1];p.shiftKey&&document.activeElement===y?(p.preventDefault(),x.focus()):!p.shiftKey&&document.activeElement===x&&(p.preventDefault(),y.focus())};return window.addEventListener("keydown",h),()=>{var p;document.body.style.overflow=f,window.removeEventListener("keydown",h),(p=u.current)==null||p.focus()}},[e]),e?yi.createPortal(o.jsx("div",{className:"sandbox-control-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&r()},children:o.jsxs("section",{className:`sandbox-control-dialog ${i}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":l,children:[o.jsxs("header",{className:"sandbox-control-head",children:[o.jsx("span",{className:"sandbox-control-head-icon","aria-hidden":"true",children:s}),o.jsxs("div",{children:[o.jsx("h2",{id:l,children:t}),o.jsx("p",{children:n})]}),o.jsx("button",{ref:c,type:"button",className:"sandbox-control-close","aria-label":`关闭${t}`,onClick:r,children:o.jsx(jOe,{})})]}),a]})}),document.body):null}function OOe({open:e,kind:t,launch:n,loading:s,error:i,onReload:r,onClose:a}){const l=t==="terminal",c=l?"Terminal":"Sandbox Browser";return o.jsxs(Jg,{open:e,title:c,subtitle:l?"连接当前 AgentKit Session 的交互式终端":"在当前 AgentKit Session 中查看与操作浏览器",icon:l?o.jsx(SG,{}):o.jsx(NG,{}),className:`sandbox-tool-dialog sandbox-tool-dialog--${t}`,onClose:a,children:[o.jsx("div",{className:"sandbox-tool-toolbar",children:o.jsxs("span",{children:[o.jsx("i",{className:s?"is-loading":n?"is-ready":""}),s?"正在连接…":n?"已连接":"尚未连接"]})}),o.jsx("div",{className:"sandbox-tool-surface",children:s?o.jsxs("div",{className:"sandbox-control-state",children:[o.jsx(Yo,{className:"spin"}),o.jsxs("strong",{children:["正在打开 ",c]}),o.jsx("span",{children:"工具正在连接当前 AgentKit Session。"})]}):i?o.jsxs("div",{className:"sandbox-control-state is-error",children:[o.jsxs("strong",{children:[c," 打开失败"]}),o.jsx("span",{children:i}),o.jsx("button",{type:"button",onClick:r,children:"重试"})]}):n?o.jsx("iframe",{src:n.url,title:c,allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function MOe({open:e,threads:t,currentThreadId:n,loading:s,error:i,onSelect:r,onClose:a}){return o.jsx(Jg,{open:e,title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",icon:o.jsx(ROe,{}),className:"sandbox-threads-dialog",onClose:a,children:o.jsx("div",{className:"sandbox-thread-list",children:s?o.jsxs("div",{className:"sandbox-control-state",children:[o.jsx(Yo,{className:"spin"}),o.jsx("strong",{children:"正在读取历史对话"})]}):i?o.jsxs("div",{className:"sandbox-control-state is-error",children:[o.jsx("strong",{children:"历史对话读取失败"}),o.jsx("span",{children:i})]}):t.length===0?o.jsx("div",{className:"sandbox-control-state",children:o.jsx("strong",{children:"暂无可恢复的对话"})}):t.map(l=>{const c=l.id===n,u=l.name||l.preview||`Thread ${l.id.slice(0,8)}`;return o.jsxs("button",{type:"button",className:c?"is-active":"",disabled:c,onClick:()=>r(l.id),children:[o.jsxs("span",{children:[o.jsx("strong",{children:u}),o.jsx("small",{children:l.preview||l.cwd||l.id})]}),o.jsx("time",{children:l.updatedAt?new Date(l.updatedAt*1e3).toLocaleString():""}),o.jsx(aT,{})]},l.id)})})})}const LOe=[{value:"read-only",label:"只读",detail:"允许读取文件,不允许写入工作空间。"},{value:"workspace-write",label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},{value:"danger-full-access",label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。",danger:!0}],DOe=[{value:"untrusted",label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},{value:"on-request",label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},{value:"never",label:"不审批",detail:"Codex 不会暂停并请求人工批准。",danger:!0}],POe=[{value:"user",label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},{value:"auto_review",label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}];function BOe({open:e,value:t,busy:n,error:s,onSave:i,onClose:r}){const[a,l]=g.useState(t);return g.useEffect(()=>{e&&l(t)},[e,t]),o.jsxs(Jg,{open:e,title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",icon:o.jsx(hC,{}),className:"sandbox-settings-dialog",onClose:r,children:[o.jsxs("div",{className:"sandbox-control-body",children:[o.jsx(m_,{label:"沙箱模式",choices:LOe,value:a.sandboxMode,disabled:n,onChange:c=>l(u=>({...u,sandboxMode:c,networkAccess:c==="danger-full-access"?!0:u.networkAccess}))}),o.jsx(m_,{label:"审批策略",choices:DOe,value:a.approvalPolicy,disabled:n,onChange:c=>l(u=>({...u,approvalPolicy:c}))}),o.jsx(m_,{label:"审批方式",choices:POe,value:a.approvalsReviewer,disabled:n,onChange:c=>l(u=>({...u,approvalsReviewer:c}))}),o.jsxs("label",{className:`sandbox-network-toggle${a.sandboxMode==="danger-full-access"?" is-disabled":""}`,children:[o.jsxs("span",{children:[o.jsx("strong",{children:"允许网络访问"}),o.jsx("small",{children:"控制 workspace-write 与只读模式中的外部网络访问。"})]}),o.jsx("input",{type:"checkbox",checked:a.networkAccess,disabled:n||a.sandboxMode==="danger-full-access",onChange:c=>l(u=>({...u,networkAccess:c.target.checked}))})]}),a.sandboxMode==="danger-full-access"?o.jsx("div",{className:"sandbox-control-note is-danger",children:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。"}):null,s?o.jsx("div",{className:"sandbox-control-error",children:s}):null]}),o.jsxs("footer",{className:"sandbox-control-actions",children:[o.jsx("button",{type:"button",onClick:r,disabled:n,children:"取消"}),o.jsxs("button",{type:"button",className:"is-primary",disabled:n,onClick:()=>i(a),children:[n?o.jsx(Yo,{className:"spin"}):null,"保存权限"]})]})]})}function m_({label:e,choices:t,value:n,disabled:s,onChange:i}){return o.jsxs("fieldset",{className:"sandbox-choice-group",disabled:s,role:"radiogroup","aria-label":e,children:[o.jsx("legend",{children:e}),o.jsx("div",{className:"sandbox-choice-list",children:t.map(r=>o.jsxs("button",{type:"button",role:"radio",className:`${n===r.value?"is-active":""}${r.danger?" is-danger":""}`.trim(),"aria-checked":n===r.value,onClick:()=>i(r.value),onKeyDown:a=>{var d,f;const l=t.findIndex(h=>h.value===r.value);let c=l;if(a.key==="ArrowRight"||a.key==="ArrowDown")c=(l+1)%t.length;else if(a.key==="ArrowLeft"||a.key==="ArrowUp")c=(l-1+t.length)%t.length;else if(a.key==="Home")c=0;else if(a.key==="End")c=t.length-1;else return;a.preventDefault(),i(t[c].value);const u=(d=a.currentTarget.parentElement)==null?void 0:d.querySelectorAll('[role="radio"]');(f=u==null?void 0:u[c])==null||f.focus()},children:[o.jsx("i",{}),o.jsxs("span",{children:[o.jsx("strong",{children:r.label}),o.jsx("small",{children:r.detail})]})]},r.value))})]})}function UOe({open:e,cwd:t,locked:n,busy:s,error:i,browse:r,onSave:a,onClose:l}){const[c,u]=g.useState(t||"/"),[d,f]=g.useState(null),[h,m]=g.useState(!1),[p,b]=g.useState("");g.useEffect(()=>{if(!e)return;const y=t||"/";u(y),v(y)},[t,e]);async function v(y){m(!0),b("");try{const x=await r(y);f(x),u(x.path)}catch(x){b(x instanceof Error?x.message:String(x))}finally{m(!1)}}return o.jsxs(Jg,{open:e,title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",icon:o.jsx(py,{}),className:"sandbox-workspace-dialog",onClose:l,children:[o.jsxs("div",{className:"sandbox-control-body",children:[o.jsxs("label",{className:"sandbox-workspace-input",children:[o.jsx("span",{children:"绝对路径"}),o.jsxs("div",{children:[o.jsx("input",{value:c,disabled:s||n,spellCheck:!1,onChange:y=>u(y.target.value),onKeyDown:y=>{y.key==="Enter"&&c.startsWith("/")&&(y.preventDefault(),v(c))}}),o.jsx("button",{type:"button",disabled:s||h||!c.startsWith("/"),onClick:()=>void v(c),children:"浏览"})]})]}),o.jsxs("div",{className:"sandbox-directory-browser",children:[o.jsxs("div",{className:"sandbox-directory-head",children:[o.jsx("span",{title:d==null?void 0:d.path,children:(d==null?void 0:d.path)??c}),h?o.jsx(Yo,{className:"spin"}):null]}),o.jsxs("div",{className:"sandbox-directory-list",children:[d!=null&&d.parent?o.jsxs("button",{type:"button",disabled:h,onClick:()=>void v(d.parent??"/"),children:[o.jsx(py,{}),o.jsx("span",{children:"上一级"}),o.jsx("small",{children:d.parent}),o.jsx(aT,{})]}):null,d==null?void 0:d.directories.map(y=>o.jsxs("button",{type:"button",disabled:h,onClick:()=>void v(y.path),children:[o.jsx(py,{}),o.jsx("span",{children:y.name}),o.jsx(aT,{})]},y.path)),!h&&(d==null?void 0:d.directories.length)===0?o.jsx("div",{className:"sandbox-directory-empty",children:"当前目录没有子目录"}):null]})]}),n?o.jsx("div",{className:"sandbox-control-note",children:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。"}):null,p||i?o.jsx("div",{className:"sandbox-control-error",children:p||i}):null]}),o.jsxs("footer",{className:"sandbox-control-actions",children:[o.jsx("button",{type:"button",onClick:l,disabled:s,children:"取消"}),o.jsxs("button",{type:"button",className:"is-primary",disabled:s||n||!c.startsWith("/"),onClick:()=>a(c),children:[s?o.jsx(Yo,{className:"spin"}):null,"使用此目录"]})]})]})}function FOe({approval:e,busy:t,error:n,onDecision:s}){var a;const i=(a=e==null?void 0:e.command)==null?void 0:a.trim(),r=(e==null?void 0:e.changes)===void 0?"":JSON.stringify(e.changes,null,2);return o.jsxs(Jg,{open:e!==null,title:(e==null?void 0:e.kind)==="file"?"允许修改文件?":"允许执行命令?",subtitle:"Codex 正在等待你的决定",icon:o.jsx(hC,{}),className:"sandbox-approval-dialog",onClose:()=>{t||s("cancel")},children:[o.jsxs("div",{className:"sandbox-control-body",children:[e!=null&&e.reason?o.jsx("div",{className:"sandbox-approval-reason",children:e.reason}):null,i?o.jsx("pre",{children:i}):null,r?o.jsx("pre",{children:r}):null,e!=null&&e.cwd?o.jsxs("div",{className:"sandbox-approval-meta",children:["执行目录 ",o.jsx("code",{children:e.cwd})]}):null,n?o.jsx("div",{className:"sandbox-control-error",children:n}):null]}),o.jsxs("footer",{className:"sandbox-control-actions sandbox-approval-actions",children:[o.jsx("button",{type:"button",disabled:t,onClick:()=>s("decline"),children:"拒绝"}),o.jsx("button",{type:"button",disabled:t,onClick:()=>s("accept"),children:"仅本次允许"}),o.jsxs("button",{type:"button",className:"is-primary",disabled:t,onClick:()=>s("acceptForSession"),children:[t?o.jsx(Yo,{className:"spin"}):null,"本会话允许"]})]})]})}const $Oe={codex:"Codex",openclaw:"OpenClaw",hermes:"Hermes"};function $D(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t)}function HOe({session:e,onBack:t,onOpen:n,onDelete:s}){const[i,r]=g.useState(!1),[a,l]=g.useState(!1),[c,u]=g.useState(!1),[d,f]=g.useState(""),h=$Oe[e.toolName],m=async()=>{if(!(a||c)){l(!0),f("");try{await n()}catch(b){f(b instanceof Error?b.message:String(b))}finally{l(!1)}}},p=async()=>{if(!(c||a)){u(!0),f("");try{await s()}catch(b){f(b instanceof Error?b.message:String(b)),r(!1)}finally{u(!1)}}};return o.jsxs("section",{className:"sandbox-agent-details",children:[o.jsxs("header",{className:"sandbox-agent-details-header",children:[o.jsxs("button",{type:"button",className:"sandbox-agent-back",onClick:t,children:[o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),"返回智能体"]}),o.jsxs("div",{children:[o.jsx("h1",{children:e.displayName||`${h} 智能体`}),o.jsxs("p",{children:[h," AgentKit Session 详情"]})]})]}),d?o.jsx("div",{className:"sandbox-agent-detail-error",role:"alert",children:d}):null,o.jsxs("div",{className:"sandbox-agent-detail-panel",children:[o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"智能体类型"}),o.jsx("dd",{children:h})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:sE(e.status)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"创建人"}),o.jsx("dd",{children:e.createdBy||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具类型"}),o.jsx("dd",{children:e.toolType||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:$D(e.createdAt)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"过期时间"}),o.jsx("dd",{children:$D(e.expireAt)})]}),o.jsxs("div",{className:"is-wide",children:[o.jsx("dt",{children:"Session ID"}),o.jsx("dd",{children:e.id})]})]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"sandbox-agent-delete",disabled:a||c,onClick:()=>r(!0),children:"删除智能体"}),o.jsx("button",{type:"button",className:"sandbox-agent-open",disabled:a||c,"aria-busy":a||void 0,onClick:()=>void m(),children:a?"打开中…":"打开智能体"})]})]}),i?o.jsx("div",{className:"confirm-scrim",onClick:()=>!c&&r(!1),children:o.jsxs("div",{className:"confirm-box",role:"alertdialog","aria-modal":"true","aria-labelledby":"sandbox-agent-delete-title",onClick:b=>b.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"sandbox-agent-delete-title",children:"删除智能体?"}),o.jsxs("div",{className:"confirm-text",children:["将删除“",e.displayName||`${h} 智能体`,"”及其 AgentKit Session,此操作无法撤销。"]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",disabled:c,onClick:()=>r(!1),children:"取消"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",disabled:c,onClick:()=>void p(),children:c?"删除中…":"确认删除"})]})]})}):null]})}const zOe="_SegmentedControl_1sl7d_1",VOe="_SegmentedControlOption_1sl7d_140",GOe="_SegmentedControlThumb_1sl7d_219",oT={SegmentedControl:zOe,SegmentedControlOption:VOe,SegmentedControlThumb:GOe},gy=({value:e,onChange:t,children:n,block:s,pill:i=!0,size:r="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=g.useRef(null),f=g.useRef(null),h=g.useCallback(p=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let E=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(E+w)<2&&(E=E-1),v.style.width=`${Math.floor(E)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const S=x*.15,_=b.scrollLeft,k=y.offsetLeft,T=k+E;(k<_+S||T>_+x-S)&&p&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);ASe({ref:d,onResize:()=>{const p=f.current;if(!p)return;const b=p.style.transition;p.style.transition="",h(!1),p.style.transition=b}}),g.useLayoutEffect(()=>{const p=d.current,b=f.current;!p||!b||(h(!!b.style.transition),b.style.transition||MN(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,r,a,i]);const m=p=>{p&&t&&t(p)};return o.jsxs(mIe,{ref:d,className:da(oT.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:m,onClick:c,"data-block":s?"":void 0,"data-pill":i?"":void 0,"data-size":r,"data-gutter-size":a,...u,children:[o.jsx("div",{className:oT.SegmentedControlThumb,ref:f}),n]})},KOe=({children:e,...t})=>o.jsx(xIe,{className:oT.SegmentedControlOption,...t,onPointerEnter:bH,children:o.jsx("span",{className:"relative",children:e})});gy.Option=KOe;function qOe({workspace:e,onBack:t}){const[n,s]=g.useState("main"),[i,r]=g.useState(""),[a,l]=g.useState(!1),[c,u]=g.useState(""),d=e.kind==="openclaw"?"OpenClaw":"Hermes";g.useEffect(()=>{s("main"),r(""),u(""),l(!1)},[e.session.id]);const f=async()=>{if(s("terminal"),!(i||a)){l(!0),u("");try{const h=await cn.launchAgentTerminal(e.kind,e.session.id);r(h.url)}catch(h){u(h instanceof Error?h.message:String(h))}finally{l(!1)}}};return o.jsxs("section",{className:"sandbox-agent-workspace",children:[o.jsxs("header",{children:[o.jsxs("div",{className:"sandbox-agent-workspace-title",children:[o.jsx("button",{type:"button",onClick:t,"aria-label":"返回智能体列表",children:o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}),o.jsxs("div",{children:[o.jsx("h1",{children:e.session.displayName||`${d} 智能体`}),o.jsxs("p",{children:[o.jsxs("span",{children:["创建人 ",e.session.createdBy||"未知"]}),o.jsx("span",{className:"sandbox-agent-workspace-status","data-ready":e.session.status.toLowerCase()==="ready"||void 0,children:sE(e.session.status)})]})]})]}),o.jsxs(gy,{className:"sandbox-agent-workspace-tabs",value:n,size:"lg",gutterSize:"lg",block:!0,pill:!1,"aria-label":"智能体工作区",onChange:h=>{h==="terminal"?f():s("main")},children:[o.jsx(gy.Option,{value:"main",children:"主界面"}),o.jsx(gy.Option,{value:"terminal",children:"终端"})]})]}),o.jsx("div",{className:"sandbox-agent-workspace-surface",children:n==="main"?o.jsx("iframe",{src:e.webuiUrl,title:`${d} 主界面`,allow:"clipboard-read; clipboard-write"}):a?o.jsx("div",{className:"sandbox-agent-workspace-state",role:"status",children:"正在打开终端…"}):c?o.jsxs("div",{className:"sandbox-agent-workspace-state is-error",role:"alert",children:[o.jsx("p",{children:c}),o.jsx("button",{type:"button",onClick:()=>void f(),children:"重新尝试"})]}):i?o.jsx("iframe",{src:i,title:`${d} 终端`}):null})]})}const kE=[{name:"model",usage:"/model [model]",description:"显示或切换当前对话模型",keywords:["模型","switch"]},{name:"models",usage:"/models",description:"列出 app-server 可用模型",keywords:["模型列表","list"]},{name:"skill",usage:"/skill",description:"浏览并调用当前工作区可用的 Skill",keywords:["技能","workflow"]},{name:"skills",usage:"/skills",description:"浏览并调用当前工作区可用的 Skills",keywords:["技能列表","workflow","list"]},{name:"new",usage:"/new",description:"开始一个新对话",keywords:["新建","对话"]},{name:"resume",usage:"/resume [thread]",description:"打开历史会话或恢复指定 thread",keywords:["历史","恢复","session"]},{name:"fork",usage:"/fork",description:"从当前上下文分叉一个新对话",keywords:["分叉","branch"]},{name:"compact",usage:"/compact",description:"压缩当前对话上下文",keywords:["压缩","上下文"]},{name:"archive",usage:"/archive",description:"归档当前对话并新建对话",keywords:["归档","关闭"]},{name:"status",usage:"/status",description:"显示当前连接、thread、模型与 token 状态",keywords:["状态","连接","token"]},{name:"clear",usage:"/clear",description:"清空当前视图并开始新对话",keywords:["清空","重置"]},{name:"help",usage:"/help",description:"显示 Sandbox 支持的快捷命令",keywords:["帮助","命令"]}];function YOe(e){var n;const t=e.trim().match(/^\/([^\s]+)(?:\s+([\s\S]*))?$/);if(t)return{name:t[1].toLocaleLowerCase(),argument:((n=t[2])==null?void 0:n.trim())??""}}function WOe(e){const t=e.toLocaleLowerCase();return kE.filter(n=>!t||[n.name,n.description,...n.keywords].some(s=>s.toLocaleLowerCase().includes(t))).sort((n,s)=>HD(n,t)-HD(s,t)).slice(0,12)}function HD(e,t){return t?e.name===t?0:e.name.startsWith(t)?1:e.name.includes(t)?2:3:kE.indexOf(e)}function XOe(e,t){const n=t.toLocaleLowerCase();return e.filter(s=>!n||`${s.id} ${s.displayName} ${s.description}`.toLocaleLowerCase().includes(n)).sort((s,i)=>{if(!n)return Number(i.isDefault)-Number(s.isDefault);const r=s.id.toLocaleLowerCase(),a=i.id.toLocaleLowerCase(),l=(c,u)=>c===n?0:c.startsWith(n)?1:u.toLocaleLowerCase().startsWith(n)?2:3;return l(r,s.displayName)-l(a,i.displayName)}).slice(0,12)}function QOe(){return kE.map(e=>({label:e.usage,value:e.description}))}function ZOe(e,t){return e.map(n=>{const s=n.displayName.trim(),i=s&&s!==n.id?`${s} · ${n.id}`:n.id;return{label:n.id===t?"当前模型":"可用模型",value:n.description?`${i} — ${n.description}`:i,code:!1}})}function JOe(e){const t=[{label:"Thread",value:e.threadId,code:!0},{label:"工作空间",value:e.cwd||"未设置",code:!!e.cwd}];return e.model&&t.push({label:"模型",value:e.model,code:!0}),t.push({label:"状态",value:e.busy?"运行中":"空闲"}),e.threadTotal&&t.push({label:"累计 Token",value:e.threadTotal.totalTokens.toLocaleString()}),e.modelContextWindow!==void 0&&t.push({label:"上下文窗口",value:e.modelContextWindow.toLocaleString()}),t}function eMe(e){return e.messages.map(t=>{var s;const n=[];return t.role==="user"&&((s=t.skillNames)!=null&&s.length)&&n.push({kind:"invocation",value:{skills:t.skillNames.map(i=>({name:i,description:""}))}}),t.content&&n.push({kind:"text",text:t.content}),{role:t.role,blocks:n,meta:{localId:t.id,ts:t.timestamp/1e3}}})}function tMe({appName:e,value:t,onChange:n,onSubmit:s,disabled:i,busy:r,attachments:a,onAddFiles:l,onRemoveAttachment:c,actions:u,models:d,modelsLoading:f,modelsLoaded:h,currentModel:m,onRequestModels:p,skills:b,skillsLoading:v,skillsLoaded:y,selectedSkills:x,onRequestSkills:E,onSelectedSkillsChange:w}){const S=g.useRef(null),_=g.useRef(null),k=g.useRef(null),T=g.useRef(null),[A,j]=g.useState(!1),[R,B]=g.useState(0),[z,L]=g.useState(!1);g.useLayoutEffect(()=>{const V=S.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,200)}px`)},[t]);const F=g.useMemo(()=>{if(!t.startsWith("/")||t.includes(` -`))return;const V=t.slice(1),X=V.search(/\s/),K=(X<0?V:V.slice(0,X)).toLocaleLowerCase(),ce=X<0?"":V.slice(X).trim();if(!(X>=0&&K!=="model"))return{command:K,argument:ce,modelMode:X>=0}},[t]),C=g.useMemo(()=>{const V=/(^|\s)\$([^\s$]*)$/.exec(t);if(V)return{query:V[2],start:t.length-V[2].length-1,end:t.length}},[t]),I=g.useMemo(()=>{if(C){const V=C.query.toLocaleLowerCase();return b.filter(X=>!x.some(K=>K.id===X.id||K.name===X.name)).filter(X=>`${X.name} ${X.description}`.toLocaleLowerCase().includes(V)).slice(0,12).map(X=>({kind:"skill",skill:X}))}return F!=null&&F.modelMode?XOe(d,F.argument).map(V=>({kind:"model",model:V})):F?WOe(F.command).map(V=>({kind:"command",command:V})):[]},[C,d,x,b,F]),D=!z&&!!(C||F);g.useEffect(()=>{B(0)},[t]),g.useEffect(()=>{F!=null&&F.modelMode&&!h&&!f&&p()},[h,f,p,F==null?void 0:F.modelMode]),g.useEffect(()=>{C&&!y&&!v&&E()},[C,E,y,v]);const $=a.some(V=>V.status!=="ready"),O=!i&&!r&&!$&&(t.trim().length>0||a.length>0);function te(V){L(!1),j(!1),n(V)}function ne(V){if(V.kind==="skill"){if(!C)return;const X=t.slice(0,C.start)+t.slice(C.end);w([...x,V.skill]),te(X),L(!0),requestAnimationFrame(()=>{var K,ce;(K=S.current)==null||K.focus(),(ce=S.current)==null||ce.setSelectionRange(C.start,C.start)});return}if(V.kind==="model"){te(`/model ${V.model.id}`),L(!0),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()});return}if(V.command.name==="model"){te("/model "),p(),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()});return}if(V.command.name==="skill"||V.command.name==="skills"){te(`/${V.command.name}`),L(!0),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()});return}te(`/${V.command.name}`),L(!0),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()})}function P(V){var X;j(!1),(X=V.current)==null||X.click()}function Q(V){const X=V.target.files?Array.from(V.target.files):[];X.length&&l(X),V.target.value=""}const ee=C?"可用 Skills":F!=null&&F.modelMode?"选择模型":"Codex 快捷命令";return o.jsxs("div",{className:"composer sandbox-codex-composer",children:[a.length>0?o.jsx(aE,{appName:e,compact:!0,items:a,onRemove:c}):null,o.jsxs("div",{className:"composer-box",children:[D?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":ee,children:[o.jsxs("div",{className:"composer-command-head",children:[o.jsx(IOe,{}),o.jsx("span",{children:ee}),F!=null&&F.modelMode&&m?o.jsxs("small",{children:["当前:",m]}):null,o.jsx("kbd",{children:C?"$":"/"})]}),C&&v?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(Yo,{className:"spin"})," 正在发现当前工作区的 Skills…"]}):F!=null&&F.modelMode&&f?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(Yo,{className:"spin"})," 正在读取模型…"]}):I.length===0?o.jsx("div",{className:"composer-command-empty",children:C?"当前工作区没有匹配的 Skill":F!=null&&F.modelMode?"没有匹配模型,也可以直接输入模型 ID":"没有匹配的快捷命令"}):o.jsx("div",{className:"composer-command-list",children:I.map((V,X)=>{const K=V.kind==="command"?`command:${V.command.name}`:V.kind==="model"?`model:${V.model.id}`:`skill:${V.skill.id}`,ce=V.kind==="command"?V.command.usage:V.kind==="model"?V.model.displayName:`$${V.skill.name}`,he=V.kind==="command"?V.command.description:V.kind==="model"?V.model.description||V.model.id:V.skill.description||"加载并执行该 Skill";return o.jsxs("button",{type:"button",role:"option","aria-selected":X===R,className:`composer-command-item${X===R?" is-active":""}`,onMouseDown:ye=>{ye.preventDefault(),ne(V)},onMouseEnter:()=>B(X),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${V.kind}`,"aria-hidden":"true",children:V.kind==="command"?"/":V.kind==="model"?"◇":"$"}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsx("strong",{children:ce}),o.jsx("span",{children:he})]}),X===R?o.jsx("kbd",{children:"↵"}):null]},K)})})]}):null,o.jsxs("div",{className:"composer-left-controls",children:[o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:i,onClick:()=>j(V=>!V),children:o.jsx(NOe,{className:"icon"})}),A?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>j(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",disabled:u.uploadBusy,onClick:()=>P(_),children:[o.jsx(kOe,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:u.uploadBusy,onClick:()=>P(k),children:[o.jsx(AOe,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:u.uploadBusy,onClick:()=>P(T),children:[o.jsx(COe,{className:"icon"}),"上传视频"]}),o.jsx("div",{className:"composer-menu-separator",role:"separator"}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{j(!1),u.onOpenTerminal()},children:[o.jsx(SG,{className:"icon"}),"进入终端"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{j(!1),u.onOpenBrowser()},children:[o.jsx(NG,{className:"icon"}),"查看浏览器"]})]})]}):null]}),o.jsx("button",{type:"button",className:"comp-icon sandbox-composer-control",title:"Codex 权限","aria-label":"Codex 权限",disabled:u.settingsBusy||r,onClick:u.onOpenPermissions,children:o.jsx(hC,{})}),o.jsx("button",{type:"button",className:`comp-icon sandbox-composer-control${u.workspaceLocked?" is-locked":""}`,title:u.workspaceLocked?"对话已开始,工作空间已锁定":"选择工作空间","aria-label":"Codex 工作空间",disabled:u.settingsBusy||r,onClick:u.onOpenWorkspace,children:o.jsx(py,{})})]}),o.jsxs("div",{className:"composer-input-stack sandbox-composer-input",children:[x.length>0?o.jsx(rE,{skillPrefix:"$",value:{skills:x.map(({name:V,description:X})=>({name:V,description:X}))},onRemoveSkill:V=>w(x.filter(X=>X.name!==V))}):null,o.jsx("textarea",{ref:S,className:"comp-input scroll",rows:1,value:t,disabled:i,placeholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…","aria-expanded":D,onChange:V=>te(V.target.value),onBlur:()=>window.setTimeout(()=>L(!0),0),onKeyDown:V=>{if(!AA(V.nativeEvent)){if(D){if((V.key==="ArrowDown"||V.key==="Tab"&&!V.shiftKey)&&I.length>0){V.preventDefault(),B(X=>(X+1)%I.length);return}if((V.key==="ArrowUp"||V.key==="Tab"&&V.shiftKey)&&I.length>0){V.preventDefault(),B(X=>(X-1+I.length)%I.length);return}if(V.key==="Enter"&&!V.shiftKey&&I[R]){V.preventDefault(),ne(I[R]);return}if(V.key==="Escape"){V.preventDefault(),L(!0);return}}if(V.key==="Backspace"&&!t&&V.currentTarget.selectionStart===0&&x.length>0){V.preventDefault(),w(x.slice(0,-1));return}V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),O&&s(t))}}})]}),o.jsx("button",{type:"button",className:"comp-send",disabled:!O,onClick:()=>s(t),"aria-label":"发送",children:r?o.jsx(Yo,{className:"icon spin"}):o.jsx(TOe,{className:"icon"})})]}),o.jsx("input",{ref:_,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:Q}),o.jsx("input",{ref:k,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:Q}),o.jsx("input",{ref:T,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:Q})]})}function nMe({session:e,conversationBusy:t,onInputChange:n,onSessionPatch:s,onSnapshot:i,onActivity:r,onError:a}){const l=g.useRef((e==null?void 0:e.id)??"");l.current=(e==null?void 0:e.id)??"";const[c,u]=g.useState(!1),[d,f]=g.useState([]),[h,m]=g.useState(!1),[p,b]=g.useState(!1),[v,y]=g.useState([]),[x,E]=g.useState(!1),[w,S]=g.useState(!1),[_,k]=g.useState([]),[T,A]=g.useState(!1),[j,R]=g.useState([]),[B,z]=g.useState(!1),[L,F]=g.useState("");g.useEffect(()=>{u(!1),f([]),m(!1),b(!1),y([]),E(!1),S(!1),k([]),A(!1),R([]),z(!1),F("")},[e==null?void 0:e.id]);const C=g.useCallback(async()=>{const P=l.current;if(!P)return[];m(!0);try{const Q=await cn.listModels(P);return l.current===P&&(f(Q),b(!0)),Q}catch(Q){return l.current===P&&(b(!0),a(Q instanceof Error?Q.message:String(Q))),[]}finally{l.current===P&&m(!1)}},[a]),I=g.useCallback(async()=>{const P=l.current;if(!P)return[];E(!0);try{const Q=await cn.listSkills(P);return l.current===P&&(y(Q),S(!0)),Q}catch(Q){return l.current===P&&(S(!0),a(Q instanceof Error?Q.message:String(Q))),[]}finally{l.current===P&&E(!1)}},[a]),D=g.useCallback(async()=>{const P=l.current;if(P){A(!0),z(!0),F("");try{const Q=await cn.listThreads(P);l.current===P&&R(Q.threads)}catch(Q){l.current===P&&F(Q instanceof Error?Q.message:String(Q))}finally{l.current===P&&z(!1)}}},[]);function $(P){i(P),k([]),y([]),S(!1),A(!1)}async function O(P){const Q=l.current;if(!(!Q||c||t)){if(P===(e==null?void 0:e.threadId)){A(!1);return}u(!0),a("");try{const ee=await cn.resumeThread(Q,P);if(l.current!==Q)return;$(ee),r("已恢复 Codex 对话",[{label:"Thread",value:ee.threadId,code:!0}])}catch(ee){l.current===Q&&a(ee instanceof Error?ee.message:String(ee))}finally{l.current===Q&&u(!1)}}}async function te(P){const Q=e,ee=P.trim();if(!ee.startsWith("/"))return!1;if(!Q||t||c)return!0;const V=YOe(ee),X=V&&kE.find(K=>K.name===V.name);if(!V||!X)return a(`未知快捷命令:${ee.split(/\s/,1)[0]}。输入 /help 查看可用命令。`),!0;if(a(""),k([]),X.name==="model"&&!V.argument)return n("/model "),p||await C(),!0;if(X.name==="skill"||X.name==="skills")return n("$"),w||(await I()).length===0&&n(""),!0;if(X.name==="resume"&&!V.argument)return n(""),await D(),!0;n(""),u(!0);try{if(X.name==="model"){const K=await cn.setModel(Q.id,V.argument);if(l.current!==Q.id)return!0;s({model:K}),r("已切换 Codex 模型",[{label:"模型",value:K,code:!0}])}else if(X.name==="models"){const K=p?d:await C();if(l.current!==Q.id)return!0;r(K.length>0?"Codex 可用模型":"当前没有可用模型",ZOe(K,Q.model))}else if(X.name==="new"||X.name==="clear"){const K=await cn.newThread(Q.id);if(l.current!==Q.id)return!0;$(K),r("已新建 Codex 对话",[{label:"Thread",value:K.threadId,code:!0}])}else if(X.name==="resume"){const K=await cn.resumeThread(Q.id,V.argument);if(l.current!==Q.id)return!0;$(K),r("已恢复 Codex 对话",[{label:"Thread",value:K.threadId,code:!0}])}else if(X.name==="fork"){const K=await cn.forkThread(Q.id);if(l.current!==Q.id)return!0;$(K),r("已分叉 Codex 对话",[{label:"Thread",value:K.threadId,code:!0}])}else if(X.name==="compact"){if(await cn.compactThread(Q.id),l.current!==Q.id)return!0;r("已开始压缩当前 Codex 对话",[{label:"Thread",value:Q.threadId,code:!0}])}else if(X.name==="archive"){const K=Q.threadId,ce=await cn.archiveThread(Q.id,K);if(l.current!==Q.id)return!0;ce.snapshot&&$(ce.snapshot),r("已归档 Codex 对话",[{label:"Thread",value:K,code:!0}])}else if(X.name==="status"){const K=await cn.getStatus(Q.id);if(l.current!==Q.id)return!0;s(K),r("Codex 当前状态",JOe(K))}else X.name==="help"&&r("Sandbox 支持的 Codex 快捷命令",QOe())}catch(K){l.current===Q.id&&(n(ee),a(K instanceof Error?K.message:String(K)))}finally{l.current===Q.id&&u(!1)}return!0}function ne(){y([]),S(!1),k([])}return{commandBusy:c,models:d,modelsLoading:h,modelsLoaded:p,loadModels:C,skills:v,skillsLoading:x,skillsLoaded:w,loadSkills:I,selectedSkills:_,setSelectedSkills:k,invalidateSkills:ne,threadsOpen:T,threads:j,threadsLoading:B,threadsError:L,openThreads:D,closeThreads:()=>{c||(A(!1),F(""))},resumeThread:O,executeSlash:te}}const sMe={volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},iMe={volcengine:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",byteplus:"https://docs.byteplus.com/en/docs/legal"};function rMe(e){return e.toLowerCase()==="github"?o.jsx($ee,{className:"icon"}):o.jsx(Kee,{className:"icon"})}function aMe({branding:e,cloudProvider:t,onUsername:n}){const[s,i]=g.useState(null),[r,a]=g.useState(""),[l,c]=g.useState(0),[u,d]=g.useState(""),f=g.useRef(null);g.useEffect(()=>{let v=!0;return i(null),a(""),GB().then(y=>{v&&i(y)}).catch(y=>{v&&a(y instanceof Error?y.message:String(y))}),()=>{v=!1}},[l]);const h=s!==null&&s.length===0;g.useEffect(()=>{var v;h&&((v=f.current)==null||v.focus())},[h]);const m=gte.test(u),p=t==="byteplus"?p2:m2,b=()=>{m&&n(u)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||p,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(Ra,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),r?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:r}),o.jsx("button",{type:"button",onClick:()=>c(v=>v+1),children:"重试"})]}):s===null?null:s.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:s.map(v=>o.jsxs("button",{className:"login-btn",onClick:()=>yte(v.loginUrl),children:[rMe(v.id),o.jsxs("span",{children:["使用 ",v.label," 登录"]})]},v.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:v=>{v.preventDefault(),b()},children:[o.jsx("input",{ref:f,className:"login-name-input",value:u,onChange:v=>d(v.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!m,"aria-label":"进入",children:o.jsx(Wm,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:u&&!m?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:sMe[t]}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:iMe[t],target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function oMe({open:e,checking:t,error:n,onLogin:s}){const i=g.useRef(null);return g.useEffect(()=>{var a;if(!e)return;const r=document.body.style.overflow;return document.body.style.overflow="hidden",(a=i.current)==null||a.focus(),()=>{document.body.style.overflow=r}},[e]),e?yi.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(Gk,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:i,type:"button",onClick:s,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}const lMe=[{value:"slow",label:"执行速度慢"},{value:"crash",label:"运行崩溃"},{value:"incorrect",label:"结果不准确"},{value:"tool_error",label:"工具调用失败"},{value:"other",label:"其他问题"}];function cMe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function uMe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function dMe({onClose:e,onSubmit:t}){const n=g.useId(),s=g.useId(),i=g.useRef(null),r=g.useRef(null),a=g.useRef(!1),l=g.useRef(e),[c,u]=g.useState(()=>new Set),[d,f]=g.useState(""),[h,m]=g.useState(!1),[p,b]=g.useState(""),[v,y]=g.useState(!1);a.current=h,l.current=e,g.useEffect(()=>{var T;const S=document.body.style.overflow,_=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(T=r.current)==null||T.focus();const k=A=>{var z;if(A.key==="Escape"&&!a.current){A.preventDefault(),l.current();return}if(A.key!=="Tab")return;const j=Array.from(((z=i.current)==null?void 0:z.querySelectorAll("button:not(:disabled), textarea:not(:disabled)"))??[]);if(j.length===0)return;const R=j[0],B=j[j.length-1];A.shiftKey&&document.activeElement===R?(A.preventDefault(),B.focus()):!A.shiftKey&&document.activeElement===B&&(A.preventDefault(),R.focus())};return window.addEventListener("keydown",k),()=>{document.body.style.overflow=S,window.removeEventListener("keydown",k),_!=null&&_.isConnected&&_.focus()}},[]);const x=S=>{u(_=>{const k=new Set(_);return k.has(S)?k.delete(S):k.add(S),k})},E=async()=>{if(!(h||v)){m(!0),b("");try{await t({issues:[...c],description:d.trim()}),y(!0)}catch(S){b(S instanceof Error?S.message:String(S))}finally{m(!1)}}},w=c.size>0||d.trim().length>0;return yi.createPortal(o.jsx("div",{className:"issue-feedback-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!h&&e()},children:o.jsxs("section",{ref:i,className:"issue-feedback-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,"aria-describedby":v?`${s}-success`:s,"aria-busy":h||void 0,children:[o.jsxs("header",{className:"issue-feedback-head",children:[o.jsx("h2",{id:n,children:"问题反馈"}),o.jsx("button",{type:"button",className:"issue-feedback-close",onClick:e,disabled:h,"aria-label":"关闭问题反馈",children:o.jsx(cMe,{})})]}),v?o.jsxs("div",{className:"issue-feedback-success",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"issue-feedback-success-mark","aria-hidden":"true",children:o.jsx(uMe,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:"上报成功,感谢您的反馈"}),o.jsx("p",{id:`${s}-success`,children:"AgentKit 团队会尽快查看您提交的问题。"})]})]}):o.jsxs("div",{className:"issue-feedback-body",children:[o.jsx("p",{id:s,className:"issue-feedback-intro",children:"请选择遇到的问题,也可以补充具体表现。"}),o.jsx("p",{className:"issue-feedback-privacy",role:"alert",children:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。"}),o.jsx("div",{className:"issue-feedback-chips","aria-label":"常见问题",children:lMe.map(S=>o.jsx("button",{type:"button",className:"issue-feedback-chip","aria-pressed":c.has(S.value),onClick:()=>x(S.value),disabled:h,children:S.label},S.value))}),o.jsxs("label",{className:"issue-feedback-field",children:[o.jsx("span",{children:"问题描述"}),o.jsx("textarea",{ref:r,value:d,onChange:S=>f(S.target.value),placeholder:"请描述问题发生时的表现(选填)",maxLength:4e3,rows:5,disabled:h})]}),p&&o.jsx("p",{className:"issue-feedback-error",role:"alert",children:p})]}),o.jsx("footer",{className:"issue-feedback-actions",children:v?o.jsx("button",{type:"button",className:"is-primary",onClick:e,children:"完成"}):o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:e,disabled:h,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:()=>void E(),disabled:!w||h,children:h?"正在上报…":"提交反馈"})]})})]})}),document.body)}const fMe=[{value:"conversation",label:"对话"},{value:"agents",label:"智能体"},{value:"applications",label:"自动化"},{value:"search",label:"搜索"},{value:"other",label:"其他"}],hMe=[{value:"page_slow",label:"页面加载慢"},{value:"feature_unavailable",label:"功能无法使用"},{value:"display_error",label:"页面显示异常"},{value:"no_response",label:"操作无响应"},{value:"other",label:"其他问题"}],mMe=["点击后没有反应","页面一直处于加载状态","部分内容显示不完整","操作后出现错误提示"];function pMe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function gMe({initialModule:e,onSubmit:t}){const n=g.useRef(null),[s,i]=g.useState(()=>new Set),[r,a]=g.useState(e),[l,c]=g.useState(""),[u,d]=g.useState(!1),[f,h]=g.useState(""),[m,p]=g.useState(!1),b=E=>{i(w=>{const S=new Set(w);return S.has(E)?S.delete(E):S.add(E),S})},v=E=>{var w;c(S=>S.trim()?S.includes(E)?S:`${S.trimEnd()} -${E}`:E),(w=n.current)==null||w.focus()},y=async E=>{if(E.preventDefault(),!(u||m)){d(!0),h("");try{await t({module:r,issues:[...s],description:l.trim()}),p(!0)}catch(w){h(w instanceof Error?w.message:String(w))}finally{d(!1)}}},x=s.size>0||l.trim().length>0;return o.jsxs("div",{className:"platform-feedback-page",children:[o.jsxs("header",{className:"platform-feedback-header",children:[o.jsx("h1",{children:"问题反馈"}),o.jsx("p",{children:"告诉我们您在使用 AgentKit Studio 时遇到的问题。"})]}),o.jsx("div",{className:"platform-feedback-scroll",children:m?o.jsxs("section",{className:"platform-feedback-success","aria-labelledby":"feedback-success-title","aria-live":"polite",role:"status",children:[o.jsx("span",{className:"platform-feedback-success-icon","aria-hidden":"true",children:o.jsx(pMe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"feedback-success-title",children:"上报成功,感谢您的反馈"}),o.jsx("p",{children:"AgentKit 团队会尽快查看您提交的问题。"})]})]}):o.jsxs("form",{className:"platform-feedback-form",onSubmit:E=>void y(E),children:[o.jsxs("section",{className:"platform-feedback-section",children:[o.jsx("div",{className:"platform-feedback-section-heading",children:o.jsx("h2",{children:"所属模块"})}),o.jsx("div",{className:"platform-feedback-pills","aria-label":"所属模块",children:fMe.map(E=>o.jsx("button",{type:"button","aria-pressed":r===E.value,onClick:()=>a(E.value),disabled:u,children:E.label},E.value))})]}),o.jsx("section",{className:"platform-feedback-section",children:o.jsxs("div",{className:"platform-feedback-suggestions",children:[o.jsx("span",{children:"常见问题(可多选)"}),o.jsx("div",{className:"platform-feedback-pills","aria-label":"问题类型",children:hMe.map(E=>o.jsx("button",{type:"button","aria-pressed":s.has(E.value),onClick:()=>b(E.value),disabled:u,children:E.label},E.value))})]})}),o.jsxs("section",{className:"platform-feedback-section",children:[o.jsxs("label",{className:"platform-feedback-field",children:[o.jsx("span",{children:"问题描述"}),o.jsx("textarea",{ref:n,value:l,onChange:E=>c(E.target.value),placeholder:"请描述问题发生时的页面、操作和表现",maxLength:4e3,rows:6,disabled:u})]}),o.jsxs("div",{className:"platform-feedback-suggestions",children:[o.jsx("span",{children:"快捷补充"}),o.jsx("div",{className:"platform-feedback-pills","aria-label":"问题描述推荐",children:mMe.map(E=>o.jsx("button",{type:"button",onClick:()=>v(E),disabled:u,children:E},E))})]})]}),o.jsx("p",{className:"platform-feedback-privacy",role:"alert",children:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"}),f&&o.jsx("p",{className:"platform-feedback-error",role:"alert",children:f}),o.jsx("div",{className:"platform-feedback-actions",children:o.jsx("button",{type:"submit",disabled:!x||u,children:u?"正在上报…":"提交反馈"})})]})})]})}function bMe({node:e,ctx:t}){const n=e.variant??"default";return o.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}Du("Button",bMe);function yMe({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Du("Card",yMe);const xMe={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},EMe={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function TG(e){return xMe[e]??"flex-start"}function kG(e){return EMe[e]??"stretch"}function vMe({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:TG(e.justify),alignItems:kG(e.align)},children:n.map(s=>t.render(s))})}Du("Column",vMe);function wMe({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Du("Divider",wMe);const _Me={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function SMe({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:_Me[t]??"•"})}Du("Icon",SMe);function NMe({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:TG(e.justify),alignItems:kG(e.align??"center")},children:n.map(s=>t.render(s))})}Du("Row",NMe);const TMe=new Set(["h1","h2","h3","h4","h5"]);function kMe({node:e,ctx:t}){const n=e.variant??"body",s=t.resolveString(e.text),i=TMe.has(n)?n:"p";return o.jsx(i,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:s})}Du("Text",kMe);function AMe(e){return e==="agents"?"agents":e==="applications"?"applications":e==="search"?"search":["conversation","new-chat","sandbox"].includes(e)?"conversation":"other"}async function p_(e){const[t,n,s]=await Promise.allSettled([bOe(),yOe(),u2(e)]);return{agentId:e,ready:!0,harnessEnabled:s.status==="fulfilled",builtinTools:s.status==="fulfilled"?s.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const Ea={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},CMe=600,IMe=1e3,jMe=5e3,RMe=500,OMe=new Set,MMe=[];function xa(){return{skills:[]}}function g_(e){return`${SE(e)}.active`}function lT(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function LMe(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(lT(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function cT(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const s=cT(n,t);if(s)return s}}function AG(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...AG(n)));return t}function zD(){const e=typeof localStorage<"u"?localStorage.getItem(Ea.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function DMe({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3.75",y:"3.75",width:"16.5",height:"16.5",rx:"3.25"}),o.jsx("path",{d:"M12 8.5v7M8.5 12h7"}),o.jsx("path",{d:"M6.75 6.75h1M16.25 17.25h1",opacity:"0.6"})]})}function PMe({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3.5",y:"5",width:"17",height:"14.75",rx:"2.25"}),o.jsx("path",{d:"M3.5 9h17M9.25 12.25 7.1 14.4l2.15 2.15M14.75 12.25l2.15 2.15-2.15 2.15M12.8 11.85l-1.6 5.1"})]})}function BMe({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"2.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),o.jsx("path",{d:"M5.25 8.5h1.5M5.25 11.5h1.5"}),o.jsx("rect",{x:"14.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),o.jsx("path",{d:"M17.25 15.5h1.5M17.25 12.5h1.5M8.75 12h6.5m-2.5-2.5 2.5 2.5-2.5 2.5"})]})}function UMe(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function uT(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function FMe(e){if(!e)return"";const t=[];return e.ts&&t.push(uT(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function Uc(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}function VD(e,t){for(let n=t-1;n>=0;n-=1)if(e[n].role==="user")return Uc(e[n]);return""}const $Me="send_a2ui_json_to_client";function HMe(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===$Me&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?PH(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function zMe(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function VMe(e){return new Promise((t,n)=>{let s="";try{s=new URL(e,window.location.href).protocol}catch{}if(s!=="http:"&&s!=="https:"){n(new Error("授权链接不是 http/https 地址,已阻止打开。"));return}const i=window.open(e,"veadk_oauth","width=520,height=720");if(!i){n(new Error("弹窗被拦截,请允许弹窗后重试。"));return}let r=!1;const a=()=>{clearInterval(u),window.removeEventListener("message",c)},l=d=>{if(!r){r=!0,a();try{i.close()}catch{}t(d)}},c=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&l(f.url)};window.addEventListener("message",c);const u=setInterval(()=>{if(!r){if(i.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(r=!0,t(d.trim())):n(new Error("授权已取消。"));return}try{const d=i.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&l(d)}catch{}}},500)})}function GMe(e,t){const n=JSON.parse(JSON.stringify(e??{})),s=n.exchangedAuthCredential??n.exchanged_auth_credential??{},i=s.oauth2??{};return i.authResponseUri=t,i.auth_response_uri=t,s.oauth2=i,n.exchangedAuthCredential=s,n}function GD({text:e}){const[t,n]=g.useState(!1);return o.jsx("button",{className:"icon-btn",title:t?"已复制":"复制",disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?o.jsx(Pa,{className:"icon"}):o.jsx(gx,{className:"icon"})})}const KD=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],qD=()=>KD[Math.floor(Math.random()*KD.length)];function b_(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function YD(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function WD(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}const KMe={"read-only":"只读","workspace-write":"工作区写入","danger-full-access":"完全访问"},qMe={untrusted:"仅不可信命令","on-request":"按需审批",never:"不审批"},YMe={user:"由我审批",auto_review:"自动审查"};function WMe(e,t){const n=e.kind==="file"?"文件修改":"命令执行";return t==="accept"?`已允许本次${n}`:t==="acceptForSession"?`已在本会话中允许${n}`:t==="decline"?`已拒绝${n}`:`已取消${n}审批`}function XMe(e){var n,s,i;const t=[];return(n=e.command)!=null&&n.trim()&&t.push({label:"命令",value:e.command.trim(),code:!0}),(s=e.grantRoot)!=null&&s.trim()&&t.push({label:"授权路径",value:e.grantRoot.trim(),code:!0}),(i=e.cwd)!=null&&i.trim()&&t.push({label:"执行目录",value:e.cwd.trim(),code:!0}),t}function XD(e){return e.flatMap(t=>t.apps.map(n=>ao(t.id,n)))}function QMe(e,t){var n;return((n=e.find(s=>s.runtimeId&&s.apps.some(i=>ao(s.id,i)===t)))==null?void 0:n.runtimeId)??""}function ZMe(e,t){for(const n of e){const s=n.apps.find(i=>ao(n.id,i)===t);if(s&&n.runtimeId)return{runtimeId:n.runtimeId,region:n.region??"cn-beijing",appName:s}}return null}function JMe(){const[e,t]=g.useState([]),[n,s]=g.useState(""),[i,r]=g.useState([]),[a,l]=g.useState(""),c=g.useRef(null),[u,d]=g.useState(!1),[f,h]=g.useState([]),[m,p]=g.useState(null),[b,v]=g.useState([]),[y,x]=g.useState(!1),[E,w]=g.useState(!1),[S,_]=g.useState(""),[k,T]=g.useState(!1),[A,j]=g.useState(!1),[R,B]=g.useState(null),[z,L]=g.useState(null),[F,C]=g.useState(!1),[I,D]=g.useState(""),[$,O]=g.useState(null),[te,ne]=g.useState(!1),[P,Q]=g.useState(""),[ee,V]=g.useState(!1),[X,K]=g.useState(!1),[ce,he]=g.useState("confirm"),[ye,ue]=g.useState(""),[we,De]=g.useState("codex"),[Se,ae]=g.useState(!1),[pe,_e]=g.useState(0),[et,Be]=g.useState(null),[Fe,We]=g.useState(null),Ae=g.useRef(null),Ke=g.useRef(null),Ue=g.useRef((m==null?void 0:m.id)??""),W=g.useRef(""),oe=g.useRef(0),Z=g.useRef(new Set);Ue.current=(m==null?void 0:m.id)??"",g.useEffect(()=>()=>{for(const M of Z.current)URL.revokeObjectURL(M);Z.current.clear()},[]);function Ee(M){const U=URL.createObjectURL(M);return Z.current.add(U),U}function Oe(M){!M||!Z.current.delete(M)||URL.revokeObjectURL(M)}function at(){for(const M of Z.current)URL.revokeObjectURL(M);Z.current.clear()}const[Lt,ct]=g.useState({}),yn=a?Lt[a]??[]:f,Et=m?b:yn,vt=(M,U)=>ct(Y=>({...Y,[M]:typeof U=="function"?U(Y[M]??[]):U}));function xn(M,U,Y=[],ie=""){if(Ue.current!==M)return;const xe=crypto.randomUUID(),ke={role:"system",blocks:[],activity:{id:xe,title:U,...Y.length>0?{details:Y}:{}},meta:{localId:xe,ts:Date.now()/1e3}};v(Ve=>{if(!ie)return[...Ve,ke];const tt=Ve.findIndex(Qe=>{var lt;return((lt=Qe.meta)==null?void 0:lt.localId)===ie});return tt<0?[...Ve,ke]:[...Ve.slice(0,tt),ke,...Ve.slice(tt)]})}const[Vt,Ft]=g.useState(""),[it,dt]=g.useState("agent"),[He,St]=g.useState(null),[ge,$e]=g.useState({}),nt=g.useRef(new Map),$t=!n||ge.ready===!0&&ge.agentId===n,[qn,nn]=g.useState(null),[qt,mn]=g.useState(!1),wt=g.useRef(0),[Bt,Tt]=g.useState([]),[En,vn]=g.useState(xa),[Ht,os]=g.useState(null),[Os,Ms]=g.useState(0),[wn,ls]=g.useState(!1),[Yn,Wn]=g.useState(null),[ri,ps]=g.useState(!1),[Ls,Ln]=g.useState([]),[Ds,Cn]=g.useState(!1),Ss=g.useRef(new Set),[Ps,cs]=g.useState(()=>new Set),[gs,Dn]=g.useState(()=>new Set),[pn,on]=g.useState(()=>new Set),Yt=g.useRef(new Map),_n=g.useRef(new Map),de=g.useRef(void 0),Ie=g.useRef(()=>{}),Me=(M,U)=>cs(Y=>{const ie=new Set(Y);return U?ie.add(M):ie.delete(M),ie}),Xe=M=>{const U=_n.current.get(M);U!==void 0&&window.clearTimeout(U),_n.current.delete(M),Dn(Y=>new Set(Y).add(M))},ot=M=>{const U=_n.current.get(M);U!==void 0&&window.clearTimeout(U);const Y=window.setTimeout(()=>{_n.current.delete(M),Dn(ie=>{const xe=new Set(ie);return xe.delete(M),xe})},2400);_n.current.set(M,Y)},mt=(M,U)=>{on(Y=>{if(Y.has(M)===U)return Y;const ie=new Set(Y);return ie.delete(M),ie})},bt=g.useRef(""),[$n,Le]=g.useState(""),[bs,ys]=g.useState(""),[Ns,en]=g.useState(()=>new Set),[Ut,Oi]=g.useState(null),[gn,Ts]=g.useState(null),[Ha,ol]=g.useState(!1),[nr,Fu]=g.useState(),[xc,re]=g.useState(qD),[yt,Sn]=g.useState(null),[ks,sn]=g.useState(!1),[As,za]=g.useState(!1),[mo,Hn]=g.useState(""),Gi=g.useRef(!1),[se,Ne]=g.useState(null),[be,st]=g.useState(""),[un,Ct]=g.useState(),[ft,xs]=g.useState(null),Bs=(ft==null?void 0:ft.capabilities.runtimeScope)??"mine",[Us,Mi]=g.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[xi,fa]=g.useState("cloud"),[Xn,Pn]=g.useState(Lp),[Rt,po]=g.useState("volcengine"),[AE,e0]=g.useState(""),[$u,Ei]=g.useState(!1),[Ec,Th]=g.useState(!1),[t0,ll]=g.useState(!1),[CE,Hu]=g.useState({}),[n0,kh]=g.useState({}),[s0,Er]=g.useState({}),zu=Ps.has(a),go=gs.has(a),cl=zu||u,i0=!!a&&ri,ul=m?y:cl,IE=ul||!m&&go,Qn=nMe({session:m,conversationBusy:y,onInputChange:Ft,onSessionPatch:M=>{const U=Ue.current;p(Y=>(Y==null?void 0:Y.id)===U?{...Y,...M}:Y)},onSnapshot:M=>{const U=Ue.current;at(),v(eMe(M)),p(Y=>(Y==null?void 0:Y.id)===U?{...Y,threadId:M.threadId,cwd:M.cwd??Y.cwd,model:M.model??Y.model,workspaceLocked:M.workspaceLocked,permissions:M.permissions,busy:!1}:Y)},onActivity:(M,U=[])=>{const Y=Ue.current;Y&&xn(Y,M,U)},onError:Le}),jE=CE[a]??"",RE=n0[a]??OMe,OE=s0[a]??MMe,Li=Ht==null?void 0:Ht.graph,Ah=[Ht==null?void 0:Ht.name,Li==null?void 0:Li.name,Li==null?void 0:Li.id].filter(M=>!!M),Vu=En.targetAgent&&Li?cT(Li,En.targetAgent.name):Li,ME=(Vu==null?void 0:Vu.skills)??(En.targetAgent?[]:(Ht==null?void 0:Ht.skills)??[]),r0=Li?AG(Li):[];function Gu(M){b_(M);for(const U of M)U.status==="uploading"?Ss.current.add(U.id):U.uri&&Xb(n,U.uri).catch(Y=>Le(String(Y)))}function Ch(){wt.current+=1;const M=qn;nn(null),mn(!1),M&&!M.id.startsWith("pending-")&&nRe(M.id).catch(U=>{Le(U instanceof Error?U.message:String(U))})}async function Ih(M){try{await PS(n,be,M),await DS(n,be,M),r(U=>U.filter(Y=>Y.id!==M)),ct(U=>{const{[M]:Y,...ie}=U;return ie})}catch(U){Le(String(U))}}function LE(M){const U=Bt.find(xe=>xe.id===M);if(!U)return;const Y=Bt.filter(xe=>xe.id!==M);b_([U]),U.status==="uploading"&&Ss.current.add(M),Tt(Y),Y.length===0&&!Vt.trim()&&!!a&&Et.length===0?(bt.current="",l(""),Ih(a)):U.uri&&Xb(n,U.uri).catch(xe=>Le(String(xe)))}const a0=(M,U)=>{var ke,Ve,tt,Qe,lt;const Y=U.author&&U.author!=="user"?U.author:void 0;Y&&(Hu(Je=>({...Je,[M]:Y})),kh(Je=>({...Je,[M]:new Set(Je[M]??[]).add(Y)})),Er(Je=>{var qe;return(qe=Je[M])!=null&&qe.length?Je:{...Je,[M]:[Y]}}));const ie=((ke=U.actions)==null?void 0:ke.transferToAgent)??((Ve=U.actions)==null?void 0:Ve.transfer_to_agent);ie&&Er(Je=>{const qe=Je[M]??[];return qe[qe.length-1]===ie?Je:{...Je,[M]:[...qe,ie]}}),(((tt=U.actions)==null?void 0:tt.endOfAgent)??((Qe=U.actions)==null?void 0:Qe.end_of_agent)??((lt=U.actions)==null?void 0:lt.escalate))&&Er(Je=>{const qe=Je[M]??[];return qe.length<=1?Je:{...Je,[M]:qe.slice(0,-1)}})},[bo,zt]=g.useState(zD),[o0,l0]=g.useState([]),[DE,jh]=g.useState({}),Ku=g.useCallback(M=>{l0(U=>{const Y=U.findIndex(xe=>xe.id===M.id);if(Y===-1)return[M,...U];const ie=[...U];return ie[Y]={...ie[Y],...M},ie})},[]),[c0,u0]=g.useState(!0),[qu,ai]=g.useState(!1),[Rh,H]=g.useState(!1),[le,fe]=g.useState(!1),[Ce,Ge]=g.useState(null),[_t,zn]=g.useState("custom"),[dl,dn]=g.useState([]),vi=g.useRef([]),fl=g.useRef(null),Yu=g.useRef(null),[mC,d0]=g.useState([]),[Ys,$r]=g.useState(""),vr=g.useRef(null),[PE,wi]=g.useState(!1),[Wu,Nn]=g.useState(!1),[pC,BE]=g.useState(""),[CG,IG]=g.useState("good"),[jG,f0]=g.useState("basic"),[RG,OG]=g.useState("good"),[Oh,h0]=g.useState(""),[MG,LG]=g.useState(null),[hl,Es]=g.useState(!1),[vc,Hr]=g.useState(null),UE=g.useRef(null),[Va,Mh]=g.useState(()=>{const M=Na();return bh(M),M}),[DG,gC]=g.useState(!1),[PG,bC]=g.useState(""),[yC,m0]=g.useState(null),[BG,xC]=g.useState({}),[UG,EC]=g.useState(()=>new Set),[Xu,ha]=g.useState(null),[p0,g0]=g.useState(Ni(Rt)),[vC,Ki]=g.useState(""),[wC,Di]=g.useState(""),[Tn,sr]=g.useState(null),[FG,FE]=g.useState(!1),b0=g.useRef(!1),Qu=g.useRef(!1),Ga=g.useCallback(M=>{if(!be)return!1;try{CD(localStorage,be,M)}catch(U){return ys(U instanceof Error?U.message:"浏览器拒绝保存草稿,请稍后重试。"),!1}return vi.current=M,dn(M),ys(""),!0},[be]),Ka=g.useCallback(M=>{var U;M&&((U=fl.current)==null?void 0:U.id)!==M||(fl.current=null,Yu.current!==null&&(window.clearTimeout(Yu.current),Yu.current=null))},[]),Zu=g.useCallback(()=>{const M=fl.current;M&&(Ka(),Ga([M,...vi.current.filter(U=>U.id!==M.id)]))},[Ka,Ga]),$G=g.useCallback((M,U,Y)=>{!M||!be||(fl.current&&fl.current.id!==M&&Zu(),fl.current={id:M,draft:U,updatedAt:Date.now(),deploymentTarget:Y},Yu.current!==null&&window.clearTimeout(Yu.current),Yu.current=window.setTimeout(Zu,CMe))},[Zu,be]),$E=g.useCallback(M=>{!M||!be||(Ka(M),Ga(vi.current.filter(U=>U.id!==M)))},[Ka,Ga,be]),_C=g.useCallback(M=>{if(!be||M.length===0)return;const U=new Set(M.map(Y=>Y.id));fl.current&&U.has(fl.current.id)&&Ka(),Ga(vi.current.filter(Y=>!U.has(Y.id))),jh(Y=>Object.fromEntries(Object.entries(Y).filter(([ie])=>!U.has(ie)))),U.has(Ys)&&($r(""),Ge(null),ha(null),vr.current=null,localStorage.removeItem(g_(be)))},[Ka,Ga,Ys,be]),SC=g.useCallback(M=>{if(!M||!be)return;Ka(M);const U=vr.current,Y=vi.current.filter(ie=>ie.id!==M);Ga((U==null?void 0:U.id)===M?[U,...Y]:Y)},[Ka,Ga,be]);g.useEffect(()=>(window.addEventListener("pagehide",Zu),()=>{window.removeEventListener("pagehide",Zu)}),[Zu]),g.useEffect(()=>{if(!be){Ka(),vi.current=[],dn([]),d0([]),$r(""),ys(""),vr.current=null;return}let M=[],U="";try{M=Kje(localStorage,be),localStorage.getItem(SE(be))!==null&&CD(localStorage,be,M),U=localStorage.getItem(g_(be))||"",ys("")}catch(ie){ys(ie instanceof Error?ie.message:"无法读取本机草稿,请稍后重试。")}vi.current=M,dn(M),d0(LMe(be));const Y=M.find(ie=>ie.id===U);vr.current=Y??null,bo==="custom"&&Y&&($r(Y.id),Ge(Y.draft),ha(Y.deploymentTarget??null))},[Ka,be]),g.useEffect(()=>{if(!be)return;const M=g_(be);try{bo==="custom"&&Ys?localStorage.setItem(M,Ys):localStorage.removeItem(M)}catch{ys("浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。")}},[bo,Ys,be]);const HG=g.useCallback(M=>{if(!be)return;const U=[...new Set(M.filter(Boolean))];d0(U),localStorage.setItem(lT(be),JSON.stringify(U))},[be]),zG=g.useCallback(async M=>{const U=M.filter(Qe=>!!Qe.runtimeId&&Qe.canDelete===!0);if(U.length===0)return;const Y=QMe(Va,n),ie=new Set(U.map(Qe=>Qe.runtimeId));EC(Qe=>{const lt=new Set(Qe);for(const Je of ie)lt.add(Je);return lt}),hb(ie);const xe=new Set,ke=new Set,Ve=new Set,tt=[];for(const Qe of U)try{if(!Qe.region)throw new Error("Runtime 缺少地域信息,无法删除");await L8(Qe.runtimeId,Qe.region),R1(Qe.runtimeId),xe.add(Qe.runtimeId),ke.add(Qe.id)}catch(lt){const Je=lt instanceof Error?lt.message:String(lt);Ve.add(Qe.runtimeId),tt.push(`${Qe.label}: ${Je}`)}if(xe.size>0&&(hb(xe),Mh(Na()),m0(lt=>{if(!lt)return lt;const Je=new Set(lt);for(const qe of xe)Je.delete(qe);return Je}),xC(lt=>Object.fromEntries(Object.entries(lt).filter(([Je])=>!xe.has(Je)))),d0(lt=>{const Je=lt.filter(qe=>!ke.has(qe));return be&&localStorage.setItem(lT(be),JSON.stringify(Je)),Je}),Ga(vi.current.filter(lt=>{var Je;return!((Je=lt.deploymentTarget)!=null&&Je.runtimeId)||!xe.has(lt.deploymentTarget.runtimeId)})),(Y?xe.has(Y):U.some(lt=>lt.id===n))&&(cK(),zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Ki(""),Di(""),Es(!0),Le("")),Tn!=null&&Tn.runtime&&xe.has(Tn.runtime.runtimeId)&&(zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Ki(""),Di(""),Es(!0),Le(""))),Ve.size>0&&EC(Qe=>{const lt=new Set(Qe);for(const Je of Ve)lt.delete(Je);return lt}),tt.length>0){const Qe=tt.slice(0,3).join(";"),lt=tt.length>3?`;另有 ${tt.length-3} 个失败`:"";throw new Error(`${tt.length} 个 Agent 删除失败:${Qe}${lt}`)}},[Tn,n,Ga,Va,be]),HE=g.useCallback(async()=>{gC(!0),bC("");try{const M=[];let U="";do{const Y=await Nx({scope:Bs,region:"all",pageSize:100,nextToken:U});M.push(...Y.runtimes),U=Y.nextToken}while(U&&M.length<2e3);m0(new Set(M.map(Y=>Y.runtimeId))),xC(Object.fromEntries(M.map(Y=>[Y.runtimeId,{canDelete:Y.canDelete}])))}catch(M){bC(M instanceof Error?M.message:String(M))}finally{gC(!1)}},[Bs]);function y0(M){console.log("create agent draft:",M),zt(null),pl()}function zE(M,U){console.log("Agent added, navigating to:",M,U),Mh(Na()),m0(null),hb(),$E(Ys),$r(""),vr.current=null,ha(null),Ki(""),Di(M),f0("basic"),zt(null),Nn(!0),s(M)}const VE=g.useCallback(M=>{zt(null),fe(!1),Es(!1),sr(null),Nn(!0),Di(""),f0("basic"),Ki(M.id),Le("")},[]),NC=g.useCallback(M=>{Ys&&jh(U=>({...U,[Ys]:M.id})),VE(M)},[Ys,VE]),TC=g.useCallback(async M=>{if(!M.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const U=(Xu==null?void 0:Xu.region)??p0,Y=await uy(M.runtimeId,M.agentName,M.region??U,M.version);Mh(Na()),Ms(xe=>xe+1);const ie=await p_(Y);nt.current.set(Y,ie),$e(ie),m0(xe=>{const ke=new Set(xe??[]);return ke.add(M.runtimeId),ke}),hb(),ha(null),$E(Ys),jh(xe=>{if(!Ys||!xe[Ys])return xe;const ke={...xe};return delete ke[Ys],ke}),$r(""),vr.current=null,Di(Y),f0("basic"),zt(null),Nn(!0),s(Y)},[Ys,p0,$E,Xu]),Lh=g.useRef(null),GE=g.useRef(new Map),wc=g.useRef(!0),ml=g.useRef(!1),_c=g.useRef(null),kC=g.useRef({key:"",turnCount:0}),KE=(m==null?void 0:m.id)??a;g.useLayoutEffect(()=>{const M=Lh.current,U=kC.current,Y=U.key!==KE,ie=!Y&&Et.length>U.turnCount;if(kC.current={key:KE,turnCount:Et.length},!M||Et.length===0||!Y&&!ie)return;wc.current=!0,ml.current=!1,_c.current!==null&&(window.clearTimeout(_c.current),_c.current=null);const xe=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(Y||xe){M.scrollTop=M.scrollHeight;return}ml.current=!0,M.scrollTo({top:M.scrollHeight,behavior:"smooth"}),_c.current=window.setTimeout(()=>{ml.current=!1,_c.current=null},450)},[KE,Et.length]),g.useLayoutEffect(()=>{const M=Lh.current;!M||!wc.current||ml.current||(M.scrollTop=M.scrollHeight)},[ul,Et]),g.useEffect(()=>{if(!Oh||Wu||Et.length===0)return;const M=GE.current.get(Oh);if(!M)return;wc.current=!1,M.scrollIntoView({behavior:"smooth",block:"center"});const U=window.setTimeout(()=>{h0("")},2600);return()=>window.clearTimeout(U)},[Oh,Wu,Et]),g.useEffect(()=>()=>{_c.current!==null&&window.clearTimeout(_c.current)},[]);const VG=g.useCallback(()=>{const M=Lh.current;!M||ml.current||(wc.current=M.scrollHeight-M.scrollTop-M.clientHeight<32)},[]),GG=g.useCallback(M=>{M.deltaY<0&&(ml.current=!1,wc.current=!1)},[]),KG=g.useCallback(()=>{ml.current=!1,wc.current=!1},[]),qG=g.useCallback(()=>{const M=Lh.current;!M||!wc.current||ml.current||(M.scrollTop=M.scrollHeight)},[]),qE=g.useCallback(()=>{Ne(null),OS().then(M=>{st(M.userId),Ct(M.info),Th(!!M.local),Sn(M.status),M.status==="authenticated"&&(b0.current=!0,Qu.current=!0,localStorage.removeItem(Ea.app),s(""),zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),Es(!1))}).catch(M=>{Ne(M instanceof Error?M.message:String(M))})},[]);g.useEffect(()=>{qE()},[qE]),g.useEffect(()=>{const M=()=>{Hn(""),sn(!0)};return window.addEventListener(MS,M),Tte()&&M(),()=>window.removeEventListener(MS,M)},[]);const YG=g.useCallback(async()=>{if(Gi.current)return;Gi.current=!0;const M=xte();if(!M){Gi.current=!1,Hn("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}za(!0),Hn("");try{for(;;){await new Promise(U=>window.setTimeout(U,1e3));try{const U=await OS();if(U.status==="authenticated"){st(U.userId),Ct(U.info),Th(!!U.local),Sn(U.status),sn(!1),kte(),M.close();return}}catch{}if(M.closed){Hn("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{Gi.current=!1,za(!1)}},[]);g.useEffect(()=>{Ec&&be&&zR(be)},[Ec,be]),g.useEffect(()=>{if(yt!=="authenticated"||!be||!n){$e({});return}const M=nt.current.get(n);if(M){$e(M);return}let U=!1;return $e({}),p_(n).then(Y=>{U||(nt.current.set(n,Y),$e(Y))}),()=>{U=!0}},[n,yt,be]),g.useEffect(()=>{if(yt!=="authenticated"||!be){xs(null);return}let M=!1;return xs(null),I8().then(U=>{M||xs(U)}).catch(U=>{console.warn("[app] /web/access failed; using ordinary-user access:",U),M||xs(C8)}),()=>{M=!0}},[yt,be]),g.useEffect(()=>{A8().then(M=>{pTe(M.telemetry),bTe({agentsSource:M.agentsSource}),Mi(M.features),fa(M.agentsSource),po(M.provider),Pn(M.branding),e0(M.version),Ei(!0)})},[]),g.useEffect(()=>{yt!=="authenticated"||!un||!ft||gTe({userId:ft.telemetry.userId,role:ft.role,local:Ec})},[ft,yt,Ec,un]),g.useEffect(()=>{g0(M=>{const U=Ni(Rt);return!M||Rt==="byteplus"&&M.startsWith("cn-")||Rt==="volcengine"&&M.startsWith("ap-")?U:M})},[Rt]),g.useEffect(()=>{ft&&(ft.capabilities.createAgents||(zt(null),Ge(null),H(!1),fe(!1),l0([])),ft.capabilities.manageAgents||Nn(!1))},[ft]),g.useEffect(()=>{yt!=="authenticated"||xi!=="cloud"||!$u||!Wu||Tn||HE()},[Tn,xi,yt,Wu,HE,$u]),g.useEffect(()=>{document.title=Xn.title;let M=document.querySelector('link[rel~="icon"]');M||(M=document.createElement("link"),M.rel="icon",document.head.appendChild(M)),M.removeAttribute("type"),M.href=Xn.logoUrl||(Rt==="byteplus"?p2:m2)},[Rt,Xn]),g.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(M=>M.ok?M.json():null).then(M=>{M&&u0(!!M.credentials)}).catch(M=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",M)})},[]);function WG(M){zR(M),b0.current=!0,Qu.current=!0,localStorage.removeItem(Ea.app),xs(null),zt(null),Ge(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),pl(),s(""),Es(!1),st(M),Ct({name:M}),Th(!0),Sn("authenticated")}function XG(){xs(null),Ec?(bte(),st(""),Ct(void 0),Sn("unauthenticated")):vte()}g.useEffect(()=>{if(yt==="authenticated"){if(xi==="cloud"){const M=XD(Va);s(U=>U&&M.includes(U)?U:(U&&(Qu.current=!0,localStorage.removeItem(Ea.app)),""));return}e8().then(M=>{t(M);const U=XD(Va);s(Y=>Y&&(M.includes(Y)||U.includes(Y))?Y:(Y&&(Qu.current=!0,localStorage.removeItem(Ea.app)),""))}).catch(M=>Le(String(M)))}},[yt,xi,Va]),g.useEffect(()=>{n?(Qu.current=!1,localStorage.setItem(Ea.app,n)):localStorage.removeItem(Ea.app)},[n]),g.useEffect(()=>{let M=!1;if(Wn(null),Ln([]),hl||Tn||!n||!be||!a){ps(!1);return}return ps(!0),US(n,be,a).then(U=>{M||(Wn(U),u2(n).then(Y=>{M||Ln(Y)}).catch(()=>{M||Ln([])}))}).catch(()=>{M||Wn(null)}).finally(()=>{M||ps(!1)}),()=>{M=!0}},[Tn,n,hl,be,a]),g.useEffect(()=>{let M=!1;if(os(null),vn(xa()),yt!=="authenticated"||hl||Tn||!n){ls(!1);return}return ls(!0),d2(n).then(U=>{M||os(U)}).catch(()=>{M||os(null)}).finally(()=>{M||ls(!1)}),()=>{M=!0}},[Tn,n,Os,yt,hl]),g.useEffect(()=>{ft&&localStorage.setItem(Ea.view,ft.capabilities.createAgents?bo??"chat":"chat")},[ft,bo]),g.useEffect(()=>{localStorage.setItem(Ea.session,a),bt.current=a},[a]),g.useEffect(()=>{const M=ZMe(Va,n);if(!M||!be){Ie.current=()=>{},on(Je=>Je.size===0?Je:new Set);return}const{runtimeId:U,region:Y,appName:ie}=M;let xe=!1,ke=0;function Ve(){de.current!==void 0&&(window.clearTimeout(de.current),de.current=void 0)}function tt(Je){Ve(),de.current=window.setTimeout(()=>void Qe(),Je)}async function Qe(){const Je=++ke;try{const qe=await o8({runtimeId:U,region:Y,appName:ie,userId:be});if(xe||Je!==ke)return;const rn=new Set(qe.items.filter(rt=>rt.state==="running").map(rt=>rt.sessionId));if(on(rt=>rt.size===rn.size&&[...rn].every(Ws=>rt.has(Ws))?rt:rn),rn.size>0){tt(IMe);return}const ln=qe.items.filter(rt=>rt.state==="pending").map(rt=>Date.parse(rt.dueAt)).filter(Number.isFinite);ln.length>0&&tt(Math.max(RMe,Math.min(...ln)-Date.now()))}catch{!xe&&Je===ke&&tt(jMe)}}const lt=()=>{Ve(),Qe()};return Ie.current=lt,lt(),()=>{xe=!0,ke+=1,Ve(),Ie.current===lt&&(Ie.current=()=>{})}},[n,Va,be]),g.useEffect(()=>()=>Yt.current.forEach(M=>M.abort()),[]),g.useEffect(()=>()=>_n.current.forEach(M=>{window.clearTimeout(M)}),[]),g.useEffect(()=>()=>{var M,U;(M=Ae.current)==null||M.abort(),(U=Ke.current)==null||U.abort()},[]),g.useEffect(()=>{if(hl||Tn||m||!n||!be)return;let M=!1;return(async()=>{const U=await x0(n);if(!M){if(!b0.current){b0.current=!0;const Y=localStorage.getItem(Ea.session)||"";if(zD()===null&&Y&&U.some(ie=>ie.id===Y)){Dh(Y);return}}pl()}})(),()=>{M=!0}},[Tn,n,hl,m,be]),g.useEffect(()=>{const M=UE.current;M&&M.app===n&&(UE.current=null,Dh(M.sid))},[n]);function QG(M,U){wi(!1),M===n?Dh(U):(UE.current={app:M,sid:U},s(M))}async function x0(M){try{const U=await o2(M,be),Y=await Promise.allSettled(U.map(ke=>{var Ve;return(Ve=ke.events)!=null&&Ve.length?Promise.resolve(ke):a1(M,be,ke.id)})),ie=Y.find(ke=>ke.status==="rejected"&&!/get session failed:\s*404\b/i.test(String(ke.reason)));if((ie==null?void 0:ie.status)==="rejected")throw ie.reason;const xe=Y.flatMap(ke=>ke.status==="fulfilled"?[ke.value]:[]);return r(xe),xe}catch(U){return Le(String(U)),[]}}function AC(M="codex",U=!1){m||(Le(""),ue(""),he("confirm"),De(M),ae(U),K(!0))}function ZG(){var M;(M=Ae.current)==null||M.abort(),Ae.current=null,K(!1),he("confirm"),ue(""),!m&&it==="temporary"&&!Se&&dt("agent")}async function JG(M){var Y;(Y=Ae.current)==null||Y.abort();const U=new AbortController;Ae.current=U,he("loading"),ue("");try{const ie=we==="codex"?await cn.startSession({displayName:M,signal:U.signal}):await cn.startAgentSession(we,{displayName:M,signal:U.signal});if(Ae.current!==U)return;if(yTe({kind:we,source:Se?"my_agents":"new_chat",sessionId:ie.id}),Se){_e(ke=>ke+1),K(!1),he("confirm"),Es(!0);return}if(we!=="codex")return;const xe=await cn.connectSession(ie.id,{signal:U.signal});if(Ae.current!==U)return;bt.current="",l(""),h([]),Ft(""),vn(xa()),dt("temporary"),Ch(),mn(!1),Gu(Bt),Tt([]),at(),v([]),p(xe),zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Es(!1),Be(null),We(null),K(!1),he("confirm")}catch(ie){if((ie==null?void 0:ie.name)==="AbortError"||Ae.current!==U)return;xTe({kind:we,source:Se?"my_agents":"new_chat",error:ie}),ue(ie instanceof Error?ie.message:String(ie)),he("error")}finally{Ae.current===U&&(Ae.current=null)}}async function YE(M,U="my_agents"){Le("");const Y=Date.now();try{if(M.toolName==="codex"){const xe=await cn.connectSession(M.id);mb({kind:M.toolName,source:U,durationMs:Date.now()-Y,sandboxStatus:xe.status}),bt.current="",l(""),h([]),Ft(""),vn(xa()),at(),v([]),p(xe),Be(null),We(null),Es(!1),Nn(!1);return}const ie=await cn.openAgentSession(M.toolName,M.id);mb({kind:M.toolName,source:U,durationMs:Date.now()-Y,sandboxStatus:ie.session.status}),We(ie),Be(null),Es(!1),Nn(!1)}catch(ie){throw Vw({kind:M.toolName,source:U,durationMs:Date.now()-Y,error:ie}),Le(ie instanceof Error?ie.message:String(ie)),ie}}function eK(M){Be(M),We(null),Es(!1),Nn(!1),Le("")}async function tK(M){(m==null?void 0:m.id)===M.id&&yo(),M.toolName==="codex"?await cn.deleteSession(M.id):await cn.deleteAgentSession(M.toolName,M.id),Be(null),We(null),_e(U=>U+1),Es(!0)}function yo(){var U;(U=Ke.current)==null||U.abort(),Ke.current=null,Ue.current="",W.current="",x(!1),at(),v([]),Tt([]),Ft(""),Le(""),dt("agent"),w(!1),_(""),T(!1),j(!1),B(null),L(null),C(!1),D(""),O(null),ne(!1),Q(""),V(!1),oe.current+=1;const M=m;p(null),M&&cn.closeSession(M.id).catch(Y=>Le(String(Y)))}async function WE(M){const U=m;if(U){B(M),L(null),D(""),C(!0);try{const Y=M==="terminal"?await cn.launchTerminal(U.id):await cn.launchBrowser(U.id);L(Y)}catch(Y){D(Y instanceof Error?Y.message:String(Y))}finally{C(!1)}}}async function nK(M){const U=m;if(!(!U||E)){w(!0),_("");try{const Y=await cn.updatePermissions(U.id,M);p(ie=>(ie==null?void 0:ie.id)===U.id?{...ie,permissions:Y}:ie),xn(U.id,"已更新当前 Sandbox Session 的 Codex 权限",[{label:"沙箱模式",value:KMe[Y.sandboxMode]},{label:"审批策略",value:qMe[Y.approvalPolicy]},{label:"审批方式",value:YMe[Y.approvalsReviewer]},{label:"网络访问",value:Y.networkAccess?"允许":"关闭"}]),Ue.current===U.id&&T(!1)}catch(Y){_(Y instanceof Error?Y.message:String(Y))}finally{w(!1)}}}const sK=g.useCallback(async M=>{const U=m==null?void 0:m.id;if(!U)throw new Error("当前没有已连接的 Sandbox。");return cn.listDirectories(U,M)},[m==null?void 0:m.id]);async function iK(M){const U=m;if(!(!U||U.workspaceLocked||E)){w(!0),_("");try{const Y=await cn.updateWorkspace(U.id,M);p(ie=>(ie==null?void 0:ie.id)===U.id?{...ie,cwd:Y}:ie),Qn.invalidateSkills(),xn(U.id,"已更新工作空间",[{label:"工作目录",value:Y,code:!0}]),Ue.current===U.id&&j(!1)}catch(Y){_(Y instanceof Error?Y.message:String(Y))}finally{w(!1)}}}async function rK(M){const U=m,Y=$;if(!(!U||!Y||te)){ne(!0),Q("");try{await cn.resolveApproval(U.id,Y.id,M),xn(U.id,WMe(Y,M),XMe(Y),W.current),O(ie=>(ie==null?void 0:ie.id)===Y.id?null:ie)}catch(ie){Q(ie instanceof Error?ie.message:String(ie))}finally{ne(!1)}}}async function aK(M){const U=m;if(!U||ee)return;const Y=++oe.current;Le(""),V(!0);const ie=Array.from(M).map(xe=>{const ke={id:YD(),mimeType:WD(xe),name:xe.name,sizeBytes:xe.size,status:"uploading",previewUrl:Ee(xe)};return{file:xe,attachment:ke}});Tt(xe=>[...xe,...ie.map(({attachment:ke})=>ke)]);try{const ke=(await Promise.all(ie.map(async({file:Ve,attachment:tt})=>{try{const Qe=await cn.uploadFile(U.id,Ve);return oe.current!==Y?null:(Tt(lt=>lt.map(Je=>Je.id===tt.id?{...Je,id:Qe.id,uri:Qe.path,name:Qe.name,mimeType:Qe.mimeType,sizeBytes:Qe.sizeBytes,status:"ready"}:Je)),Qe)}catch(Qe){if(oe.current!==Y)return null;const lt=Qe instanceof Error?Qe.message:String(Qe);return Tt(Je=>Je.map(qe=>qe.id===tt.id?{...qe,status:"error",error:lt}:qe)),Le(lt),null}}))).filter(Ve=>Ve!==null);oe.current===Y&&ke.length>0&&xn(U.id,ke.length===1?"已上传文件到 Sandbox":`已上传 ${ke.length} 个文件到 Sandbox`,ke.map((Ve,tt)=>({label:ke.length===1?"文件":`文件 ${tt+1}`,value:Ve.path,code:!0})))}finally{if(oe.current===Y)V(!1);else for(const{attachment:xe}of ie)Oe(xe.previewUrl)}}function oK(M){const U=Bt.find(Y=>Y.id===M);U&&(Oe(U.previewUrl),Tt(Y=>Y.filter(ie=>ie.id!==M)))}async function CC(M,U=[],Y=[]){var Ws;const ie=m,xe=U.filter(Ye=>Ye.status==="ready"&&Ye.uri);if(!ie||y||!M.trim()&&xe.length===0)return;Le(""),O(null),Q("");const ke=Date.now(),Ve=new AbortController;(Ws=Ke.current)==null||Ws.abort(),Ke.current=Ve;const tt=[];Y.length>0&&tt.push({kind:"invocation",value:{skills:Y.map(({name:Ye,description:Nt})=>({name:Ye,description:Nt}))}}),xe.length>0&&tt.push({kind:"attachment",files:xe.map(Ye=>({id:Ye.id,mimeType:Ye.mimeType,name:Ye.name,sizeBytes:Ye.sizeBytes,previewUrl:Ye.previewUrl}))}),M.trim()&&tt.push({kind:"text",text:M});const Qe=xe.map(Ye=>Ye.uri).filter(Ye=>!!Ye),Je=[Y.map(Ye=>`$${Ye.name}`).join(" "),M.trim()].filter(Boolean).join(" "),qe=Qe.length>0?[Je,"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",...Qe.map(Ye=>`- ${Ye}`)].filter(Boolean).join(` +`)),b("copied")}catch{b("error")}},z=()=>{var C;p(!1),b("idle"),u(""),f(E.current||((C=T[0])==null?void 0:C.version)||""),r("confirm")};return o.jsxs(o.Fragment,{children:[o.jsxs("button",{type:"button",className:e==="feature-link"?"welcome-feature-link studio-update-trigger--feature":`studio-update-trigger is-${i}`,title:i==="submitting"?"正在更新 Studio":i==="published"?"Studio 已更新":`更新 Studio 至 ${n.latestVersion}`,onClick:()=>{var C;i==="published"?window.location.reload():(i==="submitting"||i==="error"||(f(((C=T[0])==null?void 0:C.version)||n.latestVersion),r("confirm")),l(!0))},children:[e!=="feature-link"&&o.jsx(FD,{className:"studio-update-icon"}),i==="submitting"?o.jsx(Pa,{as:"span",children:"正在更新"}):i==="published"?o.jsx("span",{children:"刷新使用新版"}):i==="error"?o.jsx("span",{children:"更新失败"}):e==="feature-link"?o.jsx("span",{children:"立即更新"}):o.jsx("span",{children:"有新版更新"})]}),a&&i!=="idle"&&o.jsx("div",{className:"confirm-scrim",role:"presentation",children:o.jsxs("section",{className:"confirm-box studio-update-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"studio-update-title",children:[o.jsx("div",{className:"studio-update-dialog-mark",children:o.jsx(FD,{})}),o.jsx("div",{id:"studio-update-title",className:"confirm-title",children:i==="error"?"Studio 更新失败":i==="submitting"?"正在更新 Studio":i==="published"?"Studio 更新完成":"发现新版本"}),i==="error"?o.jsxs("div",{className:"studio-update-error-panel",children:[o.jsx("p",{className:"confirm-text studio-update-error",children:c}),o.jsxs("dl",{className:"studio-update-error-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"失败阶段"}),o.jsx("dd",{children:oOe[n.errorStage]||n.errorStage||"未知阶段"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"错误 ID"}),o.jsx("dd",{children:n.errorId||"未生成"})]})]}),o.jsx($D,{lines:R,phase:"error",copyState:m,onCopy:()=>void B()}),n.consoleUrl&&o.jsxs("a",{className:"studio-update-console-link",href:n.consoleUrl,target:"_blank",rel:"noreferrer",children:["前往 VeFaaS 控制台查看 Function 日志",o.jsx("span",{"aria-hidden":!0,children:"↗"})]})]}):i==="submitting"||i==="published"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"studio-update-progress-summary",children:[o.jsxs("div",{children:[o.jsx("span",{children:"目标版本"}),o.jsx("strong",{children:E.current||k})]}),o.jsxs("div",{children:[o.jsx("span",{children:i==="published"?"更新状态":"已用时"}),o.jsx("strong",{children:i==="published"?"已完成":lOe(v)})]})]}),o.jsx("ol",{className:"studio-update-progress","aria-label":"Studio 更新进度",children:UD.map((C,I)=>{const D=UD.findIndex(te=>te.id===n.progressStage),$=i==="published"||Ivoid B()}),o.jsx("p",{className:"studio-update-progress-note",children:"发布阶段会短暂中断连接;关闭此窗口不会停止更新,可随时点击右上角按钮重新查看。"})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"confirm-text",children:"更新会重启 Studio 服务,预计约 3–5 分钟完成更新与发布。期间正在进行的对话、 流式响应或部署任务可能中断,登录态不会受到影响。"}),o.jsxs("div",{className:"studio-update-field",ref:x,children:[o.jsx("span",{children:"选择版本"}),o.jsxs("button",{type:"button",className:"studio-update-version-trigger","aria-label":"选择版本","aria-haspopup":"listbox","aria-expanded":h,onClick:()=>p(C=>!C),onKeyDown:C=>{(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),p(!0))},children:[o.jsx("span",{children:k}),o.jsx(dOe,{})]}),h&&o.jsx("div",{className:"studio-update-version-menu",role:"listbox","aria-label":"选择版本",children:T.map(C=>{const I=C.version===k;return o.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`studio-update-version-option${I?" is-selected":""}`,onClick:()=>{f(C.version),p(!1)},children:[o.jsx("span",{children:C.version}),I&&o.jsx(fOe,{})]},C.version)})})]}),o.jsxs("dl",{className:"studio-update-versions",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"当前版本"}),o.jsx("dd",{children:n.currentVersion})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"目标版本"}),o.jsx("dd",{children:k})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Commit"}),o.jsx("dd",{children:((A==null?void 0:A.gitSha)||n.latestGitSha).slice(0,8)})]})]}),o.jsxs("section",{className:"studio-update-changelog","aria-labelledby":"studio-update-changelog-title",children:[o.jsx("div",{id:"studio-update-changelog-title",children:"更新内容"}),A!=null&&A.changelog.length?o.jsx("ul",{children:A.changelog.map(C=>o.jsx("li",{children:C},C))}):o.jsx("p",{children:"暂无更新说明"})]})]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",onClick:()=>{l(!1),p(!1),i==="confirm"&&(r("idle"),u(""))},children:i==="submitting"?"后台运行":i==="confirm"?"取消":"关闭"}),i==="confirm"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:()=>void j(),children:"立即更新"}),i==="error"&&o.jsx("button",{type:"button",className:"confirm-btn studio-update-confirm",onClick:z,children:"重新尝试"})]})]})})]})}const pOe=[{title:"多地域智能体",description:"并行加载北京与上海 Runtime,列表下滑即可继续加载。"},{title:"会话内切换",description:"在输入框旁选择智能体,并直接开启一段新会话。"},{title:"可视化执行画布",description:"通过横向画布查看多智能体结构,并支持全屏浏览。"}];function mOe({canUpdate:e=!1}){return o.jsxs("div",{className:"welcome-feature-pill",children:[o.jsx("span",{children:"焕然一新"}),o.jsx("span",{className:"welcome-feature-divider","aria-hidden":"true"}),o.jsx("button",{type:"button",className:"welcome-feature-link","aria-describedby":"welcome-feature-popover",children:"查看新特性"}),o.jsxs("section",{id:"welcome-feature-popover",className:"welcome-feature-popover",role:"tooltip",children:[o.jsx("strong",{children:"本次更新"}),o.jsx("ul",{children:pOe.map(t=>o.jsxs("li",{children:[o.jsx("span",{children:t.title}),o.jsx("p",{children:t.description})]},t.title))})]}),e&&o.jsx(hOe,{variant:"feature-link"})]})}const gOe=1e4;async function SG(e){const t=await fetch(Rn(e),{headers:Ex({Accept:"application/json"}),signal:Bn(void 0,gOe)});if(!t.ok)throw new Error(`读取会话模式能力失败(HTTP ${t.status})`);const n=await t.json();if(typeof n.enabled!="boolean")throw new Error("会话模式能力响应格式错误");return{enabled:n.enabled,reason:typeof n.reason=="string"?n.reason:void 0}}async function bOe(){return SG("/web/sandbox/capabilities")}async function yOe(){return SG("/web/skill-creator/capabilities")}const xOe="我的智能体";function EOe({open:e,state:t,agentKind:n="codex",error:s,onCancel:i,onConfirm:r}){const a=n==="codex"?"Codex":n==="openclaw"?"OpenClaw":"Hermes",l=n==="codex"?xOe:`我的 ${a}`,c=g.useRef(null),u=g.useRef(null),d=g.useRef(null),f=g.useRef(!1),h=g.useRef(i),[p,m]=g.useState(l);if(h.current=i,g.useEffect(()=>{if(!e)return;m(l);const x=document.body.style.overflow;document.body.style.overflow="hidden";const E=window.requestAnimationFrame(()=>{var S,_;(S=u.current)==null||S.focus(),(_=u.current)==null||_.select()}),w=S=>{var A;if(S.key==="Escape"){S.preventDefault(),h.current();return}if(S.key!=="Tab")return;const _=(A=c.current)==null?void 0:A.querySelectorAll("input:not(:disabled), button:not(:disabled)");if(!(_!=null&&_.length))return;const T=_[0],k=_[_.length-1];S.shiftKey&&document.activeElement===T?(S.preventDefault(),k.focus()):!S.shiftKey&&document.activeElement===k&&(S.preventDefault(),T.focus())};return window.addEventListener("keydown",w),()=>{window.cancelAnimationFrame(E),document.body.style.overflow=x,window.removeEventListener("keydown",w)}},[l,e]),!e)return null;const b=t==="loading",v=p.trim(),y=b?`正在创建 ${a} 智能体`:t==="error"?"启动失败":`创建 ${a} 智能体`;return wi.createPortal(o.jsx("div",{className:"sandbox-dialog-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&!b&&i()},children:o.jsxs("form",{ref:c,className:"sandbox-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"sandbox-dialog-title","aria-describedby":t==="confirm"?void 0:"sandbox-dialog-description",onSubmit:x=>{x.preventDefault(),!b&&!f.current&&v&&r(v)},children:[o.jsxs("div",{className:"sandbox-dialog-visual","aria-hidden":"true",children:[o.jsx("span",{className:"sandbox-dialog-orbit"}),o.jsx("span",{className:"sandbox-dialog-icon",children:b?o.jsx("span",{className:"sandbox-spinner"}):o.jsx(Qm,{kind:n})})]}),o.jsxs("div",{className:"sandbox-dialog-copy",children:[o.jsx("h2",{id:"sandbox-dialog-title",children:y}),t==="error"?o.jsx("p",{id:"sandbox-dialog-description",className:"sandbox-dialog-error",role:"alert",children:s||"AgentKit 沙箱初始化失败,请稍后重新尝试。"}):b?o.jsxs("p",{id:"sandbox-dialog-description","aria-live":"polite",children:["正在创建并等待 ",a," 智能体就绪,这通常需要半分钟"]}):null,o.jsxs("label",{className:"sandbox-dialog-field",children:[o.jsxs("span",{className:"sandbox-dialog-field-label",children:[o.jsx("span",{children:"智能体名称"}),o.jsxs("span",{"aria-hidden":"true",children:[p.length,"/",T3]})]}),o.jsx("input",{ref:u,type:"text",required:!0,value:p,maxLength:T3,disabled:b,placeholder:l,autoComplete:"off",onChange:x=>m(x.target.value),onCompositionStart:()=>{f.current=!0},onCompositionEnd:()=>{f.current=!1},onKeyDown:x=>{const{nativeEvent:E}=x;x.key==="Enter"&&(f.current||E.isComposing||E.keyCode===229)&&x.preventDefault()}})]})]}),o.jsxs("footer",{className:"sandbox-dialog-actions",children:[o.jsx("button",{ref:d,type:"button",onClick:i,children:b?"取消创建":"取消"}),!b&&o.jsx("button",{type:"submit",className:"is-primary",disabled:!v,children:t==="error"?"重新尝试":"确认创建"})]})]})}),document.body)}function vOe({agentName:e,onExit:t}){return o.jsxs("div",{className:"sandbox-session-warning",role:"status",children:[o.jsx("span",{className:"sandbox-session-warning-dot","aria-hidden":"true"}),o.jsxs("span",{className:"sandbox-session-warning-copy",children:["当前您在使用 ",e," 智能体"]}),o.jsx("button",{type:"button",onClick:t,children:"退出内置智能体"})]})}function wOe({activity:e,time:t}){var n;return o.jsxs("aside",{className:"sandbox-activity-record",role:"status","aria-label":"Sandbox 操作记录",children:[o.jsxs("div",{className:"sandbox-activity-summary",children:[o.jsx("span",{className:"sandbox-activity-dot","aria-hidden":"true"}),o.jsx("span",{className:"sandbox-activity-label",children:"操作记录"}),o.jsx("strong",{children:e.title}),t?o.jsx("time",{children:t}):null]}),(n=e.details)!=null&&n.length?o.jsx("dl",{className:"sandbox-activity-details",children:e.details.map(s=>o.jsxs("div",{children:[o.jsx("dt",{children:s.label}),o.jsx("dd",{title:s.value,children:s.code?o.jsx("code",{children:s.value}):s.value})]},`${s.label}:${s.value}`))}):null]})}function _Oe(e){return e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}m`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e)}function SOe({usage:e}){const t=[["Total",e.totalTokens],["Input",e.inputTokens],...e.cachedInputTokens>0?[["Cached input",e.cachedInputTokens]]:[],["Output",e.outputTokens],...e.reasoningOutputTokens>0?[["Reasoning output",e.reasoningOutputTokens]]:[]];return o.jsx("div",{className:"sandbox-token-usage","aria-label":"Codex Token 用量",children:t.map(([n,s])=>o.jsxs("span",{title:`${n}: ${s.toLocaleString()} tokens`,children:[o.jsx("small",{children:n}),o.jsx("strong",{children:_Oe(s)})]},n))})}function NG(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"m7.5 9 2.7 2.5L7.5 14M12.7 14h3.8"}),o.jsx("path",{d:"M3.8 7.5h16.4",opacity:".55"})]})}function TG(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("path",{d:"M3.8 8h16.4"}),o.jsx("circle",{cx:"6.5",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("circle",{cx:"8.8",cy:"6.3",r:".65",fill:"currentColor",stroke:"none"}),o.jsx("path",{d:"m9 15 2.2-4 1.6 2.4 1.1-1.2L16 15H9Z"})]})}function hC(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M12 3.4 19 6v5.3c0 4.3-2.7 7.6-7 9.3-4.3-1.7-7-5-7-9.3V6l7-2.6Z"}),o.jsx("path",{d:"m8.8 12 2 2 4.4-4.4"})]})}function gy(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M3.5 7.7h6.1l1.7 2h9.2v7.5a2.3 2.3 0 0 1-2.3 2.3H5.8a2.3 2.3 0 0 1-2.3-2.3V7.7Z"}),o.jsx("path",{d:"M3.8 7.7V6.8a2.3 2.3 0 0 1 2.3-2.3h3l1.8 2h6.9a2.3 2.3 0 0 1 2.3 2.3v.9"}),o.jsx("path",{d:"M12 13v3M10.5 14.5h3"})]})}function NOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M12 5v14M5 12h14"})})}function TOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 11.5 5.5-5.5 5.5 5.5M12 6v12"})})}function kOe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.5"}),o.jsx("circle",{cx:"8.5",cy:"9",r:"1.4"}),o.jsx("path",{d:"m5.5 17 4.2-4.2 2.6 2.4 2.1-2.1 4.1 3.9"})]})}function AOe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M6 3.5h7l5 5v12H6z"}),o.jsx("path",{d:"M13 3.5v5h5M9 13h6M9 16h5"})]})}function COe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("rect",{x:"3.5",y:"5",width:"13.5",height:"14",rx:"2.5"}),o.jsx("path",{d:"m17 10 3.5-2v8L17 14zM7 8.5h4.5"})]})}function IOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m12 3 1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5zM18.5 15.5l.7 2.1 2.1.7-2.1.7-.7 2.1-.7-2.1-2.1-.7 2.1-.7z"})})}function jOe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m6.5 6.5 11 11M17.5 6.5l-11 11"})})}function aT(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m9 6 6 6-6 6"})})}function ROe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"M4.8 8.2A8 8 0 1 1 4 12M4.8 8.2V4.5M4.8 8.2h3.7"}),o.jsx("path",{d:"M12 8v4.5l3 1.8"})]})}function nl(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"M20 12a8 8 0 1 1-2.35-5.65"})})}function Xg({open:e,title:t,subtitle:n,icon:s,className:i="",onClose:r,children:a}){const l=g.useId(),c=g.useRef(null),u=g.useRef(null),d=g.useRef(r);return d.current=r,g.useEffect(()=>{var p;if(!e)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const f=document.body.style.overflow;document.body.style.overflow="hidden",(p=c.current)==null||p.focus();const h=m=>{var E;if(m.key==="Escape"){m.preventDefault(),d.current();return}if(m.key!=="Tab")return;const b=(E=c.current)==null?void 0:E.closest("[role=dialog]"),v=Array.from((b==null?void 0:b.querySelectorAll('button:not(:disabled), input:not(:disabled), iframe, [tabindex]:not([tabindex="-1"])'))??[]);if(v.length===0)return;const y=v[0],x=v[v.length-1];m.shiftKey&&document.activeElement===y?(m.preventDefault(),x.focus()):!m.shiftKey&&document.activeElement===x&&(m.preventDefault(),y.focus())};return window.addEventListener("keydown",h),()=>{var m;document.body.style.overflow=f,window.removeEventListener("keydown",h),(m=u.current)==null||m.focus()}},[e]),e?wi.createPortal(o.jsx("div",{className:"sandbox-control-backdrop",onMouseDown:f=>{f.target===f.currentTarget&&r()},children:o.jsxs("section",{className:`sandbox-control-dialog ${i}`.trim(),role:"dialog","aria-modal":"true","aria-labelledby":l,children:[o.jsxs("header",{className:"sandbox-control-head",children:[o.jsx("span",{className:"sandbox-control-head-icon","aria-hidden":"true",children:s}),o.jsxs("div",{children:[o.jsx("h2",{id:l,children:t}),o.jsx("p",{children:n})]}),o.jsx("button",{ref:c,type:"button",className:"sandbox-control-close","aria-label":`关闭${t}`,onClick:r,children:o.jsx(jOe,{})})]}),a]})}),document.body):null}function OOe({open:e,kind:t,launch:n,loading:s,error:i,onReload:r,onClose:a}){const l=t==="terminal",c=l?"Terminal":"Sandbox Browser";return o.jsxs(Xg,{open:e,title:c,subtitle:l?"连接当前 AgentKit Session 的交互式终端":"在当前 AgentKit Session 中查看与操作浏览器",icon:l?o.jsx(NG,{}):o.jsx(TG,{}),className:`sandbox-tool-dialog sandbox-tool-dialog--${t}`,onClose:a,children:[o.jsx("div",{className:"sandbox-tool-toolbar",children:o.jsxs("span",{children:[o.jsx("i",{className:s?"is-loading":n?"is-ready":""}),s?"正在连接…":n?"已连接":"尚未连接"]})}),o.jsx("div",{className:"sandbox-tool-surface",children:s?o.jsxs("div",{className:"sandbox-control-state",children:[o.jsx(nl,{className:"spin"}),o.jsxs("strong",{children:["正在打开 ",c]}),o.jsx("span",{children:"工具正在连接当前 AgentKit Session。"})]}):i?o.jsxs("div",{className:"sandbox-control-state is-error",children:[o.jsxs("strong",{children:[c," 打开失败"]}),o.jsx("span",{children:i}),o.jsx("button",{type:"button",onClick:r,children:"重试"})]}):n?o.jsx("iframe",{src:n.url,title:c,allow:"clipboard-read; clipboard-write",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-pointer-lock allow-same-origin allow-scripts"}):null})]})}function MOe({open:e,threads:t,currentThreadId:n,loading:s,error:i,onSelect:r,onClose:a}){return o.jsx(Xg,{open:e,title:"恢复 Codex 对话",subtitle:"选择当前 Sandbox Session 中最近更新的 Thread",icon:o.jsx(ROe,{}),className:"sandbox-threads-dialog",onClose:a,children:o.jsx("div",{className:"sandbox-thread-list",children:s?o.jsxs("div",{className:"sandbox-control-state",children:[o.jsx(nl,{className:"spin"}),o.jsx("strong",{children:"正在读取历史对话"})]}):i?o.jsxs("div",{className:"sandbox-control-state is-error",children:[o.jsx("strong",{children:"历史对话读取失败"}),o.jsx("span",{children:i})]}):t.length===0?o.jsx("div",{className:"sandbox-control-state",children:o.jsx("strong",{children:"暂无可恢复的对话"})}):t.map(l=>{const c=l.id===n,u=l.name||l.preview||`Thread ${l.id.slice(0,8)}`;return o.jsxs("button",{type:"button",className:c?"is-active":"",disabled:c,onClick:()=>r(l.id),children:[o.jsxs("span",{children:[o.jsx("strong",{children:u}),o.jsx("small",{children:l.preview||l.cwd||l.id})]}),o.jsx("time",{children:l.updatedAt?new Date(l.updatedAt*1e3).toLocaleString():""}),o.jsx(aT,{})]},l.id)})})})}const LOe=[{value:"read-only",label:"只读",detail:"允许读取文件,不允许写入工作空间。"},{value:"workspace-write",label:"工作区写入",detail:"允许在当前工作空间内读取与修改文件。"},{value:"danger-full-access",label:"完全访问",detail:"不启用沙箱隔离,适合明确可信的任务。",danger:!0}],DOe=[{value:"untrusted",label:"仅不可信命令",detail:"只对 Codex 判断为不可信的操作发起审批。"},{value:"on-request",label:"按需审批",detail:"Codex 可在必要时请求你确认命令或文件修改。"},{value:"never",label:"不审批",detail:"Codex 不会暂停并请求人工批准。",danger:!0}],POe=[{value:"user",label:"由我审批",detail:"审批请求会显示在 Studio 中,由你决定。"},{value:"auto_review",label:"自动审查",detail:"使用 Codex 自动审查流程处理审批请求。"}];function BOe({open:e,value:t,busy:n,error:s,onSave:i,onClose:r}){const[a,l]=g.useState(t);return g.useEffect(()=>{e&&l(t)},[e,t]),o.jsxs(Xg,{open:e,title:"Codex 权限",subtitle:"设置会保存到当前 Sandbox Session,并同步到其中的所有 Thread",icon:o.jsx(hC,{}),className:"sandbox-settings-dialog",onClose:r,children:[o.jsxs("div",{className:"sandbox-control-body",children:[o.jsx(p_,{label:"沙箱模式",choices:LOe,value:a.sandboxMode,disabled:n,onChange:c=>l(u=>({...u,sandboxMode:c,networkAccess:c==="danger-full-access"?!0:u.networkAccess}))}),o.jsx(p_,{label:"审批策略",choices:DOe,value:a.approvalPolicy,disabled:n,onChange:c=>l(u=>({...u,approvalPolicy:c}))}),o.jsx(p_,{label:"审批方式",choices:POe,value:a.approvalsReviewer,disabled:n,onChange:c=>l(u=>({...u,approvalsReviewer:c}))}),o.jsxs("label",{className:`sandbox-network-toggle${a.sandboxMode==="danger-full-access"?" is-disabled":""}`,children:[o.jsxs("span",{children:[o.jsx("strong",{children:"允许网络访问"}),o.jsx("small",{children:"控制 workspace-write 与只读模式中的外部网络访问。"})]}),o.jsx("input",{type:"checkbox",checked:a.networkAccess,disabled:n||a.sandboxMode==="danger-full-access",onChange:c=>l(u=>({...u,networkAccess:c.target.checked}))})]}),a.sandboxMode==="danger-full-access"?o.jsx("div",{className:"sandbox-control-note is-danger",children:"完全访问会关闭文件系统与网络隔离,请只在可信任务中使用。"}):null,s?o.jsx("div",{className:"sandbox-control-error",children:s}):null]}),o.jsxs("footer",{className:"sandbox-control-actions",children:[o.jsx("button",{type:"button",onClick:r,disabled:n,children:"取消"}),o.jsxs("button",{type:"button",className:"is-primary",disabled:n,onClick:()=>i(a),children:[n?o.jsx(nl,{className:"spin"}):null,"保存权限"]})]})]})}function p_({label:e,choices:t,value:n,disabled:s,onChange:i}){return o.jsxs("fieldset",{className:"sandbox-choice-group",disabled:s,role:"radiogroup","aria-label":e,children:[o.jsx("legend",{children:e}),o.jsx("div",{className:"sandbox-choice-list",children:t.map(r=>o.jsxs("button",{type:"button",role:"radio",className:`${n===r.value?"is-active":""}${r.danger?" is-danger":""}`.trim(),"aria-checked":n===r.value,onClick:()=>i(r.value),onKeyDown:a=>{var d,f;const l=t.findIndex(h=>h.value===r.value);let c=l;if(a.key==="ArrowRight"||a.key==="ArrowDown")c=(l+1)%t.length;else if(a.key==="ArrowLeft"||a.key==="ArrowUp")c=(l-1+t.length)%t.length;else if(a.key==="Home")c=0;else if(a.key==="End")c=t.length-1;else return;a.preventDefault(),i(t[c].value);const u=(d=a.currentTarget.parentElement)==null?void 0:d.querySelectorAll('[role="radio"]');(f=u==null?void 0:u[c])==null||f.focus()},children:[o.jsx("i",{}),o.jsxs("span",{children:[o.jsx("strong",{children:r.label}),o.jsx("small",{children:r.detail})]})]},r.value))})]})}function UOe({open:e,cwd:t,locked:n,busy:s,error:i,browse:r,onSave:a,onClose:l}){const[c,u]=g.useState(t||"/"),[d,f]=g.useState(null),[h,p]=g.useState(!1),[m,b]=g.useState("");g.useEffect(()=>{if(!e)return;const y=t||"/";u(y),v(y)},[t,e]);async function v(y){p(!0),b("");try{const x=await r(y);f(x),u(x.path)}catch(x){b(x instanceof Error?x.message:String(x))}finally{p(!1)}}return o.jsxs(Xg,{open:e,title:"工作空间",subtitle:"选择当前 Codex Thread 执行命令与修改文件的目录",icon:o.jsx(gy,{}),className:"sandbox-workspace-dialog",onClose:l,children:[o.jsxs("div",{className:"sandbox-control-body",children:[o.jsxs("label",{className:"sandbox-workspace-input",children:[o.jsx("span",{children:"绝对路径"}),o.jsxs("div",{children:[o.jsx("input",{value:c,disabled:s||n,spellCheck:!1,onChange:y=>u(y.target.value),onKeyDown:y=>{y.key==="Enter"&&c.startsWith("/")&&(y.preventDefault(),v(c))}}),o.jsx("button",{type:"button",disabled:s||h||!c.startsWith("/"),onClick:()=>void v(c),children:"浏览"})]})]}),o.jsxs("div",{className:"sandbox-directory-browser",children:[o.jsxs("div",{className:"sandbox-directory-head",children:[o.jsx("span",{title:d==null?void 0:d.path,children:(d==null?void 0:d.path)??c}),h?o.jsx(nl,{className:"spin"}):null]}),o.jsxs("div",{className:"sandbox-directory-list",children:[d!=null&&d.parent?o.jsxs("button",{type:"button",disabled:h,onClick:()=>void v(d.parent??"/"),children:[o.jsx(gy,{}),o.jsx("span",{children:"上一级"}),o.jsx("small",{children:d.parent}),o.jsx(aT,{})]}):null,d==null?void 0:d.directories.map(y=>o.jsxs("button",{type:"button",disabled:h,onClick:()=>void v(y.path),children:[o.jsx(gy,{}),o.jsx("span",{children:y.name}),o.jsx(aT,{})]},y.path)),!h&&(d==null?void 0:d.directories.length)===0?o.jsx("div",{className:"sandbox-directory-empty",children:"当前目录没有子目录"}):null]})]}),n?o.jsx("div",{className:"sandbox-control-note",children:"当前对话已经开始,工作空间已锁定。新建 Sandbox 会话后可重新选择。"}):null,m||i?o.jsx("div",{className:"sandbox-control-error",children:m||i}):null]}),o.jsxs("footer",{className:"sandbox-control-actions",children:[o.jsx("button",{type:"button",onClick:l,disabled:s,children:"取消"}),o.jsxs("button",{type:"button",className:"is-primary",disabled:s||n||!c.startsWith("/"),onClick:()=>a(c),children:[s?o.jsx(nl,{className:"spin"}):null,"使用此目录"]})]})]})}function FOe({approval:e,busy:t,error:n,onDecision:s}){var a;const i=(a=e==null?void 0:e.command)==null?void 0:a.trim(),r=(e==null?void 0:e.changes)===void 0?"":JSON.stringify(e.changes,null,2);return o.jsxs(Xg,{open:e!==null,title:(e==null?void 0:e.kind)==="file"?"允许修改文件?":"允许执行命令?",subtitle:"Codex 正在等待你的决定",icon:o.jsx(hC,{}),className:"sandbox-approval-dialog",onClose:()=>{t||s("cancel")},children:[o.jsxs("div",{className:"sandbox-control-body",children:[e!=null&&e.reason?o.jsx("div",{className:"sandbox-approval-reason",children:e.reason}):null,i?o.jsx("pre",{children:i}):null,r?o.jsx("pre",{children:r}):null,e!=null&&e.cwd?o.jsxs("div",{className:"sandbox-approval-meta",children:["执行目录 ",o.jsx("code",{children:e.cwd})]}):null,n?o.jsx("div",{className:"sandbox-control-error",children:n}):null]}),o.jsxs("footer",{className:"sandbox-control-actions sandbox-approval-actions",children:[o.jsx("button",{type:"button",disabled:t,onClick:()=>s("decline"),children:"拒绝"}),o.jsx("button",{type:"button",disabled:t,onClick:()=>s("accept"),children:"仅本次允许"}),o.jsxs("button",{type:"button",className:"is-primary",disabled:t,onClick:()=>s("acceptForSession"),children:[t?o.jsx(nl,{className:"spin"}):null,"本会话允许"]})]})]})}const $Oe={codex:"Codex",openclaw:"OpenClaw",hermes:"Hermes"};function HD(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t)}function HOe({session:e,onBack:t,onOpen:n,onDelete:s}){const[i,r]=g.useState(!1),[a,l]=g.useState(!1),[c,u]=g.useState(!1),[d,f]=g.useState(""),h=$Oe[e.toolName],p=async()=>{if(!(a||c)){l(!0),f("");try{await n()}catch(b){f(b instanceof Error?b.message:String(b))}finally{l(!1)}}},m=async()=>{if(!(c||a)){u(!0),f("");try{await s()}catch(b){f(b instanceof Error?b.message:String(b)),r(!1)}finally{u(!1)}}};return o.jsxs("section",{className:"sandbox-agent-details",children:[o.jsxs("header",{className:"sandbox-agent-details-header",children:[o.jsxs("button",{type:"button",className:"sandbox-agent-back",onClick:t,children:[o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),"返回智能体"]}),o.jsxs("div",{children:[o.jsx("h1",{children:e.displayName||`${h} 智能体`}),o.jsxs("p",{children:[h," AgentKit Session 详情"]})]})]}),d?o.jsx("div",{className:"sandbox-agent-detail-error",role:"alert",children:d}):null,o.jsxs("div",{className:"sandbox-agent-detail-panel",children:[o.jsxs("dl",{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"智能体类型"}),o.jsx("dd",{children:h})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"状态"}),o.jsx("dd",{children:iE(e.status)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"创建人"}),o.jsx("dd",{children:e.createdBy||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"工具类型"}),o.jsx("dd",{children:e.toolType||"—"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"创建时间"}),o.jsx("dd",{children:HD(e.createdAt)})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"过期时间"}),o.jsx("dd",{children:HD(e.expireAt)})]}),o.jsxs("div",{className:"is-wide",children:[o.jsx("dt",{children:"Session ID"}),o.jsx("dd",{children:e.id})]})]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",className:"sandbox-agent-delete",disabled:a||c,onClick:()=>r(!0),children:"删除智能体"}),o.jsx("button",{type:"button",className:"sandbox-agent-open",disabled:a||c,"aria-busy":a||void 0,onClick:()=>void p(),children:a?"打开中…":"打开智能体"})]})]}),i?o.jsx("div",{className:"confirm-scrim",onClick:()=>!c&&r(!1),children:o.jsxs("div",{className:"confirm-box",role:"alertdialog","aria-modal":"true","aria-labelledby":"sandbox-agent-delete-title",onClick:b=>b.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",id:"sandbox-agent-delete-title",children:"删除智能体?"}),o.jsxs("div",{className:"confirm-text",children:["将删除“",e.displayName||`${h} 智能体`,"”及其 AgentKit Session,此操作无法撤销。"]}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{type:"button",className:"confirm-btn",disabled:c,onClick:()=>r(!1),children:"取消"}),o.jsx("button",{type:"button",className:"confirm-btn confirm-btn--danger",disabled:c,onClick:()=>void m(),children:c?"删除中…":"确认删除"})]})]})}):null]})}const zOe="_SegmentedControl_1sl7d_1",VOe="_SegmentedControlOption_1sl7d_140",GOe="_SegmentedControlThumb_1sl7d_219",oT={SegmentedControl:zOe,SegmentedControlOption:VOe,SegmentedControlThumb:GOe},by=({value:e,onChange:t,children:n,block:s,pill:i=!0,size:r="md",gutterSize:a,className:l,onClick:c,...u})=>{const d=g.useRef(null),f=g.useRef(null),h=g.useCallback(m=>{const b=d.current,v=f.current;if(!b||!v)return;const y=b==null?void 0:b.querySelector('[data-state="on"]');if(!y)return;const x=b.clientWidth;let E=Math.floor(y.clientWidth);const w=y.offsetLeft;if(x-(E+w)<2&&(E=E-1),v.style.width=`${Math.floor(E)}px`,v.style.transform=`translateX(${w}px)`,b.scrollWidth>x){const S=x*.15,_=b.scrollLeft,T=y.offsetLeft,k=T+E;(T<_+S||k>_+x-S)&&m&&y.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},[]);ASe({ref:d,onResize:()=>{const m=f.current;if(!m)return;const b=m.style.transition;m.style.transition="",h(!1),m.style.transition=b}}),g.useLayoutEffect(()=>{const m=d.current,b=f.current;!m||!b||(h(!!b.style.transition),b.style.transition||MN(()=>{b.style.transition="width 300ms var(--cubic-enter), transform 300ms var(--cubic-enter)"}))},[h,e,r,a,i]);const p=m=>{m&&t&&t(m)};return o.jsxs(pIe,{ref:d,className:ga(oT.SegmentedControl,l),type:"single",value:e,loop:!1,onValueChange:p,onClick:c,"data-block":s?"":void 0,"data-pill":i?"":void 0,"data-size":r,"data-gutter-size":a,...u,children:[o.jsx("div",{className:oT.SegmentedControlThumb,ref:f}),n]})},KOe=({children:e,...t})=>o.jsx(xIe,{className:oT.SegmentedControlOption,...t,onPointerEnter:yH,children:o.jsx("span",{className:"relative",children:e})});by.Option=KOe;function qOe({workspace:e,onBack:t}){const[n,s]=g.useState("main"),[i,r]=g.useState(""),[a,l]=g.useState(!1),[c,u]=g.useState(""),d=e.kind==="openclaw"?"OpenClaw":"Hermes";g.useEffect(()=>{s("main"),r(""),u(""),l(!1)},[e.session.id]);const f=async()=>{if(s("terminal"),!(i||a)){l(!0),u("");try{const h=await cn.launchAgentTerminal(e.kind,e.session.id);r(h.url)}catch(h){u(h instanceof Error?h.message:String(h))}finally{l(!1)}}};return o.jsxs("section",{className:"sandbox-agent-workspace",children:[o.jsxs("header",{children:[o.jsxs("div",{className:"sandbox-agent-workspace-title",children:[o.jsx("button",{type:"button",onClick:t,"aria-label":"返回智能体列表",children:o.jsx("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:o.jsx("path",{d:"m14.5 6-6 6 6 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}),o.jsxs("div",{children:[o.jsx("h1",{children:e.session.displayName||`${d} 智能体`}),o.jsxs("p",{children:[o.jsxs("span",{children:["创建人 ",e.session.createdBy||"未知"]}),o.jsx("span",{className:"sandbox-agent-workspace-status","data-ready":e.session.status.toLowerCase()==="ready"||void 0,children:iE(e.session.status)})]})]})]}),o.jsxs(by,{className:"sandbox-agent-workspace-tabs",value:n,size:"lg",gutterSize:"lg",block:!0,pill:!1,"aria-label":"智能体工作区",onChange:h=>{h==="terminal"?f():s("main")},children:[o.jsx(by.Option,{value:"main",children:"主界面"}),o.jsx(by.Option,{value:"terminal",children:"终端"})]})]}),o.jsx("div",{className:"sandbox-agent-workspace-surface",children:n==="main"?o.jsx("iframe",{src:e.webuiUrl,title:`${d} 主界面`,allow:"clipboard-read; clipboard-write"}):a?o.jsx("div",{className:"sandbox-agent-workspace-state",role:"status",children:"正在打开终端…"}):c?o.jsxs("div",{className:"sandbox-agent-workspace-state is-error",role:"alert",children:[o.jsx("p",{children:c}),o.jsx("button",{type:"button",onClick:()=>void f(),children:"重新尝试"})]}):i?o.jsx("iframe",{src:i,title:`${d} 终端`}):null})]})}const AE=[{name:"model",usage:"/model [model]",description:"显示或切换当前对话模型",keywords:["模型","switch"]},{name:"models",usage:"/models",description:"列出 app-server 可用模型",keywords:["模型列表","list"]},{name:"skill",usage:"/skill",description:"浏览并调用当前工作区可用的 Skill",keywords:["技能","workflow"]},{name:"skills",usage:"/skills",description:"浏览并调用当前工作区可用的 Skills",keywords:["技能列表","workflow","list"]},{name:"new",usage:"/new",description:"开始一个新对话",keywords:["新建","对话"]},{name:"resume",usage:"/resume [thread]",description:"打开历史会话或恢复指定 thread",keywords:["历史","恢复","session"]},{name:"fork",usage:"/fork",description:"从当前上下文分叉一个新对话",keywords:["分叉","branch"]},{name:"compact",usage:"/compact",description:"压缩当前对话上下文",keywords:["压缩","上下文"]},{name:"archive",usage:"/archive",description:"归档当前对话并新建对话",keywords:["归档","关闭"]},{name:"status",usage:"/status",description:"显示当前连接、thread、模型与 token 状态",keywords:["状态","连接","token"]},{name:"clear",usage:"/clear",description:"清空当前视图并开始新对话",keywords:["清空","重置"]},{name:"help",usage:"/help",description:"显示 Sandbox 支持的快捷命令",keywords:["帮助","命令"]}];function YOe(e){var n;const t=e.trim().match(/^\/([^\s]+)(?:\s+([\s\S]*))?$/);if(t)return{name:t[1].toLocaleLowerCase(),argument:((n=t[2])==null?void 0:n.trim())??""}}function WOe(e){const t=e.toLocaleLowerCase();return AE.filter(n=>!t||[n.name,n.description,...n.keywords].some(s=>s.toLocaleLowerCase().includes(t))).sort((n,s)=>zD(n,t)-zD(s,t)).slice(0,12)}function zD(e,t){return t?e.name===t?0:e.name.startsWith(t)?1:e.name.includes(t)?2:3:AE.indexOf(e)}function XOe(e,t){const n=t.toLocaleLowerCase();return e.filter(s=>!n||`${s.id} ${s.displayName} ${s.description}`.toLocaleLowerCase().includes(n)).sort((s,i)=>{if(!n)return Number(i.isDefault)-Number(s.isDefault);const r=s.id.toLocaleLowerCase(),a=i.id.toLocaleLowerCase(),l=(c,u)=>c===n?0:c.startsWith(n)?1:u.toLocaleLowerCase().startsWith(n)?2:3;return l(r,s.displayName)-l(a,i.displayName)}).slice(0,12)}function QOe(){return AE.map(e=>({label:e.usage,value:e.description}))}function ZOe(e,t){return e.map(n=>{const s=n.displayName.trim(),i=s&&s!==n.id?`${s} · ${n.id}`:n.id;return{label:n.id===t?"当前模型":"可用模型",value:n.description?`${i} — ${n.description}`:i,code:!1}})}function JOe(e){const t=[{label:"Thread",value:e.threadId,code:!0},{label:"工作空间",value:e.cwd||"未设置",code:!!e.cwd}];return e.model&&t.push({label:"模型",value:e.model,code:!0}),t.push({label:"状态",value:e.busy?"运行中":"空闲"}),e.threadTotal&&t.push({label:"累计 Token",value:e.threadTotal.totalTokens.toLocaleString()}),e.modelContextWindow!==void 0&&t.push({label:"上下文窗口",value:e.modelContextWindow.toLocaleString()}),t}function eMe(e){return e.messages.map(t=>{var s;const n=[];return t.role==="user"&&((s=t.skillNames)!=null&&s.length)&&n.push({kind:"invocation",value:{skills:t.skillNames.map(i=>({name:i,description:""}))}}),t.content&&n.push({kind:"text",text:t.content}),{role:t.role,blocks:n,meta:{localId:t.id,ts:t.timestamp/1e3}}})}function tMe({appName:e,value:t,onChange:n,onSubmit:s,disabled:i,busy:r,attachments:a,onAddFiles:l,onRemoveAttachment:c,actions:u,models:d,modelsLoading:f,modelsLoaded:h,currentModel:p,onRequestModels:m,skills:b,skillsLoading:v,skillsLoaded:y,selectedSkills:x,onRequestSkills:E,onSelectedSkillsChange:w}){const S=g.useRef(null),_=g.useRef(null),T=g.useRef(null),k=g.useRef(null),[A,j]=g.useState(!1),[R,B]=g.useState(0),[z,L]=g.useState(!1);g.useLayoutEffect(()=>{const V=S.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,200)}px`)},[t]);const F=g.useMemo(()=>{if(!t.startsWith("/")||t.includes(` +`))return;const V=t.slice(1),X=V.search(/\s/),K=(X<0?V:V.slice(0,X)).toLocaleLowerCase(),ce=X<0?"":V.slice(X).trim();if(!(X>=0&&K!=="model"))return{command:K,argument:ce,modelMode:X>=0}},[t]),C=g.useMemo(()=>{const V=/(^|\s)\$([^\s$]*)$/.exec(t);if(V)return{query:V[2],start:t.length-V[2].length-1,end:t.length}},[t]),I=g.useMemo(()=>{if(C){const V=C.query.toLocaleLowerCase();return b.filter(X=>!x.some(K=>K.id===X.id||K.name===X.name)).filter(X=>`${X.name} ${X.description}`.toLocaleLowerCase().includes(V)).slice(0,12).map(X=>({kind:"skill",skill:X}))}return F!=null&&F.modelMode?XOe(d,F.argument).map(V=>({kind:"model",model:V})):F?WOe(F.command).map(V=>({kind:"command",command:V})):[]},[C,d,x,b,F]),D=!z&&!!(C||F);g.useEffect(()=>{B(0)},[t]),g.useEffect(()=>{F!=null&&F.modelMode&&!h&&!f&&m()},[h,f,m,F==null?void 0:F.modelMode]),g.useEffect(()=>{C&&!y&&!v&&E()},[C,E,y,v]);const $=a.some(V=>V.status!=="ready"),O=!i&&!r&&!$&&(t.trim().length>0||a.length>0);function te(V){L(!1),j(!1),n(V)}function se(V){if(V.kind==="skill"){if(!C)return;const X=t.slice(0,C.start)+t.slice(C.end);w([...x,V.skill]),te(X),L(!0),requestAnimationFrame(()=>{var K,ce;(K=S.current)==null||K.focus(),(ce=S.current)==null||ce.setSelectionRange(C.start,C.start)});return}if(V.kind==="model"){te(`/model ${V.model.id}`),L(!0),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()});return}if(V.command.name==="model"){te("/model "),m(),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()});return}if(V.command.name==="skill"||V.command.name==="skills"){te(`/${V.command.name}`),L(!0),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()});return}te(`/${V.command.name}`),L(!0),requestAnimationFrame(()=>{var X;return(X=S.current)==null?void 0:X.focus()})}function P(V){var X;j(!1),(X=V.current)==null||X.click()}function Q(V){const X=V.target.files?Array.from(V.target.files):[];X.length&&l(X),V.target.value=""}const ee=C?"可用 Skills":F!=null&&F.modelMode?"选择模型":"Codex 快捷命令";return o.jsxs("div",{className:"composer sandbox-codex-composer",children:[a.length>0?o.jsx(oE,{appName:e,compact:!0,items:a,onRemove:c}):null,o.jsxs("div",{className:"composer-box",children:[D?o.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":ee,children:[o.jsxs("div",{className:"composer-command-head",children:[o.jsx(IOe,{}),o.jsx("span",{children:ee}),F!=null&&F.modelMode&&p?o.jsxs("small",{children:["当前:",p]}):null,o.jsx("kbd",{children:C?"$":"/"})]}),C&&v?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(nl,{className:"spin"})," 正在发现当前工作区的 Skills…"]}):F!=null&&F.modelMode&&f?o.jsxs("div",{className:"composer-command-empty",children:[o.jsx(nl,{className:"spin"})," 正在读取模型…"]}):I.length===0?o.jsx("div",{className:"composer-command-empty",children:C?"当前工作区没有匹配的 Skill":F!=null&&F.modelMode?"没有匹配模型,也可以直接输入模型 ID":"没有匹配的快捷命令"}):o.jsx("div",{className:"composer-command-list",children:I.map((V,X)=>{const K=V.kind==="command"?`command:${V.command.name}`:V.kind==="model"?`model:${V.model.id}`:`skill:${V.skill.id}`,ce=V.kind==="command"?V.command.usage:V.kind==="model"?V.model.displayName:`$${V.skill.name}`,he=V.kind==="command"?V.command.description:V.kind==="model"?V.model.description||V.model.id:V.skill.description||"加载并执行该 Skill";return o.jsxs("button",{type:"button",role:"option","aria-selected":X===R,className:`composer-command-item${X===R?" is-active":""}`,onMouseDown:be=>{be.preventDefault(),se(V)},onMouseEnter:()=>B(X),children:[o.jsx("span",{className:`composer-command-icon composer-command-icon--${V.kind}`,"aria-hidden":"true",children:V.kind==="command"?"/":V.kind==="model"?"◇":"$"}),o.jsxs("span",{className:"composer-command-copy",children:[o.jsx("strong",{children:ce}),o.jsx("span",{children:he})]}),X===R?o.jsx("kbd",{children:"↵"}):null]},K)})})]}):null,o.jsxs("div",{className:"composer-left-controls",children:[o.jsxs("div",{className:"composer-menu-wrap",children:[o.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:i,onClick:()=>j(V=>!V),children:o.jsx(NOe,{className:"icon"})}),A?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"menu-scrim",onClick:()=>j(!1)}),o.jsxs("div",{className:"composer-menu",role:"menu",children:[o.jsxs("button",{type:"button",className:"menu-item",disabled:u.uploadBusy,onClick:()=>P(_),children:[o.jsx(kOe,{className:"icon"}),"上传图片"]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:u.uploadBusy,onClick:()=>P(T),children:[o.jsx(AOe,{className:"icon"}),"上传文档或 PDF"]}),o.jsxs("button",{type:"button",className:"menu-item",disabled:u.uploadBusy,onClick:()=>P(k),children:[o.jsx(COe,{className:"icon"}),"上传视频"]}),o.jsx("div",{className:"composer-menu-separator",role:"separator"}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{j(!1),u.onOpenTerminal()},children:[o.jsx(NG,{className:"icon"}),"进入终端"]}),o.jsxs("button",{type:"button",className:"menu-item",onClick:()=>{j(!1),u.onOpenBrowser()},children:[o.jsx(TG,{className:"icon"}),"查看浏览器"]})]})]}):null]}),o.jsx("button",{type:"button",className:"comp-icon sandbox-composer-control",title:"Codex 权限","aria-label":"Codex 权限",disabled:u.settingsBusy||r,onClick:u.onOpenPermissions,children:o.jsx(hC,{})}),o.jsx("button",{type:"button",className:`comp-icon sandbox-composer-control${u.workspaceLocked?" is-locked":""}`,title:u.workspaceLocked?"对话已开始,工作空间已锁定":"选择工作空间","aria-label":"Codex 工作空间",disabled:u.settingsBusy||r,onClick:u.onOpenWorkspace,children:o.jsx(gy,{})})]}),o.jsxs("div",{className:"composer-input-stack sandbox-composer-input",children:[x.length>0?o.jsx(aE,{skillPrefix:"$",value:{skills:x.map(({name:V,description:X})=>({name:V,description:X}))},onRemoveSkill:V=>w(x.filter(X=>X.name!==V))}):null,o.jsx("textarea",{ref:S,className:"comp-input scroll",rows:1,value:t,disabled:i,placeholder:"向 AgentKit 沙箱发送消息,输入 / 查看命令,输入 $ 调用 Skill…","aria-expanded":D,onChange:V=>te(V.target.value),onBlur:()=>window.setTimeout(()=>L(!0),0),onKeyDown:V=>{if(!AA(V.nativeEvent)){if(D){if((V.key==="ArrowDown"||V.key==="Tab"&&!V.shiftKey)&&I.length>0){V.preventDefault(),B(X=>(X+1)%I.length);return}if((V.key==="ArrowUp"||V.key==="Tab"&&V.shiftKey)&&I.length>0){V.preventDefault(),B(X=>(X-1+I.length)%I.length);return}if(V.key==="Enter"&&!V.shiftKey&&I[R]){V.preventDefault(),se(I[R]);return}if(V.key==="Escape"){V.preventDefault(),L(!0);return}}if(V.key==="Backspace"&&!t&&V.currentTarget.selectionStart===0&&x.length>0){V.preventDefault(),w(x.slice(0,-1));return}V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),O&&s(t))}}})]}),o.jsx("button",{type:"button",className:"comp-send",disabled:!O,onClick:()=>s(t),"aria-label":"发送",children:r?o.jsx(nl,{className:"icon spin"}):o.jsx(TOe,{className:"icon"})})]}),o.jsx("input",{ref:_,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:Q}),o.jsx("input",{ref:T,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:Q}),o.jsx("input",{ref:k,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:Q})]})}function nMe({session:e,conversationBusy:t,onInputChange:n,onSessionPatch:s,onSnapshot:i,onActivity:r,onError:a}){const l=g.useRef((e==null?void 0:e.id)??"");l.current=(e==null?void 0:e.id)??"";const[c,u]=g.useState(!1),[d,f]=g.useState([]),[h,p]=g.useState(!1),[m,b]=g.useState(!1),[v,y]=g.useState([]),[x,E]=g.useState(!1),[w,S]=g.useState(!1),[_,T]=g.useState([]),[k,A]=g.useState(!1),[j,R]=g.useState([]),[B,z]=g.useState(!1),[L,F]=g.useState("");g.useEffect(()=>{u(!1),f([]),p(!1),b(!1),y([]),E(!1),S(!1),T([]),A(!1),R([]),z(!1),F("")},[e==null?void 0:e.id]);const C=g.useCallback(async()=>{const P=l.current;if(!P)return[];p(!0);try{const Q=await cn.listModels(P);return l.current===P&&(f(Q),b(!0)),Q}catch(Q){return l.current===P&&(b(!0),a(Q instanceof Error?Q.message:String(Q))),[]}finally{l.current===P&&p(!1)}},[a]),I=g.useCallback(async()=>{const P=l.current;if(!P)return[];E(!0);try{const Q=await cn.listSkills(P);return l.current===P&&(y(Q),S(!0)),Q}catch(Q){return l.current===P&&(S(!0),a(Q instanceof Error?Q.message:String(Q))),[]}finally{l.current===P&&E(!1)}},[a]),D=g.useCallback(async()=>{const P=l.current;if(P){A(!0),z(!0),F("");try{const Q=await cn.listThreads(P);l.current===P&&R(Q.threads)}catch(Q){l.current===P&&F(Q instanceof Error?Q.message:String(Q))}finally{l.current===P&&z(!1)}}},[]);function $(P){i(P),T([]),y([]),S(!1),A(!1)}async function O(P){const Q=l.current;if(!(!Q||c||t)){if(P===(e==null?void 0:e.threadId)){A(!1);return}u(!0),a("");try{const ee=await cn.resumeThread(Q,P);if(l.current!==Q)return;$(ee),r("已恢复 Codex 对话",[{label:"Thread",value:ee.threadId,code:!0}])}catch(ee){l.current===Q&&a(ee instanceof Error?ee.message:String(ee))}finally{l.current===Q&&u(!1)}}}async function te(P){const Q=e,ee=P.trim();if(!ee.startsWith("/"))return!1;if(!Q||t||c)return!0;const V=YOe(ee),X=V&&AE.find(K=>K.name===V.name);if(!V||!X)return a(`未知快捷命令:${ee.split(/\s/,1)[0]}。输入 /help 查看可用命令。`),!0;if(a(""),T([]),X.name==="model"&&!V.argument)return n("/model "),m||await C(),!0;if(X.name==="skill"||X.name==="skills")return n("$"),w||(await I()).length===0&&n(""),!0;if(X.name==="resume"&&!V.argument)return n(""),await D(),!0;n(""),u(!0);try{if(X.name==="model"){const K=await cn.setModel(Q.id,V.argument);if(l.current!==Q.id)return!0;s({model:K}),r("已切换 Codex 模型",[{label:"模型",value:K,code:!0}])}else if(X.name==="models"){const K=m?d:await C();if(l.current!==Q.id)return!0;r(K.length>0?"Codex 可用模型":"当前没有可用模型",ZOe(K,Q.model))}else if(X.name==="new"||X.name==="clear"){const K=await cn.newThread(Q.id);if(l.current!==Q.id)return!0;$(K),r("已新建 Codex 对话",[{label:"Thread",value:K.threadId,code:!0}])}else if(X.name==="resume"){const K=await cn.resumeThread(Q.id,V.argument);if(l.current!==Q.id)return!0;$(K),r("已恢复 Codex 对话",[{label:"Thread",value:K.threadId,code:!0}])}else if(X.name==="fork"){const K=await cn.forkThread(Q.id);if(l.current!==Q.id)return!0;$(K),r("已分叉 Codex 对话",[{label:"Thread",value:K.threadId,code:!0}])}else if(X.name==="compact"){if(await cn.compactThread(Q.id),l.current!==Q.id)return!0;r("已开始压缩当前 Codex 对话",[{label:"Thread",value:Q.threadId,code:!0}])}else if(X.name==="archive"){const K=Q.threadId,ce=await cn.archiveThread(Q.id,K);if(l.current!==Q.id)return!0;ce.snapshot&&$(ce.snapshot),r("已归档 Codex 对话",[{label:"Thread",value:K,code:!0}])}else if(X.name==="status"){const K=await cn.getStatus(Q.id);if(l.current!==Q.id)return!0;s(K),r("Codex 当前状态",JOe(K))}else X.name==="help"&&r("Sandbox 支持的 Codex 快捷命令",QOe())}catch(K){l.current===Q.id&&(n(ee),a(K instanceof Error?K.message:String(K)))}finally{l.current===Q.id&&u(!1)}return!0}function se(){y([]),S(!1),T([])}return{commandBusy:c,models:d,modelsLoading:h,modelsLoaded:m,loadModels:C,skills:v,skillsLoading:x,skillsLoaded:w,loadSkills:I,selectedSkills:_,setSelectedSkills:T,invalidateSkills:se,threadsOpen:k,threads:j,threadsLoading:B,threadsError:L,openThreads:D,closeThreads:()=>{c||(A(!1),F(""))},resumeThread:O,executeSlash:te}}const sMe={volcengine:"火山引擎 AgentKit 提供企业级 Agent 解决方案",byteplus:"BytePlus AgentKit 提供企业级 Agent 解决方案"},iMe={volcengine:"https://docs.volcengine.com/docs/86681/1925174?lang=zh",byteplus:"https://docs.byteplus.com/en/docs/legal"};function rMe(e){return e.toLowerCase()==="github"?o.jsx(Hee,{className:"icon"}):o.jsx(qee,{className:"icon"})}function aMe({branding:e,cloudProvider:t,onUsername:n}){const[s,i]=g.useState(null),[r,a]=g.useState(""),[l,c]=g.useState(0),[u,d]=g.useState(""),f=g.useRef(null);g.useEffect(()=>{let v=!0;return i(null),a(""),KB().then(y=>{v&&i(y)}).catch(y=>{v&&a(y instanceof Error?y.message:String(y))}),()=>{v=!1}},[l]);const h=s!==null&&s.length===0;g.useEffect(()=>{var v;h&&((v=f.current)==null||v.focus())},[h]);const p=bte.test(u),m=t==="byteplus"?m2:p2,b=()=>{p&&n(u)};return o.jsxs("div",{className:"login",children:[o.jsx("header",{className:"login-top",children:o.jsxs("span",{className:"login-brand",children:[o.jsx("img",{className:"login-brand-logo",src:e.logoUrl||m,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),o.jsx("main",{className:"login-main",children:o.jsxs("div",{className:"login-card",children:[o.jsx(Pa,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),r?o.jsxs("div",{className:"login-provider-error",role:"alert",children:[o.jsx("p",{children:r}),o.jsx("button",{type:"button",onClick:()=>c(v=>v+1),children:"重试"})]}):s===null?null:s.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"登录以继续使用"}),o.jsx("div",{className:"login-providers",children:s.map(v=>o.jsxs("button",{className:"login-btn",onClick:()=>xte(v.loginUrl),children:[rMe(v.id),o.jsxs("span",{children:["使用 ",v.label," 登录"]})]},v.id))})]}):o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),o.jsxs("form",{className:"login-name",onSubmit:v=>{v.preventDefault(),b()},children:[o.jsx("input",{ref:f,className:"login-name-input",value:u,onChange:v=>d(v.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16}),o.jsx("button",{type:"submit",className:"login-name-go",disabled:!p,"aria-label":"进入",children:o.jsx(Kp,{className:"icon"})})]}),o.jsx("p",{className:"login-hint","aria-live":"polite",children:u&&!p?"只能包含大小写字母和数字,最多 16 位。":""})]}),o.jsx("p",{className:"login-powered",children:sMe[t]}),o.jsxs("p",{className:"login-legal",children:["继续即表示你已阅读并同意 AgentKit"," ",o.jsx("a",{href:iMe[t],target:"_blank",rel:"noreferrer",children:"产品和服务条款"})]})]})}),o.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function oMe({open:e,checking:t,error:n,onLogin:s}){const i=g.useRef(null);return g.useEffect(()=>{var a;if(!e)return;const r=document.body.style.overflow;return document.body.style.overflow="hidden",(a=i.current)==null||a.focus(),()=>{document.body.style.overflow=r}},[e]),e?wi.createPortal(o.jsx("div",{className:"auth-expired-backdrop",children:o.jsxs("section",{className:"auth-expired-dialog",role:"alertdialog","aria-modal":"true","aria-labelledby":"auth-expired-title","aria-describedby":"auth-expired-description",children:[o.jsx("div",{className:"auth-expired-mark","aria-hidden":"true",children:o.jsx(Gk,{})}),o.jsxs("div",{className:"auth-expired-copy",children:[o.jsx("h2",{id:"auth-expired-title",children:"登录状态已过期"}),o.jsx("p",{id:"auth-expired-description",children:"当前编辑内容会保留。重新登录后,刚才的操作将自动继续。"}),n&&o.jsx("p",{className:"auth-expired-error",role:"alert",children:n})]}),o.jsx("footer",{className:"auth-expired-actions",children:o.jsx("button",{ref:i,type:"button",onClick:s,disabled:t,children:t?"等待登录完成…":"重新登录"})})]})}),document.body):null}const lMe=[{value:"slow",label:"执行速度慢"},{value:"crash",label:"运行崩溃"},{value:"incorrect",label:"结果不准确"},{value:"tool_error",label:"工具调用失败"},{value:"other",label:"其他问题"}];function cMe(e){return o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round","aria-hidden":"true",...e,children:[o.jsx("path",{d:"m7 7 10 10"}),o.jsx("path",{d:"m17 7-10 10"})]})}function uMe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function dMe({onClose:e,onSubmit:t}){const n=g.useId(),s=g.useId(),i=g.useRef(null),r=g.useRef(null),a=g.useRef(!1),l=g.useRef(e),[c,u]=g.useState(()=>new Set),[d,f]=g.useState(""),[h,p]=g.useState(!1),[m,b]=g.useState(""),[v,y]=g.useState(!1);a.current=h,l.current=e,g.useEffect(()=>{var k;const S=document.body.style.overflow,_=document.activeElement instanceof HTMLElement?document.activeElement:null;document.body.style.overflow="hidden",(k=r.current)==null||k.focus();const T=A=>{var z;if(A.key==="Escape"&&!a.current){A.preventDefault(),l.current();return}if(A.key!=="Tab")return;const j=Array.from(((z=i.current)==null?void 0:z.querySelectorAll("button:not(:disabled), textarea:not(:disabled)"))??[]);if(j.length===0)return;const R=j[0],B=j[j.length-1];A.shiftKey&&document.activeElement===R?(A.preventDefault(),B.focus()):!A.shiftKey&&document.activeElement===B&&(A.preventDefault(),R.focus())};return window.addEventListener("keydown",T),()=>{document.body.style.overflow=S,window.removeEventListener("keydown",T),_!=null&&_.isConnected&&_.focus()}},[]);const x=S=>{u(_=>{const T=new Set(_);return T.has(S)?T.delete(S):T.add(S),T})},E=async()=>{if(!(h||v)){p(!0),b("");try{await t({issues:[...c],description:d.trim()}),y(!0)}catch(S){b(S instanceof Error?S.message:String(S))}finally{p(!1)}}},w=c.size>0||d.trim().length>0;return wi.createPortal(o.jsx("div",{className:"issue-feedback-backdrop",onMouseDown:S=>{S.target===S.currentTarget&&!h&&e()},children:o.jsxs("section",{ref:i,className:"issue-feedback-dialog",role:"dialog","aria-modal":"true","aria-labelledby":n,"aria-describedby":v?`${s}-success`:s,"aria-busy":h||void 0,children:[o.jsxs("header",{className:"issue-feedback-head",children:[o.jsx("h2",{id:n,children:"问题反馈"}),o.jsx("button",{type:"button",className:"issue-feedback-close",onClick:e,disabled:h,"aria-label":"关闭问题反馈",children:o.jsx(cMe,{})})]}),v?o.jsxs("div",{className:"issue-feedback-success",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"issue-feedback-success-mark","aria-hidden":"true",children:o.jsx(uMe,{})}),o.jsxs("div",{children:[o.jsx("h3",{children:"上报成功,感谢您的反馈"}),o.jsx("p",{id:`${s}-success`,children:"AgentKit 团队会尽快查看您提交的问题。"})]})]}):o.jsxs("div",{className:"issue-feedback-body",children:[o.jsx("p",{id:s,className:"issue-feedback-intro",children:"请选择遇到的问题,也可以补充具体表现。"}),o.jsx("p",{className:"issue-feedback-privacy",role:"alert",children:"您的对话数据将会上报到 AgentKit 团队,请注意隐私保护。"}),o.jsx("div",{className:"issue-feedback-chips","aria-label":"常见问题",children:lMe.map(S=>o.jsx("button",{type:"button",className:"issue-feedback-chip","aria-pressed":c.has(S.value),onClick:()=>x(S.value),disabled:h,children:S.label},S.value))}),o.jsxs("label",{className:"issue-feedback-field",children:[o.jsx("span",{children:"问题描述"}),o.jsx("textarea",{ref:r,value:d,onChange:S=>f(S.target.value),placeholder:"请描述问题发生时的表现(选填)",maxLength:4e3,rows:5,disabled:h})]}),m&&o.jsx("p",{className:"issue-feedback-error",role:"alert",children:m})]}),o.jsx("footer",{className:"issue-feedback-actions",children:v?o.jsx("button",{type:"button",className:"is-primary",onClick:e,children:"完成"}):o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:e,disabled:h,children:"取消"}),o.jsx("button",{type:"button",className:"is-primary",onClick:()=>void E(),disabled:!w||h,children:h?"正在上报…":"提交反馈"})]})})]})}),document.body)}const fMe=[{value:"conversation",label:"对话"},{value:"agents",label:"智能体"},{value:"applications",label:"自动化"},{value:"search",label:"搜索"},{value:"other",label:"其他"}],hMe=[{value:"page_slow",label:"页面加载慢"},{value:"feature_unavailable",label:"功能无法使用"},{value:"display_error",label:"页面显示异常"},{value:"no_response",label:"操作无响应"},{value:"other",label:"其他问题"}],pMe=["点击后没有反应","页面一直处于加载状态","部分内容显示不完整","操作后出现错误提示"];function mMe(e){return o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:o.jsx("path",{d:"m5 12.5 4.2 4.2L19 7"})})}function gMe({initialModule:e,onSubmit:t}){const n=g.useRef(null),[s,i]=g.useState(()=>new Set),[r,a]=g.useState(e),[l,c]=g.useState(""),[u,d]=g.useState(!1),[f,h]=g.useState(""),[p,m]=g.useState(!1),b=E=>{i(w=>{const S=new Set(w);return S.has(E)?S.delete(E):S.add(E),S})},v=E=>{var w;c(S=>S.trim()?S.includes(E)?S:`${S.trimEnd()} +${E}`:E),(w=n.current)==null||w.focus()},y=async E=>{if(E.preventDefault(),!(u||p)){d(!0),h("");try{await t({module:r,issues:[...s],description:l.trim()}),m(!0)}catch(w){h(w instanceof Error?w.message:String(w))}finally{d(!1)}}},x=s.size>0||l.trim().length>0;return o.jsxs("div",{className:"platform-feedback-page",children:[o.jsxs("header",{className:"platform-feedback-header",children:[o.jsx("h1",{children:"问题反馈"}),o.jsx("p",{children:"告诉我们您在使用 AgentKit Studio 时遇到的问题。"})]}),o.jsx("div",{className:"platform-feedback-scroll",children:p?o.jsxs("section",{className:"platform-feedback-success","aria-labelledby":"feedback-success-title","aria-live":"polite",role:"status",children:[o.jsx("span",{className:"platform-feedback-success-icon","aria-hidden":"true",children:o.jsx(mMe,{})}),o.jsxs("div",{children:[o.jsx("h2",{id:"feedback-success-title",children:"上报成功,感谢您的反馈"}),o.jsx("p",{children:"AgentKit 团队会尽快查看您提交的问题。"})]})]}):o.jsxs("form",{className:"platform-feedback-form",onSubmit:E=>void y(E),children:[o.jsxs("section",{className:"platform-feedback-section",children:[o.jsx("div",{className:"platform-feedback-section-heading",children:o.jsx("h2",{children:"所属模块"})}),o.jsx("div",{className:"platform-feedback-pills","aria-label":"所属模块",children:fMe.map(E=>o.jsx("button",{type:"button","aria-pressed":r===E.value,onClick:()=>a(E.value),disabled:u,children:E.label},E.value))})]}),o.jsx("section",{className:"platform-feedback-section",children:o.jsxs("div",{className:"platform-feedback-suggestions",children:[o.jsx("span",{children:"常见问题(可多选)"}),o.jsx("div",{className:"platform-feedback-pills","aria-label":"问题类型",children:hMe.map(E=>o.jsx("button",{type:"button","aria-pressed":s.has(E.value),onClick:()=>b(E.value),disabled:u,children:E.label},E.value))})]})}),o.jsxs("section",{className:"platform-feedback-section",children:[o.jsxs("label",{className:"platform-feedback-field",children:[o.jsx("span",{children:"问题描述"}),o.jsx("textarea",{ref:n,value:l,onChange:E=>c(E.target.value),placeholder:"请描述问题发生时的页面、操作和表现",maxLength:4e3,rows:6,disabled:u})]}),o.jsxs("div",{className:"platform-feedback-suggestions",children:[o.jsx("span",{children:"快捷补充"}),o.jsx("div",{className:"platform-feedback-pills","aria-label":"问题描述推荐",children:pMe.map(E=>o.jsx("button",{type:"button",onClick:()=>v(E),disabled:u,children:E},E))})]})]}),o.jsx("p",{className:"platform-feedback-privacy",role:"alert",children:"您的数据将会上报到 AgentKit 团队,请注意隐私保护。"}),f&&o.jsx("p",{className:"platform-feedback-error",role:"alert",children:f}),o.jsx("div",{className:"platform-feedback-actions",children:o.jsx("button",{type:"submit",disabled:!x||u,children:u?"正在上报…":"提交反馈"})})]})})]})}function bMe({node:e,ctx:t}){const n=e.variant??"default";return o.jsx("button",{type:"button",className:`a2ui-button a2ui-button--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,onClick:()=>t.dispatchAction(e.action,e),children:t.render(e.child)})}Bu("Button",bMe);function yMe({node:e,ctx:t}){return o.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Bu("Card",yMe);const xMe={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},EMe={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function kG(e){return xMe[e]??"flex-start"}function AG(e){return EMe[e]??"stretch"}function vMe({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:kG(e.justify),alignItems:AG(e.align)},children:n.map(s=>t.render(s))})}Bu("Column",vMe);function wMe({node:e}){const t=e.axis==="vertical";return o.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Bu("Divider",wMe);const _Me={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function SMe({node:e}){const t=e.name??"";return o.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:_Me[t]??"•"})}Bu("Icon",SMe);function NMe({node:e,ctx:t}){const n=e.children??[];return o.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:kG(e.justify),alignItems:AG(e.align??"center")},children:n.map(s=>t.render(s))})}Bu("Row",NMe);const TMe=new Set(["h1","h2","h3","h4","h5"]);function kMe({node:e,ctx:t}){const n=e.variant??"body",s=t.resolveString(e.text),i=TMe.has(n)?n:"p";return o.jsx(i,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:s})}Bu("Text",kMe);function AMe(e){return e==="agents"?"agents":e==="applications"?"applications":e==="search"?"search":["conversation","new-chat","sandbox"].includes(e)?"conversation":"other"}async function m_(e){const[t,n,s]=await Promise.allSettled([bOe(),yOe(),u2(e)]);return{agentId:e,ready:!0,harnessEnabled:s.status==="fulfilled",builtinTools:s.status==="fulfilled"?s.value:[],temporaryEnabled:t.status==="fulfilled"&&t.value.enabled,skillCreateEnabled:n.status==="fulfilled"&&n.value.enabled}}const Na={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},CMe=600,IMe=1e3,jMe=5e3,RMe=500,OMe=new Set,MMe=[];function Sa(){return{skills:[]}}function g_(e){return`${NE(e)}.active`}function lT(e){return`veadk.agentOrder.${encodeURIComponent(e)}`}function LMe(e){if(!e)return[];try{const t=JSON.parse(localStorage.getItem(lT(e))||"[]");return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function cT(e,t){if(e.name===t||e.id===t)return e;for(const n of e.children){const s=cT(n,t);if(s)return s}}function CG(e){const t=[];for(const n of e.children)n.mentionable&&(t.push({name:n.name,description:n.description,type:n.type,path:n.path}),t.push(...CG(n)));return t}function VD(){const e=typeof localStorage<"u"?localStorage.getItem(Na.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function DMe({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3.75",y:"3.75",width:"16.5",height:"16.5",rx:"3.25"}),o.jsx("path",{d:"M12 8.5v7M8.5 12h7"}),o.jsx("path",{d:"M6.75 6.75h1M16.25 17.25h1",opacity:"0.6"})]})}function PMe({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"3.5",y:"5",width:"17",height:"14.75",rx:"2.25"}),o.jsx("path",{d:"M3.5 9h17M9.25 12.25 7.1 14.4l2.15 2.15M14.75 12.25l2.15 2.15-2.15 2.15M12.8 11.85l-1.6 5.1"})]})}function BMe({className:e}){return o.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"2.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),o.jsx("path",{d:"M5.25 8.5h1.5M5.25 11.5h1.5"}),o.jsx("rect",{x:"14.75",y:"5",width:"6.5",height:"14",rx:"1.6"}),o.jsx("path",{d:"M17.25 15.5h1.5M17.25 12.5h1.5M8.75 12h6.5m-2.5-2.5 2.5 2.5-2.5 2.5"})]})}function UMe(){return o.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[o.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),o.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),o.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function uT(e){return e?new Date(e*1e3).toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):""}function FMe(e){if(!e)return"";const t=[];return e.ts&&t.push(uT(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function $c(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}function GD(e,t){for(let n=t-1;n>=0;n-=1)if(e[n].role==="user")return $c(e[n]);return""}const $Me="send_a2ui_json_to_client";function HMe(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"||t.kind==="artifact"?t.files.length>0:t.kind==="tool"?!(t.name===$Me&&t.done):t.kind==="agent-transfer"?!1:t.kind==="a2ui"?BH(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function zMe(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function VMe(e){return new Promise((t,n)=>{let s="";try{s=new URL(e,window.location.href).protocol}catch{}if(s!=="http:"&&s!=="https:"){n(new Error("授权链接不是 http/https 地址,已阻止打开。"));return}const i=window.open(e,"veadk_oauth","width=520,height=720");if(!i){n(new Error("弹窗被拦截,请允许弹窗后重试。"));return}let r=!1;const a=()=>{clearInterval(u),window.removeEventListener("message",c)},l=d=>{if(!r){r=!0,a();try{i.close()}catch{}t(d)}},c=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&l(f.url)};window.addEventListener("message",c);const u=setInterval(()=>{if(!r){if(i.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(r=!0,t(d.trim())):n(new Error("授权已取消。"));return}try{const d=i.location.href;d&&d!=="about:blank"&&new URL(d).origin===window.location.origin&&/[?&](code|state|error)=/.test(d)&&l(d)}catch{}}},500)})}function GMe(e,t){const n=JSON.parse(JSON.stringify(e??{})),s=n.exchangedAuthCredential??n.exchanged_auth_credential??{},i=s.oauth2??{};return i.authResponseUri=t,i.auth_response_uri=t,s.oauth2=i,n.exchangedAuthCredential=s,n}function KD({text:e}){const[t,n]=g.useState(!1);return o.jsx("button",{className:"icon-btn",title:t?"已复制":"复制",disabled:!e,onClick:async()=>{if(e)try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)}catch{}},children:t?o.jsx(Ha,{className:"icon"}):o.jsx(bx,{className:"icon"})})}const qD=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],YD=()=>qD[Math.floor(Math.random()*qD.length)];function b_(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function WD(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function XD(e){var n;if(e.type)return e.type;const t=(n=e.name.split(".").pop())==null?void 0:n.toLowerCase();return t==="md"||t==="markdown"?"text/markdown":t==="txt"?"text/plain":"application/octet-stream"}const KMe={"read-only":"只读","workspace-write":"工作区写入","danger-full-access":"完全访问"},qMe={untrusted:"仅不可信命令","on-request":"按需审批",never:"不审批"},YMe={user:"由我审批",auto_review:"自动审查"};function WMe(e,t){const n=e.kind==="file"?"文件修改":"命令执行";return t==="accept"?`已允许本次${n}`:t==="acceptForSession"?`已在本会话中允许${n}`:t==="decline"?`已拒绝${n}`:`已取消${n}审批`}function XMe(e){var n,s,i;const t=[];return(n=e.command)!=null&&n.trim()&&t.push({label:"命令",value:e.command.trim(),code:!0}),(s=e.grantRoot)!=null&&s.trim()&&t.push({label:"授权路径",value:e.grantRoot.trim(),code:!0}),(i=e.cwd)!=null&&i.trim()&&t.push({label:"执行目录",value:e.cwd.trim(),code:!0}),t}function QD(e){return e.flatMap(t=>t.apps.map(n=>ho(t.id,n)))}function QMe(e,t){var n;return((n=e.find(s=>s.runtimeId&&s.apps.some(i=>ho(s.id,i)===t)))==null?void 0:n.runtimeId)??""}function ZMe(e,t){for(const n of e){const s=n.apps.find(i=>ho(n.id,i)===t);if(s&&n.runtimeId)return{runtimeId:n.runtimeId,region:n.region??"cn-beijing",appName:s}}return null}function JMe(){const[e,t]=g.useState([]),[n,s]=g.useState(""),[i,r]=g.useState([]),[a,l]=g.useState(""),c=g.useRef(null),[u,d]=g.useState(!1),[f,h]=g.useState([]),[p,m]=g.useState(null),[b,v]=g.useState([]),[y,x]=g.useState(!1),[E,w]=g.useState(!1),[S,_]=g.useState(""),[T,k]=g.useState(!1),[A,j]=g.useState(!1),[R,B]=g.useState(null),[z,L]=g.useState(null),[F,C]=g.useState(!1),[I,D]=g.useState(""),[$,O]=g.useState(null),[te,se]=g.useState(!1),[P,Q]=g.useState(""),[ee,V]=g.useState(!1),[X,K]=g.useState(!1),[ce,he]=g.useState("confirm"),[be,ue]=g.useState(""),[we,Le]=g.useState("codex"),[Ne,ae]=g.useState(!1),[me,_e]=g.useState(0),[Je,Pe]=g.useState(null),[Fe,Ye]=g.useState(null),Ce=g.useRef(null),Ve=g.useRef(null),Ue=g.useRef((p==null?void 0:p.id)??""),W=g.useRef(""),oe=g.useRef(0),Z=g.useRef(new Set);Ue.current=(p==null?void 0:p.id)??"",g.useEffect(()=>()=>{for(const M of Z.current)URL.revokeObjectURL(M);Z.current.clear()},[]);function Ee(M){const U=URL.createObjectURL(M);return Z.current.add(U),U}function Me(M){!M||!Z.current.delete(M)||URL.revokeObjectURL(M)}function lt(){for(const M of Z.current)URL.revokeObjectURL(M);Z.current.clear()}const[Ot,ut]=g.useState({}),xn=a?Ot[a]??[]:f,xt=p?b:xn,wt=(M,U)=>ut(Y=>({...Y,[M]:typeof U=="function"?U(Y[M]??[]):U}));function En(M,U,Y=[],re=""){if(Ue.current!==M)return;const xe=crypto.randomUUID(),ke={role:"system",blocks:[],activity:{id:xe,title:U,...Y.length>0?{details:Y}:{}},meta:{localId:xe,ts:Date.now()/1e3}};v(ze=>{if(!re)return[...ze,ke];const nt=ze.findIndex(Xe=>{var ct;return((ct=Xe.meta)==null?void 0:ct.localId)===re});return nt<0?[...ze,ke]:[...ze.slice(0,nt),ke,...ze.slice(nt)]})}const[Ut,Pt]=g.useState(""),[at,ft]=g.useState("agent"),[He,_t]=g.useState(null),[ye,We]=g.useState({}),Ge=g.useRef(new Map),ht=!n||ye.ready===!0&&ye.agentId===n,[Vn,un]=g.useState(null),[Ht,sn]=g.useState(!1),kn=g.useRef(0),[zt,ot]=g.useState([]),[An,mn]=g.useState(Sa),[At,Os]=g.useState(null),[Ms,bs]=g.useState(0),[vn,Gn]=g.useState(!1),[ls,Kn]=g.useState(null),[Ss,Ns]=g.useState(!1),[hi,Cn]=g.useState([]),[Ks,cs]=g.useState(!1),qn=g.useRef(new Set),[Yn,Wn]=g.useState(()=>new Set),[Ls,ys]=g.useState(()=>new Set),[gn,fn]=g.useState(()=>new Set),dn=g.useRef(new Map),rn=g.useRef(new Map),an=g.useRef(void 0),xs=g.useRef(()=>{}),de=(M,U)=>Wn(Y=>{const re=new Set(Y);return U?re.add(M):re.delete(M),re}),Ie=M=>{const U=rn.current.get(M);U!==void 0&&window.clearTimeout(U),rn.current.delete(M),ys(Y=>new Set(Y).add(M))},Be=M=>{const U=rn.current.get(M);U!==void 0&&window.clearTimeout(U);const Y=window.setTimeout(()=>{rn.current.delete(M),ys(re=>{const xe=new Set(re);return xe.delete(M),xe})},2400);rn.current.set(M,Y)},it=(M,U)=>{fn(Y=>{if(Y.has(M)===U)return Y;const re=new Set(Y);return re.delete(M),re})},et=g.useRef(""),[Et,je]=g.useState(""),[Ln,us]=g.useState(""),[pi,ri]=g.useState(()=>new Set),[Xn,Jt]=g.useState(null),[vt,Dn]=g.useState(null),[mi,qa]=g.useState(!1),[ba,wc]=g.useState(),[nr,Hu]=g.useState(YD),[qs,ie]=g.useState(null),[Qt,Pn]=g.useState(!1),[Ts,en]=g.useState(!1),[ks,Vr]=g.useState(""),Gr=g.useRef(!1),[ne,Se]=g.useState(null),[ge,st]=g.useState(""),[on,bn]=g.useState(),[St,qt]=g.useState(null),wn=(St==null?void 0:St.capabilities.runtimeScope)??"mine",[Ds,sr]=g.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[zi,wr]=g.useState("cloud"),[Qn,ir]=g.useState(Rm),[Dt,Ps]=g.useState("volcengine"),[Eo,Sh]=g.useState(""),[Qg,Zg]=g.useState(!1),[vo,ai]=g.useState(!1),[CE,Jg]=g.useState(!1),[e0,Ya]=g.useState({}),[IE,t0]=g.useState({}),[n0,wo]=g.useState({}),s0=Yn.has(a),_o=Ls.has(a),So=s0||u,ml=!!a&&Ss,Wa=p?y:So,i0=Wa||!p&&_o,Zn=nMe({session:p,conversationBusy:y,onInputChange:Pt,onSessionPatch:M=>{const U=Ue.current;m(Y=>(Y==null?void 0:Y.id)===U?{...Y,...M}:Y)},onSnapshot:M=>{const U=Ue.current;lt(),v(eMe(M)),m(Y=>(Y==null?void 0:Y.id)===U?{...Y,threadId:M.threadId,cwd:M.cwd??Y.cwd,model:M.model??Y.model,workspaceLocked:M.workspaceLocked,permissions:M.permissions,busy:!1}:Y)},onActivity:(M,U=[])=>{const Y=Ue.current;Y&&En(Y,M,U)},onError:je}),jE=e0[a]??"",RE=IE[a]??OMe,OE=n0[a]??MMe,Vi=At==null?void 0:At.graph,r0=[At==null?void 0:At.name,Vi==null?void 0:Vi.name,Vi==null?void 0:Vi.id].filter(M=>!!M),zu=An.targetAgent&&Vi?cT(Vi,An.targetAgent.name):Vi,a0=(zu==null?void 0:zu.skills)??(An.targetAgent?[]:(At==null?void 0:At.skills)??[]),o0=Vi?CG(Vi):[];function Nh(M){b_(M);for(const U of M)U.status==="uploading"?qn.current.add(U.id):U.uri&&Qb(n,U.uri).catch(Y=>je(String(Y)))}function Vu(){kn.current+=1;const M=Vn;un(null),sn(!1),M&&!M.id.startsWith("pending-")&&nRe(M.id).catch(U=>{je(U instanceof Error?U.message:String(U))})}async function Gu(M){try{await PS(n,ge,M),await DS(n,ge,M),r(U=>U.filter(Y=>Y.id!==M)),ut(U=>{const{[M]:Y,...re}=U;return re})}catch(U){je(String(U))}}function ME(M){const U=zt.find(xe=>xe.id===M);if(!U)return;const Y=zt.filter(xe=>xe.id!==M);b_([U]),U.status==="uploading"&&qn.current.add(M),ot(Y),Y.length===0&&!Ut.trim()&&!!a&&xt.length===0?(et.current="",l(""),Gu(a)):U.uri&&Qb(n,U.uri).catch(xe=>je(String(xe)))}const l0=(M,U)=>{var ke,ze,nt,Xe,ct;const Y=U.author&&U.author!=="user"?U.author:void 0;Y&&(Ya(Ze=>({...Ze,[M]:Y})),t0(Ze=>({...Ze,[M]:new Set(Ze[M]??[]).add(Y)})),wo(Ze=>{var Ke;return(Ke=Ze[M])!=null&&Ke.length?Ze:{...Ze,[M]:[Y]}}));const re=((ke=U.actions)==null?void 0:ke.transferToAgent)??((ze=U.actions)==null?void 0:ze.transfer_to_agent);re&&wo(Ze=>{const Ke=Ze[M]??[];return Ke[Ke.length-1]===re?Ze:{...Ze,[M]:[...Ke,re]}}),(((nt=U.actions)==null?void 0:nt.endOfAgent)??((Xe=U.actions)==null?void 0:Xe.end_of_agent)??((ct=U.actions)==null?void 0:ct.escalate))&&wo(Ze=>{const Ke=Ze[M]??[];return Ke.length<=1?Ze:{...Ze,[M]:Ke.slice(0,-1)}})},[No,Bt]=g.useState(VD),[c0,u0]=g.useState([]),[LE,Th]=g.useState({}),kh=g.useCallback(M=>{u0(U=>{const Y=U.findIndex(xe=>xe.id===M.id);if(Y===-1)return[M,...U];const re=[...U];return re[Y]={...re[Y],...M},re})},[]),[DE,d0]=g.useState(!0),[Ku,oi]=g.useState(!1),[Ah,As]=g.useState(!1),[Ch,H]=g.useState(!1),[le,fe]=g.useState(null),[Ae,tt]=g.useState("custom"),[bt,ds]=g.useState([]),_r=g.useRef([]),Yt=g.useRef(null),Gi=g.useRef(null),[pC,f0]=g.useState([]),[Ys,Kr]=g.useState(""),Sr=g.useRef(null),[PE,_i]=g.useState(!1),[qu,_n]=g.useState(!1),[mC,BE]=g.useState(""),[IG,jG]=g.useState("good"),[RG,h0]=g.useState("basic"),[OG,MG]=g.useState("good"),[Ih,p0]=g.useState(""),[LG,DG]=g.useState(null),[gl,Es]=g.useState(!1),[_c,qr]=g.useState(null),UE=g.useRef(null),[Xa,jh]=g.useState(()=>{const M=Ia();return mh(M),M}),[PG,gC]=g.useState(!1),[BG,bC]=g.useState(""),[yC,m0]=g.useState(null),[UG,xC]=g.useState({}),[FG,EC]=g.useState(()=>new Set),[Yu,ya]=g.useState(null),[g0,b0]=g.useState(Ti(Dt)),[vC,Ki]=g.useState(""),[wC,Mi]=g.useState(""),[Sn,rr]=g.useState(null),[$G,FE]=g.useState(!1),y0=g.useRef(!1),Wu=g.useRef(!1),Qa=g.useCallback(M=>{if(!ge)return!1;try{ID(localStorage,ge,M)}catch(U){return us(U instanceof Error?U.message:"浏览器拒绝保存草稿,请稍后重试。"),!1}return _r.current=M,ds(M),us(""),!0},[ge]),Za=g.useCallback(M=>{var U;M&&((U=Yt.current)==null?void 0:U.id)!==M||(Yt.current=null,Gi.current!==null&&(window.clearTimeout(Gi.current),Gi.current=null))},[]),Xu=g.useCallback(()=>{const M=Yt.current;M&&(Za(),Qa([M,..._r.current.filter(U=>U.id!==M.id)]))},[Za,Qa]),HG=g.useCallback((M,U,Y)=>{!M||!ge||(Yt.current&&Yt.current.id!==M&&Xu(),Yt.current={id:M,draft:U,updatedAt:Date.now(),deploymentTarget:Y},Gi.current!==null&&window.clearTimeout(Gi.current),Gi.current=window.setTimeout(Xu,CMe))},[Xu,ge]),$E=g.useCallback(M=>{!M||!ge||(Za(M),Qa(_r.current.filter(U=>U.id!==M)))},[Za,Qa,ge]),_C=g.useCallback(M=>{if(!ge||M.length===0)return;const U=new Set(M.map(Y=>Y.id));Yt.current&&U.has(Yt.current.id)&&Za(),Qa(_r.current.filter(Y=>!U.has(Y.id))),Th(Y=>Object.fromEntries(Object.entries(Y).filter(([re])=>!U.has(re)))),U.has(Ys)&&(Kr(""),fe(null),ya(null),Sr.current=null,localStorage.removeItem(g_(ge)))},[Za,Qa,Ys,ge]),SC=g.useCallback(M=>{if(!M||!ge)return;Za(M);const U=Sr.current,Y=_r.current.filter(re=>re.id!==M);Qa((U==null?void 0:U.id)===M?[U,...Y]:Y)},[Za,Qa,ge]);g.useEffect(()=>(window.addEventListener("pagehide",Xu),()=>{window.removeEventListener("pagehide",Xu)}),[Xu]),g.useEffect(()=>{if(!ge){Za(),_r.current=[],ds([]),f0([]),Kr(""),us(""),Sr.current=null;return}let M=[],U="";try{M=Kje(localStorage,ge),localStorage.getItem(NE(ge))!==null&&ID(localStorage,ge,M),U=localStorage.getItem(g_(ge))||"",us("")}catch(re){us(re instanceof Error?re.message:"无法读取本机草稿,请稍后重试。")}_r.current=M,ds(M),f0(LMe(ge));const Y=M.find(re=>re.id===U);Sr.current=Y??null,No==="custom"&&Y&&(Kr(Y.id),fe(Y.draft),ya(Y.deploymentTarget??null))},[Za,ge]),g.useEffect(()=>{if(!ge)return;const M=g_(ge);try{No==="custom"&&Ys?localStorage.setItem(M,Ys):localStorage.removeItem(M)}catch{us("浏览器拒绝保存当前草稿位置,请检查站点存储权限后重试。")}},[No,Ys,ge]);const zG=g.useCallback(M=>{if(!ge)return;const U=[...new Set(M.filter(Boolean))];f0(U),localStorage.setItem(lT(ge),JSON.stringify(U))},[ge]),VG=g.useCallback(async M=>{const U=M.filter(Xe=>!!Xe.runtimeId&&Xe.canDelete===!0);if(U.length===0)return;const Y=QMe(Xa,n),re=new Set(U.map(Xe=>Xe.runtimeId));EC(Xe=>{const ct=new Set(Xe);for(const Ze of re)ct.add(Ze);return ct}),pb(re);const xe=new Set,ke=new Set,ze=new Set,nt=[];for(const Xe of U)try{if(!Xe.region)throw new Error("Runtime 缺少地域信息,无法删除");await D8(Xe.runtimeId,Xe.region),O1(Xe.runtimeId),xe.add(Xe.runtimeId),ke.add(Xe.id)}catch(ct){const Ze=ct instanceof Error?ct.message:String(ct);ze.add(Xe.runtimeId),nt.push(`${Xe.label}: ${Ze}`)}if(xe.size>0&&(pb(xe),jh(Ia()),m0(ct=>{if(!ct)return ct;const Ze=new Set(ct);for(const Ke of xe)Ze.delete(Ke);return Ze}),xC(ct=>Object.fromEntries(Object.entries(ct).filter(([Ze])=>!xe.has(Ze)))),f0(ct=>{const Ze=ct.filter(Ke=>!ke.has(Ke));return ge&&localStorage.setItem(lT(ge),JSON.stringify(Ze)),Ze}),Qa(_r.current.filter(ct=>{var Ze;return!((Ze=ct.deploymentTarget)!=null&&Ze.runtimeId)||!xe.has(ct.deploymentTarget.runtimeId)})),(Y?xe.has(Y):U.some(ct=>ct.id===n))&&(uK(),Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),rr(null),Ki(""),Mi(""),Es(!0),je("")),Sn!=null&&Sn.runtime&&xe.has(Sn.runtime.runtimeId)&&(Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),rr(null),Ki(""),Mi(""),Es(!0),je(""))),ze.size>0&&EC(Xe=>{const ct=new Set(Xe);for(const Ze of ze)ct.delete(Ze);return ct}),nt.length>0){const Xe=nt.slice(0,3).join(";"),ct=nt.length>3?`;另有 ${nt.length-3} 个失败`:"";throw new Error(`${nt.length} 个 Agent 删除失败:${Xe}${ct}`)}},[Sn,n,Qa,Xa,ge]),HE=g.useCallback(async()=>{gC(!0),bC("");try{const M=[];let U="";do{const Y=await Tx({scope:wn,region:"all",pageSize:100,nextToken:U});M.push(...Y.runtimes),U=Y.nextToken}while(U&&M.length<2e3);m0(new Set(M.map(Y=>Y.runtimeId))),xC(Object.fromEntries(M.map(Y=>[Y.runtimeId,{canDelete:Y.canDelete}])))}catch(M){bC(M instanceof Error?M.message:String(M))}finally{gC(!1)}},[wn]);function x0(M){console.log("create agent draft:",M),Bt(null),yl()}function zE(M,U){console.log("Agent added, navigating to:",M,U),jh(Ia()),m0(null),pb(),$E(Ys),Kr(""),Sr.current=null,ya(null),Ki(""),Mi(M),h0("basic"),Bt(null),_n(!0),s(M)}const VE=g.useCallback(M=>{Bt(null),H(!1),Es(!1),rr(null),_n(!0),Mi(""),h0("basic"),Ki(M.id),je("")},[]),NC=g.useCallback(M=>{Ys&&Th(U=>({...U,[Ys]:M.id})),VE(M)},[Ys,VE]),TC=g.useCallback(async M=>{if(!M.runtimeId)throw new Error("部署完成,但未返回 Runtime ID。");const U=(Yu==null?void 0:Yu.region)??g0,Y=await dy(M.runtimeId,M.agentName,M.region??U,M.version);jh(Ia()),bs(xe=>xe+1);const re=await m_(Y);Ge.current.set(Y,re),We(re),m0(xe=>{const ke=new Set(xe??[]);return ke.add(M.runtimeId),ke}),pb(),ya(null),$E(Ys),Th(xe=>{if(!Ys||!xe[Ys])return xe;const ke={...xe};return delete ke[Ys],ke}),Kr(""),Sr.current=null,Mi(Y),h0("basic"),Bt(null),_n(!0),s(Y)},[Ys,g0,$E,Yu]),Rh=g.useRef(null),GE=g.useRef(new Map),Sc=g.useRef(!0),bl=g.useRef(!1),Nc=g.useRef(null),kC=g.useRef({key:"",turnCount:0}),KE=(p==null?void 0:p.id)??a;g.useLayoutEffect(()=>{const M=Rh.current,U=kC.current,Y=U.key!==KE,re=!Y&&xt.length>U.turnCount;if(kC.current={key:KE,turnCount:xt.length},!M||xt.length===0||!Y&&!re)return;Sc.current=!0,bl.current=!1,Nc.current!==null&&(window.clearTimeout(Nc.current),Nc.current=null);const xe=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(Y||xe){M.scrollTop=M.scrollHeight;return}bl.current=!0,M.scrollTo({top:M.scrollHeight,behavior:"smooth"}),Nc.current=window.setTimeout(()=>{bl.current=!1,Nc.current=null},450)},[KE,xt.length]),g.useLayoutEffect(()=>{const M=Rh.current;!M||!Sc.current||bl.current||(M.scrollTop=M.scrollHeight)},[Wa,xt]),g.useEffect(()=>{if(!Ih||qu||xt.length===0)return;const M=GE.current.get(Ih);if(!M)return;Sc.current=!1,M.scrollIntoView({behavior:"smooth",block:"center"});const U=window.setTimeout(()=>{p0("")},2600);return()=>window.clearTimeout(U)},[Ih,qu,xt]),g.useEffect(()=>()=>{Nc.current!==null&&window.clearTimeout(Nc.current)},[]);const GG=g.useCallback(()=>{const M=Rh.current;!M||bl.current||(Sc.current=M.scrollHeight-M.scrollTop-M.clientHeight<32)},[]),KG=g.useCallback(M=>{M.deltaY<0&&(bl.current=!1,Sc.current=!1)},[]),qG=g.useCallback(()=>{bl.current=!1,Sc.current=!1},[]),YG=g.useCallback(()=>{const M=Rh.current;!M||!Sc.current||bl.current||(M.scrollTop=M.scrollHeight)},[]),qE=g.useCallback(()=>{Se(null),OS().then(M=>{st(M.userId),bn(M.info),ai(!!M.local),ie(M.status),M.status==="authenticated"&&(y0.current=!0,Wu.current=!0,localStorage.removeItem(Na.app),s(""),Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),Es(!1))}).catch(M=>{Se(M instanceof Error?M.message:String(M))})},[]);g.useEffect(()=>{qE()},[qE]),g.useEffect(()=>{const M=()=>{Vr(""),Pn(!0)};return window.addEventListener(MS,M),kte()&&M(),()=>window.removeEventListener(MS,M)},[]);const WG=g.useCallback(async()=>{if(Gr.current)return;Gr.current=!0;const M=Ete();if(!M){Gr.current=!1,Vr("登录窗口被浏览器拦截,请允许弹出窗口后重试。");return}en(!0),Vr("");try{for(;;){await new Promise(U=>window.setTimeout(U,1e3));try{const U=await OS();if(U.status==="authenticated"){st(U.userId),bn(U.info),ai(!!U.local),ie(U.status),Pn(!1),Ate(),M.close();return}}catch{}if(M.closed){Vr("登录窗口已关闭,请重新登录以继续当前操作。");return}}}finally{Gr.current=!1,en(!1)}},[]);g.useEffect(()=>{vo&&ge&&zR(ge)},[vo,ge]),g.useEffect(()=>{if(qs!=="authenticated"||!ge||!n){We({});return}const M=Ge.current.get(n);if(M){We(M);return}let U=!1;return We({}),m_(n).then(Y=>{U||(Ge.current.set(n,Y),We(Y))}),()=>{U=!0}},[n,qs,ge]),g.useEffect(()=>{if(qs!=="authenticated"||!ge){qt(null);return}let M=!1;return qt(null),j8().then(U=>{M||qt(U)}).catch(U=>{console.warn("[app] /web/access failed; using ordinary-user access:",U),M||qt(I8)}),()=>{M=!0}},[qs,ge]),g.useEffect(()=>{C8().then(M=>{mTe(M.telemetry),bTe({agentsSource:M.agentsSource}),sr(M.features),wr(M.agentsSource),Ps(M.provider),ir(M.branding),Sh(M.version),Zg(!0)})},[]),g.useEffect(()=>{qs!=="authenticated"||!on||!St||gTe({userId:St.telemetry.userId,role:St.role,local:vo})},[St,qs,vo,on]),g.useEffect(()=>{b0(M=>{const U=Ti(Dt);return!M||Dt==="byteplus"&&M.startsWith("cn-")||Dt==="volcengine"&&M.startsWith("ap-")?U:M})},[Dt]),g.useEffect(()=>{St&&(St.capabilities.createAgents||(Bt(null),fe(null),As(!1),H(!1),u0([])),St.capabilities.manageAgents||_n(!1))},[St]),g.useEffect(()=>{qs!=="authenticated"||zi!=="cloud"||!Qg||!qu||Sn||HE()},[Sn,zi,qs,qu,HE,Qg]),g.useEffect(()=>{document.title=Qn.title;let M=document.querySelector('link[rel~="icon"]');M||(M=document.createElement("link"),M.rel="icon",document.head.appendChild(M)),M.removeAttribute("type"),M.href=Qn.logoUrl||(Dt==="byteplus"?m2:p2)},[Dt,Qn]),g.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(M=>M.ok?M.json():null).then(M=>{M&&d0(!!M.credentials)}).catch(M=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",M)})},[]);function XG(M){zR(M),y0.current=!0,Wu.current=!0,localStorage.removeItem(Na.app),qt(null),Bt(null),fe(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),yl(),s(""),Es(!1),st(M),bn({name:M}),ai(!0),ie("authenticated")}function QG(){qt(null),vo?(yte(),st(""),bn(void 0),ie("unauthenticated")):wte()}g.useEffect(()=>{if(qs==="authenticated"){if(zi==="cloud"){const M=QD(Xa);s(U=>U&&M.includes(U)?U:(U&&(Wu.current=!0,localStorage.removeItem(Na.app)),""));return}t8().then(M=>{t(M);const U=QD(Xa);s(Y=>Y&&(M.includes(Y)||U.includes(Y))?Y:(Y&&(Wu.current=!0,localStorage.removeItem(Na.app)),""))}).catch(M=>je(String(M)))}},[qs,zi,Xa]),g.useEffect(()=>{n?(Wu.current=!1,localStorage.setItem(Na.app,n)):localStorage.removeItem(Na.app)},[n]),g.useEffect(()=>{let M=!1;if(Kn(null),Cn([]),gl||Sn||!n||!ge||!a){Ns(!1);return}return Ns(!0),US(n,ge,a).then(U=>{M||(Kn(U),u2(n).then(Y=>{M||Cn(Y)}).catch(()=>{M||Cn([])}))}).catch(()=>{M||Kn(null)}).finally(()=>{M||Ns(!1)}),()=>{M=!0}},[Sn,n,gl,ge,a]),g.useEffect(()=>{let M=!1;if(Os(null),mn(Sa()),qs!=="authenticated"||gl||Sn||!n){Gn(!1);return}return Gn(!0),d2(n).then(U=>{M||Os(U)}).catch(()=>{M||Os(null)}).finally(()=>{M||Gn(!1)}),()=>{M=!0}},[Sn,n,Ms,qs,gl]),g.useEffect(()=>{St&&localStorage.setItem(Na.view,St.capabilities.createAgents?No??"chat":"chat")},[St,No]),g.useEffect(()=>{localStorage.setItem(Na.session,a),et.current=a},[a]),g.useEffect(()=>{const M=ZMe(Xa,n);if(!M||!ge){xs.current=()=>{},fn(Ze=>Ze.size===0?Ze:new Set);return}const{runtimeId:U,region:Y,appName:re}=M;let xe=!1,ke=0;function ze(){an.current!==void 0&&(window.clearTimeout(an.current),an.current=void 0)}function nt(Ze){ze(),an.current=window.setTimeout(()=>void Xe(),Ze)}async function Xe(){const Ze=++ke;try{const Ke=await l8({runtimeId:U,region:Y,appName:re,userId:ge});if(xe||Ze!==ke)return;const tn=new Set(Ke.items.filter(rt=>rt.state==="running").map(rt=>rt.sessionId));if(fn(rt=>rt.size===tn.size&&[...tn].every(Ws=>rt.has(Ws))?rt:tn),tn.size>0){nt(IMe);return}const ln=Ke.items.filter(rt=>rt.state==="pending").map(rt=>Date.parse(rt.dueAt)).filter(Number.isFinite);ln.length>0&&nt(Math.max(RMe,Math.min(...ln)-Date.now()))}catch{!xe&&Ze===ke&&nt(jMe)}}const ct=()=>{ze(),Xe()};return xs.current=ct,ct(),()=>{xe=!0,ke+=1,ze(),xs.current===ct&&(xs.current=()=>{})}},[n,Xa,ge]),g.useEffect(()=>()=>dn.current.forEach(M=>M.abort()),[]),g.useEffect(()=>()=>rn.current.forEach(M=>{window.clearTimeout(M)}),[]),g.useEffect(()=>()=>{var M,U;(M=Ce.current)==null||M.abort(),(U=Ve.current)==null||U.abort()},[]),g.useEffect(()=>{if(gl||Sn||p||!n||!ge)return;let M=!1;return(async()=>{const U=await E0(n);if(!M){if(!y0.current){y0.current=!0;const Y=localStorage.getItem(Na.session)||"";if(VD()===null&&Y&&U.some(re=>re.id===Y)){Oh(Y);return}}yl()}})(),()=>{M=!0}},[Sn,n,gl,p,ge]),g.useEffect(()=>{const M=UE.current;M&&M.app===n&&(UE.current=null,Oh(M.sid))},[n]);function ZG(M,U){_i(!1),M===n?Oh(U):(UE.current={app:M,sid:U},s(M))}async function E0(M){try{const U=await o2(M,ge),Y=await Promise.allSettled(U.map(ke=>{var ze;return(ze=ke.events)!=null&&ze.length?Promise.resolve(ke):o1(M,ge,ke.id)})),re=Y.find(ke=>ke.status==="rejected"&&!/get session failed:\s*404\b/i.test(String(ke.reason)));if((re==null?void 0:re.status)==="rejected")throw re.reason;const xe=Y.flatMap(ke=>ke.status==="fulfilled"?[ke.value]:[]);return r(xe),xe}catch(U){return je(String(U)),[]}}function AC(M="codex",U=!1){p||(je(""),ue(""),he("confirm"),Le(M),ae(U),K(!0))}function JG(){var M;(M=Ce.current)==null||M.abort(),Ce.current=null,K(!1),he("confirm"),ue(""),!p&&at==="temporary"&&!Ne&&ft("agent")}async function eK(M){var Y;(Y=Ce.current)==null||Y.abort();const U=new AbortController;Ce.current=U,he("loading"),ue("");try{const re=we==="codex"?await cn.startSession({displayName:M,signal:U.signal}):await cn.startAgentSession(we,{displayName:M,signal:U.signal});if(Ce.current!==U)return;if(yTe({kind:we,source:Ne?"my_agents":"new_chat",sessionId:re.id}),Ne){_e(ke=>ke+1),K(!1),he("confirm"),Es(!0);return}if(we!=="codex")return;const xe=await cn.connectSession(re.id,{signal:U.signal});if(Ce.current!==U)return;et.current="",l(""),h([]),Pt(""),mn(Sa()),ft("temporary"),Vu(),sn(!1),Nh(zt),ot([]),lt(),v([]),m(xe),Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),rr(null),Es(!1),Pe(null),Ye(null),K(!1),he("confirm")}catch(re){if((re==null?void 0:re.name)==="AbortError"||Ce.current!==U)return;xTe({kind:we,source:Ne?"my_agents":"new_chat",error:re}),ue(re instanceof Error?re.message:String(re)),he("error")}finally{Ce.current===U&&(Ce.current=null)}}async function YE(M,U="my_agents"){je("");const Y=Date.now();try{if(M.toolName==="codex"){const xe=await cn.connectSession(M.id);mb({kind:M.toolName,source:U,durationMs:Date.now()-Y,sandboxStatus:xe.status}),et.current="",l(""),h([]),Pt(""),mn(Sa()),lt(),v([]),m(xe),Pe(null),Ye(null),Es(!1),_n(!1);return}const re=await cn.openAgentSession(M.toolName,M.id);mb({kind:M.toolName,source:U,durationMs:Date.now()-Y,sandboxStatus:re.session.status}),Ye(re),Pe(null),Es(!1),_n(!1)}catch(re){throw Vw({kind:M.toolName,source:U,durationMs:Date.now()-Y,error:re}),je(re instanceof Error?re.message:String(re)),re}}function tK(M){Pe(M),Ye(null),Es(!1),_n(!1),je("")}async function nK(M){(p==null?void 0:p.id)===M.id&&To(),M.toolName==="codex"?await cn.deleteSession(M.id):await cn.deleteAgentSession(M.toolName,M.id),Pe(null),Ye(null),_e(U=>U+1),Es(!0)}function To(){var U;(U=Ve.current)==null||U.abort(),Ve.current=null,Ue.current="",W.current="",x(!1),lt(),v([]),ot([]),Pt(""),je(""),ft("agent"),w(!1),_(""),k(!1),j(!1),B(null),L(null),C(!1),D(""),O(null),se(!1),Q(""),V(!1),oe.current+=1;const M=p;m(null),M&&cn.closeSession(M.id).catch(Y=>je(String(Y)))}async function WE(M){const U=p;if(U){B(M),L(null),D(""),C(!0);try{const Y=M==="terminal"?await cn.launchTerminal(U.id):await cn.launchBrowser(U.id);L(Y)}catch(Y){D(Y instanceof Error?Y.message:String(Y))}finally{C(!1)}}}async function sK(M){const U=p;if(!(!U||E)){w(!0),_("");try{const Y=await cn.updatePermissions(U.id,M);m(re=>(re==null?void 0:re.id)===U.id?{...re,permissions:Y}:re),En(U.id,"已更新当前 Sandbox Session 的 Codex 权限",[{label:"沙箱模式",value:KMe[Y.sandboxMode]},{label:"审批策略",value:qMe[Y.approvalPolicy]},{label:"审批方式",value:YMe[Y.approvalsReviewer]},{label:"网络访问",value:Y.networkAccess?"允许":"关闭"}]),Ue.current===U.id&&k(!1)}catch(Y){_(Y instanceof Error?Y.message:String(Y))}finally{w(!1)}}}const iK=g.useCallback(async M=>{const U=p==null?void 0:p.id;if(!U)throw new Error("当前没有已连接的 Sandbox。");return cn.listDirectories(U,M)},[p==null?void 0:p.id]);async function rK(M){const U=p;if(!(!U||U.workspaceLocked||E)){w(!0),_("");try{const Y=await cn.updateWorkspace(U.id,M);m(re=>(re==null?void 0:re.id)===U.id?{...re,cwd:Y}:re),Zn.invalidateSkills(),En(U.id,"已更新工作空间",[{label:"工作目录",value:Y,code:!0}]),Ue.current===U.id&&j(!1)}catch(Y){_(Y instanceof Error?Y.message:String(Y))}finally{w(!1)}}}async function aK(M){const U=p,Y=$;if(!(!U||!Y||te)){se(!0),Q("");try{await cn.resolveApproval(U.id,Y.id,M),En(U.id,WMe(Y,M),XMe(Y),W.current),O(re=>(re==null?void 0:re.id)===Y.id?null:re)}catch(re){Q(re instanceof Error?re.message:String(re))}finally{se(!1)}}}async function oK(M){const U=p;if(!U||ee)return;const Y=++oe.current;je(""),V(!0);const re=Array.from(M).map(xe=>{const ke={id:WD(),mimeType:XD(xe),name:xe.name,sizeBytes:xe.size,status:"uploading",previewUrl:Ee(xe)};return{file:xe,attachment:ke}});ot(xe=>[...xe,...re.map(({attachment:ke})=>ke)]);try{const ke=(await Promise.all(re.map(async({file:ze,attachment:nt})=>{try{const Xe=await cn.uploadFile(U.id,ze);return oe.current!==Y?null:(ot(ct=>ct.map(Ze=>Ze.id===nt.id?{...Ze,id:Xe.id,uri:Xe.path,name:Xe.name,mimeType:Xe.mimeType,sizeBytes:Xe.sizeBytes,status:"ready"}:Ze)),Xe)}catch(Xe){if(oe.current!==Y)return null;const ct=Xe instanceof Error?Xe.message:String(Xe);return ot(Ze=>Ze.map(Ke=>Ke.id===nt.id?{...Ke,status:"error",error:ct}:Ke)),je(ct),null}}))).filter(ze=>ze!==null);oe.current===Y&&ke.length>0&&En(U.id,ke.length===1?"已上传文件到 Sandbox":`已上传 ${ke.length} 个文件到 Sandbox`,ke.map((ze,nt)=>({label:ke.length===1?"文件":`文件 ${nt+1}`,value:ze.path,code:!0})))}finally{if(oe.current===Y)V(!1);else for(const{attachment:xe}of re)Me(xe.previewUrl)}}function lK(M){const U=zt.find(Y=>Y.id===M);U&&(Me(U.previewUrl),ot(Y=>Y.filter(re=>re.id!==M)))}async function CC(M,U=[],Y=[]){var Ws;const re=p,xe=U.filter(qe=>qe.status==="ready"&&qe.uri);if(!re||y||!M.trim()&&xe.length===0)return;je(""),O(null),Q("");const ke=Date.now(),ze=new AbortController;(Ws=Ve.current)==null||Ws.abort(),Ve.current=ze;const nt=[];Y.length>0&&nt.push({kind:"invocation",value:{skills:Y.map(({name:qe,description:Nt})=>({name:qe,description:Nt}))}}),xe.length>0&&nt.push({kind:"attachment",files:xe.map(qe=>({id:qe.id,mimeType:qe.mimeType,name:qe.name,sizeBytes:qe.sizeBytes,previewUrl:qe.previewUrl}))}),M.trim()&&nt.push({kind:"text",text:M});const Xe=xe.map(qe=>qe.uri).filter(qe=>!!qe),Ze=[Y.map(qe=>`$${qe.name}`).join(" "),M.trim()].filter(Boolean).join(" "),Ke=Xe.length>0?[Ze,"以下文件已上传到当前 Sandbox 工作空间,请在任务中使用:",...Xe.map(qe=>`- ${qe}`)].filter(Boolean).join(` -`):Je,rn=crypto.randomUUID(),ln=crypto.randomUUID(),rt=[{role:"user",blocks:tt,meta:{localId:rn,ts:Date.now()/1e3}},{role:"assistant",blocks:[],meta:{localId:ln}}];W.current=ln,v(Ye=>[...Ye,...rt]),x(!0),p(Ye=>(Ye==null?void 0:Ye.id)===ie.id?{...Ye,busy:!0,workspaceLocked:!0}:Ye);try{const Ye=await cn.sendMessage({sessionId:ie.id,text:qe,skillIds:Y.map(Nt=>Nt.id)},{signal:Ve.signal,onApproval:Nt=>{Ke.current===Ve&&(Q(""),O(Nt))},onApprovalResolved:Nt=>{Ke.current===Ve&&O(pt=>(pt==null?void 0:pt.id)===Nt?null:pt)},onBlocks:Nt=>{Ke.current===Ve&&v(pt=>{const kt=pt.slice(),Zn=kt.findIndex(At=>{var Xs;return((Xs=At.meta)==null?void 0:Xs.localId)===ln}),Cs=kt[Zn];return(Cs==null?void 0:Cs.role)==="assistant"&&(kt[Zn]={...Cs,blocks:Nt}),kt})},onUsage:Nt=>{Ke.current===Ve&&v(pt=>{const kt=pt.slice(),Zn=kt.findIndex(At=>{var Xs;return((Xs=At.meta)==null?void 0:Xs.localId)===ln}),Cs=kt[Zn];return(Cs==null?void 0:Cs.role)==="assistant"&&(kt[Zn]={...Cs,meta:{...Cs.meta,sandboxUsage:Nt.usage}}),kt})}});if(Ke.current!==Ve)return;D3({kind:ie.toolName,source:"composer",sessionState:"existing",durationMs:Date.now()-ke}),v(Nt=>{const pt=Nt.slice(),kt=pt.findIndex(Cs=>{var At;return((At=Cs.meta)==null?void 0:At.localId)===ln}),Zn=pt[kt];return(Zn==null?void 0:Zn.role)==="assistant"&&(pt[kt]={...Zn,blocks:Ye.blocks,meta:{...Zn.meta,ts:Date.now()/1e3,...Ye.usage?{sandboxUsage:Ye.usage.usage}:{}}}),pt})}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||Ke.current!==Ve)return;lm({kind:ie.toolName,source:"composer",sessionState:"existing",durationMs:Date.now()-ke,phase:"sandbox_send",error:Ye}),v(Nt=>Nt.filter(pt=>{var kt,Zn;return((kt=pt.meta)==null?void 0:kt.localId)!==rn&&((Zn=pt.meta)==null?void 0:Zn.localId)!==ln})),Ft(M),Tt(U),Qn.setSelectedSkills(Y),Le(`内置智能体发送失败:${Ye instanceof Error?Ye.message:String(Ye)}`);try{const Nt=await cn.getSettings(ie.id);p(pt=>(pt==null?void 0:pt.id)===ie.id?{...pt,...Nt}:pt)}catch{}}finally{Ke.current===Ve&&(Ke.current=null,W.current===ln&&(W.current=""),x(!1),O(null),p(Ye=>(Ye==null?void 0:Ye.id)===ie.id?{...Ye,busy:!1}:Ye))}}async function lK(M){if(await Qn.executeSlash(M)||!m||y||Qn.commandBusy)return;const U=Bt,Y=Qn.selectedSkills;Ft(""),Tt([]),Qn.setSelectedSkills([]),await CC(M.trim(),U,Y)}function pl(){yo(),Le(""),re(qD()),dt("agent"),St(null),Ch(),mn(!1);const M=a&&yn.length===0&&Bt.length>0?a:"";bt.current="",l(""),Wn(null),Ln([]),d(!1),h([]),vn(xa()),Gu(Bt),Tt([]),M&&Ih(M)}function cK(){var M;Qu.current=!0,localStorage.removeItem(Ea.app),a&&((M=Yt.current.get(a))==null||M.abort()),c.current=null,pl(),s(""),$e({}),os(null)}function uK(){Ts(null),zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Be(null),We(null),Es(!1),Hr(null),pl()}async function dK(M){var U;try{(U=Yt.current.get(M))==null||U.abort(),mt(M,!1),await PS(n,be,M),await DS(n,be,M);const Y=_n.current.get(M);Y!==void 0&&window.clearTimeout(Y),_n.current.delete(M),Dn(ie=>{if(!ie.has(M))return ie;const xe=new Set(ie);return xe.delete(M),xe}),ct(ie=>{const{[M]:xe,...ke}=ie;return ke}),M===a&&pl(),await x0(n)}catch(Y){Le(String(Y))}}async function Dh(M){if(m&&yo(),M!==a&&(bt.current=M,Le(""),d(!1),h([]),dt("agent"),St(null),Ch(),vn(xa()),Wn(null),Ln([]),l(M),Lt[M]===void 0)){ll(!0);try{const U=await a1(n,be,M);vt(M,fne(U.events??[],U.state))}catch(U){Le(String(U))}finally{ll(!1)}}}async function fK(M){if(!M.sessionId||!M.messageId){Le("这条案例缺少会话定位信息,无法跳转。");return}wi(!1),zt(null),H(!1),fe(!1),ai(!1),Nn(!1),BE(n),IG(M.kind),h0(M.messageId),await Dh(M.sessionId)}function hK(){const M=pC||n;wi(!1),zt(null),H(!1),fe(!1),ai(!1),Ki(""),Di(M),f0("evaluations"),OG(CG),Nn(!0),BE(""),h0("")}function mK(M){const U=new Map,Y=new Map;for(const ie of M){if(!ie.sessionId||!ie.messageId)continue;const xe=U.get(ie.sessionId)??new Set;if(xe.add(ie.messageId),U.set(ie.sessionId,xe),ie.runtimeId&&ie.userId){const ke=[ie.runtimeId,n,ie.userId,ie.sessionId].join(":"),Ve=Y.get(ke)??{runtimeId:ie.runtimeId,appName:n,userId:ie.userId,sessionId:ie.sessionId,eventIds:new Set};Ve.eventIds.add(ie.messageId),Y.set(ke,Ve)}}if(U.size!==0){ct(ie=>{const xe={...ie};for(const[ke,Ve]of U){const tt=xe[ke];tt&&(xe[ke]=tt.map(Qe=>{var lt;return(lt=Qe.meta)!=null&<.eventId&&Ve.has(Qe.meta.eventId)?{...Qe,meta:{...Qe.meta,feedback:void 0}}:Qe}))}return xe}),r(ie=>ie.map(xe=>{const ke=U.get(xe.id);if(!ke||!xe.state)return xe;const Ve={...xe.state};for(const tt of ke)delete Ve[`veadk_feedback:${tt}`];return{...xe,state:Ve}})),en(ie=>{const xe=new Set(ie);for(const ke of U.values())for(const Ve of ke)xe.delete(Ve);return xe});for(const ie of Y.values())XB({runtimeId:ie.runtimeId,appName:ie.appName,userId:ie.userId,sessionId:ie.sessionId,eventIds:[...ie.eventIds]});LG(ie=>ie&&(M.some(xe=>xe.id===ie.id||xe.messageId===ie.messageId)?null:ie))}}async function IC(M=!0){if(a)return a;c.current||(c.current=r1(n,be));const U=c.current;try{const Y=await U;M&&l(Y);const ie=Date.now()/1e3,xe={id:Y,lastUpdateTime:ie,events:[]};return r(ke=>[xe,...ke.filter(Ve=>Ve.id!==Y)]),Y}finally{c.current===U&&(c.current=null)}}async function pK(M){if(!n||!be||!a||!Yn)return!1;Cn(!0),Le("");try{const U=await FS(n,be,a,M,Yn.revision);return Wn(U),!0}catch(U){return Le(String(U)),!1}finally{Cn(!1)}}async function gK(M){if(!(!n||!be||!a||!Yn)){Cn(!0),Le("");try{const U=await E8(n,be,a,M,Yn.revision);Wn(U)}catch(U){Le(String(U))}finally{Cn(!1)}}}async function bK(M){Le("");let U;try{U=await IC()}catch(ie){Le(String(ie));return}const Y=Array.from(M).map(ie=>({file:ie,attachment:{id:YD(),mimeType:WD(ie),name:ie.name,sizeBytes:ie.size,status:"uploading"}}));Tt(ie=>[...ie,...Y.map(xe=>xe.attachment)]),await Promise.all(Y.map(async({file:ie,attachment:xe})=>{try{const ke=await g8(n,be,U,ie);if(Ss.current.delete(xe.id)){ke.uri&&await Xb(n,ke.uri);return}Tt(Ve=>Ve.map(tt=>tt.id===xe.id?ke:tt))}catch(ke){if(Ss.current.delete(xe.id))return;const Ve=ke instanceof Error?ke.message:String(ke);Tt(tt=>tt.map(Qe=>Qe.id===xe.id?{...Qe,status:"error",error:Ve}:Qe)),Le(Ve)}}))}async function jC(M,U=[],Y=xa(),ie="composer"){if(!M.trim()&&U.length===0||cl||i0||!n||!be)return;Le("");const xe=Date.now(),ke=!a,Ve=ke?"new":"existing",tt=!!qi,Qe=[];(Y.skills.length>0||Y.targetAgent)&&Qe.push({kind:"invocation",value:Y}),U.length&&Qe.push({kind:"attachment",files:U.map(rt=>({id:rt.id,mimeType:rt.mimeType,data:rt.data,uri:rt.uri,name:rt.name,sizeBytes:rt.sizeBytes}))}),M.trim()&&Qe.push({kind:"text",text:M});const lt=[{role:"user",blocks:Qe,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];ke&&(h(lt),d(!0));const Je=He;let qe;try{qe=await IC(!ke)}catch(rt){ke&&(h([]),d(!1),Ft(M),vn(Y)),tt&&lm({kind:"runtime",source:ie,sessionState:Ve,durationMs:Date.now()-xe,phase:"create_session",error:rt}),Le(String(rt));return}let rn=Zv(Yn);if(Je)try{let rt=await US(n,be,qe);const Ws=Bke[Je].filter(Ye=>{var Nt;return(Nt=ge.builtinTools)==null?void 0:Nt.includes(Ye)});for(const Ye of[...qH[Je],...Ws])rt.tools.some(Nt=>Nt.name===Ye)||(rt=await FS(n,be,qe,{kind:"tool",name:Ye},rt.revision));Wn(rt),rn=Zv(rt)}catch(rt){ke&&(h([]),d(!1),Ft(M),vn(Y)),tt&&lm({kind:"runtime",source:ie,sessionState:Ve,durationMs:Date.now()-xe,phase:"mount_task_capabilities",error:rt}),Le(`任务能力挂载失败:${String(rt)}`);return}vt(qe,rt=>ke?lt:[...rt,...lt]),ke&&(bt.current=qe,l(qe),h([]),d(!1));const ln=new AbortController;Yt.current.set(qe,ln),Me(qe,!0),Xe(qe),bt.current=qe,Hu(rt=>({...rt,[qe]:""})),kh(rt=>({...rt,[qe]:new Set})),Er(rt=>({...rt,[qe]:[]}));try{let rt=Aa(),Ws="",Ye=0,Nt=Date.now()/1e3,pt="",kt="",Zn=!1,Cs=null;for await(const At of Mp({appName:n,userId:be,sessionId:qe,text:M,attachments:U,invocation:Y,signal:ln.signal,sessionCapabilities:rn})){if(ln.signal.aborted)break;const Xs=At.error??At.errorMessage??At.error_message;if(typeof Xs=="string"&&Xs){Zn=!0,Cs=Xs,bt.current===qe&&Le(Xs);break}a0(qe,At);const ma=At.author&&At.author!=="user"?At.author:"";ma&&ma!==Ws&&(Ws=ma,rt=Aa()),rt=Af(rt,At);const ir=At.usageMetadata??At.usage_metadata;ir!=null&&ir.totalTokenCount&&(Ye=ir.totalTokenCount),At.timestamp&&(Nt=At.timestamp),At.id&&(pt=At.id);const Eo=At.invocationId??At.invocation_id;Eo&&(kt=Eo);const Fs=rt.blocks,Uh={author:Ws||void 0,tokens:Ye||void 0,ts:Nt,eventId:pt||void 0,invocationId:kt||void 0};vt(qe,v0=>{var Fh;const vo=v0.slice(),wo=vo[vo.length-1];return(wo==null?void 0:wo.role)==="assistant"&&(!((Fh=wo.meta)!=null&&Fh.author)||wo.meta.author===Ws)?vo[vo.length-1]={...wo,blocks:Fs,meta:Uh}:vo.push({role:"assistant",blocks:Fs,meta:Uh}),vo})}x0(n),!ln.signal.aborted&&tt&&(Zn?lm({kind:"runtime",source:ie,sessionState:Ve,durationMs:Date.now()-xe,phase:"run_sse",error:Cs??"run_sse failed"}):D3({kind:"runtime",source:ie,sessionState:Ve,durationMs:Date.now()-xe})),!ln.signal.aborted&&!Zn&&pt&&Ie.current()}catch(rt){(rt==null?void 0:rt.name)!=="AbortError"&&!ln.signal.aborted&&bt.current===qe&&(tt&&lm({kind:"runtime",source:ie,sessionState:Ve,durationMs:Date.now()-xe,phase:"run_sse",error:rt}),Le(String(rt)))}finally{Yt.current.get(qe)===ln&&Yt.current.delete(qe),Me(qe,!1),ot(qe),Hu(rt=>({...rt,[qe]:""})),Er(rt=>({...rt,[qe]:[]}))}}function yK(M,U){var xe,ke;const Y=((xe=M==null?void 0:M.event)==null?void 0:xe.name)??U.id,ie=((ke=M==null?void 0:M.event)==null?void 0:ke.context)??{};jC(`[ui-action] ${Y}: ${JSON.stringify(ie)}`,[],xa(),"a2ui_action")}async function xK(M){var Qe,lt,Je;if(!M.authUri)throw new Error("事件中没有授权地址。");if(!n||!be||!a)throw new Error("会话尚未就绪。");const U=a,Y=await VMe(M.authUri),ie=GMe(M.authConfig,Y),xe=qe=>qe.map(rn=>rn.kind==="auth"&&!rn.done?{...rn,done:!0}:rn);vt(U,qe=>{const rn=qe.slice(),ln=rn[rn.length-1];return(ln==null?void 0:ln.role)==="assistant"&&(rn[rn.length-1]={...ln,blocks:xe(ln.blocks)}),rn});const ke=Et[Et.length-1],Ve=xe(ke&&ke.role==="assistant"?ke.blocks:[]),tt=new AbortController;Yt.current.set(U,tt),Me(U,!0),Xe(U);try{let qe=Aa(),rn=((Qe=ke==null?void 0:ke.meta)==null?void 0:Qe.author)??"",ln=Ve,rt=0,Ws=Date.now()/1e3,Ye=((lt=ke==null?void 0:ke.meta)==null?void 0:lt.eventId)??"",Nt=((Je=ke==null?void 0:ke.meta)==null?void 0:Je.invocationId)??"",pt=!1;for await(const kt of Mp({appName:n,userId:be,sessionId:a,text:"",functionResponses:[{id:M.callId,name:"adk_request_credential",response:ie}],signal:tt.signal,sessionCapabilities:Zv(Yn)})){if(tt.signal.aborted)break;const Zn=kt.error??kt.errorMessage??kt.error_message;if(typeof Zn=="string"&&Zn){pt=!0,bt.current===U&&Le(Zn);break}a0(U,kt);const Cs=kt.author&&kt.author!=="user"?kt.author:"";Cs&&Cs!==rn&&(rn=Cs,ln=[],qe=Aa()),qe=Af(qe,kt);const At=kt.usageMetadata??kt.usage_metadata;At!=null&&At.totalTokenCount&&(rt=At.totalTokenCount),kt.timestamp&&(Ws=kt.timestamp),kt.id&&(Ye=kt.id);const Xs=kt.invocationId??kt.invocation_id;Xs&&(Nt=Xs);const ma=[...ln,...qe.blocks];vt(U,ir=>{var v0,vo,wo,Fh,$C;const Eo=ir.slice(),Fs=Eo[Eo.length-1],Uh={author:rn||((v0=Fs==null?void 0:Fs.meta)==null?void 0:v0.author),tokens:rt||((vo=Fs==null?void 0:Fs.meta)==null?void 0:vo.tokens),ts:Ws,eventId:Ye||((wo=Fs==null?void 0:Fs.meta)==null?void 0:wo.eventId),invocationId:Nt||((Fh=Fs==null?void 0:Fs.meta)==null?void 0:Fh.invocationId)};return(Fs==null?void 0:Fs.role)==="assistant"&&(!(($C=Fs.meta)!=null&&$C.author)||Fs.meta.author===rn)?Eo[Eo.length-1]={...Fs,blocks:ma,meta:Uh}:Eo.push({role:"assistant",blocks:ma,meta:Uh}),Eo})}x0(n),!tt.signal.aborted&&!pt&&Ye&&Ie.current()}catch(qe){(qe==null?void 0:qe.name)!=="AbortError"&&!tt.signal.aborted&&bt.current===U&&Le(String(qe))}finally{Yt.current.get(U)===tt&&Yt.current.delete(U),Me(U,!1),ot(U),Hu(qe=>({...qe,[U]:""})),Er(qe=>({...qe,[U]:[]}))}}if(se)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:se}),o.jsx("button",{type:"button",onClick:qE,children:"重试"})]});if(yt===null)return o.jsx("div",{className:"boot"});if(yt==="unauthenticated")return o.jsx(aMe,{branding:Xn,cloudProvider:Rt,onUsername:WG});if(!ft)return o.jsx("div",{className:"boot"});const zr=ft.capabilities.createAgents,RC=ft.capabilities.manageAgents,gl=zr?bo:null,OC=zr&&le,MC=zr&&Rh,LC=Wu&&!!(Tn||vC||wC),DC=oH(e,Va),Ph=DC.filter(M=>M.runtimeId&&(yC===null||yC.has(M.runtimeId))).map(M=>{var U;return{...M,canDelete:M.runtimeId?((U=BG[M.runtimeId])==null?void 0:U.canDelete)===!0:!1}}),EK=(()=>{if(Ph.length===0)return Ph;const M=new Map(mC.map((U,Y)=>[U,Y]));return[...Ph].sort((U,Y)=>{const ie=M.get(U.id),xe=M.get(Y.id);return ie!=null&&xe!=null?ie-xe:ie!=null?-1:xe!=null?1:Ph.indexOf(U)-Ph.indexOf(Y)})})(),PC=M=>{var U;return((U=DC.find(Y=>Y.id===M))==null?void 0:U.label)??M},In=Va.find(M=>M.runtimeId&&M.apps.some(U=>ao(M.id,U)===n)),qi=In&&In.runtimeId&&In.region?{runtimeId:In.runtimeId,name:In.name,region:In.region}:void 0,Bh=(qi==null?void 0:qi.runtimeId)??"",xo=In?In.apps.find(M=>ao(In.id,M)===n)??(Ht==null?void 0:Ht.appName)??In.apps[0]??In.name:"",vK=async M=>{var ke,Ve,tt;const U=Ut,Y=a;if(!U||!Y)throw new Error("当前会话不可用,请关闭后重试。");const ie=((ke=U.turn.meta)==null?void 0:ke.invocationId)??"",xe=Bh?[]:await o1(n,Y).catch(()=>[]);await BS({source:"agent_exec",module:"conversation",issues:M.issues,problem:"",description:M.description,page:"conversation",appName:xo||n,runtimeId:Bh,region:(qi==null?void 0:qi.region)??"cn-beijing",sessionId:Y,eventId:((Ve=U.turn.meta)==null?void 0:Ve.eventId)??((tt=U.turn.meta)==null?void 0:tt.localId)??"",invocationId:ie,input:U.input,output:Uc(U.turn),toolCalls:YR(U.turn),trace:nne(xe,ie)})},wK=async M=>{const U=m?"":a,Y=m||U?Et:[],ie=U&&n&&!Bh?await o1(n,U).catch(()=>[]):[];await BS({source:"platform",module:M.module,issues:M.issues,problem:"",description:M.description,page:gn??"unknown",appName:xo||n,runtimeId:Bh,region:(qi==null?void 0:qi.region)??"cn-beijing",sessionId:U,eventId:"",invocationId:"",input:Y.filter(xe=>xe.role==="user").map(Uc).filter(Boolean).join(` +`):Ze,tn=crypto.randomUUID(),ln=crypto.randomUUID(),rt=[{role:"user",blocks:nt,meta:{localId:tn,ts:Date.now()/1e3}},{role:"assistant",blocks:[],meta:{localId:ln}}];W.current=ln,v(qe=>[...qe,...rt]),x(!0),m(qe=>(qe==null?void 0:qe.id)===re.id?{...qe,busy:!0,workspaceLocked:!0}:qe);try{const qe=await cn.sendMessage({sessionId:re.id,text:Ke,skillIds:Y.map(Nt=>Nt.id)},{signal:ze.signal,onApproval:Nt=>{Ve.current===ze&&(Q(""),O(Nt))},onApprovalResolved:Nt=>{Ve.current===ze&&O(mt=>(mt==null?void 0:mt.id)===Nt?null:mt)},onBlocks:Nt=>{Ve.current===ze&&v(mt=>{const Tt=mt.slice(),Jn=Tt.findIndex(kt=>{var Xs;return((Xs=kt.meta)==null?void 0:Xs.localId)===ln}),Cs=Tt[Jn];return(Cs==null?void 0:Cs.role)==="assistant"&&(Tt[Jn]={...Cs,blocks:Nt}),Tt})},onUsage:Nt=>{Ve.current===ze&&v(mt=>{const Tt=mt.slice(),Jn=Tt.findIndex(kt=>{var Xs;return((Xs=kt.meta)==null?void 0:Xs.localId)===ln}),Cs=Tt[Jn];return(Cs==null?void 0:Cs.role)==="assistant"&&(Tt[Jn]={...Cs,meta:{...Cs.meta,sandboxUsage:Nt.usage}}),Tt})}});if(Ve.current!==ze)return;P3({kind:re.toolName,source:"composer",sessionState:"existing",durationMs:Date.now()-ke}),v(Nt=>{const mt=Nt.slice(),Tt=mt.findIndex(Cs=>{var kt;return((kt=Cs.meta)==null?void 0:kt.localId)===ln}),Jn=mt[Tt];return(Jn==null?void 0:Jn.role)==="assistant"&&(mt[Tt]={...Jn,blocks:qe.blocks,meta:{...Jn.meta,ts:Date.now()/1e3,...qe.usage?{sandboxUsage:qe.usage.usage}:{}}}),mt})}catch(qe){if((qe==null?void 0:qe.name)==="AbortError"||Ve.current!==ze)return;rp({kind:re.toolName,source:"composer",sessionState:"existing",durationMs:Date.now()-ke,phase:"sandbox_send",error:qe}),v(Nt=>Nt.filter(mt=>{var Tt,Jn;return((Tt=mt.meta)==null?void 0:Tt.localId)!==tn&&((Jn=mt.meta)==null?void 0:Jn.localId)!==ln})),Pt(M),ot(U),Zn.setSelectedSkills(Y),je(`内置智能体发送失败:${qe instanceof Error?qe.message:String(qe)}`);try{const Nt=await cn.getSettings(re.id);m(mt=>(mt==null?void 0:mt.id)===re.id?{...mt,...Nt}:mt)}catch{}}finally{Ve.current===ze&&(Ve.current=null,W.current===ln&&(W.current=""),x(!1),O(null),m(qe=>(qe==null?void 0:qe.id)===re.id?{...qe,busy:!1}:qe))}}async function cK(M){if(await Zn.executeSlash(M)||!p||y||Zn.commandBusy)return;const U=zt,Y=Zn.selectedSkills;Pt(""),ot([]),Zn.setSelectedSkills([]),await CC(M.trim(),U,Y)}function yl(){To(),je(""),Hu(YD()),ft("agent"),_t(null),Vu(),sn(!1);const M=a&&xn.length===0&&zt.length>0?a:"";et.current="",l(""),Kn(null),Cn([]),d(!1),h([]),mn(Sa()),Nh(zt),ot([]),M&&Gu(M)}function uK(){var M;Wu.current=!0,localStorage.removeItem(Na.app),a&&((M=dn.current.get(a))==null||M.abort()),c.current=null,yl(),s(""),We({}),Os(null)}function dK(){Dn(null),Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),rr(null),Pe(null),Ye(null),Es(!1),qr(null),yl()}async function fK(M){var U;try{(U=dn.current.get(M))==null||U.abort(),it(M,!1),await PS(n,ge,M),await DS(n,ge,M);const Y=rn.current.get(M);Y!==void 0&&window.clearTimeout(Y),rn.current.delete(M),ys(re=>{if(!re.has(M))return re;const xe=new Set(re);return xe.delete(M),xe}),ut(re=>{const{[M]:xe,...ke}=re;return ke}),M===a&&yl(),await E0(n)}catch(Y){je(String(Y))}}async function Oh(M){if(p&&To(),M!==a&&(et.current=M,je(""),d(!1),h([]),ft("agent"),_t(null),Vu(),mn(Sa()),Kn(null),Cn([]),l(M),Ot[M]===void 0)){Jg(!0);try{const U=await o1(n,ge,M);wt(M,fne(U.events??[],U.state))}catch(U){je(String(U))}finally{Jg(!1)}}}async function hK(M){if(!M.sessionId||!M.messageId){je("这条案例缺少会话定位信息,无法跳转。");return}_i(!1),Bt(null),As(!1),H(!1),oi(!1),_n(!1),BE(n),jG(M.kind),p0(M.messageId),await Oh(M.sessionId)}function pK(){const M=mC||n;_i(!1),Bt(null),As(!1),H(!1),oi(!1),Ki(""),Mi(M),h0("evaluations"),MG(IG),_n(!0),BE(""),p0("")}function mK(M){const U=new Map,Y=new Map;for(const re of M){if(!re.sessionId||!re.messageId)continue;const xe=U.get(re.sessionId)??new Set;if(xe.add(re.messageId),U.set(re.sessionId,xe),re.runtimeId&&re.userId){const ke=[re.runtimeId,n,re.userId,re.sessionId].join(":"),ze=Y.get(ke)??{runtimeId:re.runtimeId,appName:n,userId:re.userId,sessionId:re.sessionId,eventIds:new Set};ze.eventIds.add(re.messageId),Y.set(ke,ze)}}if(U.size!==0){ut(re=>{const xe={...re};for(const[ke,ze]of U){const nt=xe[ke];nt&&(xe[ke]=nt.map(Xe=>{var ct;return(ct=Xe.meta)!=null&&ct.eventId&&ze.has(Xe.meta.eventId)?{...Xe,meta:{...Xe.meta,feedback:void 0}}:Xe}))}return xe}),r(re=>re.map(xe=>{const ke=U.get(xe.id);if(!ke||!xe.state)return xe;const ze={...xe.state};for(const nt of ke)delete ze[`veadk_feedback:${nt}`];return{...xe,state:ze}})),ri(re=>{const xe=new Set(re);for(const ke of U.values())for(const ze of ke)xe.delete(ze);return xe});for(const re of Y.values())QB({runtimeId:re.runtimeId,appName:re.appName,userId:re.userId,sessionId:re.sessionId,eventIds:[...re.eventIds]});DG(re=>re&&(M.some(xe=>xe.id===re.id||xe.messageId===re.messageId)?null:re))}}async function IC(M=!0){if(a)return a;c.current||(c.current=a1(n,ge));const U=c.current;try{const Y=await U;M&&l(Y);const re=Date.now()/1e3,xe={id:Y,lastUpdateTime:re,events:[]};return r(ke=>[xe,...ke.filter(ze=>ze.id!==Y)]),Y}finally{c.current===U&&(c.current=null)}}async function gK(M){if(!n||!ge||!a||!ls)return!1;cs(!0),je("");try{const U=await FS(n,ge,a,M,ls.revision);return Kn(U),!0}catch(U){return je(String(U)),!1}finally{cs(!1)}}async function bK(M){if(!(!n||!ge||!a||!ls)){cs(!0),je("");try{const U=await v8(n,ge,a,M,ls.revision);Kn(U)}catch(U){je(String(U))}finally{cs(!1)}}}async function yK(M){je("");let U;try{U=await IC()}catch(re){je(String(re));return}const Y=Array.from(M).map(re=>({file:re,attachment:{id:WD(),mimeType:XD(re),name:re.name,sizeBytes:re.size,status:"uploading"}}));ot(re=>[...re,...Y.map(xe=>xe.attachment)]),await Promise.all(Y.map(async({file:re,attachment:xe})=>{try{const ke=await b8(n,ge,U,re);if(qn.current.delete(xe.id)){ke.uri&&await Qb(n,ke.uri);return}ot(ze=>ze.map(nt=>nt.id===xe.id?ke:nt))}catch(ke){if(qn.current.delete(xe.id))return;const ze=ke instanceof Error?ke.message:String(ke);ot(nt=>nt.map(Xe=>Xe.id===xe.id?{...Xe,status:"error",error:ze}:Xe)),je(ze)}}))}async function jC(M,U=[],Y=Sa(),re="composer"){if(!M.trim()&&U.length===0||So||ml||!n||!ge)return;je("");const xe=Date.now(),ke=!a,ze=ke?"new":"existing",nt=!!qi,Xe=[];(Y.skills.length>0||Y.targetAgent)&&Xe.push({kind:"invocation",value:Y}),U.length&&Xe.push({kind:"attachment",files:U.map(rt=>({id:rt.id,mimeType:rt.mimeType,data:rt.data,uri:rt.uri,name:rt.name,sizeBytes:rt.sizeBytes}))}),M.trim()&&Xe.push({kind:"text",text:M});const ct=[{role:"user",blocks:Xe,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}];ke&&(h(ct),d(!0));const Ze=He;let Ke;try{Ke=await IC(!ke)}catch(rt){ke&&(h([]),d(!1),Pt(M),mn(Y)),nt&&rp({kind:"runtime",source:re,sessionState:ze,durationMs:Date.now()-xe,phase:"create_session",error:rt}),je(String(rt));return}let tn=Zv(ls);if(Ze)try{let rt=await US(n,ge,Ke);const Ws=Bke[Ze].filter(qe=>{var Nt;return(Nt=ye.builtinTools)==null?void 0:Nt.includes(qe)});for(const qe of[...YH[Ze],...Ws])rt.tools.some(Nt=>Nt.name===qe)||(rt=await FS(n,ge,Ke,{kind:"tool",name:qe},rt.revision));Kn(rt),tn=Zv(rt)}catch(rt){ke&&(h([]),d(!1),Pt(M),mn(Y)),nt&&rp({kind:"runtime",source:re,sessionState:ze,durationMs:Date.now()-xe,phase:"mount_task_capabilities",error:rt}),je(`任务能力挂载失败:${String(rt)}`);return}wt(Ke,rt=>ke?ct:[...rt,...ct]),ke&&(et.current=Ke,l(Ke),h([]),d(!1));const ln=new AbortController;dn.current.set(Ke,ln),de(Ke,!0),Ie(Ke),et.current=Ke,Ya(rt=>({...rt,[Ke]:""})),t0(rt=>({...rt,[Ke]:new Set})),wo(rt=>({...rt,[Ke]:[]}));try{let rt=Oa(),Ws="",qe=0,Nt=Date.now()/1e3,mt="",Tt="",Jn=!1,Cs=null;for await(const kt of jm({appName:n,userId:ge,sessionId:Ke,text:M,attachments:U,invocation:Y,signal:ln.signal,sessionCapabilities:tn})){if(ln.signal.aborted)break;const Xs=kt.error??kt.errorMessage??kt.error_message;if(typeof Xs=="string"&&Xs){Jn=!0,Cs=Xs,et.current===Ke&&je(Xs);break}l0(Ke,kt);const xa=kt.author&&kt.author!=="user"?kt.author:"";xa&&xa!==Ws&&(Ws=xa,rt=Oa()),rt=Tf(rt,kt);const ar=kt.usageMetadata??kt.usage_metadata;ar!=null&&ar.totalTokenCount&&(qe=ar.totalTokenCount),kt.timestamp&&(Nt=kt.timestamp),kt.id&&(mt=kt.id);const Ao=kt.invocationId??kt.invocation_id;Ao&&(Tt=Ao);const Bs=rt.blocks,Dh={author:Ws||void 0,tokens:qe||void 0,ts:Nt,eventId:mt||void 0,invocationId:Tt||void 0};wt(Ke,w0=>{var Ph;const Co=w0.slice(),Io=Co[Co.length-1];return(Io==null?void 0:Io.role)==="assistant"&&(!((Ph=Io.meta)!=null&&Ph.author)||Io.meta.author===Ws)?Co[Co.length-1]={...Io,blocks:Bs,meta:Dh}:Co.push({role:"assistant",blocks:Bs,meta:Dh}),Co})}E0(n),!ln.signal.aborted&&nt&&(Jn?rp({kind:"runtime",source:re,sessionState:ze,durationMs:Date.now()-xe,phase:"run_sse",error:Cs??"run_sse failed"}):P3({kind:"runtime",source:re,sessionState:ze,durationMs:Date.now()-xe})),!ln.signal.aborted&&!Jn&&mt&&xs.current()}catch(rt){(rt==null?void 0:rt.name)!=="AbortError"&&!ln.signal.aborted&&et.current===Ke&&(nt&&rp({kind:"runtime",source:re,sessionState:ze,durationMs:Date.now()-xe,phase:"run_sse",error:rt}),je(String(rt)))}finally{dn.current.get(Ke)===ln&&dn.current.delete(Ke),de(Ke,!1),Be(Ke),Ya(rt=>({...rt,[Ke]:""})),wo(rt=>({...rt,[Ke]:[]}))}}function xK(M,U){var xe,ke;const Y=((xe=M==null?void 0:M.event)==null?void 0:xe.name)??U.id,re=((ke=M==null?void 0:M.event)==null?void 0:ke.context)??{};jC(`[ui-action] ${Y}: ${JSON.stringify(re)}`,[],Sa(),"a2ui_action")}async function EK(M){var Xe,ct,Ze;if(!M.authUri)throw new Error("事件中没有授权地址。");if(!n||!ge||!a)throw new Error("会话尚未就绪。");const U=a,Y=await VMe(M.authUri),re=GMe(M.authConfig,Y),xe=Ke=>Ke.map(tn=>tn.kind==="auth"&&!tn.done?{...tn,done:!0}:tn);wt(U,Ke=>{const tn=Ke.slice(),ln=tn[tn.length-1];return(ln==null?void 0:ln.role)==="assistant"&&(tn[tn.length-1]={...ln,blocks:xe(ln.blocks)}),tn});const ke=xt[xt.length-1],ze=xe(ke&&ke.role==="assistant"?ke.blocks:[]),nt=new AbortController;dn.current.set(U,nt),de(U,!0),Ie(U);try{let Ke=Oa(),tn=((Xe=ke==null?void 0:ke.meta)==null?void 0:Xe.author)??"",ln=ze,rt=0,Ws=Date.now()/1e3,qe=((ct=ke==null?void 0:ke.meta)==null?void 0:ct.eventId)??"",Nt=((Ze=ke==null?void 0:ke.meta)==null?void 0:Ze.invocationId)??"",mt=!1;for await(const Tt of jm({appName:n,userId:ge,sessionId:a,text:"",functionResponses:[{id:M.callId,name:"adk_request_credential",response:re}],signal:nt.signal,sessionCapabilities:Zv(ls)})){if(nt.signal.aborted)break;const Jn=Tt.error??Tt.errorMessage??Tt.error_message;if(typeof Jn=="string"&&Jn){mt=!0,et.current===U&&je(Jn);break}l0(U,Tt);const Cs=Tt.author&&Tt.author!=="user"?Tt.author:"";Cs&&Cs!==tn&&(tn=Cs,ln=[],Ke=Oa()),Ke=Tf(Ke,Tt);const kt=Tt.usageMetadata??Tt.usage_metadata;kt!=null&&kt.totalTokenCount&&(rt=kt.totalTokenCount),Tt.timestamp&&(Ws=Tt.timestamp),Tt.id&&(qe=Tt.id);const Xs=Tt.invocationId??Tt.invocation_id;Xs&&(Nt=Xs);const xa=[...ln,...Ke.blocks];wt(U,ar=>{var w0,Co,Io,Ph,$C;const Ao=ar.slice(),Bs=Ao[Ao.length-1],Dh={author:tn||((w0=Bs==null?void 0:Bs.meta)==null?void 0:w0.author),tokens:rt||((Co=Bs==null?void 0:Bs.meta)==null?void 0:Co.tokens),ts:Ws,eventId:qe||((Io=Bs==null?void 0:Bs.meta)==null?void 0:Io.eventId),invocationId:Nt||((Ph=Bs==null?void 0:Bs.meta)==null?void 0:Ph.invocationId)};return(Bs==null?void 0:Bs.role)==="assistant"&&(!(($C=Bs.meta)!=null&&$C.author)||Bs.meta.author===tn)?Ao[Ao.length-1]={...Bs,blocks:xa,meta:Dh}:Ao.push({role:"assistant",blocks:xa,meta:Dh}),Ao})}E0(n),!nt.signal.aborted&&!mt&&qe&&xs.current()}catch(Ke){(Ke==null?void 0:Ke.name)!=="AbortError"&&!nt.signal.aborted&&et.current===U&&je(String(Ke))}finally{dn.current.get(U)===nt&&dn.current.delete(U),de(U,!1),Be(U),Ya(Ke=>({...Ke,[U]:""})),wo(Ke=>({...Ke,[U]:[]}))}}if(ne)return o.jsxs("div",{className:"boot boot-error",children:[o.jsx("p",{children:ne}),o.jsx("button",{type:"button",onClick:qE,children:"重试"})]});if(qs===null)return o.jsx("div",{className:"boot"});if(qs==="unauthenticated")return o.jsx(aMe,{branding:Qn,cloudProvider:Dt,onUsername:XG});if(!St)return o.jsx("div",{className:"boot"});const Yr=St.capabilities.createAgents,RC=St.capabilities.manageAgents,xl=Yr?No:null,OC=Yr&&Ch,MC=Yr&&Ah,LC=qu&&!!(Sn||vC||wC),DC=lH(e,Xa),Mh=DC.filter(M=>M.runtimeId&&(yC===null||yC.has(M.runtimeId))).map(M=>{var U;return{...M,canDelete:M.runtimeId?((U=UG[M.runtimeId])==null?void 0:U.canDelete)===!0:!1}}),vK=(()=>{if(Mh.length===0)return Mh;const M=new Map(pC.map((U,Y)=>[U,Y]));return[...Mh].sort((U,Y)=>{const re=M.get(U.id),xe=M.get(Y.id);return re!=null&&xe!=null?re-xe:re!=null?-1:xe!=null?1:Mh.indexOf(U)-Mh.indexOf(Y)})})(),PC=M=>{var U;return((U=DC.find(Y=>Y.id===M))==null?void 0:U.label)??M},In=Xa.find(M=>M.runtimeId&&M.apps.some(U=>ho(M.id,U)===n)),qi=In&&In.runtimeId&&In.region?{runtimeId:In.runtimeId,name:In.name,region:In.region}:void 0,Lh=(qi==null?void 0:qi.runtimeId)??"",ko=In?In.apps.find(M=>ho(In.id,M)===n)??(At==null?void 0:At.appName)??In.apps[0]??In.name:"",wK=async M=>{var ke,ze,nt;const U=Xn,Y=a;if(!U||!Y)throw new Error("当前会话不可用,请关闭后重试。");const re=((ke=U.turn.meta)==null?void 0:ke.invocationId)??"",xe=Lh?[]:await l1(n,Y).catch(()=>[]);await BS({source:"agent_exec",module:"conversation",issues:M.issues,problem:"",description:M.description,page:"conversation",appName:ko||n,runtimeId:Lh,region:(qi==null?void 0:qi.region)??"cn-beijing",sessionId:Y,eventId:((ze=U.turn.meta)==null?void 0:ze.eventId)??((nt=U.turn.meta)==null?void 0:nt.localId)??"",invocationId:re,input:U.input,output:$c(U.turn),toolCalls:WR(U.turn),trace:nne(xe,re)})},_K=async M=>{const U=p?"":a,Y=p||U?xt:[],re=U&&n&&!Lh?await l1(n,U).catch(()=>[]):[];await BS({source:"platform",module:M.module,issues:M.issues,problem:"",description:M.description,page:vt??"unknown",appName:ko||n,runtimeId:Lh,region:(qi==null?void 0:qi.region)??"cn-beijing",sessionId:U,eventId:"",invocationId:"",input:Y.filter(xe=>xe.role==="user").map($c).filter(Boolean).join(` -`),output:Y.filter(xe=>xe.role==="assistant").map(Uc).filter(Boolean).join(` +`),output:Y.filter(xe=>xe.role==="assistant").map($c).filter(Boolean).join(` -`),toolCalls:Y.flatMap(YR),trace:ie})},BC=async(M,U,Y="")=>{var Qe,lt,Je,qe,rn,ln,rt,Ws;const ie=(Qe=M.meta)==null?void 0:Qe.eventId,xe=a;if(!ie||!xe||!qi)return;const ke=Uc(M),Ve=(lt=M.meta)==null?void 0:lt.feedback,tt={...Ve,rating:U,syncStatus:"syncing",updatedAt:Date.now()/1e3};vt(xe,Ye=>Ye.map(Nt=>{var pt;return((pt=Nt.meta)==null?void 0:pt.eventId)===ie?{...Nt,meta:{...Nt.meta,feedback:tt}}:Nt})),en(Ye=>new Set(Ye).add(ie)),In!=null&&In.runtimeId&&xo&&Wb({runtimeId:In.runtimeId,region:In.region??Ni(Rt),appName:xo,userId:be,sessionId:xe,messageId:ie,invocationId:(Je=M.meta)==null?void 0:Je.invocationId,rating:U,input:Y,output:ke,createdAt:(qe=M.meta)!=null&&qe.ts?new Date(M.meta.ts*1e3).toISOString():void 0});try{const Ye=await a8({appName:n,userId:be,sessionId:xe,eventId:ie,rating:U});vt(xe,Nt=>Nt.map(pt=>{var kt;return((kt=pt.meta)==null?void 0:kt.eventId)===ie?{...pt,meta:{...pt.meta,feedback:Ye}}:pt})),r(Nt=>Nt.map(pt=>pt.id===xe?{...pt,state:{...pt.state??{},[`veadk_feedback:${ie}`]:Ye}}:pt)),In!=null&&In.runtimeId&&xo&&(Wb({runtimeId:In.runtimeId,region:In.region??Ni(Rt),appName:xo,userId:be,sessionId:xe,messageId:ie,invocationId:(rn=M.meta)==null?void 0:rn.invocationId,rating:Ye.rating,input:Y,output:ke,createdAt:(ln=M.meta)!=null&&ln.ts?new Date(M.meta.ts*1e3).toISOString():void 0}),u8({runtimeId:In.runtimeId,region:In.region??Ni(Rt),appName:xo,pageSize:100}))}catch(Ye){vt(xe,Nt=>Nt.map(pt=>{var kt;return((kt=pt.meta)==null?void 0:kt.eventId)===ie?{...pt,meta:{...pt.meta,feedback:Ve}}:pt})),In!=null&&In.runtimeId&&xo&&Wb({runtimeId:In.runtimeId,region:In.region??Ni(Rt),appName:xo,userId:be,sessionId:xe,messageId:ie,invocationId:(rt=M.meta)==null?void 0:rt.invocationId,rating:(Ve==null?void 0:Ve.rating)??null,input:Y,output:ke,createdAt:(Ws=M.meta)!=null&&Ws.ts?new Date(M.meta.ts*1e3).toISOString():void 0}),bt.current===xe&&Le(Ye instanceof Error?Ye.message:String(Ye))}finally{en(Ye=>{const Nt=new Set(Ye);return Nt.delete(ie),Nt})}},E0=async M=>{Mh(Na());let U=nt.current.get(M);U||(U=await p_(M),nt.current.set(M,U)),$e(U),Ms(Y=>Y+1),s(M),sr(null),Ki(""),Di(""),Es(!1),Nn(!1),zt(null),ai(!1),H(!1),fe(!1),wi(!1),pl()},_K=async M=>{await E0(M)},SK=M=>{if(!zr){Le("当前账号没有添加 Agent 的权限。");return}Es(!1),Nn(!1),g0(M),Ge(null),zt(null),fe(!0),Le("")},NK=async(M,U)=>{if(!M.runtime)throw new Error("缺少 Runtime 信息,无法连接智能体。");const Y=Date.now();try{const ie=await uy(M.runtime.runtimeId,M.name,M.runtime.region,M.runtime.currentVersion);return mb({kind:"runtime",source:U,durationMs:Date.now()-Y,runtimeRegion:M.runtime.region,runtimeIsMine:M.isMine}),ie}catch(ie){throw Vw({kind:"runtime",source:U,durationMs:Date.now()-Y,error:ie}),ie}},UC=async(M,U={})=>{if(M.runtime)try{const Y=await NK(M,U.source??"my_agents");await E0(Y)}catch(Y){const ie=Y instanceof Error?Y.message:String(Y);if(Le(ie),U.rethrow)throw new Error(ie)}},TK=M=>{M.runtime&&(sr(M),Ki(""),Di(""),Es(!1),Nn(!0),Le(""))},kK=M=>{if(!zr){Le("当前账号没有创建智能体的权限。");return}AC(M,!0)},XE=()=>{Ts(null),m&&yo(),bt.current="",l(""),zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Be(null),We(null),Ki(""),Di(""),Es(!0),Hr(null),Le("")},AK=()=>{Ts(null),m&&yo(),bt.current="",l(""),zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Be(null),We(null),Es(!1),Hr("catalog"),Le("")},CK=async M=>{if(BE(""),h0(""),M.runtimeId&&M.id.startsWith("detail:")){const U=Date.now();try{const Y=await uy(M.runtimeId,M.label,M.region??Ni(Rt),M.currentVersion);mb({kind:"runtime",source:"agent_workspace",durationMs:Date.now()-U,runtimeRegion:M.region}),await E0(Y)}catch(Y){Vw({kind:"runtime",source:"agent_workspace",durationMs:Date.now()-U,error:Y}),Le(Y instanceof Error?Y.message:String(Y))}return}await E0(M.id)},QE=Tn!=null&&Tn.runtime?Va.find(M=>{var U;return M.runtimeId===((U=Tn.runtime)==null?void 0:U.runtimeId)}):void 0,bl=Tn!=null&&Tn.runtime?{id:`detail:${Tn.runtime.runtimeId}`,label:Tn.name,app:Tn.appName??Tn.name,remote:!0,runtimeApp:QE==null?void 0:QE.apps[0],runtimeId:Tn.runtime.runtimeId,region:Tn.runtime.region,currentVersion:Tn.runtime.currentVersion,canDelete:Tn.runtime.canDelete}:null,FC=gn!==null?"feedback":vc?"applications":PE?"search":hl||Wu||et||Fe?"agents":a||bo||qu||Rh||le?null:"new-chat";return o.jsxs("div",{className:"layout",children:[o.jsx(Mne,{branding:Xn,cloudProvider:Rt,access:ft,features:Us,sessions:i,currentSessionId:a,activePage:FC,streamingSids:Ps,evaluatingSids:pn,onNewChat:uK,onSearch:()=>{Ts(null),m&&yo(),zt(null),ai(!1),H(!1),fe(!1),Nn(!1),sr(null),Be(null),We(null),Es(!1),Hr(null),wi(!0),Le("")},onQuickCreate:()=>{if(!zr){Le("当前账号没有添加 Agent 的权限。");return}m&&yo(),bt.current="",l(""),ai(!1),H(!1),wi(!1),Nn(!1),sr(null),Be(null),We(null),Es(!1),Hr(null),zt(null),Ge(null),g0(Ni(Rt)),fe(!0),Le("")},onSkillCenter:()=>{m&&yo(),zt(null),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Be(null),We(null),Es(!1),Hr(null),ai(!0),Le("")},onAddAgent:()=>{if(!zr){Le("当前账号没有添加 Agent 的权限。");return}m&&yo(),bt.current="",zt(null),ai(!1),wi(!1),Nn(!1),sr(null),Be(null),We(null),Es(!1),Hr(null),l(""),fe(!1),H(!0),Le("")},onMyAgents:XE,onApplications:AK,onIssueFeedback:()=>{gn===null&&(Ts(FC??(m?"sandbox":a?"conversation":"workspace")),Le(""))},onPickSession:M=>{Ts(null),zt(null),ai(!1),H(!1),fe(!1),wi(!1),Nn(!1),sr(null),Be(null),We(null),Es(!1),Hr(null),Le(""),Dh(M)},onDeleteSession:dK,userInfo:un,version:AE,onLogout:XG}),(()=>{const M=o.jsxs("div",{className:`composer-slot${m?" sandbox-composer-wrap":""}`,children:[m&&o.jsx(vOe,{agentName:m.toolName==="codex"?"Codex":m.toolName==="openclaw"?"OpenClaw":"Hermes",onExit:pl}),m?o.jsx(tMe,{appName:n,value:Vt,onChange:Ft,onSubmit:U=>void lK(U),disabled:!1,busy:y||Qn.commandBusy,attachments:Bt,onAddFiles:aK,onRemoveAttachment:oK,actions:{onOpenTerminal:()=>void WE("terminal"),onOpenBrowser:()=>void WE("browser"),onOpenPermissions:()=>{_(""),T(!0)},onOpenWorkspace:()=>{_(""),j(!0)},workspaceLocked:m.workspaceLocked,settingsBusy:E,uploadBusy:ee||y},models:Qn.models,modelsLoading:Qn.modelsLoading,modelsLoaded:Qn.modelsLoaded,currentModel:m.model,onRequestModels:()=>void Qn.loadModels(),skills:Qn.skills,skillsLoading:Qn.skillsLoading,skillsLoaded:Qn.skillsLoaded,selectedSkills:Qn.selectedSkills,onRequestSkills:()=>void Qn.loadSkills(),onSelectedSkillsChange:Qn.setSelectedSkills}):o.jsx(Uke,{sessionId:a,sessionInitializing:u,appName:n,agentName:n?PC(n):"Agent",value:Vt,onChange:Ft,onSubmit:()=>{if(!m&&it==="skill-create"){const xe=Vt.trim();if(!xe||qt)return;const ke={id:`pending-${Date.now()}`,prompt:xe,status:"provisioning",candidates:CA.map((tt,Qe)=>({id:`pending-${Qe}`,model:tt,modelLabel:tt,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};mn(!0);const Ve=++wt.current;Le(""),nn(ke),Ft(""),eRe(xe,tt=>{wt.current===Ve&&nn(tt)}).then(tt=>{wt.current===Ve&&nn(tt)}).catch(tt=>{wt.current===Ve&&(nn(null),Ft(xe),Le(tt instanceof Error?tt.message:String(tt)))}).finally(()=>{wt.current===Ve&&mn(!1)});return}const U=Vt;if(Ft(""),m){CC(U);return}const Y=Bt,ie=En;Tt([]),vn(xa()),jC(U,Y,ie),b_(Y)},disabled:m?!1:!be||it==="temporary"||it==="agent"&&!n,busy:m?y:it==="skill-create"?qt:cl,showMeta:Et.length>0&&!m,attachments:m?[]:Bt,skills:m?[]:ME,agents:m?[]:r0,invocation:m?xa():En,capabilitiesLoading:!m&&wn,allowAttachments:!m,onInvocationChange:vn,onAddFiles:bK,onRemoveAttachment:LE,newChatMode:m?"agent":it,newChatTask:m?null:He,newChatLayout:!m&&Et.length===0&&qn===null,showAgentPicker:!m&&Et.length===0&&qn===null&&it==="agent",agentPickerDisabled:!be||cl,selectedRuntimeId:qi==null?void 0:qi.runtimeId,runtimeScope:ft.capabilities.runtimeScope,onSelectRuntime:async U=>{var Y;await UC({id:U.runtimeId,name:U.name,description:((Y=U.description)==null?void 0:Y.trim())||"暂无描述",createdAt:U.createdAt??"",specificationLabel:"地域",specification:kf(U.region,Rt),isMine:U.isMine,runtime:{runtimeId:U.runtimeId,region:U.region,currentVersion:U.currentVersion,canDelete:U.canDelete}},{rethrow:!0,source:"new_chat_picker"})},onSelectSandboxSession:U=>YE(U,"new_chat_picker"),showModeSelector:!1,temporaryEnabled:$t&&ge.temporaryEnabled,skillCreateEnabled:$t&&ge.skillCreateEnabled,harnessEnabled:$t&&ge.harnessEnabled,builtinTools:$t?ge.builtinTools:[],onModeChange:U=>{if(!(U==="temporary"&&!ge.temporaryEnabled||U==="skill-create"&&!ge.skillCreateEnabled)){if(U==="temporary"){St(null),dt(U),AC();return}if(dt(U),U!=="agent"&&St(null),Le(""),U==="skill-create"){vn(xa());const Y=a&&yn.length===0&&Bt.length>0?a:"";Gu(Bt),Tt([]),Y&&(bt.current="",l(""),Ih(Y))}}},onTaskChange:St})]});return o.jsx("section",{className:"main-shell",children:o.jsxs("main",{className:`main${m?" is-sandbox-session":""}`,children:[$n&&o.jsx("div",{className:"error",role:"alert",children:$n}),bs&&o.jsx("div",{className:"error",role:"alert",children:bs}),t0&&o.jsxs("div",{className:"session-loading",children:[o.jsx(bn,{className:"icon spin"})," 加载会话…"]}),pC&&!LC&&!OC&&!MC&&!PE&&!qu&&gl===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:hK,children:[o.jsx(Vk,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),gn!==null?o.jsx(gMe,{initialModule:AMe(gn),onSubmit:wK}):vc==="coding-agents"?o.jsx(WTe,{onBack:()=>Hr("catalog")}):vc==="feishu"?o.jsx(jTe,{onBack:()=>Hr("catalog")}):vc&&vc!=="catalog"?o.jsx(eTe,{automation:vc,onBack:()=>Hr("catalog")}):vc==="catalog"?o.jsx(WNe,{onOpen:Hr}):Fe?o.jsx(qOe,{workspace:Fe,onBack:XE}):et?o.jsx(HOe,{session:et,onBack:XE,onOpen:()=>YE(et,"sandbox_detail"),onDelete:()=>tK(et)}):hl?o.jsx(_Ne,{cloudProvider:Rt,canCreate:zr,runtimeScope:ft.capabilities.runtimeScope,onCreateAgent:SK,onUseAgent:U=>UC(U,{source:"my_agents"}),onViewAgentDetails:TK,onCreateSandboxAgent:kK,onUseSandboxAgent:U=>YE(U,"my_agents"),onViewSandboxAgentDetails:eK,sandboxRefreshKey:pe,connectedRuntimeId:Bh,hiddenRuntimeIds:UG,drafts:dl,deploymentTasks:o0,draftDeploymentTaskIds:DE,onViewDeploymentTask:VE,onEditDraft:U=>{Es(!1),Ge(U.draft),zn("custom"),$r(U.id),vr.current=U,ha(U.deploymentTarget??null),Ki(""),Di(""),zt("custom"),Le("")},onDeleteDraft:U=>_C([U])}):LC?o.jsx(fSe,{agents:bl?[bl]:EK,drafts:dl,agentOrder:mC,selectedAgentId:n,agentInfo:Ht,agentInfoAgentId:n,loadingAgentInfo:wn,canCreate:zr,canUpdate:zr||RC,loadingAgents:DG,agentsError:PG,deploymentTasks:o0,focusedDeploymentTaskId:vC,focusedAgentId:(bl==null?void 0:bl.id)??wC,focusedAgentSection:jG,focusedCaseKind:RG,feedbackCasePreview:MG,detailOnly:!0,onRetryAgents:()=>void HE(),onAgentOrderChange:HG,onDeleteAgents:zG,onDeleteDrafts:_C,onSelectAgent:_K,onTalkAgent:CK,onOpenFeedbackCase:U=>void fK(U),onFeedbackCasesDeleted:mK,onCreateAgent:()=>{if(!zr){Le("当前账号没有添加 Agent 的权限。");return}Nn(!1),fe(!0),zt(null),Ge(null),ha(null),g0(Ni(Rt)),$r(""),vr.current=null,Ki(""),Di(""),Le("")},onUpdateAgent:(U,Y)=>{var Ve,tt;if(!RC&&!zr){Le("当前账号没有管理 Agent 的权限。");return}if(!Y.canUpdate){Le(Y.reason||"当前 Runtime 不支持原地更新。");return}if(!Y.runtime.runtimeId){Le("仅支持更新已部署的云端智能体。");return}if(!Y.runtime.region){Le("Runtime 缺少地域信息,无法更新。");return}if(!((Ve=Y.agent)!=null&&Ve.appName)){Le("Runtime 缺少智能体名称,无法更新。");return}const ie=Object.fromEntries(Y.runtime.envs.map(({key:Qe,value:lt})=>[Qe,lt])),xe={...U,deployment:{...U.deployment??{feishuEnabled:!1},network:Y.runtime.network,envValues:{...ie,...((tt=U.deployment)==null?void 0:tt.envValues)??{}}}};Nn(!1),Ge(xe),zn("custom");const ke=`runtime-${Y.runtime.runtimeId}`;$r(ke),vr.current=dl.find(Qe=>Qe.id===ke)??null,Ki(""),Di(""),ha({runtimeId:Y.runtime.runtimeId,name:Y.runtime.name||Y.agent.name||U.name,region:Y.runtime.region,appName:Y.agent.appName,currentVersion:Y.runtime.currentVersion}),zt("custom"),Le("")},onEditDraft:U=>{Nn(!1),Ge(U.draft),zn("custom"),$r(U.id),vr.current=U,ha(U.deploymentTarget??null),Ki(""),Di(""),zt("custom"),Le("")}},(bl==null?void 0:bl.id)??"workspace"):OC?o.jsx(YH,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:DMe,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{fe(!1),Ge(null),zt("menu")}},{key:"package",icon:PMe,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{fe(!1),Ge(null),zt("package")}},{key:"migration",icon:BMe,title:"从存量迁移",desc:"从您的 LangChain / Dify 等存量项目迁移至 AgentKit Runtime",status:"敬请期待",disabled:!0,onClick:()=>{}}]}):PE?o.jsx(Nne,{userId:be,appId:n,agentInfo:Ht,capabilitiesLoading:wn,agentLabel:PC,onOpenSession:QG}):MC?o.jsx(z_e,{onAdded:U=>{Mh(Na()),H(!1),s(U)},onCancel:()=>H(!1)}):qu?o.jsx(F_e,{cloudProvider:Rt}):gl!==null&&!c0?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,height:"100%",padding:24,textAlign:"center",color:"var(--text-secondary, #6b7280)"},children:[o.jsxs("div",{style:{fontSize:18,fontWeight:600},children:["需要配置",Rt==="byteplus"?"BytePlus":"火山引擎"," AK/SK"]}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要",Rt==="byteplus"?" BytePlus ":" Volcengine ","凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:Rt==="byteplus"?"BYTEPLUS_ACCESS_KEY":"VOLCENGINE_ACCESS_KEY"})," ","与"," ",o.jsx("code",{children:Rt==="byteplus"?"BYTEPLUS_SECRET_KEY":"VOLCENGINE_SECRET_KEY"})," ","后重试。"]})]}):gl==="menu"?o.jsx(lAe,{onSelect:U=>{Ge(null),ha(null),Ki(""),Di(""),U==="custom"&&zn("custom"),$r(U==="custom"?`draft-${Date.now().toString(36)}`:""),vr.current=null,zt(U)},onImport:U=>{Ge(U),zn("yaml_import"),ha(null),Ki(""),Di(""),$r(`draft-${Date.now().toString(36)}`),vr.current=null,zt("custom")}}):gl==="intelligent"?o.jsx(UAe,{userId:be,cloudProvider:Rt,onBack:()=>zt("menu"),onCreate:y0,onAgentAdded:zE,onDeploymentTaskChange:Ku}):gl==="custom"?o.jsx(Tje,{cloudProvider:Rt,initialDraft:Ce??void 0,onBack:()=>zt("menu"),onCreate:y0,onAgentAdded:zE,features:Us,onDeploymentTaskChange:Ku,createMode:_t,deploymentTarget:Xu??void 0,initialDeployRegion:p0,onDraftChange:(U,Y)=>{Ys&&(Y?$G(Ys,U,Xu??void 0):SC(Ys))},onDiscard:Ys?()=>{SC(Ys),$r(""),vr.current=null,Ge(null),ha(null),Ki(""),Di(n),zt(null),fe(!1),Nn(!0),Le("")}:void 0,onDeploymentStarted:NC,onDeploymentComplete:TC},Ys||"custom"):gl==="template"?o.jsx(Cje,{cloudProvider:Rt,onBack:()=>zt("menu"),onCreate:y0}):gl==="workflow"?o.jsx(Pje,{cloudProvider:Rt,onBack:()=>zt("menu"),onCreate:y0}):gl==="package"?o.jsx(Hje,{cloudProvider:Rt,onBack:()=>{zt(null),fe(!0)},onAgentAdded:zE,onDeploymentTaskChange:Ku,onDeploymentStarted:NC,onDeploymentComplete:TC,initialDeployRegion:p0}):Et.length===0&&qn?o.jsx(pRe,{initialJob:qn}):Et.length===0&&!$t?o.jsxs("div",{className:"session-loading",children:[o.jsx(bn,{className:"icon spin"})," 正在检查 Agent 能力…"]}):Et.length===0?o.jsxs("div",{className:"welcome",children:[o.jsxs("div",{className:"welcome-primary",children:[o.jsxs("div",{className:"welcome-heading",children:[o.jsx(pOe,{canUpdate:ft.role==="admin"}),o.jsx("h1",{className:"welcome-title",children:m?"让灵感自由生长":it==="skill-create"?"想创建一个什么 Skill?":xc})]}),M]}),o.jsx(sOe,{})]},`welcome-${ge.agentId??n}`):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${IE?" is-streaming":""}`,ref:Lh,onScroll:VG,onWheel:GG,onTouchMove:KG,children:Et.map((U,Y)=>{var Ws,Ye,Nt,pt,kt,Zn,Cs;const ie=Y===Et.length-1;if(U.role==="system")return U.activity?o.jsx("div",{className:"turn turn--system",children:o.jsx(wOe,{activity:U.activity,time:uT((Ws=U.meta)==null?void 0:Ws.ts)})},U.activity.id):null;if(U.role==="user"){const At=U.blocks.map(ir=>ir.kind==="text"?ir.text:"").join(""),Xs=U.blocks.flatMap(ir=>ir.kind==="attachment"?ir.files:[]),ma=U.blocks.find(ir=>ir.kind==="invocation");return o.jsxs(ss.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(ma==null?void 0:ma.kind)==="invocation"&&o.jsx(rE,{value:ma.value}),Xs.length>0&&o.jsx(aE,{appName:n,items:Xs}),At&&o.jsx("div",{className:"bubble",children:o.jsx(gh,{text:At})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((Ye=U.meta)==null?void 0:Ye.ts)&&o.jsx("span",{className:"meta-text",children:uT(U.meta.ts)}),o.jsx(GD,{text:At})]})]},Y)}const xe=((Nt=U.meta)==null?void 0:Nt.author)??"",ke=xe&&Li?cT(Li,xe):void 0,Ve=!!(xe&&Ah.length>0&&!Ah.includes(xe)),tt=(ke==null?void 0:ke.name)||xe,Qe=(ke==null?void 0:ke.description)||(Ve?"正在执行主 Agent 移交的任务。":"");if(U.blocks.length>0&&U.blocks.every(At=>At.kind==="agent-transfer"))return null;const lt=U.blocks.length===0,Je=((kt=(pt=U.meta)==null?void 0:pt.feedback)==null?void 0:kt.rating)??null,qe=((Zn=U.meta)==null?void 0:Zn.eventId)??"",rn=Ns.has(qe),ln=!!(qi&&qe&&Uc(U)),rt=ln?VD(Et,Y):"";return o.jsxs(ss.div,{ref:At=>{qe&&(At?GE.current.set(qe,At):GE.current.delete(qe))},className:["turn turn--assistant",Ve?"turn--subagent":"",Oh&&Oh===qe?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[Ve&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(Iee,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:tt})]}),o.jsx("p",{className:"subagent-run-description",title:Qe,children:Qe})]}),lt?ie&&ul?o.jsx(KH,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(kA,{appName:n,blocks:U.blocks,streaming:ie&&(ul||go),onStreamFrame:ie?qG:void 0,onAction:yK,onAuth:xK,onArtifactDownload:(At,Xs)=>h8(n,be,a,At,Xs),onArtifactPreview:(At,Xs)=>p8(n,be,a,At,Xs)}),!(ie&&ul)&&!HMe(U)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(ie&&ul)&&!zMe(U)&&o.jsxs("div",{className:"turn-meta",children:[m&&((Cs=U.meta)!=null&&Cs.sandboxUsage)?o.jsx(SOe,{usage:U.meta.sandboxUsage}):null,o.jsxs("div",{className:"turn-actions",children:[ln&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${Je==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":Je==="good","aria-busy":rn,title:Je==="good"?"取消点赞":"赞",disabled:rn,onClick:()=>void BC(U,Je==="good"?null:"good",rt),children:o.jsx(kne,{className:"icon",filled:Je==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${Je==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":Je==="bad","aria-busy":rn,title:Je==="bad"?"取消点踩":"踩",disabled:rn,onClick:()=>void BC(U,Je==="bad"?null:"bad",rt),children:o.jsx(Ane,{className:"icon",filled:Je==="bad"})})]}),!m&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"icon-btn","aria-label":"问题反馈",title:"问题反馈",onClick:()=>Oi({turn:U,input:VD(Et,Y)}),children:o.jsx(K8,{className:"icon"})}),o.jsx("button",{type:"button",className:"icon-btn",title:"Tracing 火焰图",onClick:()=>{var At;Fu((At=U.meta)!=null&&At.ts?U.meta.ts*1e3:Date.now()),ol(!0)},children:o.jsx(UMe,{})})]}),o.jsx(GD,{text:Uc(U)})]}),U.meta&&o.jsx("span",{className:"meta-text",children:FMe(U.meta)})]})]})]},Y)})}),!m&&o.jsx(rhe,{appName:n,info:Ht,loading:wn,activeAgent:jE,seenAgents:RE,execPath:OE,capabilities:Yn,capabilityLoading:ri,capabilityMutating:Ds,builtinTools:Ls,onAddCapability:pK,onRemoveCapability:U=>void gK(U)}),o.jsx("div",{className:"conversation-composer-slot",children:M})]})]})})})(),Ut&&a&&o.jsx(dMe,{onClose:()=>Oi(null),onSubmit:vK}),Ha&&a&&o.jsx(tG,{appName:n,sessionId:a,endTimeMs:nr,onClose:()=>ol(!1)}),o.jsx(EOe,{open:X,state:ce,agentKind:we,error:ye,onCancel:ZG,onConfirm:M=>void JG(M)}),m?o.jsxs(o.Fragment,{children:[o.jsx(OOe,{open:R!==null,kind:R??"terminal",launch:z,loading:F,error:I,onReload:()=>{R&&WE(R)},onClose:()=>{B(null),L(null),C(!1),D("")}}),o.jsx(BOe,{open:k,value:m.permissions,busy:E||y,error:S,onSave:M=>void nK(M),onClose:()=>{E||(T(!1),_(""))}}),o.jsx(UOe,{open:A,cwd:m.cwd,locked:m.workspaceLocked,busy:E,error:S,browse:sK,onSave:M=>void iK(M),onClose:()=>{E||(j(!1),_(""))}}),o.jsx(MOe,{open:Qn.threadsOpen,threads:Qn.threads,currentThreadId:m.threadId,loading:Qn.threadsLoading,error:Qn.threadsError,onSelect:M=>void Qn.resumeThread(M),onClose:Qn.closeThreads}),o.jsx(FOe,{approval:$,busy:te,error:P,onDecision:M=>void rK(M)})]}):null,o.jsx(oMe,{open:ks,checking:As,error:mo,onLogin:()=>void YG()}),FG&&o.jsx("div",{className:"confirm-scrim",onClick:()=>FE(!1),children:o.jsxs("div",{className:"confirm-box",onClick:M=>M.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>FE(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{Ge(null),zt("menu"),FE(!1)},children:"确定返回"})]})]})})]})}const QD="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(QD)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(QD,String(t))}catch{}window.location.reload()}});(()=>{if(!(window.opener&&window.opener!==window&&/[?&](code|state|error)=/.test(window.location.search)))return!1;try{window.opener.postMessage({veadkOAuth:!0,url:window.location.href},window.location.origin)}catch{}return window.close(),!0})()||CW.createRoot(document.getElementById("root")).render(o.jsx(Pt.StrictMode,{children:o.jsx(FW,{reducedMotion:"user",children:o.jsx(xee,{maskOpacity:.9,children:o.jsx(JMe,{})})})}));export{XA as $,uye as A,dye as B,_F as C,o as D,ht as E,Fn as F,Qt as G,sLe as H,LV as I,kbe as J,yi as K,g as L,Yx as M,Dr as N,iLe as O,yV as P,tp as Q,Pt as R,Eu as S,mIe as T,_V as U,zi as V,pr as W,Pu as X,yE as Y,wV as Z,wu as _,ca as a,fF as a0,MV as b,xIe as c,yL as d,Uf as e,er as f,rLe as g,aV as h,yc as i,EE as j,Kf as k,HAe as l,fLe as m,q2 as n,fge as o,XAe as p,Xp as q,an as r,Cbe as s,Dbe as t,mge as u,qf as v,Dye as w,bbe as x,ybe as y,Vye as z}; +`),toolCalls:Y.flatMap(WR),trace:re})},BC=async(M,U,Y="")=>{var Xe,ct,Ze,Ke,tn,ln,rt,Ws;const re=(Xe=M.meta)==null?void 0:Xe.eventId,xe=a;if(!re||!xe||!qi||Dt==="byteplus")return;const ke=$c(M),ze=(ct=M.meta)==null?void 0:ct.feedback,nt={...ze,rating:U,syncStatus:"syncing",updatedAt:Date.now()/1e3};wt(xe,qe=>qe.map(Nt=>{var mt;return((mt=Nt.meta)==null?void 0:mt.eventId)===re?{...Nt,meta:{...Nt.meta,feedback:nt}}:Nt})),ri(qe=>new Set(qe).add(re)),In!=null&&In.runtimeId&&ko&&Xb({runtimeId:In.runtimeId,region:In.region??Ti(Dt),appName:ko,userId:ge,sessionId:xe,messageId:re,invocationId:(Ze=M.meta)==null?void 0:Ze.invocationId,rating:U,input:Y,output:ke,createdAt:(Ke=M.meta)!=null&&Ke.ts?new Date(M.meta.ts*1e3).toISOString():void 0});try{const qe=await o8({appName:n,userId:ge,sessionId:xe,eventId:re,rating:U});wt(xe,Nt=>Nt.map(mt=>{var Tt;return((Tt=mt.meta)==null?void 0:Tt.eventId)===re?{...mt,meta:{...mt.meta,feedback:qe}}:mt})),r(Nt=>Nt.map(mt=>mt.id===xe?{...mt,state:{...mt.state??{},[`veadk_feedback:${re}`]:qe}}:mt)),In!=null&&In.runtimeId&&ko&&(Xb({runtimeId:In.runtimeId,region:In.region??Ti(Dt),appName:ko,userId:ge,sessionId:xe,messageId:re,invocationId:(tn=M.meta)==null?void 0:tn.invocationId,rating:qe.rating,input:Y,output:ke,createdAt:(ln=M.meta)!=null&&ln.ts?new Date(M.meta.ts*1e3).toISOString():void 0}),d8({runtimeId:In.runtimeId,region:In.region??Ti(Dt),appName:ko,pageSize:100}))}catch(qe){wt(xe,Nt=>Nt.map(mt=>{var Tt;return((Tt=mt.meta)==null?void 0:Tt.eventId)===re?{...mt,meta:{...mt.meta,feedback:ze}}:mt})),In!=null&&In.runtimeId&&ko&&Xb({runtimeId:In.runtimeId,region:In.region??Ti(Dt),appName:ko,userId:ge,sessionId:xe,messageId:re,invocationId:(rt=M.meta)==null?void 0:rt.invocationId,rating:(ze==null?void 0:ze.rating)??null,input:Y,output:ke,createdAt:(Ws=M.meta)!=null&&Ws.ts?new Date(M.meta.ts*1e3).toISOString():void 0}),et.current===xe&&je(qe instanceof Error?qe.message:String(qe))}finally{ri(qe=>{const Nt=new Set(qe);return Nt.delete(re),Nt})}},v0=async M=>{jh(Ia());let U=Ge.current.get(M);U||(U=await m_(M),Ge.current.set(M,U)),We(U),bs(Y=>Y+1),s(M),rr(null),Ki(""),Mi(""),Es(!1),_n(!1),Bt(null),oi(!1),As(!1),H(!1),_i(!1),yl()},SK=async M=>{await v0(M)},NK=M=>{if(!Yr){je("当前账号没有添加 Agent 的权限。");return}Es(!1),_n(!1),b0(M),fe(null),Bt(null),H(!0),je("")},TK=async(M,U)=>{if(!M.runtime)throw new Error("缺少 Runtime 信息,无法连接智能体。");const Y=Date.now();try{const re=await dy(M.runtime.runtimeId,M.name,M.runtime.region,M.runtime.currentVersion);return mb({kind:"runtime",source:U,durationMs:Date.now()-Y,runtimeRegion:M.runtime.region,runtimeIsMine:M.isMine}),re}catch(re){throw Vw({kind:"runtime",source:U,durationMs:Date.now()-Y,error:re}),re}},UC=async(M,U={})=>{if(M.runtime)try{const Y=await TK(M,U.source??"my_agents");await v0(Y)}catch(Y){const re=Y instanceof Error?Y.message:String(Y);if(je(re),U.rethrow)throw new Error(re)}},kK=M=>{M.runtime&&(rr(M),Ki(""),Mi(""),Es(!1),_n(!0),je(""))},AK=M=>{if(!Yr){je("当前账号没有创建智能体的权限。");return}AC(M,!0)},XE=()=>{Dn(null),p&&To(),et.current="",l(""),Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),rr(null),Pe(null),Ye(null),Ki(""),Mi(""),Es(!0),qr(null),je("")},CK=()=>{Dn(null),p&&To(),et.current="",l(""),Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),rr(null),Pe(null),Ye(null),Es(!1),qr("catalog"),je("")},IK=async M=>{if(BE(""),p0(""),M.runtimeId&&M.id.startsWith("detail:")){const U=Date.now();try{const Y=await dy(M.runtimeId,M.label,M.region??Ti(Dt),M.currentVersion);mb({kind:"runtime",source:"agent_workspace",durationMs:Date.now()-U,runtimeRegion:M.region}),await v0(Y)}catch(Y){Vw({kind:"runtime",source:"agent_workspace",durationMs:Date.now()-U,error:Y}),je(Y instanceof Error?Y.message:String(Y))}return}await v0(M.id)},QE=Sn!=null&&Sn.runtime?Xa.find(M=>{var U;return M.runtimeId===((U=Sn.runtime)==null?void 0:U.runtimeId)}):void 0,El=Sn!=null&&Sn.runtime?{id:`detail:${Sn.runtime.runtimeId}`,label:Sn.name,app:Sn.appName??Sn.name,remote:!0,runtimeApp:QE==null?void 0:QE.apps[0],runtimeId:Sn.runtime.runtimeId,region:Sn.runtime.region,currentVersion:Sn.runtime.currentVersion,canDelete:Sn.runtime.canDelete}:null,FC=vt!==null?"feedback":_c?"applications":PE?"search":gl||qu||Je||Fe?"agents":a||No||Ku||Ah||Ch?null:"new-chat";return o.jsxs("div",{className:"layout",children:[o.jsx(Mne,{branding:Qn,cloudProvider:Dt,access:St,features:Ds,sessions:i,currentSessionId:a,activePage:FC,streamingSids:Yn,evaluatingSids:gn,onNewChat:dK,onSearch:()=>{Dn(null),p&&To(),Bt(null),oi(!1),As(!1),H(!1),_n(!1),rr(null),Pe(null),Ye(null),Es(!1),qr(null),_i(!0),je("")},onQuickCreate:()=>{if(!Yr){je("当前账号没有添加 Agent 的权限。");return}p&&To(),et.current="",l(""),oi(!1),As(!1),_i(!1),_n(!1),rr(null),Pe(null),Ye(null),Es(!1),qr(null),Bt(null),fe(null),b0(Ti(Dt)),H(!0),je("")},onSkillCenter:()=>{p&&To(),Bt(null),As(!1),H(!1),_i(!1),_n(!1),rr(null),Pe(null),Ye(null),Es(!1),qr(null),oi(!0),je("")},onAddAgent:()=>{if(!Yr){je("当前账号没有添加 Agent 的权限。");return}p&&To(),et.current="",Bt(null),oi(!1),_i(!1),_n(!1),rr(null),Pe(null),Ye(null),Es(!1),qr(null),l(""),H(!1),As(!0),je("")},onMyAgents:XE,onApplications:CK,onIssueFeedback:()=>{vt===null&&(Dn(FC??(p?"sandbox":a?"conversation":"workspace")),je(""))},onPickSession:M=>{Dn(null),Bt(null),oi(!1),As(!1),H(!1),_i(!1),_n(!1),rr(null),Pe(null),Ye(null),Es(!1),qr(null),je(""),Oh(M)},onDeleteSession:fK,userInfo:on,version:Eo,onLogout:QG}),(()=>{const M=o.jsxs("div",{className:`composer-slot${p?" sandbox-composer-wrap":""}`,children:[p&&o.jsx(vOe,{agentName:p.toolName==="codex"?"Codex":p.toolName==="openclaw"?"OpenClaw":"Hermes",onExit:yl}),p?o.jsx(tMe,{appName:n,value:Ut,onChange:Pt,onSubmit:U=>void cK(U),disabled:!1,busy:y||Zn.commandBusy,attachments:zt,onAddFiles:oK,onRemoveAttachment:lK,actions:{onOpenTerminal:()=>void WE("terminal"),onOpenBrowser:()=>void WE("browser"),onOpenPermissions:()=>{_(""),k(!0)},onOpenWorkspace:()=>{_(""),j(!0)},workspaceLocked:p.workspaceLocked,settingsBusy:E,uploadBusy:ee||y},models:Zn.models,modelsLoading:Zn.modelsLoading,modelsLoaded:Zn.modelsLoaded,currentModel:p.model,onRequestModels:()=>void Zn.loadModels(),skills:Zn.skills,skillsLoading:Zn.skillsLoading,skillsLoaded:Zn.skillsLoaded,selectedSkills:Zn.selectedSkills,onRequestSkills:()=>void Zn.loadSkills(),onSelectedSkillsChange:Zn.setSelectedSkills}):o.jsx(Uke,{sessionId:a,sessionInitializing:u,appName:n,agentName:n?PC(n):"Agent",value:Ut,onChange:Pt,onSubmit:()=>{if(!p&&at==="skill-create"){const xe=Ut.trim();if(!xe||Ht)return;const ke={id:`pending-${Date.now()}`,prompt:xe,status:"provisioning",candidates:CA.map((nt,Xe)=>({id:`pending-${Xe}`,model:nt,modelLabel:nt,status:"queued",stage:"provisioning",files:[],activities:[{id:"provisioning",kind:"status",text:"正在拉起 Sandbox",status:"running"}]}))};sn(!0);const ze=++kn.current;je(""),un(ke),Pt(""),eRe(xe,nt=>{kn.current===ze&&un(nt)}).then(nt=>{kn.current===ze&&un(nt)}).catch(nt=>{kn.current===ze&&(un(null),Pt(xe),je(nt instanceof Error?nt.message:String(nt)))}).finally(()=>{kn.current===ze&&sn(!1)});return}const U=Ut;if(Pt(""),p){CC(U);return}const Y=zt,re=An;ot([]),mn(Sa()),jC(U,Y,re),b_(Y)},disabled:p?!1:!ge||at==="temporary"||at==="agent"&&!n,busy:p?y:at==="skill-create"?Ht:So,showMeta:xt.length>0&&!p,attachments:p?[]:zt,skills:p?[]:a0,agents:p?[]:o0,invocation:p?Sa():An,capabilitiesLoading:!p&&vn,allowAttachments:!p,onInvocationChange:mn,onAddFiles:yK,onRemoveAttachment:ME,newChatMode:p?"agent":at,newChatTask:p?null:He,newChatLayout:!p&&xt.length===0&&Vn===null,showAgentPicker:!p&&xt.length===0&&Vn===null&&at==="agent",agentPickerDisabled:!ge||So,selectedRuntimeId:qi==null?void 0:qi.runtimeId,runtimeScope:St.capabilities.runtimeScope,onSelectRuntime:async U=>{var Y;await UC({id:U.runtimeId,name:U.name,description:((Y=U.description)==null?void 0:Y.trim())||"暂无描述",createdAt:U.createdAt??"",specificationLabel:"地域",specification:Nf(U.region,Dt),isMine:U.isMine,runtime:{runtimeId:U.runtimeId,region:U.region,currentVersion:U.currentVersion,canDelete:U.canDelete}},{rethrow:!0,source:"new_chat_picker"})},onSelectSandboxSession:U=>YE(U,"new_chat_picker"),showModeSelector:!1,temporaryEnabled:ht&&ye.temporaryEnabled,skillCreateEnabled:ht&&ye.skillCreateEnabled,harnessEnabled:ht&&ye.harnessEnabled,builtinTools:ht?ye.builtinTools:[],onModeChange:U=>{if(!(U==="temporary"&&!ye.temporaryEnabled||U==="skill-create"&&!ye.skillCreateEnabled)){if(U==="temporary"){_t(null),ft(U),AC();return}if(ft(U),U!=="agent"&&_t(null),je(""),U==="skill-create"){mn(Sa());const Y=a&&xn.length===0&&zt.length>0?a:"";Nh(zt),ot([]),Y&&(et.current="",l(""),Gu(Y))}}},onTaskChange:_t})]});return o.jsx("section",{className:"main-shell",children:o.jsxs("main",{className:`main${p?" is-sandbox-session":""}`,children:[Et&&o.jsx("div",{className:"error",role:"alert",children:Et}),Ln&&o.jsx("div",{className:"error",role:"alert",children:Ln}),CE&&o.jsxs("div",{className:"session-loading",children:[o.jsx(yn,{className:"icon spin"})," 加载会话…"]}),mC&&!LC&&!OC&&!MC&&!PE&&!Ku&&xl===null&&o.jsx("div",{className:"case-return-bar",children:o.jsxs("button",{type:"button",onClick:pK,children:[o.jsx(Vk,{"aria-hidden":!0}),o.jsx("span",{children:"返回评测案例"})]})}),vt!==null?o.jsx(gMe,{initialModule:AMe(vt),onSubmit:_K}):_c==="coding-agents"?o.jsx(WTe,{onBack:()=>qr("catalog")}):_c==="feishu"?o.jsx(jTe,{onBack:()=>qr("catalog")}):_c&&_c!=="catalog"?o.jsx(eTe,{automation:_c,onBack:()=>qr("catalog")}):_c==="catalog"?o.jsx(WNe,{onOpen:qr}):Fe?o.jsx(qOe,{workspace:Fe,onBack:XE}):Je?o.jsx(HOe,{session:Je,onBack:XE,onOpen:()=>YE(Je,"sandbox_detail"),onDelete:()=>nK(Je)}):gl?o.jsx(_Ne,{cloudProvider:Dt,canCreate:Yr,runtimeScope:St.capabilities.runtimeScope,onCreateAgent:NK,onUseAgent:U=>UC(U,{source:"my_agents"}),onViewAgentDetails:kK,onCreateSandboxAgent:AK,onUseSandboxAgent:U=>YE(U,"my_agents"),onViewSandboxAgentDetails:tK,sandboxRefreshKey:me,connectedRuntimeId:Lh,hiddenRuntimeIds:FG,drafts:bt,deploymentTasks:c0,draftDeploymentTaskIds:LE,onViewDeploymentTask:VE,onEditDraft:U=>{Es(!1),fe(U.draft),tt("custom"),Kr(U.id),Sr.current=U,ya(U.deploymentTarget??null),Ki(""),Mi(""),Bt("custom"),je("")},onDeleteDraft:U=>_C([U])}):LC?o.jsx(fSe,{agents:El?[El]:vK,drafts:bt,agentOrder:pC,selectedAgentId:n,agentInfo:At,agentInfoAgentId:n,loadingAgentInfo:vn,canCreate:Yr,canUpdate:Yr||RC,loadingAgents:PG,agentsError:BG,deploymentTasks:c0,focusedDeploymentTaskId:vC,focusedAgentId:(El==null?void 0:El.id)??wC,focusedAgentSection:RG,focusedCaseKind:OG,feedbackCasePreview:LG,detailOnly:!0,onRetryAgents:()=>void HE(),onAgentOrderChange:zG,onDeleteAgents:VG,onDeleteDrafts:_C,onSelectAgent:SK,onTalkAgent:IK,onOpenFeedbackCase:U=>void hK(U),onFeedbackCasesDeleted:mK,onCreateAgent:()=>{if(!Yr){je("当前账号没有添加 Agent 的权限。");return}_n(!1),H(!0),Bt(null),fe(null),ya(null),b0(Ti(Dt)),Kr(""),Sr.current=null,Ki(""),Mi(""),je("")},onUpdateAgent:(U,Y)=>{var ze,nt;if(!RC&&!Yr){je("当前账号没有管理 Agent 的权限。");return}if(!Y.canUpdate){je(Y.reason||"当前 Runtime 不支持原地更新。");return}if(!Y.runtime.runtimeId){je("仅支持更新已部署的云端智能体。");return}if(!Y.runtime.region){je("Runtime 缺少地域信息,无法更新。");return}if(!((ze=Y.agent)!=null&&ze.appName)){je("Runtime 缺少智能体名称,无法更新。");return}const re=Object.fromEntries(Y.runtime.envs.map(({key:Xe,value:ct})=>[Xe,ct])),xe={...U,deployment:{...U.deployment??{feishuEnabled:!1},network:Y.runtime.network,envValues:{...re,...((nt=U.deployment)==null?void 0:nt.envValues)??{}}}};_n(!1),fe(xe),tt("custom");const ke=`runtime-${Y.runtime.runtimeId}`;Kr(ke),Sr.current=bt.find(Xe=>Xe.id===ke)??null,Ki(""),Mi(""),ya({runtimeId:Y.runtime.runtimeId,name:Y.runtime.name||Y.agent.name||U.name,region:Y.runtime.region,appName:Y.agent.appName,currentVersion:Y.runtime.currentVersion}),Bt("custom"),je("")},onEditDraft:U=>{_n(!1),fe(U.draft),tt("custom"),Kr(U.id),Sr.current=U,ya(U.deploymentTarget??null),Ki(""),Mi(""),Bt("custom"),je("")}},(El==null?void 0:El.id)??"workspace"):OC?o.jsx(WH,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:DMe,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{H(!1),fe(null),Bt("menu")}},{key:"package",icon:PMe,title:"从代码包添加和部署",desc:"上传 Agent 项目压缩包,查看代码并直接部署到 AgentKit Runtime。",onClick:()=>{H(!1),fe(null),Bt("package")}},{key:"migration",icon:BMe,title:"从存量迁移",desc:"从您的 LangChain / Dify 等存量项目迁移至 AgentKit Runtime",status:"敬请期待",disabled:!0,onClick:()=>{}}]}):PE?o.jsx(Nne,{userId:ge,appId:n,agentInfo:At,capabilitiesLoading:vn,agentLabel:PC,onOpenSession:ZG}):MC?o.jsx(z_e,{onAdded:U=>{jh(Ia()),As(!1),s(U)},onCancel:()=>As(!1)}):Ku?o.jsx(F_e,{cloudProvider:Dt}):xl!==null&&!DE?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:12,height:"100%",padding:24,textAlign:"center",color:"var(--text-secondary, #6b7280)"},children:[o.jsxs("div",{style:{fontSize:18,fontWeight:600},children:["需要配置",Dt==="byteplus"?"BytePlus":"火山引擎"," AK/SK"]}),o.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要",Dt==="byteplus"?" BytePlus ":" Volcengine ","凭据才能使用。请在运行环境中设置"," ",o.jsx("code",{children:Dt==="byteplus"?"BYTEPLUS_ACCESS_KEY":"VOLCENGINE_ACCESS_KEY"})," ","与"," ",o.jsx("code",{children:Dt==="byteplus"?"BYTEPLUS_SECRET_KEY":"VOLCENGINE_SECRET_KEY"})," ","后重试。"]})]}):xl==="menu"?o.jsx(lAe,{onSelect:U=>{fe(null),ya(null),Ki(""),Mi(""),U==="custom"&&tt("custom"),Kr(U==="custom"?`draft-${Date.now().toString(36)}`:""),Sr.current=null,Bt(U)},onImport:U=>{fe(U),tt("yaml_import"),ya(null),Ki(""),Mi(""),Kr(`draft-${Date.now().toString(36)}`),Sr.current=null,Bt("custom")}}):xl==="intelligent"?o.jsx(UAe,{userId:ge,cloudProvider:Dt,onBack:()=>Bt("menu"),onCreate:x0,onAgentAdded:zE,onDeploymentTaskChange:kh}):xl==="custom"?o.jsx(Tje,{cloudProvider:Dt,initialDraft:le??void 0,onBack:()=>Bt("menu"),onCreate:x0,onAgentAdded:zE,features:Ds,onDeploymentTaskChange:kh,createMode:Ae,deploymentTarget:Yu??void 0,initialDeployRegion:g0,onDraftChange:(U,Y)=>{Ys&&(Y?HG(Ys,U,Yu??void 0):SC(Ys))},onDiscard:Ys?()=>{SC(Ys),Kr(""),Sr.current=null,fe(null),ya(null),Ki(""),Mi(n),Bt(null),H(!1),_n(!0),je("")}:void 0,onDeploymentStarted:NC,onDeploymentComplete:TC},Ys||"custom"):xl==="template"?o.jsx(Cje,{cloudProvider:Dt,onBack:()=>Bt("menu"),onCreate:x0}):xl==="workflow"?o.jsx(Pje,{cloudProvider:Dt,onBack:()=>Bt("menu"),onCreate:x0}):xl==="package"?o.jsx(Hje,{cloudProvider:Dt,onBack:()=>{Bt(null),H(!0)},onAgentAdded:zE,onDeploymentTaskChange:kh,onDeploymentStarted:NC,onDeploymentComplete:TC,initialDeployRegion:g0}):xt.length===0&&Vn?o.jsx(mRe,{initialJob:Vn}):xt.length===0&&!ht?o.jsxs("div",{className:"session-loading",children:[o.jsx(yn,{className:"icon spin"})," 正在检查 Agent 能力…"]}):xt.length===0?o.jsxs("div",{className:"welcome",children:[o.jsxs("div",{className:"welcome-primary",children:[o.jsxs("div",{className:"welcome-heading",children:[o.jsx(mOe,{canUpdate:St.role==="admin"}),o.jsx("h1",{className:"welcome-title",children:p?"让灵感自由生长":at==="skill-create"?"想创建一个什么 Skill?":nr})]}),M]}),o.jsx(sOe,{})]},`welcome-${ye.agentId??n}`):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`transcript${i0?" is-streaming":""}`,ref:Rh,onScroll:GG,onWheel:KG,onTouchMove:qG,children:xt.map((U,Y)=>{var Ws,qe,Nt,mt,Tt,Jn,Cs;const re=Y===xt.length-1;if(U.role==="system")return U.activity?o.jsx("div",{className:"turn turn--system",children:o.jsx(wOe,{activity:U.activity,time:uT((Ws=U.meta)==null?void 0:Ws.ts)})},U.activity.id):null;if(U.role==="user"){const kt=U.blocks.map(ar=>ar.kind==="text"?ar.text:"").join(""),Xs=U.blocks.flatMap(ar=>ar.kind==="attachment"?ar.files:[]),xa=U.blocks.find(ar=>ar.kind==="invocation");return o.jsxs(is.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(xa==null?void 0:xa.kind)==="invocation"&&o.jsx(aE,{value:xa.value}),Xs.length>0&&o.jsx(oE,{appName:n,items:Xs}),kt&&o.jsx("div",{className:"bubble",children:o.jsx(ph,{text:kt})}),o.jsxs("div",{className:"turn-actions turn-actions--right",children:[((qe=U.meta)==null?void 0:qe.ts)&&o.jsx("span",{className:"meta-text",children:uT(U.meta.ts)}),o.jsx(KD,{text:kt})]})]},Y)}const xe=((Nt=U.meta)==null?void 0:Nt.author)??"",ke=xe&&Vi?cT(Vi,xe):void 0,ze=!!(xe&&r0.length>0&&!r0.includes(xe)),nt=(ke==null?void 0:ke.name)||xe,Xe=(ke==null?void 0:ke.description)||(ze?"正在执行主 Agent 移交的任务。":"");if(U.blocks.length>0&&U.blocks.every(kt=>kt.kind==="agent-transfer"))return null;const ct=U.blocks.length===0,Ze=((Tt=(mt=U.meta)==null?void 0:mt.feedback)==null?void 0:Tt.rating)??null,Ke=((Jn=U.meta)==null?void 0:Jn.eventId)??"",tn=pi.has(Ke),ln=!!(qi&&Ke&&$c(U)),rt=ln?GD(xt,Y):"";return o.jsxs(is.div,{ref:kt=>{Ke&&(kt?GE.current.set(Ke,kt):GE.current.delete(Ke))},className:["turn turn--assistant",ze?"turn--subagent":"",Ih&&Ih===Ke?"is-feedback-target":""].filter(Boolean).join(" "),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[ze&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"subagent-run-label",children:[o.jsxs("span",{className:"subagent-run-handoff",children:[o.jsx(jee,{}),o.jsx("span",{children:"智能体移交"})]}),o.jsx("span",{className:"subagent-run-title",children:nt})]}),o.jsx("p",{className:"subagent-run-description",title:Xe,children:Xe})]}),ct?re&&Wa?o.jsx(qH,{}):null:o.jsxs(o.Fragment,{children:[o.jsx(kA,{appName:n,blocks:U.blocks,streaming:re&&(Wa||_o),onStreamFrame:re?YG:void 0,onAction:xK,onAuth:EK,onArtifactDownload:(kt,Xs)=>p8(n,ge,a,kt,Xs),onArtifactPreview:(kt,Xs)=>g8(n,ge,a,kt,Xs)}),!(re&&Wa)&&!HMe(U)&&o.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(re&&Wa)&&!zMe(U)&&o.jsxs("div",{className:"turn-meta",children:[p&&((Cs=U.meta)!=null&&Cs.sandboxUsage)?o.jsx(SOe,{usage:U.meta.sandboxUsage}):null,o.jsxs("div",{className:"turn-actions",children:[ln&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:`icon-btn feedback-btn${Ze==="good"?" feedback-btn--good":""}`,"aria-label":"赞","aria-pressed":Ze==="good","aria-busy":tn,title:Ze==="good"?"取消点赞":"赞",disabled:tn,onClick:()=>void BC(U,Ze==="good"?null:"good",rt),children:o.jsx(kne,{className:"icon",filled:Ze==="good"})}),o.jsx("button",{type:"button",className:`icon-btn feedback-btn${Ze==="bad"?" feedback-btn--bad":""}`,"aria-label":"踩","aria-pressed":Ze==="bad","aria-busy":tn,title:Ze==="bad"?"取消点踩":"踩",disabled:tn,onClick:()=>void BC(U,Ze==="bad"?null:"bad",rt),children:o.jsx(Ane,{className:"icon",filled:Ze==="bad"})})]}),!p&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"icon-btn","aria-label":"问题反馈",title:"问题反馈",onClick:()=>Jt({turn:U,input:GD(xt,Y)}),children:o.jsx(q8,{className:"icon"})}),o.jsx("button",{type:"button",className:"icon-btn",title:"Tracing 火焰图",onClick:()=>{var kt;wc((kt=U.meta)!=null&&kt.ts?U.meta.ts*1e3:Date.now()),qa(!0)},children:o.jsx(UMe,{})})]}),o.jsx(KD,{text:$c(U)})]}),U.meta&&o.jsx("span",{className:"meta-text",children:FMe(U.meta)})]})]})]},Y)})}),!p&&o.jsx(rhe,{appName:n,info:At,loading:vn,activeAgent:jE,seenAgents:RE,execPath:OE,capabilities:ls,capabilityLoading:Ss,capabilityMutating:Ks,builtinTools:hi,onAddCapability:gK,onRemoveCapability:U=>void bK(U)}),o.jsx("div",{className:"conversation-composer-slot",children:M})]})]})})})(),Xn&&a&&o.jsx(dMe,{onClose:()=>Jt(null),onSubmit:wK}),mi&&a&&o.jsx(nG,{appName:n,sessionId:a,endTimeMs:ba,onClose:()=>qa(!1)}),o.jsx(EOe,{open:X,state:ce,agentKind:we,error:be,onCancel:JG,onConfirm:M=>void eK(M)}),p?o.jsxs(o.Fragment,{children:[o.jsx(OOe,{open:R!==null,kind:R??"terminal",launch:z,loading:F,error:I,onReload:()=>{R&&WE(R)},onClose:()=>{B(null),L(null),C(!1),D("")}}),o.jsx(BOe,{open:T,value:p.permissions,busy:E||y,error:S,onSave:M=>void sK(M),onClose:()=>{E||(k(!1),_(""))}}),o.jsx(UOe,{open:A,cwd:p.cwd,locked:p.workspaceLocked,busy:E,error:S,browse:iK,onSave:M=>void rK(M),onClose:()=>{E||(j(!1),_(""))}}),o.jsx(MOe,{open:Zn.threadsOpen,threads:Zn.threads,currentThreadId:p.threadId,loading:Zn.threadsLoading,error:Zn.threadsError,onSelect:M=>void Zn.resumeThread(M),onClose:Zn.closeThreads}),o.jsx(FOe,{approval:$,busy:te,error:P,onDecision:M=>void aK(M)})]}):null,o.jsx(oMe,{open:Qt,checking:Ts,error:ks,onLogin:()=>void WG()}),$G&&o.jsx("div",{className:"confirm-scrim",onClick:()=>FE(!1),children:o.jsxs("div",{className:"confirm-box",onClick:M=>M.stopPropagation(),children:[o.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),o.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),o.jsxs("div",{className:"confirm-actions",children:[o.jsx("button",{className:"confirm-btn",onClick:()=>FE(!1),children:"取消"}),o.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{fe(null),Bt("menu"),FE(!1)},children:"确定返回"})]})]})})]})}const ZD="veadk.preloadRecoveryAt";window.addEventListener("vite:preloadError",e=>{const t=Date.now();let n=0;try{n=Number(sessionStorage.getItem(ZD)||"0")}catch{}if(!(t-n<1e4)){e.preventDefault();try{sessionStorage.setItem(ZD,String(t))}catch{}window.location.reload()}});(()=>{if(!(window.opener&&window.opener!==window&&/[?&](code|state|error)=/.test(window.location.search)))return!1;try{window.opener.postMessage({veadkOAuth:!0,url:window.location.href},window.location.origin)}catch{}return window.close(),!0})()||IW.createRoot(document.getElementById("root")).render(o.jsx(Lt.StrictMode,{children:o.jsx($W,{reducedMotion:"user",children:o.jsx(Eee,{maskOpacity:.9,children:o.jsx(JMe,{})})})}));export{XA as $,uye as A,dye as B,SF as C,o as D,pt as E,Fn as F,Kt as G,sLe as H,DV as I,kbe as J,wi as K,g as L,Wx as M,Ur as N,iLe as O,xV as P,Zp as Q,Lt as R,wu as S,pIe as T,SV as U,$i as V,br as W,Uu as X,xE as Y,_V as Z,Su as _,pa as a,hF as a0,LV as b,xIe as c,xL as d,Pf as e,er as f,rLe as g,oV as h,vc as i,vE as j,Vf as k,HAe as l,fLe as m,q2 as n,fge as o,XAe as p,qm as q,nn as r,Cbe as s,Dbe as t,pge as u,Gf as v,Dye as w,bbe as x,ybe as y,Vye as z}; diff --git a/veadk/webui/index.html b/veadk/webui/index.html index d695809bd..b58a441e4 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,8 +5,8 @@ AgentKit Studio - - + +