diff --git a/frontend/src/create/CustomCreate.tsx b/frontend/src/create/CustomCreate.tsx index c58c8c10..b3aaef8d 100644 --- a/frontend/src/create/CustomCreate.tsx +++ b/frontend/src/create/CustomCreate.tsx @@ -41,6 +41,8 @@ import { emptyDraft, } from "./types"; import { + A2A_REGISTRY_DEFAULTS, + A2A_REGISTRY_ENV, BUILTIN_TOOLS, STM_BACKENDS, LTM_BACKENDS, @@ -112,6 +114,7 @@ type StepId = | "skills" | "knowledge" | "advanced" + | "a2aCenter" | "subagents" | "review"; @@ -131,6 +134,7 @@ const STEPS: StepMeta[] = [ { id: "skills", label: "技能", hint: "声明式技能", icon: Sparkles }, { id: "knowledge", label: "知识库", hint: "外部知识检索", icon: Database }, { id: "advanced", label: "进阶配置", hint: "记忆与观测", icon: Layers }, + { id: "a2aCenter", label: "A2A 中心", hint: "远程 Agent 发现", icon: Globe }, { id: "subagents", label: "子 Agent", hint: "嵌套协作", icon: Boxes }, { id: "review", label: "完成", hint: "预览并创建", icon: Rocket }, ]; @@ -207,6 +211,38 @@ function DebugRunIcon({ className }: { className?: string }) { } const AGENT_TYPE_GAP_PX = 4; + +const A2A_REGISTRY_ENV_TO_FIELD = { + REGISTRY_SPACE_ID: "registrySpaceId", + REGISTRY_TOP_K: "registryTopK", + REGISTRY_REGION: "registryRegion", + REGISTRY_ENDPOINT: "registryEndpoint", +} as const; + +type A2aRegistryEnvKey = keyof typeof A2A_REGISTRY_ENV_TO_FIELD; + +function a2aRegistryEnvValues( + registry: AgentDraft["a2aRegistry"] | undefined, + options: { includeDefaults: boolean }, +): Record { + if (!registry?.enabled) return {}; + const values: Record = { + REGISTRY_SPACE_ID: registry.registrySpaceId ?? "", + }; + if (options.includeDefaults) { + values.REGISTRY_TOP_K = + registry.registryTopK?.trim() || A2A_REGISTRY_DEFAULTS.topK; + values.REGISTRY_REGION = + registry.registryRegion?.trim() || A2A_REGISTRY_DEFAULTS.region; + values.REGISTRY_ENDPOINT = + registry.registryEndpoint?.trim() || A2A_REGISTRY_DEFAULTS.endpoint; + } else { + values.REGISTRY_TOP_K = registry.registryTopK ?? ""; + values.REGISTRY_REGION = registry.registryRegion ?? ""; + values.REGISTRY_ENDPOINT = registry.registryEndpoint ?? ""; + } + return values; +} /* ---------------------------------------------------------------- * * Multi-select checklist. Each row = label + desc, toggling the id in * `selected`. Used for built-in tools and tracing exporters. @@ -845,6 +881,9 @@ function nodeProblem( return (n.a2aUrl ?? "").trim().length === 0 ? "缺少 Agent URL" : null; if (isOrchestratorType(n.agentType)) return n.subAgents.length === 0 ? "缺少子 Agent" : null; + if (n.a2aRegistry?.enabled && !n.a2aRegistry.registrySpaceId.trim()) { + return "A2A 中心缺少空间 ID"; + } return n.instruction.trim().length === 0 ? "缺少系统提示词" : null; } @@ -879,11 +918,19 @@ function countDraftAgents(root: AgentDraft): number { /** Collect only settings used by active components across the Agent tree. */ function collectDeploymentEnv(root: AgentDraft): RuntimeEnvConfiguration { const selections: RuntimeEnvSelection[] = []; + const fixedValues: Record = {}; const visit = (node: AgentDraft) => { for (const toolId of node.builtinTools ?? []) { const tool = BUILTIN_TOOLS.find((item) => item.id === toolId); if (tool) selections.push({ env: tool.env }); } + if (node.a2aRegistry?.enabled) { + selections.push({ env: A2A_REGISTRY_ENV }); + Object.assign( + fixedValues, + a2aRegistryEnvValues(node.a2aRegistry, { includeDefaults: true }), + ); + } if (node.memory.shortTerm) { selections.push({ env: @@ -922,7 +969,11 @@ function collectDeploymentEnv(root: AgentDraft): RuntimeEnvConfiguration { node.subAgents.forEach(visit); }; visit(root); - return runtimeEnvConfiguration(selections); + const config = runtimeEnvConfiguration(selections); + return { + specs: config.specs, + fixedValues: { ...config.fixedValues, ...fixedValues }, + }; } /* ---------------------------------------------------------------- * @@ -1531,6 +1582,29 @@ export function CustomCreate({ }, })); + const patchA2aRegistry = ( + updates: Partial>, + ) => + patch({ + a2aRegistry: { + ...(node.a2aRegistry ?? { + enabled: false, + registrySpaceId: "", + registryTopK: "", + registryRegion: "", + registryEndpoint: "", + }), + ...updates, + }, + }); + + const patchA2aRegistryEnv = (key: string, value: string) => { + if (!(key in A2A_REGISTRY_ENV_TO_FIELD)) return; + const field = A2A_REGISTRY_ENV_TO_FIELD[key as A2aRegistryEnvKey]; + patchA2aRegistry({ [field]: value }); + patchDeploymentEnv(key, value); + }; + // Replace the whole tree (structural edits from the left tree), optionally // moving the selection to a new node. const applyTree = (nextRoot: AgentDraft, select?: NodePath) => { @@ -1586,6 +1660,8 @@ export function CustomCreate({ const descriptionMissing = node.description.trim().length === 0; const instructionMissing = node.instruction.trim().length === 0; const urlMissing = (node.a2aUrl ?? "").trim().length === 0; + const a2aRegistrySpaceMissing = + !!node.a2aRegistry?.enabled && !node.a2aRegistry.registrySpaceId.trim(); const invalidClass = (missing: boolean) => showErrors && missing ? `is-error cw-error-shake-${validationPulse % 2}` @@ -1629,6 +1705,7 @@ export function CustomCreate({ node.memory.shortTerm || node.memory.longTerm || node.tracing, + a2aCenter: !!node.a2aRegistry?.enabled, subagents: (node.subAgents?.length ?? 0) > 0, review: canFinish, }), @@ -1638,7 +1715,7 @@ export function CustomCreate({ // The nav only lists the sections actually rendered for THIS node's type — // orchestrators / A2A leaves have far fewer than an LLM (type lives in the // top bar; sub-agents live in the left tree; both are excluded here). - const rootOnlyStepIds: StepId[] = isRootAgent ? ["advanced"] : []; + const rootOnlyStepIds: StepId[] = isRootAgent ? ["advanced", "a2aCenter"] : []; const navStepIds: StepId[] = orchestrator || a2a ? ["basic"] @@ -2466,6 +2543,37 @@ export function CustomCreate({ )} + )} + {isRootAgent && ( +
+
+ + patchA2aRegistry({ enabled }) + } + title="A2A 中心" + desc="升级该 Agent 为 SupperAgent,支持发现并调用 A2A 注册中心子 Agent" + icon={Globe} + /> + {node.a2aRegistry?.enabled && ( +
+ + {showErrors && a2aRegistrySpaceMissing && ( + + A2A 注册中心空间 ID 为必填项 + + )} +
+ )} +
+
)} )} diff --git a/frontend/src/create/configYaml.ts b/frontend/src/create/configYaml.ts index 7c3ee3a4..a7af3cf2 100644 --- a/frontend/src/create/configYaml.ts +++ b/frontend/src/create/configYaml.ts @@ -3,6 +3,7 @@ // can be imported back into the custom-mode wizard. import { parse, stringify } from "yaml"; +import { A2A_REGISTRY_DEFAULTS } from "./veadkCatalog"; import { normalizeDraft } from "./normalizeDraft"; import type { AgentDraft } from "./types"; @@ -28,6 +29,19 @@ function toConfig(draft: AgentDraft): Record { if (m.args?.length) e.args = m.args; return e; }); + if (draft.a2aRegistry?.enabled) { + const registry: Record = { enabled: true }; + if (draft.a2aRegistry.registrySpaceId?.trim()) + registry.registrySpaceId = draft.a2aRegistry.registrySpaceId.trim(); + registry.registryTopK = + draft.a2aRegistry.registryTopK?.trim() || A2A_REGISTRY_DEFAULTS.topK; + registry.registryRegion = + draft.a2aRegistry.registryRegion?.trim() || A2A_REGISTRY_DEFAULTS.region; + registry.registryEndpoint = + draft.a2aRegistry.registryEndpoint?.trim() || + A2A_REGISTRY_DEFAULTS.endpoint; + o.a2aRegistry = registry; + } if (draft.memory?.shortTerm || draft.memory?.longTerm) { o.memory = { shortTerm: !!draft.memory.shortTerm, longTerm: !!draft.memory.longTerm }; if (draft.memory.shortTerm) o.shortTermBackend = draft.shortTermBackend || "local"; @@ -69,6 +83,7 @@ function toConfig(draft: AgentDraft): Record { const s: Record = { name: sa.name, description: sa.description, instruction: sa.instruction }; if (sa.builtinTools?.length) s.builtinTools = [...sa.builtinTools]; if (sa.customTools?.length) s.customTools = sa.customTools.map((t) => ({ name: t.name, description: t.description })); + if (sa.a2aRegistry?.enabled) s.a2aRegistry = toConfig(sa).a2aRegistry; return s; }); return o; diff --git a/frontend/src/create/normalizeDraft.ts b/frontend/src/create/normalizeDraft.ts index 90f9b184..0a0a70cd 100644 --- a/frontend/src/create/normalizeDraft.ts +++ b/frontend/src/create/normalizeDraft.ts @@ -1,4 +1,10 @@ -import { emptyDraft, type AgentDraft, type CustomTool, type SelectedSkill } from "./types"; +import { + emptyDraft, + type A2aRegistryConfig, + type AgentDraft, + type CustomTool, + type SelectedSkill, +} from "./types"; const STM_IDS = new Set(["local", "sqlite", "mysql", "postgresql"]); const LTM_IDS = new Set(["local", "opensearch", "redis", "viking", "mem0"]); @@ -57,6 +63,17 @@ function asMaxIterations(v: unknown): number { return typeof v === "number" && Number.isFinite(v) && v > 0 ? Math.floor(v) : 3; } +function asA2aRegistry(v: unknown): A2aRegistryConfig { + const o = (v && typeof v === "object" ? v : {}) as Record; + return { + enabled: asBool(o.enabled), + registrySpaceId: asString(o.registrySpaceId), + registryTopK: asString(o.registryTopK), + registryRegion: asString(o.registryRegion), + registryEndpoint: asString(o.registryEndpoint), + }; +} + function parseSubAgents(v: unknown): AgentDraft[] { if (!Array.isArray(v)) return []; return v.map((s) => { @@ -71,6 +88,7 @@ function parseSubAgents(v: unknown): AgentDraft[] { a2aUrl: asString(so.a2aUrl), builtinTools: asStringArray(so.builtinTools).filter((t) => TOOL_IDS.has(t)), customTools: asCustomTools(so.customTools), + a2aRegistry: asA2aRegistry(so.a2aRegistry), subAgents: parseSubAgents(so.subAgents), }; }); @@ -178,6 +196,7 @@ export function normalizeDraft(raw: unknown): AgentDraft { builtinTools: asStringArray(o.builtinTools).filter((t) => TOOL_IDS.has(t)), customTools: asCustomTools(o.customTools), mcpTools, + a2aRegistry: asA2aRegistry(o.a2aRegistry), memory: { shortTerm: asBool(mem.shortTerm), longTerm: asBool(mem.longTerm) }, shortTermBackend: pick(o.shortTermBackend, STM_IDS, "local"), longTermBackend: pick(o.longTermBackend, LTM_IDS, "local"), diff --git a/frontend/src/create/types.ts b/frontend/src/create/types.ts index 518158fc..cf6a4b6a 100644 --- a/frontend/src/create/types.ts +++ b/frontend/src/create/types.ts @@ -46,6 +46,18 @@ export interface NetworkConfig { enableSharedInternetAccess?: boolean; } +export interface A2aRegistryConfig { + enabled: boolean; + /** REGISTRY_SPACE_ID. */ + registrySpaceId: string; + /** REGISTRY_TOP_K. Empty means the UI supplies the explicit default. */ + registryTopK?: string; + /** REGISTRY_REGION. Empty means the UI supplies the explicit default. */ + registryRegion?: string; + /** REGISTRY_ENDPOINT. Empty means the UI supplies the explicit default. */ + registryEndpoint?: string; +} + export interface DeploymentConfig { feishuEnabled: boolean; network?: NetworkConfig; @@ -94,6 +106,8 @@ export interface AgentDraft { customTools?: CustomTool[]; /** MCP tool servers — the backend generator emits an MCPToolset per entry. */ mcpTools?: McpTool[]; + /** AgentKit A2A registry center tools. */ + a2aRegistry?: A2aRegistryConfig; /** Chosen backends when memory is enabled. */ shortTermBackend?: string; longTermBackend?: string; @@ -146,6 +160,13 @@ export function emptyDraft(): AgentDraft { builtinTools: [], customTools: [], mcpTools: [], + a2aRegistry: { + enabled: false, + registrySpaceId: "", + registryTopK: "", + registryRegion: "", + registryEndpoint: "", + }, modelName: DEFAULT_MODEL_NAME, modelProvider: "", modelApiBase: "", diff --git a/frontend/src/create/veadkCatalog.ts b/frontend/src/create/veadkCatalog.ts index 9c1e3e00..275685e5 100644 --- a/frontend/src/create/veadkCatalog.ts +++ b/frontend/src/create/veadkCatalog.ts @@ -82,6 +82,40 @@ export const FEISHU_ENV: EnvVar[] = [ }, ]; +export const A2A_REGISTRY_DEFAULTS = { + topK: "3", + region: "cn-beijing", + endpoint: "https://open.volcengineapi.com/", +} as const; + +/** AgentKit A2A registry center runtime configuration. */ +export const A2A_REGISTRY_ENV: EnvVar[] = [ + { + key: "REGISTRY_SPACE_ID", + required: true, + placeholder: "请输入 A2A 空间 ID", + comment: "A2A 注册中心空间 ID", + }, + { + key: "REGISTRY_TOP_K", + required: false, + placeholder: A2A_REGISTRY_DEFAULTS.topK, + comment: "召回 Agent 数量", + }, + { + key: "REGISTRY_REGION", + required: false, + placeholder: A2A_REGISTRY_DEFAULTS.region, + comment: "A2A 注册中心地域", + }, + { + key: "REGISTRY_ENDPOINT", + required: false, + placeholder: A2A_REGISTRY_DEFAULTS.endpoint, + comment: "A2A 注册中心 OpenAPI 地址", + }, +]; + /* ------------------------------------------------------------------ * * Built-in tools (curated to ones that load without npx/uvx/AgentKit). * ------------------------------------------------------------------ */ diff --git a/frontend/tests/deploymentEnv.test.mjs b/frontend/tests/deploymentEnv.test.mjs index 81ef2a21..3c2f7ab7 100644 --- a/frontend/tests/deploymentEnv.test.mjs +++ b/frontend/tests/deploymentEnv.test.mjs @@ -19,6 +19,8 @@ const { runtimeEnvVars, } = await loadTypeScriptModule("../src/create/deploymentEnv.ts"); const { + A2A_REGISTRY_DEFAULTS, + A2A_REGISTRY_ENV, BUILTIN_TOOLS, KB_BACKENDS, LTM_BACKENDS, @@ -202,6 +204,38 @@ test("collects non-automatic built-in tool settings for deployment", () => { assert.match(customCreateSource, /selections\.push\(\{ env: tool\.env \}\)/); }); +test("materializes A2A registry defaults for deployment env", () => { + assert.deepEqual( + runtimeEnvVars(A2A_REGISTRY_ENV, { + REGISTRY_SPACE_ID: "space-test", + REGISTRY_TOP_K: A2A_REGISTRY_DEFAULTS.topK, + REGISTRY_REGION: A2A_REGISTRY_DEFAULTS.region, + REGISTRY_ENDPOINT: A2A_REGISTRY_DEFAULTS.endpoint, + }), + [ + { key: "REGISTRY_SPACE_ID", value: "space-test" }, + { key: "REGISTRY_TOP_K", value: "3" }, + { key: "REGISTRY_REGION", value: "cn-beijing" }, + { + key: "REGISTRY_ENDPOINT", + value: "https://open.volcengineapi.com/", + }, + ], + ); + assert.match( + customCreateSource, + /a2aRegistryEnvValues\(node\.a2aRegistry, \{ includeDefaults: true \}\)/, + ); + assert.match( + customCreateSource, + /fixedValues:\s*\{ \.\.\.config\.fixedValues, \.\.\.fixedValues \}/, + ); + assert.match( + customCreateSource, + /deploymentEnvValues=\{\{[\s\S]*?\.\.\.draft\.deployment\?\.envValues,[\s\S]*?\.\.\.deploymentEnv\.fixedValues,/, + ); +}); + test("keeps deployment configuration primary beside an inspectable Agent topology", () => { assert.match(customCreateSource, /agentDraft=\{draft\}/); assert.match(projectPreviewSource, /className="pp-topology-pane"/); diff --git a/frontend/tests/markdownPromptEditor.test.mjs b/frontend/tests/markdownPromptEditor.test.mjs index a2864cea..91a91b9b 100644 --- a/frontend/tests/markdownPromptEditor.test.mjs +++ b/frontend/tests/markdownPromptEditor.test.mjs @@ -18,12 +18,17 @@ const localPickerSource = readFileSync( new URL("../src/create/LocalPicker.tsx", import.meta.url), "utf8", ); +const configYamlSource = readFileSync( + new URL("../src/create/configYaml.ts", import.meta.url), + "utf8", +); const generatedAgentConfigSources = [ "../src/create/types.ts", "../src/create/normalizeDraft.ts", - "../src/create/configYaml.ts", "../src/create/TemplateCreate.tsx", -].map((path) => readFileSync(new URL(path, import.meta.url), "utf8")).join("\n"); +].map((path) => readFileSync(new URL(path, import.meta.url), "utf8")) + .concat(configYamlSource) + .join("\n"); const displayTextSource = readFileSync( new URL("../src/create/displayText.ts", import.meta.url), "utf8", @@ -301,7 +306,7 @@ test("nested Agent forms omit root-only advanced configuration", () => { assert.match(createSource, /const isRootAgent = safePath\.length === 0;/); assert.match( createSource, - /const rootOnlyStepIds: StepId\[\] = isRootAgent \? \["advanced"\] : \[\];/, + /const rootOnlyStepIds: StepId\[\] = isRootAgent \? \["advanced", "a2aCenter"\] : \[\];/, ); assert.match(createSource, /\.\.\.rootOnlyStepIds/); assert.match( @@ -329,3 +334,22 @@ test("memory and tracing are grouped under advanced configuration", () => { assert.doesNotMatch(createSource, /A2UI|enableA2ui/); assert.doesNotMatch(generatedAgentConfigSources, /A2UI|enableA2ui/); }); + +test("A2A registry YAML export materializes default optional settings", () => { + assert.match( + configYamlSource, + /import \{ A2A_REGISTRY_DEFAULTS \} from "\.\/veadkCatalog";/, + ); + assert.match( + configYamlSource, + /registry\.registryTopK\s*=\s*draft\.a2aRegistry\.registryTopK\?\.trim\(\) \|\| A2A_REGISTRY_DEFAULTS\.topK;/, + ); + assert.match( + configYamlSource, + /registry\.registryRegion\s*=\s*draft\.a2aRegistry\.registryRegion\?\.trim\(\) \|\| A2A_REGISTRY_DEFAULTS\.region;/, + ); + assert.match( + configYamlSource, + /registry\.registryEndpoint\s*=\s*draft\.a2aRegistry\.registryEndpoint\?\.trim\(\) \|\|\s*A2A_REGISTRY_DEFAULTS\.endpoint;/, + ); +}); diff --git a/tests/cli/test_generated_agent_backend_codegen.py b/tests/cli/test_generated_agent_backend_codegen.py index 72ab0f26..51d7cf8b 100644 --- a/tests/cli/test_generated_agent_backend_codegen.py +++ b/tests/cli/test_generated_agent_backend_codegen.py @@ -105,6 +105,16 @@ def test_project_policy_allows_mcp_stdio_but_debug_rejects_it() -> None: validate_debug_policy(draft, allow_local_runtime_resources=True) +def test_security_rejects_enabled_a2a_registry_without_space_id() -> None: + draft = AgentDraft( + name="demo", + instruction="You are helpful.", + a2aRegistry={"enabled": True}, + ) + with pytest.raises(DebugPolicyError, match="A2A registry space id is required"): + validate_project_policy(draft) + + def test_url_policy_rejects_private_literal_ip() -> None: with pytest.raises(DebugPolicyError): validate_url_not_private("http://127.0.0.1:8000", field_name="url") diff --git a/tests/cli/test_generated_agent_backend_codegen_extended.py b/tests/cli/test_generated_agent_backend_codegen_extended.py index a1318198..6653f7e6 100644 --- a/tests/cli/test_generated_agent_backend_codegen_extended.py +++ b/tests/cli/test_generated_agent_backend_codegen_extended.py @@ -831,3 +831,81 @@ def test_studio_deploy_run_script_allows_generated_agent_debug() -> None: assert "studio --auth-mode frontend" in run_script assert '--site-logo "$ROOT_DIR/site-logo.png"' in run_script assert "--allow-remote-generated-agent-test-run" not in run_script + + +def test_agentkit_app_adds_dynamic_a2a_tools_per_run() -> None: + source = Path("veadk/integrations/agentkit/app.py").read_text() + + assert "build_remote_a2a_agent_tools(prompt, registry_config)" in source + assert "def _spawn_dynamic_a2a_agent(" in source + assert "def _configure_dynamic_a2a_routes(" in source + assert "def _run_request_custom_metadata(" in source + assert 'getattr(req, "custom_metadata", None)' in source + assert "req.custom_metadata" not in source + assert '@app.post("/run_sse")' in source + assert '@app.post("/invoke")' in source + assert "types.UserContent" in source + assert '@app.post("/run", response_model=None)' in source + + +def test_frontend_deploy_forwards_a2a_registry_runtime_env_keys() -> None: + source = Path("veadk/cli/cli_frontend.py").read_text() + + assert '"REGISTRY_",' not in source + assert '"A2A_REGISTRY_",' not in source + assert '"REGISTRY_SPACE_ID",' in source + assert '"REGISTRY_ENDPOINT",' in source + assert '"REGISTRY_TOP_K",' in source + assert '"A2A_REGISTRY_ACCESS_KEY",' in source + + +def test_generated_agent_test_runner_enables_dynamic_a2a_helper() -> None: + source = Path("veadk/cli/generated_agent_test_runner.py").read_text() + + assert "get_fast_api_app" in source + assert "_bind_adk_server_services(app)" in source + assert "_veadk_adk_server" in source + assert "dynamic_a2a" in source + assert "helper.enable_dynamic_a2a_tools(app, root_agent)" in source + + +def test_agentkit_dynamic_a2a_tools_use_user_prompt_once(monkeypatch) -> None: + from veadk import Agent + from veadk.a2a.registry_client import AgentKitA2ARegistryConfig + from veadk.integrations.agentkit import app as agentkit_app + from veadk.tools.builtin_tools import a2a_registry + + calls: list[str] = [] + + def fake_build_remote_a2a_agent_tools(prompt, config): + calls.append(prompt) + assert config.space_id == "space-test" + + def remote_a2a_reliability_review(input: str): + return {"input": input} + + return [remote_a2a_reliability_review] + + monkeypatch.setattr( + a2a_registry, + "build_remote_a2a_agent_tools", + fake_build_remote_a2a_agent_tools, + ) + agent = Agent(name="demo", instruction="x", model_api_key="fake") + setattr( + agent, + "_veadk_a2a_registry_config", + AgentKitA2ARegistryConfig(space_id="space-test"), + ) + + cloned = agentkit_app._spawn_dynamic_a2a_agent( + agent, + "你是否拥有 remote_a2a 开头的工具?", + ) + + assert calls == [ + "你是否拥有 remote_a2a 开头的工具?", + ] + assert "remote_a2a_reliability_review" in { + getattr(tool, "__name__", "") for tool in cloned.tools + } diff --git a/tests/cli/test_generated_agent_component_matrix.py b/tests/cli/test_generated_agent_component_matrix.py index 999e5d9e..1b69eca0 100644 --- a/tests/cli/test_generated_agent_component_matrix.py +++ b/tests/cli/test_generated_agent_component_matrix.py @@ -19,6 +19,7 @@ import pytest from veadk.cli.generated_agent_catalog import ( + A2A_REGISTRY_ENV, BUILTIN_TOOLS, KB_BACKENDS, LTM_BACKENDS, @@ -209,6 +210,99 @@ def test_every_tracing_exporter_generates_code_and_env( _assert_python_files_compile(project) +def test_a2a_registry_center_generates_tools_and_env() -> None: + project = generate_project_from_draft( + AgentDraft( + name="a2a-center", + a2aRegistry={ + "enabled": True, + "registrySpaceId": "space-test", + }, + ) + ) + files = _files(project) + app_py = files["app.py"] + agent_py = files["agents/a2a_center/agent.py"] + dynamic_py = files["agents/a2a_center/dynamic_a2a.py"] + + assert "enable_dynamic_a2a_tools(app, root_agent)" in app_py + assert "from veadk.a2a.registry_client import registry_config_from_env" in agent_py + assert "from veadk.tools.builtin_tools.a2a_registry import" in agent_py + assert "a2a_registry_config_agent = registry_config_from_env()" in agent_py + assert "build_a2a_registry_tools" in agent_py + assert "tools=[*a2a_registry_tools_agent]" in agent_py + assert ( + 'setattr(agent, "_veadk_a2a_registry_config", a2a_registry_config_agent)' + in agent_py + ) + assert "build_remote_a2a_agent_tools(prompt, registry_config)" in dynamic_py + assert "def _run_request_custom_metadata(" in dynamic_py + assert 'getattr(req, "custom_metadata", None)' in dynamic_py + assert "req.custom_metadata" not in dynamic_py + assert "_ADK_SERVER_STATE_KEY" in dynamic_py + assert "_DYNAMIC_A2A_ROUTES_ENABLED_STATE_KEY" in dynamic_py + assert "def _has_dynamic_a2a_routes(" in dynamic_py + assert '@app.post("/run_sse")' in dynamic_py + assert '@app.post("/invoke")' in dynamic_py + assert "types.UserContent" in dynamic_py + assert _env_keys(files[".env.example"]) == _catalog_env_keys( + MODEL_ENV, + A2A_REGISTRY_ENV, + ) + assert "REGISTRY_TOP_K=3" in files[".env.example"] + assert "REGISTRY_REGION=cn-beijing" in files[".env.example"] + assert "REGISTRY_ENDPOINT=https://open.volcengineapi.com/" in files[".env.example"] + _assert_python_files_compile(project) + + +def test_a2a_registry_center_env_example_uses_configured_values() -> None: + project = generate_project_from_draft( + AgentDraft( + name="a2a-center-custom", + a2aRegistry={ + "enabled": True, + "registrySpaceId": "space-custom", + "registryTopK": "8", + "registryRegion": "cn-shanghai", + "registryEndpoint": "https://example.com/", + }, + ) + ) + env_example = _files(project)[".env.example"] + + assert "REGISTRY_SPACE_ID=space-custom" in env_example + assert "REGISTRY_TOP_K=8" in env_example + assert "REGISTRY_REGION=cn-shanghai" in env_example + assert "REGISTRY_ENDPOINT=https://example.com/" in env_example + + +def test_nested_a2a_registry_agent_generates_dynamic_helper() -> None: + project = generate_project_from_draft( + AgentDraft( + name="root-sequential", + agentType="sequential", + subAgents=[ + AgentDraft( + name="registry-worker", + a2aRegistry={ + "enabled": True, + "registrySpaceId": "space-test", + }, + ) + ], + ) + ) + files = _files(project) + + assert "agents/root_sequential/dynamic_a2a.py" in files + assert "enable_dynamic_a2a_tools(app, root_agent)" in files["app.py"] + assert ( + "_has_a2a_registry_config(child)" + in files["agents/root_sequential/dynamic_a2a.py"] + ) + _assert_python_files_compile(project) + + def test_deeply_nested_agent_types_generate_complete_component_project() -> None: component_worker = AgentDraft( name="component-worker", diff --git a/veadk/cli/cli_frontend.py b/veadk/cli/cli_frontend.py index ebb9bca4..5bf38608 100644 --- a/veadk/cli/cli_frontend.py +++ b/veadk/cli/cli_frontend.py @@ -843,7 +843,26 @@ def _resolve_ve_credentials() -> tuple[str, str, str | None]: "OPENAI_", "GOOGLE_", ) - _ENV_EXACT: frozenset[str] = frozenset({"CLOUD_PROVIDER"}) + _ENV_EXACT: frozenset[str] = frozenset( + { + "CLOUD_PROVIDER", + "REGISTRY_SPACE_ID", + "REGISTRY_ENDPOINT", + "REGISTRY_VERSION", + "REGISTRY_SERVICE_NAME", + "REGISTRY_REGION", + "REGISTRY_TOP_K", + "REGISTRY_TIMEOUT_MS", + "REGISTRY_POLL_INTERVAL_MS", + "REGISTRY_UPSTREAM_TIP_TOKEN", + "REGISTRY_ID_ENDPOINT", + "A2A_REGISTRY_SPACE_ID", + "A2A_REGISTRY_UPSTREAM_TIP_TOKEN", + "A2A_REGISTRY_ACCESS_KEY", + "A2A_REGISTRY_SECRET_KEY", + "A2A_REGISTRY_SESSION_TOKEN", + } + ) def _collect_runtime_envs() -> dict[str, str]: """Return env vars that should be injected into a deployed runtime.""" @@ -1394,6 +1413,28 @@ def _safe_runner_env() -> dict[str, str]: ) return env + def _a2a_registry_env_from_draft(draft: AgentDraft) -> dict[str, str]: + env: dict[str, str] = {} + + def visit(node: AgentDraft) -> None: + registry = node.a2aRegistry + if registry.enabled: + env.update( + { + "REGISTRY_SPACE_ID": registry.registrySpaceId.strip(), + "REGISTRY_TOP_K": registry.registryTopK.strip() or "3", + "REGISTRY_REGION": registry.registryRegion.strip() + or "cn-beijing", + "REGISTRY_ENDPOINT": registry.registryEndpoint.strip() + or "https://open.volcengineapi.com/", + } + ) + for sub_agent in node.subAgents: + visit(sub_agent) + + visit(draft) + return env + def _read_runner_log_tail(path: PathlibPath, max_chars: int = 6000) -> str: try: with path.open("rb") as f: @@ -1501,11 +1542,11 @@ def _draft_for_debug_run(draft: AgentDraft) -> AgentDraft: }, ) - async def _generate_project_from_request( + async def _generate_project_and_draft_from_request( data: dict, *, debug: bool, - ) -> GeneratedProject: + ) -> tuple[GeneratedProject, AgentDraft]: try: if debug: req = GeneratedAgentTestRunRequest.model_validate(data) @@ -1528,12 +1569,23 @@ async def _generate_project_from_request( project, resolve_skillspace_detail=_resolve_skillspace_skill_md, ) - return project + return project, draft except ValidationError as e: raise HTTPException(status_code=422, detail=e.errors()) from e except DebugPolicyError as e: raise _http_policy_error(e) from e + async def _generate_project_from_request( + data: dict, + *, + debug: bool, + ) -> GeneratedProject: + project, _ = await _generate_project_and_draft_from_request( + data, + debug=debug, + ) + return project + def _write_generated_project(project: GeneratedProject, temp_dir: str) -> str: if not project.name: raise HTTPException(status_code=400, detail="Agent name is required") @@ -1676,7 +1728,10 @@ async def _create_generated_agent_test_run(request: Request): temp_dir = "" proc = None try: - project = await _generate_project_from_request(data, debug=True) + project, draft = await _generate_project_and_draft_from_request( + data, + debug=True, + ) temp_dir = tempfile.mkdtemp(prefix="veadk_generated_agent_test_") app_name = _write_generated_project(project, temp_dir) port = _free_local_port() @@ -1694,12 +1749,14 @@ async def _create_generated_agent_test_run(request: Request): "--port", str(port), ] + runner_env = _safe_runner_env() + runner_env.update(_a2a_registry_env_from_draft(draft)) with stdout_path.open("w", encoding="utf-8") as stdout_file: with stderr_path.open("w", encoding="utf-8") as stderr_file: proc = subprocess.Popen( cmd, cwd=temp_dir, - env=_safe_runner_env(), + env=runner_env, stdout=stdout_file, stderr=stderr_file, ) diff --git a/veadk/cli/generated_agent_catalog.py b/veadk/cli/generated_agent_catalog.py index 0baf90fb..1a7baf9b 100644 --- a/veadk/cli/generated_agent_catalog.py +++ b/veadk/cli/generated_agent_catalog.py @@ -79,6 +79,23 @@ class ExporterOption: # AgentKit runtimes. Components must not ask users to duplicate AK/SK settings. VOLC_ENV: tuple[EnvVar, ...] = () +A2A_REGISTRY_ENV = ( + EnvVar( + "REGISTRY_SPACE_ID", + True, + "your-a2a-space-id", + "A2A 注册中心空间 ID", + ), + EnvVar("REGISTRY_TOP_K", False, "3", "召回 Agent 数量"), + EnvVar("REGISTRY_REGION", False, "cn-beijing", "A2A 注册中心地域"), + EnvVar( + "REGISTRY_ENDPOINT", + False, + "https://open.volcengineapi.com/", + "A2A 注册中心 OpenAPI 地址", + ), +) + BUILTIN_TOOLS = ( ToolOption( id="web_search", diff --git a/veadk/cli/generated_agent_codegen.py b/veadk/cli/generated_agent_codegen.py index 3d812a28..46957de2 100644 --- a/veadk/cli/generated_agent_codegen.py +++ b/veadk/cli/generated_agent_codegen.py @@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from veadk.cli.generated_agent_catalog import ( + A2A_REGISTRY_ENV, EXPORTER_BY_ID, KB_BY_ID, LTM_BY_ID, @@ -86,6 +87,29 @@ class McpTool(BaseModel): args: list[str] = Field(default_factory=list) +class A2ARegistryConfig(BaseModel): + model_config = ConfigDict(extra="forbid") + + enabled: bool = False + registrySpaceId: str = "" + registryTopK: str = "" + registryRegion: str = "" + registryEndpoint: str = "" + + @field_validator( + "registrySpaceId", + "registryTopK", + "registryRegion", + "registryEndpoint", + mode="before", + ) + @classmethod + def _coerce_string(cls, value: Any) -> str: + if value is None: + return "" + return str(value) + + class SelectedSkill(BaseModel): model_config = ConfigDict(extra="forbid") @@ -141,6 +165,7 @@ class DeploymentConfig(BaseModel): model_config = ConfigDict(extra="forbid") feishuEnabled: bool = False + envValues: dict[str, str] = Field(default_factory=dict) class AgentDraft(BaseModel): @@ -165,6 +190,7 @@ class AgentDraft(BaseModel): builtinTools: list[str] = Field(default_factory=list) customTools: list[CustomTool] = Field(default_factory=list) mcpTools: list[McpTool] = Field(default_factory=list) + a2aRegistry: A2ARegistryConfig = Field(default_factory=A2ARegistryConfig) shortTermBackend: str = "local" longTermBackend: str = "local" autoSaveSession: bool = False @@ -386,6 +412,30 @@ def _build_agent(acc: _Acc, draft: AgentDraft, var_name: str) -> str: ) tool_exprs.append(v) + if draft.a2aRegistry.enabled: + _add_import( + acc, "from veadk.a2a.registry_client import registry_config_from_env" + ) + _add_import( + acc, + "from veadk.tools.builtin_tools.a2a_registry import " + "build_a2a_registry_tools", + ) + registry_var = _unique_ident( + acc, + f"a2a_registry_config_{var_name}", + "a2a_registry_config", + ) + tools_var = _unique_ident( + acc, + f"a2a_registry_tools_{var_name}", + "a2a_registry_tools", + ) + acc.pre_lines.append(f"{registry_var} = registry_config_from_env()") + acc.pre_lines.append(f"{tools_var} = build_a2a_registry_tools({registry_var})") + tool_exprs.append(f"*{tools_var}") + _add_env(acc, A2A_REGISTRY_ENV) + for name in draft.tools: if name.strip(): tool_exprs.append(_emit_tool_stub(acc, name, "")) @@ -501,6 +551,10 @@ def _build_agent(acc: _Acc, draft: AgentDraft, var_name: str) -> str: joined_kwargs = ",\n ".join(kwargs) acc.pre_lines.append(f"{var_name} = Agent(\n {joined_kwargs},\n)") + if draft.a2aRegistry.enabled: + acc.pre_lines.append( + f'setattr({var_name}, "_veadk_a2a_registry_config", {registry_var})' + ) return var_name @@ -582,20 +636,467 @@ def render_readme(name: str, draft: AgentDraft) -> str: return "\n".join(lines) -def _render_app_py(pkg: str, feishu_channel_enabled: bool) -> str: - return f"""{_PYTHON_LICENSE_HEADER} -from agents.{pkg}.agent import AGENT_DISPLAY_NAMES, root_agent -from veadk.integrations.agentkit import create_agentkit_app, run_agentkit_app +def _render_app_py( + pkg: str, + feishu_channel_enabled: bool, + a2a_registry_enabled: bool, +) -> str: + lines = [ + _PYTHON_LICENSE_HEADER.rstrip(), + "", + f"from agents.{pkg}.agent import AGENT_DISPLAY_NAMES, root_agent", + ] + if a2a_registry_enabled: + lines.append(f"from agents.{pkg}.dynamic_a2a import enable_dynamic_a2a_tools") + lines.extend( + [ + "from veadk.integrations.agentkit import create_agentkit_app, run_agentkit_app", + "", + "app = create_agentkit_app(", + " root_agent,", + " AGENT_DISPLAY_NAMES,", + f" enable_feishu={feishu_channel_enabled!r},", + ")", + ] + ) + if a2a_registry_enabled: + lines.extend(["", "enable_dynamic_a2a_tools(app, root_agent)"]) + lines.extend(["", 'if __name__ == "__main__":', " run_agentkit_app(app)", ""]) + return "\n".join(lines) + + +def _render_dynamic_a2a_py() -> str: + return ( + _PYTHON_LICENSE_HEADER + + r""" +from __future__ import annotations + +import asyncio +import json +from typing import Any + +from fastapi import FastAPI, HTTPException, Request, Response +from fastapi.responses import StreamingResponse +from google.adk.agents import RunConfig +from google.adk.agents.base_agent import BaseAgent +from google.adk.agents.run_config import StreamingMode +from google.adk.apps.app import App +from google.adk.cli.api_server import RunAgentRequest +from google.adk.runners import Runner as AdkRunner +from google.adk.utils.context_utils import Aclosing +from google.genai import types + + +_SERVER_STATE_KEY = "_veadk_agentkit_server" +_ADK_SERVER_STATE_KEY = "_veadk_adk_server" +_DYNAMIC_A2A_ROUTES_ENABLED_STATE_KEY = "_veadk_dynamic_a2a_routes_enabled" +_REGISTRY_CONFIG_ATTR = "_veadk_a2a_registry_config" + + +def _tool_name(tool: object) -> str | None: + name = getattr(tool, "__name__", None) or getattr(tool, "name", None) + return str(name) if name else None + + +def _content_text(content: object) -> str: + parts = getattr(content, "parts", None) or [] + texts: list[str] = [] + for part in parts: + text = getattr(part, "text", None) + if text: + texts.append(str(text)) + return "\n".join(texts) + + +def _has_a2a_registry_config(agent: object) -> bool: + if getattr(agent, _REGISTRY_CONFIG_ATTR, None) is not None: + return True + return any( + _has_a2a_registry_config(child) + for child in getattr(agent, "sub_agents", []) or [] + ) + + +def _add_dynamic_a2a_agent_tools(agent: object, prompt: str) -> int: + attached = 0 + registry_config = getattr(agent, _REGISTRY_CONFIG_ATTR, None) + prompt = prompt.strip() + if registry_config is not None and prompt: + from veadk.tools.builtin_tools.a2a_registry import build_remote_a2a_agent_tools + + dynamic_tools = build_remote_a2a_agent_tools(prompt, registry_config) + existing = { + name + for tool in getattr(agent, "tools", []) or [] + if (name := _tool_name(tool)) + } + for tool in dynamic_tools: + name = _tool_name(tool) + if not name or name in existing: + continue + getattr(agent, "tools").append(tool) + existing.add(name) + attached += 1 + + for child in getattr(agent, "sub_agents", []) or []: + attached += _add_dynamic_a2a_agent_tools(child, prompt) + return attached + + +def _spawn_dynamic_a2a_agent(base_agent: BaseAgent, prompt: str) -> BaseAgent: + cloned = base_agent.clone(update={}) + attached = _add_dynamic_a2a_agent_tools(cloned, prompt) + if _has_a2a_registry_config(cloned): + print( + f"dynamic A2A tool assembly completed for this turn: attached={attached}", + flush=True, + ) + return cloned + + +def _promote_route(app: FastAPI, endpoint) -> None: + routes = app.router.routes + for index, route in enumerate(routes): + if getattr(route, "endpoint", None) == endpoint: + routes.insert(0, routes.pop(index)) + return + + +def _has_dynamic_a2a_routes(app: FastAPI) -> bool: + expected = { + ("/run", "run_agent_dynamic"), + ("/run_sse", "run_agent_sse_dynamic"), + ("/invoke", "invoke_agent_dynamic"), + } + found: set[tuple[str, str]] = set() + for route in app.router.routes: + path = getattr(route, "path", None) + endpoint_name = getattr(getattr(route, "endpoint", None), "__name__", "") + if (path, endpoint_name) in expected: + found.add((path, endpoint_name)) + return expected.issubset(found) + + +class _RuntimeServices: + def __init__(self, app: FastAPI): + agent_server = getattr(app.state, _SERVER_STATE_KEY, None) + if agent_server is not None: + self._load_from_server(getattr(agent_server, "server", agent_server)) + return + + adk_server = getattr(app.state, _ADK_SERVER_STATE_KEY, None) + if adk_server is not None: + self._load_from_server(adk_server) + return + + attrs = getattr(app, "_tmpl_attrs", {}) + self.default_app_name = attrs.get("app_name") + self.current_app_name_ref = attrs.get("current_app_name_ref") + self.artifact_service = attrs.get("artifact_service") + self.session_service = attrs.get("session_service") + self.memory_service = attrs.get("memory_service") + self.credential_service = attrs.get("credential_service") + self.auto_create_session = bool(attrs.get("auto_create_session", False)) + + def _load_from_server(self, server: object) -> None: + self.default_app_name = getattr(server, "default_app_name", None) + self.current_app_name_ref = getattr(server, "current_app_name_ref", None) + self.artifact_service = getattr(server, "artifact_service", None) + self.session_service = getattr(server, "session_service", None) + self.memory_service = getattr(server, "memory_service", None) + self.credential_service = getattr(server, "credential_service", None) + self.auto_create_session = bool(getattr(server, "auto_create_session", False)) + + +def _dynamic_runner(services: _RuntimeServices, *, app_name: str, root_agent: BaseAgent, prompt: str): + run_agent = _spawn_dynamic_a2a_agent(root_agent, prompt) + agent_app = App(name=app_name, root_agent=run_agent, plugins=[]) + return AdkRunner( + app=agent_app, + artifact_service=services.artifact_service, + session_service=services.session_service, + memory_service=services.memory_service, + credential_service=services.credential_service, + auto_create_session=services.auto_create_session, + ) -app = create_agentkit_app( - root_agent, - AGENT_DISPLAY_NAMES, - enable_feishu={feishu_channel_enabled!r}, -) -if __name__ == "__main__": - run_agentkit_app(app) +def _resolve_run_app_name(services: _RuntimeServices, root_agent: BaseAgent, req: RunAgentRequest) -> str: + app_name = req.app_name or services.default_app_name + if not app_name: + app_name = getattr(root_agent, "name", "") or "" + if not app_name: + raise HTTPException( + status_code=400, + detail="app_name is required when ADK_DEFAULT_APP_NAME is not set", + ) + req.app_name = app_name + if services.current_app_name_ref is not None: + services.current_app_name_ref.value = app_name + return app_name + + +def _run_request_custom_metadata(req: RunAgentRequest) -> dict[str, Any] | None: + metadata = getattr(req, "custom_metadata", None) + return metadata if isinstance(metadata, dict) and metadata else None + + +def _resolve_invoke_app_name(services: _RuntimeServices, root_agent: BaseAgent) -> str: + app_name = services.default_app_name or getattr(root_agent, "name", "") or "" + if not app_name: + raise HTTPException( + status_code=400, + detail="app_name is required when ADK_DEFAULT_APP_NAME is not set", + ) + if services.current_app_name_ref is not None: + services.current_app_name_ref.value = app_name + return app_name + + +async def _invoke_text(request: Request) -> str: + body = await request.body() + if not body: + return "" + try: + payload = json.loads(body) + except Exception: + return body.decode("utf-8", errors="replace") + if isinstance(payload, dict): + text = payload.get("prompt") + if text is not None: + return str(text) + try: + return json.dumps(payload, ensure_ascii=False) + except Exception: + return "" + + +def enable_dynamic_a2a_tools(app: FastAPI, root_agent: BaseAgent) -> None: + if _has_dynamic_a2a_routes(app): + return + + services = _RuntimeServices(app) + if services.session_service is None or not _has_a2a_registry_config(root_agent): + return + + @app.post("/run", response_model=None) + async def run_agent_dynamic( + req: RunAgentRequest, + request: Request, + ) -> list[Any] | Response: + app_name = _resolve_run_app_name(services, root_agent, req) + runner = _dynamic_runner( + services, + app_name=app_name, + root_agent=root_agent, + prompt=_content_text(req.new_message), + ) + custom_metadata = _run_request_custom_metadata(req) + run_config = ( + RunConfig(custom_metadata=custom_metadata) if custom_metadata else None + ) + + async def worker() -> list[Any]: + async with Aclosing( + runner.run_async( + user_id=req.user_id, + session_id=req.session_id, + new_message=req.new_message, + state_delta=req.state_delta, + invocation_id=req.invocation_id, + run_config=run_config, + ) + ) as agen: + return [event async for event in agen] + + worker_task = asyncio.create_task(worker()) + + async def monitor() -> None: + try: + while True: + message = await request.receive() + if message.get("type") == "http.disconnect": + worker_task.cancel() + break + except asyncio.CancelledError: + pass + + monitor_task = asyncio.create_task(monitor()) + try: + return await worker_task + except asyncio.CancelledError: + if await request.is_disconnected(): + return Response(status_code=499) + raise + finally: + monitor_task.cancel() + + @app.post("/run_sse") + async def run_agent_sse_dynamic(req: RunAgentRequest) -> StreamingResponse: + app_name = _resolve_run_app_name(services, root_agent, req) + runner = _dynamic_runner( + services, + app_name=app_name, + root_agent=root_agent, + prompt=_content_text(req.new_message), + ) + stream_mode = StreamingMode.SSE if req.streaming else StreamingMode.NONE + custom_metadata = _run_request_custom_metadata(req) + + if not runner.auto_create_session: + session = await services.session_service.get_session( + app_name=app_name, + user_id=req.user_id, + session_id=req.session_id, + ) + if not session: + raise HTTPException( + status_code=404, + detail=f"Session not found: {req.session_id}", + ) + + async def event_generator(): + try: + async with Aclosing( + runner.run_async( + user_id=req.user_id, + session_id=req.session_id, + new_message=req.new_message, + state_delta=req.state_delta, + run_config=RunConfig( + streaming_mode=stream_mode, + custom_metadata=custom_metadata, + ), + invocation_id=req.invocation_id, + ) + ) as agen: + async for event in agen: + events_to_stream = [event] + if ( + not req.function_call_event_id + and event.actions.artifact_delta + and event.content + and event.content.parts + ): + content_event = event.model_copy(deep=True) + content_event.actions.artifact_delta = {} + artifact_event = event.model_copy(deep=True) + artifact_event.content = None + events_to_stream = [content_event, artifact_event] + + for event_to_stream in events_to_stream: + yield ( + "data: " + + event_to_stream.model_dump_json( + exclude_none=True, + by_alias=True, + ) + + "\n\n" + ) + except Exception as exc: + yield f"data: {json.dumps({'error': str(exc)})}\n\n" + + return StreamingResponse(event_generator(), media_type="text/event-stream") + + @app.post("/invoke") + async def invoke_agent_dynamic(request: Request) -> StreamingResponse: + app_name = _resolve_invoke_app_name(services, root_agent) + user_id = request.headers.get("user_id") or "agentkit_user" + session_id = request.headers.get("session_id") or "" + prompt = await _invoke_text(request) + content = types.UserContent(parts=[types.Part(text=prompt or "")]) + + session = await services.session_service.get_session( + app_name=app_name, + user_id=user_id, + session_id=session_id, + ) + if not session: + await services.session_service.create_session( + app_name=app_name, + user_id=user_id, + session_id=session_id, + ) + + runner = _dynamic_runner( + services, + app_name=app_name, + root_agent=root_agent, + prompt=prompt, + ) + + async def event_generator(): + try: + async with Aclosing( + runner.run_async( + user_id=user_id, + session_id=session_id, + new_message=content, + run_config=RunConfig(streaming_mode=StreamingMode.SSE), + ) + ) as agen: + async for event in agen: + yield ( + "data: " + + event.model_dump_json( + exclude_none=True, + by_alias=True, + ) + + "\n\n" + ) + except Exception as exc: + yield f"data: {json.dumps({'error': str(exc)})}\n\n" + + return StreamingResponse( + event_generator(), + media_type="text/event-stream", + headers={ + "Cache-Control": "no-cache", + "Connection": "keep-alive", + "X-Accel-Buffering": "no", + }, + ) + + _promote_route(app, run_agent_dynamic) + _promote_route(app, run_agent_sse_dynamic) + _promote_route(app, invoke_agent_dynamic) + setattr(app.state, _DYNAMIC_A2A_ROUTES_ENABLED_STATE_KEY, True) """ + ) + + +def _draft_has_a2a_registry(draft: AgentDraft) -> bool: + if draft.a2aRegistry.enabled: + return True + return any(_draft_has_a2a_registry(sub_agent) for sub_agent in draft.subAgents) + + +def _a2a_registry_env_values(draft: AgentDraft) -> dict[str, str]: + if not draft.a2aRegistry.enabled: + return {} + registry = draft.a2aRegistry + return { + "REGISTRY_SPACE_ID": registry.registrySpaceId.strip(), + "REGISTRY_TOP_K": registry.registryTopK.strip() or "3", + "REGISTRY_REGION": registry.registryRegion.strip() or "cn-beijing", + "REGISTRY_ENDPOINT": registry.registryEndpoint.strip() + or "https://open.volcengineapi.com/", + } + + +def _materialize_a2a_registry_env(env: list[EnvVar], draft: AgentDraft) -> list[EnvVar]: + values = _a2a_registry_env_values(draft) + if not values: + return env + return [ + EnvVar( + item.key, + item.required, + values.get(item.key, item.placeholder), + item.comment, + ) + for item in env + ] def generate_project_from_draft(draft: AgentDraft) -> GeneratedProject: @@ -630,7 +1131,8 @@ def generate_project_from_draft(draft: AgentDraft) -> GeneratedProject: ) agent_py = f"{_PYTHON_LICENSE_HEADER}\n{import_block}\n\n{agent_definition}" - app_py = _render_app_py(pkg, feishu_channel_enabled) + a2a_registry_enabled = _draft_has_a2a_registry(draft) + app_py = _render_app_py(pkg, feishu_channel_enabled, a2a_registry_enabled) files = [ GeneratedFile(path="app.py", content=app_py), # Top-level agents package marker so `from agents..agent import @@ -645,8 +1147,21 @@ def generate_project_from_draft(draft: AgentDraft) -> GeneratedProject: '__all__ = ["AGENT_DISPLAY_NAMES", "root_agent"]\n' ), ), + *( + [ + GeneratedFile( + path=f"agents/{pkg}/dynamic_a2a.py", + content=_render_dynamic_a2a_py(), + ) + ] + if a2a_registry_enabled + else [] + ), GeneratedFile( - path=".env.example", content=render_env_example(_dedupe_env(acc.env)) + path=".env.example", + content=render_env_example( + _materialize_a2a_registry_env(_dedupe_env(acc.env), draft) + ), ), GeneratedFile( path="requirements.txt", diff --git a/veadk/cli/generated_agent_security.py b/veadk/cli/generated_agent_security.py index a026f312..acfed652 100644 --- a/veadk/cli/generated_agent_security.py +++ b/veadk/cli/generated_agent_security.py @@ -106,6 +106,8 @@ def _validate_node( raise DebugPolicyError("A2A URL is required") if not allow_local_runtime_resources: validate_url_not_private(draft.a2aUrl, field_name="a2aUrl") + if draft.a2aRegistry.enabled and not draft.a2aRegistry.registrySpaceId.strip(): + raise DebugPolicyError("A2A registry space id is required") _validate_catalog_ids("builtinTools", draft.builtinTools, TOOL_BY_ID) if draft.shortTermBackend not in STM_BY_ID: diff --git a/veadk/cli/generated_agent_test_runner.py b/veadk/cli/generated_agent_test_runner.py index db0bbf01..50b452c5 100644 --- a/veadk/cli/generated_agent_test_runner.py +++ b/veadk/cli/generated_agent_test_runner.py @@ -23,6 +23,74 @@ from __future__ import annotations import argparse +from importlib import import_module +from types import ModuleType +from typing import Any + + +_ADK_SERVER_STATE_KEY = "_veadk_adk_server" + + +def _looks_like_adk_server(value: object) -> bool: + return all( + hasattr(value, attr) + for attr in ( + "artifact_service", + "session_service", + "memory_service", + "credential_service", + "current_app_name_ref", + "auto_create_session", + ) + ) + + +def _find_adk_server(app: Any) -> object | None: + """Find the ADK ApiServer captured by the default route closures.""" + for route in getattr(app.router, "routes", []) or []: + endpoint = getattr(route, "endpoint", None) + for cell in getattr(endpoint, "__closure__", None) or (): + try: + value = cell.cell_contents + except ValueError: + continue + if _looks_like_adk_server(value): + return value + return None + + +def _bind_adk_server_services(app: Any) -> None: + """Expose ADK services in the shape generated dynamic_a2a.py expects.""" + server = _find_adk_server(app) + if server is None: + return + setattr(app.state, _ADK_SERVER_STATE_KEY, server) + setattr( + app, + "_tmpl_attrs", + { + **getattr(app, "_tmpl_attrs", {}), + "app_name": getattr(server, "default_app_name", None), + "current_app_name_ref": getattr(server, "current_app_name_ref", None), + "artifact_service": getattr(server, "artifact_service", None), + "session_service": getattr(server, "session_service", None), + "memory_service": getattr(server, "memory_service", None), + "credential_service": getattr(server, "credential_service", None), + "auto_create_session": getattr(server, "auto_create_session", False), + }, + ) + + +def _import_dynamic_a2a_helper(app_name: str) -> ModuleType | None: + """Import the optional generated helper from either supported package layout.""" + module_names = (f"{app_name}.dynamic_a2a", f"agents.{app_name}.dynamic_a2a") + for module_name in module_names: + try: + return import_module(module_name) + except ModuleNotFoundError as exc: + if exc.name != module_name: + raise + return None def main() -> None: @@ -36,6 +104,23 @@ def main() -> None: from google.adk.cli.fast_api import get_fast_api_app app = get_fast_api_app(agents_dir=args.agents_dir, web=False) + _bind_adk_server_services(app) + + # Generated projects with A2A center include a helper that overrides /run and + # /run_sse so each debug turn gets registry-discovered remote_a2a_* tools. + from google.adk.apps.app import App + from google.adk.cli.utils.agent_loader import AgentLoader + + loader = AgentLoader(args.agents_dir) + apps = loader.list_agents() + if len(apps) == 1: + agent_or_app = loader.load_agent(apps[0]) + root_agent = ( + agent_or_app.root_agent if isinstance(agent_or_app, App) else agent_or_app + ) + helper = _import_dynamic_a2a_helper(apps[0]) + if helper is not None: + helper.enable_dynamic_a2a_tools(app, root_agent) uvicorn.run(app, host=args.host, port=args.port, log_level="warning") diff --git a/veadk/integrations/agentkit/app.py b/veadk/integrations/agentkit/app.py index f6a2b1f3..16d98d93 100644 --- a/veadk/integrations/agentkit/app.py +++ b/veadk/integrations/agentkit/app.py @@ -18,6 +18,7 @@ import asyncio import inspect +import json import os import threading import traceback @@ -27,12 +28,18 @@ from typing import TYPE_CHECKING, Any, cast from agentkit.apps import AgentkitAgentServerApp -from fastapi import FastAPI, HTTPException -from fastapi.responses import FileResponse +from fastapi import FastAPI, HTTPException, Request, Response +from fastapi.responses import FileResponse, StreamingResponse from fastapi.staticfiles import StaticFiles -from google.adk.agents import LoopAgent, ParallelAgent, SequentialAgent +from google.adk.agents import LoopAgent, ParallelAgent, RunConfig, SequentialAgent from google.adk.agents.base_agent import BaseAgent +from google.adk.agents.run_config import StreamingMode +from google.adk.cli.api_server import RunAgentRequest from google.adk.agents.remote_a2a_agent import RemoteA2aAgent +from google.adk.apps.app import App +from google.adk.runners import Runner as AdkRunner +from google.adk.utils.context_utils import Aclosing +from google.genai import types from veadk.agent_metadata import ( agent_component_summaries, @@ -47,6 +54,9 @@ _MAX_AGENT_GRAPH_DEPTH = 8 _SERVER_STATE_KEY = "_veadk_agentkit_server" +_ADK_SERVER_STATE_KEY = "_veadk_adk_server" +_DYNAMIC_A2A_ROUTES_ENABLED_STATE_KEY = "_veadk_dynamic_a2a_routes_enabled" +_REGISTRY_CONFIG_ATTR = "_veadk_a2a_registry_config" def _agent_type(agent: object) -> str: @@ -72,6 +82,67 @@ def _tool_label(tool: object) -> str: return str(name or type(tool).__name__) +def _tool_name(tool: object) -> str | None: + name = getattr(tool, "__name__", None) or getattr(tool, "name", None) + return str(name) if name else None + + +def _content_text(content: object) -> str: + parts = getattr(content, "parts", None) or [] + texts: list[str] = [] + for part in parts: + text = getattr(part, "text", None) + if text: + texts.append(str(text)) + return "\n".join(texts) + + +def _has_a2a_registry_config(agent: object) -> bool: + if getattr(agent, _REGISTRY_CONFIG_ATTR, None) is not None: + return True + return any( + _has_a2a_registry_config(child) + for child in getattr(agent, "sub_agents", []) or [] + ) + + +def _add_dynamic_a2a_agent_tools(agent: object, prompt: str) -> int: + attached = 0 + registry_config = getattr(agent, _REGISTRY_CONFIG_ATTR, None) + prompt = prompt.strip() + if registry_config is not None and prompt: + from veadk.tools.builtin_tools.a2a_registry import build_remote_a2a_agent_tools + + dynamic_tools = build_remote_a2a_agent_tools(prompt, registry_config) + existing = { + name + for tool in getattr(agent, "tools", []) or [] + if (name := _tool_name(tool)) + } + for tool in dynamic_tools: + name = _tool_name(tool) + if not name or name in existing: + continue + getattr(agent, "tools").append(tool) + existing.add(name) + attached += 1 + + for child in getattr(agent, "sub_agents", []) or []: + attached += _add_dynamic_a2a_agent_tools(child, prompt) + return attached + + +def _spawn_dynamic_a2a_agent(base_agent: BaseAgent, prompt: str) -> BaseAgent: + cloned = base_agent.clone(update={}) + attached = _add_dynamic_a2a_agent_tools(cloned, prompt) + if _has_a2a_registry_config(cloned): + print( + f"dynamic A2A tool assembly completed for this turn: attached={attached}", + flush=True, + ) + return cloned + + def _display_name( agent_id: str, display_names: Mapping[str, str], @@ -414,6 +485,316 @@ def _prioritize_platform_routes(app: FastAPI) -> None: ] +def _promote_route(app: FastAPI, endpoint: Callable[..., Any]) -> None: + routes = app.router.routes + for index, route in enumerate(routes): + if getattr(route, "endpoint", None) == endpoint: + routes.insert(0, routes.pop(index)) + return + + +class _RuntimeServices: + def __init__(self, app: FastAPI): + agent_server = getattr(app.state, _SERVER_STATE_KEY, None) + if agent_server is not None: + self._load_from_server(getattr(agent_server, "server", agent_server)) + return + + adk_server = getattr(app.state, _ADK_SERVER_STATE_KEY, None) + if adk_server is not None: + self._load_from_server(adk_server) + return + + attrs = getattr(app, "_tmpl_attrs", {}) + self.default_app_name = attrs.get("app_name") + self.current_app_name_ref = attrs.get("current_app_name_ref") + self.artifact_service = attrs.get("artifact_service") + self.session_service = attrs.get("session_service") + self.memory_service = attrs.get("memory_service") + self.credential_service = attrs.get("credential_service") + self.auto_create_session = bool(attrs.get("auto_create_session", False)) + + def _load_from_server(self, server: object) -> None: + self.default_app_name = getattr(server, "default_app_name", None) + self.current_app_name_ref = getattr(server, "current_app_name_ref", None) + self.artifact_service = getattr(server, "artifact_service", None) + self.session_service = getattr(server, "session_service", None) + self.memory_service = getattr(server, "memory_service", None) + self.credential_service = getattr(server, "credential_service", None) + self.auto_create_session = bool(getattr(server, "auto_create_session", False)) + + +def _dynamic_runner( + services: _RuntimeServices, + *, + app_name: str, + root_agent: BaseAgent, + prompt: str, +) -> AdkRunner: + run_agent = _spawn_dynamic_a2a_agent(root_agent, prompt) + agent_app = App(name=app_name, root_agent=run_agent, plugins=[]) + return AdkRunner( + app=agent_app, + artifact_service=services.artifact_service, + session_service=services.session_service, + memory_service=services.memory_service, + credential_service=services.credential_service, + auto_create_session=services.auto_create_session, + ) + + +def _resolve_run_app_name( + services: _RuntimeServices, + root_agent: BaseAgent, + req: RunAgentRequest, +) -> str: + app_name = req.app_name or services.default_app_name + if not app_name: + app_name = getattr(root_agent, "name", "") or "" + if not app_name: + raise HTTPException( + status_code=400, + detail="app_name is required when ADK_DEFAULT_APP_NAME is not set", + ) + req.app_name = app_name + if services.current_app_name_ref is not None: + services.current_app_name_ref.value = app_name + return app_name + + +def _run_request_custom_metadata(req: RunAgentRequest) -> dict[str, Any] | None: + metadata = getattr(req, "custom_metadata", None) + return metadata if isinstance(metadata, dict) and metadata else None + + +def _resolve_invoke_app_name( + services: _RuntimeServices, + root_agent: BaseAgent, +) -> str: + app_name = services.default_app_name or getattr(root_agent, "name", "") or "" + if not app_name: + raise HTTPException( + status_code=400, + detail="app_name is required when ADK_DEFAULT_APP_NAME is not set", + ) + if services.current_app_name_ref is not None: + services.current_app_name_ref.value = app_name + return app_name + + +async def _invoke_text(request: Request) -> str: + body = await request.body() + if not body: + return "" + try: + payload = json.loads(body) + except Exception: + return body.decode("utf-8", errors="replace") + if isinstance(payload, dict): + text = payload.get("prompt") + if text is not None: + return str(text) + try: + return json.dumps(payload, ensure_ascii=False) + except Exception: + return "" + + +def _configure_dynamic_a2a_routes( + app: FastAPI, + root_agent: BaseAgent, +) -> None: + if getattr(app.state, _DYNAMIC_A2A_ROUTES_ENABLED_STATE_KEY, False): + return + + services = _RuntimeServices(app) + if services.session_service is None or not _has_a2a_registry_config(root_agent): + return + + @app.post("/run", response_model=None) + async def run_agent_dynamic( + req: RunAgentRequest, + request: Request, + ) -> list[Any] | Response: + app_name = _resolve_run_app_name(services, root_agent, req) + runner = _dynamic_runner( + services, + app_name=app_name, + root_agent=root_agent, + prompt=_content_text(req.new_message), + ) + custom_metadata = _run_request_custom_metadata(req) + run_config = ( + RunConfig(custom_metadata=custom_metadata) if custom_metadata else None + ) + + async def worker() -> list[Any]: + async with Aclosing( + runner.run_async( + user_id=req.user_id, + session_id=req.session_id, + new_message=req.new_message, + state_delta=req.state_delta, + invocation_id=req.invocation_id, + run_config=run_config, + ) + ) as agen: + return [event async for event in agen] + + worker_task = asyncio.create_task(worker()) + + async def monitor() -> None: + try: + while True: + message = await request.receive() + if message.get("type") == "http.disconnect": + worker_task.cancel() + break + except asyncio.CancelledError: + pass + + monitor_task = asyncio.create_task(monitor()) + try: + return await worker_task + except asyncio.CancelledError: + if await request.is_disconnected(): + return Response(status_code=499) + raise + finally: + monitor_task.cancel() + + @app.post("/run_sse") + async def run_agent_sse_dynamic(req: RunAgentRequest) -> StreamingResponse: + app_name = _resolve_run_app_name(services, root_agent, req) + runner = _dynamic_runner( + services, + app_name=app_name, + root_agent=root_agent, + prompt=_content_text(req.new_message), + ) + stream_mode = StreamingMode.SSE if req.streaming else StreamingMode.NONE + custom_metadata = _run_request_custom_metadata(req) + + if not runner.auto_create_session: + session = await services.session_service.get_session( + app_name=app_name, + user_id=req.user_id, + session_id=req.session_id, + ) + if not session: + raise HTTPException( + status_code=404, + detail=f"Session not found: {req.session_id}", + ) + + async def event_generator(): + try: + async with Aclosing( + runner.run_async( + user_id=req.user_id, + session_id=req.session_id, + new_message=req.new_message, + state_delta=req.state_delta, + run_config=RunConfig( + streaming_mode=stream_mode, + custom_metadata=custom_metadata, + ), + invocation_id=req.invocation_id, + ) + ) as agen: + async for event in agen: + events_to_stream = [event] + if ( + not req.function_call_event_id + and event.actions.artifact_delta + and event.content + and event.content.parts + ): + content_event = event.model_copy(deep=True) + content_event.actions.artifact_delta = {} + artifact_event = event.model_copy(deep=True) + artifact_event.content = None + events_to_stream = [content_event, artifact_event] + + for event_to_stream in events_to_stream: + yield ( + "data: " + + event_to_stream.model_dump_json( + exclude_none=True, + by_alias=True, + ) + + "\n\n" + ) + except Exception as exc: # noqa: BLE001 - SSE surfaces errors as data. + yield f"data: {json.dumps({'error': str(exc)})}\n\n" + + return StreamingResponse(event_generator(), media_type="text/event-stream") + + @app.post("/invoke") + async def invoke_agent_dynamic(request: Request) -> StreamingResponse: + app_name = _resolve_invoke_app_name(services, root_agent) + user_id = request.headers.get("user_id") or "agentkit_user" + session_id = request.headers.get("session_id") or "" + prompt = await _invoke_text(request) + content = types.UserContent(parts=[types.Part(text=prompt or "")]) + + session = await services.session_service.get_session( + app_name=app_name, + user_id=user_id, + session_id=session_id, + ) + if not session: + await services.session_service.create_session( + app_name=app_name, + user_id=user_id, + session_id=session_id, + ) + + runner = _dynamic_runner( + services, + app_name=app_name, + root_agent=root_agent, + prompt=prompt, + ) + + async def event_generator(): + try: + async with Aclosing( + runner.run_async( + user_id=user_id, + session_id=session_id, + new_message=content, + run_config=RunConfig(streaming_mode=StreamingMode.SSE), + ) + ) as agen: + async for event in agen: + yield ( + "data: " + + event.model_dump_json( + exclude_none=True, + by_alias=True, + ) + + "\n\n" + ) + except Exception as exc: # noqa: BLE001 - SSE surfaces errors as data. + yield f"data: {json.dumps({'error': str(exc)})}\n\n" + + return StreamingResponse( + event_generator(), + media_type="text/event-stream", + headers={ + "Cache-Control": "no-cache", + "Connection": "keep-alive", + "X-Accel-Buffering": "no", + }, + ) + + _promote_route(app, run_agent_dynamic) + _promote_route(app, run_agent_sse_dynamic) + _promote_route(app, invoke_agent_dynamic) + setattr(app.state, _DYNAMIC_A2A_ROUTES_ENABLED_STATE_KEY, True) + + def create_agentkit_app( root_agent: BaseAgent, display_names: Mapping[str, str] | None = None, @@ -446,6 +827,7 @@ def create_agentkit_app( ) app = cast(FastAPI, agent_server.app) setattr(app.state, _SERVER_STATE_KEY, agent_server) + _configure_dynamic_a2a_routes(app, root_agent) if enable_feishu: _configure_feishu_lifecycle(app, root_agent, short_term_memory) diff --git a/veadk/webui/assets/CodeEditor-C4sQGBmQ.js b/veadk/webui/assets/CodeEditor-CGGDMGvz.js similarity index 99% rename from veadk/webui/assets/CodeEditor-C4sQGBmQ.js rename to veadk/webui/assets/CodeEditor-CGGDMGvz.js index 1a1c1f24..3cbbca6c 100644 --- a/veadk/webui/assets/CodeEditor-C4sQGBmQ.js +++ b/veadk/webui/assets/CodeEditor-CGGDMGvz.js @@ -1,4 +1,4 @@ -import{A as xe,t as sf}from"./index-DxU-BSPC.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{A as xe,t as sf}from"./index-DPHNOB64.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-Dd-SgWF0.js b/veadk/webui/assets/MarkdownPromptEditor-DpwH_Fse.js similarity index 99% rename from veadk/webui/assets/MarkdownPromptEditor-Dd-SgWF0.js rename to veadk/webui/assets/MarkdownPromptEditor-DpwH_Fse.js index 178d92e1..7b5eb7d5 100644 --- a/veadk/webui/assets/MarkdownPromptEditor-Dd-SgWF0.js +++ b/veadk/webui/assets/MarkdownPromptEditor-DpwH_Fse.js @@ -1,4 +1,4 @@ -var i2=Object.defineProperty;var s2=(t,e,n)=>e in t?i2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var P=(t,e,n)=>s2(t,typeof e!="symbol"?e+"":e,n);import{i as Dd,j as l2,f as a2,g as Fc,y as c2,G as u2,s as f2,A as C,a as N,e as Fd,c as Hd,V as it,x as mn,E as Ns,C as Za,B as d2,b as Vd,u as rn,w as pl,h as tf,v as xr,F as Un,D as zt,d as fi,k as h2,t as L,z as nr,o as g2,m as p2,n as m2,l as y2,r as x2,p as _2,q as v2,R as qo}from"./index-DxU-BSPC.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++ne in t?i2(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var P=(t,e,n)=>s2(t,typeof e!="symbol"?e+"":e,n);import{i as Dd,j as l2,f as a2,g as Fc,y as c2,G as u2,s as f2,A as C,a as N,e as Fd,c as Hd,V as it,x as mn,E as Ns,C as Za,B as d2,b as Vd,u as rn,w as pl,h as tf,v as xr,F as Un,D as zt,d as fi,k as h2,t as L,z as nr,o as g2,m as p2,n as m2,l as y2,r as x2,p as _2,q as v2,R as qo}from"./index-DPHNOB64.js";const C2={}.hasOwnProperty;function am(t,e){let n=-1,r;if(e.extensions)for(;++ni.map(i=>d[i]); -function yD(e,t){for(var n=0;nr[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"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ah=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var SS={exports:{}},yp={},kS={exports:{}},rt={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownPromptEditor-DpwH_Fse.js","assets/MarkdownPromptEditor-ZH9qtki0.css"])))=>i.map(i=>d[i]); +function _D(e,t){for(var n=0;nr[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"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var lh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ku(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var AS={exports:{}},Ep={},CS={exports:{}},tt={};/** * @license React * react.production.min.js * @@ -7,7 +7,7 @@ function yD(e,t){for(var n=0;n>>1,G=L[Y];if(0>>1;Yi(Q,k))rei(le,Q)?(L[Y]=le,L[re]=k,Y=re):(L[Y]=Q,L[V]=k,Y=V);else if(rei(le,k))L[Y]=le,L[re]=k,Y=re;else break e}}return M}function i(L,M){var k=L.sortIndex-M.sortIndex;return k!==0?k:L.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],c=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var M=n(c);M!==null;){if(M.callback===null)r(c);else if(M.startTime<=L)r(c),M.sortIndex=M.expirationTime,t(l,M);else break;M=n(c)}}function w(L){if(y=!1,b(L),!m)if(n(l)!==null)m=!0,C(N);else{var M=n(c);M!==null&&R(w,M.startTime-L)}}function N(L,M){m=!1,y&&(y=!1,g(S),S=-1),p=!0;var k=h;try{for(b(M),f=n(l);f!==null&&(!(f.expirationTime>M)||L&&!D());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var G=Y(f.expirationTime<=M);M=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(l)&&r(l),b(M)}else r(l);f=n(l)}if(f!==null)var P=!0;else{var V=n(c);V!==null&&R(w,V.startTime-M),P=!1}return P}finally{f=null,h=k,p=!1}}var T=!1,A=null,S=-1,O=5,I=-1;function D(){return!(e.unstable_now()-IL||125Y?(L.sortIndex=k,t(c,L),n(l)===null&&L===n(c)&&(y?(g(S),S=-1):y=!0,R(w,k-Y))):(L.sortIndex=G,t(l,L),m||p||(m=!0,C(N))),L},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(L){var M=h;return function(){var k=h;h=M;try{return L.apply(this,arguments)}finally{h=k}}}})(FS);BS.exports=FS;var FD=BS.exports;/** + */(function(e){function t(L,M){var k=L.length;L.push(M);e:for(;0>>1,G=L[Y];if(0>>1;Yi(Q,k))nei(le,Q)?(L[Y]=le,L[ne]=k,Y=ne):(L[Y]=Q,L[V]=k,Y=V);else if(nei(le,k))L[Y]=le,L[ne]=k,Y=ne;else break e}}return M}function i(L,M){var k=L.sortIndex-M.sortIndex;return k!==0?k:L.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var l=[],c=[],d=1,f=null,h=3,p=!1,m=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var M=n(c);M!==null;){if(M.callback===null)r(c);else if(M.startTime<=L)r(c),M.sortIndex=M.expirationTime,t(l,M);else break;M=n(c)}}function w(L){if(y=!1,b(L),!m)if(n(l)!==null)m=!0,C(N);else{var M=n(c);M!==null&&O(w,M.startTime-L)}}function N(L,M){m=!1,y&&(y=!1,g(S),S=-1),p=!0;var k=h;try{for(b(M),f=n(l);f!==null&&(!(f.expirationTime>M)||L&&!D());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,h=f.priorityLevel;var G=Y(f.expirationTime<=M);M=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(l)&&r(l),b(M)}else r(l);f=n(l)}if(f!==null)var P=!0;else{var V=n(c);V!==null&&O(w,V.startTime-M),P=!1}return P}finally{f=null,h=k,p=!1}}var T=!1,A=null,S=-1,R=5,I=-1;function D(){return!(e.unstable_now()-IL||125Y?(L.sortIndex=k,t(c,L),n(l)===null&&L===n(c)&&(y?(g(S),S=-1):y=!0,O(w,k-Y))):(L.sortIndex=G,t(l,L),m||p||(m=!0,C(N))),L},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(L){var M=h;return function(){var k=h;h=M;try{return L.apply(this,arguments)}finally{h=k}}}})($S);US.exports=$S;var KD=US.exports;/** * @license React * react-dom.production.min.js * @@ -31,14 +31,14 @@ function yD(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h0=Object.prototype.hasOwnProperty,$D=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Nx={},Sx={};function HD(e){return h0.call(Sx,e)?!0:h0.call(Nx,e)?!1:$D.test(e)?Sx[e]=!0:(Nx[e]=!0,!1)}function zD(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function VD(e,t,n,r){if(t===null||typeof t>"u"||zD(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ar(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var Fn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fn[e]=new ar(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fn[t]=new ar(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fn[e]=new ar(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fn[e]=new ar(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fn[e]=new ar(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fn[e]=new ar(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fn[e]=new ar(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fn[e]=new ar(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fn[e]=new ar(e,5,!1,e.toLowerCase(),null,!1,!1)});var v1=/[\-:]([a-z])/g;function w1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(v1,w1);Fn[t]=new ar(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(v1,w1);Fn[t]=new ar(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(v1,w1);Fn[t]=new ar(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fn[e]=new ar(e,1,!1,e.toLowerCase(),null,!1,!1)});Fn.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fn[e]=new ar(e,1,!1,e.toLowerCase(),null,!0,!0)});function _1(e,t,n,r){var i=Fn.hasOwnProperty(t)?Fn[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p0=Object.prototype.hasOwnProperty,WD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Sx={},kx={};function qD(e){return p0.call(kx,e)?!0:p0.call(Sx,e)?!1:WD.test(e)?kx[e]=!0:(Sx[e]=!0,!1)}function GD(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function XD(e,t,n,r){if(t===null||typeof t>"u"||GD(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ur(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var Vn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Vn[e]=new ur(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Vn[t]=new ur(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Vn[e]=new ur(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Vn[e]=new ur(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Vn[e]=new ur(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Vn[e]=new ur(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Vn[e]=new ur(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Vn[e]=new ur(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Vn[e]=new ur(e,5,!1,e.toLowerCase(),null,!1,!1)});var w1=/[\-:]([a-z])/g;function _1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(w1,_1);Vn[t]=new ur(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(w1,_1);Vn[t]=new ur(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(w1,_1);Vn[t]=new ur(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Vn[e]=new ur(e,1,!1,e.toLowerCase(),null,!1,!1)});Vn.xlinkHref=new ur("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Vn[e]=new ur(e,1,!1,e.toLowerCase(),null,!0,!0)});function T1(e,t,n,r){var i=Vn.hasOwnProperty(t)?Vn[t]:null;(i!==null?i.type!==0:r||!(2o||i[a]!==s[o]){var l=` -`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{Cm=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cc(e):""}function KD(e){switch(e.tag){case 5:return cc(e.type);case 16:return cc("Lazy");case 13:return cc("Suspense");case 19:return cc("SuspenseList");case 0:case 2:case 15:return e=Im(e.type,!1),e;case 11:return e=Im(e.type.render,!1),e;case 1:return e=Im(e.type,!0),e;default:return""}}function y0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lo:return"Fragment";case oo:return"Portal";case p0:return"Profiler";case T1:return"StrictMode";case m0:return"Suspense";case g0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case HS:return(e.displayName||"Context")+".Consumer";case $S:return(e._context.displayName||"Context")+".Provider";case N1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case S1:return t=e.displayName||null,t!==null?t:y0(e.type)||"Memo";case hs:t=e._payload,e=e._init;try{return y0(e(t))}catch{}}return null}function YD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return y0(t);case 8:return t===T1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ps(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function VS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function WD(e){var t=VS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ad(e){e._valueTracker||(e._valueTracker=WD(e))}function KS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=VS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function oh(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function b0(e,t){var n=t.checked;return Zt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ax(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ps(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function YS(e,t){t=t.checked,t!=null&&_1(e,"checked",t,!1)}function E0(e,t){YS(e,t);var n=Ps(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?x0(e,t.type,n):t.hasOwnProperty("defaultValue")&&x0(e,t.type,Ps(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cx(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function x0(e,t,n){(t!=="number"||oh(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var uc=Array.isArray;function Oo(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Cd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qD=["Webkit","ms","Moz","O"];Object.keys(wc).forEach(function(e){qD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wc[t]=wc[e]})});function XS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||wc.hasOwnProperty(e)&&wc[e]?(""+t).trim():t+"px"}function QS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=XS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var GD=Zt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _0(e,t){if(t){if(GD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(pe(62))}}function T0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var N0=null;function k1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var S0=null,Ro=null,Lo=null;function Rx(e){if(e=Vu(e)){if(typeof S0!="function")throw Error(pe(280));var t=e.stateNode;t&&(t=wp(t),S0(e.stateNode,e.type,t))}}function ZS(e){Ro?Lo?Lo.push(e):Lo=[e]:Ro=e}function JS(){if(Ro){var e=Ro,t=Lo;if(Lo=Ro=null,Rx(e),t)for(e=0;e>>=0,e===0?32:31-(aP(e)/oP|0)|0}var Id=64,Od=4194304;function dc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function dh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=dc(o):(s&=a,s!==0&&(r=dc(s)))}else a=n&~i,a!==0?r=dc(a):s!==0&&(r=dc(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Hu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ii(t),e[t]=n}function dP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Tc),$x=" ",Hx=!1;function Ek(e,t){switch(e){case"keyup":return FP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function $P(e,t){switch(e){case"compositionend":return xk(t);case"keypress":return t.which!==32?null:(Hx=!0,$x);case"textInput":return e=t.data,e===$x&&Hx?null:e;default:return null}}function HP(e,t){if(co)return e==="compositionend"||!D1&&Ek(e,t)?(e=yk(),Cf=R1=xs=null,co=!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=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Yx(n)}}function Tk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Tk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Nk(){for(var e=window,t=oh();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=oh(e.document)}return t}function P1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function QP(e){var t=Nk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Tk(n.ownerDocument.documentElement,n)){if(r!==null&&P1(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Wx(n,s);var a=Wx(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,uo=null,R0=null,Sc=null,L0=!1;function qx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;L0||uo==null||uo!==oh(r)||(r=uo,"selectionStart"in r&&P1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sc&&iu(Sc,r)||(Sc=r,r=ph(R0,"onSelect"),0po||(e.current=F0[po],F0[po]=null,po--)}function Dt(e,t){po++,F0[po]=e.current,e.current=t}var js={},Wn=Hs(js),hr=Hs(!1),wa=js;function Ko(e,t){var n=e.type.contextTypes;if(!n)return js;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pr(e){return e=e.childContextTypes,e!=null}function gh(){Ft(hr),Ft(Wn)}function tv(e,t,n){if(Wn.current!==js)throw Error(pe(168));Dt(Wn,t),Dt(hr,n)}function Mk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(pe(108,YD(e)||"Unknown",i));return Zt({},n,r)}function yh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||js,wa=Wn.current,Dt(Wn,e),Dt(hr,hr.current),!0}function nv(e,t,n){var r=e.stateNode;if(!r)throw Error(pe(169));n?(e=Mk(e,t,wa),r.__reactInternalMemoizedMergedChildContext=e,Ft(hr),Ft(Wn),Dt(Wn,e)):Ft(hr),Dt(hr,n)}var Pi=null,_p=!1,Vm=!1;function Dk(e){Pi===null?Pi=[e]:Pi.push(e)}function c4(e){_p=!0,Dk(e)}function zs(){if(!Vm&&Pi!==null){Vm=!0;var e=0,t=vt;try{var n=Pi;for(vt=1;e>=a,i-=a,Bi=1<<32-ii(t)+i|n<S?(O=A,A=null):O=A.sibling;var I=h(g,A,b[S],w);if(I===null){A===null&&(A=O);break}e&&A&&I.alternate===null&&t(g,A),E=s(I,E,S),T===null?N=I:T.sibling=I,T=I,A=O}if(S===b.length)return n(g,A),Ht&&Zs(g,S),N;if(A===null){for(;SS?(O=A,A=null):O=A.sibling;var D=h(g,A,I.value,w);if(D===null){A===null&&(A=O);break}e&&A&&D.alternate===null&&t(g,A),E=s(D,E,S),T===null?N=D:T.sibling=D,T=D,A=O}if(I.done)return n(g,A),Ht&&Zs(g,S),N;if(A===null){for(;!I.done;S++,I=b.next())I=f(g,I.value,w),I!==null&&(E=s(I,E,S),T===null?N=I:T.sibling=I,T=I);return Ht&&Zs(g,S),N}for(A=r(g,A);!I.done;S++,I=b.next())I=p(A,g,S,I.value,w),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?S:I.key),E=s(I,E,S),T===null?N=I:T.sibling=I,T=I);return e&&A.forEach(function(F){return t(g,F)}),Ht&&Zs(g,S),N}function v(g,E,b,w){if(typeof b=="object"&&b!==null&&b.type===lo&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case kd:e:{for(var N=b.key,T=E;T!==null;){if(T.key===N){if(N=b.type,N===lo){if(T.tag===7){n(g,T.sibling),E=i(T,b.props.children),E.return=g,g=E;break e}}else if(T.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===hs&&sv(N)===T.type){n(g,T.sibling),E=i(T,b.props),E.ref=Wl(g,T,b),E.return=g,g=E;break e}n(g,T);break}else t(g,T);T=T.sibling}b.type===lo?(E=ma(b.props.children,g.mode,w,b.key),E.return=g,g=E):(w=jf(b.type,b.key,b.props,null,g.mode,w),w.ref=Wl(g,E,b),w.return=g,g=w)}return a(g);case oo:e:{for(T=b.key;E!==null;){if(E.key===T)if(E.tag===4&&E.stateNode.containerInfo===b.containerInfo&&E.stateNode.implementation===b.implementation){n(g,E.sibling),E=i(E,b.children||[]),E.return=g,g=E;break e}else{n(g,E);break}else t(g,E);E=E.sibling}E=Zm(b,g.mode,w),E.return=g,g=E}return a(g);case hs:return T=b._init,v(g,E,T(b._payload),w)}if(uc(b))return m(g,E,b,w);if(Hl(b))return y(g,E,b,w);Bd(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,E!==null&&E.tag===6?(n(g,E.sibling),E=i(E,b),E.return=g,g=E):(n(g,E),E=Qm(b,g.mode,w),E.return=g,g=E),a(g)):n(g,E)}return v}var Wo=Fk(!0),Uk=Fk(!1),xh=Hs(null),vh=null,yo=null,U1=null;function $1(){U1=yo=vh=null}function H1(e){var t=xh.current;Ft(xh),e._currentValue=t}function H0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Do(e,t){vh=e,U1=yo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dr=!0),e.firstContext=null)}function Hr(e){var t=e._currentValue;if(U1!==e)if(e={context:e,memoizedValue:t,next:null},yo===null){if(vh===null)throw Error(pe(308));yo=e,vh.dependencies={lanes:0,firstContext:e}}else yo=yo.next=e;return t}var oa=null;function z1(e){oa===null?oa=[e]:oa.push(e)}function $k(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,z1(t)):(n.next=i.next,i.next=n),t.interleaved=n,Xi(e,r)}function Xi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ps=!1;function V1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Vi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function As(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ft&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Xi(e,n)}return i=r.interleaved,i===null?(t.next=t,z1(r)):(t.next=i.next,i.next=t),r.interleaved=t,Xi(e,n)}function Of(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,C1(e,n)}}function av(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function wh(e,t,n,r){var i=e.updateQueue;ps=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;a=0,d=c=l=null,o=s;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,y=o;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Zt({},f,h);break e;case 2:ps=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=p,l=f):d=d.next=p,a|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Na|=a,e.lanes=a,e.memoizedState=f}}function ov(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ym.transition;Ym.transition={};try{e(!1),t()}finally{vt=n,Ym.transition=r}}function s2(){return zr().memoizedState}function h4(e,t,n){var r=Is(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},a2(e))o2(t,n);else if(n=$k(e,t,n,r),n!==null){var i=nr();si(n,e,r,i),l2(n,t,r)}}function p4(e,t,n){var r=Is(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(a2(e))o2(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,oi(o,a)){var l=t.interleaved;l===null?(i.next=i,z1(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=$k(e,t,i,r),n!==null&&(i=nr(),si(n,e,r,i),l2(n,t,r))}}function a2(e){var t=e.alternate;return e===Qt||t!==null&&t===Qt}function o2(e,t){kc=Th=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function l2(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,C1(e,n)}}var Nh={readContext:Hr,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useInsertionEffect:$n,useLayoutEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useMutableSource:$n,useSyncExternalStore:$n,useId:$n,unstable_isNewReconciler:!1},m4={readContext:Hr,useCallback:function(e,t){return yi().memoizedState=[e,t===void 0?null:t],e},useContext:Hr,useEffect:cv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Lf(4194308,4,e2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Lf(4194308,4,e,t)},useInsertionEffect:function(e,t){return Lf(4,2,e,t)},useMemo:function(e,t){var n=yi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=yi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=h4.bind(null,Qt,e),[r.memoizedState,e]},useRef:function(e){var t=yi();return e={current:e},t.memoizedState=e},useState:lv,useDebugValue:Z1,useDeferredValue:function(e){return yi().memoizedState=e},useTransition:function(){var e=lv(!1),t=e[0];return e=f4.bind(null,e[1]),yi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Qt,i=yi();if(Ht){if(n===void 0)throw Error(pe(407));n=n()}else{if(n=t(),Mn===null)throw Error(pe(349));Ta&30||Yk(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,cv(qk.bind(null,r,s,e),[e]),r.flags|=2048,fu(9,Wk.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=yi(),t=Mn.identifierPrefix;if(Ht){var n=Fi,r=Bi;n=(r&~(1<<32-ii(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=uu++,0")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{Im=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?pc(e):""}function QD(e){switch(e.tag){case 5:return pc(e.type);case 16:return pc("Lazy");case 13:return pc("Suspense");case 19:return pc("SuspenseList");case 0:case 2:case 15:return e=Rm(e.type,!1),e;case 11:return e=Rm(e.type.render,!1),e;case 1:return e=Rm(e.type,!0),e;default:return""}}function b0(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case po:return"Fragment";case ho:return"Portal";case m0:return"Profiler";case N1:return"StrictMode";case g0:return"Suspense";case y0:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case VS:return(e.displayName||"Context")+".Consumer";case zS:return(e._context.displayName||"Context")+".Provider";case S1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case k1:return t=e.displayName||null,t!==null?t:b0(e.type)||"Memo";case bs:t=e._payload,e=e._init;try{return b0(e(t))}catch{}}return null}function ZD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return b0(t);case 8:return t===N1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function $s(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function YS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function JD(e){var t=YS(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rd(e){e._valueTracker||(e._valueTracker=JD(e))}function WS(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=YS(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ch(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function E0(e,t){var n=t.checked;return Gt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Cx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$s(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qS(e,t){t=t.checked,t!=null&&T1(e,"checked",t,!1)}function x0(e,t){qS(e,t);var n=$s(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?v0(e,t.type,n):t.hasOwnProperty("defaultValue")&&v0(e,t.type,$s(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ix(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function v0(e,t,n){(t!=="number"||ch(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var mc=Array.isArray;function Po(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Od.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ru(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var kc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eP=["Webkit","ms","Moz","O"];Object.keys(kc).forEach(function(e){eP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),kc[t]=kc[e]})});function ZS(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||kc.hasOwnProperty(e)&&kc[e]?(""+t).trim():t+"px"}function JS(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ZS(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var tP=Gt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function T0(e,t){if(t){if(tP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(pe(62))}}function N0(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var S0=null;function A1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var k0=null,jo=null,Bo=null;function Lx(e){if(e=Gu(e)){if(typeof k0!="function")throw Error(pe(280));var t=e.stateNode;t&&(t=Tp(t),k0(e.stateNode,e.type,t))}}function ek(e){jo?Bo?Bo.push(e):Bo=[e]:jo=e}function tk(){if(jo){var e=jo,t=Bo;if(Bo=jo=null,Lx(e),t)for(e=0;e>>=0,e===0?32:31-(fP(e)/hP|0)|0}var Ld=64,Md=4194304;function gc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hh(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=gc(o):(s&=a,s!==0&&(r=gc(s)))}else a=n&~i,a!==0?r=gc(a):s!==0&&(r=gc(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Wu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ui(t),e[t]=n}function yP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Cc),Hx=" ",zx=!1;function vk(e,t){switch(e){case"keyup":return KP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wk(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var mo=!1;function WP(e,t){switch(e){case"compositionend":return wk(t);case"keypress":return t.which!==32?null:(zx=!0,Hx);case"textInput":return e=t.data,e===Hx&&zx?null:e;default:return null}}function qP(e,t){if(mo)return e==="compositionend"||!P1&&vk(e,t)?(e=Ek(),Rf=L1=Ns=null,mo=!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=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Wx(n)}}function Sk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kk(){for(var e=window,t=ch();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ch(e.document)}return t}function j1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function r4(e){var t=kk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Sk(n.ownerDocument.documentElement,n)){if(r!==null&&j1(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=qx(n,s);var a=qx(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,go=null,L0=null,Rc=null,M0=!1;function Gx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;M0||go==null||go!==ch(r)||(r=go,"selectionStart"in r&&j1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Rc&&cu(Rc,r)||(Rc=r,r=gh(L0,"onSelect"),0Eo||(e.current=U0[Eo],U0[Eo]=null,Eo--)}function It(e,t){Eo++,U0[Eo]=e.current,e.current=t}var Hs={},Qn=Ws(Hs),Er=Ws(!1),Aa=Hs;function Xo(e,t){var n=e.type.contextTypes;if(!n)return Hs;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function xr(e){return e=e.childContextTypes,e!=null}function bh(){Dt(Er),Dt(Qn)}function nv(e,t,n){if(Qn.current!==Hs)throw Error(pe(168));It(Qn,t),It(Er,n)}function Pk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(pe(108,ZD(e)||"Unknown",i));return Gt({},n,r)}function Eh(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hs,Aa=Qn.current,It(Qn,e),It(Er,Er.current),!0}function rv(e,t,n){var r=e.stateNode;if(!r)throw Error(pe(169));n?(e=Pk(e,t,Aa),r.__reactInternalMemoizedMergedChildContext=e,Dt(Er),Dt(Qn),It(Qn,e)):Dt(Er),It(Er,n)}var $i=null,Np=!1,Km=!1;function jk(e){$i===null?$i=[e]:$i.push(e)}function m4(e){Np=!0,jk(e)}function qs(){if(!Km&&$i!==null){Km=!0;var e=0,t=Et;try{var n=$i;for(Et=1;e>=a,i-=a,zi=1<<32-ui(t)+i|n<S?(R=A,A=null):R=A.sibling;var I=h(g,A,b[S],w);if(I===null){A===null&&(A=R);break}e&&A&&I.alternate===null&&t(g,A),E=s(I,E,S),T===null?N=I:T.sibling=I,T=I,A=R}if(S===b.length)return n(g,A),Ut&&ra(g,S),N;if(A===null){for(;SS?(R=A,A=null):R=A.sibling;var D=h(g,A,I.value,w);if(D===null){A===null&&(A=R);break}e&&A&&D.alternate===null&&t(g,A),E=s(D,E,S),T===null?N=D:T.sibling=D,T=D,A=R}if(I.done)return n(g,A),Ut&&ra(g,S),N;if(A===null){for(;!I.done;S++,I=b.next())I=f(g,I.value,w),I!==null&&(E=s(I,E,S),T===null?N=I:T.sibling=I,T=I);return Ut&&ra(g,S),N}for(A=r(g,A);!I.done;S++,I=b.next())I=p(A,g,S,I.value,w),I!==null&&(e&&I.alternate!==null&&A.delete(I.key===null?S:I.key),E=s(I,E,S),T===null?N=I:T.sibling=I,T=I);return e&&A.forEach(function(F){return t(g,F)}),Ut&&ra(g,S),N}function v(g,E,b,w){if(typeof b=="object"&&b!==null&&b.type===po&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Id:e:{for(var N=b.key,T=E;T!==null;){if(T.key===N){if(N=b.type,N===po){if(T.tag===7){n(g,T.sibling),E=i(T,b.props.children),E.return=g,g=E;break e}}else if(T.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===bs&&av(N)===T.type){n(g,T.sibling),E=i(T,b.props),E.ref=Zl(g,T,b),E.return=g,g=E;break e}n(g,T);break}else t(g,T);T=T.sibling}b.type===po?(E=va(b.props.children,g.mode,w,b.key),E.return=g,g=E):(w=Ff(b.type,b.key,b.props,null,g.mode,w),w.ref=Zl(g,E,b),w.return=g,g=w)}return a(g);case ho:e:{for(T=b.key;E!==null;){if(E.key===T)if(E.tag===4&&E.stateNode.containerInfo===b.containerInfo&&E.stateNode.implementation===b.implementation){n(g,E.sibling),E=i(E,b.children||[]),E.return=g,g=E;break e}else{n(g,E);break}else t(g,E);E=E.sibling}E=Jm(b,g.mode,w),E.return=g,g=E}return a(g);case bs:return T=b._init,v(g,E,T(b._payload),w)}if(mc(b))return m(g,E,b,w);if(Wl(b))return y(g,E,b,w);$d(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,E!==null&&E.tag===6?(n(g,E.sibling),E=i(E,b),E.return=g,g=E):(n(g,E),E=Zm(b,g.mode,w),E.return=g,g=E),a(g)):n(g,E)}return v}var Zo=$k(!0),Hk=$k(!1),wh=Ws(null),_h=null,wo=null,$1=null;function H1(){$1=wo=_h=null}function z1(e){var t=wh.current;Dt(wh),e._currentValue=t}function z0(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Uo(e,t){_h=e,$1=wo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yr=!0),e.firstContext=null)}function qr(e){var t=e._currentValue;if($1!==e)if(e={context:e,memoizedValue:t,next:null},wo===null){if(_h===null)throw Error(pe(308));wo=e,_h.dependencies={lanes:0,firstContext:e}}else wo=wo.next=e;return t}var ha=null;function V1(e){ha===null?ha=[e]:ha.push(e)}function zk(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,V1(t)):(n.next=i.next,i.next=n),t.interleaved=n,ns(e,r)}function ns(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Es=!1;function K1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Gi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ls(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,dt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ns(e,n)}return i=r.interleaved,i===null?(t.next=t,V1(r)):(t.next=i.next,i.next=t),r.interleaved=t,ns(e,n)}function Lf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,I1(e,n)}}function ov(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Th(e,t,n,r){var i=e.updateQueue;Es=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?s=c:a.next=c,a=l;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;a=0,d=c=l=null,o=s;do{var h=o.lane,p=o.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,y=o;switch(h=t,p=n,y.tag){case 1:if(m=y.payload,typeof m=="function"){f=m.call(p,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=y.payload,h=typeof m=="function"?m.call(p,f,h):m,h==null)break e;f=Gt({},f,h);break e;case 2:Es=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else p={eventTime:p,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=p,l=f):d=d.next=p,a|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(d===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Ra|=a,e.lanes=a,e.memoizedState=f}}function lv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Wm.transition;Wm.transition={};try{e(!1),t()}finally{Et=n,Wm.transition=r}}function o2(){return Gr().memoizedState}function E4(e,t,n){var r=Ds(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},l2(e))c2(t,n);else if(n=zk(e,t,n,r),n!==null){var i=ar();di(n,e,r,i),u2(n,t,r)}}function x4(e,t,n){var r=Ds(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(l2(e))c2(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,hi(o,a)){var l=t.interleaved;l===null?(i.next=i,V1(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=zk(e,t,i,r),n!==null&&(i=ar(),di(n,e,r,i),u2(n,t,r))}}function l2(e){var t=e.alternate;return e===qt||t!==null&&t===qt}function c2(e,t){Oc=Sh=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function u2(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,I1(e,n)}}var kh={readContext:qr,useCallback:Kn,useContext:Kn,useEffect:Kn,useImperativeHandle:Kn,useInsertionEffect:Kn,useLayoutEffect:Kn,useMemo:Kn,useReducer:Kn,useRef:Kn,useState:Kn,useDebugValue:Kn,useDeferredValue:Kn,useTransition:Kn,useMutableSource:Kn,useSyncExternalStore:Kn,useId:Kn,unstable_isNewReconciler:!1},v4={readContext:qr,useCallback:function(e,t){return wi().memoizedState=[e,t===void 0?null:t],e},useContext:qr,useEffect:uv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Df(4194308,4,n2.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Df(4194308,4,e,t)},useInsertionEffect:function(e,t){return Df(4,2,e,t)},useMemo:function(e,t){var n=wi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=E4.bind(null,qt,e),[r.memoizedState,e]},useRef:function(e){var t=wi();return e={current:e},t.memoizedState=e},useState:cv,useDebugValue:J1,useDeferredValue:function(e){return wi().memoizedState=e},useTransition:function(){var e=cv(!1),t=e[0];return e=b4.bind(null,e[1]),wi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qt,i=wi();if(Ut){if(n===void 0)throw Error(pe(407));n=n()}else{if(n=t(),Pn===null)throw Error(pe(349));Ia&30||qk(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,uv(Xk.bind(null,r,s,e),[e]),r.flags|=2048,yu(9,Gk.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=wi(),t=Pn.identifierPrefix;if(Ut){var n=Vi,r=zi;n=(r&~(1<<32-ui(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=mu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[vi]=t,e[ou]=r,b2(e,t,!1,!1),t.stateNode=e;e:{switch(a=T0(n,r),n){case"dialog":Bt("cancel",e),Bt("close",e),i=r;break;case"iframe":case"object":case"embed":Bt("load",e),i=r;break;case"video":case"audio":for(i=0;iXo&&(t.flags|=128,r=!0,ql(s,!1),t.lanes=4194304)}else{if(!r)if(e=_h(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ql(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Ht)return Hn(t),null}else 2*un()-s.renderingStartTime>Xo&&n!==1073741824&&(t.flags|=128,r=!0,ql(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=un(),t.sibling=null,n=Gt.current,Dt(Gt,r?n&1|2:n&1),t):(Hn(t),null);case 22:case 23:return ib(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?vr&1073741824&&(Hn(t),t.subtreeFlags&6&&(t.flags|=8192)):Hn(t),null;case 24:return null;case 25:return null}throw Error(pe(156,t.tag))}function _4(e,t){switch(B1(t),t.tag){case 1:return pr(t.type)&&gh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qo(),Ft(hr),Ft(Wn),W1(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Y1(t),null;case 13:if(Ft(Gt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(pe(340));Yo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ft(Gt),null;case 4:return qo(),null;case 10:return H1(t.type._context),null;case 22:case 23:return ib(),null;case 24:return null;default:return null}}var Ud=!1,Vn=!1,T4=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function bo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){sn(e,t,r)}else n.current=null}function Q0(e,t,n){try{n()}catch(r){sn(e,t,r)}}var xv=!1;function N4(e,t){if(M0=fh,e=Nk(),P1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(o=a+i),f!==s||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===i&&(o=a),h===s&&++d===r&&(l=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(D0={focusedElem:e,selectionRange:n},fh=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,v=m.memoizedState,g=t.stateNode,E=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:Qr(t.type,y),v);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(pe(163))}}catch(w){sn(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return m=xv,xv=!1,m}function Ac(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Q0(t,n,s)}i=i.next}while(i!==r)}}function Sp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Z0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function v2(e){var t=e.alternate;t!==null&&(e.alternate=null,v2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vi],delete t[ou],delete t[B0],delete t[o4],delete t[l4])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function w2(e){return e.tag===5||e.tag===3||e.tag===4}function vv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||w2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function J0(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mh));else if(r!==4&&(e=e.child,e!==null))for(J0(e,t,n),e=e.sibling;e!==null;)J0(e,t,n),e=e.sibling}function ey(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ey(e,t,n),e=e.sibling;e!==null;)ey(e,t,n),e=e.sibling}var Pn=null,Zr=!1;function as(e,t,n){for(n=n.child;n!==null;)_2(e,t,n),n=n.sibling}function _2(e,t,n){if(wi&&typeof wi.onCommitFiberUnmount=="function")try{wi.onCommitFiberUnmount(bp,n)}catch{}switch(n.tag){case 5:Vn||bo(n,t);case 6:var r=Pn,i=Zr;Pn=null,as(e,t,n),Pn=r,Zr=i,Pn!==null&&(Zr?(e=Pn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pn.removeChild(n.stateNode));break;case 18:Pn!==null&&(Zr?(e=Pn,n=n.stateNode,e.nodeType===8?zm(e.parentNode,n):e.nodeType===1&&zm(e,n),nu(e)):zm(Pn,n.stateNode));break;case 4:r=Pn,i=Zr,Pn=n.stateNode.containerInfo,Zr=!0,as(e,t,n),Pn=r,Zr=i;break;case 0:case 11:case 14:case 15:if(!Vn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Q0(n,t,a),i=i.next}while(i!==r)}as(e,t,n);break;case 1:if(!Vn&&(bo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){sn(n,t,o)}as(e,t,n);break;case 21:as(e,t,n);break;case 22:n.mode&1?(Vn=(r=Vn)||n.memoizedState!==null,as(e,t,n),Vn=r):as(e,t,n);break;default:as(e,t,n)}}function wv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new T4),t.forEach(function(r){var i=M4.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function qr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~s}if(r=i,r=un()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*k4(r/1960))-r,10e?16:e,vs===null)var r=!1;else{if(e=vs,vs=null,Ah=0,ft&6)throw Error(pe(331));var i=ft;for(ft|=4,Ne=e.current;Ne!==null;){var s=Ne,a=s.child;if(Ne.flags&16){var o=s.deletions;if(o!==null){for(var l=0;lun()-nb?pa(e,0):tb|=n),mr(e,t)}function O2(e,t){t===0&&(e.mode&1?(t=Od,Od<<=1,!(Od&130023424)&&(Od=4194304)):t=1);var n=nr();e=Xi(e,t),e!==null&&(Hu(e,t,n),mr(e,n))}function L4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),O2(e,n)}function M4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(pe(314))}r!==null&&r.delete(t),O2(e,n)}var R2;R2=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||hr.current)dr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dr=!1,v4(e,t,n);dr=!!(e.flags&131072)}else dr=!1,Ht&&t.flags&1048576&&Pk(t,Eh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Mf(e,t),e=t.pendingProps;var i=Ko(t,Wn.current);Do(t,n),i=G1(null,t,r,e,i,n);var s=X1();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pr(r)?(s=!0,yh(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,V1(t),i.updater=Np,t.stateNode=i,i._reactInternals=t,V0(t,r,e,n),t=W0(null,t,r,!0,s,n)):(t.tag=0,Ht&&s&&j1(t),Jn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Mf(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=P4(r),e=Qr(r,e),i){case 0:t=Y0(null,t,r,e,n);break e;case 1:t=yv(null,t,r,e,n);break e;case 11:t=mv(null,t,r,e,n);break e;case 14:t=gv(null,t,r,Qr(r.type,e),n);break e}throw Error(pe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),Y0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),yv(e,t,r,i,n);case 3:e:{if(m2(t),e===null)throw Error(pe(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Hk(e,t),wh(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Go(Error(pe(423)),t),t=bv(e,t,r,n,i);break e}else if(r!==i){i=Go(Error(pe(424)),t),t=bv(e,t,r,n,i);break e}else for(_r=ks(t.stateNode.containerInfo.firstChild),Tr=t,Ht=!0,ei=null,n=Uk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yo(),r===i){t=Qi(e,t,n);break e}Jn(e,t,r,n)}t=t.child}return t;case 5:return zk(t),e===null&&$0(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,P0(r,i)?a=null:s!==null&&P0(r,s)&&(t.flags|=32),p2(e,t),Jn(e,t,a,n),t.child;case 6:return e===null&&$0(t),null;case 13:return g2(e,t,n);case 4:return K1(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Wo(t,null,r,n):Jn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),mv(e,t,r,i,n);case 7:return Jn(e,t,t.pendingProps,n),t.child;case 8:return Jn(e,t,t.pendingProps.children,n),t.child;case 12:return Jn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,Dt(xh,r._currentValue),r._currentValue=a,s!==null)if(oi(s.value,a)){if(s.children===i.children&&!hr.current){t=Qi(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Vi(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),H0(s.return,n,t),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(pe(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),H0(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}Jn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Do(t,n),i=Hr(i),r=r(i),t.flags|=1,Jn(e,t,r,n),t.child;case 14:return r=t.type,i=Qr(r,t.pendingProps),i=Qr(r.type,i),gv(e,t,r,i,n);case 15:return f2(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Qr(r,i),Mf(e,t),t.tag=1,pr(r)?(e=!0,yh(t)):e=!1,Do(t,n),c2(t,r,i),V0(t,r,i,n),W0(null,t,r,!0,e,n);case 19:return y2(e,t,n);case 22:return h2(e,t,n)}throw Error(pe(156,t.tag))};function L2(e,t){return ak(e,t)}function D4(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(e,t,n,r){return new D4(e,t,n,r)}function ab(e){return e=e.prototype,!(!e||!e.isReactComponent)}function P4(e){if(typeof e=="function")return ab(e)?1:0;if(e!=null){if(e=e.$$typeof,e===N1)return 11;if(e===S1)return 14}return 2}function Os(e,t){var n=e.alternate;return n===null?(n=Fr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function jf(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")ab(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case lo:return ma(n.children,i,s,t);case T1:a=8,i|=8;break;case p0:return e=Fr(12,n,t,i|2),e.elementType=p0,e.lanes=s,e;case m0:return e=Fr(13,n,t,i),e.elementType=m0,e.lanes=s,e;case g0:return e=Fr(19,n,t,i),e.elementType=g0,e.lanes=s,e;case zS:return Ap(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $S:a=10;break e;case HS:a=9;break e;case N1:a=11;break e;case S1:a=14;break e;case hs:a=16,r=null;break e}throw Error(pe(130,e==null?e:typeof e,""))}return t=Fr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function ma(e,t,n,r){return e=Fr(7,e,r,t),e.lanes=n,e}function Ap(e,t,n,r){return e=Fr(22,e,r,t),e.elementType=zS,e.lanes=n,e.stateNode={isHidden:!1},e}function Qm(e,t,n){return e=Fr(6,e,null,t),e.lanes=n,e}function Zm(e,t,n){return t=Fr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function j4(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rm(0),this.expirationTimes=Rm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rm(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function ob(e,t,n,r,i,s,a,o,l){return e=new j4(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Fr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},V1(s),e}function B4(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j2)}catch(e){console.error(e)}}j2(),jS.exports=Ir;var Qo=jS.exports,Iv=Qo;f0.createRoot=Iv.createRoot,f0.hydrateRoot=Iv.hydrateRoot;const db=_.createContext({});function Lp(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const Mp=_.createContext(null),pu=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class z4 extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function V4({children:e,isPresent:t}){const n=_.useId(),r=_.useRef(null),i=_.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=_.useContext(pu);return _.useInsertionEffect(()=>{const{width:a,height:o,top:l,left:c}=i.current;if(t||!r.current||!a||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` +`+s.stack}return{value:e,source:t,stack:i,digest:null}}function Xm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Y0(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var T4=typeof WeakMap=="function"?WeakMap:Map;function f2(e,t,n){n=Gi(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ch||(Ch=!0,ny=r),Y0(e,t)},n}function h2(e,t,n){n=Gi(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Y0(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Y0(e,t),typeof r!="function"&&(Ms===null?Ms=new Set([this]):Ms.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function hv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new T4;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=B4.bind(null,e,t,n),t.then(e,e))}function pv(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function mv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Gi(-1,1),t.tag=2,Ls(n,t,1))),n.lanes|=1),e)}var N4=as.ReactCurrentOwner,yr=!1;function rr(e,t,n,r){t.child=e===null?Hk(t,null,n,r):Zo(t,e.child,n,r)}function gv(e,t,n,r,i){n=n.render;var s=t.ref;return Uo(t,i),r=X1(e,t,n,r,s,i),n=Q1(),e!==null&&!yr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rs(e,t,i)):(Ut&&n&&B1(t),t.flags|=1,rr(e,t,r,i),t.child)}function yv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!ob(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,p2(e,t,s,r,i)):(e=Ff(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:cu,n(a,r)&&e.ref===t.ref)return rs(e,t,i)}return t.flags|=1,e=Ps(s,r),e.ref=t.ref,e.return=t,t.child=e}function p2(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(cu(s,r)&&e.ref===t.ref)if(yr=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(yr=!0);else return t.lanes=e.lanes,rs(e,t,i)}return W0(e,t,n,r,i)}function m2(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},It(To,kr),kr|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,It(To,kr),kr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,It(To,kr),kr|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,It(To,kr),kr|=r;return rr(e,t,i,n),t.child}function g2(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function W0(e,t,n,r,i){var s=xr(n)?Aa:Qn.current;return s=Xo(t,s),Uo(t,i),n=X1(e,t,n,r,s,i),r=Q1(),e!==null&&!yr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,rs(e,t,i)):(Ut&&r&&B1(t),t.flags|=1,rr(e,t,n,i),t.child)}function bv(e,t,n,r,i){if(xr(n)){var s=!0;Eh(t)}else s=!1;if(Uo(t,i),t.stateNode===null)Pf(e,t),d2(t,n,r),K0(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=qr(c):(c=xr(n)?Aa:Qn.current,c=Xo(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||l!==c)&&fv(t,a,r,c),Es=!1;var h=t.memoizedState;a.state=h,Th(t,r,a,i),l=t.memoizedState,o!==r||h!==l||Er.current||Es?(typeof d=="function"&&(V0(t,n,d,r),l=t.memoizedState),(o=Es||dv(t,n,o,r,h,l,c))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Vk(e,t),o=t.memoizedProps,c=t.type===t.elementType?o:ri(t.type,o),a.props=c,f=t.pendingProps,h=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=qr(l):(l=xr(n)?Aa:Qn.current,l=Xo(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==f||h!==l)&&fv(t,a,r,l),Es=!1,h=t.memoizedState,a.state=h,Th(t,r,a,i);var m=t.memoizedState;o!==f||h!==m||Er.current||Es?(typeof p=="function"&&(V0(t,n,p,r),m=t.memoizedState),(c=Es||dv(t,n,c,r,h,m,l)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,m,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,m,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=l,r=c):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return q0(e,t,n,r,s,i)}function q0(e,t,n,r,i,s){g2(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&rv(t,n,!1),rs(e,t,s);r=t.stateNode,N4.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Zo(t,e.child,null,s),t.child=Zo(t,null,o,s)):rr(e,t,o,s),t.memoizedState=r.state,i&&rv(t,n,!0),t.child}function y2(e){var t=e.stateNode;t.pendingContext?nv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nv(e,t.context,!1),Y1(e,t.containerInfo)}function Ev(e,t,n,r,i){return Qo(),U1(i),t.flags|=256,rr(e,t,n,r),t.child}var G0={dehydrated:null,treeContext:null,retryLane:0};function X0(e){return{baseLanes:e,cachePool:null,transitions:null}}function b2(e,t,n){var r=t.pendingProps,i=Yt.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),It(Yt,i&1),e===null)return H0(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Ip(a,r,0,null),e=va(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=X0(n),t.memoizedState=G0,e):eb(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return S4(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Ps(i,l),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=Ps(o,s):(s=va(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?X0(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=G0,r}return s=e.child,e=s.sibling,r=Ps(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function eb(e,t){return t=Ip({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Hd(e,t,n,r){return r!==null&&U1(r),Zo(t,e.child,null,n),e=eb(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function S4(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=Xm(Error(pe(422))),Hd(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Ip({mode:"visible",children:r.children},i,0,null),s=va(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Zo(t,e.child,null,a),t.child.memoizedState=X0(a),t.memoizedState=G0,s);if(!(t.mode&1))return Hd(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(pe(419)),r=Xm(s,r,void 0),Hd(e,t,a,r)}if(o=(a&e.childLanes)!==0,yr||o){if(r=Pn,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,ns(e,i),di(r,e,i,-1))}return ab(),r=Xm(Error(pe(421))),Hd(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=F4.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Cr=Os(i.nextSibling),Ir=t,Ut=!0,ai=null,e!==null&&(Ur[$r++]=zi,Ur[$r++]=Vi,Ur[$r++]=Ca,zi=e.id,Vi=e.overflow,Ca=t),t=eb(t,r.children),t.flags|=4096,t)}function xv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),z0(e.return,t,n)}function Qm(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function E2(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(rr(e,t,r.children,n),r=Yt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xv(e,n,t);else if(e.tag===19)xv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(It(Yt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Nh(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Qm(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Nh(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Qm(t,!0,n,null,s);break;case"together":Qm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Pf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function rs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ra|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(pe(153));if(t.child!==null){for(e=t.child,n=Ps(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ps(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function k4(e,t,n){switch(t.tag){case 3:y2(t),Qo();break;case 5:Kk(t);break;case 1:xr(t.type)&&Eh(t);break;case 4:Y1(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;It(wh,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(It(Yt,Yt.current&1),t.flags|=128,null):n&t.child.childLanes?b2(e,t,n):(It(Yt,Yt.current&1),e=rs(e,t,n),e!==null?e.sibling:null);It(Yt,Yt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return E2(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),It(Yt,Yt.current),r)break;return null;case 22:case 23:return t.lanes=0,m2(e,t,n)}return rs(e,t,n)}var x2,Q0,v2,w2;x2=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Q0=function(){};v2=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,pa(Ai.current);var s=null;switch(n){case"input":i=E0(e,i),r=E0(e,r),s=[];break;case"select":i=Gt({},i,{value:void 0}),r=Gt({},r,{value:void 0}),s=[];break;case"textarea":i=w0(e,i),r=w0(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=yh)}T0(n,r);var a;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(nu.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(o=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(nu.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Mt("scroll",e),s||o===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};w2=function(e,t,n,r){n!==r&&(t.flags|=4)};function Jl(e,t){if(!Ut)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Yn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function A4(e,t,n){var r=t.pendingProps;switch(F1(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yn(t),null;case 1:return xr(t.type)&&bh(),Yn(t),null;case 3:return r=t.stateNode,Jo(),Dt(Er),Dt(Qn),q1(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ud(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ai!==null&&(sy(ai),ai=null))),Q0(e,t),Yn(t),null;case 5:W1(t);var i=pa(pu.current);if(n=t.type,e!==null&&t.stateNode!=null)v2(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(pe(166));return Yn(t),null}if(e=pa(Ai.current),Ud(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Si]=t,r[fu]=s,e=(t.mode&1)!==0,n){case"dialog":Mt("cancel",r),Mt("close",r);break;case"iframe":case"object":case"embed":Mt("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Si]=t,e[fu]=r,x2(e,t,!1,!1),t.stateNode=e;e:{switch(a=N0(n,r),n){case"dialog":Mt("cancel",e),Mt("close",e),i=r;break;case"iframe":case"object":case"embed":Mt("load",e),i=r;break;case"video":case"audio":for(i=0;itl&&(t.flags|=128,r=!0,Jl(s,!1),t.lanes=4194304)}else{if(!r)if(e=Nh(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Ut)return Yn(t),null}else 2*dn()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,r=!0,Jl(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=dn(),t.sibling=null,n=Yt.current,It(Yt,r?n&1|2:n&1),t):(Yn(t),null);case 22:case 23:return sb(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?kr&1073741824&&(Yn(t),t.subtreeFlags&6&&(t.flags|=8192)):Yn(t),null;case 24:return null;case 25:return null}throw Error(pe(156,t.tag))}function C4(e,t){switch(F1(t),t.tag){case 1:return xr(t.type)&&bh(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jo(),Dt(Er),Dt(Qn),q1(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return W1(t),null;case 13:if(Dt(Yt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(pe(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Dt(Yt),null;case 4:return Jo(),null;case 10:return z1(t.type._context),null;case 22:case 23:return sb(),null;case 24:return null;default:return null}}var zd=!1,qn=!1,I4=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function _o(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){sn(e,t,r)}else n.current=null}function Z0(e,t,n){try{n()}catch(r){sn(e,t,r)}}var vv=!1;function R4(e,t){if(D0=ph,e=kk(),j1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,l=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||i!==0&&f.nodeType!==3||(o=a+i),f!==s||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===i&&(o=a),h===s&&++d===r&&(l=a),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(P0={focusedElem:e,selectionRange:n},ph=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,v=m.memoizedState,g=t.stateNode,E=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:ri(t.type,y),v);g.__reactInternalSnapshotBeforeUpdate=E}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(pe(163))}}catch(w){sn(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return m=vv,vv=!1,m}function Lc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Z0(t,n,s)}i=i.next}while(i!==r)}}function Ap(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function J0(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _2(e){var t=e.alternate;t!==null&&(e.alternate=null,_2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Si],delete t[fu],delete t[F0],delete t[h4],delete t[p4])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function T2(e){return e.tag===5||e.tag===3||e.tag===4}function wv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||T2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ey(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yh));else if(r!==4&&(e=e.child,e!==null))for(ey(e,t,n),e=e.sibling;e!==null;)ey(e,t,n),e=e.sibling}function ty(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ty(e,t,n),e=e.sibling;e!==null;)ty(e,t,n),e=e.sibling}var $n=null,ii=!1;function ds(e,t,n){for(n=n.child;n!==null;)N2(e,t,n),n=n.sibling}function N2(e,t,n){if(ki&&typeof ki.onCommitFiberUnmount=="function")try{ki.onCommitFiberUnmount(xp,n)}catch{}switch(n.tag){case 5:qn||_o(n,t);case 6:var r=$n,i=ii;$n=null,ds(e,t,n),$n=r,ii=i,$n!==null&&(ii?(e=$n,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):$n.removeChild(n.stateNode));break;case 18:$n!==null&&(ii?(e=$n,n=n.stateNode,e.nodeType===8?Vm(e.parentNode,n):e.nodeType===1&&Vm(e,n),ou(e)):Vm($n,n.stateNode));break;case 4:r=$n,i=ii,$n=n.stateNode.containerInfo,ii=!0,ds(e,t,n),$n=r,ii=i;break;case 0:case 11:case 14:case 15:if(!qn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&Z0(n,t,a),i=i.next}while(i!==r)}ds(e,t,n);break;case 1:if(!qn&&(_o(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){sn(n,t,o)}ds(e,t,n);break;case 21:ds(e,t,n);break;case 22:n.mode&1?(qn=(r=qn)||n.memoizedState!==null,ds(e,t,n),qn=r):ds(e,t,n);break;default:ds(e,t,n)}}function _v(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new I4),t.forEach(function(r){var i=U4.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ei(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~s}if(r=i,r=dn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*L4(r/1960))-r,10e?16:e,Ss===null)var r=!1;else{if(e=Ss,Ss=null,Ih=0,dt&6)throw Error(pe(331));var i=dt;for(dt|=4,Ne=e.current;Ne!==null;){var s=Ne,a=s.child;if(Ne.flags&16){var o=s.deletions;if(o!==null){for(var l=0;ldn()-rb?xa(e,0):nb|=n),vr(e,t)}function L2(e,t){t===0&&(e.mode&1?(t=Md,Md<<=1,!(Md&130023424)&&(Md=4194304)):t=1);var n=ar();e=ns(e,t),e!==null&&(Wu(e,t,n),vr(e,n))}function F4(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),L2(e,n)}function U4(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(pe(314))}r!==null&&r.delete(t),L2(e,n)}var M2;M2=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Er.current)yr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return yr=!1,k4(e,t,n);yr=!!(e.flags&131072)}else yr=!1,Ut&&t.flags&1048576&&Bk(t,vh,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pf(e,t),e=t.pendingProps;var i=Xo(t,Qn.current);Uo(t,n),i=X1(null,t,r,e,i,n);var s=Q1();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xr(r)?(s=!0,Eh(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,K1(t),i.updater=kp,t.stateNode=i,i._reactInternals=t,K0(t,r,e,n),t=q0(null,t,r,!0,s,n)):(t.tag=0,Ut&&s&&B1(t),rr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Pf(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=H4(r),e=ri(r,e),i){case 0:t=W0(null,t,r,e,n);break e;case 1:t=bv(null,t,r,e,n);break e;case 11:t=gv(null,t,r,e,n);break e;case 14:t=yv(null,t,r,ri(r.type,e),n);break e}throw Error(pe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),W0(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),bv(e,t,r,i,n);case 3:e:{if(y2(t),e===null)throw Error(pe(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Vk(e,t),Th(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=el(Error(pe(423)),t),t=Ev(e,t,r,n,i);break e}else if(r!==i){i=el(Error(pe(424)),t),t=Ev(e,t,r,n,i);break e}else for(Cr=Os(t.stateNode.containerInfo.firstChild),Ir=t,Ut=!0,ai=null,n=Hk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qo(),r===i){t=rs(e,t,n);break e}rr(e,t,r,n)}t=t.child}return t;case 5:return Kk(t),e===null&&H0(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,j0(r,i)?a=null:s!==null&&j0(r,s)&&(t.flags|=32),g2(e,t),rr(e,t,a,n),t.child;case 6:return e===null&&H0(t),null;case 13:return b2(e,t,n);case 4:return Y1(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zo(t,null,r,n):rr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),gv(e,t,r,i,n);case 7:return rr(e,t,t.pendingProps,n),t.child;case 8:return rr(e,t,t.pendingProps.children,n),t.child;case 12:return rr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,It(wh,r._currentValue),r._currentValue=a,s!==null)if(hi(s.value,a)){if(s.children===i.children&&!Er.current){t=rs(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var l=o.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Gi(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),z0(s.return,n,t),o.lanes|=n;break}l=l.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(pe(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),z0(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}rr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Uo(t,n),i=qr(i),r=r(i),t.flags|=1,rr(e,t,r,n),t.child;case 14:return r=t.type,i=ri(r,t.pendingProps),i=ri(r.type,i),yv(e,t,r,i,n);case 15:return p2(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ri(r,i),Pf(e,t),t.tag=1,xr(r)?(e=!0,Eh(t)):e=!1,Uo(t,n),d2(t,r,i),K0(t,r,i,n),q0(null,t,r,!0,e,n);case 19:return E2(e,t,n);case 22:return m2(e,t,n)}throw Error(pe(156,t.tag))};function D2(e,t){return lk(e,t)}function $4(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(e,t,n,r){return new $4(e,t,n,r)}function ob(e){return e=e.prototype,!(!e||!e.isReactComponent)}function H4(e){if(typeof e=="function")return ob(e)?1:0;if(e!=null){if(e=e.$$typeof,e===S1)return 11;if(e===k1)return 14}return 2}function Ps(e,t){var n=e.alternate;return n===null?(n=Kr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ff(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")ob(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case po:return va(n.children,i,s,t);case N1:a=8,i|=8;break;case m0:return e=Kr(12,n,t,i|2),e.elementType=m0,e.lanes=s,e;case g0:return e=Kr(13,n,t,i),e.elementType=g0,e.lanes=s,e;case y0:return e=Kr(19,n,t,i),e.elementType=y0,e.lanes=s,e;case KS:return Ip(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zS:a=10;break e;case VS:a=9;break e;case S1:a=11;break e;case k1:a=14;break e;case bs:a=16,r=null;break e}throw Error(pe(130,e==null?e:typeof e,""))}return t=Kr(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function va(e,t,n,r){return e=Kr(7,e,r,t),e.lanes=n,e}function Ip(e,t,n,r){return e=Kr(22,e,r,t),e.elementType=KS,e.lanes=n,e.stateNode={isHidden:!1},e}function Zm(e,t,n){return e=Kr(6,e,null,t),e.lanes=n,e}function Jm(e,t,n){return t=Kr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function z4(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lm(0),this.expirationTimes=Lm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lm(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function lb(e,t,n,r,i,s,a,o,l){return e=new z4(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Kr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},K1(s),e}function V4(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(F2)}catch(e){console.error(e)}}F2(),FS.exports=Pr;var nl=FS.exports,Rv=nl;h0.createRoot=Rv.createRoot,h0.hydrateRoot=Rv.hydrateRoot;const fb=_.createContext({});function Dp(e){const t=_.useRef(null);return t.current===null&&(t.current=e()),t.current}const Pp=_.createContext(null),Eu=_.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class G4 extends _.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function X4({children:e,isPresent:t}){const n=_.useId(),r=_.useRef(null),i=_.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=_.useContext(Eu);return _.useInsertionEffect(()=>{const{width:a,height:o,top:l,left:c}=i.current;if(t||!r.current||!a||!o)return;r.current.dataset.motionPopId=n;const d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${a}px !important; @@ -46,551 +46,551 @@ Error generating stack: `+s.message+` top: ${l}px !important; left: ${c}px !important; } - `),()=>{document.head.removeChild(d)}},[t]),u.jsx(z4,{isPresent:t,childRef:r,sizeRef:i,children:_.cloneElement(e,{ref:r})})}const K4=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const o=Lp(Y4),l=_.useId(),c=_.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=_.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c,register:f=>(o.set(f,!1),()=>o.delete(f))}),s?[Math.random(),c]:[n,c]);return _.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),_.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=u.jsx(V4,{isPresent:n,children:e})),u.jsx(Mp.Provider,{value:d,children:e})};function Y4(){return new Map}function B2(e=!0){const t=_.useContext(Mp);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=_.useId();_.useEffect(()=>{e&&i(s)},[e]);const a=_.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const zd=e=>e.key||"";function Ov(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const fb=typeof window<"u",F2=fb?_.useLayoutEffect:_.useEffect,Rs=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1})=>{const[o,l]=B2(a),c=_.useMemo(()=>Ov(e),[e]),d=a&&!o?[]:c.map(zd),f=_.useRef(!0),h=_.useRef(c),p=Lp(()=>new Map),[m,y]=_.useState(c),[v,g]=_.useState(c);F2(()=>{f.current=!1,h.current=c;for(let w=0;w{const N=zd(w),T=a&&!o?!1:c===v||d.includes(N),A=()=>{if(p.has(N))p.set(N,!0);else return;let S=!0;p.forEach(O=>{O||(S=!1)}),S&&(b==null||b(),g(h.current),a&&(l==null||l()),r&&r())};return u.jsx(K4,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:T?void 0:A,children:w},N)})})},Nr=e=>e;let U2=Nr;const W4={useManualTiming:!1};function q4(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(c){s.has(c)&&(l.schedule(c),e()),c(a)}const l={schedule:(c,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&s.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(a=c,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Vd=["read","resolveKeyframes","update","preRender","render","postRender"],G4=40;function $2(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=Vd.reduce((g,E)=>(g[E]=q4(s),g),{}),{read:o,resolveKeyframes:l,update:c,preRender:d,render:f,postRender:h}=a,p=()=>{const g=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,G4),1),i.timestamp=g,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),d.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Vd.reduce((g,E)=>{const b=a[E];return g[E]=(w,N=!1,T=!1)=>(n||m(),b.schedule(w,N,T)),g},{}),cancel:g=>{for(let E=0;ERv[e].some(n=>!!t[n])};function X4(e){for(const t in e)Zo[t]={...Zo[t],...e[t]}}const Q4=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 Oh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Q4.has(e)}let z2=e=>!Oh(e);function V2(e){e&&(z2=t=>t.startsWith("on")?!Oh(t):e(t))}try{V2(require("@emotion/is-prop-valid").default)}catch{}function Z4(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(z2(i)||n===!0&&Oh(i)||!t&&!Oh(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function J4({children:e,isValidProp:t,...n}){t&&V2(t),n={..._.useContext(pu),...n},n.isStatic=Lp(()=>n.isStatic);const r=_.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return u.jsx(pu.Provider,{value:r,children:e})}function e6(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Dp=_.createContext({});function mu(e){return typeof e=="string"||Array.isArray(e)}function Pp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const hb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pb=["initial",...hb];function jp(e){return Pp(e.animate)||pb.some(t=>mu(e[t]))}function K2(e){return!!(jp(e)||e.variants)}function t6(e,t){if(jp(e)){const{initial:n,animate:r}=e;return{initial:n===!1||mu(n)?n:void 0,animate:mu(r)?r:void 0}}return e.inherit!==!1?t:{}}function n6(e){const{initial:t,animate:n}=t6(e,_.useContext(Dp));return _.useMemo(()=>({initial:t,animate:n}),[Lv(t),Lv(n)])}function Lv(e){return Array.isArray(e)?e.join(" "):e}const r6=Symbol.for("motionComponentSymbol");function xo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function i6(e,t,n){return _.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):xo(n)&&(n.current=r))},[t])}const mb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),s6="framerAppearId",Y2="data-"+mb(s6),{schedule:gb}=$2(queueMicrotask,!1),W2=_.createContext({});function a6(e,t,n,r,i){var s,a;const{visualElement:o}=_.useContext(Dp),l=_.useContext(H2),c=_.useContext(Mp),d=_.useContext(pu).reducedMotion,f=_.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=_.useContext(W2);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&o6(f.current,n,i,p);const m=_.useRef(!1);_.useInsertionEffect(()=>{h&&m.current&&h.update(n,c)});const y=n[Y2],v=_.useRef(!!y&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,y))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,y)));return F2(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),gb.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),_.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),v.current=!1))}),h}function o6(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:q2(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&xo(o),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function q2(e){if(e)return e.options.allowProjection!==!1?e.projection:q2(e.parent)}function l6({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,a;e&&X4(e);function o(c,d){let f;const h={..._.useContext(pu),...c,layoutId:c6(c)},{isStatic:p}=h,m=n6(c),y=r(c,p);if(!p&&fb){u6();const v=d6(h);f=v.MeasureLayout,m.visualElement=a6(i,y,h,t,v.ProjectionNode)}return u.jsxs(Dp.Provider,{value:m,children:[f&&m.visualElement?u.jsx(f,{visualElement:m.visualElement,...h}):null,n(i,c,i6(y,m.visualElement,d),y,p,m.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${(a=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&a!==void 0?a:""})`}`;const l=_.forwardRef(o);return l[r6]=i,l}function c6({layoutId:e}){const t=_.useContext(db).id;return t&&e!==void 0?t+"-"+e:e}function u6(e,t){_.useContext(H2).strict}function d6(e){const{drag:t,layout:n}=Zo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const f6=["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 yb(e){return typeof e!="string"||e.includes("-")?!1:!!(f6.indexOf(e)>-1||/[A-Z]/u.test(e))}function Mv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function bb(e,t,n,r){if(typeof t=="function"){const[i,s]=Mv(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Mv(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const sy=e=>Array.isArray(e),h6=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),p6=e=>sy(e)?e[e.length-1]||0:e,Kn=e=>!!(e&&e.getVelocity);function Bf(e){const t=Kn(e)?e.get():e;return h6(t)?t.toValue():t}function m6({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const a={latestValues:g6(r,i,s,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const G2=e=>(t,n)=>{const r=_.useContext(Dp),i=_.useContext(Mp),s=()=>m6(e,t,r,i);return n?s():Lp(s)};function g6(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Bf(s[h]);let{initial:a,animate:o}=e;const l=jp(e),c=K2(e);t&&c&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!Pp(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),Q2=X2("--"),y6=X2("var(--"),Eb=e=>y6(e)?b6.test(e.split("/*")[0].trim()):!1,b6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Z2=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Zi=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},gu={..._l,transform:e=>Zi(0,1,e)},Kd={..._l,default:1},Yu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),us=Yu("deg"),Ti=Yu("%"),Ue=Yu("px"),E6=Yu("vh"),x6=Yu("vw"),Dv={...Ti,parse:e=>Ti.parse(e)/100,transform:e=>Ti.transform(e*100)},v6={borderWidth:Ue,borderTopWidth:Ue,borderRightWidth:Ue,borderBottomWidth:Ue,borderLeftWidth:Ue,borderRadius:Ue,radius:Ue,borderTopLeftRadius:Ue,borderTopRightRadius:Ue,borderBottomRightRadius:Ue,borderBottomLeftRadius:Ue,width:Ue,maxWidth:Ue,height:Ue,maxHeight:Ue,top:Ue,right:Ue,bottom:Ue,left:Ue,padding:Ue,paddingTop:Ue,paddingRight:Ue,paddingBottom:Ue,paddingLeft:Ue,margin:Ue,marginTop:Ue,marginRight:Ue,marginBottom:Ue,marginLeft:Ue,backgroundPositionX:Ue,backgroundPositionY:Ue},w6={rotate:us,rotateX:us,rotateY:us,rotateZ:us,scale:Kd,scaleX:Kd,scaleY:Kd,scaleZ:Kd,skew:us,skewX:us,skewY:us,distance:Ue,translateX:Ue,translateY:Ue,translateZ:Ue,x:Ue,y:Ue,z:Ue,perspective:Ue,transformPerspective:Ue,opacity:gu,originX:Dv,originY:Dv,originZ:Ue},Pv={..._l,transform:Math.round},xb={...v6,...w6,zIndex:Pv,size:Ue,fillOpacity:gu,strokeOpacity:gu,numOctaves:Pv},_6={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},T6=wl.length;function N6(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),J2=()=>({..._b(),attrs:{}}),Tb=e=>typeof e=="string"&&e.toLowerCase()==="svg";function eA(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const tA=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 nA(e,t,n,r){eA(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(tA.has(i)?i:mb(i),t.attrs[i])}const Rh={};function I6(e){Object.assign(Rh,e)}function rA(e,{layout:t,layoutId:n}){return Fa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Rh[e]||e==="opacity")}function Nb(e,t,n){var r;const{style:i}=e,s={};for(const a in i)(Kn(i[a])||t.style&&Kn(t.style[a])||rA(a,e)||((r=n==null?void 0:n.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[a]=i[a]);return s}function iA(e,t,n){const r=Nb(e,t,n);for(const i in e)if(Kn(e[i])||Kn(t[i])){const s=wl.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function O6(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 Bv=["x","y","width","height","cx","cy","r"],R6={useVisualState:G2({scrapeMotionValuesFromProps:iA,createRenderState:J2,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const o in i)if(Fa.has(o)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let o=0;o{O6(n,r),Ut.render(()=>{wb(r,i,Tb(n.tagName),e.transformTemplate),nA(n,r)})})}})},L6={useVisualState:G2({scrapeMotionValuesFromProps:Nb,createRenderState:_b})};function sA(e,t,n){for(const r in t)!Kn(t[r])&&!rA(r,n)&&(e[r]=t[r])}function M6({transformTemplate:e},t){return _.useMemo(()=>{const n=_b();return vb(n,t,e),Object.assign({},n.vars,n.style)},[t])}function D6(e,t){const n=e.style||{},r={};return sA(r,n,e),Object.assign(r,M6(e,t)),r}function P6(e,t){const n={},r=D6(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function j6(e,t,n,r){const i=_.useMemo(()=>{const s=J2();return wb(s,t,Tb(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};sA(s,e.style,e),i.style={...s,...i.style}}return i}function B6(e=!1){return(n,r,i,{latestValues:s},a)=>{const l=(yb(n)?j6:P6)(r,s,a,n),c=Z4(r,typeof n=="string",e),d=n!==_.Fragment?{...c,...l,ref:i}:{},{children:f}=r,h=_.useMemo(()=>Kn(f)?f.get():f,[f]);return _.createElement(n,{...d,children:h})}}function F6(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...yb(r)?R6:L6,preloadedFeatures:e,useRender:B6(i),createVisualElement:t,Component:r};return l6(a)}}function aA(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r(Ff===void 0&&Ni.set(jn.isProcessing||W4.useManualTiming?jn.timestamp:performance.now()),Ff),set:e=>{Ff=e,queueMicrotask(U6)}};function kb(e,t){e.indexOf(t)===-1&&e.push(t)}function Ab(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Cb{constructor(){this.subscriptions=[]}add(t){return kb(this.subscriptions,t),()=>Ab(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s!isNaN(parseFloat(e));class H6{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ni.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),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=Ni.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$6(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 Cb);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ut.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ni.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Fv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Fv);return lA(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 yu(e,t){return new H6(e,t)}function z6(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,yu(n))}function V6(e,t){const n=Bp(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const o=p6(s[a]);z6(e,a,o)}}function K6(e){return!!(Kn(e)&&e.add)}function ay(e,t){const n=e.getValue("willChange");if(K6(n))return n.add(t)}function cA(e){return e.props[Y2]}function Ib(e){let t;return()=>(t===void 0&&(t=e()),t)}const Y6=Ib(()=>window.ScrollTimeline!==void 0);class W6{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 r=0;r{if(Y6()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].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 q6 extends W6{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Ki=e=>e*1e3,Yi=e=>e/1e3;function Ob(e){return typeof e=="function"}function Uv(e,t){e.timeline=t,e.onfinish=null}const Rb=e=>Array.isArray(e)&&typeof e[0]=="number",G6={linearEasing:void 0};function X6(e,t){const n=Ib(e);return()=>{var r;return(r=G6[t])!==null&&r!==void 0?r:n()}}const Lh=X6(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Jo=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},uA=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${r})`,oy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:hc([0,.65,.55,1]),circOut:hc([.55,0,1,.45]),backIn:hc([.31,.01,.66,-.59]),backOut:hc([.33,1.53,.69,.99])};function fA(e,t){if(e)return typeof e=="function"&&Lh()?uA(e,t):Rb(e)?hc(e):Array.isArray(e)?e.map(n=>fA(n,t)||oy.easeOut):oy[e]}const hA=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Q6=1e-7,Z6=12;function J6(e,t,n,r,i){let s,a,o=0;do a=t+(n-t)/2,s=hA(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>Q6&&++oJ6(s,0,1,e,n);return s=>s===0||s===1?s:hA(i(s),t,r)}const pA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,mA=e=>t=>1-e(1-t),gA=Wu(.33,1.53,.69,.99),Lb=mA(gA),yA=pA(Lb),bA=e=>(e*=2)<1?.5*Lb(e):.5*(2-Math.pow(2,-10*(e-1))),Mb=e=>1-Math.sin(Math.acos(e)),EA=mA(Mb),xA=pA(Mb),vA=e=>/^0[^.\s]+$/u.test(e);function e5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||vA(e):!0}const Oc=e=>Math.round(e*1e5)/1e5,Db=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function t5(e){return e==null}const n5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pb=(e,t)=>n=>!!(typeof n=="string"&&n5.test(n)&&n.startsWith(e)||t&&!t5(n)&&Object.prototype.hasOwnProperty.call(n,t)),wA=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,o]=r.match(Db);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},r5=e=>Zi(0,255,e),eg={..._l,transform:e=>Math.round(r5(e))},ca={test:Pb("rgb","red"),parse:wA("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+eg.transform(e)+", "+eg.transform(t)+", "+eg.transform(n)+", "+Oc(gu.transform(r))+")"};function i5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const ly={test:Pb("#"),parse:i5,transform:ca.transform},vo={test:Pb("hsl","hue"),parse:wA("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ti.transform(Oc(t))+", "+Ti.transform(Oc(n))+", "+Oc(gu.transform(r))+")"},zn={test:e=>ca.test(e)||ly.test(e)||vo.test(e),parse:e=>ca.test(e)?ca.parse(e):vo.test(e)?vo.parse(e):ly.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ca.transform(e):vo.transform(e)},s5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function a5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Db))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(s5))===null||n===void 0?void 0:n.length)||0)>0}const _A="number",TA="color",o5="var",l5="var(",$v="${}",c5=/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 bu(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(c5,l=>(zn.test(l)?(r.color.push(s),i.push(TA),n.push(zn.parse(l))):l.startsWith(l5)?(r.var.push(s),i.push(o5),n.push(l)):(r.number.push(s),i.push(_A),n.push(parseFloat(l))),++s,$v)).split($v);return{values:n,split:o,indexes:r,types:i}}function NA(e){return bu(e).values}function SA(e){const{split:t,types:n}=bu(e),r=t.length;return i=>{let s="";for(let a=0;atypeof e=="number"?0:e;function d5(e){const t=NA(e);return SA(e)(t.map(u5))}const Fs={test:a5,parse:NA,createTransformer:SA,getAnimatableNone:d5},f5=new Set(["brightness","contrast","saturate","opacity"]);function h5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Db)||[];if(!r)return e;const i=n.replace(r,"");let s=f5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const p5=/\b([a-z-]*)\(.*?\)/gu,cy={...Fs,getAnimatableNone:e=>{const t=e.match(p5);return t?t.map(h5).join(" "):e}},m5={...xb,color:zn,backgroundColor:zn,outlineColor:zn,fill:zn,stroke:zn,borderColor:zn,borderTopColor:zn,borderRightColor:zn,borderBottomColor:zn,borderLeftColor:zn,filter:cy,WebkitFilter:cy},jb=e=>m5[e];function kA(e,t){let n=jb(e);return n!==cy&&(n=Fs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const g5=new Set(["auto","none","0"]);function y5(e,t,n){let r=0,i;for(;re===_l||e===Ue,zv=(e,t)=>parseFloat(e.split(", ")[t]),Vv=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return zv(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?zv(s[1],e):0}},b5=new Set(["x","y","z"]),E5=wl.filter(e=>!b5.has(e));function x5(e){const t=[];return E5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const el={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:Vv(4,13),y:Vv(5,14)};el.translateX=el.x;el.translateY=el.y;const ga=new Set;let uy=!1,dy=!1;function AA(){if(dy){const e=Array.from(ga).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=x5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var o;(o=r.getValue(s))===null||o===void 0||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}dy=!1,uy=!1,ga.forEach(e=>e.complete()),ga.clear()}function CA(){ga.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(dy=!0)})}function v5(){CA(),AA()}class Bb{constructor(t,n,r,i,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ga.add(this),uy||(uy=!0,Ut.read(CA),Ut.resolveKeyframes(AA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),w5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _5(e){const t=w5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function OA(e,t,n=1){const[r,i]=_5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return IA(a)?parseFloat(a):a}return Eb(i)?OA(i,t,n+1):i}const RA=e=>t=>t.test(e),T5={test:e=>e==="auto",parse:e=>e},LA=[_l,Ue,Ti,us,x6,E6,T5],Kv=e=>LA.find(RA(e));class MA extends Bb{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Yv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fs.test(e)||e==="0")&&!e.startsWith("url("));function N5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function Fp(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(k5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const A5=40;class DA{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ni.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>A5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&v5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ni.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:a,onComplete:o,onUpdate:l,isGenerator:c}=this.options;if(!c&&!S5(t,r,i,s))if(a)this.options.duration=0;else{l&&l(Fp(t,this.options,n)),o&&o(),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 fy=2e4;function PA(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=fy?1/0:t}const Xt=(e,t,n)=>e+(t-e)*n;function tg(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 C5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;i=tg(l,o,e+1/3),s=tg(l,o,e),a=tg(l,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function Mh(e,t){return n=>n>0?t:e}const ng=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},I5=[ly,ca,vo],O5=e=>I5.find(t=>t.test(e));function Wv(e){const t=O5(e);if(!t)return!1;let n=t.parse(e);return t===vo&&(n=C5(n)),n}const qv=(e,t)=>{const n=Wv(e),r=Wv(t);if(!n||!r)return Mh(e,t);const i={...n};return s=>(i.red=ng(n.red,r.red,s),i.green=ng(n.green,r.green,s),i.blue=ng(n.blue,r.blue,s),i.alpha=Xt(n.alpha,r.alpha,s),ca.transform(i))},R5=(e,t)=>n=>t(e(n)),qu=(...e)=>e.reduce(R5),hy=new Set(["none","hidden"]);function L5(e,t){return hy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function M5(e,t){return n=>Xt(e,t,n)}function Fb(e){return typeof e=="number"?M5:typeof e=="string"?Eb(e)?Mh:zn.test(e)?qv:j5:Array.isArray(e)?jA:typeof e=="object"?zn.test(e)?qv:D5:Mh}function jA(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>Fb(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in r)n[s]=r[s](i);return n}}function P5(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s{const n=Fs.createTransformer(t),r=bu(e),i=bu(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?hy.has(e)&&!i.values.length||hy.has(t)&&!r.values.length?L5(e,t):qu(jA(P5(r,i),i.values),n):Mh(e,t)};function BA(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Xt(e,t,n):Fb(e)(e,t)}const B5=5;function FA(e,t,n){const r=Math.max(t-B5,0);return lA(n-e(r),t-r)}const rn={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},rg=.001;function F5({duration:e=rn.duration,bounce:t=rn.bounce,velocity:n=rn.velocity,mass:r=rn.mass}){let i,s,a=1-t;a=Zi(rn.minDamping,rn.maxDamping,a),e=Zi(rn.minDuration,rn.maxDuration,Yi(e)),a<1?(i=c=>{const d=c*a,f=d*e,h=d-n,p=py(c,a),m=Math.exp(-f);return rg-h/p*m},s=c=>{const f=c*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(c,2)*e,m=Math.exp(-f),y=py(Math.pow(c,2),a);return(-i(c)+rg>0?-1:1)*((h-p)*m)/y}):(i=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-rg+d*f},s=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const o=5/e,l=$5(i,s,o);if(e=Ki(e),isNaN(l))return{stiffness:rn.stiffness,damping:rn.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const U5=12;function $5(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function V5(e){let t={velocity:rn.velocity,stiffness:rn.stiffness,damping:rn.damping,mass:rn.mass,isResolvedFromDuration:!1,...e};if(!Gv(e,z5)&&Gv(e,H5))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Zi(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:rn.mass,stiffness:i,damping:s}}else{const n=F5(e);t={...t,...n,mass:rn.mass},t.isResolvedFromDuration=!0}return t}function UA(e=rn.visualDuration,t=rn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=V5({...n,velocity:-Yi(n.velocity||0)}),m=h||0,y=c/(2*Math.sqrt(l*d)),v=a-s,g=Yi(Math.sqrt(l/d)),E=Math.abs(v)<5;r||(r=E?rn.restSpeed.granular:rn.restSpeed.default),i||(i=E?rn.restDelta.granular:rn.restDelta.default);let b;if(y<1){const N=py(g,y);b=T=>{const A=Math.exp(-y*g*T);return a-A*((m+y*g*v)/N*Math.sin(N*T)+v*Math.cos(N*T))}}else if(y===1)b=N=>a-Math.exp(-g*N)*(v+(m+g*v)*N);else{const N=g*Math.sqrt(y*y-1);b=T=>{const A=Math.exp(-y*g*T),S=Math.min(N*T,300);return a-A*((m+y*g*v)*Math.sinh(S)+N*v*Math.cosh(S))/N}}const w={calculatedDuration:p&&f||null,next:N=>{const T=b(N);if(p)o.done=N>=f;else{let A=0;y<1&&(A=N===0?Ki(m):FA(b,N,T));const S=Math.abs(A)<=r,O=Math.abs(a-T)<=i;o.done=S&&O}return o.value=o.done?a:T,o},toString:()=>{const N=Math.min(PA(w),fy),T=uA(A=>w.next(N*A).value,N,30);return N+"ms "+T}};return w}function Xv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>o!==void 0&&Sl,m=S=>o===void 0?l:l===void 0||Math.abs(o-S)-y*Math.exp(-S/r),b=S=>g+E(S),w=S=>{const O=E(S),I=b(S);h.done=Math.abs(O)<=c,h.value=h.done?g:I};let N,T;const A=S=>{p(h.value)&&(N=S,T=UA({keyframes:[h.value,m(h.value)],velocity:FA(b,S,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return A(0),{calculatedDuration:null,next:S=>{let O=!1;return!T&&N===void 0&&(O=!0,w(S),A(S)),N!==void 0&&S>=N?T.next(S-N):(!O&&w(S),h)}}}const K5=Wu(.42,0,1,1),Y5=Wu(0,0,.58,1),$A=Wu(.42,0,.58,1),W5=e=>Array.isArray(e)&&typeof e[0]!="number",q5={linear:Nr,easeIn:K5,easeInOut:$A,easeOut:Y5,circIn:Mb,circInOut:xA,circOut:EA,backIn:Lb,backInOut:yA,backOut:gA,anticipate:bA},Qv=e=>{if(Rb(e)){U2(e.length===4);const[t,n,r,i]=e;return Wu(t,n,r,i)}else if(typeof e=="string")return q5[e];return e};function G5(e,t,n){const r=[],i=n||BA,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=G5(t,r,i),l=o.length,c=d=>{if(a&&d1)for(;fc(Zi(e[0],e[s-1],d)):c}function Q5(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Jo(0,t,r);e.push(Xt(n,1,i))}}function Z5(e){const t=[0];return Q5(t,e.length-1),t}function J5(e,t){return e.map(n=>n*t)}function ej(e,t){return e.map(()=>t||$A).splice(0,e.length-1)}function Dh({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=W5(r)?r.map(Qv):Qv(r),s={done:!1,value:t[0]},a=J5(n&&n.length===t.length?n:Z5(t),e),o=X5(a,t,{ease:Array.isArray(i)?i:ej(t,i)});return{calculatedDuration:e,next:l=>(s.value=o(l),s.done=l>=e,s)}}const tj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ut.update(t,!0),stop:()=>Bs(t),now:()=>jn.isProcessing?jn.timestamp:Ni.now()}},nj={decay:Xv,inertia:Xv,tween:Dh,keyframes:Dh,spring:UA},rj=e=>e/100;class Ub extends DA{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:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,a=(i==null?void 0:i.KeyframeResolver)||Bb,o=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new a(s,o,n,r,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:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=this.options,o=Ob(n)?n:nj[n]||Dh;let l,c;o!==Dh&&typeof t[0]!="number"&&(l=qu(rj,BA(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});s==="mirror"&&(c=o({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=PA(d));const{calculatedDuration:f}=d,h=f+i,p=h*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,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:r}=this;if(!r){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:y,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 g=this.currentTime-h*(this.speed>=0?1:-1),E=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,w=s;if(p){const S=Math.min(this.currentTime,d)/f;let O=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&O--,O=Math.min(O,p+1),!!(O%2)&&(m==="reverse"?(I=1-I,y&&(I-=y/f)):m==="mirror"&&(w=a)),b=Zi(0,1,I)*f}const N=E?{done:!1,value:l[0]}:w.next(b);o&&(N.value=o(N.value));let{done:T}=N;!E&&c!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return A&&i!==void 0&&(N.value=Fp(l,this.options,i)),v&&v(N.value),A&&this.finish(),N}get duration(){const{resolved:t}=this;return t?Yi(t.calculatedDuration):0}get time(){return Yi(this.currentTime)}set time(t){t=Ki(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=Yi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=tj,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),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=r??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 ij=new Set(["opacity","clipPath","filter","transform"]);function sj(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const d=fA(o,i);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}const aj=Ib(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ph=10,oj=2e4;function lj(e){return Ob(e.type)||e.type==="spring"||!dA(e.ease)}function cj(e,t){const n=new Ub({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&sthis.onKeyframesResolved(a,o),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:a,motionValue:o,name:l,startTime:c}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof s=="string"&&Lh()&&uj(s)&&(s=HA[s]),lj(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...y}=this.options,v=cj(t,y);t=v.keyframes,t.length===1&&(t[1]=t[0]),r=v.duration,i=v.times,s=v.ease,a="keyframes"}const d=sj(o.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Uv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set(Fp(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Yi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Yi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ki(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:r}=n;r.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 Nr;const{animation:r}=n;Uv(r,t)}return Nr}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:r,duration:i,type:s,ease:a,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:d,onComplete:f,element:h,...p}=this.options,m=new Ub({...p,keyframes:r,duration:i,type:s,ease:a,times:o,isGenerator:!0}),y=Ki(this.time);c.setWithVelocity(m.sample(y-Ph).value,m.sample(y).value,Ph)}const{onStop:l}=this.options;l&&l(),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:r,repeatDelay:i,repeatType:s,damping:a,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return aj()&&r&&ij.has(r)&&!l&&!c&&!i&&s!=="mirror"&&a!==0&&o!=="inertia"}}const dj={type:"spring",stiffness:500,damping:25,restSpeed:10},fj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hj={type:"keyframes",duration:.8},pj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mj=(e,{keyframes:t})=>t.length>2?hj:Fa.has(e)?e.startsWith("scale")?fj(t[1]):dj:pj;function gj({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const $b=(e,t,n,r={},i,s)=>a=>{const o=Sb(r,e)||{},l=o.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ki(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:s?void 0:i};gj(o)||(d={...d,...mj(e,d)}),d.duration&&(d.duration=Ki(d.duration)),d.repeatDelay&&(d.repeatDelay=Ki(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&&!s&&t.get()!==void 0){const h=Fp(d.keyframes,o);if(h!==void 0)return Ut.update(()=>{d.onUpdate(h),d.onComplete()}),new q6([])}return!s&&Zv.supports(d)?new Zv(d):new Ub(d)};function yj({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function zA(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=l[f];if(p===void 0||d&&yj(d,f))continue;const m={delay:n,...Sb(a||{},f)};let y=!1;if(window.MotionHandoffAnimation){const g=cA(e);if(g){const E=window.MotionHandoffAnimation(g,f,Ut);E!==null&&(m.startTime=E,y=!0)}}ay(e,f),h.start($b(f,h,p,e.shouldReduceMotion&&oA.has(f)?{type:!1}:m,e,y));const v=h.animation;v&&c.push(v)}return o&&Promise.all(c).then(()=>{Ut.update(()=>{o&&V6(e,o)})}),c}function my(e,t,n={}){var r;const i=Bp(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const a=i?()=>Promise.all(zA(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return bj(e,t,d+c,f,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,d]=l==="beforeChildren"?[a,o]:[o,a];return c().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function bj(e,t,n=0,r=0,i=1,s){const a=[],o=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>o-c*r;return Array.from(e.variantChildren).sort(Ej).forEach((c,d)=>{c.notify("AnimationStart",t),a.push(my(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(a)}function Ej(e,t){return e.sortNodePosition(t)}function xj(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>my(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=my(e,t,n);else{const i=typeof t=="function"?Bp(e,t,n.custom):t;r=Promise.all(zA(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const vj=pb.length;function VA(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?VA(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:r})=>xj(e,n,r)))}function Nj(e){let t=Tj(e),n=Jv(),r=!0;const i=l=>(c,d)=>{var f;const h=Bp(e,d,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...y}=h;c={...c,...y,...m}}return c};function s(l){t=l(e)}function a(l){const{props:c}=e,d=VA(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let v=0;v<_j;v++){const g=wj[v],E=n[g],b=c[g]!==void 0?c[g]:d[g],w=mu(b),N=g===l?E.isActive:null;N===!1&&(m=v);let T=b===d[g]&&b!==c[g]&&w;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),E.protectedKeys={...p},!E.isActive&&N===null||!b&&!E.prevProp||Pp(b)||typeof b=="boolean")continue;const A=Sj(E.prevProp,b);let S=A||g===l&&E.isActive&&!T&&w||v>m&&w,O=!1;const I=Array.isArray(b)?b:[b];let D=I.reduce(i(g),{});N===!1&&(D={});const{prevResolvedValues:F={}}=E,W={...F,...D},j=R=>{S=!0,h.has(R)&&(O=!0,h.delete(R)),E.needsAnimating[R]=!0;const L=e.getValue(R);L&&(L.liveStyle=!1)};for(const R in W){const L=D[R],M=F[R];if(p.hasOwnProperty(R))continue;let k=!1;sy(L)&&sy(M)?k=!aA(L,M):k=L!==M,k?L!=null?j(R):h.add(R):L!==void 0&&h.has(R)?j(R):E.protectedKeys[R]=!0}E.prevProp=b,E.prevResolvedValues=D,E.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(T&&A)||O)&&f.push(...I.map(R=>({animation:R,options:{type:g}})))}if(h.size){const v={};h.forEach(g=>{const E=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),v[g]=E??null}),f.push({animation:v})}let y=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function o(l,c){var d;if(n[l].isActive===c)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(l,c)}),n[l].isActive=c;const f=a(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Jv(),r=!0}}}function Sj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!aA(t,e):!1}function Gs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Jv(){return{animate:Gs(!0),whileInView:Gs(),whileHover:Gs(),whileTap:Gs(),whileDrag:Gs(),whileFocus:Gs(),exit:Gs()}}class Vs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class kj extends Vs{constructor(t){super(t),t.animationState||(t.animationState=Nj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Pp(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 Aj=0;class Cj extends Vs{constructor(){super(...arguments),this.id=Aj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Ij={animation:{Feature:kj},exit:{Feature:Cj}},Xr={x:!1,y:!1};function KA(){return Xr.x||Xr.y}function Oj(e){return e==="x"||e==="y"?Xr[e]?null:(Xr[e]=!0,()=>{Xr[e]=!1}):Xr.x||Xr.y?null:(Xr.x=Xr.y=!0,()=>{Xr.x=Xr.y=!1})}const Hb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Eu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Gu(e){return{point:{x:e.pageX,y:e.pageY}}}const Rj=e=>t=>Hb(t)&&e(t,Gu(t));function Rc(e,t,n,r){return Eu(e,t,Rj(n),r)}const ew=(e,t)=>Math.abs(e-t);function Lj(e,t){const n=ew(e.x,t.x),r=ew(e.y,t.y);return Math.sqrt(n**2+r**2)}class YA{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!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=sg(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=Lj(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:y}=jn;this.history.push({...m,timestamp:y});const{onStart:v,onMove:g}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ig(h,this.transformPagePoint),Ut.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=sg(f.type==="pointercancel"?this.lastMoveEventInfo:ig(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,v),m&&m(f,v)},!Hb(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const a=Gu(t),o=ig(a,this.transformPagePoint),{point:l}=o,{timestamp:c}=jn;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,sg(o,this.history)),this.removeListeners=qu(Rc(this.contextWindow,"pointermove",this.handlePointerMove),Rc(this.contextWindow,"pointerup",this.handlePointerUp),Rc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Bs(this.updatePoint)}}function ig(e,t){return t?{point:t(e.point)}:e}function tw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sg({point:e},t){return{point:e,delta:tw(e,WA(t)),offset:tw(e,Mj(t)),velocity:Dj(t,.1)}}function Mj(e){return e[0]}function WA(e){return e[e.length-1]}function Dj(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=WA(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ki(t)));)n--;if(!r)return{x:0,y:0};const s=Yi(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const qA=1e-4,Pj=1-qA,jj=1+qA,GA=.01,Bj=0-GA,Fj=0+GA;function Ar(e){return e.max-e.min}function Uj(e,t,n){return Math.abs(e-t)<=n}function nw(e,t,n,r=.5){e.origin=r,e.originPoint=Xt(t.min,t.max,e.origin),e.scale=Ar(n)/Ar(t),e.translate=Xt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Pj&&e.scale<=jj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Bj&&e.translate<=Fj||isNaN(e.translate))&&(e.translate=0)}function Lc(e,t,n,r){nw(e.x,t.x,n.x,r?r.originX:void 0),nw(e.y,t.y,n.y,r?r.originY:void 0)}function rw(e,t,n){e.min=n.min+t.min,e.max=e.min+Ar(t)}function $j(e,t,n){rw(e.x,t.x,n.x),rw(e.y,t.y,n.y)}function iw(e,t,n){e.min=t.min-n.min,e.max=e.min+Ar(t)}function Mc(e,t,n){iw(e.x,t.x,n.x),iw(e.y,t.y,n.y)}function Hj(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Xt(n,e,r.max):Math.min(e,n)),e}function sw(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 zj(e,{top:t,left:n,bottom:r,right:i}){return{x:sw(e.x,n,i),y:sw(e.y,t,r)}}function aw(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Jo(t.min,t.max-r,e.min):r>i&&(n=Jo(e.min,e.max-i,t.min)),Zi(0,1,n)}function Yj(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 gy=.35;function Wj(e=gy){return e===!1?e=0:e===!0&&(e=gy),{x:ow(e,"left","right"),y:ow(e,"top","bottom")}}function ow(e,t,n){return{min:lw(e,t),max:lw(e,n)}}function lw(e,t){return typeof e=="number"?e:e[t]||0}const cw=()=>({translate:0,scale:1,origin:0,originPoint:0}),wo=()=>({x:cw(),y:cw()}),uw=()=>({min:0,max:0}),cn=()=>({x:uw(),y:uw()});function Lr(e){return[e("x"),e("y")]}function XA({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function qj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function ag(e){return e===void 0||e===1}function yy({scale:e,scaleX:t,scaleY:n}){return!ag(e)||!ag(t)||!ag(n)}function ea(e){return yy(e)||QA(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function QA(e){return dw(e.x)||dw(e.y)}function dw(e){return e&&e!=="0%"}function jh(e,t,n){const r=e-n,i=t*r;return n+i}function fw(e,t,n,r,i){return i!==void 0&&(e=jh(e,i,r)),jh(e,n,r)+t}function by(e,t=0,n=1,r,i){e.min=fw(e.min,t,n,r,i),e.max=fw(e.max,t,n,r,i)}function ZA(e,{x:t,y:n}){by(e.x,t.translate,t.scale,t.originPoint),by(e.y,n.translate,n.scale,n.originPoint)}const hw=.999999999999,pw=1.0000000000001;function Xj(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let o=0;ohw&&(t.x=1),t.yhw&&(t.y=1)}function _o(e,t){e.min=e.min+t,e.max=e.max+t}function mw(e,t,n,r,i=.5){const s=Xt(e.min,e.max,i);by(e,t,n,s,r)}function To(e,t){mw(e.x,t.x,t.scaleX,t.scale,t.originX),mw(e.y,t.y,t.scaleY,t.scale,t.originY)}function JA(e,t){return XA(Gj(e.getBoundingClientRect(),t))}function Qj(e,t,n){const r=JA(e,n),{scroll:i}=t;return i&&(_o(r.x,i.offset.x),_o(r.y,i.offset.y)),r}const eC=({current:e})=>e?e.ownerDocument.defaultView:null,Zj=new WeakMap;class Jj{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=cn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Gu(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Oj(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),Lr(v=>{let g=this.getAxisMotionValue(v).get()||0;if(Ti.test(g)){const{projection:E}=this.visualElement;if(E&&E.layout){const b=E.layout.layoutBox[v];b&&(g=Ar(b)*(parseFloat(g)/100))}}this.originPoint[v]=g}),m&&Ut.postRender(()=>m(d,f)),ay(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=eB(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),l=()=>Lr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new YA(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:eC(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Ut.postRender(()=>s(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:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Yd(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=Hj(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=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,s=this.constraints;n&&xo(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=zj(i.layoutBox,n):this.constraints=!1,this.elastic=Wj(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Lr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Yj(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!xo(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Qj(r,i.root,this.visualElement.getTransformPagePoint());let a=Vj(i.layout.layoutBox,s);if(n){const o=n(qj(a));this.hasMutatedConstraints=!!o,o&&(a=XA(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},c=Lr(d=>{if(!Yd(d,n,this.currentDirection))return;let f=l&&l[d]||{};a&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(c).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return ay(this.visualElement,t),r.start($b(t,r,0,n,this.visualElement,!1))}stopAnimation(){Lr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Lr(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()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Lr(n=>{const{drag:r}=this.getProps();if(!Yd(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[n];s.set(t[n]-Xt(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!xo(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Lr(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();i[a]=Kj({min:l,max:l},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Lr(a=>{if(!Yd(a,t,null))return;const o=this.getAxisMotionValue(a),{min:l,max:c}=this.constraints[a];o.set(Xt(l,c,i[a]))})}addListeners(){if(!this.visualElement.current)return;Zj.set(this.visualElement,this);const t=this.visualElement.current,n=Rc(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();xo(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Ut.read(r);const a=Eu(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Lr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=gy,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function Yd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function eB(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class tB extends Vs{constructor(t){super(t),this.removeGroupControls=Nr,this.removeListeners=Nr,this.controls=new Jj(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Nr}unmount(){this.removeGroupControls(),this.removeListeners()}}const gw=e=>(t,n)=>{e&&Ut.postRender(()=>e(t,n))};class nB extends Vs{constructor(){super(...arguments),this.removePointerDownListener=Nr}onPointerDown(t){this.session=new YA(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:eC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:gw(t),onStart:gw(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&Ut.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Rc(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 Uf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Xl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ue.test(e))e=parseFloat(e);else return e;const n=yw(e,t.target.x),r=yw(e,t.target.y);return`${n}% ${r}%`}},rB={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Fs.parse(e);if(i.length>5)return r;const s=Fs.createTransformer(e),a=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=o,i[1+a]/=l;const c=Xt(o,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),s(i)}};class iB extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;I6(sB),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Uf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,a=r.projection;return a&&(a.isPresent=s,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Ut.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),gb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function tC(e){const[t,n]=B2(),r=_.useContext(db);return u.jsx(iB,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(W2),isPresent:t,safeToRemove:n})}const sB={borderRadius:{...Xl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Xl,borderTopRightRadius:Xl,borderBottomLeftRadius:Xl,borderBottomRightRadius:Xl,boxShadow:rB};function aB(e,t,n){const r=Kn(e)?e:yu(e);return r.start($b("",r,t,n)),r.animation}function oB(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lB=(e,t)=>e.depth-t.depth;class cB{constructor(){this.children=[],this.isDirty=!1}add(t){kb(this.children,t),this.isDirty=!0}remove(t){Ab(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lB),this.isDirty=!1,this.children.forEach(t)}}function uB(e,t){const n=Ni.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Bs(r),e(s-t))};return Ut.read(r,!0),()=>Bs(r)}const nC=["TopLeft","TopRight","BottomLeft","BottomRight"],dB=nC.length,bw=e=>typeof e=="string"?parseFloat(e):e,Ew=e=>typeof e=="number"||Ue.test(e);function fB(e,t,n,r,i,s){i?(e.opacity=Xt(0,n.opacity!==void 0?n.opacity:1,hB(r)),e.opacityExit=Xt(t.opacity!==void 0?t.opacity:1,0,pB(r))):s&&(e.opacity=Xt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(Jo(e,t,r))}function vw(e,t){e.min=t.min,e.max=t.max}function Rr(e,t){vw(e.x,t.x),vw(e.y,t.y)}function ww(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function _w(e,t,n,r,i){return e-=t,e=jh(e,1/n,r),i!==void 0&&(e=jh(e,1/i,r)),e}function mB(e,t=0,n=1,r=.5,i,s=e,a=e){if(Ti.test(t)&&(t=parseFloat(t),t=Xt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=Xt(s.min,s.max,r);e===s&&(o-=t),e.min=_w(e.min,t,n,o,i),e.max=_w(e.max,t,n,o,i)}function Tw(e,t,[n,r,i],s,a){mB(e,t[n],t[r],t[i],t.scale,s,a)}const gB=["x","scaleX","originX"],yB=["y","scaleY","originY"];function Nw(e,t,n,r){Tw(e.x,t,gB,n?n.x:void 0,r?r.x:void 0),Tw(e.y,t,yB,n?n.y:void 0,r?r.y:void 0)}function Sw(e){return e.translate===0&&e.scale===1}function iC(e){return Sw(e.x)&&Sw(e.y)}function kw(e,t){return e.min===t.min&&e.max===t.max}function bB(e,t){return kw(e.x,t.x)&&kw(e.y,t.y)}function Aw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sC(e,t){return Aw(e.x,t.x)&&Aw(e.y,t.y)}function Cw(e){return Ar(e.x)/Ar(e.y)}function Iw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class EB{constructor(){this.members=[]}add(t){kb(this.members,t),t.scheduleRender()}remove(t){if(Ab(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function xB(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const ta={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},pc=typeof window<"u"&&window.MotionDebug!==void 0,og=["","X","Y","Z"],vB={visibility:"hidden"},Ow=1e3;let wB=0;function lg(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function aC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=cA(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ut,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&aC(r)}function oC({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},o=t==null?void 0:t()){this.id=wB++,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,pc&&(ta.totalNodes=ta.resolvedTargetDeltas=ta.recalculatedProjection=0),this.nodes.forEach(NB),this.nodes.forEach(IB),this.nodes.forEach(OB),this.nodes.forEach(SB),pc&&window.MotionDebug.record(ta)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=uB(h,250),Uf.hasAnimatedSinceResize&&(Uf.hasAnimatedSinceResize=!1,this.nodes.forEach(Lw))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||PB,{onLayoutAnimationStart:v,onLayoutAnimationComplete:g}=d.getProps(),E=!this.targetLayout||!sC(this.targetLayout,m)||p,b=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||h&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,b);const w={...Sb(y,"layout"),onPlay:v,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||Lw(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,Bs(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(RB),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&&aC(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 l=0;l{const N=w/1e3;Mw(f.x,a.x,N),Mw(f.y,a.y,N),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),MB(this.relativeTarget,this.relativeTargetOrigin,h,N),b&&bB(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=cn()),Rr(b,this.relativeTarget)),y&&(this.animationValues=d,fB(d,c,this.latestValues,N,E,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},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&&(Bs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ut.update(()=>{Uf.hasAnimatedSinceResize=!0,this.currentAnimation=aB(0,Ow,{...a,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},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(Ow),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:c,latestValues:d}=a;if(!(!o||!l||!c)){if(this!==a&&this.layout&&c&&lC(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||cn();const f=Ar(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const h=Ar(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+h}Rr(o,l),To(o,d),Lc(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new EB),this.sharedNodes.get(a).add(o);const c=o.options.initialPromotionConfig;o.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(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:o,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const c={};l.z&&lg("z",a,c,this.animationValues);for(let d=0;d{var o;return(o=a.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(Rw),this.root.sharedNodes.clear()}}}function _B(e){e.updateLayout()}function TB(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:r,measuredBox:i}=e.layout,{animationType:s}=e.options,a=n.source!==e.layout.source;s==="size"?Lr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Ar(h);h.min=r[f].min,h.max=h.min+p}):lC(s,n.layoutBox,r)&&Lr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Ar(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=wo();Lc(o,r,n.layoutBox);const l=wo();a?Lc(l,e.applyTransform(i,!0),n.measuredBox):Lc(l,r,n.layoutBox);const c=!iC(o);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=cn();Mc(m,n.layoutBox,h.layoutBox);const y=cn();Mc(y,r,p.layoutBox),sC(m,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function NB(e){pc&&ta.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 SB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function kB(e){e.clearSnapshot()}function Rw(e){e.clearMeasurements()}function AB(e){e.isLayoutDirty=!1}function CB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Lw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function IB(e){e.resolveTargetDelta()}function OB(e){e.calcProjection()}function RB(e){e.resetSkewAndRotation()}function LB(e){e.removeLeadSnapshot()}function Mw(e,t,n){e.translate=Xt(t.translate,0,n),e.scale=Xt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Dw(e,t,n,r){e.min=Xt(t.min,n.min,r),e.max=Xt(t.max,n.max,r)}function MB(e,t,n,r){Dw(e.x,t.x,n.x,r),Dw(e.y,t.y,n.y,r)}function DB(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const PB={duration:.45,ease:[.4,0,.1,1]},Pw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),jw=Pw("applewebkit/")&&!Pw("chrome/")?Math.round:Nr;function Bw(e){e.min=jw(e.min),e.max=jw(e.max)}function jB(e){Bw(e.x),Bw(e.y)}function lC(e,t,n){return e==="position"||e==="preserve-aspect"&&!Uj(Cw(t),Cw(n),.2)}function BB(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const FB=oC({attachResizeListener:(e,t)=>Eu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),cg={current:void 0},cC=oC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cg.current){const e=new FB({});e.mount(window),e.setOptions({layoutScroll:!0}),cg.current=e}return cg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),UB={pan:{Feature:nB},drag:{Feature:tB,ProjectionNode:cC,MeasureLayout:tC}};function $B(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function uC(e,t){const n=$B(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Fw(e){return t=>{t.pointerType==="touch"||KA()||e(t)}}function HB(e,t,n={}){const[r,i,s]=uC(e,n),a=Fw(o=>{const{target:l}=o,c=t(o);if(typeof c!="function"||!l)return;const d=Fw(f=>{c(f),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,i)});return r.forEach(o=>{o.addEventListener("pointerenter",a,i)}),s}function Uw(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Ut.postRender(()=>s(t,Gu(t)))}class zB extends Vs{mount(){const{current:t}=this.node;t&&(this.unmount=HB(t,n=>(Uw(this.node,n,"Start"),r=>Uw(this.node,r,"End"))))}unmount(){}}class VB extends Vs{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=qu(Eu(this.node.current,"focus",()=>this.onFocus()),Eu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const dC=(e,t)=>t?e===t?!0:dC(e,t.parentElement):!1,KB=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function YB(e){return KB.has(e.tagName)||e.tabIndex!==-1}const mc=new WeakSet;function $w(e){return t=>{t.key==="Enter"&&e(t)}}function ug(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const WB=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=$w(()=>{if(mc.has(n))return;ug(n,"down");const i=$w(()=>{ug(n,"up")}),s=()=>ug(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Hw(e){return Hb(e)&&!KA()}function qB(e,t,n={}){const[r,i,s]=uC(e,n),a=o=>{const l=o.currentTarget;if(!Hw(o)||mc.has(l))return;mc.add(l);const c=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!Hw(p)||!mc.has(l))&&(mc.delete(l),typeof c=="function"&&c(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||dC(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(o=>{!YB(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),o.addEventListener("focus",c=>WB(c,i),i)}),s}function zw(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Ut.postRender(()=>s(t,Gu(t)))}class GB extends Vs{mount(){const{current:t}=this.node;t&&(this.unmount=qB(t,n=>(zw(this.node,n,"Start"),(r,{success:i})=>zw(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ey=new WeakMap,dg=new WeakMap,XB=e=>{const t=Ey.get(e.target);t&&t(e)},QB=e=>{e.forEach(XB)};function ZB({root:e,...t}){const n=e||document;dg.has(n)||dg.set(n,{});const r=dg.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(QB,{root:e,...t})),r[i]}function JB(e,t,n){const r=ZB(t);return Ey.set(e,n),r.observe(e),()=>{Ey.delete(e),r.unobserve(e)}}const e8={some:0,all:1};class t8 extends Vs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:e8[i]},o=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=c?d:f;h&&h(l)};return JB(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(n8(t,n))&&this.startObserver()}unmount(){}}function n8({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const r8={inView:{Feature:t8},tap:{Feature:GB},focus:{Feature:VB},hover:{Feature:zB}},i8={layout:{ProjectionNode:cC,MeasureLayout:tC}},xy={current:null},fC={current:!1};function s8(){if(fC.current=!0,!!fb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>xy.current=e.matches;e.addListener(t),t()}else xy.current=!1}const a8=[...LA,zn,Fs],o8=e=>a8.find(RA(e)),Vw=new WeakMap;function l8(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Kn(i))e.addValue(r,i);else if(Kn(s))e.addValue(r,yu(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,yu(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Kw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class c8{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Bb,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=Ni.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),fC.current||s8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:xy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Vw.delete(this.current),this.projection&&this.projection.unmount(),Bs(this.notifyUpdate),Bs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Fa.has(t),i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Ut.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Zo){const n=Zo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):cn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=yu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(IA(i)||vA(i))?i=parseFloat(i):!o8(i)&&Fs.test(n)&&(i=kA(t,n)),this.setBaseTarget(t,Kn(i)?i.get():i)),Kn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const a=bb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(i=a[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Kn(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Cb),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class hC extends c8{constructor(){super(...arguments),this.KeyframeResolver=MA}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Kn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function u8(e){return window.getComputedStyle(e)}class d8 extends hC{constructor(){super(...arguments),this.type="html",this.renderInstance=eA}readValueFromInstance(t,n){if(Fa.has(n)){const r=jb(n);return r&&r.default||0}else{const r=u8(t),i=(Q2(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return JA(t,n)}build(t,n,r){vb(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Nb(t,n,r)}}class f8 extends hC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=cn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Fa.has(n)){const r=jb(n);return r&&r.default||0}return n=tA.has(n)?n:mb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iA(t,n,r)}build(t,n,r){wb(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){nA(t,n,r,i)}mount(t){this.isSVGTag=Tb(t.tagName),super.mount(t)}}const h8=(e,t)=>yb(e)?new f8(t):new d8(t,{allowProjection:e!==_.Fragment}),p8=F6({...Ij,...r8,...UB,...i8},h8),zt=e6(p8);function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?_.useEffect:_.useLayoutEffect;function no(e,t,n){var r=_.useRef(t);r.current=t,_.useEffect(function(){function i(s){r.current(s)}return e&&window.addEventListener(e,i,n),function(){e&&window.removeEventListener(e,i)}},[e])}var m8=["container"];function g8(e){var t=e.container,n=t===void 0?document.body:t,r=Up(e,m8);return Qo.createPortal(Qe.createElement("div",Nn({},r)),n)}function y8(e){return Qe.createElement("svg",Nn({width:"44",height:"44",viewBox:"0 0 768 768"},e),Qe.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 b8(e){return Qe.createElement("svg",Nn({width:"44",height:"44",viewBox:"0 0 768 768"},e),Qe.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 E8(e){return Qe.createElement("svg",Nn({width:"44",height:"44",viewBox:"0 0 768 768"},e),Qe.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function x8(){return _.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function Ww(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var i=e.touches[1],s=i.clientX,a=i.clientY;return[(n+s)/2,(r+a)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(a-r,2))]}return[n,r,0]}var ms=function(e,t,n,r){var i,s=n*t,a=(s-r)/2,o=e;return s<=r?(i=1,o=0):e>0&&a-e<=0?(i=2,o=a):e<0&&a+e<=0&&(i=3,o=-a),[i,o]};function fg(e,t,n,r,i,s,a,o,l,c){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),l===void 0&&(l=0),c===void 0&&(c=0);var d=ms(e,s,n,innerWidth)[0],f=ms(t,s,r,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-s/i*(a-(h+e))-h+(r/n>=3&&n*s===innerWidth?0:d?l/2:l),y:o-s/i*(o-(p+t))-p+(f[0]?c/2:c),lastCX:a,lastCY:o}}function _y(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function hg(e,t,n){var r=_y(n,innerWidth,innerHeight),i=r[0],s=r[1],a=0,o=i,l=s,c=e/t*s,d=t/e*i;return e=s?o=c:e>=i&&ti/s?l=d:t/e>=3&&!r[2]?a=((l=d)-s)/2:o=c,{width:o,height:l,x:0,y:a,pause:!0}}function qd(e,t){var n=t.leading,r=n!==void 0&&n,i=t.maxWait,s=t.wait,a=s===void 0?i||0:s,o=_.useRef(e);o.current=e;var l=_.useRef(0),c=_.useRef(),d=function(){return c.current&&clearTimeout(c.current)},f=_.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){l.current=p,d(),o.current.apply(null,h)}var y=l.current,v=p-y;if(y===0&&(r&&m(),l.current=p),i!==void 0){if(v>i)return void m()}else v=1&&s&&s())};d()}function d(){l=requestAnimationFrame(c)}}var w8={T:0,L:0,W:0,H:0,FIT:void 0},mC=function(){var e=_.useRef(!1);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},_8=["className"];function T8(e){var t=e.className,n=t===void 0?"":t,r=Up(e,_8);return Qe.createElement("div",Nn({className:"PhotoView__Spinner "+n},r),Qe.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},Qe.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"}),Qe.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var N8=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function S8(e){var t=e.src,n=e.loaded,r=e.broken,i=e.className,s=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,l=Up(e,N8),c=mC();return t&&!r?Qe.createElement(Qe.Fragment,null,Qe.createElement("img",Nn({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(d){var f=d.target;c.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){c.current&&s({broken:!0})},draggable:!1,alt:""},l)),!n&&(a?Qe.createElement("span",{className:"PhotoView__icon"},a):Qe.createElement(T8,{className:"PhotoView__icon"}))):o?Qe.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var k8={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 A8(e){var t=e.item,n=t.src,r=t.render,i=t.width,s=i===void 0?0:i,a=t.height,o=a===void 0?0:a,l=t.originRef,c=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,y=e.loadingElement,v=e.brokenElement,g=e.onPhotoTap,E=e.onMaskTap,b=e.onReachMove,w=e.onReachUp,N=e.onPhotoResize,T=e.isActive,A=e.expose,S=Bh(k8),O=S[0],I=S[1],D=_.useRef(0),F=mC(),W=O.naturalWidth,j=W===void 0?s:W,$=O.naturalHeight,C=$===void 0?o:$,R=O.width,L=R===void 0?s:R,M=O.height,k=M===void 0?o:M,Y=O.loaded,G=Y===void 0?!n:Y,P=O.broken,V=O.x,Q=O.y,re=O.touched,le=O.stopRaf,K=O.maskTouched,q=O.rotate,ae=O.scale,ge=O.CX,he=O.CY,de=O.lastX,Ie=O.lastY,_e=O.lastCX,Ee=O.lastCY,Pe=O.lastScale,be=O.touchTime,Ve=O.touchLength,ke=O.pause,ce=O.reach,It=ya({onScale:function(se){return Me(Wd(se))},onRotate:function(se){q!==se&&(A({rotate:se}),I(Nn({rotate:se},hg(j,C,se))))}});function Me(se,Ce,We){ae!==se&&(A({scale:se}),I(Nn({scale:se},fg(V,Q,L,k,ae,se,Ce,We),se<=1&&{x:0,y:0})))}var wt=qd(function(se,Ce,We){if(We===void 0&&(We=0),(re||K)&&T){var Jt=_y(q,L,k),Xe=Jt[0],te=Jt[1];if(We===0&&D.current===0){var xe=Math.abs(se-ge)<=20,ye=Math.abs(Ce-he)<=20;if(xe&&ye)return void I({lastCX:se,lastCY:Ce});D.current=xe?Ce>he?3:2:1}var Be,He=se-_e,$e=Ce-Ee;if(We===0){var ot=ms(He+de,ae,Xe,innerWidth)[0],it=ms($e+Ie,ae,te,innerHeight);Be=function(mt,kn,lt,An){return kn&&mt===1||An==="x"?"x":lt&&mt>1||An==="y"?"y":void 0}(D.current,ot,it[0],ce),Be!==void 0&&b(Be,se,Ce,ae)}if(Be==="x"||K)return void I({reach:"x"});var mn=Wd(ae+(We-Ve)/100/2*ae,j/L,.2);A({scale:mn}),I(Nn({touchLength:We,reach:Be,scale:mn},fg(V,Q,L,k,ae,mn,se,Ce,He,$e)))}},{maxWait:8});function st(se){return!le&&!re&&(F.current&&I(Nn({},se,{pause:c})),F.current)}var z,X,oe,we,Ae,Ge,Ot,Ke,xn=(Ae=function(se){return st({x:se})},Ge=function(se){return st({y:se})},Ot=function(se){return F.current&&(A({scale:se}),I({scale:se})),!re&&F.current},Ke=ya({X:function(se){return Ae(se)},Y:function(se){return Ge(se)},S:function(se){return Ot(se)}}),function(se,Ce,We,Jt,Xe,te,xe,ye,Be,He,$e){var ot=_y(He,Xe,te),it=ot[0],mn=ot[1],mt=ms(se,ye,it,innerWidth),kn=mt[0],lt=mt[1],An=ms(Ce,ye,mn,innerHeight),gn=An[0],br=An[1],an=Date.now()-$e;if(an>=200||ye!==xe||Math.abs(Be-xe)>1){var Cn=fg(se,Ce,Xe,te,xe,ye),_t=Cn.x,Un=Cn.y,on=kn?lt:_t!==se?_t:null,Xn=gn?br:Un!==Ce?Un:null;return on!==null&&ia(se,on,Ke.X),Xn!==null&&ia(Ce,Xn,Ke.Y),void(ye!==xe&&ia(xe,ye,Ke.S))}var Qn=(se-We)/an,In=(Ce-Jt)/an,Dn=Math.sqrt(Math.pow(Qn,2)+Math.pow(In,2)),vn=!1,wn=!1;(function(_n,en){var ee,Te=_n,De=0,ze=0,gt=function(tn){ee||(ee=tn);var Wt=tn-ee,ln=Math.sign(_n),Ka=-.001*ln,pi=Math.sign(-Te)*Math.pow(Te,2)*2e-4,jl=Te*Wt+(Ka+pi)*Math.pow(Wt,2)/2;De+=jl,ee=tn,ln*(Te+=(Ka+pi)*Wt)<=0?tt():en(De)?ht():tt()};function ht(){ze=requestAnimationFrame(gt)}function tt(){cancelAnimationFrame(ze)}ht()})(Dn,function(_n){var en=se+_n*(Qn/Dn),ee=Ce+_n*(In/Dn),Te=ms(en,xe,it,innerWidth),De=Te[0],ze=Te[1],gt=ms(ee,xe,mn,innerHeight),ht=gt[0],tt=gt[1];if(De&&!vn&&(vn=!0,kn?ia(en,ze,Ke.X):qw(ze,en+(en-ze),Ke.X)),ht&&!wn&&(wn=!0,gn?ia(ee,tt,Ke.Y):qw(tt,ee+(ee-tt),Ke.Y)),vn&&wn)return!1;var tn=vn||Ke.X(ze),Wt=wn||Ke.Y(tt);return tn&&Wt})}),jt=(z=g,X=function(se,Ce){ce||Me(ae!==1?1:Math.max(2,j/L),se,Ce)},oe=_.useRef(0),we=qd(function(){oe.current=0,z.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var se=[].slice.call(arguments);oe.current+=1,we.apply(void 0,se),oe.current>=2&&(we.cancel(),oe.current=0,X.apply(void 0,se))});function yt(se,Ce){if(D.current=0,(re||K)&&T){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var We=Wd(ae,j/L);if(xn(V,Q,de,Ie,L,k,ae,We,Pe,q,be),w(se,Ce),ge===se&&he===Ce){if(re)return void jt(se,Ce);K&&E(se,Ce)}}}function Yt(se,Ce,We){We===void 0&&(We=0),I({touched:!0,CX:se,CY:Ce,lastCX:se,lastCY:Ce,lastX:V,lastY:Q,lastScale:ae,touchLength:We,touchTime:Date.now()})}function kt(se){I({maskTouched:!0,CX:se.clientX,CY:se.clientY,lastX:V,lastY:Q})}no(Mi?void 0:"mousemove",function(se){se.preventDefault(),wt(se.clientX,se.clientY)}),no(Mi?void 0:"mouseup",function(se){yt(se.clientX,se.clientY)}),no(Mi?"touchmove":void 0,function(se){se.preventDefault();var Ce=Ww(se);wt.apply(void 0,Ce)},{passive:!1}),no(Mi?"touchend":void 0,function(se){var Ce=se.changedTouches[0];yt(Ce.clientX,Ce.clientY)},{passive:!1}),no("resize",qd(function(){G&&!re&&(I(hg(j,C,q)),N())},{maxWait:8})),wy(function(){T&&A(Nn({scale:ae,rotate:q},It))},[T]);var Rt=function(se,Ce,We,Jt,Xe,te,xe,ye,Be,He){var $e=function(_t,Un,on,Xn,Qn){var In=_.useRef(!1),Dn=Bh({lead:!0,scale:on}),vn=Dn[0],wn=vn.lead,_n=vn.scale,en=Dn[1],ee=qd(function(Te){try{return Qn(!0),en({lead:!1,scale:Te}),Promise.resolve()}catch(De){return Promise.reject(De)}},{wait:Xn});return wy(function(){In.current?(Qn(!1),en({lead:!0}),ee(on)):In.current=!0},[on]),wn?[_t*_n,Un*_n,on/_n]:[_t*on,Un*on,1]}(te,xe,ye,Be,He),ot=$e[0],it=$e[1],mn=$e[2],mt=function(_t,Un,on,Xn,Qn){var In=_.useState(w8),Dn=In[0],vn=In[1],wn=_.useState(0),_n=wn[0],en=wn[1],ee=_.useRef(),Te=ya({OK:function(){return _t&&en(4)}});function De(ze){Qn(!1),en(ze)}return _.useEffect(function(){if(ee.current||(ee.current=Date.now()),on){if(function(ze,gt){var ht=ze&&ze.current;if(ht&&ht.nodeType===1){var tt=ht.getBoundingClientRect();gt({T:tt.top,L:tt.left,W:tt.width,H:tt.height,FIT:ht.tagName==="IMG"?getComputedStyle(ht).objectFit:void 0})}}(Un,vn),_t)return Date.now()-ee.current<250?(en(1),requestAnimationFrame(function(){en(2),requestAnimationFrame(function(){return De(3)})}),void setTimeout(Te.OK,Xn)):void en(4);De(5)}},[_t,on]),[_n,Dn]}(se,Ce,We,Be,He),kn=mt[0],lt=mt[1],An=lt.W,gn=lt.FIT,br=innerWidth/2,an=innerHeight/2,Cn=kn<3||kn>4;return[Cn?An?lt.L:br:Jt+(br-te*ye/2),Cn?An?lt.T:an:Xe+(an-xe*ye/2),ot,Cn&&gn?ot*(lt.H/An):it,kn===0?mn:Cn?An/(te*ye)||.01:mn,Cn?gn?1:0:1,kn,gn]}(c,l,G,V,Q,L,k,ae,d,function(se){return I({pause:se})}),Le=Rt[4],at=Rt[6],bt="transform "+d+"ms "+f,Et={className:p,onMouseDown:Mi?void 0:function(se){se.stopPropagation(),se.button===0&&Yt(se.clientX,se.clientY,0)},onTouchStart:Mi?function(se){se.stopPropagation(),Yt.apply(void 0,Ww(se))}:void 0,onWheel:function(se){if(!ce){var Ce=Wd(ae-se.deltaY/100/2,j/L);I({stopRaf:!0}),Me(Ce,se.clientX,se.clientY)}},style:{width:Rt[2]+"px",height:Rt[3]+"px",opacity:Rt[5],objectFit:at===4?void 0:Rt[7],transform:q?"rotate("+q+"deg)":void 0,transition:at>2?bt+", opacity "+d+"ms ease, height "+(at<4?d/2:at>4?d:0)+"ms "+f:void 0}};return Qe.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Mi&&T?kt:void 0,onTouchStart:Mi&&T?function(se){return kt(se.touches[0])}:void 0},Qe.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Le+", 0, 0, "+Le+", "+Rt[0]+", "+Rt[1]+")",transition:re||ke?void 0:bt,willChange:T?"transform":void 0}},n?Qe.createElement(S8,Nn({src:n,loaded:G,broken:P},Et,{onPhotoLoad:function(se){I(Nn({},se,se.loaded&&hg(se.naturalWidth||0,se.naturalHeight||0,q)))},loadingElement:y,brokenElement:v})):r&&r({attrs:Et,scale:Le,rotate:q})))}var Gw={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 C8(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,i=e.easing,s=e.photoClosable,a=e.maskClosable,o=a===void 0||a,l=e.maskOpacity,c=l===void 0?1:l,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,y=e.toolbarRender,v=e.className,g=e.maskClassName,E=e.photoClassName,b=e.photoWrapClassName,w=e.loadingElement,N=e.brokenElement,T=e.images,A=e.index,S=A===void 0?0:A,O=e.onIndexChange,I=e.visible,D=e.onClose,F=e.afterClose,W=e.portalContainer,j=Bh(Gw),$=j[0],C=j[1],R=_.useState(0),L=R[0],M=R[1],k=$.x,Y=$.touched,G=$.pause,P=$.lastCX,V=$.lastCY,Q=$.bg,re=Q===void 0?c:Q,le=$.lastBg,K=$.overlay,q=$.minimal,ae=$.scale,ge=$.rotate,he=$.onScale,de=$.onRotate,Ie=e.hasOwnProperty("index"),_e=Ie?S:L,Ee=Ie?O:M,Pe=_.useRef(_e),be=T.length,Ve=T[_e],ke=typeof n=="boolean"?n:be>n,ce=function(Le,at){var bt=_.useReducer(function(We){return!We},!1)[1],Et=_.useRef(0),se=function(We){var Jt=_.useRef(We);function Xe(te){Jt.current=te}return _.useMemo(function(){(function(te){Le?(te(Le),Et.current=1):Et.current=2})(Xe)},[We]),[Jt.current,Xe]}(Le),Ce=se[1];return[se[0],Et.current,function(){bt(),Et.current===2&&(Ce(!1),at&&at()),Et.current=0}]}(I,F),It=ce[0],Me=ce[1],wt=ce[2];wy(function(){if(It)return C({pause:!0,x:_e*-(innerWidth+qa)}),void(Pe.current=_e);C(Gw)},[It]);var st=ya({close:function(Le){de&&de(0),C({overlay:!0,lastBg:re}),D(Le)},changeIndex:function(Le,at){at===void 0&&(at=!1);var bt=ke?Pe.current+(Le-_e):Le,Et=be-1,se=vy(bt,0,Et),Ce=ke?bt:se,We=innerWidth+qa;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-We*Ce,pause:at}),Pe.current=Ce,Ee&&Ee(ke?Le<0?Et:Le>Et?0:Le:se)}}),z=st.close,X=st.changeIndex;function oe(Le){return Le?z():C({overlay:!K})}function we(){C({x:-(innerWidth+qa)*_e,lastCX:void 0,lastCY:void 0,pause:!0}),Pe.current=_e}function Ae(Le,at,bt,Et){Le==="x"?function(se){if(P!==void 0){var Ce=se-P,We=Ce;!ke&&(_e===0&&Ce>0||_e===be-1&&Ce<0)&&(We=Ce/2),C({touched:!0,lastCX:P,x:-(innerWidth+qa)*Pe.current+We,pause:!1})}else C({touched:!0,lastCX:se,x:k,pause:!1})}(at):Le==="y"&&function(se,Ce){if(V!==void 0){var We=c===null?null:vy(c,.01,c-Math.abs(se-V)/100/4);C({touched:!0,lastCY:V,bg:Ce===1?We:c,minimal:Ce===1})}else C({touched:!0,lastCY:se,bg:re,minimal:!0})}(bt,Et)}function Ge(Le,at){var bt=Le-(P??Le),Et=at-(V??at),se=!1;if(bt<-40)X(_e+1);else if(bt>40)X(_e-1);else{var Ce=-(innerWidth+qa)*Pe.current;Math.abs(Et)>100&&q&&f&&(se=!0,z()),C({touched:!1,x:Ce,lastCX:void 0,lastCY:void 0,bg:c,overlay:!!se||K})}}no("keydown",function(Le){if(I)switch(Le.key){case"ArrowLeft":X(_e-1,!0);break;case"ArrowRight":X(_e+1,!0);break;case"Escape":z()}});var Ot=function(Le,at,bt){return _.useMemo(function(){var Et=Le.length;return bt?Le.concat(Le).concat(Le).slice(Et+at-1,Et+at+2):Le.slice(Math.max(at-1,0),Math.min(at+2,Et+1))},[Le,at,bt])}(T,_e,ke);if(!It)return null;var Ke=K&&!Me,xn=I?re:le,jt=he&&de&&{images:T,index:_e,visible:I,onClose:z,onIndexChange:X,overlayVisible:Ke,overlay:Ve&&Ve.overlay,scale:ae,rotate:ge,onScale:he,onRotate:de},yt=r?r(Me):400,Yt=i?i(Me):Yw,kt=r?r(3):600,Rt=i?i(3):Yw;return Qe.createElement(g8,{className:"PhotoView-Portal"+(Ke?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Le){return Le.stopPropagation()},container:W},I&&Qe.createElement(x8,null),Qe.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(Me===1?" PhotoView-Slider__fadeIn":Me===2?" PhotoView-Slider__fadeOut":""),style:{background:xn?"rgba(0, 0, 0, "+xn+")":void 0,transitionTimingFunction:Yt,transitionDuration:(Y?0:yt)+"ms",animationDuration:yt+"ms"},onAnimationEnd:wt}),p&&Qe.createElement("div",{className:"PhotoView-Slider__BannerWrap"},Qe.createElement("div",{className:"PhotoView-Slider__Counter"},_e+1," / ",be),Qe.createElement("div",{className:"PhotoView-Slider__BannerRight"},y&&jt&&y(jt),Qe.createElement(y8,{className:"PhotoView-Slider__toolbarIcon",onClick:z}))),Ot.map(function(Le,at){var bt=ke||_e!==0?Pe.current-1+at:_e+at;return Qe.createElement(A8,{key:ke?Le.key+"/"+Le.src+"/"+bt:Le.key,item:Le,speed:yt,easing:Yt,visible:I,onReachMove:Ae,onReachUp:Ge,onPhotoTap:function(){return oe(s)},onMaskTap:function(){return oe(o)},wrapClassName:b,className:E,style:{left:(innerWidth+qa)*bt+"px",transform:"translate3d("+k+"px, 0px, 0)",transition:Y||G?void 0:"transform "+kt+"ms "+Rt},loadingElement:w,brokenElement:N,onPhotoResize:we,isActive:Pe.current===bt,expose:C})}),!Mi&&p&&Qe.createElement(Qe.Fragment,null,(ke||_e!==0)&&Qe.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return X(_e-1,!0)}},Qe.createElement(b8,null)),(ke||_e+1-1){var g=c.slice();return g.splice(v,1,y),void o({images:g})}o(function(E){return{images:E.images.concat(y)}})},remove:function(y){o(function(v){var g=v.images.filter(function(E){return E.key!==y});return{images:g,index:Math.min(g.length-1,f)}})},show:function(y){var v=c.findIndex(function(g){return g.key===y});o({visible:!0,index:v}),r&&r(!0,v,a)}}),p=ya({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(y){o({index:y}),n&&n(y,a)}}),m=_.useMemo(function(){return Nn({},a,h)},[a,h]);return Qe.createElement(pC.Provider,{value:m},t,Qe.createElement(C8,Nn({images:c,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},i)))}var gC=function(e){var t,n,r=e.src,i=e.render,s=e.overlay,a=e.width,o=e.height,l=e.triggers,c=l===void 0?["onClick"]:l,d=e.children,f=_.useContext(pC),h=(t=function(){return f.nextId()},(n=_.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=_.useRef(null);_.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),_.useEffect(function(){return function(){f.remove(h)}},[]);var m=ya({render:function(v){return i&&i(v)},show:function(v,g){f.show(h),function(E,b){if(d){var w=d.props[E];w&&w(b)}}(v,g)}}),y=_.useMemo(function(){var v={};return c.forEach(function(g){v[g]=m.show.bind(null,g)}),v},[]);return _.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:s,width:a,height:o})},[r]),d?_.Children.only(_.cloneElement(d,Nn({},y,{ref:p}))):null};/** + `),()=>{document.head.removeChild(d)}},[t]),u.jsx(G4,{isPresent:t,childRef:r,sizeRef:i,children:_.cloneElement(e,{ref:r})})}const Q4=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a})=>{const o=Dp(Z4),l=_.useId(),c=_.useCallback(f=>{o.set(f,!0);for(const h of o.values())if(!h)return;r&&r()},[o,r]),d=_.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c,register:f=>(o.set(f,!1),()=>o.delete(f))}),s?[Math.random(),c]:[n,c]);return _.useMemo(()=>{o.forEach((f,h)=>o.set(h,!1))},[n]),_.useEffect(()=>{!n&&!o.size&&r&&r()},[n]),a==="popLayout"&&(e=u.jsx(X4,{isPresent:n,children:e})),u.jsx(Pp.Provider,{value:d,children:e})};function Z4(){return new Map}function U2(e=!0){const t=_.useContext(Pp);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=_.useId();_.useEffect(()=>{e&&i(s)},[e]);const a=_.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const Yd=e=>e.key||"";function Ov(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const hb=typeof window<"u",$2=hb?_.useLayoutEffect:_.useEffect,js=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1})=>{const[o,l]=U2(a),c=_.useMemo(()=>Ov(e),[e]),d=a&&!o?[]:c.map(Yd),f=_.useRef(!0),h=_.useRef(c),p=Dp(()=>new Map),[m,y]=_.useState(c),[v,g]=_.useState(c);$2(()=>{f.current=!1,h.current=c;for(let w=0;w{const N=Yd(w),T=a&&!o?!1:c===v||d.includes(N),A=()=>{if(p.has(N))p.set(N,!0);else return;let S=!0;p.forEach(R=>{R||(S=!1)}),S&&(b==null||b(),g(h.current),a&&(l==null||l()),r&&r())};return u.jsx(Q4,{isPresent:T,initial:!f.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:T?void 0:A,children:w},N)})})},Rr=e=>e;let H2=Rr;const J4={useManualTiming:!1};function e6(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function o(c){s.has(c)&&(l.schedule(c),e()),c(a)}const l={schedule:(c,d=!1,f=!1)=>{const p=f&&r?t:n;return d&&s.add(c),p.has(c)||p.add(c),c},cancel:c=>{n.delete(c),s.delete(c)},process:c=>{if(a=c,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(o),t.clear(),r=!1,i&&(i=!1,l.process(c))}};return l}const Wd=["read","resolveKeyframes","update","preRender","render","postRender"],t6=40;function z2(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=Wd.reduce((g,E)=>(g[E]=e6(s),g),{}),{read:o,resolveKeyframes:l,update:c,preRender:d,render:f,postRender:h}=a,p=()=>{const g=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,t6),1),i.timestamp=g,i.isProcessing=!0,o.process(i),l.process(i),c.process(i),d.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Wd.reduce((g,E)=>{const b=a[E];return g[E]=(w,N=!1,T=!1)=>(n||m(),b.schedule(w,N,T)),g},{}),cancel:g=>{for(let E=0;ELv[e].some(n=>!!t[n])};function n6(e){for(const t in e)rl[t]={...rl[t],...e[t]}}const r6=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 Lh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||r6.has(e)}let K2=e=>!Lh(e);function Y2(e){e&&(K2=t=>t.startsWith("on")?!Lh(t):e(t))}try{Y2(require("@emotion/is-prop-valid").default)}catch{}function i6(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(K2(i)||n===!0&&Lh(i)||!t&&!Lh(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function s6({children:e,isValidProp:t,...n}){t&&Y2(t),n={..._.useContext(Eu),...n},n.isStatic=Dp(()=>n.isStatic);const r=_.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return u.jsx(Eu.Provider,{value:r,children:e})}function a6(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const jp=_.createContext({});function xu(e){return typeof e=="string"||Array.isArray(e)}function Bp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const pb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mb=["initial",...pb];function Fp(e){return Bp(e.animate)||mb.some(t=>xu(e[t]))}function W2(e){return!!(Fp(e)||e.variants)}function o6(e,t){if(Fp(e)){const{initial:n,animate:r}=e;return{initial:n===!1||xu(n)?n:void 0,animate:xu(r)?r:void 0}}return e.inherit!==!1?t:{}}function l6(e){const{initial:t,animate:n}=o6(e,_.useContext(jp));return _.useMemo(()=>({initial:t,animate:n}),[Mv(t),Mv(n)])}function Mv(e){return Array.isArray(e)?e.join(" "):e}const c6=Symbol.for("motionComponentSymbol");function No(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function u6(e,t,n){return _.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):No(n)&&(n.current=r))},[t])}const gb=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),d6="framerAppearId",q2="data-"+gb(d6),{schedule:yb}=z2(queueMicrotask,!1),G2=_.createContext({});function f6(e,t,n,r,i){var s,a;const{visualElement:o}=_.useContext(jp),l=_.useContext(V2),c=_.useContext(Pp),d=_.useContext(Eu).reducedMotion,f=_.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d}));const h=f.current,p=_.useContext(G2);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&h6(f.current,n,i,p);const m=_.useRef(!1);_.useInsertionEffect(()=>{h&&m.current&&h.update(n,c)});const y=n[q2],v=_.useRef(!!y&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,y))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,y)));return $2(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),yb.render(h.render),v.current&&h.animationState&&h.animationState.animateChanges())}),_.useEffect(()=>{h&&(!v.current&&h.animationState&&h.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,y)}),v.current=!1))}),h}function h6(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:X2(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&No(o),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function X2(e){if(e)return e.options.allowProjection!==!1?e.projection:X2(e.parent)}function p6({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,a;e&&n6(e);function o(c,d){let f;const h={..._.useContext(Eu),...c,layoutId:m6(c)},{isStatic:p}=h,m=l6(c),y=r(c,p);if(!p&&hb){g6();const v=y6(h);f=v.MeasureLayout,m.visualElement=f6(i,y,h,t,v.ProjectionNode)}return u.jsxs(jp.Provider,{value:m,children:[f&&m.visualElement?u.jsx(f,{visualElement:m.visualElement,...h}):null,n(i,c,u6(y,m.visualElement,d),y,p,m.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${(a=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&a!==void 0?a:""})`}`;const l=_.forwardRef(o);return l[c6]=i,l}function m6({layoutId:e}){const t=_.useContext(fb).id;return t&&e!==void 0?t+"-"+e:e}function g6(e,t){_.useContext(V2).strict}function y6(e){const{drag:t,layout:n}=rl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const b6=["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 bb(e){return typeof e!="string"||e.includes("-")?!1:!!(b6.indexOf(e)>-1||/[A-Z]/u.test(e))}function Dv(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Eb(e,t,n,r){if(typeof t=="function"){const[i,s]=Dv(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Dv(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const ay=e=>Array.isArray(e),E6=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),x6=e=>ay(e)?e[e.length-1]||0:e,Gn=e=>!!(e&&e.getVelocity);function Uf(e){const t=Gn(e)?e.get():e;return E6(t)?t.toValue():t}function v6({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const a={latestValues:w6(r,i,s,e),renderState:t()};return n&&(a.onMount=o=>n({props:r,current:o,...a}),a.onUpdate=o=>n(o)),a}const Q2=e=>(t,n)=>{const r=_.useContext(jp),i=_.useContext(Pp),s=()=>v6(e,t,r,i);return n?s():Dp(s)};function w6(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Uf(s[h]);let{initial:a,animate:o}=e;const l=Fp(e),c=W2(e);t&&c&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?o:a;if(f&&typeof f!="boolean"&&!Bp(f)){const h=Array.isArray(f)?f:[f];for(let p=0;pt=>typeof t=="string"&&t.startsWith(e),J2=Z2("--"),_6=Z2("var(--"),xb=e=>_6(e)?T6.test(e.split("/*")[0].trim()):!1,T6=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,eA=(e,t)=>t&&typeof e=="number"?t.transform(e):e,is=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},vu={...Al,transform:e=>is(0,1,e)},qd={...Al,default:1},Qu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ms=Qu("deg"),Ci=Qu("%"),Ue=Qu("px"),N6=Qu("vh"),S6=Qu("vw"),Pv={...Ci,parse:e=>Ci.parse(e)/100,transform:e=>Ci.transform(e*100)},k6={borderWidth:Ue,borderTopWidth:Ue,borderRightWidth:Ue,borderBottomWidth:Ue,borderLeftWidth:Ue,borderRadius:Ue,radius:Ue,borderTopLeftRadius:Ue,borderTopRightRadius:Ue,borderBottomRightRadius:Ue,borderBottomLeftRadius:Ue,width:Ue,maxWidth:Ue,height:Ue,maxHeight:Ue,top:Ue,right:Ue,bottom:Ue,left:Ue,padding:Ue,paddingTop:Ue,paddingRight:Ue,paddingBottom:Ue,paddingLeft:Ue,margin:Ue,marginTop:Ue,marginRight:Ue,marginBottom:Ue,marginLeft:Ue,backgroundPositionX:Ue,backgroundPositionY:Ue},A6={rotate:ms,rotateX:ms,rotateY:ms,rotateZ:ms,scale:qd,scaleX:qd,scaleY:qd,scaleZ:qd,skew:ms,skewX:ms,skewY:ms,distance:Ue,translateX:Ue,translateY:Ue,translateZ:Ue,x:Ue,y:Ue,z:Ue,perspective:Ue,transformPerspective:Ue,opacity:vu,originX:Pv,originY:Pv,originZ:Ue},jv={...Al,transform:Math.round},vb={...k6,...A6,zIndex:jv,size:Ue,fillOpacity:vu,strokeOpacity:vu,numOctaves:jv},C6={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},I6=kl.length;function R6(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}}),tA=()=>({...Tb(),attrs:{}}),Nb=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nA(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const rA=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 iA(e,t,n,r){nA(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(rA.has(i)?i:gb(i),t.attrs[i])}const Mh={};function P6(e){Object.assign(Mh,e)}function sA(e,{layout:t,layoutId:n}){return Ka.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Mh[e]||e==="opacity")}function Sb(e,t,n){var r;const{style:i}=e,s={};for(const a in i)(Gn(i[a])||t.style&&Gn(t.style[a])||sA(a,e)||((r=n==null?void 0:n.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[a]=i[a]);return s}function aA(e,t,n){const r=Sb(e,t,n);for(const i in e)if(Gn(e[i])||Gn(t[i])){const s=kl.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function j6(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 Fv=["x","y","width","height","cx","cy","r"],B6={useVisualState:Q2({scrapeMotionValuesFromProps:aA,createRenderState:tA,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const o in i)if(Ka.has(o)){s=!0;break}}if(!s)return;let a=!t;if(t)for(let o=0;o{j6(n,r),Pt.render(()=>{_b(r,i,Nb(n.tagName),e.transformTemplate),iA(n,r)})})}})},F6={useVisualState:Q2({scrapeMotionValuesFromProps:Sb,createRenderState:Tb})};function oA(e,t,n){for(const r in t)!Gn(t[r])&&!sA(r,n)&&(e[r]=t[r])}function U6({transformTemplate:e},t){return _.useMemo(()=>{const n=Tb();return wb(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $6(e,t){const n=e.style||{},r={};return oA(r,n,e),Object.assign(r,U6(e,t)),r}function H6(e,t){const n={},r=$6(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function z6(e,t,n,r){const i=_.useMemo(()=>{const s=tA();return _b(s,t,Nb(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};oA(s,e.style,e),i.style={...s,...i.style}}return i}function V6(e=!1){return(n,r,i,{latestValues:s},a)=>{const l=(bb(n)?z6:H6)(r,s,a,n),c=i6(r,typeof n=="string",e),d=n!==_.Fragment?{...c,...l,ref:i}:{},{children:f}=r,h=_.useMemo(()=>Gn(f)?f.get():f,[f]);return _.createElement(n,{...d,children:h})}}function K6(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...bb(r)?B6:F6,preloadedFeatures:e,useRender:V6(i),createVisualElement:t,Component:r};return p6(a)}}function lA(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r($f===void 0&&Ii.set(Hn.isProcessing||J4.useManualTiming?Hn.timestamp:performance.now()),$f),set:e=>{$f=e,queueMicrotask(Y6)}};function Ab(e,t){e.indexOf(t)===-1&&e.push(t)}function Cb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ib{constructor(){this.subscriptions=[]}add(t){return Ab(this.subscriptions,t),()=>Cb(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s!isNaN(parseFloat(e));class q6{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ii.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),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=Ii.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=W6(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 Ib);const r=this.events[t].add(n);return t==="change"?()=>{r(),Pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Ii.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Uv)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Uv);return uA(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 wu(e,t){return new q6(e,t)}function G6(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wu(n))}function X6(e,t){const n=Up(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const o=x6(s[a]);G6(e,a,o)}}function Q6(e){return!!(Gn(e)&&e.add)}function oy(e,t){const n=e.getValue("willChange");if(Q6(n))return n.add(t)}function dA(e){return e.props[q2]}function Rb(e){let t;return()=>(t===void 0&&(t=e()),t)}const Z6=Rb(()=>window.ScrollTimeline!==void 0);class J6{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 r=0;r{if(Z6()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].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 e5 extends J6{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}const Xi=e=>e*1e3,Qi=e=>e/1e3;function Ob(e){return typeof e=="function"}function $v(e,t){e.timeline=t,e.onfinish=null}const Lb=e=>Array.isArray(e)&&typeof e[0]=="number",t5={linearEasing:void 0};function n5(e,t){const n=Rb(e);return()=>{var r;return(r=t5[t])!==null&&r!==void 0?r:n()}}const Dh=n5(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),il=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},fA=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ly={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bc([0,.65,.55,1]),circOut:bc([.55,0,1,.45]),backIn:bc([.31,.01,.66,-.59]),backOut:bc([.33,1.53,.69,.99])};function pA(e,t){if(e)return typeof e=="function"&&Dh()?fA(e,t):Lb(e)?bc(e):Array.isArray(e)?e.map(n=>pA(n,t)||ly.easeOut):ly[e]}const mA=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,r5=1e-7,i5=12;function s5(e,t,n,r,i){let s,a,o=0;do a=t+(n-t)/2,s=mA(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>r5&&++os5(s,0,1,e,n);return s=>s===0||s===1?s:mA(i(s),t,r)}const gA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yA=e=>t=>1-e(1-t),bA=Zu(.33,1.53,.69,.99),Mb=yA(bA),EA=gA(Mb),xA=e=>(e*=2)<1?.5*Mb(e):.5*(2-Math.pow(2,-10*(e-1))),Db=e=>1-Math.sin(Math.acos(e)),vA=yA(Db),wA=gA(Db),_A=e=>/^0[^.\s]+$/u.test(e);function a5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||_A(e):!0}const Pc=e=>Math.round(e*1e5)/1e5,Pb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function o5(e){return e==null}const l5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jb=(e,t)=>n=>!!(typeof n=="string"&&l5.test(n)&&n.startsWith(e)||t&&!o5(n)&&Object.prototype.hasOwnProperty.call(n,t)),TA=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,o]=r.match(Pb);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},c5=e=>is(0,255,e),tg={...Al,transform:e=>Math.round(c5(e))},ma={test:jb("rgb","red"),parse:TA("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+tg.transform(e)+", "+tg.transform(t)+", "+tg.transform(n)+", "+Pc(vu.transform(r))+")"};function u5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const cy={test:jb("#"),parse:u5,transform:ma.transform},So={test:jb("hsl","hue"),parse:TA("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ci.transform(Pc(t))+", "+Ci.transform(Pc(n))+", "+Pc(vu.transform(r))+")"},Wn={test:e=>ma.test(e)||cy.test(e)||So.test(e),parse:e=>ma.test(e)?ma.parse(e):So.test(e)?So.parse(e):cy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ma.transform(e):So.transform(e)},d5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function f5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Pb))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(d5))===null||n===void 0?void 0:n.length)||0)>0}const NA="number",SA="color",h5="var",p5="var(",Hv="${}",m5=/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 _u(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(m5,l=>(Wn.test(l)?(r.color.push(s),i.push(SA),n.push(Wn.parse(l))):l.startsWith(p5)?(r.var.push(s),i.push(h5),n.push(l)):(r.number.push(s),i.push(NA),n.push(parseFloat(l))),++s,Hv)).split(Hv);return{values:n,split:o,indexes:r,types:i}}function kA(e){return _u(e).values}function AA(e){const{split:t,types:n}=_u(e),r=t.length;return i=>{let s="";for(let a=0;atypeof e=="number"?0:e;function y5(e){const t=kA(e);return AA(e)(t.map(g5))}const Vs={test:f5,parse:kA,createTransformer:AA,getAnimatableNone:y5},b5=new Set(["brightness","contrast","saturate","opacity"]);function E5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Pb)||[];if(!r)return e;const i=n.replace(r,"");let s=b5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const x5=/\b([a-z-]*)\(.*?\)/gu,uy={...Vs,getAnimatableNone:e=>{const t=e.match(x5);return t?t.map(E5).join(" "):e}},v5={...vb,color:Wn,backgroundColor:Wn,outlineColor:Wn,fill:Wn,stroke:Wn,borderColor:Wn,borderTopColor:Wn,borderRightColor:Wn,borderBottomColor:Wn,borderLeftColor:Wn,filter:uy,WebkitFilter:uy},Bb=e=>v5[e];function CA(e,t){let n=Bb(e);return n!==uy&&(n=Vs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const w5=new Set(["auto","none","0"]);function _5(e,t,n){let r=0,i;for(;re===Al||e===Ue,Vv=(e,t)=>parseFloat(e.split(", ")[t]),Kv=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Vv(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?Vv(s[1],e):0}},T5=new Set(["x","y","z"]),N5=kl.filter(e=>!T5.has(e));function S5(e){const t=[];return N5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const sl={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:Kv(4,13),y:Kv(5,14)};sl.translateX=sl.x;sl.translateY=sl.y;const wa=new Set;let dy=!1,fy=!1;function IA(){if(fy){const e=Array.from(wa).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=S5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var o;(o=r.getValue(s))===null||o===void 0||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}fy=!1,dy=!1,wa.forEach(e=>e.complete()),wa.clear()}function RA(){wa.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fy=!0)})}function k5(){RA(),IA()}class Fb{constructor(t,n,r,i,s,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(wa.add(this),dy||(dy=!0,Pt.read(RA),Pt.resolveKeyframes(IA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),A5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function C5(e){const t=A5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function LA(e,t,n=1){const[r,i]=C5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return OA(a)?parseFloat(a):a}return xb(i)?LA(i,t,n+1):i}const MA=e=>t=>t.test(e),I5={test:e=>e==="auto",parse:e=>e},DA=[Al,Ue,Ci,ms,S6,N6,I5],Yv=e=>DA.find(MA(e));class PA extends Fb{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Wv=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Vs.test(e)||e==="0")&&!e.startsWith("url("));function R5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;ne!==null;function $p(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(L5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const M5=40;class jA{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ii.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>M5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&k5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ii.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:a,onComplete:o,onUpdate:l,isGenerator:c}=this.options;if(!c&&!O5(t,r,i,s))if(a)this.options.duration=0;else{l&&l($p(t,this.options,n)),o&&o(),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 hy=2e4;function BA(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=hy?1/0:t}const Wt=(e,t,n)=>e+(t-e)*n;function ng(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 D5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;i=ng(l,o,e+1/3),s=ng(l,o,e),a=ng(l,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function Ph(e,t){return n=>n>0?t:e}const rg=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},P5=[cy,ma,So],j5=e=>P5.find(t=>t.test(e));function qv(e){const t=j5(e);if(!t)return!1;let n=t.parse(e);return t===So&&(n=D5(n)),n}const Gv=(e,t)=>{const n=qv(e),r=qv(t);if(!n||!r)return Ph(e,t);const i={...n};return s=>(i.red=rg(n.red,r.red,s),i.green=rg(n.green,r.green,s),i.blue=rg(n.blue,r.blue,s),i.alpha=Wt(n.alpha,r.alpha,s),ma.transform(i))},B5=(e,t)=>n=>t(e(n)),Ju=(...e)=>e.reduce(B5),py=new Set(["none","hidden"]);function F5(e,t){return py.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function U5(e,t){return n=>Wt(e,t,n)}function Ub(e){return typeof e=="number"?U5:typeof e=="string"?xb(e)?Ph:Wn.test(e)?Gv:z5:Array.isArray(e)?FA:typeof e=="object"?Wn.test(e)?Gv:$5:Ph}function FA(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>Ub(s)(s,t[a]));return s=>{for(let a=0;a{for(const s in r)n[s]=r[s](i);return n}}function H5(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s{const n=Vs.createTransformer(t),r=_u(e),i=_u(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?py.has(e)&&!i.values.length||py.has(t)&&!r.values.length?F5(e,t):Ju(FA(H5(r,i),i.values),n):Ph(e,t)};function UA(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Wt(e,t,n):Ub(e)(e,t)}const V5=5;function $A(e,t,n){const r=Math.max(t-V5,0);return uA(n-e(r),t-r)}const rn={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},ig=.001;function K5({duration:e=rn.duration,bounce:t=rn.bounce,velocity:n=rn.velocity,mass:r=rn.mass}){let i,s,a=1-t;a=is(rn.minDamping,rn.maxDamping,a),e=is(rn.minDuration,rn.maxDuration,Qi(e)),a<1?(i=c=>{const d=c*a,f=d*e,h=d-n,p=my(c,a),m=Math.exp(-f);return ig-h/p*m},s=c=>{const f=c*a*e,h=f*n+n,p=Math.pow(a,2)*Math.pow(c,2)*e,m=Math.exp(-f),y=my(Math.pow(c,2),a);return(-i(c)+ig>0?-1:1)*((h-p)*m)/y}):(i=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-ig+d*f},s=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const o=5/e,l=W5(i,s,o);if(e=Xi(e),isNaN(l))return{stiffness:rn.stiffness,damping:rn.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const Y5=12;function W5(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function X5(e){let t={velocity:rn.velocity,stiffness:rn.stiffness,damping:rn.damping,mass:rn.mass,isResolvedFromDuration:!1,...e};if(!Xv(e,G5)&&Xv(e,q5))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*is(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:rn.mass,stiffness:i,damping:s}}else{const n=K5(e);t={...t,...n,mass:rn.mass},t.isResolvedFromDuration=!0}return t}function HA(e=rn.visualDuration,t=rn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=X5({...n,velocity:-Qi(n.velocity||0)}),m=h||0,y=c/(2*Math.sqrt(l*d)),v=a-s,g=Qi(Math.sqrt(l/d)),E=Math.abs(v)<5;r||(r=E?rn.restSpeed.granular:rn.restSpeed.default),i||(i=E?rn.restDelta.granular:rn.restDelta.default);let b;if(y<1){const N=my(g,y);b=T=>{const A=Math.exp(-y*g*T);return a-A*((m+y*g*v)/N*Math.sin(N*T)+v*Math.cos(N*T))}}else if(y===1)b=N=>a-Math.exp(-g*N)*(v+(m+g*v)*N);else{const N=g*Math.sqrt(y*y-1);b=T=>{const A=Math.exp(-y*g*T),S=Math.min(N*T,300);return a-A*((m+y*g*v)*Math.sinh(S)+N*v*Math.cosh(S))/N}}const w={calculatedDuration:p&&f||null,next:N=>{const T=b(N);if(p)o.done=N>=f;else{let A=0;y<1&&(A=N===0?Xi(m):$A(b,N,T));const S=Math.abs(A)<=r,R=Math.abs(a-T)<=i;o.done=S&&R}return o.value=o.done?a:T,o},toString:()=>{const N=Math.min(BA(w),hy),T=fA(A=>w.next(N*A).value,N,30);return N+"ms "+T}};return w}function Qv({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=S=>o!==void 0&&Sl,m=S=>o===void 0?l:l===void 0||Math.abs(o-S)-y*Math.exp(-S/r),b=S=>g+E(S),w=S=>{const R=E(S),I=b(S);h.done=Math.abs(R)<=c,h.value=h.done?g:I};let N,T;const A=S=>{p(h.value)&&(N=S,T=HA({keyframes:[h.value,m(h.value)],velocity:$A(b,S,h.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return A(0),{calculatedDuration:null,next:S=>{let R=!1;return!T&&N===void 0&&(R=!0,w(S),A(S)),N!==void 0&&S>=N?T.next(S-N):(!R&&w(S),h)}}}const Q5=Zu(.42,0,1,1),Z5=Zu(0,0,.58,1),zA=Zu(.42,0,.58,1),J5=e=>Array.isArray(e)&&typeof e[0]!="number",ej={linear:Rr,easeIn:Q5,easeInOut:zA,easeOut:Z5,circIn:Db,circInOut:wA,circOut:vA,backIn:Mb,backInOut:EA,backOut:bA,anticipate:xA},Zv=e=>{if(Lb(e)){H2(e.length===4);const[t,n,r,i]=e;return Zu(t,n,r,i)}else if(typeof e=="string")return ej[e];return e};function tj(e,t,n){const r=[],i=n||UA,s=e.length-1;for(let a=0;at[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=tj(t,r,i),l=o.length,c=d=>{if(a&&d1)for(;fc(is(e[0],e[s-1],d)):c}function rj(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=il(0,t,r);e.push(Wt(n,1,i))}}function ij(e){const t=[0];return rj(t,e.length-1),t}function sj(e,t){return e.map(n=>n*t)}function aj(e,t){return e.map(()=>t||zA).splice(0,e.length-1)}function jh({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=J5(r)?r.map(Zv):Zv(r),s={done:!1,value:t[0]},a=sj(n&&n.length===t.length?n:ij(t),e),o=nj(a,t,{ease:Array.isArray(i)?i:aj(t,i)});return{calculatedDuration:e,next:l=>(s.value=o(l),s.done=l>=e,s)}}const oj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Pt.update(t,!0),stop:()=>zs(t),now:()=>Hn.isProcessing?Hn.timestamp:Ii.now()}},lj={decay:Qv,inertia:Qv,tween:jh,keyframes:jh,spring:HA},cj=e=>e/100;class $b extends jA{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:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,a=(i==null?void 0:i.KeyframeResolver)||Fb,o=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new a(s,o,n,r,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:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=this.options,o=Ob(n)?n:lj[n]||jh;let l,c;o!==jh&&typeof t[0]!="number"&&(l=Ju(cj,UA(t[0],t[1])),t=[0,100]);const d=o({...this.options,keyframes:t});s==="mirror"&&(c=o({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=BA(d));const{calculatedDuration:f}=d,h=f+i,p=h*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,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:r}=this;if(!r){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:a,mapPercentToKeyframes:o,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return s.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:y,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 g=this.currentTime-h*(this.speed>=0?1:-1),E=this.speed>=0?g<0:g>d;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,w=s;if(p){const S=Math.min(this.currentTime,d)/f;let R=Math.floor(S),I=S%1;!I&&S>=1&&(I=1),I===1&&R--,R=Math.min(R,p+1),!!(R%2)&&(m==="reverse"?(I=1-I,y&&(I-=y/f)):m==="mirror"&&(w=a)),b=is(0,1,I)*f}const N=E?{done:!1,value:l[0]}:w.next(b);o&&(N.value=o(N.value));let{done:T}=N;!E&&c!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return A&&i!==void 0&&(N.value=$p(l,this.options,i)),v&&v(N.value),A&&this.finish(),N}get duration(){const{resolved:t}=this;return t?Qi(t.calculatedDuration):0}get time(){return Qi(this.currentTime)}set time(t){t=Xi(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=Qi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=oj,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),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=r??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 uj=new Set(["opacity","clipPath","filter","transform"]);function dj(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const d=pA(o,i);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:r,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"})}const fj=Rb(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Bh=10,hj=2e4;function pj(e){return Ob(e.type)||e.type==="spring"||!hA(e.ease)}function mj(e,t){const n=new $b({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&sthis.onKeyframesResolved(a,o),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:a,motionValue:o,name:l,startTime:c}=this.options;if(!o.owner||!o.owner.current)return!1;if(typeof s=="string"&&Dh()&&gj(s)&&(s=VA[s]),pj(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...y}=this.options,v=mj(t,y);t=v.keyframes,t.length===1&&(t[1]=t[0]),r=v.duration,i=v.times,s=v.ease,a="keyframes"}const d=dj(o.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?($v(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;o.set($p(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Qi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Qi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Xi(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:r}=n;r.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 Rr;const{animation:r}=n;$v(r,t)}return Rr}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:r,duration:i,type:s,ease:a,times:o}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:d,onComplete:f,element:h,...p}=this.options,m=new $b({...p,keyframes:r,duration:i,type:s,ease:a,times:o,isGenerator:!0}),y=Xi(this.time);c.setWithVelocity(m.sample(y-Bh).value,m.sample(y).value,Bh)}const{onStop:l}=this.options;l&&l(),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:r,repeatDelay:i,repeatType:s,damping:a,type:o}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return fj()&&r&&uj.has(r)&&!l&&!c&&!i&&s!=="mirror"&&a!==0&&o!=="inertia"}}const yj={type:"spring",stiffness:500,damping:25,restSpeed:10},bj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ej={type:"keyframes",duration:.8},xj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vj=(e,{keyframes:t})=>t.length>2?Ej:Ka.has(e)?e.startsWith("scale")?bj(t[1]):yj:xj;function wj({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Hb=(e,t,n,r={},i,s)=>a=>{const o=kb(r,e)||{},l=o.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Xi(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:h=>{t.set(h),o.onUpdate&&o.onUpdate(h)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:s?void 0:i};wj(o)||(d={...d,...vj(e,d)}),d.duration&&(d.duration=Xi(d.duration)),d.repeatDelay&&(d.repeatDelay=Xi(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&&!s&&t.get()!==void 0){const h=$p(d.keyframes,o);if(h!==void 0)return Pt.update(()=>{d.onUpdate(h),d.onComplete()}),new e5([])}return!s&&Jv.supports(d)?new Jv(d):new $b(d)};function _j({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function KA(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:a=e.getDefaultTransition(),transitionEnd:o,...l}=t;r&&(a=r);const c=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in l){const h=e.getValue(f,(s=e.latestValues[f])!==null&&s!==void 0?s:null),p=l[f];if(p===void 0||d&&_j(d,f))continue;const m={delay:n,...kb(a||{},f)};let y=!1;if(window.MotionHandoffAnimation){const g=dA(e);if(g){const E=window.MotionHandoffAnimation(g,f,Pt);E!==null&&(m.startTime=E,y=!0)}}oy(e,f),h.start(Hb(f,h,p,e.shouldReduceMotion&&cA.has(f)?{type:!1}:m,e,y));const v=h.animation;v&&c.push(v)}return o&&Promise.all(c).then(()=>{Pt.update(()=>{o&&X6(e,o)})}),c}function gy(e,t,n={}){var r;const i=Up(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const a=i?()=>Promise.all(KA(e,i,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return Tj(e,t,d+c,f,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,d]=l==="beforeChildren"?[a,o]:[o,a];return c().then(()=>d())}else return Promise.all([a(),o(n.delay)])}function Tj(e,t,n=0,r=0,i=1,s){const a=[],o=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>o-c*r;return Array.from(e.variantChildren).sort(Nj).forEach((c,d)=>{c.notify("AnimationStart",t),a.push(gy(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(a)}function Nj(e,t){return e.sortNodePosition(t)}function Sj(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>gy(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=gy(e,t,n);else{const i=typeof t=="function"?Up(e,t,n.custom):t;r=Promise.all(KA(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const kj=mb.length;function YA(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?YA(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:r})=>Sj(e,n,r)))}function Rj(e){let t=Ij(e),n=ew(),r=!0;const i=l=>(c,d)=>{var f;const h=Up(e,d,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:m,...y}=h;c={...c,...y,...m}}return c};function s(l){t=l(e)}function a(l){const{props:c}=e,d=YA(e.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let v=0;vm&&w,R=!1;const I=Array.isArray(b)?b:[b];let D=I.reduce(i(g),{});N===!1&&(D={});const{prevResolvedValues:F={}}=E,W={...F,...D},j=O=>{S=!0,h.has(O)&&(R=!0,h.delete(O)),E.needsAnimating[O]=!0;const L=e.getValue(O);L&&(L.liveStyle=!1)};for(const O in W){const L=D[O],M=F[O];if(p.hasOwnProperty(O))continue;let k=!1;ay(L)&&ay(M)?k=!lA(L,M):k=L!==M,k?L!=null?j(O):h.add(O):L!==void 0&&h.has(O)?j(O):E.protectedKeys[O]=!0}E.prevProp=b,E.prevResolvedValues=D,E.isActive&&(p={...p,...D}),r&&e.blockInitialAnimation&&(S=!1),S&&(!(T&&A)||R)&&f.push(...I.map(O=>({animation:O,options:{type:g}})))}if(h.size){const v={};h.forEach(g=>{const E=e.getBaseTarget(g),b=e.getValue(g);b&&(b.liveStyle=!0),v[g]=E??null}),f.push({animation:v})}let y=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function o(l,c){var d;if(n[l].isActive===c)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(l,c)}),n[l].isActive=c;const f=a(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>n,reset:()=>{n=ew(),r=!0}}}function Oj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!lA(t,e):!1}function ea(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ew(){return{animate:ea(!0),whileInView:ea(),whileHover:ea(),whileTap:ea(),whileDrag:ea(),whileFocus:ea(),exit:ea()}}class Gs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Lj extends Gs{constructor(t){super(t),t.animationState||(t.animationState=Rj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bp(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 Mj=0;class Dj extends Gs{constructor(){super(...arguments),this.id=Mj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Pj={animation:{Feature:Lj},exit:{Feature:Dj}},ni={x:!1,y:!1};function WA(){return ni.x||ni.y}function jj(e){return e==="x"||e==="y"?ni[e]?null:(ni[e]=!0,()=>{ni[e]=!1}):ni.x||ni.y?null:(ni.x=ni.y=!0,()=>{ni.x=ni.y=!1})}const zb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Tu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ed(e){return{point:{x:e.pageX,y:e.pageY}}}const Bj=e=>t=>zb(t)&&e(t,ed(t));function jc(e,t,n,r){return Tu(e,t,Bj(n),r)}const tw=(e,t)=>Math.abs(e-t);function Fj(e,t){const n=tw(e.x,t.x),r=tw(e.y,t.y);return Math.sqrt(n**2+r**2)}class qA{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!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=ag(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=Fj(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:y}=Hn;this.history.push({...m,timestamp:y});const{onStart:v,onMove:g}=this.handlers;h||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=sg(h,this.transformPagePoint),Pt.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:y}=this.handlers;if(this.dragSnapToOrigin&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=ag(f.type==="pointercancel"?this.lastMoveEventInfo:sg(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,v),m&&m(f,v)},!zb(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const a=ed(t),o=sg(a,this.transformPagePoint),{point:l}=o,{timestamp:c}=Hn;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,ag(o,this.history)),this.removeListeners=Ju(jc(this.contextWindow,"pointermove",this.handlePointerMove),jc(this.contextWindow,"pointerup",this.handlePointerUp),jc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),zs(this.updatePoint)}}function sg(e,t){return t?{point:t(e.point)}:e}function nw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ag({point:e},t){return{point:e,delta:nw(e,GA(t)),offset:nw(e,Uj(t)),velocity:$j(t,.1)}}function Uj(e){return e[0]}function GA(e){return e[e.length-1]}function $j(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=GA(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Xi(t)));)n--;if(!r)return{x:0,y:0};const s=Qi(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const XA=1e-4,Hj=1-XA,zj=1+XA,QA=.01,Vj=0-QA,Kj=0+QA;function Mr(e){return e.max-e.min}function Yj(e,t,n){return Math.abs(e-t)<=n}function rw(e,t,n,r=.5){e.origin=r,e.originPoint=Wt(t.min,t.max,e.origin),e.scale=Mr(n)/Mr(t),e.translate=Wt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Hj&&e.scale<=zj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Vj&&e.translate<=Kj||isNaN(e.translate))&&(e.translate=0)}function Bc(e,t,n,r){rw(e.x,t.x,n.x,r?r.originX:void 0),rw(e.y,t.y,n.y,r?r.originY:void 0)}function iw(e,t,n){e.min=n.min+t.min,e.max=e.min+Mr(t)}function Wj(e,t,n){iw(e.x,t.x,n.x),iw(e.y,t.y,n.y)}function sw(e,t,n){e.min=t.min-n.min,e.max=e.min+Mr(t)}function Fc(e,t,n){sw(e.x,t.x,n.x),sw(e.y,t.y,n.y)}function qj(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Wt(n,e,r.max):Math.min(e,n)),e}function aw(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 Gj(e,{top:t,left:n,bottom:r,right:i}){return{x:aw(e.x,n,i),y:aw(e.y,t,r)}}function ow(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=il(t.min,t.max-r,e.min):r>i&&(n=il(e.min,e.max-i,t.min)),is(0,1,n)}function Zj(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 yy=.35;function Jj(e=yy){return e===!1?e=0:e===!0&&(e=yy),{x:lw(e,"left","right"),y:lw(e,"top","bottom")}}function lw(e,t,n){return{min:cw(e,t),max:cw(e,n)}}function cw(e,t){return typeof e=="number"?e:e[t]||0}const uw=()=>({translate:0,scale:1,origin:0,originPoint:0}),ko=()=>({x:uw(),y:uw()}),dw=()=>({min:0,max:0}),un=()=>({x:dw(),y:dw()});function Fr(e){return[e("x"),e("y")]}function ZA({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function eB({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function tB(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function og(e){return e===void 0||e===1}function by({scale:e,scaleX:t,scaleY:n}){return!og(e)||!og(t)||!og(n)}function sa(e){return by(e)||JA(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function JA(e){return fw(e.x)||fw(e.y)}function fw(e){return e&&e!=="0%"}function Fh(e,t,n){const r=e-n,i=t*r;return n+i}function hw(e,t,n,r,i){return i!==void 0&&(e=Fh(e,i,r)),Fh(e,n,r)+t}function Ey(e,t=0,n=1,r,i){e.min=hw(e.min,t,n,r,i),e.max=hw(e.max,t,n,r,i)}function eC(e,{x:t,y:n}){Ey(e.x,t.translate,t.scale,t.originPoint),Ey(e.y,n.translate,n.scale,n.originPoint)}const pw=.999999999999,mw=1.0000000000001;function nB(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let o=0;opw&&(t.x=1),t.ypw&&(t.y=1)}function Ao(e,t){e.min=e.min+t,e.max=e.max+t}function gw(e,t,n,r,i=.5){const s=Wt(e.min,e.max,i);Ey(e,t,n,s,r)}function Co(e,t){gw(e.x,t.x,t.scaleX,t.scale,t.originX),gw(e.y,t.y,t.scaleY,t.scale,t.originY)}function tC(e,t){return ZA(tB(e.getBoundingClientRect(),t))}function rB(e,t,n){const r=tC(e,n),{scroll:i}=t;return i&&(Ao(r.x,i.offset.x),Ao(r.y,i.offset.y)),r}const nC=({current:e})=>e?e.ownerDocument.defaultView:null,iB=new WeakMap;class sB{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=un(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ed(d).point)},s=(d,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jj(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),Fr(v=>{let g=this.getAxisMotionValue(v).get()||0;if(Ci.test(g)){const{projection:E}=this.visualElement;if(E&&E.layout){const b=E.layout.layoutBox[v];b&&(g=Mr(b)*(parseFloat(g)/100))}}this.originPoint[v]=g}),m&&Pt.postRender(()=>m(d,f)),oy(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:v}=f;if(p&&this.currentDirection===null){this.currentDirection=aB(v),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),y&&y(d,f)},o=(d,f)=>this.stop(d,f),l=()=>Fr(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new qA(t,{onSessionStart:i,onStart:s,onMove:a,onSessionEnd:o,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:nC(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Pt.postRender(()=>s(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:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Gd(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=qj(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=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,s=this.constraints;n&&No(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Gj(i.layoutBox,n):this.constraints=!1,this.elastic=Jj(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Fr(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Zj(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!No(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=rB(r,i.root,this.visualElement.getTransformPagePoint());let a=Xj(i.layout.layoutBox,s);if(n){const o=n(eB(a));this.hasMutatedConstraints=!!o,o&&(a=ZA(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),l=this.constraints||{},c=Fr(d=>{if(!Gd(d,n,this.currentDirection))return;let f=l&&l[d]||{};a&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(d,m)});return Promise.all(c).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return oy(this.visualElement,t),r.start(Hb(t,r,0,n,this.visualElement,!1))}stopAnimation(){Fr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Fr(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()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Fr(n=>{const{drag:r}=this.getProps();if(!Gd(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[n];s.set(t[n]-Wt(a,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!No(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Fr(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const l=o.get();i[a]=Qj({min:l,max:l},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Fr(a=>{if(!Gd(a,t,null))return;const o=this.getAxisMotionValue(a),{min:l,max:c}=this.constraints[a];o.set(Wt(l,c,i[a]))})}addListeners(){if(!this.visualElement.current)return;iB.set(this.visualElement,this);const t=this.visualElement.current,n=jc(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();No(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Pt.read(r);const a=Tu(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Fr(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=l[d].translate,f.set(f.get()+l[d].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=yy,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function Gd(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function aB(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class oB extends Gs{constructor(t){super(t),this.removeGroupControls=Rr,this.removeListeners=Rr,this.controls=new sB(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rr}unmount(){this.removeGroupControls(),this.removeListeners()}}const yw=e=>(t,n)=>{e&&Pt.postRender(()=>e(t,n))};class lB extends Gs{constructor(){super(...arguments),this.removePointerDownListener=Rr}onPointerDown(t){this.session=new qA(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:yw(t),onStart:yw(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&Pt.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=jc(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 Hf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function bw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const tc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ue.test(e))e=parseFloat(e);else return e;const n=bw(e,t.target.x),r=bw(e,t.target.y);return`${n}% ${r}%`}},cB={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Vs.parse(e);if(i.length>5)return r;const s=Vs.createTransformer(e),a=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=o,i[1+a]/=l;const c=Wt(o,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=c),typeof i[3+a]=="number"&&(i[3+a]/=c),s(i)}};class uB extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;P6(dB),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),Hf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,a=r.projection;return a&&(a.isPresent=s,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||Pt.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),yb.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function rC(e){const[t,n]=U2(),r=_.useContext(fb);return u.jsx(uB,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(G2),isPresent:t,safeToRemove:n})}const dB={borderRadius:{...tc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:tc,borderTopRightRadius:tc,borderBottomLeftRadius:tc,borderBottomRightRadius:tc,boxShadow:cB};function fB(e,t,n){const r=Gn(e)?e:wu(e);return r.start(Hb("",r,t,n)),r.animation}function hB(e){return e instanceof SVGElement&&e.tagName!=="svg"}const pB=(e,t)=>e.depth-t.depth;class mB{constructor(){this.children=[],this.isDirty=!1}add(t){Ab(this.children,t),this.isDirty=!0}remove(t){Cb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(pB),this.isDirty=!1,this.children.forEach(t)}}function gB(e,t){const n=Ii.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(zs(r),e(s-t))};return Pt.read(r,!0),()=>zs(r)}const iC=["TopLeft","TopRight","BottomLeft","BottomRight"],yB=iC.length,Ew=e=>typeof e=="string"?parseFloat(e):e,xw=e=>typeof e=="number"||Ue.test(e);function bB(e,t,n,r,i,s){i?(e.opacity=Wt(0,n.opacity!==void 0?n.opacity:1,EB(r)),e.opacityExit=Wt(t.opacity!==void 0?t.opacity:1,0,xB(r))):s&&(e.opacity=Wt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;art?1:n(il(e,t,r))}function ww(e,t){e.min=t.min,e.max=t.max}function Br(e,t){ww(e.x,t.x),ww(e.y,t.y)}function _w(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Tw(e,t,n,r,i){return e-=t,e=Fh(e,1/n,r),i!==void 0&&(e=Fh(e,1/i,r)),e}function vB(e,t=0,n=1,r=.5,i,s=e,a=e){if(Ci.test(t)&&(t=parseFloat(t),t=Wt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=Wt(s.min,s.max,r);e===s&&(o-=t),e.min=Tw(e.min,t,n,o,i),e.max=Tw(e.max,t,n,o,i)}function Nw(e,t,[n,r,i],s,a){vB(e,t[n],t[r],t[i],t.scale,s,a)}const wB=["x","scaleX","originX"],_B=["y","scaleY","originY"];function Sw(e,t,n,r){Nw(e.x,t,wB,n?n.x:void 0,r?r.x:void 0),Nw(e.y,t,_B,n?n.y:void 0,r?r.y:void 0)}function kw(e){return e.translate===0&&e.scale===1}function aC(e){return kw(e.x)&&kw(e.y)}function Aw(e,t){return e.min===t.min&&e.max===t.max}function TB(e,t){return Aw(e.x,t.x)&&Aw(e.y,t.y)}function Cw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oC(e,t){return Cw(e.x,t.x)&&Cw(e.y,t.y)}function Iw(e){return Mr(e.x)/Mr(e.y)}function Rw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class NB{constructor(){this.members=[]}add(t){Ab(this.members,t),t.scheduleRender()}remove(t){if(Cb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function SB(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const o=e.x.scale*t.x,l=e.y.scale*t.y;return(o!==1||l!==1)&&(r+=`scale(${o}, ${l})`),r||"none"}const aa={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ec=typeof window<"u"&&window.MotionDebug!==void 0,lg=["","X","Y","Z"],kB={visibility:"hidden"},Ow=1e3;let AB=0;function cg(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function lC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=dA(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Pt,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&lC(r)}function cC({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},o=t==null?void 0:t()){this.id=AB++,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,Ec&&(aa.totalNodes=aa.resolvedTargetDeltas=aa.recalculatedProjection=0),this.nodes.forEach(RB),this.nodes.forEach(PB),this.nodes.forEach(jB),this.nodes.forEach(OB),Ec&&window.MotionDebug.record(aa)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=gB(h,250),Hf.hasAnimatedSinceResize&&(Hf.hasAnimatedSinceResize=!1,this.nodes.forEach(Mw))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||HB,{onLayoutAnimationStart:v,onLayoutAnimationComplete:g}=d.getProps(),E=!this.targetLayout||!oC(this.targetLayout,m)||p,b=!h&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||h&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,b);const w={...kb(y,"layout"),onPlay:v,onComplete:g};(d.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w)}else h||Mw(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,zs(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(BB),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&&lC(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 l=0;l{const N=w/1e3;Dw(f.x,a.x,N),Dw(f.y,a.y,N),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fc(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UB(this.relativeTarget,this.relativeTargetOrigin,h,N),b&&TB(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=un()),Br(b,this.relativeTarget)),y&&(this.animationValues=d,bB(d,c,this.latestValues,N,E,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},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&&(zs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Pt.update(()=>{Hf.hasAnimatedSinceResize=!0,this.currentAnimation=fB(0,Ow,{...a,onUpdate:o=>{this.mixTargetDelta(o),a.onUpdate&&a.onUpdate(o)},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(Ow),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:l,layout:c,latestValues:d}=a;if(!(!o||!l||!c)){if(this!==a&&this.layout&&c&&uC(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||un();const f=Mr(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+f;const h=Mr(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+h}Br(o,l),Co(o,d),Bc(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new NB),this.sharedNodes.get(a).add(o);const c=o.options.initialPromotionConfig;o.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(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:o,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(o=!0),!o)return;const c={};l.z&&cg("z",a,c,this.animationValues);for(let d=0;d{var o;return(o=a.currentAnimation)===null||o===void 0?void 0:o.stop()}),this.root.nodes.forEach(Lw),this.root.sharedNodes.clear()}}}function CB(e){e.updateLayout()}function IB(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:r,measuredBox:i}=e.layout,{animationType:s}=e.options,a=n.source!==e.layout.source;s==="size"?Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(h);h.min=r[f].min,h.max=h.min+p}):uC(s,n.layoutBox,r)&&Fr(f=>{const h=a?n.measuredBox[f]:n.layoutBox[f],p=Mr(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const o=ko();Bc(o,r,n.layoutBox);const l=ko();a?Bc(l,e.applyTransform(i,!0),n.measuredBox):Bc(l,r,n.layoutBox);const c=!aC(o);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=un();Fc(m,n.layoutBox,h.layoutBox);const y=un();Fc(y,r,p.layoutBox),oC(m,y)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=m,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:o,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function RB(e){Ec&&aa.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 OB(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function LB(e){e.clearSnapshot()}function Lw(e){e.clearMeasurements()}function MB(e){e.isLayoutDirty=!1}function DB(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Mw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function PB(e){e.resolveTargetDelta()}function jB(e){e.calcProjection()}function BB(e){e.resetSkewAndRotation()}function FB(e){e.removeLeadSnapshot()}function Dw(e,t,n){e.translate=Wt(t.translate,0,n),e.scale=Wt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Pw(e,t,n,r){e.min=Wt(t.min,n.min,r),e.max=Wt(t.max,n.max,r)}function UB(e,t,n,r){Pw(e.x,t.x,n.x,r),Pw(e.y,t.y,n.y,r)}function $B(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const HB={duration:.45,ease:[.4,0,.1,1]},jw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Bw=jw("applewebkit/")&&!jw("chrome/")?Math.round:Rr;function Fw(e){e.min=Bw(e.min),e.max=Bw(e.max)}function zB(e){Fw(e.x),Fw(e.y)}function uC(e,t,n){return e==="position"||e==="preserve-aspect"&&!Yj(Iw(t),Iw(n),.2)}function VB(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const KB=cC({attachResizeListener:(e,t)=>Tu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ug={current:void 0},dC=cC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ug.current){const e=new KB({});e.mount(window),e.setOptions({layoutScroll:!0}),ug.current=e}return ug.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),YB={pan:{Feature:lB},drag:{Feature:oB,ProjectionNode:dC,MeasureLayout:rC}};function WB(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function fC(e,t){const n=WB(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Uw(e){return t=>{t.pointerType==="touch"||WA()||e(t)}}function qB(e,t,n={}){const[r,i,s]=fC(e,n),a=Uw(o=>{const{target:l}=o,c=t(o);if(typeof c!="function"||!l)return;const d=Uw(f=>{c(f),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,i)});return r.forEach(o=>{o.addEventListener("pointerenter",a,i)}),s}function $w(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Pt.postRender(()=>s(t,ed(t)))}class GB extends Gs{mount(){const{current:t}=this.node;t&&(this.unmount=qB(t,n=>($w(this.node,n,"Start"),r=>$w(this.node,r,"End"))))}unmount(){}}class XB extends Gs{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=Ju(Tu(this.node.current,"focus",()=>this.onFocus()),Tu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const hC=(e,t)=>t?e===t?!0:hC(e,t.parentElement):!1,QB=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ZB(e){return QB.has(e.tagName)||e.tabIndex!==-1}const xc=new WeakSet;function Hw(e){return t=>{t.key==="Enter"&&e(t)}}function dg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const JB=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Hw(()=>{if(xc.has(n))return;dg(n,"down");const i=Hw(()=>{dg(n,"up")}),s=()=>dg(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function zw(e){return zb(e)&&!WA()}function e8(e,t,n={}){const[r,i,s]=fC(e,n),a=o=>{const l=o.currentTarget;if(!zw(o)||xc.has(l))return;xc.add(l);const c=t(o),d=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!zw(p)||!xc.has(l))&&(xc.delete(l),typeof c=="function"&&c(p,{success:m}))},f=p=>{d(p,n.useGlobalTarget||hC(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return r.forEach(o=>{!ZB(o)&&o.getAttribute("tabindex")===null&&(o.tabIndex=0),(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),o.addEventListener("focus",c=>JB(c,i),i)}),s}function Vw(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Pt.postRender(()=>s(t,ed(t)))}class t8 extends Gs{mount(){const{current:t}=this.node;t&&(this.unmount=e8(t,n=>(Vw(this.node,n,"Start"),(r,{success:i})=>Vw(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const xy=new WeakMap,fg=new WeakMap,n8=e=>{const t=xy.get(e.target);t&&t(e)},r8=e=>{e.forEach(n8)};function i8({root:e,...t}){const n=e||document;fg.has(n)||fg.set(n,{});const r=fg.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(r8,{root:e,...t})),r[i]}function s8(e,t,n){const r=i8(t);return xy.set(e,n),r.observe(e),()=>{xy.delete(e),r.unobserve(e)}}const a8={some:0,all:1};class o8 extends Gs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:a8[i]},o=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),h=c?d:f;h&&h(l)};return s8(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(l8(t,n))&&this.startObserver()}unmount(){}}function l8({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const c8={inView:{Feature:o8},tap:{Feature:t8},focus:{Feature:XB},hover:{Feature:GB}},u8={layout:{ProjectionNode:dC,MeasureLayout:rC}},vy={current:null},pC={current:!1};function d8(){if(pC.current=!0,!!hb)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>vy.current=e.matches;e.addListener(t),t()}else vy.current=!1}const f8=[...DA,Wn,Vs],h8=e=>f8.find(MA(e)),Kw=new WeakMap;function p8(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Gn(i))e.addValue(r,i);else if(Gn(s))e.addValue(r,wu(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,wu(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Yw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class m8{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fb,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=Ii.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),pC.current||d8(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:vy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Kw.delete(this.current),this.projection&&this.projection.unmount(),zs(this.notifyUpdate),zs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ka.has(t),i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in rl){const n=rl[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):un()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=wu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(OA(i)||_A(i))?i=parseFloat(i):!h8(i)&&Vs.test(n)&&(i=CA(t,n)),this.setBaseTarget(t,Gn(i)?i.get():i)),Gn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const a=Eb(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(i=a[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Gn(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ib),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class mC extends m8{constructor(){super(...arguments),this.KeyframeResolver=PA}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Gn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function g8(e){return window.getComputedStyle(e)}class y8 extends mC{constructor(){super(...arguments),this.type="html",this.renderInstance=nA}readValueFromInstance(t,n){if(Ka.has(n)){const r=Bb(n);return r&&r.default||0}else{const r=g8(t),i=(J2(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return tC(t,n)}build(t,n,r){wb(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Sb(t,n,r)}}class b8 extends mC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=un}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ka.has(n)){const r=Bb(n);return r&&r.default||0}return n=rA.has(n)?n:gb(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return aA(t,n,r)}build(t,n,r){_b(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){iA(t,n,r,i)}mount(t){this.isSVGTag=Nb(t.tagName),super.mount(t)}}const E8=(e,t)=>bb(e)?new b8(t):new y8(t,{allowProjection:e!==_.Fragment}),x8=K6({...Pj,...c8,...YB,...u8},E8),$t=a6(x8);function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||/ServerSideRendering/.test(navigator&&navigator.userAgent)?_.useEffect:_.useLayoutEffect;function oo(e,t,n){var r=_.useRef(t);r.current=t,_.useEffect(function(){function i(s){r.current(s)}return e&&window.addEventListener(e,i,n),function(){e&&window.removeEventListener(e,i)}},[e])}var v8=["container"];function w8(e){var t=e.container,n=t===void 0?document.body:t,r=Hp(e,v8);return nl.createPortal(qe.createElement("div",An({},r)),n)}function _8(e){return qe.createElement("svg",An({width:"44",height:"44",viewBox:"0 0 768 768"},e),qe.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 T8(e){return qe.createElement("svg",An({width:"44",height:"44",viewBox:"0 0 768 768"},e),qe.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 N8(e){return qe.createElement("svg",An({width:"44",height:"44",viewBox:"0 0 768 768"},e),qe.createElement("path",{d:"M384 127.5l256.5 256.5-256.5 256.5-45-45 178.5-180h-390v-63h390l-178.5-180z"}))}function S8(){return _.useEffect(function(){var e=document.body.style,t=e.overflow;return e.overflow="hidden",function(){e.overflow=t}},[]),null}function qw(e){var t=e.touches[0],n=t.clientX,r=t.clientY;if(e.touches.length>=2){var i=e.touches[1],s=i.clientX,a=i.clientY;return[(n+s)/2,(r+a)/2,Math.sqrt(Math.pow(s-n,2)+Math.pow(a-r,2))]}return[n,r,0]}var xs=function(e,t,n,r){var i,s=n*t,a=(s-r)/2,o=e;return s<=r?(i=1,o=0):e>0&&a-e<=0?(i=2,o=a):e<0&&a+e<=0&&(i=3,o=-a),[i,o]};function hg(e,t,n,r,i,s,a,o,l,c){a===void 0&&(a=innerWidth/2),o===void 0&&(o=innerHeight/2),l===void 0&&(l=0),c===void 0&&(c=0);var d=xs(e,s,n,innerWidth)[0],f=xs(t,s,r,innerHeight),h=innerWidth/2,p=innerHeight/2;return{x:a-s/i*(a-(h+e))-h+(r/n>=3&&n*s===innerWidth?0:d?l/2:l),y:o-s/i*(o-(p+t))-p+(f[0]?c/2:c),lastCX:a,lastCY:o}}function Ty(e,t,n){var r=e%180!=0;return r?[n,t,r]:[t,n,r]}function pg(e,t,n){var r=Ty(n,innerWidth,innerHeight),i=r[0],s=r[1],a=0,o=i,l=s,c=e/t*s,d=t/e*i;return e=s?o=c:e>=i&&ti/s?l=d:t/e>=3&&!r[2]?a=((l=d)-s)/2:o=c,{width:o,height:l,x:0,y:a,pause:!0}}function Qd(e,t){var n=t.leading,r=n!==void 0&&n,i=t.maxWait,s=t.wait,a=s===void 0?i||0:s,o=_.useRef(e);o.current=e;var l=_.useRef(0),c=_.useRef(),d=function(){return c.current&&clearTimeout(c.current)},f=_.useCallback(function(){var h=[].slice.call(arguments),p=Date.now();function m(){l.current=p,d(),o.current.apply(null,h)}var y=l.current,v=p-y;if(y===0&&(r&&m(),l.current=p),i!==void 0){if(v>i)return void m()}else v=1&&s&&s())};d()}function d(){l=requestAnimationFrame(c)}}var A8={T:0,L:0,W:0,H:0,FIT:void 0},yC=function(){var e=_.useRef(!1);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),e},C8=["className"];function I8(e){var t=e.className,n=t===void 0?"":t,r=Hp(e,C8);return qe.createElement("div",An({className:"PhotoView__Spinner "+n},r),qe.createElement("svg",{viewBox:"0 0 32 32",width:"36",height:"36",fill:"white"},qe.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"}),qe.createElement("path",{d:"M16 0 A16 16 0 0 1 32 16 L28 16 A12 12 0 0 0 16 4z"})))}var R8=["src","loaded","broken","className","onPhotoLoad","loadingElement","brokenElement"];function O8(e){var t=e.src,n=e.loaded,r=e.broken,i=e.className,s=e.onPhotoLoad,a=e.loadingElement,o=e.brokenElement,l=Hp(e,R8),c=yC();return t&&!r?qe.createElement(qe.Fragment,null,qe.createElement("img",An({className:"PhotoView__Photo"+(i?" "+i:""),src:t,onLoad:function(d){var f=d.target;c.current&&s({loaded:!0,naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},onError:function(){c.current&&s({broken:!0})},draggable:!1,alt:""},l)),!n&&(a?qe.createElement("span",{className:"PhotoView__icon"},a):qe.createElement(I8,{className:"PhotoView__icon"}))):o?qe.createElement("span",{className:"PhotoView__icon"},typeof o=="function"?o({src:t}):o):null}var L8={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 M8(e){var t=e.item,n=t.src,r=t.render,i=t.width,s=i===void 0?0:i,a=t.height,o=a===void 0?0:a,l=t.originRef,c=e.visible,d=e.speed,f=e.easing,h=e.wrapClassName,p=e.className,m=e.style,y=e.loadingElement,v=e.brokenElement,g=e.onPhotoTap,E=e.onMaskTap,b=e.onReachMove,w=e.onReachUp,N=e.onPhotoResize,T=e.isActive,A=e.expose,S=Uh(L8),R=S[0],I=S[1],D=_.useRef(0),F=yC(),W=R.naturalWidth,j=W===void 0?s:W,$=R.naturalHeight,C=$===void 0?o:$,O=R.width,L=O===void 0?s:O,M=R.height,k=M===void 0?o:M,Y=R.loaded,G=Y===void 0?!n:Y,P=R.broken,V=R.x,Q=R.y,ne=R.touched,le=R.stopRaf,K=R.maskTouched,q=R.rotate,ae=R.scale,ye=R.CX,he=R.CY,de=R.lastX,Ie=R.lastY,_e=R.lastCX,xe=R.lastCY,je=R.lastScale,be=R.touchTime,Ve=R.touchLength,ke=R.pause,ce=R.reach,Nt=_a({onScale:function(se){return De(Xd(se))},onRotate:function(se){q!==se&&(A({rotate:se}),I(An({rotate:se},pg(j,C,se))))}});function De(se,Ce,Ke){ae!==se&&(A({scale:se}),I(An({scale:se},hg(V,Q,L,k,ae,se,Ce,Ke),se<=1&&{x:0,y:0})))}var xt=Qd(function(se,Ce,Ke){if(Ke===void 0&&(Ke=0),(ne||K)&&T){var on=Ty(q,L,k),Xe=on[0],re=on[1];if(Ke===0&&D.current===0){var Ee=Math.abs(se-ye)<=20,me=Math.abs(Ce-he)<=20;if(Ee&&me)return void I({lastCX:se,lastCY:Ce});D.current=Ee?Ce>he?3:2:1}var Me,$e=se-_e,He=Ce-xe;if(Ke===0){var ft=xs($e+de,ae,Xe,innerWidth)[0],at=xs(He+Ie,ae,re,innerHeight);Me=function(ht,In,ut,jn){return In&&ht===1||jn==="x"?"x":ut&&ht>1||jn==="y"?"y":void 0}(D.current,ft,at[0],ce),Me!==void 0&&b(Me,se,Ce,ae)}if(Me==="x"||K)return void I({reach:"x"});var ln=Xd(ae+(Ke-Ve)/100/2*ae,j/L,.2);A({scale:ln}),I(An({touchLength:Ke,reach:Me,scale:ln},hg(V,Q,L,k,ae,ln,se,Ce,$e,He)))}},{maxWait:8});function it(se){return!le&&!ne&&(F.current&&I(An({},se,{pause:c})),F.current)}var z,X,oe,ve,Ae,st,Xt,ze,an=(Ae=function(se){return it({x:se})},st=function(se){return it({y:se})},Xt=function(se){return F.current&&(A({scale:se}),I({scale:se})),!ne&&F.current},ze=_a({X:function(se){return Ae(se)},Y:function(se){return st(se)},S:function(se){return Xt(se)}}),function(se,Ce,Ke,on,Xe,re,Ee,me,Me,$e,He){var ft=Ty($e,Xe,re),at=ft[0],ln=ft[1],ht=xs(se,me,at,innerWidth),In=ht[0],ut=ht[1],jn=xs(Ce,me,ln,innerHeight),cn=jn[0],dr=jn[1],Zt=Date.now()-He;if(Zt>=200||me!==Ee||Math.abs(Me-Ee)>1){var fr=hg(se,Ce,Xe,re,Ee,me),Bt=fr.x,er=fr.y,Ot=In?ut:Bt!==se?Bt:null,vn=cn?dr:er!==Ce?er:null;return Ot!==null&&ua(se,Ot,ze.X),vn!==null&&ua(Ce,vn,ze.Y),void(me!==Ee&&ua(Ee,me,ze.S))}var tr=(se-Ke)/Zt,Rn=(Ce-on)/Zt,Bn=Math.sqrt(Math.pow(tr,2)+Math.pow(Rn,2)),wn=!1,_n=!1;(function(Tn,Jt){var en,gn=Tn,Fn=0,Nn=0,Tr=function(Te){en||(en=Te);var Pe=Te-en,nt=Math.sign(Tn),yt=-.001*nt,Lt=Math.sign(-gn)*Math.pow(gn,2)*2e-4,tn=gn*Pe+(yt+Lt)*Math.pow(Pe,2)/2;Fn+=tn,en=Te,nt*(gn+=(yt+Lt)*Pe)<=0?ee():Jt(Fn)?yn():ee()};function yn(){Nn=requestAnimationFrame(Tr)}function ee(){cancelAnimationFrame(Nn)}yn()})(Bn,function(Tn){var Jt=se+Tn*(tr/Bn),en=Ce+Tn*(Rn/Bn),gn=xs(Jt,Ee,at,innerWidth),Fn=gn[0],Nn=gn[1],Tr=xs(en,Ee,ln,innerHeight),yn=Tr[0],ee=Tr[1];if(Fn&&!wn&&(wn=!0,In?ua(Jt,Nn,ze.X):Gw(Nn,Jt+(Jt-Nn),ze.X)),yn&&!_n&&(_n=!0,cn?ua(en,ee,ze.Y):Gw(ee,en+(en-ee),ze.Y)),wn&&_n)return!1;var Te=wn||ze.X(Nn),Pe=_n||ze.Y(ee);return Te&&Pe})}),vt=(z=g,X=function(se,Ce){ce||De(ae!==1?1:Math.max(2,j/L),se,Ce)},oe=_.useRef(0),ve=Qd(function(){oe.current=0,z.apply(void 0,[].slice.call(arguments))},{wait:300}),function(){var se=[].slice.call(arguments);oe.current+=1,ve.apply(void 0,se),oe.current>=2&&(ve.cancel(),oe.current=0,X.apply(void 0,se))});function pt(se,Ce){if(D.current=0,(ne||K)&&T){I({touched:!1,maskTouched:!1,pause:!1,stopRaf:!1,reach:void 0});var Ke=Xd(ae,j/L);if(an(V,Q,de,Ie,L,k,ae,Ke,je,q,be),w(se,Ce),ye===se&&he===Ce){if(ne)return void vt(se,Ce);K&&E(se,Ce)}}}function jt(se,Ce,Ke){Ke===void 0&&(Ke=0),I({touched:!0,CX:se,CY:Ce,lastCX:se,lastCY:Ce,lastX:V,lastY:Q,lastScale:ae,touchLength:Ke,touchTime:Date.now()})}function Vt(se){I({maskTouched:!0,CX:se.clientX,CY:se.clientY,lastX:V,lastY:Q})}oo(Fi?void 0:"mousemove",function(se){se.preventDefault(),xt(se.clientX,se.clientY)}),oo(Fi?void 0:"mouseup",function(se){pt(se.clientX,se.clientY)}),oo(Fi?"touchmove":void 0,function(se){se.preventDefault();var Ce=qw(se);xt.apply(void 0,Ce)},{passive:!1}),oo(Fi?"touchend":void 0,function(se){var Ce=se.changedTouches[0];pt(Ce.clientX,Ce.clientY)},{passive:!1}),oo("resize",Qd(function(){G&&!ne&&(I(pg(j,C,q)),N())},{maxWait:8})),_y(function(){T&&A(An({scale:ae,rotate:q},Nt))},[T]);var Qt=function(se,Ce,Ke,on,Xe,re,Ee,me,Me,$e){var He=function(Bt,er,Ot,vn,tr){var Rn=_.useRef(!1),Bn=Uh({lead:!0,scale:Ot}),wn=Bn[0],_n=wn.lead,Tn=wn.scale,Jt=Bn[1],en=Qd(function(gn){try{return tr(!0),Jt({lead:!1,scale:gn}),Promise.resolve()}catch(Fn){return Promise.reject(Fn)}},{wait:vn});return _y(function(){Rn.current?(tr(!1),Jt({lead:!0}),en(Ot)):Rn.current=!0},[Ot]),_n?[Bt*Tn,er*Tn,Ot/Tn]:[Bt*Ot,er*Ot,1]}(re,Ee,me,Me,$e),ft=He[0],at=He[1],ln=He[2],ht=function(Bt,er,Ot,vn,tr){var Rn=_.useState(A8),Bn=Rn[0],wn=Rn[1],_n=_.useState(0),Tn=_n[0],Jt=_n[1],en=_.useRef(),gn=_a({OK:function(){return Bt&&Jt(4)}});function Fn(Nn){tr(!1),Jt(Nn)}return _.useEffect(function(){if(en.current||(en.current=Date.now()),Ot){if(function(Nn,Tr){var yn=Nn&&Nn.current;if(yn&&yn.nodeType===1){var ee=yn.getBoundingClientRect();Tr({T:ee.top,L:ee.left,W:ee.width,H:ee.height,FIT:yn.tagName==="IMG"?getComputedStyle(yn).objectFit:void 0})}}(er,wn),Bt)return Date.now()-en.current<250?(Jt(1),requestAnimationFrame(function(){Jt(2),requestAnimationFrame(function(){return Fn(3)})}),void setTimeout(gn.OK,vn)):void Jt(4);Fn(5)}},[Bt,Ot]),[Tn,Bn]}(se,Ce,Ke,Me,$e),In=ht[0],ut=ht[1],jn=ut.W,cn=ut.FIT,dr=innerWidth/2,Zt=innerHeight/2,fr=In<3||In>4;return[fr?jn?ut.L:dr:on+(dr-re*me/2),fr?jn?ut.T:Zt:Xe+(Zt-Ee*me/2),ft,fr&&cn?ft*(ut.H/jn):at,In===0?ln:fr?jn/(re*me)||.01:ln,fr?cn?1:0:1,In,cn]}(c,l,G,V,Q,L,k,ae,d,function(se){return I({pause:se})}),Le=Qt[4],Je=Qt[6],mt="transform "+d+"ms "+f,gt={className:p,onMouseDown:Fi?void 0:function(se){se.stopPropagation(),se.button===0&&jt(se.clientX,se.clientY,0)},onTouchStart:Fi?function(se){se.stopPropagation(),jt.apply(void 0,qw(se))}:void 0,onWheel:function(se){if(!ce){var Ce=Xd(ae-se.deltaY/100/2,j/L);I({stopRaf:!0}),De(Ce,se.clientX,se.clientY)}},style:{width:Qt[2]+"px",height:Qt[3]+"px",opacity:Qt[5],objectFit:Je===4?void 0:Qt[7],transform:q?"rotate("+q+"deg)":void 0,transition:Je>2?mt+", opacity "+d+"ms ease, height "+(Je<4?d/2:Je>4?d:0)+"ms "+f:void 0}};return qe.createElement("div",{className:"PhotoView__PhotoWrap"+(h?" "+h:""),style:m,onMouseDown:!Fi&&T?Vt:void 0,onTouchStart:Fi&&T?function(se){return Vt(se.touches[0])}:void 0},qe.createElement("div",{className:"PhotoView__PhotoBox",style:{transform:"matrix("+Le+", 0, 0, "+Le+", "+Qt[0]+", "+Qt[1]+")",transition:ne||ke?void 0:mt,willChange:T?"transform":void 0}},n?qe.createElement(O8,An({src:n,loaded:G,broken:P},gt,{onPhotoLoad:function(se){I(An({},se,se.loaded&&pg(se.naturalWidth||0,se.naturalHeight||0,q)))},loadingElement:y,brokenElement:v})):r&&r({attrs:gt,scale:Le,rotate:q})))}var Xw={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 D8(e){var t=e.loop,n=t===void 0?3:t,r=e.speed,i=e.easing,s=e.photoClosable,a=e.maskClosable,o=a===void 0||a,l=e.maskOpacity,c=l===void 0?1:l,d=e.pullClosable,f=d===void 0||d,h=e.bannerVisible,p=h===void 0||h,m=e.overlayRender,y=e.toolbarRender,v=e.className,g=e.maskClassName,E=e.photoClassName,b=e.photoWrapClassName,w=e.loadingElement,N=e.brokenElement,T=e.images,A=e.index,S=A===void 0?0:A,R=e.onIndexChange,I=e.visible,D=e.onClose,F=e.afterClose,W=e.portalContainer,j=Uh(Xw),$=j[0],C=j[1],O=_.useState(0),L=O[0],M=O[1],k=$.x,Y=$.touched,G=$.pause,P=$.lastCX,V=$.lastCY,Q=$.bg,ne=Q===void 0?c:Q,le=$.lastBg,K=$.overlay,q=$.minimal,ae=$.scale,ye=$.rotate,he=$.onScale,de=$.onRotate,Ie=e.hasOwnProperty("index"),_e=Ie?S:L,xe=Ie?R:M,je=_.useRef(_e),be=T.length,Ve=T[_e],ke=typeof n=="boolean"?n:be>n,ce=function(Le,Je){var mt=_.useReducer(function(Ke){return!Ke},!1)[1],gt=_.useRef(0),se=function(Ke){var on=_.useRef(Ke);function Xe(re){on.current=re}return _.useMemo(function(){(function(re){Le?(re(Le),gt.current=1):gt.current=2})(Xe)},[Ke]),[on.current,Xe]}(Le),Ce=se[1];return[se[0],gt.current,function(){mt(),gt.current===2&&(Ce(!1),Je&&Je()),gt.current=0}]}(I,F),Nt=ce[0],De=ce[1],xt=ce[2];_y(function(){if(Nt)return C({pause:!0,x:_e*-(innerWidth+Ja)}),void(je.current=_e);C(Xw)},[Nt]);var it=_a({close:function(Le){de&&de(0),C({overlay:!0,lastBg:ne}),D(Le)},changeIndex:function(Le,Je){Je===void 0&&(Je=!1);var mt=ke?je.current+(Le-_e):Le,gt=be-1,se=wy(mt,0,gt),Ce=ke?mt:se,Ke=innerWidth+Ja;C({touched:!1,lastCX:void 0,lastCY:void 0,x:-Ke*Ce,pause:Je}),je.current=Ce,xe&&xe(ke?Le<0?gt:Le>gt?0:Le:se)}}),z=it.close,X=it.changeIndex;function oe(Le){return Le?z():C({overlay:!K})}function ve(){C({x:-(innerWidth+Ja)*_e,lastCX:void 0,lastCY:void 0,pause:!0}),je.current=_e}function Ae(Le,Je,mt,gt){Le==="x"?function(se){if(P!==void 0){var Ce=se-P,Ke=Ce;!ke&&(_e===0&&Ce>0||_e===be-1&&Ce<0)&&(Ke=Ce/2),C({touched:!0,lastCX:P,x:-(innerWidth+Ja)*je.current+Ke,pause:!1})}else C({touched:!0,lastCX:se,x:k,pause:!1})}(Je):Le==="y"&&function(se,Ce){if(V!==void 0){var Ke=c===null?null:wy(c,.01,c-Math.abs(se-V)/100/4);C({touched:!0,lastCY:V,bg:Ce===1?Ke:c,minimal:Ce===1})}else C({touched:!0,lastCY:se,bg:ne,minimal:!0})}(mt,gt)}function st(Le,Je){var mt=Le-(P??Le),gt=Je-(V??Je),se=!1;if(mt<-40)X(_e+1);else if(mt>40)X(_e-1);else{var Ce=-(innerWidth+Ja)*je.current;Math.abs(gt)>100&&q&&f&&(se=!0,z()),C({touched:!1,x:Ce,lastCX:void 0,lastCY:void 0,bg:c,overlay:!!se||K})}}oo("keydown",function(Le){if(I)switch(Le.key){case"ArrowLeft":X(_e-1,!0);break;case"ArrowRight":X(_e+1,!0);break;case"Escape":z()}});var Xt=function(Le,Je,mt){return _.useMemo(function(){var gt=Le.length;return mt?Le.concat(Le).concat(Le).slice(gt+Je-1,gt+Je+2):Le.slice(Math.max(Je-1,0),Math.min(Je+2,gt+1))},[Le,Je,mt])}(T,_e,ke);if(!Nt)return null;var ze=K&&!De,an=I?ne:le,vt=he&&de&&{images:T,index:_e,visible:I,onClose:z,onIndexChange:X,overlayVisible:ze,overlay:Ve&&Ve.overlay,scale:ae,rotate:ye,onScale:he,onRotate:de},pt=r?r(De):400,jt=i?i(De):Ww,Vt=r?r(3):600,Qt=i?i(3):Ww;return qe.createElement(w8,{className:"PhotoView-Portal"+(ze?"":" PhotoView-Slider__clean")+(I?"":" PhotoView-Slider__willClose")+(v?" "+v:""),role:"dialog",onClick:function(Le){return Le.stopPropagation()},container:W},I&&qe.createElement(S8,null),qe.createElement("div",{className:"PhotoView-Slider__Backdrop"+(g?" "+g:"")+(De===1?" PhotoView-Slider__fadeIn":De===2?" PhotoView-Slider__fadeOut":""),style:{background:an?"rgba(0, 0, 0, "+an+")":void 0,transitionTimingFunction:jt,transitionDuration:(Y?0:pt)+"ms",animationDuration:pt+"ms"},onAnimationEnd:xt}),p&&qe.createElement("div",{className:"PhotoView-Slider__BannerWrap"},qe.createElement("div",{className:"PhotoView-Slider__Counter"},_e+1," / ",be),qe.createElement("div",{className:"PhotoView-Slider__BannerRight"},y&&vt&&y(vt),qe.createElement(_8,{className:"PhotoView-Slider__toolbarIcon",onClick:z}))),Xt.map(function(Le,Je){var mt=ke||_e!==0?je.current-1+Je:_e+Je;return qe.createElement(M8,{key:ke?Le.key+"/"+Le.src+"/"+mt:Le.key,item:Le,speed:pt,easing:jt,visible:I,onReachMove:Ae,onReachUp:st,onPhotoTap:function(){return oe(s)},onMaskTap:function(){return oe(o)},wrapClassName:b,className:E,style:{left:(innerWidth+Ja)*mt+"px",transform:"translate3d("+k+"px, 0px, 0)",transition:Y||G?void 0:"transform "+Vt+"ms "+Qt},loadingElement:w,brokenElement:N,onPhotoResize:ve,isActive:je.current===mt,expose:C})}),!Fi&&p&&qe.createElement(qe.Fragment,null,(ke||_e!==0)&&qe.createElement("div",{className:"PhotoView-Slider__ArrowLeft",onClick:function(){return X(_e-1,!0)}},qe.createElement(T8,null)),(ke||_e+1-1){var g=c.slice();return g.splice(v,1,y),void o({images:g})}o(function(E){return{images:E.images.concat(y)}})},remove:function(y){o(function(v){var g=v.images.filter(function(E){return E.key!==y});return{images:g,index:Math.min(g.length-1,f)}})},show:function(y){var v=c.findIndex(function(g){return g.key===y});o({visible:!0,index:v}),r&&r(!0,v,a)}}),p=_a({close:function(){o({visible:!1}),r&&r(!1,f,a)},changeIndex:function(y){o({index:y}),n&&n(y,a)}}),m=_.useMemo(function(){return An({},a,h)},[a,h]);return qe.createElement(gC.Provider,{value:m},t,qe.createElement(D8,An({images:c,visible:d,index:f,onIndexChange:p.changeIndex,onClose:p.close},i)))}var bC=function(e){var t,n,r=e.src,i=e.render,s=e.overlay,a=e.width,o=e.height,l=e.triggers,c=l===void 0?["onClick"]:l,d=e.children,f=_.useContext(gC),h=(t=function(){return f.nextId()},(n=_.useRef({sign:!1,fn:void 0}).current).sign||(n.sign=!0,n.fn=t()),n.fn),p=_.useRef(null);_.useImperativeHandle(d==null?void 0:d.ref,function(){return p.current}),_.useEffect(function(){return function(){f.remove(h)}},[]);var m=_a({render:function(v){return i&&i(v)},show:function(v,g){f.show(h),function(E,b){if(d){var w=d.props[E];w&&w(b)}}(v,g)}}),y=_.useMemo(function(){var v={};return c.forEach(function(g){v[g]=m.show.bind(null,g)}),v},[]);return _.useEffect(function(){f.update({key:h,src:r,originRef:p,render:m.render,overlay:s,width:a,height:o})},[r]),d?_.Children.only(_.cloneElement(d,An({},y,{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 L8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),yC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const F8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),EC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.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 M8={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 U8={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 D8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>_.createElement("svg",{ref:l,...M8,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yC("lucide",i),...o},[...a.map(([c,d])=>_.createElement(c,d)),...Array.isArray(s)?s:[s]]));/** + */const $8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>_.createElement("svg",{ref:l,...U8,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:EC("lucide",i),...o},[...a.map(([c,d])=>_.createElement(c,d)),...Array.isArray(s)?s:[s]]));/** * @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 ve=(e,t)=>{const n=_.forwardRef(({className:r,...i},s)=>_.createElement(D8,{ref:s,iconNode:t,className:yC(`lucide-${L8(e)}`,r),...i}));return n.displayName=`${e}`,n};/** + */const we=(e,t)=>{const n=_.forwardRef(({className:r,...i},s)=>_.createElement($8,{ref:s,iconNode:t,className:EC(`lucide-${F8(e)}`,r),...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 P8=ve("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 H8=we("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 bC=ve("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const xC=we("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 j8=ve("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 z8=we("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 EC=ve("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const vC=we("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 xC=ve("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + */const wC=we("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 vC=ve("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 _C=we("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 B8=ve("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 V8=we("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 ka=ve("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 La=we("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 wC=ve("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 TC=we("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 F8=ve("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 K8=we("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 U8=ve("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 Y8=we("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 Ai=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Li=we("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 Fh=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const $h=we("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 $8=ve("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const W8=we("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @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 rr=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const or=we("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 _C=ve("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 NC=we("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 H8=ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const q8=we("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 z8=ve("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 G8=we("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 V8=ve("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 X8=we("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 zb=ve("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 Vb=we("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 Vb=ve("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 Kb=we("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 TC=ve("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 SC=we("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 $f=ve("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 zf=we("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 Kb=ve("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 Yb=we("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 K8=ve("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 Q8=we("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 Yb=ve("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 Wb=we("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 Y8=ve("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const Z8=we("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @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 NC=ve("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 kC=we("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 Xw=ve("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 Qw=we("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 W8=ve("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 J8=we("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 q8=ve("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 e9=we("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 SC=ve("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 AC=we("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 G8=ve("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 t9=we("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 kC=ve("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 CC=we("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 X8=ve("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 n9=we("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 Q8=ve("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 r9=we("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 Wb=ve("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 qb=we("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 AC=ve("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 IC=we("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 CC=ve("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 RC=we("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 Z8=ve("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 i9=we("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 $p=ve("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 Cl=we("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 J8=ve("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 s9=we("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 e9=ve("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 a9=we("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 IC=ve("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 OC=we("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 Xu=ve("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 td=we("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 t9=ve("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 o9=we("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 OC=ve("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 LC=we("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 n9=ve("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 l9=we("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 r9=ve("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** + */const c9=we("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/** * @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 i9=ve("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 u9=we("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 s9=ve("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** + */const d9=we("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @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 xt=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + */const bt=we("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 a9=ve("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 f9=we("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 o9=ve("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 h9=we("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 Dc=ve("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 Uc=we("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 RC=ve("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 MC=we("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 l9=ve("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 p9=we("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 c9=ve("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 m9=we("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 u9=ve("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 g9=we("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 LC=ve("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 DC=we("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 d9=ve("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 y9=we("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 f9=ve("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 b9=we("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 h9=ve("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 E9=we("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 p9=ve("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const x9=we("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 li=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const pi=we("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 qb=ve("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 Gb=we("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 Gb=ve("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 Xb=we("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 m9=ve("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 v9=we("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 MC=ve("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 PC=we("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 Ty=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const Ny=we("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 g9=ve("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 w9=we("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 y9=ve("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 _9=we("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 Qw=ve("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 Zw=we("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 Aa=ve("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 Ma=we("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 DC=ve("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 jC=we("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 Tl=ve("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 Il=we("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 b9=ve("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 T9=we("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 E9=ve("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 N9=we("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 x9=ve("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 S9=we("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 v9=ve("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 k9=we("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 w9=ve("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 A9=we("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 Xb=ve("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 Qb=we("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 Vr=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zw="veadk_auth_qs";let Ql=null;function _9(){if(Ql!==null)return Ql;const e=window.location.search.replace(/^\?/,"");return e?(sessionStorage.setItem(Zw,e),window.history.replaceState(null,"",window.location.pathname+window.location.hash),Ql=e):Ql=sessionStorage.getItem(Zw)??"",Ql}function Pc(e){const t=_9();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((r,i)=>{n.searchParams.has(i)||n.searchParams.set(i,r)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const T9=/\brun_sse\s*failed\s*:\s*404\b/i,Jw="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function Gd(e){const t=String(e);return!T9.test(t)||t.includes(Jw)?t:`${t} + */const Xr=we("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Jw="veadk_auth_qs";let nc=null;function C9(){if(nc!==null)return nc;const e=window.location.search.replace(/^\?/,"");return e?(sessionStorage.setItem(Jw,e),window.history.replaceState(null,"",window.location.pathname+window.location.hash),nc=e):nc=sessionStorage.getItem(Jw)??"",nc}function $c(e){const t=C9();if(!t)return e;const n=new URL(e,window.location.origin);return new URLSearchParams(t).forEach((r,i)=>{n.searchParams.has(i)||n.searchParams.set(i,r)}),/^https?:\/\//i.test(e)?n.toString():n.pathname+n.search+n.hash}const I9=/\brun_sse\s*failed\s*:\s*404\b/i,e_="提示:该 404 可能是多实例部署使用 in-memory 或 SQLite 短期记忆导致的:请求落到不同实例后,会话无法找到。请改用基于数据库的持久化短期记忆存储。";function Zd(e){const t=String(e);return!I9.test(t)||t.includes(e_)?t:`${t} -${Jw}`}async function*Qb(e){if(!e.body)throw new Error("Response has no body");const t=e.body.getReader(),n=new TextDecoder;let r="";try{for(;;){const{done:i,value:s}=await t.read();if(i)break;r+=n.decode(s,{stream:!0});let a=r.match(/\r?\n\r?\n/);for(;(a==null?void 0:a.index)!==void 0;){const o=r.slice(0,a.index);r=r.slice(a.index+a[0].length);const l=o.split(/\r?\n/).filter(c=>c.startsWith("data:")).map(c=>c.slice(5).trimStart()).join(` -`);if(l)try{yield JSON.parse(l)}catch{l!=="[DONE]"&&l!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${l.length} chars):`,l.slice(0,200))}a=r.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const Hp=3e4,N9=12e4,PC=1e4;function Qu(e,t=Hp){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const Zb="veadk_local_user",S9=/^[A-Za-z0-9]{1,16}$/;function jC(){try{return localStorage.getItem(Zb)}catch{return null}}function k9(e){try{localStorage.setItem(Zb,e)}catch{}}function A9(){try{localStorage.removeItem(Zb)}catch{}}function C9(e){const t=new Headers(e),n=jC();return n&&t.set("X-VeADK-Local-User",n),t}async function I9(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:Qu(void 0,PC)})}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 O9(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function R9(){window.location.assign("/oauth2/logout")}async function L9(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:Qu(void 0,PC)})}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=jC();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function M9(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function D9(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const Hf="",Jb=new Map;function BC(e,t){Jb.set(e,t)}function FC(){Jb.clear()}function ui(e){const t=Jb.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}function St(e,t={},n={},r=Hp){const i={...t,headers:C9(t.headers),signal:Qu(t.signal,r)};if(n.runtimeId){const s=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch(Pc(`${Hf}/web/runtime-proxy/${n.runtimeId}${e}${s}`),i)}if(n.base){const s=new Headers(i.headers);return s.set("X-AgentKit-Base",n.base),n.apiKey&&s.set("X-AgentKit-Key",n.apiKey),fetch(Pc(`${Hf}/agentkit-proxy${e}`),{...i,headers:s})}return fetch(Pc(`${Hf}${e}`),i)}function P9(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const r=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",i=String(t.msg??"");return r?`${r}: ${i}`:i}return String(t)}).filter(Boolean).join(` -`):e&&typeof e=="object"?JSON.stringify(e):""}async function Wr(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return P9(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function UC(){const e=await St("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class Zu extends Error{constructor(){super("你没有权限访问该 Runtime,请刷新列表后重试。"),this.name="RuntimeAccessDeniedError"}}async function zp(e,t,n){const r=await St("/list-apps",{},n??{base:e,apiKey:t});if((r.status===403||r.status===404)&&(n!=null&&n.runtimeId))throw new Zu;if(!r.ok)throw new Error(await Wr(r,"读取 Agent 列表失败"));return r.json()}async function Uh(e,t){const{app:n,ep:r}=ui(e),i=await St(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!i.ok)throw new Error(`create session failed: ${i.status}`);return(await i.json()).id}async function eE(e,t){const{app:n,ep:r}=ui(e),i=await St(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!i.ok)throw new Error(`list sessions failed: ${i.status}`);return i.json()}async function $h(e,t,n){const{app:r,ep:i}=ui(e),s=await St(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},i);if(!s.ok)throw new Error(`get session failed: ${s.status}`);return s.json()}async function Ny(e,t,n){const{app:r,ep:i}=ui(e),s=await St(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},i);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}async function j9(e){const t=await St("/web/media/capabilities");if(!t.ok)throw new Error(await Wr(t,"media capabilities failed"));return t.json()}async function $C(e,t,n,r){const{app:i}=ui(e),s=new FormData;s.set("app_name",i),s.set("user_id",t),s.set("session_id",n),s.set("file",r);const a=await St("/web/media",{method:"POST",body:s},{},N9);if(!a.ok)throw new Error(await Wr(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function Sy(e,t,n){const{app:r}=ui(e),i=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,s=await St(i,{method:"DELETE"});if(!s.ok&&s.status!==404)throw new Error(await Wr(s,"media cleanup failed"))}function HC(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((r,i)=>![1,3,5].includes(i)).join("/")}`}catch{return}}async function zf(e,t){const n=HC(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await St(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await Wr(r,"media cleanup failed"))}function zC(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=HC(t);if(!n)return t;const r=`${n}/content`;return Pc(`${Hf}${r}`)}async function VC(e,t){const{app:n,ep:r}=ui(e),i=await St(`/dev/apps/${encodeURIComponent(n)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!i.ok)throw new Error(`trace failed: ${i.status}`);const s=i.headers.get("content-type")??"";if(!s.includes("application/json")){const o=s.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${o}),请检查 Studio API 代理配置`)}const a=await i.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}async function KC(e,t){const n=await St(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph}}async function Ju(e){const{app:t,ep:n}=ui(e);return KC(t,n)}async function YC(e,t){const n={runtimeId:e,region:t},i=(await zp("","",n))[0];if(!i)throw new Error("该 Runtime 未提供可预览的 Agent。");return KC(i,n)}async function WC(e,t,n,r){const{app:i,ep:s}=ui(e),a=new URLSearchParams({source:t,app_name:i,q:n,user_id:r}),o=await St(`/web/search?${a.toString()}`,{},s);if(!o.ok)throw new Error(await Wr(o,"Agent 检索失败"));return o.json()}async function qC(e,t){const{app:n}=ui(e),r=await St(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!r.ok)throw new Error(`web search failed: ${r.status}`);return r.json()}async function*xu({appName:e,userId:t,sessionId:n,text:r,attachments:i=[],invocation:s,functionResponses:a=[],signal:o}){const{app:l,ep:c}=ui(e),d=i.flatMap(m=>m.status&&m.status!=="ready"?[]:m.uri?[{fileData:{mimeType:m.mimeType,fileUri:m.uri,displayName:m.name},partMetadata:{veadkMedia:{id:m.id,uri:m.uri,name:m.name,mimeType:m.mimeType,sizeBytes:m.sizeBytes}}}]:m.data?[{inlineData:{mimeType:m.mimeType,data:m.data,displayName:m.name}}]:[]),f=s&&(s.skills.length>0||s.targetAgent)?s:void 0,h=[...d,...a.map(m=>({functionResponse:{id:m.id,name:m.name,response:m.response}})),...r.trim()?[{text:r}]:[]];if(f&&h.length>0){const m=h[0],y=m.partMetadata;h[0]={...m,partMetadata:{...y,veadkInvocation:f}}}const p=await St("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:l,user_id:t,session_id:n,new_message:{role:"user",parts:h},streaming:!0,custom_metadata:f?{veadkInvocation:f}:void 0}),signal:o},c,0);if(!p.ok)throw new Error(Gd(`run_sse failed: ${p.status}`));for await(const m of Qb(p)){const y=m;typeof y.error=="string"&&(y.error=Gd(y.error)),typeof y.errorMessage=="string"&&(y.errorMessage=Gd(y.errorMessage)),typeof y.error_message=="string"&&(y.error_message=Gd(y.error_message)),yield y}}const jc=new Map;async function tE(e,t,n,r){var c;const i=r==null?void 0:r.taskId,s=i?new AbortController:void 0;i&&s&&jc.set(i,s);const a=()=>{i&&jc.get(i)===s&&jc.delete(i)};let o;try{o=await St("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:i,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0)}catch(d){throw a(),d}if(!o.ok){const d=await o.text().catch(()=>"");throw a(),new Error(d||`部署失败 (${o.status})`)}let l=null;try{for await(const d of Qb(o)){const f=d;if(f&&f.done){l=f;break}f&&f.message&&((c=r==null?void 0:r.onStage)==null||c.call(r,f))}}catch(d){throw a(),d}if(a(),!l)throw new Error("部署失败:连接中断");if(!l.success)throw new Error(l.error||"部署失败");if(!l.url||!l.agentName)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:l.apikey??"",url:l.url,agentName:l.agentName,runtimeId:l.runtimeId,consoleUrl:l.consoleUrl,region:l.region,feishuChannel:l.feishuChannel}}async function GC(e){var n;const t=await St("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(r||`取消部署失败 (${t.status})`)}(n=jc.get(e))==null||n.abort(),jc.delete(e)}async function XC(e="cn-beijing"){const t=await St(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const vu={title:"VeADK Studio",logoUrl:""},pg={studio:!1,branding:vu,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function QC(){var e,t;try{const n=await St("/web/ui-config");if(!n.ok)return pg;const r=await n.json(),i=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:vu.logoUrl;return{studio:r.studio??!1,branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:vu.title,logoUrl:i?Pc(i):""},features:{...pg.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return pg}}const ZC={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function JC(){var n,r,i;const e=await St("/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.capabilities)==null?void 0:n.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.manageAgents)!="boolean"||!["all","mine"].includes((i=t.capabilities)==null?void 0:i.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function Vf(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 St(`/web/runtimes?${t.toString()}`);if(!n.ok)throw new Error(`加载 Runtime 失败 (${n.status})`);const r=await n.json();return{runtimes:r.runtimes??[],nextToken:r.nextToken??""}}async function eI(e,t="cn-beijing"){try{return await zp("","",{runtimeId:e,region:t})}catch(n){if(n instanceof Zu)throw n;return null}}async function tI(e,t="cn-beijing"){const n=await St("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(r||`删除失败 (${n.status})`)}}async function nE(e,t="cn-beijing"){const n=await St(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Wr(n,"加载 Runtime 详情失败"));return n.json()}async function Hh(e){const t=await St("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Wr(t,"生成项目失败"));return t.json()}async function nI(e){const t=await St("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Wr(t,"创建调试运行失败"));return t.json()}async function rI(e,t){const n=await St(`/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 Wr(n,"创建调试会话失败"));return(await n.json()).id}async function*iI({runId:e,userId:t,sessionId:n,text:r,signal:i}){const s=r.trim()?[{text:r}]:[],a=await St(`/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:s},streaming:!0}),signal:i},{},0);if(!a.ok)throw new Error(await Wr(a,"调试运行失败"));for await(const o of Qb(a))yield o}async function ky(e){const t=await St(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Wr(t,"清理调试运行失败"))}const B9=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:vu,DEFAULT_STUDIO_ACCESS:ZC,RuntimeAccessDeniedError:Zu,cancelAgentkitDeployment:GC,clearRemoteApps:FC,componentSearch:WC,createGeneratedAgentTestRun:nI,createGeneratedAgentTestSession:rI,createSession:Uh,deleteGeneratedAgentTestRun:ky,deleteMedia:zf,deleteRuntime:tI,deleteSession:Ny,deleteSessionMedia:Sy,deployAgentkitProject:tE,fetchRemoteApps:zp,generateAgentProject:Hh,getAgentInfo:Ju,getMediaCapabilities:j9,getMyRuntimes:XC,getRuntimeAgentInfo:YC,getRuntimeDetail:nE,getRuntimes:Vf,getSession:$h,getSessionTrace:VC,getStudioAccess:JC,getUiConfig:QC,listApps:UC,listSessions:eE,mediaContentUrl:zC,probeRuntimeApps:eI,registerRemoteApp:BC,runGeneratedAgentTestSSE:iI,runSSE:xu,uploadMedia:$C,webSearch:qC},Symbol.toStringTag,{value:"Module"})),F9="send_a2ui_json_to_client",U9="validated_a2ui_json",Ay="adk_request_credential";function $9(e){var r,i,s,a;const t=e,n=((r=t==null?void 0:t.exchangedAuthCredential)==null?void 0:r.oauth2)??((i=t==null?void 0:t.exchanged_auth_credential)==null?void 0:i.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.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 Ui(){return{blocks:[],liveStart:0}}const e_=e=>e.functionCall??e.function_call,Cy=e=>e.functionResponse??e.function_response;function H9(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function sI(e){const t=[];for(const[n,r]of e.entries()){const i=r.partMetadata??r.part_metadata,s=i==null?void 0:i.veadkTransport;if((s==null?void 0:s.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 o=r.inlineData??r.inline_data;if(o&&o.data){t.push({id:`inline-${n}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:H9(o.data),name:o.displayName??o.display_name});continue}const l=r.fileData??r.file_data,c=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&c&&t.push({id:c,mimeType:l.mimeType??l.mime_type,uri:c,name:l.displayName??l.display_name})}return t}function Iy(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 z9=new Set(["llm","sequential","parallel","loop","a2a"]);function V9(e){var t;for(const n of e){const r=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!r||typeof r!="object")continue;const i=r,s=Array.isArray(i.skills)?i.skills.flatMap(l=>{if(!l||typeof l!="object")return[];const c=l;return typeof c.name=="string"?[{name:c.name,description:typeof c.description=="string"?c.description:""}]:[]}):[];let a;const o=i.targetAgent;if(o&&typeof o=="object"){const l=o,c=l.type;typeof l.name=="string"&&typeof c=="string"&&z9.has(c)&&Array.isArray(l.path)&&(a={name:l.name,description:typeof l.description=="string"?l.description:"",type:c,path:l.path.filter(d=>typeof d=="string")})}if(s.length>0||a)return{skills:s,targetAgent:a}}}function K9(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 t_(e,t,n){const r=e[e.length-1];r&&r.kind===t?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function Xd(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function tl(e,t){var a,o;const n=e.blocks.map(l=>({...l}));let r=e.liveStart;const i=((a=t.content)==null?void 0:a.parts)??[],s=i.some(l=>e_(l)||Cy(l));if(t.partial&&!s){for(const l of i){const c=Iy(l);typeof c=="string"&&c&&t_(n,l.thought?"thinking":"text",c)}return{blocks:n,liveStart:r}}n.length=r;for(const l of i){const c=e_(l),d=Cy(l),f=sI([l]),h=Iy(l);if(typeof h=="string"&&h)t_(n,l.thought?"thinking":"text",h);else if(f.length)Xd(n),K9(n,f);else if(c)if(Xd(n),c.name===Ay){const p=c.args??{},m=p.authConfig??p.auth_config??p,v=String(p.functionCallId??p.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:c.id??"",label:v,authUri:$9(m),authConfig:m,done:!1})}else n.push({kind:"tool",name:c.name??"",args:c.args,done:!1});else if(d){if(Xd(n),d.name===Ay)for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="auth"&&!m.done){m.done=!0;break}}for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="tool"&&!m.done&&m.name===d.name){m.done=!0,m.response=d.response;break}}if(d.name===F9){const p=((o=d.response)==null?void 0:o[U9])??[];if(p.length){const m=n[n.length-1];m&&m.kind==="a2ui"?m.messages.push(...p):n.push({kind:"a2ui",messages:p})}}}}return Xd(n),r=n.length,{blocks:n,liveStart:r}}function Y9(e){var r;const t=[];let n=Ui();for(const i of e)if(i.author==="user"){const a=((r=i.content)==null?void 0:r.parts)??[];if(a.some(f=>{var h;return((h=Cy(f))==null?void 0:h.name)===Ay})){for(let f=t.length-1;f>=0;f--)if(t[f].role==="assistant"){for(let h=t[f].blocks.length-1;h>=0;h--){const p=t[f].blocks[h];if(p.kind==="auth"){p.done=!0;break}}break}}const o=a.map(Iy).filter(f=>!!f).join(""),l=sI(a),c=V9(a);if(!o&&!l.length&&!c){n=Ui();continue}const d=[];c&&d.push({kind:"invocation",value:c}),l.length&&d.push({kind:"attachment",files:l}),o&&d.push({kind:"text",text:o}),t.push({role:"user",blocks:d,meta:{ts:i.timestamp}}),n=Ui()}else{let a=t[t.length-1];(!a||a.role!=="assistant")&&(a={role:"assistant",blocks:[],meta:{}},t.push(a),n=Ui()),n=tl(n,i),a.blocks=n.blocks;const o=i.usageMetadata??i.usage_metadata,l=a.meta??(a.meta={});o!=null&&o.totalTokenCount&&(l.tokens=o.totalTokenCount),i.timestamp&&(l.ts=i.timestamp)}return t}function aI(e){var t,n;for(const r of e??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const i=(((n=r.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(i)return i}return"新会话"}const W9="https://findskill.com/";function q9(){return u.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("circle",{cx:"12",cy:"12",r:"8.6"}),u.jsx("path",{d:"M12 6.4 13.25 10.75 17.6 12 13.25 13.25 12 17.6 10.75 13.25 6.4 12 10.75 10.75z",fill:"currentColor",stroke:"none"})]})}function G9({onClick:e}){return u.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"技能中心",title:"技能中心",children:[u.jsx(q9,{}),u.jsx("span",{className:"sidebar-nav-label",children:"技能中心"})]})}function X9(){return u.jsx("iframe",{className:"skill-frame",src:W9,title:"技能中心"})}const Q9=50,n_=48;function Z9(e){return(e.events??[]).flatMap(t=>{var i,s;const r=(((i=t.content)==null?void 0:i.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return r?[{text:r,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function J9(e){var t,n;for(const r of e.events??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const i=(((n=r.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(i)return i}return"未命名会话"}function eF(e,t,n){const r=Math.max(0,t-n_),i=Math.min(e.length,t+n+n_);return(r>0?"…":"")+e.slice(r,i).trim()+(i{var l;if((l=o.events)!=null&&l.length)return o;try{return await $h(t,e,o.id)}catch{return o}})),a=[];for(const o of s)for(const{text:l,role:c,ts:d}of Z9(o)){const f=l.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:J9(o),snippet:eF(l,f,r.length),role:c,ts:d??o.lastUpdateTime});break}}return a.sort((o,l)=>(l.ts??0)-(o.ts??0)),a.slice(0,Q9)}async function nF(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await qC(e,t.trim())}catch(a){const o=String(a);return{results:[],note:o.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${o}`}}const{mounted:r,results:i,error:s}=n;return r?s?{results:[],note:s}:{results:i.map((a,o)=>({type:"web",index:o,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function rF(e,t,n,r){if(!t||!r.trim())return{results:[]};const i=await WC(t,e,r.trim(),n);if(!i.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(i.error)return{results:[],note:i.error};const s=i.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:i.results.map((a,o)=>e==="knowledge"?{type:"knowledge",index:o,content:a.content,sourceName:s,sourceType:i.sourceType}:{type:"memory",index:o,content:a.content,sourceName:s,sourceType:i.sourceType,author:a.author,ts:a.timestamp})}}async function iF(e,t,n){return e==="session"?{results:await tF(n.userId,n.appId,t)}:e==="web"?nF(n.appId,t):rF(e,n.appId,n.userId,t)}function oI({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),u.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function sF({open:e}){return u.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:u.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function aF({onClick:e}){return u.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"智能搜索",title:"智能搜索",children:[u.jsx(oI,{}),u.jsx("span",{className:"sidebar-nav-label",children:"智能搜索"})]})}function oF(e,t,n){const r=!!e,i=new Set((t==null?void 0:t.searchSources)??[]),s=a=>r?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:r,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:r&&i.has("web"),description:"通过 web_search 工具检索",unavailableLabel:s(" web_search 工具")},{id:"knowledge",label:"知识库",ready:r&&i.has("knowledge"),unavailableLabel:s("知识库")},{id:"memory",label:"长期记忆",ready:r&&i.has("memory"),unavailableLabel:s("长期记忆")}]}function zh(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 r_(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 lF({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:i,onOpenSession:s}){var $,C;const[a,o]=_.useState("session"),[l,c]=_.useState(""),[d,f]=_.useState([]),[h,p]=_.useState(),[m,y]=_.useState(!1),[v,g]=_.useState(!1),[E,b]=_.useState(!1),w=_.useRef(0),N=_.useRef(null),T=oF(t,n,r),A=T.find(R=>R.id===a),S=a==="knowledge"?($=n==null?void 0:n.components)==null?void 0:$.find(R=>R.source==="knowledgebase"||R.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(R=>R.source==="long_term_memory"||R.kind==="memory"):void 0;_.useEffect(()=>{w.current+=1,o("session"),f([]),p(void 0),g(!1),y(!1),b(!1)},[t]),_.useEffect(()=>{if(!E)return;function R(L){var M;(M=N.current)!=null&&M.contains(L.target)||b(!1)}return document.addEventListener("pointerdown",R),()=>document.removeEventListener("pointerdown",R)},[E]);async function O(R,L){var G;const M=R.trim();if(!M||!((G=T.find(P=>P.id===L))!=null&&G.ready))return;const k=++w.current;y(!0),g(!0);let Y;try{Y=await iF(L,M,{userId:e,appId:t})}catch(P){const V=P instanceof Error?P.message:String(P);Y={results:[],note:`搜索失败:${V}`}}k===w.current&&(f(Y.results),p(Y.note),y(!1))}function I(R){w.current+=1,c(R),f([]),p(void 0),g(!1),y(!1)}function D(R){w.current+=1,o(R),b(!1),f([]),p(void 0),g(!1),y(!1)}const F=!!(A!=null&&A.ready),W=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(S==null?void 0:S.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(S==null?void 0:S.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",j=S!=null&&S.backend?zh(S.backend):"";return u.jsxs("div",{className:"search",children:[u.jsxs("div",{className:"search-box",children:[u.jsxs("div",{className:"search-source-picker-wrap",ref:N,children:[u.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(A==null?void 0:A.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":E,onClick:()=>b(R=>!R),children:[u.jsx("span",{children:(A==null?void 0:A.label)??"搜索类型"}),j&&u.jsx("small",{children:j}),u.jsx(sF,{open:E})]}),E&&u.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:T.map(R=>{var k,Y;const L=R.id==="knowledge"?(k=n==null?void 0:n.components)==null?void 0:k.find(G=>G.source==="knowledgebase"||G.kind==="knowledgebase"):R.id==="memory"?(Y=n==null?void 0:n.components)==null?void 0:Y.find(G=>G.source==="long_term_memory"||G.kind==="memory"):void 0,M=L?[L.name,L.backend?zh(L.backend):""].filter(Boolean).join(" · "):R.ready?R.description:R.unavailableLabel;return u.jsxs("button",{type:"button",role:"option","aria-selected":a===R.id,disabled:!R.ready,onClick:()=>D(R.id),children:[u.jsx("span",{children:R.label}),M&&u.jsx("small",{children:M})]},R.id)})})]}),u.jsx("span",{className:"search-box-divider","aria-hidden":!0}),u.jsx("input",{className:"search-input",value:l,onChange:R=>I(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),O(l,a))},placeholder:W,disabled:!F,autoFocus:!0}),u.jsx("button",{className:"search-go",onClick:()=>void O(l,a),disabled:!l.trim()||m,"aria-label":"搜索",children:m?u.jsx(xt,{className:"icon spin"}):u.jsx(oI,{className:"icon"})})]}),u.jsx("div",{className:"search-results",children:F?v?m?null:h?u.jsx("div",{className:"search-empty",children:h}):d.length===0&&v?u.jsxs("div",{className:"search-empty",children:["未找到匹配「",l.trim(),"」的结果。"]}):d.map((R,L)=>u.jsx(cF,{result:R,agentLabel:i,onOpen:s},L)):u.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):u.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(A==null?void 0:A.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function cF({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return u.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[u.jsx(RC,{className:"search-result-icon"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsx("span",{className:"search-result-title",children:e.title}),u.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${r_(e.ts)}`:""]})]}),u.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return u.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[u.jsx($p,{className:"search-result-icon"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsx("span",{className:"search-result-title",children:e.title||e.url}),u.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&u.jsx(Yb,{className:"search-result-ext"})]})]}),e.summary&&u.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return u.jsxs("div",{className:"search-result search-result-static",children:[u.jsx(i_,{source:"knowledge"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),u.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${zh(e.sourceType)}`:""]})]}),u.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return u.jsxs("div",{className:"search-result search-result-static",children:[u.jsx(i_,{source:"memory"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),u.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${zh(e.sourceType)}`:"",e.ts?` · ${r_(e.ts)}`:""]})]}),u.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function i_({source:e,className:t="search-result-icon"}){return e==="knowledge"?u.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[u.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"}),u.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):u.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[u.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),u.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"})]})}const lI="veadk_agentkit_connections";function $i(){try{const e=localStorage.getItem(lI);return e?JSON.parse(e):[]}catch{return[]}}function Vp(e){try{localStorage.setItem(lI,JSON.stringify(e))}catch{}}function Ca(e,t){return`agentkit:${e}:${t}`}function cI(e){try{return new URL(e).host}catch{return e}}function Nl(e){FC();for(const t of e)for(const n of t.apps)BC(Ca(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function uI(e,t,n,r,i){const s={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:i},a=[...$i().filter(o=>o.runtimeId!==e),s];return Vp(a),Nl(a),s}async function rE(e,t,n){let r;try{r=await eI(e,n)}catch(a){throw a instanceof Zu&&Oy(e),a}if(!r||r.length===0)throw Oy(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(r.map(a=>[a,t])),s=uI(e,t,n,r,i);return Ca(s.id,r[0])}async function dI(e,t,n,r){const i=t.trim().replace(/\/+$/,""),s=await zp(i,n.trim()),a={id:Date.now().toString(36),name:e.trim()||cI(i),base:i,apiKey:n.trim(),apps:s,appLabels:r&&s.length>0?{[s[0]]:r}:void 0},o=[...$i().filter(l=>l.base!==i),a];return Vp(o),Nl(o),a}function uF(e){const t=$i().filter(n=>n.id!==e);return Vp(t),Nl(t),t}function Oy(e){const t=$i().filter(n=>n.runtimeId!==e);return Vp(t),Nl(t),t}function fI(e,t){const n=e.map(i=>({id:i,label:i,app:i,remote:!1})),r=t.flatMap(i=>i.apps.map(s=>{var o;const a=((o=i.appLabels)==null?void 0:o[s])??s;return{id:Ca(i.id,s),label:a,app:s,remote:!0,host:i.runtimeId?i.name:cI(i.base??"")}}));return[...n,...r]}const s_=Object.freeze(Object.defineProperty({__proto__:null,addConnection:dI,addRuntimeConnection:uI,buildAgentEntries:fI,connectRuntime:rE,loadConnections:$i,registerConnections:Nl,remoteAppId:Ca,removeConnection:uF,removeRuntimeConnection:Oy},Symbol.toStringTag,{value:"Module"}));function Vh({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),u.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),u.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),u.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),u.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),u.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),u.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"})]})}function dF({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),u.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),u.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),u.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function fF({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"m4.7 7.2 7.3-3 7.3 3-7.3 3.1Z"}),u.jsx("path",{d:"M7.2 9.2v4.2c0 1.7 2.15 3.05 4.8 3.05s4.8-1.35 4.8-3.05V9.2"}),u.jsx("path",{d:"M19.3 7.2v5.25"}),u.jsx("circle",{cx:"19.3",cy:"14.4",r:"1.15",fill:"currentColor",stroke:"none"})]})}function hI({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),u.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),u.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),u.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),u.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const a_=15,hF=1e4,pF=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function mF(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function pI(e){const t=e.toLowerCase();return t.includes("invalidagentkitruntime.notfound")||t.includes("specified agentkitruntime does not exist")?"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。":t.includes("accessdenied")||t.includes("forbidden")||t.includes("permission")||t.includes("(401)")||t.includes("(403)")?"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。":t.includes("agent-info failed: 404")||t.includes("读取 agent 列表失败 (404)")?"该 Agent Server 版本暂不支持信息预览。":"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。"}function mg(e,t=hF){return new Promise((n,r)=>{const i=setTimeout(()=>r(new Error("加载超时,请重试")),t);e.then(s=>{clearTimeout(i),n(s)},s=>{clearTimeout(i),r(s)})})}function gF({open:e,onClose:t,anchorTop:n=0,agentsSource:r,localApps:i,currentId:s,currentRuntime:a,runtimeScope:o,onSelect:l}){const[c,d]=_.useState([]),[f,h]=_.useState([""]),[p,m]=_.useState(0),[y,v]=_.useState(o==="mine"),[g,E]=_.useState(null),[b,w]=_.useState("cn-beijing"),[N,T]=_.useState(!1),[A,S]=_.useState(""),[O,I]=_.useState(""),[D,F]=_.useState(null),[W,j]=_.useState(new Set),[$,C]=_.useState(),[R,L]=_.useState("agent"),M=_.useRef(!1);function k(q){C(ae=>(ae==null?void 0:ae.runtimeId)===q.runtimeId?void 0:{runtimeId:q.runtimeId,name:q.name,region:q.region})}const Y=_.useCallback(async q=>{if(c[q]){m(q);return}const ae=f[q];if(ae!==void 0){T(!0),S("");try{const ge=await mg(Vf({nextToken:ae,pageSize:a_,region:b,scope:"all"}));d(he=>{const de=[...he];return de[q]=ge.runtimes,de}),h(he=>{const de=[...he];return ge.nextToken&&(de[q+1]=ge.nextToken),de}),m(q)}catch(ge){S(ge instanceof Error?ge.message:String(ge))}finally{T(!1)}}},[f,c,b]),G=_.useCallback(async()=>{T(!0),S("");try{const q=[];let ae="";do{const ge=await mg(Vf({scope:"mine",nextToken:ae,pageSize:100,region:b}));q.push(...ge.runtimes),ae=ge.nextToken}while(ae&&q.length<2e3);E(q)}catch(q){S(q instanceof Error?q.message:String(q))}finally{T(!1)}},[b]);_.useEffect(()=>{v(o==="mine"),d([]),h([""]),m(0),E(null),M.current=!1},[o]),_.useEffect(()=>{e&&r==="cloud"&&!y&&!M.current&&(M.current=!0,Y(0))},[e,r,y,Y]),_.useEffect(()=>{y&&g===null&&r==="cloud"&&G()},[y,g,r,G]),_.useEffect(()=>{e&&(C(void 0),L("agent"))},[e]);function P(){j(new Set),y?(E(null),G()):(d([]),h([""]),m(0),M.current=!0,T(!0),S(""),mg(Vf({nextToken:"",pageSize:a_,region:b,scope:"all"})).then(q=>{d([q.runtimes]),h(q.nextToken?["",q.nextToken]:[""])}).catch(q=>S(q instanceof Error?q.message:String(q))).finally(()=>T(!1)))}function V(q){q!==b&&(w(q),d([]),h([""]),m(0),E(null),j(new Set),M.current=!1)}const Q=!y&&(c[p+1]!==void 0||f[p+1]!==void 0);function re(q){F(q.runtimeId),rE(q.runtimeId,q.name,q.region).then(ae=>{l(ae),t()}).catch(ae=>{if(ae instanceof Zu){S(ae.message);return}j(ge=>new Set(ge).add(q.runtimeId))}).finally(()=>F(null))}if(!e)return null;const K=(y?g??[]:c[p]??[]).filter(q=>O?q.name.toLowerCase().includes(O.toLowerCase()):!0);return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:t}),u.jsxs("div",{className:`agentsel ${$?"has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:{top:n,height:`min(640px, calc(100dvh - ${n}px - 10px))`},children:[u.jsxs("div",{className:"agentsel-main",children:[u.jsxs("div",{className:"agentsel-head",children:[u.jsxs("span",{className:"agentsel-title",children:[u.jsx(Vh,{})," 选择 Agent"]}),u.jsxs("div",{className:"agentsel-head-actions",children:[r==="cloud"&&u.jsx("button",{className:"agentsel-refresh",onClick:P,title:"刷新",disabled:N,children:u.jsx(qb,{className:`icon ${N?"spin":""}`})}),u.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:u.jsx(Vr,{className:"icon"})})]})]}),r==="local"?u.jsx("div",{className:"agentsel-body",children:i.length===0?u.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):u.jsx("ul",{className:"agentsel-list",children:i.map(q=>u.jsx("li",{children:u.jsxs("button",{className:`agentsel-item ${q===s?"active":""}`,onClick:()=>{l(q),t()},children:[u.jsx(Vh,{}),u.jsx("span",{className:"agentsel-item-name",children:q})]})},q))})}):u.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[u.jsxs("div",{className:"agentsel-tools",children:[u.jsxs("div",{className:"agentsel-search",children:[u.jsx(Ty,{className:"icon"}),u.jsx("input",{value:O,onChange:q=>I(q.target.value),placeholder:"搜索 Runtime 名称"})]}),u.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:pF.map(q=>u.jsx("button",{type:"button",className:b===q.value?"active":"","aria-pressed":b===q.value,onClick:()=>V(q.value),children:q.label},q.value))}),o==="all"&&u.jsxs("label",{className:"agentsel-mine",children:[u.jsx("input",{type:"checkbox",checked:y,onChange:q=>v(q.target.checked)}),"只看我创建的"]})]}),A&&u.jsx("div",{className:"agentsel-error",children:A}),u.jsxs("div",{className:"agentsel-listwrap",children:[K.length===0&&!N?u.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):u.jsx("ul",{className:"agentsel-list",children:K.map(q=>{const ae=W.has(q.runtimeId),ge=D===q.runtimeId,he=(a==null?void 0:a.runtimeId)===q.runtimeId,de=($==null?void 0:$.runtimeId)===q.runtimeId;return u.jsx("li",{children:u.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${he?"active":""} ${de?"is-previewed":""}`,title:q.runtimeId,children:[u.jsx(hI,{}),u.jsxs("div",{className:"agentsel-item-main",children:[u.jsx("span",{className:"agentsel-item-name",title:q.name,children:q.name}),u.jsxs("div",{className:"agentsel-item-meta",children:[u.jsx("span",{className:`agentsel-status is-${ae?"bad":_F(q.status)}`,children:ae?"不支持":mI(q.status)}),q.isMine&&u.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),u.jsxs("div",{className:"agentsel-item-actions",children:[u.jsx("button",{type:"button",className:"agentsel-connect",disabled:ge||he,onClick:()=>re(q),children:ge?"连接中…":he?"已连接":ae?"重试":"连接"}),u.jsx("button",{type:"button",className:`agentsel-info ${de?"active":""}`,"aria-label":`查看 ${q.name} 信息`,"aria-pressed":de,title:"查看信息",onClick:()=>k(q),children:u.jsx(Xu,{className:"icon"})})]})]})},q.runtimeId)})}),N&&u.jsxs("div",{className:"agentsel-loading",children:[u.jsx(xt,{className:"icon spin"})," 加载中…"]})]}),u.jsxs("div",{className:"agentsel-pager",children:[u.jsx("button",{disabled:y||p===0||N,onClick:()=>void Y(p-1),"aria-label":"上一页",children:u.jsx($8,{className:"icon"})}),u.jsx("span",{className:"agentsel-pager-label",children:y?1:p+1}),u.jsx("button",{disabled:y||!Q||N,onClick:()=>void Y(p+1),"aria-label":"下一页",children:u.jsx(rr,{className:"icon"})})]})]})]}),r==="cloud"&&$&&u.jsx(xF,{runtime:$,tab:R,onTabChange:L})]})]})}const yF={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function bF(e){return yF[e.toLowerCase()]??e}function EF(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 xF({runtime:e,tab:t,onTabChange:n}){return u.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[u.jsx("div",{className:"agentsel-head agentsel-preview-head",children:u.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[u.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),u.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),u.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),u.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:u.jsx(vF,{runtime:e})}),u.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:u.jsx(wF,{runtime:e})})]})}function vF({runtime:e}){const[t,n]=_.useState(null),[r,i]=_.useState(!0),[s,a]=_.useState(""),o=e.runtimeId,l=e.region;_.useEffect(()=>{let d=!0;return n(null),i(!0),a(""),YC(o,l).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(pI(h))}).finally(()=>d&&i(!1)),()=>{d=!1}},[o,l]);const c=(t==null?void 0:t.components)??[];return u.jsx("div",{className:"agentsel-detail-body",children:r?u.jsxs("div",{className:"agentsel-panel-state",children:[u.jsx(xt,{className:"icon spin"})," 读取 Agent 信息…"]}):s?u.jsxs("div",{className:"agentsel-panel-empty",children:[u.jsx("span",{children:"暂时无法读取 Agent 信息"}),u.jsx("small",{title:s,children:s})]}):t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"agentsel-identity",children:[u.jsx(Vh,{className:"agentsel-identity-icon"}),u.jsxs("div",{className:"agentsel-identity-copy",children:[u.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&u.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&u.jsxs("section",{className:"agentsel-info-section",children:[u.jsx("h3",{children:"描述"}),u.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&u.jsx(o_,{icon:u.jsx(LC,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&u.jsx(o_,{icon:u.jsx(dF,{}),title:"工具",values:t.tools}),t.skills.length>0&&u.jsxs("section",{className:"agentsel-info-section",children:[u.jsxs("h3",{children:[u.jsx(fF,{})," 技能"]}),u.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>u.jsxs("div",{className:"agentsel-info-list-item",children:[u.jsx("strong",{title:d.name,children:d.name}),d.description&&u.jsx("span",{title:d.description,children:d.description})]},d.name))})]}),c.length>0&&u.jsxs("section",{className:"agentsel-info-section",children:[u.jsxs("h3",{children:[u.jsx(wC,{className:"icon"})," 挂载组件"]}),u.jsx("div",{className:"agentsel-info-list",children:c.map((d,f)=>u.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[u.jsxs("div",{className:"agentsel-component-head",children:[u.jsx("strong",{title:d.name,children:d.name}),u.jsxs("span",{children:[bF(d.kind),d.backend?` · ${EF(d.backend)}`:""]})]}),d.description&&u.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skills.length===0&&c.length===0&&u.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function o_({icon:e,title:t,values:n}){return u.jsxs("section",{className:"agentsel-info-section",children:[u.jsxs("h3",{children:[e,t]}),u.jsx("div",{className:"agentsel-chips",children:n.map((r,i)=>u.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${i}`))})]})}function wF({runtime:e}){const[t,n]=_.useState(null),[r,i]=_.useState(!0),[s,a]=_.useState(""),o=e.runtimeId,l=e.region;_.useEffect(()=>{let d=!0;return i(!0),a(""),n(null),nE(o,l).then(f=>d&&n(f)).catch(f=>d&&a(pI(f instanceof Error?f.message:String(f)))).finally(()=>d&&i(!1)),()=>{d=!1}},[o,l]);const c=[];if(t){t.model&&c.push(["模型",t.model]),t.description&&c.push(["描述",t.description]),t.status&&c.push(["状态",mI(t.status)]),t.region&&c.push(["区域",mF(t.region)]);const d=t.resources,f=[d.cpuMilli!=null?`CPU ${d.cpuMilli}m`:"",d.memoryMb!=null?`内存 ${d.memoryMb}MB`:"",d.minInstance!=null||d.maxInstance!=null?`实例 ${d.minInstance??"?"}~${d.maxInstance??"?"}`:""].filter(Boolean).join(" · ");f&&c.push(["资源",f]),t.currentVersion!=null&&c.push(["版本",String(t.currentVersion)])}return u.jsxs("div",{className:"agentsel-detail-body",children:[u.jsxs("div",{className:"agentsel-runtime-identity",children:[u.jsx(hI,{}),u.jsxs("div",{children:[u.jsx("strong",{title:e.name,children:e.name}),u.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?u.jsxs("div",{className:"agentsel-apps-note",children:[u.jsx(xt,{className:"icon spin"})," 读取详情…"]}):s?u.jsx("div",{className:"agentsel-error",children:s}):t?u.jsxs(u.Fragment,{children:[u.jsx("dl",{className:"agentsel-kv",children:c.map(([d,f])=>u.jsxs("div",{className:"agentsel-kv-row",children:[u.jsx("dt",{children:d}),u.jsx("dd",{children:f})]},d))}),t.envs.length>0&&u.jsxs("div",{className:"agentsel-envs",children:[u.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>u.jsxs("div",{className:"agentsel-env",children:[u.jsx("span",{className:"agentsel-env-k",children:d.key}),u.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function _F(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}const TF={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function mI(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return TF[t]??(e||"-")}const iE="/assets/volcengine-DM14a-L-.svg",l_="(max-width: 860px)",NF=54;function SF(){return u.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M12.5 3 5.5 13h5l-1 8 8-11h-5l.5-7z",fill:"currentColor",stroke:"none"}),u.jsx("path",{d:"M19 4.5v3M17.5 6h3",opacity:"0.85"})]})}function kF(){return u.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("circle",{cx:"8.25",cy:"7.75",r:"3.15"}),u.jsx("path",{d:"M2.9 19.2c.45-3.45 2.48-5.35 5.35-5.35 2.4 0 4.2 1.28 4.98 3.66"}),u.jsx("path",{d:"M17.4 4.5v15M14.8 9h5.2M14.8 15.3h5.2"}),u.jsx("circle",{cx:"17.4",cy:"9",r:"1.15",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"17.4",cy:"15.3",r:"1.15",fill:"currentColor",stroke:"none"})]})}function AF(e){let t=2166136261;for(const r of e)t^=r.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 CF={admin:"管理员",developer:"开发者",user:"普通用户"};function c_({role:e}){const t=CF[e];return u.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function IF({access:e,userInfo:t,onLogout:n}){const[r,i]=_.useState(!1),[s,a]=_.useState("");if(!t)return null;const o=M9(t),l=typeof t.email=="string"?t.email:"",c=(o||"U").slice(0,1).toUpperCase(),d=AF(o||l||c),f=D9(t),h=f===s?"":f;return u.jsxs("div",{className:"sidebar-user",children:[u.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(p=>!p),title:l?`${o} -${l}`:o,children:[u.jsxs("span",{className:`account-avatar${h?" has-image":""}`,style:d,children:[c,h?u.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),u.jsxs("span",{className:"sidebar-user-identity",children:[u.jsxs("span",{className:"sidebar-user-primary",children:[u.jsx("span",{className:"sidebar-user-name",children:o}),u.jsx(c_,{role:e.role})]}),l&&l!==o&&u.jsx("span",{className:"sidebar-user-email",children:l})]})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),u.jsxs("div",{className:"account-pop sidebar-user-pop",children:[u.jsxs("div",{className:"account-head",children:[u.jsxs("span",{className:`account-avatar account-avatar--lg${h?" has-image":""}`,style:d,children:[c,h?u.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),u.jsxs("div",{className:"account-id",children:[u.jsxs("div",{className:"account-name-row",children:[u.jsx("div",{className:"account-name",children:o}),u.jsx(c_,{role:e.role})]}),l&&l!==o&&u.jsx("div",{className:"account-sub",children:l})]})]}),u.jsxs("button",{className:"account-logout",onClick:()=>{i(!1),n()},children:[u.jsx(o9,{className:"icon"})," 退出登录"]})]})]})]})}function OF({branding:e,sessions:t,currentSessionId:n,features:r,access:i,streamingSids:s,agentsSource:a="local",localApps:o=[],currentAgentId:l="",currentAgentLabel:c="",currentRuntime:d,onSelectAgent:f,onNewChat:h,onSearch:p,onQuickCreate:m,onSkillCenter:y,onAddAgent:v,onManageAgents:g,onPickSession:E,onDeleteSession:b,userInfo:w,onLogout:N}){const T=R=>(r==null?void 0:r[R])!==!1,[A,S]=_.useState(null),[O,I]=_.useState(!1),D=_.useRef(typeof window<"u"&&window.matchMedia(l_).matches),[F,W]=_.useState(D.current),j=()=>{I(R=>!R)},$=[...t].sort((R,L)=>(L.lastUpdateTime??0)-(R.lastUpdateTime??0)),C=()=>{D.current=!1,W(R=>!R),I(!1),S(null)};return _.useEffect(()=>{const R=window.matchMedia(l_),L=M=>{M.matches?W(k=>k||(D.current=!0,!0)):D.current&&(D.current=!1,W(!1))};return R.addEventListener("change",L),()=>R.removeEventListener("change",L)},[]),u.jsxs("aside",{className:`sidebar ${F?"is-collapsed":""}`,children:[u.jsxs("div",{className:"sidebar-top",children:[u.jsxs("div",{className:"sidebar-brand-row",children:[u.jsxs("div",{className:"brand",children:[u.jsx("img",{className:"brand-logo",src:e.logoUrl||iE,width:20,height:20,alt:"","aria-hidden":!0}),u.jsx("span",{className:"brand-title",children:e.title})]}),u.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:C,"aria-label":F?"展开侧边栏":"收起侧边栏",title:F?"展开侧边栏":"收起侧边栏",children:F?u.jsx(f9,{className:"icon"}):u.jsx(d9,{className:"icon"})})]}),f&&(()=>{const R=a==="cloud"&&!l,L=a==="cloud"&&!R&&!!d,M=a==="cloud"&&!R&&(d!=null&&d.region)?d.region==="cn-beijing"?"北京":d.region==="cn-shanghai"?"上海":d.region:"";return u.jsxs("button",{className:`agent-row ${R?"agent-row--empty":""} ${L?"agent-row--connected":""}`,onClick:j,"aria-label":R?"请选择 Agent":c||"选择 Agent",title:"切换 Agent",children:[u.jsx(Vh,{className:"icon agent-row-lead"}),u.jsx("span",{className:"agent-row-name",children:R?"请选择 Agent":c||"选择 Agent"}),M&&u.jsx("span",{className:"agent-row-region",children:M}),u.jsx(rr,{className:`icon agent-row-chev ${O?"open":""}`})]})})(),f&&u.jsx(gF,{open:O,onClose:()=>I(!1),anchorTop:NF,agentsSource:a,localApps:o,currentId:l,currentRuntime:d,runtimeScope:i.capabilities.runtimeScope,onSelect:f}),T("newChat")&&u.jsxs("button",{className:"new-chat",onClick:h,"aria-label":"新会话",title:"新会话",children:[u.jsx(li,{className:"icon"}),u.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),T("search")&&u.jsx(aF,{onClick:p}),T("skillCenter")&&u.jsx(G9,{onClick:y}),i.capabilities.createAgents&&T("addAgent")&&u.jsxs("button",{className:"new-chat",onClick:m,"aria-label":"添加 Agent",title:"添加 Agent",children:[u.jsx(SF,{}),u.jsx("span",{className:"sidebar-nav-label",children:"添加 Agent"})]}),i.capabilities.manageAgents&&T("manageAgents")&&u.jsxs("button",{className:"new-chat",onClick:g,"aria-label":"管理 Agent",title:"管理 Agent",children:[u.jsx(kF,{}),u.jsx("span",{className:"sidebar-nav-label",children:"管理 Agent"})]})]}),T("history")&&u.jsxs("div",{className:"sidebar-history",children:[u.jsxs("div",{className:"history-head",children:[u.jsx("span",{children:"历史会话"}),T("newChat")&&u.jsx("button",{type:"button",className:"history-new-chat",onClick:h,"aria-label":"新建会话",title:"新建会话",children:u.jsx(li,{className:"icon"})})]}),u.jsxs("div",{className:"history-list",children:[$.length===0&&u.jsx("div",{className:"history-empty",children:"暂无会话"}),$.map(R=>{const L=aI(R.events);return u.jsxs("div",{className:`history-item ${R.id===n?"active":""}`,children:[u.jsxs("button",{className:"history-item-btn",onClick:()=>E(R.id),title:L,children:[(s==null?void 0:s.has(R.id))&&u.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),u.jsx("span",{className:"history-title",children:L})]}),u.jsx("button",{className:"history-more",title:"更多",onClick:()=>S(M=>M===R.id?null:R.id),children:u.jsx(K8,{className:"icon"})}),A===R.id&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>S(null)}),u.jsx("div",{className:"history-menu",children:u.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{S(null),b(R.id)},children:[u.jsx(Tl,{className:"icon"})," 删除"]})})]})]},R.id)})]})]}),u.jsx(IF,{access:i,userInfo:w,onLogout:N})]})}function RF({apps:e,appName:t,onAppChange:n,agentLabel:r,title:i,crumbs:s,rightContent:a}){return u.jsxs("div",{className:"navbar",children:[u.jsxs("div",{className:"navbar-left",children:[u.jsx("div",{className:"navbar-default",children:s&&s.length>0?u.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:s.map((o,l)=>u.jsxs(_.Fragment,{children:[l>0&&u.jsx(rr,{className:"crumb-sep"}),o.onClick?u.jsx("button",{className:"crumb crumb-link",onClick:o.onClick,children:o.label}):u.jsx("span",{className:"crumb crumb-current",children:o.label})]},l))}):i?u.jsx("div",{className:"navbar-title",title:i,children:i}):u.jsx(LF,{apps:e,appName:t,onAppChange:n,agentLabel:r})}),u.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),u.jsxs("div",{className:"navbar-right",children:[u.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),a]})]})}function LF({apps:e,appName:t,onAppChange:n,agentLabel:r}){const[i,s]=_.useState(!1),[a,o]=_.useState(null),[l,c]=_.useState({}),[d,f]=_.useState(0),h=_.useRef({}),p=v=>r?r(v):v;function m(v){o(v);const g=h.current[v];if(g){const E=g.getBoundingClientRect(),b=g.closest(".agent-dd");if(b){const w=b.getBoundingClientRect();f(E.top-w.top)}}l[v]===void 0&&(c(E=>({...E,[v]:"loading"})),Ju(v).then(E=>c(b=>({...b,[v]:E}))).catch(()=>c(E=>({...E,[v]:"error"}))))}function y(){s(!1),o(null)}return u.jsxs("div",{className:"agent-dd",children:[u.jsxs("button",{className:"agent-dd-trigger",onClick:()=>s(v=>!v),children:[u.jsx("span",{className:"agent-dd-current",children:t?p(t):"选择 Agent"}),u.jsx(Fh,{className:`agent-dd-chev ${i?"open":""}`})]}),i&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:y}),u.jsx("div",{className:"agent-dd-menu",children:e.map(v=>u.jsx("div",{ref:g=>h.current[v]=g,className:"agent-dd-row",onMouseEnter:()=>m(v),onMouseLeave:()=>o(g=>g===v?null:g),children:u.jsxs("button",{className:`agent-dd-item ${v===t?"active":""}`,onClick:()=>{n(v),y()},children:[u.jsx("span",{className:"agent-dd-item-name",children:p(v)}),v===t&&u.jsx("span",{className:"agent-dd-item-dot","aria-label":"当前"})]})},v))}),a&&u.jsx(MF,{state:l[a],top:d})]})]})}function MF({state:e,top:t}){return u.jsx("div",{className:"agent-dd-flyout",style:{top:`${t}px`},children:e===void 0||e==="loading"?u.jsxs("div",{className:"agent-dd-fly-loading",children:[u.jsx(xt,{className:"icon spin"})," 加载中…"]}):e==="error"?u.jsx("div",{className:"agent-dd-fly-loading",children:"读取信息失败"}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"agent-dd-fly-name",children:e.name}),e.description&&u.jsx("div",{className:"agent-dd-fly-desc",children:e.description}),u.jsxs("div",{className:"agent-dd-fly-field",children:[u.jsx(TC,{className:"icon"}),u.jsx("span",{className:"agent-dd-fly-model",children:e.model})]}),e.tools.length>0&&u.jsxs("div",{className:"agent-dd-fly-field agent-dd-fly-field--tools",children:[u.jsx(Xb,{className:"icon"}),u.jsx("div",{className:"agent-dd-fly-chips",children:e.tools.map(n=>u.jsx("span",{className:"agent-dd-chip",children:n},n))})]}),e.subAgents.length>0&&u.jsxs("div",{className:"agent-dd-fly-field",children:[u.jsx("span",{className:"agent-dd-fly-label",children:"子 Agent"}),u.jsx("span",{className:"agent-dd-fly-model",children:e.subAgents.join("、")})]})]})})}const u_={llm:{icon:ka,label:"LLM"},sequential:{icon:CC,label:"顺序"},parallel:{icon:DC,label:"并行"},loop:{icon:Gb,label:"循环"},a2a:{icon:$p,label:"A2A"}};function gI(e){return 1+e.children.reduce((t,n)=>t+gI(n),0)}function nl(e){return e.id||e.name}function DF(e,t){const n=nl(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const r=/^agent_sub_(\d+)$/.exec(n);return r?`子 Agent ${r[1]}`:e.name||n}function yI(e,t=!0){return{...e,id:nl(e),name:DF(e,t),children:e.children.map(n=>yI(n,!1))}}function bI(e,t){t.set(nl(e),e.name||nl(e)),e.children.forEach(n=>bI(n,t))}function EI({node:e,activeAgent:t,seen:n,path:r}){const i=u_[e.type]??u_.llm,s=i.icon,a=nl(e),o=!!a,l=o&&a===t,c=o&&!l&&r.has(a),d=o&&!l&&!c&&n.has(a);return u.jsxs("div",{className:"topo-branch",children:[u.jsxs("div",{className:`topo-node topo-type-${e.type} ${l?"is-active":""} ${c?"is-onpath":""} ${d?"is-done":""}`,title:e.description||e.name,children:[u.jsx(s,{className:"topo-icon"}),u.jsx("span",{className:"topo-name",children:e.name||"(未命名)"}),u.jsx("span",{className:"topo-badge",children:i.label})]}),l&&e.type==="a2a"&&u.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&u.jsx("div",{className:"topo-children",children:e.children.map((f,h)=>u.jsx(EI,{node:f,activeAgent:t,seen:n,path:r},`${nl(f)}-${h}`))})]})}function d_({appName:e,activeAgent:t,seenAgents:n,execPath:r=[]}){const[i,s]=_.useState(null);if(_.useEffect(()=>{let l=!1;if(s(null),!!e)return Ju(e).then(c=>{l||s(c.graph?yI(c.graph):null)}).catch(()=>{l||s(null)}),()=>{l=!0}},[e]),!i||i.children.length===0)return null;const a=new Set(r),o=new Map;return bI(i,o),u.jsxs("aside",{className:"topo","aria-label":"Agent 拓扑",children:[u.jsxs("div",{className:"topo-head",children:[u.jsx("span",{className:"topo-head-title",children:"Agent 拓扑"}),u.jsxs("span",{className:"topo-head-sub",children:[gI(i)," 个"]})]}),r.length>0&&u.jsx("div",{className:"topo-path","aria-label":"执行路径",children:r.map((l,c)=>u.jsxs("span",{className:"topo-path-seg",children:[c>0&&u.jsx(rr,{className:"topo-path-sep"}),u.jsx("span",{className:c===r.length-1?"topo-path-name is-current":"topo-path-name",children:o.get(l)??l})]},`${l}-${c}`))}),u.jsx("div",{className:"topo-tree",children:u.jsx(EI,{node:i,activeAgent:t,seen:n,path:a})})]})}function PF({onAdded:e,onCancel:t}){const[n,r]=_.useState(""),[i,s]=_.useState(""),[a,o]=_.useState(""),[l,c]=_.useState(!1),[d,f]=_.useState(""),h=n.trim().length>0&&i.trim().length>0&&!l;async function p(){if(h){c(!0),f("");try{const m=await dI(a,n,i,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),c(!1);return}e(Ca(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),c(!1)}}}return u.jsx("div",{className:"addagent",children:u.jsxs("div",{className:"addagent-card",children:[u.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),u.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),u.jsxs("label",{className:"addagent-field",children:[u.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),u.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),u.jsxs("label",{className:"addagent-field",children:[u.jsx("span",{className:"addagent-label",children:"API Key"}),u.jsx("input",{className:"addagent-input",type:"password",value:i,onChange:m=>s(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),u.jsxs("label",{className:"addagent-field",children:[u.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),u.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&u.jsx("div",{className:"addagent-error",children:d}),u.jsxs("div",{className:"addagent-actions",children:[u.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:l,children:"取消"}),u.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[l?u.jsx(xt,{className:"icon spin"}):null,l?"连接中…":"连接并添加"]})]})]})})}function jF({currentRuntimeId:e,onConnect:t}){const[n,r]=_.useState([]),[i,s]=_.useState(!0),[a,o]=_.useState(""),[l,c]=_.useState(null),[d,f]=_.useState(null),[h,p]=_.useState(null),[m,y]=_.useState({}),[v,g]=_.useState("cn-beijing"),[E,b]=_.useState(!1),w=_.useCallback(async()=>{s(!0),o("");try{r(await XC(v))}catch(O){o(O instanceof Error?O.message:String(O))}finally{s(!1)}},[v]);_.useEffect(()=>{w()},[w]);async function N(O){y(D=>({...D,[O.runtimeId]:{loading:!0}}));const I={loading:!1};try{I.detail=await nE(O.runtimeId,O.region)}catch(D){I.error=D instanceof Error?D.message:String(D)}I.detail&&(I.graphs=[{name:I.detail.name,description:I.detail.description,type:"llm",model:I.detail.model,tools:[],skills:[],path:[I.detail.name],mentionable:!1,children:[]}],I.graphNote="仅显示主 Agent(控制面信息)。"),y(D=>({...D,[O.runtimeId]:I}))}function T(O){const I=h===O.runtimeId;p(I?null:O.runtimeId),!I&&!m[O.runtimeId]&&N(O)}async function A(O){if(!l&&window.confirm(`确定删除 Agent "${O.name}"?该 Runtime 将被永久删除。`)){c(O.runtimeId),o("");try{await tI(O.runtimeId,O.region),r(I=>I.filter(D=>D.runtimeId!==O.runtimeId))}catch(I){o(I instanceof Error?I.message:String(I))}finally{c(null)}}}async function S(O){if(!(d||e===O.runtimeId)){f(O.runtimeId),o("");try{await t(O)}catch(I){o(I instanceof Error?I.message:String(I))}finally{f(null)}}}return u.jsxs("div",{className:"manage",children:[u.jsxs("div",{className:"manage-head",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"manage-title",children:"管理 Agent"}),u.jsx("p",{className:"manage-sub",children:"列出你有权管理的 AgentKit Runtime"})]}),u.jsxs("div",{className:"manage-head-actions",children:[u.jsxs("div",{className:"manage-region-picker",onKeyDown:O=>{O.key==="Escape"&&b(!1)},children:[u.jsxs("button",{type:"button",className:"manage-region",onClick:()=>b(O=>!O),title:"按区域筛选","aria-label":"区域筛选","aria-haspopup":"listbox","aria-expanded":E,children:[u.jsx("span",{children:v==="cn-beijing"?"北京":"上海"}),u.jsx(Fh,{className:`manage-region-chevron${E?" is-open":""}`})]}),E&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>b(!1)}),u.jsx("div",{className:"manage-region-menu",role:"listbox","aria-label":"区域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(O=>{const I=O.value===v;return u.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`manage-region-option${I?" is-selected":""}`,onClick:()=>{g(O.value),b(!1)},children:[u.jsx("span",{children:O.label}),I&&u.jsx(Ai,{"aria-hidden":"true"})]},O.value)})})]})]}),u.jsxs("button",{type:"button",className:"manage-refresh",onClick:()=>void w(),disabled:i,title:"刷新",children:[u.jsx(qb,{className:`icon ${i?"spin":""}`}),"刷新"]})]})]}),a&&u.jsx("div",{className:"manage-error",children:a}),i?u.jsxs("div",{className:"manage-empty",children:[u.jsx(xt,{className:"icon spin"})," 加载中…"]}):n.length===0?u.jsx("div",{className:"manage-empty",children:"暂无你部署的 Agent。"}):u.jsx("ul",{className:"manage-list",children:n.map(O=>{const I=h===O.runtimeId,D=m[O.runtimeId];return u.jsxs("li",{className:"manage-item",children:[u.jsxs("div",{className:"manage-item-row",children:[u.jsxs("button",{type:"button",className:"manage-item-toggle",onClick:()=>T(O),"aria-expanded":I,children:[I?u.jsx(Fh,{className:"icon"}):u.jsx(rr,{className:"icon"}),u.jsxs("span",{className:"manage-item-main",children:[u.jsx("span",{className:"manage-item-name",children:O.name}),u.jsx("span",{className:`manage-badge is-${HF(O.status)}`,children:O.status||"-"})]})]}),u.jsxs("div",{className:"manage-item-actions",children:[u.jsxs("button",{type:"button",className:"manage-connect",onClick:()=>void S(O),disabled:d!==null||e===O.runtimeId,children:[d===O.runtimeId?u.jsx(xt,{className:"icon spin"}):u.jsx(r9,{className:"icon"}),e===O.runtimeId?"已连接":"连接到此 Agent"]}),u.jsx("button",{type:"button",className:"manage-del",onClick:()=>void A(O),disabled:l===O.runtimeId,title:"删除该 Runtime",children:l===O.runtimeId?u.jsx(xt,{className:"icon spin"}):u.jsx(Tl,{className:"icon"})})]})]}),u.jsxs("div",{className:"manage-item-meta",children:[u.jsx("span",{className:"manage-item-id",title:O.runtimeId,children:O.runtimeId}),u.jsx("span",{className:"manage-item-dot",children:"·"}),u.jsx("span",{children:O.region}),O.createdAt&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"manage-item-dot",children:"·"}),u.jsx("span",{children:vI(O.createdAt)})]})]}),I&&u.jsx("div",{className:"manage-detail",children:!D||D.loading?u.jsxs("div",{className:"manage-detail-loading",children:[u.jsx(xt,{className:"icon spin"})," 读取详情…"]}):u.jsxs(u.Fragment,{children:[D.error&&u.jsx("div",{className:"manage-error",children:D.error}),D.detail&&u.jsx(UF,{detail:D.detail}),u.jsx("div",{className:"manage-tree-head",children:"Agent 结构"}),D.graphs&&D.graphs.length>0?D.graphs.map((F,W)=>u.jsx(xI,{node:F},W)):u.jsx("div",{className:"manage-tree-note",children:D.graphNote})]})})]},O.runtimeId)})})]})}const BF=/KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL/i;function FF({envKey:e,value:t}){const[n,r]=_.useState(!1);return!BF.test(e)||n?u.jsx("code",{className:"manage-env-v",children:t}):u.jsx("button",{type:"button",className:"manage-env-v manage-env-masked",title:"敏感值已隐藏,点击显示","aria-label":`显示 ${e} 的值`,onClick:()=>r(!0),children:"••••••••"})}function UF({detail:e}){const t=e.resources,n=[];e.model&&n.push(["模型",e.model]),e.description&&n.push(["描述",e.description]),e.statusMessage&&n.push(["状态信息",e.statusMessage]),e.project&&n.push(["Project",e.project]),e.currentVersion!=null&&n.push(["版本",String(e.currentVersion)]);const r=[t.cpuMilli!=null?`CPU ${t.cpuMilli}m`:"",t.memoryMb!=null?`内存 ${t.memoryMb}MB`:"",t.minInstance!=null||t.maxInstance!=null?`实例 ${t.minInstance??"?"}~${t.maxInstance??"?"}`:"",t.maxConcurrency!=null?`并发 ${t.maxConcurrency}`:""].filter(Boolean).join(" · ");return r&&n.push(["资源",r]),e.memoryId&&n.push(["Memory",e.memoryId]),e.toolId&&n.push(["Tool",e.toolId]),e.knowledgeId&&n.push(["Knowledge",e.knowledgeId]),e.mcpToolsetId&&n.push(["MCP Toolset",e.mcpToolsetId]),e.updatedAt&&n.push(["更新时间",vI(e.updatedAt)]),u.jsxs("div",{className:"manage-detail-card",children:[u.jsx("dl",{className:"manage-kv",children:n.map(([i,s])=>u.jsxs("div",{className:"manage-kv-row",children:[u.jsx("dt",{children:i}),u.jsx("dd",{children:s})]},i))}),e.envs.length>0&&u.jsxs("div",{className:"manage-envs",children:[u.jsx("div",{className:"manage-envs-head",children:"环境变量"}),e.envs.map(i=>u.jsxs("div",{className:"manage-env",children:[u.jsx("code",{className:"manage-env-k",children:i.key}),u.jsx(FF,{envKey:i.key,value:i.value})]},i.key))]})]})}const $F={llm:"LLM",sequential:"Sequential",parallel:"Parallel",loop:"Loop",a2a:"A2A"};function xI({node:e,depth:t=0}){return u.jsxs("div",{className:"manage-tree",style:{marginLeft:t?16:0},children:[u.jsxs("div",{className:"manage-tree-node",children:[u.jsx("span",{className:"manage-tree-name",children:e.name||"(未命名)"}),u.jsx("span",{className:"manage-tree-type",children:$F[e.type]||e.type}),e.model&&u.jsx("span",{className:"manage-tree-model",children:e.model})]}),e.tools.length>0&&u.jsx("div",{className:"manage-tree-tools",children:e.tools.map(n=>u.jsx("span",{className:"manage-tree-tool",children:n},n))}),e.children.map((n,r)=>u.jsx(xI,{node:n,depth:t+1},r))]})}function HF(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}function vI(e){const t=Number(e),n=Number.isFinite(t)&&String(t)===e?new Date(t*1e3):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()}const zF={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 VF(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const i of n){if(r==null||typeof r!="object")return;r=r[i]}return r}function KF(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function YF(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function sE(e,t){if(KF(e))return VF(t,e.path);if(YF(e)){const n=zF[e.call],r={};for(const[i,s]of Object.entries(e.args??{}))r[i]=sE(s,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function WF(e,t){const n=sE(e,t);return n==null?"":typeof n=="string"?n:String(n)}const wI=new Map;function Ua(e,t){wI.set(e,t)}function qF(e){return wI.get(e)}function GF(e,t,n){const r=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(let s=0;ssE(r,e.dataModel),resolveString:r=>WF(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const i=e.components[r];if(!i)return null;const s=qF(i.component)??XF;return u.jsx(s,{node:i,ctx:n},r)}};return u.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function TI(e){const t=_.useRef(null),n=_.useRef(!0),r=28,i=_.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:i}}function qle(){}function f_(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&t.push(a),i=r+1,r=n.indexOf(",",i)}return t}function NI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ZF=/[$_\p{ID_Start}]/u,JF=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,eU=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,tU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SI={};function Gle(e){return e?ZF.test(String.fromCodePoint(e)):!1}function Xle(e,t){const r=(t||SI).jsx?eU:JF;return e?r.test(String.fromCodePoint(e)):!1}function h_(e,t){return(SI.jsx?nU:tU).test(e)}const rU=/[ \t\n\f\r]/g;function iU(e){return typeof e=="object"?e.type==="text"?p_(e.value):!1:p_(e)}function p_(e){return e.replace(rU,"")===""}let ed=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};ed.prototype.normal={};ed.prototype.property={};ed.prototype.space=void 0;function kI(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ed(n,r,t)}function wu(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 sU=0;const qe=$a(),yn=$a(),Ry=$a(),me=$a(),Mt=$a(),jo=$a(),xr=$a();function $a(){return 2**++sU}const Ly=Object.freeze(Object.defineProperty({__proto__:null,boolean:qe,booleanish:yn,commaOrSpaceSeparated:xr,commaSeparated:jo,number:me,overloadedBoolean:Ry,spaceSeparated:Mt},Symbol.toStringTag,{value:"Module"})),gg=Object.keys(Ly);class aE extends yr{constructor(t,n,r,i){let s=-1;if(super(t,n),m_(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&uU.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(g_,fU);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!g_.test(s)){let a=s.replace(cU,dU);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=aE}return new i(r,t)}function dU(e){return"-"+e.toLowerCase()}function fU(e){return e.charAt(1).toUpperCase()}const td=kI([AI,aU,OI,RI,LI],"html"),Ks=kI([AI,oU,OI,RI,LI],"svg");function y_(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function MI(e){return e.join(" ").trim()}var oE={},b_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hU=/\n/g,pU=/^\s*/,mU=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,gU=/^:\s*/,yU=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,bU=/^[;\s]*/,EU=/^\s+|\s+$/g,xU=` -`,E_="/",x_="*",sa="",vU="comment",wU="declaration";function _U(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var y=m.match(hU);y&&(n+=y.length);var v=m.lastIndexOf(xU);r=~v?m.length-v:r+m.length}function s(){var m={line:n,column:r};return function(y){return y.position=new a(m),c(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var v=y[0];return i(v),e=e.slice(v.length),y}}function c(){l(pU)}function d(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=s();if(!(E_!=e.charAt(0)||x_!=e.charAt(1))){for(var y=2;sa!=e.charAt(y)&&(x_!=e.charAt(y)||E_!=e.charAt(y+1));)++y;if(y+=2,sa===e.charAt(y-1))return o("End of comment missing");var v=e.slice(2,y-2);return r+=2,i(v),e=e.slice(y),r+=2,m({type:vU,comment:v})}}function h(){var m=s(),y=l(mU);if(y){if(f(),!l(gU))return o("property missing ':'");var v=l(yU),g=m({type:wU,property:v_(y[0].replace(b_,sa)),value:v?v_(v[0].replace(b_,sa)):sa});return l(bU),g}}function p(){var m=[];d(m);for(var y;y=h();)y!==!1&&(m.push(y),d(m));return m}return c(),p()}function v_(e){return e?e.replace(EU,sa):sa}var TU=_U,NU=ah&&ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(oE,"__esModule",{value:!0});oE.default=kU;const SU=NU(TU);function kU(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,SU.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var Yp={};Object.defineProperty(Yp,"__esModule",{value:!0});Yp.camelCase=void 0;var AU=/^--[a-zA-Z0-9_-]+$/,CU=/-([a-z])/g,IU=/^[^-]+$/,OU=/^-(webkit|moz|ms|o|khtml)-/,RU=/^-(ms)-/,LU=function(e){return!e||IU.test(e)||AU.test(e)},MU=function(e,t){return t.toUpperCase()},w_=function(e,t){return"".concat(t,"-")},DU=function(e,t){return t===void 0&&(t={}),LU(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(RU,w_):e=e.replace(OU,w_),e.replace(CU,MU))};Yp.camelCase=DU;var PU=ah&&ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jU=PU(oE),BU=Yp;function My(e,t){var n={};return!e||typeof e!="string"||(0,jU.default)(e,function(r,i){r&&i&&(n[(0,BU.camelCase)(r,t)]=i)}),n}My.default=My;var FU=My;const UU=Uu(FU),Wp=DI("end"),Ci=DI("start");function DI(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $U(e){const t=Ci(e),n=Wp(e);if(t&&n)return{start:t,end:n}}function Bc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?__(e.position):"start"in e||"end"in e?__(e):"line"in e||"column"in e?Dy(e):""}function Dy(e){return T_(e&&e.line)+":"+T_(e&&e.column)}function __(e){return Dy(e&&e.start)+"-"+Dy(e&&e.end)}function T_(e){return e&&typeof e=="number"?e:1}class qn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Bc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qn.prototype.file="";qn.prototype.name="";qn.prototype.reason="";qn.prototype.message="";qn.prototype.stack="";qn.prototype.column=void 0;qn.prototype.line=void 0;qn.prototype.ancestors=void 0;qn.prototype.cause=void 0;qn.prototype.fatal=void 0;qn.prototype.place=void 0;qn.prototype.ruleId=void 0;qn.prototype.source=void 0;const lE={}.hasOwnProperty,HU=new Map,zU=/[A-Z]/g,VU=new Set(["table","tbody","thead","tfoot","tr"]),KU=new Set(["td","th"]),PI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function YU(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=e7(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");r=JU(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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"?Ks:td,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=jI(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function jI(e,t,n){if(t.type==="element")return WU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qU(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XU(e,t,n);if(t.type==="mdxjsEsm")return GU(e,t);if(t.type==="root")return QU(e,t,n);if(t.type==="text")return ZU(e,t)}function WU(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ks,e.schema=i),e.ancestors.push(t);const s=FI(e,t.tagName,!1),a=t7(e,t);let o=uE(e,t);return VU.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!iU(l):!0})),BI(e,a,s,t),cE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function qU(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}_u(e,t.position)}function GU(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);_u(e,t.position)}function XU(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ks,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:FI(e,t.name,!0),a=n7(e,t),o=uE(e,t);return BI(e,a,s,t),cE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function QU(e,t,n){const r={};return cE(r,uE(e,t)),e.create(t,e.Fragment,r,n)}function ZU(e,t){return t.value}function BI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function cE(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function JU(e,t,n){return r;function r(i,s,a,o){const c=Array.isArray(a.children)?n:t;return o?c(s,a,o):c(s,a)}}function e7(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=Ci(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function t7(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&lE.call(t.properties,i)){const s=r7(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&KU.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function n7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else _u(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else _u(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function uE(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:HU;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s0?(Sr(e,e.length,0,t),e):t}const k_={}.hasOwnProperty;function $I(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 ai(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const tr=Ys(/[A-Za-z]/),Yn=Ys(/[\dA-Za-z]/),f7=Ys(/[#-'*+\--9=?A-Z^-~]/);function Kh(e){return e!==null&&(e<32||e===127)}const Py=Ys(/\d/),h7=Ys(/[\dA-Fa-f]/),p7=Ys(/[!-/:-@[-`{-~]/);function je(e){return e!==null&&e<-2}function Ct(e){return e!==null&&(e<0||e===32)}function nt(e){return e===-2||e===-1||e===32}const qp=Ys(new RegExp("\\p{P}|\\p{S}","u")),Ia=Ys(/\s/);function Ys(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function kl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ut(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return nt(l)?(e.enter(n),o(l)):t(l)}function o(l){return nt(l)&&s++a))return;const A=t.events.length;let S=A,O,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(O){I=t.events[S][1].end;break}O=!0}for(g(r),T=A;Tb;){const N=n[w];t.containerState=N[1],N[0].exit.call(t,e)}n.length=b}function E(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function E7(e,t,n){return ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rl(e){if(e===null||Ct(e)||Ia(e))return 1;if(qp(e))return 2}function Gp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};C_(f,-l),C_(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Pr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Pr(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Pr(c,Gp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Pr(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Pr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Sr(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&nt(T)?ut(e,E,"linePrefix",s+1)(T):E(T)}function E(T){return T===null||je(T)?e.check(I_,y,w)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||je(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),b)}function w(T){return e.exit("codeFenced"),t(T)}function N(T,A,S){let O=0;return I;function I($){return T.enter("lineEnding"),T.consume($),T.exit("lineEnding"),D}function D($){return T.enter("codeFencedFence"),nt($)?ut(T,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):F($)}function F($){return $===o?(T.enter("codeFencedFenceSequence"),W($)):S($)}function W($){return $===o?(O++,T.consume($),W):O>=a?(T.exit("codeFencedFenceSequence"),nt($)?ut(T,j,"whitespace")($):j($)):S($)}function j($){return $===null||je($)?(T.exit("codeFencedFence"),A($)):S($)}}}function O7(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const bg={name:"codeIndented",tokenize:L7},R7={partial:!0,tokenize:M7};function L7(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ut(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):je(c)?e.attempt(R7,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||je(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function M7(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):je(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):ut(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):je(a)?i(a):n(a)}}const D7={name:"codeText",previous:j7,resolve:P7,tokenize:B7};function P7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=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-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Zl(this.left,r),s.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),Zl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Zl(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(r.parser.constructs.flow,n,t)(a)}}function WI(e,t,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),h):g===null||g===32||g===41||Kh(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(o),h(g)):g===null||g===60||je(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!d&&(g===null||g===41||Ct(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):je(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||je(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!nt(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function GI(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===a?(e.exit(s),l(a)):h===null?n(h):je(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ut(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||je(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Fc(e,t){let n;return r;function r(i){return je(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):nt(i)?ut(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Y7={name:"definition",tokenize:q7},W7={partial:!0,tokenize:G7};function q7(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),a(p)}function a(p){return qI.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Ct(p)?Fc(e,c)(p):c(p)}function c(p){return WI(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(W7,f,f)(p)}function f(p){return nt(p)?ut(e,h,"whitespace")(p):h(p)}function h(p){return p===null||je(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function G7(e,t,n){return r;function r(o){return Ct(o)?Fc(e,i)(o):n(o)}function i(o){return GI(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return nt(o)?ut(e,a,"whitespace")(o):a(o)}function a(o){return o===null||je(o)?t(o):n(o)}}const X7={name:"hardBreakEscape",tokenize:Q7};function Q7(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return je(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Z7={name:"headingAtx",resolve:J7,tokenize:e$};function J7(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Sr(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function e$(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||Ct(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||je(d)?(e.exit("atxHeading"),t(d)):nt(d)?ut(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Ct(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const t$=["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"],R_=["pre","script","style","textarea"],n$={concrete:!0,name:"htmlFlow",resolveTo:s$,tokenize:a$},r$={partial:!0,tokenize:l$},i$={partial:!0,tokenize:o$};function s$(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 a$(e,t,n){const r=this;let i,s,a,o,l;return c;function c(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),s=!0,y):P===63?(e.consume(P),i=3,r.interrupt?t:k):tr(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,o=0,m):tr(P)?(e.consume(P),i=4,r.interrupt?t:k):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:k):n(P)}function m(P){const V="CDATA[";return P===V.charCodeAt(o++)?(e.consume(P),o===V.length?r.interrupt?t:F:m):n(P)}function y(P){return tr(P)?(e.consume(P),a=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||Ct(P)){const V=P===47,Q=a.toLowerCase();return!V&&!s&&R_.includes(Q)?(i=1,r.interrupt?t(P):F(P)):t$.includes(a.toLowerCase())?(i=6,V?(e.consume(P),g):r.interrupt?t(P):F(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?E(P):b(P))}return P===45||Yn(P)?(e.consume(P),a+=String.fromCharCode(P),v):n(P)}function g(P){return P===62?(e.consume(P),r.interrupt?t:F):n(P)}function E(P){return nt(P)?(e.consume(P),E):I(P)}function b(P){return P===47?(e.consume(P),I):P===58||P===95||tr(P)?(e.consume(P),w):nt(P)?(e.consume(P),b):I(P)}function w(P){return P===45||P===46||P===58||P===95||Yn(P)?(e.consume(P),w):N(P)}function N(P){return P===61?(e.consume(P),T):nt(P)?(e.consume(P),N):b(P)}function T(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),l=P,A):nt(P)?(e.consume(P),T):S(P)}function A(P){return P===l?(e.consume(P),l=null,O):P===null||je(P)?n(P):(e.consume(P),A)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||Ct(P)?N(P):(e.consume(P),S)}function O(P){return P===47||P===62||nt(P)?b(P):n(P)}function I(P){return P===62?(e.consume(P),D):n(P)}function D(P){return P===null||je(P)?F(P):nt(P)?(e.consume(P),D):n(P)}function F(P){return P===45&&i===2?(e.consume(P),C):P===60&&i===1?(e.consume(P),R):P===62&&i===4?(e.consume(P),Y):P===63&&i===3?(e.consume(P),k):P===93&&i===5?(e.consume(P),M):je(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(r$,G,W)(P)):P===null||je(P)?(e.exit("htmlFlowData"),W(P)):(e.consume(P),F)}function W(P){return e.check(i$,j,G)(P)}function j(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),$}function $(P){return P===null||je(P)?W(P):(e.enter("htmlFlowData"),F(P))}function C(P){return P===45?(e.consume(P),k):F(P)}function R(P){return P===47?(e.consume(P),a="",L):F(P)}function L(P){if(P===62){const V=a.toLowerCase();return R_.includes(V)?(e.consume(P),Y):F(P)}return tr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),L):F(P)}function M(P){return P===93?(e.consume(P),k):F(P)}function k(P){return P===62?(e.consume(P),Y):P===45&&i===2?(e.consume(P),k):F(P)}function Y(P){return P===null||je(P)?(e.exit("htmlFlowData"),G(P)):(e.consume(P),Y)}function G(P){return e.exit("htmlFlow"),t(P)}}function o$(e,t,n){const r=this;return i;function i(a){return je(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function l$(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(nd,t,n)}}const c$={name:"htmlText",tokenize:u$};function u$(e,t,n){const r=this;let i,s,a;return o;function o(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),N):k===63?(e.consume(k),b):tr(k)?(e.consume(k),S):n(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),s=0,m):tr(k)?(e.consume(k),E):n(k)}function d(k){return k===45?(e.consume(k),p):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),h):je(k)?(a=f,R(k)):(e.consume(k),f)}function h(k){return k===45?(e.consume(k),p):f(k)}function p(k){return k===62?C(k):k===45?h(k):f(k)}function m(k){const Y="CDATA[";return k===Y.charCodeAt(s++)?(e.consume(k),s===Y.length?y:m):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),v):je(k)?(a=y,R(k)):(e.consume(k),y)}function v(k){return k===93?(e.consume(k),g):y(k)}function g(k){return k===62?C(k):k===93?(e.consume(k),g):y(k)}function E(k){return k===null||k===62?C(k):je(k)?(a=E,R(k)):(e.consume(k),E)}function b(k){return k===null?n(k):k===63?(e.consume(k),w):je(k)?(a=b,R(k)):(e.consume(k),b)}function w(k){return k===62?C(k):b(k)}function N(k){return tr(k)?(e.consume(k),T):n(k)}function T(k){return k===45||Yn(k)?(e.consume(k),T):A(k)}function A(k){return je(k)?(a=A,R(k)):nt(k)?(e.consume(k),A):C(k)}function S(k){return k===45||Yn(k)?(e.consume(k),S):k===47||k===62||Ct(k)?O(k):n(k)}function O(k){return k===47?(e.consume(k),C):k===58||k===95||tr(k)?(e.consume(k),I):je(k)?(a=O,R(k)):nt(k)?(e.consume(k),O):C(k)}function I(k){return k===45||k===46||k===58||k===95||Yn(k)?(e.consume(k),I):D(k)}function D(k){return k===61?(e.consume(k),F):je(k)?(a=D,R(k)):nt(k)?(e.consume(k),D):O(k)}function F(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,W):je(k)?(a=F,R(k)):nt(k)?(e.consume(k),F):(e.consume(k),j)}function W(k){return k===i?(e.consume(k),i=void 0,$):k===null?n(k):je(k)?(a=W,R(k)):(e.consume(k),W)}function j(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Ct(k)?O(k):(e.consume(k),j)}function $(k){return k===47||k===62||Ct(k)?O(k):n(k)}function C(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function R(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),L}function L(k){return nt(k)?ut(e,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):M(k)}function M(k){return e.enter("htmlTextData"),a(k)}}const hE={name:"labelEnd",resolveAll:p$,resolveTo:m$,tokenize:g$},d$={tokenize:y$},f$={tokenize:b$},h$={tokenize:E$};function p$(e){let t=-1;const n=[];for(;++t=3&&(c===null||je(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),nt(c)?ut(e,o,"whitespace")(c):o(c))}}const cr={continuation:{tokenize:C$},exit:O$,name:"list",tokenize:A$},S$={partial:!0,tokenize:R$},k$={partial:!0,tokenize:I$};function A$(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Py(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Kf,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Py(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(nd,r.interrupt?n:d,e.attempt(S$,h,f))}function d(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return nt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function C$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(nd,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ut(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!nt(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(k$,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ut(e,e.attempt(cr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function I$(e,t,n){const r=this;return ut(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function O$(e){e.exit(this.containerState.type)}function R$(e,t,n){const r=this;return ut(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!nt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const L_={name:"setextUnderline",resolveTo:L$,tokenize:M$};function L$(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function M$(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),nt(c)?ut(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||je(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const D$={tokenize:P$};function P$(e){const t=this,n=e.attempt(nd,r,e.attempt(this.parser.constructs.flowInitial,i,ut(e,e.attempt(this.parser.constructs.flow,i,e.attempt($7,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const j$={resolveAll:QI()},B$=XI("string"),F$=XI("text");function XI(e){return{resolveAll:QI(e==="text"?U$:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(d){return c(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function J$(e,t){let n=-1;const r=[];let i;for(;++nc.startsWith("data:")).map(c=>c.slice(5).trimStart()).join(` +`);if(l)try{yield JSON.parse(l)}catch{l!=="[DONE]"&&l!=="ping"&&console.debug(`parseSSE: dropping unparseable frame (${l.length} chars):`,l.slice(0,200))}a=r.match(/\r?\n\r?\n/)}}}finally{try{await t.cancel()}catch{}finally{t.releaseLock()}}}const zp=3e4,R9=12e4,BC=1e4;function nd(e,t=zp){if(t<=0)return e??void 0;const n=AbortSignal.timeout(t);return e?AbortSignal.any([e,n]):n}const Jb="veadk_local_user",O9=/^[A-Za-z0-9]{1,16}$/;function FC(){try{return localStorage.getItem(Jb)}catch{return null}}function L9(e){try{localStorage.setItem(Jb,e)}catch{}}function M9(){try{localStorage.removeItem(Jb)}catch{}}function D9(e){const t=new Headers(e),n=FC();return n&&t.set("X-VeADK-Local-User",n),t}async function P9(){let e;try{e=await fetch("/web/auth-config",{headers:{Accept:"application/json"},signal:nd(void 0,BC)})}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 j9(e){const t=window.location.pathname+window.location.search+window.location.hash,n=e.includes("?")?"&":"?";window.location.assign(`${e}${n}redirect=${encodeURIComponent(t)}`)}function B9(){window.location.assign("/oauth2/logout")}async function F9(){let e;try{e=await fetch("/oauth2/userinfo",{headers:{Accept:"application/json"},signal:nd(void 0,BC)})}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=FC();return t?{status:"authenticated",userId:t,info:{name:t},local:!0}:{status:"unauthenticated",userId:"",local:!0}}function U9(e){return e?String(e.name??e.preferred_username??e.email??e.sub??""):""}function $9(e){const t=e==null?void 0:e.picture;return typeof t=="string"?t.trim():""}const Vf="",eE=new Map;function UC(e,t){eE.set(e,t)}function $C(){eE.clear()}function gi(e){const t=eE.get(e);return t?{app:t.app,ep:{base:t.base,apiKey:t.apiKey,runtimeId:t.runtimeId,region:t.region}}:{app:e,ep:{}}}function Tt(e,t={},n={},r=zp){const i={...t,headers:D9(t.headers),signal:nd(t.signal,r)};if(n.runtimeId){const s=n.region?`${e.includes("?")?"&":"?"}region=${encodeURIComponent(n.region)}`:"";return fetch($c(`${Vf}/web/runtime-proxy/${n.runtimeId}${e}${s}`),i)}if(n.base){const s=new Headers(i.headers);return s.set("X-AgentKit-Base",n.base),n.apiKey&&s.set("X-AgentKit-Key",n.apiKey),fetch($c(`${Vf}/agentkit-proxy${e}`),{...i,headers:s})}return fetch($c(`${Vf}${e}`),i)}function H9(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>{var n;if(t&&typeof t=="object"&&"msg"in t){const r=Array.isArray(t.loc)?(n=t.loc)==null?void 0:n.join("."):"",i=String(t.msg??"");return r?`${r}: ${i}`:i}return String(t)}).filter(Boolean).join(` +`):e&&typeof e=="object"?JSON.stringify(e):""}async function Jr(e,t){const n=await e.text().catch(()=>"");if(!n)return`${t} (${e.status})`;try{const r=JSON.parse(n);return H9(r.detail??r.error)||n||`${t} (${e.status})`}catch{return n||`${t} (${e.status})`}}async function HC(){const e=await Tt("/list-apps");if(!e.ok)throw new Error(`list-apps failed: ${e.status}`);return e.json()}class rd extends Error{constructor(){super("你没有权限访问该 Runtime,请刷新列表后重试。"),this.name="RuntimeAccessDeniedError"}}async function Vp(e,t,n){const r=await Tt("/list-apps",{},n??{base:e,apiKey:t});if((r.status===403||r.status===404)&&(n!=null&&n.runtimeId))throw new rd;if(!r.ok)throw new Error(await Jr(r,"读取 Agent 列表失败"));return r.json()}async function Hh(e,t){const{app:n,ep:r}=gi(e),i=await Tt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}"},r);if(!i.ok)throw new Error(`create session failed: ${i.status}`);return(await i.json()).id}async function tE(e,t){const{app:n,ep:r}=gi(e),i=await Tt(`/apps/${n}/users/${encodeURIComponent(t)}/sessions`,{},r);if(!i.ok)throw new Error(`list sessions failed: ${i.status}`);return i.json()}async function zh(e,t,n){const{app:r,ep:i}=gi(e),s=await Tt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{},i);if(!s.ok)throw new Error(`get session failed: ${s.status}`);return s.json()}async function Sy(e,t,n){const{app:r,ep:i}=gi(e),s=await Tt(`/apps/${r}/users/${encodeURIComponent(t)}/sessions/${n}`,{method:"DELETE"},i);if(!s.ok&&s.status!==404)throw new Error(`delete session failed: ${s.status}`)}async function z9(e){const t=await Tt("/web/media/capabilities");if(!t.ok)throw new Error(await Jr(t,"media capabilities failed"));return t.json()}async function zC(e,t,n,r){const{app:i}=gi(e),s=new FormData;s.set("app_name",i),s.set("user_id",t),s.set("session_id",n),s.set("file",r);const a=await Tt("/web/media",{method:"POST",body:s},{},R9);if(!a.ok)throw new Error(await Jr(a,"文件上传失败"));return{...await a.json(),status:"ready"}}async function ky(e,t,n){const{app:r}=gi(e),i=`/web/media/${encodeURIComponent(r)}/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,s=await Tt(i,{method:"DELETE"});if(!s.ok&&s.status!==404)throw new Error(await Jr(s,"media cleanup failed"))}function VC(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((r,i)=>![1,3,5].includes(i)).join("/")}`}catch{return}}async function Kf(e,t){const n=VC(t);if(!n)throw new Error("Invalid VeADK media URI");const r=await Tt(n,{method:"DELETE"});if(!r.ok&&r.status!==404)throw new Error(await Jr(r,"media cleanup failed"))}function KC(e,t){if(t.startsWith("data:")||t.startsWith("blob:")||/^https?:/.test(t))return t;const n=VC(t);if(!n)return t;const r=`${n}/content`;return $c(`${Vf}${r}`)}async function YC(e,t){const{app:n,ep:r}=gi(e),i=await Tt(`/dev/apps/${encodeURIComponent(n)}/debug/trace/session/${encodeURIComponent(t)}`,{},r);if(!i.ok)throw new Error(`trace failed: ${i.status}`);const s=i.headers.get("content-type")??"";if(!s.includes("application/json")){const o=s.split(";",1)[0]||"Content-Type 缺失";throw new Error(`trace failed: 服务端返回了非 JSON 响应(${o}),请检查 Studio API 代理配置`)}const a=await i.json();if(!Array.isArray(a))throw new Error("trace failed: 返回格式无效");return a}async function WC(e,t){const n=await Tt(`/web/agent-info/${e}`,{},t);if(!n.ok)throw new Error(`agent-info failed: ${n.status}`);const r=await n.json();return{name:r.name??e,description:r.description??"",type:r.type,model:r.model??"",tools:r.tools??[],skills:r.skills??[],subAgents:r.subAgents??[],components:r.components??[],searchSources:r.searchSources??[],graph:r.graph}}async function id(e){const{app:t,ep:n}=gi(e);return WC(t,n)}async function qC(e,t){const n={runtimeId:e,region:t},i=(await Vp("","",n))[0];if(!i)throw new Error("该 Runtime 未提供可预览的 Agent。");return WC(i,n)}async function GC(e,t,n,r){const{app:i,ep:s}=gi(e),a=new URLSearchParams({source:t,app_name:i,q:n,user_id:r}),o=await Tt(`/web/search?${a.toString()}`,{},s);if(!o.ok)throw new Error(await Jr(o,"Agent 检索失败"));return o.json()}async function XC(e,t){const{app:n}=gi(e),r=await Tt(`/web/search?source=web&app_name=${encodeURIComponent(n)}&q=${encodeURIComponent(t)}`);if(!r.ok)throw new Error(`web search failed: ${r.status}`);return r.json()}async function*Nu({appName:e,userId:t,sessionId:n,text:r,attachments:i=[],invocation:s,functionResponses:a=[],signal:o}){const{app:l,ep:c}=gi(e),d=i.flatMap(m=>m.status&&m.status!=="ready"?[]:m.uri?[{fileData:{mimeType:m.mimeType,fileUri:m.uri,displayName:m.name},partMetadata:{veadkMedia:{id:m.id,uri:m.uri,name:m.name,mimeType:m.mimeType,sizeBytes:m.sizeBytes}}}]:m.data?[{inlineData:{mimeType:m.mimeType,data:m.data,displayName:m.name}}]:[]),f=s&&(s.skills.length>0||s.targetAgent)?s:void 0,h=[...d,...a.map(m=>({functionResponse:{id:m.id,name:m.name,response:m.response}})),...r.trim()?[{text:r}]:[]];if(f&&h.length>0){const m=h[0],y=m.partMetadata;h[0]={...m,partMetadata:{...y,veadkInvocation:f}}}const p=await Tt("/run_sse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({app_name:l,user_id:t,session_id:n,new_message:{role:"user",parts:h},streaming:!0,custom_metadata:f?{veadkInvocation:f}:void 0}),signal:o},c,0);if(!p.ok)throw new Error(Zd(`run_sse failed: ${p.status}`));for await(const m of Zb(p)){const y=m;typeof y.error=="string"&&(y.error=Zd(y.error)),typeof y.errorMessage=="string"&&(y.errorMessage=Zd(y.errorMessage)),typeof y.error_message=="string"&&(y.error_message=Zd(y.error_message)),yield y}}const Hc=new Map;async function nE(e,t,n,r){var c;const i=r==null?void 0:r.taskId,s=i?new AbortController:void 0;i&&s&&Hc.set(i,s);const a=()=>{i&&Hc.get(i)===s&&Hc.delete(i)};let o;try{o=await Tt("/web/deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},signal:s==null?void 0:s.signal,body:JSON.stringify({name:e,files:t,config:n,taskId:i,im:r==null?void 0:r.im,envs:r==null?void 0:r.envs})},{},0)}catch(d){throw a(),d}if(!o.ok){const d=await o.text().catch(()=>"");throw a(),new Error(d||`部署失败 (${o.status})`)}let l=null;try{for await(const d of Zb(o)){const f=d;if(f&&f.done){l=f;break}f&&f.message&&((c=r==null?void 0:r.onStage)==null||c.call(r,f))}}catch(d){throw a(),d}if(a(),!l)throw new Error("部署失败:连接中断");if(!l.success)throw new Error(l.error||"部署失败");if(!l.url||!l.agentName)throw new Error("部署失败:返回缺少 AgentKit 连接信息");return{apikey:l.apikey??"",url:l.url,agentName:l.agentName,runtimeId:l.runtimeId,consoleUrl:l.consoleUrl,region:l.region,feishuChannel:l.feishuChannel}}async function QC(e){var n;const t=await Tt("/web/cancel-deploy-agentkit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:e})});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(r||`取消部署失败 (${t.status})`)}(n=Hc.get(e))==null||n.abort(),Hc.delete(e)}async function ZC(e="cn-beijing"){const t=await Tt(`/web/my-runtimes?region=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`加载失败 (${t.status})`);return(await t.json()).runtimes??[]}const Su={title:"VeADK Studio",logoUrl:""},mg={studio:!1,branding:Su,features:{newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0,generatedAgentTestRun:!0},defaultView:"chat",agentsSource:"local"};async function JC(){var e,t;try{const n=await Tt("/web/ui-config");if(!n.ok)return mg;const r=await n.json(),i=typeof((e=r.branding)==null?void 0:e.logoUrl)=="string"?r.branding.logoUrl:Su.logoUrl;return{studio:r.studio??!1,branding:{title:typeof((t=r.branding)==null?void 0:t.title)=="string"?r.branding.title:Su.title,logoUrl:i?$c(i):""},features:{...mg.features,...r.features??{}},defaultView:r.defaultView??"chat",agentsSource:r.agentsSource==="cloud"?"cloud":"local"}}catch{return mg}}const eI={role:"user",capabilities:{createAgents:!1,manageAgents:!1,runtimeScope:"mine"}};async function tI(){var n,r,i;const e=await Tt("/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.capabilities)==null?void 0:n.createAgents)!="boolean"||typeof((r=t.capabilities)==null?void 0:r.manageAgents)!="boolean"||!["all","mine"].includes((i=t.capabilities)==null?void 0:i.runtimeScope))throw new Error("权限服务返回了无法解析的响应");return t}async function Yf(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 Tt(`/web/runtimes?${t.toString()}`);if(!n.ok)throw new Error(`加载 Runtime 失败 (${n.status})`);const r=await n.json();return{runtimes:r.runtimes??[],nextToken:r.nextToken??""}}async function nI(e,t="cn-beijing"){try{return await Vp("","",{runtimeId:e,region:t})}catch(n){if(n instanceof rd)throw n;return null}}async function rI(e,t="cn-beijing"){const n=await Tt("/web/delete-runtime",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtimeId:e,region:t})});if(!n.ok){const r=await n.text().catch(()=>"");throw new Error(r||`删除失败 (${n.status})`)}}async function rE(e,t="cn-beijing"){const n=await Tt(`/web/runtime-detail?runtimeId=${encodeURIComponent(e)}®ion=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(await Jr(n,"加载 Runtime 详情失败"));return n.json()}async function Vh(e){const t=await Tt("/web/generated-agent-projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"生成项目失败"));return t.json()}async function iI(e){const t=await Tt("/web/generated-agent-test-runs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({draft:e})});if(!t.ok)throw new Error(await Jr(t,"创建调试运行失败"));return t.json()}async function sI(e,t){const n=await Tt(`/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 Jr(n,"创建调试会话失败"));return(await n.json()).id}async function*aI({runId:e,userId:t,sessionId:n,text:r,signal:i}){const s=r.trim()?[{text:r}]:[],a=await Tt(`/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:s},streaming:!0}),signal:i},{},0);if(!a.ok)throw new Error(await Jr(a,"调试运行失败"));for await(const o of Zb(a))yield o}async function Ay(e){const t=await Tt(`/web/generated-agent-test-runs/${e}`,{method:"DELETE"});if(!t.ok&&t.status!==404)throw new Error(await Jr(t,"清理调试运行失败"))}const V9=Object.freeze(Object.defineProperty({__proto__:null,DEFAULT_SITE_BRANDING:Su,DEFAULT_STUDIO_ACCESS:eI,RuntimeAccessDeniedError:rd,cancelAgentkitDeployment:QC,clearRemoteApps:$C,componentSearch:GC,createGeneratedAgentTestRun:iI,createGeneratedAgentTestSession:sI,createSession:Hh,deleteGeneratedAgentTestRun:Ay,deleteMedia:Kf,deleteRuntime:rI,deleteSession:Sy,deleteSessionMedia:ky,deployAgentkitProject:nE,fetchRemoteApps:Vp,generateAgentProject:Vh,getAgentInfo:id,getMediaCapabilities:z9,getMyRuntimes:ZC,getRuntimeAgentInfo:qC,getRuntimeDetail:rE,getRuntimes:Yf,getSession:zh,getSessionTrace:YC,getStudioAccess:tI,getUiConfig:JC,listApps:HC,listSessions:tE,mediaContentUrl:KC,probeRuntimeApps:nI,registerRemoteApp:UC,runGeneratedAgentTestSSE:aI,runSSE:Nu,uploadMedia:zC,webSearch:XC},Symbol.toStringTag,{value:"Module"})),K9="send_a2ui_json_to_client",Y9="validated_a2ui_json",Cy="adk_request_credential";function W9(e){var r,i,s,a;const t=e,n=((r=t==null?void 0:t.exchangedAuthCredential)==null?void 0:r.oauth2)??((i=t==null?void 0:t.exchanged_auth_credential)==null?void 0:i.oauth2)??((s=t==null?void 0:t.rawAuthCredential)==null?void 0:s.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 Ki(){return{blocks:[],liveStart:0}}const t_=e=>e.functionCall??e.function_call,Iy=e=>e.functionResponse??e.function_response;function q9(e){return e.replace(/-/g,"+").replace(/_/g,"/")}function oI(e){const t=[];for(const[n,r]of e.entries()){const i=r.partMetadata??r.part_metadata,s=i==null?void 0:i.veadkTransport;if((s==null?void 0:s.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 o=r.inlineData??r.inline_data;if(o&&o.data){t.push({id:`inline-${n}-${o.displayName??o.display_name??"media"}`,mimeType:o.mimeType??o.mime_type,data:q9(o.data),name:o.displayName??o.display_name});continue}const l=r.fileData??r.file_data,c=(l==null?void 0:l.fileUri)??(l==null?void 0:l.file_uri);l&&c&&t.push({id:c,mimeType:l.mimeType??l.mime_type,uri:c,name:l.displayName??l.display_name})}return t}function Ry(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 G9=new Set(["llm","sequential","parallel","loop","a2a"]);function X9(e){var t;for(const n of e){const r=(t=n.partMetadata??n.part_metadata)==null?void 0:t.veadkInvocation;if(!r||typeof r!="object")continue;const i=r,s=Array.isArray(i.skills)?i.skills.flatMap(l=>{if(!l||typeof l!="object")return[];const c=l;return typeof c.name=="string"?[{name:c.name,description:typeof c.description=="string"?c.description:""}]:[]}):[];let a;const o=i.targetAgent;if(o&&typeof o=="object"){const l=o,c=l.type;typeof l.name=="string"&&typeof c=="string"&&G9.has(c)&&Array.isArray(l.path)&&(a={name:l.name,description:typeof l.description=="string"?l.description:"",type:c,path:l.path.filter(d=>typeof d=="string")})}if(s.length>0||a)return{skills:s,targetAgent:a}}}function Q9(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 n_(e,t,n){const r=e[e.length-1];r&&r.kind===t?r.text+=n:e.push(t==="thinking"?{kind:t,text:n,done:!1}:{kind:t,text:n})}function Jd(e){for(const t of e)t.kind==="thinking"&&(t.done=!0)}function al(e,t){var a,o;const n=e.blocks.map(l=>({...l}));let r=e.liveStart;const i=((a=t.content)==null?void 0:a.parts)??[],s=i.some(l=>t_(l)||Iy(l));if(t.partial&&!s){for(const l of i){const c=Ry(l);typeof c=="string"&&c&&n_(n,l.thought?"thinking":"text",c)}return{blocks:n,liveStart:r}}n.length=r;for(const l of i){const c=t_(l),d=Iy(l),f=oI([l]),h=Ry(l);if(typeof h=="string"&&h)n_(n,l.thought?"thinking":"text",h);else if(f.length)Jd(n),Q9(n,f);else if(c)if(Jd(n),c.name===Cy){const p=c.args??{},m=p.authConfig??p.auth_config??p,v=String(p.functionCallId??p.function_call_id??"").replace(/^_adk_toolset_auth_/,"")||void 0;n.push({kind:"auth",callId:c.id??"",label:v,authUri:W9(m),authConfig:m,done:!1})}else n.push({kind:"tool",name:c.name??"",args:c.args,done:!1});else if(d){if(Jd(n),d.name===Cy)for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="auth"&&!m.done){m.done=!0;break}}for(let p=n.length-1;p>=0;p--){const m=n[p];if(m.kind==="tool"&&!m.done&&m.name===d.name){m.done=!0,m.response=d.response;break}}if(d.name===K9){const p=((o=d.response)==null?void 0:o[Y9])??[];if(p.length){const m=n[n.length-1];m&&m.kind==="a2ui"?m.messages.push(...p):n.push({kind:"a2ui",messages:p})}}}}return Jd(n),r=n.length,{blocks:n,liveStart:r}}function Z9(e){var r;const t=[];let n=Ki();for(const i of e)if(i.author==="user"){const a=((r=i.content)==null?void 0:r.parts)??[];if(a.some(f=>{var h;return((h=Iy(f))==null?void 0:h.name)===Cy})){for(let f=t.length-1;f>=0;f--)if(t[f].role==="assistant"){for(let h=t[f].blocks.length-1;h>=0;h--){const p=t[f].blocks[h];if(p.kind==="auth"){p.done=!0;break}}break}}const o=a.map(Ry).filter(f=>!!f).join(""),l=oI(a),c=X9(a);if(!o&&!l.length&&!c){n=Ki();continue}const d=[];c&&d.push({kind:"invocation",value:c}),l.length&&d.push({kind:"attachment",files:l}),o&&d.push({kind:"text",text:o}),t.push({role:"user",blocks:d,meta:{ts:i.timestamp}}),n=Ki()}else{let a=t[t.length-1];(!a||a.role!=="assistant")&&(a={role:"assistant",blocks:[],meta:{}},t.push(a),n=Ki()),n=al(n,i),a.blocks=n.blocks;const o=i.usageMetadata??i.usage_metadata,l=a.meta??(a.meta={});o!=null&&o.totalTokenCount&&(l.tokens=o.totalTokenCount),i.timestamp&&(l.ts=i.timestamp)}return t}function lI(e){var t,n;for(const r of e??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const i=(((n=r.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(i)return i}return"新会话"}const J9="https://findskill.com/";function eF(){return u.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("circle",{cx:"12",cy:"12",r:"8.6"}),u.jsx("path",{d:"M12 6.4 13.25 10.75 17.6 12 13.25 13.25 12 17.6 10.75 13.25 6.4 12 10.75 10.75z",fill:"currentColor",stroke:"none"})]})}function tF({onClick:e}){return u.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"技能中心",title:"技能中心",children:[u.jsx(eF,{}),u.jsx("span",{className:"sidebar-nav-label",children:"技能中心"})]})}function nF(){return u.jsx("iframe",{className:"skill-frame",src:J9,title:"技能中心"})}const rF=50,r_=48;function iF(e){return(e.events??[]).flatMap(t=>{var i,s;const r=(((i=t.content)==null?void 0:i.parts)??[]).map(a=>typeof a.text=="string"?a.text:"").filter(Boolean).join("");return r?[{text:r,role:t.author??((s=t.content)==null?void 0:s.role)??"",ts:t.timestamp}]:[]})}function sF(e){var t,n;for(const r of e.events??[])if(r.author==="user"||((t=r.content)==null?void 0:t.role)==="user"){const i=(((n=r.content)==null?void 0:n.parts)??[]).map(s=>s.text).find(Boolean);if(i)return i}return"未命名会话"}function aF(e,t,n){const r=Math.max(0,t-r_),i=Math.min(e.length,t+n+r_);return(r>0?"…":"")+e.slice(r,i).trim()+(i{var l;if((l=o.events)!=null&&l.length)return o;try{return await zh(t,e,o.id)}catch{return o}})),a=[];for(const o of s)for(const{text:l,role:c,ts:d}of iF(o)){const f=l.toLowerCase().indexOf(r);if(f!==-1){a.push({type:"session",appId:t,sessionId:o.id,title:sF(o),snippet:aF(l,f,r.length),role:c,ts:d??o.lastUpdateTime});break}}return a.sort((o,l)=>(l.ts??0)-(o.ts??0)),a.slice(0,rF)}async function lF(e,t){if(!e||!t.trim())return{results:[]};let n;try{n=await XC(e,t.trim())}catch(a){const o=String(a);return{results:[],note:o.includes("404")?"网络搜索接口未就绪(后端未启用 /web/search)。":`网络搜索失败:${o}`}}const{mounted:r,results:i,error:s}=n;return r?s?{results:[],note:s}:{results:i.map((a,o)=>({type:"web",index:o,title:a.title,url:a.url,siteName:a.siteName,summary:a.summary}))}:{results:[],note:"当前 Agent 未挂载 web_search 工具。"}}async function cF(e,t,n,r){if(!t||!r.trim())return{results:[]};const i=await GC(t,e,r.trim(),n);if(!i.mounted)return{results:[],note:e==="knowledge"?"该 Agent 未挂载知识库。":"该 Agent 未挂载长期记忆。"};if(i.error)return{results:[],note:i.error};const s=i.sourceName??(e==="knowledge"?"知识库":"长期记忆");return{results:i.results.map((a,o)=>e==="knowledge"?{type:"knowledge",index:o,content:a.content,sourceName:s,sourceType:i.sourceType}:{type:"memory",index:o,content:a.content,sourceName:s,sourceType:i.sourceType,author:a.author,ts:a.timestamp})}}async function uF(e,t,n){return e==="session"?{results:await oF(n.userId,n.appId,t)}:e==="web"?lF(n.appId,t):cF(e,n.appId,n.userId,t)}function cI({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M16.4 10.7a5.7 5.7 0 1 1-1.67-4.03"}),u.jsx("path",{d:"M15.25 15.25 19.6 19.6"})]})}function dF({open:e}){return u.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:u.jsx("path",{d:"m3.25 4.75 2.75 2.5 2.75-2.5"})})}function fF({onClick:e}){return u.jsxs("button",{className:"new-chat",onClick:e,"aria-label":"智能搜索",title:"智能搜索",children:[u.jsx(cI,{}),u.jsx("span",{className:"sidebar-nav-label",children:"智能搜索"})]})}function hF(e,t,n){const r=!!e,i=new Set((t==null?void 0:t.searchSources)??[]),s=a=>r?n?"正在检测 Agent 能力":`当前 Agent 未挂载${a}`:"请选择 Agent";return[{id:"session",label:"会话",ready:r,unavailableLabel:"请选择 Agent"},{id:"web",label:"网络",ready:r&&i.has("web"),description:"通过 web_search 工具检索",unavailableLabel:s(" web_search 工具")},{id:"knowledge",label:"知识库",ready:r&&i.has("knowledge"),unavailableLabel:s("知识库")},{id:"memory",label:"长期记忆",ready:r&&i.has("memory"),unavailableLabel:s("长期记忆")}]}function Kh(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 i_(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 pF({userId:e,appId:t,agentInfo:n,capabilitiesLoading:r,agentLabel:i,onOpenSession:s}){var $,C;const[a,o]=_.useState("session"),[l,c]=_.useState(""),[d,f]=_.useState([]),[h,p]=_.useState(),[m,y]=_.useState(!1),[v,g]=_.useState(!1),[E,b]=_.useState(!1),w=_.useRef(0),N=_.useRef(null),T=hF(t,n,r),A=T.find(O=>O.id===a),S=a==="knowledge"?($=n==null?void 0:n.components)==null?void 0:$.find(O=>O.source==="knowledgebase"||O.kind==="knowledgebase"):a==="memory"?(C=n==null?void 0:n.components)==null?void 0:C.find(O=>O.source==="long_term_memory"||O.kind==="memory"):void 0;_.useEffect(()=>{w.current+=1,o("session"),f([]),p(void 0),g(!1),y(!1),b(!1)},[t]),_.useEffect(()=>{if(!E)return;function O(L){var M;(M=N.current)!=null&&M.contains(L.target)||b(!1)}return document.addEventListener("pointerdown",O),()=>document.removeEventListener("pointerdown",O)},[E]);async function R(O,L){var G;const M=O.trim();if(!M||!((G=T.find(P=>P.id===L))!=null&&G.ready))return;const k=++w.current;y(!0),g(!0);let Y;try{Y=await uF(L,M,{userId:e,appId:t})}catch(P){const V=P instanceof Error?P.message:String(P);Y={results:[],note:`搜索失败:${V}`}}k===w.current&&(f(Y.results),p(Y.note),y(!1))}function I(O){w.current+=1,c(O),f([]),p(void 0),g(!1),y(!1)}function D(O){w.current+=1,o(O),b(!1),f([]),p(void 0),g(!1),y(!1)}const F=!!(A!=null&&A.ready),W=t?a==="web"?"在网络中检索":a==="knowledge"?`在 ${(S==null?void 0:S.name)??"当前 Agent 的知识库"} 中检索`:a==="memory"?`在 ${(S==null?void 0:S.name)??"当前用户的长期记忆"} 中检索`:"在当前 Agent 的会话中检索":"请先选择 Agent",j=S!=null&&S.backend?Kh(S.backend):"";return u.jsxs("div",{className:"search",children:[u.jsxs("div",{className:"search-box",children:[u.jsxs("div",{className:"search-source-picker-wrap",ref:N,children:[u.jsxs("button",{className:"search-source-picker",type:"button","aria-label":`搜索类型:${(A==null?void 0:A.label)??"未选择"}`,"aria-haspopup":"listbox","aria-expanded":E,onClick:()=>b(O=>!O),children:[u.jsx("span",{children:(A==null?void 0:A.label)??"搜索类型"}),j&&u.jsx("small",{children:j}),u.jsx(dF,{open:E})]}),E&&u.jsx("div",{className:"search-source-menu",role:"listbox","aria-label":"选择搜索类型",children:T.map(O=>{var k,Y;const L=O.id==="knowledge"?(k=n==null?void 0:n.components)==null?void 0:k.find(G=>G.source==="knowledgebase"||G.kind==="knowledgebase"):O.id==="memory"?(Y=n==null?void 0:n.components)==null?void 0:Y.find(G=>G.source==="long_term_memory"||G.kind==="memory"):void 0,M=L?[L.name,L.backend?Kh(L.backend):""].filter(Boolean).join(" · "):O.ready?O.description:O.unavailableLabel;return u.jsxs("button",{type:"button",role:"option","aria-selected":a===O.id,disabled:!O.ready,onClick:()=>D(O.id),children:[u.jsx("span",{children:O.label}),M&&u.jsx("small",{children:M})]},O.id)})})]}),u.jsx("span",{className:"search-box-divider","aria-hidden":!0}),u.jsx("input",{className:"search-input",value:l,onChange:O=>I(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),R(l,a))},placeholder:W,disabled:!F,autoFocus:!0}),u.jsx("button",{className:"search-go",onClick:()=>void R(l,a),disabled:!l.trim()||m,"aria-label":"搜索",children:m?u.jsx(bt,{className:"icon spin"}):u.jsx(cI,{className:"icon"})})]}),u.jsx("div",{className:"search-results",children:F?v?m?null:h?u.jsx("div",{className:"search-empty",children:h}):d.length===0&&v?u.jsxs("div",{className:"search-empty",children:["未找到匹配「",l.trim(),"」的结果。"]}):d.map((O,L)=>u.jsx(mF,{result:O,agentLabel:i,onOpen:s},L)):u.jsx("div",{className:"search-empty",children:a==="web"?"输入关键词后回车或点击按钮,通过 web_search 工具检索。":a==="knowledge"?"输入问题,检索当前 Agent 挂载的知识库。":a==="memory"?"输入线索,检索当前用户跨会话保存的长期记忆。":"输入关键词后回车或点击按钮,搜索当前 Agent 的会话。"}):u.jsx("div",{className:"search-empty",children:t?r?"正在读取当前 Agent 的检索能力…":(A==null?void 0:A.unavailableLabel)??"当前 Agent 未挂载该数据源":"选择一个 Agent 后,即可检索会话、网络及其挂载的数据源。"})})]})}function mF({result:e,agentLabel:t,onOpen:n}){switch(e.type){case"session":return u.jsxs("button",{className:"search-result",onClick:()=>n(e.appId,e.sessionId),children:[u.jsx(MC,{className:"search-result-icon"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsx("span",{className:"search-result-title",children:e.title}),u.jsxs("span",{className:"search-result-meta",children:[t(e.appId),e.ts?` · ${i_(e.ts)}`:""]})]}),u.jsx("div",{className:"search-result-snippet",children:e.snippet})]})]});case"web":return u.jsxs("a",{className:"search-result",href:e.url||void 0,target:"_blank",rel:"noreferrer noopener",children:[u.jsx(Cl,{className:"search-result-icon"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsx("span",{className:"search-result-title",children:e.title||e.url}),u.jsxs("span",{className:"search-result-meta",children:[e.siteName,e.url&&u.jsx(Wb,{className:"search-result-ext"})]})]}),e.summary&&u.jsx("div",{className:"search-result-snippet",children:e.summary})]})]});case"knowledge":return u.jsxs("div",{className:"search-result search-result-static",children:[u.jsx(s_,{source:"knowledge"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsxs("span",{className:"search-result-title",children:["知识片段 ",e.index+1]}),u.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${Kh(e.sourceType)}`:""]})]}),u.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});case"memory":return u.jsxs("div",{className:"search-result search-result-static",children:[u.jsx(s_,{source:"memory"}),u.jsxs("div",{className:"search-result-body",children:[u.jsxs("div",{className:"search-result-head",children:[u.jsxs("span",{className:"search-result-title",children:["记忆片段 ",e.index+1]}),u.jsxs("span",{className:"search-result-meta",children:[e.sourceName,e.sourceType?` · ${Kh(e.sourceType)}`:"",e.ts?` · ${i_(e.ts)}`:""]})]}),u.jsx("div",{className:"search-result-snippet search-result-snippet-expanded",children:e.content})]})]});default:return null}}function s_({source:e,className:t="search-result-icon"}){return e==="knowledge"?u.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[u.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"}),u.jsx("path",{d:"M8.25 9h7.5M8.25 12.25h6"})]}):u.jsxs("svg",{className:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[u.jsx("path",{d:"M12 4.5a7.5 7.5 0 1 0 7.5 7.5"}),u.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"})]})}const uI="veadk_agentkit_connections";function Yi(){try{const e=localStorage.getItem(uI);return e?JSON.parse(e):[]}catch{return[]}}function Kp(e){try{localStorage.setItem(uI,JSON.stringify(e))}catch{}}function Da(e,t){return`agentkit:${e}:${t}`}function dI(e){try{return new URL(e).host}catch{return e}}function Rl(e){$C();for(const t of e)for(const n of t.apps)UC(Da(t.id,n),t.runtimeId?{app:n,runtimeId:t.runtimeId,region:t.region}:{app:n,base:t.base,apiKey:t.apiKey})}function fI(e,t,n,r,i){const s={id:`rt_${e}`,name:t||e,runtimeId:e,region:n,apps:r,appLabels:i},a=[...Yi().filter(o=>o.runtimeId!==e),s];return Kp(a),Rl(a),s}async function iE(e,t,n){let r;try{r=await nI(e,n)}catch(a){throw a instanceof rd&&Oy(e),a}if(!r||r.length===0)throw Oy(e),new Error("该 Runtime 暂不支持连接,请确认服务已正常运行。");const i=Object.fromEntries(r.map(a=>[a,t])),s=fI(e,t,n,r,i);return Da(s.id,r[0])}async function hI(e,t,n,r){const i=t.trim().replace(/\/+$/,""),s=await Vp(i,n.trim()),a={id:Date.now().toString(36),name:e.trim()||dI(i),base:i,apiKey:n.trim(),apps:s,appLabels:r&&s.length>0?{[s[0]]:r}:void 0},o=[...Yi().filter(l=>l.base!==i),a];return Kp(o),Rl(o),a}function gF(e){const t=Yi().filter(n=>n.id!==e);return Kp(t),Rl(t),t}function Oy(e){const t=Yi().filter(n=>n.runtimeId!==e);return Kp(t),Rl(t),t}function pI(e,t){const n=e.map(i=>({id:i,label:i,app:i,remote:!1})),r=t.flatMap(i=>i.apps.map(s=>{var o;const a=((o=i.appLabels)==null?void 0:o[s])??s;return{id:Da(i.id,s),label:a,app:s,remote:!0,host:i.runtimeId?i.name:dI(i.base??"")}}));return[...n,...r]}const a_=Object.freeze(Object.defineProperty({__proto__:null,addConnection:hI,addRuntimeConnection:fI,buildAgentEntries:pI,connectRuntime:iE,loadConnections:Yi,registerConnections:Rl,remoteAppId:Da,removeConnection:gF,removeRuntimeConnection:Oy},Symbol.toStringTag,{value:"Module"}));function Yh({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"m10.05 3.7 1.95-1.12 1.95 1.12"}),u.jsx("path",{d:"m16.25 5.03 3.9 2.25v4.5"}),u.jsx("path",{d:"M20.15 15.08v1.64l-3.9 2.25"}),u.jsx("path",{d:"m13.95 20.3-1.95 1.12-1.95-1.12"}),u.jsx("path",{d:"m7.75 18.97-3.9-2.25v-4.5"}),u.jsx("path",{d:"M3.85 8.92V7.28l3.9-2.25"}),u.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"})]})}function yF({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M4.5 6.7h4.2M12.3 6.7h7.2"}),u.jsx("path",{d:"M4.5 12h8.2M16.3 12h3.2"}),u.jsx("path",{d:"M4.5 17.3h2.7M10.8 17.3h8.7"}),u.jsx("circle",{cx:"10.5",cy:"6.7",r:"1.8",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"14.5",cy:"12",r:"1.8",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"9",cy:"17.3",r:"1.8",fill:"currentColor",stroke:"none"})]})}function bF({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"m4.7 7.2 7.3-3 7.3 3-7.3 3.1Z"}),u.jsx("path",{d:"M7.2 9.2v4.2c0 1.7 2.15 3.05 4.8 3.05s4.8-1.35 4.8-3.05V9.2"}),u.jsx("path",{d:"M19.3 7.2v5.25"}),u.jsx("circle",{cx:"19.3",cy:"14.4",r:"1.15",fill:"currentColor",stroke:"none"})]})}function mI({className:e="icon"}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M18.7 8.15A7.55 7.55 0 0 0 5.35 7.1"}),u.jsx("path",{d:"m18.7 8.15-.2-3.05-3.02.3"}),u.jsx("path",{d:"M5.3 15.85A7.55 7.55 0 0 0 18.65 16.9"}),u.jsx("path",{d:"m5.3 15.85.2 3.05 3.02-.3"}),u.jsx("path",{d:"M6.85 12h2.8l1.4-2.9 1.9 5.8 1.42-2.9h2.78"})]})}const o_=15,EF=1e4,xF=[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}];function vF(e){return e==="cn-beijing"?"北京":e==="cn-shanghai"?"上海":e}function gI(e){const t=e.toLowerCase();return t.includes("invalidagentkitruntime.notfound")||t.includes("specified agentkitruntime does not exist")?"该 Runtime 已不存在或列表信息已过期,请刷新列表后重试。":t.includes("accessdenied")||t.includes("forbidden")||t.includes("permission")||t.includes("(401)")||t.includes("(403)")?"当前账号无权访问该 Runtime,请检查所属 Project 和访问权限。":t.includes("agent-info failed: 404")||t.includes("读取 agent 列表失败 (404)")?"该 Agent Server 版本暂不支持信息预览。":"该 Runtime 暂时无法访问,请确认其状态为“就绪”后重试。"}function gg(e,t=EF){return new Promise((n,r)=>{const i=setTimeout(()=>r(new Error("加载超时,请重试")),t);e.then(s=>{clearTimeout(i),n(s)},s=>{clearTimeout(i),r(s)})})}function wF({open:e,onClose:t,anchorTop:n=0,agentsSource:r,localApps:i,currentId:s,currentRuntime:a,runtimeScope:o,onSelect:l}){const[c,d]=_.useState([]),[f,h]=_.useState([""]),[p,m]=_.useState(0),[y,v]=_.useState(o==="mine"),[g,E]=_.useState(null),[b,w]=_.useState("cn-beijing"),[N,T]=_.useState(!1),[A,S]=_.useState(""),[R,I]=_.useState(""),[D,F]=_.useState(null),[W,j]=_.useState(new Set),[$,C]=_.useState(),[O,L]=_.useState("agent"),M=_.useRef(!1);function k(q){C(ae=>(ae==null?void 0:ae.runtimeId)===q.runtimeId?void 0:{runtimeId:q.runtimeId,name:q.name,region:q.region})}const Y=_.useCallback(async q=>{if(c[q]){m(q);return}const ae=f[q];if(ae!==void 0){T(!0),S("");try{const ye=await gg(Yf({nextToken:ae,pageSize:o_,region:b,scope:"all"}));d(he=>{const de=[...he];return de[q]=ye.runtimes,de}),h(he=>{const de=[...he];return ye.nextToken&&(de[q+1]=ye.nextToken),de}),m(q)}catch(ye){S(ye instanceof Error?ye.message:String(ye))}finally{T(!1)}}},[f,c,b]),G=_.useCallback(async()=>{T(!0),S("");try{const q=[];let ae="";do{const ye=await gg(Yf({scope:"mine",nextToken:ae,pageSize:100,region:b}));q.push(...ye.runtimes),ae=ye.nextToken}while(ae&&q.length<2e3);E(q)}catch(q){S(q instanceof Error?q.message:String(q))}finally{T(!1)}},[b]);_.useEffect(()=>{v(o==="mine"),d([]),h([""]),m(0),E(null),M.current=!1},[o]),_.useEffect(()=>{e&&r==="cloud"&&!y&&!M.current&&(M.current=!0,Y(0))},[e,r,y,Y]),_.useEffect(()=>{y&&g===null&&r==="cloud"&&G()},[y,g,r,G]),_.useEffect(()=>{e&&(C(void 0),L("agent"))},[e]);function P(){j(new Set),y?(E(null),G()):(d([]),h([""]),m(0),M.current=!0,T(!0),S(""),gg(Yf({nextToken:"",pageSize:o_,region:b,scope:"all"})).then(q=>{d([q.runtimes]),h(q.nextToken?["",q.nextToken]:[""])}).catch(q=>S(q instanceof Error?q.message:String(q))).finally(()=>T(!1)))}function V(q){q!==b&&(w(q),d([]),h([""]),m(0),E(null),j(new Set),M.current=!1)}const Q=!y&&(c[p+1]!==void 0||f[p+1]!==void 0);function ne(q){F(q.runtimeId),iE(q.runtimeId,q.name,q.region).then(ae=>{l(ae),t()}).catch(ae=>{if(ae instanceof rd){S(ae.message);return}j(ye=>new Set(ye).add(q.runtimeId))}).finally(()=>F(null))}if(!e)return null;const K=(y?g??[]:c[p]??[]).filter(q=>R?q.name.toLowerCase().includes(R.toLowerCase()):!0);return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:t}),u.jsxs("div",{className:`agentsel ${$?"has-detail":""}`,role:"dialog","aria-label":"选择 Agent",style:{top:n,height:`min(640px, calc(100dvh - ${n}px - 10px))`},children:[u.jsxs("div",{className:"agentsel-main",children:[u.jsxs("div",{className:"agentsel-head",children:[u.jsxs("span",{className:"agentsel-title",children:[u.jsx(Yh,{})," 选择 Agent"]}),u.jsxs("div",{className:"agentsel-head-actions",children:[r==="cloud"&&u.jsx("button",{className:"agentsel-refresh",onClick:P,title:"刷新",disabled:N,children:u.jsx(Gb,{className:`icon ${N?"spin":""}`})}),u.jsx("button",{className:"agentsel-refresh",onClick:t,title:"关闭",children:u.jsx(Xr,{className:"icon"})})]})]}),r==="local"?u.jsx("div",{className:"agentsel-body",children:i.length===0?u.jsx("div",{className:"agentsel-empty",children:"暂无本地 Agent。"}):u.jsx("ul",{className:"agentsel-list",children:i.map(q=>u.jsx("li",{children:u.jsxs("button",{className:`agentsel-item ${q===s?"active":""}`,onClick:()=>{l(q),t()},children:[u.jsx(Yh,{}),u.jsx("span",{className:"agentsel-item-name",children:q})]})},q))})}):u.jsxs("div",{className:"agentsel-body agentsel-body--cloud",children:[u.jsxs("div",{className:"agentsel-tools",children:[u.jsxs("div",{className:"agentsel-search",children:[u.jsx(Ny,{className:"icon"}),u.jsx("input",{value:R,onChange:q=>I(q.target.value),placeholder:"搜索 Runtime 名称"})]}),u.jsx("div",{className:"agentsel-regions","aria-label":"按部署地域筛选",children:xF.map(q=>u.jsx("button",{type:"button",className:b===q.value?"active":"","aria-pressed":b===q.value,onClick:()=>V(q.value),children:q.label},q.value))}),o==="all"&&u.jsxs("label",{className:"agentsel-mine",children:[u.jsx("input",{type:"checkbox",checked:y,onChange:q=>v(q.target.checked)}),"只看我创建的"]})]}),A&&u.jsx("div",{className:"agentsel-error",children:A}),u.jsxs("div",{className:"agentsel-listwrap",children:[K.length===0&&!N?u.jsx("div",{className:"agentsel-empty",children:"暂无 Runtime。"}):u.jsx("ul",{className:"agentsel-list",children:K.map(q=>{const ae=W.has(q.runtimeId),ye=D===q.runtimeId,he=(a==null?void 0:a.runtimeId)===q.runtimeId,de=($==null?void 0:$.runtimeId)===q.runtimeId;return u.jsx("li",{children:u.jsxs("div",{className:`agentsel-item agentsel-runtime-item ${he?"active":""} ${de?"is-previewed":""}`,title:q.runtimeId,children:[u.jsx(mI,{}),u.jsxs("div",{className:"agentsel-item-main",children:[u.jsx("span",{className:"agentsel-item-name",title:q.name,children:q.name}),u.jsxs("div",{className:"agentsel-item-meta",children:[u.jsx("span",{className:`agentsel-status is-${ae?"bad":CF(q.status)}`,children:ae?"不支持":yI(q.status)}),q.isMine&&u.jsx("span",{className:"agentsel-badge",children:"我创建的"})]})]}),u.jsxs("div",{className:"agentsel-item-actions",children:[u.jsx("button",{type:"button",className:"agentsel-connect",disabled:ye||he,onClick:()=>ne(q),children:ye?"连接中…":he?"已连接":ae?"重试":"连接"}),u.jsx("button",{type:"button",className:`agentsel-info ${de?"active":""}`,"aria-label":`查看 ${q.name} 信息`,"aria-pressed":de,title:"查看信息",onClick:()=>k(q),children:u.jsx(td,{className:"icon"})})]})]})},q.runtimeId)})}),N&&u.jsxs("div",{className:"agentsel-loading",children:[u.jsx(bt,{className:"icon spin"})," 加载中…"]})]}),u.jsxs("div",{className:"agentsel-pager",children:[u.jsx("button",{disabled:y||p===0||N,onClick:()=>void Y(p-1),"aria-label":"上一页",children:u.jsx(W8,{className:"icon"})}),u.jsx("span",{className:"agentsel-pager-label",children:y?1:p+1}),u.jsx("button",{disabled:y||!Q||N,onClick:()=>void Y(p+1),"aria-label":"下一页",children:u.jsx(or,{className:"icon"})})]})]})]}),r==="cloud"&&$&&u.jsx(SF,{runtime:$,tab:O,onTabChange:L})]})]})}const _F={knowledgebase:"知识库",memory:"记忆",prompt_manager:"提示词管理",example_store:"样例库",run_processor:"运行处理器",tracer:"链路追踪",toolset:"工具集",plugin:"插件",other:"其他"};function TF(e){return _F[e.toLowerCase()]??e}function NF(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 SF({runtime:e,tab:t,onTabChange:n}){return u.jsxs("section",{className:"agentsel-detail agentsel-preview","aria-label":"Agent 与 Runtime 信息",children:[u.jsx("div",{className:"agentsel-head agentsel-preview-head",children:u.jsxs("div",{className:`agentsel-detail-tabs is-${t}`,role:"tablist","aria-label":"详情类型",children:[u.jsx("span",{className:"agentsel-detail-tabs-slider","aria-hidden":!0}),u.jsx("button",{id:"agentsel-agent-tab",type:"button",role:"tab","aria-selected":t==="agent","aria-controls":"agentsel-agent-panel",onClick:()=>n("agent"),children:"Agent 信息"}),u.jsx("button",{id:"agentsel-runtime-tab",type:"button",role:"tab","aria-selected":t==="runtime","aria-controls":"agentsel-runtime-panel",onClick:()=>n("runtime"),children:"Runtime 信息"})]})}),u.jsx("div",{id:"agentsel-agent-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-agent-tab",hidden:t!=="agent",children:u.jsx(kF,{runtime:e})}),u.jsx("div",{id:"agentsel-runtime-panel",className:"agentsel-tab-panel",role:"tabpanel","aria-labelledby":"agentsel-runtime-tab",hidden:t!=="runtime",children:u.jsx(AF,{runtime:e})})]})}function kF({runtime:e}){const[t,n]=_.useState(null),[r,i]=_.useState(!0),[s,a]=_.useState(""),o=e.runtimeId,l=e.region;_.useEffect(()=>{let d=!0;return n(null),i(!0),a(""),qC(o,l).then(f=>d&&n(f)).catch(f=>{if(!d)return;const h=f instanceof Error?f.message:String(f);a(gI(h))}).finally(()=>d&&i(!1)),()=>{d=!1}},[o,l]);const c=(t==null?void 0:t.components)??[];return u.jsx("div",{className:"agentsel-detail-body",children:r?u.jsxs("div",{className:"agentsel-panel-state",children:[u.jsx(bt,{className:"icon spin"})," 读取 Agent 信息…"]}):s?u.jsxs("div",{className:"agentsel-panel-empty",children:[u.jsx("span",{children:"暂时无法读取 Agent 信息"}),u.jsx("small",{title:s,children:s})]}):t?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"agentsel-identity",children:[u.jsx(Yh,{className:"agentsel-identity-icon"}),u.jsxs("div",{className:"agentsel-identity-copy",children:[u.jsx("strong",{title:t.name,children:t.name||"未命名 Agent"}),t.model&&u.jsx("span",{title:t.model,children:t.model})]})]}),t.description&&u.jsxs("section",{className:"agentsel-info-section",children:[u.jsx("h3",{children:"描述"}),u.jsx("p",{className:"agentsel-description",title:t.description,children:t.description})]}),t.subAgents.length>0&&u.jsx(l_,{icon:u.jsx(DC,{className:"icon"}),title:"子 Agent",values:t.subAgents}),t.tools.length>0&&u.jsx(l_,{icon:u.jsx(yF,{}),title:"工具",values:t.tools}),t.skills.length>0&&u.jsxs("section",{className:"agentsel-info-section",children:[u.jsxs("h3",{children:[u.jsx(bF,{})," 技能"]}),u.jsx("div",{className:"agentsel-info-list",children:t.skills.map(d=>u.jsxs("div",{className:"agentsel-info-list-item",children:[u.jsx("strong",{title:d.name,children:d.name}),d.description&&u.jsx("span",{title:d.description,children:d.description})]},d.name))})]}),c.length>0&&u.jsxs("section",{className:"agentsel-info-section",children:[u.jsxs("h3",{children:[u.jsx(TC,{className:"icon"})," 挂载组件"]}),u.jsx("div",{className:"agentsel-info-list",children:c.map((d,f)=>u.jsxs("div",{className:"agentsel-info-list-item agentsel-component",children:[u.jsxs("div",{className:"agentsel-component-head",children:[u.jsx("strong",{title:d.name,children:d.name}),u.jsxs("span",{children:[TF(d.kind),d.backend?` · ${NF(d.backend)}`:""]})]}),d.description&&u.jsx("span",{title:d.description,children:d.description})]},`${d.kind}:${d.name}:${f}`))})]}),!t.description&&t.subAgents.length===0&&t.tools.length===0&&t.skills.length===0&&c.length===0&&u.jsx("div",{className:"agentsel-panel-empty",children:"暂无更多 Agent 配置信息。"})]}):null})}function l_({icon:e,title:t,values:n}){return u.jsxs("section",{className:"agentsel-info-section",children:[u.jsxs("h3",{children:[e,t]}),u.jsx("div",{className:"agentsel-chips",children:n.map((r,i)=>u.jsx("span",{className:"agentsel-chip",title:r,children:r},`${r}:${i}`))})]})}function AF({runtime:e}){const[t,n]=_.useState(null),[r,i]=_.useState(!0),[s,a]=_.useState(""),o=e.runtimeId,l=e.region;_.useEffect(()=>{let d=!0;return i(!0),a(""),n(null),rE(o,l).then(f=>d&&n(f)).catch(f=>d&&a(gI(f instanceof Error?f.message:String(f)))).finally(()=>d&&i(!1)),()=>{d=!1}},[o,l]);const c=[];if(t){t.model&&c.push(["模型",t.model]),t.description&&c.push(["描述",t.description]),t.status&&c.push(["状态",yI(t.status)]),t.region&&c.push(["区域",vF(t.region)]);const d=t.resources,f=[d.cpuMilli!=null?`CPU ${d.cpuMilli}m`:"",d.memoryMb!=null?`内存 ${d.memoryMb}MB`:"",d.minInstance!=null||d.maxInstance!=null?`实例 ${d.minInstance??"?"}~${d.maxInstance??"?"}`:""].filter(Boolean).join(" · ");f&&c.push(["资源",f]),t.currentVersion!=null&&c.push(["版本",String(t.currentVersion)])}return u.jsxs("div",{className:"agentsel-detail-body",children:[u.jsxs("div",{className:"agentsel-runtime-identity",children:[u.jsx(mI,{}),u.jsxs("div",{children:[u.jsx("strong",{title:e.name,children:e.name}),u.jsx("span",{title:e.runtimeId,children:e.runtimeId})]})]}),r?u.jsxs("div",{className:"agentsel-apps-note",children:[u.jsx(bt,{className:"icon spin"})," 读取详情…"]}):s?u.jsx("div",{className:"agentsel-error",children:s}):t?u.jsxs(u.Fragment,{children:[u.jsx("dl",{className:"agentsel-kv",children:c.map(([d,f])=>u.jsxs("div",{className:"agentsel-kv-row",children:[u.jsx("dt",{children:d}),u.jsx("dd",{children:f})]},d))}),t.envs.length>0&&u.jsxs("div",{className:"agentsel-envs",children:[u.jsx("div",{className:"agentsel-envs-head",children:"环境变量"}),t.envs.map(d=>u.jsxs("div",{className:"agentsel-env",children:[u.jsx("span",{className:"agentsel-env-k",children:d.key}),u.jsx("span",{className:"agentsel-env-v",children:d.value})]},d.key))]})]}):null]})}function CF(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}const IF={ready:"就绪",unreleased:"未发布",running:"运行中",active:"运行中",creating:"创建中",pending:"等待中",deploying:"部署中",updating:"更新中",failed:"失败",error:"异常",stopping:"停止中",stopped:"已停止",deleting:"删除中",deleted:"已删除"};function yI(e){const t=e.toLowerCase().replace(/[\s_-]/g,"");return IF[t]??(e||"-")}const sE="/assets/volcengine-DM14a-L-.svg",c_="(max-width: 860px)",RF=54;function OF(){return u.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"M12.5 3 5.5 13h5l-1 8 8-11h-5l.5-7z",fill:"currentColor",stroke:"none"}),u.jsx("path",{d:"M19 4.5v3M17.5 6h3",opacity:"0.85"})]})}function LF(){return u.jsxs("svg",{className:"icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("circle",{cx:"8.25",cy:"7.75",r:"3.15"}),u.jsx("path",{d:"M2.9 19.2c.45-3.45 2.48-5.35 5.35-5.35 2.4 0 4.2 1.28 4.98 3.66"}),u.jsx("path",{d:"M17.4 4.5v15M14.8 9h5.2M14.8 15.3h5.2"}),u.jsx("circle",{cx:"17.4",cy:"9",r:"1.15",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"17.4",cy:"15.3",r:"1.15",fill:"currentColor",stroke:"none"})]})}function MF(e){let t=2166136261;for(const r of e)t^=r.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 DF={admin:"管理员",developer:"开发者",user:"普通用户"};function u_({role:e}){const t=DF[e];return u.jsx("span",{className:`studio-role-badge studio-role-badge--${e}`,title:t,children:t})}function PF({access:e,userInfo:t,onLogout:n}){const[r,i]=_.useState(!1),[s,a]=_.useState("");if(!t)return null;const o=U9(t),l=typeof t.email=="string"?t.email:"",c=(o||"U").slice(0,1).toUpperCase(),d=MF(o||l||c),f=$9(t),h=f===s?"":f;return u.jsxs("div",{className:"sidebar-user",children:[u.jsxs("button",{className:"sidebar-user-btn",onClick:()=>i(p=>!p),title:l?`${o} +${l}`:o,children:[u.jsxs("span",{className:`account-avatar${h?" has-image":""}`,style:d,children:[c,h?u.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),u.jsxs("span",{className:"sidebar-user-identity",children:[u.jsxs("span",{className:"sidebar-user-primary",children:[u.jsx("span",{className:"sidebar-user-name",children:o}),u.jsx(u_,{role:e.role})]}),l&&l!==o&&u.jsx("span",{className:"sidebar-user-email",children:l})]})]}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>i(!1)}),u.jsxs("div",{className:"account-pop sidebar-user-pop",children:[u.jsxs("div",{className:"account-head",children:[u.jsxs("span",{className:`account-avatar account-avatar--lg${h?" has-image":""}`,style:d,children:[c,h?u.jsx("img",{className:"account-avatar-image",src:h,alt:"","aria-hidden":"true",referrerPolicy:"no-referrer",onError:()=>a(h)}):null]}),u.jsxs("div",{className:"account-id",children:[u.jsxs("div",{className:"account-name-row",children:[u.jsx("div",{className:"account-name",children:o}),u.jsx(u_,{role:e.role})]}),l&&l!==o&&u.jsx("div",{className:"account-sub",children:l})]})]}),u.jsxs("button",{className:"account-logout",onClick:()=>{i(!1),n()},children:[u.jsx(h9,{className:"icon"})," 退出登录"]})]})]})]})}function jF({branding:e,sessions:t,currentSessionId:n,features:r,access:i,streamingSids:s,agentsSource:a="local",localApps:o=[],currentAgentId:l="",currentAgentLabel:c="",currentRuntime:d,onSelectAgent:f,onNewChat:h,onSearch:p,onQuickCreate:m,onSkillCenter:y,onAddAgent:v,onManageAgents:g,onPickSession:E,onDeleteSession:b,userInfo:w,onLogout:N}){const T=O=>(r==null?void 0:r[O])!==!1,[A,S]=_.useState(null),[R,I]=_.useState(!1),D=_.useRef(typeof window<"u"&&window.matchMedia(c_).matches),[F,W]=_.useState(D.current),j=()=>{I(O=>!O)},$=[...t].sort((O,L)=>(L.lastUpdateTime??0)-(O.lastUpdateTime??0)),C=()=>{D.current=!1,W(O=>!O),I(!1),S(null)};return _.useEffect(()=>{const O=window.matchMedia(c_),L=M=>{M.matches?W(k=>k||(D.current=!0,!0)):D.current&&(D.current=!1,W(!1))};return O.addEventListener("change",L),()=>O.removeEventListener("change",L)},[]),u.jsxs("aside",{className:`sidebar ${F?"is-collapsed":""}`,children:[u.jsxs("div",{className:"sidebar-top",children:[u.jsxs("div",{className:"sidebar-brand-row",children:[u.jsxs("div",{className:"brand",children:[u.jsx("img",{className:"brand-logo",src:e.logoUrl||sE,width:20,height:20,alt:"","aria-hidden":!0}),u.jsx("span",{className:"brand-title",children:e.title})]}),u.jsx("button",{type:"button",className:"sidebar-collapse-toggle",onClick:C,"aria-label":F?"展开侧边栏":"收起侧边栏",title:F?"展开侧边栏":"收起侧边栏",children:F?u.jsx(b9,{className:"icon"}):u.jsx(y9,{className:"icon"})})]}),f&&(()=>{const O=a==="cloud"&&!l,L=a==="cloud"&&!O&&!!d,M=a==="cloud"&&!O&&(d!=null&&d.region)?d.region==="cn-beijing"?"北京":d.region==="cn-shanghai"?"上海":d.region:"";return u.jsxs("button",{className:`agent-row ${O?"agent-row--empty":""} ${L?"agent-row--connected":""}`,onClick:j,"aria-label":O?"请选择 Agent":c||"选择 Agent",title:"切换 Agent",children:[u.jsx(Yh,{className:"icon agent-row-lead"}),u.jsx("span",{className:"agent-row-name",children:O?"请选择 Agent":c||"选择 Agent"}),M&&u.jsx("span",{className:"agent-row-region",children:M}),u.jsx(or,{className:`icon agent-row-chev ${R?"open":""}`})]})})(),f&&u.jsx(wF,{open:R,onClose:()=>I(!1),anchorTop:RF,agentsSource:a,localApps:o,currentId:l,currentRuntime:d,runtimeScope:i.capabilities.runtimeScope,onSelect:f}),T("newChat")&&u.jsxs("button",{className:"new-chat",onClick:h,"aria-label":"新会话",title:"新会话",children:[u.jsx(pi,{className:"icon"}),u.jsx("span",{className:"sidebar-nav-label",children:"新会话"})]}),T("search")&&u.jsx(fF,{onClick:p}),T("skillCenter")&&u.jsx(tF,{onClick:y}),i.capabilities.createAgents&&T("addAgent")&&u.jsxs("button",{className:"new-chat",onClick:m,"aria-label":"添加 Agent",title:"添加 Agent",children:[u.jsx(OF,{}),u.jsx("span",{className:"sidebar-nav-label",children:"添加 Agent"})]}),i.capabilities.manageAgents&&T("manageAgents")&&u.jsxs("button",{className:"new-chat",onClick:g,"aria-label":"管理 Agent",title:"管理 Agent",children:[u.jsx(LF,{}),u.jsx("span",{className:"sidebar-nav-label",children:"管理 Agent"})]})]}),T("history")&&u.jsxs("div",{className:"sidebar-history",children:[u.jsxs("div",{className:"history-head",children:[u.jsx("span",{children:"历史会话"}),T("newChat")&&u.jsx("button",{type:"button",className:"history-new-chat",onClick:h,"aria-label":"新建会话",title:"新建会话",children:u.jsx(pi,{className:"icon"})})]}),u.jsxs("div",{className:"history-list",children:[$.length===0&&u.jsx("div",{className:"history-empty",children:"暂无会话"}),$.map(O=>{const L=lI(O.events);return u.jsxs("div",{className:`history-item ${O.id===n?"active":""}`,children:[u.jsxs("button",{className:"history-item-btn",onClick:()=>E(O.id),title:L,children:[(s==null?void 0:s.has(O.id))&&u.jsx("span",{className:"history-streaming",title:"正在生成…","aria-label":"正在生成"}),u.jsx("span",{className:"history-title",children:L})]}),u.jsx("button",{className:"history-more",title:"更多",onClick:()=>S(M=>M===O.id?null:O.id),children:u.jsx(Q8,{className:"icon"})}),A===O.id&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>S(null)}),u.jsx("div",{className:"history-menu",children:u.jsxs("button",{className:"menu-item menu-item--danger",onClick:()=>{S(null),b(O.id)},children:[u.jsx(Il,{className:"icon"})," 删除"]})})]})]},O.id)})]})]}),u.jsx(PF,{access:i,userInfo:w,onLogout:N})]})}function BF({apps:e,appName:t,onAppChange:n,agentLabel:r,title:i,crumbs:s,rightContent:a}){return u.jsxs("div",{className:"navbar",children:[u.jsxs("div",{className:"navbar-left",children:[u.jsx("div",{className:"navbar-default",children:s&&s.length>0?u.jsx("nav",{className:"navbar-crumbs","aria-label":"面包屑",children:s.map((o,l)=>u.jsxs(_.Fragment,{children:[l>0&&u.jsx(or,{className:"crumb-sep"}),o.onClick?u.jsx("button",{className:"crumb crumb-link",onClick:o.onClick,children:o.label}):u.jsx("span",{className:"crumb crumb-current",children:o.label})]},l))}):i?u.jsx("div",{className:"navbar-title",title:i,children:i}):u.jsx(FF,{apps:e,appName:t,onAppChange:n,agentLabel:r})}),u.jsx("div",{id:"veadk-page-header-left",className:"navbar-portal-slot"})]}),u.jsxs("div",{className:"navbar-right",children:[u.jsx("div",{id:"veadk-page-header-actions",className:"navbar-portal-actions"}),a]})]})}function FF({apps:e,appName:t,onAppChange:n,agentLabel:r}){const[i,s]=_.useState(!1),[a,o]=_.useState(null),[l,c]=_.useState({}),[d,f]=_.useState(0),h=_.useRef({}),p=v=>r?r(v):v;function m(v){o(v);const g=h.current[v];if(g){const E=g.getBoundingClientRect(),b=g.closest(".agent-dd");if(b){const w=b.getBoundingClientRect();f(E.top-w.top)}}l[v]===void 0&&(c(E=>({...E,[v]:"loading"})),id(v).then(E=>c(b=>({...b,[v]:E}))).catch(()=>c(E=>({...E,[v]:"error"}))))}function y(){s(!1),o(null)}return u.jsxs("div",{className:"agent-dd",children:[u.jsxs("button",{className:"agent-dd-trigger",onClick:()=>s(v=>!v),children:[u.jsx("span",{className:"agent-dd-current",children:t?p(t):"选择 Agent"}),u.jsx($h,{className:`agent-dd-chev ${i?"open":""}`})]}),i&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:y}),u.jsx("div",{className:"agent-dd-menu",children:e.map(v=>u.jsx("div",{ref:g=>h.current[v]=g,className:"agent-dd-row",onMouseEnter:()=>m(v),onMouseLeave:()=>o(g=>g===v?null:g),children:u.jsxs("button",{className:`agent-dd-item ${v===t?"active":""}`,onClick:()=>{n(v),y()},children:[u.jsx("span",{className:"agent-dd-item-name",children:p(v)}),v===t&&u.jsx("span",{className:"agent-dd-item-dot","aria-label":"当前"})]})},v))}),a&&u.jsx(UF,{state:l[a],top:d})]})]})}function UF({state:e,top:t}){return u.jsx("div",{className:"agent-dd-flyout",style:{top:`${t}px`},children:e===void 0||e==="loading"?u.jsxs("div",{className:"agent-dd-fly-loading",children:[u.jsx(bt,{className:"icon spin"})," 加载中…"]}):e==="error"?u.jsx("div",{className:"agent-dd-fly-loading",children:"读取信息失败"}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"agent-dd-fly-name",children:e.name}),e.description&&u.jsx("div",{className:"agent-dd-fly-desc",children:e.description}),u.jsxs("div",{className:"agent-dd-fly-field",children:[u.jsx(SC,{className:"icon"}),u.jsx("span",{className:"agent-dd-fly-model",children:e.model})]}),e.tools.length>0&&u.jsxs("div",{className:"agent-dd-fly-field agent-dd-fly-field--tools",children:[u.jsx(Qb,{className:"icon"}),u.jsx("div",{className:"agent-dd-fly-chips",children:e.tools.map(n=>u.jsx("span",{className:"agent-dd-chip",children:n},n))})]}),e.subAgents.length>0&&u.jsxs("div",{className:"agent-dd-fly-field",children:[u.jsx("span",{className:"agent-dd-fly-label",children:"子 Agent"}),u.jsx("span",{className:"agent-dd-fly-model",children:e.subAgents.join("、")})]})]})})}const d_={llm:{icon:La,label:"LLM"},sequential:{icon:RC,label:"顺序"},parallel:{icon:jC,label:"并行"},loop:{icon:Xb,label:"循环"},a2a:{icon:Cl,label:"A2A"}};function bI(e){return 1+e.children.reduce((t,n)=>t+bI(n),0)}function ol(e){return e.id||e.name}function $F(e,t){const n=ol(e);if(e.id&&e.name&&e.name!==n)return e.name;if(t&&n==="agent")return"主 Agent";const r=/^agent_sub_(\d+)$/.exec(n);return r?`子 Agent ${r[1]}`:e.name||n}function EI(e,t=!0){return{...e,id:ol(e),name:$F(e,t),children:e.children.map(n=>EI(n,!1))}}function xI(e,t){t.set(ol(e),e.name||ol(e)),e.children.forEach(n=>xI(n,t))}function vI({node:e,activeAgent:t,seen:n,path:r}){const i=d_[e.type]??d_.llm,s=i.icon,a=ol(e),o=!!a,l=o&&a===t,c=o&&!l&&r.has(a),d=o&&!l&&!c&&n.has(a);return u.jsxs("div",{className:"topo-branch",children:[u.jsxs("div",{className:`topo-node topo-type-${e.type} ${l?"is-active":""} ${c?"is-onpath":""} ${d?"is-done":""}`,title:e.description||e.name,children:[u.jsx(s,{className:"topo-icon"}),u.jsx("span",{className:"topo-name",children:e.name||"(未命名)"}),u.jsx("span",{className:"topo-badge",children:i.label})]}),l&&e.type==="a2a"&&u.jsx("div",{className:"topo-remote",children:"远程执行中…"}),e.children.length>0&&u.jsx("div",{className:"topo-children",children:e.children.map((f,h)=>u.jsx(vI,{node:f,activeAgent:t,seen:n,path:r},`${ol(f)}-${h}`))})]})}function f_({appName:e,activeAgent:t,seenAgents:n,execPath:r=[]}){const[i,s]=_.useState(null);if(_.useEffect(()=>{let l=!1;if(s(null),!!e)return id(e).then(c=>{l||s(c.graph?EI(c.graph):null)}).catch(()=>{l||s(null)}),()=>{l=!0}},[e]),!i||i.children.length===0)return null;const a=new Set(r),o=new Map;return xI(i,o),u.jsxs("aside",{className:"topo","aria-label":"Agent 拓扑",children:[u.jsxs("div",{className:"topo-head",children:[u.jsx("span",{className:"topo-head-title",children:"Agent 拓扑"}),u.jsxs("span",{className:"topo-head-sub",children:[bI(i)," 个"]})]}),r.length>0&&u.jsx("div",{className:"topo-path","aria-label":"执行路径",children:r.map((l,c)=>u.jsxs("span",{className:"topo-path-seg",children:[c>0&&u.jsx(or,{className:"topo-path-sep"}),u.jsx("span",{className:c===r.length-1?"topo-path-name is-current":"topo-path-name",children:o.get(l)??l})]},`${l}-${c}`))}),u.jsx("div",{className:"topo-tree",children:u.jsx(vI,{node:i,activeAgent:t,seen:n,path:a})})]})}function HF({onAdded:e,onCancel:t}){const[n,r]=_.useState(""),[i,s]=_.useState(""),[a,o]=_.useState(""),[l,c]=_.useState(!1),[d,f]=_.useState(""),h=n.trim().length>0&&i.trim().length>0&&!l;async function p(){if(h){c(!0),f("");try{const m=await hI(a,n,i,a);if(m.apps.length===0){f("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。"),c(!1);return}e(Da(m.id,m.apps[0]))}catch(m){f(`连接失败:${String(m)}。请检查 URL、API Key,以及该网关是否允许跨域。`),c(!1)}}}return u.jsx("div",{className:"addagent",children:u.jsxs("div",{className:"addagent-card",children:[u.jsx("h2",{className:"addagent-title",children:"添加 AgentKit 智能体"}),u.jsx("p",{className:"addagent-sub",children:"填入 AgentKit 部署的访问地址与 API Key,将通过 ADK 协议连接,连接成功后其 Agent 会出现在左上角的下拉中。"}),u.jsxs("label",{className:"addagent-field",children:[u.jsx("span",{className:"addagent-label",children:"访问地址 URL"}),u.jsx("input",{className:"addagent-input",value:n,onChange:m=>r(m.target.value),placeholder:"https://xxxxx.apigateway-cn-beijing.volceapi.com",autoFocus:!0})]}),u.jsxs("label",{className:"addagent-field",children:[u.jsx("span",{className:"addagent-label",children:"API Key"}),u.jsx("input",{className:"addagent-input",type:"password",value:i,onChange:m=>s(m.target.value),placeholder:"以 Authorization: Bearer 方式连接"})]}),u.jsxs("label",{className:"addagent-field",children:[u.jsx("span",{className:"addagent-label",children:"显示名称(可选)"}),u.jsx("input",{className:"addagent-input",value:a,onChange:m=>o(m.target.value),placeholder:"默认取 URL 的主机名"})]}),d&&u.jsx("div",{className:"addagent-error",children:d}),u.jsxs("div",{className:"addagent-actions",children:[u.jsx("button",{className:"addagent-btn addagent-btn--ghost",onClick:t,disabled:l,children:"取消"}),u.jsxs("button",{className:"addagent-btn addagent-btn--primary",onClick:p,disabled:!h,children:[l?u.jsx(bt,{className:"icon spin"}):null,l?"连接中…":"连接并添加"]})]})]})})}function zF({currentRuntimeId:e,onConnect:t}){const[n,r]=_.useState([]),[i,s]=_.useState(!0),[a,o]=_.useState(""),[l,c]=_.useState(null),[d,f]=_.useState(null),[h,p]=_.useState(null),[m,y]=_.useState({}),[v,g]=_.useState("cn-beijing"),[E,b]=_.useState(!1),w=_.useCallback(async()=>{s(!0),o("");try{r(await ZC(v))}catch(R){o(R instanceof Error?R.message:String(R))}finally{s(!1)}},[v]);_.useEffect(()=>{w()},[w]);async function N(R){y(D=>({...D,[R.runtimeId]:{loading:!0}}));const I={loading:!1};try{I.detail=await rE(R.runtimeId,R.region)}catch(D){I.error=D instanceof Error?D.message:String(D)}I.detail&&(I.graphs=[{name:I.detail.name,description:I.detail.description,type:"llm",model:I.detail.model,tools:[],skills:[],path:[I.detail.name],mentionable:!1,children:[]}],I.graphNote="仅显示主 Agent(控制面信息)。"),y(D=>({...D,[R.runtimeId]:I}))}function T(R){const I=h===R.runtimeId;p(I?null:R.runtimeId),!I&&!m[R.runtimeId]&&N(R)}async function A(R){if(!l&&window.confirm(`确定删除 Agent "${R.name}"?该 Runtime 将被永久删除。`)){c(R.runtimeId),o("");try{await rI(R.runtimeId,R.region),r(I=>I.filter(D=>D.runtimeId!==R.runtimeId))}catch(I){o(I instanceof Error?I.message:String(I))}finally{c(null)}}}async function S(R){if(!(d||e===R.runtimeId)){f(R.runtimeId),o("");try{await t(R)}catch(I){o(I instanceof Error?I.message:String(I))}finally{f(null)}}}return u.jsxs("div",{className:"manage",children:[u.jsxs("div",{className:"manage-head",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"manage-title",children:"管理 Agent"}),u.jsx("p",{className:"manage-sub",children:"列出你有权管理的 AgentKit Runtime"})]}),u.jsxs("div",{className:"manage-head-actions",children:[u.jsxs("div",{className:"manage-region-picker",onKeyDown:R=>{R.key==="Escape"&&b(!1)},children:[u.jsxs("button",{type:"button",className:"manage-region",onClick:()=>b(R=>!R),title:"按区域筛选","aria-label":"区域筛选","aria-haspopup":"listbox","aria-expanded":E,children:[u.jsx("span",{children:v==="cn-beijing"?"北京":"上海"}),u.jsx($h,{className:`manage-region-chevron${E?" is-open":""}`})]}),E&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>b(!1)}),u.jsx("div",{className:"manage-region-menu",role:"listbox","aria-label":"区域",children:[{value:"cn-beijing",label:"北京"},{value:"cn-shanghai",label:"上海"}].map(R=>{const I=R.value===v;return u.jsxs("button",{type:"button",role:"option","aria-selected":I,className:`manage-region-option${I?" is-selected":""}`,onClick:()=>{g(R.value),b(!1)},children:[u.jsx("span",{children:R.label}),I&&u.jsx(Li,{"aria-hidden":"true"})]},R.value)})})]})]}),u.jsxs("button",{type:"button",className:"manage-refresh",onClick:()=>void w(),disabled:i,title:"刷新",children:[u.jsx(Gb,{className:`icon ${i?"spin":""}`}),"刷新"]})]})]}),a&&u.jsx("div",{className:"manage-error",children:a}),i?u.jsxs("div",{className:"manage-empty",children:[u.jsx(bt,{className:"icon spin"})," 加载中…"]}):n.length===0?u.jsx("div",{className:"manage-empty",children:"暂无你部署的 Agent。"}):u.jsx("ul",{className:"manage-list",children:n.map(R=>{const I=h===R.runtimeId,D=m[R.runtimeId];return u.jsxs("li",{className:"manage-item",children:[u.jsxs("div",{className:"manage-item-row",children:[u.jsxs("button",{type:"button",className:"manage-item-toggle",onClick:()=>T(R),"aria-expanded":I,children:[I?u.jsx($h,{className:"icon"}):u.jsx(or,{className:"icon"}),u.jsxs("span",{className:"manage-item-main",children:[u.jsx("span",{className:"manage-item-name",children:R.name}),u.jsx("span",{className:`manage-badge is-${qF(R.status)}`,children:R.status||"-"})]})]}),u.jsxs("div",{className:"manage-item-actions",children:[u.jsxs("button",{type:"button",className:"manage-connect",onClick:()=>void S(R),disabled:d!==null||e===R.runtimeId,children:[d===R.runtimeId?u.jsx(bt,{className:"icon spin"}):u.jsx(c9,{className:"icon"}),e===R.runtimeId?"已连接":"连接到此 Agent"]}),u.jsx("button",{type:"button",className:"manage-del",onClick:()=>void A(R),disabled:l===R.runtimeId,title:"删除该 Runtime",children:l===R.runtimeId?u.jsx(bt,{className:"icon spin"}):u.jsx(Il,{className:"icon"})})]})]}),u.jsxs("div",{className:"manage-item-meta",children:[u.jsx("span",{className:"manage-item-id",title:R.runtimeId,children:R.runtimeId}),u.jsx("span",{className:"manage-item-dot",children:"·"}),u.jsx("span",{children:R.region}),R.createdAt&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"manage-item-dot",children:"·"}),u.jsx("span",{children:_I(R.createdAt)})]})]}),I&&u.jsx("div",{className:"manage-detail",children:!D||D.loading?u.jsxs("div",{className:"manage-detail-loading",children:[u.jsx(bt,{className:"icon spin"})," 读取详情…"]}):u.jsxs(u.Fragment,{children:[D.error&&u.jsx("div",{className:"manage-error",children:D.error}),D.detail&&u.jsx(YF,{detail:D.detail}),u.jsx("div",{className:"manage-tree-head",children:"Agent 结构"}),D.graphs&&D.graphs.length>0?D.graphs.map((F,W)=>u.jsx(wI,{node:F},W)):u.jsx("div",{className:"manage-tree-note",children:D.graphNote})]})})]},R.runtimeId)})})]})}const VF=/KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL/i;function KF({envKey:e,value:t}){const[n,r]=_.useState(!1);return!VF.test(e)||n?u.jsx("code",{className:"manage-env-v",children:t}):u.jsx("button",{type:"button",className:"manage-env-v manage-env-masked",title:"敏感值已隐藏,点击显示","aria-label":`显示 ${e} 的值`,onClick:()=>r(!0),children:"••••••••"})}function YF({detail:e}){const t=e.resources,n=[];e.model&&n.push(["模型",e.model]),e.description&&n.push(["描述",e.description]),e.statusMessage&&n.push(["状态信息",e.statusMessage]),e.project&&n.push(["Project",e.project]),e.currentVersion!=null&&n.push(["版本",String(e.currentVersion)]);const r=[t.cpuMilli!=null?`CPU ${t.cpuMilli}m`:"",t.memoryMb!=null?`内存 ${t.memoryMb}MB`:"",t.minInstance!=null||t.maxInstance!=null?`实例 ${t.minInstance??"?"}~${t.maxInstance??"?"}`:"",t.maxConcurrency!=null?`并发 ${t.maxConcurrency}`:""].filter(Boolean).join(" · ");return r&&n.push(["资源",r]),e.memoryId&&n.push(["Memory",e.memoryId]),e.toolId&&n.push(["Tool",e.toolId]),e.knowledgeId&&n.push(["Knowledge",e.knowledgeId]),e.mcpToolsetId&&n.push(["MCP Toolset",e.mcpToolsetId]),e.updatedAt&&n.push(["更新时间",_I(e.updatedAt)]),u.jsxs("div",{className:"manage-detail-card",children:[u.jsx("dl",{className:"manage-kv",children:n.map(([i,s])=>u.jsxs("div",{className:"manage-kv-row",children:[u.jsx("dt",{children:i}),u.jsx("dd",{children:s})]},i))}),e.envs.length>0&&u.jsxs("div",{className:"manage-envs",children:[u.jsx("div",{className:"manage-envs-head",children:"环境变量"}),e.envs.map(i=>u.jsxs("div",{className:"manage-env",children:[u.jsx("code",{className:"manage-env-k",children:i.key}),u.jsx(KF,{envKey:i.key,value:i.value})]},i.key))]})]})}const WF={llm:"LLM",sequential:"Sequential",parallel:"Parallel",loop:"Loop",a2a:"A2A"};function wI({node:e,depth:t=0}){return u.jsxs("div",{className:"manage-tree",style:{marginLeft:t?16:0},children:[u.jsxs("div",{className:"manage-tree-node",children:[u.jsx("span",{className:"manage-tree-name",children:e.name||"(未命名)"}),u.jsx("span",{className:"manage-tree-type",children:WF[e.type]||e.type}),e.model&&u.jsx("span",{className:"manage-tree-model",children:e.model})]}),e.tools.length>0&&u.jsx("div",{className:"manage-tree-tools",children:e.tools.map(n=>u.jsx("span",{className:"manage-tree-tool",children:n},n))}),e.children.map((n,r)=>u.jsx(wI,{node:n,depth:t+1},r))]})}function qF(e){const t=(e||"").toLowerCase();return t.includes("run")||t.includes("ready")||t.includes("active")?"ok":t.includes("creat")||t.includes("pend")||t.includes("deploy")?"warn":t.includes("fail")||t.includes("error")||t.includes("delet")?"bad":"muted"}function _I(e){const t=Number(e),n=Number.isFinite(t)&&String(t)===e?new Date(t*1e3):new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleString()}const GF={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 XF(e,t){if(!t||t==="/")return e;const n=t.replace(/^\//,"").split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~"));let r=e;for(const i of n){if(r==null||typeof r!="object")return;r=r[i]}return r}function QF(e){return typeof e=="object"&&e!==null&&typeof e.path=="string"}function ZF(e){return typeof e=="object"&&e!==null&&typeof e.call=="string"}function aE(e,t){if(QF(e))return XF(t,e.path);if(ZF(e)){const n=GF[e.call],r={};for(const[i,s]of Object.entries(e.args??{}))r[i]=aE(s,t);return n?n(r):`[unknown fn: ${e.call}]`}return e}function JF(e,t){const n=aE(e,t);return n==null?"":typeof n=="string"?n:String(n)}const TI=new Map;function Ya(e,t){TI.set(e,t)}function eU(e){return TI.get(e)}function tU(e,t,n){const r=t.replace(/^\//,"").split("/").map(s=>s.replace(/~1/g,"/").replace(/~0/g,"~"));let i=e;for(let s=0;saE(r,e.dataModel),resolveString:r=>JF(r,e.dataModel),dispatchAction:t,render:r=>{if(!r)return null;const i=e.components[r];if(!i)return null;const s=eU(i.component)??nU;return u.jsx(s,{node:i,ctx:n},r)}};return u.jsx("div",{className:"a2ui-surface","data-a2ui-surface":e.surfaceId,children:n.render(e.rootId)})}function SI(e){const t=_.useRef(null),n=_.useRef(!0),r=28,i=_.useCallback(()=>{const s=t.current;s&&(n.current=s.scrollHeight-s.scrollTop-s.clientHeight{const s=t.current;s&&n.current&&(s.scrollTop=s.scrollHeight)},[e]),{ref:t,onScroll:i}}function Jle(){}function h_(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&t.push(a),i=r+1,r=n.indexOf(",",i)}return t}function kI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const iU=/[$_\p{ID_Start}]/u,sU=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,aU=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,oU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AI={};function ece(e){return e?iU.test(String.fromCodePoint(e)):!1}function tce(e,t){const r=(t||AI).jsx?aU:sU;return e?r.test(String.fromCodePoint(e)):!1}function p_(e,t){return(AI.jsx?lU:oU).test(e)}const cU=/[ \t\n\f\r]/g;function uU(e){return typeof e=="object"?e.type==="text"?m_(e.value):!1:m_(e)}function m_(e){return e.replace(cU,"")===""}let sd=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};sd.prototype.normal={};sd.prototype.property={};sd.prototype.space=void 0;function CI(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new sd(n,r,t)}function ku(e){return e.toLowerCase()}class _r{constructor(t,n){this.attribute=n,this.property=t}}_r.prototype.attribute="";_r.prototype.booleanish=!1;_r.prototype.boolean=!1;_r.prototype.commaOrSpaceSeparated=!1;_r.prototype.commaSeparated=!1;_r.prototype.defined=!1;_r.prototype.mustUseProperty=!1;_r.prototype.number=!1;_r.prototype.overloadedBoolean=!1;_r.prototype.property="";_r.prototype.spaceSeparated=!1;_r.prototype.space=void 0;let dU=0;const We=Wa(),bn=Wa(),Ly=Wa(),ge=Wa(),Ct=Wa(),Ho=Wa(),Sr=Wa();function Wa(){return 2**++dU}const My=Object.freeze(Object.defineProperty({__proto__:null,boolean:We,booleanish:bn,commaOrSpaceSeparated:Sr,commaSeparated:Ho,number:ge,overloadedBoolean:Ly,spaceSeparated:Ct},Symbol.toStringTag,{value:"Module"})),yg=Object.keys(My);class oE extends _r{constructor(t,n,r,i){let s=-1;if(super(t,n),g_(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&gU.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(y_,bU);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!y_.test(s)){let a=s.replace(mU,yU);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=oE}return new i(r,t)}function yU(e){return"-"+e.toLowerCase()}function bU(e){return e.charAt(1).toUpperCase()}const ad=CI([II,fU,LI,MI,DI],"html"),Xs=CI([II,hU,LI,MI,DI],"svg");function b_(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function PI(e){return e.join(" ").trim()}var lE={},E_=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,EU=/\n/g,xU=/^\s*/,vU=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,wU=/^:\s*/,_U=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,TU=/^[;\s]*/,NU=/^\s+|\s+$/g,SU=` +`,x_="/",v_="*",da="",kU="comment",AU="declaration";function CU(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var y=m.match(EU);y&&(n+=y.length);var v=m.lastIndexOf(SU);r=~v?m.length-v:r+m.length}function s(){var m={line:n,column:r};return function(y){return y.position=new a(m),c(),y}}function a(m){this.start=m,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(m){var y=new Error(t.source+":"+n+":"+r+": "+m);if(y.reason=m,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(m){var y=m.exec(e);if(y){var v=y[0];return i(v),e=e.slice(v.length),y}}function c(){l(xU)}function d(m){var y;for(m=m||[];y=f();)y!==!1&&m.push(y);return m}function f(){var m=s();if(!(x_!=e.charAt(0)||v_!=e.charAt(1))){for(var y=2;da!=e.charAt(y)&&(v_!=e.charAt(y)||x_!=e.charAt(y+1));)++y;if(y+=2,da===e.charAt(y-1))return o("End of comment missing");var v=e.slice(2,y-2);return r+=2,i(v),e=e.slice(y),r+=2,m({type:kU,comment:v})}}function h(){var m=s(),y=l(vU);if(y){if(f(),!l(wU))return o("property missing ':'");var v=l(_U),g=m({type:AU,property:w_(y[0].replace(E_,da)),value:v?w_(v[0].replace(E_,da)):da});return l(TU),g}}function p(){var m=[];d(m);for(var y;y=h();)y!==!1&&(m.push(y),d(m));return m}return c(),p()}function w_(e){return e?e.replace(NU,da):da}var IU=CU,RU=lh&&lh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lE,"__esModule",{value:!0});lE.default=LU;const OU=RU(IU);function LU(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,OU.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0});Wp.camelCase=void 0;var MU=/^--[a-zA-Z0-9_-]+$/,DU=/-([a-z])/g,PU=/^[^-]+$/,jU=/^-(webkit|moz|ms|o|khtml)-/,BU=/^-(ms)-/,FU=function(e){return!e||PU.test(e)||MU.test(e)},UU=function(e,t){return t.toUpperCase()},__=function(e,t){return"".concat(t,"-")},$U=function(e,t){return t===void 0&&(t={}),FU(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(BU,__):e=e.replace(jU,__),e.replace(DU,UU))};Wp.camelCase=$U;var HU=lh&&lh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},zU=HU(lE),VU=Wp;function Dy(e,t){var n={};return!e||typeof e!="string"||(0,zU.default)(e,function(r,i){r&&i&&(n[(0,VU.camelCase)(r,t)]=i)}),n}Dy.default=Dy;var KU=Dy;const YU=Ku(KU),qp=jI("end"),Mi=jI("start");function jI(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function WU(e){const t=Mi(e),n=qp(e);if(t&&n)return{start:t,end:n}}function zc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?T_(e.position):"start"in e||"end"in e?T_(e):"line"in e||"column"in e?Py(e):""}function Py(e){return N_(e&&e.line)+":"+N_(e&&e.column)}function T_(e){return Py(e&&e.start)+"-"+Py(e&&e.end)}function N_(e){return e&&typeof e=="number"?e:1}class Zn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=zc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zn.prototype.file="";Zn.prototype.name="";Zn.prototype.reason="";Zn.prototype.message="";Zn.prototype.stack="";Zn.prototype.column=void 0;Zn.prototype.line=void 0;Zn.prototype.ancestors=void 0;Zn.prototype.cause=void 0;Zn.prototype.fatal=void 0;Zn.prototype.place=void 0;Zn.prototype.ruleId=void 0;Zn.prototype.source=void 0;const cE={}.hasOwnProperty,qU=new Map,GU=/[A-Z]/g,XU=new Set(["table","tbody","thead","tfoot","tr"]),QU=new Set(["td","th"]),BI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ZU(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=a7(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");r=s7(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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"?Xs:ad,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=FI(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function FI(e,t,n){if(t.type==="element")return JU(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return e7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return n7(e,t,n);if(t.type==="mdxjsEsm")return t7(e,t);if(t.type==="root")return r7(e,t,n);if(t.type==="text")return i7(e,t)}function JU(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Xs,e.schema=i),e.ancestors.push(t);const s=$I(e,t.tagName,!1),a=o7(e,t);let o=dE(e,t);return XU.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!uU(l):!0})),UI(e,a,s,t),uE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function e7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Au(e,t.position)}function t7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Au(e,t.position)}function n7(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Xs,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:$I(e,t.name,!0),a=l7(e,t),o=dE(e,t);return UI(e,a,s,t),uE(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function r7(e,t,n){const r={};return uE(r,dE(e,t)),e.create(t,e.Fragment,r,n)}function i7(e,t){return t.value}function UI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function uE(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function s7(e,t,n){return r;function r(i,s,a,o){const c=Array.isArray(a.children)?n:t;return o?c(s,a,o):c(s,a)}}function a7(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=Mi(r);return t(i,s,a,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function o7(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&cE.call(t.properties,i)){const s=c7(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&QU.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function l7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Au(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Au(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function dE(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:qU;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s0?(Or(e,e.length,0,t),e):t}const A_={}.hasOwnProperty;function zI(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 fi(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sr=Qs(/[A-Za-z]/),Xn=Qs(/[\dA-Za-z]/),b7=Qs(/[#-'*+\--9=?A-Z^-~]/);function Wh(e){return e!==null&&(e<32||e===127)}const jy=Qs(/\d/),E7=Qs(/[\dA-Fa-f]/),x7=Qs(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function kt(e){return e!==null&&(e<0||e===32)}function et(e){return e===-2||e===-1||e===32}const Gp=Qs(new RegExp("\\p{P}|\\p{S}","u")),Pa=Qs(/\s/);function Qs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ll(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function lt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return et(l)?(e.enter(n),o(l)):t(l)}function o(l){return et(l)&&s++a))return;const A=t.events.length;let S=A,R,I;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){if(R){I=t.events[S][1].end;break}R=!0}for(g(r),T=A;Tb;){const N=n[w];t.containerState=N[1],N[0].exit.call(t,e)}n.length=b}function E(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function N7(e,t,n){return lt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ll(e){if(e===null||kt(e)||Pa(e))return 1;if(Gp(e))return 2}function Xp(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},h={...e[n][1].start};I_(f,-l),I_(h,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Hr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Hr(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=Hr(c,Xp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Hr(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=Hr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Or(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&et(T)?lt(e,E,"linePrefix",s+1)(T):E(T)}function E(T){return T===null||Be(T)?e.check(R_,y,w)(T):(e.enter("codeFlowValue"),b(T))}function b(T){return T===null||Be(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),b)}function w(T){return e.exit("codeFenced"),t(T)}function N(T,A,S){let R=0;return I;function I($){return T.enter("lineEnding"),T.consume($),T.exit("lineEnding"),D}function D($){return T.enter("codeFencedFence"),et($)?lt(T,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):F($)}function F($){return $===o?(T.enter("codeFencedFenceSequence"),W($)):S($)}function W($){return $===o?(R++,T.consume($),W):R>=a?(T.exit("codeFencedFenceSequence"),et($)?lt(T,j,"whitespace")($):j($)):S($)}function j($){return $===null||Be($)?(T.exit("codeFencedFence"),A($)):S($)}}}function j7(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Eg={name:"codeIndented",tokenize:F7},B7={partial:!0,tokenize:U7};function F7(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),lt(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):Be(c)?e.attempt(B7,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||Be(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function U7(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):lt(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):Be(a)?i(a):n(a)}}const $7={name:"codeText",previous:z7,resolve:H7,tokenize:V7};function H7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=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-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&rc(this.left,r),s.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),rc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),rc(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(r.parser.constructs.flow,n,t)(a)}}function GI(e,t,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),h):g===null||g===32||g===41||Wh(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),y(g))}function h(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(o),h(g)):g===null||g===60||Be(g)?n(g):(e.consume(g),g===92?m:p)}function m(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function y(g){return!d&&(g===null||g===41||kt(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):d999||p===null||p===91||p===93&&!l||p===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):Be(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||Be(p)||o++>999?(e.exit("chunkString"),d(p)):(e.consume(p),l||(l=!et(p)),p===92?h:f)}function h(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function QI(e,t,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),a=h===40?41:h,l):n(h)}function l(h){return h===a?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===a?(e.exit(s),l(a)):h===null?n(h):Be(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),lt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||Be(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?f:d)}function f(h){return h===a||h===92?(e.consume(h),d):d(h)}}function Vc(e,t){let n;return r;function r(i){return Be(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):et(i)?lt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Z7={name:"definition",tokenize:e$},J7={partial:!0,tokenize:t$};function e$(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),a(p)}function a(p){return XI.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return i=fi(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return kt(p)?Vc(e,c)(p):c(p)}function c(p){return GI(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(J7,f,f)(p)}function f(p){return et(p)?lt(e,h,"whitespace")(p):h(p)}function h(p){return p===null||Be(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function t$(e,t,n){return r;function r(o){return kt(o)?Vc(e,i)(o):n(o)}function i(o){return QI(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return et(o)?lt(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Be(o)?t(o):n(o)}}const n$={name:"hardBreakEscape",tokenize:r$};function r$(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Be(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const i$={name:"headingAtx",resolve:s$,tokenize:a$};function s$(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Or(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function a$(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||kt(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||Be(d)?(e.exit("atxHeading"),t(d)):et(d)?lt(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||kt(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const o$=["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"],L_=["pre","script","style","textarea"],l$={concrete:!0,name:"htmlFlow",resolveTo:d$,tokenize:f$},c$={partial:!0,tokenize:p$},u$={partial:!0,tokenize:h$};function d$(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 f$(e,t,n){const r=this;let i,s,a,o,l;return c;function c(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),s=!0,y):P===63?(e.consume(P),i=3,r.interrupt?t:k):sr(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,o=0,m):sr(P)?(e.consume(P),i=4,r.interrupt?t:k):n(P)}function p(P){return P===45?(e.consume(P),r.interrupt?t:k):n(P)}function m(P){const V="CDATA[";return P===V.charCodeAt(o++)?(e.consume(P),o===V.length?r.interrupt?t:F:m):n(P)}function y(P){return sr(P)?(e.consume(P),a=String.fromCharCode(P),v):n(P)}function v(P){if(P===null||P===47||P===62||kt(P)){const V=P===47,Q=a.toLowerCase();return!V&&!s&&L_.includes(Q)?(i=1,r.interrupt?t(P):F(P)):o$.includes(a.toLowerCase())?(i=6,V?(e.consume(P),g):r.interrupt?t(P):F(P)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):s?E(P):b(P))}return P===45||Xn(P)?(e.consume(P),a+=String.fromCharCode(P),v):n(P)}function g(P){return P===62?(e.consume(P),r.interrupt?t:F):n(P)}function E(P){return et(P)?(e.consume(P),E):I(P)}function b(P){return P===47?(e.consume(P),I):P===58||P===95||sr(P)?(e.consume(P),w):et(P)?(e.consume(P),b):I(P)}function w(P){return P===45||P===46||P===58||P===95||Xn(P)?(e.consume(P),w):N(P)}function N(P){return P===61?(e.consume(P),T):et(P)?(e.consume(P),N):b(P)}function T(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),l=P,A):et(P)?(e.consume(P),T):S(P)}function A(P){return P===l?(e.consume(P),l=null,R):P===null||Be(P)?n(P):(e.consume(P),A)}function S(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||kt(P)?N(P):(e.consume(P),S)}function R(P){return P===47||P===62||et(P)?b(P):n(P)}function I(P){return P===62?(e.consume(P),D):n(P)}function D(P){return P===null||Be(P)?F(P):et(P)?(e.consume(P),D):n(P)}function F(P){return P===45&&i===2?(e.consume(P),C):P===60&&i===1?(e.consume(P),O):P===62&&i===4?(e.consume(P),Y):P===63&&i===3?(e.consume(P),k):P===93&&i===5?(e.consume(P),M):Be(P)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(c$,G,W)(P)):P===null||Be(P)?(e.exit("htmlFlowData"),W(P)):(e.consume(P),F)}function W(P){return e.check(u$,j,G)(P)}function j(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),$}function $(P){return P===null||Be(P)?W(P):(e.enter("htmlFlowData"),F(P))}function C(P){return P===45?(e.consume(P),k):F(P)}function O(P){return P===47?(e.consume(P),a="",L):F(P)}function L(P){if(P===62){const V=a.toLowerCase();return L_.includes(V)?(e.consume(P),Y):F(P)}return sr(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),L):F(P)}function M(P){return P===93?(e.consume(P),k):F(P)}function k(P){return P===62?(e.consume(P),Y):P===45&&i===2?(e.consume(P),k):F(P)}function Y(P){return P===null||Be(P)?(e.exit("htmlFlowData"),G(P)):(e.consume(P),Y)}function G(P){return e.exit("htmlFlow"),t(P)}}function h$(e,t,n){const r=this;return i;function i(a){return Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function p$(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(od,t,n)}}const m$={name:"htmlText",tokenize:g$};function g$(e,t,n){const r=this;let i,s,a;return o;function o(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),N):k===63?(e.consume(k),b):sr(k)?(e.consume(k),S):n(k)}function c(k){return k===45?(e.consume(k),d):k===91?(e.consume(k),s=0,m):sr(k)?(e.consume(k),E):n(k)}function d(k){return k===45?(e.consume(k),p):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),h):Be(k)?(a=f,O(k)):(e.consume(k),f)}function h(k){return k===45?(e.consume(k),p):f(k)}function p(k){return k===62?C(k):k===45?h(k):f(k)}function m(k){const Y="CDATA[";return k===Y.charCodeAt(s++)?(e.consume(k),s===Y.length?y:m):n(k)}function y(k){return k===null?n(k):k===93?(e.consume(k),v):Be(k)?(a=y,O(k)):(e.consume(k),y)}function v(k){return k===93?(e.consume(k),g):y(k)}function g(k){return k===62?C(k):k===93?(e.consume(k),g):y(k)}function E(k){return k===null||k===62?C(k):Be(k)?(a=E,O(k)):(e.consume(k),E)}function b(k){return k===null?n(k):k===63?(e.consume(k),w):Be(k)?(a=b,O(k)):(e.consume(k),b)}function w(k){return k===62?C(k):b(k)}function N(k){return sr(k)?(e.consume(k),T):n(k)}function T(k){return k===45||Xn(k)?(e.consume(k),T):A(k)}function A(k){return Be(k)?(a=A,O(k)):et(k)?(e.consume(k),A):C(k)}function S(k){return k===45||Xn(k)?(e.consume(k),S):k===47||k===62||kt(k)?R(k):n(k)}function R(k){return k===47?(e.consume(k),C):k===58||k===95||sr(k)?(e.consume(k),I):Be(k)?(a=R,O(k)):et(k)?(e.consume(k),R):C(k)}function I(k){return k===45||k===46||k===58||k===95||Xn(k)?(e.consume(k),I):D(k)}function D(k){return k===61?(e.consume(k),F):Be(k)?(a=D,O(k)):et(k)?(e.consume(k),D):R(k)}function F(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,W):Be(k)?(a=F,O(k)):et(k)?(e.consume(k),F):(e.consume(k),j)}function W(k){return k===i?(e.consume(k),i=void 0,$):k===null?n(k):Be(k)?(a=W,O(k)):(e.consume(k),W)}function j(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||kt(k)?R(k):(e.consume(k),j)}function $(k){return k===47||k===62||kt(k)?R(k):n(k)}function C(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function O(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),L}function L(k){return et(k)?lt(e,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):M(k)}function M(k){return e.enter("htmlTextData"),a(k)}}const pE={name:"labelEnd",resolveAll:x$,resolveTo:v$,tokenize:w$},y$={tokenize:_$},b$={tokenize:T$},E$={tokenize:N$};function x$(e){let t=-1;const n=[];for(;++t=3&&(c===null||Be(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),et(c)?lt(e,o,"whitespace")(c):o(c))}}const mr={continuation:{tokenize:D$},exit:j$,name:"list",tokenize:M$},O$={partial:!0,tokenize:B$},L$={partial:!0,tokenize:P$};function M$(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:jy(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Wf,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return jy(p)&&++a<10?(e.consume(p),l):(!r.interrupt||a<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(od,r.interrupt?n:d,e.attempt(O$,h,f))}function d(p){return r.containerState.initialBlankLine=!0,s++,h(p)}function f(p){return et(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function D$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(od,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,lt(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!et(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(L$,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,lt(e,e.attempt(mr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function P$(e,t,n){const r=this;return lt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function j$(e){e.exit(this.containerState.type)}function B$(e,t,n){const r=this;return lt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!et(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const M_={name:"setextUnderline",resolveTo:F$,tokenize:U$};function F$(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function U$(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),et(c)?lt(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Be(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const $$={tokenize:H$};function H$(e){const t=this,n=e.attempt(od,r,e.attempt(this.parser.constructs.flowInitial,i,lt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(W7,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const z$={resolveAll:JI()},V$=ZI("string"),K$=ZI("text");function ZI(e){return{resolveAll:JI(e==="text"?Y$:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(d){return c(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),l)}function c(d){if(d===null)return!0;const f=i[d];let h=-1;if(f)for(;++h-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function sH(e,t){let n=-1;const r=[];let i;for(;++n0){const Ge=oe.tokenStack[oe.tokenStack.length-1];(Ge[1]||D_).call(oe,void 0,Ge[0])}for(X.position={start:os(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:os(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function hH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=kl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function gH(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 yH(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function eO(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function bH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return eO(e,t);const i={src:kl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function EH(e,t){const n={src:kl(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function xH(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function vH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return eO(e,t);const i={href:kl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function wH(e,t){const n={href:kl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _H(e,t,n){const r=e.all(t),i=n?TH(n):tO(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.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:[]}),s.className=["task-list-item"]}let o=-1;for(;++o0){const st=oe.tokenStack[oe.tokenStack.length-1];(st[1]||P_).call(oe,void 0,st[0])}for(X.position={start:fs(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:fs(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},Ae=-1;++Ae0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function EH(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xH(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vH(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ll(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function wH(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 _H(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function nR(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function TH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nR(e,t);const i={src:Ll(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function NH(e,t){const n={src:Ll(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function SH(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function kH(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nR(e,t);const i={href:Ll(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function AH(e,t){const n={href:Ll(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function CH(e,t,n){const r=e.all(t),i=n?IH(n):rR(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.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:[]}),s.className=["task-list-item"]}let o=-1;for(;++o1}function NH(e,t){const n={},r=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)},o=Ci(t.children[1]),l=Wp(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function IH(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(B_(t.slice(i),i>0,!1)),s.join("")}function B_(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===P_||s===j_;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===P_||s===j_;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function LH(e,t){const n={type:"text",value:RH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function MH(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const DH={blockquote:uH,break:dH,code:fH,delete:hH,emphasis:pH,footnoteReference:mH,heading:gH,html:yH,imageReference:bH,image:EH,inlineCode:xH,linkReference:vH,link:wH,listItem:_H,list:NH,paragraph:SH,root:kH,strong:AH,table:CH,tableCell:OH,tableRow:IH,text:LH,thematicBreak:MH,toml:Qd,yaml:Qd,definition:Qd,footnoteDefinition:Qd};function Qd(){}const nO=-1,Xp=0,Uc=1,Yh=2,pE=3,mE=4,gE=5,yE=6,rO=7,iO=8,PH=typeof self=="object"?self:globalThis,F_=(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 PH[e](t)},jH=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case Xp:case nO:return n(a,i);case Uc:{const o=n([],i);for(const l of a)o.push(r(l));return o}case Yh:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case pE:return n(new Date(a),i);case mE:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case gE:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case yE:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case rO:{const{name:o,message:l}=a;return n(F_(o,l),i)}case iO: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:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(F_(s,a),i)};return r},U_=e=>jH(new Map,e)(0),Ga="",{toString:BH}={},{keys:FH}=Object,Jl=e=>{const t=typeof e;if(t!=="object"||!e)return[Xp,t];const n=BH.call(e).slice(8,-1);switch(n){case"Array":return[Uc,Ga];case"Object":return[Yh,Ga];case"Date":return[pE,Ga];case"RegExp":return[mE,Ga];case"Map":return[gE,Ga];case"Set":return[yE,Ga];case"DataView":return[Uc,n]}return n.includes("Array")?[Uc,n]:n.includes("Error")?[rO,n]:[Yh,n]},Zd=([e,t])=>e===Xp&&(t==="function"||t==="symbol"),UH=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=Jl(a);switch(o){case Xp:{let d=a;switch(l){case"bigint":o=iO,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([nO],a)}return i([o,d],a)}case Uc:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const d=[],f=i([o,d],a);for(const h of a)d.push(s(h));return f}case Yh:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],f=i([o,d],a);for(const h of FH(a))(e||!Zd(Jl(a[h])))&&d.push([s(h),s(a[h])]);return f}case pE:return i([o,a.toISOString()],a);case mE:{const{source:d,flags:f}=a;return i([o,{source:d,flags:f}],a)}case gE:{const d=[],f=i([o,d],a);for(const[h,p]of a)(e||!(Zd(Jl(h))||Zd(Jl(p))))&&d.push([s(h),s(p)]);return f}case yE:{const d=[],f=i([o,d],a);for(const h of a)(e||!Zd(Jl(h)))&&d.push(s(h));return f}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},$_=(e,{json:t,lossy:n}={})=>{const r=[];return UH(!(t||n),!!t,new Map,r)(e),r},il=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?U_($_(e,t)):structuredClone(e):(e,t)=>U_($_(e,t));function $H(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 HH(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function zH(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$H,r=e.options.footnoteBackLabel||HH,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const E=v.children[v.children.length-1];E&&E.type==="text"?E.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...il(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const c={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,c),e.applyData(t,c)}function IH(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r1}function RH(e,t){const n={},r=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)},o=Mi(t.children[1]),l=qp(t.children[t.children.length-1]);o&&l&&(a.position={start:o,end:l}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function PH(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let l=-1;const c=[];for(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(F_(t.slice(i),i>0,!1)),s.join("")}function F_(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===j_||s===B_;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===j_||s===B_;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function FH(e,t){const n={type:"text",value:BH(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function UH(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $H={blockquote:gH,break:yH,code:bH,delete:EH,emphasis:xH,footnoteReference:vH,heading:wH,html:_H,imageReference:TH,image:NH,inlineCode:SH,linkReference:kH,link:AH,listItem:CH,list:RH,paragraph:OH,root:LH,strong:MH,table:DH,tableCell:jH,tableRow:PH,text:FH,thematicBreak:UH,toml:ef,yaml:ef,definition:ef,footnoteDefinition:ef};function ef(){}const iR=-1,Qp=0,Kc=1,qh=2,mE=3,gE=4,yE=5,bE=6,sR=7,aR=8,HH=typeof self=="object"?self:globalThis,U_=(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 HH[e](t)},zH=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case Qp:case iR:return n(a,i);case Kc:{const o=n([],i);for(const l of a)o.push(r(l));return o}case qh:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case mE:return n(new Date(a),i);case gE:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case yE:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case bE:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case sR:{const{name:o,message:l}=a;return n(U_(o,l),i)}case aR: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:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(U_(s,a),i)};return r},$_=e=>zH(new Map,e)(0),eo="",{toString:VH}={},{keys:KH}=Object,ic=e=>{const t=typeof e;if(t!=="object"||!e)return[Qp,t];const n=VH.call(e).slice(8,-1);switch(n){case"Array":return[Kc,eo];case"Object":return[qh,eo];case"Date":return[mE,eo];case"RegExp":return[gE,eo];case"Map":return[yE,eo];case"Set":return[bE,eo];case"DataView":return[Kc,n]}return n.includes("Array")?[Kc,n]:n.includes("Error")?[sR,n]:[qh,n]},tf=([e,t])=>e===Qp&&(t==="function"||t==="symbol"),YH=(e,t,n,r)=>{const i=(a,o)=>{const l=r.push(a)-1;return n.set(o,l),l},s=a=>{if(n.has(a))return n.get(a);let[o,l]=ic(a);switch(o){case Qp:{let d=a;switch(l){case"bigint":o=aR,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return i([iR],a)}return i([o,d],a)}case Kc:{if(l){let h=a;return l==="DataView"?h=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(a)),i([l,[...h]],a)}const d=[],f=i([o,d],a);for(const h of a)d.push(s(h));return f}case qh:{if(l)switch(l){case"BigInt":return i([l,a.toString()],a);case"Boolean":case"Number":case"String":return i([l,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],f=i([o,d],a);for(const h of KH(a))(e||!tf(ic(a[h])))&&d.push([s(h),s(a[h])]);return f}case mE:return i([o,a.toISOString()],a);case gE:{const{source:d,flags:f}=a;return i([o,{source:d,flags:f}],a)}case yE:{const d=[],f=i([o,d],a);for(const[h,p]of a)(e||!(tf(ic(h))||tf(ic(p))))&&d.push([s(h),s(p)]);return f}case bE:{const d=[],f=i([o,d],a);for(const h of a)(e||!tf(ic(h)))&&d.push(s(h));return f}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},H_=(e,{json:t,lossy:n}={})=>{const r=[];return YH(!(t||n),!!t,new Map,r)(e),r},cl=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?$_(H_(e,t)):structuredClone(e):(e,t)=>$_(H_(e,t));function WH(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 qH(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function GH(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||WH,r=e.options.footnoteBackLabel||qH,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&m.push({type:"text",value:" "});let E=typeof n=="string"?n:n(l,p);typeof E=="string"&&(E={type:"text",value:E}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const E=v.children[v.children.length-1];E&&E.type==="text"?E.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else d.push(...m);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(d,!0)};e.patch(c,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...cl(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const rd=function(e){if(e==null)return WH;if(typeof e=="function")return Qp(e);if(typeof e=="object")return Array.isArray(e)?VH(e):KH(e);if(typeof e=="string")return YH(e);throw new Error("Expected function, string, or object as test")};function VH(e){const t=[];let n=-1;for(;++n":""))+")"})}return h;function h(){let p=sO,m,y,v;if((!t||s(l,c,d[d.length-1]||void 0))&&(p=QH(n(l,d)),p[0]===By))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==XH)for(y=(r?g.children.length:-1)+a,v=d.concat(g);y>-1&&y":""))+")"})}return h;function h(){let p=oR,m,y,v;if((!t||s(l,c,d[d.length-1]||void 0))&&(p=rz(n(l,d)),p[0]===Fy))return p;if("children"in l&&l.children){const g=l;if(g.children&&p[0]!==nz)for(y=(r?g.children.length:-1)+a,v=d.concat(g);y>-1&&y0&&n.push({type:"text",value:` -`}),n}function H_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function z_(e,t){const n=JH(e,t),r=n.one(e,void 0),i=zH(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` -`},i),s}function iz(e,t){return e&&"run"in e?async function(n,r){const i=z_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return z_(n,{file:r,...e||t})}}function V_(e){if(e)throw e}var Yf=Object.prototype.hasOwnProperty,oO=Object.prototype.toString,K_=Object.defineProperty,Y_=Object.getOwnPropertyDescriptor,W_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):oO.call(t)==="[object Array]"},q_=function(t){if(!t||oO.call(t)!=="[object Object]")return!1;var n=Yf.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Yf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Yf.call(t,i)},G_=function(t,n){K_&&n.name==="__proto__"?K_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},X_=function(t,n){if(n==="__proto__")if(Yf.call(t,n)){if(Y_)return Y_(t,n).value}else return;return t[n]},sz=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});la.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(c){const d=c;if(o&&n)throw d;return i(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const bi={basename:lz,dirname:cz,extname:uz,join:dz,sep:"/"};function lz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');sd(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function cz(e){if(sd(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function uz(e){sd(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function dz(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hz(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function sd(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pz={cwd:mz};function mz(){return"/"}function $y(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gz(e){if(typeof e=="string")e=new URL(e);else if(!$y(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 yz(e)}function yz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...m]=d;const y=r[h][1];Uy(y)&&Uy(p)&&(p=xg(!0,y,p)),r[h]=[c,p,...m]}}}}const vz=new bE().freeze();function Tg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ng(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sg(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 Z_(e){if(!Uy(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function J_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jd(e){return wz(e)?e:new lO(e)}function wz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _z(e){return typeof e=="string"||Tz(e)}function Tz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Nz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",eT=[],tT={allowDangerousHtml:!0},Sz=/^(https?|ircs?|mailto|xmpp)$/i,kz=[{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 Az(e){const t=Cz(e),n=Iz(e);return Oz(t.runSync(t.parse(n),n),e)}function Cz(e){const t=e.rehypePlugins||eT,n=e.remarkPlugins||eT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tT}:tT;return vz().use(cH).use(n).use(iz,r).use(t)}function Iz(e){const t=e.children||"",n=new lO;return typeof t=="string"&&(n.value=t),n}function Oz(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||Rz;for(const d of kz)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Nz+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),id(e,c),YU(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function c(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 yg)if(Object.hasOwn(yg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],y=yg[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=l(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function Rz(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Sz.test(e.slice(0,t))?e:""}function nT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Lz(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Mz(e,t,n){const i=rd((n||{}).ignore||[]),s=Dz(t);let a=-1;for(;++a0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=w+1:(m!==w&&E.push({type:"text",value:c.value.slice(m,w)}),Array.isArray(T)?E.push(...T):T&&E.push(T),m=w+b[0].length,g=!0),!h.global)break;b=h.exec(c.value)}return g?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=nT(e,"(");let s=nT(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function cO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ia(n)||qp(n))&&(!t||n!==47)}uO.peek=iV;function Xz(){this.buffer()}function Qz(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Zz(){this.buffer()}function Jz(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function eV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tV(e){this.exit(e)}function nV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rV(e){this.exit(e)}function iV(){return"["}function uO(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function sV(){return{enter:{gfmFootnoteCallString:Xz,gfmFootnoteCall:Qz,gfmFootnoteDefinitionLabelString:Zz,gfmFootnoteDefinition:Jz},exit:{gfmFootnoteCallString:eV,gfmFootnoteCall:tV,gfmFootnoteDefinitionLabelString:nV,gfmFootnoteDefinition:rV}}}function aV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:uO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?` -`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?dO:oV))),c(),l}}function oV(e,t,n){return t===0?e:dO(e,t,n)}function dO(e,t,n){return(n?"":" ")+e}const lV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fO.peek=hV;function cV(){return{canContainEols:["delete"],enter:{strikethrough:dV},exit:{strikethrough:fV}}}function uV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:lV}],handlers:{delete:fO}}}function dV(e){this.enter({type:"delete",children:[]},e)}function fV(e){this.exit(e)}function fO(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function hV(){return"~"}function pV(e){return e.length}function mV(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||pV,s=[],a=[],o=[],l=[];let c=0,d=-1;for(;++dc&&(c=e[d].length);++gl[g])&&(l[g]=b)}y.push(E)}a[d]=y,o[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),h[f]=b}a.splice(1,0,h),o.splice(1,0,p),d=-1;const m=[];for(;++d "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),bV);return i(),a}function bV(e,t,n){return">"+(n?"":" ")+e}function EV(e,t){return sT(e,t.inConstruct,!0)&&!sT(e,t.notInConstruct,!1)}function sT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function vV(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 wV(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 _V(e,t,n,r){const i=wV(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(vV(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,TV);return f(),h}const o=n.createTracker(r),l=i.repeat(Math.max(xV(s,i)+1,3)),c=n.enter("codeFenced");let d=o.move(l);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:` +`}),n}function z_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function V_(e,t){const n=sz(e,t),r=n.one(e,void 0),i=GH(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` +`},i),s}function uz(e,t){return e&&"run"in e?async function(n,r){const i=V_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return V_(n,{file:r,...e||t})}}function K_(e){if(e)throw e}var qf=Object.prototype.hasOwnProperty,cR=Object.prototype.toString,Y_=Object.defineProperty,W_=Object.getOwnPropertyDescriptor,q_=function(t){return typeof Array.isArray=="function"?Array.isArray(t):cR.call(t)==="[object Array]"},G_=function(t){if(!t||cR.call(t)!=="[object Object]")return!1;var n=qf.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&qf.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||qf.call(t,i)},X_=function(t,n){Y_&&n.name==="__proto__"?Y_(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Q_=function(t,n){if(n==="__proto__")if(qf.call(t,n)){if(W_)return W_(t,n).value}else return;return t[n]},dz=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});la.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(c){const d=c;if(o&&n)throw d;return i(d)}o||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const _i={basename:pz,dirname:mz,extname:gz,join:yz,sep:"/"};function pz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ud(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function mz(e){if(ud(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function gz(e){ud(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function yz(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Ez(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function ud(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xz={cwd:vz};function vz(){return"/"}function Hy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wz(e){if(typeof e=="string")e=new URL(e);else if(!Hy(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 _z(e)}function _z(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...m]=d;const y=r[h][1];$y(y)&&$y(p)&&(p=vg(!0,y,p)),r[h]=[c,p,...m]}}}}const kz=new EE().freeze();function Ng(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Sg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function kg(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 J_(e){if(!$y(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function eT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function nf(e){return Az(e)?e:new uR(e)}function Az(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Cz(e){return typeof e=="string"||Iz(e)}function Iz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Rz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",tT=[],nT={allowDangerousHtml:!0},Oz=/^(https?|ircs?|mailto|xmpp)$/i,Lz=[{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 Mz(e){const t=Dz(e),n=Pz(e);return jz(t.runSync(t.parse(n),n),e)}function Dz(e){const t=e.rehypePlugins||tT,n=e.remarkPlugins||tT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nT}:nT;return kz().use(mH).use(n).use(uz,r).use(t)}function Pz(e){const t=e.children||"",n=new uR;return typeof t=="string"&&(n.value=t),n}function jz(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||Bz;for(const d of Lz)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Rz+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),cd(e,c),ZU(e,{Fragment:u.Fragment,components:i,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function c(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 bg)if(Object.hasOwn(bg,p)&&Object.hasOwn(d.properties,p)){const m=d.properties[p],y=bg[p];(y===null||y.includes(d.tagName))&&(d.properties[p]=l(String(m||""),p,d))}}if(d.type==="element"){let p=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(d,f,h)),p&&h&&typeof f=="number")return o&&d.children?h.children.splice(f,1,...d.children):h.children.splice(f,1),f}}}function Bz(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Oz.test(e.slice(0,t))?e:""}function rT(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Fz(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Uz(e,t,n){const i=ld((n||{}).ignore||[]),s=$z(t);let a=-1;for(;++a0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=w+1:(m!==w&&E.push({type:"text",value:c.value.slice(m,w)}),Array.isArray(T)?E.push(...T):T&&E.push(T),m=w+b[0].length,g=!0),!h.global)break;b=h.exec(c.value)}return g?(m?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=rT(e,"(");let s=rT(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function dR(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Pa(n)||Gp(n))&&(!t||n!==47)}fR.peek=uV;function nV(){this.buffer()}function rV(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function iV(){this.buffer()}function sV(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function aV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oV(e){this.exit(e)}function lV(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=fi(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cV(e){this.exit(e)}function uV(){return"["}function fR(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function dV(){return{enter:{gfmFootnoteCallString:nV,gfmFootnoteCall:rV,gfmFootnoteDefinitionLabelString:iV,gfmFootnoteDefinition:sV},exit:{gfmFootnoteCallString:aV,gfmFootnoteCall:oV,gfmFootnoteDefinitionLabelString:lV,gfmFootnoteDefinition:cV}}}function fV(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fR},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let l=o.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return l+=o.move(s.safe(s.associationId(r),{before:l,after:"]"})),d(),l+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),l+=o.move((t?` +`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?hR:hV))),c(),l}}function hV(e,t,n){return t===0?e:hR(e,t,n)}function hR(e,t,n){return(n?"":" ")+e}const pV=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];pR.peek=EV;function mV(){return{canContainEols:["delete"],enter:{strikethrough:yV},exit:{strikethrough:bV}}}function gV(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:pV}],handlers:{delete:pR}}}function yV(e){this.enter({type:"delete",children:[]},e)}function bV(e){this.exit(e)}function pR(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function EV(){return"~"}function xV(e){return e.length}function vV(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||xV,s=[],a=[],o=[],l=[];let c=0,d=-1;for(;++dc&&(c=e[d].length);++gl[g])&&(l[g]=b)}y.push(E)}a[d]=y,o[d]=v}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fl[f]&&(l[f]=E),p[f]=E),h[f]=b}a.splice(1,0,h),o.splice(1,0,p),d=-1;const m=[];for(;++d "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),TV);return i(),a}function TV(e,t,n){return">"+(n?"":" ")+e}function NV(e,t){return aT(e,t.inConstruct,!0)&&!aT(e,t.notInConstruct,!1)}function aT(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ra&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function kV(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 AV(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 CV(e,t,n,r){const i=AV(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(kV(e,n)){const f=n.enter("codeIndented"),h=n.indentLines(s,IV);return f(),h}const o=n.createTracker(r),l=i.repeat(Math.max(SV(s,i)+1,3)),c=n.enter("codeFenced");let d=o.move(l);if(e.lang){const f=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...o.current()})),f()}return d+=o.move(` `),s&&(d+=o.move(s+` -`)),d+=o.move(l),c(),d}function TV(e,t,n){return(n?"":" ")+e}function EE(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 NV(e,t,n,r){const i=EE(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":` -`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),a(),c}function SV(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 Tu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Wh(e,t,n){const r=rl(e),i=rl(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}pO.peek=kV;function pO(e,t,n,r){const i=SV(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),d=Wh(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(l=Tu(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Wh(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Tu(f));const p=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function kV(e,t,n){return n.options.emphasis||"*"}function AV(e,t){let n=!1;return id(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,By}),!!((!e.depth||e.depth<3)&&dE(e)&&(t.options.setext||n))}function CV(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(AV(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` +`)),d+=o.move(l),c(),d}function IV(e,t,n){return(n?"":" ")+e}function xE(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 RV(e,t,n,r){const i=xE(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":` +`,...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),a(),c}function OV(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 Cu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Gh(e,t,n){const r=ll(e),i=ll(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===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}}gR.peek=LV;function gR(e,t,n,r){const i=OV(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),d=Gh(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(l=Cu(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Gh(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Cu(f));const p=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function LV(e,t,n){return n.options.emphasis||"*"}function MV(e,t){let n=!1;return cd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Fy}),!!((!e.depth||e.depth<3)&&fE(e)&&(t.options.setext||n))}function DV(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(MV(e,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:` `,after:` `});return f(),d(),h+` `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(` `))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),l=n.enter("phrasing");s.move(a+" ");let c=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(c)&&(c=Tu(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),o(),c}mO.peek=IV;function mO(e){return e.value||""}function IV(){return"<"}gO.peek=OV;function gO(e,t,n,r){const i=EE(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),c+=l.move(")"),a(),c}function OV(){return"!"}yO.peek=RV;function yO(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const c=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!c||c!==f?l+=o.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function RV(){return"!"}bO.peek=LV;function bO(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s\u007F]/.test(e.url))}xO.peek=MV;function xO(e,t,n,r){const i=EE(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(EO(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),o(),c}function MV(e,t,n){return EO(e,n)?"<":"["}vO.peek=DV;function vO(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!c||c!==f?l+=o.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function DV(){return"["}function xE(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 PV(e){const t=xE(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 jV(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 wO(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 BV(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?jV(n):xE(n);const o=e.ordered?a==="."?")":".":PV(n);let l=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&&(l=!0),wO(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),d);return l(),c;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?s:s+" ".repeat(a-s.length))+f}}function $V(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const HV=rd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function zV(e,t,n,r){return(e.children.some(function(a){return HV(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function VV(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}_O.peek=KV;function _O(e,t,n,r){const i=VV(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),d=Wh(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(l=Tu(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Wh(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Tu(f));const p=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function KV(e,t,n){return n.options.strong||"*"}function YV(e,t,n,r){return n.safe(e.value,r)}function WV(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 qV(e,t,n){const r=(wO(n)+(n.options.ruleSpaces?" ":"")).repeat(WV(n));return n.options.ruleSpaces?r.slice(0,-1):r}const TO={blockquote:yV,break:aT,code:_V,definition:NV,emphasis:pO,hardBreak:aT,heading:CV,html:mO,image:gO,imageReference:yO,inlineCode:bO,link:xO,linkReference:vO,list:BV,listItem:UV,paragraph:$V,root:zV,strong:_O,text:YV,thematicBreak:qV};function GV(){return{enter:{table:XV,tableData:oT,tableHeader:oT,tableRow:ZV},exit:{codeText:JV,table:QV,tableData:Ig,tableHeader:Ig,tableRow:Ig}}}function XV(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 QV(e){this.exit(e),this.data.inTable=void 0}function ZV(e){this.enter({type:"tableRow",children:[]},e)}function Ig(e){this.exit(e)}function oT(e){this.enter({type:"tableCell",children:[]},e)}function JV(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,eK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function eK(e,t){return t==="|"?t:e}function tK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...s.current()});return/^[\t ]/.test(c)&&(c=Cu(c.charCodeAt(0))+c.slice(1)),c=c?a+" "+c:a,n.options.closeAtx&&(c+=" "+a),l(),o(),c}yR.peek=PV;function yR(e){return e.value||""}function PV(){return"<"}bR.peek=jV;function bR(e,t,n,r){const i=xE(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(o=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),o()),c+=l.move(")"),a(),c}function jV(){return"!"}ER.peek=BV;function ER(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("![");const c=n.safe(e.alt,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!c||c!==f?l+=o.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function BV(){return"!"}xR.peek=FV;function xR(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s\u007F]/.test(e.url))}wR.peek=UV;function wR(e,t,n,r){const i=xE(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,l;if(vR(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),n.stack=d,f}o=n.enter("link"),l=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(l=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),l()),c+=a.move(")"),o(),c}function UV(e,t,n){return vR(e,n)?"<":"["}_R.peek=$V;function _R(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let l=o.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...o.current()});l+=o.move(c+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(e),{before:l,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!c||c!==f?l+=o.move(f+"]"):i==="shortcut"?l=l.slice(0,-1):l+=o.move("]"),l}function $V(){return"["}function vE(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 HV(e){const t=vE(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 zV(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 TR(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 VV(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?zV(n):vE(n);const o=e.ordered?a==="."?")":".":HV(n);let l=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&&(l=!0),TR(n)===a&&d){let f=-1;for(;++f-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,o.current()),d);return l(),c;function d(f,h,p){return h?(p?"":" ".repeat(a))+f:(p?s:s+" ".repeat(a-s.length))+f}}function WV(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const qV=ld(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function GV(e,t,n,r){return(e.children.some(function(a){return qV(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function XV(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}NR.peek=QV;function NR(e,t,n,r){const i=XV(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let l=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const c=l.charCodeAt(0),d=Gh(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(l=Cu(c)+l.slice(1));const f=l.charCodeAt(l.length-1),h=Gh(r.after.charCodeAt(0),f,i);h.inside&&(l=l.slice(0,-1)+Cu(f));const p=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+l+p}function QV(e,t,n){return n.options.strong||"*"}function ZV(e,t,n,r){return n.safe(e.value,r)}function JV(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 eK(e,t,n){const r=(TR(n)+(n.options.ruleSpaces?" ":"")).repeat(JV(n));return n.options.ruleSpaces?r.slice(0,-1):r}const SR={blockquote:_V,break:oT,code:CV,definition:RV,emphasis:gR,hardBreak:oT,heading:DV,html:yR,image:bR,imageReference:ER,inlineCode:xR,link:wR,linkReference:_R,list:VV,listItem:YV,paragraph:WV,root:GV,strong:NR,text:ZV,thematicBreak:eK};function tK(){return{enter:{table:nK,tableData:lT,tableHeader:lT,tableRow:iK},exit:{codeText:sK,table:rK,tableData:Rg,tableHeader:Rg,tableRow:Rg}}}function nK(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 rK(e){this.exit(e),this.data.inTable=void 0}function iK(e){this.enter({type:"tableRow",children:[]},e)}function Rg(e){this.exit(e)}function lT(e){this.enter({type:"tableCell",children:[]},e)}function sK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,aK));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function aK(e,t){return t==="|"?t:e}function oK(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=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:l,tableRow:o}};function a(p,m,y,v){return c(d(p,y,v),p.align)}function o(p,m,y,v){const g=f(p,y,v),E=c([g]);return E.slice(0,E.indexOf(` -`))}function l(p,m,y,v){const g=y.enter("tableCell"),E=y.enter("phrasing"),b=y.containerPhrasing(p,{...v,before:s,after:s});return E(),g(),b}function c(p,m){return mV(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function d(p,m,y){const v=p.children;let g=-1;const E=[],b=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const EK={tokenize:kK,partial:!0};function xK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:TK,continuation:{tokenize:NK},exit:SK}},text:{91:{name:"gfmFootnoteCall",tokenize:_K},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:vK,resolveTo:wK}}}}function vK(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const c=ai(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function wK(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 r={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 s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function _K(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!a||f===null||f===91||Ct(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(ai(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ct(f)||(a=!0),s++,e.consume(f),f===92?d:c}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function TK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(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&&!o||m===null||m===91||Ct(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return s=ai(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return Ct(m)||(o=!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(s)||i.push(s),ut(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function NK(e,t,n){return e.check(nd,t,e.attempt(EK,t,n))}function SK(e){e.exit("gfmFootnoteDefinition")}function kK(e,t,n){const r=this;return ut(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function AK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l1?l(m):(a.consume(m),f++,p);if(f<2&&!n)return l(m);const v=a.exit("strikethroughSequenceTemporary"),g=rl(m);return v._open=!g||g===2&&!!y,v._close=!y||y===2&&!!g,o(m)}}}class CK{constructor(){this.map=[]}add(t,n,r){IK(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function IK(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const j=r.events[D][1].type;if(j==="lineEnding"||j==="linePrefix")D--;else break}const F=D>-1?r.events[D][1].type:null,W=F==="tableHead"||F==="tableRow"?T:l;return W===T&&r.parser.lazy[r.now().line]?n(I):W(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),c(I)}function c(I){return I===124||(a=!0,s+=1),d(I)}function d(I){return I===null?n(I):je(I)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):nt(I)?ut(e,d,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||Ct(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,nt(I)?ut(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?v(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):N(I)}function y(I){return nt(I)?ut(e,v,"whitespace")(I):v(I)}function v(I){return I===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),g):I===45?(s+=1,g(I)):I===null||je(I)?w(I):N(I)}function g(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):N(I)}function E(I){return I===45?(e.consume(I),E):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(I))}function b(I){return nt(I)?ut(e,w,"whitespace")(I):w(I)}function w(I){return I===124?m(I):I===null||je(I)?!a||i!==s?N(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):N(I)}function N(I){return n(I)}function T(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||je(I)?(e.exit("tableRow"),t(I)):nt(I)?ut(e,A,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||Ct(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?O:S)}function O(I){return I===92||I===124?(e.consume(I),S):S(I)}}function MK(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,c,d,f;const h=new CK;for(;++nn[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},ro(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function cT(e,t,n,r,i){const s=[],a=ro(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function ro(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const DK={name:"tasklistCheck",tokenize:jK};function PK(){return{text:{91:DK}}}function jK(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Ct(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return je(l)?t(l):nt(l)?e.check({tokenize:BK},t,n)(l):n(l)}}function BK(e,t,n){return ut(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function FK(e){return $I([uK(),xK(),AK(e),RK(),PK()])}const UK={};function $K(e){const t=this,n=e||UK,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(FK(n)),s.push(aK()),a.push(oK(n))}const uT=function(e,t,n){const r=rd(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(;++tc&&(c=d):d&&(c!==void 0&&c>-1&&l.push(` -`.repeat(c)||" "),c=-1,l.push(d))}return l.join("")}function MO(e,t,n){return e.type==="element"?GK(e,t,n):e.type==="text"?n.whitespace==="normal"?DO(e,n):XK(e):[]}function GK(e,t,n){const r=PO(e,n),i=e.children||[];let s=-1,a=[];if(WK(e))return a;let o,l;for(zy(e)||pT(e)&&uT(t,e,pT)?l=` -`:YK(e)?(o=2,l=2):LO(e)&&(o=1,l=1);++s]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={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(c,{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"],y=["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"],g=["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:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,c],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:T.concat([{begin:/\(/,end:/\)/,keywords:w,contains:T.concat(["self"]),relevance:0}]),relevance:0},S={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,o]}]},o,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",o]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function rY(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=nY(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function jO(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=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"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(o);const l={match:/\\"/},c={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},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],g={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["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"],N=["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:y,literal:v,built_in:[...E,...b,"set","shopt",...w,...N]},contains:[p,e.SHEBANG(),m,f,s,a,g,o,l,c,d,n]}}function iY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={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(c,{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"},g=[f,o,n,e.C_BLOCK_COMMENT_MODE,d,c],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:g.concat([{begin:/\(/,end:/\)/,keywords:v,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,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,c,d,o,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,o]}]},o,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:c,keywords:v}}}function sY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={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(c,{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"],y=["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"],g=["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:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,c],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:T.concat([{begin:/\(/,end:/\)/,keywords:w,contains:T.concat(["self"]),relevance:0}]),relevance:0},S={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,o]}]},o,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",o]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function aY(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"],r=["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"],s=["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(s),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={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},c={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]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[v,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[c,y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},b=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"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,E,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:"("+b+"\\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,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const oY=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_-]*/}}),lY=["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"],cY=["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"],uY=[...lY,...cY],dY=["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(),fY=["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(),hY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),pY=["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 mY(e){const t=e.regex,n=oY(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[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,r,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:":("+fY.join("|")+")"},{begin:":(:)?("+hY.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+pY.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:dY.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+uY.join("|")+")\\b"}]}}function gY(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 yY(e){const s={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:s,illegal:"FO(e,t,n-1))}function EY(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+FO("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={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"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,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:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,mT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},mT,c]}}const gT="[A-Za-z$_][0-9A-Za-z$_]*",xY=["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"],vY=["true","false","null","undefined","NaN","Infinity"],UO=["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"],$O=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],HO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],wY=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],_Y=[].concat(HO,UO,$O);function zO(e){const t=e.regex,n=(L,{after:M})=>{const k="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,M)=>{const k=L[0].length+L.index,Y=L.input[k];if(Y==="<"||Y===","){M.ignoreMatch();return}Y===">"&&(n(L,{after:k})||M.ignoreMatch());let G;const P=L.input.substring(k);if(G=P.match(/^\s*=/)){M.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){M.ignoreMatch();return}}},o={$pattern:gT,keyword:xY,literal:vY,built_in:_Y,"variable.language":wY},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\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:o,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"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const w=[].concat(E,h.contains),N=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},S={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:{_:[...UO,...$O]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,F([...HO,"super","import"].map(L=>`${L}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,E,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,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:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},W,D,A,$,{match:/\$[(.]/}]}}function VO(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},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 so="[0-9](_*[0-9])*",rf=`\\.(${so})`,sf="[0-9a-fA-F](_*[0-9a-fA-F])*",TY={className:"number",variants:[{begin:`(\\b(${so})((${rf})|\\.)?|(${rf}))[eE][+-]?(${so})[fFdD]?\\b`},{begin:`\\b(${so})((${rf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${rf})[fFdD]?\\b`},{begin:`\\b(${so})[fFdD]\\b`},{begin:`\\b0[xX]((${sf})\\.?|(${sf})?\\.(${sf}))[pP][+-]?(${so})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${sf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function NY(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+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=TY,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,r,o,l,{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,o,l,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},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},c]}}const SY=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_-]*/}}),kY=["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"],AY=["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"],CY=[...kY,...AY],IY=["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(),KO=["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(),YO=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),OY=["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(),RY=KO.concat(YO).sort().reverse();function LY(e){const t=SY(e),n=RY,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",a=[],o=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},c=function(b,w,N){return{className:b,begin:w,relevance:N}},d={$pattern:/[a-z-]+/,keyword:r,attribute:IY.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},m={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+OY.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},y={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:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+CY.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+KO.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+YO.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,v,E,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function MY(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],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:[r],relevance:5}])}}function WO(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={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}]},s={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}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),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}]},c={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(c,{contains:[]}),h=e.inherit(d,{contains:[]});c.contains.push(h),d.contains.push(f);let p=[n,l];return[c,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(c,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,s,c,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function DY(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_]*/,o={"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"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function PY(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"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},c={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,s,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(y,v,g="\\1")=>{const E=g==="\\1"?g:t.concat(g,v);return t.concat(t.concat("(?:",y,")"),v,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,g,r)},p=(y,v,g)=>t.concat(t.concat("(?:",y,")"),v,/(?:\\.|[^\\\/])*?/,g,r),m=[l,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}]},c,{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,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function jY(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=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),s=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(j,$)=>{$.data._beginMatch=j[1]||j[2]},"on:end":(j,$)=>{$.data._beginMatch!==j[1]&&$.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ -]`,m={scope:"string",variants:[d,c,f,h]},y={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"],g=["__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"],E=["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:g,literal:(j=>{const $=[];return j.forEach(C=>{$.push(C),C.toLowerCase()===C?$.push(C.toUpperCase()):$.push(C.toLowerCase())}),$})(v),built_in:E},N=j=>j.map($=>$.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",N(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],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"}}]},O={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[O,a,S,e.C_BLOCK_COMMENT_MODE,m,y,T]},D={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",N(g).join("\\b|"),"|",N(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const F=[O,S,e.C_BLOCK_COMMENT_MODE,m,y,T],W={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:w,contains:[W,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}]}},o,{scope:"variable.language",match:/\$this\b/},a,D,S,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{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",W,a,S,e.C_BLOCK_COMMENT_MODE,m,y]}]},{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,y]}}function BY(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 FY(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function GO(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["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"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,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"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,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,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,c]},{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,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,y={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:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,y,f,e.HASH_COMMENT_MODE]}]};return c.contains=[f,y,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,y,{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:[g]},{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:[y,g,f]}]}}function UY(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function $Y(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=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=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=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,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function HY(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\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"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],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"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},T=[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:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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(l,c),relevance:0}].concat(l,c);d.contains=T,y.contains=T;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:T}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(I).concat(c).concat(T)}}function zY(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),s={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))?",o=["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"],l=["true","false","Some","None","Ok","Err"],c=["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:o,literal:l,built_in:c},illegal:""},s]}}const VY=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_-]*/}}),KY=["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"],YY=["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"],WY=[...KY,...YY],qY=["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(),GY=["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(),XY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),QY=["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 ZY(e){const t=VY(e),n=XY,r=GY,i="@[a-z-]+",s="and or not only",o={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("+WY.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+QY.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,o,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:s,attribute:qY.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function JY(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function eW(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["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"],l=["add","asc","collation","desc","final","first","last","view"],c=["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=[...c,...l].filter(N=>!d.includes(N)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(N){return t.concat(/\b/,t.either(...N.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:E(h),relevance:0};function w(N,{exceptions:T,when:A}={}){const S=A;return T=T||[],N.map(O=>O.match(/\|\d+$/)||T.includes(O)?O:S(O)?`${O}|0`:O)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(m,{when:N=>N.length<3}),literal:s,type:o,built_in:f},contains:[{scope:"type",match:E(a)},b,g,y,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function XO(e){return e?typeof e=="string"?e:e.source:null}function ec(e){return Nt("(?=",e,")")}function Nt(...e){return e.map(n=>XO(n)).join("")}function tW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Zn(...e){return"("+(tW(e).capture?"":"?:")+e.map(r=>XO(r)).join("|")+")"}const _E=e=>Nt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),nW=["Protocol","Type"].map(_E),yT=["init","self"].map(_E),rW=["Any","Self"],Og=["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"],bT=["false","nil","true"],iW=["assignment","associativity","higherThan","left","lowerThan","none","right"],sW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ET=["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"],QO=Zn(/[/=\-+!*%<>&|^~?]/,/[\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]/),ZO=Zn(QO,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Rg=Nt(QO,ZO,"*"),JO=Zn(/[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]/),qh=Zn(JO,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),gi=Nt(JO,qh,"*"),af=Nt(/[A-Z]/,qh,"*"),aW=["attached","autoclosure",Nt(/convention\(/,Zn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Nt(/objc\(/,gi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],oW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function lW(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Zn(...nW,...yT)],className:{2:"keyword"}},s={match:Nt(/\./,Zn(...Og)),relevance:0},a=Og.filter(Ee=>typeof Ee=="string").concat(["_|0"]),o=Og.filter(Ee=>typeof Ee!="string").concat(rW).map(_E),l={variants:[{className:"keyword",match:Zn(...o,...yT)}]},c={$pattern:Zn(/\b\w+/,/#\w+/),keyword:a.concat(sW),literal:bT},d=[i,s,l],f={match:Nt(/\./,Zn(...ET)),relevance:0},h={className:"built_in",match:Nt(/\b/,Zn(...ET),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},y={className:"operator",relevance:0,variants:[{match:Rg},{match:`\\.(\\.|${ZO})+`}]},v=[m,y],g="([0-9]_*)+",E="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(Ee="")=>({className:"subst",variants:[{match:Nt(/\\/,Ee,/[0\\tnr"']/)},{match:Nt(/\\/,Ee,/u\{[0-9a-fA-F]{1,8}\}/)}]}),N=(Ee="")=>({className:"subst",match:Nt(/\\/,Ee,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(Ee="")=>({className:"subst",label:"interpol",begin:Nt(/\\/,Ee,/\(/),end:/\)/}),A=(Ee="")=>({begin:Nt(Ee,/"""/),end:Nt(/"""/,Ee),contains:[w(Ee),N(Ee),T(Ee)]}),S=(Ee="")=>({begin:Nt(Ee,/"/),end:Nt(/"/,Ee),contains:[w(Ee),T(Ee)]}),O={className:"string",variants:[A(),A("#"),A("##"),A("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},F=Ee=>{const Pe=Nt(Ee,/\//),be=Nt(/\//,Ee);return{begin:Pe,end:be,contains:[...I,{scope:"comment",begin:`#(?!.*${be})`,end:/$/}]}},W={scope:"regexp",variants:[F("###"),F("##"),F("#"),D]},j={match:Nt(/`/,gi,/`/)},$={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${qh}+`},R=[j,$,C],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:oW,contains:[...v,b,O]}]}},M={scope:"keyword",match:Nt(/@/,Zn(...aW),ec(Zn(/\(/,/\s+/)))},k={scope:"meta",match:Nt(/@/,gi)},Y=[L,M,k],G={match:ec(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Nt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,qh,"+")},{className:"type",match:af,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Nt(/\s+&\s+/,ec(af)),relevance:0}]},P={begin://,keywords:c,contains:[...r,...d,...Y,m,G]};G.contains.push(P);const V={match:Nt(gi,/\s*:/),keywords:"_|0",relevance:0},Q={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",V,...r,W,...d,...p,...v,b,O,...R,...Y,G]},re={begin://,keywords:"repeat each",contains:[...r,G]},le={begin:Zn(ec(Nt(gi,/\s*:/)),ec(Nt(gi,/\s+/,gi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:gi}]},K={begin:/\(/,end:/\)/,keywords:c,contains:[le,...r,...d,...v,b,O,...Y,G,Q],endsParent:!0,illegal:/["']/},q={match:[/(func|macro)/,/\s+/,Zn(j.match,gi,Rg)],className:{1:"keyword",3:"title.function"},contains:[re,K,t],illegal:[/\[/,/%/]},ae={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[re,K,t],illegal:/\[|%/},ge={match:[/operator/,/\s+/,Rg],className:{1:"keyword",3:"title"}},he={begin:[/precedencegroup/,/\s+/,af],className:{1:"keyword",3:"title"},contains:[G],keywords:[...iW,...bT],end:/}/},de={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},_e={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,gi,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[re,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:af},...d],relevance:0}]};for(const Ee of O.variants){const Pe=Ee.contains.find(Ve=>Ve.label==="interpol");Pe.keywords=c;const be=[...d,...p,...v,b,O,...R];Pe.contains=[...be,{begin:/\(/,end:/\)/,contains:["self",...be]}]}return{name:"Swift",keywords:c,contains:[...r,q,ae,de,Ie,_e,ge,he,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},W,...d,...p,...v,b,O,...R,...Y,G,Q]}}const Gh="[A-Za-z$_][0-9A-Za-z$_]*",eR=["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"],tR=["true","false","null","undefined","NaN","Infinity"],nR=["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"],rR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],iR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],aR=[].concat(iR,nR,rR);function cW(e){const t=e.regex,n=(L,{after:M})=>{const k="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,M)=>{const k=L[0].length+L.index,Y=L.input[k];if(Y==="<"||Y===","){M.ignoreMatch();return}Y===">"&&(n(L,{after:k})||M.ignoreMatch());let G;const P=L.input.substring(k);if(G=P.match(/^\s*=/)){M.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){M.ignoreMatch();return}}},o={$pattern:Gh,keyword:eR,literal:tR,built_in:aR,"variable.language":sR},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\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:o,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"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const w=[].concat(E,h.contains),N=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},S={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:{_:[...nR,...rR]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,F([...iR,"super","import"].map(L=>`${L}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",R={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,E,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},R,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,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:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},W,D,A,$,{match:/\$[(.]/}]}}function oR(e){const t=e.regex,n=cW(e),r=Gh,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={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]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Gh,keyword:eR.concat(l),literal:tR,built_in:aR.concat(i),"variable.language":sR},d={className:"meta",begin:"@"+r},f=(y,v,g)=>{const E=y.contains.findIndex(b=>b.label===v);if(E===-1)throw new Error("can not find mode to replace");y.contains.splice(E,1,g)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(y=>y.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const m=n.contains.find(y=>y.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function uW(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,i),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,i),/ +/,t.either(a,o),/ *#/)}]},c={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,r,l,c,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 dW(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["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"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={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/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={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:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,i,e.QUOTE_STRING_MODE,l,c,o]}}function fW(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={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:[s,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,a,l,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],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:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function lR(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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]},o=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},y={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[r,{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,y,s,a],g=[...v];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const hW={arduino:rY,bash:jO,c:iY,cpp:sY,csharp:aY,css:mY,diff:gY,go:yY,graphql:bY,ini:BO,java:EY,javascript:zO,json:VO,kotlin:NY,less:LY,lua:MY,makefile:WO,markdown:qO,objectivec:DY,perl:PY,php:jY,"php-template":BY,plaintext:FY,python:GO,"python-repl":UY,r:$Y,ruby:HY,rust:zY,scss:ZY,shell:JY,sql:eW,swift:lW,typescript:oR,vbnet:uW,wasm:dW,xml:fW,yaml:lR};function cR(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],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&cR(n)}),e}let xT=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function uR(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ws(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const pW="",vT=e=>!!e.scope,mW=(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((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class gW{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=uR(t)}openNode(t){if(!vT(t))return;const n=mW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){vT(t)&&(this.buffer+=pW)}value(){return this.buffer}span(t){this.buffer+=``}}const wT=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class TE{constructor(){this.rootNode=wT(),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=wT({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(r=>this._walk(t,r)),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=>{TE._collapse(n)}))}}class yW extends TE{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new gW(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Nu(e){return e?typeof e=="string"?e:e.source:null}function dR(e){return za("(?=",e,")")}function bW(e){return za("(?:",e,")*")}function EW(e){return za("(?:",e,")?")}function za(...e){return e.map(n=>Nu(n)).join("")}function xW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function NE(...e){return"("+(xW(e).capture?"":"?:")+e.map(r=>Nu(r)).join("|")+")"}function fR(e){return new RegExp(e.toString()+"|").exec("").length-1}function vW(e,t){const n=e&&e.exec(t);return n&&n.index===0}const wW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function SE(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let s=Nu(r),a="";for(;s.length>0;){const o=wW.exec(s);if(!o){a+=s;break}a+=s.substring(0,o.index),s=s.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+i):(a+=o[0],o[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const _W=/\b\B/,hR="[a-zA-Z]\\w*",kE="[a-zA-Z_]\\w*",pR="\\b\\d+(\\.\\d+)?",mR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",gR="\\b(0b[01]+)",TW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",NW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=za(t,/.*\b/,e.binary,/\b.*/)),ws({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Su={begin:"\\\\[\\s\\S]",relevance:0},SW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Su]},kW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Su]},AW={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/},Zp=function(e,t,n={}){const r=ws({scope:"comment",begin:e,end:t,contains:[]},n);r.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=NE("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 r.contains.push({begin:za(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},CW=Zp("//","$"),IW=Zp("/\\*","\\*/"),OW=Zp("#","$"),RW={scope:"number",begin:pR,relevance:0},LW={scope:"number",begin:mR,relevance:0},MW={scope:"number",begin:gR,relevance:0},DW={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Su,{begin:/\[/,end:/\]/,relevance:0,contains:[Su]}]},PW={scope:"title",begin:hR,relevance:0},jW={scope:"title",begin:kE,relevance:0},BW={begin:"\\.\\s*"+kE,relevance:0},FW=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 of=Object.freeze({__proto__:null,APOS_STRING_MODE:SW,BACKSLASH_ESCAPE:Su,BINARY_NUMBER_MODE:MW,BINARY_NUMBER_RE:gR,COMMENT:Zp,C_BLOCK_COMMENT_MODE:IW,C_LINE_COMMENT_MODE:CW,C_NUMBER_MODE:LW,C_NUMBER_RE:mR,END_SAME_AS_BEGIN:FW,HASH_COMMENT_MODE:OW,IDENT_RE:hR,MATCH_NOTHING_RE:_W,METHOD_GUARD:BW,NUMBER_MODE:RW,NUMBER_RE:pR,PHRASAL_WORDS_MODE:AW,QUOTE_STRING_MODE:kW,REGEXP_MODE:DW,RE_STARTERS_RE:TW,SHEBANG:NW,TITLE_MODE:PW,UNDERSCORE_IDENT_RE:kE,UNDERSCORE_TITLE_MODE:jW});function UW(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function $W(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function HW(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=UW,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function zW(e,t){Array.isArray(e.illegal)&&(e.illegal=NE(...e.illegal))}function VW(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 KW(e,t){e.relevance===void 0&&(e.relevance=1)}const YW=(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(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=za(n.beforeMatch,dR(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},WW=["of","and","for","in","not","or","if","then","parent","list","value"],qW="keyword";function yR(e,t,n=qW){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(s){Object.assign(r,yR(e[s],t,s))}),r;function i(s,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");r[l[0]]=[s,GW(l[0],l[1])]})}}function GW(e,t){return t?Number(t):XW(e)?0:1}function XW(e){return WW.includes(e.toLowerCase())}const _T={},ba=e=>{console.error(e)},TT=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Xa=(e,t)=>{_T[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),_T[`${e}/${t}`]=!0)},Xh=new Error;function bR(e,t,{key:n}){let r=0;const i=e[n],s={},a={};for(let o=1;o<=t.length;o++)a[o+r]=i[o],s[o+r]=!0,r+=fR(t[o-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function QW(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw ba("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Xh;if(typeof e.beginScope!="object"||e.beginScope===null)throw ba("beginScope must be object"),Xh;bR(e,e.begin,{key:"beginScope"}),e.begin=SE(e.begin,{joinWith:""})}}function ZW(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw ba("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Xh;if(typeof e.endScope!="object"||e.endScope===null)throw ba("endScope must be object"),Xh;bR(e,e.end,{key:"endScope"}),e.end=SE(e.end,{joinWith:""})}}function JW(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function eq(e){JW(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),QW(e),ZW(e)}function tq(e){function t(a,o){return new RegExp(Nu(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=fR(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(SE(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const c=l.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new n;return this.rules.slice(o).forEach(([c,d])=>l.addRule(c,d)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(o);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(o)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(a){const o=new r;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function s(a,o){const l=a;if(a.isCompiled)return l;[$W,VW,eq,YW].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[HW,zW,KW].forEach(d=>d(a,o)),a.isCompiled=!0;let c=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),c=a.keywords.$pattern,delete a.keywords.$pattern),c=c||/\w+/,a.keywords&&(a.keywords=yR(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=Nu(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return nq(d==="self"?a:d)})),a.contains.forEach(function(d){s(d,l)}),a.starts&&s(a.starts,o),l.matcher=i(l),l}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=ws(e.classNameAliases||{}),s(e)}function ER(e){return e?e.endsWithParent||ER(e.starts):!1}function nq(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ws(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:ER(e)?ws(e,{starts:e.starts?ws(e.starts):null}):Object.isFrozen(e)?ws(e):e}var rq="11.11.1";class iq extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Lg=uR,NT=ws,ST=Symbol("nomatch"),sq=7,xR=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:yW};function l(C){return o.noHighlightRe.test(C)}function c(C){let R=C.className+" ";R+=C.parentNode?C.parentNode.className:"";const L=o.languageDetectRe.exec(R);if(L){const M=S(L[1]);return M||(TT(s.replace("{}",L[1])),TT("Falling back to no-highlight mode for this block.",C)),M?L[1]:"no-highlight"}return R.split(/\s+/).find(M=>l(M)||S(M))}function d(C,R,L){let M="",k="";typeof R=="object"?(M=C,L=R.ignoreIllegals,k=R.language):(Xa("10.7.0","highlight(lang, code, ...args) has been deprecated."),Xa("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),k=C,M=R),L===void 0&&(L=!0);const Y={code:M,language:k};j("before:highlight",Y);const G=Y.result?Y.result:f(Y.language,Y.code,L);return G.code=Y.code,j("after:highlight",G),G}function f(C,R,L,M){const k=Object.create(null);function Y(z,X){return z.keywords[X]}function G(){if(!be.keywords){ke.addText(ce);return}let z=0;be.keywordPatternRe.lastIndex=0;let X=be.keywordPatternRe.exec(ce),oe="";for(;X;){oe+=ce.substring(z,X.index);const we=_e.case_insensitive?X[0].toLowerCase():X[0],Ae=Y(be,we);if(Ae){const[Ge,Ot]=Ae;if(ke.addText(oe),oe="",k[we]=(k[we]||0)+1,k[we]<=sq&&(It+=Ot),Ge.startsWith("_"))oe+=X[0];else{const Ke=_e.classNameAliases[Ge]||Ge;Q(X[0],Ke)}}else oe+=X[0];z=be.keywordPatternRe.lastIndex,X=be.keywordPatternRe.exec(ce)}oe+=ce.substring(z),ke.addText(oe)}function P(){if(ce==="")return;let z=null;if(typeof be.subLanguage=="string"){if(!t[be.subLanguage]){ke.addText(ce);return}z=f(be.subLanguage,ce,!0,Ve[be.subLanguage]),Ve[be.subLanguage]=z._top}else z=p(ce,be.subLanguage.length?be.subLanguage:null);be.relevance>0&&(It+=z.relevance),ke.__addSublanguage(z._emitter,z.language)}function V(){be.subLanguage!=null?P():G(),ce=""}function Q(z,X){z!==""&&(ke.startScope(X),ke.addText(z),ke.endScope())}function re(z,X){let oe=1;const we=X.length-1;for(;oe<=we;){if(!z._emit[oe]){oe++;continue}const Ae=_e.classNameAliases[z[oe]]||z[oe],Ge=X[oe];Ae?Q(Ge,Ae):(ce=Ge,G(),ce=""),oe++}}function le(z,X){return z.scope&&typeof z.scope=="string"&&ke.openNode(_e.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(Q(ce,_e.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),ce=""):z.beginScope._multi&&(re(z.beginScope,X),ce="")),be=Object.create(z,{parent:{value:be}}),be}function K(z,X,oe){let we=vW(z.endRe,oe);if(we){if(z["on:end"]){const Ae=new xT(z);z["on:end"](X,Ae),Ae.isMatchIgnored&&(we=!1)}if(we){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return K(z.parent,X,oe)}function q(z){return be.matcher.regexIndex===0?(ce+=z[0],1):(st=!0,0)}function ae(z){const X=z[0],oe=z.rule,we=new xT(oe),Ae=[oe.__beforeBegin,oe["on:begin"]];for(const Ge of Ae)if(Ge&&(Ge(z,we),we.isMatchIgnored))return q(X);return oe.skip?ce+=X:(oe.excludeBegin&&(ce+=X),V(),!oe.returnBegin&&!oe.excludeBegin&&(ce=X)),le(oe,z),oe.returnBegin?0:X.length}function ge(z){const X=z[0],oe=R.substring(z.index),we=K(be,z,oe);if(!we)return ST;const Ae=be;be.endScope&&be.endScope._wrap?(V(),Q(X,be.endScope._wrap)):be.endScope&&be.endScope._multi?(V(),re(be.endScope,z)):Ae.skip?ce+=X:(Ae.returnEnd||Ae.excludeEnd||(ce+=X),V(),Ae.excludeEnd&&(ce=X));do be.scope&&ke.closeNode(),!be.skip&&!be.subLanguage&&(It+=be.relevance),be=be.parent;while(be!==we.parent);return we.starts&&le(we.starts,z),Ae.returnEnd?0:X.length}function he(){const z=[];for(let X=be;X!==_e;X=X.parent)X.scope&&z.unshift(X.scope);z.forEach(X=>ke.openNode(X))}let de={};function Ie(z,X){const oe=X&&X[0];if(ce+=z,oe==null)return V(),0;if(de.type==="begin"&&X.type==="end"&&de.index===X.index&&oe===""){if(ce+=R.slice(X.index,X.index+1),!i){const we=new Error(`0 width match regex (${C})`);throw we.languageName=C,we.badRule=de.rule,we}return 1}if(de=X,X.type==="begin")return ae(X);if(X.type==="illegal"&&!L){const we=new Error('Illegal lexeme "'+oe+'" for mode "'+(be.scope||"")+'"');throw we.mode=be,we}else if(X.type==="end"){const we=ge(X);if(we!==ST)return we}if(X.type==="illegal"&&oe==="")return ce+=` -`,1;if(wt>1e5&&wt>X.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ce+=oe,oe.length}const _e=S(C);if(!_e)throw ba(s.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Ee=tq(_e);let Pe="",be=M||Ee;const Ve={},ke=new o.__emitter(o);he();let ce="",It=0,Me=0,wt=0,st=!1;try{if(_e.__emitTokens)_e.__emitTokens(R,ke);else{for(be.matcher.considerAll();;){wt++,st?st=!1:be.matcher.considerAll(),be.matcher.lastIndex=Me;const z=be.matcher.exec(R);if(!z)break;const X=R.substring(Me,z.index),oe=Ie(X,z);Me=z.index+oe}Ie(R.substring(Me))}return ke.finalize(),Pe=ke.toHTML(),{language:C,value:Pe,relevance:It,illegal:!1,_emitter:ke,_top:be}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:C,value:Lg(R),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:Me,context:R.slice(Me-100,Me+100),mode:z.mode,resultSoFar:Pe},_emitter:ke};if(i)return{language:C,value:Lg(R),illegal:!1,relevance:0,errorRaised:z,_emitter:ke,_top:be};throw z}}function h(C){const R={value:Lg(C),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return R._emitter.addText(C),R}function p(C,R){R=R||o.languages||Object.keys(t);const L=h(C),M=R.filter(S).filter(I).map(V=>f(V,C,!1));M.unshift(L);const k=M.sort((V,Q)=>{if(V.relevance!==Q.relevance)return Q.relevance-V.relevance;if(V.language&&Q.language){if(S(V.language).supersetOf===Q.language)return 1;if(S(Q.language).supersetOf===V.language)return-1}return 0}),[Y,G]=k,P=Y;return P.secondBest=G,P}function m(C,R,L){const M=R&&n[R]||L;C.classList.add("hljs"),C.classList.add(`language-${M}`)}function y(C){let R=null;const L=c(C);if(l(L))return;if(j("before:highlightElement",{el:C,language:L}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(o.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)),o.throwUnescapedHTML))throw new iq("One of your code blocks includes unescaped HTML.",C.innerHTML);R=C;const M=R.textContent,k=L?d(M,{language:L,ignoreIllegals:!0}):p(M);C.innerHTML=k.value,C.dataset.highlighted="yes",m(C,L,k.language),C.result={language:k.language,re:k.relevance,relevance:k.relevance},k.secondBest&&(C.secondBest={language:k.secondBest.language,relevance:k.secondBest.relevance}),j("after:highlightElement",{el:C,result:k,text:M})}function v(C){o=NT(o,C)}const g=()=>{w(),Xa("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){w(),Xa("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function w(){function C(){w()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",C,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(y)}function N(C,R){let L=null;try{L=R(e)}catch(M){if(ba("Language definition for '{}' could not be registered.".replace("{}",C)),i)ba(M);else throw M;L=a}L.name||(L.name=C),t[C]=L,L.rawDefinition=R.bind(null,e),L.aliases&&O(L.aliases,{languageName:C})}function T(C){delete t[C];for(const R of Object.keys(n))n[R]===C&&delete n[R]}function A(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function O(C,{languageName:R}){typeof C=="string"&&(C=[C]),C.forEach(L=>{n[L.toLowerCase()]=R})}function I(C){const R=S(C);return R&&!R.disableAutodetect}function D(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=R=>{C["before:highlightBlock"](Object.assign({block:R.el},R))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=R=>{C["after:highlightBlock"](Object.assign({block:R.el},R))})}function F(C){D(C),r.push(C)}function W(C){const R=r.indexOf(C);R!==-1&&r.splice(R,1)}function j(C,R){const L=C;r.forEach(function(M){M[L]&&M[L](R)})}function $(C){return Xa("10.7.0","highlightBlock will be removed entirely in v12.0"),Xa("10.7.0","Please use highlightElement now."),y(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:w,highlightElement:y,highlightBlock:$,configure:v,initHighlighting:g,initHighlightingOnLoad:E,registerLanguage:N,unregisterLanguage:T,listLanguages:A,getLanguage:S,registerAliases:O,autoDetection:I,inherit:NT,addPlugin:F,removePlugin:W}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=rq,e.regex={concat:za,lookahead:dR,either:NE,optional:EW,anyNumberOfTimes:bW};for(const C in of)typeof of[C]=="object"&&cR(of[C]);return Object.assign(e,of),e},sl=xR({});sl.newInstance=()=>xR({});var aq=sl;sl.HighlightJS=sl;sl.default=sl;const gr=Uu(aq),kT={},oq="hljs-";function lq(e){const t=gr.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:a,registered:o};function n(l,c,d){const f=d||kT,h=typeof f.prefix=="string"?f.prefix:oq;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:cq,classPrefix:h});const p=t.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,y=m.data;return y.language=p.language,y.relevance=p.relevance,m}function r(l,c){const f=(c||kT).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 s(l,c){if(typeof l=="string")t.registerLanguage(l,c);else{let d;for(d in l)Object.hasOwn(l,d)&&t.registerLanguage(d,l[d])}}function a(l,c){if(typeof l=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const f=l[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(l){return!!t.getLanguage(l)}}class cq{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],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(a,o){return o?a+"_".repeat(o):n.options.classPrefix+a}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const uq={};function dq(e){const t=e||uq,n=t.aliases,r=t.detect||!1,i=t.languages||hW,s=t.plainText,a=t.prefix,o=t.subset;let l="hljs";const c=lq(i);if(n&&c.registerAlias(n),a){const d=a.indexOf("-");l=d===-1?a:a.slice(0,d)}return function(d,f){id(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const y=fq(h);if(y===!1||!y&&!r||y&&s&&s.includes(y))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(l)||h.properties.className.unshift(l);const v=qK(h,{whitespace:"pre"});let g;try{g=y?c.highlight(y,v,{prefix:a}):c.highlightAuto(v,{prefix:a,subset:o})}catch(E){const b=E;if(y&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+y+"`, it’s not registered",{ancestors:[m,h],cause:b,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!y&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function fq(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n-1&&s<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const l=IT(t,n[a-1]);o=l===-1?t.length+1:l+1,n[a]=o}if(o>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(a=55296&&e<=57343}function Bq(e){return e>=56320&&e<=57343}function Fq(e,t){return(e-55296)*1024+9216+t}function SR(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function kR(e){return e>=64976&&e<=65007||jq.has(e)}var ne;(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"})(ne||(ne={}));const Uq=65536;class $q{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=Uq,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:r,col:i,offset:s}=this,a=i+n,o=s+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_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(Bq(n))return this.pos++,this._addGap(),Fq(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(ne.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 r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;const r=this.html.charCodeAt(n);return r===B.CARRIAGE_RETURN?B.LINE_FEED:r}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,B.EOF;let t=this.html.charCodeAt(this.pos);return t===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):t===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,NR(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===B.LINE_FEED||t===B.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){SR(t)?this._err(ne.controlCharacterInInputStream):kR(t)&&this._err(ne.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 Hq=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))),zq=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 Vq(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=zq.get(e))!==null&&t!==void 0?t:e}var Ln;(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"})(Ln||(Ln={}));const Kq=32;var _s;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(_s||(_s={}));function Ky(e){return e>=Ln.ZERO&&e<=Ln.NINE}function Yq(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_F||e>=Ln.LOWER_A&&e<=Ln.LOWER_F}function Wq(e){return e>=Ln.UPPER_A&&e<=Ln.UPPER_Z||e>=Ln.LOWER_A&&e<=Ln.LOWER_Z||Ky(e)}function qq(e){return e===Ln.EQUALS||Wq(e)}var On;(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"})(On||(On={}));var ji;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ji||(ji={}));class Gq{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=On.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=ji.Strict}startEntity(t){this.decodeMode=t,this.state=On.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case On.EntityStart:return t.charCodeAt(n)===Ln.NUM?(this.state=On.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=On.NamedEntity,this.stateNamedEntity(t,n));case On.NumericStart:return this.stateNumericStart(t,n);case On.NumericDecimal:return this.stateNumericDecimal(t,n);case On.NumericHex:return this.stateNumericHex(t,n);case On.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Kq)===Ln.LOWER_X?(this.state=On.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=On.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,s!==0){if(a===Ln.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==ji.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&_s.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~_s.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case On.NamedEntity:return this.result!==0&&(this.decodeMode!==ji.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case On.NumericDecimal:return this.emitNumericEntity(0,2);case On.NumericHex:return this.emitNumericEntity(0,3);case On.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case On.EntityStart:return 0}}}function Xq(e,t,n,r){const i=(t&_s.BRANCH_LENGTH)>>7,s=t&_s.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:e[n+l]-1}let a=n,o=a+i-1;for(;a<=o;){const l=a+o>>>1,c=e[l];if(cr)o=l-1;else return e[l+i]}return-1}var ue;(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/"})(ue||(ue={}));var Ea;(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"})(Ea||(Ea={}));var jr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(jr||(jr={}));var J;(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"})(J||(J={}));var x;(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"})(x||(x={}));const Qq=new Map([[J.A,x.A],[J.ADDRESS,x.ADDRESS],[J.ANNOTATION_XML,x.ANNOTATION_XML],[J.APPLET,x.APPLET],[J.AREA,x.AREA],[J.ARTICLE,x.ARTICLE],[J.ASIDE,x.ASIDE],[J.B,x.B],[J.BASE,x.BASE],[J.BASEFONT,x.BASEFONT],[J.BGSOUND,x.BGSOUND],[J.BIG,x.BIG],[J.BLOCKQUOTE,x.BLOCKQUOTE],[J.BODY,x.BODY],[J.BR,x.BR],[J.BUTTON,x.BUTTON],[J.CAPTION,x.CAPTION],[J.CENTER,x.CENTER],[J.CODE,x.CODE],[J.COL,x.COL],[J.COLGROUP,x.COLGROUP],[J.DD,x.DD],[J.DESC,x.DESC],[J.DETAILS,x.DETAILS],[J.DIALOG,x.DIALOG],[J.DIR,x.DIR],[J.DIV,x.DIV],[J.DL,x.DL],[J.DT,x.DT],[J.EM,x.EM],[J.EMBED,x.EMBED],[J.FIELDSET,x.FIELDSET],[J.FIGCAPTION,x.FIGCAPTION],[J.FIGURE,x.FIGURE],[J.FONT,x.FONT],[J.FOOTER,x.FOOTER],[J.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[J.FORM,x.FORM],[J.FRAME,x.FRAME],[J.FRAMESET,x.FRAMESET],[J.H1,x.H1],[J.H2,x.H2],[J.H3,x.H3],[J.H4,x.H4],[J.H5,x.H5],[J.H6,x.H6],[J.HEAD,x.HEAD],[J.HEADER,x.HEADER],[J.HGROUP,x.HGROUP],[J.HR,x.HR],[J.HTML,x.HTML],[J.I,x.I],[J.IMG,x.IMG],[J.IMAGE,x.IMAGE],[J.INPUT,x.INPUT],[J.IFRAME,x.IFRAME],[J.KEYGEN,x.KEYGEN],[J.LABEL,x.LABEL],[J.LI,x.LI],[J.LINK,x.LINK],[J.LISTING,x.LISTING],[J.MAIN,x.MAIN],[J.MALIGNMARK,x.MALIGNMARK],[J.MARQUEE,x.MARQUEE],[J.MATH,x.MATH],[J.MENU,x.MENU],[J.META,x.META],[J.MGLYPH,x.MGLYPH],[J.MI,x.MI],[J.MO,x.MO],[J.MN,x.MN],[J.MS,x.MS],[J.MTEXT,x.MTEXT],[J.NAV,x.NAV],[J.NOBR,x.NOBR],[J.NOFRAMES,x.NOFRAMES],[J.NOEMBED,x.NOEMBED],[J.NOSCRIPT,x.NOSCRIPT],[J.OBJECT,x.OBJECT],[J.OL,x.OL],[J.OPTGROUP,x.OPTGROUP],[J.OPTION,x.OPTION],[J.P,x.P],[J.PARAM,x.PARAM],[J.PLAINTEXT,x.PLAINTEXT],[J.PRE,x.PRE],[J.RB,x.RB],[J.RP,x.RP],[J.RT,x.RT],[J.RTC,x.RTC],[J.RUBY,x.RUBY],[J.S,x.S],[J.SCRIPT,x.SCRIPT],[J.SEARCH,x.SEARCH],[J.SECTION,x.SECTION],[J.SELECT,x.SELECT],[J.SOURCE,x.SOURCE],[J.SMALL,x.SMALL],[J.SPAN,x.SPAN],[J.STRIKE,x.STRIKE],[J.STRONG,x.STRONG],[J.STYLE,x.STYLE],[J.SUB,x.SUB],[J.SUMMARY,x.SUMMARY],[J.SUP,x.SUP],[J.TABLE,x.TABLE],[J.TBODY,x.TBODY],[J.TEMPLATE,x.TEMPLATE],[J.TEXTAREA,x.TEXTAREA],[J.TFOOT,x.TFOOT],[J.TD,x.TD],[J.TH,x.TH],[J.THEAD,x.THEAD],[J.TITLE,x.TITLE],[J.TR,x.TR],[J.TRACK,x.TRACK],[J.TT,x.TT],[J.U,x.U],[J.UL,x.UL],[J.SVG,x.SVG],[J.VAR,x.VAR],[J.WBR,x.WBR],[J.XMP,x.XMP]]);function Cl(e){var t;return(t=Qq.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const fe=x,Zq={[ue.HTML]:new Set([fe.ADDRESS,fe.APPLET,fe.AREA,fe.ARTICLE,fe.ASIDE,fe.BASE,fe.BASEFONT,fe.BGSOUND,fe.BLOCKQUOTE,fe.BODY,fe.BR,fe.BUTTON,fe.CAPTION,fe.CENTER,fe.COL,fe.COLGROUP,fe.DD,fe.DETAILS,fe.DIR,fe.DIV,fe.DL,fe.DT,fe.EMBED,fe.FIELDSET,fe.FIGCAPTION,fe.FIGURE,fe.FOOTER,fe.FORM,fe.FRAME,fe.FRAMESET,fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6,fe.HEAD,fe.HEADER,fe.HGROUP,fe.HR,fe.HTML,fe.IFRAME,fe.IMG,fe.INPUT,fe.LI,fe.LINK,fe.LISTING,fe.MAIN,fe.MARQUEE,fe.MENU,fe.META,fe.NAV,fe.NOEMBED,fe.NOFRAMES,fe.NOSCRIPT,fe.OBJECT,fe.OL,fe.P,fe.PARAM,fe.PLAINTEXT,fe.PRE,fe.SCRIPT,fe.SECTION,fe.SELECT,fe.SOURCE,fe.STYLE,fe.SUMMARY,fe.TABLE,fe.TBODY,fe.TD,fe.TEMPLATE,fe.TEXTAREA,fe.TFOOT,fe.TH,fe.THEAD,fe.TITLE,fe.TR,fe.TRACK,fe.UL,fe.WBR,fe.XMP]),[ue.MATHML]:new Set([fe.MI,fe.MO,fe.MN,fe.MS,fe.MTEXT,fe.ANNOTATION_XML]),[ue.SVG]:new Set([fe.TITLE,fe.FOREIGN_OBJECT,fe.DESC]),[ue.XLINK]:new Set,[ue.XML]:new Set,[ue.XMLNS]:new Set},Yy=new Set([fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6]);J.STYLE,J.SCRIPT,J.XMP,J.IFRAME,J.NOEMBED,J.NOFRAMES,J.PLAINTEXT;var U;(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"})(U||(U={}));const dn={DATA:U.DATA,RCDATA:U.RCDATA,RAWTEXT:U.RAWTEXT,SCRIPT_DATA:U.SCRIPT_DATA,PLAINTEXT:U.PLAINTEXT,CDATA_SECTION:U.CDATA_SECTION};function Jq(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function gc(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function eG(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function ds(e){return eG(e)||gc(e)}function RT(e){return ds(e)||Jq(e)}function lf(e){return e+32}function CR(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function LT(e){return CR(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function tG(e){return e===B.NULL?ne.nullCharacterReference:e>1114111?ne.characterReferenceOutsideUnicodeRange:NR(e)?ne.surrogateCharacterReference:kR(e)?ne.noncharacterCharacterReference:SR(e)||e===B.CARRIAGE_RETURN?ne.controlCharacterReference:null}class nG{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=U.DATA,this.returnState=U.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new $q(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Gq(Hq,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=tG(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,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,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}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(ne.endTagWithAttributes),t.selfClosing&&this._err(ne.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 et.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case et.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case et.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:et.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=CR(t)?et.WHITESPACE_CHARACTER:t===B.NULL?et.NULL_CHARACTER:et.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(et.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=U.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?ji.Attribute:ji.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===U.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case U.DATA:{this._stateData(t);break}case U.RCDATA:{this._stateRcdata(t);break}case U.RAWTEXT:{this._stateRawtext(t);break}case U.SCRIPT_DATA:{this._stateScriptData(t);break}case U.PLAINTEXT:{this._statePlaintext(t);break}case U.TAG_OPEN:{this._stateTagOpen(t);break}case U.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case U.TAG_NAME:{this._stateTagName(t);break}case U.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case U.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case U.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case U.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case U.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case U.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case U.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case U.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case U.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case U.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case U.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case U.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case U.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case U.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case U.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case U.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case U.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case U.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case U.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case U.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case U.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case U.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case U.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case U.BOGUS_COMMENT:{this._stateBogusComment(t);break}case U.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case U.COMMENT_START:{this._stateCommentStart(t);break}case U.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case U.COMMENT:{this._stateComment(t);break}case U.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case U.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case U.COMMENT_END:{this._stateCommentEnd(t);break}case U.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case U.DOCTYPE:{this._stateDoctype(t);break}case U.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case U.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case U.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case U.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case U.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case U.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case U.CDATA_SECTION:{this._stateCdataSection(t);break}case U.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case U.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case U.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case U.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case B.AMPERSAND:{this._startCharacterReference();break}case B.LESS_THAN_SIGN:{this.state=U.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars($t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars($t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars($t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars($t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(ds(t))this._createStartTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case B.EXCLAMATION_MARK:{this.state=U.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=U.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=U.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(ds(t))this._createEndTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=U.DATA;break}case B.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("");break}case B.NULL:{this._err(ne.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars($t);break}case B.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ds(t)?(this._emitChars("<"),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){ds(t)?(this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case B.NULL:{this._err(ne.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars($t);break}case B.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(lr.SCRIPT,!1)&<(this.preprocessor.peek(lr.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 r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),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])!==ue.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;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(oG,ue.HTML)}clearBackToTableBodyContext(){this.clearBackTo(aG,ue.HTML)}clearBackToTableRowContext(){this.clearBackTo(sG,ue.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]===x.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]===x.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ue.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case ue.SVG:{if(PT.has(i))return!1;break}case ue.MATHML:{if(DT.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Qh)}hasInListItemScope(t){return this.hasInDynamicScope(t,rG)}hasInButtonScope(t){return this.hasInDynamicScope(t,iG)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ue.HTML:{if(Yy.has(n))return!0;if(Qh.has(n))return!1;break}case ue.SVG:{if(PT.has(n))return!1;break}case ue.MATHML:{if(DT.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case t:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ue.HTML)switch(this.tagIDs[t]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case t:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&IR.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&MT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&MT.has(this.currentTagId);)this.pop()}}const Mg=3;var Ei;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ei||(Ei={}));const jT={type:Ei.Marker};class uG{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let o=0;o[a.name,a.value]));let s=0;for(let a=0;ai.get(l.name)===l.value)&&(s+=1,s>=Mg&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(jT)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ei.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ei.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(jT);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ei.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ei.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ei.Element&&n.element===t)}}const fs={createDocument(){return{nodeName:"#document",mode:jr.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 r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};fs.appendChild(e,s)}},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(fs.isTextNode(n)){n.value+=t;return}}fs.appendChild(e,fs.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&fs.isTextNode(r)?r.value+=t:fs.insertBefore(e,fs.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function gG(e){return e.name===OR&&e.publicId===null&&(e.systemId===null||e.systemId===dG)}function yG(e){if(e.name!==OR)return jr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===fG)return jr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),pG.has(n))return jr.QUIRKS;let r=t===null?hG:RR;if(BT(n,r))return jr.QUIRKS;if(r=t===null?LR:mG,BT(n,r))return jr.LIMITED_QUIRKS}return jr.NO_QUIRKS}const FT={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},bG="definitionurl",EG="definitionURL",xG=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])),vG=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ue.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ue.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ue.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ue.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ue.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ue.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ue.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ue.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ue.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ue.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ue.XMLNS}]]),wG=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])),_G=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function TG(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===Ea.COLOR||r===Ea.SIZE||r===Ea.FACE)||_G.has(t)}function MR(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ue.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ue.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=H.TEXT}switchToPlaintextParsing(){this.insertionMode=H.TEXT,this.originalInsertionMode=H.IN_BODY,this.tokenizer.state=dn.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)===J.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ue.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=dn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=dn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=dn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=dn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ue.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ue.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(J.HTML,ue.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,x.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):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),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:c,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===et.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===x.SVG&&this.treeAdapter.getTagName(n)===J.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ue.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ue.HTML)}_processToken(t){switch(t.type){case et.CHARACTER:{this.onCharacter(t);break}case et.NULL_CHARACTER:{this.onNullCharacter(t);break}case et.COMMENT:{this.onComment(t);break}case et.DOCTYPE:{this.onDoctype(t);break}case et.START_TAG:{this._processStartTag(t);break}case et.END_TAG:{this.onEndTag(t);break}case et.EOF:{this.onEof(t);break}case et.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return AG(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Ei.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=H.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case x.TR:{this.insertionMode=H.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=H.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=H.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=H.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=H.IN_TABLE;return}case x.BODY:{this.insertionMode=H.IN_BODY;return}case x.FRAMESET:{this.insertionMode=H.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(t);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?H.AFTER_HEAD:H.BEFORE_HEAD;return}case x.TD:case x.TH:{if(t>0){this.insertionMode=H.IN_CELL;return}break}case x.HEAD:{if(t>0){this.insertionMode=H.IN_HEAD;return}break}}this.insertionMode=H.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=H.IN_SELECT_IN_TABLE;return}}this.insertionMode=H.IN_SELECT}_isElementCausesFosterParenting(t){return PR.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 x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ue.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,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 r=this.treeAdapter.getNamespaceURI(t);return Zq[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){lQ(this,t);return}switch(this.insertionMode){case H.INITIAL:{tc(this,t);break}case H.BEFORE_HTML:{$c(this,t);break}case H.BEFORE_HEAD:{Hc(this,t);break}case H.IN_HEAD:{zc(this,t);break}case H.IN_HEAD_NO_SCRIPT:{Vc(this,t);break}case H.AFTER_HEAD:{Kc(this,t);break}case H.IN_BODY:case H.IN_CAPTION:case H.IN_CELL:case H.IN_TEMPLATE:{BR(this,t);break}case H.TEXT:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:{Dg(this,t);break}case H.IN_TABLE_TEXT:{VR(this,t);break}case H.IN_COLUMN_GROUP:{Zh(this,t);break}case H.AFTER_BODY:{Jh(this,t);break}case H.AFTER_AFTER_BODY:{qf(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){oQ(this,t);return}switch(this.insertionMode){case H.INITIAL:{tc(this,t);break}case H.BEFORE_HTML:{$c(this,t);break}case H.BEFORE_HEAD:{Hc(this,t);break}case H.IN_HEAD:{zc(this,t);break}case H.IN_HEAD_NO_SCRIPT:{Vc(this,t);break}case H.AFTER_HEAD:{Kc(this,t);break}case H.TEXT:{this._insertCharacters(t);break}case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:{Dg(this,t);break}case H.IN_COLUMN_GROUP:{Zh(this,t);break}case H.AFTER_BODY:{Jh(this,t);break}case H.AFTER_AFTER_BODY:{qf(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Wy(this,t);return}switch(this.insertionMode){case H.INITIAL:case H.BEFORE_HTML:case H.BEFORE_HEAD:case H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:case H.IN_BODY:case H.IN_TABLE:case H.IN_CAPTION:case H.IN_COLUMN_GROUP:case H.IN_TABLE_BODY:case H.IN_ROW:case H.IN_CELL:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:case H.IN_TEMPLATE:case H.IN_FRAMESET:case H.AFTER_FRAMESET:{Wy(this,t);break}case H.IN_TABLE_TEXT:{nc(this,t);break}case H.AFTER_BODY:{FG(this,t);break}case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:{UG(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case H.INITIAL:{$G(this,t);break}case H.BEFORE_HEAD:case H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:{this._err(t,ne.misplacedDoctype);break}case H.IN_TABLE_TEXT:{nc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?cQ(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case H.INITIAL:{tc(this,t);break}case H.BEFORE_HTML:{HG(this,t);break}case H.BEFORE_HEAD:{VG(this,t);break}case H.IN_HEAD:{di(this,t);break}case H.IN_HEAD_NO_SCRIPT:{WG(this,t);break}case H.AFTER_HEAD:{GG(this,t);break}case H.IN_BODY:{Gn(this,t);break}case H.IN_TABLE:{al(this,t);break}case H.IN_TABLE_TEXT:{nc(this,t);break}case H.IN_CAPTION:{KX(this,t);break}case H.IN_COLUMN_GROUP:{LE(this,t);break}case H.IN_TABLE_BODY:{tm(this,t);break}case H.IN_ROW:{nm(this,t);break}case H.IN_CELL:{qX(this,t);break}case H.IN_SELECT:{WR(this,t);break}case H.IN_SELECT_IN_TABLE:{XX(this,t);break}case H.IN_TEMPLATE:{ZX(this,t);break}case H.AFTER_BODY:{eQ(this,t);break}case H.IN_FRAMESET:{tQ(this,t);break}case H.AFTER_FRAMESET:{rQ(this,t);break}case H.AFTER_AFTER_BODY:{sQ(this,t);break}case H.AFTER_AFTER_FRAMESET:{aQ(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?uQ(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case H.INITIAL:{tc(this,t);break}case H.BEFORE_HTML:{zG(this,t);break}case H.BEFORE_HEAD:{KG(this,t);break}case H.IN_HEAD:{YG(this,t);break}case H.IN_HEAD_NO_SCRIPT:{qG(this,t);break}case H.AFTER_HEAD:{XG(this,t);break}case H.IN_BODY:{em(this,t);break}case H.TEXT:{DX(this,t);break}case H.IN_TABLE:{ku(this,t);break}case H.IN_TABLE_TEXT:{nc(this,t);break}case H.IN_CAPTION:{YX(this,t);break}case H.IN_COLUMN_GROUP:{WX(this,t);break}case H.IN_TABLE_BODY:{qy(this,t);break}case H.IN_ROW:{YR(this,t);break}case H.IN_CELL:{GX(this,t);break}case H.IN_SELECT:{qR(this,t);break}case H.IN_SELECT_IN_TABLE:{QX(this,t);break}case H.IN_TEMPLATE:{JX(this,t);break}case H.AFTER_BODY:{XR(this,t);break}case H.IN_FRAMESET:{nQ(this,t);break}case H.AFTER_FRAMESET:{iQ(this,t);break}case H.AFTER_AFTER_BODY:{qf(this,t);break}}}onEof(t){switch(this.insertionMode){case H.INITIAL:{tc(this,t);break}case H.BEFORE_HTML:{$c(this,t);break}case H.BEFORE_HEAD:{Hc(this,t);break}case H.IN_HEAD:{zc(this,t);break}case H.IN_HEAD_NO_SCRIPT:{Vc(this,t);break}case H.AFTER_HEAD:{Kc(this,t);break}case H.IN_BODY:case H.IN_TABLE:case H.IN_CAPTION:case H.IN_COLUMN_GROUP:case H.IN_TABLE_BODY:case H.IN_ROW:case H.IN_CELL:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:{HR(this,t);break}case H.TEXT:{PX(this,t);break}case H.IN_TABLE_TEXT:{nc(this,t);break}case H.IN_TEMPLATE:{GR(this,t);break}case H.AFTER_BODY:case H.IN_FRAMESET:case H.AFTER_FRAMESET:case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:{RE(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===B.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 H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:case H.TEXT:case H.IN_COLUMN_GROUP:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:case H.IN_FRAMESET:case H.AFTER_FRAMESET:{this._insertCharacters(t);break}case H.IN_BODY:case H.IN_CAPTION:case H.IN_CELL:case H.IN_TEMPLATE:case H.AFTER_BODY:case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:{jR(this,t);break}case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:{Dg(this,t);break}case H.IN_TABLE_TEXT:{zR(this,t);break}}}};function LG(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):$R(e,t),n}function MG(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function DG(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,a=i;a!==n;s++,a=i){i=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),l=o&&s>=OG;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=PG(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function PG(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function jG(e,t,n){const r=e.treeAdapter.getTagName(t),i=Cl(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===x.TEMPLATE&&s===ue.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function BG(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function OE(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function $G(e,t){e._setDocumentType(t);const n=t.forceQuirks?jr.QUIRKS:yG(t);gG(t)||e._err(t,ne.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=H.BEFORE_HTML}function tc(e,t){e._err(t,ne.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,jr.QUIRKS),e.insertionMode=H.BEFORE_HTML,e._processToken(t)}function HG(e,t){t.tagID===x.HTML?(e._insertElement(t,ue.HTML),e.insertionMode=H.BEFORE_HEAD):$c(e,t)}function zG(e,t){const n=t.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&$c(e,t)}function $c(e,t){e._insertFakeRootElement(),e.insertionMode=H.BEFORE_HEAD,e._processToken(t)}function VG(e,t){switch(t.tagID){case x.HTML:{Gn(e,t);break}case x.HEAD:{e._insertElement(t,ue.HTML),e.headElement=e.openElements.current,e.insertionMode=H.IN_HEAD;break}default:Hc(e,t)}}function KG(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?Hc(e,t):e._err(t,ne.endTagWithoutMatchingOpenElement)}function Hc(e,t){e._insertFakeElement(J.HEAD,x.HEAD),e.headElement=e.openElements.current,e.insertionMode=H.IN_HEAD,e._processToken(t)}function di(e,t){switch(t.tagID){case x.HTML:{Gn(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,dn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,dn.RAWTEXT):(e._insertElement(t,ue.HTML),e.insertionMode=H.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,dn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,dn.SCRIPT_DATA);break}case x.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=H.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(H.IN_TEMPLATE);break}case x.HEAD:{e._err(t,ne.misplacedStartTagForHeadElement);break}default:zc(e,t)}}function YG(e,t){switch(t.tagID){case x.HEAD:{e.openElements.pop(),e.insertionMode=H.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{zc(e,t);break}case x.TEMPLATE:{Va(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function Va(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,ne.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ne.endTagWithoutMatchingOpenElement)}function zc(e,t){e.openElements.pop(),e.insertionMode=H.AFTER_HEAD,e._processToken(t)}function WG(e,t){switch(t.tagID){case x.HTML:{Gn(e,t);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{di(e,t);break}case x.NOSCRIPT:{e._err(t,ne.nestedNoscriptInHead);break}default:Vc(e,t)}}function qG(e,t){switch(t.tagID){case x.NOSCRIPT:{e.openElements.pop(),e.insertionMode=H.IN_HEAD;break}case x.BR:{Vc(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function Vc(e,t){const n=t.type===et.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=H.IN_HEAD,e._processToken(t)}function GG(e,t){switch(t.tagID){case x.HTML:{Gn(e,t);break}case x.BODY:{e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=H.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,ue.HTML),e.insertionMode=H.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{e._err(t,ne.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),di(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,ne.misplacedStartTagForHeadElement);break}default:Kc(e,t)}}function XG(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{Kc(e,t);break}case x.TEMPLATE:{Va(e,t);break}default:e._err(t,ne.endTagWithoutMatchingOpenElement)}}function Kc(e,t){e._insertFakeElement(J.BODY,x.BODY),e.insertionMode=H.IN_BODY,Jp(e,t)}function Jp(e,t){switch(t.type){case et.CHARACTER:{BR(e,t);break}case et.WHITESPACE_CHARACTER:{jR(e,t);break}case et.COMMENT:{Wy(e,t);break}case et.START_TAG:{Gn(e,t);break}case et.END_TAG:{em(e,t);break}case et.EOF:{HR(e,t);break}}}function jR(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function BR(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function QG(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function ZG(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function JG(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_FRAMESET)}function eX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function tX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Yy.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ue.HTML)}function nX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function rX(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),n||(e.formElement=e.openElements.current))}function iX(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===x.LI&&i===x.LI||(n===x.DD||n===x.DT)&&(i===x.DD||i===x.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==x.ADDRESS&&i!==x.DIV&&i!==x.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function sX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.tokenizer.state=dn.PLAINTEXT}function aX(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1}function oX(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(J.A);n&&(OE(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function cX(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(OE(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function dX(e,t){e.treeAdapter.getDocumentMode(e.document)!==jr.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=H.IN_TABLE}function FR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function UR(e){const t=AR(e,Ea.TYPE);return t!=null&&t.toLowerCase()===CG}function fX(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),UR(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function hX(e,t){e._appendElement(t,ue.HTML),t.ackSelfClosing=!0}function pX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function mX(e,t){t.tagName=J.IMG,t.tagID=x.IMG,FR(e,t)}function gX(e,t){e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.tokenizer.state=dn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=H.TEXT}function yX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,dn.RAWTEXT)}function bX(e,t){e.framesetOk=!1,e._switchToTextParsing(t,dn.RAWTEXT)}function HT(e,t){e._switchToTextParsing(t,dn.RAWTEXT)}function EX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===H.IN_TABLE||e.insertionMode===H.IN_CAPTION||e.insertionMode===H.IN_TABLE_BODY||e.insertionMode===H.IN_ROW||e.insertionMode===H.IN_CELL?H.IN_SELECT_IN_TABLE:H.IN_SELECT}function xX(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function vX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ue.HTML)}function wX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,ue.HTML)}function _X(e,t){e._reconstructActiveFormattingElements(),MR(t),IE(t),t.selfClosing?e._appendElement(t,ue.MATHML):e._insertElement(t,ue.MATHML),t.ackSelfClosing=!0}function TX(e,t){e._reconstructActiveFormattingElements(),DR(t),IE(t),t.selfClosing?e._appendElement(t,ue.SVG):e._insertElement(t,ue.SVG),t.ackSelfClosing=!0}function zT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function Gn(e,t){switch(t.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{lX(e,t);break}case x.A:{oX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{tX(e,t);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{eX(e,t);break}case x.LI:case x.DD:case x.DT:{iX(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{FR(e,t);break}case x.HR:{pX(e,t);break}case x.RB:case x.RTC:{vX(e,t);break}case x.RT:case x.RP:{wX(e,t);break}case x.PRE:case x.LISTING:{nX(e,t);break}case x.XMP:{yX(e,t);break}case x.SVG:{TX(e,t);break}case x.HTML:{QG(e,t);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{di(e,t);break}case x.BODY:{ZG(e,t);break}case x.FORM:{rX(e,t);break}case x.NOBR:{cX(e,t);break}case x.MATH:{_X(e,t);break}case x.TABLE:{dX(e,t);break}case x.INPUT:{fX(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{hX(e,t);break}case x.IMAGE:{mX(e,t);break}case x.BUTTON:{aX(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{uX(e,t);break}case x.IFRAME:{bX(e,t);break}case x.SELECT:{EX(e,t);break}case x.OPTION:case x.OPTGROUP:{xX(e,t);break}case x.NOEMBED:case x.NOFRAMES:{HT(e,t);break}case x.FRAMESET:{JG(e,t);break}case x.TEXTAREA:{gX(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?HT(e,t):zT(e,t);break}case x.PLAINTEXT:{sX(e,t);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:zT(e,t)}}function NX(e,t){if(e.openElements.hasInScope(x.BODY)&&(e.insertionMode=H.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function SX(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=H.AFTER_BODY,XR(e,t))}function kX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function AX(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(x.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(x.FORM):n&&e.openElements.remove(n))}function CX(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(J.P,x.P),e._closePElement()}function IX(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function OX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function RX(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function LX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function MX(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(J.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function $R(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],a=e.openElements.tagIDs[i];if(r===a&&(r!==x.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,a))break}}function em(e,t){switch(t.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{OE(e,t);break}case x.P:{CX(e);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{kX(e,t);break}case x.LI:{IX(e);break}case x.DD:case x.DT:{OX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{RX(e);break}case x.BR:{MX(e);break}case x.BODY:{NX(e,t);break}case x.HTML:{SX(e,t);break}case x.FORM:{AX(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{LX(e,t);break}case x.TEMPLATE:{Va(e,t);break}default:$R(e,t)}}function HR(e,t){e.tmplInsertionModeStack.length>0?GR(e,t):RE(e,t)}function DX(e,t){var n;t.tagID===x.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function PX(e,t){e._err(t,ne.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Dg(e,t){if(e.openElements.currentTagId!==void 0&&PR.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=H.IN_TABLE_TEXT,t.type){case et.CHARACTER:{VR(e,t);break}case et.WHITESPACE_CHARACTER:{zR(e,t);break}}else ad(e,t)}function jX(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_CAPTION}function BX(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_COLUMN_GROUP}function FX(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.COLGROUP,x.COLGROUP),e.insertionMode=H.IN_COLUMN_GROUP,LE(e,t)}function UX(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_TABLE_BODY}function $X(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.TBODY,x.TBODY),e.insertionMode=H.IN_TABLE_BODY,tm(e,t)}function HX(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function zX(e,t){UR(t)?e._appendElement(t,ue.HTML):ad(e,t),t.ackSelfClosing=!0}function VX(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ue.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function al(e,t){switch(t.tagID){case x.TD:case x.TH:case x.TR:{$X(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{di(e,t);break}case x.COL:{FX(e,t);break}case x.FORM:{VX(e,t);break}case x.TABLE:{HX(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{UX(e,t);break}case x.INPUT:{zX(e,t);break}case x.CAPTION:{jX(e,t);break}case x.COLGROUP:{BX(e,t);break}default:ad(e,t)}}function ku(e,t){switch(t.tagID){case x.TABLE:{e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode());break}case x.TEMPLATE:{Va(e,t);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:ad(e,t)}}function ad(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Jp(e,t),e.fosterParentingEnabled=n}function zR(e,t){e.pendingCharacterTokens.push(t)}function VR(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function nc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===x.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===x.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop();break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop();break}case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode());break}case x.TEMPLATE:{Va(e,t);break}}}function XX(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e._processStartTag(t)):WR(e,t)}function QX(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e.onEndTag(t)):qR(e,t)}function ZX(e,t){switch(t.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{di(e,t);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.tmplInsertionModeStack[0]=H.IN_TABLE,e.insertionMode=H.IN_TABLE,al(e,t);break}case x.COL:{e.tmplInsertionModeStack[0]=H.IN_COLUMN_GROUP,e.insertionMode=H.IN_COLUMN_GROUP,LE(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=H.IN_TABLE_BODY,e.insertionMode=H.IN_TABLE_BODY,tm(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=H.IN_ROW,e.insertionMode=H.IN_ROW,nm(e,t);break}default:e.tmplInsertionModeStack[0]=H.IN_BODY,e.insertionMode=H.IN_BODY,Gn(e,t)}}function JX(e,t){t.tagID===x.TEMPLATE&&Va(e,t)}function GR(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):RE(e,t)}function eQ(e,t){t.tagID===x.HTML?Gn(e,t):Jh(e,t)}function XR(e,t){var n;if(t.tagID===x.HTML){if(e.fragmentContext||(e.insertionMode=H.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===x.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Jh(e,t)}function Jh(e,t){e.insertionMode=H.IN_BODY,Jp(e,t)}function tQ(e,t){switch(t.tagID){case x.HTML:{Gn(e,t);break}case x.FRAMESET:{e._insertElement(t,ue.HTML);break}case x.FRAME:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{di(e,t);break}}}function nQ(e,t){t.tagID===x.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==x.FRAMESET&&(e.insertionMode=H.AFTER_FRAMESET))}function rQ(e,t){switch(t.tagID){case x.HTML:{Gn(e,t);break}case x.NOFRAMES:{di(e,t);break}}}function iQ(e,t){t.tagID===x.HTML&&(e.insertionMode=H.AFTER_AFTER_FRAMESET)}function sQ(e,t){t.tagID===x.HTML?Gn(e,t):qf(e,t)}function qf(e,t){e.insertionMode=H.IN_BODY,Jp(e,t)}function aQ(e,t){switch(t.tagID){case x.HTML:{Gn(e,t);break}case x.NOFRAMES:{di(e,t);break}}}function oQ(e,t){t.chars=$t,e._insertCharacters(t)}function lQ(e,t){e._insertCharacters(t),e.framesetOk=!1}function QR(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ue.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function cQ(e,t){if(TG(t))QR(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ue.MATHML?MR(t):r===ue.SVG&&(NG(t),DR(t)),IE(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function uQ(e,t){if(t.tagID===x.P||t.tagID===x.BR){QR(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ue.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}J.AREA,J.BASE,J.BASEFONT,J.BGSOUND,J.BR,J.COL,J.EMBED,J.FRAME,J.HR,J.IMG,J.INPUT,J.KEYGEN,J.LINK,J.META,J.PARAM,J.SOURCE,J.TRACK,J.WBR;const dQ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,fQ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),VT={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function ZR(e,t){const n=wQ(e),r=hO("type",{handlers:{root:hQ,element:pQ,text:mQ,comment:eL,doctype:gQ,raw:bQ},unknown:EQ}),i={parser:n?new $T(VT):$T.getFragmentParser(void 0,VT),handle(o){r(o,i)},stitches:!1,options:t||{}};r(e,i),Il(i,Ci());const s=n?i.parser.document:i.parser.getFragment(),a=_q(s,{file:i.options.file});return i.stitches&&id(a,"comment",function(o,l,c){const d=o;if(d.value.stitch&&c&&l!==void 0){const f=c.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function JR(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:et.CHARACTER,chars:e.value,location:od(e)};Il(t,Ci(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function gQ(e,t){const n={type:et.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:od(e)};Il(t,Ci(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function yQ(e,t){t.stitches=!0;const n=_Q(e);if("children"in e&&"children"in n){const r=ZR({type:"root",children:e.children},t.options);n.children=r.children}eL({type:"comment",value:{stitch:n}},t)}function eL(e,t){const n=e.value,r={type:et.COMMENT,data:n,location:od(e)};Il(t,Ci(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function bQ(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,tL(t,Ci(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(dQ,"<$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 EQ(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))yQ(n,t);else{let r="";throw fQ.has(n.type)&&(r=". 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"+r)}}function Il(e,t){tL(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=dn.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 tL(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 xQ(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===dn.PLAINTEXT)return;Il(t,Ci(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ua.html;i===ua.html&&n==="svg"&&(i=ua.svg);const s=Aq({...e,children:[]},{space:i===ua.svg?"svg":"html"}),a={type:et.START_TAG,tagName:n,tagID:Cl(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:od(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function vQ(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Pq.includes(n)||t.parser.tokenizer.state===dn.PLAINTEXT)return;Il(t,Wp(e));const r={type:et.END_TAG,tagName:n,tagID:Cl(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:od(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===dn.RCDATA||t.parser.tokenizer.state===dn.RAWTEXT||t.parser.tokenizer.state===dn.SCRIPT_DATA)&&(t.parser.tokenizer.state=dn.DATA)}function wQ(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function od(e){const t=Ci(e)||{line:void 0,column:void 0,offset:void 0},n=Wp(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 _Q(e){return"children"in e?il({...e,children:[]}):il(e)}function TQ(e){return function(t,n){return ZR(t,{...e,file:n})}}const nL=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function rL(e){if(!e)return!1;try{const t=e.toLowerCase();return nL.some(n=>t.includes(n))}catch{return!1}}function NQ(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(rL(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const i=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return nL.some(s=>i.includes(s))}return!1}function SQ({text:e,className:t}){const[n,r]=_.useState(null),i=(o,l)=>{if(o.src)return o.src;if(l){const c=f=>{var h;if(!f)return null;if(f.type==="source"&&((h=f.properties)!=null&&h.src))return f.properties.src;if(f.children)for(const p of f.children){const m=c(p);if(m)return m}return null},d=c({children:l});if(d)return d}return""},s=o=>{try{const c=new URL(o).pathname.split("/");return c[c.length-1]||"video.mp4"}catch{return"video.mp4"}},a=o=>o?Array.isArray(o)?o.map(l=>(l==null?void 0:l.value)||"").join("")||"video":(o==null?void 0:o.value)||"video":"video";return u.jsxs("div",{className:t?`md ${t}`:"md",children:[u.jsx(Az,{remarkPlugins:[$K],rehypePlugins:[TQ,dq],components:{a:({node:o,...l})=>{const c=l.href;if(c&&(rL(c)||NQ(o))){const d=c,f=a(o==null?void 0:o.children);return u.jsxs("div",{className:"video-container",children:[u.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${f}`,onClick:()=>r({src:d,title:f}),children:[u.jsx("video",{src:d,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),u.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:u.jsx(Dc,{})})]}),u.jsx("div",{className:"video-caption",children:u.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:f})})]})}return u.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer"})},img:({node:o,src:l,alt:c,...d})=>{const f=u.jsx("img",{...d,src:l,alt:c??"",loading:"lazy"});return l?u.jsx(gC,{src:l,children:u.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${c||"图片"}`,children:[f,u.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:u.jsx(Dc,{})})]})}):f},video:({node:o,src:l,children:c,...d})=>{const f=i({src:l},c);return f?u.jsx("div",{className:"video-container",children:u.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>r({src:f}),children:[u.jsx("video",{src:f,...d,playsInline:!0,className:"video-thumbnail",children:c}),u.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:u.jsx(Dc,{})})]})}):u.jsx("video",{src:l,controls:!0,playsInline:!0,className:"video-inline",...d,children:c})}},children:e}),n&&u.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>r(null),children:u.jsxs("div",{className:"video-viewer",onClick:o=>o.stopPropagation(),children:[u.jsxs("div",{className:"video-viewer-header",children:[u.jsx("div",{className:"video-viewer-title",children:n.title||s(n.src)}),u.jsxs("nav",{className:"video-viewer-nav",children:[u.jsx("a",{href:n.src,download:n.title||s(n.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:u.jsx(Kb,{})}),u.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>r(null),children:u.jsx(Vr,{})})]})]}),u.jsx("div",{className:"video-viewer-body",children:u.jsx("video",{src:n.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const rm=_.memo(SQ);function ME({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:u.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>u.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[u.jsx(Aa,{"aria-hidden":!0}),u.jsxs("span",{children:["/",r.name]}),t?u.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:u.jsx(Vr,{})}):null]},r.name)),e.targetAgent?u.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[u.jsx(vC,{"aria-hidden":!0}),u.jsx("span",{children:e.targetAgent.name}),n?u.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:u.jsx(Vr,{})}):null]}):null]})}function DE(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function iL(e){var n,r,i,s;const t=DE(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((r=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:r.toUpperCase())??"VIDEO":t==="image"?((s=(i=e.mimeType)==null?void 0:i.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function sL(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function aL(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?zC(t,e.uri):""}function kQ({kind:e}){return e==="image"?u.jsx(IC,{}):e==="video"?u.jsx(kC,{}):e==="pdf"?u.jsx(G8,{}):u.jsx(SC,{})}function PE({appName:e,items:t,compact:n=!1,onRemove:r}){const[i,s]=_.useState(null);return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=DE(a.mimeType),l=aL(a,e),c=a.status==="uploading"||a.status==="error"||!l,d=u.jsxs("button",{type:"button",className:"media-card-main",disabled:c,onClick:()=>s(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&l?u.jsx("img",{className:"media-card-image",src:l,alt:a.name??"图片",loading:"lazy"}):o==="video"&&l?u.jsxs("div",{className:"media-card-video-container",children:[u.jsx("video",{className:"media-card-video",src:l,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),u.jsx("span",{className:"media-card-video-play",children:u.jsx(p9,{})})]}):u.jsx("span",{className:"media-card-icon",children:u.jsx(kQ,{kind:o})}),u.jsxs("span",{className:"media-card-copy",children:[u.jsx("span",{className:"media-card-name",children:a.name??"附件"}),u.jsxs("span",{className:"media-card-meta",children:[u.jsx("span",{className:"media-card-type",children:iL(a)}),a.status==="uploading"?u.jsxs(u.Fragment,{children:[u.jsx(xt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":sL(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?u.jsx(Dc,{className:"media-card-open"}):null]});return u.jsxs(zt.div,{className:`media-card media-card--${o}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[o==="image"&&!c?u.jsx(gC,{src:l,children:d}):d,r?u.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:u.jsx(Vr,{})}):null]},a.id)})}),u.jsx(Rs,{children:i?u.jsx(AQ,{appName:e,item:i,onClose:()=>s(null)}):null})]})}function AQ({appName:e,item:t,onClose:n}){const r=_.useMemo(()=>aL(t,e),[e,t]),i=DE(t.mimeType),[s,a]=_.useState(""),[o,l]=_.useState(i==="text"||i==="markdown"),[c,d]=_.useState("");return _.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),_.useEffect(()=>{if(i!=="text"&&i!=="markdown")return;const f=new AbortController;return l(!0),d(""),fetch(r,{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||l(!1)}),()=>f.abort()},[i,r]),u.jsx(zt.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:u.jsxs(zt.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:[u.jsxs("header",{className:"media-viewer-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:t.name??"附件"}),u.jsxs("span",{children:[iL(t),t.sizeBytes?` · ${sL(t.sizeBytes)}`:""]})]}),u.jsxs("nav",{children:[u.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:u.jsx(Kb,{})}),u.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:u.jsx(Vr,{})})]})]}),u.jsxs("div",{className:`media-viewer-body media-viewer-body--${i}`,children:[i==="image"?u.jsx("img",{src:r,alt:t.name??"图片"}):null,i==="video"?u.jsx("div",{className:"media-viewer-video-wrapper",children:u.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,i==="pdf"?u.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?u.jsxs("div",{className:"media-viewer-loading",children:[u.jsx(xt,{})," 正在读取文档…"]}):null,!o&&c?u.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",c]}):null,!o&&i==="markdown"?u.jsx("div",{className:"media-document",children:u.jsx(rm,{text:s})}):null,!o&&i==="text"?u.jsx("pre",{className:"media-document media-document--plain",children:s}):null]})]})})}function ld({as:e="span",className:t="",duration:n=4,spread:r=20,children:i,style:s,...a}){const o=Math.min(Math.max(r,5),45);return u.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${n}s`},...a,children:i})}function CQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),u.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 IQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),u.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),u.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),u.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 OQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),u.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),u.jsx("path",{d:"m19.25 2.5.42 1.2 1.2.42-1.2.42-.42 1.2-.42-1.2-1.2-.42 1.2-.42.42-1.2Z",fill:"currentColor",stroke:"none"})]})}function RQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.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"}),u.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"}),u.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function LQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),u.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),u.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),u.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function oL(e){return u.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:u.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function MQ({definition:e,done:t,open:n,onToggle:r}){const i=e.icon;return u.jsxs("button",{type:"button",className:`builtin-tool-head${t?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":n,children:[u.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:u.jsx(i,{})}),t?u.jsx("span",{className:"builtin-tool-label",children:e.doneLabel}):u.jsx(ld,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:e.runningLabel}),u.jsx(oL,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}const DQ={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:CQ},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:IQ},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:OQ},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:RQ},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:LQ}};function PQ(e){return DQ[e]}const lL="send_a2ui_json_to_client";function jQ({className:e}){return u.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:u.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 BQ(){return u.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.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 cL({text:e,done:t}){const[n,r]=_.useState(!t),i=_.useRef(!1);_.useEffect(()=>{i.current||r(!t)},[t]);const s=()=>{i.current=!0,r(c=>!c)},a=e.replace(/^\s+/,""),{ref:o,onScroll:l}=TI(a);return u.jsxs("div",{className:"block-thinking",children:[u.jsxs("button",{className:"think-head",onClick:s,type:"button",children:[u.jsx("span",{className:"think-icon","aria-hidden":"true",children:u.jsx(jQ,{className:`spark ${t?"":"pulse"}`})}),t?u.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):u.jsx(ld,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),u.jsx(rr,{className:`chev ${n?"open":""}`})]}),u.jsx("div",{className:`think-collapse ${n&&a?"open":""}`,children:u.jsx("div",{className:"think-collapse-inner",children:u.jsx("div",{className:"think-body scroll",ref:o,onScroll:l,children:a})})})]})}function uL(){return u.jsx(cL,{text:"",done:!1})}function FQ({name:e,args:t,response:n,done:r}){const[i,s]=_.useState(!1),a=e===lL?"渲染 UI":e,o=PQ(e),l=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),c=l&&l.length>2e3?l.slice(0,2e3)+` -…(已截断)`:l;return u.jsxs(zt.div,{className:`block-tool${o?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o?u.jsx(MQ,{definition:o,done:r,open:i,onToggle:()=>s(d=>!d)}):u.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>s(d=>!d),type:"button","aria-expanded":i,children:[u.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u.jsx(BQ,{})}),r?u.jsx("span",{className:"tool-name",children:a}):u.jsx(ld,{className:"tool-name",duration:2.2,spread:15,children:a}),u.jsx(oL,{className:`tool-chevron${i?" is-open":""}`})]}),u.jsx("div",{className:`think-collapse ${i?"open":""}`,children:u.jsx("div",{className:"think-collapse-inner",children:u.jsxs("div",{className:"tool-detail",children:[t!=null&&u.jsxs("div",{className:"tool-section",children:[u.jsx("div",{className:"tool-section-label",children:"参数"}),u.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),c!=null&&u.jsxs("div",{className:"tool-section",children:[u.jsx("div",{className:"tool-section-label",children:"返回"}),u.jsx("pre",{className:"tool-args tool-result",children:c})]})]})})})]})}function UQ({block:e,onAuth:t}){const[n,r]=_.useState(e.done?"done":"idle"),[i,s]=_.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),l=async()=>{if(t){s(""),r("authorizing");try{await t(e),r("done")}catch(d){s(d instanceof Error?d.message:String(d)),r("idle")}}};return e.done||n==="done"?u.jsxs(zt.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[u.jsx(Qw,{className:"auth-card-icon auth-card-icon--done"}),u.jsxs("span",{children:["已授权 · ",a]})]}):u.jsxs(zt.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[u.jsxs("div",{className:"auth-card-head",children:[u.jsx(Qw,{className:"auth-card-icon"}),u.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),u.jsxs("p",{className:"auth-card-desc",children:["工具集 ",u.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&u.jsxs(u.Fragment,{children:[" ","将跳转至 ",u.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),u.jsx("button",{className:"auth-card-btn",onClick:l,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?u.jsxs(u.Fragment,{children:[u.jsx(xt,{className:"cw-i spin"})," 等待授权…"]}):u.jsx(u.Fragment,{children:"去授权"})}),!e.authUri&&u.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),i&&u.jsx("div",{className:"auth-card-err",children:i})]})}function dL({blocks:e,appName:t="",onAction:n,onAuth:r}){return u.jsx(u.Fragment,{children:e.map((i,s)=>{switch(i.kind){case"thinking":return u.jsx(cL,{text:i.text,done:i.done},s);case"text":{const a=i.text.replace(/^\s+/,"");return a?u.jsx("div",{className:"bubble",children:u.jsx(rm,{text:a})},s):null}case"attachment":return u.jsx(PE,{appName:t,items:i.files},s);case"invocation":return u.jsx(ME,{value:i.value},s);case"tool":return i.name===lL&&i.done?null:u.jsx(FQ,{name:i.name,args:i.args,response:i.response,done:i.done},s);case"auth":return u.jsx(UQ,{block:i,onAuth:r},s);case"a2ui":return _I(i.messages).filter(a=>a.components[a.rootId]).map(a=>u.jsx(zt.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:u.jsx(QF,{surface:a,onAction:n})},`${s}-${a.surfaceId}`));default:return null}})})}function $Q(e){return e.isComposing||e.keyCode===229}function HQ({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:i,onChange:s,onSubmit:a,disabled:o,busy:l,showMeta:c,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,onInvocationChange:y,onAddFiles:v,onRemoveAttachment:g}){const E=_.useRef(null),b=_.useRef(null),w=_.useRef(null),N=_.useRef(null),[T,A]=_.useState(!1),[S,O]=_.useState(null),[I,D]=_.useState(0),[F,W]=_.useState(!1);async function j(){if(e)try{await navigator.clipboard.writeText(e),W(!0),setTimeout(()=>W(!1),1500)}catch{W(!1)}}_.useLayoutEffect(()=>{const V=E.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,200)}px`)},[i]);const $=d.some(V=>V.status!=="ready"),C=!o&&!l&&!$&&(i.trim().length>0||d.length>0),R=(S==null?void 0:S.query.toLocaleLowerCase())??"",L=(S==null?void 0:S.kind)==="skill"?f.filter(V=>!p.skills.some(Q=>Q.name===V.name)).filter(V=>`${V.name} ${V.description}`.toLocaleLowerCase().includes(R)).map(V=>({kind:"skill",value:V})):(S==null?void 0:S.kind)==="agent"?h.filter(V=>`${V.name} ${V.description}`.toLocaleLowerCase().includes(R)).map(V=>({kind:"agent",value:V})):[];function M(V){var Q;A(!1),O(null),(Q=V.current)==null||Q.click()}function k(V,Q){const re=V.slice(0,Q),le=/(^|\s)([/@])([^\s/@]*)$/.exec(re);if(!le){O(null);return}const K=le[2].length+le[3].length,q={kind:le[2]==="/"?"skill":"agent",query:le[3],start:Q-K,end:Q},ae=!S||S.kind!==q.kind||S.query!==q.query||S.start!==q.start||S.end!==q.end;O(q),ae&&D(0),A(!1)}function Y(V){if(!S)return;const Q=i.slice(0,S.start)+i.slice(S.end);s(Q),V.kind==="skill"?y({...p,skills:[...p.skills,V.value]}):y({skills:[],targetAgent:V.value});const re=S.start;O(null),requestAnimationFrame(()=>{var le,K;(le=E.current)==null||le.focus(),(K=E.current)==null||K.setSelectionRange(re,re)})}function G(){if(p.targetAgent){y({skills:[]});return}p.skills.length>0&&y({...p,skills:p.skills.slice(0,-1)})}function P(V){const Q=V.target.files?Array.from(V.target.files):[];Q.length&&v(Q),V.target.value=""}return u.jsxs("div",{className:"composer",children:[u.jsx(ME,{value:p,onRemoveSkill:V=>y({...p,skills:p.skills.filter(Q=>Q.name!==V)}),onRemoveAgent:()=>y({skills:[]})}),d.length>0&&u.jsx(PE,{appName:n,compact:!0,items:d,onRemove:g}),u.jsxs("div",{className:"composer-box",children:[S?u.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":S.kind==="skill"?"可用技能":"可用子 Agent",children:[u.jsxs("div",{className:"composer-command-head",children:[S.kind==="skill"?u.jsx(Aa,{}):u.jsx(vC,{}),u.jsx("span",{children:S.kind==="skill"?"调用技能":"使用子 Agent"}),u.jsx("kbd",{children:S.kind==="skill"?"/":"@"})]}),m?u.jsxs("div",{className:"composer-command-empty",children:[u.jsx(xt,{className:"spin"})," 正在读取 Agent 能力…"]}):L.length===0?u.jsx("div",{className:"composer-command-empty",children:S.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):u.jsx("div",{className:"composer-command-list",children:L.map((V,Q)=>u.jsxs("button",{type:"button",role:"option","aria-selected":Q===I,className:`composer-command-item${Q===I?" is-active":""}`,onMouseDown:re=>{re.preventDefault(),Y(V)},onMouseEnter:()=>D(Q),children:[u.jsx("span",{className:`composer-command-icon composer-command-icon--${V.kind}`,children:V.kind==="skill"?u.jsx(Aa,{}):u.jsx(ka,{})}),u.jsxs("span",{className:"composer-command-copy",children:[u.jsxs("strong",{children:[V.kind==="skill"?"/":"@",V.value.name]}),u.jsx("span",{children:V.value.description||(V.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),u.jsx("kbd",{children:Q===I?"↵":V.kind==="skill"?"技能":"Agent"})]},`${V.kind}-${V.value.name}`))})]}):null,u.jsxs("div",{className:"composer-menu-wrap",children:[u.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o,onClick:()=>{O(null),A(V=>!V)},children:u.jsx(li,{className:"icon"})}),T&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>A(!1)}),u.jsxs("div",{className:"composer-menu",role:"menu",children:[u.jsxs("button",{type:"button",className:"menu-item",onClick:()=>M(b),children:[u.jsx(IC,{className:"icon"}),"上传图片"]}),u.jsxs("button",{type:"button",className:"menu-item",onClick:()=>M(w),children:[u.jsx(SC,{className:"icon"}),"上传文档或 PDF"]}),u.jsxs("button",{type:"button",className:"menu-item",onClick:()=>M(N),children:[u.jsx(kC,{className:"icon"}),"上传视频"]})]})]})]}),u.jsx("textarea",{ref:E,className:"comp-input scroll",rows:1,value:i,disabled:o,placeholder:o?"请选择 Agent":`向 ${r} 发消息…`,"aria-expanded":!!S,onChange:V=>{s(V.target.value),k(V.target.value,V.target.selectionStart)},onSelect:V=>k(V.currentTarget.value,V.currentTarget.selectionStart),onBlur:()=>setTimeout(()=>O(null),0),onKeyDown:V=>{if(!$Q(V.nativeEvent)){if(S){if(V.key==="ArrowDown"&&L.length>0){V.preventDefault(),D(Q=>(Q+1)%L.length);return}if(V.key==="ArrowUp"&&L.length>0){V.preventDefault(),D(Q=>(Q-1+L.length)%L.length);return}if((V.key==="Enter"||V.key==="Tab")&&L[I]){V.preventDefault(),Y(L[I]);return}if(V.key==="Escape"){V.preventDefault(),O(null);return}}if(V.key==="Backspace"&&!i&&V.currentTarget.selectionStart===0&&V.currentTarget.selectionEnd===0){G();return}V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),C&&a())}}}),u.jsx(zt.button,{type:"button",className:"comp-send",disabled:!C,onClick:a,"aria-label":"发送",whileTap:C?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:l?u.jsx(xt,{className:"icon spin"}):u.jsx(xC,{className:"icon"})})]}),c&&u.jsxs("div",{className:"composer-meta",children:[u.jsxs("span",{className:"composer-session-line",children:["会话 ID:",u.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&u.jsx("button",{type:"button",className:"composer-session-copy",title:F?"已复制":"复制会话 ID","aria-label":F?"已复制会话 ID":"复制会话 ID",onClick:()=>void j(),children:F?u.jsx(Ai,{}):u.jsx(Vb,{})})]}),u.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),u.jsx("span",{children:"回答仅供参考"})]}),u.jsx("input",{ref:b,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:P}),u.jsx("input",{ref:w,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:P}),u.jsx("input",{ref:N,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:P})]})}function fL({title:e,sub:t,cards:n,footer:r}){return u.jsxs("div",{className:"stk",children:[u.jsxs("div",{className:"stk-head",children:[u.jsx("h1",{className:"stk-title",children:e}),t&&u.jsx("p",{className:"stk-sub",children:t})]}),u.jsx("div",{className:"stk-list",children:n.map((i,s)=>u.jsxs(zt.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:s*.04},children:[u.jsx("span",{className:"stk-card-icon",children:u.jsx(i.icon,{})}),u.jsxs("span",{className:"stk-card-text",children:[u.jsx("span",{className:"stk-card-title",children:i.title}),u.jsx("span",{className:"stk-card-desc",children:i.desc})]}),u.jsx(rr,{className:"stk-card-arrow"})]},i.key))}),r&&u.jsx("div",{className:"stk-footer",children:r})]})}const jE=Symbol.for("yaml.alias"),Gy=Symbol.for("yaml.document"),Ls=Symbol.for("yaml.map"),hL=Symbol.for("yaml.pair"),ki=Symbol.for("yaml.scalar"),Ol=Symbol.for("yaml.seq"),Kr=Symbol.for("yaml.node.type"),Rl=e=>!!e&&typeof e=="object"&&e[Kr]===jE,cd=e=>!!e&&typeof e=="object"&&e[Kr]===Gy,ud=e=>!!e&&typeof e=="object"&&e[Kr]===Ls,pn=e=>!!e&&typeof e=="object"&&e[Kr]===hL,Pt=e=>!!e&&typeof e=="object"&&e[Kr]===ki,dd=e=>!!e&&typeof e=="object"&&e[Kr]===Ol;function fn(e){if(e&&typeof e=="object")switch(e[Kr]){case Ls:case Ol:return!0}return!1}function hn(e){if(e&&typeof e=="object")switch(e[Kr]){case jE:case Ls:case ki:case Ol:return!0}return!1}const pL=e=>(Pt(e)||fn(e))&&!!e.anchor,na=Symbol("break visit"),zQ=Symbol("skip children"),Yc=Symbol("remove node");function Ll(e,t){const n=VQ(t);cd(e)?So(null,e.contents,n,Object.freeze([e]))===Yc&&(e.contents=null):So(null,e,n,Object.freeze([]))}Ll.BREAK=na;Ll.SKIP=zQ;Ll.REMOVE=Yc;function So(e,t,n,r){const i=KQ(e,t,n,r);if(hn(i)||pn(i))return YQ(e,r,i),So(e,i,n,r);if(typeof i!="symbol"){if(fn(t)){r=Object.freeze(r.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>WQ[t]);class er{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},er.defaultYaml,t),this.tags=Object.assign({},er.defaultTags,n)}clone(){const t=new er(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new er(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:er.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},er.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:er.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},er.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,a]=r;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,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[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+qQ(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(t&&r.length>0&&hn(t.contents)){const s={};Ll(t.contents,(a,o)=>{hn(o)&&o.tag&&(s[o.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,a]of r)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(o=>o.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(` -`)}}er.defaultYaml={explicit:!1,version:"1.2"};er.defaultTags={"!!":"tag:yaml.org,2002:"};function mL(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 gL(e){const t=new Set;return Ll(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function yL(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function GQ(e,t){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=gL(e));const a=yL(t,i);return i.add(a),a},setAnchors:()=>{for(const s of n){const a=r.get(s);if(typeof a=="object"&&a.anchor&&(Pt(a.node)||fn(a.node)))a.node.anchor=a.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:r}}function ko(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i$r(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!pL(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,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 BE{constructor(t){Object.defineProperty(this,Kr,{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:r,onAnchor:i,reviver:s}={}){if(!cd(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 r=="number"?r:100},o=$r(this,"",a);if(typeof i=="function")for(const{count:l,res:c}of a.anchors.values())i(c,l);return typeof s=="function"?ko(s,{"":o},"",o):o}}class FE extends BE{constructor(t){super(jE),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 r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Ll(t,{Node:(s,a)=>{(Rl(a)||pL(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,a=this.resolve(i,n);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=r.get(a);if(o||($r(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Gf(i,a,r)),o.count*o.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(mL(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}}function Gf(e,t,n){if(Rl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(fn(t)){let r=0;for(const i of t.items){const s=Gf(e,i,n);s>r&&(r=s)}return r}else if(pn(t)){const r=Gf(e,t.key,n),i=Gf(e,t.value,n);return Math.max(r,i)}return 1}const bL=e=>!e||typeof e!="function"&&typeof e!="object";class Ye extends BE{constructor(t){super(ki),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:$r(this.value,t,n)}toString(){return String(this.value)}}Ye.BLOCK_FOLDED="BLOCK_FOLDED";Ye.BLOCK_LITERAL="BLOCK_LITERAL";Ye.PLAIN="PLAIN";Ye.QUOTE_DOUBLE="QUOTE_DOUBLE";Ye.QUOTE_SINGLE="QUOTE_SINGLE";const XQ="tag:yaml.org,2002:";function QQ(e,t,n){if(t){const r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,e))&&!r.format})}function Au(e,t,n){var f,h,p;if(cd(e)&&(e=e.contents),hn(e))return e;if(pn(e)){const m=(h=(f=n.schema[Ls]).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:r,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=n;let l;if(r&&e&&typeof e=="object"){if(l=o.get(e),l)return l.anchor??(l.anchor=i(e)),new FE(l.anchor);l={anchor:null,node:null},o.set(e,l)}t!=null&&t.startsWith("!!")&&(t=XQ+t.slice(2));let c=QQ(e,t,a.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Ye(e);return l&&(l.node=m),m}c=e instanceof Map?a[Ls]:Symbol.iterator in Object(e)?a[Ol]:a[Ls]}s&&(s(c),delete n.onTagObj);const d=c!=null&&c.createNode?c.createNode(n.schema,e,n):typeof((p=c==null?void 0:c.nodeClass)==null?void 0:p.from)=="function"?c.nodeClass.from(n.schema,e,n):new Ye(e);return t?d.tag=t:c.default||(d.tag=c.tag),l&&(l.node=d),d}function ep(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=r,r=a}else r=new Map([[s,r]])}return Au(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const yc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class EL extends BE{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(r=>hn(r)||pn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(yc(t))this.add(n);else{const[r,...i]=t,s=this.get(r,!0);if(fn(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,ep(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(fn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&Pt(s)?s.value:s:fn(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!pn(n))return!1;const r=n.value;return r==null||t&&Pt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return fn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(fn(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,ep(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const ZQ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Hi(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const da=(e,t,n)=>e.endsWith(` -`)?Hi(n,t):n.includes(` +`))}function l(p,m,y,v){const g=y.enter("tableCell"),E=y.enter("phrasing"),b=y.containerPhrasing(p,{...v,before:s,after:s});return E(),g(),b}function c(p,m){return vV(p,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function d(p,m,y){const v=p.children;let g=-1;const E=[],b=m.enter("table");for(;++g0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const NK={tokenize:LK,partial:!0};function SK(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:IK,continuation:{tokenize:RK},exit:OK}},text:{91:{name:"gfmFootnoteCall",tokenize:CK},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:kK,resolveTo:AK}}}}function kK(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!a||!a._balanced)return n(l);const c=fi(r.sliceSerialize({start:a.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function AK(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 r={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 s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function CK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(s>999||f===93&&!a||f===null||f===91||kt(f))return n(f);if(f===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(fi(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return kt(f)||(a=!0),s++,e.consume(f),f===92?d:c}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,c):c(f)}}function IK(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(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&&!o||m===null||m===91||kt(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return s=fi(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return kt(m)||(o=!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(s)||i.push(s),lt(e,p,"gfmFootnoteDefinitionWhitespace")):n(m)}function p(m){return t(m)}}function RK(e,t,n){return e.check(od,t,e.attempt(NK,t,n))}function OK(e){e.exit("gfmFootnoteDefinition")}function LK(e,t,n){const r=this;return lt(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function MK(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l1?l(m):(a.consume(m),f++,p);if(f<2&&!n)return l(m);const v=a.exit("strikethroughSequenceTemporary"),g=ll(m);return v._open=!g||g===2&&!!y,v._close=!y||y===2&&!!g,o(m)}}}class DK{constructor(){this.map=[]}add(t,n,r){PK(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function PK(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const j=r.events[D][1].type;if(j==="lineEnding"||j==="linePrefix")D--;else break}const F=D>-1?r.events[D][1].type:null,W=F==="tableHead"||F==="tableRow"?T:l;return W===T&&r.parser.lazy[r.now().line]?n(I):W(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),c(I)}function c(I){return I===124||(a=!0,s+=1),d(I)}function d(I){return I===null?n(I):Be(I)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),p):n(I):et(I)?lt(e,d,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||kt(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?h:f)}function h(I){return I===92||I===124?(e.consume(I),f):f(I)}function p(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,et(I)?lt(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):m(I))}function m(I){return I===45||I===58?v(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):N(I)}function y(I){return et(I)?lt(e,v,"whitespace")(I):v(I)}function v(I){return I===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),g):I===45?(s+=1,g(I)):I===null||Be(I)?w(I):N(I)}function g(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):N(I)}function E(I){return I===45?(e.consume(I),E):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(I))}function b(I){return et(I)?lt(e,w,"whitespace")(I):w(I)}function w(I){return I===124?m(I):I===null||Be(I)?!a||i!==s?N(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):N(I)}function N(I){return n(I)}function T(I){return e.enter("tableRow"),A(I)}function A(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),A):I===null||Be(I)?(e.exit("tableRow"),t(I)):et(I)?lt(e,A,"whitespace")(I):(e.enter("data"),S(I))}function S(I){return I===null||I===124||kt(I)?(e.exit("data"),A(I)):(e.consume(I),I===92?R:S)}function R(I){return I===92||I===124?(e.consume(I),S):S(I)}}function UK(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,c,d,f;const h=new DK;for(;++nn[2]+1){const m=n[2]+1,y=n[3]-n[2]-1;e.add(m,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(s.end=Object.assign({},lo(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function uT(e,t,n,r,i){const s=[],a=lo(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function lo(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const $K={name:"tasklistCheck",tokenize:zK};function HK(){return{text:{91:$K}}}function zK(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return kt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return Be(l)?t(l):et(l)?e.check({tokenize:VK},t,n)(l):n(l)}}function VK(e,t,n){return lt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function KK(e){return zI([gK(),SK(),MK(e),BK(),HK()])}const YK={};function WK(e){const t=this,n=e||YK,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(KK(n)),s.push(fK()),a.push(hK(n))}const dT=function(e,t,n){const r=ld(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(;++tc&&(c=d):d&&(c!==void 0&&c>-1&&l.push(` +`.repeat(c)||" "),c=-1,l.push(d))}return l.join("")}function PR(e,t,n){return e.type==="element"?tY(e,t,n):e.type==="text"?n.whitespace==="normal"?jR(e,n):nY(e):[]}function tY(e,t,n){const r=BR(e,n),i=e.children||[];let s=-1,a=[];if(JK(e))return a;let o,l;for(Vy(e)||mT(e)&&dT(t,e,mT)?l=` +`:ZK(e)?(o=2,l=2):DR(e)&&(o=1,l=1);++s]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={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(c,{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"],y=["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"],g=["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:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,c],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:T.concat([{begin:/\(/,end:/\)/,keywords:w,contains:T.concat(["self"]),relevance:0}]),relevance:0},S={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,o]}]},o,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",o]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function cY(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=lY(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function FR(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=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"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(o);const l={match:/\\"/},c={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},y=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],g={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["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"],N=["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:y,literal:v,built_in:[...E,...b,"set","shopt",...w,...N]},contains:[p,e.SHEBANG(),m,f,s,a,g,o,l,c,d,n]}}function uY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={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(c,{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"},g=[f,o,n,e.C_BLOCK_COMMENT_MODE,d,c],E={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:g.concat([{begin:/\(/,end:/\)/,keywords:v,contains:g.concat(["self"]),relevance:0}]),relevance:0},b={begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,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,c,d,o,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,o]}]},o,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:c,keywords:v}}}function dY(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={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(c,{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"],y=["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"],g=["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:y,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},N={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[N,f,o,n,e.C_BLOCK_COMMENT_MODE,d,c],A={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:T.concat([{begin:/\(/,end:/\)/,keywords:w,contains:T.concat(["self"]),relevance:0}]),relevance:0},S={className:"function",begin:"("+a+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:p,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,o,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,o]}]},o,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",o]},{begin:e.IDENT_RE+"::",keywords:w},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function fY(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"],r=["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"],s=["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(s),built_in:t,literal:r},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={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},c={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]},y={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},v=e.inherit(y,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});h.contains=[y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],p.contains=[v,m,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[c,y,m,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},b=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"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,E,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:"("+b+"\\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,E],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[g,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}}const hY=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_-]*/}}),pY=["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"],mY=["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"],gY=[...pY,...mY],yY=["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(),bY=["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(),EY=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),xY=["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 vY(e){const t=e.regex,n=hY(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[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,r,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:":("+bY.join("|")+")"},{begin:":(:)?("+EY.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+xY.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:yY.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+gY.join("|")+")\\b"}]}}function wY(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 _Y(e){const s={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:s,illegal:"$R(e,t,n-1))}function NY(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+$R("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),l={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"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,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:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,gT,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},gT,c]}}const yT="[A-Za-z$_][0-9A-Za-z$_]*",SY=["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"],kY=["true","false","null","undefined","NaN","Infinity"],HR=["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"],zR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],VR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],AY=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],CY=[].concat(VR,HR,zR);function KR(e){const t=e.regex,n=(L,{after:M})=>{const k="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,M)=>{const k=L[0].length+L.index,Y=L.input[k];if(Y==="<"||Y===","){M.ignoreMatch();return}Y===">"&&(n(L,{after:k})||M.ignoreMatch());let G;const P=L.input.substring(k);if(G=P.match(/^\s*=/)){M.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){M.ignoreMatch();return}}},o={$pattern:yT,keyword:SY,literal:kY,built_in:CY,"variable.language":AY},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\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:o,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"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const w=[].concat(E,h.contains),N=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},S={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:{_:[...HR,...zR]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,F([...VR,"super","import"].map(L=>`${L}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,E,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,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:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},W,D,A,$,{match:/\$[(.]/}]}}function YR(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},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 uo="[0-9](_*[0-9])*",of=`\\.(${uo})`,lf="[0-9a-fA-F](_*[0-9a-fA-F])*",IY={className:"number",variants:[{begin:`(\\b(${uo})((${of})|\\.)?|(${of}))[eE][+-]?(${uo})[fFdD]?\\b`},{begin:`\\b(${uo})((${of})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${of})[fFdD]?\\b`},{begin:`\\b(${uo})[fFdD]\\b`},{begin:`\\b0[xX]((${lf})\\.?|(${lf})?\\.(${lf}))[pP][+-]?(${uo})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${lf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function RY(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+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(a);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=IY,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,r,o,l,{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,o,l,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},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},c]}}const OY=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_-]*/}}),LY=["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"],MY=["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"],DY=[...LY,...MY],PY=["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(),WR=["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(),qR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),jY=["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(),BY=WR.concat(qR).sort().reverse();function FY(e){const t=OY(e),n=BY,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",a=[],o=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},c=function(b,w,N){return{className:b,begin:w,relevance:N}},d={$pattern:/[a-z-]+/,keyword:r,attribute:PY.join(" ")},f={begin:"\\(",end:"\\)",contains:o,keywords:d,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,f,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const h=o.concat({begin:/\{/,end:/\}/,contains:a}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},m={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+jY.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},y={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:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:h}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+DY.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+WR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+qR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:h},{begin:"!important"},t.FUNCTION_DISPATCH]},E={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,y,v,E,m,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}function UY(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],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:[r],relevance:5}])}}function GR(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={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}]},s={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}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),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}]},c={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(c,{contains:[]}),h=e.inherit(d,{contains:[]});c.contains.push(h),d.contains.push(f);let p=[n,l];return[c,d,f,h].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(c,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,s,c,d,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function $Y(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_]*/,o={"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"]},l={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function HY(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"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},c={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,s,l],f=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],h=(y,v,g="\\1")=>{const E=g==="\\1"?g:t.concat(g,v);return t.concat(t.concat("(?:",y,")"),v,/(?:\\.|[^\\\/])*?/,E,/(?:\\.|[^\\\/])*?/,g,r)},p=(y,v,g)=>t.concat(t.concat("(?:",y,")"),v,/(?:\\.|[^\\\/])*?/,g,r),m=[l,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}]},c,{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,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=m,a.contains=m,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:m}}function zY(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=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),s=t.concat(/[A-Z]+/,n),a={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(j,$)=>{$.data._beginMatch=j[1]||j[2]},"on:end":(j,$)=>{$.data._beginMatch!==j[1]&&$.ignoreMatch()}},h=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ +]`,m={scope:"string",variants:[d,c,f,h]},y={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"],g=["__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"],E=["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:g,literal:(j=>{const $=[];return j.forEach(C=>{$.push(C),C.toLowerCase()===C?$.push(C.toUpperCase()):$.push(C.toLowerCase())}),$})(v),built_in:E},N=j=>j.map($=>$.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",N(E).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},A=t.concat(r,"\\b(?!\\()"),S={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),A],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),A],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"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},I={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[R,a,S,e.C_BLOCK_COMMENT_MODE,m,y,T]},D={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",N(g).join("\\b|"),"|",N(E).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[I]};I.contains.push(D);const F=[R,S,e.C_BLOCK_COMMENT_MODE,m,y,T],W={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:w,contains:[W,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}]}},o,{scope:"variable.language",match:/\$this\b/},a,D,S,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{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",W,a,S,e.C_BLOCK_COMMENT_MODE,m,y]}]},{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,y]}}function VY(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 KY(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function QR(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["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"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,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"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,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,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,d,c]},{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,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",p=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,m=`\\b|${r.join("|")}`,y={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:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,y,f,e.HASH_COMMENT_MODE]}]};return c.contains=[f,y,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,y,{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:[g]},{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:[y,g,f]}]}}function YY(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function WY(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=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=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=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,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function qY(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\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"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],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"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},T=[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:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{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(l,c),relevance:0}].concat(l,c);d.contains=T,y.contains=T;const I=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:T}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(I).concat(c).concat(T)}}function GY(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),s={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))?",o=["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"],l=["true","false","Some","None","Ok","Err"],c=["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:o,literal:l,built_in:c},illegal:""},s]}}const XY=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_-]*/}}),QY=["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"],ZY=["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"],JY=[...QY,...ZY],eW=["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(),tW=["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(),nW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rW=["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 iW(e){const t=XY(e),n=nW,r=tW,i="@[a-z-]+",s="and or not only",o={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("+JY.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rW.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,o,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:s,attribute:eW.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function sW(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function aW(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["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"],l=["add","asc","collation","desc","final","first","last","view"],c=["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=[...c,...l].filter(N=>!d.includes(N)),y={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function E(N){return t.concat(/\b/,t.either(...N.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const b={scope:"keyword",match:E(h),relevance:0};function w(N,{exceptions:T,when:A}={}){const S=A;return T=T||[],N.map(R=>R.match(/\|\d+$/)||T.includes(R)?R:S(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:w(m,{when:N=>N.length<3}),literal:s,type:o,built_in:f},contains:[{scope:"type",match:E(a)},b,g,y,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function ZR(e){return e?typeof e=="string"?e:e.source:null}function sc(e){return _t("(?=",e,")")}function _t(...e){return e.map(n=>ZR(n)).join("")}function oW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function nr(...e){return"("+(oW(e).capture?"":"?:")+e.map(r=>ZR(r)).join("|")+")"}const TE=e=>_t(/\b/,e,/\w$/.test(e)?/\b/:/\B/),lW=["Protocol","Type"].map(TE),bT=["init","self"].map(TE),cW=["Any","Self"],Og=["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"],ET=["false","nil","true"],uW=["assignment","associativity","higherThan","left","lowerThan","none","right"],dW=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],xT=["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"],JR=nr(/[/=\-+!*%<>&|^~?]/,/[\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]/),eO=nr(JR,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Lg=_t(JR,eO,"*"),tO=nr(/[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]/),Xh=nr(tO,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),vi=_t(tO,Xh,"*"),cf=_t(/[A-Z]/,Xh,"*"),fW=["attached","autoclosure",_t(/convention\(/,nr("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",_t(/objc\(/,vi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],hW=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function pW(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,nr(...lW,...bT)],className:{2:"keyword"}},s={match:_t(/\./,nr(...Og)),relevance:0},a=Og.filter(xe=>typeof xe=="string").concat(["_|0"]),o=Og.filter(xe=>typeof xe!="string").concat(cW).map(TE),l={variants:[{className:"keyword",match:nr(...o,...bT)}]},c={$pattern:nr(/\b\w+/,/#\w+/),keyword:a.concat(dW),literal:ET},d=[i,s,l],f={match:_t(/\./,nr(...xT)),relevance:0},h={className:"built_in",match:_t(/\b/,nr(...xT),/(?=\()/)},p=[f,h],m={match:/->/,relevance:0},y={className:"operator",relevance:0,variants:[{match:Lg},{match:`\\.(\\.|${eO})+`}]},v=[m,y],g="([0-9]_*)+",E="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${E})(\\.(${E}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},w=(xe="")=>({className:"subst",variants:[{match:_t(/\\/,xe,/[0\\tnr"']/)},{match:_t(/\\/,xe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),N=(xe="")=>({className:"subst",match:_t(/\\/,xe,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(xe="")=>({className:"subst",label:"interpol",begin:_t(/\\/,xe,/\(/),end:/\)/}),A=(xe="")=>({begin:_t(xe,/"""/),end:_t(/"""/,xe),contains:[w(xe),N(xe),T(xe)]}),S=(xe="")=>({begin:_t(xe,/"/),end:_t(/"/,xe),contains:[w(xe),T(xe)]}),R={className:"string",variants:[A(),A("#"),A("##"),A("###"),S(),S("#"),S("##"),S("###")]},I=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],D={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:I},F=xe=>{const je=_t(xe,/\//),be=_t(/\//,xe);return{begin:je,end:be,contains:[...I,{scope:"comment",begin:`#(?!.*${be})`,end:/$/}]}},W={scope:"regexp",variants:[F("###"),F("##"),F("#"),D]},j={match:_t(/`/,vi,/`/)},$={className:"variable",match:/\$\d+/},C={className:"variable",match:`\\$${Xh}+`},O=[j,$,C],L={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:hW,contains:[...v,b,R]}]}},M={scope:"keyword",match:_t(/@/,nr(...fW),sc(nr(/\(/,/\s+/)))},k={scope:"meta",match:_t(/@/,vi)},Y=[L,M,k],G={match:sc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:_t(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Xh,"+")},{className:"type",match:cf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:_t(/\s+&\s+/,sc(cf)),relevance:0}]},P={begin://,keywords:c,contains:[...r,...d,...Y,m,G]};G.contains.push(P);const V={match:_t(vi,/\s*:/),keywords:"_|0",relevance:0},Q={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",V,...r,W,...d,...p,...v,b,R,...O,...Y,G]},ne={begin://,keywords:"repeat each",contains:[...r,G]},le={begin:nr(sc(_t(vi,/\s*:/)),sc(_t(vi,/\s+/,vi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:vi}]},K={begin:/\(/,end:/\)/,keywords:c,contains:[le,...r,...d,...v,b,R,...Y,G,Q],endsParent:!0,illegal:/["']/},q={match:[/(func|macro)/,/\s+/,nr(j.match,vi,Lg)],className:{1:"keyword",3:"title.function"},contains:[ne,K,t],illegal:[/\[/,/%/]},ae={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ne,K,t],illegal:/\[|%/},ye={match:[/operator/,/\s+/,Lg],className:{1:"keyword",3:"title"}},he={begin:[/precedencegroup/,/\s+/,cf],className:{1:"keyword",3:"title"},contains:[G],keywords:[...uW,...ET],end:/}/},de={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ie={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},_e={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,vi,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[ne,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:cf},...d],relevance:0}]};for(const xe of R.variants){const je=xe.contains.find(Ve=>Ve.label==="interpol");je.keywords=c;const be=[...d,...p,...v,b,R,...O];je.contains=[...be,{begin:/\(/,end:/\)/,contains:["self",...be]}]}return{name:"Swift",keywords:c,contains:[...r,q,ae,de,Ie,_e,ye,he,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},W,...d,...p,...v,b,R,...O,...Y,G,Q]}}const Qh="[A-Za-z$_][0-9A-Za-z$_]*",nO=["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"],rO=["true","false","null","undefined","NaN","Infinity"],iO=["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"],sO=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],aO=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],oO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],lO=[].concat(aO,iO,sO);function mW(e){const t=e.regex,n=(L,{after:M})=>{const k="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,M)=>{const k=L[0].length+L.index,Y=L.input[k];if(Y==="<"||Y===","){M.ignoreMatch();return}Y===">"&&(n(L,{after:k})||M.ignoreMatch());let G;const P=L.input.substring(k);if(G=P.match(/^\s*=/)){M.ignoreMatch();return}if((G=P.match(/^\s+extends\s+/))&&G.index===0){M.ignoreMatch();return}}},o={$pattern:Qh,keyword:nO,literal:rO,built_in:lO,"variable.language":oO},l="[0-9](_?[0-9])*",c=`\\.(${l})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",f={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\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:o,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"}},y={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,h]},E={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,{match:/\$\d+/},f];h.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});const w=[].concat(E,h.contains),N=w.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(w)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:N},A={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},S={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:{_:[...iO,...sO]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},I={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(L){return t.concat("(?!",L.join("|"),")")}const W={match:t.concat(/\b/,F([...aO,"super","import"].map(L=>`${L}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},j={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",O={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:N,CLASS_REFERENCE:S},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,y,v,E,{match:/\$\d+/},f,S,{scope:"attr",match:r+t.lookahead(":"),relevance:0},O,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,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:o,contains:N}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},I,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},j,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},W,D,A,$,{match:/\$[(.]/}]}}function cO(e){const t=e.regex,n=mW(e),r=Qh,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={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]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Qh,keyword:nO.concat(l),literal:rO,built_in:lO.concat(i),"variable.language":oO},d={className:"meta",begin:"@"+r},f=(y,v,g)=>{const E=y.contains.findIndex(b=>b.label===v);if(E===-1)throw new Error("can not find mode to replace");y.contains.splice(E,1,g)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(d);const h=n.contains.find(y=>y.scope==="attr"),p=Object.assign({},h,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,h,p]),n.contains=n.contains.concat([d,s,a,p]),f(n,"shebang",e.SHEBANG()),f(n,"use_strict",o);const m=n.contains.find(y=>y.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function gW(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,i),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(s,i),/ +/,t.either(a,o),/ *#/)}]},c={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,r,l,c,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 yW(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["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"}},s={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={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/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={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:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,a,i,e.QUOTE_STRING_MODE,l,c,o]}}function bW(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(s,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={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:[s,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,a,l,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],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:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function uO(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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]},o=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},y={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},v=[r,{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,y,s,a],g=[...v];return g.pop(),g.push(o),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const EW={arduino:cY,bash:FR,c:uY,cpp:dY,csharp:fY,css:vY,diff:wY,go:_Y,graphql:TY,ini:UR,java:NY,javascript:KR,json:YR,kotlin:RY,less:FY,lua:UY,makefile:GR,markdown:XR,objectivec:$Y,perl:HY,php:zY,"php-template":VY,plaintext:KY,python:QR,"python-repl":YY,r:WY,ruby:qY,rust:GY,scss:iW,shell:sW,sql:aW,swift:pW,typescript:cO,vbnet:gW,wasm:yW,xml:bW,yaml:uO};function dO(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],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&dO(n)}),e}let vT=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function fO(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function ks(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const xW="",wT=e=>!!e.scope,vW=(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((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class wW{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=fO(t)}openNode(t){if(!wT(t))return;const n=vW(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){wT(t)&&(this.buffer+=xW)}value(){return this.buffer}span(t){this.buffer+=``}}const _T=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class NE{constructor(){this.rootNode=_T(),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=_T({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(r=>this._walk(t,r)),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=>{NE._collapse(n)}))}}class _W extends NE{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new wW(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Iu(e){return e?typeof e=="string"?e:e.source:null}function hO(e){return Ga("(?=",e,")")}function TW(e){return Ga("(?:",e,")*")}function NW(e){return Ga("(?:",e,")?")}function Ga(...e){return e.map(n=>Iu(n)).join("")}function SW(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function SE(...e){return"("+(SW(e).capture?"":"?:")+e.map(r=>Iu(r)).join("|")+")"}function pO(e){return new RegExp(e.toString()+"|").exec("").length-1}function kW(e,t){const n=e&&e.exec(t);return n&&n.index===0}const AW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function kE(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let s=Iu(r),a="";for(;s.length>0;){const o=AW.exec(s);if(!o){a+=s;break}a+=s.substring(0,o.index),s=s.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+i):(a+=o[0],o[0]==="("&&n++)}return a}).map(r=>`(${r})`).join(t)}const CW=/\b\B/,mO="[a-zA-Z]\\w*",AE="[a-zA-Z_]\\w*",gO="\\b\\d+(\\.\\d+)?",yO="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",bO="\\b(0b[01]+)",IW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",RW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Ga(t,/.*\b/,e.binary,/\b.*/)),ks({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Ru={begin:"\\\\[\\s\\S]",relevance:0},OW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ru]},LW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ru]},MW={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/},Jp=function(e,t,n={}){const r=ks({scope:"comment",begin:e,end:t,contains:[]},n);r.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=SE("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 r.contains.push({begin:Ga(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},DW=Jp("//","$"),PW=Jp("/\\*","\\*/"),jW=Jp("#","$"),BW={scope:"number",begin:gO,relevance:0},FW={scope:"number",begin:yO,relevance:0},UW={scope:"number",begin:bO,relevance:0},$W={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ru,{begin:/\[/,end:/\]/,relevance:0,contains:[Ru]}]},HW={scope:"title",begin:mO,relevance:0},zW={scope:"title",begin:AE,relevance:0},VW={begin:"\\.\\s*"+AE,relevance:0},KW=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 uf=Object.freeze({__proto__:null,APOS_STRING_MODE:OW,BACKSLASH_ESCAPE:Ru,BINARY_NUMBER_MODE:UW,BINARY_NUMBER_RE:bO,COMMENT:Jp,C_BLOCK_COMMENT_MODE:PW,C_LINE_COMMENT_MODE:DW,C_NUMBER_MODE:FW,C_NUMBER_RE:yO,END_SAME_AS_BEGIN:KW,HASH_COMMENT_MODE:jW,IDENT_RE:mO,MATCH_NOTHING_RE:CW,METHOD_GUARD:VW,NUMBER_MODE:BW,NUMBER_RE:gO,PHRASAL_WORDS_MODE:MW,QUOTE_STRING_MODE:LW,REGEXP_MODE:$W,RE_STARTERS_RE:IW,SHEBANG:RW,TITLE_MODE:HW,UNDERSCORE_IDENT_RE:AE,UNDERSCORE_TITLE_MODE:zW});function YW(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function WW(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function qW(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=YW,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function GW(e,t){Array.isArray(e.illegal)&&(e.illegal=SE(...e.illegal))}function XW(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 QW(e,t){e.relevance===void 0&&(e.relevance=1)}const ZW=(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(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Ga(n.beforeMatch,hO(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},JW=["of","and","for","in","not","or","if","then","parent","list","value"],eq="keyword";function EO(e,t,n=eq){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(s){Object.assign(r,EO(e[s],t,s))}),r;function i(s,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){const l=o.split("|");r[l[0]]=[s,tq(l[0],l[1])]})}}function tq(e,t){return t?Number(t):nq(e)?0:1}function nq(e){return JW.includes(e.toLowerCase())}const TT={},Ta=e=>{console.error(e)},NT=(e,...t)=>{console.log(`WARN: ${e}`,...t)},to=(e,t)=>{TT[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),TT[`${e}/${t}`]=!0)},Zh=new Error;function xO(e,t,{key:n}){let r=0;const i=e[n],s={},a={};for(let o=1;o<=t.length;o++)a[o+r]=i[o],s[o+r]=!0,r+=pO(t[o-1]);e[n]=a,e[n]._emit=s,e[n]._multi=!0}function rq(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ta("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Zh;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ta("beginScope must be object"),Zh;xO(e,e.begin,{key:"beginScope"}),e.begin=kE(e.begin,{joinWith:""})}}function iq(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ta("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Zh;if(typeof e.endScope!="object"||e.endScope===null)throw Ta("endScope must be object"),Zh;xO(e,e.end,{key:"endScope"}),e.end=kE(e.end,{joinWith:""})}}function sq(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function aq(e){sq(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),rq(e),iq(e)}function oq(e){function t(a,o){return new RegExp(Iu(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=pO(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const o=this.regexes.map(l=>l[1]);this.matcherRe=t(kE(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(o);if(!l)return null;const c=l.findIndex((f,h)=>h>0&&f!==void 0),d=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,d)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];const l=new n;return this.rules.slice(o).forEach(([c,d])=>l.addRule(c,d)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(o);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,c=d.exec(o)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(a){const o=new r;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function s(a,o){const l=a;if(a.isCompiled)return l;[WW,XW,aq,ZW].forEach(d=>d(a,o)),e.compilerExtensions.forEach(d=>d(a,o)),a.__beforeBegin=null,[qW,GW,QW].forEach(d=>d(a,o)),a.isCompiled=!0;let c=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),c=a.keywords.$pattern,delete a.keywords.$pattern),c=c||/\w+/,a.keywords&&(a.keywords=EO(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=Iu(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(d){return lq(d==="self"?a:d)})),a.contains.forEach(function(d){s(d,l)}),a.starts&&s(a.starts,o),l.matcher=i(l),l}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=ks(e.classNameAliases||{}),s(e)}function vO(e){return e?e.endsWithParent||vO(e.starts):!1}function lq(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ks(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:vO(e)?ks(e,{starts:e.starts?ks(e.starts):null}):Object.isFrozen(e)?ks(e):e}var cq="11.11.1";class uq extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Mg=fO,ST=ks,kT=Symbol("nomatch"),dq=7,wO=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:_W};function l(C){return o.noHighlightRe.test(C)}function c(C){let O=C.className+" ";O+=C.parentNode?C.parentNode.className:"";const L=o.languageDetectRe.exec(O);if(L){const M=S(L[1]);return M||(NT(s.replace("{}",L[1])),NT("Falling back to no-highlight mode for this block.",C)),M?L[1]:"no-highlight"}return O.split(/\s+/).find(M=>l(M)||S(M))}function d(C,O,L){let M="",k="";typeof O=="object"?(M=C,L=O.ignoreIllegals,k=O.language):(to("10.7.0","highlight(lang, code, ...args) has been deprecated."),to("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),k=C,M=O),L===void 0&&(L=!0);const Y={code:M,language:k};j("before:highlight",Y);const G=Y.result?Y.result:f(Y.language,Y.code,L);return G.code=Y.code,j("after:highlight",G),G}function f(C,O,L,M){const k=Object.create(null);function Y(z,X){return z.keywords[X]}function G(){if(!be.keywords){ke.addText(ce);return}let z=0;be.keywordPatternRe.lastIndex=0;let X=be.keywordPatternRe.exec(ce),oe="";for(;X;){oe+=ce.substring(z,X.index);const ve=_e.case_insensitive?X[0].toLowerCase():X[0],Ae=Y(be,ve);if(Ae){const[st,Xt]=Ae;if(ke.addText(oe),oe="",k[ve]=(k[ve]||0)+1,k[ve]<=dq&&(Nt+=Xt),st.startsWith("_"))oe+=X[0];else{const ze=_e.classNameAliases[st]||st;Q(X[0],ze)}}else oe+=X[0];z=be.keywordPatternRe.lastIndex,X=be.keywordPatternRe.exec(ce)}oe+=ce.substring(z),ke.addText(oe)}function P(){if(ce==="")return;let z=null;if(typeof be.subLanguage=="string"){if(!t[be.subLanguage]){ke.addText(ce);return}z=f(be.subLanguage,ce,!0,Ve[be.subLanguage]),Ve[be.subLanguage]=z._top}else z=p(ce,be.subLanguage.length?be.subLanguage:null);be.relevance>0&&(Nt+=z.relevance),ke.__addSublanguage(z._emitter,z.language)}function V(){be.subLanguage!=null?P():G(),ce=""}function Q(z,X){z!==""&&(ke.startScope(X),ke.addText(z),ke.endScope())}function ne(z,X){let oe=1;const ve=X.length-1;for(;oe<=ve;){if(!z._emit[oe]){oe++;continue}const Ae=_e.classNameAliases[z[oe]]||z[oe],st=X[oe];Ae?Q(st,Ae):(ce=st,G(),ce=""),oe++}}function le(z,X){return z.scope&&typeof z.scope=="string"&&ke.openNode(_e.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(Q(ce,_e.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),ce=""):z.beginScope._multi&&(ne(z.beginScope,X),ce="")),be=Object.create(z,{parent:{value:be}}),be}function K(z,X,oe){let ve=kW(z.endRe,oe);if(ve){if(z["on:end"]){const Ae=new vT(z);z["on:end"](X,Ae),Ae.isMatchIgnored&&(ve=!1)}if(ve){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return K(z.parent,X,oe)}function q(z){return be.matcher.regexIndex===0?(ce+=z[0],1):(it=!0,0)}function ae(z){const X=z[0],oe=z.rule,ve=new vT(oe),Ae=[oe.__beforeBegin,oe["on:begin"]];for(const st of Ae)if(st&&(st(z,ve),ve.isMatchIgnored))return q(X);return oe.skip?ce+=X:(oe.excludeBegin&&(ce+=X),V(),!oe.returnBegin&&!oe.excludeBegin&&(ce=X)),le(oe,z),oe.returnBegin?0:X.length}function ye(z){const X=z[0],oe=O.substring(z.index),ve=K(be,z,oe);if(!ve)return kT;const Ae=be;be.endScope&&be.endScope._wrap?(V(),Q(X,be.endScope._wrap)):be.endScope&&be.endScope._multi?(V(),ne(be.endScope,z)):Ae.skip?ce+=X:(Ae.returnEnd||Ae.excludeEnd||(ce+=X),V(),Ae.excludeEnd&&(ce=X));do be.scope&&ke.closeNode(),!be.skip&&!be.subLanguage&&(Nt+=be.relevance),be=be.parent;while(be!==ve.parent);return ve.starts&&le(ve.starts,z),Ae.returnEnd?0:X.length}function he(){const z=[];for(let X=be;X!==_e;X=X.parent)X.scope&&z.unshift(X.scope);z.forEach(X=>ke.openNode(X))}let de={};function Ie(z,X){const oe=X&&X[0];if(ce+=z,oe==null)return V(),0;if(de.type==="begin"&&X.type==="end"&&de.index===X.index&&oe===""){if(ce+=O.slice(X.index,X.index+1),!i){const ve=new Error(`0 width match regex (${C})`);throw ve.languageName=C,ve.badRule=de.rule,ve}return 1}if(de=X,X.type==="begin")return ae(X);if(X.type==="illegal"&&!L){const ve=new Error('Illegal lexeme "'+oe+'" for mode "'+(be.scope||"")+'"');throw ve.mode=be,ve}else if(X.type==="end"){const ve=ye(X);if(ve!==kT)return ve}if(X.type==="illegal"&&oe==="")return ce+=` +`,1;if(xt>1e5&&xt>X.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ce+=oe,oe.length}const _e=S(C);if(!_e)throw Ta(s.replace("{}",C)),new Error('Unknown language: "'+C+'"');const xe=oq(_e);let je="",be=M||xe;const Ve={},ke=new o.__emitter(o);he();let ce="",Nt=0,De=0,xt=0,it=!1;try{if(_e.__emitTokens)_e.__emitTokens(O,ke);else{for(be.matcher.considerAll();;){xt++,it?it=!1:be.matcher.considerAll(),be.matcher.lastIndex=De;const z=be.matcher.exec(O);if(!z)break;const X=O.substring(De,z.index),oe=Ie(X,z);De=z.index+oe}Ie(O.substring(De))}return ke.finalize(),je=ke.toHTML(),{language:C,value:je,relevance:Nt,illegal:!1,_emitter:ke,_top:be}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:C,value:Mg(O),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:De,context:O.slice(De-100,De+100),mode:z.mode,resultSoFar:je},_emitter:ke};if(i)return{language:C,value:Mg(O),illegal:!1,relevance:0,errorRaised:z,_emitter:ke,_top:be};throw z}}function h(C){const O={value:Mg(C),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return O._emitter.addText(C),O}function p(C,O){O=O||o.languages||Object.keys(t);const L=h(C),M=O.filter(S).filter(I).map(V=>f(V,C,!1));M.unshift(L);const k=M.sort((V,Q)=>{if(V.relevance!==Q.relevance)return Q.relevance-V.relevance;if(V.language&&Q.language){if(S(V.language).supersetOf===Q.language)return 1;if(S(Q.language).supersetOf===V.language)return-1}return 0}),[Y,G]=k,P=Y;return P.secondBest=G,P}function m(C,O,L){const M=O&&n[O]||L;C.classList.add("hljs"),C.classList.add(`language-${M}`)}function y(C){let O=null;const L=c(C);if(l(L))return;if(j("before:highlightElement",{el:C,language:L}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.children.length>0&&(o.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)),o.throwUnescapedHTML))throw new uq("One of your code blocks includes unescaped HTML.",C.innerHTML);O=C;const M=O.textContent,k=L?d(M,{language:L,ignoreIllegals:!0}):p(M);C.innerHTML=k.value,C.dataset.highlighted="yes",m(C,L,k.language),C.result={language:k.language,re:k.relevance,relevance:k.relevance},k.secondBest&&(C.secondBest={language:k.secondBest.language,relevance:k.secondBest.relevance}),j("after:highlightElement",{el:C,result:k,text:M})}function v(C){o=ST(o,C)}const g=()=>{w(),to("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){w(),to("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function w(){function C(){w()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",C,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(y)}function N(C,O){let L=null;try{L=O(e)}catch(M){if(Ta("Language definition for '{}' could not be registered.".replace("{}",C)),i)Ta(M);else throw M;L=a}L.name||(L.name=C),t[C]=L,L.rawDefinition=O.bind(null,e),L.aliases&&R(L.aliases,{languageName:C})}function T(C){delete t[C];for(const O of Object.keys(n))n[O]===C&&delete n[O]}function A(){return Object.keys(t)}function S(C){return C=(C||"").toLowerCase(),t[C]||t[n[C]]}function R(C,{languageName:O}){typeof C=="string"&&(C=[C]),C.forEach(L=>{n[L.toLowerCase()]=O})}function I(C){const O=S(C);return O&&!O.disableAutodetect}function D(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=O=>{C["before:highlightBlock"](Object.assign({block:O.el},O))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=O=>{C["after:highlightBlock"](Object.assign({block:O.el},O))})}function F(C){D(C),r.push(C)}function W(C){const O=r.indexOf(C);O!==-1&&r.splice(O,1)}function j(C,O){const L=C;r.forEach(function(M){M[L]&&M[L](O)})}function $(C){return to("10.7.0","highlightBlock will be removed entirely in v12.0"),to("10.7.0","Please use highlightElement now."),y(C)}Object.assign(e,{highlight:d,highlightAuto:p,highlightAll:w,highlightElement:y,highlightBlock:$,configure:v,initHighlighting:g,initHighlightingOnLoad:E,registerLanguage:N,unregisterLanguage:T,listLanguages:A,getLanguage:S,registerAliases:R,autoDetection:I,inherit:ST,addPlugin:F,removePlugin:W}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=cq,e.regex={concat:Ga,lookahead:hO,either:SE,optional:NW,anyNumberOfTimes:TW};for(const C in uf)typeof uf[C]=="object"&&dO(uf[C]);return Object.assign(e,uf),e},ul=wO({});ul.newInstance=()=>wO({});var fq=ul;ul.HighlightJS=ul;ul.default=ul;const wr=Ku(fq),AT={},hq="hljs-";function pq(e){const t=wr.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:a,registered:o};function n(l,c,d){const f=d||AT,h=typeof f.prefix=="string"?f.prefix:hq;if(!t.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");t.configure({__emitter:mq,classPrefix:h});const p=t.highlight(c,{ignoreIllegals:!0,language:l});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const m=p._emitter.root,y=m.data;return y.language=p.language,y.relevance=p.relevance,m}function r(l,c){const f=(c||AT).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 s(l,c){if(typeof l=="string")t.registerLanguage(l,c);else{let d;for(d in l)Object.hasOwn(l,d)&&t.registerLanguage(d,l[d])}}function a(l,c){if(typeof l=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:l});else{let d;for(d in l)if(Object.hasOwn(l,d)){const f=l[d];t.registerAliases(typeof f=="string"?f:[...f],{languageName:d})}}}function o(l){return!!t.getLanguage(l)}}class mq{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],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(a,o){return o?a+"_".repeat(o):n.options.classPrefix+a}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const gq={};function yq(e){const t=e||gq,n=t.aliases,r=t.detect||!1,i=t.languages||EW,s=t.plainText,a=t.prefix,o=t.subset;let l="hljs";const c=pq(i);if(n&&c.registerAlias(n),a){const d=a.indexOf("-");l=d===-1?a:a.slice(0,d)}return function(d,f){cd(d,"element",function(h,p,m){if(h.tagName!=="code"||!m||m.type!=="element"||m.tagName!=="pre")return;const y=bq(h);if(y===!1||!y&&!r||y&&s&&s.includes(y))return;Array.isArray(h.properties.className)||(h.properties.className=[]),h.properties.className.includes(l)||h.properties.className.unshift(l);const v=eY(h,{whitespace:"pre"});let g;try{g=y?c.highlight(y,v,{prefix:a}):c.highlightAuto(v,{prefix:a,subset:o})}catch(E){const b=E;if(y&&/Unknown language/.test(b.message)){f.message("Cannot highlight as `"+y+"`, it’s not registered",{ancestors:[m,h],cause:b,place:h.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw b}!y&&g.data&&g.data.language&&h.properties.className.push("language-"+g.data.language),g.children.length>0&&(h.children=g.children)})}}function bq(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n-1&&s<=t.length){let a=0;for(;;){let o=n[a];if(o===void 0){const l=RT(t,n[a-1]);o=l===-1?t.length+1:l+1,n[a]=o}if(o>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length1?n[s.line-2]:0)+s.column-1;if(a=55296&&e<=57343}function Vq(e){return e>=56320&&e<=57343}function Kq(e,t){return(e-55296)*1024+9216+t}function AO(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function CO(e){return e>=64976&&e<=65007||zq.has(e)}var te;(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"})(te||(te={}));const Yq=65536;class Wq{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=Yq,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:r,col:i,offset:s}=this,a=i+n,o=s+n;return{code:t,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_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(Vq(n))return this.pos++,this._addGap(),Kq(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(te.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 r=0;r=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;const r=this.html.charCodeAt(n);return r===B.CARRIAGE_RETURN?B.LINE_FEED:r}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,B.EOF;let t=this.html.charCodeAt(this.pos);return t===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):t===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,kO(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===B.LINE_FEED||t===B.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){AO(t)?this._err(te.controlCharacterInInputStream):CO(t)&&this._err(te.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 qq=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))),Gq=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 Xq(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Gq.get(e))!==null&&t!==void 0?t:e}var Dn;(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"})(Dn||(Dn={}));const Qq=32;var As;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(As||(As={}));function Yy(e){return e>=Dn.ZERO&&e<=Dn.NINE}function Zq(e){return e>=Dn.UPPER_A&&e<=Dn.UPPER_F||e>=Dn.LOWER_A&&e<=Dn.LOWER_F}function Jq(e){return e>=Dn.UPPER_A&&e<=Dn.UPPER_Z||e>=Dn.LOWER_A&&e<=Dn.LOWER_Z||Yy(e)}function eG(e){return e===Dn.EQUALS||Jq(e)}var Ln;(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"})(Ln||(Ln={}));var Hi;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Hi||(Hi={}));class tG{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Ln.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Hi.Strict}startEntity(t){this.decodeMode=t,this.state=Ln.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ln.EntityStart:return t.charCodeAt(n)===Dn.NUM?(this.state=Ln.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ln.NamedEntity,this.stateNamedEntity(t,n));case Ln.NumericStart:return this.stateNumericStart(t,n);case Ln.NumericDecimal:return this.stateNumericDecimal(t,n);case Ln.NumericHex:return this.stateNumericHex(t,n);case Ln.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Qq)===Dn.LOWER_X?(this.state=Ln.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ln.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n>14;for(;n>14,s!==0){if(a===Dn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Hi.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&As.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~As.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Ln.NamedEntity:return this.result!==0&&(this.decodeMode!==Hi.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ln.NumericDecimal:return this.emitNumericEntity(0,2);case Ln.NumericHex:return this.emitNumericEntity(0,3);case Ln.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ln.EntityStart:return 0}}}function nG(e,t,n,r){const i=(t&As.BRANCH_LENGTH)>>7,s=t&As.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const l=r-s;return l<0||l>=i?-1:e[n+l]-1}let a=n,o=a+i-1;for(;a<=o;){const l=a+o>>>1,c=e[l];if(cr)o=l-1;else return e[l+i]}return-1}var ue;(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/"})(ue||(ue={}));var Na;(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"})(Na||(Na={}));var zr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(zr||(zr={}));var J;(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"})(J||(J={}));var x;(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"})(x||(x={}));const rG=new Map([[J.A,x.A],[J.ADDRESS,x.ADDRESS],[J.ANNOTATION_XML,x.ANNOTATION_XML],[J.APPLET,x.APPLET],[J.AREA,x.AREA],[J.ARTICLE,x.ARTICLE],[J.ASIDE,x.ASIDE],[J.B,x.B],[J.BASE,x.BASE],[J.BASEFONT,x.BASEFONT],[J.BGSOUND,x.BGSOUND],[J.BIG,x.BIG],[J.BLOCKQUOTE,x.BLOCKQUOTE],[J.BODY,x.BODY],[J.BR,x.BR],[J.BUTTON,x.BUTTON],[J.CAPTION,x.CAPTION],[J.CENTER,x.CENTER],[J.CODE,x.CODE],[J.COL,x.COL],[J.COLGROUP,x.COLGROUP],[J.DD,x.DD],[J.DESC,x.DESC],[J.DETAILS,x.DETAILS],[J.DIALOG,x.DIALOG],[J.DIR,x.DIR],[J.DIV,x.DIV],[J.DL,x.DL],[J.DT,x.DT],[J.EM,x.EM],[J.EMBED,x.EMBED],[J.FIELDSET,x.FIELDSET],[J.FIGCAPTION,x.FIGCAPTION],[J.FIGURE,x.FIGURE],[J.FONT,x.FONT],[J.FOOTER,x.FOOTER],[J.FOREIGN_OBJECT,x.FOREIGN_OBJECT],[J.FORM,x.FORM],[J.FRAME,x.FRAME],[J.FRAMESET,x.FRAMESET],[J.H1,x.H1],[J.H2,x.H2],[J.H3,x.H3],[J.H4,x.H4],[J.H5,x.H5],[J.H6,x.H6],[J.HEAD,x.HEAD],[J.HEADER,x.HEADER],[J.HGROUP,x.HGROUP],[J.HR,x.HR],[J.HTML,x.HTML],[J.I,x.I],[J.IMG,x.IMG],[J.IMAGE,x.IMAGE],[J.INPUT,x.INPUT],[J.IFRAME,x.IFRAME],[J.KEYGEN,x.KEYGEN],[J.LABEL,x.LABEL],[J.LI,x.LI],[J.LINK,x.LINK],[J.LISTING,x.LISTING],[J.MAIN,x.MAIN],[J.MALIGNMARK,x.MALIGNMARK],[J.MARQUEE,x.MARQUEE],[J.MATH,x.MATH],[J.MENU,x.MENU],[J.META,x.META],[J.MGLYPH,x.MGLYPH],[J.MI,x.MI],[J.MO,x.MO],[J.MN,x.MN],[J.MS,x.MS],[J.MTEXT,x.MTEXT],[J.NAV,x.NAV],[J.NOBR,x.NOBR],[J.NOFRAMES,x.NOFRAMES],[J.NOEMBED,x.NOEMBED],[J.NOSCRIPT,x.NOSCRIPT],[J.OBJECT,x.OBJECT],[J.OL,x.OL],[J.OPTGROUP,x.OPTGROUP],[J.OPTION,x.OPTION],[J.P,x.P],[J.PARAM,x.PARAM],[J.PLAINTEXT,x.PLAINTEXT],[J.PRE,x.PRE],[J.RB,x.RB],[J.RP,x.RP],[J.RT,x.RT],[J.RTC,x.RTC],[J.RUBY,x.RUBY],[J.S,x.S],[J.SCRIPT,x.SCRIPT],[J.SEARCH,x.SEARCH],[J.SECTION,x.SECTION],[J.SELECT,x.SELECT],[J.SOURCE,x.SOURCE],[J.SMALL,x.SMALL],[J.SPAN,x.SPAN],[J.STRIKE,x.STRIKE],[J.STRONG,x.STRONG],[J.STYLE,x.STYLE],[J.SUB,x.SUB],[J.SUMMARY,x.SUMMARY],[J.SUP,x.SUP],[J.TABLE,x.TABLE],[J.TBODY,x.TBODY],[J.TEMPLATE,x.TEMPLATE],[J.TEXTAREA,x.TEXTAREA],[J.TFOOT,x.TFOOT],[J.TD,x.TD],[J.TH,x.TH],[J.THEAD,x.THEAD],[J.TITLE,x.TITLE],[J.TR,x.TR],[J.TRACK,x.TRACK],[J.TT,x.TT],[J.U,x.U],[J.UL,x.UL],[J.SVG,x.SVG],[J.VAR,x.VAR],[J.WBR,x.WBR],[J.XMP,x.XMP]]);function Dl(e){var t;return(t=rG.get(e))!==null&&t!==void 0?t:x.UNKNOWN}const fe=x,iG={[ue.HTML]:new Set([fe.ADDRESS,fe.APPLET,fe.AREA,fe.ARTICLE,fe.ASIDE,fe.BASE,fe.BASEFONT,fe.BGSOUND,fe.BLOCKQUOTE,fe.BODY,fe.BR,fe.BUTTON,fe.CAPTION,fe.CENTER,fe.COL,fe.COLGROUP,fe.DD,fe.DETAILS,fe.DIR,fe.DIV,fe.DL,fe.DT,fe.EMBED,fe.FIELDSET,fe.FIGCAPTION,fe.FIGURE,fe.FOOTER,fe.FORM,fe.FRAME,fe.FRAMESET,fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6,fe.HEAD,fe.HEADER,fe.HGROUP,fe.HR,fe.HTML,fe.IFRAME,fe.IMG,fe.INPUT,fe.LI,fe.LINK,fe.LISTING,fe.MAIN,fe.MARQUEE,fe.MENU,fe.META,fe.NAV,fe.NOEMBED,fe.NOFRAMES,fe.NOSCRIPT,fe.OBJECT,fe.OL,fe.P,fe.PARAM,fe.PLAINTEXT,fe.PRE,fe.SCRIPT,fe.SECTION,fe.SELECT,fe.SOURCE,fe.STYLE,fe.SUMMARY,fe.TABLE,fe.TBODY,fe.TD,fe.TEMPLATE,fe.TEXTAREA,fe.TFOOT,fe.TH,fe.THEAD,fe.TITLE,fe.TR,fe.TRACK,fe.UL,fe.WBR,fe.XMP]),[ue.MATHML]:new Set([fe.MI,fe.MO,fe.MN,fe.MS,fe.MTEXT,fe.ANNOTATION_XML]),[ue.SVG]:new Set([fe.TITLE,fe.FOREIGN_OBJECT,fe.DESC]),[ue.XLINK]:new Set,[ue.XML]:new Set,[ue.XMLNS]:new Set},Wy=new Set([fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6]);J.STYLE,J.SCRIPT,J.XMP,J.IFRAME,J.NOEMBED,J.NOFRAMES,J.PLAINTEXT;var U;(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"})(U||(U={}));const fn={DATA:U.DATA,RCDATA:U.RCDATA,RAWTEXT:U.RAWTEXT,SCRIPT_DATA:U.SCRIPT_DATA,PLAINTEXT:U.PLAINTEXT,CDATA_SECTION:U.CDATA_SECTION};function sG(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function vc(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function aG(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function gs(e){return aG(e)||vc(e)}function LT(e){return gs(e)||sG(e)}function df(e){return e+32}function RO(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function MT(e){return RO(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function oG(e){return e===B.NULL?te.nullCharacterReference:e>1114111?te.characterReferenceOutsideUnicodeRange:kO(e)?te.surrogateCharacterReference:CO(e)?te.noncharacterCharacterReference:AO(e)||e===B.CARRIAGE_RETURN?te.controlCharacterReference:null}class lG{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=U.DATA,this.returnState=U.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Wq(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tG(qq,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=oG(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,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,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}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(te.endTagWithAttributes),t.selfClosing&&this._err(te.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 Ze.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Ze.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Ze.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:Ze.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=RO(t)?Ze.WHITESPACE_CHARACTER:t===B.NULL?Ze.NULL_CHARACTER:Ze.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Ze.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=U.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Hi.Attribute:Hi.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===U.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===U.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case U.DATA:{this._stateData(t);break}case U.RCDATA:{this._stateRcdata(t);break}case U.RAWTEXT:{this._stateRawtext(t);break}case U.SCRIPT_DATA:{this._stateScriptData(t);break}case U.PLAINTEXT:{this._statePlaintext(t);break}case U.TAG_OPEN:{this._stateTagOpen(t);break}case U.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case U.TAG_NAME:{this._stateTagName(t);break}case U.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case U.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case U.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case U.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case U.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case U.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case U.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case U.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case U.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case U.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case U.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case U.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case U.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case U.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case U.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case U.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case U.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case U.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case U.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case U.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case U.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case U.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case U.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case U.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case U.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case U.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case U.BOGUS_COMMENT:{this._stateBogusComment(t);break}case U.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case U.COMMENT_START:{this._stateCommentStart(t);break}case U.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case U.COMMENT:{this._stateComment(t);break}case U.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case U.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case U.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case U.COMMENT_END:{this._stateCommentEnd(t);break}case U.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case U.DOCTYPE:{this._stateDoctype(t);break}case U.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case U.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case U.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case U.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case U.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case U.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case U.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case U.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case U.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case U.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case U.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case U.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case U.CDATA_SECTION:{this._stateCdataSection(t);break}case U.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case U.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case U.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case U.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.TAG_OPEN;break}case B.AMPERSAND:{this._startCharacterReference();break}case B.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(t);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case B.AMPERSAND:{this._startCharacterReference();break}case B.LESS_THAN_SIGN:{this.state=U.RCDATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Ft);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.RAWTEXT_LESS_THAN_SIGN;break}case B.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Ft);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case B.LESS_THAN_SIGN:{this.state=U.SCRIPT_DATA_LESS_THAN_SIGN;break}case B.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Ft);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case B.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(Ft);break}case B.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(gs(t))this._createStartTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case B.EXCLAMATION_MARK:{this.state=U.MARKUP_DECLARATION_OPEN;break}case B.SOLIDUS:{this.state=U.END_TAG_OPEN;break}case B.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=U.BOGUS_COMMENT,this._stateBogusComment(t);break}case B.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=U.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(gs(t))this._createEndTagToken(),this.state=U.TAG_NAME,this._stateTagName(t);else switch(t){case B.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=U.DATA;break}case B.EOF:{this._err(te.eofBeforeTagName),this._emitChars("");break}case B.NULL:{this._err(te.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_ESCAPED,this._emitChars(Ft);break}case B.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===B.SOLIDUS?this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:gs(t)?(this._emitChars("<"),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=U.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){gs(t)?(this.state=U.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("");break}case B.NULL:{this._err(te.unexpectedNullCharacter),this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ft);break}case B.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===B.SOLIDUS?(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=U.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(pr.SCRIPT,!1)&&MT(this.preprocessor.peek(pr.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 r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),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])!==ue.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;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(hG,ue.HTML)}clearBackToTableBodyContext(){this.clearBackTo(fG,ue.HTML)}clearBackToTableRowContext(){this.clearBackTo(dG,ue.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]===x.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]===x.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ue.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case ue.SVG:{if(jT.has(i))return!1;break}case ue.MATHML:{if(PT.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Jh)}hasInListItemScope(t){return this.hasInDynamicScope(t,cG)}hasInButtonScope(t){return this.hasInDynamicScope(t,uG)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ue.HTML:{if(Wy.has(n))return!0;if(Jh.has(n))return!1;break}case ue.SVG:{if(jT.has(n))return!1;break}case ue.MATHML:{if(PT.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case t:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ue.HTML)switch(this.tagIDs[t]){case x.TBODY:case x.THEAD:case x.TFOOT:return!0;case x.TABLE:case x.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ue.HTML)switch(this.tagIDs[n]){case t:return!0;case x.OPTION:case x.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&OO.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&DT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&DT.has(this.currentTagId);)this.pop()}}const Dg=3;var Ti;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ti||(Ti={}));const BT={type:Ti.Marker};class gG{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(t),a=this.treeAdapter.getNamespaceURI(t);for(let o=0;o[a.name,a.value]));let s=0;for(let a=0;ai.get(l.name)===l.value)&&(s+=1,s>=Dg&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(BT)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ti.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ti.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(BT);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ti.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ti.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ti.Element&&n.element===t)}}const ys={createDocument(){return{nodeName:"#document",mode:zr.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 r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};ys.appendChild(e,s)}},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(ys.isTextNode(n)){n.value+=t;return}}ys.appendChild(e,ys.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ys.isTextNode(r)?r.value+=t:ys.insertBefore(e,ys.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;re.startsWith(n))}function wG(e){return e.name===LO&&e.publicId===null&&(e.systemId===null||e.systemId===yG)}function _G(e){if(e.name!==LO)return zr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===bG)return zr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),xG.has(n))return zr.QUIRKS;let r=t===null?EG:MO;if(FT(n,r))return zr.QUIRKS;if(r=t===null?DO:vG,FT(n,r))return zr.LIMITED_QUIRKS}return zr.NO_QUIRKS}const UT={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},TG="definitionurl",NG="definitionURL",SG=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])),kG=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ue.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ue.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ue.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ue.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ue.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ue.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ue.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ue.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ue.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ue.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ue.XMLNS}]]),AG=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])),CG=new Set([x.B,x.BIG,x.BLOCKQUOTE,x.BODY,x.BR,x.CENTER,x.CODE,x.DD,x.DIV,x.DL,x.DT,x.EM,x.EMBED,x.H1,x.H2,x.H3,x.H4,x.H5,x.H6,x.HEAD,x.HR,x.I,x.IMG,x.LI,x.LISTING,x.MENU,x.META,x.NOBR,x.OL,x.P,x.PRE,x.RUBY,x.S,x.SMALL,x.SPAN,x.STRONG,x.STRIKE,x.SUB,x.SUP,x.TABLE,x.TT,x.U,x.UL,x.VAR]);function IG(e){const t=e.tagID;return t===x.FONT&&e.attrs.some(({name:r})=>r===Na.COLOR||r===Na.SIZE||r===Na.FACE)||CG.has(t)}function PO(e){for(let t=0;t0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ue.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ue.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=H.TEXT}switchToPlaintextParsing(){this.insertionMode=H.TEXT,this.originalInsertionMode=H.IN_BODY,this.tokenizer.state=fn.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)===J.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ue.HTML))switch(this.fragmentContextID){case x.TITLE:case x.TEXTAREA:{this.tokenizer.state=fn.RCDATA;break}case x.STYLE:case x.XMP:case x.IFRAME:case x.NOEMBED:case x.NOFRAMES:case x.NOSCRIPT:{this.tokenizer.state=fn.RAWTEXT;break}case x.SCRIPT:{this.tokenizer.state=fn.SCRIPT_DATA;break}case x.PLAINTEXT:{this.tokenizer.state=fn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));a&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ue.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ue.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(J.HTML,ue.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,x.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):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),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:c,endOffset:d}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:c,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),s=n.type===Ze.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,s)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===x.SVG&&this.treeAdapter.getTagName(n)===J.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ue.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===x.MGLYPH||t.tagID===x.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ue.HTML)}_processToken(t){switch(t.type){case Ze.CHARACTER:{this.onCharacter(t);break}case Ze.NULL_CHARACTER:{this.onNullCharacter(t);break}case Ze.COMMENT:{this.onComment(t);break}case Ze.DOCTYPE:{this.onDoctype(t);break}case Ze.START_TAG:{this._processStartTag(t);break}case Ze.END_TAG:{this.onEndTag(t);break}case Ze.EOF:{this.onEof(t);break}case Ze.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return MG(t,i,s,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Ti.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=H.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(x.P),this.openElements.popUntilTagNamePopped(x.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case x.TR:{this.insertionMode=H.IN_ROW;return}case x.TBODY:case x.THEAD:case x.TFOOT:{this.insertionMode=H.IN_TABLE_BODY;return}case x.CAPTION:{this.insertionMode=H.IN_CAPTION;return}case x.COLGROUP:{this.insertionMode=H.IN_COLUMN_GROUP;return}case x.TABLE:{this.insertionMode=H.IN_TABLE;return}case x.BODY:{this.insertionMode=H.IN_BODY;return}case x.FRAMESET:{this.insertionMode=H.IN_FRAMESET;return}case x.SELECT:{this._resetInsertionModeForSelect(t);return}case x.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case x.HTML:{this.insertionMode=this.headElement?H.AFTER_HEAD:H.BEFORE_HEAD;return}case x.TD:case x.TH:{if(t>0){this.insertionMode=H.IN_CELL;return}break}case x.HEAD:{if(t>0){this.insertionMode=H.IN_HEAD;return}break}}this.insertionMode=H.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===x.TEMPLATE)break;if(r===x.TABLE){this.insertionMode=H.IN_SELECT_IN_TABLE;return}}this.insertionMode=H.IN_SELECT}_isElementCausesFosterParenting(t){return BO.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 x.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ue.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case x.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,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 r=this.treeAdapter.getNamespaceURI(t);return iG[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){pQ(this,t);return}switch(this.insertionMode){case H.INITIAL:{ac(this,t);break}case H.BEFORE_HTML:{Yc(this,t);break}case H.BEFORE_HEAD:{Wc(this,t);break}case H.IN_HEAD:{qc(this,t);break}case H.IN_HEAD_NO_SCRIPT:{Gc(this,t);break}case H.AFTER_HEAD:{Xc(this,t);break}case H.IN_BODY:case H.IN_CAPTION:case H.IN_CELL:case H.IN_TEMPLATE:{UO(this,t);break}case H.TEXT:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:{Pg(this,t);break}case H.IN_TABLE_TEXT:{YO(this,t);break}case H.IN_COLUMN_GROUP:{ep(this,t);break}case H.AFTER_BODY:{tp(this,t);break}case H.AFTER_AFTER_BODY:{Xf(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){hQ(this,t);return}switch(this.insertionMode){case H.INITIAL:{ac(this,t);break}case H.BEFORE_HTML:{Yc(this,t);break}case H.BEFORE_HEAD:{Wc(this,t);break}case H.IN_HEAD:{qc(this,t);break}case H.IN_HEAD_NO_SCRIPT:{Gc(this,t);break}case H.AFTER_HEAD:{Xc(this,t);break}case H.TEXT:{this._insertCharacters(t);break}case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:{Pg(this,t);break}case H.IN_COLUMN_GROUP:{ep(this,t);break}case H.AFTER_BODY:{tp(this,t);break}case H.AFTER_AFTER_BODY:{Xf(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){qy(this,t);return}switch(this.insertionMode){case H.INITIAL:case H.BEFORE_HTML:case H.BEFORE_HEAD:case H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:case H.IN_BODY:case H.IN_TABLE:case H.IN_CAPTION:case H.IN_COLUMN_GROUP:case H.IN_TABLE_BODY:case H.IN_ROW:case H.IN_CELL:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:case H.IN_TEMPLATE:case H.IN_FRAMESET:case H.AFTER_FRAMESET:{qy(this,t);break}case H.IN_TABLE_TEXT:{oc(this,t);break}case H.AFTER_BODY:{KG(this,t);break}case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:{YG(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case H.INITIAL:{WG(this,t);break}case H.BEFORE_HEAD:case H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:{this._err(t,te.misplacedDoctype);break}case H.IN_TABLE_TEXT:{oc(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?mQ(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case H.INITIAL:{ac(this,t);break}case H.BEFORE_HTML:{qG(this,t);break}case H.BEFORE_HEAD:{XG(this,t);break}case H.IN_HEAD:{yi(this,t);break}case H.IN_HEAD_NO_SCRIPT:{JG(this,t);break}case H.AFTER_HEAD:{tX(this,t);break}case H.IN_BODY:{Jn(this,t);break}case H.IN_TABLE:{dl(this,t);break}case H.IN_TABLE_TEXT:{oc(this,t);break}case H.IN_CAPTION:{QX(this,t);break}case H.IN_COLUMN_GROUP:{ME(this,t);break}case H.IN_TABLE_BODY:{nm(this,t);break}case H.IN_ROW:{rm(this,t);break}case H.IN_CELL:{eQ(this,t);break}case H.IN_SELECT:{GO(this,t);break}case H.IN_SELECT_IN_TABLE:{nQ(this,t);break}case H.IN_TEMPLATE:{iQ(this,t);break}case H.AFTER_BODY:{aQ(this,t);break}case H.IN_FRAMESET:{oQ(this,t);break}case H.AFTER_FRAMESET:{cQ(this,t);break}case H.AFTER_AFTER_BODY:{dQ(this,t);break}case H.AFTER_AFTER_FRAMESET:{fQ(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?gQ(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case H.INITIAL:{ac(this,t);break}case H.BEFORE_HTML:{GG(this,t);break}case H.BEFORE_HEAD:{QG(this,t);break}case H.IN_HEAD:{ZG(this,t);break}case H.IN_HEAD_NO_SCRIPT:{eX(this,t);break}case H.AFTER_HEAD:{nX(this,t);break}case H.IN_BODY:{tm(this,t);break}case H.TEXT:{$X(this,t);break}case H.IN_TABLE:{Ou(this,t);break}case H.IN_TABLE_TEXT:{oc(this,t);break}case H.IN_CAPTION:{ZX(this,t);break}case H.IN_COLUMN_GROUP:{JX(this,t);break}case H.IN_TABLE_BODY:{Gy(this,t);break}case H.IN_ROW:{qO(this,t);break}case H.IN_CELL:{tQ(this,t);break}case H.IN_SELECT:{XO(this,t);break}case H.IN_SELECT_IN_TABLE:{rQ(this,t);break}case H.IN_TEMPLATE:{sQ(this,t);break}case H.AFTER_BODY:{ZO(this,t);break}case H.IN_FRAMESET:{lQ(this,t);break}case H.AFTER_FRAMESET:{uQ(this,t);break}case H.AFTER_AFTER_BODY:{Xf(this,t);break}}}onEof(t){switch(this.insertionMode){case H.INITIAL:{ac(this,t);break}case H.BEFORE_HTML:{Yc(this,t);break}case H.BEFORE_HEAD:{Wc(this,t);break}case H.IN_HEAD:{qc(this,t);break}case H.IN_HEAD_NO_SCRIPT:{Gc(this,t);break}case H.AFTER_HEAD:{Xc(this,t);break}case H.IN_BODY:case H.IN_TABLE:case H.IN_CAPTION:case H.IN_COLUMN_GROUP:case H.IN_TABLE_BODY:case H.IN_ROW:case H.IN_CELL:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:{VO(this,t);break}case H.TEXT:{HX(this,t);break}case H.IN_TABLE_TEXT:{oc(this,t);break}case H.IN_TEMPLATE:{QO(this,t);break}case H.AFTER_BODY:case H.IN_FRAMESET:case H.AFTER_FRAMESET:case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:{LE(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===B.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 H.IN_HEAD:case H.IN_HEAD_NO_SCRIPT:case H.AFTER_HEAD:case H.TEXT:case H.IN_COLUMN_GROUP:case H.IN_SELECT:case H.IN_SELECT_IN_TABLE:case H.IN_FRAMESET:case H.AFTER_FRAMESET:{this._insertCharacters(t);break}case H.IN_BODY:case H.IN_CAPTION:case H.IN_CELL:case H.IN_TEMPLATE:case H.AFTER_BODY:case H.AFTER_AFTER_BODY:case H.AFTER_AFTER_FRAMESET:{FO(this,t);break}case H.IN_TABLE:case H.IN_TABLE_BODY:case H.IN_ROW:{Pg(this,t);break}case H.IN_TABLE_TEXT:{KO(this,t);break}}}};function FG(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):zO(e,t),n}function UG(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function $G(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let s=0,a=i;a!==n;s++,a=i){i=e.openElements.getCommonAncestor(a);const o=e.activeFormattingElements.getElementEntry(a),l=o&&s>=jG;!o||l?(l&&e.activeFormattingElements.removeEntry(o),e.openElements.remove(a)):(a=HG(e,o),r===t&&(e.activeFormattingElements.bookmark=o),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(a,r),r=a)}return r}function HG(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function zG(e,t,n){const r=e.treeAdapter.getTagName(t),i=Dl(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const s=e.treeAdapter.getNamespaceURI(t);i===x.TEMPLATE&&s===ue.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function VG(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,s),e.treeAdapter.appendChild(t,s),e.activeFormattingElements.insertElementAfterBookmark(s,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,s,i.tagID)}function OE(e,t){for(let n=0;n=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const s=e.openElements.items[1],a=e.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&e._setEndLocation(s,t)}}}}function WG(e,t){e._setDocumentType(t);const n=t.forceQuirks?zr.QUIRKS:_G(t);wG(t)||e._err(t,te.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=H.BEFORE_HTML}function ac(e,t){e._err(t,te.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,zr.QUIRKS),e.insertionMode=H.BEFORE_HTML,e._processToken(t)}function qG(e,t){t.tagID===x.HTML?(e._insertElement(t,ue.HTML),e.insertionMode=H.BEFORE_HEAD):Yc(e,t)}function GG(e,t){const n=t.tagID;(n===x.HTML||n===x.HEAD||n===x.BODY||n===x.BR)&&Yc(e,t)}function Yc(e,t){e._insertFakeRootElement(),e.insertionMode=H.BEFORE_HEAD,e._processToken(t)}function XG(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.HEAD:{e._insertElement(t,ue.HTML),e.headElement=e.openElements.current,e.insertionMode=H.IN_HEAD;break}default:Wc(e,t)}}function QG(e,t){const n=t.tagID;n===x.HEAD||n===x.BODY||n===x.HTML||n===x.BR?Wc(e,t):e._err(t,te.endTagWithoutMatchingOpenElement)}function Wc(e,t){e._insertFakeElement(J.HEAD,x.HEAD),e.headElement=e.openElements.current,e.insertionMode=H.IN_HEAD,e._processToken(t)}function yi(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case x.TITLE:{e._switchToTextParsing(t,fn.RCDATA);break}case x.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,fn.RAWTEXT):(e._insertElement(t,ue.HTML),e.insertionMode=H.IN_HEAD_NO_SCRIPT);break}case x.NOFRAMES:case x.STYLE:{e._switchToTextParsing(t,fn.RAWTEXT);break}case x.SCRIPT:{e._switchToTextParsing(t,fn.SCRIPT_DATA);break}case x.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=H.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(H.IN_TEMPLATE);break}case x.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:qc(e,t)}}function ZG(e,t){switch(t.tagID){case x.HEAD:{e.openElements.pop(),e.insertionMode=H.AFTER_HEAD;break}case x.BODY:case x.BR:case x.HTML:{qc(e,t);break}case x.TEMPLATE:{Xa(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function Xa(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==x.TEMPLATE&&e._err(t,te.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,te.endTagWithoutMatchingOpenElement)}function qc(e,t){e.openElements.pop(),e.insertionMode=H.AFTER_HEAD,e._processToken(t)}function JG(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BASEFONT:case x.BGSOUND:case x.HEAD:case x.LINK:case x.META:case x.NOFRAMES:case x.STYLE:{yi(e,t);break}case x.NOSCRIPT:{e._err(t,te.nestedNoscriptInHead);break}default:Gc(e,t)}}function eX(e,t){switch(t.tagID){case x.NOSCRIPT:{e.openElements.pop(),e.insertionMode=H.IN_HEAD;break}case x.BR:{Gc(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function Gc(e,t){const n=t.type===Ze.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=H.IN_HEAD,e._processToken(t)}function tX(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.BODY:{e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=H.IN_BODY;break}case x.FRAMESET:{e._insertElement(t,ue.HTML),e.insertionMode=H.IN_FRAMESET;break}case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{e._err(t,te.abandonedHeadElementChild),e.openElements.push(e.headElement,x.HEAD),yi(e,t),e.openElements.remove(e.headElement);break}case x.HEAD:{e._err(t,te.misplacedStartTagForHeadElement);break}default:Xc(e,t)}}function nX(e,t){switch(t.tagID){case x.BODY:case x.HTML:case x.BR:{Xc(e,t);break}case x.TEMPLATE:{Xa(e,t);break}default:e._err(t,te.endTagWithoutMatchingOpenElement)}}function Xc(e,t){e._insertFakeElement(J.BODY,x.BODY),e.insertionMode=H.IN_BODY,em(e,t)}function em(e,t){switch(t.type){case Ze.CHARACTER:{UO(e,t);break}case Ze.WHITESPACE_CHARACTER:{FO(e,t);break}case Ze.COMMENT:{qy(e,t);break}case Ze.START_TAG:{Jn(e,t);break}case Ze.END_TAG:{tm(e,t);break}case Ze.EOF:{VO(e,t);break}}}function FO(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function UO(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function rX(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function iX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function sX(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_FRAMESET)}function aX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function oX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Wy.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ue.HTML)}function lX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function cX(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),n||(e.formElement=e.openElements.current))}function uX(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===x.LI&&i===x.LI||(n===x.DD||n===x.DT)&&(i===x.DD||i===x.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==x.ADDRESS&&i!==x.DIV&&i!==x.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML)}function dX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.tokenizer.state=fn.PLAINTEXT}function fX(e,t){e.openElements.hasInScope(x.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(x.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1}function hX(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(J.A);n&&(OE(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function mX(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(x.NOBR)&&(OE(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ue.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function gX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function yX(e,t){e.treeAdapter.getDocumentMode(e.document)!==zr.QUIRKS&&e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=H.IN_TABLE}function $O(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function HO(e){const t=IO(e,Na.TYPE);return t!=null&&t.toLowerCase()===DG}function bX(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ue.HTML),HO(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function EX(e,t){e._appendElement(t,ue.HTML),t.ackSelfClosing=!0}function xX(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._appendElement(t,ue.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function vX(e,t){t.tagName=J.IMG,t.tagID=x.IMG,$O(e,t)}function wX(e,t){e._insertElement(t,ue.HTML),e.skipNextNewLine=!0,e.tokenizer.state=fn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=H.TEXT}function _X(e,t){e.openElements.hasInButtonScope(x.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function TX(e,t){e.framesetOk=!1,e._switchToTextParsing(t,fn.RAWTEXT)}function zT(e,t){e._switchToTextParsing(t,fn.RAWTEXT)}function NX(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===H.IN_TABLE||e.insertionMode===H.IN_CAPTION||e.insertionMode===H.IN_TABLE_BODY||e.insertionMode===H.IN_ROW||e.insertionMode===H.IN_CELL?H.IN_SELECT_IN_TABLE:H.IN_SELECT}function SX(e,t){e.openElements.currentTagId===x.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function kX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ue.HTML)}function AX(e,t){e.openElements.hasInScope(x.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(x.RTC),e._insertElement(t,ue.HTML)}function CX(e,t){e._reconstructActiveFormattingElements(),PO(t),RE(t),t.selfClosing?e._appendElement(t,ue.MATHML):e._insertElement(t,ue.MATHML),t.ackSelfClosing=!0}function IX(e,t){e._reconstructActiveFormattingElements(),jO(t),RE(t),t.selfClosing?e._appendElement(t,ue.SVG):e._insertElement(t,ue.SVG),t.ackSelfClosing=!0}function VT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ue.HTML)}function Jn(e,t){switch(t.tagID){case x.I:case x.S:case x.B:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.SMALL:case x.STRIKE:case x.STRONG:{pX(e,t);break}case x.A:{hX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{oX(e,t);break}case x.P:case x.DL:case x.OL:case x.UL:case x.DIV:case x.DIR:case x.NAV:case x.MAIN:case x.MENU:case x.ASIDE:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.DETAILS:case x.ADDRESS:case x.ARTICLE:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{aX(e,t);break}case x.LI:case x.DD:case x.DT:{uX(e,t);break}case x.BR:case x.IMG:case x.WBR:case x.AREA:case x.EMBED:case x.KEYGEN:{$O(e,t);break}case x.HR:{xX(e,t);break}case x.RB:case x.RTC:{kX(e,t);break}case x.RT:case x.RP:{AX(e,t);break}case x.PRE:case x.LISTING:{lX(e,t);break}case x.XMP:{_X(e,t);break}case x.SVG:{IX(e,t);break}case x.HTML:{rX(e,t);break}case x.BASE:case x.LINK:case x.META:case x.STYLE:case x.TITLE:case x.SCRIPT:case x.BGSOUND:case x.BASEFONT:case x.TEMPLATE:{yi(e,t);break}case x.BODY:{iX(e,t);break}case x.FORM:{cX(e,t);break}case x.NOBR:{mX(e,t);break}case x.MATH:{CX(e,t);break}case x.TABLE:{yX(e,t);break}case x.INPUT:{bX(e,t);break}case x.PARAM:case x.TRACK:case x.SOURCE:{EX(e,t);break}case x.IMAGE:{vX(e,t);break}case x.BUTTON:{fX(e,t);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{gX(e,t);break}case x.IFRAME:{TX(e,t);break}case x.SELECT:{NX(e,t);break}case x.OPTION:case x.OPTGROUP:{SX(e,t);break}case x.NOEMBED:case x.NOFRAMES:{zT(e,t);break}case x.FRAMESET:{sX(e,t);break}case x.TEXTAREA:{wX(e,t);break}case x.NOSCRIPT:{e.options.scriptingEnabled?zT(e,t):VT(e,t);break}case x.PLAINTEXT:{dX(e,t);break}case x.COL:case x.TH:case x.TD:case x.TR:case x.HEAD:case x.FRAME:case x.TBODY:case x.TFOOT:case x.THEAD:case x.CAPTION:case x.COLGROUP:break;default:VT(e,t)}}function RX(e,t){if(e.openElements.hasInScope(x.BODY)&&(e.insertionMode=H.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function OX(e,t){e.openElements.hasInScope(x.BODY)&&(e.insertionMode=H.AFTER_BODY,ZO(e,t))}function LX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function MX(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(x.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(x.FORM):n&&e.openElements.remove(n))}function DX(e){e.openElements.hasInButtonScope(x.P)||e._insertFakeElement(J.P,x.P),e._closePElement()}function PX(e){e.openElements.hasInListItemScope(x.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(x.LI),e.openElements.popUntilTagNamePopped(x.LI))}function jX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function BX(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function FX(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function UX(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(J.BR,x.BR),e.openElements.pop(),e.framesetOk=!1}function zO(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const s=e.openElements.items[i],a=e.openElements.tagIDs[i];if(r===a&&(r!==x.UNKNOWN||e.treeAdapter.getTagName(s)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(s,a))break}}function tm(e,t){switch(t.tagID){case x.A:case x.B:case x.I:case x.S:case x.U:case x.EM:case x.TT:case x.BIG:case x.CODE:case x.FONT:case x.NOBR:case x.SMALL:case x.STRIKE:case x.STRONG:{OE(e,t);break}case x.P:{DX(e);break}case x.DL:case x.UL:case x.OL:case x.DIR:case x.DIV:case x.NAV:case x.PRE:case x.MAIN:case x.MENU:case x.ASIDE:case x.BUTTON:case x.CENTER:case x.FIGURE:case x.FOOTER:case x.HEADER:case x.HGROUP:case x.DIALOG:case x.ADDRESS:case x.ARTICLE:case x.DETAILS:case x.SEARCH:case x.SECTION:case x.SUMMARY:case x.LISTING:case x.FIELDSET:case x.BLOCKQUOTE:case x.FIGCAPTION:{LX(e,t);break}case x.LI:{PX(e);break}case x.DD:case x.DT:{jX(e,t);break}case x.H1:case x.H2:case x.H3:case x.H4:case x.H5:case x.H6:{BX(e);break}case x.BR:{UX(e);break}case x.BODY:{RX(e,t);break}case x.HTML:{OX(e,t);break}case x.FORM:{MX(e);break}case x.APPLET:case x.OBJECT:case x.MARQUEE:{FX(e,t);break}case x.TEMPLATE:{Xa(e,t);break}default:zO(e,t)}}function VO(e,t){e.tmplInsertionModeStack.length>0?QO(e,t):LE(e,t)}function $X(e,t){var n;t.tagID===x.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function HX(e,t){e._err(t,te.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Pg(e,t){if(e.openElements.currentTagId!==void 0&&BO.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=H.IN_TABLE_TEXT,t.type){case Ze.CHARACTER:{YO(e,t);break}case Ze.WHITESPACE_CHARACTER:{KO(e,t);break}}else dd(e,t)}function zX(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_CAPTION}function VX(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_COLUMN_GROUP}function KX(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.COLGROUP,x.COLGROUP),e.insertionMode=H.IN_COLUMN_GROUP,ME(e,t)}function YX(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ue.HTML),e.insertionMode=H.IN_TABLE_BODY}function WX(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(J.TBODY,x.TBODY),e.insertionMode=H.IN_TABLE_BODY,nm(e,t)}function qX(e,t){e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function GX(e,t){HO(t)?e._appendElement(t,ue.HTML):dd(e,t),t.ackSelfClosing=!0}function XX(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ue.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function dl(e,t){switch(t.tagID){case x.TD:case x.TH:case x.TR:{WX(e,t);break}case x.STYLE:case x.SCRIPT:case x.TEMPLATE:{yi(e,t);break}case x.COL:{KX(e,t);break}case x.FORM:{XX(e,t);break}case x.TABLE:{qX(e,t);break}case x.TBODY:case x.TFOOT:case x.THEAD:{YX(e,t);break}case x.INPUT:{GX(e,t);break}case x.CAPTION:{zX(e,t);break}case x.COLGROUP:{VX(e,t);break}default:dd(e,t)}}function Ou(e,t){switch(t.tagID){case x.TABLE:{e.openElements.hasInTableScope(x.TABLE)&&(e.openElements.popUntilTagNamePopped(x.TABLE),e._resetInsertionMode());break}case x.TEMPLATE:{Xa(e,t);break}case x.BODY:case x.CAPTION:case x.COL:case x.COLGROUP:case x.HTML:case x.TBODY:case x.TD:case x.TFOOT:case x.TH:case x.THEAD:case x.TR:break;default:dd(e,t)}}function dd(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,em(e,t),e.fosterParentingEnabled=n}function KO(e,t){e.pendingCharacterTokens.push(t)}function YO(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function oc(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n0&&e.openElements.currentTagId===x.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===x.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===x.OPTGROUP&&e.openElements.pop();break}case x.OPTION:{e.openElements.currentTagId===x.OPTION&&e.openElements.pop();break}case x.SELECT:{e.openElements.hasInSelectScope(x.SELECT)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode());break}case x.TEMPLATE:{Xa(e,t);break}}}function nQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e._processStartTag(t)):GO(e,t)}function rQ(e,t){const n=t.tagID;n===x.CAPTION||n===x.TABLE||n===x.TBODY||n===x.TFOOT||n===x.THEAD||n===x.TR||n===x.TD||n===x.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(x.SELECT),e._resetInsertionMode(),e.onEndTag(t)):XO(e,t)}function iQ(e,t){switch(t.tagID){case x.BASE:case x.BASEFONT:case x.BGSOUND:case x.LINK:case x.META:case x.NOFRAMES:case x.SCRIPT:case x.STYLE:case x.TEMPLATE:case x.TITLE:{yi(e,t);break}case x.CAPTION:case x.COLGROUP:case x.TBODY:case x.TFOOT:case x.THEAD:{e.tmplInsertionModeStack[0]=H.IN_TABLE,e.insertionMode=H.IN_TABLE,dl(e,t);break}case x.COL:{e.tmplInsertionModeStack[0]=H.IN_COLUMN_GROUP,e.insertionMode=H.IN_COLUMN_GROUP,ME(e,t);break}case x.TR:{e.tmplInsertionModeStack[0]=H.IN_TABLE_BODY,e.insertionMode=H.IN_TABLE_BODY,nm(e,t);break}case x.TD:case x.TH:{e.tmplInsertionModeStack[0]=H.IN_ROW,e.insertionMode=H.IN_ROW,rm(e,t);break}default:e.tmplInsertionModeStack[0]=H.IN_BODY,e.insertionMode=H.IN_BODY,Jn(e,t)}}function sQ(e,t){t.tagID===x.TEMPLATE&&Xa(e,t)}function QO(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(x.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):LE(e,t)}function aQ(e,t){t.tagID===x.HTML?Jn(e,t):tp(e,t)}function ZO(e,t){var n;if(t.tagID===x.HTML){if(e.fragmentContext||(e.insertionMode=H.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===x.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else tp(e,t)}function tp(e,t){e.insertionMode=H.IN_BODY,em(e,t)}function oQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.FRAMESET:{e._insertElement(t,ue.HTML);break}case x.FRAME:{e._appendElement(t,ue.HTML),t.ackSelfClosing=!0;break}case x.NOFRAMES:{yi(e,t);break}}}function lQ(e,t){t.tagID===x.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==x.FRAMESET&&(e.insertionMode=H.AFTER_FRAMESET))}function cQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.NOFRAMES:{yi(e,t);break}}}function uQ(e,t){t.tagID===x.HTML&&(e.insertionMode=H.AFTER_AFTER_FRAMESET)}function dQ(e,t){t.tagID===x.HTML?Jn(e,t):Xf(e,t)}function Xf(e,t){e.insertionMode=H.IN_BODY,em(e,t)}function fQ(e,t){switch(t.tagID){case x.HTML:{Jn(e,t);break}case x.NOFRAMES:{yi(e,t);break}}}function hQ(e,t){t.chars=Ft,e._insertCharacters(t)}function pQ(e,t){e._insertCharacters(t),e.framesetOk=!1}function JO(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ue.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function mQ(e,t){if(IG(t))JO(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ue.MATHML?PO(t):r===ue.SVG&&(RG(t),jO(t)),RE(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function gQ(e,t){if(t.tagID===x.P||t.tagID===x.BR){JO(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ue.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}J.AREA,J.BASE,J.BASEFONT,J.BGSOUND,J.BR,J.COL,J.EMBED,J.FRAME,J.HR,J.IMG,J.INPUT,J.KEYGEN,J.LINK,J.META,J.PARAM,J.SOURCE,J.TRACK,J.WBR;const yQ=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,bQ=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),KT={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function eL(e,t){const n=AQ(e),r=mR("type",{handlers:{root:EQ,element:xQ,text:vQ,comment:nL,doctype:wQ,raw:TQ},unknown:NQ}),i={parser:n?new HT(KT):HT.getFragmentParser(void 0,KT),handle(o){r(o,i)},stitches:!1,options:t||{}};r(e,i),Pl(i,Mi());const s=n?i.parser.document:i.parser.getFragment(),a=Cq(s,{file:i.options.file});return i.stitches&&cd(a,"comment",function(o,l,c){const d=o;if(d.value.stitch&&c&&l!==void 0){const f=c.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function tL(e,t){let n=-1;if(e)for(;++n4&&(t.parser.tokenizer.state=0);const n={type:Ze.CHARACTER,chars:e.value,location:fd(e)};Pl(t,Mi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function wQ(e,t){const n={type:Ze.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:fd(e)};Pl(t,Mi(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function _Q(e,t){t.stitches=!0;const n=CQ(e);if("children"in e&&"children"in n){const r=eL({type:"root",children:e.children},t.options);n.children=r.children}nL({type:"comment",value:{stitch:n}},t)}function nL(e,t){const n=e.value,r={type:Ze.COMMENT,data:n,location:fd(e)};Pl(t,Mi(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function TQ(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,rL(t,Mi(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(yQ,"<$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 NQ(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))_Q(n,t);else{let r="";throw bQ.has(n.type)&&(r=". 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"+r)}}function Pl(e,t){rL(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=fn.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 rL(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 SQ(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===fn.PLAINTEXT)return;Pl(t,Mi(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ga.html;i===ga.html&&n==="svg"&&(i=ga.svg);const s=Mq({...e,children:[]},{space:i===ga.svg?"svg":"html"}),a={type:Ze.START_TAG,tagName:n,tagID:Dl(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:fd(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function kQ(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Hq.includes(n)||t.parser.tokenizer.state===fn.PLAINTEXT)return;Pl(t,qp(e));const r={type:Ze.END_TAG,tagName:n,tagID:Dl(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:fd(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===fn.RCDATA||t.parser.tokenizer.state===fn.RAWTEXT||t.parser.tokenizer.state===fn.SCRIPT_DATA)&&(t.parser.tokenizer.state=fn.DATA)}function AQ(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function fd(e){const t=Mi(e)||{line:void 0,column:void 0,offset:void 0},n=qp(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 CQ(e){return"children"in e?cl({...e,children:[]}):cl(e)}function IQ(e){return function(t,n){return eL(t,{...e,file:n})}}const iL=[".mp4",".webm",".mov",".m4v",".ogg",".avi"];function sL(e){if(!e)return!1;try{const t=e.toLowerCase();return iL.some(n=>t.includes(n))}catch{return!1}}function RQ(e){var r;const t=(r=e==null?void 0:e.properties)==null?void 0:r.href;if(!t)return!1;if(sL(t))return!0;const n=e==null?void 0:e.children;if(n&&Array.isArray(n)){const i=n.map(s=>(s==null?void 0:s.value)||"").join("").toLowerCase();return iL.some(s=>i.includes(s))}return!1}function OQ({text:e,className:t}){const[n,r]=_.useState(null),i=(o,l)=>{if(o.src)return o.src;if(l){const c=f=>{var h;if(!f)return null;if(f.type==="source"&&((h=f.properties)!=null&&h.src))return f.properties.src;if(f.children)for(const p of f.children){const m=c(p);if(m)return m}return null},d=c({children:l});if(d)return d}return""},s=o=>{try{const c=new URL(o).pathname.split("/");return c[c.length-1]||"video.mp4"}catch{return"video.mp4"}},a=o=>o?Array.isArray(o)?o.map(l=>(l==null?void 0:l.value)||"").join("")||"video":(o==null?void 0:o.value)||"video":"video";return u.jsxs("div",{className:t?`md ${t}`:"md",children:[u.jsx(Mz,{remarkPlugins:[WK],rehypePlugins:[IQ,yq],components:{a:({node:o,...l})=>{const c=l.href;if(c&&(sL(c)||RQ(o))){const d=c,f=a(o==null?void 0:o.children);return u.jsxs("div",{className:"video-container",children:[u.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":`点击播放视频: ${f}`,onClick:()=>r({src:d,title:f}),children:[u.jsx("video",{src:d,playsInline:!0,className:"video-thumbnail",preload:"metadata"}),u.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:u.jsx(Uc,{})})]}),u.jsx("div",{className:"video-caption",children:u.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"video-link-text",children:f})})]})}return u.jsx("a",{...l,target:"_blank",rel:"noopener noreferrer"})},img:({node:o,src:l,alt:c,...d})=>{const f=u.jsx("img",{...d,src:l,alt:c??"",loading:"lazy"});return l?u.jsx(bC,{src:l,children:u.jsxs("button",{type:"button",className:"image-preview-trigger","aria-label":`放大预览:${c||"图片"}`,children:[f,u.jsx("span",{className:"image-preview-hint","aria-hidden":"true",children:u.jsx(Uc,{})})]})}):f},video:({node:o,src:l,children:c,...d})=>{const f=i({src:l},c);return f?u.jsx("div",{className:"video-container",children:u.jsxs("button",{type:"button",className:"video-preview-trigger","aria-label":"点击放大视频",onClick:()=>r({src:f}),children:[u.jsx("video",{src:f,...d,playsInline:!0,className:"video-thumbnail",children:c}),u.jsx("span",{className:"video-preview-hint","aria-hidden":"true",children:u.jsx(Uc,{})})]})}):u.jsx("video",{src:l,controls:!0,playsInline:!0,className:"video-inline",...d,children:c})}},children:e}),n&&u.jsx("div",{className:"video-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":"视频预览",onClick:()=>r(null),children:u.jsxs("div",{className:"video-viewer",onClick:o=>o.stopPropagation(),children:[u.jsxs("div",{className:"video-viewer-header",children:[u.jsx("div",{className:"video-viewer-title",children:n.title||s(n.src)}),u.jsxs("nav",{className:"video-viewer-nav",children:[u.jsx("a",{href:n.src,download:n.title||s(n.src),"aria-label":"下载视频",title:"下载视频",className:"video-viewer-download",children:u.jsx(Yb,{})}),u.jsx("button",{type:"button",className:"video-viewer-close","aria-label":"关闭",onClick:()=>r(null),children:u.jsx(Xr,{})})]})]}),u.jsx("div",{className:"video-viewer-body",children:u.jsx("video",{src:n.src,controls:!0,autoPlay:!0,playsInline:!0,className:"video-fullscreen"})})]})})]})}const im=_.memo(OQ);function DE({value:e,onRemoveSkill:t,onRemoveAgent:n}){return e.skills.length===0&&!e.targetAgent?null:u.jsxs("div",{className:"invocation-chips","aria-label":"本轮调用上下文",children:[e.skills.map(r=>u.jsxs("span",{className:"invocation-chip invocation-chip--skill",title:r.description,children:[u.jsx(Ma,{"aria-hidden":!0}),u.jsxs("span",{children:["/",r.name]}),t?u.jsx("button",{type:"button",onClick:()=>t(r.name),"aria-label":`移除技能 ${r.name}`,children:u.jsx(Xr,{})}):null]},r.name)),e.targetAgent?u.jsxs("span",{className:"invocation-chip invocation-chip--agent",title:e.targetAgent.description,children:[u.jsx(_C,{"aria-hidden":!0}),u.jsx("span",{children:e.targetAgent.name}),n?u.jsx("button",{type:"button",onClick:n,"aria-label":`移除 Agent ${e.targetAgent.name}`,children:u.jsx(Xr,{})}):null]}):null]})}function PE(e=""){return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e==="application/pdf"?"pdf":e==="text/markdown"?"markdown":"text"}function aL(e){var n,r,i,s;const t=PE(e.mimeType);return t==="pdf"?"PDF":t==="markdown"?"MD":t==="video"?((r=(n=e.mimeType)==null?void 0:n.split("/")[1])==null?void 0:r.toUpperCase())??"VIDEO":t==="image"?((s=(i=e.mimeType)==null?void 0:i.split("/")[1])==null?void 0:s.toUpperCase())??"IMAGE":"TXT"}function oL(e){return e?e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`:""}function lL(e,t){return e.previewUrl?e.previewUrl:e.data?`data:${e.mimeType??"application/octet-stream"};base64,${e.data}`:e.uri?KC(t,e.uri):""}function LQ({kind:e}){return e==="image"?u.jsx(OC,{}):e==="video"?u.jsx(CC,{}):e==="pdf"?u.jsx(t9,{}):u.jsx(AC,{})}function jE({appName:e,items:t,compact:n=!1,onRemove:r}){const[i,s]=_.useState(null);return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:`media-grid${n?" media-grid--compact":""}`,children:t.map(a=>{const o=PE(a.mimeType),l=lL(a,e),c=a.status==="uploading"||a.status==="error"||!l,d=u.jsxs("button",{type:"button",className:"media-card-main",disabled:c,onClick:()=>s(a),"aria-label":`预览 ${a.name??"附件"}`,children:[o==="image"&&l?u.jsx("img",{className:"media-card-image",src:l,alt:a.name??"图片",loading:"lazy"}):o==="video"&&l?u.jsxs("div",{className:"media-card-video-container",children:[u.jsx("video",{className:"media-card-video",src:l,muted:!0,playsInline:!0,preload:"metadata","aria-hidden":"true"}),u.jsx("span",{className:"media-card-video-play",children:u.jsx(x9,{})})]}):u.jsx("span",{className:"media-card-icon",children:u.jsx(LQ,{kind:o})}),u.jsxs("span",{className:"media-card-copy",children:[u.jsx("span",{className:"media-card-name",children:a.name??"附件"}),u.jsxs("span",{className:"media-card-meta",children:[u.jsx("span",{className:"media-card-type",children:aL(a)}),a.status==="uploading"?u.jsxs(u.Fragment,{children:[u.jsx(bt,{className:"media-card-spinner"})," 上传中"]}):a.status==="error"?a.error??"上传失败":oL(a.sizeBytes)]})]}),!n&&a.status!=="uploading"&&a.status!=="error"?u.jsx(Uc,{className:"media-card-open"}):null]});return u.jsxs($t.div,{className:`media-card media-card--${o}${a.status==="error"?" media-card--error":""}`,layout:!0,initial:{opacity:0,scale:.985,y:4},animate:{opacity:1,scale:1,y:0},children:[o==="image"&&!c?u.jsx(bC,{src:l,children:d}):d,r?u.jsx("button",{type:"button",className:"media-card-remove","aria-label":`移除 ${a.name??"附件"}`,onClick:()=>r(a.id),children:u.jsx(Xr,{})}):null]},a.id)})}),u.jsx(js,{children:i?u.jsx(MQ,{appName:e,item:i,onClose:()=>s(null)}):null})]})}function MQ({appName:e,item:t,onClose:n}){const r=_.useMemo(()=>lL(t,e),[e,t]),i=PE(t.mimeType),[s,a]=_.useState(""),[o,l]=_.useState(i==="text"||i==="markdown"),[c,d]=_.useState("");return _.useEffect(()=>{const f=h=>{h.key==="Escape"&&n()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n]),_.useEffect(()=>{if(i!=="text"&&i!=="markdown")return;const f=new AbortController;return l(!0),d(""),fetch(r,{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||l(!1)}),()=>f.abort()},[i,r]),u.jsx($t.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:u.jsxs($t.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:[u.jsxs("header",{className:"media-viewer-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:t.name??"附件"}),u.jsxs("span",{children:[aL(t),t.sizeBytes?` · ${oL(t.sizeBytes)}`:""]})]}),u.jsxs("nav",{children:[u.jsx("a",{href:r,download:t.name,"aria-label":"下载",children:u.jsx(Yb,{})}),u.jsx("button",{type:"button",onClick:n,"aria-label":"关闭",children:u.jsx(Xr,{})})]})]}),u.jsxs("div",{className:`media-viewer-body media-viewer-body--${i}`,children:[i==="image"?u.jsx("img",{src:r,alt:t.name??"图片"}):null,i==="video"?u.jsx("div",{className:"media-viewer-video-wrapper",children:u.jsx("video",{src:r,controls:!0,autoPlay:!0,playsInline:!0,preload:"auto",className:"media-viewer-video"})}):null,i==="pdf"?u.jsx("iframe",{src:r,title:t.name??"PDF"}):null,o?u.jsxs("div",{className:"media-viewer-loading",children:[u.jsx(bt,{})," 正在读取文档…"]}):null,!o&&c?u.jsxs("div",{className:"media-viewer-loading",children:["文档加载失败:",c]}):null,!o&&i==="markdown"?u.jsx("div",{className:"media-document",children:u.jsx(im,{text:s})}):null,!o&&i==="text"?u.jsx("pre",{className:"media-document media-document--plain",children:s}):null]})]})})}function hd({as:e="span",className:t="",duration:n=4,spread:r=20,children:i,style:s,...a}){const o=Math.min(Math.max(r,5),45);return u.jsx(e,{className:`text-shimmer${t?` ${t}`:""}`,style:{...s,backgroundImage:`linear-gradient(to right, hsl(var(--muted-foreground)) ${50-o}%, hsl(var(--foreground)) 50%, hsl(var(--muted-foreground)) ${50+o}%)`,animationDuration:`${n}s`},...a,children:i})}function DQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("circle",{cx:"10.25",cy:"10.25",r:"6.25"}),u.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 PQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"3.25",y:"5.25",width:"15.5",height:"13.5",rx:"2.25"}),u.jsx("circle",{cx:"8.1",cy:"9.3",r:"1.35"}),u.jsx("path",{d:"m4.7 16.5 3.65-3.7 2.45 2.25 2.2-2.2 4.35 4.1"}),u.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 jQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("rect",{x:"3.25",y:"5.5",width:"16.25",height:"13",rx:"2.4"}),u.jsx("path",{d:"m10.2 9.2 4.4 2.8-4.4 2.8V9.2Z"}),u.jsx("path",{d:"m19.25 2.5.42 1.2 1.2.42-1.2.42-.42 1.2-.42-1.2-1.2-.42 1.2-.42.42-1.2Z",fill:"currentColor",stroke:"none"})]})}function BQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.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"}),u.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"}),u.jsx("path",{d:"M8.2 12.25h.01M8.2 16.8h.01"})]})}function FQ(e){return u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:[u.jsx("path",{d:"M4.25 4.25h4.5v15.5h-4.5zM8.75 5.75h5v14h-5zM13.75 4.25h4.1v10.25h-4.1z"}),u.jsx("path",{d:"M5.75 7h1.5M10.25 8.25h2M10.25 11h2M15.15 7h1.3"}),u.jsx("circle",{cx:"17.45",cy:"17.35",r:"2.45"}),u.jsx("path",{d:"m19.25 19.15 1.55 1.55"})]})}function cL(e){return u.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:u.jsx("path",{d:"m6 3.25 4.5 4.75L6 12.75"})})}function UQ({definition:e,done:t,open:n,onToggle:r}){const i=e.icon;return u.jsxs("button",{type:"button",className:`builtin-tool-head${t?" is-done":" is-running"}`,"data-tool-tone":e.tone,onClick:r,"aria-expanded":n,children:[u.jsx("span",{className:"builtin-tool-icon","aria-hidden":"true",children:u.jsx(i,{})}),t?u.jsx("span",{className:"builtin-tool-label",children:e.doneLabel}):u.jsx(hd,{className:"builtin-tool-label",duration:2.4,spread:18,"aria-live":"polite",children:e.runningLabel}),u.jsx(cL,{className:`builtin-tool-chevron${n?" is-open":""}`})]})}const $Q={web_search:{name:"web_search",runningLabel:"正在进行网络搜索",doneLabel:"已完成网络搜索",tone:"search",icon:DQ},image_generate:{name:"image_generate",runningLabel:"正在生成图片",doneLabel:"已完成图片生成",tone:"image",icon:PQ},video_generate:{name:"video_generate",runningLabel:"正在生成视频",doneLabel:"已完成视频生成",tone:"video",icon:jQ},load_memory:{name:"load_memory",runningLabel:"正在检索长期记忆",doneLabel:"已完成记忆检索",tone:"memory",icon:BQ},load_knowledgebase:{name:"load_knowledgebase",runningLabel:"正在检索知识库",doneLabel:"已完成知识库检索",tone:"knowledge",icon:FQ}};function HQ(e){return $Q[e]}const uL="send_a2ui_json_to_client";function zQ({className:e}){return u.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:u.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 VQ(){return u.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.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 dL({text:e,done:t}){const[n,r]=_.useState(!t),i=_.useRef(!1);_.useEffect(()=>{i.current||r(!t)},[t]);const s=()=>{i.current=!0,r(c=>!c)},a=e.replace(/^\s+/,""),{ref:o,onScroll:l}=SI(a);return u.jsxs("div",{className:"block-thinking",children:[u.jsxs("button",{className:"think-head",onClick:s,type:"button",children:[u.jsx("span",{className:"think-icon","aria-hidden":"true",children:u.jsx(zQ,{className:`spark ${t?"":"pulse"}`})}),t?u.jsx("span",{className:"think-label think-label--done",children:"已完成思考"}):u.jsx(hd,{className:"think-label",duration:2.4,spread:18,children:"思考中"}),u.jsx(or,{className:`chev ${n?"open":""}`})]}),u.jsx("div",{className:`think-collapse ${n&&a?"open":""}`,children:u.jsx("div",{className:"think-collapse-inner",children:u.jsx("div",{className:"think-body scroll",ref:o,onScroll:l,children:a})})})]})}function fL(){return u.jsx(dL,{text:"",done:!1})}function KQ({name:e,args:t,response:n,done:r}){const[i,s]=_.useState(!1),a=e===uL?"渲染 UI":e,o=HQ(e),l=n==null?null:typeof n=="string"?n:JSON.stringify(n,null,2),c=l&&l.length>2e3?l.slice(0,2e3)+` +…(已截断)`:l;return u.jsxs($t.div,{className:`block-tool${o?" block-tool--builtin":""}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[o?u.jsx(UQ,{definition:o,done:r,open:i,onToggle:()=>s(d=>!d)}):u.jsxs("button",{className:"tool-head tool-head--generic",onClick:()=>s(d=>!d),type:"button","aria-expanded":i,children:[u.jsx("span",{className:"tool-icon tool-icon--generic","aria-hidden":"true",children:u.jsx(VQ,{})}),r?u.jsx("span",{className:"tool-name",children:a}):u.jsx(hd,{className:"tool-name",duration:2.2,spread:15,children:a}),u.jsx(cL,{className:`tool-chevron${i?" is-open":""}`})]}),u.jsx("div",{className:`think-collapse ${i?"open":""}`,children:u.jsx("div",{className:"think-collapse-inner",children:u.jsxs("div",{className:"tool-detail",children:[t!=null&&u.jsxs("div",{className:"tool-section",children:[u.jsx("div",{className:"tool-section-label",children:"参数"}),u.jsx("pre",{className:"tool-args",children:JSON.stringify(t,null,2)})]}),c!=null&&u.jsxs("div",{className:"tool-section",children:[u.jsx("div",{className:"tool-section-label",children:"返回"}),u.jsx("pre",{className:"tool-args tool-result",children:c})]})]})})})]})}function YQ({block:e,onAuth:t}){const[n,r]=_.useState(e.done?"done":"idle"),[i,s]=_.useState(""),a=e.label||"MCP 工具集",o=(()=>{try{return e.authUri?new URL(e.authUri).host:""}catch{return""}})(),l=async()=>{if(t){s(""),r("authorizing");try{await t(e),r("done")}catch(d){s(d instanceof Error?d.message:String(d)),r("idle")}}};return e.done||n==="done"?u.jsxs($t.div,{className:"auth-card-collapsed",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},children:[u.jsx(Zw,{className:"auth-card-icon auth-card-icon--done"}),u.jsxs("span",{children:["已授权 · ",a]})]}):u.jsxs($t.div,{className:"auth-card",initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[u.jsxs("div",{className:"auth-card-head",children:[u.jsx(Zw,{className:"auth-card-icon"}),u.jsxs("span",{className:"auth-card-title",children:[a," 需要授权"]})]}),u.jsxs("p",{className:"auth-card-desc",children:["工具集 ",u.jsx("code",{className:"auth-card-code",children:a})," 使用 OAuth 保护, 需登录授权后方可调用。",o&&u.jsxs(u.Fragment,{children:[" ","将跳转至 ",u.jsx("code",{className:"auth-card-code",children:o})," 完成登录,"]}),"授权完成后对话自动继续。"]}),u.jsx("button",{className:"auth-card-btn",onClick:l,disabled:n==="authorizing"||!e.authUri,children:n==="authorizing"?u.jsxs(u.Fragment,{children:[u.jsx(bt,{className:"cw-i spin"})," 等待授权…"]}):u.jsx(u.Fragment,{children:"去授权"})}),!e.authUri&&u.jsx("div",{className:"auth-card-err",children:"未在事件中找到授权地址。"}),i&&u.jsx("div",{className:"auth-card-err",children:i})]})}function hL({blocks:e,appName:t="",onAction:n,onAuth:r}){return u.jsx(u.Fragment,{children:e.map((i,s)=>{switch(i.kind){case"thinking":return u.jsx(dL,{text:i.text,done:i.done},s);case"text":{const a=i.text.replace(/^\s+/,"");return a?u.jsx("div",{className:"bubble",children:u.jsx(im,{text:a})},s):null}case"attachment":return u.jsx(jE,{appName:t,items:i.files},s);case"invocation":return u.jsx(DE,{value:i.value},s);case"tool":return i.name===uL&&i.done?null:u.jsx(KQ,{name:i.name,args:i.args,response:i.response,done:i.done},s);case"auth":return u.jsx(YQ,{block:i,onAuth:r},s);case"a2ui":return NI(i.messages).filter(a=>a.components[a.rootId]).map(a=>u.jsx($t.div,{initial:{opacity:0,y:8,scale:.985},animate:{opacity:1,y:0,scale:1},transition:{type:"spring",stiffness:380,damping:30},children:u.jsx(rU,{surface:a,onAction:n})},`${s}-${a.surfaceId}`));default:return null}})})}function WQ(e){return e.isComposing||e.keyCode===229}function qQ({sessionId:e,sessionInitializing:t=!1,appName:n,agentName:r,value:i,onChange:s,onSubmit:a,disabled:o,busy:l,showMeta:c,attachments:d,skills:f,agents:h,invocation:p,capabilitiesLoading:m=!1,onInvocationChange:y,onAddFiles:v,onRemoveAttachment:g}){const E=_.useRef(null),b=_.useRef(null),w=_.useRef(null),N=_.useRef(null),[T,A]=_.useState(!1),[S,R]=_.useState(null),[I,D]=_.useState(0),[F,W]=_.useState(!1);async function j(){if(e)try{await navigator.clipboard.writeText(e),W(!0),setTimeout(()=>W(!1),1500)}catch{W(!1)}}_.useLayoutEffect(()=>{const V=E.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,200)}px`)},[i]);const $=d.some(V=>V.status!=="ready"),C=!o&&!l&&!$&&(i.trim().length>0||d.length>0),O=(S==null?void 0:S.query.toLocaleLowerCase())??"",L=(S==null?void 0:S.kind)==="skill"?f.filter(V=>!p.skills.some(Q=>Q.name===V.name)).filter(V=>`${V.name} ${V.description}`.toLocaleLowerCase().includes(O)).map(V=>({kind:"skill",value:V})):(S==null?void 0:S.kind)==="agent"?h.filter(V=>`${V.name} ${V.description}`.toLocaleLowerCase().includes(O)).map(V=>({kind:"agent",value:V})):[];function M(V){var Q;A(!1),R(null),(Q=V.current)==null||Q.click()}function k(V,Q){const ne=V.slice(0,Q),le=/(^|\s)([/@])([^\s/@]*)$/.exec(ne);if(!le){R(null);return}const K=le[2].length+le[3].length,q={kind:le[2]==="/"?"skill":"agent",query:le[3],start:Q-K,end:Q},ae=!S||S.kind!==q.kind||S.query!==q.query||S.start!==q.start||S.end!==q.end;R(q),ae&&D(0),A(!1)}function Y(V){if(!S)return;const Q=i.slice(0,S.start)+i.slice(S.end);s(Q),V.kind==="skill"?y({...p,skills:[...p.skills,V.value]}):y({skills:[],targetAgent:V.value});const ne=S.start;R(null),requestAnimationFrame(()=>{var le,K;(le=E.current)==null||le.focus(),(K=E.current)==null||K.setSelectionRange(ne,ne)})}function G(){if(p.targetAgent){y({skills:[]});return}p.skills.length>0&&y({...p,skills:p.skills.slice(0,-1)})}function P(V){const Q=V.target.files?Array.from(V.target.files):[];Q.length&&v(Q),V.target.value=""}return u.jsxs("div",{className:"composer",children:[u.jsx(DE,{value:p,onRemoveSkill:V=>y({...p,skills:p.skills.filter(Q=>Q.name!==V)}),onRemoveAgent:()=>y({skills:[]})}),d.length>0&&u.jsx(jE,{appName:n,compact:!0,items:d,onRemove:g}),u.jsxs("div",{className:"composer-box",children:[S?u.jsxs("div",{className:"composer-command-menu",role:"listbox","aria-label":S.kind==="skill"?"可用技能":"可用子 Agent",children:[u.jsxs("div",{className:"composer-command-head",children:[S.kind==="skill"?u.jsx(Ma,{}):u.jsx(_C,{}),u.jsx("span",{children:S.kind==="skill"?"调用技能":"使用子 Agent"}),u.jsx("kbd",{children:S.kind==="skill"?"/":"@"})]}),m?u.jsxs("div",{className:"composer-command-empty",children:[u.jsx(bt,{className:"spin"})," 正在读取 Agent 能力…"]}):L.length===0?u.jsx("div",{className:"composer-command-empty",children:S.kind==="skill"?"当前 Agent 没有匹配技能":"当前 Agent 没有匹配子 Agent"}):u.jsx("div",{className:"composer-command-list",children:L.map((V,Q)=>u.jsxs("button",{type:"button",role:"option","aria-selected":Q===I,className:`composer-command-item${Q===I?" is-active":""}`,onMouseDown:ne=>{ne.preventDefault(),Y(V)},onMouseEnter:()=>D(Q),children:[u.jsx("span",{className:`composer-command-icon composer-command-icon--${V.kind}`,children:V.kind==="skill"?u.jsx(Ma,{}):u.jsx(La,{})}),u.jsxs("span",{className:"composer-command-copy",children:[u.jsxs("strong",{children:[V.kind==="skill"?"/":"@",V.value.name]}),u.jsx("span",{children:V.value.description||(V.kind==="skill"?"加载并执行该技能":"将本轮交给该 Agent")})]}),u.jsx("kbd",{children:Q===I?"↵":V.kind==="skill"?"技能":"Agent"})]},`${V.kind}-${V.value.name}`))})]}):null,u.jsxs("div",{className:"composer-menu-wrap",children:[u.jsx("button",{type:"button",className:"comp-icon",title:"添加","aria-label":"添加",disabled:o,onClick:()=>{R(null),A(V=>!V)},children:u.jsx(pi,{className:"icon"})}),T&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"menu-scrim",onClick:()=>A(!1)}),u.jsxs("div",{className:"composer-menu",role:"menu",children:[u.jsxs("button",{type:"button",className:"menu-item",onClick:()=>M(b),children:[u.jsx(OC,{className:"icon"}),"上传图片"]}),u.jsxs("button",{type:"button",className:"menu-item",onClick:()=>M(w),children:[u.jsx(AC,{className:"icon"}),"上传文档或 PDF"]}),u.jsxs("button",{type:"button",className:"menu-item",onClick:()=>M(N),children:[u.jsx(CC,{className:"icon"}),"上传视频"]})]})]})]}),u.jsx("textarea",{ref:E,className:"comp-input scroll",rows:1,value:i,disabled:o,placeholder:o?"请选择 Agent":`向 ${r} 发消息…`,"aria-expanded":!!S,onChange:V=>{s(V.target.value),k(V.target.value,V.target.selectionStart)},onSelect:V=>k(V.currentTarget.value,V.currentTarget.selectionStart),onBlur:()=>setTimeout(()=>R(null),0),onKeyDown:V=>{if(!WQ(V.nativeEvent)){if(S){if(V.key==="ArrowDown"&&L.length>0){V.preventDefault(),D(Q=>(Q+1)%L.length);return}if(V.key==="ArrowUp"&&L.length>0){V.preventDefault(),D(Q=>(Q-1+L.length)%L.length);return}if((V.key==="Enter"||V.key==="Tab")&&L[I]){V.preventDefault(),Y(L[I]);return}if(V.key==="Escape"){V.preventDefault(),R(null);return}}if(V.key==="Backspace"&&!i&&V.currentTarget.selectionStart===0&&V.currentTarget.selectionEnd===0){G();return}V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),C&&a())}}}),u.jsx($t.button,{type:"button",className:"comp-send",disabled:!C,onClick:a,"aria-label":"发送",whileTap:C?{scale:.9}:void 0,transition:{type:"spring",stiffness:600,damping:22},children:l?u.jsx(bt,{className:"icon spin"}):u.jsx(wC,{className:"icon"})})]}),c&&u.jsxs("div",{className:"composer-meta",children:[u.jsxs("span",{className:"composer-session-line",children:["会话 ID:",u.jsx("span",{className:"composer-session-id",title:e||void 0,"aria-live":"polite",children:t?"初始化中":e||"—"}),e&&u.jsx("button",{type:"button",className:"composer-session-copy",title:F?"已复制":"复制会话 ID","aria-label":F?"已复制会话 ID":"复制会话 ID",onClick:()=>void j(),children:F?u.jsx(Li,{}):u.jsx(Kb,{})})]}),u.jsx("span",{className:"composer-meta-separator","aria-hidden":!0,children:"|"}),u.jsx("span",{children:"回答仅供参考"})]}),u.jsx("input",{ref:b,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:P}),u.jsx("input",{ref:w,type:"file",accept:".txt,.md,.markdown,.pdf,text/plain,text/markdown,application/pdf",multiple:!0,hidden:!0,onChange:P}),u.jsx("input",{ref:N,type:"file",accept:"video/mp4,video/webm,video/quicktime",multiple:!0,hidden:!0,onChange:P})]})}function pL({title:e,sub:t,cards:n,footer:r}){return u.jsxs("div",{className:"stk",children:[u.jsxs("div",{className:"stk-head",children:[u.jsx("h1",{className:"stk-title",children:e}),t&&u.jsx("p",{className:"stk-sub",children:t})]}),u.jsx("div",{className:"stk-list",children:n.map((i,s)=>u.jsxs($t.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:s*.04},children:[u.jsx("span",{className:"stk-card-icon",children:u.jsx(i.icon,{})}),u.jsxs("span",{className:"stk-card-text",children:[u.jsx("span",{className:"stk-card-title",children:i.title}),u.jsx("span",{className:"stk-card-desc",children:i.desc})]}),u.jsx(or,{className:"stk-card-arrow"})]},i.key))}),r&&u.jsx("div",{className:"stk-footer",children:r})]})}const BE=Symbol.for("yaml.alias"),Xy=Symbol.for("yaml.document"),Bs=Symbol.for("yaml.map"),mL=Symbol.for("yaml.pair"),Oi=Symbol.for("yaml.scalar"),jl=Symbol.for("yaml.seq"),Qr=Symbol.for("yaml.node.type"),Bl=e=>!!e&&typeof e=="object"&&e[Qr]===BE,pd=e=>!!e&&typeof e=="object"&&e[Qr]===Xy,md=e=>!!e&&typeof e=="object"&&e[Qr]===Bs,mn=e=>!!e&&typeof e=="object"&&e[Qr]===mL,Rt=e=>!!e&&typeof e=="object"&&e[Qr]===Oi,gd=e=>!!e&&typeof e=="object"&&e[Qr]===jl;function hn(e){if(e&&typeof e=="object")switch(e[Qr]){case Bs:case jl:return!0}return!1}function pn(e){if(e&&typeof e=="object")switch(e[Qr]){case BE:case Bs:case Oi:case jl:return!0}return!1}const gL=e=>(Rt(e)||hn(e))&&!!e.anchor,oa=Symbol("break visit"),GQ=Symbol("skip children"),Qc=Symbol("remove node");function Fl(e,t){const n=XQ(t);pd(e)?Ro(null,e.contents,n,Object.freeze([e]))===Qc&&(e.contents=null):Ro(null,e,n,Object.freeze([]))}Fl.BREAK=oa;Fl.SKIP=GQ;Fl.REMOVE=Qc;function Ro(e,t,n,r){const i=QQ(e,t,n,r);if(pn(i)||mn(i))return ZQ(e,r,i),Ro(e,i,n,r);if(typeof i!="symbol"){if(hn(t)){r=Object.freeze(r.concat(t));for(let s=0;se.replace(/[!,[\]{}]/g,t=>JQ[t]);class ir{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ir.defaultYaml,t),this.tags=Object.assign({},ir.defaultTags,n)}clone(){const t=new ir(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new ir(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ir.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ir.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:ir.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ir.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,a]=r;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,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[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(a){return n(String(a)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+eZ(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(t&&r.length>0&&pn(t.contents)){const s={};Fl(t.contents,(a,o)=>{pn(o)&&o.tag&&(s[o.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,a]of r)s==="!!"&&a==="tag:yaml.org,2002:"||(!t||i.some(o=>o.startsWith(a)))&&n.push(`%TAG ${s} ${a}`);return n.join(` +`)}}ir.defaultYaml={explicit:!1,version:"1.2"};ir.defaultTags={"!!":"tag:yaml.org,2002:"};function yL(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 bL(e){const t=new Set;return Fl(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function EL(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function tZ(e,t){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i??(i=bL(e));const a=EL(t,i);return i.add(a),a},setAnchors:()=>{for(const s of n){const a=r.get(s);if(typeof a=="object"&&a.anchor&&(Rt(a.node)||hn(a.node)))a.node.anchor=a.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:r}}function Oo(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;iWr(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!gL(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=s=>{r.res=s,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 FE{constructor(t){Object.defineProperty(this,Qr,{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:r,onAnchor:i,reviver:s}={}){if(!pd(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 r=="number"?r:100},o=Wr(this,"",a);if(typeof i=="function")for(const{count:l,res:c}of a.anchors.values())i(c,l);return typeof s=="function"?Oo(s,{"":o},"",o):o}}class UE extends FE{constructor(t){super(BE),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 r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],Fl(t,{Node:(s,a)=>{(Bl(a)||gL(a))&&r.push(a)}}),n&&(n.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,a=this.resolve(i,n);if(!a){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=r.get(a);if(o||(Wr(a,null,n),o=r.get(a)),(o==null?void 0:o.res)===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Qf(i,a,r)),o.count*o.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(yL(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(t.implicitKey)return`${i} `}return i}}function Qf(e,t,n){if(Bl(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(hn(t)){let r=0;for(const i of t.items){const s=Qf(e,i,n);s>r&&(r=s)}return r}else if(mn(t)){const r=Qf(e,t.key,n),i=Qf(e,t.value,n);return Math.max(r,i)}return 1}const xL=e=>!e||typeof e!="function"&&typeof e!="object";class Ye extends FE{constructor(t){super(Oi),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Wr(this.value,t,n)}toString(){return String(this.value)}}Ye.BLOCK_FOLDED="BLOCK_FOLDED";Ye.BLOCK_LITERAL="BLOCK_LITERAL";Ye.PLAIN="PLAIN";Ye.QUOTE_DOUBLE="QUOTE_DOUBLE";Ye.QUOTE_SINGLE="QUOTE_SINGLE";const nZ="tag:yaml.org,2002:";function rZ(e,t,n){if(t){const r=n.filter(s=>s.tag===t),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,e))&&!r.format})}function Lu(e,t,n){var f,h,p;if(pd(e)&&(e=e.contents),pn(e))return e;if(mn(e)){const m=(h=(f=n.schema[Bs]).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:r,onAnchor:i,onTagObj:s,schema:a,sourceObjects:o}=n;let l;if(r&&e&&typeof e=="object"){if(l=o.get(e),l)return l.anchor??(l.anchor=i(e)),new UE(l.anchor);l={anchor:null,node:null},o.set(e,l)}t!=null&&t.startsWith("!!")&&(t=nZ+t.slice(2));let c=rZ(e,t,a.tags);if(!c){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new Ye(e);return l&&(l.node=m),m}c=e instanceof Map?a[Bs]:Symbol.iterator in Object(e)?a[jl]:a[Bs]}s&&(s(c),delete n.onTagObj);const d=c!=null&&c.createNode?c.createNode(n.schema,e,n):typeof((p=c==null?void 0:c.nodeClass)==null?void 0:p.from)=="function"?c.nodeClass.from(n.schema,e,n):new Ye(e);return t?d.tag=t:c.default||(d.tag=c.tag),l&&(l.node=d),d}function np(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const s=t[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=r,r=a}else r=new Map([[s,r]])}return Lu(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const wc=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class vL extends FE{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(r=>pn(r)||mn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(wc(t))this.add(n);else{const[r,...i]=t,s=this.get(r,!0);if(hn(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,np(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(hn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,s=this.get(r,!0);return i.length===0?!n&&Rt(s)?s.value:s:hn(s)?s.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!mn(n))return!1;const r=n.value;return r==null||t&&Rt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return hn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(hn(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,np(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const iZ=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Wi(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ya=(e,t,n)=>e.endsWith(` +`)?Wi(n,t):n.includes(` `)?` -`+Hi(n,t):(e.endsWith(" ")?"":" ")+n,xL="flow",Xy="block",Xf="quoted";function im(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return e;ii-Math.max(2,s)?c.push(0):f=i-r);let h,p,m=!1,y=-1,v=-1,g=-1;n===Xy&&(y=KT(e,y,t.length),y!==-1&&(f=y+l));for(let b;b=e[y+=1];){if(n===Xf&&b==="\\"){switch(v=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}g=y}if(b===` -`)n===Xy&&(y=KT(e,y,t.length)),f=y+t.length+l,h=void 0;else{if(b===" "&&p&&p!==" "&&p!==` +`+Wi(n,t):(e.endsWith(" ")?"":" ")+n,wL="flow",Qy="block",Zf="quoted";function sm(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:o}={}){if(!i||i<0)return e;ii-Math.max(2,s)?c.push(0):f=i-r);let h,p,m=!1,y=-1,v=-1,g=-1;n===Qy&&(y=YT(e,y,t.length),y!==-1&&(f=y+l));for(let b;b=e[y+=1];){if(n===Zf&&b==="\\"){switch(v=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}g=y}if(b===` +`)n===Qy&&(y=YT(e,y,t.length)),f=y+t.length+l,h=void 0;else{if(b===" "&&p&&p!==" "&&p!==` `&&p!==" "){const w=e[y+1];w&&w!==" "&&w!==` -`&&w!==" "&&(h=y)}if(y>=f)if(h)c.push(h),f=h+l,h=void 0;else if(n===Xf){for(;p===" "||p===" ";)p=b,b=e[y+=1],m=!0;const w=y>g+1?y-2:v-1;if(d[w])return e;c.push(w),d[w]=!0,f=w+l,h=void 0}else m=!0}p=b}if(m&&o&&o(),c.length===0)return e;a&&a();let E=e.slice(0,c[0]);for(let b=0;b({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),am=e=>/^(%|---|\.\.\.)/m.test(e);function JQ(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,a=0;sr)return!0;if(a=s+1,i-a<=r)return!1}return!0}function Wc(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(am(e)?" ":"");let a="",o=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(a+=n.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{a+=n.slice(o,l);const d=n.substr(l+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(l,6)}l+=5,o=l+1}break;case"n":if(r||n[l+2]==='"'||n.length=f)if(h)c.push(h),f=h+l,h=void 0;else if(n===Zf){for(;p===" "||p===" ";)p=b,b=e[y+=1],m=!0;const w=y>g+1?y-2:v-1;if(d[w])return e;c.push(w),d[w]=!0,f=w+l,h=void 0}else m=!0}p=b}if(m&&o&&o(),c.length===0)return e;a&&a();let E=e.slice(0,c[0]);for(let b=0;b({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),om=e=>/^(%|---|\.\.\.)/m.test(e);function sZ(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let s=0,a=0;sr)return!0;if(a=s+1,i-a<=r)return!1}return!0}function Zc(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(om(e)?" ":"");let a="",o=0;for(let l=0,c=n[l];c;c=n[++l])if(c===" "&&n[l+1]==="\\"&&n[l+2]==="n"&&(a+=n.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(n[l+1]){case"u":{a+=n.slice(o,l);const d=n.substr(l+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(l,6)}l+=5,o=l+1}break;case"n":if(r||n[l+2]==='"'||n.length `;let f,h;for(h=n.length;h>0;--h){const N=n[h-1];if(N!==` `&&N!==" "&&N!==" ")break}let p=n.substring(h);const m=p.indexOf(` `);m===-1?f="-":n===p||m!==p.length-1?(f="+",s&&s()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===` -`&&(p=p.slice(0,-1)),p=p.replace(Zy,`$&${c}`));let y=!1,v,g=-1;for(v=0;v{T=!0});const S=im(`${E}${N}${p}`,c,Xy,A);if(!T)return`>${w} +$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let T=!1;const A=am(r,!0);a!=="folded"&&t!==Ye.BLOCK_FOLDED&&(A.onOverflow=()=>{T=!0});const S=sm(`${E}${N}${p}`,c,Qy,A);if(!T)return`>${w} ${c}${S}`}return n=n.replace(/\n+/g,`$&${c}`),`|${w} -${c}${E}${n}${p}`}function eZ(e,t,n,r){const{type:i,value:s}=e,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:d}=t;if(o&&s.includes(` -`)||d&&/[[\]{},]/.test(s))return Ao(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||d||!s.includes(` -`)?Ao(s,t):Qf(e,t,n,r);if(!o&&!d&&i!==Ye.PLAIN&&s.includes(` -`))return Qf(e,t,n,r);if(am(s)){if(l==="")return t.forceBlockIndent=!0,Qf(e,t,n,r);if(o&&l===c)return Ao(s,t)}const f=s.replace(/\n+/g,`$& -${l}`);if(a){const h=y=>{var v;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((v=y.test)==null?void 0:v.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return Ao(s,t)}return o?f:im(f,l,xL,sm(t,!1))}function UE(e,t,n,r){const{implicitKey:i,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==Ye.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Ye.QUOTE_DOUBLE);const l=d=>{switch(d){case Ye.BLOCK_FOLDED:case Ye.BLOCK_LITERAL:return i||s?Ao(a.value,t):Qf(a,t,n,r);case Ye.QUOTE_DOUBLE:return Wc(a.value,t);case Ye.QUOTE_SINGLE:return Qy(a.value,t);case Ye.PLAIN:return eZ(a,t,n,r);default:return null}};let c=l(o);if(c===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=i&&d||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function vL(e,t){const n=Object.assign({blockQuote:!0,commentString:ZQ,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 r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function tZ(e,t){var i;if(t.tag){const s=e.filter(a=>a.tag===t.tag);if(s.length>0)return s.find(a=>a.format===t.format)??s[0]}let n,r;if(Pt(t)){r=t.value;let s=e.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,r)});if(s.length>1){const a=s.filter(o=>o.test);a.length>0&&(s=a)}n=s.find(a=>a.format===t.format)??s.find(a=>!a.format)}else r=t,n=e.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=((i=r==null?void 0:r.constructor)==null?void 0:i.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function nZ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(Pt(e)||fn(e))&&e.anchor;s&&mL(s)&&(n.add(s),i.push(`&${s}`));const a=e.tag??(t.default?null:t.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}function ol(e,t,n,r){var l;if(pn(e))return e.toString(t,n,r);if(Rl(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.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 s=hn(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=tZ(t.doc.schema.tags,s));const a=nZ(s,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const o=typeof i.stringify=="function"?i.stringify(s,t,n,r):Pt(s)?UE(s,t,n,r):s.toString(t,n,r);return a?Pt(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} -${t.indent}${o}`:o}function rZ({key:e,value:t},n,r,i){const{allNullValues:s,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:f}}=n;let h=hn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(fn(e)||!hn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||fn(e)||(Pt(e)?e.type===Ye.BLOCK_FOLDED||e.type===Ye.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!s),indent:o+l});let m=!1,y=!1,v=ol(e,n,()=>m=!0,()=>y=!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(s||t==null)return m&&r&&r(),v===""?"?":p?`? ${v}`:v}else if(s&&!f||t==null&&p)return v=`? ${v}`,h&&!m?v+=da(v,n.indent,c(h)):y&&i&&i(),v;m&&(h=null),p?(h&&(v+=da(v,n.indent,c(h))),v=`? ${v} -${o}:`):(v=`${v}:`,h&&(v+=da(v,n.indent,c(h))));let g,E,b;hn(t)?(g=!!t.spaceBefore,E=t.commentBefore,b=t.comment):(g=!1,E=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&Pt(t)&&(n.indentAtStart=v.length+1),y=!1,!d&&l.length>=2&&!n.inFlow&&!p&&dd(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const N=ol(t,n,()=>w=!0,()=>y=!0);let T=" ";if(h||g||E){if(T=g?` +${c}${E}${n}${p}`}function aZ(e,t,n,r){const{type:i,value:s}=e,{actualString:a,implicitKey:o,indent:l,indentStep:c,inFlow:d}=t;if(o&&s.includes(` +`)||d&&/[[\]{},]/.test(s))return Lo(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||d||!s.includes(` +`)?Lo(s,t):Jf(e,t,n,r);if(!o&&!d&&i!==Ye.PLAIN&&s.includes(` +`))return Jf(e,t,n,r);if(om(s)){if(l==="")return t.forceBlockIndent=!0,Jf(e,t,n,r);if(o&&l===c)return Lo(s,t)}const f=s.replace(/\n+/g,`$& +${l}`);if(a){const h=y=>{var v;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((v=y.test)==null?void 0:v.test(f))},{compat:p,tags:m}=t.doc.schema;if(m.some(h)||p!=null&&p.some(h))return Lo(s,t)}return o?f:sm(f,l,wL,am(t,!1))}function $E(e,t,n,r){const{implicitKey:i,inFlow:s}=t,a=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:o}=e;o!==Ye.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(o=Ye.QUOTE_DOUBLE);const l=d=>{switch(d){case Ye.BLOCK_FOLDED:case Ye.BLOCK_LITERAL:return i||s?Lo(a.value,t):Jf(a,t,n,r);case Ye.QUOTE_DOUBLE:return Zc(a.value,t);case Ye.QUOTE_SINGLE:return Zy(a.value,t);case Ye.PLAIN:return aZ(a,t,n,r);default:return null}};let c=l(o);if(c===null){const{defaultKeyType:d,defaultStringType:f}=t.options,h=i&&d||f;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function _L(e,t){const n=Object.assign({blockQuote:!0,commentString:iZ,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 r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function oZ(e,t){var i;if(t.tag){const s=e.filter(a=>a.tag===t.tag);if(s.length>0)return s.find(a=>a.format===t.format)??s[0]}let n,r;if(Rt(t)){r=t.value;let s=e.filter(a=>{var o;return(o=a.identify)==null?void 0:o.call(a,r)});if(s.length>1){const a=s.filter(o=>o.test);a.length>0&&(s=a)}n=s.find(a=>a.format===t.format)??s.find(a=>!a.format)}else r=t,n=e.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!n){const s=((i=r==null?void 0:r.constructor)==null?void 0:i.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return n}function lZ(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],s=(Rt(e)||hn(e))&&e.anchor;s&&yL(s)&&(n.add(s),i.push(`&${s}`));const a=e.tag??(t.default?null:t.tag);return a&&i.push(r.directives.tagString(a)),i.join(" ")}function fl(e,t,n,r){var l;if(mn(e))return e.toString(t,n,r);if(Bl(e)){if(t.doc.directives)return e.toString(t);if((l=t.resolvedAliases)!=null&&l.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 s=pn(e)?e:t.doc.createNode(e,{onTagObj:c=>i=c});i??(i=oZ(t.doc.schema.tags,s));const a=lZ(s,i,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const o=typeof i.stringify=="function"?i.stringify(s,t,n,r):Rt(s)?$E(s,t,n,r):s.toString(t,n,r);return a?Rt(s)||o[0]==="{"||o[0]==="["?`${a} ${o}`:`${a} +${t.indent}${o}`:o}function cZ({key:e,value:t},n,r,i){const{allNullValues:s,doc:a,indent:o,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:f}}=n;let h=pn(e)&&e.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(hn(e)||!pn(e)&&typeof e=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let p=!f&&(!e||h&&t==null&&!n.inFlow||hn(e)||(Rt(e)?e.type===Ye.BLOCK_FOLDED||e.type===Ye.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!s),indent:o+l});let m=!1,y=!1,v=fl(e,n,()=>m=!0,()=>y=!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(s||t==null)return m&&r&&r(),v===""?"?":p?`? ${v}`:v}else if(s&&!f||t==null&&p)return v=`? ${v}`,h&&!m?v+=ya(v,n.indent,c(h)):y&&i&&i(),v;m&&(h=null),p?(h&&(v+=ya(v,n.indent,c(h))),v=`? ${v} +${o}:`):(v=`${v}:`,h&&(v+=ya(v,n.indent,c(h))));let g,E,b;pn(t)?(g=!!t.spaceBefore,E=t.commentBefore,b=t.comment):(g=!1,E=null,b=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!p&&!h&&Rt(t)&&(n.indentAtStart=v.length+1),y=!1,!d&&l.length>=2&&!n.inFlow&&!p&&gd(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const N=fl(t,n,()=>w=!0,()=>y=!0);let T=" ";if(h||g||E){if(T=g?` `:"",E){const A=c(E);T+=` -${Hi(A,n.indent)}`}N===""&&!n.inFlow?T===` +${Wi(A,n.indent)}`}N===""&&!n.inFlow?T===` `&&b&&(T=` `):T+=` -${n.indent}`}else if(!p&&fn(t)){const A=N[0],S=N.indexOf(` -`),O=S!==-1,I=n.inFlow??t.flow??t.items.length===0;if(O||!I){let D=!1;if(O&&(A==="&"||A==="!")){let F=N.indexOf(" ");A==="&"&&F!==-1&&Fe===cf||typeof e=="symbol"&&e.description===cf,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ye(Symbol(cf)),{addToJSMap:_L}),stringify:()=>cf},iZ=(e,t)=>(Wi.identify(t)||Pt(t)&&(!t.type||t.type===Ye.PLAIN)&&Wi.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Wi.tag&&n.default));function _L(e,t,n){const r=TL(e,n);if(dd(r))for(const i of r.items)Pg(e,t,i);else if(Array.isArray(r))for(const i of r)Pg(e,t,i);else Pg(e,t,r)}function Pg(e,t,n){const r=TL(e,n);if(!ud(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[s,a]of i)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function TL(e,t){return e&&Rl(t)?t.resolve(e.doc,e):t}function NL(e,t,{key:n,value:r}){if(hn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(iZ(e,n))_L(e,t,r);else{const i=$r(n,"",e);if(t instanceof Map)t.set(i,$r(r,i,e));else if(t instanceof Set)t.add(i);else{const s=sZ(n,i,e),a=$r(r,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function sZ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(hn(e)&&(n!=null&&n.doc)){const r=vL(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),wL(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function $E(e,t,n){const r=Au(e,void 0,n),i=Au(t,void 0,n);return new ir(r,i)}class ir{constructor(t,n=null){Object.defineProperty(this,Kr,{value:hL}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return hn(n)&&(n=n.clone(t)),hn(r)&&(r=r.clone(t)),new ir(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return NL(n,r,this)}toString(t,n,r){return t!=null&&t.doc?rZ(this,t,n,r):JSON.stringify(this)}}function SL(e,t,n){return(t.inFlow??e.flow?oZ:aZ)(e,t,n)}function aZ({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let m=0;mv=null,()=>f=!0);v&&(g+=da(g,s,c(v))),f&&v&&(f=!1),h.push(r+g)}let p;if(h.length===0)p=i.start+i.end;else{p=h[0];for(let m=1;me===ff||typeof e=="symbol"&&e.description===ff,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ye(Symbol(ff)),{addToJSMap:NL}),stringify:()=>ff},uZ=(e,t)=>(Zi.identify(t)||Rt(t)&&(!t.type||t.type===Ye.PLAIN)&&Zi.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Zi.tag&&n.default));function NL(e,t,n){const r=SL(e,n);if(gd(r))for(const i of r.items)jg(e,t,i);else if(Array.isArray(r))for(const i of r)jg(e,t,i);else jg(e,t,r)}function jg(e,t,n){const r=SL(e,n);if(!md(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[s,a]of i)t instanceof Map?t.has(s)||t.set(s,a):t instanceof Set?t.add(s):Object.prototype.hasOwnProperty.call(t,s)||Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function SL(e,t){return e&&Bl(t)?t.resolve(e.doc,e):t}function kL(e,t,{key:n,value:r}){if(pn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(uZ(e,n))NL(e,t,r);else{const i=Wr(n,"",e);if(t instanceof Map)t.set(i,Wr(r,i,e));else if(t instanceof Set)t.add(i);else{const s=dZ(n,i,e),a=Wr(r,s,e);s in t?Object.defineProperty(t,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[s]=a}}return t}function dZ(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(pn(e)&&(n!=null&&n.doc)){const r=_L(n.doc,{});r.anchors=new Set;for(const s of n.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),TL(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function HE(e,t,n){const r=Lu(e,void 0,n),i=Lu(t,void 0,n);return new lr(r,i)}class lr{constructor(t,n=null){Object.defineProperty(this,Qr,{value:mL}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return pn(n)&&(n=n.clone(t)),pn(r)&&(r=r.clone(t)),new lr(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return kL(n,r,this)}toString(t,n,r){return t!=null&&t.doc?cZ(this,t,n,r):JSON.stringify(this)}}function AL(e,t,n){return(t.inFlow??e.flow?hZ:fZ)(e,t,n)}function fZ({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:a,onComment:o}){const{indent:l,options:{commentString:c}}=n,d=Object.assign({},n,{indent:s,type:null});let f=!1;const h=[];for(let m=0;mv=null,()=>f=!0);v&&(g+=ya(g,s,c(v))),f&&v&&(f=!1),h.push(r+g)}let p;if(h.length===0)p=i.start+i.end;else{p=h[0];for(let m=1;mv=null);c||(c=f.length>d||g.includes(` -`)),m0&&(c||(c=f.reduce((E,b)=>E+b.length+2,2)+(g.length+2)>t.options.lineWidth)),c&&(g+=",")),v&&(g+=da(g,r,o(v))),f.push(g),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!c){const m=f.reduce((y,v)=>y+v.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=h;for(const y of f)m+=y?` +`+Wi(c(e),l),o&&o()):f&&a&&a(),p}function hZ({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:o}}=t;r+=s;const l=Object.assign({},t,{indent:r,inFlow:!0,type:null});let c=!1,d=0;const f=[];for(let m=0;mv=null);c||(c=f.length>d||g.includes(` +`)),m0&&(c||(c=f.reduce((E,b)=>E+b.length+2,2)+(g.length+2)>t.options.lineWidth)),c&&(g+=",")),v&&(g+=ya(g,r,o(v))),f.push(g),d=f.length}const{start:h,end:p}=n;if(f.length===0)return h+p;if(!c){const m=f.reduce((y,v)=>y+v.length+2,2);c=t.options.lineWidth>0&&m>t.options.lineWidth}if(c){let m=h;for(const y of f)m+=y?` ${s}${i}${y}`:` `;return`${m} -${i}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function tp({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=Hi(t(r),e);n.push(s.trimStart())}}function fa(e,t){const n=Pt(t)?t.value:t;for(const r of e)if(pn(r)&&(r.key===t||r.key===n||Pt(r.key)&&r.key.value===n))return r}class Br extends EL{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Ls,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:s}=r,a=new this(t),o=(l,c)=>{if(typeof s=="function")c=s.call(n,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||i)&&a.items.push($E(l,c,r))};if(n instanceof Map)for(const[l,c]of n)o(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))o(l,n[l]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;pn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new ir(t,t==null?void 0:t.value):r=new ir(t.key,t.value);const i=fa(this.items,r.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Pt(i.value)&&bL(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const o=this.items.findIndex(l=>s(r,l)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=fa(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=fa(this.items,t),i=r==null?void 0:r.value;return(!n&&Pt(i)?i.value:i)??void 0}has(t){return!!fa(this.items,t)}set(t,n){this.add(new ir(t,n),!0)}toJSON(t,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const s of this.items)NL(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!pn(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})),SL(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Ml={collection:"map",default:!0,nodeClass:Br,tag:"tag:yaml.org,2002:map",resolve(e,t){return ud(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Br.from(e,t,n)};class Oa extends EL{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ol,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=uf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=uf(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Pt(i)?i.value:i}has(t){const n=uf(t);return typeof n=="number"&&n=0?t:null}const Dl={collection:"seq",default:!0,nodeClass:Oa,tag:"tag:yaml.org,2002:seq",resolve(e,t){return dd(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Oa.from(e,t,n)},om={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),UE(e,t,n,r)}},lm={identify:e=>e==null,createNode:()=>new Ye(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ye(null),stringify:({source:e},t)=>typeof e=="string"&&lm.test.test(e)?e:t.options.nullStr},HE={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ye(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&HE.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function fi({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=t-(s.length-a-1);for(;o-- >0;)s+="0"}return s}const kL={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:fi},AL={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():fi(e)}},CL={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 Ye(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:fi},cm=e=>typeof e=="bigint"||Number.isInteger(e),zE=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function IL(e,t,n){const{value:r}=e;return cm(r)&&r>=0?n+r.toString(t):fi(e)}const OL={identify:e=>cm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>zE(e,2,8,n),stringify:e=>IL(e,8,"0o")},RL={identify:cm,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>zE(e,0,10,n),stringify:fi},LL={identify:e=>cm(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>zE(e,2,16,n),stringify:e=>IL(e,16,"0x")},lZ=[Ml,Dl,om,lm,HE,OL,RL,LL,kL,AL,CL];function YT(e){return typeof e=="bigint"||Number.isInteger(e)}const df=({value:e})=>JSON.stringify(e),cZ=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:df},{identify:e=>e==null,createNode:()=>new Ye(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:df},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:df},{identify:YT,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})=>YT(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:df}],uZ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},dZ=[Ml,Dl].concat(cZ,uZ),VE={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,"")),r=new Uint8Array(n.length);for(let i=0;i1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new ir(new Ye(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} +${i}${p}`}else return`${h}${a}${f.join(" ")}${a}${p}`}function rp({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=Wi(t(r),e);n.push(s.trimStart())}}function ba(e,t){const n=Rt(t)?t.value:t;for(const r of e)if(mn(r)&&(r.key===t||r.key===n||Rt(r.key)&&r.key.value===n))return r}class Vr extends vL{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Bs,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:s}=r,a=new this(t),o=(l,c)=>{if(typeof s=="function")c=s.call(n,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||i)&&a.items.push(HE(l,c,r))};if(n instanceof Map)for(const[l,c]of n)o(l,c);else if(n&&typeof n=="object")for(const l of Object.keys(n))o(l,n[l]);return typeof t.sortMapEntries=="function"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;let r;mn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new lr(t,t==null?void 0:t.value):r=new lr(t.key,t.value);const i=ba(this.items,r.key),s=(a=this.schema)==null?void 0:a.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Rt(i.value)&&xL(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const o=this.items.findIndex(l=>s(r,l)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=ba(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=ba(this.items,t),i=r==null?void 0:r.value;return(!n&&Rt(i)?i.value:i)??void 0}has(t){return!!ba(this.items,t)}set(t,n){this.add(new lr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(i);for(const s of this.items)kL(n,i,s);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!mn(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})),AL(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Ul={collection:"map",default:!0,nodeClass:Vr,tag:"tag:yaml.org,2002:map",resolve(e,t){return md(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Vr.from(e,t,n)};class ja extends vL{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(jl,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=hf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=hf(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Rt(i)?i.value:i}has(t){const n=hf(t);return typeof n=="number"&&n=0?t:null}const $l={collection:"seq",default:!0,nodeClass:ja,tag:"tag:yaml.org,2002:seq",resolve(e,t){return gd(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ja.from(e,t,n)},lm={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),$E(e,t,n,r)}},cm={identify:e=>e==null,createNode:()=>new Ye(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ye(null),stringify:({source:e},t)=>typeof e=="string"&&cm.test.test(e)?e:t.options.nullStr},zE={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ye(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&zE.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function bi({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let o=t-(s.length-a-1);for(;o-- >0;)s+="0"}return s}const CL={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:bi},IL={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():bi(e)}},RL={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 Ye(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:bi},um=e=>typeof e=="bigint"||Number.isInteger(e),VE=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function OL(e,t,n){const{value:r}=e;return um(r)&&r>=0?n+r.toString(t):bi(e)}const LL={identify:e=>um(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>VE(e,2,8,n),stringify:e=>OL(e,8,"0o")},ML={identify:um,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>VE(e,0,10,n),stringify:bi},DL={identify:e=>um(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>VE(e,2,16,n),stringify:e=>OL(e,16,"0x")},pZ=[Ul,$l,lm,cm,zE,LL,ML,DL,CL,IL,RL];function WT(e){return typeof e=="bigint"||Number.isInteger(e)}const pf=({value:e})=>JSON.stringify(e),mZ=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:pf},{identify:e=>e==null,createNode:()=>new Ye(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:pf},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:pf},{identify:WT,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})=>WT(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:pf}],gZ={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},yZ=[Ul,$l].concat(mZ,gZ),KE={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,"")),r=new Uint8Array(n.length);for(let i=0;i1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new lr(new Ye(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore} ${i.key.commentBefore}`:r.commentBefore),r.comment){const s=i.value??i.key;s.comment=s.comment?`${r.comment} -${s.comment}`:r.comment}r=i}e.items[n]=pn(r)?r:new ir(r)}}else t("Expected a sequence for this tag");return e}function DL(e,t,n){const{replacer:r}=n,i=new Oa(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(s++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const c=Object.keys(a);if(c.length===1)o=c[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=a;i.items.push($E(o,l,n))}return i}const KE={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ML,createNode:DL};class Bo extends Oa{constructor(){super(),this.add=Br.prototype.add.bind(this),this.delete=Br.prototype.delete.bind(this),this.get=Br.prototype.get.bind(this),this.has=Br.prototype.has.bind(this),this.set=Br.prototype.set.bind(this),this.tag=Bo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let s,a;if(pn(i)?(s=$r(i.key,"",n),a=$r(i.value,s,n)):s=$r(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}static from(t,n,r){const i=DL(t,n,r),s=new this;return s.items=i.items,s}}Bo.tag="tag:yaml.org,2002:omap";const YE={collection:"seq",identify:e=>e instanceof Map,nodeClass:Bo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=ML(e,t),r=[];for(const{key:i}of n.items)Pt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Bo,n)},createNode:(e,t,n)=>Bo.from(e,t,n)};function PL({value:e,source:t},n){return t&&(e?jL:BL).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const jL={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 Ye(!0),stringify:PL},BL={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 Ye(!1),stringify:PL},fZ={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:fi},hZ={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():fi(e)}},pZ={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 Ye(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:fi},fd=e=>typeof e=="bigint"||Number.isInteger(e);function um(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){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 s=parseInt(e,n);return i==="-"?-1*s:s}function WE(e,t,n){const{value:r}=e;if(fd(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return fi(e)}const mZ={identify:fd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>um(e,2,2,n),stringify:e=>WE(e,2,"0b")},gZ={identify:fd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>um(e,1,8,n),stringify:e=>WE(e,8,"0")},yZ={identify:fd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>um(e,0,10,n),stringify:fi},bZ={identify:fd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>um(e,2,16,n),stringify:e=>WE(e,16,"0x")};class Fo extends Br{constructor(t){super(t),this.tag=Fo.tag}add(t){let n;pn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new ir(t.key,null):n=new ir(t,null),fa(this.items,n.key)||this.items.push(n)}get(t,n){const r=fa(this.items,t);return!n&&pn(r)?Pt(r.key)?r.key.value:r.key:r}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 r=fa(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new ir(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),s.items.push($E(a,null,r));return s}}Fo.tag="tag:yaml.org,2002:set";const qE={collection:"map",identify:e=>e instanceof Set,nodeClass:Fo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Fo.from(e,t,n),resolve(e,t){if(ud(e)){if(e.hasAllNullValues(!0))return Object.assign(new Fo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function GE(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),s=r.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return n==="-"?i(-1)*s:s}function FL(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return fi(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const UL={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})=>GE(e,n),stringify:FL},$L={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=>GE(e,!1),stringify:FL},dm={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(dm.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,a,o]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,i,s||0,a||0,o||0,l);const d=t[8];if(d&&d!=="Z"){let f=GE(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},WT=[Ml,Dl,om,lm,jL,BL,mZ,gZ,yZ,bZ,fZ,hZ,pZ,VE,Wi,YE,KE,qE,UL,$L,dm],qT=new Map([["core",lZ],["failsafe",[Ml,Dl,om]],["json",dZ],["yaml11",WT],["yaml-1.1",WT]]),GT={binary:VE,bool:HE,float:CL,floatExp:AL,floatNaN:kL,floatTime:$L,int:RL,intHex:LL,intOct:OL,intTime:UL,map:Ml,merge:Wi,null:lm,omap:YE,pairs:KE,seq:Dl,set:qE,timestamp:dm},EZ={"tag:yaml.org,2002:binary":VE,"tag:yaml.org,2002:merge":Wi,"tag:yaml.org,2002:omap":YE,"tag:yaml.org,2002:pairs":KE,"tag:yaml.org,2002:set":qE,"tag:yaml.org,2002:timestamp":dm};function jg(e,t,n){const r=qT.get(t);if(r&&!e)return n&&!r.includes(Wi)?r.concat(Wi):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(qT.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Wi)),i.reduce((s,a)=>{const o=typeof a=="string"?GT[a]:a;if(!o){const l=JSON.stringify(a),c=Object.keys(GT).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(o)||s.push(o),s},[])}const xZ=(e,t)=>e.keyt.key?1:0;class XE{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?jg(t,"compat"):t?jg(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?EZ:{},this.tags=jg(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Ls,{value:Ml}),Object.defineProperty(this,ki,{value:om}),Object.defineProperty(this,Ol,{value:Dl}),this.sortMapEntries=typeof a=="function"?a:a===!0?xZ:null}clone(){const t=Object.create(XE.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function vZ(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=vL(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=s(e.commentBefore);n.unshift(Hi(c,""))}let a=!1,o=null;if(e.contents){if(hn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Hi(f,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}const c=o?void 0:()=>a=!0;let d=ol(e.contents,i,()=>o=null,c);o&&(d+=da(d,"",s(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(ol(e.contents,i));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const c=s(e.comment);c.includes(` -`)?(n.push("..."),n.push(Hi(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(Hi(s(c),"")))}return n.join(` +${s.comment}`:r.comment}r=i}e.items[n]=mn(r)?r:new lr(r)}}else t("Expected a sequence for this tag");return e}function jL(e,t,n){const{replacer:r}=n,i=new ja(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof r=="function"&&(a=r.call(t,String(s++),a));let o,l;if(Array.isArray(a))if(a.length===2)o=a[0],l=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const c=Object.keys(a);if(c.length===1)o=c[0],l=a[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=a;i.items.push(HE(o,l,n))}return i}const YE={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:PL,createNode:jL};class zo extends ja{constructor(){super(),this.add=Vr.prototype.add.bind(this),this.delete=Vr.prototype.delete.bind(this),this.get=Vr.prototype.get.bind(this),this.has=Vr.prototype.has.bind(this),this.set=Vr.prototype.set.bind(this),this.tag=zo.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items){let s,a;if(mn(i)?(s=Wr(i.key,"",n),a=Wr(i.value,s,n)):s=Wr(i,"",n),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,a)}return r}static from(t,n,r){const i=jL(t,n,r),s=new this;return s.items=i.items,s}}zo.tag="tag:yaml.org,2002:omap";const WE={collection:"seq",identify:e=>e instanceof Map,nodeClass:zo,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=PL(e,t),r=[];for(const{key:i}of n.items)Rt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new zo,n)},createNode:(e,t,n)=>zo.from(e,t,n)};function BL({value:e,source:t},n){return t&&(e?FL:UL).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const FL={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 Ye(!0),stringify:BL},UL={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 Ye(!1),stringify:BL},bZ={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:bi},EZ={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():bi(e)}},xZ={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 Ye(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:bi},yd=e=>typeof e=="bigint"||Number.isInteger(e);function dm(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){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 s=parseInt(e,n);return i==="-"?-1*s:s}function qE(e,t,n){const{value:r}=e;if(yd(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return bi(e)}const vZ={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>dm(e,2,2,n),stringify:e=>qE(e,2,"0b")},wZ={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>dm(e,1,8,n),stringify:e=>qE(e,8,"0")},_Z={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>dm(e,0,10,n),stringify:bi},TZ={identify:yd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>dm(e,2,16,n),stringify:e=>qE(e,16,"0x")};class Vo extends Vr{constructor(t){super(t),this.tag=Vo.tag}add(t){let n;mn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new lr(t.key,null):n=new lr(t,null),ba(this.items,n.key)||this.items.push(n)}get(t,n){const r=ba(this.items,t);return!n&&mn(r)?Rt(r.key)?r.key.value:r.key:r}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 r=ba(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new lr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,s=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof i=="function"&&(a=i.call(n,a,a)),s.items.push(HE(a,null,r));return s}}Vo.tag="tag:yaml.org,2002:set";const GE={collection:"map",identify:e=>e instanceof Set,nodeClass:Vo,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Vo.from(e,t,n),resolve(e,t){if(md(e)){if(e.hasAllNullValues(!0))return Object.assign(new Vo,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function XE(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=a=>t?BigInt(a):Number(a),s=r.replace(/_/g,"").split(":").reduce((a,o)=>a*i(60)+i(o),i(0));return n==="-"?i(-1)*s:s}function $L(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return bi(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const HL={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})=>XE(e,n),stringify:$L},zL={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=>XE(e,!1),stringify:$L},fm={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(fm.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,s,a,o]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,r-1,i,s||0,a||0,o||0,l);const d=t[8];if(d&&d!=="Z"){let f=XE(d,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},qT=[Ul,$l,lm,cm,FL,UL,vZ,wZ,_Z,TZ,bZ,EZ,xZ,KE,Zi,WE,YE,GE,HL,zL,fm],GT=new Map([["core",pZ],["failsafe",[Ul,$l,lm]],["json",yZ],["yaml11",qT],["yaml-1.1",qT]]),XT={binary:KE,bool:zE,float:RL,floatExp:IL,floatNaN:CL,floatTime:zL,int:ML,intHex:DL,intOct:LL,intTime:HL,map:Ul,merge:Zi,null:cm,omap:WE,pairs:YE,seq:$l,set:GE,timestamp:fm},NZ={"tag:yaml.org,2002:binary":KE,"tag:yaml.org,2002:merge":Zi,"tag:yaml.org,2002:omap":WE,"tag:yaml.org,2002:pairs":YE,"tag:yaml.org,2002:set":GE,"tag:yaml.org,2002:timestamp":fm};function Bg(e,t,n){const r=GT.get(t);if(r&&!e)return n&&!r.includes(Zi)?r.concat(Zi):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const s=Array.from(GT.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${s} or define customTags array`)}if(Array.isArray(e))for(const s of e)i=i.concat(s);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Zi)),i.reduce((s,a)=>{const o=typeof a=="string"?XT[a]:a;if(!o){const l=JSON.stringify(a),c=Object.keys(XT).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(o)||s.push(o),s},[])}const SZ=(e,t)=>e.keyt.key?1:0;class QE{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(t)?Bg(t,"compat"):t?Bg(null,t):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?NZ:{},this.tags=Bg(n,this.name,r),this.toStringOptions=o??null,Object.defineProperty(this,Bs,{value:Ul}),Object.defineProperty(this,Oi,{value:lm}),Object.defineProperty(this,jl,{value:$l}),this.sortMapEntries=typeof a=="function"?a:a===!0?SZ:null}clone(){const t=Object.create(QE.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function kZ(e,t){var l;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const c=e.directives.toString(e);c?(n.push(c),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=_L(e,t),{commentString:s}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const c=s(e.commentBefore);n.unshift(Wi(c,""))}let a=!1,o=null;if(e.contents){if(pn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const f=s(e.contents.commentBefore);n.push(Wi(f,""))}i.forceBlockIndent=!!e.comment,o=e.contents.comment}const c=o?void 0:()=>a=!0;let d=fl(e.contents,i,()=>o=null,c);o&&(d+=ya(d,"",s(o))),(d[0]==="|"||d[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${d}`:n.push(d)}else n.push(fl(e.contents,i));if((l=e.directives)!=null&&l.docEnd)if(e.comment){const c=s(e.comment);c.includes(` +`)?(n.push("..."),n.push(Wi(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=e.comment;c&&a&&(c=c.replace(/^\n+/,"")),c&&((!a||o)&&n[n.length-1]!==""&&n.push(""),n.push(Wi(s(c),"")))}return n.join(` `)+` -`}class hd{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Kr,{value:Gy});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new er({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(hd.prototype,{[Kr]:{value:Gy}});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=hn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Qa(this.contents)&&this.contents.add(t)}addIn(t,n){Qa(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=gL(this);t.anchor=!n||r.has(n)?yL(n||"a",r):n}return new FE(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const v=E=>typeof E=="number"||E instanceof String||E instanceof Number,g=n.filter(v).map(String);g.length>0&&(n=n.concat(g)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:c,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=GQ(this,a||"a"),m={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},y=Au(t,d,m);return o&&fn(y)&&(y.flow=!0),h(),y}createPair(t,n,r={}){const i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new ir(i,s)}delete(t){return Qa(this.contents)?this.contents.delete(t):!1}deleteIn(t){return yc(t)?this.contents==null?!1:(this.contents=null,!0):Qa(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return fn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return yc(t)?!n&&Pt(this.contents)?this.contents.value:this.contents:fn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return fn(this.contents)?this.contents.has(t):!1}hasIn(t){return yc(t)?this.contents!==void 0:fn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=ep(this.schema,[t],n):Qa(this.contents)&&this.contents.set(t,n)}setIn(t,n){yc(t)?this.contents=n:this.contents==null?this.contents=ep(this.schema,Array.from(t),n):Qa(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new er({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new er({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=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(r)this.schema=new XE(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=$r(this.contents,n??"",o);if(typeof s=="function")for(const{count:c,res:d}of o.anchors.values())s(d,c);return typeof a=="function"?ko(a,{"":l},"",l):l}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 vZ(this,t)}}function Qa(e){if(fn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class HL extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class bc extends HL{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class wZ extends HL{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const XT=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const o=Math.min(s-39,a.length-79);a="…"+a.substring(o),s-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,s))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`… +`}class bd{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qr,{value:Xy});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:a}=s;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new ir({version:a}),this.setSchema(a,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(bd.prototype,{[Qr]:{value:Xy}});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=pn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){no(this.contents)&&this.contents.add(t)}addIn(t,n){no(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=bL(this);t.anchor=!n||r.has(n)?EL(n||"a",r):n}return new UE(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const v=E=>typeof E=="number"||E instanceof String||E instanceof Number,g=n.filter(v).map(String);g.length>0&&(n=n.concat(g)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:o,keepUndefined:l,onTagObj:c,tag:d}=r??{},{onAnchor:f,setAnchors:h,sourceObjects:p}=tZ(this,a||"a"),m={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:p},y=Lu(t,d,m);return o&&hn(y)&&(y.flow=!0),h(),y}createPair(t,n,r={}){const i=this.createNode(t,null,r),s=this.createNode(n,null,r);return new lr(i,s)}delete(t){return no(this.contents)?this.contents.delete(t):!1}deleteIn(t){return wc(t)?this.contents==null?!1:(this.contents=null,!0):no(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return hn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return wc(t)?!n&&Rt(this.contents)?this.contents.value:this.contents:hn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return hn(this.contents)?this.contents.has(t):!1}hasIn(t){return wc(t)?this.contents!==void 0:hn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=np(this.schema,[t],n):no(this.contents)&&this.contents.set(t,n)}setIn(t,n){wc(t)?this.contents=n:this.contents==null?this.contents=np(this.schema,Array.from(t),n):no(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new ir({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new ir({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=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(r)this.schema=new QE(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:a}={}){const o={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Wr(this.contents,n??"",o);if(typeof s=="function")for(const{count:c,res:d}of o.anchors.values())s(d,c);return typeof a=="function"?Oo(a,{"":l},"",l):l}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 kZ(this,t)}}function no(e){if(hn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class VL extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class _c extends VL{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class AZ extends VL{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const QT=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(o=>t.linePos(o));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,a=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const o=Math.min(s-39,a.length-79);a="…"+a.substring(o),s-=o-1}if(a.length>80&&(a=a.substring(0,79)+"…"),r>1&&/^ *$/.test(a.substring(0,s))){let o=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);o.length>80&&(o=o.substring(0,79)+`… `),a=o+a}if(/[^ ]/.test(a)){let o=1;const l=n.linePos[1];(l==null?void 0:l.line)===r&&l.col>i&&(o=Math.max(1,Math.min(l.col-i,80-s)));const c=" ".repeat(s)+"^".repeat(o);n.message+=`: ${a} ${c} -`}};function ll(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:a,startOnNewline:o}){let l=!1,c=o,d=o,f="",h="",p=!1,m=!1,y=null,v=null,g=null,E=null,b=null,w=null,N=null;for(const S of e)switch(m&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&s(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),y&&(c&&S.type!=="comment"&&S.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(y=S),d=!0;break;case"comment":{d||s(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const O=S.source.substring(1)||" ";f?f+=h+O:f=O,h="",c=!1;break}case"newline":c?f?f+=S.source:(!w||n!=="seq-item-ind")&&(l=!0):h+=S.source,c=!0,p=!0,(v||g)&&(E=S),d=!0;break;case"anchor":v&&s(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&s(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=S,N??(N=S.offset),c=!1,d=!1,m=!0;break;case"tag":{g&&s(S,"MULTIPLE_TAGS","A node can have at most one tag"),g=S,N??(N=S.offset),c=!1,d=!1,m=!0;break}case n:(v||g)&&s(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),w&&s(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`),w=S,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){b&&s(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=S,c=!1,d=!1;break}default:s(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,d=!1}const T=e[e.length-1],A=T?T.offset+T.source.length:i;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(c&&y.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:w,spaceBefore:l,comment:f,hasNewline:p,anchor:v,tag:g,newlineAfterProp:E,end:A,start:N??A}}function Cu(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(Cu(t.key)||Cu(t.value))return!0}return!1;default:return!0}}function Jy(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Cu(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function zL(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,a)=>s===a||Pt(s)&&Pt(a)&&s.value===a.value;return t.some(s=>i(s.key,n))}const QT="All mapping items must start at the same column";function _Z({composeNode:e,composeEmptyNode:t},n,r,i,s){var d;const a=(s==null?void 0:s.nodeClass)??Br,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,c=null;for(const f of r.items){const{start:h,key:p,sep:m,value:y}=f,v=ll(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!v.found;if(g){if(p&&(p.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(l,"BAD_INDENT",QT)),!v.anchor&&!v.tag&&!m){c=v.end,v.comment&&(o.comment?o.comment+=` -`+v.comment:o.comment=v.comment);continue}(v.newlineAfterProp||Cu(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)!==r.indent&&i(l,"BAD_INDENT",QT);n.atKey=!0;const E=v.end,b=p?e(n,p,v,i):t(n,E,h,null,v,i);n.schema.compat&&Jy(r.indent,p,i),n.atKey=!1,zL(n,o.items,b)&&i(E,"DUPLICATE_KEY","Map keys must be unique");const w=ll(m??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=w.end,w.found){g&&((y==null?void 0:y.type)==="block-map"&&!w.hasNewline&&i(l,"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 NZ({composeNode:e,composeEmptyNode:t},n,r,i,s){var v;const a=r.start.source==="{",o=a?"flow map":"flow sequence",l=(s==null?void 0:s.nodeClass)??(a?Br:Oa),c=new l(n.schema);c.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g0){const g=pd(m,y,n.options.strict,i);g.comment&&(c.comment?c.comment+=` -`+g.comment:c.comment=g.comment),c.range=[r.offset,y,g.offset]}else c.range=[r.offset,y,y];return c}function Ug(e,t,n,r,i,s){const a=n.type==="block-map"?_Z(e,t,n,r,s):n.type==="block-seq"?TZ(e,t,n,r,s):NZ(e,t,n,r,s),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function SZ(e,t,n,r,i){var h;const s=r.tag,a=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,y=p&&s?p.offset>s.offset?p:s:p??s;y&&(!m||m.offsetp.tag===a&&p.collection===o);if(!l){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Ug(e,t,n,i,a)}const c=Ug(e,t,n,i,a,l),d=((h=l.resolve)==null?void 0:h.call(l,c,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options))??c,f=hn(d)?d:new Ye(d);return f.range=c.range,f.tag=a,l!=null&&l.format&&(f.format=l.format),f}function kZ(e,t,n){const r=t.offset,i=AZ(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Ye.BLOCK_FOLDED:Ye.BLOCK_LITERAL,a=t.source?CZ(t.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const v=a[y][1];if(v===""||v==="\r")o=y;else break}if(o===0){const y=i.chomp==="+"&&a.length>0?` +`}};function hl(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:a,startOnNewline:o}){let l=!1,c=o,d=o,f="",h="",p=!1,m=!1,y=null,v=null,g=null,E=null,b=null,w=null,N=null;for(const S of e)switch(m&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&s(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),y&&(c&&S.type!=="comment"&&S.type!=="newline"&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),S.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&S.source.includes(" ")&&(y=S),d=!0;break;case"comment":{d||s(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=S.source.substring(1)||" ";f?f+=h+R:f=R,h="",c=!1;break}case"newline":c?f?f+=S.source:(!w||n!=="seq-item-ind")&&(l=!0):h+=S.source,c=!0,p=!0,(v||g)&&(E=S),d=!0;break;case"anchor":v&&s(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&s(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=S,N??(N=S.offset),c=!1,d=!1,m=!0;break;case"tag":{g&&s(S,"MULTIPLE_TAGS","A node can have at most one tag"),g=S,N??(N=S.offset),c=!1,d=!1,m=!0;break}case n:(v||g)&&s(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),w&&s(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`),w=S,c=n==="seq-item-ind"||n==="explicit-key-ind",d=!1;break;case"comma":if(t){b&&s(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),b=S,c=!1,d=!1;break}default:s(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),c=!1,d=!1}const T=e[e.length-1],A=T?T.offset+T.source.length:i;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(c&&y.indent<=a||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&s(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:b,found:w,spaceBefore:l,comment:f,hasNewline:p,anchor:v,tag:g,newlineAfterProp:E,end:A,start:N??A}}function Mu(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(Mu(t.key)||Mu(t.value))return!0}return!1;default:return!0}}function e1(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Mu(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function KL(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,a)=>s===a||Rt(s)&&Rt(a)&&s.value===a.value;return t.some(s=>i(s.key,n))}const ZT="All mapping items must start at the same column";function CZ({composeNode:e,composeEmptyNode:t},n,r,i,s){var d;const a=(s==null?void 0:s.nodeClass)??Vr,o=new a(n.schema);n.atRoot&&(n.atRoot=!1);let l=r.offset,c=null;for(const f of r.items){const{start:h,key:p,sep:m,value:y}=f,v=hl(h,{indicator:"explicit-key-ind",next:p??(m==null?void 0:m[0]),offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),g=!v.found;if(g){if(p&&(p.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in p&&p.indent!==r.indent&&i(l,"BAD_INDENT",ZT)),!v.anchor&&!v.tag&&!m){c=v.end,v.comment&&(o.comment?o.comment+=` +`+v.comment:o.comment=v.comment);continue}(v.newlineAfterProp||Mu(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)!==r.indent&&i(l,"BAD_INDENT",ZT);n.atKey=!0;const E=v.end,b=p?e(n,p,v,i):t(n,E,h,null,v,i);n.schema.compat&&e1(r.indent,p,i),n.atKey=!1,KL(n,o.items,b)&&i(E,"DUPLICATE_KEY","Map keys must be unique");const w=hl(m??[],{indicator:"map-value-ind",next:y,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!p||p.type==="block-scalar"});if(l=w.end,w.found){g&&((y==null?void 0:y.type)==="block-map"&&!w.hasNewline&&i(l,"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 RZ({composeNode:e,composeEmptyNode:t},n,r,i,s){var v;const a=r.start.source==="{",o=a?"flow map":"flow sequence",l=(s==null?void 0:s.nodeClass)??(a?Vr:ja),c=new l(n.schema);c.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let g=0;g0){const g=Ed(m,y,n.options.strict,i);g.comment&&(c.comment?c.comment+=` +`+g.comment:c.comment=g.comment),c.range=[r.offset,y,g.offset]}else c.range=[r.offset,y,y];return c}function $g(e,t,n,r,i,s){const a=n.type==="block-map"?CZ(e,t,n,r,s):n.type==="block-seq"?IZ(e,t,n,r,s):RZ(e,t,n,r,s),o=a.constructor;return i==="!"||i===o.tagName?(a.tag=o.tagName,a):(i&&(a.tag=i),a)}function OZ(e,t,n,r,i){var h;const s=r.tag,a=s?t.directives.tagName(s.source,p=>i(s,"TAG_RESOLVE_FAILED",p)):null;if(n.type==="block-seq"){const{anchor:p,newlineAfterProp:m}=r,y=p&&s?p.offset>s.offset?p:s:p??s;y&&(!m||m.offsetp.tag===a&&p.collection===o);if(!l){const p=t.schema.knownTags[a];if((p==null?void 0:p.collection)===o)t.schema.tags.push(Object.assign({},p,{default:!1})),l=p;else return p?i(s,"BAD_COLLECTION_TYPE",`${p.tag} used for ${o} collection, but expects ${p.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),$g(e,t,n,i,a)}const c=$g(e,t,n,i,a,l),d=((h=l.resolve)==null?void 0:h.call(l,c,p=>i(s,"TAG_RESOLVE_FAILED",p),t.options))??c,f=pn(d)?d:new Ye(d);return f.range=c.range,f.tag=a,l!=null&&l.format&&(f.format=l.format),f}function LZ(e,t,n){const r=t.offset,i=MZ(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?Ye.BLOCK_FOLDED:Ye.BLOCK_LITERAL,a=t.source?DZ(t.source):[];let o=a.length;for(let y=a.length-1;y>=0;--y){const v=a[y][1];if(v===""||v==="\r")o=y;else break}if(o===0){const y=i.chomp==="+"&&a.length>0?` `.repeat(Math.max(1,a.length-1)):"";let v=r+i.length;return t.source&&(v+=t.source.length),{value:y,type:s,comment:i.comment,range:[r,v,v]}}let l=t.indent+i.indent,c=t.offset+i.length,d=0;for(let y=0;yl&&(l=v.length);else{v.length=o;--y)a[y][0].length>l&&(o=y+1);let f="",h="",p=!1;for(let y=0;yl||g[0]===" "?(h===" "?h=` @@ -605,65 +605,65 @@ ${c} `+a[y][0].slice(l);f[f.length-1]!==` `&&(f+=` `);break;default:f+=` -`}const m=r+i.length+t.source.length;return{value:f,type:s,comment:i.comment,range:[r,m,m]}}function AZ({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],s=i[0];let a=0,o="",l=-1;for(let h=1;hn(r+h,p,m);switch(i){case"scalar":o=Ye.PLAIN,l=OZ(s,c);break;case"single-quoted-scalar":o=Ye.QUOTE_SINGLE,l=RZ(s,c);break;case"double-quoted-scalar":o=Ye.QUOTE_DOUBLE,l=LZ(s,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const d=r+s.length,f=pd(a,d,t,n);return{value:l,type:o,comment:f.comment,range:[r,d,f.offset]}}function OZ(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}`),VL(e)}function RZ(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),VL(e.slice(1,-1)).replace(/''/g,"'")}function VL(e){let t,n;try{t=new RegExp(`(.*?)(?n(r+h,p,m);switch(i){case"scalar":o=Ye.PLAIN,l=jZ(s,c);break;case"single-quoted-scalar":o=Ye.QUOTE_SINGLE,l=BZ(s,c);break;case"double-quoted-scalar":o=Ye.QUOTE_DOUBLE,l=FZ(s,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const d=r+s.length,f=Ed(a,d,t,n);return{value:l,type:o,comment:f.comment,range:[r,d,f.offset]}}function jZ(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}`),YL(e)}function BZ(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),YL(e.slice(1,-1)).replace(/''/g,"'")}function YL(e){let t,n;try{t=new RegExp(`(.*?)(?s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function MZ(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` +`)&&(n+=r>s?e.slice(s,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function UZ(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===` `||r==="\r")&&!(r==="\r"&&e[t+2]!==` `);)r===` `&&(n+=` -`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const DZ={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:` -`,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function PZ(e,t,n,r){const i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{const o=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}}function KL(e,t,n,r){const{value:i,type:s,comment:a,range:o}=t.type==="block-scalar"?kZ(e,t,r):IZ(t,e.options.strict,r),l=n?e.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[ki]:l?c=jZ(e.schema,i,l,n,r):t.type==="scalar"?c=BZ(e,i,t,r):c=e.schema[ki];let d;try{const f=c.resolve(i,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Pt(f)?f:new Ye(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new Ye(i)}return d.range=o,d.source=i,s&&(d.type=s),l&&(d.tag=l),c.format&&(d.format=c.format),a&&(d.comment=a),d}function jZ(e,t,n,r,i){var o;if(n==="!")return e[ki];const s=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(const l of s)if((o=l.test)!=null&&o.test(t))return l;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[ki])}function BZ({atKey:e,directives:t,schema:n},r,i,s){const a=n.tags.find(o=>{var l;return(o.default===!0||e&&o.default==="key")&&((l=o.test)==null?void 0:l.test(r))})||n[ki];if(n.compat){const o=n.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(r))})??n[ki];if(a.tag!==o.tag){const l=t.tagString(a.tag),c=t.tagString(o.tag),d=`Value may be parsed as either ${l} or ${c}`;s(i,"TAG_RESOLVE_FAILED",d,!0)}}return a}function FZ(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];(i==null?void 0:i.type)==="space";)e+=i.source.length,i=t[++r];break}}return e}const UZ={composeNode:YL,composeEmptyNode:QE};function YL(e,t,n,r){const i=e.atKey,{spaceBefore:s,comment:a,anchor:o,tag:l}=n;let c,d=!0;switch(t.type){case"alias":c=$Z(e,t,r),(o||l)&&r(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":c=KL(e,t,l,r),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=SZ(UZ,e,t,n,r),o&&(c.anchor=o.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),d=!1}}return c??(c=QE(e,t.offset,void 0,null,n,r)),o&&c.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Pt(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?c.comment=a:c.commentBefore=a),e.options.keepSourceTokens&&d&&(c.srcToken=t),c}function QE(e,t,n,r,{spaceBefore:i,comment:s,anchor:a,tag:o,end:l},c){const d={type:"scalar",offset:FZ(t,n,r),indent:-1,source:""},f=KL(e,d,o,c);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function $Z({options:e},{offset:t,source:n,end:r},i){const s=new FE(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,o=pd(r,a,e.strict,i);return s.range=[t,a,o.offset],o.comment&&(s.comment=o.comment),s}function HZ(e,t,{offset:n,start:r,value:i,end:s},a){const o=Object.assign({_directives:t},e),l=new hd(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=ll(r,{indicator:"doc-start",next:i??(s==null?void 0:s[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.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")),l.contents=i?YL(c,i,d,a):QE(c,d.end,r,null,d,a);const f=l.contents.range[2],h=pd(s,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function rc(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 ZT(e){var i;let t="",n=!1,r=!1;for(let s=0;sr(n,"TAG_RESOLVE_FAILED",f)):null;let c;e.options.stringKeys&&e.atKey?c=e.schema[Oi]:l?c=zZ(e.schema,i,l,n,r):t.type==="scalar"?c=VZ(e,i,t,r):c=e.schema[Oi];let d;try{const f=c.resolve(i,h=>r(n??t,"TAG_RESOLVE_FAILED",h),e.options);d=Rt(f)?f:new Ye(f)}catch(f){const h=f instanceof Error?f.message:String(f);r(n??t,"TAG_RESOLVE_FAILED",h),d=new Ye(i)}return d.range=o,d.source=i,s&&(d.type=s),l&&(d.tag=l),c.format&&(d.format=c.format),a&&(d.comment=a),d}function zZ(e,t,n,r,i){var o;if(n==="!")return e[Oi];const s=[];for(const l of e.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(const l of s)if((o=l.test)!=null&&o.test(t))return l;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Oi])}function VZ({atKey:e,directives:t,schema:n},r,i,s){const a=n.tags.find(o=>{var l;return(o.default===!0||e&&o.default==="key")&&((l=o.test)==null?void 0:l.test(r))})||n[Oi];if(n.compat){const o=n.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(r))})??n[Oi];if(a.tag!==o.tag){const l=t.tagString(a.tag),c=t.tagString(o.tag),d=`Value may be parsed as either ${l} or ${c}`;s(i,"TAG_RESOLVE_FAILED",d,!0)}}return a}function KZ(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];(i==null?void 0:i.type)==="space";)e+=i.source.length,i=t[++r];break}}return e}const YZ={composeNode:qL,composeEmptyNode:ZE};function qL(e,t,n,r){const i=e.atKey,{spaceBefore:s,comment:a,anchor:o,tag:l}=n;let c,d=!0;switch(t.type){case"alias":c=WZ(e,t,r),(o||l)&&r(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":c=WL(e,t,l,r),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=OZ(YZ,e,t,n,r),o&&(c.anchor=o.source.substring(1))}catch(f){const h=f instanceof Error?f.message:String(f);r(t,"RESOURCE_EXHAUSTION",h)}break;default:{const f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",f),d=!1}}return c??(c=ZE(e,t.offset,void 0,null,n,r)),o&&c.anchor===""&&r(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Rt(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?c.comment=a:c.commentBefore=a),e.options.keepSourceTokens&&d&&(c.srcToken=t),c}function ZE(e,t,n,r,{spaceBefore:i,comment:s,anchor:a,tag:o,end:l},c){const d={type:"scalar",offset:KZ(t,n,r),indent:-1,source:""},f=WL(e,d,o,c);return a&&(f.anchor=a.source.substring(1),f.anchor===""&&c(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function WZ({options:e},{offset:t,source:n,end:r},i){const s=new UE(n.substring(1));s.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,o=Ed(r,a,e.strict,i);return s.range=[t,a,o.offset],o.comment&&(s.comment=o.comment),s}function qZ(e,t,{offset:n,start:r,value:i,end:s},a){const o=Object.assign({_directives:t},e),l=new bd(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=hl(r,{indicator:"doc-start",next:i??(s==null?void 0:s[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});d.found&&(l.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")),l.contents=i?qL(c,i,d,a):ZE(c,d.end,r,null,d,a);const f=l.contents.range[2],h=Ed(s,f,!1,a);return h.comment&&(l.comment=h.comment),l.range=[n,f,h.offset],l}function lc(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 JT(e){var i;let t="",n=!1,r=!1;for(let s=0;s{const a=rc(n);s?this.warnings.push(new wZ(a,r,i)):this.errors.push(new bc(a,r,i))},this.directives=new er({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=ZT(this.prelude);if(r){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} -${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(fn(s)&&!s.flow&&s.items.length>0){let a=s.items[0];pn(a)&&(a=a.key);const o=a.commentBefore;a.commentBefore=o?`${r} +`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":((i=e[s+1])==null?void 0:i[0])!=="#"&&(s+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class GZ{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,s)=>{const a=lc(n);s?this.warnings.push(new AZ(a,r,i)):this.errors.push(new _c(a,r,i))},this.directives=new ir({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=JT(this.prelude);if(r){const s=t.contents;if(n)t.comment=t.comment?`${t.comment} +${r}`:r;else if(i||t.directives.docStart||!s)t.commentBefore=r;else if(hn(s)&&!s.flow&&s.items.length>0){let a=s.items[0];mn(a)&&(a=a.key);const o=a.commentBefore;a.commentBefore=o?`${r} ${o}`:r}else{const a=s.commentBefore;s.commentBefore=a?`${r} -${a}`:r}}if(n){for(let s=0;s{const s=rc(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=HZ(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,r=new bc(rc(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new bc(rc(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=pd(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} -${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new bc(rc(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 r=Object.assign({_directives:this.directives},this.options),i=new hd(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const WL="\uFEFF",qL="",GL="",e1="";function VZ(e){switch(e){case WL:return"byte-order-mark";case qL:return"doc-mode";case GL:return"flow-error-end";case e1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case` +${a}`:r}}if(n){for(let s=0;s{const s=lc(t);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=qZ(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,r=new _c(lc(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new _c(lc(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Ed(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r} +${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new _c(lc(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 r=Object.assign({_directives:this.directives},this.options),i=new bd(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const GL="\uFEFF",XL="",QL="",t1="";function XZ(e){switch(e){case GL:return"byte-order-mark";case XL:return"doc-mode";case QL:return"flow-error-end";case t1: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 Gr(e){switch(e){case void 0:case" ":case` -`:case"\r":case" ":return!0;default:return!1}}const JT=new Set("0123456789ABCDEFabcdef"),KZ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ff=new Set(",[]{}"),YZ=new Set(` ,[]{} -\r `),$g=e=>!e||YZ.has(e);class WZ{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 r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===` +`: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 ti(e){switch(e){case void 0:case" ":case` +`:case"\r":case" ":return!0;default:return!1}}const eN=new Set("0123456789ABCDEFabcdef"),QZ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),mf=new Set(",[]{}"),ZZ=new Set(` ,[]{} +\r `),Hg=e=>!e||ZZ.has(e);class JZ{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 r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}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 r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===` `||!i&&!this.atEnd)return t+r+1}return n===` -`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&Gr(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!Gr(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===":")&&Gr(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"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($g),"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,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ti(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&tthis.indentValue&&!ti(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===":")&&ti(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"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(Hg),"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,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>Gr(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case` +`,s)}i!==-1&&(n=i-(r[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=>ti(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":n+=1;break;case` `:t=s,n=0;break;case"\r":{const a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===` `)break}default:break e}if(!r&&!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 s=this.continueScalar(t+1);if(s===-1)break;t=this.buffer.indexOf(` `,s)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===` `;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let s=t-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);const o=s;for(;a===" ";)a=this.buffer[--s];if(a===` -`&&s>=this.pos&&s+1+n>o)t=s;else break}while(!0);return yield e1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(Gr(s)||t&&ff.has(s))break;n=r}else if(Gr(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===` +`&&s>=this.pos&&s+1+n>o)t=s;else break}while(!0);return yield t1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(ti(s)||t&&mf.has(s))break;n=r}else if(ti(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===` `?(r+=1,i=` -`,s=this.buffer[r+1]):n=r),s==="#"||t&&ff.has(s))break;if(i===` -`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&ff.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield e1,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 r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.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($g),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(Gr(r)||n&&ff.has(r)){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(;!Gr(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(KZ.has(n))n=this.buffer[++t];else if(n==="%"&&JT.has(this.buffer[t+1])&&JT.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===` +`,s=this.buffer[r+1]):n=r),s==="#"||t&&mf.has(s))break;if(i===` +`){const a=this.continueScalar(r+1);if(a===-1)break;r=Math.max(r,a-2)}}else{if(t&&mf.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield t1,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 r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.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(Hg),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,r=this.charAt(1);if(ti(r)||n&&mf.has(r)){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(;!ti(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(QZ.has(n))n=this.buffer[++t];else if(n==="%"&&eN.has(this.buffer[t+1])&&eN.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,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");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,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class qZ{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[s]=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 np(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 r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&tN(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.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=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.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((r.type==="document"||r.type==="block-map"||r.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&&eN(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class eJ{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n>1;this.lineStarts[s]=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 ip(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 r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&nN(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.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=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.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((r.type==="document"||r.type==="block-map"||r.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&&tN(i.start)===-1&&(n.indent===0||i.start.every(s=>s.type!=="comment"||s.indent=t.indent){const i=!this.onKeyLine&&this.indent===t.indent,s=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(s&&n.sep&&!n.value){const o=[];for(let l=0;lt.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||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):s||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(gs(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(XL(n.key)&&!gs(n.sep,"newline")){const o=Za(n.start),l=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(gs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=Za(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:a,key:null,sep:[this.sourceToken]}):gs(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 o=this.flowScalar(this.type);s||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!gs(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(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;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,s=Array.isArray(i)?i[i.length-1]:void 0;(s==null?void 0:s.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],s=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(s)){np(s,n.start),s.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||gs(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 r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.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 r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=hf(r),s=Za(i);tN(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}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 r;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,s=Array.isArray(i)?i[i.length-1]:void 0;(s==null?void 0:s.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],s=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(s)){ip(s,n.start),s.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,s=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(s&&n.sep&&!n.value){const o=[];for(let l=0;lt.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||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):s||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(vs(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(ZL(n.key)&&!vs(n.sep,"newline")){const o=ro(n.start),l=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(vs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=ro(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||s?t.items.push({start:a,key:null,sep:[this.sourceToken]}):vs(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 o=this.flowScalar(this.type);s||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!vs(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(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;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,s=Array.isArray(i)?i[i.length-1]:void 0;(s==null?void 0:s.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],s=(r=i==null?void 0:i.value)==null?void 0:r.end;if(Array.isArray(s)){ip(s,n.start),s.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||vs(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 r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.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 r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=gf(r),s=ro(i);nN(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}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=hf(t),r=Za(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=hf(t),r=Za(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.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 XZ(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new qZ||null,prettyErrors:t}}function QZ(e,t={}){const{lineCounter:n,prettyErrors:r}=XZ(t),i=new GZ(n==null?void 0:n.addNewLine),s=new zZ(t);let a=null;for(const o of s.compose(i.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new bc(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(XT(e,n)),a.warnings.forEach(XT(e,n))),a}function ZZ(e,t,n){let r;const i=QZ(e,n);if(!i)return null;if(i.warnings.forEach(s=>wL(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function JZ(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:i}={};if(!i)return}return cd(e)&&!r?e.toString(n):new hd(e,r,n).toString(n)}const eJ="doubao-seed-2-1-pro-260628",tJ="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",nJ=`你是一个专业、可靠的智能助手。 +`,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=gf(t),r=ro(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=gf(t),r=ro(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.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 nJ(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new eJ||null,prettyErrors:t}}function rJ(e,t={}){const{lineCounter:n,prettyErrors:r}=nJ(t),i=new tJ(n==null?void 0:n.addNewLine),s=new GZ(t);let a=null;for(const o of s.compose(i.parse(e),!0,e.length))if(!a)a=o;else if(a.options.logLevel!=="silent"){a.errors.push(new _c(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(a.errors.forEach(QT(e,n)),a.warnings.forEach(QT(e,n))),a}function iJ(e,t,n){let r;const i=rJ(e,n);if(!i)return null;if(i.warnings.forEach(s=>TL(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function sJ(e,t,n){let r=null;if(Array.isArray(t)&&(r=t),e===void 0){const{keepUndefined:i}={};if(!i)return}return pd(e)&&!r?e.toString(n):new bd(e,r,n).toString(n)}const aJ="https://ark.cn-beijing.volces.com/api/v3/",Jc=[{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:aJ}],pl=[],cc=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],Ji={topK:"3",region:"cn-beijing",endpoint:"https://open.volcengineapi.com/"},JL=[{key:"REGISTRY_SPACE_ID",required:!0,placeholder:"请输入 A2A 空间 ID",comment:"A2A 注册中心空间 ID"},{key:"REGISTRY_TOP_K",required:!1,placeholder:Ji.topK,comment:"召回 Agent 数量"},{key:"REGISTRY_REGION",required:!1,placeholder:Ji.region,comment:"A2A 注册中心地域"},{key:"REGISTRY_ENDPOINT",required:!1,placeholder:Ji.endpoint,comment:"A2A 注册中心 OpenAPI 地址"}],JE=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:pl},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:pl},{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:"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"}]}],sp=[{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}]}],ap=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:Jc,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},...Jc],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},...Jc],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:pl},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],op=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:Jc,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},...Jc],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:pl},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...pl,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],lp=[{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:[...pl,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],oJ=e=>JE.find(t=>t.id===e),lJ=e=>sp.find(t=>t.id===e),cJ=e=>ap.find(t=>t.id===e),uJ=e=>op.find(t=>t.id===e),dJ=e=>lp.find(t=>t.id===e),fJ="doubao-seed-2-1-pro-260628",hJ="一个基于 VeADK 构建的智能助手,理解用户意图并调用合适的工具完成任务。",pJ=`你是一个专业、可靠的智能助手。 你的目标是准确理解用户的需求,并给出条理清晰、简洁有用的回答。 约束: - 信息不足时主动提问澄清,不要臆造事实。 - 需要时合理调用可用的工具,并说明关键结论。 -- 保持礼貌、专业的语气。`;function Us(){return{name:"",description:tJ,instruction:nJ,agentType:"llm",maxIterations:3,a2aUrl:"",tools:[],skills:[],memory:{shortTerm:!1,longTerm:!1},knowledgebase:!1,tracing:!1,subAgents:[],builtinTools:[],customTools:[],mcpTools:[],modelName:eJ,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:"local",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const rJ=new Set(["local","sqlite","mysql","postgresql"]),iJ=new Set(["local","opensearch","redis","viking","mem0"]),sJ=new Set(["local","opensearch","viking","context_search"]),aJ=new Set(["apmplus","cozeloop","tls"]),QL=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","vesearch"]),oJ=new Set(["llm","sequential","parallel","loop","a2a"]);function pt(e,t=""){return typeof e=="string"?e:t}function Ja(e){return e===!0}function Zf(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function ZL(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:pt(t.name),description:pt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function Hg(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function JL(e){return typeof e=="string"&&oJ.has(e)?e:"llm"}function eM(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function tM(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{};return{...Us(),name:pt(n.name),description:pt(n.description),instruction:pt(n.instruction),agentType:JL(n.agentType),maxIterations:eM(n.maxIterations),a2aUrl:pt(n.a2aUrl),builtinTools:Zf(n.builtinTools).filter(r=>QL.has(r)),customTools:ZL(n.customTools),subAgents:tM(n.subAgents)}}):[]}function lJ(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},i=pt(r.source),s=i==="local"||i==="skillspace"||i==="skillhub"?i:"skillhub",a=pt(r.name)||pt(r.slug)||pt(r.skillName)||pt(r.skillId)||"skill",o=pt(r.folder)||a,l=pt(r.description);if(s==="skillhub"){const f=pt(r.slug);if(!f)continue;t.push({source:s,folder:o,name:a,description:l,slug:f,namespace:pt(r.namespace)||"public"});continue}if(s==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},y=pt(m.path),v=pt(m.content);return y?{path:y,content:v}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:s,folder:o,name:a,description:l,localFiles:h});continue}const c=pt(r.skillSpaceId),d=pt(r.skillId);!c||!d||t.push({source:s,folder:o,name:a,description:l,skillSpaceId:c,skillSpaceName:pt(r.skillSpaceName),skillId:d,version:pt(r.version)})}return t}function nM(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},r=t.deployment&&typeof t.deployment=="object"?t.deployment:{},i=Array.isArray(t.mcpTools)?t.mcpTools.map(s=>{const a=s&&typeof s=="object"?s:{},o=a.transport==="stdio"?"stdio":"http";return{name:pt(a.name),transport:o,url:pt(a.url),authToken:pt(a.authToken),command:pt(a.command),args:Zf(a.args)}}).filter(s=>s.transport==="http"?!!s.url:!!s.command):[];return{...Us(),name:pt(t.name)||"my_agent",description:pt(t.description),instruction:pt(t.instruction)||"You are a helpful assistant.",agentType:JL(t.agentType),maxIterations:eM(t.maxIterations),a2aUrl:pt(t.a2aUrl),modelName:pt(t.modelName),modelProvider:pt(t.modelProvider),modelApiBase:pt(t.modelApiBase),builtinTools:Zf(t.builtinTools).filter(s=>QL.has(s)),customTools:ZL(t.customTools),mcpTools:i,memory:{shortTerm:Ja(n.shortTerm),longTerm:Ja(n.longTerm)},shortTermBackend:Hg(t.shortTermBackend,rJ,"local"),longTermBackend:Hg(t.longTermBackend,iJ,"local"),autoSaveSession:Ja(t.autoSaveSession),knowledgebase:Ja(t.knowledgebase),knowledgebaseBackend:Hg(t.knowledgebaseBackend,sJ,"local"),tracing:Ja(t.tracing),tracingExporters:Zf(t.tracingExporters).filter(s=>aJ.has(s)),deployment:{feishuEnabled:Ja(r.feishuEnabled)},subAgents:tM(t.subAgents),selectedSkills:lJ(t)}}function cJ(e){var n,r,i,s,a,o,l,c,d,f,h,p;const t={name:e.name,description:e.description,instruction:e.instruction};return(n=e.modelName)!=null&&n.trim()&&(t.modelName=e.modelName.trim()),(r=e.modelProvider)!=null&&r.trim()&&(t.modelProvider=e.modelProvider.trim()),(i=e.modelApiBase)!=null&&i.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(s=e.builtinTools)!=null&&s.length&&(t.builtinTools=[...e.builtinTools]),(a=e.customTools)!=null&&a.length&&(t.customTools=e.customTools.map(m=>({name:m.name,description:m.description}))),(o=e.mcpTools)!=null&&o.length&&(t.mcpTools=e.mcpTools.map(m=>{var v,g,E,b;const y={name:m.name,transport:m.transport};return(v=m.url)!=null&&v.trim()&&(y.url=m.url.trim()),(g=m.authToken)!=null&&g.trim()&&(y.authToken=m.authToken.trim()),(E=m.command)!=null&&E.trim()&&(y.command=m.command.trim()),(b=m.args)!=null&&b.length&&(y.args=m.args),y})),((l=e.memory)!=null&&l.shortTerm||(c=e.memory)!=null&&c.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||"local"),e.tracing&&((d=e.tracingExporters)!=null&&d.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(f=e.deployment)!=null&&f.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(h=e.selectedSkills)!=null&&h.length&&(t.selectedSkills=e.selectedSkills.map(m=>{const y={source:m.source,name:m.name,folder:m.folder};return m.description&&(y.description=m.description),m.source==="skillhub"?(y.slug=m.slug,y.namespace=m.namespace??"public"):m.source==="local"?y.localFiles=m.localFiles??[]:(y.skillSpaceId=m.skillSpaceId,y.skillSpaceName=m.skillSpaceName,y.skillId=m.skillId,m.version&&(y.version=m.version)),y})),(p=e.subAgents)!=null&&p.length&&(t.subAgents=e.subAgents.map(m=>{var v,g;const y={name:m.name,description:m.description,instruction:m.instruction};return(v=m.builtinTools)!=null&&v.length&&(y.builtinTools=[...m.builtinTools]),(g=m.customTools)!=null&&g.length&&(y.customTools=m.customTools.map(E=>({name:E.name,description:E.description}))),y})),t}function uJ(e){return`# VeADK Agent 结构配置 +- 保持礼貌、专业的语气。`;function Ks(){return{name:"",description:hJ,instruction:pJ,agentType:"llm",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:fJ,modelProvider:"",modelApiBase:"",shortTermBackend:"local",longTermBackend:"local",autoSaveSession:!1,knowledgebaseBackend:"local",tracingExporters:[],selectedSkills:[],deployment:{feishuEnabled:!1}}}const mJ=new Set(["local","sqlite","mysql","postgresql"]),gJ=new Set(["local","opensearch","redis","viking","mem0"]),yJ=new Set(["local","opensearch","viking","context_search"]),bJ=new Set(["apmplus","cozeloop","tls"]),eM=new Set(["web_search","parallel_web_search","link_reader","web_scraper","image_generate","image_edit","video_generate","text_to_speech","vesearch"]),EJ=new Set(["llm","sequential","parallel","loop","a2a"]);function rt(e,t=""){return typeof e=="string"?e:t}function la(e){return e===!0}function eh(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function tM(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?{name:rt(t.name),description:rt(t.description)}:null).filter(t=>!!t&&!!t.name.trim()):[]}function zg(e,t,n){return typeof e=="string"&&t.has(e)?e:n}function nM(e){return typeof e=="string"&&EJ.has(e)?e:"llm"}function rM(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):3}function iM(e){const t=e&&typeof e=="object"?e:{};return{enabled:la(t.enabled),registrySpaceId:rt(t.registrySpaceId),registryTopK:rt(t.registryTopK),registryRegion:rt(t.registryRegion),registryEndpoint:rt(t.registryEndpoint)}}function sM(e){return Array.isArray(e)?e.map(t=>{const n=t&&typeof t=="object"?t:{};return{...Ks(),name:rt(n.name),description:rt(n.description),instruction:rt(n.instruction),agentType:nM(n.agentType),maxIterations:rM(n.maxIterations),a2aUrl:rt(n.a2aUrl),builtinTools:eh(n.builtinTools).filter(r=>eM.has(r)),customTools:tM(n.customTools),a2aRegistry:iM(n.a2aRegistry),subAgents:sM(n.subAgents)}}):[]}function xJ(e){if(!Array.isArray(e.selectedSkills))return[];const t=[];for(const n of e.selectedSkills){const r=n&&typeof n=="object"?n:{},i=rt(r.source),s=i==="local"||i==="skillspace"||i==="skillhub"?i:"skillhub",a=rt(r.name)||rt(r.slug)||rt(r.skillName)||rt(r.skillId)||"skill",o=rt(r.folder)||a,l=rt(r.description);if(s==="skillhub"){const f=rt(r.slug);if(!f)continue;t.push({source:s,folder:o,name:a,description:l,slug:f,namespace:rt(r.namespace)||"public"});continue}if(s==="local"){const h=(Array.isArray(r.localFiles)?r.localFiles:[]).map(p=>{const m=p&&typeof p=="object"?p:{},y=rt(m.path),v=rt(m.content);return y?{path:y,content:v}:null}).filter(p=>p!==null);if(h.length===0)continue;t.push({source:s,folder:o,name:a,description:l,localFiles:h});continue}const c=rt(r.skillSpaceId),d=rt(r.skillId);!c||!d||t.push({source:s,folder:o,name:a,description:l,skillSpaceId:c,skillSpaceName:rt(r.skillSpaceName),skillId:d,version:rt(r.version)})}return t}function aM(e){const t=e&&typeof e=="object"?e:{},n=t.memory&&typeof t.memory=="object"?t.memory:{},r=t.deployment&&typeof t.deployment=="object"?t.deployment:{},i=Array.isArray(t.mcpTools)?t.mcpTools.map(s=>{const a=s&&typeof s=="object"?s:{},o=a.transport==="stdio"?"stdio":"http";return{name:rt(a.name),transport:o,url:rt(a.url),authToken:rt(a.authToken),command:rt(a.command),args:eh(a.args)}}).filter(s=>s.transport==="http"?!!s.url:!!s.command):[];return{...Ks(),name:rt(t.name)||"my_agent",description:rt(t.description),instruction:rt(t.instruction)||"You are a helpful assistant.",agentType:nM(t.agentType),maxIterations:rM(t.maxIterations),a2aUrl:rt(t.a2aUrl),modelName:rt(t.modelName),modelProvider:rt(t.modelProvider),modelApiBase:rt(t.modelApiBase),builtinTools:eh(t.builtinTools).filter(s=>eM.has(s)),customTools:tM(t.customTools),mcpTools:i,a2aRegistry:iM(t.a2aRegistry),memory:{shortTerm:la(n.shortTerm),longTerm:la(n.longTerm)},shortTermBackend:zg(t.shortTermBackend,mJ,"local"),longTermBackend:zg(t.longTermBackend,gJ,"local"),autoSaveSession:la(t.autoSaveSession),knowledgebase:la(t.knowledgebase),knowledgebaseBackend:zg(t.knowledgebaseBackend,yJ,"local"),tracing:la(t.tracing),tracingExporters:eh(t.tracingExporters).filter(s=>bJ.has(s)),deployment:{feishuEnabled:la(r.feishuEnabled)},subAgents:sM(t.subAgents),selectedSkills:xJ(t)}}function oM(e){var n,r,i,s,a,o,l,c,d,f,h,p,m,y,v,g,E;const t={name:e.name,description:e.description,instruction:e.instruction};if((n=e.modelName)!=null&&n.trim()&&(t.modelName=e.modelName.trim()),(r=e.modelProvider)!=null&&r.trim()&&(t.modelProvider=e.modelProvider.trim()),(i=e.modelApiBase)!=null&&i.trim()&&(t.modelApiBase=e.modelApiBase.trim()),(s=e.builtinTools)!=null&&s.length&&(t.builtinTools=[...e.builtinTools]),(a=e.customTools)!=null&&a.length&&(t.customTools=e.customTools.map(b=>({name:b.name,description:b.description}))),(o=e.mcpTools)!=null&&o.length&&(t.mcpTools=e.mcpTools.map(b=>{var N,T,A,S;const w={name:b.name,transport:b.transport};return(N=b.url)!=null&&N.trim()&&(w.url=b.url.trim()),(T=b.authToken)!=null&&T.trim()&&(w.authToken=b.authToken.trim()),(A=b.command)!=null&&A.trim()&&(w.command=b.command.trim()),(S=b.args)!=null&&S.length&&(w.args=b.args),w})),(l=e.a2aRegistry)!=null&&l.enabled){const b={enabled:!0};(c=e.a2aRegistry.registrySpaceId)!=null&&c.trim()&&(b.registrySpaceId=e.a2aRegistry.registrySpaceId.trim()),b.registryTopK=((d=e.a2aRegistry.registryTopK)==null?void 0:d.trim())||Ji.topK,b.registryRegion=((f=e.a2aRegistry.registryRegion)==null?void 0:f.trim())||Ji.region,b.registryEndpoint=((h=e.a2aRegistry.registryEndpoint)==null?void 0:h.trim())||Ji.endpoint,t.a2aRegistry=b}return((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||"local"),e.tracing&&((y=e.tracingExporters)!=null&&y.length)&&(t.tracing=!0,t.tracingExporters=[...e.tracingExporters]),(v=e.deployment)!=null&&v.feishuEnabled&&(t.deployment={feishuEnabled:!0}),(g=e.selectedSkills)!=null&&g.length&&(t.selectedSkills=e.selectedSkills.map(b=>{const w={source:b.source,name:b.name,folder:b.folder};return b.description&&(w.description=b.description),b.source==="skillhub"?(w.slug=b.slug,w.namespace=b.namespace??"public"):b.source==="local"?w.localFiles=b.localFiles??[]:(w.skillSpaceId=b.skillSpaceId,w.skillSpaceName=b.skillSpaceName,w.skillId=b.skillId,b.version&&(w.version=b.version)),w})),(E=e.subAgents)!=null&&E.length&&(t.subAgents=e.subAgents.map(b=>{var N,T,A;const w={name:b.name,description:b.description,instruction:b.instruction};return(N=b.builtinTools)!=null&&N.length&&(w.builtinTools=[...b.builtinTools]),(T=b.customTools)!=null&&T.length&&(w.customTools=b.customTools.map(S=>({name:S.name,description:S.description}))),(A=b.a2aRegistry)!=null&&A.enabled&&(w.a2aRegistry=oM(b).a2aRegistry),w})),t}function vJ(e){return`# VeADK Agent 结构配置 # 可在「创建 Agent」页通过「导入 YAML」重新载入。 -`+JZ(cJ(e))}function dJ(e){const t=ZZ(e);return nM(t)}const fJ=[{kind:"custom",icon:v9,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:l9,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:n9,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:w9,title:"工作流",desc:"敬请期待",disabled:!0}];function hJ({onSelect:e,onImport:t}){const n=_.useRef(null),[r,i]=_.useState(""),s=fJ.map(o=>({key:o.kind,icon:o.icon,title:o.title,desc:o.desc,disabled:o.disabled,onClick:()=>e(o.kind)})),a=async o=>{var c;const l=(c=o.target.files)==null?void 0:c[0];if(o.target.value="",!!l)try{const d=await l.text();t(dJ(d))}catch(d){i(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return u.jsx(fL,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:s,footer:u.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[u.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[u.jsx(E9,{}),"导入 YAML 配置"]}),r&&u.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),u.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const pJ="modulepreload",mJ=function(e){return"/"+e},nN={},Uo=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=mJ(l),l in nN)return;nN[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":pJ,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};function gJ({className:e,...t}){return u.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:[u.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"}),u.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 Ec={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:gJ},sequential:{id:"sequential",label:"顺序编排",desc:"子 Agent 按顺序依次执行",icon:CC},parallel:{id:"parallel",label:"并行编排",desc:"子 Agent 并行执行后汇总",icon:DC},loop:{id:"loop",label:"循环编排",desc:"子 Agent 循环执行到满足条件",icon:Gb},a2a:{id:"a2a",label:"远程 Agent",desc:"通过 A2A 协议调用远程 Agent",icon:$p}},pf=[Ec.llm,Ec.sequential,Ec.parallel,Ec.loop];function ZE(e){return Ec[e??"llm"]}const rM=e=>e==="sequential"||e==="parallel"||e==="loop",JE=e=>e==="a2a",yJ="https://ark.cn-beijing.volces.com/api/v3/",qc=[{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:yJ}],cl=[],ic=[{key:"FEISHU_APP_ID",required:!0,placeholder:"cli_xxx",comment:"飞书应用 App ID"},{key:"FEISHU_APP_SECRET",required:!0,placeholder:"输入 App Secret",comment:"飞书应用 App Secret"}],ex=[{id:"web_search",label:"联网搜索",desc:"火山引擎 Web Search,获取实时信息。",importLine:"from veadk.tools.builtin_tools.web_search import web_search",toolNames:["web_search"],env:cl},{id:"parallel_web_search",label:"并行联网搜索",desc:"并行发起多条搜索查询,更快汇总。",importLine:"from veadk.tools.builtin_tools.parallel_web_search import parallel_web_search",toolNames:["parallel_web_search"],env:cl},{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:"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"}]}],rp=[{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}]}],ip=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:qc,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},...qc],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},...qc],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Memory",desc:"火山 VikingDB 记忆库(支持用户画像)。",env:cl},{id:"mem0",label:"Mem0",desc:"Mem0 托管记忆服务。",env:[{key:"DATABASE_MEM0_API_KEY",required:!0},{key:"DATABASE_MEM0_BASE_URL",required:!1}]}],sp=[{id:"local",label:"本地向量库",desc:"进程内 llama-index 向量库。",env:qc,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},...qc],pipExtra:"extensions",needsEmbedding:!0},{id:"viking",label:"VikingDB Knowledge",desc:"火山 VikingDB 知识库。",env:cl},{id:"context_search",label:"Context Search",desc:"火山 Context Search 引擎(无需向量化)。",env:[...cl,{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ID",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_ENDPOINT",required:!0},{key:"DATABASE_CONTEXT_SEARCH_ENGINE_APIKEY",required:!0}]}],ap=[{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:[...cl,{key:"OBSERVABILITY_OPENTELEMETRY_TLS_SERVICE_NAME",required:!1,comment:"TLS topic_id,留空自动创建"}]}],bJ=e=>ex.find(t=>t.id===e),EJ=e=>rp.find(t=>t.id===e),xJ=e=>ip.find(t=>t.id===e),vJ=e=>sp.find(t=>t.id===e),wJ=e=>ap.find(t=>t.id===e);function iM(e){const t=new Map,n={};for(const r of e){for(const i of r.env){const s=t.get(i.key);(!s||i.required&&!s.required)&&t.set(i.key,i)}r.enableFlag&&(t.set(r.enableFlag,{key:r.enableFlag,required:!0}),n[r.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function _J(e,t){return iM([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function TJ(e,t){const n=new Map;for(const r of e){const i=t[r.key]??"";i.trim()&&n.set(r.key,i)}return[...n].map(([r,i])=>({key:r,value:i}))}function rN(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const NJ=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function SJ(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function qt(e,t){e.push(t&255,t>>>8&255)}function Er(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}const iN=2048,zg=20,sN=0;function kJ(e){const t=new TextEncoder,n=[],r=[];let i=0;for(const p of e){const m=t.encode(p.path),y=t.encode(p.content),v=SJ(y),g=y.length,E=[];Er(E,67324752),qt(E,zg),qt(E,iN),qt(E,sN),qt(E,0),qt(E,0),Er(E,v),Er(E,g),Er(E,g),qt(E,m.length),qt(E,0);const b=Uint8Array.from(E);n.push(b,m,y),r.push({nameBytes:m,dataBytes:y,crc:v,size:g,offset:i}),i+=b.length+m.length+y.length}const s=i,a=[];let o=0;for(const p of r){const m=[];Er(m,33639248),qt(m,zg),qt(m,zg),qt(m,iN),qt(m,sN),qt(m,0),qt(m,0),Er(m,p.crc),Er(m,p.size),Er(m,p.size),qt(m,p.nameBytes.length),qt(m,0),qt(m,0),qt(m,0),qt(m,0),Er(m,0),Er(m,p.offset);const y=Uint8Array.from(m);a.push(y,p.nameBytes),o+=y.length+p.nameBytes.length}const l=[];Er(l,101010256),qt(l,0),qt(l,0),qt(l,r.length),qt(l,r.length),Er(l,o),Er(l,s),qt(l,0);const c=[...n,...a,Uint8Array.from(l)],d=c.reduce((p,m)=>p+m.length,0),f=new Uint8Array(d);let h=0;for(const p of c)f.set(p,h),h+=p.length;return new Blob([f],{type:"application/zip"})}const AJ=_.lazy(()=>Uo(()=>import("./CodeEditor-C4sQGBmQ.js"),[]));function CJ(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let i=t;r.forEach((s,a)=>{let o=i.children.get(s);o||(o={name:s,children:new Map},i.children.set(s,o)),a===r.length-1&&(o.path=n.path),i=o})}return t}function IJ(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return r!==i?r?-1:1:t.name.localeCompare(n.name)})}function OJ({project:e,open:t,onClose:n,onChange:r}){var m;const[i,s]=_.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=_.useState(new Set),l=_.useRef(null),c=_.useMemo(()=>CJ(e.files),[e.files]),d=e.files.find(y=>y.path===i)??null;if(_.useEffect(()=>{var g;if(!t)return;const y=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const v=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=y,window.removeEventListener("keydown",v)}},[n,t]),_.useEffect(()=>{d||e.files.length===0||s(e.files[0].path)},[e.files,d]),!t)return null;function f(y){o(v=>{const g=new Set(v);return g.has(y)?g.delete(y):g.add(y),g})}function h(y,v,g){return IJ(y).map(E=>{const b=g?`${g}/${E.name}`:E.name;if(!(E.children.size>0&&E.path===void 0)&&E.path)return u.jsxs("button",{type:"button",className:`code-browser-file${i===E.path?" is-active":""}`,style:{paddingLeft:`${12+v*16}px`},onClick:()=>s(E.path??null),title:E.path,children:[u.jsx(Xw,{"aria-hidden":"true"}),u.jsx("span",{children:E.name})]},b);const N=a.has(b);return u.jsxs("div",{children:[u.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+v*16}px`},onClick:()=>f(b),"aria-expanded":!N,children:[u.jsx(rr,{className:N?"":"is-open","aria-hidden":"true"}),u.jsx(AC,{"aria-hidden":"true"}),u.jsx("span",{children:E.name})]}),!N&&h(E,v+1,b)]},b)})}function p(y){d&&r({...e,files:e.files.map(v=>v.path===d.path?{...v,content:y}:v)})}return Qo.createPortal(u.jsx("div",{className:"code-browser-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:u.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[u.jsxs("header",{className:"code-browser-head",children:[u.jsxs("div",{className:"code-browser-title-wrap",children:[u.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:u.jsx(zb,{})}),u.jsxs("div",{children:[u.jsx("h2",{id:"code-browser-title",children:"项目代码"}),u.jsx("p",{children:e.name||"Agent 项目"})]})]}),u.jsx("button",{ref:l,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:u.jsx(Vr,{"aria-hidden":"true"})})]}),u.jsxs("div",{className:"code-browser-workspace",children:[u.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[u.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",u.jsx("span",{children:e.files.length})]}),u.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(c,0,""):u.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),u.jsxs("main",{className:"code-browser-main",children:[u.jsxs("div",{className:"code-browser-path",children:[u.jsx(Xw,{"aria-hidden":"true"}),u.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),u.jsx("div",{className:"code-browser-editor",children:d?u.jsx(_.Suspense,{fallback:u.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:u.jsx(AJ,{value:d.content,path:d.path,onChange:p})}):u.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function RJ({project:e,onChange:t,className:n=""}){const[r,i]=_.useState(!1);return u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>i(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[u.jsx(zb,{"aria-hidden":"true"}),u.jsx("span",{children:"查看源码"})]}),u.jsx(OJ,{project:e,open:r,onClose:()=>i(!1),onChange:t})]})}function LJ({className:e,...t}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[u.jsx("path",{d:"m12 2.75 4.25 2.45v4.9L12 12.55 7.75 10.1V5.2L12 2.75Z"}),u.jsx("path",{d:"m7.75 5.2 4.25 2.45 4.25-2.45M12 7.65v4.9"}),u.jsx("path",{d:"M12 12.55v4.7m-2.25-2.2L12 17.3l2.25-2.25"}),u.jsx("path",{d:"M5.5 17.25v2.25a1.75 1.75 0 0 0 1.75 1.75h9.5a1.75 1.75 0 0 0 1.75-1.75v-2.25"})]})}function op({message:e,className:t="",onRetry:n}){const[r,i]=_.useState(!1),[s,a]=_.useState(!1),[o,l]=_.useState(!1),c=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{a(!1)}},d=async()=>{if(!(!n||o)){l(!0);try{await n()}finally{l(!1)}}};return u.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,children:[u.jsx("p",{className:"deploy-error-message-text",children:e}),u.jsxs("div",{className:"deploy-error-message-actions",children:[n&&u.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:o,onClick:()=>void d(),children:[o?u.jsx(xt,{className:"spin"}):u.jsx(MC,{}),o?"重试中…":"重试部署"]}),u.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>i(f=>!f),children:r?u.jsx(u9,{}):u.jsx(Dc,{})}),u.jsx("button",{type:"button",title:s?"已复制":"复制完整错误信息","aria-label":s?"已复制":"复制完整错误信息",onClick:()=>void c(),children:s?u.jsx(Ai,{}):u.jsx(Vb,{})})]})]})}gr.registerLanguage("python",GO);gr.registerLanguage("typescript",oR);gr.registerLanguage("javascript",zO);gr.registerLanguage("json",VO);gr.registerLanguage("yaml",lR);gr.registerLanguage("markdown",qO);gr.registerLanguage("bash",jO);gr.registerLanguage("ini",BO);gr.registerLanguage("dockerfile",tY);gr.registerLanguage("makefile",WO);const MJ=_.lazy(()=>Uo(()=>import("./CodeEditor-C4sQGBmQ.js"),[]));function DJ({open:e,onCancel:t,onConfirm:n}){const r=_.useRef(null);return _.useEffect(()=>{var a;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(a=r.current)==null||a.focus();const s=o=>{o.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>{document.body.style.overflow=i,window.removeEventListener("keydown",s)}},[t,e]),e?Qo.createPortal(u.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&t()},children:u.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:[u.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[u.jsxs("div",{className:"code-browser-title-wrap",children:[u.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:u.jsx(b9,{})}),u.jsx("h2",{id:"pp-confirm-title",children:"确认部署"})]}),u.jsx("button",{type:"button",className:"code-browser-close",onClick:t,"aria-label":"关闭部署确认",children:u.jsx(Vr,{"aria-hidden":"true"})})]}),u.jsx("div",{className:"pp-confirm-body",children:u.jsx("p",{id:"pp-confirm-description",children:"部署后暂不支持修改 Agent 配置,确定部署吗?"})}),u.jsxs("footer",{className:"pp-confirm-actions",children:[u.jsx("button",{ref:r,type:"button",onClick:t,children:"取消"}),u.jsx("button",{type:"button",className:"is-primary",onClick:n,children:"确定部署"})]})]})}),document.body):null}const PJ={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"},aN={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function oN(e){return e.replace(/&/g,"&").replace(//g,">")}function jJ(e){const n=(e.split("/").pop()??e).toLowerCase();if(aN[n])return aN[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const r=n.lastIndexOf(".");if(r===-1)return null;const i=n.slice(r+1);return PJ[i]??null}function BJ(e,t){try{const n=jJ(t);return n&&gr.getLanguage(n)?gr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?gr.highlightAuto(e).value:oN(e)}catch{return oN(e)}}const mf=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}];function FJ(e){return e.trim().replace(/[。.!!]+$/u,"")}function Vg(e,t="未配置"){return[...new Set(e.map(r=>r==null?void 0:r.trim()).filter(Boolean))].join("、")||t}function sM(e,t="root"){var a,o,l;const n=e.agentType??"llm",r=[...(e.builtinTools??[]).map(c=>{var d;return((d=bJ(c))==null?void 0:d.label)??c}),...(e.customTools??[]).map(c=>c.name),...(e.mcpTools??[]).map(c=>c.name),...e.tools??[]],i=[...(e.selectedSkills??[]).map(c=>c.name),...e.skills??[]],s=e.memory.longTerm?((a=xJ(e.longTermBackend??"local"))==null?void 0:a.label)??e.longTermBackend:void 0;return{id:t,name:e.name.trim()||"未命名 Agent",type:n,description:FJ(e.description),model:n==="llm"?e.modelName||e.model||"默认模型":"不适用",tools:Vg(r),skills:Vg(i),knowledgebase:e.knowledgebase?((o=vJ(e.knowledgebaseBackend??"local"))==null?void 0:o.label)??e.knowledgebaseBackend??"默认知识库":"未配置",shortTerm:e.memory.shortTerm?((l=EJ(e.shortTermBackend??"local"))==null?void 0:l.label)??e.shortTermBackend??"默认后端":"未配置",longTerm:s?`${s}${e.autoSaveSession?" · 自动保存会话":""}`:"未配置",tracing:e.tracing?Vg((e.tracingExporters??[]).map(c=>{var d;return((d=wJ(c))==null?void 0:d.label)??c}),"默认观测"):"未配置",children:e.subAgents.map((c,d)=>sM(c,`${t}.${d}`))}}function aM(e,t){if(e.id===t)return e;for(const n of e.children){const r=aM(n,t);if(r)return r}}function oM({agent:e,depth:t,inspectedId:n,onHover:r,onFocus:i}){const s=ZE(e.type),a=s.icon;return u.jsxs("div",{className:"pp-topology-branch",children:[u.jsxs("button",{type:"button",className:`pp-agent-node${e.id===n?" is-inspected":""}`,style:{marginLeft:t*16,width:`calc(100% - ${t*16}px)`},onMouseEnter:()=>r(e.id),onMouseLeave:()=>r(null),onFocus:()=>i(e.id),onBlur:()=>i(null),"aria-label":`查看 ${e.name} 配置`,children:[u.jsx("span",{className:"pp-agent-node-icon",children:u.jsx(a,{"aria-hidden":"true"})}),u.jsxs("span",{className:"pp-agent-node-main",children:[u.jsx("span",{className:"pp-agent-node-name",children:e.name}),u.jsx("span",{className:"pp-agent-node-type",children:s.label})]}),e.children.length>0&&u.jsx("span",{className:"pp-agent-child-count",children:e.children.length})]}),e.children.length>0&&u.jsx("div",{className:"pp-topology-children",children:e.children.map(o=>u.jsx(oM,{agent:o,depth:t+1,inspectedId:n,onHover:r,onFocus:i},o.id))})]})}function UJ(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let i=t;r.forEach((s,a)=>{let o=i.children.get(s);o||(o={name:s,children:new Map},i.children.set(s,o)),a===r.length-1&&(o.path=n.path),i=o})}return t}function $J(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return r!==i?r?-1:1:t.name.localeCompare(n.name)})}function HJ(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function zJ({left:e,right:t}){const[n,r]=_.useState(null);return _.useLayoutEffect(()=>{const i=document.getElementById("veadk-page-header-left"),s=document.getElementById("veadk-page-header-actions");i&&s&&r({left:i,right:s})},[]),n?u.jsxs(u.Fragment,{children:[Qo.createPortal(e,n.left),Qo.createPortal(t,n.right)]}):u.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function tx({project:e,agentDraft:t,agentName:n,agentCount:r,onChange:i,onDeploy:s,onAgentAdded:a,onDeploymentTaskChange:o,feishuEnabled:l=!1,onFeishuEnabledChange:c,deploymentEnv:d=[],deploymentEnvValues:f={},onDeploymentEnvChange:h,network:p,onNetworkChange:m,deployRegion:y="cn-beijing",onDeployRegionChange:v,onBack:g,onExportYaml:E}){var We,Jt,Xe;const b=typeof i=="function",[w,N]=_.useState(((Jt=(We=e==null?void 0:e.files)==null?void 0:We[0])==null?void 0:Jt.path)??null),[T,A]=_.useState(new Set),[S,O]=_.useState(!1),[I,D]=_.useState(""),[F,W]=_.useState(!1),[j,$]=_.useState(!1),[C,R]=_.useState(!1),[L,M]=_.useState(null),[k,Y]=_.useState(null),[G,P]=_.useState({}),[V,Q]=_.useState(null),[re,le]=_.useState(!1),[K,q]=_.useState([]),[ae,ge]=_.useState(!1),[he,de]=_.useState(null),[Ie,_e]=_.useState(null),Ee=_.useRef(!0),Pe=_.useMemo(()=>t?sM(t):{id:"root",name:n||(e==null?void 0:e.name)||"未命名 Agent",type:"llm",description:"",model:"默认模型",tools:"未配置",skills:"未配置",knowledgebase:"未配置",shortTerm:"未配置",longTerm:"未配置",tracing:"未配置",children:[]},[t,n,e==null?void 0:e.name]),be=Ie??he,Ve=be?aM(Pe,be):void 0,ke=Ve?ZE(Ve.type):void 0,ce=ke==null?void 0:ke.icon;_.useEffect(()=>(Ee.current=!0,()=>{Ee.current=!1}),[]);const It=_.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:UJ(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return u.jsx("div",{className:"pp-error",children:"项目数据无效"});const Me=e.files.find(te=>te.path===w)??null,wt=(p==null?void 0:p.mode)??"public",st=_J(l?[...d,...ic]:d,f),z=st.length+K.length;function X(te){A(xe=>{const ye=new Set(xe);return ye.has(te)?ye.delete(te):ye.add(te),ye})}function oe(te,xe){i&&(i({...e,files:te}),xe!==void 0&&N(xe))}function we(te){Me&&oe(e.files.map(xe=>xe.path===Me.path?{...xe,content:te}:xe))}function Ae(){const te=I.trim();if(O(!1),D(""),!!te){if(e.files.some(xe=>xe.path===te)){N(te);return}oe([...e.files,{path:te,content:""}],te)}}function Ge(){if(!Me)return;const te=window.prompt("重命名文件",Me.path),xe=te==null?void 0:te.trim();!xe||xe===Me.path||e.files.some(ye=>ye.path===xe)||oe(e.files.map(ye=>ye.path===Me.path?{...ye,path:xe}:ye),xe)}function Ot(){var xe;if(!Me)return;const te=e.files.filter(ye=>ye.path!==Me.path);oe(te,((xe=te[0])==null?void 0:xe.path)??null)}function Ke(te,xe){q(ye=>ye.map(Be=>Be.id===te?{...Be,...xe}:Be))}function xn(te){q(xe=>xe.filter(ye=>ye.id!==te))}function jt(){q(te=>[...te,HJ()])}function yt(te){m&&m(te==="public"?void 0:{...p??{mode:te},mode:te})}function Yt(te){m==null||m({...p??{mode:"private"},...te})}function kt(){const te=new Map(K.map(ye=>({key:ye.key.trim(),value:ye.value})).filter(ye=>ye.key.length>0).map(ye=>[ye.key,ye.value])),xe=l?[...d,...ic]:d;for(const ye of TJ(xe,f))te.set(ye.key,ye.value);return[...te].map(([ye,Be])=>({key:ye,value:Be}))}async function Rt(){if(!(!c||F||C)){M(null),R(!0);try{await c(!l)}catch(te){Ee.current&&M(`更新飞书配置失败:${te instanceof Error?te.message:String(te)}`)}finally{Ee.current&&R(!1)}}}async function Le(){var xe;if(!s||F)return;if(wt!=="public"&&!((xe=p==null?void 0:p.vpcId)!=null&&xe.trim())){M("使用 VPC 网络时,请填写 VPC ID。");return}const te=rN(d,f);if(te){const ye=d.find(Be=>Be.key===te.key);M(`请返回配置页填写 ${(ye==null?void 0:ye.comment)||(ye==null?void 0:ye.key)}(${ye==null?void 0:ye.key})。`);return}if(l){const ye=rN(ic,f);if(ye){const Be=ic.find(He=>He.key===ye.key);M(`启用飞书后,请填写${(Be==null?void 0:Be.comment)||(Be==null?void 0:Be.key)}。`);return}}$(!0)}async function at(){if(!s||F)return;$(!1);const te=kt();Ee.current&&(M(null),Y(null),P({}),Q(null),W(!0));const xe=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let ye="生成中…";const Be=Date.now();o==null||o({id:xe,runtimeName:ye,region:y,startedAt:Be,status:"running",label:"准备部署"});try{const He=await s(e,$e=>{var ot;$e.runtimeName&&(ye=$e.runtimeName),Ee.current&&(P(it=>({...it,[$e.phase]:$e})),Q($e.phase)),o==null||o({id:xe,runtimeName:ye,region:y,startedAt:Be,status:"running",label:((ot=mf.find(it=>it.phase===$e.phase))==null?void 0:ot.label)??$e.phase,message:$e.message,pct:$e.pct})},l?{taskId:xe,im:{feishu:{enabled:!0}},envs:te}:{taskId:xe,envs:te});Ee.current&&(Y(He),Q(null)),o==null||o({id:xe,runtimeName:He.agentName||ye,runtimeId:He.runtimeId,region:He.region||y,startedAt:Be,status:"success",label:"部署完成"})}catch(He){const $e=He instanceof Error?He.message:String(He);if(He instanceof DOMException&&He.name==="AbortError"){Ee.current&&(M(null),Q(null)),o==null||o({id:xe,runtimeName:ye,region:y,startedAt:Be,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}Ee.current&&M($e),o==null||o({id:xe,runtimeName:ye,region:y,startedAt:Be,status:"error",label:"部署失败",message:$e,retry:Le})}finally{Ee.current&&W(!1)}}function bt(){$(!1)}async function Et(){if(!(!k||re)){le(!0),M(null);try{const{addConnection:te,addRuntimeConnection:xe,remoteAppId:ye,loadConnections:Be}=await Uo(async()=>{const{addConnection:ot,addRuntimeConnection:it,remoteAppId:mn,loadConnections:mt}=await Promise.resolve().then(()=>s_);return{addConnection:ot,addRuntimeConnection:it,remoteAppId:mn,loadConnections:mt}},void 0),{probeRuntimeApps:He}=await Uo(async()=>{const{probeRuntimeApps:ot}=await Promise.resolve().then(()=>B9);return{probeRuntimeApps:ot}},void 0);let $e;if(k.runtimeId){const ot=k.region??"cn-beijing",it=await He(k.runtimeId,ot)??[];$e=xe(k.runtimeId,k.agentName,ot,it,it.length>0?{[it[0]]:k.agentName}:void 0)}else $e=await te(k.agentName,k.url,k.apikey,"");if($e.apps.length===0)M("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const ot={[$e.apps[0]]:k.agentName},it={...$e,appLabels:{...$e.appLabels??{},...ot}},mt=Be().map(lt=>lt.id===$e.id?it:lt);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(mt));const{registerConnections:kn}=await Uo(async()=>{const{registerConnections:lt}=await Promise.resolve().then(()=>s_);return{registerConnections:lt}},void 0);if(kn(mt),a){const lt=ye($e.id,$e.apps[0]);a(lt,k.agentName)}else alert(`🎉 Agent "${k.agentName}" 已添加到左上角下拉列表!`)}}catch(te){M(`添加 Agent 失败:${te instanceof Error?te.message:String(te)}`)}finally{le(!1)}}}function se(){const te=kJ(e.files),xe=URL.createObjectURL(te),ye=document.createElement("a");ye.href=xe,ye.download=`${e.name||"project"}.zip`,document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(xe)}function Ce(te,xe,ye){return $J(te).map(Be=>{const He=ye?`${ye}/${Be.name}`:Be.name,$e=Be.path!==void 0,ot={paddingLeft:8+xe*14};if($e){const mn=Be.path===w;return u.jsxs("button",{type:"button",className:`pp-row pp-file${mn?" pp-active":""}`,style:ot,onClick:()=>N(Be.path),title:Be.path,children:[u.jsx(X8,{className:"pp-ic"}),u.jsx("span",{className:"pp-label",children:Be.name})]},He)}const it=T.has(He);return u.jsxs("div",{children:[u.jsxs("button",{type:"button",className:"pp-row pp-folder",style:ot,onClick:()=>X(He),children:[u.jsx(rr,{className:`pp-ic pp-chevron${it?"":" pp-open"}`}),u.jsx(AC,{className:"pp-ic"}),u.jsx("span",{className:"pp-label",children:Be.name})]}),!it&&Ce(Be,xe+1,He)]},He)})}return u.jsxs("div",{className:`pp-root${s?" is-deploy":""}`,children:[s&&u.jsx(zJ,{left:u.jsxs("div",{className:"pp-toolbar-left",children:[g&&u.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:g,children:[u.jsx(bC,{className:"pp-ic"}),"返回配置"]}),u.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",n||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),u.jsxs("div",{className:"pp-body",children:[s&&u.jsxs("section",{className:"pp-topology-pane","aria-label":"Agent 拓扑",children:[u.jsxs("div",{className:"pp-topology-head",children:[u.jsxs("div",{children:[u.jsx("div",{className:"pp-topology-title",children:"Agent 拓扑"}),u.jsxs("div",{className:"pp-topology-count",children:[r??1," 个智能体"]})]}),b&&i&&u.jsx(RJ,{project:e,onChange:i})]}),u.jsxs("div",{className:"pp-topology-scroll",children:[u.jsx("div",{className:"pp-topology-tree",children:u.jsx(oM,{agent:Pe,depth:0,inspectedId:be,onHover:de,onFocus:_e})}),Ve&&ke&&ce&&u.jsxs("div",{className:"pp-agent-inspector","aria-live":"polite",children:[u.jsxs("div",{className:"pp-agent-inspector-head",children:[u.jsx("span",{className:"pp-agent-inspector-icon",children:u.jsx(ce,{"aria-hidden":"true"})}),u.jsxs("div",{children:[u.jsx("strong",{children:Ve.name}),u.jsx("span",{children:ke.label})]})]}),Ve.description&&u.jsx("p",{children:Ve.description}),u.jsxs("dl",{className:"pp-agent-config-grid",children:[u.jsx("dt",{children:"模型"}),u.jsx("dd",{children:Ve.model}),u.jsx("dt",{children:"工具"}),u.jsx("dd",{children:Ve.tools}),u.jsx("dt",{children:"技能"}),u.jsx("dd",{children:Ve.skills}),u.jsx("dt",{children:"知识库"}),u.jsx("dd",{children:Ve.knowledgebase}),u.jsx("dt",{children:"短期记忆"}),u.jsx("dd",{children:Ve.shortTerm}),u.jsx("dt",{children:"长期记忆"}),u.jsx("dd",{children:Ve.longTerm}),u.jsx("dt",{children:"观测"}),u.jsx("dd",{children:Ve.tracing})]})]})]}),u.jsxs("div",{className:"pp-topology-actions",children:[E&&u.jsxs("button",{type:"button",className:"pp-secondary",onClick:E,children:[u.jsx(W8,{className:"pp-ic"}),"导出配置"]}),e.files.length>0&&u.jsxs("button",{type:"button",className:"pp-secondary",onClick:se,children:[u.jsx(Kb,{className:"pp-ic"}),"下载源码"]})]})]}),u.jsxs("div",{className:"pp-files-area",children:[u.jsxs("div",{className:"pp-sidebar",children:[u.jsxs("div",{className:"pp-sidebar-head",children:[u.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),b&&u.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{O(!0),D("")},children:u.jsx(q8,{className:"pp-ic"})})]}),u.jsxs("div",{className:"pp-tree",children:[S&&u.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:I,onChange:te=>D(te.target.value),onBlur:Ae,onKeyDown:te=>{te.key==="Enter"&&Ae(),te.key==="Escape"&&(O(!1),D(""))}}),e.files.length===0&&!S?u.jsx("div",{className:"pp-empty",children:"暂无文件"}):Ce(It,0,"")]})]}),u.jsxs("div",{className:"pp-main",children:[u.jsxs("div",{className:"pp-main-head",children:[u.jsx("span",{className:"pp-path",title:Me==null?void 0:Me.path,children:(Me==null?void 0:Me.path)??"未选择文件"}),u.jsx("div",{className:"pp-actions",children:b&&Me&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:Ge,children:u.jsx(h9,{className:"pp-ic"})}),u.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:Ot,children:u.jsx(Tl,{className:"pp-ic"})})]})})]}),u.jsx("div",{className:"pp-content",children:Me==null?u.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):b?u.jsx("div",{className:"pp-codemirror",children:u.jsx(_.Suspense,{fallback:u.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:u.jsx(MJ,{value:Me.content,path:Me.path,onChange:we})})}):u.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:BJ(Me.content,Me.path)}})})]})]}),s&&u.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[u.jsx("div",{className:"pp-config-head",children:u.jsx("div",{className:"pp-config-title",children:"部署配置"})}),u.jsxs("div",{className:"pp-config-scroll",children:[u.jsxs("section",{className:"pp-config-section",children:[u.jsx("div",{className:"pp-config-label",children:"发布区域"}),u.jsxs("select",{className:"pp-config-select",value:y,onChange:te=>v==null?void 0:v(te.target.value),"aria-label":"部署区域",disabled:F||!v,children:[u.jsx("option",{value:"cn-beijing",children:"华北 2(北京)"}),u.jsx("option",{value:"cn-shanghai",children:"华东 2(上海)"})]})]}),u.jsxs("section",{className:"pp-config-section",children:[u.jsx("div",{className:"pp-config-label",children:"消息渠道"}),u.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:`pp-channel${l?" is-on":""}`,onClick:()=>void Rt(),disabled:F||C||!c,children:[u.jsx("span",{className:"pp-channel-title",children:C?"飞书(正在更新代码…)":"飞书"}),u.jsx("span",{className:"pp-switch","aria-hidden":!0,children:u.jsx("span",{})})]}),l&&u.jsx("div",{className:"pp-channel-fields",children:ic.map(te=>u.jsxs("label",{children:[u.jsxs("span",{children:[te.comment||te.key,te.required&&u.jsx("small",{children:"必填"})]}),u.jsx("code",{children:te.key}),u.jsx("input",{type:te.key.includes("SECRET")?"password":"text",value:f[te.key]??"",placeholder:te.placeholder,disabled:F||!h,autoComplete:"off",onChange:xe=>h==null?void 0:h(te.key,xe.currentTarget.value)})]},te.key))})]}),u.jsxs("section",{className:"pp-config-section",children:[u.jsx("div",{className:"pp-config-label",children:"网络"}),u.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(te=>u.jsx("button",{type:"button",role:"radio","aria-checked":wt===te,className:wt===te?"is-on":"",onClick:()=>yt(te),disabled:F||!m,children:te==="public"?"公网":te==="private"?"VPC":"公网 + VPC"},te))}),wt!=="public"&&u.jsxs("div",{className:"pp-network-fields",children:[u.jsxs("label",{children:[u.jsx("span",{children:"VPC ID"}),u.jsx("input",{value:(p==null?void 0:p.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:F,onChange:te=>Yt({vpcId:te.target.value})})]}),u.jsxs("label",{children:[u.jsxs("span",{children:["子网 ID ",u.jsx("small",{children:"可选,多个用逗号分隔"})]}),u.jsx("input",{value:(p==null?void 0:p.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:F,onChange:te=>Yt({subnetIds:te.target.value})})]}),u.jsxs("label",{className:"pp-network-check",children:[u.jsx("input",{type:"checkbox",checked:!!(p!=null&&p.enableSharedInternetAccess),disabled:F,onChange:te=>Yt({enableSharedInternetAccess:te.target.checked})}),"VPC 内共享公网出口"]})]})]}),u.jsxs("section",{className:"pp-config-section pp-env-section",children:[u.jsxs("div",{className:"pp-env-head",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"pp-config-label",children:["环境变量",u.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[z," 项"]})]}),u.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),u.jsx("button",{type:"button",className:"pp-icon-btn",title:ae?"隐藏值":"显示值",onClick:()=>ge(te=>!te),children:ae?u.jsx(Y8,{className:"pp-ic"}):u.jsx(NC,{className:"pp-ic"})})]}),u.jsxs("button",{type:"button",className:"pp-env-add",onClick:jt,disabled:F,children:[u.jsx(li,{className:"pp-ic"}),"添加变量"]}),(st.length>0||K.length>0)&&u.jsxs("div",{className:"pp-env-table",children:[st.length>0&&u.jsxs("div",{className:"pp-env-group",children:[u.jsxs("div",{className:"pp-env-group-head",children:[u.jsx("span",{children:"组件自动生成"}),u.jsxs("small",{children:[st.length," 项"]})]}),st.map(te=>{const xe=te.key.startsWith("ENABLE_");return u.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[u.jsx("input",{className:"pp-env-key-fixed",value:te.key,readOnly:!0,disabled:F,"aria-label":`${te.key} 环境变量名`}),u.jsx("input",{type:xe||ae?"text":"password",value:te.value,placeholder:te.required?"必填,尚未填写":"可选,尚未填写",readOnly:xe,disabled:F||!xe&&!h,autoComplete:"off","aria-label":`${te.key} 环境变量值`,onChange:ye=>h==null?void 0:h(te.key,ye.currentTarget.value)}),u.jsx("span",{className:"pp-env-source",children:xe?"自动":"同步"})]},te.key)})]}),K.length>0&&u.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[u.jsx("span",{children:"自定义变量"}),u.jsxs("small",{children:[K.length," 项"]})]}),K.map(te=>u.jsxs("div",{className:"pp-env-row",children:[u.jsx("input",{value:te.key,placeholder:"名称",disabled:F,autoComplete:"off",onChange:xe=>Ke(te.id,{key:xe.currentTarget.value})}),u.jsx("input",{type:ae?"text":"password",value:te.value,placeholder:"值",disabled:F,autoComplete:"off",onChange:xe=>Ke(te.id,{value:xe.currentTarget.value})}),u.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:F,onClick:()=>xn(te.id),children:u.jsx(Vr,{className:"pp-ic"})})]},te.id))]})]}),(F||k||Object.keys(G).length>0)&&u.jsxs("section",{className:"pp-config-section pp-progress-section",children:[u.jsx("div",{className:"pp-config-label",children:"部署进度"}),u.jsx("ol",{className:"pp-steps",children:mf.map((te,xe)=>{const ye=V?mf.findIndex(ot=>ot.phase===V):-1,Be=!!L&&(ye===-1?xe===0:xe===ye);let He;k?He="done":Be?He="failed":ye===-1?He=F?"active":"pending":xete.phase===V))==null?void 0:Xe.label)??V}阶段):`:""}${L}`,onRetry:Le}),k&&u.jsxs("section",{className:"pp-deploy-result",children:[u.jsx("div",{className:"pp-deploy-result-header",children:"部署成功"}),u.jsxs("div",{className:"pp-deploy-result-body",children:[k.region&&u.jsxs("div",{className:"pp-deploy-result-field",children:[u.jsx("label",{children:"区域"}),u.jsx("code",{children:k.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),u.jsxs("div",{className:"pp-deploy-result-field",children:[u.jsx("label",{children:"Agent 名称"}),u.jsx("code",{children:k.agentName})]}),u.jsxs("div",{className:"pp-deploy-result-field",children:[u.jsx("label",{children:"API 端点"}),u.jsx("code",{className:"pp-deploy-result-url",children:k.url})]})]}),u.jsxs("div",{className:"pp-deploy-result-actions",children:[u.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:Et,disabled:re,children:[re?u.jsx(xt,{className:"pp-ic spin"}):u.jsx(RC,{className:"pp-ic"}),re?"连接中…":"立即对话"]}),k.consoleUrl&&u.jsxs("a",{href:k.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[u.jsx(Yb,{className:"pp-ic"}),"控制台"]})]})]})]}),u.jsx("div",{className:"pp-config-actions",children:u.jsxs("button",{type:"button",className:"pp-deploy",onClick:Le,disabled:F||C,children:[F?u.jsx(xt,{className:"pp-ic spin"}):L?u.jsx(MC,{className:"pp-ic"}):u.jsx(LJ,{className:"pp-ic"}),F?"部署中…":L?"重试部署":"部署"]})})]})]}),u.jsx(DJ,{open:j,onCancel:bt,onConfirm:()=>void at()})]})}const lN="dogfooding",Kg="dogfooding",Yg="dogfooding_b";let VJ=0;const Wg=()=>++VJ;function cN(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function KJ(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function uN(e){const t=[],n=KJ(e);t.push(n);const r=n.indexOf("{"),i=n.lastIndexOf("}");r>=0&&i>r&&t.push(n.slice(r,i+1));for(const s of t)try{const a=JSON.parse(s);if(a&&typeof a=="object"&&(typeof a.name=="string"||typeof a.instruction=="string"))return await Hh(nM(a))}catch{}return null}function YJ({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:i}){const[s,a]=_.useState([{id:Wg(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,l]=_.useState(""),[c,d]=_.useState(!1),[f,h]=_.useState(null),[p,m]=_.useState(null),[y,v]=_.useState(!1),[g,E]=_.useState(null),[b,w]=_.useState(null),[N,T]=_.useState(!1),[A,S]=_.useState(!1),[O,I]=_.useState({}),D=_.useRef(null),F=_.useRef(null),W=_.useRef(null),j=_.useRef(null),$=_.useRef(null);_.useEffect(()=>{const Q=j.current;Q&&Q.scrollTo({top:Q.scrollHeight,behavior:"smooth"})},[s,c]),_.useEffect(()=>{const Q=$.current;Q&&(Q.style.height="auto",Q.style.height=Math.min(Q.scrollHeight,160)+"px")},[o]);const C=Q=>a(re=>[...re,{id:Wg(),role:"assistant",text:Q}]);async function R(){if(D.current)return D.current;const Q=await Uh(lN,e);return D.current=Q,Q}async function L(Q,re){if(re.current)return re.current;const le=await Uh(Q,e);return re.current=le,le}async function M(Q,re){if(!O[Q])try{const le=await Ju(re);I(K=>({...K,[Q]:le.model||re}))}catch{I(le=>({...le,[Q]:re}))}}async function k(Q,re,le){const K=await L(Q,re);let q=Ui();for await(const ge of xu({appName:Q,userId:e,sessionId:K,text:le}))q=tl(q,ge);const ae=cN(q).trim();return{project:await uN(ae),finalText:ae}}const Y=async(Q,re,le)=>tE(Q.name,Q.files,{region:"cn-beijing",projectName:"default"},{...le,onStage:re}),G=async()=>{const Q=o.trim();if(!(!Q||c)){if(a(re=>[...re,{id:Wg(),role:"user",text:Q}]),l(""),h(null),d(!0),y){E(null),w(null),T(!0),S(!0),M("a",Kg),M("b",Yg);const re=k(Kg,F,Q).then(({project:K})=>(E(K),K)).catch(K=>{const q=K instanceof Error?K.message:String(K);return h(q),null}).finally(()=>T(!1)),le=k(Yg,W,Q).then(({project:K})=>(w(K),K)).catch(K=>{const q=K instanceof Error?K.message:String(K);return h(q),null}).finally(()=>S(!1));try{const[K,q]=await Promise.all([re,le]),ae=[K?`方案 A:${K.name}`:null,q?`方案 B:${q.name}`:null].filter(Boolean);ae.length?C(`已生成两个方案(${ae.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const re=await R();let le=Ui();for await(const ae of xu({appName:lN,userId:e,sessionId:re,text:Q}))le=tl(le,ae);const K=cN(le).trim(),q=await uN(K);q?(m(q),C(`已生成项目:${q.name}(${q.files.length} 个文件),可在右侧预览和编辑。`)):C(K||"(助手没有返回内容,请再描述一下你的需求。)")}catch(re){const le=re instanceof Error?re.message:String(re);h(le),C(`抱歉,调用智能构建助手失败:${le}`)}finally{d(!1)}}},P=Q=>{const re=Q==="a"?g:b;if(!re)return;m(re),v(!1),E(null),w(null),T(!1),S(!1);const le=Q==="a"?"A":"B",K=Q==="a"?O.a:O.b;C(`已采用方案 ${le}(${K??(Q==="a"?Kg:Yg)}),可继续编辑。`)},V=Q=>{Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(Q.preventDefault(),G())};return u.jsx("div",{className:"ic-root",children:u.jsxs("div",{className:"ic-body",children:[u.jsxs("div",{className:"ic-chat",children:[u.jsxs("div",{className:"ic-transcript",ref:j,children:[u.jsx(Rs,{initial:!1,children:s.map(Q=>u.jsxs(zt.div,{className:`ic-turn ic-turn--${Q.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[Q.role==="assistant"&&u.jsx("div",{className:"ic-avatar",children:u.jsx(ka,{className:"ic-avatar-icon"})}),u.jsx("div",{className:"ic-bubble",children:Q.role==="assistant"?u.jsx(rm,{text:Q.text}):Q.text})]},Q.id))}),c&&u.jsxs(zt.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[u.jsx("div",{className:"ic-avatar",children:u.jsx(ka,{className:"ic-avatar-icon"})}),u.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[u.jsx("span",{className:"ic-dot"}),u.jsx("span",{className:"ic-dot"}),u.jsx("span",{className:"ic-dot"})]})]})]}),f&&u.jsxs("div",{className:"ic-error",children:[u.jsx(_C,{className:"ic-error-icon"}),f]}),u.jsxs("div",{className:"ic-composer",children:[u.jsxs("div",{className:"ic-composer-box",children:[u.jsx("textarea",{ref:$,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:Q=>l(Q.target.value),onKeyDown:V,disabled:c}),u.jsx("button",{className:"ic-send",onClick:()=>void G(),disabled:!o.trim()||c,title:"发送 (Enter)",children:u.jsx(g9,{className:"ic-send-icon"})})]}),u.jsxs("div",{className:"ic-composer-foot",children:[u.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[u.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:y,disabled:c,onChange:Q=>v(Q.target.checked)}),u.jsx("span",{className:"ic-ab-track",children:u.jsx("span",{className:"ic-ab-thumb"})}),u.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),u.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),u.jsx("aside",{className:"ic-preview",children:y?u.jsxs("div",{className:"ic-compare",children:[u.jsx(dN,{side:"a",project:g,loading:N,model:O.a,onAdopt:()=>P("a")}),u.jsx("div",{className:"ic-compare-divider"}),u.jsx(dN,{side:"b",project:b,loading:A,model:O.b,onAdopt:()=>P("b")})]}):p?u.jsx(tx,{project:p,onChange:m,onDeploy:Y,onAgentAdded:r,onDeploymentTaskChange:i}):u.jsxs("div",{className:"ic-preview-empty",children:[u.jsxs("div",{className:"ic-preview-empty-icon",children:[u.jsx(Q8,{className:"ic-preview-empty-glyph"}),u.jsx(Aa,{className:"ic-preview-empty-spark"})]}),u.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),u.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function dN({side:e,project:t,loading:n,model:r,onAdopt:i}){const s=e==="a"?"方案 A":"方案 B";return u.jsxs("div",{className:"ic-pane",children:[u.jsxs("div",{className:"ic-pane-head",children:[u.jsxs("div",{className:"ic-pane-title",children:[u.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:s}),r&&u.jsx("span",{className:"ic-pane-model",children:r})]}),u.jsxs("button",{className:"ic-adopt",onClick:i,disabled:!t||n,title:`采用${s}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),u.jsx("div",{className:"ic-pane-body",children:n?u.jsxs("div",{className:"ic-pane-loading",children:[u.jsx(xt,{className:"ic-pane-spinner"}),u.jsx("span",{children:"正在生成…"})]}):t?u.jsx(tx,{project:t}):u.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const WJ=/^[A-Za-z_][A-Za-z0-9_]*$/;function $o(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":WJ.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function lM(e){const t=new Set,n=new Set,r=i=>{$o(i.name)===null&&(t.has(i.name)?n.add(i.name):t.add(i.name)),i.subAgents.forEach(r)};return r(e),n}function Yr(e){return e.trimEnd().replace(/[。.]+$/,"")}function Qs(e,t){return e[t]|e[t+1]<<8}function sc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function qJ(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 GJ(e){let n=-1;for(let o=e.length-22;o>=0&&o>e.length-65557;o--)if(sc(e,o)===101010256){n=o;break}if(n<0)throw new Error("无效的 zip:找不到 EOCD");const r=Qs(e,n+10);let i=sc(e,n+16);const s=new TextDecoder("utf-8"),a=[];for(let o=0;o{var o;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((o=a.Metadata)==null?void 0:o.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function ZJ({selected:e,onChange:t}){const[n,r]=_.useState(""),[i,s]=_.useState([]),[a,o]=_.useState(!1),[l,c]=_.useState(null),[d,f]=_.useState(!1),h=y=>e.some(v=>v.source==="skillhub"&&v.slug===y),p=y=>{y.slug&&(h(y.slug)?t(e.filter(v=>!(v.source==="skillhub"&&v.slug===y.slug))):t([...e,{source:"skillhub",slug:y.slug,name:y.name,folder:y.slug.split("/").pop()||y.name,namespace:y.namespace||"public",description:y.description}]))},m=async y=>{o(!0),c(null),f(!0);try{const v=await QJ(y);s(v)}catch(v){c(v instanceof Error?v.message:"搜索失败,请稍后重试。"),s([])}finally{o(!1)}};return _.useEffect(()=>{const y=n.trim();if(!y){s([]),f(!1),c(null);return}const v=setTimeout(()=>m(y),300);return()=>clearTimeout(v)},[n]),u.jsxs("div",{className:"cw-skillhub",children:[u.jsxs("div",{className:"cw-skill-searchrow",children:[u.jsxs("div",{className:"cw-skill-searchbox",children:[u.jsx(Ty,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),u.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:y=>r(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),n.trim()&&m(n))}})]}),u.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?u.jsx(xt,{className:"cw-i cw-spin"}):u.jsx(Ty,{className:"cw-i"}),"搜索"]})]}),l&&u.jsxs("div",{className:"cw-banner",children:[u.jsx(Xu,{className:"cw-i"}),u.jsx("span",{children:l})]}),a&&i.length===0?u.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):i.length>0?u.jsx("div",{className:"cw-skill-results",children:i.map(y=>{const v=h(y.slug||"");return u.jsxs("button",{type:"button",className:`cw-skill-result ${v?"is-on":""}`,onClick:()=>p(y),"aria-pressed":v,children:[u.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:v?u.jsx(Ai,{className:"cw-i cw-i-sm"}):u.jsx(li,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-skill-result-meta",children:[u.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&u.jsx("span",{className:"cw-skill-result-desc",children:Yr(y.description)}),y.sourceRepo&&u.jsx("span",{className:"cw-skill-result-repo",children:y.sourceRepo})]})]},y.id||y.slug)})}):d&&!l?u.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&u.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const t1=/(^|\/)skill\.md$/i;class Ms extends Error{}function JJ(e,t){const n=(e??"").replace(/\r\n?/g,` +`+sJ(oM(e))}function wJ(e){const t=iJ(e);return aM(t)}const _J=[{kind:"custom",icon:k9,title:"自定义",desc:"分步配置模型、工具、记忆、知识库等组件。"},{kind:"intelligent",icon:p9,title:"智能模式",desc:"敬请期待",disabled:!0},{kind:"template",icon:l9,title:"从模板新建",desc:"敬请期待",disabled:!0},{kind:"workflow",icon:A9,title:"工作流",desc:"敬请期待",disabled:!0}];function TJ({onSelect:e,onImport:t}){const n=_.useRef(null),[r,i]=_.useState(""),s=_J.map(o=>({key:o.kind,icon:o.icon,title:o.title,desc:o.desc,disabled:o.disabled,onClick:()=>e(o.kind)})),a=async o=>{var c;const l=(c=o.target.files)==null?void 0:c[0];if(o.target.value="",!!l)try{const d=await l.text();t(wJ(d))}catch(d){i(`导入失败:${d instanceof Error?d.message:String(d)}`)}};return u.jsx(pL,{title:"从 0 快速创建",sub:"选择一种方式开始",cards:s,footer:u.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[u.jsxs("button",{className:"stk-import",onClick:()=>{var o;return(o=n.current)==null?void 0:o.click()},children:[u.jsx(N9,{}),"导入 YAML 配置"]}),r&&u.jsx("span",{style:{fontSize:12,color:"hsl(var(--destructive))"},children:r}),u.jsx("input",{ref:n,type:"file",accept:".yaml,.yml,text/yaml",style:{display:"none"},onChange:a})]})})}const NJ="modulepreload",SJ=function(e){return"/"+e},rN={},Ko=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=SJ(l),l in rN)return;rN[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":NJ,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};function kJ({className:e,...t}){return u.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:[u.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"}),u.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 Tc={llm:{id:"llm",label:"LLM 智能体",desc:"大模型驱动,自主完成任务",icon:kJ},sequential:{id:"sequential",label:"顺序编排",desc:"子 Agent 按顺序依次执行",icon:RC},parallel:{id:"parallel",label:"并行编排",desc:"子 Agent 并行执行后汇总",icon:jC},loop:{id:"loop",label:"循环编排",desc:"子 Agent 循环执行到满足条件",icon:Xb},a2a:{id:"a2a",label:"远程 Agent",desc:"通过 A2A 协议调用远程 Agent",icon:Cl}},yf=[Tc.llm,Tc.sequential,Tc.parallel,Tc.loop];function ex(e){return Tc[e??"llm"]}const lM=e=>e==="sequential"||e==="parallel"||e==="loop",tx=e=>e==="a2a";function cM(e){const t=new Map,n={};for(const r of e){for(const i of r.env){const s=t.get(i.key);(!s||i.required&&!s.required)&&t.set(i.key,i)}r.enableFlag&&(t.set(r.enableFlag,{key:r.enableFlag,required:!0}),n[r.enableFlag]="true")}return{specs:[...t.values()],fixedValues:n}}function AJ(e,t){return cM([{env:e}]).specs.map(r=>({...r,value:t[r.key]??""}))}function CJ(e,t){const n=new Map;for(const r of e){const i=t[r.key]??"";i.trim()&&n.set(r.key,i)}return[...n].map(([r,i])=>({key:r,value:i}))}function iN(e,t){return e.find(n=>{var r;return n.required&&!((r=t[n.key])!=null&&r.trim())})}const IJ=(()=>{const e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n>>>0}return e})();function RJ(e){let t=4294967295;for(let n=0;n>>8;return(t^4294967295)>>>0}function Kt(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 sN=2048,Vg=20,aN=0;function OJ(e){const t=new TextEncoder,n=[],r=[];let i=0;for(const p of e){const m=t.encode(p.path),y=t.encode(p.content),v=RJ(y),g=y.length,E=[];Nr(E,67324752),Kt(E,Vg),Kt(E,sN),Kt(E,aN),Kt(E,0),Kt(E,0),Nr(E,v),Nr(E,g),Nr(E,g),Kt(E,m.length),Kt(E,0);const b=Uint8Array.from(E);n.push(b,m,y),r.push({nameBytes:m,dataBytes:y,crc:v,size:g,offset:i}),i+=b.length+m.length+y.length}const s=i,a=[];let o=0;for(const p of r){const m=[];Nr(m,33639248),Kt(m,Vg),Kt(m,Vg),Kt(m,sN),Kt(m,aN),Kt(m,0),Kt(m,0),Nr(m,p.crc),Nr(m,p.size),Nr(m,p.size),Kt(m,p.nameBytes.length),Kt(m,0),Kt(m,0),Kt(m,0),Kt(m,0),Nr(m,0),Nr(m,p.offset);const y=Uint8Array.from(m);a.push(y,p.nameBytes),o+=y.length+p.nameBytes.length}const l=[];Nr(l,101010256),Kt(l,0),Kt(l,0),Kt(l,r.length),Kt(l,r.length),Nr(l,o),Nr(l,s),Kt(l,0);const c=[...n,...a,Uint8Array.from(l)],d=c.reduce((p,m)=>p+m.length,0),f=new Uint8Array(d);let h=0;for(const p of c)f.set(p,h),h+=p.length;return new Blob([f],{type:"application/zip"})}const LJ=_.lazy(()=>Ko(()=>import("./CodeEditor-CGGDMGvz.js"),[]));function MJ(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let i=t;r.forEach((s,a)=>{let o=i.children.get(s);o||(o={name:s,children:new Map},i.children.set(s,o)),a===r.length-1&&(o.path=n.path),i=o})}return t}function DJ(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return r!==i?r?-1:1:t.name.localeCompare(n.name)})}function PJ({project:e,open:t,onClose:n,onChange:r}){var m;const[i,s]=_.useState(((m=e.files[0])==null?void 0:m.path)??null),[a,o]=_.useState(new Set),l=_.useRef(null),c=_.useMemo(()=>MJ(e.files),[e.files]),d=e.files.find(y=>y.path===i)??null;if(_.useEffect(()=>{var g;if(!t)return;const y=document.body.style.overflow;document.body.style.overflow="hidden",(g=l.current)==null||g.focus();const v=E=>{E.key==="Escape"&&n()};return window.addEventListener("keydown",v),()=>{document.body.style.overflow=y,window.removeEventListener("keydown",v)}},[n,t]),_.useEffect(()=>{d||e.files.length===0||s(e.files[0].path)},[e.files,d]),!t)return null;function f(y){o(v=>{const g=new Set(v);return g.has(y)?g.delete(y):g.add(y),g})}function h(y,v,g){return DJ(y).map(E=>{const b=g?`${g}/${E.name}`:E.name;if(!(E.children.size>0&&E.path===void 0)&&E.path)return u.jsxs("button",{type:"button",className:`code-browser-file${i===E.path?" is-active":""}`,style:{paddingLeft:`${12+v*16}px`},onClick:()=>s(E.path??null),title:E.path,children:[u.jsx(Qw,{"aria-hidden":"true"}),u.jsx("span",{children:E.name})]},b);const N=a.has(b);return u.jsxs("div",{children:[u.jsxs("button",{type:"button",className:"code-browser-folder",style:{paddingLeft:`${10+v*16}px`},onClick:()=>f(b),"aria-expanded":!N,children:[u.jsx(or,{className:N?"":"is-open","aria-hidden":"true"}),u.jsx(IC,{"aria-hidden":"true"}),u.jsx("span",{children:E.name})]}),!N&&h(E,v+1,b)]},b)})}function p(y){d&&r({...e,files:e.files.map(v=>v.path===d.path?{...v,content:y}:v)})}return nl.createPortal(u.jsx("div",{className:"code-browser-backdrop",onMouseDown:y=>{y.target===y.currentTarget&&n()},children:u.jsxs("section",{className:"code-browser-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"code-browser-title",children:[u.jsxs("header",{className:"code-browser-head",children:[u.jsxs("div",{className:"code-browser-title-wrap",children:[u.jsx("span",{className:"code-browser-title-icon","aria-hidden":"true",children:u.jsx(Vb,{})}),u.jsxs("div",{children:[u.jsx("h2",{id:"code-browser-title",children:"项目代码"}),u.jsx("p",{children:e.name||"Agent 项目"})]})]}),u.jsx("button",{ref:l,type:"button",className:"code-browser-close",onClick:n,"aria-label":"关闭代码浏览器",children:u.jsx(Xr,{"aria-hidden":"true"})})]}),u.jsxs("div",{className:"code-browser-workspace",children:[u.jsxs("aside",{className:"code-browser-sidebar","aria-label":"项目文件",children:[u.jsxs("div",{className:"code-browser-sidebar-head",children:["文件 ",u.jsx("span",{children:e.files.length})]}),u.jsx("div",{className:"code-browser-tree",children:e.files.length>0?h(c,0,""):u.jsx("div",{className:"code-browser-empty",children:"暂无项目文件"})})]}),u.jsxs("main",{className:"code-browser-main",children:[u.jsxs("div",{className:"code-browser-path",children:[u.jsx(Qw,{"aria-hidden":"true"}),u.jsx("span",{children:(d==null?void 0:d.path)??"未选择文件"})]}),u.jsx("div",{className:"code-browser-editor",children:d?u.jsx(_.Suspense,{fallback:u.jsx("div",{className:"code-browser-empty",children:"正在加载编辑器…"}),children:u.jsx(LJ,{value:d.content,path:d.path,onChange:p})}):u.jsx("div",{className:"code-browser-empty",children:"从左侧选择文件以查看代码"})})]})]})]})}),document.body)}function jJ({project:e,onChange:t,className:n=""}){const[r,i]=_.useState(!1);return u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",className:`code-browser-trigger ${n}`.trim(),onClick:()=>i(!0),"aria-label":"查看和编辑项目源码",title:"查看源码",children:[u.jsx(Vb,{"aria-hidden":"true"}),u.jsx("span",{children:"查看源码"})]}),u.jsx(PJ,{project:e,open:r,onClose:()=>i(!1),onChange:t})]})}function BJ({className:e,...t}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t,children:[u.jsx("path",{d:"m12 2.75 4.25 2.45v4.9L12 12.55 7.75 10.1V5.2L12 2.75Z"}),u.jsx("path",{d:"m7.75 5.2 4.25 2.45 4.25-2.45M12 7.65v4.9"}),u.jsx("path",{d:"M12 12.55v4.7m-2.25-2.2L12 17.3l2.25-2.25"}),u.jsx("path",{d:"M5.5 17.25v2.25a1.75 1.75 0 0 0 1.75 1.75h9.5a1.75 1.75 0 0 0 1.75-1.75v-2.25"})]})}function cp({message:e,className:t="",onRetry:n}){const[r,i]=_.useState(!1),[s,a]=_.useState(!1),[o,l]=_.useState(!1),c=async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),1500)}catch{a(!1)}},d=async()=>{if(!(!n||o)){l(!0);try{await n()}finally{l(!1)}}};return u.jsxs("div",{className:`deploy-error-message${r?" is-expanded":""}${t?` ${t}`:""}`,children:[u.jsx("p",{className:"deploy-error-message-text",children:e}),u.jsxs("div",{className:"deploy-error-message-actions",children:[n&&u.jsxs("button",{type:"button",className:"deploy-error-retry",disabled:o,onClick:()=>void d(),children:[o?u.jsx(bt,{className:"spin"}):u.jsx(PC,{}),o?"重试中…":"重试部署"]}),u.jsx("button",{type:"button",title:r?"收起错误信息":"展开完整错误信息","aria-label":r?"收起错误信息":"展开完整错误信息",onClick:()=>i(f=>!f),children:r?u.jsx(g9,{}):u.jsx(Uc,{})}),u.jsx("button",{type:"button",title:s?"已复制":"复制完整错误信息","aria-label":s?"已复制":"复制完整错误信息",onClick:()=>void c(),children:s?u.jsx(Li,{}):u.jsx(Kb,{})})]})]})}wr.registerLanguage("python",QR);wr.registerLanguage("typescript",cO);wr.registerLanguage("javascript",KR);wr.registerLanguage("json",YR);wr.registerLanguage("yaml",uO);wr.registerLanguage("markdown",XR);wr.registerLanguage("bash",FR);wr.registerLanguage("ini",UR);wr.registerLanguage("dockerfile",oY);wr.registerLanguage("makefile",GR);const FJ=_.lazy(()=>Ko(()=>import("./CodeEditor-CGGDMGvz.js"),[]));function UJ({open:e,onCancel:t,onConfirm:n}){const r=_.useRef(null);return _.useEffect(()=>{var a;if(!e)return;const i=document.body.style.overflow;document.body.style.overflow="hidden",(a=r.current)==null||a.focus();const s=o=>{o.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>{document.body.style.overflow=i,window.removeEventListener("keydown",s)}},[t,e]),e?nl.createPortal(u.jsx("div",{className:"code-browser-backdrop pp-confirm-backdrop",onMouseDown:i=>{i.target===i.currentTarget&&t()},children:u.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:[u.jsxs("header",{className:"code-browser-head pp-confirm-head",children:[u.jsxs("div",{className:"code-browser-title-wrap",children:[u.jsx("span",{className:"code-browser-title-icon pp-confirm-icon","aria-hidden":"true",children:u.jsx(T9,{})}),u.jsx("h2",{id:"pp-confirm-title",children:"确认部署"})]}),u.jsx("button",{type:"button",className:"code-browser-close",onClick:t,"aria-label":"关闭部署确认",children:u.jsx(Xr,{"aria-hidden":"true"})})]}),u.jsx("div",{className:"pp-confirm-body",children:u.jsx("p",{id:"pp-confirm-description",children:"部署后暂不支持修改 Agent 配置,确定部署吗?"})}),u.jsxs("footer",{className:"pp-confirm-actions",children:[u.jsx("button",{ref:r,type:"button",onClick:t,children:"取消"}),u.jsx("button",{type:"button",className:"is-primary",onClick:n,children:"确定部署"})]})]})}),document.body):null}const $J={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"},oN={dockerfile:"dockerfile","requirements.txt":"plaintext","requirements-dev.txt":"plaintext",".env":"ini",".gitignore":"plaintext",makefile:"makefile"};function lN(e){return e.replace(/&/g,"&").replace(//g,">")}function HJ(e){const n=(e.split("/").pop()??e).toLowerCase();if(oN[n])return oN[n];if(n.startsWith("dockerfile"))return"dockerfile";if(n.startsWith(".env"))return"ini";const r=n.lastIndexOf(".");if(r===-1)return null;const i=n.slice(r+1);return $J[i]??null}function zJ(e,t){try{const n=HJ(t);return n&&wr.getLanguage(n)?wr.highlight(e,{language:n,ignoreIllegals:!0}).value:n===null?wr.highlightAuto(e).value:lN(e)}catch{return lN(e)}}const bf=[{phase:"build",label:"构建镜像"},{phase:"deploy",label:"部署"},{phase:"publish",label:"发布"}];function VJ(e){return e.trim().replace(/[。.!!]+$/u,"")}function Kg(e,t="未配置"){return[...new Set(e.map(r=>r==null?void 0:r.trim()).filter(Boolean))].join("、")||t}function uM(e,t="root"){var a,o,l;const n=e.agentType??"llm",r=[...(e.builtinTools??[]).map(c=>{var d;return((d=oJ(c))==null?void 0:d.label)??c}),...(e.customTools??[]).map(c=>c.name),...(e.mcpTools??[]).map(c=>c.name),...e.tools??[]],i=[...(e.selectedSkills??[]).map(c=>c.name),...e.skills??[]],s=e.memory.longTerm?((a=cJ(e.longTermBackend??"local"))==null?void 0:a.label)??e.longTermBackend:void 0;return{id:t,name:e.name.trim()||"未命名 Agent",type:n,description:VJ(e.description),model:n==="llm"?e.modelName||e.model||"默认模型":"不适用",tools:Kg(r),skills:Kg(i),knowledgebase:e.knowledgebase?((o=uJ(e.knowledgebaseBackend??"local"))==null?void 0:o.label)??e.knowledgebaseBackend??"默认知识库":"未配置",shortTerm:e.memory.shortTerm?((l=lJ(e.shortTermBackend??"local"))==null?void 0:l.label)??e.shortTermBackend??"默认后端":"未配置",longTerm:s?`${s}${e.autoSaveSession?" · 自动保存会话":""}`:"未配置",tracing:e.tracing?Kg((e.tracingExporters??[]).map(c=>{var d;return((d=dJ(c))==null?void 0:d.label)??c}),"默认观测"):"未配置",children:e.subAgents.map((c,d)=>uM(c,`${t}.${d}`))}}function dM(e,t){if(e.id===t)return e;for(const n of e.children){const r=dM(n,t);if(r)return r}}function fM({agent:e,depth:t,inspectedId:n,onHover:r,onFocus:i}){const s=ex(e.type),a=s.icon;return u.jsxs("div",{className:"pp-topology-branch",children:[u.jsxs("button",{type:"button",className:`pp-agent-node${e.id===n?" is-inspected":""}`,style:{marginLeft:t*16,width:`calc(100% - ${t*16}px)`},onMouseEnter:()=>r(e.id),onMouseLeave:()=>r(null),onFocus:()=>i(e.id),onBlur:()=>i(null),"aria-label":`查看 ${e.name} 配置`,children:[u.jsx("span",{className:"pp-agent-node-icon",children:u.jsx(a,{"aria-hidden":"true"})}),u.jsxs("span",{className:"pp-agent-node-main",children:[u.jsx("span",{className:"pp-agent-node-name",children:e.name}),u.jsx("span",{className:"pp-agent-node-type",children:s.label})]}),e.children.length>0&&u.jsx("span",{className:"pp-agent-child-count",children:e.children.length})]}),e.children.length>0&&u.jsx("div",{className:"pp-topology-children",children:e.children.map(o=>u.jsx(fM,{agent:o,depth:t+1,inspectedId:n,onHover:r,onFocus:i},o.id))})]})}function KJ(e){const t={name:"",children:new Map};for(const n of e){const r=n.path.split("/").filter(Boolean);let i=t;r.forEach((s,a)=>{let o=i.children.get(s);o||(o={name:s,children:new Map},i.children.set(s,o)),a===r.length-1&&(o.path=n.path),i=o})}return t}function YJ(e){return[...e.children.values()].sort((t,n)=>{const r=t.children.size>0&&t.path===void 0,i=n.children.size>0&&n.path===void 0;return r!==i?r?-1:1:t.name.localeCompare(n.name)})}function WJ(e="",t=""){return{id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,key:e,value:t}}function qJ({left:e,right:t}){const[n,r]=_.useState(null);return _.useLayoutEffect(()=>{const i=document.getElementById("veadk-page-header-left"),s=document.getElementById("veadk-page-header-actions");i&&s&&r({left:i,right:s})},[]),n?u.jsxs(u.Fragment,{children:[nl.createPortal(e,n.left),nl.createPortal(t,n.right)]}):u.jsxs("header",{className:"pp-toolbar",children:[e,t]})}function nx({project:e,agentDraft:t,agentName:n,agentCount:r,onChange:i,onDeploy:s,onAgentAdded:a,onDeploymentTaskChange:o,feishuEnabled:l=!1,onFeishuEnabledChange:c,deploymentEnv:d=[],deploymentEnvValues:f={},onDeploymentEnvChange:h,network:p,onNetworkChange:m,deployRegion:y="cn-beijing",onDeployRegionChange:v,onBack:g,onExportYaml:E}){var Ke,on,Xe;const b=typeof i=="function",[w,N]=_.useState(((on=(Ke=e==null?void 0:e.files)==null?void 0:Ke[0])==null?void 0:on.path)??null),[T,A]=_.useState(new Set),[S,R]=_.useState(!1),[I,D]=_.useState(""),[F,W]=_.useState(!1),[j,$]=_.useState(!1),[C,O]=_.useState(!1),[L,M]=_.useState(null),[k,Y]=_.useState(null),[G,P]=_.useState({}),[V,Q]=_.useState(null),[ne,le]=_.useState(!1),[K,q]=_.useState([]),[ae,ye]=_.useState(!1),[he,de]=_.useState(null),[Ie,_e]=_.useState(null),xe=_.useRef(!0),je=_.useMemo(()=>t?uM(t):{id:"root",name:n||(e==null?void 0:e.name)||"未命名 Agent",type:"llm",description:"",model:"默认模型",tools:"未配置",skills:"未配置",knowledgebase:"未配置",shortTerm:"未配置",longTerm:"未配置",tracing:"未配置",children:[]},[t,n,e==null?void 0:e.name]),be=Ie??he,Ve=be?dM(je,be):void 0,ke=Ve?ex(Ve.type):void 0,ce=ke==null?void 0:ke.icon;_.useEffect(()=>(xe.current=!0,()=>{xe.current=!1}),[]);const Nt=_.useMemo(()=>!(e!=null&&e.files)||!Array.isArray(e.files)?{name:"",children:new Map}:KJ(e.files),[e==null?void 0:e.files]);if(!e||!Array.isArray(e.files))return u.jsx("div",{className:"pp-error",children:"项目数据无效"});const De=e.files.find(re=>re.path===w)??null,xt=(p==null?void 0:p.mode)??"public",it=AJ(l?[...d,...cc]:d,f),z=it.length+K.length;function X(re){A(Ee=>{const me=new Set(Ee);return me.has(re)?me.delete(re):me.add(re),me})}function oe(re,Ee){i&&(i({...e,files:re}),Ee!==void 0&&N(Ee))}function ve(re){De&&oe(e.files.map(Ee=>Ee.path===De.path?{...Ee,content:re}:Ee))}function Ae(){const re=I.trim();if(R(!1),D(""),!!re){if(e.files.some(Ee=>Ee.path===re)){N(re);return}oe([...e.files,{path:re,content:""}],re)}}function st(){if(!De)return;const re=window.prompt("重命名文件",De.path),Ee=re==null?void 0:re.trim();!Ee||Ee===De.path||e.files.some(me=>me.path===Ee)||oe(e.files.map(me=>me.path===De.path?{...me,path:Ee}:me),Ee)}function Xt(){var Ee;if(!De)return;const re=e.files.filter(me=>me.path!==De.path);oe(re,((Ee=re[0])==null?void 0:Ee.path)??null)}function ze(re,Ee){q(me=>me.map(Me=>Me.id===re?{...Me,...Ee}:Me))}function an(re){q(Ee=>Ee.filter(me=>me.id!==re))}function vt(){q(re=>[...re,WJ()])}function pt(re){m&&m(re==="public"?void 0:{...p??{mode:re},mode:re})}function jt(re){m==null||m({...p??{mode:"private"},...re})}function Vt(){const re=new Map(K.map(me=>({key:me.key.trim(),value:me.value})).filter(me=>me.key.length>0).map(me=>[me.key,me.value])),Ee=l?[...d,...cc]:d;for(const me of CJ(Ee,f))re.set(me.key,me.value);return[...re].map(([me,Me])=>({key:me,value:Me}))}async function Qt(){if(!(!c||F||C)){M(null),O(!0);try{await c(!l)}catch(re){xe.current&&M(`更新飞书配置失败:${re instanceof Error?re.message:String(re)}`)}finally{xe.current&&O(!1)}}}async function Le(){var Ee;if(!s||F)return;if(xt!=="public"&&!((Ee=p==null?void 0:p.vpcId)!=null&&Ee.trim())){M("使用 VPC 网络时,请填写 VPC ID。");return}const re=iN(d,f);if(re){const me=d.find(Me=>Me.key===re.key);M(`请返回配置页填写 ${(me==null?void 0:me.comment)||(me==null?void 0:me.key)}(${me==null?void 0:me.key})。`);return}if(l){const me=iN(cc,f);if(me){const Me=cc.find($e=>$e.key===me.key);M(`启用飞书后,请填写${(Me==null?void 0:Me.comment)||(Me==null?void 0:Me.key)}。`);return}}$(!0)}async function Je(){if(!s||F)return;$(!1);const re=Vt();xe.current&&(M(null),Y(null),P({}),Q(null),W(!0));const Ee=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;let me="生成中…";const Me=Date.now();o==null||o({id:Ee,runtimeName:me,region:y,startedAt:Me,status:"running",label:"准备部署"});try{const $e=await s(e,He=>{var ft;He.runtimeName&&(me=He.runtimeName),xe.current&&(P(at=>({...at,[He.phase]:He})),Q(He.phase)),o==null||o({id:Ee,runtimeName:me,region:y,startedAt:Me,status:"running",label:((ft=bf.find(at=>at.phase===He.phase))==null?void 0:ft.label)??He.phase,message:He.message,pct:He.pct})},l?{taskId:Ee,im:{feishu:{enabled:!0}},envs:re}:{taskId:Ee,envs:re});xe.current&&(Y($e),Q(null)),o==null||o({id:Ee,runtimeName:$e.agentName||me,runtimeId:$e.runtimeId,region:$e.region||y,startedAt:Me,status:"success",label:"部署完成"})}catch($e){const He=$e instanceof Error?$e.message:String($e);if($e instanceof DOMException&&$e.name==="AbortError"){xe.current&&(M(null),Q(null)),o==null||o({id:Ee,runtimeName:me,region:y,startedAt:Me,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"});return}xe.current&&M(He),o==null||o({id:Ee,runtimeName:me,region:y,startedAt:Me,status:"error",label:"部署失败",message:He,retry:Le})}finally{xe.current&&W(!1)}}function mt(){$(!1)}async function gt(){if(!(!k||ne)){le(!0),M(null);try{const{addConnection:re,addRuntimeConnection:Ee,remoteAppId:me,loadConnections:Me}=await Ko(async()=>{const{addConnection:ft,addRuntimeConnection:at,remoteAppId:ln,loadConnections:ht}=await Promise.resolve().then(()=>a_);return{addConnection:ft,addRuntimeConnection:at,remoteAppId:ln,loadConnections:ht}},void 0),{probeRuntimeApps:$e}=await Ko(async()=>{const{probeRuntimeApps:ft}=await Promise.resolve().then(()=>V9);return{probeRuntimeApps:ft}},void 0);let He;if(k.runtimeId){const ft=k.region??"cn-beijing",at=await $e(k.runtimeId,ft)??[];He=Ee(k.runtimeId,k.agentName,ft,at,at.length>0?{[at[0]]:k.agentName}:void 0)}else He=await re(k.agentName,k.url,k.apikey,"");if(He.apps.length===0)M("连接成功,但该地址未发现任何 Agent(/list-apps 为空)。");else{const ft={[He.apps[0]]:k.agentName},at={...He,appLabels:{...He.appLabels??{},...ft}},ht=Me().map(ut=>ut.id===He.id?at:ut);localStorage.setItem("veadk_agentkit_connections",JSON.stringify(ht));const{registerConnections:In}=await Ko(async()=>{const{registerConnections:ut}=await Promise.resolve().then(()=>a_);return{registerConnections:ut}},void 0);if(In(ht),a){const ut=me(He.id,He.apps[0]);a(ut,k.agentName)}else alert(`🎉 Agent "${k.agentName}" 已添加到左上角下拉列表!`)}}catch(re){M(`添加 Agent 失败:${re instanceof Error?re.message:String(re)}`)}finally{le(!1)}}}function se(){const re=OJ(e.files),Ee=URL.createObjectURL(re),me=document.createElement("a");me.href=Ee,me.download=`${e.name||"project"}.zip`,document.body.appendChild(me),me.click(),document.body.removeChild(me),URL.revokeObjectURL(Ee)}function Ce(re,Ee,me){return YJ(re).map(Me=>{const $e=me?`${me}/${Me.name}`:Me.name,He=Me.path!==void 0,ft={paddingLeft:8+Ee*14};if(He){const ln=Me.path===w;return u.jsxs("button",{type:"button",className:`pp-row pp-file${ln?" pp-active":""}`,style:ft,onClick:()=>N(Me.path),title:Me.path,children:[u.jsx(n9,{className:"pp-ic"}),u.jsx("span",{className:"pp-label",children:Me.name})]},$e)}const at=T.has($e);return u.jsxs("div",{children:[u.jsxs("button",{type:"button",className:"pp-row pp-folder",style:ft,onClick:()=>X($e),children:[u.jsx(or,{className:`pp-ic pp-chevron${at?"":" pp-open"}`}),u.jsx(IC,{className:"pp-ic"}),u.jsx("span",{className:"pp-label",children:Me.name})]}),!at&&Ce(Me,Ee+1,$e)]},$e)})}return u.jsxs("div",{className:`pp-root${s?" is-deploy":""}`,children:[s&&u.jsx(qJ,{left:u.jsxs("div",{className:"pp-toolbar-left",children:[g&&u.jsxs("button",{type:"button",className:"pp-toolbar-back",onClick:g,children:[u.jsx(xC,{className:"pp-ic"}),"返回配置"]}),u.jsxs("span",{className:"pp-toolbar-title",children:["部署 ",n||e.name||"未命名 Agent",r&&r>1?` 等 ${r} 个智能体`:""]})]}),right:null}),u.jsxs("div",{className:"pp-body",children:[s&&u.jsxs("section",{className:"pp-topology-pane","aria-label":"Agent 拓扑",children:[u.jsxs("div",{className:"pp-topology-head",children:[u.jsxs("div",{children:[u.jsx("div",{className:"pp-topology-title",children:"Agent 拓扑"}),u.jsxs("div",{className:"pp-topology-count",children:[r??1," 个智能体"]})]}),b&&i&&u.jsx(jJ,{project:e,onChange:i})]}),u.jsxs("div",{className:"pp-topology-scroll",children:[u.jsx("div",{className:"pp-topology-tree",children:u.jsx(fM,{agent:je,depth:0,inspectedId:be,onHover:de,onFocus:_e})}),Ve&&ke&&ce&&u.jsxs("div",{className:"pp-agent-inspector","aria-live":"polite",children:[u.jsxs("div",{className:"pp-agent-inspector-head",children:[u.jsx("span",{className:"pp-agent-inspector-icon",children:u.jsx(ce,{"aria-hidden":"true"})}),u.jsxs("div",{children:[u.jsx("strong",{children:Ve.name}),u.jsx("span",{children:ke.label})]})]}),Ve.description&&u.jsx("p",{children:Ve.description}),u.jsxs("dl",{className:"pp-agent-config-grid",children:[u.jsx("dt",{children:"模型"}),u.jsx("dd",{children:Ve.model}),u.jsx("dt",{children:"工具"}),u.jsx("dd",{children:Ve.tools}),u.jsx("dt",{children:"技能"}),u.jsx("dd",{children:Ve.skills}),u.jsx("dt",{children:"知识库"}),u.jsx("dd",{children:Ve.knowledgebase}),u.jsx("dt",{children:"短期记忆"}),u.jsx("dd",{children:Ve.shortTerm}),u.jsx("dt",{children:"长期记忆"}),u.jsx("dd",{children:Ve.longTerm}),u.jsx("dt",{children:"观测"}),u.jsx("dd",{children:Ve.tracing})]})]})]}),u.jsxs("div",{className:"pp-topology-actions",children:[E&&u.jsxs("button",{type:"button",className:"pp-secondary",onClick:E,children:[u.jsx(J8,{className:"pp-ic"}),"导出配置"]}),e.files.length>0&&u.jsxs("button",{type:"button",className:"pp-secondary",onClick:se,children:[u.jsx(Yb,{className:"pp-ic"}),"下载源码"]})]})]}),u.jsxs("div",{className:"pp-files-area",children:[u.jsxs("div",{className:"pp-sidebar",children:[u.jsxs("div",{className:"pp-sidebar-head",children:[u.jsx("span",{className:"pp-project-name",title:e.name,children:"文件预览"}),b&&u.jsx("button",{type:"button",className:"pp-icon-btn",title:"新建文件",onClick:()=>{R(!0),D("")},children:u.jsx(e9,{className:"pp-ic"})})]}),u.jsxs("div",{className:"pp-tree",children:[S&&u.jsx("input",{className:"pp-new-input",autoFocus:!0,placeholder:"path/to/file.py",value:I,onChange:re=>D(re.target.value),onBlur:Ae,onKeyDown:re=>{re.key==="Enter"&&Ae(),re.key==="Escape"&&(R(!1),D(""))}}),e.files.length===0&&!S?u.jsx("div",{className:"pp-empty",children:"暂无文件"}):Ce(Nt,0,"")]})]}),u.jsxs("div",{className:"pp-main",children:[u.jsxs("div",{className:"pp-main-head",children:[u.jsx("span",{className:"pp-path",title:De==null?void 0:De.path,children:(De==null?void 0:De.path)??"未选择文件"}),u.jsx("div",{className:"pp-actions",children:b&&De&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"pp-icon-btn",title:"重命名",onClick:st,children:u.jsx(E9,{className:"pp-ic"})}),u.jsx("button",{type:"button",className:"pp-icon-btn pp-danger",title:"删除",onClick:Xt,children:u.jsx(Il,{className:"pp-ic"})})]})})]}),u.jsx("div",{className:"pp-content",children:De==null?u.jsx("div",{className:"pp-placeholder",children:"选择左侧文件以查看内容"}):b?u.jsx("div",{className:"pp-codemirror",children:u.jsx(_.Suspense,{fallback:u.jsx("div",{className:"pp-editor-loading",children:"加载编辑器…"}),children:u.jsx(FJ,{value:De.content,path:De.path,onChange:ve})})}):u.jsx("pre",{className:"pp-pre hljs",dangerouslySetInnerHTML:{__html:zJ(De.content,De.path)}})})]})]}),s&&u.jsxs("aside",{className:"pp-config","aria-label":"部署配置",children:[u.jsx("div",{className:"pp-config-head",children:u.jsx("div",{className:"pp-config-title",children:"部署配置"})}),u.jsxs("div",{className:"pp-config-scroll",children:[u.jsxs("section",{className:"pp-config-section",children:[u.jsx("div",{className:"pp-config-label",children:"发布区域"}),u.jsxs("select",{className:"pp-config-select",value:y,onChange:re=>v==null?void 0:v(re.target.value),"aria-label":"部署区域",disabled:F||!v,children:[u.jsx("option",{value:"cn-beijing",children:"华北 2(北京)"}),u.jsx("option",{value:"cn-shanghai",children:"华东 2(上海)"})]})]}),u.jsxs("section",{className:"pp-config-section",children:[u.jsx("div",{className:"pp-config-label",children:"消息渠道"}),u.jsxs("button",{type:"button",role:"switch","aria-checked":l,className:`pp-channel${l?" is-on":""}`,onClick:()=>void Qt(),disabled:F||C||!c,children:[u.jsx("span",{className:"pp-channel-title",children:C?"飞书(正在更新代码…)":"飞书"}),u.jsx("span",{className:"pp-switch","aria-hidden":!0,children:u.jsx("span",{})})]}),l&&u.jsx("div",{className:"pp-channel-fields",children:cc.map(re=>u.jsxs("label",{children:[u.jsxs("span",{children:[re.comment||re.key,re.required&&u.jsx("small",{children:"必填"})]}),u.jsx("code",{children:re.key}),u.jsx("input",{type:re.key.includes("SECRET")?"password":"text",value:f[re.key]??"",placeholder:re.placeholder,disabled:F||!h,autoComplete:"off",onChange:Ee=>h==null?void 0:h(re.key,Ee.currentTarget.value)})]},re.key))})]}),u.jsxs("section",{className:"pp-config-section",children:[u.jsx("div",{className:"pp-config-label",children:"网络"}),u.jsx("div",{className:"pp-network-modes",role:"radiogroup","aria-label":"网络模式",children:["public","private","both"].map(re=>u.jsx("button",{type:"button",role:"radio","aria-checked":xt===re,className:xt===re?"is-on":"",onClick:()=>pt(re),disabled:F||!m,children:re==="public"?"公网":re==="private"?"VPC":"公网 + VPC"},re))}),xt!=="public"&&u.jsxs("div",{className:"pp-network-fields",children:[u.jsxs("label",{children:[u.jsx("span",{children:"VPC ID"}),u.jsx("input",{value:(p==null?void 0:p.vpcId)??"",placeholder:"vpc-xxxxxxxx",disabled:F,onChange:re=>jt({vpcId:re.target.value})})]}),u.jsxs("label",{children:[u.jsxs("span",{children:["子网 ID ",u.jsx("small",{children:"可选,多个用逗号分隔"})]}),u.jsx("input",{value:(p==null?void 0:p.subnetIds)??"",placeholder:"subnet-xxx, subnet-yyy",disabled:F,onChange:re=>jt({subnetIds:re.target.value})})]}),u.jsxs("label",{className:"pp-network-check",children:[u.jsx("input",{type:"checkbox",checked:!!(p!=null&&p.enableSharedInternetAccess),disabled:F,onChange:re=>jt({enableSharedInternetAccess:re.target.checked})}),"VPC 内共享公网出口"]})]})]}),u.jsxs("section",{className:"pp-config-section pp-env-section",children:[u.jsxs("div",{className:"pp-env-head",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"pp-config-label",children:["环境变量",u.jsxs("span",{className:"pp-agent-child-count pp-env-count",children:[z," 项"]})]}),u.jsx("div",{className:"pp-env-sub",children:"组件配置会自动同步到这里,部署前可核对最终值。"})]}),u.jsx("button",{type:"button",className:"pp-icon-btn",title:ae?"隐藏值":"显示值",onClick:()=>ye(re=>!re),children:ae?u.jsx(Z8,{className:"pp-ic"}):u.jsx(kC,{className:"pp-ic"})})]}),u.jsxs("button",{type:"button",className:"pp-env-add",onClick:vt,disabled:F,children:[u.jsx(pi,{className:"pp-ic"}),"添加变量"]}),(it.length>0||K.length>0)&&u.jsxs("div",{className:"pp-env-table",children:[it.length>0&&u.jsxs("div",{className:"pp-env-group",children:[u.jsxs("div",{className:"pp-env-group-head",children:[u.jsx("span",{children:"组件自动生成"}),u.jsxs("small",{children:[it.length," 项"]})]}),it.map(re=>{const Ee=re.key.startsWith("ENABLE_");return u.jsxs("div",{className:"pp-env-row pp-env-row-derived",children:[u.jsx("input",{className:"pp-env-key-fixed",value:re.key,readOnly:!0,disabled:F,"aria-label":`${re.key} 环境变量名`}),u.jsx("input",{type:Ee||ae?"text":"password",value:re.value,placeholder:re.required?"必填,尚未填写":"可选,尚未填写",readOnly:Ee,disabled:F||!Ee&&!h,autoComplete:"off","aria-label":`${re.key} 环境变量值`,onChange:me=>h==null?void 0:h(re.key,me.currentTarget.value)}),u.jsx("span",{className:"pp-env-source",children:Ee?"自动":"同步"})]},re.key)})]}),K.length>0&&u.jsxs("div",{className:"pp-env-group-head pp-env-group-head-custom",children:[u.jsx("span",{children:"自定义变量"}),u.jsxs("small",{children:[K.length," 项"]})]}),K.map(re=>u.jsxs("div",{className:"pp-env-row",children:[u.jsx("input",{value:re.key,placeholder:"名称",disabled:F,autoComplete:"off",onChange:Ee=>ze(re.id,{key:Ee.currentTarget.value})}),u.jsx("input",{type:ae?"text":"password",value:re.value,placeholder:"值",disabled:F,autoComplete:"off",onChange:Ee=>ze(re.id,{value:Ee.currentTarget.value})}),u.jsx("button",{type:"button",className:"pp-icon-btn pp-env-remove",title:"删除变量",disabled:F,onClick:()=>an(re.id),children:u.jsx(Xr,{className:"pp-ic"})})]},re.id))]})]}),(F||k||Object.keys(G).length>0)&&u.jsxs("section",{className:"pp-config-section pp-progress-section",children:[u.jsx("div",{className:"pp-config-label",children:"部署进度"}),u.jsx("ol",{className:"pp-steps",children:bf.map((re,Ee)=>{const me=V?bf.findIndex(ft=>ft.phase===V):-1,Me=!!L&&(me===-1?Ee===0:Ee===me);let $e;k?$e="done":Me?$e="failed":me===-1?$e=F?"active":"pending":Eere.phase===V))==null?void 0:Xe.label)??V}阶段):`:""}${L}`,onRetry:Le}),k&&u.jsxs("section",{className:"pp-deploy-result",children:[u.jsx("div",{className:"pp-deploy-result-header",children:"部署成功"}),u.jsxs("div",{className:"pp-deploy-result-body",children:[k.region&&u.jsxs("div",{className:"pp-deploy-result-field",children:[u.jsx("label",{children:"区域"}),u.jsx("code",{children:k.region==="cn-shanghai"?"上海 (cn-shanghai)":"北京 (cn-beijing)"})]}),u.jsxs("div",{className:"pp-deploy-result-field",children:[u.jsx("label",{children:"Agent 名称"}),u.jsx("code",{children:k.agentName})]}),u.jsxs("div",{className:"pp-deploy-result-field",children:[u.jsx("label",{children:"API 端点"}),u.jsx("code",{className:"pp-deploy-result-url",children:k.url})]})]}),u.jsxs("div",{className:"pp-deploy-result-actions",children:[u.jsxs("button",{type:"button",className:"pp-deploy-result-btn",onClick:gt,disabled:ne,children:[ne?u.jsx(bt,{className:"pp-ic spin"}):u.jsx(MC,{className:"pp-ic"}),ne?"连接中…":"立即对话"]}),k.consoleUrl&&u.jsxs("a",{href:k.consoleUrl,target:"_blank",rel:"noopener noreferrer",className:"pp-console-link pp-console-link-btn",children:[u.jsx(Wb,{className:"pp-ic"}),"控制台"]})]})]})]}),u.jsx("div",{className:"pp-config-actions",children:u.jsxs("button",{type:"button",className:"pp-deploy",onClick:Le,disabled:F||C,children:[F?u.jsx(bt,{className:"pp-ic spin"}):L?u.jsx(PC,{className:"pp-ic"}):u.jsx(BJ,{className:"pp-ic"}),F?"部署中…":L?"重试部署":"部署"]})})]})]}),u.jsx(UJ,{open:j,onCancel:mt,onConfirm:()=>void Je()})]})}const cN="dogfooding",Yg="dogfooding",Wg="dogfooding_b";let GJ=0;const qg=()=>++GJ;function uN(e){return e.blocks.filter(t=>t.kind==="text").map(t=>t.text).join("")}function XJ(e){const t=e.trim(),n=t.match(/^```(?:json)?\s*\n?([\s\S]*?)\n?```$/i);return(n?n[1]:t).trim()}async function dN(e){const t=[],n=XJ(e);t.push(n);const r=n.indexOf("{"),i=n.lastIndexOf("}");r>=0&&i>r&&t.push(n.slice(r,i+1));for(const s of t)try{const a=JSON.parse(s);if(a&&typeof a=="object"&&(typeof a.name=="string"||typeof a.instruction=="string"))return await Vh(aM(a))}catch{}return null}function QJ({userId:e,onBack:t,onCreate:n,onAgentAdded:r,onDeploymentTaskChange:i}){const[s,a]=_.useState([{id:qg(),role:"assistant",text:"你好,我是 VeADK 的智能构建助手。用自然语言描述你想要的 Agent,我会直接帮你生成一个可运行的 VeADK 项目,并在右侧实时预览。"}]),[o,l]=_.useState(""),[c,d]=_.useState(!1),[f,h]=_.useState(null),[p,m]=_.useState(null),[y,v]=_.useState(!1),[g,E]=_.useState(null),[b,w]=_.useState(null),[N,T]=_.useState(!1),[A,S]=_.useState(!1),[R,I]=_.useState({}),D=_.useRef(null),F=_.useRef(null),W=_.useRef(null),j=_.useRef(null),$=_.useRef(null);_.useEffect(()=>{const Q=j.current;Q&&Q.scrollTo({top:Q.scrollHeight,behavior:"smooth"})},[s,c]),_.useEffect(()=>{const Q=$.current;Q&&(Q.style.height="auto",Q.style.height=Math.min(Q.scrollHeight,160)+"px")},[o]);const C=Q=>a(ne=>[...ne,{id:qg(),role:"assistant",text:Q}]);async function O(){if(D.current)return D.current;const Q=await Hh(cN,e);return D.current=Q,Q}async function L(Q,ne){if(ne.current)return ne.current;const le=await Hh(Q,e);return ne.current=le,le}async function M(Q,ne){if(!R[Q])try{const le=await id(ne);I(K=>({...K,[Q]:le.model||ne}))}catch{I(le=>({...le,[Q]:ne}))}}async function k(Q,ne,le){const K=await L(Q,ne);let q=Ki();for await(const ye of Nu({appName:Q,userId:e,sessionId:K,text:le}))q=al(q,ye);const ae=uN(q).trim();return{project:await dN(ae),finalText:ae}}const Y=async(Q,ne,le)=>nE(Q.name,Q.files,{region:"cn-beijing",projectName:"default"},{...le,onStage:ne}),G=async()=>{const Q=o.trim();if(!(!Q||c)){if(a(ne=>[...ne,{id:qg(),role:"user",text:Q}]),l(""),h(null),d(!0),y){E(null),w(null),T(!0),S(!0),M("a",Yg),M("b",Wg);const ne=k(Yg,F,Q).then(({project:K})=>(E(K),K)).catch(K=>{const q=K instanceof Error?K.message:String(K);return h(q),null}).finally(()=>T(!1)),le=k(Wg,W,Q).then(({project:K})=>(w(K),K)).catch(K=>{const q=K instanceof Error?K.message:String(K);return h(q),null}).finally(()=>S(!1));try{const[K,q]=await Promise.all([ne,le]),ae=[K?`方案 A:${K.name}`:null,q?`方案 B:${q.name}`:null].filter(Boolean);ae.length?C(`已生成两个方案(${ae.join(",")}),请在右侧对比后采用其一。`):C("(两个方案都没有返回可用的项目,请再描述一下你的需求。)")}finally{d(!1)}return}try{const ne=await O();let le=Ki();for await(const ae of Nu({appName:cN,userId:e,sessionId:ne,text:Q}))le=al(le,ae);const K=uN(le).trim(),q=await dN(K);q?(m(q),C(`已生成项目:${q.name}(${q.files.length} 个文件),可在右侧预览和编辑。`)):C(K||"(助手没有返回内容,请再描述一下你的需求。)")}catch(ne){const le=ne instanceof Error?ne.message:String(ne);h(le),C(`抱歉,调用智能构建助手失败:${le}`)}finally{d(!1)}}},P=Q=>{const ne=Q==="a"?g:b;if(!ne)return;m(ne),v(!1),E(null),w(null),T(!1),S(!1);const le=Q==="a"?"A":"B",K=Q==="a"?R.a:R.b;C(`已采用方案 ${le}(${K??(Q==="a"?Yg:Wg)}),可继续编辑。`)},V=Q=>{Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(Q.preventDefault(),G())};return u.jsx("div",{className:"ic-root",children:u.jsxs("div",{className:"ic-body",children:[u.jsxs("div",{className:"ic-chat",children:[u.jsxs("div",{className:"ic-transcript",ref:j,children:[u.jsx(js,{initial:!1,children:s.map(Q=>u.jsxs($t.div,{className:`ic-turn ic-turn--${Q.role}`,initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.22,ease:"easeOut"},children:[Q.role==="assistant"&&u.jsx("div",{className:"ic-avatar",children:u.jsx(La,{className:"ic-avatar-icon"})}),u.jsx("div",{className:"ic-bubble",children:Q.role==="assistant"?u.jsx(im,{text:Q.text}):Q.text})]},Q.id))}),c&&u.jsxs($t.div,{className:"ic-turn ic-turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},children:[u.jsx("div",{className:"ic-avatar",children:u.jsx(La,{className:"ic-avatar-icon"})}),u.jsxs("div",{className:"ic-bubble ic-bubble--typing",children:[u.jsx("span",{className:"ic-dot"}),u.jsx("span",{className:"ic-dot"}),u.jsx("span",{className:"ic-dot"})]})]})]}),f&&u.jsxs("div",{className:"ic-error",children:[u.jsx(NC,{className:"ic-error-icon"}),f]}),u.jsxs("div",{className:"ic-composer",children:[u.jsxs("div",{className:"ic-composer-box",children:[u.jsx("textarea",{ref:$,className:"ic-input",rows:1,placeholder:"描述你想要的 Agent,例如「一个帮我整理周报的写作助手」…",value:o,onChange:Q=>l(Q.target.value),onKeyDown:V,disabled:c}),u.jsx("button",{className:"ic-send",onClick:()=>void G(),disabled:!o.trim()||c,title:"发送 (Enter)",children:u.jsx(w9,{className:"ic-send-icon"})})]}),u.jsxs("div",{className:"ic-composer-foot",children:[u.jsxs("label",{className:"ic-ab-toggle",title:"同时用两个模型生成方案进行对比",children:[u.jsx("input",{type:"checkbox",className:"ic-ab-checkbox",checked:y,disabled:c,onChange:Q=>v(Q.target.checked)}),u.jsx("span",{className:"ic-ab-track",children:u.jsx("span",{className:"ic-ab-thumb"})}),u.jsx("span",{className:"ic-ab-label",children:"A/B 对比"})]}),u.jsx("div",{className:"ic-composer-hint",children:"Enter 发送 · Shift+Enter 换行"})]})]})]}),u.jsx("aside",{className:"ic-preview",children:y?u.jsxs("div",{className:"ic-compare",children:[u.jsx(fN,{side:"a",project:g,loading:N,model:R.a,onAdopt:()=>P("a")}),u.jsx("div",{className:"ic-compare-divider"}),u.jsx(fN,{side:"b",project:b,loading:A,model:R.b,onAdopt:()=>P("b")})]}):p?u.jsx(nx,{project:p,onChange:m,onDeploy:Y,onAgentAdded:r,onDeploymentTaskChange:i}):u.jsxs("div",{className:"ic-preview-empty",children:[u.jsxs("div",{className:"ic-preview-empty-icon",children:[u.jsx(r9,{className:"ic-preview-empty-glyph"}),u.jsx(Ma,{className:"ic-preview-empty-spark"})]}),u.jsx("div",{className:"ic-preview-empty-title",children:"还没有项目"}),u.jsx("div",{className:"ic-preview-empty-sub",children:"描述你的需求,我会帮你生成 VeADK 项目"})]})})]})})}function fN({side:e,project:t,loading:n,model:r,onAdopt:i}){const s=e==="a"?"方案 A":"方案 B";return u.jsxs("div",{className:"ic-pane",children:[u.jsxs("div",{className:"ic-pane-head",children:[u.jsxs("div",{className:"ic-pane-title",children:[u.jsx("span",{className:`ic-pane-tag ic-pane-tag--${e}`,children:s}),r&&u.jsx("span",{className:"ic-pane-model",children:r})]}),u.jsxs("button",{className:"ic-adopt",onClick:i,disabled:!t||n,title:`采用${s}`,children:["采用",e==="a"?"方案 A":"方案 B"]})]}),u.jsx("div",{className:"ic-pane-body",children:n?u.jsxs("div",{className:"ic-pane-loading",children:[u.jsx(bt,{className:"ic-pane-spinner"}),u.jsx("span",{children:"正在生成…"})]}):t?u.jsx(nx,{project:t}):u.jsx("div",{className:"ic-pane-empty",children:"该方案未返回可用项目"})})]})}const ZJ=/^[A-Za-z_][A-Za-z0-9_]*$/;function Yo(e){return e.trim().length===0?"名称为必填项":e==="user"?"user 是 Google ADK 保留名称,请使用其他名称":ZJ.test(e)?null:"名称须以英文字母或下划线开头,且只能包含英文字母、数字和下划线"}function hM(e){const t=new Set,n=new Set,r=i=>{Yo(i.name)===null&&(t.has(i.name)?n.add(i.name):t.add(i.name)),i.subAgents.forEach(r)};return r(e),n}function Zr(e){return e.trimEnd().replace(/[。.]+$/,"")}function na(e,t){return e[t]|e[t+1]<<8}function uc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}async function JJ(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 eee(e){let n=-1;for(let o=e.length-22;o>=0&&o>e.length-65557;o--)if(uc(e,o)===101010256){n=o;break}if(n<0)throw new Error("无效的 zip:找不到 EOCD");const r=na(e,n+10);let i=uc(e,n+16);const s=new TextDecoder("utf-8"),a=[];for(let o=0;o{var o;return{source:"skillhub",id:a.Id??a.Slug??"",slug:a.Slug??"",name:a.Name??a.Slug??"",description:((o=a.Metadata)==null?void 0:o.DisplayDescription)||a.Description||"",namespace:a.Namespace??t,sourceRepo:a.SourceRepo,downloadCount:a.DownloadCount}})}function ree({selected:e,onChange:t}){const[n,r]=_.useState(""),[i,s]=_.useState([]),[a,o]=_.useState(!1),[l,c]=_.useState(null),[d,f]=_.useState(!1),h=y=>e.some(v=>v.source==="skillhub"&&v.slug===y),p=y=>{y.slug&&(h(y.slug)?t(e.filter(v=>!(v.source==="skillhub"&&v.slug===y.slug))):t([...e,{source:"skillhub",slug:y.slug,name:y.name,folder:y.slug.split("/").pop()||y.name,namespace:y.namespace||"public",description:y.description}]))},m=async y=>{o(!0),c(null),f(!0);try{const v=await nee(y);s(v)}catch(v){c(v instanceof Error?v.message:"搜索失败,请稍后重试。"),s([])}finally{o(!1)}};return _.useEffect(()=>{const y=n.trim();if(!y){s([]),f(!1),c(null);return}const v=setTimeout(()=>m(y),300);return()=>clearTimeout(v)},[n]),u.jsxs("div",{className:"cw-skillhub",children:[u.jsxs("div",{className:"cw-skill-searchrow",children:[u.jsxs("div",{className:"cw-skill-searchbox",children:[u.jsx(Ny,{className:"cw-i cw-skill-searchicon","aria-hidden":!0}),u.jsx("input",{className:"cw-input cw-skill-input",value:n,placeholder:"搜索火山 Find Skill 技能广场,例如 数据分析、PDF…",onChange:y=>r(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),n.trim()&&m(n))}})]}),u.jsxs("button",{type:"button",className:"cw-btn cw-btn-soft",onClick:()=>n.trim()&&m(n),disabled:!n.trim()||a,children:[a?u.jsx(bt,{className:"cw-i cw-spin"}):u.jsx(Ny,{className:"cw-i"}),"搜索"]})]}),l&&u.jsxs("div",{className:"cw-banner",children:[u.jsx(td,{className:"cw-i"}),u.jsx("span",{children:l})]}),a&&i.length===0?u.jsx("p",{className:"cw-empty-line",children:"正在搜索…"}):i.length>0?u.jsx("div",{className:"cw-skill-results",children:i.map(y=>{const v=h(y.slug||"");return u.jsxs("button",{type:"button",className:`cw-skill-result ${v?"is-on":""}`,onClick:()=>p(y),"aria-pressed":v,children:[u.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:v?u.jsx(Li,{className:"cw-i cw-i-sm"}):u.jsx(pi,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-skill-result-meta",children:[u.jsx("span",{className:"cw-skill-result-name",children:y.name}),y.description&&u.jsx("span",{className:"cw-skill-result-desc",children:Zr(y.description)}),y.sourceRepo&&u.jsx("span",{className:"cw-skill-result-repo",children:y.sourceRepo})]})]},y.id||y.slug)})}):d&&!l?u.jsx("p",{className:"cw-empty-line",children:"没有找到匹配的技能,换个关键词试试。"}):!d&&u.jsx("p",{className:"cw-empty-line",children:"输入关键词搜索火山 Find Skill 技能广场,所选技能会在生成项目时下载到 skills/ 目录。"})]})}const n1=/(^|\/)skill\.md$/i;class Fs extends Error{}function iee(e,t){const n=(e??"").replace(/\r\n?/g,` `).split(` -`);if(!n.length||n[0].trim()!=="---")throw new Ms(`${t} 的 SKILL.md 必须以 YAML frontmatter (--- ... ---) 开头`);let r=-1;for(let o=1;o=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function tee(e,t){if(!e)throw new Ms(`${t} 的 SKILL.md 缺少必填的 name frontmatter`);if(e.length>64)throw new Ms(`${t} 的 name 长度超过 64 个字符`);if(!/^[a-z0-9-]+$/.test(e))throw new Ms(`${t} 的 name 必须匹配 [a-z0-9-]+(小写字母、数字、短横线)`)}function nee(e,t){if(!e)throw new Ms(`${t} 的 SKILL.md 缺少必填的 description frontmatter`);if(e.length>1024)throw new Ms(`${t} 的 description 长度超过 1024 个字符`);if(/<[^>]+>/.test(e))throw new Ms(`${t} 的 description 不能包含 XML 标签`)}function cM(e){const t=e.map(r=>({path:r.path.replace(/\\/g,"/").replace(/^\.\//,""),text:r.text})).filter(r=>r.path.length>0&&!r.path.endsWith("/")),n=new Set(t.map(r=>r.path.split("/")[0]));if(n.size===1&&t.every(r=>r.path.includes("/"))){const r=[...n][0]+"/";return t.map(i=>({path:i.path.slice(r.length),text:i.text}))}return t}function ree(e){const t=new Map,n=new Set;for(const r of e)if(t1.test("/"+r.path)){const i=r.path.split("/");n.add(i.slice(0,-1).join("/"))}for(const r of e){const i=r.path.split("/");let s="";for(let c=i.length-1;c>=0;c--){const d=i.slice(0,c).join("/");if(n.has(d)){s=d;break}}const a=t1.test("/"+r.path);if(!s&&!a&&!n.has("")||!n.has(s)&&!a)continue;const o=s?r.path.slice(s.length+1):r.path,l=t.get(s)||[];l.push({path:o,text:r.text}),t.set(s,l)}return t}function iee(e,t,n){const r=`${n}${e?"/"+e:""}`,i=t.find(l=>t1.test("/"+l.path));if(!i)return{hit:null,error:`${r} 缺少 SKILL.md`};let s;try{s=JJ(i.text,r)}catch(l){return{hit:null,error:l instanceof Error?l.message:String(l)}}const a=s.name,o=[];for(const l of t){if(l.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${l.path}`};const d=`skills/${a}/${l.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${l.path}`};o.push({path:d,content:l.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:s.name,description:s.description,folder:a,localFiles:o},error:null}}async function see(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await GJ(t)).map(i=>({path:i.name,text:i.text}));return uM(cM(r),e.name)}async function aee(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function lee(e){const t=e.createReader(),n=[];for(;;){const r=await new Promise((i,s)=>t.readEntries(i,s));if(r.length===0)return n;n.push(...r)}}async function dM(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await oee(e),path:n}];if(!e.isDirectory)return[];const r=await lee(e);return(await Promise.all(r.map(i=>dM(i,n)))).flat()}function cee({selected:e,onChange:t}){const[n,r]=_.useState([]),[i,s]=_.useState([]),[a,o]=_.useState(!1),[l,c]=_.useState(!1),d=_.useRef(0),f=b=>e.some(w=>w.source==="local"&&w.folder===b),h=b=>{b.localFiles&&(f(b.folder||b.name)?t(e.filter(w=>!(w.source==="local"&&w.folder===(b.folder||b.name)))):t([...e,{source:"local",folder:b.folder||b.name,name:b.name,description:b.description,localFiles:b.localFiles}]))},p=_.useRef([]),m=_.useRef(e);_.useEffect(()=>{p.current=i},[i]),_.useEffect(()=>{m.current=e},[e]);const y=b=>{const w=new Set([...p.current.map(S=>S.folder||S.name),...m.current.filter(S=>S.source==="local").map(S=>S.folder)]),N=[],T=[];for(const S of b.hits){const O=S.folder||S.name;if(w.has(O)){N.push(S.name);continue}w.add(O),T.push(S)}s(S=>[...S,...T]);const A=[...b.errors];if(N.length>0&&A.push(`已跳过重复技能:${N.join("、")}`),r(A),T.length===1&&b.errors.length===0&&N.length===0){const S=T[0];S.localFiles&&t([...m.current,{source:"local",folder:S.folder||S.name,name:S.name,description:S.description,localFiles:S.localFiles}])}},v=b=>{b.preventDefault(),d.current+=1,c(!0)},g=b=>{b.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&c(!1)},E=async b=>{if(b.preventDefault(),d.current=0,c(!1),a)return;const w=Array.from(b.dataTransfer.items).map(N=>{var T;return(T=N.webkitGetAsEntry)==null?void 0:T.call(N)}).filter(N=>N!==null);if(w.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const N=(await Promise.all(w.map(S=>dM(S)))).flat(),T=w.some(S=>S.isDirectory);if(!T&&N.length===1&&N[0].file.name.toLowerCase().endsWith(".zip")){y(await see(N[0].file));return}if(!T){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const A=new Map(N.map(({file:S,path:O})=>[S,O]));y(await aee(N.map(({file:S})=>S),A))}catch(N){r([`读取失败:${N instanceof Error?N.message:String(N)}`])}finally{o(!1)}};return u.jsxs("div",{className:"cw-local",children:[u.jsxs("div",{className:`cw-local-dropzone ${l?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:v,onDragOver:b=>b.preventDefault(),onDragLeave:g,onDrop:b=>void E(b),children:[u.jsx(Wb,{className:"cw-local-drop-icon","aria-hidden":!0}),u.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),u.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md(含 name / description frontmatter)。支持包含多个技能的目录。"}),a&&u.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&u.jsxs("div",{className:"cw-banner",children:[u.jsx(Xu,{className:"cw-i"}),u.jsx("span",{children:n.join(";")})]}),i.length>0&&u.jsx("div",{className:"cw-skill-results",children:i.map(b=>{var N;const w=f(b.folder||b.name);return u.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>h(b),"aria-pressed":w,children:[u.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?u.jsx(Ai,{className:"cw-i cw-i-sm"}):u.jsx(li,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-skill-result-meta",children:[u.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&u.jsx("span",{className:"cw-skill-result-desc",children:Yr(b.description)}),u.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((N=b.localFiles)==null?void 0:N.length)??0," 个文件"]})]})]},b.id)})})]})}async function fM(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:Qu(void 0,Hp)});if(t.status===409)throw new Error("服务端未配置 Volcengine 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 uee(){return(await fM("/web/skill-spaces?region=all")).items||[]}async function dee(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await fM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}function fee(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 hee(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function pee({selected:e,onChange:t}){const[n,r]=_.useState([]),[i,s]=_.useState([]),[a,o]=_.useState(""),[l,c]=_.useState(!0),[d,f]=_.useState(!1),[h,p]=_.useState(null);_.useEffect(()=>{let g=!1;return(async()=>{c(!0),p(null);try{const E=await uee();g||(r(E),E.length>0&&o(E[0].id))}catch(E){g||p(E instanceof Error?E.message:"加载失败")}finally{g||c(!1)}})(),()=>{g=!0}},[]),_.useEffect(()=>{if(!a){s([]);return}const g=n.find(b=>b.id===a);let E=!1;return(async()=>{f(!0),p(null);try{const b=await dee(a,g==null?void 0:g.region);E||s(b)}catch(b){E||p(b instanceof Error?b.message:"加载失败")}finally{E||f(!1)}})(),()=>{E=!0}},[a,n]);const m=n.find(g=>g.id===a),y=(g,E)=>e.some(b=>b.source==="skillspace"&&b.skillId===g&&(b.version||"")===E),v=g=>{if(m)if(y(g.skillId,g.version))t(e.filter(E=>!(E.source==="skillspace"&&E.skillId===g.skillId&&(E.version||"")===g.version)));else{const E=fee(m,g);t([...e,{source:"skillspace",folder:E.folder||g.skillName,name:E.name,description:E.description,skillSpaceId:E.skillSpaceId,skillSpaceName:E.skillSpaceName,skillSpaceRegion:E.skillSpaceRegion,skillId:E.skillId,version:E.version}])}};return u.jsx("div",{className:"cw-skillspace",children:l?u.jsxs("p",{className:"cw-empty-line",children:[u.jsx(xt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?u.jsxs("div",{className:"cw-banner",children:[u.jsx(Xu,{className:"cw-i"}),u.jsx("span",{children:h})]}):n.length===0?u.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"cw-skillspace-header",children:[u.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>u.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${Yr(g.description)}`:""]},g.id))}),m&&u.jsx("a",{href:hee(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:u.jsx(Yb,{className:"cw-i cw-i-sm"})})]}),d?u.jsxs("p",{className:"cw-empty-line",children:[u.jsx(xt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):i.length===0?u.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):u.jsx("div",{className:"cw-skill-results",children:i.map(g=>{const E=y(g.skillId,g.version);return u.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>v(g),"aria-pressed":E,children:[u.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?u.jsx(Ai,{className:"cw-i cw-i-sm"}):u.jsx(li,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-skill-result-meta",children:[u.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&u.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&u.jsx("span",{className:"cw-skill-result-desc",children:Yr(g.skillDescription)}),u.jsxs("span",{className:"cw-skill-result-repo",children:[u.jsx(V8,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}const mee=_.lazy(()=>Uo(()=>import("./MarkdownPromptEditor-Dd-SgWF0.js"),__vite__mapDeps([0,1])));function gee(e,t,n="text/plain"){const r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}const fN=[{id:"type",label:"类型",hint:"选择 Agent 类型",icon:y9,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:Xu,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:TC},{id:"tools",label:"工具",hint:"可调用的能力",icon:Xb},{id:"skills",label:"技能",hint:"声明式技能",icon:Aa},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:$f},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:OC},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:wC},{id:"review",label:"完成",hint:"预览并创建",icon:m9}];function yee({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"m7.2 15.8 7.9-7.9a2 2 0 0 1 2.8 0l1.2 1.2a2 2 0 0 1 0 2.8l-7 7H8.7l-1.5-1.5a1.15 1.15 0 0 1 0-1.6Z"}),u.jsx("path",{d:"m12.7 10.3 4 4"}),u.jsx("path",{d:"M6.3 19h12.4"}),u.jsx("path",{d:"m5.5 8.2.5-1.4 1.4-.5L6 5.8l-.5-1.4L5 5.8l-1.4.5 1.4.5.5 1.4Z"})]})}function bee({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"3.25",y:"4.25",width:"17.5",height:"15.5",rx:"2.75"}),u.jsx("path",{d:"M3.75 8.75h16.5"}),u.jsx("circle",{cx:"6.35",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"8.85",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none",opacity:"0.45"}),u.jsx("path",{d:"M6 14h2.2l1.35-2.8 2.1 5.5 1.7-3.1H18"})]})}function Eee({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.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"}),u.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),u.jsx("path",{d:"M3 10v4",opacity:"0.45"}),u.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}const qg=4;function hN({items:e,selected:t,onToggle:n,scrollRows:r}){return u.jsx("div",{className:`cw-checklist ${r?"cw-checklist-tools":""}`,style:r?{"--cw-checklist-max-height":`${r*65+(r-1)*8}px`}:void 0,children:e.map(i=>{const s=t.includes(i.id);return u.jsxs("button",{type:"button",className:`cw-check ${s?"is-on":""}`,onClick:()=>n(i.id),"aria-pressed":s,children:[u.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:s&&u.jsx(Ai,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-check-text",children:[u.jsx("span",{className:"cw-check-title",children:i.label}),u.jsx("span",{className:"cw-check-desc",children:Yr(i.desc)})]})]},i.id)})})}function Gg({options:e,value:t,onChange:n}){return u.jsx("div",{className:"cw-segmented",children:e.map(r=>{var s;const i=(t??((s=e[0])==null?void 0:s.id))===r.id;return u.jsxs("button",{type:"button",className:`cw-seg ${i?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":i,title:Yr(r.desc),children:[u.jsx("span",{className:"cw-seg-title",children:r.label}),u.jsx("span",{className:"cw-seg-desc",children:Yr(r.desc)})]},r.id)})})}function xee(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function gf({env:e,values:t,onChange:n}){return e.length===0?u.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):u.jsx("div",{className:"cw-env-fields",children:e.map(r=>u.jsxs("label",{className:"cw-env-field",children:[u.jsxs("span",{className:"cw-env-field-head",children:[u.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&u.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&u.jsx("code",{title:r.key,children:r.key})]}),u.jsx("input",{className:"cw-input",type:xee(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:i=>n(r.key,i.currentTarget.value)})]},r.key))})}function vee({tools:e,onChange:t}){const n=(s,a)=>t(e.map((o,l)=>l===s?{...o,...a}:o)),r=s=>t(e.filter((a,o)=>o!==s)),i=()=>t([...e,{name:"",transport:"http",url:""}]);return u.jsxs("div",{className:"cw-mcp",children:[e.length>0&&u.jsx("div",{className:"cw-mcp-list",children:u.jsx(Rs,{initial:!1,children:e.map((s,a)=>u.jsxs(zt.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:[u.jsxs("div",{className:"cw-mcp-rowhead",children:[u.jsxs("div",{className:"cw-mcp-transport",children:[u.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${s.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":s.transport==="http",children:u.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),u.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${s.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":s.transport==="stdio",children:u.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),u.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:u.jsx(Tl,{className:"cw-i cw-i-sm"})})]}),u.jsx("input",{className:"cw-input",value:s.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),s.transport==="http"?u.jsxs(u.Fragment,{children:[u.jsx("input",{className:"cw-input",value:s.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),u.jsx("input",{className:"cw-input",value:s.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):u.jsxs(u.Fragment,{children:[u.jsx("input",{className:"cw-input",value:s.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),u.jsx("input",{className:"cw-input",value:(s.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:o=>n(a,{args:o.target.value.split(/\s+/).filter(Boolean)})}),u.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),u.jsxs("button",{type:"button",className:"cw-add-sub",onClick:i,children:[u.jsx(li,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&u.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function hM({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.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"}),u.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),u.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"}),u.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function wee({s:e,onRemove:t}){let n=Aa,r="火山 Find Skill 技能广场";return e.source==="local"?(n=Wb,r="本地"):e.source==="skillspace"&&(n=hM,r="AgentKit Skills 中心"),u.jsxs(zt.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:[u.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:u.jsx(n,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-selected-skill-meta",children:[u.jsx("span",{className:"cw-selected-skill-name",children:e.name}),u.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Yr(e.description)}`:""]})]}),u.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:u.jsx(Vr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const Xg=[{id:"local",label:"本地文件",icon:Wb},{id:"skillspace",label:"AgentKit Skills 中心",icon:hM},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:$p}];function _ee({selected:e,onChange:t}){const[n,r]=_.useState("local"),[i,s]=_.useState(!1),a=Xg.findIndex(l=>l.id===n),o=l=>t(e.filter(c=>Qg(c)!==l));return _.useEffect(()=>{if(!i)return;const l=c=>{c.key==="Escape"&&s(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),u.jsxs("div",{className:"cw-skillspane",children:[u.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>s(!0),children:[u.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:u.jsx(li,{className:"cw-i"})}),u.jsx("span",{children:"添加 Skill"})]}),e.length>0&&u.jsxs("div",{className:"cw-skill-selected",children:[u.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),u.jsx("div",{className:"cw-selected-skill-list",children:u.jsx(Rs,{initial:!1,children:e.map(l=>u.jsx(wee,{s:l,onRemove:()=>o(Qg(l))},Qg(l)))})})]}),u.jsx(Rs,{children:i&&u.jsx(zt.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:l=>{l.target===l.currentTarget&&s(!1)},children:u.jsxs(zt.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:[u.jsxs("div",{className:"cw-skill-dialog-head",children:[u.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),u.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>s(!1),children:u.jsx(Vr,{className:"cw-i"})})]}),u.jsxs("div",{className:"cw-skill-dialog-body",children:[u.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${Xg.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[u.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),Xg.map(({id:l,label:c,icon:d})=>u.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${l}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===l,className:`cw-skill-pickertab ${n===l?"is-on":""}`,onClick:()=>r(l),children:[u.jsx(d,{className:"cw-i cw-i-sm"}),c]},l))]}),u.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&u.jsx(ZJ,{selected:e,onChange:t}),n==="local"&&u.jsx(cee,{selected:e,onChange:t}),n==="skillspace"&&u.jsx(pee,{selected:e,onChange:t})]})]})]})})})]})}function Qg(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function ac({checked:e,onChange:t,title:n,desc:r,icon:i}){return u.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[u.jsx("span",{className:"cw-toggle-icon",children:u.jsx(i,{className:"cw-i"})}),u.jsxs("span",{className:"cw-toggle-text",children:[u.jsx("span",{className:"cw-toggle-title",children:n}),u.jsx("span",{className:"cw-toggle-desc",children:Yr(r)})]}),u.jsx("span",{className:"cw-switch","aria-hidden":!0,children:u.jsx(zt.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}const pN=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]);function Tee(e,t){var r;let n=e;for(const i of t)if(n=(r=n.subAgents)==null?void 0:r[i],!n)return!1;return!0}function Jf(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function md(e,t,n){if(t.length===0)return n(e);const[r,...i]=t,s=e.subAgents.slice();return s[r]=md(s[r],i,n),{...e,subAgents:s}}function Nee(e,t){return md(e,t,n=>({...n,subAgents:[...n.subAgents,Us()]}))}function See(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return md(e,n,i=>({...i,subAgents:i.subAgents.filter((s,a)=>a!==r)}))}function kee(e,t,n,r){return md(e,t,i=>{const s=i.subAgents.slice(),[a]=s.splice(n,1);return s.splice(r,0,a),{...i,subAgents:s}})}const Aee=e=>e==="sequential"||e==="loop",pM=e=>!JE(e.agentType),Cee=3;function mM(e,t){const n=$o(e.name);return n||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":JE(e.agentType)?(e.a2aUrl??"").trim().length===0?"缺少 Agent URL":null:rM(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:e.instruction.trim().length===0?"缺少系统提示词":null)}function gM(e,t,n=[]){const r=[],i=mM(e,t);return i&&r.push({path:n,name:e.name.trim()||"未命名",problem:i}),pM(e)&&e.subAgents.forEach((s,a)=>r.push(...gM(s,t,[...n,a]))),r}function yM(e){return 1+e.subAgents.reduce((t,n)=>t+yM(n),0)}function Iee(e){const t=[],n=r=>{var i,s,a;for(const o of r.builtinTools??[]){const l=ex.find(c=>c.id===o);l&&t.push({env:l.env})}if(r.memory.shortTerm&&t.push({env:((i=rp.find(o=>o.id===(r.shortTermBackend??"local")))==null?void 0:i.env)??[]}),r.memory.longTerm&&t.push({env:((s=ip.find(o=>o.id===(r.longTermBackend??"local")))==null?void 0:s.env)??[]}),r.knowledgebase&&t.push({env:((a=sp.find(o=>o.id===(r.knowledgebaseBackend??"local")))==null?void 0:a.env)??[]}),r.tracing)for(const o of r.tracingExporters??[]){const l=ap.find(c=>c.id===o);l&&t.push({env:l.env,enableFlag:l.enableFlag})}r.subAgents.forEach(n)};return n(e),iM(t)}function bM({root:e,path:t,selectedPath:n,duplicateNames:r,showErrors:i,validationPulse:s,onSelect:a,onChange:o,onClearRoot:l}){const c=Jf(e,t),d=ZE(c.agentType),f=d.icon,h=t.length===0,p=pN(t,n),m=pM(c),y=m&&t.length{const A=Nee(e,t),S=Jf(A,t).subAgents.length-1;o(A,[...t,S])},g=()=>o(See(e,t),t.slice(0,-1)),E=t.slice(0,-1),b=!h&&Aee(Jf(e,E).agentType),[w,N]=_.useState(!1),T=A=>{A.preventDefault(),A.stopPropagation(),N(!1);const S=A.dataTransfer.getData("application/x-agent-path");if(!S)return;let O;try{O=JSON.parse(S)}catch{return}if(!pN(O.slice(0,-1),E))return;const I=O[O.length-1],D=t[t.length-1];I!==D&&o(kee(e,E,I,D),[...E,D])};return u.jsxs("div",{className:"cw-tree-branch",children:[u.jsxs("div",{className:`cw-tree-node cw-tree-type-${c.agentType??"llm"} ${p?"is-selected":""} ${b?"is-draggable":""} ${w?"is-dragover":""} ${i&&mM(c,r)?`is-invalid cw-error-shake-${s%2}`:""}`,role:"button",tabIndex:0,draggable:b,onDragStart:b?A=>{A.dataTransfer.setData("application/x-agent-path",JSON.stringify(t)),A.dataTransfer.effectAllowed="move",A.stopPropagation()}:void 0,onDragOver:b?A=>{A.preventDefault(),N(!0)}:void 0,onDragLeave:b?()=>N(!1):void 0,onDrop:b?T:void 0,onClick:()=>a(t),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a(t))},children:[u.jsx(f,{className:"cw-tree-icon"}),u.jsxs("span",{className:"cw-tree-main",children:[u.jsx("span",{className:"cw-tree-name",children:c.name.trim()||"未命名"}),u.jsx("span",{className:"cw-tree-type",children:d.label})]}),u.jsxs("span",{className:"cw-tree-actions",children:[h&&u.jsx("button",{type:"button",className:"cw-icon-btn cw-tree-clear",title:"清空根 Agent","aria-label":"清空根 Agent",onClick:A=>{A.stopPropagation(),l()},children:u.jsx(yee,{className:"cw-i cw-i-sm"})}),y&&u.jsx("button",{type:"button",className:"cw-icon-btn",title:"添加子 Agent",onClick:A=>{A.stopPropagation(),v()},children:u.jsx(li,{className:"cw-i cw-i-sm"})}),!h&&u.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",title:"删除",onClick:A=>{A.stopPropagation(),g()},children:u.jsx(Tl,{className:"cw-i cw-i-sm"})})]})]}),m&&c.subAgents.length>0&&u.jsx("div",{className:"cw-tree-children",children:c.subAgents.map((A,S)=>u.jsx(bM,{root:e,path:[...t,S],selectedPath:n,duplicateNames:r,showErrors:i,validationPulse:s,onSelect:a,onChange:o,onClearRoot:l},S))})]})}function eh(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function mN(e){return JSON.stringify(eh(e))}function Oee({enabled:e,disabledReason:t,phase:n,stale:r,run:i,projectName:s,logs:a,messages:o,input:l,error:c,deploying:d,deployError:f,onInput:h,onSend:p,onRestart:m,onIgnoreChanges:y,onDeploy:v}){const[g,E]=_.useState(!1),b=n==="ready"||n==="sending",w=n==="building"||n==="starting"||n==="sending",N=e&&!i&&n==="idle",T=e&&(n==="building"||n==="starting"),A=!!(i&&r&&!T);return g?u.jsx("aside",{className:"cw-debug is-collapsed","aria-label":"调试窗口(已收起)",children:u.jsx("button",{type:"button",className:"cw-debug-expand",onClick:()=>E(!1),"aria-label":"展开调试栏",title:"展开调试栏",children:u.jsx(bee,{className:"cw-i"})})}):u.jsxs("aside",{className:"cw-debug","aria-label":"调试窗口",children:[u.jsxs("div",{className:"cw-debug-head",children:[u.jsxs("div",{className:"cw-debug-title",children:[u.jsx("button",{type:"button",className:"cw-debug-collapse",onClick:()=>E(!0),"aria-label":"收起调试栏",title:"收起调试栏",children:u.jsx(rr,{className:"cw-i cw-i-sm"})}),u.jsx("span",{children:"调试"})]}),u.jsx("div",{className:"cw-debug-head-actions",children:u.jsxs("button",{type:"button",className:"cw-debug-deploy",disabled:d,onClick:v,title:"查看源码、填写环境变量并部署",children:["去部署",d?u.jsx(xt,{className:"cw-i cw-spin"}):u.jsx(EC,{className:"cw-i"})]})})]}),!i&&n==="idle"&&!e&&u.jsx("div",{className:"cw-debug-sub",children:u.jsx("span",{children:t})}),f&&u.jsx("div",{className:"cw-debug-deploy-error",role:"alert",children:f}),u.jsxs("div",{className:"cw-debug-stage",children:[u.jsx("div",{className:"cw-debug-body",children:e?n==="error"?u.jsxs("div",{className:"cw-debug-error",children:[u.jsx(op,{message:c||"调试失败",className:"cw-debug-error-detail",onRetry:async()=>{await m()}}),a.length>0&&u.jsx("div",{className:"cw-debug-progress",children:a.map((S,O)=>u.jsx("div",{className:"cw-debug-logline",children:u.jsx("span",{children:S})},`${S}-${O}`))})]}):u.jsx("div",{className:"cw-debug-chat",children:o.length===0?u.jsx("div",{className:"cw-debug-chat-empty",children:"输入消息开始验证当前 Agent。"}):o.map((S,O)=>u.jsxs("div",{className:`cw-debug-msg cw-debug-msg-${S.role}`,children:[u.jsx("div",{className:"cw-debug-role",children:S.role==="user"?"你":s||"Agent"}),u.jsx("div",{className:"cw-debug-content",children:S.role==="user"?S.content:S.error?u.jsx(op,{message:S.error,className:"cw-debug-msg-error"}):S.blocks&&S.blocks.length>0?u.jsx(dL,{blocks:S.blocks,onAction:()=>{}}):S.content?S.content:O===o.length-1&&n==="sending"?u.jsx(uL,{}):null})]},O))}):u.jsx("div",{className:"cw-debug-empty",children:t})}),u.jsx("div",{className:"cw-debug-composer",children:u.jsxs("div",{className:"cw-debug-composerbox",children:[u.jsx("textarea",{className:"cw-debug-input",rows:1,value:l,placeholder:r?"更新 Agent 后可继续调试":b?"输入测试消息...":"调试环境启动后可输入",disabled:!b||w||r,onChange:S=>h(S.target.value),onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),p())}}),u.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!b||w||r||!l.trim(),onClick:p,children:n==="sending"?u.jsx(xt,{className:"cw-i cw-spin"}):u.jsx(xC,{className:"cw-i"})})]})}),(N||T||A)&&u.jsx("div",{className:"cw-debug-overlay",role:"status","aria-live":"polite",children:u.jsxs("div",{className:"cw-debug-overlay-content",children:[u.jsx("strong",{className:"cw-debug-overlay-title",children:T?"正在初始化调试环境":A?"Agent 配置已变更":"启动调试环境"}),T?u.jsx("div",{className:"cw-debug-overlay-progress",children:a.map((S,O)=>u.jsxs("div",{className:"cw-debug-logline",children:[O===a.length-1?u.jsx(xt,{className:"cw-i cw-spin"}):u.jsx(Ai,{className:"cw-i"}),u.jsx("span",{children:S})]},`${S}-${O}`))}):A?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"cw-debug-overlay-copy",children:"当前对话仍在使用上一次配置。更新后,新配置才会生效。"}),u.jsxs("div",{className:"cw-debug-overlay-actions",children:[u.jsx("button",{type:"button",className:"cw-debug-ignore",disabled:w,onClick:y,children:"忽略"}),u.jsxs("button",{type:"button",className:"cw-debug-start",disabled:w,onClick:m,children:[u.jsx(qb,{className:"cw-i"}),"更新 Agent"]})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"cw-debug-overlay-copy",children:"启动后会生成代码并创建临时运行环境。"}),u.jsxs("button",{type:"button",className:"cw-debug-start",onClick:m,children:[u.jsx(Eee,{className:"cw-i cw-debug-run-icon"}),"启动调试环境"]})]})]})})]})]})}function Ree({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:i,onDeploymentTaskChange:s}){var Un,on,Xn,Qn,In,Dn,vn,wn,_n,en;const[a,o]=_.useState(()=>r??Us()),[l,c]=_.useState(!1),[d,f]=_.useState(0),[h,p]=_.useState(null),[m,y]=_.useState(!1),[v,g]=_.useState("cn-beijing"),E=(i==null?void 0:i.generatedAgentTestRun)===!0,b=(i==null?void 0:i.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[w,N]=_.useState("idle"),[T,A]=_.useState(null),S=_.useRef(null),[O,I]=_.useState(null),[D,F]=_.useState(""),[W,j]=_.useState([]),[$,C]=_.useState([]),[R,L]=_.useState(""),[M,k]=_.useState(null),[Y,G]=_.useState(""),[P,V]=_.useState(""),[Q,re]=_.useState("basic"),[le,K]=_.useState(""),[q,ae]=_.useState(!1),[ge,he]=_.useState(!1),[de,Ie]=_.useState(!1),[_e,Ee]=_.useState([]),Pe=_.useRef(null),be=_.useRef({});_.useEffect(()=>()=>{const ee=S.current;ee&&ky(ee.runId).catch(Te=>console.warn("清理调试运行失败",Te))},[]);const Ve=_.useRef(null);Ve.current||(Ve.current=({meta:ee,children:Te})=>u.jsxs("section",{ref:De=>{be.current[ee.id]=De},id:`cw-sec-${ee.id}`,"data-step-id":ee.id,className:"cw-section",children:[u.jsx("header",{className:"cw-sec-head",children:u.jsxs("h2",{className:"cw-sec-title",children:[ee.label,ee.required&&u.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),Te]}));const ke=Tee(a,_e)?_e:[],ce=Jf(a,ke),It=ke.length===0,Me=`cw-model-advanced-${ke.join("-")||"root"}`,wt=`cw-more-tool-types-${ke.join("-")||"root"}`,st=`cw-advanced-config-${ke.join("-")||"root"}`,z=Math.max(0,pf.findIndex(ee=>ee.id===(ce.agentType??"llm"))),X=ee=>o(Te=>md(Te,ke,De=>({...De,...ee}))),oe=(ee,Te)=>o(De=>{var ze;return{...De,deployment:{...De.deployment??{feishuEnabled:!1},envValues:{...((ze=De.deployment)==null?void 0:ze.envValues)??{},[ee]:Te}}}}),we=(ee,Te)=>{o(ee),Te&&Ee(Te)},Ae=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(o(Us()),Ee([]),c(!1),Ie(!1))},Ge=ce.builtinTools??[],Ot=ce.mcpTools??[],Ke=ce.tracingExporters??[],xn=ce.selectedSkills??[],jt=[ce.memory.shortTerm,ce.memory.longTerm,ce.tracing].filter(Boolean).length,yt=ee=>X({builtinTools:Ge.includes(ee)?Ge.filter(Te=>Te!==ee):[...Ge,ee]}),Yt=ee=>{const Te=Ke.includes(ee)?Ke.filter(De=>De!==ee):[...Ke,ee];X({tracingExporters:Te,tracing:Te.length>0?!0:ce.tracing})},kt=rM(ce.agentType),Rt=JE(ce.agentType),Le=_.useMemo(()=>lM(a),[a]),at=$o(ce.name)??(Le.has(ce.name)?"Agent 名称在当前结构中必须唯一":null),bt=at!==null,Et=ce.description.trim().length===0,se=ce.instruction.trim().length===0,Ce=(ce.a2aUrl??"").trim().length===0,We=ee=>l&&ee?`is-error cw-error-shake-${d%2}`:"",Jt=_.useMemo(()=>gM(a,Le),[a,Le]),Xe=Jt.length===0,te=_.useMemo(()=>mN(a),[a]),xe=_.useMemo(()=>Iee(a),[a]),ye=!!(T&&Y&&Y!==te&&P!==te);_.useEffect(()=>{P&&P!==te&&V("")},[te,P]);const Be=_.useMemo(()=>{var ee,Te,De,ze;return{type:!0,basic:!bt&&(kt||Rt||!se),model:!!((ee=ce.modelName)!=null&&ee.trim()||(Te=ce.modelProvider)!=null&&Te.trim()||(De=ce.modelApiBase)!=null&&De.trim()),tools:Ge.length>0||Ot.length>0,skills:xn.length>0,knowledge:ce.knowledgebase,advanced:ce.memory.shortTerm||ce.memory.longTerm||ce.tracing,subagents:(((ze=ce.subAgents)==null?void 0:ze.length)??0)>0,review:Xe}},[ce,bt,se,kt,Rt,Xe,Ge,Ot,xn]),$e=kt||Rt?["basic"]:["basic","model","tools","skills","knowledge",...It?["advanced"]:[]],ot=fN.filter(ee=>$e.includes(ee.id)),it=$e.join("|"),mn=ke.join("."),mt=ot.findIndex(ee=>ee.id===Q),kn=ee=>{var Te;(Te=be.current[ee])==null||Te.scrollIntoView({behavior:"smooth",block:"start"})};_.useEffect(()=>{if(h)return;const ee=Pe.current;if(!ee)return;const Te=it.split("|");let De=0;const ze=()=>{De=0;const ht=Te[Te.length-1];let tt=Te[0];if(ee.scrollTop+ee.clientHeight>=ee.scrollHeight-2)tt=ht;else{const tn=ee.getBoundingClientRect().top+24;for(const Wt of Te){const ln=be.current[Wt];if(!ln||ln.getBoundingClientRect().top>tn)break;tt=Wt}}tt&&re(tn=>tn===tt?tn:tt)},gt=()=>{De||(De=window.requestAnimationFrame(ze))};return ze(),ee.addEventListener("scroll",gt,{passive:!0}),window.addEventListener("resize",gt),()=>{ee.removeEventListener("scroll",gt),window.removeEventListener("resize",gt),De&&window.cancelAnimationFrame(De)}},[h,it,mn]);const lt=()=>Xe?!0:(c(!0),f(ee=>ee+1),Jt[0]&&(Ee(Jt[0].path),window.requestAnimationFrame(()=>kn("basic"))),!1),An=async()=>{const ee=S.current;if(S.current=null,A(null),I(null),G(""),V(""),ee)try{await ky(ee.runId)}catch(Te){console.warn("清理调试运行失败",Te)}},gn=async()=>{if(K(""),!!lt()){y(!0);try{const ee=await Hh(eh(a));await An(),N("idle"),F(""),j([]),C([]),L(""),k(null),p(ee)}catch(ee){K(`打开部署页失败:${ee instanceof Error?ee.message:String(ee)}`)}finally{y(!1)}}},br=async()=>{if(!E||m||!lt())return;const ee=mN(a);V(""),k(null),C([]),L(""),j([]),N("building");try{await An();const Te=[],De=ht=>{Te.push(ht),j([...Te])};De("提交 Agent 配置"),N("starting"),De("初始化调试环境");const ze=await nI(eh(a));S.current=ze,A(ze),F(ze.appName),De("创建调试会话");const gt=await rI(ze.runId,"test_user");I(gt),G(ee),De("调试环境就绪"),N("ready")}catch(Te){k(Te instanceof Error?Te.message:String(Te)),N("error")}},an=async()=>{const ee=S.current,Te=O,De=R.trim();if(!(!ee||!Te||!De||w==="sending")){L(""),N("sending"),C(ze=>[...ze,{role:"user",content:De},{role:"assistant",content:"",blocks:[]}]);try{let ze=Ui(),gt="";for await(const ht of iI({runId:ee.runId,userId:"test_user",sessionId:Te,text:De})){const tt=ht.error||ht.errorMessage||ht.error_message;if(tt){C(tn=>{const Wt=[...tn],ln=Wt[Wt.length-1];return(ln==null?void 0:ln.role)==="assistant"&&(ln.error=String(tt)),Wt});break}ze=tl(ze,ht),gt=ze.blocks.filter(tn=>tn.kind==="text").map(tn=>tn.text).join(""),C(tn=>{const Wt=[...tn],ln=Wt[Wt.length-1];return(ln==null?void 0:ln.role)==="assistant"&&(ln.content=gt,ln.blocks=ze.blocks),Wt})}N("ready")}catch(ze){C(gt=>{const ht=[...gt],tt=ht[ht.length-1];return(tt==null?void 0:tt.role)==="assistant"&&(tt.error=ze instanceof Error?ze.message:String(ze)),ht}),N("ready")}}};if(h){const ee=async(Te,De,ze)=>{var tt;const gt=(tt=a.deployment)==null?void 0:tt.network,ht=gt&>.mode&>.mode!=="public"?{mode:gt.mode,vpc_id:gt.vpcId,subnet_ids:gt.subnetIds,enable_shared_internet_access:gt.enableSharedInternetAccess}:void 0;return tE(Te.name,Te.files,{region:v,projectName:"default",network:ht},{...ze,onStage:De})};return u.jsx("div",{className:"cw-root cw-root-preview",children:u.jsx("div",{className:"cw-preview-body",children:u.jsx(tx,{project:h,agentDraft:a,agentName:a.name||"未命名 Agent",agentCount:yM(a),onChange:p,onDeploy:ee,onAgentAdded:n,onDeploymentTaskChange:s,feishuEnabled:!!((Un=a.deployment)!=null&&Un.feishuEnabled),onFeishuEnabledChange:async Te=>{const De={...a,deployment:{...a.deployment??{feishuEnabled:!1},feishuEnabled:Te}},ze=await Hh(eh(De));o(De),p(ze)},deploymentEnv:xe.specs,deploymentEnvValues:{...(on=a.deployment)==null?void 0:on.envValues,...xe.fixedValues},onDeploymentEnvChange:oe,network:(Xn=a.deployment)==null?void 0:Xn.network,onNetworkChange:Te=>o(De=>({...De,deployment:{...De.deployment??{feishuEnabled:!1},network:Te}})),deployRegion:v,onDeployRegionChange:g,onBack:()=>p(null),onExportYaml:()=>gee(`${a.name||"agent"}.yaml`,uJ(a),"text/yaml")})})})}const Cn=Ve.current,_t=ee=>fN.find(Te=>Te.id===ee);return u.jsx("div",{className:"cw-root",children:u.jsxs("div",{className:"cw-editor",children:[u.jsxs("aside",{className:"cw-tree","aria-label":"Agent 结构",children:[u.jsx("div",{className:"cw-tree-head",children:"Agent 结构"}),u.jsx(bM,{root:a,path:[],selectedPath:ke,duplicateNames:Le,showErrors:l,validationPulse:d,onSelect:Ee,onChange:we,onClearRoot:Ae})]}),u.jsxs("div",{className:"cw-detail",children:[u.jsx("div",{className:"cw-typebar",children:u.jsx("div",{className:"cw-typebar-inner",children:u.jsxs("div",{className:"cw-typeradio cw-typeradio--row",role:"radiogroup","aria-label":"Agent 类型",style:{"--cw-agent-type-gap":`${qg}px`,"--cw-agent-type-slider-width":`calc((100% - ${8+qg*(pf.length-1)}px) / ${pf.length})`,"--cw-active-type-offset":`calc(${z*100}% + ${z*qg}px)`},children:[u.jsx("span",{className:"cw-typeradio-slider","aria-hidden":!0}),pf.map(ee=>{const Te=(ce.agentType??"llm")===ee.id;return u.jsxs("label",{className:`cw-typeradio-item ${Te?"is-on":""}`,children:[u.jsx("input",{type:"radio",name:"agentType",className:"cw-typeradio-input",checked:Te,onChange:()=>X({agentType:ee.id})}),u.jsx("span",{className:"cw-typeradio-title",children:ee.id==="a2a"?"A2A 远程":ee.label})]},ee.id)})]})})}),u.jsx("div",{className:"cw-detail-scroll",ref:Pe,children:u.jsx("div",{className:"cw-detail-inner",children:u.jsxs("div",{className:"cw-lower",children:[u.jsxs("div",{className:"cw-form-col",children:[u.jsx(Cn,{meta:_t("basic"),children:u.jsxs("div",{className:"cw-form",children:[u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["Agent 名称",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx("input",{className:`cw-input ${We(bt)}`,value:ce.name,placeholder:"customer_service",onChange:ee=>X({name:ee.target.value})}),l&&at?u.jsx("span",{className:"cw-error-text",children:at}):u.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在 Agent 结构中保持唯一。"})]}),u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["描述",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${We(Et)}`,value:ce.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:ee=>X({description:ee.target.value})}),l&&Et?u.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):u.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]}),kt?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"cw-section-desc",children:"编排型 Agent 只负责调度子 Agent,不需要模型或系统提示词。请在左侧 「Agent 结构」中为它添加、排序子 Agent。"}),ce.agentType==="loop"&&u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"最大轮次"}),u.jsx("input",{className:"cw-input",type:"number",min:1,value:ce.maxIterations??3,onChange:ee=>X({maxIterations:Math.max(1,Number(ee.target.value)||1)})}),u.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):Rt?u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["Agent URL",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx("input",{className:`cw-input ${We(Ce)}`,value:ce.a2aUrl??"",placeholder:"https://example.com/my-agent",onChange:ee=>X({a2aUrl:ee.target.value})}),l&&Ce?u.jsx("span",{className:"cw-error-text",children:"Agent URL 为必填项"}):u.jsx("span",{className:"cw-help",children:"远程 Agent 的访问地址(A2A 协议);VeADK 会拉取其 Agent Card 并按需处理鉴权。"})]}):u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["系统提示词",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx(_.Suspense,{fallback:u.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:u.jsx(mee,{value:ce.instruction,invalid:se,onChange:ee=>X({instruction:ee})})}),l&&se?u.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):u.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!kt&&!Rt&&u.jsxs(u.Fragment,{children:[u.jsx(Cn,{meta:_t("model"),children:u.jsxs("div",{className:"cw-form",children:[u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"模型名称"}),u.jsx("input",{className:"cw-input",value:ce.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:ee=>X({modelName:ee.target.value})})]}),u.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":q,"aria-controls":Me,onClick:()=>ae(ee=>!ee),children:[u.jsx("span",{children:"更多选项"}),u.jsx(rr,{className:`cw-more-options-chevron ${q?"is-open":""}`,"aria-hidden":!0})]}),u.jsx(Rs,{initial:!1,children:q&&u.jsxs(zt.div,{id:Me,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:[u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"服务商 Provider"}),u.jsx("input",{className:"cw-input",value:ce.modelProvider??"",placeholder:"openai",onChange:ee=>X({modelProvider:ee.target.value})})]}),u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"API Base"}),u.jsx("input",{className:"cw-input",value:ce.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:ee=>X({modelApiBase:ee.target.value})}),u.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),u.jsx(Cn,{meta:_t("tools"),children:u.jsxs("div",{className:"cw-form",children:[u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"内置工具"}),u.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),u.jsx("div",{className:"cw-tools-list-shell",children:u.jsx(hN,{items:ex,selected:Ge,onToggle:yt,scrollRows:6})})]}),u.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ge,"aria-controls":wt,onClick:()=>he(ee=>!ee),children:[u.jsx("span",{children:"更多类型工具"}),Ot.length>0&&u.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",Ot.length]}),u.jsx(rr,{className:`cw-more-options-chevron ${ge?"is-open":""}`,"aria-hidden":!0})]}),u.jsx(Rs,{initial:!1,children:ge&&u.jsx(zt.div,{id:wt,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:u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"MCP 工具"}),u.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),u.jsx(vee,{tools:Ot,onChange:ee=>X({mcpTools:ee})})]})})})]})}),u.jsx(Cn,{meta:_t("skills"),children:u.jsx("div",{className:"cw-form",children:u.jsx(_ee,{selected:xn,onChange:ee=>X({selectedSkills:ee})})})}),u.jsx(Cn,{meta:_t("knowledge"),children:u.jsxs("div",{className:"cw-form cw-toggle-stack",children:[u.jsx(ac,{checked:ce.knowledgebase,onChange:ee=>X({knowledgebase:ee}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:$f}),ce.knowledgebase&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"知识库后端"}),u.jsx(Gg,{options:sp,value:ce.knowledgebaseBackend,onChange:ee=>X({knowledgebaseBackend:ee})}),u.jsx(gf,{env:((Qn=sp.find(ee=>ee.id===(ce.knowledgebaseBackend??"local")))==null?void 0:Qn.env)??[],values:((In=a.deployment)==null?void 0:In.envValues)??{},onChange:oe})]})]})}),It&&u.jsxs("section",{ref:ee=>{be.current.advanced=ee},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[u.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":de,"aria-controls":st,onClick:()=>Ie(ee=>!ee),children:[u.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),u.jsx(rr,{className:`cw-advanced-disclosure-chevron ${de?"is-open":""}`,"aria-hidden":!0}),jt>0&&u.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",jt]})]}),u.jsx(Rs,{initial:!1,children:de&&u.jsxs(zt.div,{id:st,className:"cw-advanced-content",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},children:[u.jsxs("div",{className:"cw-advanced-group",children:[u.jsx("div",{className:"cw-advanced-group-head",children:u.jsx("span",{children:"记忆"})}),u.jsxs("div",{className:"cw-form cw-toggle-stack",children:[u.jsx(ac,{checked:ce.memory.shortTerm,onChange:ee=>X({memory:{...ce.memory,shortTerm:ee}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:OC}),ce.memory.shortTerm&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"短期记忆后端"}),u.jsx(Gg,{options:rp,value:ce.shortTermBackend,onChange:ee=>X({shortTermBackend:ee})}),u.jsx(gf,{env:((Dn=rp.find(ee=>ee.id===(ce.shortTermBackend??"local")))==null?void 0:Dn.env)??[],values:((vn=a.deployment)==null?void 0:vn.envValues)??{},onChange:oe})]}),u.jsx(ac,{checked:ce.memory.longTerm,onChange:ee=>X({memory:{...ce.memory,longTerm:ee}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:$f}),ce.memory.longTerm&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"长期记忆后端"}),u.jsx(Gg,{options:ip,value:ce.longTermBackend,onChange:ee=>X({longTermBackend:ee})}),u.jsx(gf,{env:((wn=ip.find(ee=>ee.id===(ce.longTermBackend??"local")))==null?void 0:wn.env)??[],values:((_n=a.deployment)==null?void 0:_n.envValues)??{},onChange:oe}),u.jsx(ac,{checked:!!ce.autoSaveSession,onChange:ee=>X({autoSaveSession:ee}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:$f})]})]})]}),u.jsxs("div",{className:"cw-advanced-group",children:[u.jsx("div",{className:"cw-advanced-group-head",children:u.jsx("span",{children:"观测"})}),u.jsxs("div",{className:"cw-form cw-toggle-stack",children:[u.jsx(ac,{checked:ce.tracing,onChange:ee=>X({tracing:ee}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:NC}),ce.tracing&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),u.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),u.jsx(hN,{items:ap,selected:Ke,onToggle:Yt}),u.jsx(gf,{env:ap.filter(ee=>Ke.includes(ee.id)).flatMap(ee=>ee.env),values:((en=a.deployment)==null?void 0:en.envValues)??{},onChange:oe})]})]})]})]})})]})]})]}),u.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:u.jsxs("ol",{className:"cw-steps",children:[u.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:u.jsx(zt.div,{className:"cw-rail-fill",animate:{height:`${Math.max(mt,0)/Math.max(ot.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),ot.map(ee=>{const Te=ee.id===Q,De=Be[ee.id];return u.jsx("li",{children:u.jsxs("button",{type:"button",className:`cw-step ${Te?"is-active":""} ${De?"is-done":""}`,onClick:()=>kn(ee.id),"aria-current":Te?"step":void 0,"aria-label":ee.label,children:[u.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:Te?u.jsx("span",{className:"cw-dot"}):De?u.jsx(Ai,{className:"cw-step-check"}):u.jsx("span",{className:"cw-dot"})}),u.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:ee.label})]})},ee.id)})]})})]})})})]}),u.jsx(Oee,{enabled:E,disabledReason:b,phase:w,stale:ye,run:T,projectName:D||a.name,logs:W,messages:$,input:R,error:M,deploying:m,deployError:le,onInput:L,onSend:an,onRestart:br,onIgnoreChanges:()=>V(te),onDeploy:gn})]})})}function Ri(e){return{...Us(),...e}}const Lee=[{id:"support",icon:e9,draft:Ri({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:U8,draft:Ri({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:t9,draft:Ri({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:zb,draft:Ri({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:c9,draft:Ri({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:x9,draft:Ri({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[Ri({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),Ri({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),Ri({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function Mee(e){const t=[];return e.tools.length&&t.push({icon:Xb,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:F8,label:"记忆"}),e.knowledgebase&&t.push({icon:B8,label:"知识库"}),e.tracing&&t.push({icon:P8,label:"观测"}),e.subAgents.length&&t.push({icon:LC,label:`子Agent ${e.subAgents.length}`}),t}function Dee({onBack:e,onCreate:t}){const[n,r]=_.useState(null);return u.jsx("div",{className:"tpl-root",children:n?u.jsx(jee,{template:n,onBack:()=>r(null),onCreate:t}):u.jsx(Pee,{onPick:r})})}function Pee({onPick:e}){return u.jsxs("div",{className:"tpl-scroll",children:[u.jsxs("div",{className:"tpl-head",children:[u.jsx("h1",{className:"tpl-title",children:"从模板新建"}),u.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),u.jsx("div",{className:"tpl-grid",children:Lee.map((t,n)=>u.jsxs(zt.button,{type:"button",className:"tpl-card",onClick:()=>e(t),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:n*.03,duration:.24,ease:[.22,1,.36,1]},children:[u.jsx("span",{className:"tpl-card-icon",children:u.jsx(t.icon,{className:"icon"})}),u.jsx("span",{className:"tpl-card-name",children:t.draft.name}),u.jsx("span",{className:"tpl-card-desc",children:Yr(t.draft.description)})]},t.id))})]})}function jee({template:e,onBack:t,onCreate:n}){const[r,i]=_.useState(e.draft.name),s=e.icon,a=Mee(e.draft);function o(){const l=r.trim()||e.draft.name;n({...e.draft,name:l})}return u.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[u.jsxs("button",{className:"tpl-back",onClick:t,children:[u.jsx(bC,{className:"icon"})," 返回模板列表"]}),u.jsxs(zt.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[u.jsxs("div",{className:"tpl-detail-head",children:[u.jsx("span",{className:"tpl-detail-icon",children:u.jsx(s,{className:"icon"})}),u.jsxs("div",{className:"tpl-detail-headtext",children:[u.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),u.jsx("div",{className:"tpl-detail-desc",children:Yr(e.draft.description)})]})]}),a.length>0&&u.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(l=>u.jsxs("span",{className:"tpl-tag",children:[u.jsx(l.icon,{className:"tpl-tag-icon"})," ",l.label]},l.label))}),u.jsxs("label",{className:"tpl-field",children:[u.jsx("span",{className:"tpl-field-label",children:"名称"}),u.jsx("input",{className:"tpl-input",value:r,onChange:l=>i(l.target.value),placeholder:e.draft.name})]}),u.jsxs("div",{className:"tpl-field",children:[u.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),u.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),u.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"模型"}),u.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"工具"}),u.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"记忆"}),u.jsx("span",{className:"tpl-meta-val",children:Bee(e.draft)})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"知识库"}),u.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),u.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&u.jsxs("div",{className:"tpl-field",children:[u.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),u.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((l,c)=>u.jsxs("div",{className:"tpl-subagent",children:[u.jsxs("div",{className:"tpl-subagent-top",children:[u.jsx("span",{className:"tpl-subagent-name",children:l.name}),l.tools.length>0&&u.jsx("span",{className:"tpl-subagent-tools",children:l.tools.join("、")})]}),u.jsx("div",{className:"tpl-subagent-desc",children:Yr(l.description)})]},c))})]}),u.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",u.jsx(rr,{className:"icon"})]})]})]})}function Bee(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}function En(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function fm(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}th.prototype=fm.prototype={constructor:th,on:function(e,t){var n=this._,r=Uee(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s0)for(var n=new Array(i),r=0,i,s;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),yN.hasOwnProperty(t)?{space:yN[t],local:e}:e}function Hee(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===n1&&t.documentElement.namespaceURI===n1?t.createElement(e):t.createElementNS(n,e)}}function zee(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function EM(e){var t=hm(e);return(t.local?zee:Hee)(t)}function Vee(){}function nx(e){return e==null?Vee:function(){return this.querySelector(e)}}function Kee(e){typeof e!="function"&&(e=nx(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=b&&(b=E+1);!(N=v[b])&&++b=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function gte(e){e||(e=yte);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;st?1:e>=t?0:NaN}function bte(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ete(){return Array.from(this)}function xte(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Ote:typeof t=="function"?Lte:Rte)(e,t,n??"")):ul(this.node(),e)}function ul(e,t){return e.style.getPropertyValue(t)||TM(e).getComputedStyle(e,null).getPropertyValue(t)}function Dte(e){return function(){delete this[e]}}function Pte(e,t){return function(){this[e]=t}}function jte(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Bte(e,t){return arguments.length>1?this.each((t==null?Dte:typeof t=="function"?jte:Pte)(e,t)):this.node()[e]}function NM(e){return e.trim().split(/^|\s+/)}function rx(e){return e.classList||new SM(e)}function SM(e){this._node=e,this._names=NM(e.getAttribute("class")||"")}SM.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 kM(e,t){for(var n=rx(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function fne(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n()=>e;function r1(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:o,dx:l,dy:c,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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}r1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function wne(e){return!e.ctrlKey&&!e.button}function _ne(){return this.parentNode}function Tne(e,t){return t??{x:e.x,y:e.y}}function Nne(){return navigator.maxTouchPoints||"ontouchstart"in this}function LM(){var e=wne,t=_ne,n=Tne,r=Nne,i={},s=fm("start","drag","end"),a=0,o,l,c,d,f=0;function h(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",v).on("touchmove.drag",g,vne).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,N){if(!(d||!e.call(this,w,N))){var T=b(this,t.call(this,w,N),w,N,"mouse");T&&(wr(w.view).on("mousemove.drag",m,Iu).on("mouseup.drag",y,Iu),OM(w.view),Zg(w),c=!1,o=w.clientX,l=w.clientY,T("start",w))}}function m(w){if(Ho(w),!c){var N=w.clientX-o,T=w.clientY-l;c=N*N+T*T>f}i.mouse("drag",w)}function y(w){wr(w.view).on("mousemove.drag mouseup.drag",null),RM(w.view,c),Ho(w),i.mouse("end",w)}function v(w,N){if(e.call(this,w,N)){var T=w.changedTouches,A=t.call(this,w,N),S=T.length,O,I;for(O=0;O>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bf(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=kne.exec(e))?new fr(t[1],t[2],t[3],1):(t=Ane.exec(e))?new fr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Cne.exec(e))?bf(t[1],t[2],t[3],t[4]):(t=Ine.exec(e))?bf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=One.exec(e))?TN(t[1],t[2]/100,t[3]/100,1):(t=Rne.exec(e))?TN(t[1],t[2]/100,t[3]/100,t[4]):bN.hasOwnProperty(e)?vN(bN[e]):e==="transparent"?new fr(NaN,NaN,NaN,0):null}function vN(e){return new fr(e>>16&255,e>>8&255,e&255,1)}function bf(e,t,n,r){return r<=0&&(e=t=n=NaN),new fr(e,t,n,r)}function Dne(e){return e instanceof yd||(e=Ra(e)),e?(e=e.rgb(),new fr(e.r,e.g,e.b,e.opacity)):new fr}function i1(e,t,n,r){return arguments.length===1?Dne(e):new fr(e,t,n,r??1)}function fr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ix(fr,i1,MM(yd,{brighter(e){return e=e==null?cp:Math.pow(cp,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ou:Math.pow(Ou,e),new fr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fr(xa(this.r),xa(this.g),xa(this.b),up(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:wN,formatHex:wN,formatHex8:Pne,formatRgb:_N,toString:_N}));function wN(){return`#${ha(this.r)}${ha(this.g)}${ha(this.b)}`}function Pne(){return`#${ha(this.r)}${ha(this.g)}${ha(this.b)}${ha((isNaN(this.opacity)?1:this.opacity)*255)}`}function _N(){const e=up(this.opacity);return`${e===1?"rgb(":"rgba("}${xa(this.r)}, ${xa(this.g)}, ${xa(this.b)}${e===1?")":`, ${e})`}`}function up(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ha(e){return e=xa(e),(e<16?"0":"")+e.toString(16)}function TN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ti(e,t,n,r)}function DM(e){if(e instanceof ti)return new ti(e.h,e.s,e.l,e.opacity);if(e instanceof yd||(e=Ra(e)),!e)return new ti;if(e instanceof ti)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n0&&l<1?0:a,new ti(a,o,l,e.opacity)}function jne(e,t,n,r){return arguments.length===1?DM(e):new ti(e,t,n,r??1)}function ti(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ix(ti,jne,MM(yd,{brighter(e){return e=e==null?cp:Math.pow(cp,e),new ti(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ou:Math.pow(Ou,e),new ti(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new fr(Jg(e>=240?e-240:e+120,i,r),Jg(e,i,r),Jg(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ti(NN(this.h),Ef(this.s),Ef(this.l),up(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=up(this.opacity);return`${e===1?"hsl(":"hsla("}${NN(this.h)}, ${Ef(this.s)*100}%, ${Ef(this.l)*100}%${e===1?")":`, ${e})`}`}}));function NN(e){return e=(e||0)%360,e<0?e+360:e}function Ef(e){return Math.max(0,Math.min(1,e||0))}function Jg(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 sx=e=>()=>e;function Bne(e,t){return function(n){return e+n*t}}function Fne(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Une(e){return(e=+e)==1?PM:function(t,n){return n-t?Fne(t,n,e):sx(isNaN(t)?n:t)}}function PM(e,t){var n=t-e;return n?Bne(e,n):sx(isNaN(e)?t:e)}const dp=function e(t){var n=Une(t);function r(i,s){var a=n((i=i1(i)).r,(s=i1(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=PM(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=l(d),i.opacity=c(d),i+""}}return r.gamma=e,r}(1);function $ne(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:xi(r,i)})),n=e0.lastIndex;return n180?d+=360:d-c>180&&(c+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:xi(c,d)})):d&&f.push(i(f)+"rotate("+d+r)}function o(c,d,f,h){c!==d?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:xi(c,d)}):d&&f.push(i(f)+"skewX("+d+r)}function l(c,d,f,h,p,m){if(c!==f||d!==h){var y=p.push(i(p)+"scale(",null,",",null,")");m.push({i:y-4,x:xi(c,f)},{i:y-2,x:xi(d,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(c,d){var f=[],h=[];return c=e(c),d=e(d),s(c.translateX,c.translateY,d.translateX,d.translateY,f,h),a(c.rotate,d.rotate,f,h),o(c.skewX,d.skewX,f,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,h),c=d=null,function(p){for(var m=-1,y=h.length,v;++m=0&&e._call.call(void 0,t),e=e._next;--dl}function AN(){La=(hp=Lu.now())+pm,dl=xc=0;try{nre()}finally{dl=0,ire(),La=0}}function rre(){var e=Lu.now(),t=e-hp;t>UM&&(pm-=t,hp=e)}function ire(){for(var e,t=fp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:fp=n);vc=e,o1(r)}function o1(e){if(!dl){xc&&(xc=clearTimeout(xc));var t=e-La;t>24?(e<1/0&&(xc=setTimeout(AN,e-Lu.now()-pm)),oc&&(oc=clearInterval(oc))):(oc||(hp=Lu.now(),oc=setInterval(rre,UM)),dl=1,$M(AN))}}function CN(e,t,n){var r=new pp;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var sre=fm("start","end","cancel","interrupt"),are=[],zM=0,IN=1,l1=2,rh=3,ON=4,c1=5,ih=6;function mm(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;ore(e,n,{name:t,index:r,group:i,on:sre,tween:are,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:zM})}function ox(e,t){var n=hi(e,t);if(n.state>zM)throw new Error("too late; already scheduled");return n}function Oi(e,t){var n=hi(e,t);if(n.state>rh)throw new Error("too late; already running");return n}function hi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ore(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=HM(s,0,n.time);function s(c){n.state=IN,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var d,f,h,p;if(n.state!==IN)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===rh)return CN(a);p.state===ON?(p.state=ih,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dl1&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function jre(e,t,n){var r,i,s=Pre(t)?ox:Oi;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function Bre(e,t){var n=this._id;return arguments.length<2?hi(this.node(),n).on.on(e):this.each(jre(n,e,t))}function Fre(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ure(){return this.on("end.remove",Fre(this._id))}function $re(e){var t=this._name,n=this._id;typeof e!="function"&&(e=nx(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a()=>e;function fie(e,{sourceEvent:t,target:n,transform:r,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:r,enumerable:!0,configurable:!0},_:{value:i}})}function zi(e,t,n){this.k=e,this.x=t,this.y=n}zi.prototype={constructor:zi,scale:function(e){return e===1?this:new zi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new zi(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 gm=new zi(1,0,0);WM.prototype=zi.prototype;function WM(e){for(;!e.__zoom;)if(!(e=e.parentNode))return gm;return e.__zoom}function t0(e){e.stopImmediatePropagation()}function lc(e){e.preventDefault(),e.stopImmediatePropagation()}function hie(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function pie(){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 RN(){return this.__zoom||gm}function mie(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function gie(){return navigator.maxTouchPoints||"ontouchstart"in this}function yie(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function qM(){var e=hie,t=pie,n=yie,r=mie,i=gie,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=nh,c=fm("start","zoom","end"),d,f,h,p=500,m=150,y=0,v=10;function g(j){j.property("__zoom",RN).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",O).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(j,$,C,R){var L=j.selection?j.selection():j;L.property("__zoom",RN),j!==L?N(j,$,C,R):L.interrupt().each(function(){T(this,arguments).event(R).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},g.scaleBy=function(j,$,C,R){g.scaleTo(j,function(){var L=this.__zoom.k,M=typeof $=="function"?$.apply(this,arguments):$;return L*M},C,R)},g.scaleTo=function(j,$,C,R){g.transform(j,function(){var L=t.apply(this,arguments),M=this.__zoom,k=C==null?w(L):typeof C=="function"?C.apply(this,arguments):C,Y=M.invert(k),G=typeof $=="function"?$.apply(this,arguments):$;return n(b(E(M,G),k,Y),L,a)},C,R)},g.translateBy=function(j,$,C,R){g.transform(j,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,R)},g.translateTo=function(j,$,C,R,L){g.transform(j,function(){var M=t.apply(this,arguments),k=this.__zoom,Y=R==null?w(M):typeof R=="function"?R.apply(this,arguments):R;return n(gm.translate(Y[0],Y[1]).scale(k.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof C=="function"?-C.apply(this,arguments):-C),M,a)},R,L)};function E(j,$){return $=Math.max(s[0],Math.min(s[1],$)),$===j.k?j:new zi($,j.x,j.y)}function b(j,$,C){var R=$[0]-C[0]*j.k,L=$[1]-C[1]*j.k;return R===j.x&&L===j.y?j:new zi(j.k,R,L)}function w(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function N(j,$,C,R){j.on("start.zoom",function(){T(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(R).end()}).tween("zoom",function(){var L=this,M=arguments,k=T(L,M).event(R),Y=t.apply(L,M),G=C==null?w(Y):typeof C=="function"?C.apply(L,M):C,P=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),V=L.__zoom,Q=typeof $=="function"?$.apply(L,M):$,re=l(V.invert(G).concat(P/V.k),Q.invert(G).concat(P/Q.k));return function(le){if(le===1)le=Q;else{var K=re(le),q=P/K[2];le=new zi(q,G[0]-K[0]*q,G[1]-K[1]*q)}k.zoom(null,le)}})}function T(j,$,C){return!C&&j.__zooming||new A(j,$)}function A(j,$){this.that=j,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,$),this.taps=0}A.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,$){return this.mouse&&j!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var $=wr(this.that).datum();c.call(j,this.that,new fie(j,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),$)}};function S(j,...$){if(!e.apply(this,arguments))return;var C=T(this,$).event(j),R=this.__zoom,L=Math.max(s[0],Math.min(s[1],R.k*Math.pow(2,r.apply(this,arguments)))),M=Jr(j);if(C.wheel)(C.mouse[0][0]!==M[0]||C.mouse[0][1]!==M[1])&&(C.mouse[1]=R.invert(C.mouse[0]=M)),clearTimeout(C.wheel);else{if(R.k===L)return;C.mouse=[M,R.invert(M)],sh(this),C.start()}lc(j),C.wheel=setTimeout(k,m),C.zoom("mouse",n(b(E(R,L),C.mouse[0],C.mouse[1]),C.extent,a));function k(){C.wheel=null,C.end()}}function O(j,...$){if(h||!e.apply(this,arguments))return;var C=j.currentTarget,R=T(this,$,!0).event(j),L=wr(j.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",P,!0),M=Jr(j,C),k=j.clientX,Y=j.clientY;OM(j.view),t0(j),R.mouse=[M,this.__zoom.invert(M)],sh(this),R.start();function G(V){if(lc(V),!R.moved){var Q=V.clientX-k,re=V.clientY-Y;R.moved=Q*Q+re*re>y}R.event(V).zoom("mouse",n(b(R.that.__zoom,R.mouse[0]=Jr(V,C),R.mouse[1]),R.extent,a))}function P(V){L.on("mousemove.zoom mouseup.zoom",null),RM(V.view,R.moved),lc(V),R.event(V).end()}}function I(j,...$){if(e.apply(this,arguments)){var C=this.__zoom,R=Jr(j.changedTouches?j.changedTouches[0]:j,this),L=C.invert(R),M=C.k*(j.shiftKey?.5:2),k=n(b(E(C,M),R,L),t.apply(this,$),a);lc(j),o>0?wr(this).transition().duration(o).call(N,k,R,j):wr(this).call(g.transform,k,R,j)}}function D(j,...$){if(e.apply(this,arguments)){var C=j.touches,R=C.length,L=T(this,$,j.changedTouches.length===R).event(j),M,k,Y,G;for(t0(j),k=0;k`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:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", 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.`},Mu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],GM=["Enter"," ","Escape"],XM={"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 fl;(function(e){e.Strict="strict",e.Loose="loose"})(fl||(fl={}));var va;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(va||(va={}));var Du;(function(e){e.Partial="partial",e.Full="full"})(Du||(Du={}));const QM={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Es;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Es||(Es={}));var Pu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pu||(Pu={}));var Re;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Re||(Re={}));const LN={[Re.Left]:Re.Right,[Re.Right]:Re.Left,[Re.Top]:Re.Bottom,[Re.Bottom]:Re.Top};function ZM(e){return e===null?null:e?"valid":"invalid"}const JM=e=>"id"in e&&"source"in e&&"target"in e,bie=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),cx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),bd=(e,t=[0,0])=>{const{width:n,height:r}=ns(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},Eie=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):cx(i)?i:t.nodeLookup.get(i.id));const o=a?mp(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return ym(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return bm(n)},Ed=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=ym(n,mp(i)),r=!0)}),r?bm(n):{x:0,y:0,width:0,height:0}},ux=(e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{const o={...Pl(t,[n,r,i]),width:t.width/i,height:t.height/i},l=[];for(const c of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=c;if(a&&!f||h)continue;const p=d.width??c.width??c.initialWidth??null,m=d.height??c.height??c.initialHeight??null,y=ju(o,pl(c)),v=(p??0)*(m??0),g=s&&y>0;(!c.internals.handleBounds||g||y>=v||c.dragging)&&l.push(c)}return l},xie=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function vie(e,t){const n=new Map,r=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)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function wie({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;const o=vie(e,a),l=Ed(o),c=fx(l,t,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await r.setViewport(c,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function e3({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const a=n.get(e),o=a.parentId?n.get(a.parentId):void 0,{x:l,y:c}=o?o.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!o)s==null||s("005",ci.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[l,c],[l+p,c+m]])}else o&&Da(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+c],[a.extent[1][0]+l,a.extent[1][1]+c]]);const h=Da(f)?Ma(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",ci.error015())),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-c+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function _ie({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=s.has(h.id),m=!p&&h.parentId&&a.find(y=>y.id===h.parentId);(p||m)&&a.push(h)}const o=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=xie(a,l);for(const h of l)o.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 hl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ma=(e={x:0,y:0},t,n)=>({x:hl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:hl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function t3(e,t,n){const{width:r,height:i}=ns(n),{x:s,y:a}=n.internals.positionAbsolute;return Ma(e,[[s,a],[s+r,a+i]],t)}const MN=(e,t,n)=>en?-hl(Math.abs(e-n),1,t)/t:0,dx=(e,t,n=15,r=40)=>{const i=MN(e.x,r,t.width-r)*n,s=MN(e.y,r,t.height-r)*n;return[i,s]},ym=(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)}),u1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),bm=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),pl=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=cx(e)?e.internals.positionAbsolute:bd(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},mp=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=cx(e)?e.internals.positionAbsolute:bd(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},n3=(e,t)=>bm(ym(u1(e),u1(t))),ju=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},DN=e=>ni(e.width)&&ni(e.height)&&ni(e.x)&&ni(e.y),ni=e=>!isNaN(e)&&isFinite(e),r3=(e,t)=>(n,r)=>{},xd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Pl=({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{const o={x:(e-n)/i,y:(t-r)/i};return s?xd(o,a):o},ml=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function eo(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 Tie(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=eo(e,n),i=eo(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=eo(e.top??e.y??0,n),i=eo(e.bottom??e.y??0,n),s=eo(e.left??e.x??0,t),a=eo(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Nie(e,t,n,r,i,s){const{x:a,y:o}=ml(e,[t,n,r]),{x:l,y:c}=ml({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-l,f=s-c;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const fx=(e,t,n,r,i,s)=>{const a=Tie(s,t,n),o=(t-a.x)/e.width,l=(n-a.y)/e.height,c=Math.min(o,l),d=hl(c,r,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,y=Nie(e,p,m,d,t,n),v={left:Math.min(y.left-a.left,0),top:Math.min(y.top-a.top,0),right:Math.min(y.right-a.right,0),bottom:Math.min(y.bottom-a.bottom,0)};return{x:p-v.left+v.right,y:m-v.top+v.bottom,zoom:d}},Bu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Da(e){return e!=null&&e!=="parent"}function ns(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 i3(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 s3(e,t={width:0,height:0},n,r,i){const s={...e},a=r.get(n);if(a){const o=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*o[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*o[1]}return s}function PN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Sie(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function kie(e){return{...XM,...e||{}}}function Xc(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:a}=ri(e),o=Pl({x:s-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},r),{x:l,y:c}=n?xd(o,t):o;return{xSnapped:l,ySnapped:c,...o}}const hx=e=>({width:e.offsetWidth,height:e.offsetHeight}),a3=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Aie=["INPUT","SELECT","TEXTAREA"];function o3(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Aie.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const l3=e=>"clientX"in e,ri=(e,t)=>{var s,a;const n=l3(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},jN=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...hx(a)}})};function c3({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:o}){const l=e*.125+i*.375+a*.375+n*.125,c=t*.125+s*.375+o*.375+r*.125,d=Math.abs(l-e),f=Math.abs(c-t);return[l,c,d,f]}function wf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function BN({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Re.Left:return[t-wf(t-r,s),n];case Re.Right:return[t+wf(r-t,s),n];case Re.Top:return[t,n-wf(n-i,s)];case Re.Bottom:return[t,n+wf(i-n,s)]}}function u3({sourceX:e,sourceY:t,sourcePosition:n=Re.Bottom,targetX:r,targetY:i,targetPosition:s=Re.Top,curvature:a=.25}){const[o,l]=BN({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[c,d]=BN({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,h,p,m]=c3({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${i}`,f,h,p,m]}function d3({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n0}const Oie=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Rie=(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)),Lie=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",ci.error006()),t;const r=n.getEdgeId||Oie;let i;return JM(e)?i={...e}:i={...e,id:r(e)},Rie(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function f3({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,a,o]=d3({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,o]}const FN={[Re.Left]:{x:-1,y:0},[Re.Right]:{x:1,y:0},[Re.Top]:{x:0,y:-1},[Re.Bottom]:{x:0,y:1}},Mie=({source:e,sourcePosition:t=Re.Bottom,target:n})=>t===Re.Left||t===Re.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Die({source:e,sourcePosition:t=Re.Bottom,target:n,targetPosition:r=Re.Top,center:i,offset:s,stepPosition:a}){const o=FN[t],l=FN[r],c={x:e.x+o.x*s,y:e.y+o.y*s},d={x:n.x+l.x*s,y:n.y+l.y*s},f=Mie({source:c,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,v;const g={x:0,y:0},E={x:0,y:0},[,,b,w]=d3({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){h==="x"?(y=i.x??c.x+(d.x-c.x)*a,v=i.y??(c.y+d.y)/2):(y=i.x??(c.x+d.x)/2,v=i.y??c.y+(d.y-c.y)*a);const S=[{x:y,y:c.y},{x:y,y:d.y}],O=[{x:c.x,y:v},{x:d.x,y:v}];o[h]===p?m=h==="x"?S:O:m=h==="x"?O:S}else{const S=[{x:c.x,y:d.y}],O=[{x:d.x,y:c.y}];if(h==="x"?m=o.x===p?O:S:m=o.y===p?S:O,t===r){const j=Math.abs(e[h]-n[h]);if(j<=s){const $=Math.min(s-1,s-j);o[h]===p?g[h]=(c[h]>e[h]?-1:1)*$:E[h]=(d[h]>n[h]?-1:1)*$}}if(t!==r){const j=h==="x"?"y":"x",$=o[h]===l[j],C=c[j]>d[j],R=c[j]=W?(y=(I.x+D.x)/2,v=m[0].y):(y=m[0].x,v=(I.y+D.y)/2)}const N={x:c.x+g.x,y:c.y+g.y},T={x:d.x+E.x,y:d.y+E.y};return[[e,...N.x!==m[0].x||N.y!==m[0].y?[N]:[],...m,...T.x!==m[m.length-1].x||T.y!==m[m.length-1].y?[T]:[],n],y,v,b,w]}function Pie(e,t,n,r){const i=Math.min(UN(e,t)/2,UN(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const c=e.xn.id===t):e[0])||null}function f1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Bie(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){const c=f1(l,t);s.has(c)||(a.push({id:c,color:l.color||n,...l}),s.add(c))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const h3=1e3,Fie=10,px={nodeOrigin:[0,0],nodeExtent:Mu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Uie={...px,checkEquality:!0};function mx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function $ie(e,t,n){const r=mx(px,n);for(const i of e.values())if(i.parentId)yx(i,e,t,r);else{const s=bd(i,r.nodeOrigin),a=Da(i.extent)?i.extent:r.nodeExtent,o=Ma(s,a,ns(i));i.internals.positionAbsolute=o}}function Hie(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const s={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(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function gx(e){return e==="manual"}function h1(e,t,n,r={}){var d,f;const i=mx(Uie,r),s={i:0},a=new Map(t),o=i!=null&&i.elevateNodesOnSelect&&!gx(i.zIndexMode)?h3:0;let l=e.length>0,c=!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=bd(h,i.nodeOrigin),y=Da(h.extent)?h.extent:i.nodeExtent,v=Ma(m,y,ns(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:Hie(h,p),z:p3(h,o,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&&(l=!1),h.parentId&&yx(p,t,n,r,s),c||(c=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:c}}function zie(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 yx(e,t,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=mx(px,r),c=e.parentId,d=t.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}zie(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*Fie),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);const f=s&&!gx(l)?h3:0,{x:h,y:p,z:m}=Vie(e,d,a,o,f,l),{positionAbsolute:y}=e.internals,v=h!==y.x||p!==y.y;(v||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:p}:y,z:m}})}function p3(e,t,n){const r=ni(e.zIndex)?e.zIndex:0;return gx(n)?r:r+(e.selected?t:0)}function Vie(e,t,n,r,i,s){const{x:a,y:o}=t.internals.positionAbsolute,l=ns(e),c=bd(e,n),d=Da(e.extent)?Ma(c,e.extent,l):c;let f=Ma({x:a+d.x,y:o+d.y},r,l);e.extent==="parent"&&(f=t3(f,l,t));const h=p3(e,i,s),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function bx(e,t,n,r=[0,0]){var a;const i=[],s=new Map;for(const o of e){const l=t.get(o.parentId);if(!l)continue;const c=((a=s.get(o.parentId))==null?void 0:a.expandedRect)??pl(l),d=n3(c,o.rect);s.set(o.parentId,{expandedRect:d,parent:l})}return s.size>0&&s.forEach(({expandedRect:o,parent:l},c)=>{var b;const d=l.internals.positionAbsolute,f=ns(l),h=l.origin??r,p=o.x0||m>0||g||E)&&(i.push({id:c,type:"position",position:{x:l.position.x-p+g,y:l.position.y-m+E}}),(b=n.get(c))==null||b.forEach(w=>{e.some(N=>N.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=bx(h,t,n,i);c.push(...p)}return{changes:c,updatedInternals:l}}async function Yie({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){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,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function VN(e,t,n,r,i,s){let a=i;const o=r.get(a)||new Map;r.set(a,o.set(n,t)),a=`${i}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),s){a=`${i}-${e}-${s}`;const c=r.get(a)||new Map;r.set(a,c.set(n,t))}}function m3(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:o},c=`${i}-${a}--${s}-${o}`,d=`${s}-${o}--${i}-${a}`;VN("source",l,d,e,i,a),VN("target",l,c,e,s,o),t.set(r.id,r)}}function g3(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:g3(n,t):!1}function KN(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Wie(e,t,n,r){const i=new Map;for(const[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!g3(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const o=e.get(s);o&&i.set(s,{id:s,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return i}function n0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,l;const i=[];for(const[c,d]of t){const f=(a=n.get(c))==null?void 0:a.internals.userNode;f&&i.push({...f,position:d.position,dragging:r})}if(!e)return[i[0],i];const s=(o=n.get(e))==null?void 0:o.internals.userNode;return[s?{...s,position:((l=t.get(e))==null?void 0:l.position)||s.position,dragging:r}:i[0],i]}function qie({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},a=xd(s,t);return{x:a.x-s.x,y:a.y-s.y}}function Gie({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,o=new Map,l=!1,c={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,y=null;function v({noDragClassName:E,handleSelector:b,domNode:w,isSelectable:N,nodeId:T,nodeClickDistance:A=0}){h=wr(w);function S({x:F,y:W}){const{nodeLookup:j,nodeExtent:$,snapGrid:C,snapToGrid:R,nodeOrigin:L,onNodeDrag:M,onSelectionDrag:k,onError:Y,updateNodePositions:G}=t();s={x:F,y:W};let P=!1;const V=o.size>1,Q=V&&$?u1(Ed(o)):null,re=V&&R?qie({dragItems:o,snapGrid:C,x:F,y:W}):null;for(const[le,K]of o){if(!j.has(le))continue;let q={x:F-K.distance.x,y:W-K.distance.y};R&&(q=re?{x:Math.round(q.x+re.x),y:Math.round(q.y+re.y)}:xd(q,C));let ae=null;if(V&&$&&!K.extent&&Q){const{positionAbsolute:de}=K.internals,Ie=de.x-Q.x+$[0][0],_e=de.x+K.measured.width-Q.x2+$[1][0],Ee=de.y-Q.y+$[0][1],Pe=de.y+K.measured.height-Q.y2+$[1][1];ae=[[Ie,Ee],[_e,Pe]]}const{position:ge,positionAbsolute:he}=e3({nodeId:le,nextPosition:q,nodeLookup:j,nodeExtent:ae||$,nodeOrigin:L,onError:Y});P=P||K.position.x!==ge.x||K.position.y!==ge.y,K.position=ge,K.internals.positionAbsolute=he}if(m=m||P,!!P&&(G(o,!0),y&&(r||M||!T&&k))){const[le,K]=n0({nodeId:T,dragItems:o,nodeLookup:j});r==null||r(y,o,le,K),M==null||M(y,le,K),T||k==null||k(y,K)}}async function O(){if(!d)return;const{transform:F,panBy:W,autoPanSpeed:j,autoPanOnNodeDrag:$}=t();if(!$){l=!1,cancelAnimationFrame(a);return}const[C,R]=dx(c,d,j);(C!==0||R!==0)&&(s.x=(s.x??0)-C/F[2],s.y=(s.y??0)-R/F[2],await W({x:C,y:R})&&S(s)),a=requestAnimationFrame(O)}function I(F){var V;const{nodeLookup:W,multiSelectionActive:j,nodesDraggable:$,transform:C,snapGrid:R,snapToGrid:L,selectNodesOnDrag:M,onNodeDragStart:k,onSelectionDragStart:Y,unselectNodesAndEdges:G}=t();f=!0,(!M||!N)&&!j&&T&&((V=W.get(T))!=null&&V.selected||G()),N&&M&&T&&(e==null||e(T));const P=Xc(F.sourceEvent,{transform:C,snapGrid:R,snapToGrid:L,containerBounds:d});if(s=P,o=Wie(W,$,P,T),o.size>0&&(n||k||!T&&Y)){const[Q,re]=n0({nodeId:T,dragItems:o,nodeLookup:W});n==null||n(F.sourceEvent,o,Q,re),k==null||k(F.sourceEvent,Q,re),T||Y==null||Y(F.sourceEvent,re)}}const D=LM().clickDistance(A).on("start",F=>{const{domNode:W,nodeDragThreshold:j,transform:$,snapGrid:C,snapToGrid:R}=t();d=(W==null?void 0:W.getBoundingClientRect())||null,p=!1,m=!1,y=F.sourceEvent,j===0&&I(F),s=Xc(F.sourceEvent,{transform:$,snapGrid:C,snapToGrid:R,containerBounds:d}),c=ri(F.sourceEvent,d)}).on("drag",F=>{const{autoPanOnNodeDrag:W,transform:j,snapGrid:$,snapToGrid:C,nodeDragThreshold:R,nodeLookup:L}=t(),M=Xc(F.sourceEvent,{transform:j,snapGrid:$,snapToGrid:C,containerBounds:d});if(y=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||T&&!L.has(T))&&(p=!0),!p){if(!l&&W&&f&&(l=!0,O()),!f){const k=ri(F.sourceEvent,d),Y=k.x-c.x,G=k.y-c.y;Math.sqrt(Y*Y+G*G)>R&&I(F)}(s.x!==M.xSnapped||s.y!==M.ySnapped)&&o&&f&&(c=ri(F.sourceEvent,d),S(M))}}).on("end",F=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:W,updateNodePositions:j,onNodeDragStop:$,onSelectionDragStop:C}=t();if(m&&(j(o,!1),m=!1),i||$||!T&&C){const[R,L]=n0({nodeId:T,dragItems:o,nodeLookup:W,dragging:!1});i==null||i(F.sourceEvent,o,R,L),$==null||$(F.sourceEvent,R,L),T||C==null||C(F.sourceEvent,L)}}}).filter(F=>{const W=F.target;return!F.button&&(!E||!KN(W,`.${E}`,w))&&(!b||KN(W,b,w))});h.call(D)}function g(){h==null||h.on(".drag",null)}return{update:v,destroy:g}}function Xie(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())ju(i,pl(s))>0&&r.push(s);return r}const Qie=250;function Zie(e,t,n,r){var o,l;let i=[],s=1/0;const a=Xie(e,n,t+Qie);for(const c of a){const d=[...((o=c.internals.handleBounds)==null?void 0:o.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const f of d){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=Pa(c,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m1){const c=r.type==="source"?"target":"source";return i.find(d=>d.type===c)??i[0]}return i[0]}function y3(e,t,n,r,i,s=!1){var c,d,f;const a=r.get(e);if(!a)return null;const o=i==="strict"?(c=a.internals.handleBounds)==null?void 0:c[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],l=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return l&&s?{...l,...Pa(a,l,l.position,!0)}:l}function b3(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function Jie(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const E3=()=>!0;function ese(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:o,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:y,onConnectEnd:v,isValidConnection:g=E3,onReconnectEnd:E,updateConnection:b,getTransform:w,getFromHandle:N,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:S}){const O=a3(e.target);let I=0,D;const{x:F,y:W}=ri(e),j=b3(s,S),$=o==null?void 0:o.getBoundingClientRect();let C=!1;if(!$||!j)return;const R=y3(i,j,r,l,t);if(!R)return;let L=ri(e,$),M=!1,k=null,Y=!1,G=null;function P(){if(!d||!$)return;const[ge,he]=dx(L,$,T);h({x:ge,y:he}),I=requestAnimationFrame(P)}const V={...R,nodeId:i,type:j,position:R.position},Q=l.get(i);let le={inProgress:!0,isValid:null,from:Pa(Q,V,Re.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:Q,to:L,toHandle:null,toPosition:LN[V.position],toNode:null,pointer:L};function K(){C=!0,b(le),m==null||m(e,{nodeId:i,handleId:r,handleType:j})}A===0&&K();function q(ge){if(!C){const{x:Pe,y:be}=ri(ge),Ve=Pe-F,ke=be-W;if(!(Ve*Ve+ke*ke>A*A))return;K()}if(!N()||!V){ae(ge);return}const he=w();L=ri(ge,$),D=Zie(Pl(L,he,!1,[1,1]),n,l,V),M||(P(),M=!0);const de=x3(ge,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:O,lib:c,flowId:f,nodeLookup:l});G=de.handleDomNode,k=de.connection,Y=Jie(!!D,de.isValid);const Ie=l.get(i),_e=Ie?Pa(Ie,V,Re.Left,!0):le.from,Ee={...le,from:_e,isValid:Y,to:de.toHandle&&Y?ml({x:de.toHandle.x,y:de.toHandle.y},he):L,toHandle:de.toHandle,toPosition:Y&&de.toHandle?de.toHandle.position:LN[V.position],toNode:de.toHandle?l.get(de.toHandle.nodeId):null,pointer:L};b(Ee),le=Ee}function ae(ge){if(!("touches"in ge&&ge.touches.length>0)){if(C){(D||G)&&k&&Y&&(y==null||y(k));const{inProgress:he,...de}=le,Ie={...de,toPosition:le.toHandle?le.toPosition:null};v==null||v(ge,Ie),s&&(E==null||E(ge,Ie))}p(),cancelAnimationFrame(I),M=!1,Y=!1,k=null,G=null,O.removeEventListener("mousemove",q),O.removeEventListener("mouseup",ae),O.removeEventListener("touchmove",q),O.removeEventListener("touchend",ae)}}O.addEventListener("mousemove",q),O.addEventListener("mouseup",ae),O.addEventListener("touchmove",q),O.addEventListener("touchend",ae)}function x3(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:o,flowId:l,isValidConnection:c=E3,nodeLookup:d}){const f=s==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=ri(e),y=a.elementFromPoint(p,m),v=y!=null&&y.classList.contains(`${o}-flow__handle`)?y:h,g={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const E=b3(void 0,v),b=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),N=v.classList.contains("connectable"),T=v.classList.contains("connectableend");if(!b||!E)return g;const A={source:f?b:r,sourceHandle:f?w:i,target:f?r:b,targetHandle:f?i:w};g.connection=A;const O=N&&T&&(n===fl.Strict?f&&E==="source"||!f&&E==="target":b!==r||w!==i);g.isValid=O&&c(A),g.toHandle=y3(b,E,w,d,n,!0)}return g}const p1={onPointerDown:ese,isValid:x3};function tse({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=wr(e);function s({translateExtent:o,width:l,height:c,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const w=n(),N=b.sourceEvent.ctrlKey&&Bu()?10:1,T=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,A=w[2]*Math.pow(2,T*N);t.scaleTo(A)};let y=[0,0];const v=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(y=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},g=b=>{const w=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const N=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],T=[N[0]-y[0],N[1]-y[1]];y=N;const A=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),S={x:w[0]-T[0]*A,y:w[1]-T[1]*A},O=[[0,0],[l,c]];t.setViewportConstrained({x:S.x,y:S.y,zoom:w[2]},O,o)},E=qM().on("start",v).on("zoom",f?g:null).on("zoom.wheel",h?m:null);i.call(E,{})}function a(){i.on("zoom",null)}return{update:s,destroy:a,pointer:Jr}}const Em=e=>({x:e.x,y:e.y,zoom:e.k}),r0=({x:e,y:t,zoom:n})=>gm.translate(e,t).scale(n),Co=(e,t)=>e.target.closest(`.${t}`),v3=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),nse=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,i0=(e,t=0,n=nse,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},w3=e=>{const t=e.ctrlKey&&Bu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function rse({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(Co(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=Jr(d),g=w3(d),E=f*Math.pow(2,g);r.scaleTo(n,E,v,d);return}const h=d.deltaMode===1?20:1;let p=i===va.Vertical?0:d.deltaX*h,m=i===va.Horizontal?0:d.deltaY*h;!Bu()&&d.shiftKey&&i!==va.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*s,-(m/f)*s,{internal:!0});const y=Em(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,y),e.panScrollTimeout=setTimeout(()=>{c==null||c(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,y))}}function ise({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,o=Co(r,e);if(r.ctrlKey&&s&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,i)}}function sse({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,a,o;if((s=r.sourceEvent)!=null&&s.internal)return;const i=Em(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function ase({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var a,o;e.usedRightMouseButton=!!(n&&v3(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((o=s.sourceEvent)!=null&&o.internal)&&(i==null||i(s.sourceEvent,Em(s.transform)))}}function ose({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,s&&v3(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const l=Em(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,l)},n?150:0)}}}function lse({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:c,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"&&(Co(f,`${c}-flow__node`)||Co(f,`${c}-flow__edge`)))return!0;if(!r&&!h&&!i&&!s&&!n||a||d&&!m||Co(f,o)&&m||Co(f,l)&&(!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||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&y}}function cse({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=qM().scaleExtent([t,n]).translateExtent(r),h=wr(e).call(f);E({x:i.x,y:i.y,zoom:hl(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(w3);async function y(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Gc:nh).transform(i0(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}function v({noWheelClassName:D,noPanClassName:F,onPaneContextMenu:W,userSelectionActive:j,panOnScroll:$,panOnDrag:C,panOnScrollMode:R,panOnScrollSpeed:L,preventScrolling:M,zoomOnPinch:k,zoomOnScroll:Y,zoomOnDoubleClick:G,zoomActivationKeyPressed:P,lib:V,onTransformChange:Q,connectionInProgress:re,paneClickDistance:le,selectionOnDrag:K}){j&&!c.isZoomingOrPanning&&g();const q=$&&!P&&!j;f.clickDistance(K?1/0:!ni(le)||le<0?0:le);const ae=q?rse({zoomPanValues:c,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:R,panOnScrollSpeed:L,zoomOnPinch:k,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:o}):ise({noWheelClassName:D,preventScrolling:M,d3ZoomHandler:p});h.on("wheel.zoom",ae,{passive:!1});const ge=sse({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:a});f.on("start",ge);const he=ase({zoomPanValues:c,panOnDrag:C,onPaneContextMenu:!!W,onPanZoom:s,onTransformChange:Q});f.on("zoom",he);const de=ose({zoomPanValues:c,panOnDrag:C,panOnScroll:$,onPaneContextMenu:W,onPanZoomEnd:o,onDraggingChange:l});f.on("end",de);const Ie=lse({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:Y,panOnScroll:$,zoomOnDoubleClick:G,zoomOnPinch:k,userSelectionActive:j,noPanClassName:F,noWheelClassName:D,lib:V,connectionInProgress:re});f.filter(Ie),G?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function E(D,F,W){const j=r0(D),$=f==null?void 0:f.constrain()(j,F,W);return $&&await y($),$}async function b(D,F){const W=r0(D);return await y(W,F),W}function w(D){if(h){const F=r0(D),W=h.property("__zoom");(W.k!==D.zoom||W.x!==D.x||W.y!==D.y)&&(f==null||f.transform(h,F,null,{sync:!0}))}}function N(){const D=h?WM(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}async function T(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Gc:nh).scaleTo(i0(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}async function A(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?Gc:nh).scaleBy(i0(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}function S(D){f==null||f.scaleExtent(D)}function O(D){f==null||f.translateExtent(D)}function I(D){const F=!ni(D)||D<0?0:D;f==null||f.clickDistance(F)}return{update:v,destroy:g,setViewport:b,setViewportConstrained:E,getViewport:N,scaleTo:T,scaleBy:A,setScaleExtent:S,setTranslateExtent:O,syncViewport:w,setClickDistance:I}}var gl;(function(e){e.Line="line",e.Handle="handle"})(gl||(gl={}));function use({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const a=e-t,o=n-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&i&&(l[0]=l[0]*-1),o&&s&&(l[1]=l[1]*-1),l}function YN(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function ls(e,t){return Math.max(0,t-e)}function cs(e,t){return Math.max(0,e-t)}function _f(e,t,n){return Math.max(0,t-e,e-n)}function WN(e,t){return e?!t:t}function dse(e,t,n,r,i,s,a,o){let{affectsX:l,affectsY:c}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:y,maxWidth:v,minHeight:g,maxHeight:E}=r,{x:b,y:w,width:N,height:T,aspectRatio:A}=e;let S=Math.floor(d?p-e.pointerX:0),O=Math.floor(f?m-e.pointerY:0);const I=N+(l?-S:S),D=T+(c?-O:O),F=-s[0]*N,W=-s[1]*T;let j=_f(I,y,v),$=_f(D,g,E);if(a){let L=0,M=0;l&&S<0?L=ls(b+S+F,a[0][0]):!l&&S>0&&(L=cs(b+I+F,a[1][0])),c&&O<0?M=ls(w+O+W,a[0][1]):!c&&O>0&&(M=cs(w+D+W,a[1][1])),j=Math.max(j,L),$=Math.max($,M)}if(o){let L=0,M=0;l&&S>0?L=cs(b+S,o[0][0]):!l&&S<0&&(L=ls(b+I,o[1][0])),c&&O>0?M=cs(w+O,o[0][1]):!c&&O<0&&(M=ls(w+D,o[1][1])),j=Math.max(j,L),$=Math.max($,M)}if(i){if(d){const L=_f(I/A,g,E)*A;if(j=Math.max(j,L),a){let M=0;!l&&!c||l&&!c&&h?M=cs(w+W+I/A,a[1][1])*A:M=ls(w+W+(l?S:-S)/A,a[0][1])*A,j=Math.max(j,M)}if(o){let M=0;!l&&!c||l&&!c&&h?M=ls(w+I/A,o[1][1])*A:M=cs(w+(l?S:-S)/A,o[0][1])*A,j=Math.max(j,M)}}if(f){const L=_f(D*A,y,v)/A;if($=Math.max($,L),a){let M=0;!l&&!c||c&&!l&&h?M=cs(b+D*A+F,a[1][0])/A:M=ls(b+(c?O:-O)*A+F,a[0][0])/A,$=Math.max($,M)}if(o){let M=0;!l&&!c||c&&!l&&h?M=ls(b+D*A,o[1][0])/A:M=cs(b+(c?O:-O)*A,o[0][0])/A,$=Math.max($,M)}}}O=O+(O<0?$:-$),S=S+(S<0?j:-j),i&&(h?I>D*A?O=(WN(l,c)?-S:S)/A:S=(WN(l,c)?-O:O)*A:d?(O=S/A,c=l):(S=O*A,l=c));const C=l?b+S:b,R=c?w+O:w;return{width:N+(l?-S:S),height:T+(c?-O:O),x:s[0]*S*(l?-1:1)+C,y:s[1]*O*(c?-1:1)+R}}const _3={width:0,height:0,x:0,y:0},fse={..._3,pointerX:0,pointerY:0,aspectRatio:1};function hse(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,o=n[0]*s,l=n[1]*a;return[[r-o,i-l],[r+s-o,i+a-l]]}function pse({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=wr(e);let a={controlDirection:YN("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:c,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:y,shouldResize:v}){let g={..._3},E={...fse};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:YN(c)};let b,w=null,N=[],T,A,S,O=!1;const I=LM().on("start",D=>{const{nodeLookup:F,transform:W,snapGrid:j,snapToGrid:$,nodeOrigin:C,paneDomNode:R}=n();if(b=F.get(t),!b)return;w=(R==null?void 0:R.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:M}=Xc(D.sourceEvent,{transform:W,snapGrid:j,snapToGrid:$,containerBounds:w});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},E={...g,pointerX:L,pointerY:M,aspectRatio:g.width/g.height},T=void 0,A=Da(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(T=F.get(b.parentId)),T&&b.extent==="parent"&&(A=[[0,0],[T.measured.width,T.measured.height]]),N=[],S=void 0;for(const[k,Y]of F)if(Y.parentId===t&&(N.push({id:k,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const G=hse(Y,b,Y.origin??C);S?S=[[Math.min(G[0][0],S[0][0]),Math.min(G[0][1],S[0][1])],[Math.max(G[1][0],S[1][0]),Math.max(G[1][1],S[1][1])]]:S=G}p==null||p(D,{...g})}).on("drag",D=>{const{transform:F,snapGrid:W,snapToGrid:j,nodeOrigin:$}=n(),C=Xc(D.sourceEvent,{transform:F,snapGrid:W,snapToGrid:j,containerBounds:w}),R=[];if(!b)return;const{x:L,y:M,width:k,height:Y}=g,G={},P=b.origin??$,{width:V,height:Q,x:re,y:le}=dse(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,A,S),K=V!==k,q=Q!==Y,ae=re!==L&&K,ge=le!==M&&q;if(!ae&&!ge&&!K&&!q)return;if((ae||ge||P[0]===1||P[1]===1)&&(G.x=ae?re:g.x,G.y=ge?le:g.y,g.x=G.x,g.y=G.y,N.length>0)){const _e=re-L,Ee=le-M;for(const Pe of N)Pe.position={x:Pe.position.x-_e+P[0]*(V-k),y:Pe.position.y-Ee+P[1]*(Q-Y)},R.push(Pe)}if((K||q)&&(G.width=K&&(!a.resizeDirection||a.resizeDirection==="horizontal")?V:g.width,G.height=q&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:g.height,g.width=G.width,g.height=G.height),T&&b.expandParent){const _e=P[0]*(G.width??0);G.x&&G.x<_e&&(g.x=_e,E.x=E.x-(G.x-_e));const Ee=P[1]*(G.height??0);G.y&&G.y{O&&(y==null||y(D,{...g}),i==null||i({...g}),O=!1)});s.call(I)}function l(){s.on(".drag",null)}return{update:o,destroy:l}}var T3={exports:{}},N3={},S3={exports:{}},k3={};/** +`);if(!n.length||n[0].trim()!=="---")throw new Fs(`${t} 的 SKILL.md 必须以 YAML frontmatter (--- ... ---) 开头`);let r=-1;for(let o=1;o=2&&(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))}function aee(e,t){if(!e)throw new Fs(`${t} 的 SKILL.md 缺少必填的 name frontmatter`);if(e.length>64)throw new Fs(`${t} 的 name 长度超过 64 个字符`);if(!/^[a-z0-9-]+$/.test(e))throw new Fs(`${t} 的 name 必须匹配 [a-z0-9-]+(小写字母、数字、短横线)`)}function oee(e,t){if(!e)throw new Fs(`${t} 的 SKILL.md 缺少必填的 description frontmatter`);if(e.length>1024)throw new Fs(`${t} 的 description 长度超过 1024 个字符`);if(/<[^>]+>/.test(e))throw new Fs(`${t} 的 description 不能包含 XML 标签`)}function pM(e){const t=e.map(r=>({path:r.path.replace(/\\/g,"/").replace(/^\.\//,""),text:r.text})).filter(r=>r.path.length>0&&!r.path.endsWith("/")),n=new Set(t.map(r=>r.path.split("/")[0]));if(n.size===1&&t.every(r=>r.path.includes("/"))){const r=[...n][0]+"/";return t.map(i=>({path:i.path.slice(r.length),text:i.text}))}return t}function lee(e){const t=new Map,n=new Set;for(const r of e)if(n1.test("/"+r.path)){const i=r.path.split("/");n.add(i.slice(0,-1).join("/"))}for(const r of e){const i=r.path.split("/");let s="";for(let c=i.length-1;c>=0;c--){const d=i.slice(0,c).join("/");if(n.has(d)){s=d;break}}const a=n1.test("/"+r.path);if(!s&&!a&&!n.has("")||!n.has(s)&&!a)continue;const o=s?r.path.slice(s.length+1):r.path,l=t.get(s)||[];l.push({path:o,text:r.text}),t.set(s,l)}return t}function cee(e,t,n){const r=`${n}${e?"/"+e:""}`,i=t.find(l=>n1.test("/"+l.path));if(!i)return{hit:null,error:`${r} 缺少 SKILL.md`};let s;try{s=iee(i.text,r)}catch(l){return{hit:null,error:l instanceof Error?l.message:String(l)}}const a=s.name,o=[];for(const l of t){if(l.path.split("/").some(f=>f===".."))return{hit:null,error:`${r} 包含非法路径(..):${l.path}`};const d=`skills/${a}/${l.path}`;if(!d.startsWith(`skills/${a}/`))return{hit:null,error:`${r} 包含非法路径:${l.path}`};o.push({path:d,content:l.text})}return{hit:{source:"local",id:`local:${a}:${t.length}`,name:s.name,description:s.description,folder:a,localFiles:o},error:null}}async function uee(e){const t=new Uint8Array(await e.arrayBuffer()),r=(await eee(t)).map(i=>({path:i.name,text:i.text}));return mM(pM(r),e.name)}async function dee(e,t=new Map){const n=[];for(let r=0;re.file(t,n))}async function hee(e){const t=e.createReader(),n=[];for(;;){const r=await new Promise((i,s)=>t.readEntries(i,s));if(r.length===0)return n;n.push(...r)}}async function gM(e,t=""){const n=t?`${t}/${e.name}`:e.name;if(e.isFile)return[{file:await fee(e),path:n}];if(!e.isDirectory)return[];const r=await hee(e);return(await Promise.all(r.map(i=>gM(i,n)))).flat()}function pee({selected:e,onChange:t}){const[n,r]=_.useState([]),[i,s]=_.useState([]),[a,o]=_.useState(!1),[l,c]=_.useState(!1),d=_.useRef(0),f=b=>e.some(w=>w.source==="local"&&w.folder===b),h=b=>{b.localFiles&&(f(b.folder||b.name)?t(e.filter(w=>!(w.source==="local"&&w.folder===(b.folder||b.name)))):t([...e,{source:"local",folder:b.folder||b.name,name:b.name,description:b.description,localFiles:b.localFiles}]))},p=_.useRef([]),m=_.useRef(e);_.useEffect(()=>{p.current=i},[i]),_.useEffect(()=>{m.current=e},[e]);const y=b=>{const w=new Set([...p.current.map(S=>S.folder||S.name),...m.current.filter(S=>S.source==="local").map(S=>S.folder)]),N=[],T=[];for(const S of b.hits){const R=S.folder||S.name;if(w.has(R)){N.push(S.name);continue}w.add(R),T.push(S)}s(S=>[...S,...T]);const A=[...b.errors];if(N.length>0&&A.push(`已跳过重复技能:${N.join("、")}`),r(A),T.length===1&&b.errors.length===0&&N.length===0){const S=T[0];S.localFiles&&t([...m.current,{source:"local",folder:S.folder||S.name,name:S.name,description:S.description,localFiles:S.localFiles}])}},v=b=>{b.preventDefault(),d.current+=1,c(!0)},g=b=>{b.preventDefault(),d.current=Math.max(0,d.current-1),d.current===0&&c(!1)},E=async b=>{if(b.preventDefault(),d.current=0,c(!1),a)return;const w=Array.from(b.dataTransfer.items).map(N=>{var T;return(T=N.webkitGetAsEntry)==null?void 0:T.call(N)}).filter(N=>N!==null);if(w.length===0){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}o(!0);try{const N=(await Promise.all(w.map(S=>gM(S)))).flat(),T=w.some(S=>S.isDirectory);if(!T&&N.length===1&&N[0].file.name.toLowerCase().endsWith(".zip")){y(await uee(N[0].file));return}if(!T){r(["请拖入包含 SKILL.md 的文件夹或一个 .zip 文件"]);return}const A=new Map(N.map(({file:S,path:R})=>[S,R]));y(await dee(N.map(({file:S})=>S),A))}catch(N){r([`读取失败:${N instanceof Error?N.message:String(N)}`])}finally{o(!1)}};return u.jsxs("div",{className:"cw-local",children:[u.jsxs("div",{className:`cw-local-dropzone ${l?"is-dragging":""}`,role:"group","aria-label":"拖入文件夹或 ZIP,自动识别 Skill",onDragEnter:v,onDragOver:b=>b.preventDefault(),onDragLeave:g,onDrop:b=>void E(b),children:[u.jsx(qb,{className:"cw-local-drop-icon","aria-hidden":!0}),u.jsx("p",{className:"cw-local-drop-hint",children:"拖入文件夹或 ZIP,自动识别 Skill"})]}),u.jsx("p",{className:"cw-local-hint",children:"每个技能需包含 SKILL.md(含 name / description frontmatter)。支持包含多个技能的目录。"}),a&&u.jsx("p",{className:"cw-empty-line",children:"正在读取文件…"}),n.length>0&&u.jsxs("div",{className:"cw-banner",children:[u.jsx(td,{className:"cw-i"}),u.jsx("span",{children:n.join(";")})]}),i.length>0&&u.jsx("div",{className:"cw-skill-results",children:i.map(b=>{var N;const w=f(b.folder||b.name);return u.jsxs("button",{type:"button",className:`cw-skill-result ${w?"is-on":""}`,onClick:()=>h(b),"aria-pressed":w,children:[u.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:w?u.jsx(Li,{className:"cw-i cw-i-sm"}):u.jsx(pi,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-skill-result-meta",children:[u.jsx("span",{className:"cw-skill-result-name",children:b.name}),b.description&&u.jsx("span",{className:"cw-skill-result-desc",children:Zr(b.description)}),u.jsxs("span",{className:"cw-skill-result-repo",children:["本地 · ",((N=b.localFiles)==null?void 0:N.length)??0," 个文件"]})]})]},b.id)})})]})}async function yM(e){const t=await fetch(e,{headers:{accept:"application/json"},signal:nd(void 0,zp)});if(t.status===409)throw new Error("服务端未配置 Volcengine 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 mee(){return(await yM("/web/skill-spaces?region=all")).items||[]}async function gee(e,t){const n=t?`?region=${encodeURIComponent(t)}`:"";return(await yM(`/web/skill-spaces/${encodeURIComponent(e)}/skills${n}`)).items||[]}function yee(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 bee(e,t){return`https://console.volcengine.com/agentkit/${(t||"cn-beijing")==="cn-beijing"?"cn":"cn-shanghai"}/skillspace/detail/${encodeURIComponent(e)}`}function Eee({selected:e,onChange:t}){const[n,r]=_.useState([]),[i,s]=_.useState([]),[a,o]=_.useState(""),[l,c]=_.useState(!0),[d,f]=_.useState(!1),[h,p]=_.useState(null);_.useEffect(()=>{let g=!1;return(async()=>{c(!0),p(null);try{const E=await mee();g||(r(E),E.length>0&&o(E[0].id))}catch(E){g||p(E instanceof Error?E.message:"加载失败")}finally{g||c(!1)}})(),()=>{g=!0}},[]),_.useEffect(()=>{if(!a){s([]);return}const g=n.find(b=>b.id===a);let E=!1;return(async()=>{f(!0),p(null);try{const b=await gee(a,g==null?void 0:g.region);E||s(b)}catch(b){E||p(b instanceof Error?b.message:"加载失败")}finally{E||f(!1)}})(),()=>{E=!0}},[a,n]);const m=n.find(g=>g.id===a),y=(g,E)=>e.some(b=>b.source==="skillspace"&&b.skillId===g&&(b.version||"")===E),v=g=>{if(m)if(y(g.skillId,g.version))t(e.filter(E=>!(E.source==="skillspace"&&E.skillId===g.skillId&&(E.version||"")===g.version)));else{const E=yee(m,g);t([...e,{source:"skillspace",folder:E.folder||g.skillName,name:E.name,description:E.description,skillSpaceId:E.skillSpaceId,skillSpaceName:E.skillSpaceName,skillSpaceRegion:E.skillSpaceRegion,skillId:E.skillId,version:E.version}])}};return u.jsx("div",{className:"cw-skillspace",children:l?u.jsxs("p",{className:"cw-empty-line",children:[u.jsx(bt,{className:"cw-i cw-spin"})," 正在加载 AgentKit Skills 中心…"]}):h?u.jsxs("div",{className:"cw-banner",children:[u.jsx(td,{className:"cw-i"}),u.jsx("span",{children:h})]}):n.length===0?u.jsx("p",{className:"cw-empty-line",children:"此账号下没有 AgentKit Skills 中心。"}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"cw-skillspace-header",children:[u.jsx("select",{className:"cw-input cw-skillspace-select",value:a,onChange:g=>o(g.target.value),"aria-label":"选择 AgentKit Skills 中心",children:n.map(g=>u.jsxs("option",{value:g.id,children:[g.name||g.id,g.region?` [${g.region}]`:"",g.description?` — ${Zr(g.description)}`:""]},g.id))}),m&&u.jsx("a",{href:bee(m.id,m.region),target:"_blank",rel:"noopener noreferrer",className:"cw-button cw-button-secondary cw-skillspace-console-link",title:"在火山引擎控制台打开",children:u.jsx(Wb,{className:"cw-i cw-i-sm"})})]}),d?u.jsxs("p",{className:"cw-empty-line",children:[u.jsx(bt,{className:"cw-i cw-spin"})," 正在加载技能列表…"]}):i.length===0?u.jsx("p",{className:"cw-empty-line",children:"此 AgentKit Skills 中心暂无技能。"}):u.jsx("div",{className:"cw-skill-results",children:i.map(g=>{const E=y(g.skillId,g.version);return u.jsxs("button",{type:"button",className:`cw-skill-result ${E?"is-on":""}`,onClick:()=>v(g),"aria-pressed":E,children:[u.jsx("span",{className:"cw-skill-result-icon","aria-hidden":!0,children:E?u.jsx(Li,{className:"cw-i cw-i-sm"}):u.jsx(pi,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-skill-result-meta",children:[u.jsxs("span",{className:"cw-skill-result-name",children:[g.skillName,g.version&&u.jsxs("span",{className:"cw-skill-result-version",children:[" ","v",g.version]})]}),g.skillDescription&&u.jsx("span",{className:"cw-skill-result-desc",children:Zr(g.skillDescription)}),u.jsxs("span",{className:"cw-skill-result-repo",children:[u.jsx(X8,{className:"cw-i cw-i-sm"})," ",(m==null?void 0:m.name)||a]})]})]},`${g.skillId}/${g.version}`)})})]})})}const xee=_.lazy(()=>Ko(()=>import("./MarkdownPromptEditor-DpwH_Fse.js"),__vite__mapDeps([0,1])));function vee(e,t,n="text/plain"){const r=URL.createObjectURL(new Blob([t],{type:`${n};charset=utf-8`})),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}const hN=[{id:"type",label:"类型",hint:"选择 Agent 类型",icon:_9,required:!0},{id:"basic",label:"基本信息",hint:"名称、描述与系统提示词",icon:td,required:!0},{id:"model",label:"模型配置",hint:"模型与服务(可选)",icon:SC},{id:"tools",label:"工具",hint:"可调用的能力",icon:Qb},{id:"skills",label:"技能",hint:"声明式技能",icon:Ma},{id:"knowledge",label:"知识库",hint:"外部知识检索",icon:zf},{id:"advanced",label:"进阶配置",hint:"记忆与观测",icon:LC},{id:"a2aCenter",label:"A2A 中心",hint:"远程 Agent 发现",icon:Cl},{id:"subagents",label:"子 Agent",hint:"嵌套协作",icon:TC},{id:"review",label:"完成",hint:"预览并创建",icon:v9}];function wee({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("path",{d:"m7.2 15.8 7.9-7.9a2 2 0 0 1 2.8 0l1.2 1.2a2 2 0 0 1 0 2.8l-7 7H8.7l-1.5-1.5a1.15 1.15 0 0 1 0-1.6Z"}),u.jsx("path",{d:"m12.7 10.3 4 4"}),u.jsx("path",{d:"M6.3 19h12.4"}),u.jsx("path",{d:"m5.5 8.2.5-1.4 1.4-.5L6 5.8l-.5-1.4L5 5.8l-1.4.5 1.4.5.5 1.4Z"})]})}function _ee({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.65",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"3.25",y:"4.25",width:"17.5",height:"15.5",rx:"2.75"}),u.jsx("path",{d:"M3.75 8.75h16.5"}),u.jsx("circle",{cx:"6.35",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none"}),u.jsx("circle",{cx:"8.85",cy:"6.5",r:"0.72",fill:"currentColor",stroke:"none",opacity:"0.45"}),u.jsx("path",{d:"M6 14h2.2l1.35-2.8 2.1 5.5 1.7-3.1H18"})]})}function Tee({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.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"}),u.jsx("path",{d:"M5.75 8.25v7.5",opacity:"0.8"}),u.jsx("path",{d:"M3 10v4",opacity:"0.45"}),u.jsx("path",{d:"M17.9 5.25v2.2M19 6.35h-2.2",strokeWidth:"1.55"})]})}const Gg=4,pN={REGISTRY_SPACE_ID:"registrySpaceId",REGISTRY_TOP_K:"registryTopK",REGISTRY_REGION:"registryRegion",REGISTRY_ENDPOINT:"registryEndpoint"};function bM(e,t){var r,i,s;if(!(e!=null&&e.enabled))return{};const n={REGISTRY_SPACE_ID:e.registrySpaceId??""};return t.includeDefaults?(n.REGISTRY_TOP_K=((r=e.registryTopK)==null?void 0:r.trim())||Ji.topK,n.REGISTRY_REGION=((i=e.registryRegion)==null?void 0:i.trim())||Ji.region,n.REGISTRY_ENDPOINT=((s=e.registryEndpoint)==null?void 0:s.trim())||Ji.endpoint):(n.REGISTRY_TOP_K=e.registryTopK??"",n.REGISTRY_REGION=e.registryRegion??"",n.REGISTRY_ENDPOINT=e.registryEndpoint??""),n}function mN({items:e,selected:t,onToggle:n,scrollRows:r}){return u.jsx("div",{className:`cw-checklist ${r?"cw-checklist-tools":""}`,style:r?{"--cw-checklist-max-height":`${r*65+(r-1)*8}px`}:void 0,children:e.map(i=>{const s=t.includes(i.id);return u.jsxs("button",{type:"button",className:`cw-check ${s?"is-on":""}`,onClick:()=>n(i.id),"aria-pressed":s,children:[u.jsx("span",{className:"cw-check-box","aria-hidden":!0,children:s&&u.jsx(Li,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-check-text",children:[u.jsx("span",{className:"cw-check-title",children:i.label}),u.jsx("span",{className:"cw-check-desc",children:Zr(i.desc)})]})]},i.id)})})}function Xg({options:e,value:t,onChange:n}){return u.jsx("div",{className:"cw-segmented",children:e.map(r=>{var s;const i=(t??((s=e[0])==null?void 0:s.id))===r.id;return u.jsxs("button",{type:"button",className:`cw-seg ${i?"is-on":""}`,onClick:()=>n(r.id),"aria-pressed":i,title:Zr(r.desc),children:[u.jsx("span",{className:"cw-seg-title",children:r.label}),u.jsx("span",{className:"cw-seg-desc",children:Zr(r.desc)})]},r.id)})})}function Nee(e){return/(SECRET|PASSWORD|KEY|TOKEN)$/.test(e)}function dc({env:e,values:t,onChange:n}){return e.length===0?u.jsx("p",{className:"cw-env-empty",children:"此后端无需额外运行参数。"}):u.jsx("div",{className:"cw-env-fields",children:e.map(r=>u.jsxs("label",{className:"cw-env-field",children:[u.jsxs("span",{className:"cw-env-field-head",children:[u.jsxs("span",{className:"cw-env-field-label",children:[r.comment||r.key,r.required&&u.jsx("span",{className:"cw-req",children:"*"})]}),r.comment&&u.jsx("code",{title:r.key,children:r.key})]}),u.jsx("input",{className:"cw-input",type:Nee(r.key)?"password":"text",value:t[r.key]??"",placeholder:r.placeholder||"请输入参数值",autoComplete:"off",onChange:i=>n(r.key,i.currentTarget.value)})]},r.key))})}function See({tools:e,onChange:t}){const n=(s,a)=>t(e.map((o,l)=>l===s?{...o,...a}:o)),r=s=>t(e.filter((a,o)=>o!==s)),i=()=>t([...e,{name:"",transport:"http",url:""}]);return u.jsxs("div",{className:"cw-mcp",children:[e.length>0&&u.jsx("div",{className:"cw-mcp-list",children:u.jsx(js,{initial:!1,children:e.map((s,a)=>u.jsxs($t.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:[u.jsxs("div",{className:"cw-mcp-rowhead",children:[u.jsxs("div",{className:"cw-mcp-transport",children:[u.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${s.transport==="http"?"is-on":""}`,onClick:()=>n(a,{transport:"http"}),"aria-pressed":s.transport==="http",children:u.jsx("span",{className:"cw-seg-title",children:"HTTP"})}),u.jsx("button",{type:"button",className:`cw-seg cw-seg-sm ${s.transport==="stdio"?"is-on":""}`,onClick:()=>n(a,{transport:"stdio"}),"aria-pressed":s.transport==="stdio",children:u.jsx("span",{className:"cw-seg-title",children:"stdio"})})]}),u.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",onClick:()=>r(a),"aria-label":"移除 MCP 工具",children:u.jsx(Il,{className:"cw-i cw-i-sm"})})]}),u.jsx("input",{className:"cw-input",value:s.name,placeholder:"名称(用于命名,可留空)",onChange:o=>n(a,{name:o.target.value})}),s.transport==="http"?u.jsxs(u.Fragment,{children:[u.jsx("input",{className:"cw-input",value:s.url??"",placeholder:"MCP 服务地址(StreamableHTTP)",onChange:o=>n(a,{url:o.target.value})}),u.jsx("input",{className:"cw-input",value:s.authToken??"",placeholder:"Bearer Token(可选)",onChange:o=>n(a,{authToken:o.target.value})})]}):u.jsxs(u.Fragment,{children:[u.jsx("input",{className:"cw-input",value:s.command??"",placeholder:"启动命令,例如 npx",onChange:o=>n(a,{command:o.target.value})}),u.jsx("input",{className:"cw-input",value:(s.args??[]).join(" "),placeholder:"参数(用空格分隔),例如 -y @playwright/mcp@latest",onChange:o=>n(a,{args:o.target.value.split(/\s+/).filter(Boolean)})}),u.jsx("p",{className:"cw-mcp-note",children:"stdio MCP 暂不参与调试运行;点击“去部署”时会完整保留这项配置并生成对应代码。"})]})]},a))})}),u.jsxs("button",{type:"button",className:"cw-add-sub",onClick:i,children:[u.jsx(pi,{className:"cw-i"}),"添加 MCP 工具"]}),e.length===0&&u.jsx("p",{className:"cw-empty-line",children:"暂无 MCP 工具,点击「添加 MCP 工具」连接外部 MCP 服务。"})]})}function EM({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.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"}),u.jsx("path",{d:"M7 4.75h9.5a2 2 0 0 1 2 2",opacity:".58"}),u.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"}),u.jsx("path",{d:"M19.25 11.25h1.5M20 10.5V12",opacity:".72"})]})}function kee({s:e,onRemove:t}){let n=Ma,r="火山 Find Skill 技能广场";return e.source==="local"?(n=qb,r="本地"):e.source==="skillspace"&&(n=EM,r="AgentKit Skills 中心"),u.jsxs($t.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:[u.jsx("span",{className:"cw-selected-skill-icon","aria-hidden":!0,children:u.jsx(n,{className:"cw-i cw-i-sm"})}),u.jsxs("span",{className:"cw-selected-skill-meta",children:[u.jsx("span",{className:"cw-selected-skill-name",children:e.name}),u.jsxs("span",{className:"cw-selected-skill-detail",children:[r,e.description?` · ${Zr(e.description)}`:""]})]}),u.jsx("button",{type:"button",className:"cw-selected-skill-remove",onClick:t,"aria-label":`移除 ${e.name}`,title:`移除 ${e.name}`,children:u.jsx(Xr,{className:"cw-i cw-i-sm"})})]},`${e.source}:${e.folder}:${e.skillId||e.slug||""}:${e.version||""}`)}const Qg=[{id:"local",label:"本地文件",icon:qb},{id:"skillspace",label:"AgentKit Skills 中心",icon:EM},{id:"skillhub",label:"火山 Find Skill 技能广场",icon:Cl}];function Aee({selected:e,onChange:t}){const[n,r]=_.useState("local"),[i,s]=_.useState(!1),a=Qg.findIndex(l=>l.id===n),o=l=>t(e.filter(c=>Zg(c)!==l));return _.useEffect(()=>{if(!i)return;const l=c=>{c.key==="Escape"&&s(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[i]),u.jsxs("div",{className:"cw-skillspane",children:[u.jsxs("button",{type:"button",className:"cw-skill-add","aria-haspopup":"dialog",onClick:()=>s(!0),children:[u.jsx("span",{className:"cw-skill-add-icon","aria-hidden":!0,children:u.jsx(pi,{className:"cw-i"})}),u.jsx("span",{children:"添加 Skill"})]}),e.length>0&&u.jsxs("div",{className:"cw-skill-selected",children:[u.jsxs("span",{className:"cw-skill-selected-label",children:["已加入技能 · ",e.length]}),u.jsx("div",{className:"cw-selected-skill-list",children:u.jsx(js,{initial:!1,children:e.map(l=>u.jsx(kee,{s:l,onRemove:()=>o(Zg(l))},Zg(l)))})})]}),u.jsx(js,{children:i&&u.jsx($t.div,{className:"cw-skill-dialog-backdrop",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16},onMouseDown:l=>{l.target===l.currentTarget&&s(!1)},children:u.jsxs($t.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:[u.jsxs("div",{className:"cw-skill-dialog-head",children:[u.jsx("h3",{id:"cw-skill-dialog-title",children:"添加 Skill"}),u.jsx("button",{type:"button",className:"cw-skill-dialog-close","aria-label":"关闭添加 Skill",onClick:()=>s(!1),children:u.jsx(Xr,{className:"cw-i"})})]}),u.jsxs("div",{className:"cw-skill-dialog-body",children:[u.jsxs("div",{className:"cw-skill-sourcetabs",role:"tablist",style:{"--cw-skill-tab-slider-width":`calc((100% - 16px) / ${Qg.length})`,"--cw-active-skill-tab-offset":`calc(${a*100}% + ${a*4}px)`},children:[u.jsx("span",{className:"cw-skill-tab-slider","aria-hidden":!0}),Qg.map(({id:l,label:c,icon:d})=>u.jsxs("button",{type:"button",role:"tab",id:`cw-skill-tab-${l}`,"aria-controls":"cw-skill-tabpanel","aria-selected":n===l,className:`cw-skill-pickertab ${n===l?"is-on":""}`,onClick:()=>r(l),children:[u.jsx(d,{className:"cw-i cw-i-sm"}),c]},l))]}),u.jsxs("div",{id:"cw-skill-tabpanel",className:"cw-skill-tabbody",role:"tabpanel","aria-labelledby":`cw-skill-tab-${n}`,children:[n==="skillhub"&&u.jsx(ree,{selected:e,onChange:t}),n==="local"&&u.jsx(pee,{selected:e,onChange:t}),n==="skillspace"&&u.jsx(Eee,{selected:e,onChange:t})]})]})]})})})]})}function Zg(e){return e.source==="skillhub"?`hub:${e.namespace}/${e.slug}`:e.source==="local"?`local:${e.folder}`:`ss:${e.skillSpaceId}/${e.skillId}/${e.version||""}`}function io({checked:e,onChange:t,title:n,desc:r,icon:i}){return u.jsxs("button",{type:"button",className:`cw-toggle ${e?"is-on":""}`,onClick:()=>t(!e),"aria-pressed":e,children:[u.jsx("span",{className:"cw-toggle-icon",children:u.jsx(i,{className:"cw-i"})}),u.jsxs("span",{className:"cw-toggle-text",children:[u.jsx("span",{className:"cw-toggle-title",children:n}),u.jsx("span",{className:"cw-toggle-desc",children:Zr(r)})]}),u.jsx("span",{className:"cw-switch","aria-hidden":!0,children:u.jsx($t.span,{className:"cw-switch-knob",layout:!0,transition:{type:"spring",stiffness:520,damping:34}})})]})}const gN=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]);function Cee(e,t){var r;let n=e;for(const i of t)if(n=(r=n.subAgents)==null?void 0:r[i],!n)return!1;return!0}function th(e,t){let n=e;for(const r of t)n=n.subAgents[r];return n}function xd(e,t,n){if(t.length===0)return n(e);const[r,...i]=t,s=e.subAgents.slice();return s[r]=xd(s[r],i,n),{...e,subAgents:s}}function Iee(e,t){return xd(e,t,n=>({...n,subAgents:[...n.subAgents,Ks()]}))}function Ree(e,t){if(t.length===0)return e;const n=t.slice(0,-1),r=t[t.length-1];return xd(e,n,i=>({...i,subAgents:i.subAgents.filter((s,a)=>a!==r)}))}function Oee(e,t,n,r){return xd(e,t,i=>{const s=i.subAgents.slice(),[a]=s.splice(n,1);return s.splice(r,0,a),{...i,subAgents:s}})}const Lee=e=>e==="sequential"||e==="loop",xM=e=>!tx(e.agentType),Mee=3;function vM(e,t){var r;const n=Yo(e.name);return n||(t.has(e.name)?"Agent 名称在当前结构中必须唯一":e.description.trim().length===0?"缺少描述":tx(e.agentType)?(e.a2aUrl??"").trim().length===0?"缺少 Agent URL":null:lM(e.agentType)?e.subAgents.length===0?"缺少子 Agent":null:(r=e.a2aRegistry)!=null&&r.enabled&&!e.a2aRegistry.registrySpaceId.trim()?"A2A 中心缺少空间 ID":e.instruction.trim().length===0?"缺少系统提示词":null)}function wM(e,t,n=[]){const r=[],i=vM(e,t);return i&&r.push({path:n,name:e.name.trim()||"未命名",problem:i}),xM(e)&&e.subAgents.forEach((s,a)=>r.push(...wM(s,t,[...n,a]))),r}function _M(e){return 1+e.subAgents.reduce((t,n)=>t+_M(n),0)}function Dee(e){const t=[],n={},r=s=>{var a,o,l,c;for(const d of s.builtinTools??[]){const f=JE.find(h=>h.id===d);f&&t.push({env:f.env})}if((a=s.a2aRegistry)!=null&&a.enabled&&(t.push({env:JL}),Object.assign(n,bM(s.a2aRegistry,{includeDefaults:!0}))),s.memory.shortTerm&&t.push({env:((o=sp.find(d=>d.id===(s.shortTermBackend??"local")))==null?void 0:o.env)??[]}),s.memory.longTerm&&t.push({env:((l=ap.find(d=>d.id===(s.longTermBackend??"local")))==null?void 0:l.env)??[]}),s.knowledgebase&&t.push({env:((c=op.find(d=>d.id===(s.knowledgebaseBackend??"local")))==null?void 0:c.env)??[]}),s.tracing)for(const d of s.tracingExporters??[]){const f=lp.find(h=>h.id===d);f&&t.push({env:f.env,enableFlag:f.enableFlag})}s.subAgents.forEach(r)};r(e);const i=cM(t);return{specs:i.specs,fixedValues:{...i.fixedValues,...n}}}function TM({root:e,path:t,selectedPath:n,duplicateNames:r,showErrors:i,validationPulse:s,onSelect:a,onChange:o,onClearRoot:l}){const c=th(e,t),d=ex(c.agentType),f=d.icon,h=t.length===0,p=gN(t,n),m=xM(c),y=m&&t.length{const A=Iee(e,t),S=th(A,t).subAgents.length-1;o(A,[...t,S])},g=()=>o(Ree(e,t),t.slice(0,-1)),E=t.slice(0,-1),b=!h&&Lee(th(e,E).agentType),[w,N]=_.useState(!1),T=A=>{A.preventDefault(),A.stopPropagation(),N(!1);const S=A.dataTransfer.getData("application/x-agent-path");if(!S)return;let R;try{R=JSON.parse(S)}catch{return}if(!gN(R.slice(0,-1),E))return;const I=R[R.length-1],D=t[t.length-1];I!==D&&o(Oee(e,E,I,D),[...E,D])};return u.jsxs("div",{className:"cw-tree-branch",children:[u.jsxs("div",{className:`cw-tree-node cw-tree-type-${c.agentType??"llm"} ${p?"is-selected":""} ${b?"is-draggable":""} ${w?"is-dragover":""} ${i&&vM(c,r)?`is-invalid cw-error-shake-${s%2}`:""}`,role:"button",tabIndex:0,draggable:b,onDragStart:b?A=>{A.dataTransfer.setData("application/x-agent-path",JSON.stringify(t)),A.dataTransfer.effectAllowed="move",A.stopPropagation()}:void 0,onDragOver:b?A=>{A.preventDefault(),N(!0)}:void 0,onDragLeave:b?()=>N(!1):void 0,onDrop:b?T:void 0,onClick:()=>a(t),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),a(t))},children:[u.jsx(f,{className:"cw-tree-icon"}),u.jsxs("span",{className:"cw-tree-main",children:[u.jsx("span",{className:"cw-tree-name",children:c.name.trim()||"未命名"}),u.jsx("span",{className:"cw-tree-type",children:d.label})]}),u.jsxs("span",{className:"cw-tree-actions",children:[h&&u.jsx("button",{type:"button",className:"cw-icon-btn cw-tree-clear",title:"清空根 Agent","aria-label":"清空根 Agent",onClick:A=>{A.stopPropagation(),l()},children:u.jsx(wee,{className:"cw-i cw-i-sm"})}),y&&u.jsx("button",{type:"button",className:"cw-icon-btn",title:"添加子 Agent",onClick:A=>{A.stopPropagation(),v()},children:u.jsx(pi,{className:"cw-i cw-i-sm"})}),!h&&u.jsx("button",{type:"button",className:"cw-icon-btn cw-icon-danger",title:"删除",onClick:A=>{A.stopPropagation(),g()},children:u.jsx(Il,{className:"cw-i cw-i-sm"})})]})]}),m&&c.subAgents.length>0&&u.jsx("div",{className:"cw-tree-children",children:c.subAgents.map((A,S)=>u.jsx(TM,{root:e,path:[...t,S],selectedPath:n,duplicateNames:r,showErrors:i,validationPulse:s,onSelect:a,onChange:o,onClearRoot:l},S))})]})}function nh(e){var t;return{...e,deployment:{feishuEnabled:!!((t=e.deployment)!=null&&t.feishuEnabled)}}}function yN(e){return JSON.stringify(nh(e))}function Pee({enabled:e,disabledReason:t,phase:n,stale:r,run:i,projectName:s,logs:a,messages:o,input:l,error:c,deploying:d,deployError:f,onInput:h,onSend:p,onRestart:m,onIgnoreChanges:y,onDeploy:v}){const[g,E]=_.useState(!1),b=n==="ready"||n==="sending",w=n==="building"||n==="starting"||n==="sending",N=e&&!i&&n==="idle",T=e&&(n==="building"||n==="starting"),A=!!(i&&r&&!T);return g?u.jsx("aside",{className:"cw-debug is-collapsed","aria-label":"调试窗口(已收起)",children:u.jsx("button",{type:"button",className:"cw-debug-expand",onClick:()=>E(!1),"aria-label":"展开调试栏",title:"展开调试栏",children:u.jsx(_ee,{className:"cw-i"})})}):u.jsxs("aside",{className:"cw-debug","aria-label":"调试窗口",children:[u.jsxs("div",{className:"cw-debug-head",children:[u.jsxs("div",{className:"cw-debug-title",children:[u.jsx("button",{type:"button",className:"cw-debug-collapse",onClick:()=>E(!0),"aria-label":"收起调试栏",title:"收起调试栏",children:u.jsx(or,{className:"cw-i cw-i-sm"})}),u.jsx("span",{children:"调试"})]}),u.jsx("div",{className:"cw-debug-head-actions",children:u.jsxs("button",{type:"button",className:"cw-debug-deploy",disabled:d,onClick:v,title:"查看源码、填写环境变量并部署",children:["去部署",d?u.jsx(bt,{className:"cw-i cw-spin"}):u.jsx(vC,{className:"cw-i"})]})})]}),!i&&n==="idle"&&!e&&u.jsx("div",{className:"cw-debug-sub",children:u.jsx("span",{children:t})}),f&&u.jsx("div",{className:"cw-debug-deploy-error",role:"alert",children:f}),u.jsxs("div",{className:"cw-debug-stage",children:[u.jsx("div",{className:"cw-debug-body",children:e?n==="error"?u.jsxs("div",{className:"cw-debug-error",children:[u.jsx(cp,{message:c||"调试失败",className:"cw-debug-error-detail",onRetry:async()=>{await m()}}),a.length>0&&u.jsx("div",{className:"cw-debug-progress",children:a.map((S,R)=>u.jsx("div",{className:"cw-debug-logline",children:u.jsx("span",{children:S})},`${S}-${R}`))})]}):u.jsx("div",{className:"cw-debug-chat",children:o.length===0?u.jsx("div",{className:"cw-debug-chat-empty",children:"输入消息开始验证当前 Agent。"}):o.map((S,R)=>u.jsxs("div",{className:`cw-debug-msg cw-debug-msg-${S.role}`,children:[u.jsx("div",{className:"cw-debug-role",children:S.role==="user"?"你":s||"Agent"}),u.jsx("div",{className:"cw-debug-content",children:S.role==="user"?S.content:S.error?u.jsx(cp,{message:S.error,className:"cw-debug-msg-error"}):S.blocks&&S.blocks.length>0?u.jsx(hL,{blocks:S.blocks,onAction:()=>{}}):S.content?S.content:R===o.length-1&&n==="sending"?u.jsx(fL,{}):null})]},R))}):u.jsx("div",{className:"cw-debug-empty",children:t})}),u.jsx("div",{className:"cw-debug-composer",children:u.jsxs("div",{className:"cw-debug-composerbox",children:[u.jsx("textarea",{className:"cw-debug-input",rows:1,value:l,placeholder:r?"更新 Agent 后可继续调试":b?"输入测试消息...":"调试环境启动后可输入",disabled:!b||w||r,onChange:S=>h(S.target.value),onKeyDown:S=>{S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),p())}}),u.jsx("button",{type:"button",className:"cw-debug-send",title:"发送",disabled:!b||w||r||!l.trim(),onClick:p,children:n==="sending"?u.jsx(bt,{className:"cw-i cw-spin"}):u.jsx(wC,{className:"cw-i"})})]})}),(N||T||A)&&u.jsx("div",{className:"cw-debug-overlay",role:"status","aria-live":"polite",children:u.jsxs("div",{className:"cw-debug-overlay-content",children:[u.jsx("strong",{className:"cw-debug-overlay-title",children:T?"正在初始化调试环境":A?"Agent 配置已变更":"启动调试环境"}),T?u.jsx("div",{className:"cw-debug-overlay-progress",children:a.map((S,R)=>u.jsxs("div",{className:"cw-debug-logline",children:[R===a.length-1?u.jsx(bt,{className:"cw-i cw-spin"}):u.jsx(Li,{className:"cw-i"}),u.jsx("span",{children:S})]},`${S}-${R}`))}):A?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"cw-debug-overlay-copy",children:"当前对话仍在使用上一次配置。更新后,新配置才会生效。"}),u.jsxs("div",{className:"cw-debug-overlay-actions",children:[u.jsx("button",{type:"button",className:"cw-debug-ignore",disabled:w,onClick:y,children:"忽略"}),u.jsxs("button",{type:"button",className:"cw-debug-start",disabled:w,onClick:m,children:[u.jsx(Gb,{className:"cw-i"}),"更新 Agent"]})]})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"cw-debug-overlay-copy",children:"启动后会生成代码并创建临时运行环境。"}),u.jsxs("button",{type:"button",className:"cw-debug-start",onClick:m,children:[u.jsx(Tee,{className:"cw-i cw-debug-run-icon"}),"启动调试环境"]})]})]})})]})]})}function jee({onBack:e,onCreate:t,onAgentAdded:n,initialDraft:r,features:i,onDeploymentTaskChange:s}){var tr,Rn,Bn,wn,_n,Tn,Jt,en,gn,Fn,Nn,Tr,yn;const[a,o]=_.useState(()=>r??Ks()),[l,c]=_.useState(!1),[d,f]=_.useState(0),[h,p]=_.useState(null),[m,y]=_.useState(!1),[v,g]=_.useState("cn-beijing"),E=(i==null?void 0:i.generatedAgentTestRun)===!0,b=(i==null?void 0:i.generatedAgentTestRunDisabledReason)||"当前后端暂不支持生成 Agent 调试运行。",[w,N]=_.useState("idle"),[T,A]=_.useState(null),S=_.useRef(null),[R,I]=_.useState(null),[D,F]=_.useState(""),[W,j]=_.useState([]),[$,C]=_.useState([]),[O,L]=_.useState(""),[M,k]=_.useState(null),[Y,G]=_.useState(""),[P,V]=_.useState(""),[Q,ne]=_.useState("basic"),[le,K]=_.useState(""),[q,ae]=_.useState(!1),[ye,he]=_.useState(!1),[de,Ie]=_.useState(!1),[_e,xe]=_.useState([]),je=_.useRef(null),be=_.useRef({});_.useEffect(()=>()=>{const ee=S.current;ee&&Ay(ee.runId).catch(Te=>console.warn("清理调试运行失败",Te))},[]);const Ve=_.useRef(null);Ve.current||(Ve.current=({meta:ee,children:Te})=>u.jsxs("section",{ref:Pe=>{be.current[ee.id]=Pe},id:`cw-sec-${ee.id}`,"data-step-id":ee.id,className:"cw-section",children:[u.jsx("header",{className:"cw-sec-head",children:u.jsxs("h2",{className:"cw-sec-title",children:[ee.label,ee.required&&u.jsx("span",{className:"cw-sec-required",children:"必填"})]})}),Te]}));const ke=Cee(a,_e)?_e:[],ce=th(a,ke),Nt=ke.length===0,De=`cw-model-advanced-${ke.join("-")||"root"}`,xt=`cw-more-tool-types-${ke.join("-")||"root"}`,it=`cw-advanced-config-${ke.join("-")||"root"}`,z=Math.max(0,yf.findIndex(ee=>ee.id===(ce.agentType??"llm"))),X=ee=>o(Te=>xd(Te,ke,Pe=>({...Pe,...ee}))),oe=(ee,Te)=>o(Pe=>{var nt;return{...Pe,deployment:{...Pe.deployment??{feishuEnabled:!1},envValues:{...((nt=Pe.deployment)==null?void 0:nt.envValues)??{},[ee]:Te}}}}),ve=ee=>X({a2aRegistry:{...ce.a2aRegistry??{enabled:!1,registrySpaceId:"",registryTopK:"",registryRegion:"",registryEndpoint:""},...ee}}),Ae=(ee,Te)=>{if(!(ee in pN))return;const Pe=pN[ee];ve({[Pe]:Te}),oe(ee,Te)},st=(ee,Te)=>{o(ee),Te&&xe(Te)},Xt=()=>{window.confirm("清空根 Agent 的全部配置和子 Agent?此操作无法撤销。")&&(o(Ks()),xe([]),c(!1),Ie(!1))},ze=ce.builtinTools??[],an=ce.mcpTools??[],vt=ce.tracingExporters??[],pt=ce.selectedSkills??[],jt=[ce.memory.shortTerm,ce.memory.longTerm,ce.tracing].filter(Boolean).length,Vt=ee=>X({builtinTools:ze.includes(ee)?ze.filter(Te=>Te!==ee):[...ze,ee]}),Qt=ee=>{const Te=vt.includes(ee)?vt.filter(Pe=>Pe!==ee):[...vt,ee];X({tracingExporters:Te,tracing:Te.length>0?!0:ce.tracing})},Le=lM(ce.agentType),Je=tx(ce.agentType),mt=_.useMemo(()=>hM(a),[a]),gt=Yo(ce.name)??(mt.has(ce.name)?"Agent 名称在当前结构中必须唯一":null),se=gt!==null,Ce=ce.description.trim().length===0,Ke=ce.instruction.trim().length===0,on=(ce.a2aUrl??"").trim().length===0,Xe=!!((tr=ce.a2aRegistry)!=null&&tr.enabled)&&!ce.a2aRegistry.registrySpaceId.trim(),re=ee=>l&&ee?`is-error cw-error-shake-${d%2}`:"",Ee=_.useMemo(()=>wM(a,mt),[a,mt]),me=Ee.length===0,Me=_.useMemo(()=>yN(a),[a]),$e=_.useMemo(()=>Dee(a),[a]),He=!!(T&&Y&&Y!==Me&&P!==Me);_.useEffect(()=>{P&&P!==Me&&V("")},[Me,P]);const ft=_.useMemo(()=>{var ee,Te,Pe,nt,yt;return{type:!0,basic:!se&&(Le||Je||!Ke),model:!!((ee=ce.modelName)!=null&&ee.trim()||(Te=ce.modelProvider)!=null&&Te.trim()||(Pe=ce.modelApiBase)!=null&&Pe.trim()),tools:ze.length>0||an.length>0,skills:pt.length>0,knowledge:ce.knowledgebase,advanced:ce.memory.shortTerm||ce.memory.longTerm||ce.tracing,a2aCenter:!!((nt=ce.a2aRegistry)!=null&&nt.enabled),subagents:(((yt=ce.subAgents)==null?void 0:yt.length)??0)>0,review:me}},[ce,se,Ke,Le,Je,me,ze,an,pt]),ln=Le||Je?["basic"]:["basic","model","tools","skills","knowledge",...Nt?["advanced","a2aCenter"]:[]],ht=hN.filter(ee=>ln.includes(ee.id)),In=ln.join("|"),ut=ke.join("."),jn=ht.findIndex(ee=>ee.id===Q),cn=ee=>{var Te;(Te=be.current[ee])==null||Te.scrollIntoView({behavior:"smooth",block:"start"})};_.useEffect(()=>{if(h)return;const ee=je.current;if(!ee)return;const Te=In.split("|");let Pe=0;const nt=()=>{Pe=0;const Lt=Te[Te.length-1];let tn=Te[0];if(ee.scrollTop+ee.clientHeight>=ee.scrollHeight-2)tn=Lt;else{const Un=ee.getBoundingClientRect().top+24;for(const Sn of Te){const On=be.current[Sn];if(!On||On.getBoundingClientRect().top>Un)break;tn=Sn}}tn&&ne(Un=>Un===tn?Un:tn)},yt=()=>{Pe||(Pe=window.requestAnimationFrame(nt))};return nt(),ee.addEventListener("scroll",yt,{passive:!0}),window.addEventListener("resize",yt),()=>{ee.removeEventListener("scroll",yt),window.removeEventListener("resize",yt),Pe&&window.cancelAnimationFrame(Pe)}},[h,In,ut]);const dr=()=>me?!0:(c(!0),f(ee=>ee+1),Ee[0]&&(xe(Ee[0].path),window.requestAnimationFrame(()=>cn("basic"))),!1),Zt=async()=>{const ee=S.current;if(S.current=null,A(null),I(null),G(""),V(""),ee)try{await Ay(ee.runId)}catch(Te){console.warn("清理调试运行失败",Te)}},fr=async()=>{if(K(""),!!dr()){y(!0);try{const ee=await Vh(nh(a));await Zt(),N("idle"),F(""),j([]),C([]),L(""),k(null),p(ee)}catch(ee){K(`打开部署页失败:${ee instanceof Error?ee.message:String(ee)}`)}finally{y(!1)}}},Bt=async()=>{if(!E||m||!dr())return;const ee=yN(a);V(""),k(null),C([]),L(""),j([]),N("building");try{await Zt();const Te=[],Pe=Lt=>{Te.push(Lt),j([...Te])};Pe("提交 Agent 配置"),N("starting"),Pe("初始化调试环境");const nt=await iI(nh(a));S.current=nt,A(nt),F(nt.appName),Pe("创建调试会话");const yt=await sI(nt.runId,"test_user");I(yt),G(ee),Pe("调试环境就绪"),N("ready")}catch(Te){k(Te instanceof Error?Te.message:String(Te)),N("error")}},er=async()=>{const ee=S.current,Te=R,Pe=O.trim();if(!(!ee||!Te||!Pe||w==="sending")){L(""),N("sending"),C(nt=>[...nt,{role:"user",content:Pe},{role:"assistant",content:"",blocks:[]}]);try{let nt=Ki(),yt="";for await(const Lt of aI({runId:ee.runId,userId:"test_user",sessionId:Te,text:Pe})){const tn=Lt.error||Lt.errorMessage||Lt.error_message;if(tn){C(Un=>{const Sn=[...Un],On=Sn[Sn.length-1];return(On==null?void 0:On.role)==="assistant"&&(On.error=String(tn)),Sn});break}nt=al(nt,Lt),yt=nt.blocks.filter(Un=>Un.kind==="text").map(Un=>Un.text).join(""),C(Un=>{const Sn=[...Un],On=Sn[Sn.length-1];return(On==null?void 0:On.role)==="assistant"&&(On.content=yt,On.blocks=nt.blocks),Sn})}N("ready")}catch(nt){C(yt=>{const Lt=[...yt],tn=Lt[Lt.length-1];return(tn==null?void 0:tn.role)==="assistant"&&(tn.error=nt instanceof Error?nt.message:String(nt)),Lt}),N("ready")}}};if(h){const ee=async(Te,Pe,nt)=>{var tn;const yt=(tn=a.deployment)==null?void 0:tn.network,Lt=yt&&yt.mode&&yt.mode!=="public"?{mode:yt.mode,vpc_id:yt.vpcId,subnet_ids:yt.subnetIds,enable_shared_internet_access:yt.enableSharedInternetAccess}:void 0;return nE(Te.name,Te.files,{region:v,projectName:"default",network:Lt},{...nt,onStage:Pe})};return u.jsx("div",{className:"cw-root cw-root-preview",children:u.jsx("div",{className:"cw-preview-body",children:u.jsx(nx,{project:h,agentDraft:a,agentName:a.name||"未命名 Agent",agentCount:_M(a),onChange:p,onDeploy:ee,onAgentAdded:n,onDeploymentTaskChange:s,feishuEnabled:!!((Rn=a.deployment)!=null&&Rn.feishuEnabled),onFeishuEnabledChange:async Te=>{const Pe={...a,deployment:{...a.deployment??{feishuEnabled:!1},feishuEnabled:Te}},nt=await Vh(nh(Pe));o(Pe),p(nt)},deploymentEnv:$e.specs,deploymentEnvValues:{...(Bn=a.deployment)==null?void 0:Bn.envValues,...$e.fixedValues},onDeploymentEnvChange:oe,network:(wn=a.deployment)==null?void 0:wn.network,onNetworkChange:Te=>o(Pe=>({...Pe,deployment:{...Pe.deployment??{feishuEnabled:!1},network:Te}})),deployRegion:v,onDeployRegionChange:g,onBack:()=>p(null),onExportYaml:()=>vee(`${a.name||"agent"}.yaml`,vJ(a),"text/yaml")})})})}const Ot=Ve.current,vn=ee=>hN.find(Te=>Te.id===ee);return u.jsx("div",{className:"cw-root",children:u.jsxs("div",{className:"cw-editor",children:[u.jsxs("aside",{className:"cw-tree","aria-label":"Agent 结构",children:[u.jsx("div",{className:"cw-tree-head",children:"Agent 结构"}),u.jsx(TM,{root:a,path:[],selectedPath:ke,duplicateNames:mt,showErrors:l,validationPulse:d,onSelect:xe,onChange:st,onClearRoot:Xt})]}),u.jsxs("div",{className:"cw-detail",children:[u.jsx("div",{className:"cw-typebar",children:u.jsx("div",{className:"cw-typebar-inner",children:u.jsxs("div",{className:"cw-typeradio cw-typeradio--row",role:"radiogroup","aria-label":"Agent 类型",style:{"--cw-agent-type-gap":`${Gg}px`,"--cw-agent-type-slider-width":`calc((100% - ${8+Gg*(yf.length-1)}px) / ${yf.length})`,"--cw-active-type-offset":`calc(${z*100}% + ${z*Gg}px)`},children:[u.jsx("span",{className:"cw-typeradio-slider","aria-hidden":!0}),yf.map(ee=>{const Te=(ce.agentType??"llm")===ee.id;return u.jsxs("label",{className:`cw-typeradio-item ${Te?"is-on":""}`,children:[u.jsx("input",{type:"radio",name:"agentType",className:"cw-typeradio-input",checked:Te,onChange:()=>X({agentType:ee.id})}),u.jsx("span",{className:"cw-typeradio-title",children:ee.id==="a2a"?"A2A 远程":ee.label})]},ee.id)})]})})}),u.jsx("div",{className:"cw-detail-scroll",ref:je,children:u.jsx("div",{className:"cw-detail-inner",children:u.jsxs("div",{className:"cw-lower",children:[u.jsxs("div",{className:"cw-form-col",children:[u.jsx(Ot,{meta:vn("basic"),children:u.jsxs("div",{className:"cw-form",children:[u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["Agent 名称",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx("input",{className:`cw-input ${re(se)}`,value:ce.name,placeholder:"customer_service",onChange:ee=>X({name:ee.target.value})}),l&>?u.jsx("span",{className:"cw-error-text",children:gt}):u.jsx("span",{className:"cw-help",children:"遵循 Google ADK 命名规则,且在 Agent 结构中保持唯一。"})]}),u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["描述",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx("textarea",{className:`cw-textarea cw-textarea-sm ${re(Ce)}`,value:ce.description,placeholder:"简要描述这个 Agent 的用途,便于团队识别…",onChange:ee=>X({description:ee.target.value})}),l&&Ce?u.jsx("span",{className:"cw-error-text",children:"描述为必填项"}):u.jsx("span",{className:"cw-help",children:"描述会显示在 Agent 列表与选择器中。"})]}),Le?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"cw-section-desc",children:"编排型 Agent 只负责调度子 Agent,不需要模型或系统提示词。请在左侧 「Agent 结构」中为它添加、排序子 Agent。"}),ce.agentType==="loop"&&u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"最大轮次"}),u.jsx("input",{className:"cw-input",type:"number",min:1,value:ce.maxIterations??3,onChange:ee=>X({maxIterations:Math.max(1,Number(ee.target.value)||1)})}),u.jsx("span",{className:"cw-help",children:"循环编排反复执行子 Agent,直到满足条件或达到该轮次上限。"})]})]}):Je?u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["Agent URL",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx("input",{className:`cw-input ${re(on)}`,value:ce.a2aUrl??"",placeholder:"https://example.com/my-agent",onChange:ee=>X({a2aUrl:ee.target.value})}),l&&on?u.jsx("span",{className:"cw-error-text",children:"Agent URL 为必填项"}):u.jsx("span",{className:"cw-help",children:"远程 Agent 的访问地址(A2A 协议);VeADK 会拉取其 Agent Card 并按需处理鉴权。"})]}):u.jsxs("div",{className:"cw-field",children:[u.jsxs("label",{className:"cw-label",children:["系统提示词",u.jsx("span",{className:"cw-req",children:"*"})]}),u.jsx(_.Suspense,{fallback:u.jsx("div",{className:"cw-markdown-loading",role:"status",children:"正在加载 Markdown 编辑器…"}),children:u.jsx(xee,{value:ce.instruction,invalid:Ke,onChange:ee=>X({instruction:ee})})}),l&&Ke?u.jsx("span",{className:"cw-error-text",children:"系统提示词为必填项"}):u.jsx("span",{className:"cw-help",children:"支持 Markdown 快捷输入,例如键入 ## 加空格创建二级标题。"})]})]})}),!Le&&!Je&&u.jsxs(u.Fragment,{children:[u.jsx(Ot,{meta:vn("model"),children:u.jsxs("div",{className:"cw-form",children:[u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"模型名称"}),u.jsx("input",{className:"cw-input",value:ce.modelName??"",placeholder:"doubao-seed-2-1-pro-260628",onChange:ee=>X({modelName:ee.target.value})})]}),u.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":q,"aria-controls":De,onClick:()=>ae(ee=>!ee),children:[u.jsx("span",{children:"更多选项"}),u.jsx(or,{className:`cw-more-options-chevron ${q?"is-open":""}`,"aria-hidden":!0})]}),u.jsx(js,{initial:!1,children:q&&u.jsxs($t.div,{id:De,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:[u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"服务商 Provider"}),u.jsx("input",{className:"cw-input",value:ce.modelProvider??"",placeholder:"openai",onChange:ee=>X({modelProvider:ee.target.value})})]}),u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"API Base"}),u.jsx("input",{className:"cw-input",value:ce.modelApiBase??"",placeholder:"https://ark.cn-beijing.volces.com/api/v3/",onChange:ee=>X({modelApiBase:ee.target.value})}),u.jsx("span",{className:"cw-help",children:"留空则使用 VeADK 默认模型配置;Ark API Key 会由 Studio 服务端凭据自动获取。其他服务商的 Key 可在部署页添加。"})]})]})})]})}),u.jsx(Ot,{meta:vn("tools"),children:u.jsxs("div",{className:"cw-form",children:[u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"内置工具"}),u.jsx("span",{className:"cw-help",children:"勾选 VeADK 提供的内置能力,生成时会自动补全 import 与所需环境变量。"}),u.jsx("div",{className:"cw-tools-list-shell",children:u.jsx(mN,{items:JE,selected:ze,onToggle:Vt,scrollRows:6})})]}),u.jsxs("button",{type:"button",className:"cw-more-options","aria-expanded":ye,"aria-controls":xt,onClick:()=>he(ee=>!ee),children:[u.jsx("span",{children:"更多类型工具"}),an.length>0&&u.jsxs("span",{className:"cw-more-options-count",children:["已配置 ",an.length]}),u.jsx(or,{className:`cw-more-options-chevron ${ye?"is-open":""}`,"aria-hidden":!0})]}),u.jsx(js,{initial:!1,children:ye&&u.jsx($t.div,{id:xt,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:u.jsxs("div",{className:"cw-field",children:[u.jsx("label",{className:"cw-label",children:"MCP 工具"}),u.jsx("span",{className:"cw-help",children:"连接外部 MCP 服务,生成时会为每个条目创建对应的 MCPToolset。"}),u.jsx(See,{tools:an,onChange:ee=>X({mcpTools:ee})})]})})})]})}),u.jsx(Ot,{meta:vn("skills"),children:u.jsx("div",{className:"cw-form",children:u.jsx(Aee,{selected:pt,onChange:ee=>X({selectedSkills:ee})})})}),u.jsx(Ot,{meta:vn("knowledge"),children:u.jsxs("div",{className:"cw-form cw-toggle-stack",children:[u.jsx(io,{checked:ce.knowledgebase,onChange:ee=>X({knowledgebase:ee}),title:"知识库",desc:"启用外部知识检索(RAG),让 Agent 基于你的资料作答。",icon:zf}),ce.knowledgebase&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"知识库后端"}),u.jsx(Xg,{options:op,value:ce.knowledgebaseBackend,onChange:ee=>X({knowledgebaseBackend:ee})}),u.jsx(dc,{env:((_n=op.find(ee=>ee.id===(ce.knowledgebaseBackend??"local")))==null?void 0:_n.env)??[],values:((Tn=a.deployment)==null?void 0:Tn.envValues)??{},onChange:oe})]})]})}),Nt&&u.jsxs("section",{ref:ee=>{be.current.advanced=ee},id:"cw-sec-advanced","data-step-id":"advanced",className:"cw-section cw-advanced-section",children:[u.jsxs("button",{type:"button",className:"cw-advanced-disclosure","aria-expanded":de,"aria-controls":it,onClick:()=>Ie(ee=>!ee),children:[u.jsx("span",{className:"cw-advanced-disclosure-title",children:"进阶配置"}),u.jsx(or,{className:`cw-advanced-disclosure-chevron ${de?"is-open":""}`,"aria-hidden":!0}),jt>0&&u.jsxs("span",{className:"cw-more-options-count",children:["已启用 ",jt]})]}),u.jsx(js,{initial:!1,children:de&&u.jsxs($t.div,{id:it,className:"cw-advanced-content",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeOut"},children:[u.jsxs("div",{className:"cw-advanced-group",children:[u.jsx("div",{className:"cw-advanced-group-head",children:u.jsx("span",{children:"记忆"})}),u.jsxs("div",{className:"cw-form cw-toggle-stack",children:[u.jsx(io,{checked:ce.memory.shortTerm,onChange:ee=>X({memory:{...ce.memory,shortTerm:ee}}),title:"短期记忆",desc:"在单次会话内保留上下文,跨轮次记住对话内容。",icon:LC}),ce.memory.shortTerm&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"短期记忆后端"}),u.jsx(Xg,{options:sp,value:ce.shortTermBackend,onChange:ee=>X({shortTermBackend:ee})}),u.jsx(dc,{env:((Jt=sp.find(ee=>ee.id===(ce.shortTermBackend??"local")))==null?void 0:Jt.env)??[],values:((en=a.deployment)==null?void 0:en.envValues)??{},onChange:oe})]}),u.jsx(io,{checked:ce.memory.longTerm,onChange:ee=>X({memory:{...ce.memory,longTerm:ee}}),title:"长期记忆",desc:"跨会话持久化关键信息,让 Agent 记住历史偏好。",icon:zf}),ce.memory.longTerm&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"长期记忆后端"}),u.jsx(Xg,{options:ap,value:ce.longTermBackend,onChange:ee=>X({longTermBackend:ee})}),u.jsx(dc,{env:((gn=ap.find(ee=>ee.id===(ce.longTermBackend??"local")))==null?void 0:gn.env)??[],values:((Fn=a.deployment)==null?void 0:Fn.envValues)??{},onChange:oe}),u.jsx(io,{checked:!!ce.autoSaveSession,onChange:ee=>X({autoSaveSession:ee}),title:"自动保存会话到长期记忆",desc:"会话结束时自动把内容写入长期记忆,无需手动调用。",icon:zf})]})]})]}),u.jsxs("div",{className:"cw-advanced-group",children:[u.jsx("div",{className:"cw-advanced-group-head",children:u.jsx("span",{children:"观测"})}),u.jsxs("div",{className:"cw-form cw-toggle-stack",children:[u.jsx(io,{checked:ce.tracing,onChange:ee=>X({tracing:ee}),title:"观测 / Tracing",desc:"记录每一步的调用链路与耗时,便于调试与性能分析。",icon:kC}),ce.tracing&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx("label",{className:"cw-label",children:"Tracing 导出器"}),u.jsx("span",{className:"cw-help",children:"选择一个或多个观测平台,生成时会写入对应的 ENABLE_* 开关与环境变量。"}),u.jsx(mN,{items:lp,selected:vt,onToggle:Qt}),u.jsx(dc,{env:lp.filter(ee=>vt.includes(ee.id)).flatMap(ee=>ee.env),values:((Nn=a.deployment)==null?void 0:Nn.envValues)??{},onChange:oe})]})]})]})]})})]}),Nt&&u.jsx(Ot,{meta:vn("a2aCenter"),children:u.jsxs("div",{className:"cw-form cw-toggle-stack",children:[u.jsx(io,{checked:!!((Tr=ce.a2aRegistry)!=null&&Tr.enabled),onChange:ee=>ve({enabled:ee}),title:"A2A 中心",desc:"升级该 Agent 为 SupperAgent,支持发现并调用 A2A 注册中心子 Agent",icon:Cl}),((yn=ce.a2aRegistry)==null?void 0:yn.enabled)&&u.jsxs("div",{className:"cw-field cw-subfield",children:[u.jsx(dc,{env:JL,values:bM(ce.a2aRegistry,{includeDefaults:!1}),onChange:Ae}),l&&Xe&&u.jsx("span",{className:"cw-error-text",children:"A2A 注册中心空间 ID 为必填项"})]})]})})]})]}),u.jsx("nav",{className:"cw-rail","aria-label":"步骤导航",children:u.jsxs("ol",{className:"cw-steps",children:[u.jsx("div",{className:"cw-rail-track","aria-hidden":!0,children:u.jsx($t.div,{className:"cw-rail-fill",animate:{height:`${Math.max(jn,0)/Math.max(ht.length-1,1)*100}%`},transition:{type:"spring",stiffness:260,damping:32}})}),ht.map(ee=>{const Te=ee.id===Q,Pe=ft[ee.id];return u.jsx("li",{children:u.jsxs("button",{type:"button",className:`cw-step ${Te?"is-active":""} ${Pe?"is-done":""}`,onClick:()=>cn(ee.id),"aria-current":Te?"step":void 0,"aria-label":ee.label,children:[u.jsx("span",{className:"cw-step-marker","aria-hidden":!0,children:Te?u.jsx("span",{className:"cw-dot"}):Pe?u.jsx(Li,{className:"cw-step-check"}):u.jsx("span",{className:"cw-dot"})}),u.jsx("span",{className:"cw-step-tooltip","aria-hidden":!0,children:ee.label})]})},ee.id)})]})})]})})})]}),u.jsx(Pee,{enabled:E,disabledReason:b,phase:w,stale:He,run:T,projectName:D||a.name,logs:W,messages:$,input:O,error:M,deploying:m,deployError:le,onInput:L,onSend:er,onRestart:Bt,onIgnoreChanges:()=>V(Me),onDeploy:fr})]})})}function ji(e){return{...Ks(),...e}}const Bee=[{id:"support",icon:a9,draft:ji({name:"客服助手",description:"7×24 在线答疑,结合知识库与历史对话,稳定、礼貌地解决用户问题。",instruction:"你是一名专业、耐心的客服助手。请始终保持礼貌、友好的语气,优先依据知识库中的资料回答用户问题;当资料不足以确定答案时,如实告知用户并主动引导其提供更多信息,切勿编造。回答尽量简洁、分点清晰,必要时给出操作步骤。",model:"doubao-1.5-pro-32k",knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"analyst",icon:Y8,draft:ji({name:"数据分析师",description:"运行代码完成统计与可视化,开启链路追踪,分析过程可观测、可复现。",instruction:"你是一名严谨的数据分析师。面对数据问题时,先厘清分析目标与口径,再通过编写并运行代码完成清洗、统计与可视化。每一步都要说明你的假设与方法,给出结论时附上关键数据支撑,并指出潜在的偏差与局限。",model:"doubao-1.5-pro-32k",tools:["code_runner"],tracing:!0})},{id:"translator",icon:o9,draft:ji({name:"翻译助手",description:"中英互译,忠实、通顺、地道,保留原文语气与专业术语。",instruction:"你是一名专业的翻译助手,精通中英互译。请在忠实于原文含义的前提下,使译文自然、地道、符合目标语言表达习惯;保留专有名词与专业术语的准确性,并尽量贴合原文的语气与风格。仅输出译文,除非用户额外要求解释。",model:"doubao-1.5-pro-32k"})},{id:"coder",icon:Vb,draft:ji({name:"代码助手",description:"编写、调试与重构代码,可运行代码验证结果,给出清晰可维护的实现。",instruction:"你是一名资深软件工程师。请根据需求编写正确、清晰、可维护的代码,遵循目标语言的惯用风格与最佳实践。在不确定时通过运行代码验证你的实现,给出关键的边界条件与测试思路,并对复杂逻辑附上简要注释。",model:"doubao-1.5-pro-32k",tools:["code_runner","file_reader"],tracing:!0})},{id:"researcher",icon:m9,draft:ji({name:"研究员",description:"联网检索一手资料,结合知识库与长期记忆,输出有据可查的研究结论。",instruction:"你是一名严谨的研究员。面对研究问题时,先拆解关键子问题,再通过联网检索收集多个一手、可信的来源,交叉验证后再下结论。结论需注明出处与不确定性,区分事实与推断,避免以偏概全。",model:"doubao-1.5-pro-32k",tools:["web_search"],knowledgebase:!0,memory:{shortTerm:!0,longTerm:!0}})},{id:"research-team",icon:S9,draft:ji({name:"多智能体研究团队",description:"由检索员、分析员、撰写员协作的研究编排,分工完成端到端调研报告。",instruction:"你是一支研究团队的总协调者。负责拆解用户的研究任务,将检索、分析、撰写分别委派给对应的子 Agent,汇总各子 Agent 的产出,把控整体质量,最终输出结构清晰、有据可查的研究报告。",model:"doubao-1.5-pro-32k",tracing:!0,memory:{shortTerm:!0,longTerm:!0},subAgents:[ji({name:"检索员",description:"联网搜集与课题相关的一手资料与数据。",instruction:"你是研究团队中的检索员。根据课题联网检索多个可信来源,整理出关键事实、数据与原文出处,交付给分析员,不做主观结论。",tools:["web_search"]}),ji({name:"分析员",description:"对检索到的材料做交叉验证与归纳分析。",instruction:"你是研究团队中的分析员。对检索员提供的材料做交叉验证、归纳与对比,提炼洞见、识别矛盾与不确定性,形成结构化的分析要点。",tools:["code_runner"]}),ji({name:"撰写员",description:"将分析结论组织为结构清晰、引用规范的报告。",instruction:"你是研究团队中的撰写员。把分析员的要点组织成结构清晰、语言通顺、引用规范的研究报告,确保每个结论都能追溯到来源。"})]})}];function Fee(e){const t=[];return e.tools.length&&t.push({icon:Qb,label:"工具"}),(e.memory.shortTerm||e.memory.longTerm)&&t.push({icon:K8,label:"记忆"}),e.knowledgebase&&t.push({icon:V8,label:"知识库"}),e.tracing&&t.push({icon:H8,label:"观测"}),e.subAgents.length&&t.push({icon:DC,label:`子Agent ${e.subAgents.length}`}),t}function Uee({onBack:e,onCreate:t}){const[n,r]=_.useState(null);return u.jsx("div",{className:"tpl-root",children:n?u.jsx(Hee,{template:n,onBack:()=>r(null),onCreate:t}):u.jsx($ee,{onPick:r})})}function $ee({onPick:e}){return u.jsxs("div",{className:"tpl-scroll",children:[u.jsxs("div",{className:"tpl-head",children:[u.jsx("h1",{className:"tpl-title",children:"从模板新建"}),u.jsx("p",{className:"tpl-sub",children:"选择一个预制 agent 模板,按需微调后即可创建。"})]}),u.jsx("div",{className:"tpl-grid",children:Bee.map((t,n)=>u.jsxs($t.button,{type:"button",className:"tpl-card",onClick:()=>e(t),initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:n*.03,duration:.24,ease:[.22,1,.36,1]},children:[u.jsx("span",{className:"tpl-card-icon",children:u.jsx(t.icon,{className:"icon"})}),u.jsx("span",{className:"tpl-card-name",children:t.draft.name}),u.jsx("span",{className:"tpl-card-desc",children:Zr(t.draft.description)})]},t.id))})]})}function Hee({template:e,onBack:t,onCreate:n}){const[r,i]=_.useState(e.draft.name),s=e.icon,a=Fee(e.draft);function o(){const l=r.trim()||e.draft.name;n({...e.draft,name:l})}return u.jsxs("div",{className:"tpl-scroll tpl-scroll--detail",children:[u.jsxs("button",{className:"tpl-back",onClick:t,children:[u.jsx(xC,{className:"icon"})," 返回模板列表"]}),u.jsxs($t.div,{className:"tpl-detail",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.28,ease:[.22,1,.36,1]},children:[u.jsxs("div",{className:"tpl-detail-head",children:[u.jsx("span",{className:"tpl-detail-icon",children:u.jsx(s,{className:"icon"})}),u.jsxs("div",{className:"tpl-detail-headtext",children:[u.jsx("div",{className:"tpl-detail-name",children:e.draft.name}),u.jsx("div",{className:"tpl-detail-desc",children:Zr(e.draft.description)})]})]}),a.length>0&&u.jsx("div",{className:"tpl-tags tpl-tags--detail",children:a.map(l=>u.jsxs("span",{className:"tpl-tag",children:[u.jsx(l.icon,{className:"tpl-tag-icon"})," ",l.label]},l.label))}),u.jsxs("label",{className:"tpl-field",children:[u.jsx("span",{className:"tpl-field-label",children:"名称"}),u.jsx("input",{className:"tpl-input",value:r,onChange:l=>i(l.target.value),placeholder:e.draft.name})]}),u.jsxs("div",{className:"tpl-field",children:[u.jsx("span",{className:"tpl-field-label",children:"系统提示词"}),u.jsx("p",{className:"tpl-instruction",children:e.draft.instruction})]}),u.jsxs("div",{className:"tpl-meta-grid",children:[e.draft.model&&u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"模型"}),u.jsx("span",{className:"tpl-meta-val tpl-mono",children:e.draft.model})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"工具"}),u.jsx("span",{className:"tpl-meta-val",children:e.draft.tools.length?e.draft.tools.join("、"):"无"})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"记忆"}),u.jsx("span",{className:"tpl-meta-val",children:zee(e.draft)})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"知识库"}),u.jsx("span",{className:"tpl-meta-val",children:e.draft.knowledgebase?"已开启":"关闭"})]}),u.jsxs("div",{className:"tpl-meta",children:[u.jsx("span",{className:"tpl-meta-key",children:"观测追踪"}),u.jsx("span",{className:"tpl-meta-val",children:e.draft.tracing?"已开启":"关闭"})]})]}),e.draft.subAgents.length>0&&u.jsxs("div",{className:"tpl-field",children:[u.jsxs("span",{className:"tpl-field-label",children:["子 Agent(",e.draft.subAgents.length,")"]}),u.jsx("div",{className:"tpl-subagents",children:e.draft.subAgents.map((l,c)=>u.jsxs("div",{className:"tpl-subagent",children:[u.jsxs("div",{className:"tpl-subagent-top",children:[u.jsx("span",{className:"tpl-subagent-name",children:l.name}),l.tools.length>0&&u.jsx("span",{className:"tpl-subagent-tools",children:l.tools.join("、")})]}),u.jsx("div",{className:"tpl-subagent-desc",children:Zr(l.description)})]},c))})]}),u.jsxs("button",{className:"tpl-create",onClick:o,children:["使用此模板创建 ",u.jsx(or,{className:"icon"})]})]})]})}function zee(e){const t=[];return e.memory.shortTerm&&t.push("短期"),e.memory.longTerm&&t.push("长期"),t.length?t.join(" + "):"关闭"}function xn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function hm(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}rh.prototype=hm.prototype={constructor:rh,on:function(e,t){var n=this._,r=Kee(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s0)for(var n=new Array(i),r=0,i,s;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),EN.hasOwnProperty(t)?{space:EN[t],local:e}:e}function Wee(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===r1&&t.documentElement.namespaceURI===r1?t.createElement(e):t.createElementNS(n,e)}}function qee(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function NM(e){var t=pm(e);return(t.local?qee:Wee)(t)}function Gee(){}function rx(e){return e==null?Gee:function(){return this.querySelector(e)}}function Xee(e){typeof e!="function"&&(e=rx(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=b&&(b=E+1);!(N=v[b])&&++b=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function vte(e){e||(e=wte);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),s=0;st?1:e>=t?0:NaN}function _te(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Tte(){return Array.from(this)}function Nte(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?Pte:typeof t=="function"?Bte:jte)(e,t,n??"")):ml(this.node(),e)}function ml(e,t){return e.style.getPropertyValue(t)||IM(e).getComputedStyle(e,null).getPropertyValue(t)}function Ute(e){return function(){delete this[e]}}function $te(e,t){return function(){this[e]=t}}function Hte(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zte(e,t){return arguments.length>1?this.each((t==null?Ute:typeof t=="function"?Hte:$te)(e,t)):this.node()[e]}function RM(e){return e.trim().split(/^|\s+/)}function ix(e){return e.classList||new OM(e)}function OM(e){this._node=e,this._names=RM(e.getAttribute("class")||"")}OM.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 LM(e,t){for(var n=ix(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function yne(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n()=>e;function i1(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:o,dx:l,dy:c,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:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}i1.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function kne(e){return!e.ctrlKey&&!e.button}function Ane(){return this.parentNode}function Cne(e,t){return t??{x:e.x,y:e.y}}function Ine(){return navigator.maxTouchPoints||"ontouchstart"in this}function FM(){var e=kne,t=Ane,n=Cne,r=Ine,i={},s=hm("start","drag","end"),a=0,o,l,c,d,f=0;function h(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",v).on("touchmove.drag",g,Sne).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,N){if(!(d||!e.call(this,w,N))){var T=b(this,t.call(this,w,N),w,N,"mouse");T&&(Ar(w.view).on("mousemove.drag",m,Du).on("mouseup.drag",y,Du),jM(w.view),Jg(w),c=!1,o=w.clientX,l=w.clientY,T("start",w))}}function m(w){if(Wo(w),!c){var N=w.clientX-o,T=w.clientY-l;c=N*N+T*T>f}i.mouse("drag",w)}function y(w){Ar(w.view).on("mousemove.drag mouseup.drag",null),BM(w.view,c),Wo(w),i.mouse("end",w)}function v(w,N){if(e.call(this,w,N)){var T=w.changedTouches,A=t.call(this,w,N),S=T.length,R,I;for(R=0;R>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xf(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=One.exec(e))?new br(t[1],t[2],t[3],1):(t=Lne.exec(e))?new br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mne.exec(e))?xf(t[1],t[2],t[3],t[4]):(t=Dne.exec(e))?xf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Pne.exec(e))?SN(t[1],t[2]/100,t[3]/100,1):(t=jne.exec(e))?SN(t[1],t[2]/100,t[3]/100,t[4]):xN.hasOwnProperty(e)?_N(xN[e]):e==="transparent"?new br(NaN,NaN,NaN,0):null}function _N(e){return new br(e>>16&255,e>>8&255,e&255,1)}function xf(e,t,n,r){return r<=0&&(e=t=n=NaN),new br(e,t,n,r)}function Une(e){return e instanceof wd||(e=Ba(e)),e?(e=e.rgb(),new br(e.r,e.g,e.b,e.opacity)):new br}function s1(e,t,n,r){return arguments.length===1?Une(e):new br(e,t,n,r??1)}function br(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}sx(br,s1,UM(wd,{brighter(e){return e=e==null?dp:Math.pow(dp,e),new br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new br(Sa(this.r),Sa(this.g),Sa(this.b),fp(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:TN,formatHex:TN,formatHex8:$ne,formatRgb:NN,toString:NN}));function TN(){return`#${Ea(this.r)}${Ea(this.g)}${Ea(this.b)}`}function $ne(){return`#${Ea(this.r)}${Ea(this.g)}${Ea(this.b)}${Ea((isNaN(this.opacity)?1:this.opacity)*255)}`}function NN(){const e=fp(this.opacity);return`${e===1?"rgb(":"rgba("}${Sa(this.r)}, ${Sa(this.g)}, ${Sa(this.b)}${e===1?")":`, ${e})`}`}function fp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ea(e){return e=Sa(e),(e<16?"0":"")+e.toString(16)}function SN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oi(e,t,n,r)}function $M(e){if(e instanceof oi)return new oi(e.h,e.s,e.l,e.opacity);if(e instanceof wd||(e=Ba(e)),!e)return new oi;if(e instanceof oi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(t===s?a=(n-r)/o+(n0&&l<1?0:a,new oi(a,o,l,e.opacity)}function Hne(e,t,n,r){return arguments.length===1?$M(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}sx(oi,Hne,UM(wd,{brighter(e){return e=e==null?dp:Math.pow(dp,e),new oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new oi(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new br(e0(e>=240?e-240:e+120,i,r),e0(e,i,r),e0(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new oi(kN(this.h),vf(this.s),vf(this.l),fp(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=fp(this.opacity);return`${e===1?"hsl(":"hsla("}${kN(this.h)}, ${vf(this.s)*100}%, ${vf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kN(e){return e=(e||0)%360,e<0?e+360:e}function vf(e){return Math.max(0,Math.min(1,e||0))}function e0(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 ax=e=>()=>e;function zne(e,t){return function(n){return e+n*t}}function Vne(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Kne(e){return(e=+e)==1?HM:function(t,n){return n-t?Vne(t,n,e):ax(isNaN(t)?n:t)}}function HM(e,t){var n=t-e;return n?zne(e,n):ax(isNaN(e)?t:e)}const hp=function e(t){var n=Kne(t);function r(i,s){var a=n((i=s1(i)).r,(s=s1(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=HM(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=l(d),i.opacity=c(d),i+""}}return r.gamma=e,r}(1);function Yne(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;in&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,l.push({i:a,x:Ni(r,i)})),n=t0.lastIndex;return n180?d+=360:d-c>180&&(c+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:Ni(c,d)})):d&&f.push(i(f)+"rotate("+d+r)}function o(c,d,f,h){c!==d?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:Ni(c,d)}):d&&f.push(i(f)+"skewX("+d+r)}function l(c,d,f,h,p,m){if(c!==f||d!==h){var y=p.push(i(p)+"scale(",null,",",null,")");m.push({i:y-4,x:Ni(c,f)},{i:y-2,x:Ni(d,h)})}else(f!==1||h!==1)&&p.push(i(p)+"scale("+f+","+h+")")}return function(c,d){var f=[],h=[];return c=e(c),d=e(d),s(c.translateX,c.translateY,d.translateX,d.translateY,f,h),a(c.rotate,d.rotate,f,h),o(c.skewX,d.skewX,f,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,h),c=d=null,function(p){for(var m=-1,y=h.length,v;++m=0&&e._call.call(void 0,t),e=e._next;--gl}function IN(){Fa=(mp=Bu.now())+mm,gl=Nc=0;try{ore()}finally{gl=0,cre(),Fa=0}}function lre(){var e=Bu.now(),t=e-mp;t>YM&&(mm-=t,mp=e)}function cre(){for(var e,t=pp,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:pp=n);Sc=e,l1(r)}function l1(e){if(!gl){Nc&&(Nc=clearTimeout(Nc));var t=e-Fa;t>24?(e<1/0&&(Nc=setTimeout(IN,e-Bu.now()-mm)),fc&&(fc=clearInterval(fc))):(fc||(mp=Bu.now(),fc=setInterval(lre,YM)),gl=1,WM(IN))}}function RN(e,t,n){var r=new gp;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var ure=hm("start","end","cancel","interrupt"),dre=[],GM=0,ON=1,c1=2,sh=3,LN=4,u1=5,ah=6;function gm(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;fre(e,n,{name:t,index:r,group:i,on:ure,tween:dre,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:GM})}function lx(e,t){var n=Ei(e,t);if(n.state>GM)throw new Error("too late; already scheduled");return n}function Pi(e,t){var n=Ei(e,t);if(n.state>sh)throw new Error("too late; already running");return n}function Ei(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function fre(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qM(s,0,n.time);function s(c){n.state=ON,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var d,f,h,p;if(n.state!==ON)return l();for(d in r)if(p=r[d],p.name===n.name){if(p.state===sh)return RN(a);p.state===LN?(p.state=ah,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+dc1&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function Hre(e,t,n){var r,i,s=$re(t)?lx:Pi;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function zre(e,t){var n=this._id;return arguments.length<2?Ei(this.node(),n).on.on(e):this.each(Hre(n,e,t))}function Vre(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Kre(){return this.on("end.remove",Vre(this._id))}function Yre(e){var t=this._name,n=this._id;typeof e!="function"&&(e=rx(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a()=>e;function yie(e,{sourceEvent:t,target:n,transform:r,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:r,enumerable:!0,configurable:!0},_:{value:i}})}function qi(e,t,n){this.k=e,this.x=t,this.y=n}qi.prototype={constructor:qi,scale:function(e){return e===1?this:new qi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qi(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 ym=new qi(1,0,0);JM.prototype=qi.prototype;function JM(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ym;return e.__zoom}function n0(e){e.stopImmediatePropagation()}function hc(e){e.preventDefault(),e.stopImmediatePropagation()}function bie(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Eie(){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 MN(){return this.__zoom||ym}function xie(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function vie(){return navigator.maxTouchPoints||"ontouchstart"in this}function wie(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}function e3(){var e=bie,t=Eie,n=wie,r=xie,i=vie,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=ih,c=hm("start","zoom","end"),d,f,h,p=500,m=150,y=0,v=10;function g(j){j.property("__zoom",MN).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",I).filter(i).on("touchstart.zoom",D).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(j,$,C,O){var L=j.selection?j.selection():j;L.property("__zoom",MN),j!==L?N(j,$,C,O):L.interrupt().each(function(){T(this,arguments).event(O).start().zoom(null,typeof $=="function"?$.apply(this,arguments):$).end()})},g.scaleBy=function(j,$,C,O){g.scaleTo(j,function(){var L=this.__zoom.k,M=typeof $=="function"?$.apply(this,arguments):$;return L*M},C,O)},g.scaleTo=function(j,$,C,O){g.transform(j,function(){var L=t.apply(this,arguments),M=this.__zoom,k=C==null?w(L):typeof C=="function"?C.apply(this,arguments):C,Y=M.invert(k),G=typeof $=="function"?$.apply(this,arguments):$;return n(b(E(M,G),k,Y),L,a)},C,O)},g.translateBy=function(j,$,C,O){g.transform(j,function(){return n(this.__zoom.translate(typeof $=="function"?$.apply(this,arguments):$,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),a)},null,O)},g.translateTo=function(j,$,C,O,L){g.transform(j,function(){var M=t.apply(this,arguments),k=this.__zoom,Y=O==null?w(M):typeof O=="function"?O.apply(this,arguments):O;return n(ym.translate(Y[0],Y[1]).scale(k.k).translate(typeof $=="function"?-$.apply(this,arguments):-$,typeof C=="function"?-C.apply(this,arguments):-C),M,a)},O,L)};function E(j,$){return $=Math.max(s[0],Math.min(s[1],$)),$===j.k?j:new qi($,j.x,j.y)}function b(j,$,C){var O=$[0]-C[0]*j.k,L=$[1]-C[1]*j.k;return O===j.x&&L===j.y?j:new qi(j.k,O,L)}function w(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function N(j,$,C,O){j.on("start.zoom",function(){T(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(O).end()}).tween("zoom",function(){var L=this,M=arguments,k=T(L,M).event(O),Y=t.apply(L,M),G=C==null?w(Y):typeof C=="function"?C.apply(L,M):C,P=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),V=L.__zoom,Q=typeof $=="function"?$.apply(L,M):$,ne=l(V.invert(G).concat(P/V.k),Q.invert(G).concat(P/Q.k));return function(le){if(le===1)le=Q;else{var K=ne(le),q=P/K[2];le=new qi(q,G[0]-K[0]*q,G[1]-K[1]*q)}k.zoom(null,le)}})}function T(j,$,C){return!C&&j.__zooming||new A(j,$)}function A(j,$){this.that=j,this.args=$,this.active=0,this.sourceEvent=null,this.extent=t.apply(j,$),this.taps=0}A.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,$){return this.mouse&&j!=="mouse"&&(this.mouse[1]=$.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=$.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=$.invert(this.touch1[0])),this.that.__zoom=$,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var $=Ar(this.that).datum();c.call(j,this.that,new yie(j,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),$)}};function S(j,...$){if(!e.apply(this,arguments))return;var C=T(this,$).event(j),O=this.__zoom,L=Math.max(s[0],Math.min(s[1],O.k*Math.pow(2,r.apply(this,arguments)))),M=si(j);if(C.wheel)(C.mouse[0][0]!==M[0]||C.mouse[0][1]!==M[1])&&(C.mouse[1]=O.invert(C.mouse[0]=M)),clearTimeout(C.wheel);else{if(O.k===L)return;C.mouse=[M,O.invert(M)],oh(this),C.start()}hc(j),C.wheel=setTimeout(k,m),C.zoom("mouse",n(b(E(O,L),C.mouse[0],C.mouse[1]),C.extent,a));function k(){C.wheel=null,C.end()}}function R(j,...$){if(h||!e.apply(this,arguments))return;var C=j.currentTarget,O=T(this,$,!0).event(j),L=Ar(j.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",P,!0),M=si(j,C),k=j.clientX,Y=j.clientY;jM(j.view),n0(j),O.mouse=[M,this.__zoom.invert(M)],oh(this),O.start();function G(V){if(hc(V),!O.moved){var Q=V.clientX-k,ne=V.clientY-Y;O.moved=Q*Q+ne*ne>y}O.event(V).zoom("mouse",n(b(O.that.__zoom,O.mouse[0]=si(V,C),O.mouse[1]),O.extent,a))}function P(V){L.on("mousemove.zoom mouseup.zoom",null),BM(V.view,O.moved),hc(V),O.event(V).end()}}function I(j,...$){if(e.apply(this,arguments)){var C=this.__zoom,O=si(j.changedTouches?j.changedTouches[0]:j,this),L=C.invert(O),M=C.k*(j.shiftKey?.5:2),k=n(b(E(C,M),O,L),t.apply(this,$),a);hc(j),o>0?Ar(this).transition().duration(o).call(N,k,O,j):Ar(this).call(g.transform,k,O,j)}}function D(j,...$){if(e.apply(this,arguments)){var C=j.touches,O=C.length,L=T(this,$,j.changedTouches.length===O).event(j),M,k,Y,G;for(n0(j),k=0;k`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:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", 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.`},Fu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],t3=["Enter"," ","Escape"],n3={"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 yl;(function(e){e.Strict="strict",e.Loose="loose"})(yl||(yl={}));var ka;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ka||(ka={}));var Uu;(function(e){e.Partial="partial",e.Full="full"})(Uu||(Uu={}));const r3={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ts;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ts||(Ts={}));var $u;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})($u||($u={}));var Oe;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Oe||(Oe={}));const DN={[Oe.Left]:Oe.Right,[Oe.Right]:Oe.Left,[Oe.Top]:Oe.Bottom,[Oe.Bottom]:Oe.Top};function i3(e){return e===null?null:e?"valid":"invalid"}const s3=e=>"id"in e&&"source"in e&&"target"in e,_ie=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ux=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_d=(e,t=[0,0])=>{const{width:n,height:r}=ls(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},Tie=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const s=typeof i=="string";let a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):ux(i)?i:t.nodeLookup.get(i.id));const o=a?yp(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return bm(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Em(n)},Td=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=bm(n,yp(i)),r=!0)}),r?Em(n):{x:0,y:0,width:0,height:0}},dx=(e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{const o={...Hl(t,[n,r,i]),width:t.width/i,height:t.height/i},l=[];for(const c of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=c;if(a&&!f||h)continue;const p=d.width??c.width??c.initialWidth??null,m=d.height??c.height??c.initialHeight??null,y=Hu(o,El(c)),v=(p??0)*(m??0),g=s&&y>0;(!c.internals.handleBounds||g||y>=v||c.dragging)&&l.push(c)}return l},Nie=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Sie(e,t){const n=new Map,r=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)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function kie({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;const o=Sie(e,a),l=Td(o),c=hx(l,t,n,(a==null?void 0:a.minZoom)??i,(a==null?void 0:a.maxZoom)??s,(a==null?void 0:a.padding)??.1);return await r.setViewport(c,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function a3({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const a=n.get(e),o=a.parentId?n.get(a.parentId):void 0,{x:l,y:c}=o?o.internals.positionAbsolute:{x:0,y:0},d=a.origin??r;let f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!o)s==null||s("005",mi.error005());else{const p=o.measured.width,m=o.measured.height;p&&m&&(f=[[l,c],[l+p,c+m]])}else o&&$a(a.extent)&&(f=[[a.extent[0][0]+l,a.extent[0][1]+c],[a.extent[1][0]+l,a.extent[1][1]+c]]);const h=$a(f)?Ua(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&(s==null||s("015",mi.error015())),{position:{x:h.x-l+(a.measured.width??0)*d[0],y:h.y-c+(a.measured.height??0)*d[1]},positionAbsolute:h}}async function Aie({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(h=>h.id)),a=[];for(const h of n){if(h.deletable===!1)continue;const p=s.has(h.id),m=!p&&h.parentId&&a.find(y=>y.id===h.parentId);(p||m)&&a.push(h)}const o=new Set(t.map(h=>h.id)),l=r.filter(h=>h.deletable!==!1),d=Nie(a,l);for(const h of l)o.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 bl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ua=(e={x:0,y:0},t,n)=>({x:bl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:bl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function o3(e,t,n){const{width:r,height:i}=ls(n),{x:s,y:a}=n.internals.positionAbsolute;return Ua(e,[[s,a],[s+r,a+i]],t)}const PN=(e,t,n)=>en?-bl(Math.abs(e-n),1,t)/t:0,fx=(e,t,n=15,r=40)=>{const i=PN(e.x,r,t.width-r)*n,s=PN(e.y,r,t.height-r)*n;return[i,s]},bm=(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)}),d1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Em=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),El=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=ux(e)?e.internals.positionAbsolute:_d(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},yp=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=ux(e)?e.internals.positionAbsolute:_d(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},l3=(e,t)=>Em(bm(d1(e),d1(t))),Hu=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},jN=e=>li(e.width)&&li(e.height)&&li(e.x)&&li(e.y),li=e=>!isNaN(e)&&isFinite(e),c3=(e,t)=>(n,r)=>{},Nd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Hl=({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{const o={x:(e-n)/i,y:(t-r)/i};return s?Nd(o,a):o},xl=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function so(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 Cie(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=so(e,n),i=so(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=so(e.top??e.y??0,n),i=so(e.bottom??e.y??0,n),s=so(e.left??e.x??0,t),a=so(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Iie(e,t,n,r,i,s){const{x:a,y:o}=xl(e,[t,n,r]),{x:l,y:c}=xl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-l,f=s-c;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(d),bottom:Math.floor(f)}}const hx=(e,t,n,r,i,s)=>{const a=Cie(s,t,n),o=(t-a.x)/e.width,l=(n-a.y)/e.height,c=Math.min(o,l),d=bl(c,r,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,y=Iie(e,p,m,d,t,n),v={left:Math.min(y.left-a.left,0),top:Math.min(y.top-a.top,0),right:Math.min(y.right-a.right,0),bottom:Math.min(y.bottom-a.bottom,0)};return{x:p-v.left+v.right,y:m-v.top+v.bottom,zoom:d}},zu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function $a(e){return e!=null&&e!=="parent"}function ls(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 u3(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 d3(e,t={width:0,height:0},n,r,i){const s={...e},a=r.get(n);if(a){const o=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*o[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*o[1]}return s}function BN(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Rie(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function Oie(e){return{...n3,...e||{}}}function tu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:a}=ci(e),o=Hl({x:s-((i==null?void 0:i.left)??0),y:a-((i==null?void 0:i.top)??0)},r),{x:l,y:c}=n?Nd(o,t):o;return{xSnapped:l,ySnapped:c,...o}}const px=e=>({width:e.offsetWidth,height:e.offsetHeight}),f3=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Lie=["INPUT","SELECT","TEXTAREA"];function h3(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Lie.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const p3=e=>"clientX"in e,ci=(e,t)=>{var s,a;const n=p3(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},FN=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...px(a)}})};function m3({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:o}){const l=e*.125+i*.375+a*.375+n*.125,c=t*.125+s*.375+o*.375+r*.125,d=Math.abs(l-e),f=Math.abs(c-t);return[l,c,d,f]}function Tf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function UN({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case Oe.Left:return[t-Tf(t-r,s),n];case Oe.Right:return[t+Tf(r-t,s),n];case Oe.Top:return[t,n-Tf(n-i,s)];case Oe.Bottom:return[t,n+Tf(i-n,s)]}}function g3({sourceX:e,sourceY:t,sourcePosition:n=Oe.Bottom,targetX:r,targetY:i,targetPosition:s=Oe.Top,curvature:a=.25}){const[o,l]=UN({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[c,d]=UN({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,h,p,m]=m3({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${o},${l} ${c},${d} ${r},${i}`,f,h,p,m]}function y3({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n0}const Pie=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,jie=(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)),Bie=(e,t,n={})=>{var s;if(!e.source||!e.target)return(s=n.onError)==null||s.call(n,"006",mi.error006()),t;const r=n.getEdgeId||Pie;let i;return s3(e)?i={...e}:i={...e,id:r(e)},jie(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function b3({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,a,o]=y3({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,o]}const $N={[Oe.Left]:{x:-1,y:0},[Oe.Right]:{x:1,y:0},[Oe.Top]:{x:0,y:-1},[Oe.Bottom]:{x:0,y:1}},Fie=({source:e,sourcePosition:t=Oe.Bottom,target:n})=>t===Oe.Left||t===Oe.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Uie({source:e,sourcePosition:t=Oe.Bottom,target:n,targetPosition:r=Oe.Top,center:i,offset:s,stepPosition:a}){const o=$N[t],l=$N[r],c={x:e.x+o.x*s,y:e.y+o.y*s},d={x:n.x+l.x*s,y:n.y+l.y*s},f=Fie({source:c,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h];let m=[],y,v;const g={x:0,y:0},E={x:0,y:0},[,,b,w]=y3({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[h]*l[h]===-1){h==="x"?(y=i.x??c.x+(d.x-c.x)*a,v=i.y??(c.y+d.y)/2):(y=i.x??(c.x+d.x)/2,v=i.y??c.y+(d.y-c.y)*a);const S=[{x:y,y:c.y},{x:y,y:d.y}],R=[{x:c.x,y:v},{x:d.x,y:v}];o[h]===p?m=h==="x"?S:R:m=h==="x"?R:S}else{const S=[{x:c.x,y:d.y}],R=[{x:d.x,y:c.y}];if(h==="x"?m=o.x===p?R:S:m=o.y===p?S:R,t===r){const j=Math.abs(e[h]-n[h]);if(j<=s){const $=Math.min(s-1,s-j);o[h]===p?g[h]=(c[h]>e[h]?-1:1)*$:E[h]=(d[h]>n[h]?-1:1)*$}}if(t!==r){const j=h==="x"?"y":"x",$=o[h]===l[j],C=c[j]>d[j],O=c[j]=W?(y=(I.x+D.x)/2,v=m[0].y):(y=m[0].x,v=(I.y+D.y)/2)}const N={x:c.x+g.x,y:c.y+g.y},T={x:d.x+E.x,y:d.y+E.y};return[[e,...N.x!==m[0].x||N.y!==m[0].y?[N]:[],...m,...T.x!==m[m.length-1].x||T.y!==m[m.length-1].y?[T]:[],n],y,v,b,w]}function $ie(e,t,n,r){const i=Math.min(HN(e,t)/2,HN(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){const c=e.xn.id===t):e[0])||null}function h1(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function zie(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){const c=h1(l,t);s.has(c)||(a.push({id:c,color:l.color||n,...l}),s.add(c))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const E3=1e3,Vie=10,mx={nodeOrigin:[0,0],nodeExtent:Fu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Kie={...mx,checkEquality:!0};function gx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Yie(e,t,n){const r=gx(mx,n);for(const i of e.values())if(i.parentId)bx(i,e,t,r);else{const s=_d(i,r.nodeOrigin),a=$a(i.extent)?i.extent:r.nodeExtent,o=Ua(s,a,ls(i));i.internals.positionAbsolute=o}}function Wie(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const s={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(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function yx(e){return e==="manual"}function p1(e,t,n,r={}){var d,f;const i=gx(Kie,r),s={i:0},a=new Map(t),o=i!=null&&i.elevateNodesOnSelect&&!yx(i.zIndexMode)?E3:0;let l=e.length>0,c=!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=_d(h,i.nodeOrigin),y=$a(h.extent)?h.extent:i.nodeExtent,v=Ua(m,y,ls(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:Wie(h,p),z:x3(h,o,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&&(l=!1),h.parentId&&bx(p,t,n,r,s),c||(c=h.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:c}}function qie(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 bx(e,t,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:o,zIndexMode:l}=gx(mx,r),c=e.parentId,d=t.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}qie(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*Vie),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);const f=s&&!yx(l)?E3:0,{x:h,y:p,z:m}=Gie(e,d,a,o,f,l),{positionAbsolute:y}=e.internals,v=h!==y.x||p!==y.y;(v||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:h,y:p}:y,z:m}})}function x3(e,t,n){const r=li(e.zIndex)?e.zIndex:0;return yx(n)?r:r+(e.selected?t:0)}function Gie(e,t,n,r,i,s){const{x:a,y:o}=t.internals.positionAbsolute,l=ls(e),c=_d(e,n),d=$a(e.extent)?Ua(c,e.extent,l):c;let f=Ua({x:a+d.x,y:o+d.y},r,l);e.extent==="parent"&&(f=o3(f,l,t));const h=x3(e,i,s),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}function Ex(e,t,n,r=[0,0]){var a;const i=[],s=new Map;for(const o of e){const l=t.get(o.parentId);if(!l)continue;const c=((a=s.get(o.parentId))==null?void 0:a.expandedRect)??El(l),d=l3(c,o.rect);s.set(o.parentId,{expandedRect:d,parent:l})}return s.size>0&&s.forEach(({expandedRect:o,parent:l},c)=>{var b;const d=l.internals.positionAbsolute,f=ls(l),h=l.origin??r,p=o.x0||m>0||g||E)&&(i.push({id:c,type:"position",position:{x:l.position.x-p+g,y:l.position.y-m+E}}),(b=n.get(c))==null||b.forEach(w=>{e.some(N=>N.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=Ex(h,t,n,i);c.push(...p)}return{changes:c,updatedInternals:l}}async function Qie({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){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,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}function YN(e,t,n,r,i,s){let a=i;const o=r.get(a)||new Map;r.set(a,o.set(n,t)),a=`${i}-${e}`;const l=r.get(a)||new Map;if(r.set(a,l.set(n,t)),s){a=`${i}-${e}-${s}`;const c=r.get(a)||new Map;r.set(a,c.set(n,t))}}function v3(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:a=null,targetHandle:o=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:o},c=`${i}-${a}--${s}-${o}`,d=`${s}-${o}--${i}-${a}`;YN("source",l,d,e,i,a),YN("target",l,c,e,s,o),t.set(r.id,r)}}function w3(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:w3(n,t):!1}function WN(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Zie(e,t,n,r){const i=new Map;for(const[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!w3(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){const o=e.get(s);o&&i.set(s,{id:s,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return i}function r0({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var a,o,l;const i=[];for(const[c,d]of t){const f=(a=n.get(c))==null?void 0:a.internals.userNode;f&&i.push({...f,position:d.position,dragging:r})}if(!e)return[i[0],i];const s=(o=n.get(e))==null?void 0:o.internals.userNode;return[s?{...s,position:((l=t.get(e))==null?void 0:l.position)||s.position,dragging:r}:i[0],i]}function Jie({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},a=Nd(s,t);return{x:a.x-s.x,y:a.y-s.y}}function ese({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,o=new Map,l=!1,c={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,y=null;function v({noDragClassName:E,handleSelector:b,domNode:w,isSelectable:N,nodeId:T,nodeClickDistance:A=0}){h=Ar(w);function S({x:F,y:W}){const{nodeLookup:j,nodeExtent:$,snapGrid:C,snapToGrid:O,nodeOrigin:L,onNodeDrag:M,onSelectionDrag:k,onError:Y,updateNodePositions:G}=t();s={x:F,y:W};let P=!1;const V=o.size>1,Q=V&&$?d1(Td(o)):null,ne=V&&O?Jie({dragItems:o,snapGrid:C,x:F,y:W}):null;for(const[le,K]of o){if(!j.has(le))continue;let q={x:F-K.distance.x,y:W-K.distance.y};O&&(q=ne?{x:Math.round(q.x+ne.x),y:Math.round(q.y+ne.y)}:Nd(q,C));let ae=null;if(V&&$&&!K.extent&&Q){const{positionAbsolute:de}=K.internals,Ie=de.x-Q.x+$[0][0],_e=de.x+K.measured.width-Q.x2+$[1][0],xe=de.y-Q.y+$[0][1],je=de.y+K.measured.height-Q.y2+$[1][1];ae=[[Ie,xe],[_e,je]]}const{position:ye,positionAbsolute:he}=a3({nodeId:le,nextPosition:q,nodeLookup:j,nodeExtent:ae||$,nodeOrigin:L,onError:Y});P=P||K.position.x!==ye.x||K.position.y!==ye.y,K.position=ye,K.internals.positionAbsolute=he}if(m=m||P,!!P&&(G(o,!0),y&&(r||M||!T&&k))){const[le,K]=r0({nodeId:T,dragItems:o,nodeLookup:j});r==null||r(y,o,le,K),M==null||M(y,le,K),T||k==null||k(y,K)}}async function R(){if(!d)return;const{transform:F,panBy:W,autoPanSpeed:j,autoPanOnNodeDrag:$}=t();if(!$){l=!1,cancelAnimationFrame(a);return}const[C,O]=fx(c,d,j);(C!==0||O!==0)&&(s.x=(s.x??0)-C/F[2],s.y=(s.y??0)-O/F[2],await W({x:C,y:O})&&S(s)),a=requestAnimationFrame(R)}function I(F){var V;const{nodeLookup:W,multiSelectionActive:j,nodesDraggable:$,transform:C,snapGrid:O,snapToGrid:L,selectNodesOnDrag:M,onNodeDragStart:k,onSelectionDragStart:Y,unselectNodesAndEdges:G}=t();f=!0,(!M||!N)&&!j&&T&&((V=W.get(T))!=null&&V.selected||G()),N&&M&&T&&(e==null||e(T));const P=tu(F.sourceEvent,{transform:C,snapGrid:O,snapToGrid:L,containerBounds:d});if(s=P,o=Zie(W,$,P,T),o.size>0&&(n||k||!T&&Y)){const[Q,ne]=r0({nodeId:T,dragItems:o,nodeLookup:W});n==null||n(F.sourceEvent,o,Q,ne),k==null||k(F.sourceEvent,Q,ne),T||Y==null||Y(F.sourceEvent,ne)}}const D=FM().clickDistance(A).on("start",F=>{const{domNode:W,nodeDragThreshold:j,transform:$,snapGrid:C,snapToGrid:O}=t();d=(W==null?void 0:W.getBoundingClientRect())||null,p=!1,m=!1,y=F.sourceEvent,j===0&&I(F),s=tu(F.sourceEvent,{transform:$,snapGrid:C,snapToGrid:O,containerBounds:d}),c=ci(F.sourceEvent,d)}).on("drag",F=>{const{autoPanOnNodeDrag:W,transform:j,snapGrid:$,snapToGrid:C,nodeDragThreshold:O,nodeLookup:L}=t(),M=tu(F.sourceEvent,{transform:j,snapGrid:$,snapToGrid:C,containerBounds:d});if(y=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||T&&!L.has(T))&&(p=!0),!p){if(!l&&W&&f&&(l=!0,R()),!f){const k=ci(F.sourceEvent,d),Y=k.x-c.x,G=k.y-c.y;Math.sqrt(Y*Y+G*G)>O&&I(F)}(s.x!==M.xSnapped||s.y!==M.ySnapped)&&o&&f&&(c=ci(F.sourceEvent,d),S(M))}}).on("end",F=>{if(!f||p){p&&o.size>0&&t().updateNodePositions(o,!1);return}if(l=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:W,updateNodePositions:j,onNodeDragStop:$,onSelectionDragStop:C}=t();if(m&&(j(o,!1),m=!1),i||$||!T&&C){const[O,L]=r0({nodeId:T,dragItems:o,nodeLookup:W,dragging:!1});i==null||i(F.sourceEvent,o,O,L),$==null||$(F.sourceEvent,O,L),T||C==null||C(F.sourceEvent,L)}}}).filter(F=>{const W=F.target;return!F.button&&(!E||!WN(W,`.${E}`,w))&&(!b||WN(W,b,w))});h.call(D)}function g(){h==null||h.on(".drag",null)}return{update:v,destroy:g}}function tse(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())Hu(i,El(s))>0&&r.push(s);return r}const nse=250;function rse(e,t,n,r){var o,l;let i=[],s=1/0;const a=tse(e,n,t+nse);for(const c of a){const d=[...((o=c.internals.handleBounds)==null?void 0:o.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const f of d){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:p}=Ha(c,f,f.position,!0),m=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));m>t||(m1){const c=r.type==="source"?"target":"source";return i.find(d=>d.type===c)??i[0]}return i[0]}function _3(e,t,n,r,i,s=!1){var c,d,f;const a=r.get(e);if(!a)return null;const o=i==="strict"?(c=a.internals.handleBounds)==null?void 0:c[t]:[...((d=a.internals.handleBounds)==null?void 0:d.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],l=(n?o==null?void 0:o.find(h=>h.id===n):o==null?void 0:o[0])??null;return l&&s?{...l,...Ha(a,l,l.position,!0)}:l}function T3(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function ise(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const N3=()=>!0;function sse(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:o,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:y,onConnectEnd:v,isValidConnection:g=N3,onReconnectEnd:E,updateConnection:b,getTransform:w,getFromHandle:N,autoPanSpeed:T,dragThreshold:A=1,handleDomNode:S}){const R=f3(e.target);let I=0,D;const{x:F,y:W}=ci(e),j=T3(s,S),$=o==null?void 0:o.getBoundingClientRect();let C=!1;if(!$||!j)return;const O=_3(i,j,r,l,t);if(!O)return;let L=ci(e,$),M=!1,k=null,Y=!1,G=null;function P(){if(!d||!$)return;const[ye,he]=fx(L,$,T);h({x:ye,y:he}),I=requestAnimationFrame(P)}const V={...O,nodeId:i,type:j,position:O.position},Q=l.get(i);let le={inProgress:!0,isValid:null,from:Ha(Q,V,Oe.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:Q,to:L,toHandle:null,toPosition:DN[V.position],toNode:null,pointer:L};function K(){C=!0,b(le),m==null||m(e,{nodeId:i,handleId:r,handleType:j})}A===0&&K();function q(ye){if(!C){const{x:je,y:be}=ci(ye),Ve=je-F,ke=be-W;if(!(Ve*Ve+ke*ke>A*A))return;K()}if(!N()||!V){ae(ye);return}const he=w();L=ci(ye,$),D=rse(Hl(L,he,!1,[1,1]),n,l,V),M||(P(),M=!0);const de=S3(ye,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:g,doc:R,lib:c,flowId:f,nodeLookup:l});G=de.handleDomNode,k=de.connection,Y=ise(!!D,de.isValid);const Ie=l.get(i),_e=Ie?Ha(Ie,V,Oe.Left,!0):le.from,xe={...le,from:_e,isValid:Y,to:de.toHandle&&Y?xl({x:de.toHandle.x,y:de.toHandle.y},he):L,toHandle:de.toHandle,toPosition:Y&&de.toHandle?de.toHandle.position:DN[V.position],toNode:de.toHandle?l.get(de.toHandle.nodeId):null,pointer:L};b(xe),le=xe}function ae(ye){if(!("touches"in ye&&ye.touches.length>0)){if(C){(D||G)&&k&&Y&&(y==null||y(k));const{inProgress:he,...de}=le,Ie={...de,toPosition:le.toHandle?le.toPosition:null};v==null||v(ye,Ie),s&&(E==null||E(ye,Ie))}p(),cancelAnimationFrame(I),M=!1,Y=!1,k=null,G=null,R.removeEventListener("mousemove",q),R.removeEventListener("mouseup",ae),R.removeEventListener("touchmove",q),R.removeEventListener("touchend",ae)}}R.addEventListener("mousemove",q),R.addEventListener("mouseup",ae),R.addEventListener("touchmove",q),R.addEventListener("touchend",ae)}function S3(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:o,flowId:l,isValidConnection:c=N3,nodeLookup:d}){const f=s==="target",h=t?a.querySelector(`.${o}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=ci(e),y=a.elementFromPoint(p,m),v=y!=null&&y.classList.contains(`${o}-flow__handle`)?y:h,g={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const E=T3(void 0,v),b=v.getAttribute("data-nodeid"),w=v.getAttribute("data-handleid"),N=v.classList.contains("connectable"),T=v.classList.contains("connectableend");if(!b||!E)return g;const A={source:f?b:r,sourceHandle:f?w:i,target:f?r:b,targetHandle:f?i:w};g.connection=A;const R=N&&T&&(n===yl.Strict?f&&E==="source"||!f&&E==="target":b!==r||w!==i);g.isValid=R&&c(A),g.toHandle=_3(b,E,w,d,n,!0)}return g}const m1={onPointerDown:sse,isValid:S3};function ase({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=Ar(e);function s({translateExtent:o,width:l,height:c,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){const m=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const w=n(),N=b.sourceEvent.ctrlKey&&zu()?10:1,T=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,A=w[2]*Math.pow(2,T*N);t.scaleTo(A)};let y=[0,0];const v=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(y=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},g=b=>{const w=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const N=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],T=[N[0]-y[0],N[1]-y[1]];y=N;const A=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),S={x:w[0]-T[0]*A,y:w[1]-T[1]*A},R=[[0,0],[l,c]];t.setViewportConstrained({x:S.x,y:S.y,zoom:w[2]},R,o)},E=e3().on("start",v).on("zoom",f?g:null).on("zoom.wheel",h?m:null);i.call(E,{})}function a(){i.on("zoom",null)}return{update:s,destroy:a,pointer:si}}const xm=e=>({x:e.x,y:e.y,zoom:e.k}),i0=({x:e,y:t,zoom:n})=>ym.translate(e,t).scale(n),Mo=(e,t)=>e.target.closest(`.${t}`),k3=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),ose=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,s0=(e,t=0,n=ose,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},A3=e=>{const t=e.ctrlKey&&zu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function lse({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(Mo(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=si(d),g=A3(d),E=f*Math.pow(2,g);r.scaleTo(n,E,v,d);return}const h=d.deltaMode===1?20:1;let p=i===ka.Vertical?0:d.deltaX*h,m=i===ka.Horizontal?0:d.deltaY*h;!zu()&&d.shiftKey&&i!==ka.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*s,-(m/f)*s,{internal:!0});const y=xm(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(d,y),e.panScrollTimeout=setTimeout(()=>{c==null||c(d,y),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(d,y))}}function cse({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,o=Mo(r,e);if(r.ctrlKey&&s&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),n.call(this,r,i)}}function use({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,a,o;if((s=r.sourceEvent)!=null&&s.internal)return;const i=xm(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function dse({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var a,o;e.usedRightMouseButton=!!(n&&k3(t,e.mouseButton??0)),(a=s.sourceEvent)!=null&&a.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((o=s.sourceEvent)!=null&&o.internal)&&(i==null||i(s.sourceEvent,xm(s.transform)))}}function fse({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,s&&k3(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const l=xm(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(a.sourceEvent,l)},n?150:0)}}}function hse({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:o,noPanClassName:l,lib:c,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"&&(Mo(f,`${c}-flow__node`)||Mo(f,`${c}-flow__edge`)))return!0;if(!r&&!h&&!i&&!s&&!n||a||d&&!m||Mo(f,o)&&m||Mo(f,l)&&(!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||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const y=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&y}}function pse({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=e3().scaleExtent([t,n]).translateExtent(r),h=Ar(e).call(f);E({x:i.x,y:i.y,zoom:bl(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);const p=h.on("wheel.zoom"),m=h.on("dblclick.zoom");f.wheelDelta(A3);async function y(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?eu:ih).transform(s0(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}function v({noWheelClassName:D,noPanClassName:F,onPaneContextMenu:W,userSelectionActive:j,panOnScroll:$,panOnDrag:C,panOnScrollMode:O,panOnScrollSpeed:L,preventScrolling:M,zoomOnPinch:k,zoomOnScroll:Y,zoomOnDoubleClick:G,zoomActivationKeyPressed:P,lib:V,onTransformChange:Q,connectionInProgress:ne,paneClickDistance:le,selectionOnDrag:K}){j&&!c.isZoomingOrPanning&&g();const q=$&&!P&&!j;f.clickDistance(K?1/0:!li(le)||le<0?0:le);const ae=q?lse({zoomPanValues:c,noWheelClassName:D,d3Selection:h,d3Zoom:f,panOnScrollMode:O,panOnScrollSpeed:L,zoomOnPinch:k,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:o}):cse({noWheelClassName:D,preventScrolling:M,d3ZoomHandler:p});h.on("wheel.zoom",ae,{passive:!1});const ye=use({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:a});f.on("start",ye);const he=dse({zoomPanValues:c,panOnDrag:C,onPaneContextMenu:!!W,onPanZoom:s,onTransformChange:Q});f.on("zoom",he);const de=fse({zoomPanValues:c,panOnDrag:C,panOnScroll:$,onPaneContextMenu:W,onPanZoomEnd:o,onDraggingChange:l});f.on("end",de);const Ie=hse({zoomActivationKeyPressed:P,panOnDrag:C,zoomOnScroll:Y,panOnScroll:$,zoomOnDoubleClick:G,zoomOnPinch:k,userSelectionActive:j,noPanClassName:F,noWheelClassName:D,lib:V,connectionInProgress:ne});f.filter(Ie),G?h.on("dblclick.zoom",m):h.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function E(D,F,W){const j=i0(D),$=f==null?void 0:f.constrain()(j,F,W);return $&&await y($),$}async function b(D,F){const W=i0(D);return await y(W,F),W}function w(D){if(h){const F=i0(D),W=h.property("__zoom");(W.k!==D.zoom||W.x!==D.x||W.y!==D.y)&&(f==null||f.transform(h,F,null,{sync:!0}))}}function N(){const D=h?JM(h.node()):{x:0,y:0,k:1};return{x:D.x,y:D.y,zoom:D.k}}async function T(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?eu:ih).scaleTo(s0(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}async function A(D,F){return h?new Promise(W=>{f==null||f.interpolate((F==null?void 0:F.interpolate)==="linear"?eu:ih).scaleBy(s0(h,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>W(!0)),D)}):!1}function S(D){f==null||f.scaleExtent(D)}function R(D){f==null||f.translateExtent(D)}function I(D){const F=!li(D)||D<0?0:D;f==null||f.clickDistance(F)}return{update:v,destroy:g,setViewport:b,setViewportConstrained:E,getViewport:N,scaleTo:T,scaleBy:A,setScaleExtent:S,setTranslateExtent:R,syncViewport:w,setClickDistance:I}}var vl;(function(e){e.Line="line",e.Handle="handle"})(vl||(vl={}));function mse({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const a=e-t,o=n-r,l=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&i&&(l[0]=l[0]*-1),o&&s&&(l[1]=l[1]*-1),l}function qN(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function hs(e,t){return Math.max(0,t-e)}function ps(e,t){return Math.max(0,e-t)}function Nf(e,t,n){return Math.max(0,t-e,e-n)}function GN(e,t){return e?!t:t}function gse(e,t,n,r,i,s,a,o){let{affectsX:l,affectsY:c}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:y,maxWidth:v,minHeight:g,maxHeight:E}=r,{x:b,y:w,width:N,height:T,aspectRatio:A}=e;let S=Math.floor(d?p-e.pointerX:0),R=Math.floor(f?m-e.pointerY:0);const I=N+(l?-S:S),D=T+(c?-R:R),F=-s[0]*N,W=-s[1]*T;let j=Nf(I,y,v),$=Nf(D,g,E);if(a){let L=0,M=0;l&&S<0?L=hs(b+S+F,a[0][0]):!l&&S>0&&(L=ps(b+I+F,a[1][0])),c&&R<0?M=hs(w+R+W,a[0][1]):!c&&R>0&&(M=ps(w+D+W,a[1][1])),j=Math.max(j,L),$=Math.max($,M)}if(o){let L=0,M=0;l&&S>0?L=ps(b+S,o[0][0]):!l&&S<0&&(L=hs(b+I,o[1][0])),c&&R>0?M=ps(w+R,o[0][1]):!c&&R<0&&(M=hs(w+D,o[1][1])),j=Math.max(j,L),$=Math.max($,M)}if(i){if(d){const L=Nf(I/A,g,E)*A;if(j=Math.max(j,L),a){let M=0;!l&&!c||l&&!c&&h?M=ps(w+W+I/A,a[1][1])*A:M=hs(w+W+(l?S:-S)/A,a[0][1])*A,j=Math.max(j,M)}if(o){let M=0;!l&&!c||l&&!c&&h?M=hs(w+I/A,o[1][1])*A:M=ps(w+(l?S:-S)/A,o[0][1])*A,j=Math.max(j,M)}}if(f){const L=Nf(D*A,y,v)/A;if($=Math.max($,L),a){let M=0;!l&&!c||c&&!l&&h?M=ps(b+D*A+F,a[1][0])/A:M=hs(b+(c?R:-R)*A+F,a[0][0])/A,$=Math.max($,M)}if(o){let M=0;!l&&!c||c&&!l&&h?M=hs(b+D*A,o[1][0])/A:M=ps(b+(c?R:-R)*A,o[0][0])/A,$=Math.max($,M)}}}R=R+(R<0?$:-$),S=S+(S<0?j:-j),i&&(h?I>D*A?R=(GN(l,c)?-S:S)/A:S=(GN(l,c)?-R:R)*A:d?(R=S/A,c=l):(S=R*A,l=c));const C=l?b+S:b,O=c?w+R:w;return{width:N+(l?-S:S),height:T+(c?-R:R),x:s[0]*S*(l?-1:1)+C,y:s[1]*R*(c?-1:1)+O}}const C3={width:0,height:0,x:0,y:0},yse={...C3,pointerX:0,pointerY:0,aspectRatio:1};function bse(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,o=n[0]*s,l=n[1]*a;return[[r-o,i-l],[r+s-o,i+a-l]]}function Ese({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=Ar(e);let a={controlDirection:qN("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:c,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:y,shouldResize:v}){let g={...C3},E={...yse};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:qN(c)};let b,w=null,N=[],T,A,S,R=!1;const I=FM().on("start",D=>{const{nodeLookup:F,transform:W,snapGrid:j,snapToGrid:$,nodeOrigin:C,paneDomNode:O}=n();if(b=F.get(t),!b)return;w=(O==null?void 0:O.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:M}=tu(D.sourceEvent,{transform:W,snapGrid:j,snapToGrid:$,containerBounds:w});g={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},E={...g,pointerX:L,pointerY:M,aspectRatio:g.width/g.height},T=void 0,A=$a(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(T=F.get(b.parentId)),T&&b.extent==="parent"&&(A=[[0,0],[T.measured.width,T.measured.height]]),N=[],S=void 0;for(const[k,Y]of F)if(Y.parentId===t&&(N.push({id:k,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const G=bse(Y,b,Y.origin??C);S?S=[[Math.min(G[0][0],S[0][0]),Math.min(G[0][1],S[0][1])],[Math.max(G[1][0],S[1][0]),Math.max(G[1][1],S[1][1])]]:S=G}p==null||p(D,{...g})}).on("drag",D=>{const{transform:F,snapGrid:W,snapToGrid:j,nodeOrigin:$}=n(),C=tu(D.sourceEvent,{transform:F,snapGrid:W,snapToGrid:j,containerBounds:w}),O=[];if(!b)return;const{x:L,y:M,width:k,height:Y}=g,G={},P=b.origin??$,{width:V,height:Q,x:ne,y:le}=gse(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,P,A,S),K=V!==k,q=Q!==Y,ae=ne!==L&&K,ye=le!==M&&q;if(!ae&&!ye&&!K&&!q)return;if((ae||ye||P[0]===1||P[1]===1)&&(G.x=ae?ne:g.x,G.y=ye?le:g.y,g.x=G.x,g.y=G.y,N.length>0)){const _e=ne-L,xe=le-M;for(const je of N)je.position={x:je.position.x-_e+P[0]*(V-k),y:je.position.y-xe+P[1]*(Q-Y)},O.push(je)}if((K||q)&&(G.width=K&&(!a.resizeDirection||a.resizeDirection==="horizontal")?V:g.width,G.height=q&&(!a.resizeDirection||a.resizeDirection==="vertical")?Q:g.height,g.width=G.width,g.height=G.height),T&&b.expandParent){const _e=P[0]*(G.width??0);G.x&&G.x<_e&&(g.x=_e,E.x=E.x-(G.x-_e));const xe=P[1]*(G.height??0);G.y&&G.y{R&&(y==null||y(D,{...g}),i==null||i({...g}),R=!1)});s.call(I)}function l(){s.on(".drag",null)}return{update:o,destroy:l}}var I3={exports:{}},R3={},O3={exports:{}},L3={};/** * @license React * use-sync-external-store-shim.production.js * @@ -671,7 +671,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yl=_;function mse(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gse=typeof Object.is=="function"?Object.is:mse,yse=yl.useState,bse=yl.useEffect,Ese=yl.useLayoutEffect,xse=yl.useDebugValue;function vse(e,t){var n=t(),r=yse({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return Ese(function(){i.value=n,i.getSnapshot=t,s0(i)&&s({inst:i})},[e,n,t]),bse(function(){return s0(i)&&s({inst:i}),e(function(){s0(i)&&s({inst:i})})},[e]),xse(n),n}function s0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gse(e,n)}catch{return!0}}function wse(e,t){return t()}var _se=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?wse:vse;k3.useSyncExternalStore=yl.useSyncExternalStore!==void 0?yl.useSyncExternalStore:_se;S3.exports=k3;var Tse=S3.exports;/** + */var wl=_;function xse(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vse=typeof Object.is=="function"?Object.is:xse,wse=wl.useState,_se=wl.useEffect,Tse=wl.useLayoutEffect,Nse=wl.useDebugValue;function Sse(e,t){var n=t(),r=wse({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return Tse(function(){i.value=n,i.getSnapshot=t,a0(i)&&s({inst:i})},[e,n,t]),_se(function(){return a0(i)&&s({inst:i}),e(function(){a0(i)&&s({inst:i})})},[e]),Nse(n),n}function a0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vse(e,n)}catch{return!0}}function kse(e,t){return t()}var Ase=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?kse:Sse;L3.useSyncExternalStore=wl.useSyncExternalStore!==void 0?wl.useSyncExternalStore:Ase;O3.exports=L3;var Cse=O3.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -679,11 +679,11 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xm=_,Nse=Tse;function Sse(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kse=typeof Object.is=="function"?Object.is:Sse,Ase=Nse.useSyncExternalStore,Cse=xm.useRef,Ise=xm.useEffect,Ose=xm.useMemo,Rse=xm.useDebugValue;N3.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=Cse(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=Ose(function(){function l(p){if(!c){if(c=!0,d=p,p=r(p),i!==void 0&&a.hasValue){var m=a.value;if(i(m,p))return f=m}return f=p}if(m=f,kse(d,p))return m;var y=r(p);return i!==void 0&&i(m,y)?(d=p,m):(d=p,f=y)}var c=!1,d,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,i]);var o=Ase(e,s[0],s[1]);return Ise(function(){a.hasValue=!0,a.value=o},[o]),Rse(o),o};T3.exports=N3;var Lse=T3.exports;const Mse=Uu(Lse),Dse={},qN=e=>{let t;const n=new Set,r=(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,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Dse?"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()}},c=t=e(r,i,l);return l},Pse=e=>e?qN(e):qN,{useDebugValue:jse}=Qe,{useSyncExternalStoreWithSelector:Bse}=Mse,Fse=e=>e;function A3(e,t=Fse,n){const r=Bse(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return jse(r),r}const GN=(e,t)=>{const n=Pse(e),r=(i,s=t)=>A3(n,i,s);return Object.assign(r,n),r},Use=(e,t)=>e?GN(e,t):GN;function Vt(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[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const vm=_.createContext(null),$se=vm.Provider,C3=ci.error001("react");function dt(e,t){const n=_.useContext(vm);if(n===null)throw new Error(C3);return A3(n,e,t)}function Kt(){const e=_.useContext(vm);if(e===null)throw new Error(C3);return _.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const XN={display:"none"},Hse={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},I3="react-flow__node-desc",O3="react-flow__edge-desc",zse="react-flow__aria-live",Vse=e=>e.ariaLiveMessage,Kse=e=>e.ariaLabelConfig;function Yse({rfId:e}){const t=dt(Vse);return u.jsx("div",{id:`${zse}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Hse,children:t})}function Wse({rfId:e,disableKeyboardA11y:t}){const n=dt(Kse);return u.jsxs(u.Fragment,{children:[u.jsx("div",{id:`${I3}-${e}`,style:XN,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),u.jsx("div",{id:`${O3}-${e}`,style:XN,children:n["edge.a11yDescription.default"]}),!t&&u.jsx(Yse,{rfId:e})]})}const wm=_.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const a=`${e}`.split("-");return u.jsx("div",{className:En(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});wm.displayName="Panel";function qse({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(wm,{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:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Gse=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Tf=e=>e.id;function Xse(e,t){return Vt(e.selectedNodes.map(Tf),t.selectedNodes.map(Tf))&&Vt(e.selectedEdges.map(Tf),t.selectedEdges.map(Tf))}function Qse({onSelectionChange:e}){const t=Kt(),{selectedNodes:n,selectedEdges:r}=dt(Gse,Xse);return _.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}const Zse=e=>!!e.onSelectionChangeHandlers;function Jse({onSelectionChange:e}){const t=dt(Zse);return e||t?u.jsx(Qse,{onSelectionChange:e}):null}const R3=[0,0],eae={x:0,y:0,zoom:1},tae=["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"],QN=[...tae,"rfId"],nae=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}),ZN={translateExtent:Mu,nodeOrigin:R3,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function rae(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=dt(nae,Vt),c=Kt();_.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=ZN,o()}),[]);const d=_.useRef(ZN);return _.useEffect(()=>{for(const f of QN){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:kie(h)}):f==="fitView"?c.setState({fitViewQueued:h}):f==="fitViewOptions"?c.setState({fitViewOptions:h}):c.setState({[f]:h})))}d.current=e},QN.map(f=>e[f])),null}function JN(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function iae(e){var r;const[t,n]=_.useState(e==="system"?null:e);return _.useEffect(()=>{if(e!=="system"){n(e);return}const i=JN(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[e]),t!==null?t:(r=JN())!=null&&r.matches?"dark":"light"}const eS=typeof document<"u"?document:null;function Fu(e=null,t={target:eS,actInsideInputWithModifier:!0}){const[n,r]=_.useState(!1),i=_.useRef(!1),s=_.useRef(new Set([])),[a,o]=_.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` + */var vm=_,Ise=Cse;function Rse(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ose=typeof Object.is=="function"?Object.is:Rse,Lse=Ise.useSyncExternalStore,Mse=vm.useRef,Dse=vm.useEffect,Pse=vm.useMemo,jse=vm.useDebugValue;R3.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=Mse(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=Pse(function(){function l(p){if(!c){if(c=!0,d=p,p=r(p),i!==void 0&&a.hasValue){var m=a.value;if(i(m,p))return f=m}return f=p}if(m=f,Ose(d,p))return m;var y=r(p);return i!==void 0&&i(m,y)?(d=p,m):(d=p,f=y)}var c=!1,d,f,h=n===void 0?null:n;return[function(){return l(t())},h===null?void 0:function(){return l(h())}]},[t,n,r,i]);var o=Lse(e,s[0],s[1]);return Dse(function(){a.hasValue=!0,a.value=o},[o]),jse(o),o};I3.exports=R3;var Bse=I3.exports;const Fse=Ku(Bse),Use={},XN=e=>{let t;const n=new Set,r=(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,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Use?"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()}},c=t=e(r,i,l);return l},$se=e=>e?XN(e):XN,{useDebugValue:Hse}=qe,{useSyncExternalStoreWithSelector:zse}=Fse,Vse=e=>e;function M3(e,t=Vse,n){const r=zse(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Hse(r),r}const QN=(e,t)=>{const n=$se(e),r=(i,s=t)=>M3(n,i,s);return Object.assign(r,n),r},Kse=(e,t)=>e?QN(e,t):QN;function Ht(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[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const wm=_.createContext(null),Yse=wm.Provider,D3=mi.error001("react");function ct(e,t){const n=_.useContext(wm);if(n===null)throw new Error(D3);return M3(n,e,t)}function zt(){const e=_.useContext(wm);if(e===null)throw new Error(D3);return _.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ZN={display:"none"},Wse={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},P3="react-flow__node-desc",j3="react-flow__edge-desc",qse="react-flow__aria-live",Gse=e=>e.ariaLiveMessage,Xse=e=>e.ariaLabelConfig;function Qse({rfId:e}){const t=ct(Gse);return u.jsx("div",{id:`${qse}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Wse,children:t})}function Zse({rfId:e,disableKeyboardA11y:t}){const n=ct(Xse);return u.jsxs(u.Fragment,{children:[u.jsx("div",{id:`${P3}-${e}`,style:ZN,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),u.jsx("div",{id:`${j3}-${e}`,style:ZN,children:n["edge.a11yDescription.default"]}),!t&&u.jsx(Qse,{rfId:e})]})}const _m=_.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const a=`${e}`.split("-");return u.jsx("div",{className:xn(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});_m.displayName="Panel";function Jse({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(_m,{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:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const eae=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Sf=e=>e.id;function tae(e,t){return Ht(e.selectedNodes.map(Sf),t.selectedNodes.map(Sf))&&Ht(e.selectedEdges.map(Sf),t.selectedEdges.map(Sf))}function nae({onSelectionChange:e}){const t=zt(),{selectedNodes:n,selectedEdges:r}=ct(eae,tae);return _.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}const rae=e=>!!e.onSelectionChangeHandlers;function iae({onSelectionChange:e}){const t=ct(rae);return e||t?u.jsx(nae,{onSelectionChange:e}):null}const B3=[0,0],sae={x:0,y:0,zoom:1},aae=["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"],JN=[...aae,"rfId"],oae=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}),eS={translateExtent:Fu,nodeOrigin:B3,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function lae(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:l}=ct(oae,Ht),c=zt();_.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{d.current=eS,o()}),[]);const d=_.useRef(eS);return _.useEffect(()=>{for(const f of JN){const h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:Oie(h)}):f==="fitView"?c.setState({fitViewQueued:h}):f==="fitViewOptions"?c.setState({fitViewOptions:h}):c.setState({[f]:h})))}d.current=e},JN.map(f=>e[f])),null}function tS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function cae(e){var r;const[t,n]=_.useState(e==="system"?null:e);return _.useEffect(()=>{if(e!=="system"){n(e);return}const i=tS(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[e]),t!==null?t:(r=tS())!=null&&r.matches?"dark":"light"}const nS=typeof document<"u"?document:null;function Vu(e=null,t={target:nS,actInsideInputWithModifier:!0}){const[n,r]=_.useState(!1),i=_.useRef(!1),s=_.useRef(new Set([])),[a,o]=_.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` `).replace(` `,` +`).split(` -`)),d=c.reduce((f,h)=>f.concat(...h),[]);return[c,d]}return[[],[]]},[e]);return _.useEffect(()=>{const l=(t==null?void 0:t.target)??eS,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var v,g;if(i.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!i.current||i.current&&!c)&&o3(p))return!1;const y=nS(p.code,o);if(s.current.add(p[y]),tS(a,s.current,!1)){const E=((g=(v=p.composedPath)==null?void 0:v.call(p))==null?void 0:g[0])||p.target,b=(E==null?void 0:E.nodeName)==="BUTTON"||(E==null?void 0:E.nodeName)==="A";t.preventDefault!==!1&&(i.current||!b)&&p.preventDefault(),r(!0)}},f=p=>{const m=nS(p.code,o);tS(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(p[m]),p.key==="Meta"&&s.current.clear(),i.current=!1},h=()=>{s.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function tS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function nS(e,t){return t.includes(e)?"code":"key"}const sae=()=>{const e=Kt();return _.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:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:s,maxZoom:a,panZoom:o}=e.getState(),l=fx(t,r,i,s,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(l,{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:r,snapGrid:i,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),c={x:t.x-o,y:t.y-l},d=n.snapGrid??i,f=n.snapToGrid??s;return Pl(c,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:s}=r.getBoundingClientRect(),a=ml(t,n);return{x:a.x+i,y:a.y+s}}}),[])};function L3(e,t){const n=[],r=new Map,i=[];for(const s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(const s of t){const a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...s};for(const l of a)aae(l,o);n.push(o)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function aae(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 M3(e,t){return L3(e,t)}function D3(e,t){return L3(e,t)}function ra(e,t){return{id:e,type:"select",selected:t}}function Io(e,t=new Set,n=!1){const r=[];for(const[i,s]of e){const a=t.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(ra(s.id,a)))}return r}function rS({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const o=t.get(a.id),l=((i=o==null?void 0:o.internals)==null?void 0:i.userNode)??o;l!==void 0&&l!==a&&n.push({id:a.id,item:a,type:"replace"}),l===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function iS(e){return{id:e.id,type:"remove"}}const oae=r3();function P3(e,t,n={}){return Lie(e,t,{...n,onError:n.onError??oae})}const sS=e=>bie(e),lae=e=>JM(e);function j3(e){return _.forwardRef(e)}const cae=typeof window<"u"?_.useLayoutEffect:_.useEffect;function aS(e){const[t,n]=_.useState(BigInt(0)),[r]=_.useState(()=>uae(()=>n(i=>i+BigInt(1))));return cae(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function uae(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const B3=_.createContext(null);function dae({children:e}){const t=Kt(),n=_.useCallback(o=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let y=l;for(const g of o)y=typeof g=="function"?g(y):g;let v=rS({items:y,lookup:h});for(const g of m.values())v=g(v);d&&c(y),v.length>0?f==null||f(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:E,setNodes:b}=t.getState();g&&b(E)})},[]),r=aS(n),i=_.useCallback(o=>{const{edges:l=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=l;for(const m of o)p=typeof m=="function"?m(p):m;d?c(p):f&&f(rS({items:p,lookup:h}))},[]),s=aS(i),a=_.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return u.jsx(B3.Provider,{value:a,children:e})}function fae(){const e=_.useContext(B3);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const hae=e=>!!e.panZoom;function Ex(){const e=sae(),t=Kt(),n=fae(),r=dt(hae),i=_.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},l=f=>{var g,E;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=sS(f)?f:h.get(f.id),y=m.parentId?s3(m.position,m.measured,m.parentId,h,p):m.position,v={...m,position:y,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((E=m.measured)==null?void 0:E.height)??m.height};return pl(v)},c=(f,h,p={replace:!1})=>{a(m=>m.map(y=>{if(y.id===f){const v=typeof h=="function"?h(y):h;return p.replace&&sS(v)?v:{...y,...v}}return y}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(y=>{if(y.id===f){const v=typeof h=="function"?h(y):h;return p.replace&&lae(v)?v:{...y,...v}}return y}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:o,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,y,v]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:y,onEdgesDelete:v,triggerNodeChanges:g,triggerEdgeChanges:E,onDelete:b,onBeforeDelete:w}=t.getState(),{nodes:N,edges:T}=await _ie({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:w}),A=T.length>0,S=N.length>0;if(A){const O=T.map(iS);v==null||v(T),E(O)}if(S){const O=N.map(iS);y==null||y(N),g(O)}return(S||A)&&(b==null||b({nodes:N,edges:T})),{deletedNodes:N,deletedEdges:T}},getIntersectingNodes:(f,h=!0,p)=>{const m=DN(f),y=m?f:l(f),v=p!==void 0;return y?(p||t.getState().nodes).filter(g=>{const E=t.getState().nodeLookup.get(g.id);if(E&&!m&&(g.id===f.id||!E.internals.positionAbsolute))return!1;const b=pl(v?g:E),w=ju(b,y);return h&&w>0||w>=b.width*b.height||w>=y.width*y.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const y=DN(f)?f:l(f);if(!y)return!1;const v=ju(y,h);return p&&v>0||v>=h.width*h.height||v>=y.width*y.height},updateNode:c,updateNodeData:(f,h,p={replace:!1})=>{c(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Eie(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??Sie();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return _.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const oS=e=>e.selected,pae=typeof window<"u"?window:void 0;function mae({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Kt(),{deleteElements:r}=Ex(),i=Fu(e,{actInsideInputWithModifier:!1}),s=Fu(t,{target:pae});_.useEffect(()=>{if(i){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(oS),edges:a.filter(oS)}),n.setState({nodesSelectionActive:!1})}},[i]),_.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function gae(e){const t=Kt();_.useEffect(()=>{const n=()=>{var i,s,a,o;if(!e.current||!(((s=(i=e.current).checkVisibility)==null?void 0:s.call(i))??!0))return!1;const r=hx(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",ci.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const _m={position:"absolute",width:"100%",height:"100%",top:0,left:0},yae=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bae({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=va.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:c,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:v,onViewportChange:g,isControlledViewport:E,paneClickDistance:b,selectionOnDrag:w}){const N=Kt(),T=_.useRef(null),{userSelectionActive:A,lib:S,connectionInProgress:O}=dt(yae,Vt),I=Fu(h),D=_.useRef();gae(T);const F=_.useCallback(W=>{g==null||g({x:W[0],y:W[1],zoom:W[2]}),E||N.setState({transform:W})},[g,E]);return _.useEffect(()=>{if(T.current){D.current=cse({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:c,viewport:l,onDraggingChange:C=>N.setState(R=>R.paneDragging===C?R:{paneDragging:C}),onPanZoomStart:(C,R)=>{const{onViewportChangeStart:L,onMoveStart:M}=N.getState();M==null||M(C,R),L==null||L(R)},onPanZoom:(C,R)=>{const{onViewportChange:L,onMove:M}=N.getState();M==null||M(C,R),L==null||L(R)},onPanZoomEnd:(C,R)=>{const{onViewportChangeEnd:L,onMoveEnd:M}=N.getState();M==null||M(C,R),L==null||L(R)}});const{x:W,y:j,zoom:$}=D.current.getViewport();return N.setState({panZoom:D.current,transform:[W,j,$],domNode:T.current.closest(".react-flow")}),()=>{var C;(C=D.current)==null||C.destroy()}}},[]),_.useEffect(()=>{var W;(W=D.current)==null||W.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:v,userSelectionActive:A,noWheelClassName:y,lib:S,onTransformChange:F,connectionInProgress:O,selectionOnDrag:w,paneClickDistance:b})},[e,t,n,r,i,s,a,o,I,p,v,A,y,S,F,O,w,b]),u.jsx("div",{className:"react-flow__renderer",ref:T,style:_m,children:m})}const Eae=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function xae(){const{userSelectionActive:e,userSelectionRect:t}=dt(Eae,Vt);return e&&t?u.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 a0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},vae=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function wae({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Du.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const v=_.useRef(0),g=Kt(),{userSelectionActive:E,elementsSelectable:b,dragging:w,connectionInProgress:N,panBy:T,autoPanSpeed:A}=dt(vae,Vt),S=b&&(e||E),O=_.useRef(null),I=_.useRef(),D=_.useRef(new Set),F=_.useRef(new Set),W=_.useRef(!1),j=_.useRef({x:0,y:0}),$=_.useRef(!1),C=K=>{if(W.current||N){W.current=!1;return}c==null||c(K),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},R=K=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){K.preventDefault();return}d==null||d(K)},L=f?K=>f(K):void 0,M=K=>{W.current&&(K.stopPropagation(),W.current=!1)},k=K=>{var Pe,be;const{domNode:q,transform:ae}=g.getState();if(I.current=q==null?void 0:q.getBoundingClientRect(),!I.current)return;const ge=K.target===O.current;if(!ge&&!!K.target.closest(".nokey")||!e||!(a&&ge||t)||K.button!==0||!K.isPrimary)return;(be=(Pe=K.target)==null?void 0:Pe.setPointerCapture)==null||be.call(Pe,K.pointerId),W.current=!1;const{x:Ie,y:_e}=ri(K.nativeEvent,I.current),Ee=Pl({x:Ie,y:_e},ae);g.setState({userSelectionRect:{width:0,height:0,startX:Ee.x,startY:Ee.y,x:Ie,y:_e}}),ge||(K.stopPropagation(),K.preventDefault())};function Y(K,q){const{userSelectionRect:ae}=g.getState();if(!ae)return;const{transform:ge,nodeLookup:he,edgeLookup:de,connectionLookup:Ie,triggerNodeChanges:_e,triggerEdgeChanges:Ee,defaultEdgeOptions:Pe}=g.getState(),be={x:ae.startX,y:ae.startY},{x:Ve,y:ke}=ml(be,ge),ce={startX:be.x,startY:be.y,x:Kst.id)),F.current=new Set;const wt=(Pe==null?void 0:Pe.selectable)??!0;for(const st of D.current){const z=Ie.get(st);if(z)for(const{edgeId:X}of z.values()){const oe=de.get(X);oe&&(oe.selectable??wt)&&F.current.add(X)}}if(!PN(It,D.current)){const st=Io(he,D.current,!0);_e(st)}if(!PN(Me,F.current)){const st=Io(de,F.current);Ee(st)}g.setState({userSelectionRect:ce,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!i||!I.current)return;const[K,q]=dx(j.current,I.current,A);T({x:K,y:q}).then(ae=>{if(!W.current||!ae){v.current=requestAnimationFrame(G);return}const{x:ge,y:he}=j.current;Y(ge,he),v.current=requestAnimationFrame(G)})}const P=()=>{cancelAnimationFrame(v.current),v.current=0,$.current=!1};_.useEffect(()=>()=>P(),[]);const V=K=>{const{userSelectionRect:q,transform:ae,resetSelectedElements:ge}=g.getState();if(!I.current||!q)return;const{x:he,y:de}=ri(K.nativeEvent,I.current);j.current={x:he,y:de};const Ie=ml({x:q.startX,y:q.startY},ae);if(!W.current){const _e=t?0:s;if(Math.hypot(he-Ie.x,de-Ie.y)<=_e)return;ge(),o==null||o(K)}W.current=!0,$.current||(G(),$.current=!0),Y(he,de)},Q=K=>{var q,ae;K.button===0&&((ae=(q=K.target)==null?void 0:q.releasePointerCapture)==null||ae.call(q,K.pointerId),!E&&K.target===O.current&&g.getState().userSelectionRect&&(C==null||C(K)),g.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(l==null||l(K),g.setState({nodesSelectionActive:D.current.size>0})),P())},re=K=>{var q,ae;(ae=(q=K.target)==null?void 0:q.releasePointerCapture)==null||ae.call(q,K.pointerId),P()},le=r===!0||Array.isArray(r)&&r.includes(0);return u.jsxs("div",{className:En(["react-flow__pane",{draggable:le,dragging:w,selection:e}]),onClick:S?void 0:a0(C,O),onContextMenu:a0(R,O),onWheel:a0(L,O),onPointerEnter:S?void 0:h,onPointerMove:S?V:p,onPointerUp:S?Q:void 0,onPointerCancel:S?re:void 0,onPointerDownCapture:S?k:void 0,onClickCapture:S?M:void 0,onPointerLeave:m,ref:O,style:_m,children:[y,u.jsx(xae,{})]})}function m1({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:o,onError:l}=t.getState(),c=o.get(e);if(!c){l==null||l("012",ci.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function F3({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){const o=Kt(),[l,c]=_.useState(!1),d=_.useRef();return _.useEffect(()=>{d.current=Gie({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{m1({id:f,store:o,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),_.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,r,t,s,e,i,a]),l}const _ae=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function U3(){const e=Kt();return _.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:c,nodeOrigin:d}=e.getState(),f=new Map,h=_ae(a),p=i?s[0]:5,m=i?s[1]:5,y=n.direction.x*p*n.factor,v=n.direction.y*m*n.factor;for(const[,g]of c){if(!h(g))continue;let E={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+v};i&&(E=xd(E,s));const{position:b,positionAbsolute:w}=e3({nodeId:g.id,nextPosition:E,nodeLookup:c,nodeExtent:r,nodeOrigin:d,onError:o});g.position=b,g.internals.positionAbsolute=w,f.set(g.id,g)}l(f)},[])}const xx=_.createContext(null),Tae=xx.Provider;xx.Consumer;const $3=()=>_.useContext(xx),Nae=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Sae=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:o,toHandle:l,isValid:c}=a,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.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:s===fl.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!i,valid:d&&c}};function kae({type:e="source",position:t=Re.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:o,children:l,className:c,onMouseDown:d,onTouchStart:f,...h},p){var $,C;const m=a||null,y=e==="target",v=Kt(),g=$3(),{connectOnClick:E,noPanClassName:b,rfId:w}=dt(Nae,Vt),{connectingFrom:N,connectingTo:T,clickConnecting:A,isPossibleEndHandle:S,connectionInProcess:O,clickConnectionInProcess:I,valid:D}=dt(Sae(g,m,e),Vt);g||(C=($=v.getState()).onError)==null||C.call($,"010",ci.error010());const F=R=>{const{defaultEdgeOptions:L,onConnect:M,hasDefaultEdges:k}=v.getState(),Y={...L,...R};if(k){const{edges:G,setEdges:P,onError:V}=v.getState();P(P3(Y,G,{onError:V}))}M==null||M(Y),o==null||o(Y)},W=R=>{if(!g)return;const L=l3(R.nativeEvent);if(i&&(L&&R.button===0||!L)){const M=v.getState();p1.onPointerDown(R.nativeEvent,{handleDomNode:R.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:y,handleId:m,nodeId:g,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...k)=>{var Y,G;return(G=(Y=v.getState()).onConnectEnd)==null?void 0:G.call(Y,...k)},updateConnection:M.updateConnection,onConnect:F,isValidConnection:n||((...k)=>{var Y,G;return((G=(Y=v.getState()).isValidConnection)==null?void 0:G.call(Y,...k))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}L?d==null||d(R):f==null||f(R)},j=R=>{const{onClickConnectStart:L,onClickConnectEnd:M,connectionClickStartHandle:k,connectionMode:Y,isValidConnection:G,lib:P,rfId:V,nodeLookup:Q,connection:re}=v.getState();if(!g||!k&&!i)return;if(!k){L==null||L(R.nativeEvent,{nodeId:g,handleId:m,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const le=a3(R.target),K=n||G,{connection:q,isValid:ae}=p1.isValid(R.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:Y,fromNodeId:k.nodeId,fromHandleId:k.id||null,fromType:k.type,isValidConnection:K,flowId:V,doc:le,lib:P,nodeLookup:Q});ae&&q&&F(q);const ge=structuredClone(re);delete ge.inProgress,ge.toPosition=ge.toHandle?ge.toHandle.position:null,M==null||M(R,ge),v.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${m}-${e}`,className:En(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,c,{source:!y,target:y,connectable:r,connectablestart:i,connectableend:s,clickconnecting:A,connectingfrom:N,connectingto:T,valid:D,connectionindicator:r&&(!O||S)&&(O||I?s:i)}]),onMouseDown:W,onTouchStart:W,onClick:E?j:void 0,ref:p,...h,children:l})}const bl=_.memo(j3(kae));function Aae({data:e,isConnectable:t,sourcePosition:n=Re.Bottom}){return u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(bl,{type:"source",position:n,isConnectable:t})]})}function Cae({data:e,isConnectable:t,targetPosition:n=Re.Top,sourcePosition:r=Re.Bottom}){return u.jsxs(u.Fragment,{children:[u.jsx(bl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(bl,{type:"source",position:r,isConnectable:t})]})}function Iae(){return null}function Oae({data:e,isConnectable:t,targetPosition:n=Re.Top}){return u.jsxs(u.Fragment,{children:[u.jsx(bl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const gp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lS={input:Aae,default:Cae,output:Oae,group:Iae};function Rae(e){var t,n,r,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??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Lae=e=>{const{width:t,height:n,x:r,y:i}=Ed(e.nodeLookup,{filter:s=>!!s.selected});return{width:ni(t)?t:null,height:ni(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Mae({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Kt(),{width:i,height:s,transformString:a,userSelectionActive:o}=dt(Lae,Vt),l=U3(),c=_.useRef(null);_.useEffect(()=>{var p;n||(p=c.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&i!==null&&s!==null;if(F3({nodeRef:c,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(y=>y.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(gp,p.key)&&(p.preventDefault(),l({direction:gp[p.key],factor:p.shiftKey?4:1}))};return u.jsx("div",{className:En(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:u.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:s}})})}const cS=typeof window<"u"?window:void 0,Dae=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function H3({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:v,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:w,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:S,autoPanOnSelection:O,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:W,preventScrolling:j,onSelectionContextMenu:$,noWheelClassName:C,noPanClassName:R,disableKeyboardA11y:L,onViewportChange:M,isControlledViewport:k}){const{nodesSelectionActive:Y,userSelectionActive:G}=dt(Dae,Vt),P=Fu(c,{target:cS}),V=Fu(y,{target:cS}),Q=V||S,re=V||w,le=d&&Q!==!0,K=P||G||le;return mae({deleteKeyCode:l,multiSelectionKeyCode:m}),u.jsx(bae,{onPaneContextMenu:s,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:re,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!P&&Q,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:W,zoomActivationKeyCode:v,preventScrolling:j,noWheelClassName:C,noPanClassName:R,onViewportChange:M,isControlledViewport:k,paneClickDistance:o,selectionOnDrag:le,children:u.jsxs(wae,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:O,isSelecting:!!K,selectionMode:f,selectionKeyPressed:P,paneClickDistance:o,selectionOnDrag:le,children:[e,Y&&u.jsx(Mae,{onSelectionContextMenu:$,noPanClassName:R,disableKeyboardA11y:L})]})})}H3.displayName="FlowRenderer";const Pae=_.memo(H3),jae=e=>t=>e?ux(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 Bae(e){return dt(_.useCallback(jae(e),[e]),Vt)}const Fae=e=>e.updateNodeInternals;function Uae(){const e=dt(Fae),[t]=_.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return _.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function $ae({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Kt(),s=_.useRef(null),a=_.useRef(null),o=_.useRef(e.sourcePosition),l=_.useRef(e.targetPosition),c=_.useRef(t),d=n&&!!e.internals.handleBounds;return _.useEffect(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(s.current),a.current=s.current)},[d,e.hidden]),_.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),_.useEffect(()=>{if(s.current){const f=c.current!==t,h=o.current!==e.sourcePosition,p=l.current!==e.targetPosition;(f||h||p)&&(c.current=t,o.current=e.sourcePosition,l.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function Hae({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:c,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:y,nodeTypes:v,nodeClickDistance:g,onError:E}){const{node:b,internals:w,isParent:N}=dt(K=>{const q=K.nodeLookup.get(e),ae=K.parentLookup.has(e);return{node:q,internals:q.internals,isParent:ae}},Vt);let T=b.type||"default",A=(v==null?void 0:v[T])||lS[T];A===void 0&&(E==null||E("003",ci.error003(T)),T="default",A=(v==null?void 0:v.default)||lS.default);const S=!!(b.draggable||o&&typeof b.draggable>"u"),O=!!(b.selectable||l&&typeof b.selectable>"u"),I=!!(b.connectable||c&&typeof b.connectable>"u"),D=!!(b.focusable||d&&typeof b.focusable>"u"),F=Kt(),W=i3(b),j=$ae({node:b,nodeType:T,hasDimensions:W,resizeObserver:f}),$=F3({nodeRef:j,disabled:b.hidden||!S,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:O,nodeClickDistance:g}),C=U3();if(b.hidden)return null;const R=ns(b),L=Rae(b),M=O||S||t||n||r||i,k=n?K=>n(K,{...w.userNode}):void 0,Y=r?K=>r(K,{...w.userNode}):void 0,G=i?K=>i(K,{...w.userNode}):void 0,P=s?K=>s(K,{...w.userNode}):void 0,V=a?K=>a(K,{...w.userNode}):void 0,Q=K=>{const{selectNodesOnDrag:q,nodeDragThreshold:ae}=F.getState();O&&(!q||!S||ae>0)&&m1({id:e,store:F,nodeRef:j}),t&&t(K,{...w.userNode})},re=K=>{if(!(o3(K.nativeEvent)||m)){if(GM.includes(K.key)&&O){const q=K.key==="Escape";m1({id:e,store:F,unselect:q,nodeRef:j})}else if(S&&b.selected&&Object.prototype.hasOwnProperty.call(gp,K.key)){K.preventDefault();const{ariaLabelConfig:q}=F.getState();F.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),C({direction:gp[K.key],factor:K.shiftKey?4:1})}}},le=()=>{var Ie;if(m||!((Ie=j.current)!=null&&Ie.matches(":focus-visible")))return;const{transform:K,width:q,height:ae,autoPanOnNodeFocus:ge,setCenter:he}=F.getState();if(!ge)return;ux(new Map([[e,b]]),{x:0,y:0,width:q,height:ae},K,!0).length>0||he(b.position.x+R.width/2,b.position.y+R.height/2,{zoom:K[2]})};return u.jsx("div",{className:En(["react-flow__node",`react-flow__node-${T}`,{[p]:S},b.className,{selected:b.selected,selectable:O,parent:N,draggable:S,dragging:$}]),ref:j,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:W?"visible":"hidden",...b.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:k,onMouseMove:Y,onMouseLeave:G,onContextMenu:P,onClick:Q,onDoubleClick:V,onKeyDown:D?re:void 0,tabIndex:D?0:void 0,onFocus:D?le:void 0,role:b.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${I3}-${y}`,"aria-label":b.ariaLabel,...b.domAttributes,children:u.jsx(Tae,{value:e,children:u.jsx(A,{id:e,data:b.data,type:T,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:b.selected??!1,selectable:O,draggable:S,deletable:b.deletable??!0,isConnectable:I,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:$,dragHandle:b.dragHandle,zIndex:w.z,parentId:b.parentId,...R})})})}var zae=_.memo(Hae);const Vae=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function z3(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=dt(Vae,Vt),a=Bae(e.onlyRenderVisibleElements),o=Uae();return u.jsx("div",{className:"react-flow__nodes",style:_m,children:a.map(l=>u.jsx(zae,{id:l,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:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:s},l))})}z3.displayName="NodeRenderer";const Kae=_.memo(z3);function Yae(e){return dt(_.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&Iie({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Vt)}const Wae=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return u.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},qae=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return u.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},uS={[Pu.Arrow]:Wae,[Pu.ArrowClosed]:qae};function Gae(e){const t=Kt();return _.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(uS,e)?uS[e]:((s=(i=t.getState()).onError)==null||s.call(i,"009",ci.error009(e)),null)},[e])}const Xae=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=Gae(t);return l?u.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:o,refX:"0",refY:"0",children:u.jsx(l,{color:n,strokeWidth:a})}):null},V3=({defaultColor:e,rfId:t})=>{const n=dt(s=>s.edges),r=dt(s=>s.defaultEdgeOptions),i=_.useMemo(()=>Bie(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?u.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:u.jsx("defs",{children:i.map(s=>u.jsx(Xae,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};V3.displayName="MarkerDefinitions";var Qae=_.memo(V3);function K3({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:c,...d}){const[f,h]=_.useState({x:1,y:0,width:0,height:0}),p=En(["react-flow__edge-textwrapper",c]),m=_.useRef(null);return _.useEffect(()=>{if(m.current){const y=m.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?u.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[i&&u.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:s,rx:o,ry:o}),u.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}K3.displayName="EdgeText";const Zae=_.memo(K3);function Tm({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:c=20,...d}){return u.jsxs(u.Fragment,{children:[u.jsx("path",{...d,d:e,fill:"none",className:En(["react-flow__edge-path",d.className])}),c?u.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&ni(t)&&ni(n)?u.jsx(Zae,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function dS({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Re.Left||e===Re.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Y3({sourceX:e,sourceY:t,sourcePosition:n=Re.Bottom,targetX:r,targetY:i,targetPosition:s=Re.Top}){const[a,o]=dS({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,c]=dS({pos:s,x1:r,y1:i,x2:e,y2:t}),[d,f,h,p]=c3({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${o} ${l},${c} ${r},${i}`,d,f,h,p]}function W3(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:o,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,interactionWidth:g})=>{const[E,b,w]=Y3({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o}),N=e.isInternal?void 0:t;return u.jsx(Tm,{id:N,path:E,labelX:b,labelY:w,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,interactionWidth:g})})}const Jae=W3({isInternal:!1}),q3=W3({isInternal:!0});Jae.displayName="SimpleBezierEdge";q3.displayName="SimpleBezierEdgeInternal";function G3(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Re.Bottom,targetPosition:m=Re.Top,markerEnd:y,markerStart:v,pathOptions:g,interactionWidth:E})=>{const[b,w,N]=d1({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:s,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),T=e.isInternal?void 0:t;return u.jsx(Tm,{id:T,path:b,labelX:w,labelY:N,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:v,interactionWidth:E})})}const X3=G3({isInternal:!1}),Q3=G3({isInternal:!0});X3.displayName="SmoothStepEdge";Q3.displayName="SmoothStepEdgeInternal";function Z3(e){return _.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return u.jsx(X3,{...n,id:r,pathOptions:_.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const eoe=Z3({isInternal:!1}),J3=Z3({isInternal:!0});eoe.displayName="StepEdge";J3.displayName="StepEdgeInternal";function eD(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})=>{const[v,g,E]=f3({sourceX:n,sourceY:r,targetX:i,targetY:s}),b=e.isInternal?void 0:t;return u.jsx(Tm,{id:b,path:v,labelX:g,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})})}const toe=eD({isInternal:!1}),tD=eD({isInternal:!0});toe.displayName="StraightEdge";tD.displayName="StraightEdgeInternal";function nD(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=Re.Bottom,targetPosition:o=Re.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,pathOptions:g,interactionWidth:E})=>{const[b,w,N]=u3({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o,curvature:g==null?void 0:g.curvature}),T=e.isInternal?void 0:t;return u.jsx(Tm,{id:T,path:b,labelX:w,labelY:N,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,interactionWidth:E})})}const noe=nD({isInternal:!1}),rD=nD({isInternal:!0});noe.displayName="BezierEdge";rD.displayName="BezierEdgeInternal";const fS={default:rD,straight:tD,step:J3,smoothstep:Q3,simplebezier:q3},hS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},roe=(e,t,n)=>n===Re.Left?e-t:n===Re.Right?e+t:e,ioe=(e,t,n)=>n===Re.Top?e-t:n===Re.Bottom?e+t:e,pS="react-flow__edgeupdater";function mS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:o}){return u.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:En([pS,`${pS}-${o}`]),cx:roe(t,r,e),cy:ioe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function soe({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:c,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=Kt(),y=(w,N)=>{if(w.button!==0)return;const{autoPanOnConnect:T,domNode:A,connectionMode:S,connectionRadius:O,lib:I,onConnectStart:D,cancelConnection:F,nodeLookup:W,rfId:j,panBy:$,updateConnection:C}=m.getState(),R=N.type==="target",L=(Y,G)=>{h(!1),f==null||f(Y,n,N.type,G)},M=Y=>c==null?void 0:c(n,Y),k=(Y,G)=>{h(!0),d==null||d(w,n,N.type),D==null||D(Y,G)};p1.onPointerDown(w.nativeEvent,{autoPanOnConnect:T,connectionMode:S,connectionRadius:O,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:W,isTarget:R,edgeUpdaterType:N.type,lib:I,flowId:j,cancelConnection:F,panBy:$,isValidConnection:(...Y)=>{var G,P;return((P=(G=m.getState()).isValidConnection)==null?void 0:P.call(G,...Y))??!0},onConnect:M,onConnectStart:k,onConnectEnd:(...Y)=>{var G,P;return(P=(G=m.getState()).onConnectEnd)==null?void 0:P.call(G,...Y)},onReconnectEnd:L,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>y(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=w=>y(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>p(!0),b=()=>p(!1);return u.jsxs(u.Fragment,{children:[(e===!0||e==="source")&&u.jsx(mS,{position:o,centerX:r,centerY:i,radius:t,onMouseDown:v,onMouseEnter:E,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&u.jsx(mS,{position:l,centerX:s,centerY:a,radius:t,onMouseDown:g,onMouseEnter:E,onMouseOut:b,type:"target"})]})}function aoe({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:y,noPanClassName:v,onError:g,disableKeyboardA11y:E}){let b=dt(he=>he.edgeLookup.get(e));const w=dt(he=>he.defaultEdgeOptions);b=w?{...w,...b}:b;let N=b.type||"default",T=(y==null?void 0:y[N])||fS[N];T===void 0&&(g==null||g("011",ci.error011(N)),N="default",T=(y==null?void 0:y.default)||fS.default);const A=!!(b.focusable||t&&typeof b.focusable>"u"),S=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),O=!!(b.selectable||r&&typeof b.selectable>"u"),I=_.useRef(null),[D,F]=_.useState(!1),[W,j]=_.useState(!1),$=Kt(),{zIndex:C,sourceX:R,sourceY:L,targetX:M,targetY:k,sourcePosition:Y,targetPosition:G}=dt(_.useCallback(he=>{const de=he.nodeLookup.get(b.source),Ie=he.nodeLookup.get(b.target);if(!de||!Ie)return{zIndex:b.zIndex,...hS};const _e=jie({id:e,sourceNode:de,targetNode:Ie,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:he.connectionMode,onError:g});return{zIndex:Cie({selected:b.selected,zIndex:b.zIndex,sourceNode:de,targetNode:Ie,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),..._e||hS}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Vt),P=_.useMemo(()=>b.markerStart?`url('#${f1(b.markerStart,m)}')`:void 0,[b.markerStart,m]),V=_.useMemo(()=>b.markerEnd?`url('#${f1(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||R===null||L===null||M===null||k===null)return null;const Q=he=>{var Ee;const{addSelectedEdges:de,unselectNodesAndEdges:Ie,multiSelectionActive:_e}=$.getState();O&&($.setState({nodesSelectionActive:!1}),b.selected&&_e?(Ie({nodes:[],edges:[b]}),(Ee=I.current)==null||Ee.blur()):de([e])),i&&i(he,b)},re=s?he=>{s(he,{...b})}:void 0,le=a?he=>{a(he,{...b})}:void 0,K=o?he=>{o(he,{...b})}:void 0,q=l?he=>{l(he,{...b})}:void 0,ae=c?he=>{c(he,{...b})}:void 0,ge=he=>{var de;if(!E&&GM.includes(he.key)&&O){const{unselectNodesAndEdges:Ie,addSelectedEdges:_e}=$.getState();he.key==="Escape"?((de=I.current)==null||de.blur(),Ie({edges:[b]})):_e([e])}};return u.jsx("svg",{style:{zIndex:C},children:u.jsxs("g",{className:En(["react-flow__edge",`react-flow__edge-${N}`,b.className,v,{selected:b.selected,animated:b.animated,inactive:!O&&!i,updating:D,selectable:O}]),onClick:Q,onDoubleClick:re,onContextMenu:le,onMouseEnter:K,onMouseMove:q,onMouseLeave:ae,onKeyDown:A?ge:void 0,tabIndex:A?0:void 0,role:b.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":A?`${O3}-${m}`:void 0,ref:I,...b.domAttributes,children:[!W&&u.jsx(T,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:O,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:R,sourceY:L,targetX:M,targetY:k,sourcePosition:Y,targetPosition:G,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:P,markerEnd:V,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),S&&u.jsx(soe,{edge:b,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:R,sourceY:L,targetX:M,targetY:k,sourcePosition:Y,targetPosition:G,setUpdateHover:F,setReconnecting:j})]})})}var ooe=_.memo(aoe);const loe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function iD({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:v,edgesReconnectable:g,elementsSelectable:E,onError:b}=dt(loe,Vt),w=Yae(t);return u.jsxs("div",{className:"react-flow__edges",children:[u.jsx(Qae,{defaultColor:e,rfId:n}),w.map(N=>u.jsx(ooe,{id:N,edgesFocusable:v,edgesReconnectable:g,elementsSelectable:E,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:y},N))]})}iD.displayName="EdgeRenderer";const coe=_.memo(iD),uoe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function doe({children:e}){const t=dt(uoe);return u.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function foe(e){const t=Ex(),n=_.useRef(!1);_.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const hoe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function poe(e){const t=dt(hoe),n=Kt();return _.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function moe(e){return e.connection.inProgress?{...e.connection,to:Pl(e.connection.to,e.transform)}:{...e.connection}}function goe(e){return moe}function yoe(e){const t=goe();return dt(t,Vt)}const boe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Eoe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:a,isValid:o,inProgress:l}=dt(boe,Vt);return!(s&&i&&l)?null:u.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:u.jsx("g",{className:En(["react-flow__connection",ZM(o)]),children:u.jsx(sD,{style:t,type:n,CustomComponent:r,isValid:o})})})}const sD=({style:e,type:t=Es.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:a,fromHandle:o,fromPosition:l,to:c,toNode:d,toHandle:f,toPosition:h,pointer:p}=yoe();if(!i)return;if(n)return u.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:s.x,fromY:s.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:h,connectionStatus:ZM(r),toNode:d,toHandle:f,pointer:p});let m="";const y={sourceX:s.x,sourceY:s.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:h};switch(t){case Es.Bezier:[m]=u3(y);break;case Es.SimpleBezier:[m]=Y3(y);break;case Es.Step:[m]=d1({...y,borderRadius:0});break;case Es.SmoothStep:[m]=d1(y);break;default:[m]=f3(y)}return u.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};sD.displayName="ConnectionLine";const xoe={};function gS(e=xoe){_.useRef(e),Kt(),_.useEffect(()=>{},[e])}function voe(){Kt(),_.useRef(!1),_.useEffect(()=>{},[])}function aD({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:v,connectionLineContainerStyle:g,selectionKeyCode:E,selectionOnDrag:b,selectionMode:w,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:S,onlyRenderVisibleElements:O,elementsSelectable:I,defaultViewport:D,translateExtent:F,minZoom:W,maxZoom:j,preventScrolling:$,defaultMarkerColor:C,zoomOnScroll:R,zoomOnPinch:L,panOnScroll:M,panOnScrollSpeed:k,panOnScrollMode:Y,zoomOnDoubleClick:G,panOnDrag:P,autoPanOnSelection:V,onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:le,onPaneMouseLeave:K,onPaneScroll:q,onPaneContextMenu:ae,paneClickDistance:ge,nodeClickDistance:he,onEdgeContextMenu:de,onEdgeMouseEnter:Ie,onEdgeMouseMove:_e,onEdgeMouseLeave:Ee,reconnectRadius:Pe,onReconnect:be,onReconnectStart:Ve,onReconnectEnd:ke,noDragClassName:ce,noWheelClassName:It,noPanClassName:Me,disableKeyboardA11y:wt,nodeExtent:st,rfId:z,viewport:X,onViewportChange:oe}){return gS(e),gS(t),voe(),foe(n),poe(X),u.jsx(Pae,{onPaneClick:Q,onPaneMouseEnter:re,onPaneMouseMove:le,onPaneMouseLeave:K,onPaneContextMenu:ae,onPaneScroll:q,paneClickDistance:ge,deleteKeyCode:S,selectionKeyCode:E,selectionOnDrag:b,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:R,zoomOnPinch:L,zoomOnDoubleClick:G,panOnScroll:M,panOnScrollSpeed:k,panOnScrollMode:Y,panOnDrag:P,autoPanOnSelection:V,defaultViewport:D,translateExtent:F,minZoom:W,maxZoom:j,onSelectionContextMenu:f,preventScrolling:$,noDragClassName:ce,noWheelClassName:It,noPanClassName:Me,disableKeyboardA11y:wt,onViewportChange:oe,isControlledViewport:!!X,children:u.jsxs(doe,{children:[u.jsx(coe,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:be,onReconnectStart:Ve,onReconnectEnd:ke,onlyRenderVisibleElements:O,onEdgeContextMenu:de,onEdgeMouseEnter:Ie,onEdgeMouseMove:_e,onEdgeMouseLeave:Ee,reconnectRadius:Pe,defaultMarkerColor:C,noPanClassName:Me,disableKeyboardA11y:wt,rfId:z}),u.jsx(Eoe,{style:y,type:m,component:v,containerStyle:g}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(Kae,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:he,onlyRenderVisibleElements:O,noPanClassName:Me,noDragClassName:ce,disableKeyboardA11y:wt,nodeExtent:st,rfId:z}),u.jsx("div",{className:"react-flow__viewport-portal"})]})})}aD.displayName="GraphView";const woe=_.memo(aD),_oe=r3(),yS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,y=new Map,v=new Map,g=r??t??[],E=n??e??[],b=d??[0,0],w=f??Mu;m3(y,v,g);const{nodesInitialized:N}=h1(E,p,m,{nodeOrigin:b,nodeExtent:w,zIndexMode:h});let T=[0,0,1];if(a&&i&&s){const A=Ed(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:O,zoom:I}=fx(A,i,s,l,c,(o==null?void 0:o.padding)??.1);T=[S,O,I]}return{rfId:"1",width:i??0,height:s??0,transform:T,nodes:E,nodesInitialized:N,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:v,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:Mu,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:fl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,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:o,fitViewResolver:null,connection:{...QM},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:_oe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:XM,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Toe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Use((p,m)=>{async function y(){const{nodeLookup:v,panZoom:g,fitViewOptions:E,fitViewResolver:b,width:w,height:N,minZoom:T,maxZoom:A}=m();g&&(await wie({nodes:v,width:w,height:N,panZoom:g,minZoom:T,maxZoom:A},E),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...yS({nodes:e,edges:t,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:v=>{const{nodeLookup:g,parentLookup:E,nodeOrigin:b,elevateNodesOnSelect:w,fitViewQueued:N,zIndexMode:T,nodesSelectionActive:A}=m(),{nodesInitialized:S,hasSelectedNodes:O}=h1(v,g,E,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:T}),I=A&&O;N&&S?(y(),p({nodes:v,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:v,nodesInitialized:S,nodesSelectionActive:I})},setEdges:v=>{const{connectionLookup:g,edgeLookup:E}=m();m3(g,E,v),p({edges:v})},setDefaultNodesAndEdges:(v,g)=>{if(v){const{setNodes:E}=m();E(v),p({hasDefaultNodes:!0})}if(g){const{setEdges:E}=m();E(g),p({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:g,nodeLookup:E,parentLookup:b,domNode:w,nodeOrigin:N,nodeExtent:T,debug:A,fitViewQueued:S,zIndexMode:O}=m(),{changes:I,updatedInternals:D}=Kie(v,E,b,w,N,T,O);D&&($ie(E,b,{nodeOrigin:N,nodeExtent:T,zIndexMode:O}),S?(y(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(A&&console.log("React Flow: trigger node changes",I),g==null||g(I)))},updateNodePositions:(v,g=!1)=>{const E=[];let b=[];const{nodeLookup:w,triggerNodeChanges:N,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:S}=m();for(const[O,I]of v){const D=w.get(O),F=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(I!=null&&I.position)),W={id:O,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:g};if(D&&T.inProgress&&T.fromNode.id===D.id){const j=Pa(D,T.fromHandle,Re.Left,!0);A({...T,from:j})}F&&D.parentId&&E.push({id:O,parentId:D.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),b.push(W)}if(E.length>0){const{parentLookup:O,nodeOrigin:I}=m(),D=bx(E,w,O,I);b.push(...D)}for(const O of S.values())b=O(b);N(b)},triggerNodeChanges:v=>{const{onNodesChange:g,setNodes:E,nodes:b,hasDefaultNodes:w,debug:N}=m();if(v!=null&&v.length){if(w){const T=M3(v,b);E(T)}N&&console.log("React Flow: trigger node changes",v),g==null||g(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:g,setEdges:E,edges:b,hasDefaultEdges:w,debug:N}=m();if(v!=null&&v.length){if(w){const T=D3(v,b);E(T)}N&&console.log("React Flow: trigger edge changes",v),g==null||g(v)}},addSelectedNodes:v=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:w,triggerEdgeChanges:N}=m();if(g){const T=v.map(A=>ra(A,!0));w(T);return}w(Io(b,new Set([...v]),!0)),N(Io(E))},addSelectedEdges:v=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:w,triggerEdgeChanges:N}=m();if(g){const T=v.map(A=>ra(A,!0));N(T);return}N(Io(E,new Set([...v]))),w(Io(b,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:g}={})=>{const{edges:E,nodes:b,nodeLookup:w,triggerNodeChanges:N,triggerEdgeChanges:T}=m(),A=v||b,S=g||E,O=[];for(const D of A){if(!D.selected)continue;const F=w.get(D.id);F&&(F.selected=!1),O.push(ra(D.id,!1))}const I=[];for(const D of S)D.selected&&I.push(ra(D.id,!1));N(O),T(I)},setMinZoom:v=>{const{panZoom:g,maxZoom:E}=m();g==null||g.setScaleExtent([v,E]),p({minZoom:v})},setMaxZoom:v=>{const{panZoom:g,minZoom:E}=m();g==null||g.setScaleExtent([E,v]),p({maxZoom:v})},setTranslateExtent:v=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(v),p({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:g,triggerNodeChanges:E,triggerEdgeChanges:b,elementsSelectable:w}=m();if(!w)return;const N=g.reduce((A,S)=>S.selected?[...A,ra(S.id,!1)]:A,[]),T=v.reduce((A,S)=>S.selected?[...A,ra(S.id,!1)]:A,[]);E(N),b(T)},setNodeExtent:v=>{const{nodes:g,nodeLookup:E,parentLookup:b,nodeOrigin:w,elevateNodesOnSelect:N,nodeExtent:T,zIndexMode:A}=m();v[0][0]===T[0][0]&&v[0][1]===T[0][1]&&v[1][0]===T[1][0]&&v[1][1]===T[1][1]||(h1(g,E,b,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:A}),p({nodeExtent:v}))},panBy:v=>{const{transform:g,width:E,height:b,panZoom:w,translateExtent:N}=m();return Yie({delta:v,panZoom:w,transform:g,translateExtent:N,width:E,height:b})},setCenter:async(v,g,E)=>{const{width:b,height:w,maxZoom:N,panZoom:T}=m();if(!T)return!1;const A=typeof(E==null?void 0:E.zoom)<"u"?E.zoom:N;return await T.setViewport({x:b/2-v*A,y:w/2-g*A,zoom:A},{duration:E==null?void 0:E.duration,ease:E==null?void 0:E.ease,interpolate:E==null?void 0:E.interpolate}),!0},cancelConnection:()=>{p({connection:{...QM}})},updateConnection:v=>{p({connection:v})},reset:()=>p({...yS()})}},Object.is);function oD({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=_.useState(()=>Toe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:c,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return u.jsx($se,{value:m,children:u.jsx(dae,{children:p})})}function Noe({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return _.useContext(vm)?u.jsx(u.Fragment,{children:e}):u.jsx(oD,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Soe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function koe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:g,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:S,onNodeDragStop:O,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onSelectionChange:W,onSelectionDragStart:j,onSelectionDrag:$,onSelectionDragStop:C,onSelectionContextMenu:R,onSelectionStart:L,onSelectionEnd:M,onBeforeDelete:k,connectionMode:Y,connectionLineType:G=Es.Bezier,connectionLineStyle:P,connectionLineComponent:V,connectionLineContainerStyle:Q,deleteKeyCode:re="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:K=!1,selectionMode:q=Du.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:ge=Bu()?"Meta":"Control",zoomActivationKeyCode:he=Bu()?"Meta":"Control",snapToGrid:de,snapGrid:Ie,onlyRenderVisibleElements:_e=!1,selectNodesOnDrag:Ee,nodesDraggable:Pe,autoPanOnNodeFocus:be,nodesConnectable:Ve,nodesFocusable:ke,nodeOrigin:ce=R3,edgesFocusable:It,edgesReconnectable:Me,elementsSelectable:wt=!0,defaultViewport:st=eae,minZoom:z=.5,maxZoom:X=2,translateExtent:oe=Mu,preventScrolling:we=!0,nodeExtent:Ae,defaultMarkerColor:Ge="#b1b1b7",zoomOnScroll:Ot=!0,zoomOnPinch:Ke=!0,panOnScroll:xn=!1,panOnScrollSpeed:jt=.5,panOnScrollMode:yt=va.Free,zoomOnDoubleClick:Yt=!0,panOnDrag:kt=!0,onPaneClick:Rt,onPaneMouseEnter:Le,onPaneMouseMove:at,onPaneMouseLeave:bt,onPaneScroll:Et,onPaneContextMenu:se,paneClickDistance:Ce=1,nodeClickDistance:We=0,children:Jt,onReconnect:Xe,onReconnectStart:te,onReconnectEnd:xe,onEdgeContextMenu:ye,onEdgeDoubleClick:Be,onEdgeMouseEnter:He,onEdgeMouseMove:$e,onEdgeMouseLeave:ot,reconnectRadius:it=10,onNodesChange:mn,onEdgesChange:mt,noDragClassName:kn="nodrag",noWheelClassName:lt="nowheel",noPanClassName:An="nopan",fitView:gn,fitViewOptions:br,connectOnClick:an,attributionPosition:Cn,proOptions:_t,defaultEdgeOptions:Un,elevateNodesOnSelect:on=!0,elevateEdgesOnSelect:Xn=!1,disableKeyboardA11y:Qn=!1,autoPanOnConnect:In,autoPanOnNodeDrag:Dn,autoPanOnSelection:vn=!0,autoPanSpeed:wn,connectionRadius:_n,isValidConnection:en,onError:ee,style:Te,id:De,nodeDragThreshold:ze,connectionDragThreshold:gt,viewport:ht,onViewportChange:tt,width:tn,height:Wt,colorMode:ln="light",debug:Ka,onScroll:pi,ariaLabelConfig:jl,zIndexMode:vd="basic",...rs},wd){const or=De||"1",Bl=iae(ln),Fl=_.useCallback(Ul=>{Ul.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),pi==null||pi(Ul)},[pi]);return u.jsx("div",{"data-testid":"rf__wrapper",...rs,onScroll:Fl,style:{...Te,...Soe},ref:wd,className:En(["react-flow",i,Bl]),id:De,role:"application",children:u.jsxs(Noe,{nodes:e,edges:t,width:tn,height:Wt,fitView:gn,fitViewOptions:br,minZoom:z,maxZoom:X,nodeOrigin:ce,nodeExtent:Ae,zIndexMode:vd,children:[u.jsx(rae,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:g,nodesDraggable:Pe,autoPanOnNodeFocus:be,nodesConnectable:Ve,nodesFocusable:ke,edgesFocusable:It,edgesReconnectable:Me,elementsSelectable:wt,elevateNodesOnSelect:on,elevateEdgesOnSelect:Xn,minZoom:z,maxZoom:X,nodeExtent:Ae,onNodesChange:mn,onEdgesChange:mt,snapToGrid:de,snapGrid:Ie,connectionMode:Y,translateExtent:oe,connectOnClick:an,defaultEdgeOptions:Un,fitView:gn,fitViewOptions:br,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onNodeDragStart:A,onNodeDrag:S,onNodeDragStop:O,onSelectionDrag:$,onSelectionDragStart:j,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:An,nodeOrigin:ce,rfId:or,autoPanOnConnect:In,autoPanOnNodeDrag:Dn,autoPanSpeed:wn,onError:ee,connectionRadius:_n,isValidConnection:en,selectNodesOnDrag:Ee,nodeDragThreshold:ze,connectionDragThreshold:gt,onBeforeDelete:k,debug:Ka,ariaLabelConfig:jl,zIndexMode:vd}),u.jsx(woe,{onInit:c,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:T,nodeTypes:s,edgeTypes:a,connectionLineType:G,connectionLineStyle:P,connectionLineComponent:V,connectionLineContainerStyle:Q,selectionKeyCode:le,selectionOnDrag:K,selectionMode:q,deleteKeyCode:re,multiSelectionKeyCode:ge,panActivationKeyCode:ae,zoomActivationKeyCode:he,onlyRenderVisibleElements:_e,defaultViewport:st,translateExtent:oe,minZoom:z,maxZoom:X,preventScrolling:we,zoomOnScroll:Ot,zoomOnPinch:Ke,zoomOnDoubleClick:Yt,panOnScroll:xn,panOnScrollSpeed:jt,panOnScrollMode:yt,panOnDrag:kt,autoPanOnSelection:vn,onPaneClick:Rt,onPaneMouseEnter:Le,onPaneMouseMove:at,onPaneMouseLeave:bt,onPaneScroll:Et,onPaneContextMenu:se,paneClickDistance:Ce,nodeClickDistance:We,onSelectionContextMenu:R,onSelectionStart:L,onSelectionEnd:M,onReconnect:Xe,onReconnectStart:te,onReconnectEnd:xe,onEdgeContextMenu:ye,onEdgeDoubleClick:Be,onEdgeMouseEnter:He,onEdgeMouseMove:$e,onEdgeMouseLeave:ot,reconnectRadius:it,defaultMarkerColor:Ge,noDragClassName:kn,noWheelClassName:lt,noPanClassName:An,rfId:or,disableKeyboardA11y:Qn,nodeExtent:Ae,viewport:ht,onViewportChange:tt}),u.jsx(Jse,{onSelectionChange:W}),Jt,u.jsx(qse,{proOptions:_t,position:Cn}),u.jsx(Wse,{rfId:or,disableKeyboardA11y:Qn})]})})}var Aoe=j3(koe);function Coe(e){const[t,n]=_.useState(e),r=_.useCallback(i=>n(s=>M3(i,s)),[]);return[t,n,r]}function Ioe(e){const[t,n]=_.useState(e),r=_.useCallback(i=>n(s=>D3(i,s)),[]);return[t,n,r]}function Ooe({dimensions:e,lineWidth:t,variant:n,className:r}){return u.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:En(["react-flow__background-pattern",n,r])})}function Roe({radius:e,className:t}){return u.jsx("circle",{cx:e,cy:e,r:e,className:En(["react-flow__background-pattern","dots",t])})}var Ds;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ds||(Ds={}));const Loe={[Ds.Dots]:1,[Ds.Lines]:1,[Ds.Cross]:6},Moe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function lD({id:e,variant:t=Ds.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:o,style:l,className:c,patternClassName:d}){const f=_.useRef(null),{transform:h,patternId:p}=dt(Moe,Vt),m=r||Loe[t],y=t===Ds.Dots,v=t===Ds.Cross,g=Array.isArray(n)?n:[n,n],E=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],w=Array.isArray(s)?s:[s,s],N=v?[b,b]:E,T=[w[0]*h[2]||1+N[0]/2,w[1]*h[2]||1+N[1]/2],A=`${p}${e||""}`;return u.jsxs("svg",{className:En(["react-flow__background",c]),style:{...l,..._m,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[u.jsx("pattern",{id:A,x:h[0]%E[0],y:h[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:y?u.jsx(Roe,{radius:b/2,className:d}):u.jsx(Ooe,{dimensions:N,lineWidth:i,variant:t,className:d})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}lD.displayName="Background";const Doe=_.memo(lD);function Poe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function joe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Boe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.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 Foe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 Uoe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 Nf({children:e,className:t,...n}){return u.jsx("button",{type:"button",className:En(["react-flow__controls-button",t]),...n,children:e})}const $oe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function cD({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:c,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=Kt(),{isInteractive:y,minZoomReached:v,maxZoomReached:g,ariaLabelConfig:E}=dt($oe,Vt),{zoomIn:b,zoomOut:w,fitView:N}=Ex(),T=()=>{b(),s==null||s()},A=()=>{w(),a==null||a()},S=()=>{N(i),o==null||o()},O=()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),l==null||l(!y)},I=h==="horizontal"?"horizontal":"vertical";return u.jsxs(wm,{className:En(["react-flow__controls",I,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??E["controls.ariaLabel"],children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(Nf,{onClick:T,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:g,children:u.jsx(Poe,{})}),u.jsx(Nf,{onClick:A,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:v,children:u.jsx(joe,{})})]}),n&&u.jsx(Nf,{className:"react-flow__controls-fitview",onClick:S,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:u.jsx(Boe,{})}),r&&u.jsx(Nf,{className:"react-flow__controls-interactive",onClick:O,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:y?u.jsx(Uoe,{}):u.jsx(Foe,{})}),d]})}cD.displayName="Controls";const Hoe=_.memo(cD);function zoe({id:e,x:t,y:n,width:r,height:i,style:s,color:a,strokeColor:o,strokeWidth:l,className:c,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:y}=s||{},v=a||m||y;return u.jsx("rect",{className:En(["react-flow__minimap-node",{selected:h},c]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const Voe=_.memo(zoe),Koe=e=>e.nodes.map(t=>t.id),o0=e=>e instanceof Function?e:()=>e;function Yoe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=Voe,onClick:a}){const o=dt(Koe,Vt),l=o0(t),c=o0(e),d=o0(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return u.jsx(u.Fragment,{children:o.map(h=>u.jsx(qoe,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function Woe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:c,x:d,y:f,width:h,height:p}=dt(m=>{const y=m.nodeLookup.get(e);if(!y)return{node:void 0,x:0,y:0,width:0,height:0};const v=y.internals.userNode,{x:g,y:E}=y.internals.positionAbsolute,{width:b,height:w}=ns(v);return{node:v,x:g,y:E,width:b,height:w}},Vt);return!c||c.hidden||!i3(c)?null:u.jsx(o,{x:d,y:f,width:h,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:i,strokeColor:n(c),strokeWidth:s,shapeRendering:a,onClick:l,id:c.id})}const qoe=_.memo(Woe);var Goe=_.memo(Yoe);const Xoe=200,Qoe=150,Zoe=e=>!e.hidden,Joe=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?n3(Ed(e.nodeLookup,{filter:Zoe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ele="react-flow__minimap-desc";function uD({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:c,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:y=!1,zoomable:v=!1,ariaLabel:g,inversePan:E,zoomStep:b=1,offsetScale:w=5}){const N=Kt(),T=_.useRef(null),{boundingRect:A,viewBB:S,rfId:O,panZoom:I,translateExtent:D,flowWidth:F,flowHeight:W,ariaLabelConfig:j}=dt(Joe,Vt),$=(e==null?void 0:e.width)??Xoe,C=(e==null?void 0:e.height)??Qoe,R=A.width/$,L=A.height/C,M=Math.max(R,L),k=M*$,Y=M*C,G=w*M,P=A.x-(k-A.width)/2-G,V=A.y-(Y-A.height)/2-G,Q=k+G*2,re=Y+G*2,le=`${ele}-${O}`,K=_.useRef(0),q=_.useRef();K.current=M,_.useEffect(()=>{if(T.current&&I)return q.current=tse({domNode:T.current,panZoom:I,getTransform:()=>N.getState().transform,getViewScale:()=>K.current}),()=>{var de;(de=q.current)==null||de.destroy()}},[I]),_.useEffect(()=>{var de;(de=q.current)==null||de.update({translateExtent:D,width:F,height:W,inversePan:E,pannable:y,zoomStep:b,zoomable:v})},[y,v,E,b,D,F,W]);const ae=p?de=>{var Ee;const[Ie,_e]=((Ee=q.current)==null?void 0:Ee.pointer(de))||[0,0];p(de,{x:Ie,y:_e})}:void 0,ge=m?_.useCallback((de,Ie)=>{const _e=N.getState().nodeLookup.get(Ie).internals.userNode;m(de,_e)},[]):void 0,he=g??j["minimap.ariaLabel"];return u.jsx(wm,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r: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:En(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:u.jsxs("svg",{width:$,height:C,viewBox:`${P} ${V} ${Q} ${re}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":le,ref:T,onClick:ae,children:[he&&u.jsx("title",{id:le,children:he}),u.jsx(Goe,{onClick:ge,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:o}),u.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-G},${V-G}h${Q+G*2}v${re+G*2}h${-Q-G*2}z - M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}uD.displayName="MiniMap";const tle=_.memo(uD),nle=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,rle={[gl.Line]:"right",[gl.Handle]:"bottom-right"};function ile({nodeId:e,position:t,variant:n=gl.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:o=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:y,onResize:v,onResizeEnd:g}){const E=$3(),b=typeof e=="string"?e:E,w=Kt(),N=_.useRef(null),T=n===gl.Handle,A=dt(_.useCallback(nle(T&&p),[T,p]),Vt),S=_.useRef(null),O=t??rle[n];_.useEffect(()=>{if(!(!N.current||!b))return S.current||(S.current=pse({domNode:N.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:D,transform:F,snapGrid:W,snapToGrid:j,nodeOrigin:$,domNode:C}=w.getState();return{nodeLookup:D,transform:F,snapGrid:W,snapToGrid:j,nodeOrigin:$,paneDomNode:C}},onChange:(D,F)=>{const{triggerNodeChanges:W,nodeLookup:j,parentLookup:$,nodeOrigin:C}=w.getState(),R=[],L={x:D.x,y:D.y},M=j.get(b);if(M&&M.expandParent&&M.parentId){const k=M.origin??C,Y=D.width??M.measured.width??0,G=D.height??M.measured.height??0,P={id:M.id,parentId:M.parentId,rect:{width:Y,height:G,...s3({x:D.x??M.position.x,y:D.y??M.position.y},{width:Y,height:G},M.parentId,j,k)}},V=bx([P],j,$,C);R.push(...V),L.x=D.x?Math.max(k[0]*Y,D.x):void 0,L.y=D.y?Math.max(k[1]*G,D.y):void 0}if(L.x!==void 0&&L.y!==void 0){const k={id:b,type:"position",position:{...L}};R.push(k)}if(D.width!==void 0&&D.height!==void 0){const Y={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};R.push(Y)}for(const k of F){const Y={...k,type:"position"};R.push(Y)}W(R)},onEnd:({width:D,height:F})=>{const W={id:b,type:"dimensions",resizing:!1,dimensions:{width:D,height:F}};w.getState().triggerNodeChanges([W])}})),S.current.update({controlPosition:O,boundaries:{minWidth:o,minHeight:l,maxWidth:c,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:y,onResize:v,onResizeEnd:g,shouldResize:m}),()=>{var D;(D=S.current)==null||D.destroy()}},[O,o,l,c,d,f,y,v,g,m]);const I=O.split("-");return u.jsx("div",{className:En(["react-flow__resize-control","nodrag",...I,n,r]),ref:N,style:{...i,scale:A,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:s})}_.memo(ile);const sle=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:i9},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:j8},{type:"loop",label:"循环",desc:"节点循环执行",Icon:Gb}];let g1=0;function l0(){return g1+=1,`node_${g1}`}function c0(e,t,n){const r=Us();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function ale({data:e,selected:t}){const n=e.agent;return u.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[u.jsx(bl,{type:"target",position:Re.Left,className:"wfb-handle"}),u.jsx("div",{className:"wfb-node-icon",children:u.jsx(ka,{className:"icon"})}),u.jsxs("div",{className:"wfb-node-body",children:[u.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),u.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),u.jsx(bl,{type:"source",position:Re.Right,className:"wfb-handle"})]})}const ole={agentNode:ale},bS={type:"smoothstep",markerEnd:{type:Pu.ArrowClosed,width:16,height:16}};function lle({onBack:e,onCreate:t}){const n=_.useRef(null),[r,i]=_.useState(""),[s,a]=_.useState(""),[o,l]=_.useState("sequential"),c=_.useMemo(()=>{g1=0;const C=l0();return c0(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=Coe([c]),[p,m,y]=Ioe([]),[v,g]=_.useState(c.id),E=d.find(C=>C.id===v)??null,b=r.trim()||"workflow_agent",w=_.useMemo(()=>lM({name:b,subAgents:d.map(C=>C.data.agent)}),[b,d]),N=$o(b)??(w.has(b)?"名称须与 Agent 节点名称保持唯一":null),T=E?$o(E.data.agent.name)??(w.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,A=d.length>0&&N===null&&d.every(C=>$o(C.data.agent.name)===null&&!w.has(C.data.agent.name)),S=_.useCallback(C=>m(R=>P3({...C,...bS},R)),[m]),O=_.useCallback(()=>{const C=l0(),R=d.length*28,L=c0(C,{x:80+R,y:120+R});f(M=>M.concat(L)),g(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},D=_.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),F=_.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const L=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),M=l0(),k=c0(M,L);f(Y=>Y.concat(k)),g(M)},[f]),W=_.useCallback(C=>{v&&f(R=>R.map(L=>L.id===v?{...L,data:{...L.data,agent:{...L.data.agent,...C}}}:L))},[v,f]),j=_.useCallback(()=>{v&&(f(C=>C.filter(R=>R.id!==v)),m(C=>C.filter(R=>R.source!==v&&R.target!==v)),g(null))},[v,f,m]),$=_.useCallback(()=>{if(!A)return;const C=d.map(L=>L.data.agent),R={...Us(),name:b,description:s.trim(),instruction:s.trim(),subAgents:C,workflow:{type:o,nodes:d.map(L=>({id:L.id,agent:L.data.agent})),edges:p.map(L=>({from:L.source,to:L.target}))}};t(R)},[A,d,p,b,s,o,t]);return u.jsx("div",{className:"wfb",children:u.jsxs("div",{className:"wfb-grid",children:[u.jsxs("aside",{className:"wfb-palette",children:[u.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"名称"}),u.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:r,onChange:C=>i(C.target.value),placeholder:"my_workflow"}),N&&u.jsx("span",{className:"wfb-field-error",children:N})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"描述"}),u.jsx("textarea",{className:"wfb-input wfb-textarea",value:s,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),u.jsx("div",{className:"wfb-section-label",children:"执行方式"}),u.jsx("div",{className:"wfb-types",children:sle.map(({type:C,label:R,desc:L,Icon:M})=>u.jsxs("button",{type:"button",className:`wfb-type ${o===C?"wfb-type--active":""}`,onClick:()=>l(C),children:[u.jsx(M,{className:"icon"}),u.jsxs("span",{className:"wfb-type-text",children:[u.jsx("span",{className:"wfb-type-name",children:R}),u.jsx("span",{className:"wfb-type-desc",children:L})]})]},C))}),u.jsx("div",{className:"wfb-section-label",children:"节点"}),u.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[u.jsx(J8,{className:"icon wfb-grip"}),u.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:u.jsx(ka,{className:"icon"})}),u.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),u.jsxs("button",{className:"wfb-add",type:"button",onClick:O,children:[u.jsx(li,{className:"icon"}),"添加节点"]}),u.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),u.jsxs("div",{className:"wfb-canvas",children:[u.jsxs("button",{className:"wfb-create",onClick:$,disabled:!A,type:"button",children:[u.jsx(Aa,{className:"icon"}),"创建工作流"]}),u.jsxs(Aoe,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:y,onConnect:S,onInit:C=>n.current=C,nodeTypes:ole,defaultEdgeOptions:bS,onDrop:F,onDragOver:D,onNodeClick:(C,R)=>g(R.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[u.jsx(Doe,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),u.jsx(Hoe,{showInteractive:!1}),u.jsx(tle,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),u.jsx("aside",{className:"wfb-inspector",children:E?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"wfb-inspector-head",children:[u.jsx("div",{className:"wfb-section-label",children:"节点配置"}),u.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:j,title:"删除节点",children:u.jsx(Tl,{className:"icon"})})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"名称"}),u.jsx("input",{className:`wfb-input ${T?"wfb-input--error":""}`,value:E.data.agent.name,onChange:C=>W({name:C.target.value}),placeholder:"agent_name"}),T?u.jsx("span",{className:"wfb-field-error",children:T}):u.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"描述"}),u.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:C=>W({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),u.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:C=>W({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),u.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:C=>W({tools:C.target.value.split(",").map(R=>R.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),u.jsxs("div",{className:"wfb-inspector-meta",children:[u.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),u.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):u.jsxs("div",{className:"wfb-inspector-empty",children:[u.jsx(ka,{className:"wfb-empty-icon"}),u.jsx("p",{children:"选择一个节点以编辑其配置"}),u.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function cle(e){return u.jsx(oD,{children:u.jsx(lle,{...e})})}const ES=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function u0(e){let t=0;for(let n=0;n>>0;return ES[t%ES.length]}function ule(e){const t=new Map;e.forEach(c=>t.set(c.span_id,c));const n=new Map,r=[];for(const c of e)c.parent_span_id!=null&&t.has(c.parent_span_id)?(n.get(c.parent_span_id)??n.set(c.parent_span_id,[]).get(c.parent_span_id)).push(c):r.push(c);const i=(c,d)=>c.start_time-d.start_time,s=(c,d)=>({span:c,depth:d,children:(n.get(c.span_id)??[]).sort(i).map(f=>s(f,d+1))}),a=r.sort(i).map(c=>s(c,0)),o=e.length?Math.min(...e.map(c=>c.start_time)):0,l=e.length?Math.max(...e.map(c=>c.end_time)):1;return{rootNodes:a,min:o,total:l-o||1}}function dle(e,t){const n=[],r=i=>{n.push(i),t.has(i.span.span_id)||i.children.forEach(r)};return e.forEach(r),n}function xS(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const fle=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function vS(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:fle(t),value:r,long:r.length>80||r.includes(` -`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function hle({appName:e,sessionId:t,onClose:n}){const[r,i]=_.useState(null),[s,a]=_.useState(""),[o,l]=_.useState(new Set),[c,d]=_.useState(null);_.useEffect(()=>{i(null),a(""),VC(e,t).then(E=>{i(E),d(E.length?E.reduce((b,w)=>b.start_time<=w.start_time?b:w).span_id:null)}).catch(E=>a(String(E)))},[e,t]);const{rootNodes:f,min:h,total:p}=_.useMemo(()=>ule(r??[]),[r]),m=_.useMemo(()=>dle(f,o),[f,o]),y=(r==null?void 0:r.find(E=>E.span_id===c))??null,v=p/1e6,g=E=>l(b=>{const w=new Set(b);return w.has(E)?w.delete(E):w.add(E),w});return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"drawer-scrim",onClick:n}),u.jsxs("aside",{className:"drawer drawer--trace",children:[u.jsxs("header",{className:"drawer-head",children:[u.jsxs("div",{children:[u.jsx("div",{className:"drawer-title",children:"调用链路观测"}),u.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${v.toFixed(1)} ms`:"加载中"})]}),u.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:u.jsx(Vr,{className:"icon"})})]}),r==null&&!s&&u.jsxs("div",{className:"drawer-loading",children:[u.jsx(xt,{className:"icon spin"})," 加载调用链路…"]}),s&&u.jsx("div",{className:"error",children:s}),r&&r.length===0&&u.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&u.jsxs("div",{className:"trace-split",children:[u.jsx("div",{className:"trace-tree scroll",children:m.map(E=>{const b=E.span,w=(b.start_time-h)/p*100,N=Math.max((b.end_time-b.start_time)/p*100,.6),T=E.children.length>0;return u.jsxs("button",{className:`trace-row ${c===b.span_id?"active":""}`,onClick:()=>d(b.span_id),children:[u.jsxs("span",{className:"trace-label",style:{paddingLeft:E.depth*14},children:[u.jsx("span",{className:`trace-caret ${T?"":"hidden"} ${o.has(b.span_id)?"":"open"}`,onClick:A=>{A.stopPropagation(),T&&g(b.span_id)},children:u.jsx(rr,{className:"chev"})}),u.jsx("span",{className:"trace-dot",style:{background:u0(b.name)}}),u.jsx("span",{className:"trace-name",title:b.name,children:b.name})]}),u.jsx("span",{className:"trace-dur",children:xS(b.end_time-b.start_time)}),u.jsx("span",{className:"trace-track",children:u.jsx("span",{className:"trace-bar",style:{left:`${w}%`,width:`${N}%`,background:u0(b.name)}})})]},b.span_id)})}),u.jsx("div",{className:"trace-detail scroll",children:y?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"td-title",children:y.name}),u.jsxs("div",{className:"td-dur",children:[u.jsx("span",{className:"td-dot",style:{background:u0(y.name)}}),xS(y.end_time-y.start_time)]}),u.jsx("div",{className:"td-section",children:"属性"}),u.jsx("div",{className:"td-props",children:vS(y).filter(E=>!E.long).map(E=>u.jsxs("div",{className:"td-prop",children:[u.jsx("span",{className:"td-key",children:E.key}),u.jsx("span",{className:"td-val",children:E.value})]},E.key))}),vS(y).filter(E=>E.long).map(E=>u.jsxs("div",{className:"td-block",children:[u.jsx("div",{className:"td-section",children:E.key}),u.jsx("pre",{className:"td-pre",children:E.value})]},E.key))]}):u.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function ple(e){return e.toLowerCase()==="github"?u.jsx(Z8,{className:"icon"}):u.jsx(a9,{className:"icon"})}function mle({branding:e,onUsername:t}){const[n,r]=_.useState(null),[i,s]=_.useState(""),[a,o]=_.useState(0),[l,c]=_.useState("");_.useEffect(()=>{let h=!0;return r(null),s(""),I9().then(p=>{h&&r(p)}).catch(p=>{h&&s(p instanceof Error?p.message:String(p))}),()=>{h=!1}},[a]);const d=S9.test(l),f=()=>{d&&t(l)};return u.jsxs("div",{className:"login",children:[u.jsx("header",{className:"login-top",children:u.jsxs("span",{className:"login-brand",children:[u.jsx("img",{className:"login-brand-logo",src:e.logoUrl||iE,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),u.jsx("main",{className:"login-main",children:u.jsxs("div",{className:"login-card",children:[u.jsx(ld,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),i?u.jsxs("div",{className:"login-provider-error",role:"alert",children:[u.jsx("p",{children:i}),u.jsx("button",{type:"button",onClick:()=>o(h=>h+1),children:"重试"})]}):n===null?null:n.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"login-sub",children:"登录以继续使用"}),u.jsx("div",{className:"login-providers",children:n.map(h=>u.jsxs("button",{className:"login-btn",onClick:()=>O9(h.loginUrl),children:[ple(h.id),u.jsxs("span",{children:["使用 ",h.label," 登录"]})]},h.id))})]}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),u.jsxs("form",{className:"login-name",onSubmit:h=>{h.preventDefault(),f()},children:[u.jsx("input",{className:"login-name-input",value:l,onChange:h=>c(h.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16,autoFocus:!0}),u.jsx("button",{type:"submit",className:"login-name-go",disabled:!d,"aria-label":"进入",children:u.jsx(EC,{className:"icon"})})]}),u.jsx("p",{className:"login-hint","aria-live":"polite",children:l&&!d?"只能包含大小写字母和数字,最多 16 位。":""})]}),u.jsx("p",{className:"login-legal",children:"继续即表示你已阅读并同意服务条款与隐私政策"}),u.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"})]})}),u.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function gle({node:e,ctx:t}){const n=e.variant??"default";return u.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)})}Ua("Button",gle);function yle({node:e,ctx:t}){return u.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Ua("Card",yle);const ble={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},Ele={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function dD(e){return ble[e]??"flex-start"}function fD(e){return Ele[e]??"stretch"}function xle({node:e,ctx:t}){const n=e.children??[];return u.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:dD(e.justify),alignItems:fD(e.align)},children:n.map(r=>t.render(r))})}Ua("Column",xle);function vle({node:e}){const t=e.axis==="vertical";return u.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Ua("Divider",vle);const wle={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function _le({node:e}){const t=e.name??"";return u.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:wle[t]??"•"})}Ua("Icon",_le);function Tle({node:e,ctx:t}){const n=e.children??[];return u.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:dD(e.justify),alignItems:fD(e.align??"center")},children:n.map(r=>t.render(r))})}Ua("Row",Tle);const Nle=new Set(["h1","h2","h3","h4","h5"]);function Sle({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),i=Nle.has(n)?n:"p";return u.jsx(i,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}Ua("Text",Sle);const kle="创建 Agent",Ale={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流"},ao={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},Cle=new Set,Ile=[];function to(){return{skills:[]}}function Ole(e,t){var r;const n=aI(e==null?void 0:e.events);if(n!=="新会话")return n;for(const i of t){if(i.role!=="user")continue;const s=(r=i.blocks.find(a=>a.kind==="text"))==null?void 0:r.text.trim();if(s)return s}return"新会话"}function hD(e,t){if(e.name===t)return e;for(const n of e.children){const r=hD(n,t);if(r)return r}}function pD(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(...pD(n)));return t}function wS(){const e=typeof localStorage<"u"?localStorage.getItem(ao.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function Rle({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),u.jsx("path",{d:"M12 8.2l1.05 2.75 2.75 1.05-2.75 1.05L12 15.8l-1.05-2.75L8.2 12l2.75-1.05z",fill:"currentColor",stroke:"none"})]})}function Lle(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[u.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),u.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),u.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function mD(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 Mle(e){if(!e)return"";const t=[];return e.ts&&t.push(mD(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function Dle(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const Ple="send_a2ui_json_to_client";function jle(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"?t.files.length>0:t.kind==="tool"?!(t.name===Ple&&t.done):t.kind==="a2ui"?_I(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function Ble(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Fle(e){return new Promise((t,n)=>{let r="";try{r=new URL(e,window.location.href).protocol}catch{}if(r!=="http:"&&r!=="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 s=!1;const a=()=>{clearInterval(c),window.removeEventListener("message",l)},o=d=>{if(!s){s=!0,a();try{i.close()}catch{}t(d)}},l=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&o(f.url)};window.addEventListener("message",l);const c=setInterval(()=>{if(!s){if(i.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(s=!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)&&o(d)}catch{}}},500)})}function Ule(e,t){const n=JSON.parse(JSON.stringify(e??{})),r=n.exchangedAuthCredential??n.exchanged_auth_credential??{},i=r.oauth2??{};return i.authResponseUri=t,i.auth_response_uri=t,r.oauth2=i,n.exchangedAuthCredential=r,n}function _S({text:e}){const[t,n]=_.useState(!1);return u.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?u.jsx(Ai,{className:"icon"}):u.jsx(Vb,{className:"icon"})})}function $le(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function Hle({tasks:e,onCancel:t}){const[n,r]=_.useState(!1),[i,s]=_.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],l=a>0?"running":(o==null?void 0:o.status)??"idle",c=a>0?`${a} 个部署任务进行中`:(o==null?void 0:o.status)==="success"?"最近部署已完成":(o==null?void 0:o.status)==="error"?"最近部署失败":(o==null?void 0:o.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{s(f.id),t(f).finally(()=>s(null))};return u.jsxs("div",{className:"global-deploy-center",children:[u.jsxs("button",{type:"button",className:`global-deploy-task is-${l}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[l==="running"?u.jsx(xt,{className:"global-deploy-task-icon spin"}):l==="success"?u.jsx(H8,{className:"global-deploy-task-icon"}):l==="error"?u.jsx(_C,{className:"global-deploy-task-icon"}):l==="cancelled"?u.jsx(z8,{className:"global-deploy-task-icon"}):u.jsx(s9,{className:"global-deploy-task-icon"}),u.jsx("span",{className:"global-deploy-task-detail",children:c}),u.jsx(Fh,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),u.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[u.jsxs("header",{className:"global-deploy-popover-head",children:[u.jsx("span",{children:"部署任务"}),u.jsx("span",{children:e.length})]}),u.jsx("div",{className:"global-deploy-list",children:e.length===0?u.jsx("div",{className:"global-deploy-empty",children:"暂无部署任务"}):e.map(f=>{const h=`${f.label}${f.status==="running"&&typeof f.pct=="number"?` ${Math.round(f.pct)}%`:""}`;return u.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[u.jsxs("div",{className:"global-deploy-item-head",children:[u.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),u.jsx("span",{className:"global-deploy-status",children:h})]}),u.jsxs("dl",{className:"global-deploy-meta",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Runtime 名称"}),u.jsx("dd",{children:f.runtimeName})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"部署地域"}),u.jsx("dd",{children:$le(f.region)})]}),f.runtimeId&&u.jsxs("div",{children:[u.jsx("dt",{children:"Runtime ID"}),u.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?u.jsx(op,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?u.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:u.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),u.jsx("div",{className:"global-deploy-item-actions",children:u.jsx("button",{type:"button",disabled:i===f.id,onClick:()=>d(f),children:i===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const TS=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],NS=()=>TS[Math.floor(Math.random()*TS.length)];function d0(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function zle(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Vle(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"}function Kle(){const[e,t]=_.useState([]),[n,r]=_.useState(""),[i,s]=_.useState([]),[a,o]=_.useState(""),l=_.useRef(null),[c,d]=_.useState(!1),[f,h]=_.useState([]),[p,m]=_.useState({}),y=a?p[a]??[]:f,v=Ole(i.find(Z=>Z.id===a),y),g=(Z,ie)=>m(Se=>({...Se,[Z]:typeof ie=="function"?ie(Se[Z]??[]):ie})),[E,b]=_.useState(""),[w,N]=_.useState([]),[T,A]=_.useState(to),[S,O]=_.useState(null),[I,D]=_.useState(!1),F=_.useRef(new Set),[W,j]=_.useState(()=>new Set),$=_.useRef(new Map),C=(Z,ie)=>j(Se=>{const Fe=new Set(Se);return ie?Fe.add(Z):Fe.delete(Z),Fe}),R=_.useRef(""),[L,M]=_.useState(""),[k,Y]=_.useState(!1),[G,P]=_.useState(NS),[V,Q]=_.useState(null),[re,le]=_.useState(null),[K,q]=_.useState(""),[ae,ge]=_.useState(),[he,de]=_.useState(null),[Ie,_e]=_.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[Ee,Pe]=_.useState("cloud"),[be,Ve]=_.useState(vu),[ke,ce]=_.useState("chat"),[It,Me]=_.useState(!1),[wt,st]=_.useState(!1),[z,X]=_.useState(!1),[oe,we]=_.useState({}),[Ae,Ge]=_.useState({}),[Ot,Ke]=_.useState({}),jt=W.has(a)||c,yt=oe[a]??"",Yt=Ae[a]??Cle,kt=Ot[a]??Ile,Rt=S==null?void 0:S.graph,Le=T.targetAgent&&Rt?hD(Rt,T.targetAgent.name):Rt,at=(Le==null?void 0:Le.skills)??(T.targetAgent?[]:(S==null?void 0:S.skills)??[]),bt=Rt?pD(Rt):[];function Et(Z){d0(Z);for(const ie of Z)ie.status==="uploading"?F.current.add(ie.id):ie.uri&&zf(n,ie.uri).catch(Se=>M(String(Se)))}async function se(Z){try{await Sy(n,K,Z),await Ny(n,K,Z),s(ie=>ie.filter(Se=>Se.id!==Z)),m(ie=>{const{[Z]:Se,...Fe}=ie;return Fe})}catch(ie){M(String(ie))}}function Ce(Z){const ie=w.find(Ze=>Ze.id===Z);if(!ie)return;const Se=w.filter(Ze=>Ze.id!==Z);d0([ie]),ie.status==="uploading"&&F.current.add(Z),N(Se),Se.length===0&&!E.trim()&&!!a&&y.length===0?(R.current="",o(""),se(a)):ie.uri&&zf(n,ie.uri).catch(Ze=>M(String(Ze)))}const We=(Z,ie)=>{var ct,Je,nn,Oe,At;const Se=ie.author&&ie.author!=="user"?ie.author:void 0;Se&&(we(Tt=>({...Tt,[Z]:Se})),Ge(Tt=>({...Tt,[Z]:new Set(Tt[Z]??[]).add(Se)})),Ke(Tt=>{var Lt;return(Lt=Tt[Z])!=null&&Lt.length?Tt:{...Tt,[Z]:[Se]}}));const Fe=((ct=ie.actions)==null?void 0:ct.transferToAgent)??((Je=ie.actions)==null?void 0:Je.transfer_to_agent);Fe&&Ke(Tt=>{const Lt=Tt[Z]??[];return Lt[Lt.length-1]===Fe?Tt:{...Tt,[Z]:[...Lt,Fe]}}),(((nn=ie.actions)==null?void 0:nn.endOfAgent)??((Oe=ie.actions)==null?void 0:Oe.end_of_agent)??((At=ie.actions)==null?void 0:At.escalate))&&Ke(Tt=>{const Lt=Tt[Z]??[];return Lt.length<=1?Tt:{...Tt,[Z]:Lt.slice(0,-1)}})},[Jt,Xe]=_.useState(wS),[te,xe]=_.useState([]),ye=_.useCallback(Z=>{xe(ie=>{const Se=ie.findIndex(Ze=>Ze.id===Z.id);if(Se===-1)return[Z,...ie];const Fe=[...ie];return Fe[Se]={...Fe[Se],...Z},Fe})},[]),Be=_.useCallback(async Z=>{try{await GC(Z.id),xe(ie=>ie.map(Se=>Se.id===Z.id?{...Se,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:Se))}catch(ie){const Se=ie instanceof Error?ie.message:String(ie);xe(Fe=>Fe.map(Ze=>Ze.id===Z.id?{...Ze,message:`取消失败:${Se}`}:Ze))}},[]),[He,$e]=_.useState(!0),[ot,it]=_.useState(!1),[mn,mt]=_.useState(!1),[kn,lt]=_.useState(!1),[An,gn]=_.useState(null),[br,an]=_.useState(!1),[Cn,_t]=_.useState(!1),Un=_.useRef(null),[on,Xn]=_.useState(()=>{const Z=$i();return Nl(Z),Z}),[Qn,In]=_.useState(!1),Dn=_.useRef(!1),vn=_.useRef(!1);function wn(Z){console.log("create agent draft:",Z),Xe(null),tt()}function _n(Z,ie){console.log("Agent added, navigating to:",Z,ie),Xn($i()),Xe(null),r(Z)}const{ref:en,onScroll:ee}=TI(y),Te=_.useCallback(()=>{le(null),L9().then(Z=>{q(Z.userId),ge(Z.info),st(!!Z.local),Q(Z.status)}).catch(Z=>{le(Z instanceof Error?Z.message:String(Z))})},[]);_.useEffect(()=>{Te()},[Te]),_.useEffect(()=>{if(V!=="authenticated"||!K){de(null);return}let Z=!1;return de(null),JC().then(ie=>{Z||de(ie)}).catch(ie=>{console.warn("[app] /web/access failed; using ordinary-user access:",ie),Z||de(ZC)}),()=>{Z=!0}},[V,K]),_.useEffect(()=>{QC().then(Z=>{_e(Z.features),Pe(Z.agentsSource),Ve(Z.branding),ce(Z.defaultView),Me(!0)})},[]),_.useEffect(()=>{!he||!It||vn.current||(vn.current=!0,ke==="addAgent"&&he.capabilities.createAgents&&(Xe(null),it(!1),an(!1),_t(!1),mt(!1),lt(!0)))},[he,ke,It]),_.useEffect(()=>{he&&(he.capabilities.createAgents||(Xe(null),gn(null),mt(!1),lt(!1),xe([])),he.capabilities.manageAgents||_t(!1))},[he]),_.useEffect(()=>{document.title=be.title;let Z=document.querySelector('link[rel~="icon"]');Z||(Z=document.createElement("link"),Z.rel="icon",document.head.appendChild(Z)),Z.removeAttribute("type"),Z.href=be.logoUrl||iE},[be]),_.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(Z=>Z.ok?Z.json():null).then(Z=>{Z&&$e(!!Z.credentials)}).catch(Z=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",Z)})},[]);function De(Z){k9(Z),Dn.current=!0,vn.current=!1,de(null),Xe(null),gn(null),it(!1),mt(!1),lt(!1),an(!1),_t(!1),tt(),q(Z),ge({name:Z}),st(!0),Q("authenticated")}function ze(){vn.current=!1,de(null),wt?(A9(),q(""),ge(void 0),Q("unauthenticated")):R9()}_.useEffect(()=>{V!=="unauthenticated"&&UC().then(Z=>{if(t(Z),Ee==="cloud"){r("");return}const ie=localStorage.getItem(ao.app),Se=on.flatMap(ct=>ct.apps.map(Je=>Ca(ct.id,Je))),Fe=ie&&(Z.includes(ie)||Se.includes(ie)),Ze=["web_search_agent","web_demo"].find(ct=>Z.includes(ct))??Z.find(ct=>!/^\d/.test(ct))??Z[0];r(Fe?ie:Ze||"")}).catch(Z=>M(String(Z)))},[V,Ee]),_.useEffect(()=>{n&&localStorage.setItem(ao.app,n)},[n]),_.useEffect(()=>{let Z=!1;if(O(null),A(to()),!n){D(!1);return}return D(!0),Ju(n).then(ie=>{Z||O(ie)}).catch(()=>{Z||O(null)}).finally(()=>{Z||D(!1)}),()=>{Z=!0}},[n]),_.useEffect(()=>{he&&localStorage.setItem(ao.view,he.capabilities.createAgents?Jt??"chat":"chat")},[he,Jt]),_.useEffect(()=>{localStorage.setItem(ao.session,a),R.current=a},[a]),_.useEffect(()=>()=>$.current.forEach(Z=>Z.abort()),[]),_.useEffect(()=>{!n||!K||(async()=>{const Z=await ht(n);if(!Dn.current){Dn.current=!0;const ie=localStorage.getItem(ao.session)||"";if(wS()===null&&ie&&Z.some(Se=>Se.id===ie)){Wt(ie);return}}tt()})()},[n,K]),_.useEffect(()=>{const Z=Un.current;Z&&Z.app===n&&(Un.current=null,Wt(Z.sid))},[n]);function gt(Z,ie){an(!1),Z===n?Wt(ie):(Un.current={app:Z,sid:ie},r(Z))}async function ht(Z){try{const ie=await eE(Z,K),Se=await Promise.all(ie.map(Fe=>{var Ze;return(Ze=Fe.events)!=null&&Ze.length?Promise.resolve(Fe):$h(Z,K,Fe.id)}));return s(Se),Se}catch(ie){return M(String(ie)),[]}}function tt(){M(""),P(NS());const Z=a&&y.length===0&&w.length>0?a:"";R.current="",o(""),d(!1),h([]),A(to()),Et(w),N([]),Z&&se(Z)}async function tn(Z){var ie;try{(ie=$.current.get(Z))==null||ie.abort(),await Sy(n,K,Z),await Ny(n,K,Z),m(Se=>{const{[Z]:Fe,...Ze}=Se;return Ze}),Z===a&&tt(),await ht(n)}catch(Se){M(String(Se))}}async function Wt(Z){if(Z!==a&&(R.current=Z,M(""),d(!1),h([]),A(to()),o(Z),p[Z]===void 0)){X(!0);try{const ie=await $h(n,K,Z);g(Z,Y9(ie.events??[]))}catch(ie){M(String(ie))}finally{X(!1)}}}async function ln(Z=!0){if(a)return a;l.current||(l.current=Uh(n,K));const ie=l.current;try{const Se=await ie;Z&&o(Se);const Fe=Date.now()/1e3,Ze={id:Se,lastUpdateTime:Fe,events:[]};return s(ct=>[Ze,...ct.filter(Je=>Je.id!==Se)]),Se}finally{l.current===ie&&(l.current=null)}}async function Ka(Z){M("");let ie;try{ie=await ln()}catch(Fe){M(String(Fe));return}const Se=Array.from(Z).map(Fe=>({file:Fe,attachment:{id:zle(),mimeType:Vle(Fe),name:Fe.name,sizeBytes:Fe.size,status:"uploading"}}));N(Fe=>[...Fe,...Se.map(Ze=>Ze.attachment)]),await Promise.all(Se.map(async({file:Fe,attachment:Ze})=>{try{const ct=await $C(n,K,ie,Fe);if(F.current.delete(Ze.id)){ct.uri&&await zf(n,ct.uri);return}N(Je=>Je.map(nn=>nn.id===Ze.id?ct:nn))}catch(ct){if(F.current.delete(Ze.id))return;const Je=ct instanceof Error?ct.message:String(ct);N(nn=>nn.map(Oe=>Oe.id===Ze.id?{...Oe,status:"error",error:Je}:Oe)),M(Je)}}))}async function pi(Z,ie=[],Se=to()){if(!Z.trim()&&ie.length===0||jt||!n||!K)return;M("");const Fe=[];(Se.skills.length>0||Se.targetAgent)&&Fe.push({kind:"invocation",value:Se}),ie.length&&Fe.push({kind:"attachment",files:ie.map(Oe=>({id:Oe.id,mimeType:Oe.mimeType,data:Oe.data,uri:Oe.uri,name:Oe.name,sizeBytes:Oe.sizeBytes}))}),Z.trim()&&Fe.push({kind:"text",text:Z});const Ze=[{role:"user",blocks:Fe,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],ct=!a;ct&&(h(Ze),d(!0));let Je;try{Je=await ln(!ct)}catch(Oe){ct&&(h([]),d(!1),b(Z),A(Se)),M(String(Oe));return}g(Je,Ze),ct&&(R.current=Je,o(Je),h([]),d(!1));const nn=new AbortController;$.current.set(Je,nn),C(Je,!0),R.current=Je,we(Oe=>({...Oe,[Je]:""})),Ge(Oe=>({...Oe,[Je]:new Set})),Ke(Oe=>({...Oe,[Je]:[]}));try{let Oe=Ui(),At=0,Tt=Date.now()/1e3;for await(const Lt of xu({appName:n,userId:K,sessionId:Je,text:Z,attachments:ie,invocation:Se,signal:nn.signal})){if(nn.signal.aborted)break;const is=Lt.error??Lt.errorMessage??Lt.error_message;if(typeof is=="string"&&is){R.current===Je&&M(is);break}We(Je,Lt),Oe=tl(Oe,Lt);const Ya=Lt.usageMetadata??Lt.usage_metadata;Ya!=null&&Ya.totalTokenCount&&(At=Ya.totalTokenCount),Lt.timestamp&&(Tt=Lt.timestamp);const Sm=Oe.blocks,Ws={tokens:At||void 0,ts:Tt};g(Je,qs=>{const ss=qs.slice(),Nd=ss[ss.length-1];return(Nd==null?void 0:Nd.role)==="assistant"&&(ss[ss.length-1]={...Nd,blocks:Sm,meta:Ws}),ss})}ht(n)}catch(Oe){(Oe==null?void 0:Oe.name)!=="AbortError"&&!nn.signal.aborted&&R.current===Je&&M(String(Oe))}finally{$.current.get(Je)===nn&&$.current.delete(Je),C(Je,!1),we(Oe=>({...Oe,[Je]:""})),Ke(Oe=>({...Oe,[Je]:[]}))}}function jl(Z,ie){var Ze,ct;const Se=((Ze=Z==null?void 0:Z.event)==null?void 0:Ze.name)??ie.id,Fe=((ct=Z==null?void 0:Z.event)==null?void 0:ct.context)??{};pi(`[ui-action] ${Se}: ${JSON.stringify(Fe)}`)}async function vd(Z){if(!Z.authUri)throw new Error("事件中没有授权地址。");if(!n||!K||!a)throw new Error("会话尚未就绪。");const ie=a,Se=await Fle(Z.authUri),Fe=Ule(Z.authConfig,Se),Ze=Oe=>Oe.map(At=>At.kind==="auth"&&!At.done?{...At,done:!0}:At);g(ie,Oe=>{const At=Oe.slice(),Tt=At[At.length-1];return(Tt==null?void 0:Tt.role)==="assistant"&&(At[At.length-1]={...Tt,blocks:Ze(Tt.blocks)}),At});const ct=y[y.length-1],Je=Ze(ct&&ct.role==="assistant"?ct.blocks:[]),nn=new AbortController;$.current.set(ie,nn),C(ie,!0);try{let Oe=Ui(),At=0,Tt=Date.now()/1e3;for await(const Lt of xu({appName:n,userId:K,sessionId:a,text:"",functionResponses:[{id:Z.callId,name:"adk_request_credential",response:Fe}],signal:nn.signal})){if(nn.signal.aborted)break;We(ie,Lt),Oe=tl(Oe,Lt);const is=Lt.usageMetadata??Lt.usage_metadata;is!=null&&is.totalTokenCount&&(At=is.totalTokenCount),Lt.timestamp&&(Tt=Lt.timestamp);const Ya=[...Je,...Oe.blocks];g(ie,Sm=>{var ss;const Ws=Sm.slice(),qs=Ws[Ws.length-1];return(qs==null?void 0:qs.role)==="assistant"&&(Ws[Ws.length-1]={...qs,blocks:Ya,meta:{tokens:At||((ss=qs.meta)==null?void 0:ss.tokens),ts:Tt}}),Ws})}ht(n)}catch(Oe){(Oe==null?void 0:Oe.name)!=="AbortError"&&!nn.signal.aborted&&R.current===ie&&M(String(Oe))}finally{$.current.get(ie)===nn&&$.current.delete(ie),C(ie,!1),we(Oe=>({...Oe,[ie]:""})),Ke(Oe=>({...Oe,[ie]:[]}))}}if(re)return u.jsxs("div",{className:"boot boot-error",children:[u.jsx("p",{children:re}),u.jsx("button",{type:"button",onClick:Te,children:"重试"})]});if(V===null)return u.jsx("div",{className:"boot"});if(V==="unauthenticated")return u.jsx(mle,{branding:be,onUsername:De});if(!he)return u.jsx("div",{className:"boot"});const rs=he.capabilities.createAgents,wd=he.capabilities.manageAgents,or=rs?Jt:null,Bl=rs&&kn,Fl=rs&&mn,Ul=wd&&Cn,vx=fI(e,on),_d=Z=>{var ie;return((ie=vx.find(Se=>Se.id===Z))==null?void 0:ie.label)??Z},$l=on.find(Z=>Z.runtimeId&&Z.apps.some(ie=>Ca(Z.id,ie)===n)),Td=$l&&$l.runtimeId?{runtimeId:$l.runtimeId,name:$l.name,region:$l.region??"cn-beijing"}:void 0,Nm=Z=>{Xn($i()),R.current="",o(""),r(Z)},gD=async Z=>{const ie=await rE(Z.runtimeId,Z.name,Z.region);Nm(ie)};return u.jsxs("div",{className:"layout",children:[u.jsx(OF,{branding:be,access:he,agentsSource:Ee,localApps:e,currentAgentId:n,currentAgentLabel:n?_d(n):"",currentRuntime:Td,onSelectAgent:Nm,features:Ie,sessions:i,currentSessionId:a,streamingSids:W,onNewChat:()=>{Xe(null),it(!1),mt(!1),lt(!1),an(!1),_t(!1),tt()},onSearch:()=>{Xe(null),it(!1),mt(!1),lt(!1),_t(!1),an(!0),M("")},onQuickCreate:()=>{if(!rs){M("当前账号没有添加 Agent 的权限。");return}R.current="",o(""),it(!1),mt(!1),an(!1),_t(!1),Xe(null),gn(null),lt(!0),M("")},onSkillCenter:()=>{Xe(null),mt(!1),lt(!1),an(!1),_t(!1),it(!0),M("")},onAddAgent:()=>{if(!rs){M("当前账号没有添加 Agent 的权限。");return}R.current="",Xe(null),it(!1),an(!1),_t(!1),o(""),lt(!1),mt(!0),M("")},onManageAgents:()=>{if(!wd){M("当前账号没有管理 Agent 的权限。");return}R.current="",o(""),Xe(null),it(!1),mt(!1),lt(!1),an(!1),_t(!0),M("")},onPickSession:Z=>{Xe(null),it(!1),mt(!1),lt(!1),an(!1),_t(!1),M(""),Wt(Z)},onDeleteSession:tn,userInfo:ae,onLogout:ze}),(()=>{const Z=u.jsx(HQ,{sessionId:a,sessionInitializing:c,appName:n,agentName:n?_d(n):"Agent",value:E,onChange:b,onSubmit:()=>{const ie=E,Se=w,Fe=T;b(""),N([]),A(to()),pi(ie,Se,Fe),d0(Se)},disabled:!n||!K,busy:jt,showMeta:y.length>0,attachments:w,skills:at,agents:bt,invocation:T,capabilitiesLoading:I,onInvocationChange:A,onAddFiles:Ka,onRemoveAttachment:Ce});return u.jsxs("section",{className:"main-shell",children:[u.jsx(RF,{apps:vx.map(ie=>ie.id),appName:n,onAppChange:Nm,agentLabel:_d,title:Bl?"添加 Agent":Fl?"添加 AgentKit 智能体":ot?"技能中心":br?"搜索":Ul?"管理 Agent":or?void 0:v,crumbs:br||Fl||ot||Bl||!or?void 0:or==="menu"?[{label:kle,onClick:()=>{Xe(null),gn(null),lt(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>In(!0)},{label:Ale[or]}],rightContent:u.jsx(Hle,{tasks:rs?te:[],onCancel:Be})}),u.jsxs("main",{className:"main",children:[L&&u.jsx("div",{className:"error",children:L}),z&&u.jsxs("div",{className:"session-loading",children:[u.jsx(xt,{className:"icon spin"})," 加载会话…"]}),Ul?u.jsx(jF,{currentRuntimeId:Td==null?void 0:Td.runtimeId,onConnect:gD}):Bl?u.jsx(fL,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:Rle,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{lt(!1),gn(null),Xe("menu")}}]}):br?u.jsx(lF,{userId:K,appId:n,agentInfo:S,capabilitiesLoading:I,agentLabel:_d,onOpenSession:gt}):Fl?u.jsx(PF,{onAdded:ie=>{Xn($i()),mt(!1),r(ie)},onCancel:()=>mt(!1)}):ot?u.jsx(X9,{}):or!==null&&!He?u.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:[u.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),u.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",u.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",u.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):or==="menu"?u.jsx(hJ,{onSelect:ie=>{gn(null),Xe(ie)},onImport:ie=>{gn(ie),Xe("custom")}}):or==="intelligent"?u.jsx(YJ,{userId:K,onBack:()=>Xe("menu"),onCreate:wn,onAgentAdded:_n,onDeploymentTaskChange:ye}):or==="custom"?u.jsx(Ree,{initialDraft:An??void 0,onBack:()=>Xe("menu"),onCreate:wn,onAgentAdded:_n,features:Ie,onDeploymentTaskChange:ye}):or==="template"?u.jsx(Dee,{onBack:()=>Xe("menu"),onCreate:wn}):or==="workflow"?u.jsx(cle,{onBack:()=>Xe("menu"),onCreate:wn}):y.length===0?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"welcome",children:[u.jsx(ld,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:G}),Z]}),u.jsx(d_,{appName:n,activeAgent:yt,seenAgents:Yt,execPath:kt})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"transcript",ref:en,onScroll:ee,children:y.map((ie,Se)=>{var ct;const Fe=Se===y.length-1;if(ie.role==="user"){const Je=ie.blocks.map(At=>At.kind==="text"?At.text:"").join(""),nn=ie.blocks.flatMap(At=>At.kind==="attachment"?At.files:[]),Oe=ie.blocks.find(At=>At.kind==="invocation");return u.jsxs(zt.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Oe==null?void 0:Oe.kind)==="invocation"&&u.jsx(ME,{value:Oe.value}),nn.length>0&&u.jsx(PE,{appName:n,items:nn}),Je&&u.jsx("div",{className:"bubble",children:u.jsx(rm,{text:Je})}),u.jsxs("div",{className:"turn-actions turn-actions--right",children:[((ct=ie.meta)==null?void 0:ct.ts)&&u.jsx("span",{className:"meta-text",children:mD(ie.meta.ts)}),u.jsx(_S,{text:Je})]})]},Se)}const Ze=ie.blocks.length===0;return u.jsx(zt.div,{className:"turn turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:Ze?Fe&&jt?u.jsx(uL,{}):null:u.jsxs(u.Fragment,{children:[u.jsx(dL,{appName:n,blocks:ie.blocks,onAction:jl,onAuth:vd}),!(Fe&&jt)&&!jle(ie)&&u.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(Fe&&jt)&&!Ble(ie)&&u.jsxs("div",{className:"turn-meta",children:[u.jsxs("div",{className:"turn-actions",children:[u.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>Y(!0),children:u.jsx(Lle,{})}),u.jsx(_S,{text:Dle(ie)})]}),ie.meta&&u.jsx("span",{className:"meta-text",children:Mle(ie.meta)})]})]})},Se)})}),u.jsx(d_,{appName:n,activeAgent:yt,seenAgents:Yt,execPath:kt}),Z]})]})]})})(),k&&a&&u.jsx(hle,{appName:n,sessionId:a,onClose:()=>Y(!1)}),Qn&&u.jsx("div",{className:"confirm-scrim",onClick:()=>In(!1),children:u.jsxs("div",{className:"confirm-box",onClick:Z=>Z.stopPropagation(),children:[u.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),u.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),u.jsxs("div",{className:"confirm-actions",children:[u.jsx("button",{className:"confirm-btn",onClick:()=>In(!1),children:"取消"}),u.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{gn(null),Xe("menu"),In(!1)},children:"确定返回"})]})]})})]})}(()=>{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})()||f0.createRoot(document.getElementById("root")).render(u.jsx(Qe.StrictMode,{children:u.jsx(J4,{reducedMotion:"user",children:u.jsx(R8,{maskOpacity:.9,children:u.jsx(Kle,{})})})}));export{_ as A,Gp as B,Sr as C,Gle as D,Bc as E,Ia as F,hO as G,Yle as R,qn as V,Qe as a,rl as b,nT as c,Xle as d,fE as e,iH as f,Tu as g,ut as h,vV as i,AV as j,aH as k,Uu as l,AK as m,cV as n,uV as o,PK as p,nK as q,rK as r,TO as s,u as t,je as u,Ct as v,nt as w,qle as x,EV as y,Qo as z}; +`)),d=c.reduce((f,h)=>f.concat(...h),[]);return[c,d]}return[[],[]]},[e]);return _.useEffect(()=>{const l=(t==null?void 0:t.target)??nS,c=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=p=>{var v,g;if(i.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!i.current||i.current&&!c)&&h3(p))return!1;const y=iS(p.code,o);if(s.current.add(p[y]),rS(a,s.current,!1)){const E=((g=(v=p.composedPath)==null?void 0:v.call(p))==null?void 0:g[0])||p.target,b=(E==null?void 0:E.nodeName)==="BUTTON"||(E==null?void 0:E.nodeName)==="A";t.preventDefault!==!1&&(i.current||!b)&&p.preventDefault(),r(!0)}},f=p=>{const m=iS(p.code,o);rS(a,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(p[m]),p.key==="Meta"&&s.current.clear(),i.current=!1},h=()=>{s.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function rS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function iS(e,t){return t.includes(e)?"code":"key"}const uae=()=>{const e=zt();return _.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:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,s],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:s,maxZoom:a,panZoom:o}=e.getState(),l=hx(t,r,i,s,a,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(l,{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:r,snapGrid:i,snapToGrid:s,domNode:a}=e.getState();if(!a)return t;const{x:o,y:l}=a.getBoundingClientRect(),c={x:t.x-o,y:t.y-l},d=n.snapGrid??i,f=n.snapToGrid??s;return Hl(c,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:s}=r.getBoundingClientRect(),a=xl(t,n);return{x:a.x+i,y:a.y+s}}}),[])};function F3(e,t){const n=[],r=new Map,i=[];for(const s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const a=r.get(s.id);a?a.push(s):r.set(s.id,[s])}for(const s of t){const a=r.get(s.id);if(!a){n.push(s);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){n.push({...a[0].item});continue}const o={...s};for(const l of a)dae(l,o);n.push(o)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function dae(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 U3(e,t){return F3(e,t)}function $3(e,t){return F3(e,t)}function ca(e,t){return{id:e,type:"select",selected:t}}function Do(e,t=new Set,n=!1){const r=[];for(const[i,s]of e){const a=t.has(i);!(s.selected===void 0&&!a)&&s.selected!==a&&(n&&(s.selected=a),r.push(ca(s.id,a)))}return r}function sS({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const o=t.get(a.id),l=((i=o==null?void 0:o.internals)==null?void 0:i.userNode)??o;l!==void 0&&l!==a&&n.push({id:a.id,item:a,type:"replace"}),l===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function aS(e){return{id:e.id,type:"remove"}}const fae=c3();function H3(e,t,n={}){return Bie(e,t,{...n,onError:n.onError??fae})}const oS=e=>_ie(e),hae=e=>s3(e);function z3(e){return _.forwardRef(e)}const pae=typeof window<"u"?_.useLayoutEffect:_.useEffect;function lS(e){const[t,n]=_.useState(BigInt(0)),[r]=_.useState(()=>mae(()=>n(i=>i+BigInt(1))));return pae(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function mae(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const V3=_.createContext(null);function gae({children:e}){const t=zt(),n=_.useCallback(o=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let y=l;for(const g of o)y=typeof g=="function"?g(y):g;let v=sS({items:y,lookup:h});for(const g of m.values())v=g(v);d&&c(y),v.length>0?f==null||f(v):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:E,setNodes:b}=t.getState();g&&b(E)})},[]),r=lS(n),i=_.useCallback(o=>{const{edges:l=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let p=l;for(const m of o)p=typeof m=="function"?m(p):m;d?c(p):f&&f(sS({items:p,lookup:h}))},[]),s=lS(i),a=_.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return u.jsx(V3.Provider,{value:a,children:e})}function yae(){const e=_.useContext(V3);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const bae=e=>!!e.panZoom;function xx(){const e=uae(),t=zt(),n=yae(),r=ct(bae),i=_.useMemo(()=>{const s=f=>t.getState().nodeLookup.get(f),a=f=>{n.nodeQueue.push(f)},o=f=>{n.edgeQueue.push(f)},l=f=>{var g,E;const{nodeLookup:h,nodeOrigin:p}=t.getState(),m=oS(f)?f:h.get(f.id),y=m.parentId?d3(m.position,m.measured,m.parentId,h,p):m.position,v={...m,position:y,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((E=m.measured)==null?void 0:E.height)??m.height};return El(v)},c=(f,h,p={replace:!1})=>{a(m=>m.map(y=>{if(y.id===f){const v=typeof h=="function"?h(y):h;return p.replace&&oS(v)?v:{...y,...v}}return y}))},d=(f,h,p={replace:!1})=>{o(m=>m.map(y=>{if(y.id===f){const v=typeof h=="function"?h(y):h;return p.replace&&hae(v)?v:{...y,...v}}return y}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;return(h=s(f))==null?void 0:h.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:a,setEdges:o,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,y,v]=p;return{nodes:f.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:m,y,zoom:v}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:p,edges:m,onNodesDelete:y,onEdgesDelete:v,triggerNodeChanges:g,triggerEdgeChanges:E,onDelete:b,onBeforeDelete:w}=t.getState(),{nodes:N,edges:T}=await Aie({nodesToRemove:f,edgesToRemove:h,nodes:p,edges:m,onBeforeDelete:w}),A=T.length>0,S=N.length>0;if(A){const R=T.map(aS);v==null||v(T),E(R)}if(S){const R=N.map(aS);y==null||y(N),g(R)}return(S||A)&&(b==null||b({nodes:N,edges:T})),{deletedNodes:N,deletedEdges:T}},getIntersectingNodes:(f,h=!0,p)=>{const m=jN(f),y=m?f:l(f),v=p!==void 0;return y?(p||t.getState().nodes).filter(g=>{const E=t.getState().nodeLookup.get(g.id);if(E&&!m&&(g.id===f.id||!E.internals.positionAbsolute))return!1;const b=El(v?g:E),w=Hu(b,y);return h&&w>0||w>=b.width*b.height||w>=y.width*y.height}):[]},isNodeIntersecting:(f,h,p=!0)=>{const y=jN(f)?f:l(f);if(!y)return!1;const v=Hu(y,h);return p&&v>0||v>=h.width*h.height||v>=y.width*y.height},updateNode:c,updateNodeData:(f,h,p={replace:!1})=>{c(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},updateEdge:d,updateEdgeData:(f,h,p={replace:!1})=>{d(f,m=>{const y=typeof h=="function"?h(m):h;return p.replace?{...m,data:y}:{...m,data:{...m.data,...y}}},p)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return Tie(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??Rie();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return _.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const cS=e=>e.selected,Eae=typeof window<"u"?window:void 0;function xae({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=zt(),{deleteElements:r}=xx(),i=Vu(e,{actInsideInputWithModifier:!1}),s=Vu(t,{target:Eae});_.useEffect(()=>{if(i){const{edges:a,nodes:o}=n.getState();r({nodes:o.filter(cS),edges:a.filter(cS)}),n.setState({nodesSelectionActive:!1})}},[i]),_.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function vae(e){const t=zt();_.useEffect(()=>{const n=()=>{var i,s,a,o;if(!e.current||!(((s=(i=e.current).checkVisibility)==null?void 0:s.call(i))??!0))return!1;const r=px(e.current);(r.height===0||r.width===0)&&((o=(a=t.getState()).onError)==null||o.call(a,"004",mi.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Tm={position:"absolute",width:"100%",height:"100%",top:0,left:0},wae=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function _ae({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=ka.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:l,translateExtent:c,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:p=!0,children:m,noWheelClassName:y,noPanClassName:v,onViewportChange:g,isControlledViewport:E,paneClickDistance:b,selectionOnDrag:w}){const N=zt(),T=_.useRef(null),{userSelectionActive:A,lib:S,connectionInProgress:R}=ct(wae,Ht),I=Vu(h),D=_.useRef();vae(T);const F=_.useCallback(W=>{g==null||g({x:W[0],y:W[1],zoom:W[2]}),E||N.setState({transform:W})},[g,E]);return _.useEffect(()=>{if(T.current){D.current=pse({domNode:T.current,minZoom:d,maxZoom:f,translateExtent:c,viewport:l,onDraggingChange:C=>N.setState(O=>O.paneDragging===C?O:{paneDragging:C}),onPanZoomStart:(C,O)=>{const{onViewportChangeStart:L,onMoveStart:M}=N.getState();M==null||M(C,O),L==null||L(O)},onPanZoom:(C,O)=>{const{onViewportChange:L,onMove:M}=N.getState();M==null||M(C,O),L==null||L(O)},onPanZoomEnd:(C,O)=>{const{onViewportChangeEnd:L,onMoveEnd:M}=N.getState();M==null||M(C,O),L==null||L(O)}});const{x:W,y:j,zoom:$}=D.current.getViewport();return N.setState({panZoom:D.current,transform:[W,j,$],domNode:T.current.closest(".react-flow")}),()=>{var C;(C=D.current)==null||C.destroy()}}},[]),_.useEffect(()=>{var W;(W=D.current)==null||W.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:I,preventScrolling:p,noPanClassName:v,userSelectionActive:A,noWheelClassName:y,lib:S,onTransformChange:F,connectionInProgress:R,selectionOnDrag:w,paneClickDistance:b})},[e,t,n,r,i,s,a,o,I,p,v,A,y,S,F,R,w,b]),u.jsx("div",{className:"react-flow__renderer",ref:T,style:Tm,children:m})}const Tae=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Nae(){const{userSelectionActive:e,userSelectionRect:t}=ct(Tae,Ht);return e&&t?u.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 o0=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Sae=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function kae({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Uu.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:s,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:d,onPaneScroll:f,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:m,children:y}){const v=_.useRef(0),g=zt(),{userSelectionActive:E,elementsSelectable:b,dragging:w,connectionInProgress:N,panBy:T,autoPanSpeed:A}=ct(Sae,Ht),S=b&&(e||E),R=_.useRef(null),I=_.useRef(),D=_.useRef(new Set),F=_.useRef(new Set),W=_.useRef(!1),j=_.useRef({x:0,y:0}),$=_.useRef(!1),C=K=>{if(W.current||N){W.current=!1;return}c==null||c(K),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},O=K=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){K.preventDefault();return}d==null||d(K)},L=f?K=>f(K):void 0,M=K=>{W.current&&(K.stopPropagation(),W.current=!1)},k=K=>{var je,be;const{domNode:q,transform:ae}=g.getState();if(I.current=q==null?void 0:q.getBoundingClientRect(),!I.current)return;const ye=K.target===R.current;if(!ye&&!!K.target.closest(".nokey")||!e||!(a&&ye||t)||K.button!==0||!K.isPrimary)return;(be=(je=K.target)==null?void 0:je.setPointerCapture)==null||be.call(je,K.pointerId),W.current=!1;const{x:Ie,y:_e}=ci(K.nativeEvent,I.current),xe=Hl({x:Ie,y:_e},ae);g.setState({userSelectionRect:{width:0,height:0,startX:xe.x,startY:xe.y,x:Ie,y:_e}}),ye||(K.stopPropagation(),K.preventDefault())};function Y(K,q){const{userSelectionRect:ae}=g.getState();if(!ae)return;const{transform:ye,nodeLookup:he,edgeLookup:de,connectionLookup:Ie,triggerNodeChanges:_e,triggerEdgeChanges:xe,defaultEdgeOptions:je}=g.getState(),be={x:ae.startX,y:ae.startY},{x:Ve,y:ke}=xl(be,ye),ce={startX:be.x,startY:be.y,x:Kit.id)),F.current=new Set;const xt=(je==null?void 0:je.selectable)??!0;for(const it of D.current){const z=Ie.get(it);if(z)for(const{edgeId:X}of z.values()){const oe=de.get(X);oe&&(oe.selectable??xt)&&F.current.add(X)}}if(!BN(Nt,D.current)){const it=Do(he,D.current,!0);_e(it)}if(!BN(De,F.current)){const it=Do(de,F.current);xe(it)}g.setState({userSelectionRect:ce,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!i||!I.current)return;const[K,q]=fx(j.current,I.current,A);T({x:K,y:q}).then(ae=>{if(!W.current||!ae){v.current=requestAnimationFrame(G);return}const{x:ye,y:he}=j.current;Y(ye,he),v.current=requestAnimationFrame(G)})}const P=()=>{cancelAnimationFrame(v.current),v.current=0,$.current=!1};_.useEffect(()=>()=>P(),[]);const V=K=>{const{userSelectionRect:q,transform:ae,resetSelectedElements:ye}=g.getState();if(!I.current||!q)return;const{x:he,y:de}=ci(K.nativeEvent,I.current);j.current={x:he,y:de};const Ie=xl({x:q.startX,y:q.startY},ae);if(!W.current){const _e=t?0:s;if(Math.hypot(he-Ie.x,de-Ie.y)<=_e)return;ye(),o==null||o(K)}W.current=!0,$.current||(G(),$.current=!0),Y(he,de)},Q=K=>{var q,ae;K.button===0&&((ae=(q=K.target)==null?void 0:q.releasePointerCapture)==null||ae.call(q,K.pointerId),!E&&K.target===R.current&&g.getState().userSelectionRect&&(C==null||C(K)),g.setState({userSelectionActive:!1,userSelectionRect:null}),W.current&&(l==null||l(K),g.setState({nodesSelectionActive:D.current.size>0})),P())},ne=K=>{var q,ae;(ae=(q=K.target)==null?void 0:q.releasePointerCapture)==null||ae.call(q,K.pointerId),P()},le=r===!0||Array.isArray(r)&&r.includes(0);return u.jsxs("div",{className:xn(["react-flow__pane",{draggable:le,dragging:w,selection:e}]),onClick:S?void 0:o0(C,R),onContextMenu:o0(O,R),onWheel:o0(L,R),onPointerEnter:S?void 0:h,onPointerMove:S?V:p,onPointerUp:S?Q:void 0,onPointerCancel:S?ne:void 0,onPointerDownCapture:S?k:void 0,onClickCapture:S?M:void 0,onPointerLeave:m,ref:R,style:Tm,children:[y,u.jsx(Nae,{})]})}function g1({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:a,nodeLookup:o,onError:l}=t.getState(),c=o.get(e);if(!c){l==null||l("012",mi.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):i([e])}function K3({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:a}){const o=zt(),[l,c]=_.useState(!1),d=_.useRef();return _.useEffect(()=>{d.current=ese({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{g1({id:f,store:o,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),_.useEffect(()=>{if(!(t||!e.current||!d.current))return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:a}),()=>{var f;(f=d.current)==null||f.destroy()}},[n,r,t,s,e,i,a]),l}const Aae=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Y3(){const e=zt();return _.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:a,onError:o,updateNodePositions:l,nodeLookup:c,nodeOrigin:d}=e.getState(),f=new Map,h=Aae(a),p=i?s[0]:5,m=i?s[1]:5,y=n.direction.x*p*n.factor,v=n.direction.y*m*n.factor;for(const[,g]of c){if(!h(g))continue;let E={x:g.internals.positionAbsolute.x+y,y:g.internals.positionAbsolute.y+v};i&&(E=Nd(E,s));const{position:b,positionAbsolute:w}=a3({nodeId:g.id,nextPosition:E,nodeLookup:c,nodeExtent:r,nodeOrigin:d,onError:o});g.position=b,g.internals.positionAbsolute=w,f.set(g.id,g)}l(f)},[])}const vx=_.createContext(null),Cae=vx.Provider;vx.Consumer;const W3=()=>_.useContext(vx),Iae=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Rae=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:a}=r,{fromHandle:o,toHandle:l,isValid:c}=a,d=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.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:s===yl.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!i,valid:d&&c}};function Oae({type:e="source",position:t=Oe.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:a,onConnect:o,children:l,className:c,onMouseDown:d,onTouchStart:f,...h},p){var $,C;const m=a||null,y=e==="target",v=zt(),g=W3(),{connectOnClick:E,noPanClassName:b,rfId:w}=ct(Iae,Ht),{connectingFrom:N,connectingTo:T,clickConnecting:A,isPossibleEndHandle:S,connectionInProcess:R,clickConnectionInProcess:I,valid:D}=ct(Rae(g,m,e),Ht);g||(C=($=v.getState()).onError)==null||C.call($,"010",mi.error010());const F=O=>{const{defaultEdgeOptions:L,onConnect:M,hasDefaultEdges:k}=v.getState(),Y={...L,...O};if(k){const{edges:G,setEdges:P,onError:V}=v.getState();P(H3(Y,G,{onError:V}))}M==null||M(Y),o==null||o(Y)},W=O=>{if(!g)return;const L=p3(O.nativeEvent);if(i&&(L&&O.button===0||!L)){const M=v.getState();m1.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:y,handleId:m,nodeId:g,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...k)=>{var Y,G;return(G=(Y=v.getState()).onConnectEnd)==null?void 0:G.call(Y,...k)},updateConnection:M.updateConnection,onConnect:F,isValidConnection:n||((...k)=>{var Y,G;return((G=(Y=v.getState()).isValidConnection)==null?void 0:G.call(Y,...k))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}L?d==null||d(O):f==null||f(O)},j=O=>{const{onClickConnectStart:L,onClickConnectEnd:M,connectionClickStartHandle:k,connectionMode:Y,isValidConnection:G,lib:P,rfId:V,nodeLookup:Q,connection:ne}=v.getState();if(!g||!k&&!i)return;if(!k){L==null||L(O.nativeEvent,{nodeId:g,handleId:m,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const le=f3(O.target),K=n||G,{connection:q,isValid:ae}=m1.isValid(O.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:Y,fromNodeId:k.nodeId,fromHandleId:k.id||null,fromType:k.type,isValidConnection:K,flowId:V,doc:le,lib:P,nodeLookup:Q});ae&&q&&F(q);const ye=structuredClone(ne);delete ye.inProgress,ye.toPosition=ye.toHandle?ye.toHandle.position:null,M==null||M(O,ye),v.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${m}-${e}`,className:xn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,c,{source:!y,target:y,connectable:r,connectablestart:i,connectableend:s,clickconnecting:A,connectingfrom:N,connectingto:T,valid:D,connectionindicator:r&&(!R||S)&&(R||I?s:i)}]),onMouseDown:W,onTouchStart:W,onClick:E?j:void 0,ref:p,...h,children:l})}const _l=_.memo(z3(Oae));function Lae({data:e,isConnectable:t,sourcePosition:n=Oe.Bottom}){return u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(_l,{type:"source",position:n,isConnectable:t})]})}function Mae({data:e,isConnectable:t,targetPosition:n=Oe.Top,sourcePosition:r=Oe.Bottom}){return u.jsxs(u.Fragment,{children:[u.jsx(_l,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(_l,{type:"source",position:r,isConnectable:t})]})}function Dae(){return null}function Pae({data:e,isConnectable:t,targetPosition:n=Oe.Top}){return u.jsxs(u.Fragment,{children:[u.jsx(_l,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const bp={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},uS={input:Lae,default:Mae,output:Pae,group:Dae};function jae(e){var t,n,r,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??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Bae=e=>{const{width:t,height:n,x:r,y:i}=Td(e.nodeLookup,{filter:s=>!!s.selected});return{width:li(t)?t:null,height:li(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Fae({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=zt(),{width:i,height:s,transformString:a,userSelectionActive:o}=ct(Bae,Ht),l=Y3(),c=_.useRef(null);_.useEffect(()=>{var p;n||(p=c.current)==null||p.focus({preventScroll:!0})},[n]);const d=!o&&i!==null&&s!==null;if(K3({nodeRef:c,disabled:!d}),!d)return null;const f=e?p=>{const m=r.getState().nodes.filter(y=>y.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(bp,p.key)&&(p.preventDefault(),l({direction:bp[p.key],factor:p.shiftKey?4:1}))};return u.jsx("div",{className:xn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:u.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:s}})})}const dS=typeof window<"u"?window:void 0,Uae=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function q3({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:y,zoomActivationKeyCode:v,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:w,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:S,autoPanOnSelection:R,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:W,preventScrolling:j,onSelectionContextMenu:$,noWheelClassName:C,noPanClassName:O,disableKeyboardA11y:L,onViewportChange:M,isControlledViewport:k}){const{nodesSelectionActive:Y,userSelectionActive:G}=ct(Uae,Ht),P=Vu(c,{target:dS}),V=Vu(y,{target:dS}),Q=V||S,ne=V||w,le=d&&Q!==!0,K=P||G||le;return xae({deleteKeyCode:l,multiSelectionKeyCode:m}),u.jsx(_ae,{onPaneContextMenu:s,elementsSelectable:g,zoomOnScroll:E,zoomOnPinch:b,panOnScroll:ne,panOnScrollSpeed:N,panOnScrollMode:T,zoomOnDoubleClick:A,panOnDrag:!P&&Q,defaultViewport:I,translateExtent:D,minZoom:F,maxZoom:W,zoomActivationKeyCode:v,preventScrolling:j,noWheelClassName:C,noPanClassName:O,onViewportChange:M,isControlledViewport:k,paneClickDistance:o,selectionOnDrag:le,children:u.jsxs(kae,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:a,panOnDrag:Q,autoPanOnSelection:R,isSelecting:!!K,selectionMode:f,selectionKeyPressed:P,paneClickDistance:o,selectionOnDrag:le,children:[e,Y&&u.jsx(Fae,{onSelectionContextMenu:$,noPanClassName:O,disableKeyboardA11y:L})]})})}q3.displayName="FlowRenderer";const $ae=_.memo(q3),Hae=e=>t=>e?dx(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 zae(e){return ct(_.useCallback(Hae(e),[e]),Ht)}const Vae=e=>e.updateNodeInternals;function Kae(){const e=ct(Vae),[t]=_.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return _.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Yae({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=zt(),s=_.useRef(null),a=_.useRef(null),o=_.useRef(e.sourcePosition),l=_.useRef(e.targetPosition),c=_.useRef(t),d=n&&!!e.internals.handleBounds;return _.useEffect(()=>{s.current&&!e.hidden&&(!d||a.current!==s.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(s.current),a.current=s.current)},[d,e.hidden]),_.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),_.useEffect(()=>{if(s.current){const f=c.current!==t,h=o.current!==e.sourcePosition,p=l.current!==e.targetPosition;(f||h||p)&&(c.current=t,o.current=e.sourcePosition,l.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function Wae({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:a,nodesDraggable:o,elementsSelectable:l,nodesConnectable:c,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:m,rfId:y,nodeTypes:v,nodeClickDistance:g,onError:E}){const{node:b,internals:w,isParent:N}=ct(K=>{const q=K.nodeLookup.get(e),ae=K.parentLookup.has(e);return{node:q,internals:q.internals,isParent:ae}},Ht);let T=b.type||"default",A=(v==null?void 0:v[T])||uS[T];A===void 0&&(E==null||E("003",mi.error003(T)),T="default",A=(v==null?void 0:v.default)||uS.default);const S=!!(b.draggable||o&&typeof b.draggable>"u"),R=!!(b.selectable||l&&typeof b.selectable>"u"),I=!!(b.connectable||c&&typeof b.connectable>"u"),D=!!(b.focusable||d&&typeof b.focusable>"u"),F=zt(),W=u3(b),j=Yae({node:b,nodeType:T,hasDimensions:W,resizeObserver:f}),$=K3({nodeRef:j,disabled:b.hidden||!S,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:g}),C=Y3();if(b.hidden)return null;const O=ls(b),L=jae(b),M=R||S||t||n||r||i,k=n?K=>n(K,{...w.userNode}):void 0,Y=r?K=>r(K,{...w.userNode}):void 0,G=i?K=>i(K,{...w.userNode}):void 0,P=s?K=>s(K,{...w.userNode}):void 0,V=a?K=>a(K,{...w.userNode}):void 0,Q=K=>{const{selectNodesOnDrag:q,nodeDragThreshold:ae}=F.getState();R&&(!q||!S||ae>0)&&g1({id:e,store:F,nodeRef:j}),t&&t(K,{...w.userNode})},ne=K=>{if(!(h3(K.nativeEvent)||m)){if(t3.includes(K.key)&&R){const q=K.key==="Escape";g1({id:e,store:F,unselect:q,nodeRef:j})}else if(S&&b.selected&&Object.prototype.hasOwnProperty.call(bp,K.key)){K.preventDefault();const{ariaLabelConfig:q}=F.getState();F.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:K.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),C({direction:bp[K.key],factor:K.shiftKey?4:1})}}},le=()=>{var Ie;if(m||!((Ie=j.current)!=null&&Ie.matches(":focus-visible")))return;const{transform:K,width:q,height:ae,autoPanOnNodeFocus:ye,setCenter:he}=F.getState();if(!ye)return;dx(new Map([[e,b]]),{x:0,y:0,width:q,height:ae},K,!0).length>0||he(b.position.x+O.width/2,b.position.y+O.height/2,{zoom:K[2]})};return u.jsx("div",{className:xn(["react-flow__node",`react-flow__node-${T}`,{[p]:S},b.className,{selected:b.selected,selectable:R,parent:N,draggable:S,dragging:$}]),ref:j,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:W?"visible":"hidden",...b.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:k,onMouseMove:Y,onMouseLeave:G,onContextMenu:P,onClick:Q,onDoubleClick:V,onKeyDown:D?ne:void 0,tabIndex:D?0:void 0,onFocus:D?le:void 0,role:b.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${P3}-${y}`,"aria-label":b.ariaLabel,...b.domAttributes,children:u.jsx(Cae,{value:e,children:u.jsx(A,{id:e,data:b.data,type:T,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:b.selected??!1,selectable:R,draggable:S,deletable:b.deletable??!0,isConnectable:I,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:$,dragHandle:b.dragHandle,zIndex:w.z,parentId:b.parentId,...O})})})}var qae=_.memo(Wae);const Gae=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function G3(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=ct(Gae,Ht),a=zae(e.onlyRenderVisibleElements),o=Kae();return u.jsx("div",{className:"react-flow__nodes",style:Tm,children:a.map(l=>u.jsx(qae,{id:l,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:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:s},l))})}G3.displayName="NodeRenderer";const Xae=_.memo(G3);function Qae(e){return ct(_.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),a=n.nodeLookup.get(i.target);s&&a&&Die({sourceNode:s,targetNode:a,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Ht)}const Zae=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return u.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Jae=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return u.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},fS={[$u.Arrow]:Zae,[$u.ArrowClosed]:Jae};function eoe(e){const t=zt();return _.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(fS,e)?fS[e]:((s=(i=t.getState()).onError)==null||s.call(i,"009",mi.error009(e)),null)},[e])}const toe=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const l=eoe(t);return l?u.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:o,refX:"0",refY:"0",children:u.jsx(l,{color:n,strokeWidth:a})}):null},X3=({defaultColor:e,rfId:t})=>{const n=ct(s=>s.edges),r=ct(s=>s.defaultEdgeOptions),i=_.useMemo(()=>zie(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?u.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:u.jsx("defs",{children:i.map(s=>u.jsx(toe,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};X3.displayName="MarkerDefinitions";var noe=_.memo(X3);function Q3({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:l,className:c,...d}){const[f,h]=_.useState({x:1,y:0,width:0,height:0}),p=xn(["react-flow__edge-textwrapper",c]),m=_.useRef(null);return _.useEffect(()=>{if(m.current){const y=m.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),n?u.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[i&&u.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:s,rx:o,ry:o}),u.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}Q3.displayName="EdgeText";const roe=_.memo(Q3);function Nm({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l,interactionWidth:c=20,...d}){return u.jsxs(u.Fragment,{children:[u.jsx("path",{...d,d:e,fill:"none",className:xn(["react-flow__edge-path",d.className])}),c?u.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&li(t)&&li(n)?u.jsx(roe,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:l}):null]})}function hS({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Oe.Left||e===Oe.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Z3({sourceX:e,sourceY:t,sourcePosition:n=Oe.Bottom,targetX:r,targetY:i,targetPosition:s=Oe.Top}){const[a,o]=hS({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,c]=hS({pos:s,x1:r,y1:i,x2:e,y2:t}),[d,f,h,p]=m3({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${o} ${l},${c} ${r},${i}`,d,f,h,p]}function J3(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:o,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,interactionWidth:g})=>{const[E,b,w]=Z3({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o}),N=e.isInternal?void 0:t;return u.jsx(Nm,{id:N,path:E,labelX:b,labelY:w,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,interactionWidth:g})})}const ioe=J3({isInternal:!1}),eD=J3({isInternal:!0});ioe.displayName="SimpleBezierEdge";eD.displayName="SimpleBezierEdgeInternal";function tD(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:p=Oe.Bottom,targetPosition:m=Oe.Top,markerEnd:y,markerStart:v,pathOptions:g,interactionWidth:E})=>{const[b,w,N]=f1({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:s,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),T=e.isInternal?void 0:t;return u.jsx(Nm,{id:T,path:b,labelX:w,labelY:N,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:y,markerStart:v,interactionWidth:E})})}const nD=tD({isInternal:!1}),rD=tD({isInternal:!0});nD.displayName="SmoothStepEdge";rD.displayName="SmoothStepEdgeInternal";function iD(e){return _.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return u.jsx(nD,{...n,id:r,pathOptions:_.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const soe=iD({isInternal:!1}),sD=iD({isInternal:!0});soe.displayName="StepEdge";sD.displayName="StepEdgeInternal";function aD(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})=>{const[v,g,E]=b3({sourceX:n,sourceY:r,targetX:i,targetY:s}),b=e.isInternal?void 0:t;return u.jsx(Nm,{id:b,path:v,labelX:g,labelY:E,label:a,labelStyle:o,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:m,interactionWidth:y})})}const aoe=aD({isInternal:!1}),oD=aD({isInternal:!0});aoe.displayName="StraightEdge";oD.displayName="StraightEdgeInternal";function lD(e){return _.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:a=Oe.Bottom,targetPosition:o=Oe.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,pathOptions:g,interactionWidth:E})=>{const[b,w,N]=g3({sourceX:n,sourceY:r,sourcePosition:a,targetX:i,targetY:s,targetPosition:o,curvature:g==null?void 0:g.curvature}),T=e.isInternal?void 0:t;return u.jsx(Nm,{id:T,path:b,labelX:w,labelY:N,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:m,markerEnd:y,markerStart:v,interactionWidth:E})})}const ooe=lD({isInternal:!1}),cD=lD({isInternal:!0});ooe.displayName="BezierEdge";cD.displayName="BezierEdgeInternal";const pS={default:cD,straight:oD,step:sD,smoothstep:rD,simplebezier:eD},mS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},loe=(e,t,n)=>n===Oe.Left?e-t:n===Oe.Right?e+t:e,coe=(e,t,n)=>n===Oe.Top?e-t:n===Oe.Bottom?e+t:e,gS="react-flow__edgeupdater";function yS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:a,type:o}){return u.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:a,className:xn([gS,`${gS}-${o}`]),cx:loe(t,r,e),cy:coe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function uoe({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:a,sourcePosition:o,targetPosition:l,onReconnect:c,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:p}){const m=zt(),y=(w,N)=>{if(w.button!==0)return;const{autoPanOnConnect:T,domNode:A,connectionMode:S,connectionRadius:R,lib:I,onConnectStart:D,cancelConnection:F,nodeLookup:W,rfId:j,panBy:$,updateConnection:C}=m.getState(),O=N.type==="target",L=(Y,G)=>{h(!1),f==null||f(Y,n,N.type,G)},M=Y=>c==null?void 0:c(n,Y),k=(Y,G)=>{h(!0),d==null||d(w,n,N.type),D==null||D(Y,G)};m1.onPointerDown(w.nativeEvent,{autoPanOnConnect:T,connectionMode:S,connectionRadius:R,domNode:A,handleId:N.id,nodeId:N.nodeId,nodeLookup:W,isTarget:O,edgeUpdaterType:N.type,lib:I,flowId:j,cancelConnection:F,panBy:$,isValidConnection:(...Y)=>{var G,P;return((P=(G=m.getState()).isValidConnection)==null?void 0:P.call(G,...Y))??!0},onConnect:M,onConnectStart:k,onConnectEnd:(...Y)=>{var G,P;return(P=(G=m.getState()).onConnectEnd)==null?void 0:P.call(G,...Y)},onReconnectEnd:L,updateConnection:C,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},v=w=>y(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=w=>y(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),E=()=>p(!0),b=()=>p(!1);return u.jsxs(u.Fragment,{children:[(e===!0||e==="source")&&u.jsx(yS,{position:o,centerX:r,centerY:i,radius:t,onMouseDown:v,onMouseEnter:E,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&u.jsx(yS,{position:l,centerX:s,centerY:a,radius:t,onMouseDown:g,onMouseEnter:E,onMouseOut:b,type:"target"})]})}function doe({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,rfId:m,edgeTypes:y,noPanClassName:v,onError:g,disableKeyboardA11y:E}){let b=ct(he=>he.edgeLookup.get(e));const w=ct(he=>he.defaultEdgeOptions);b=w?{...w,...b}:b;let N=b.type||"default",T=(y==null?void 0:y[N])||pS[N];T===void 0&&(g==null||g("011",mi.error011(N)),N="default",T=(y==null?void 0:y.default)||pS.default);const A=!!(b.focusable||t&&typeof b.focusable>"u"),S=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),R=!!(b.selectable||r&&typeof b.selectable>"u"),I=_.useRef(null),[D,F]=_.useState(!1),[W,j]=_.useState(!1),$=zt(),{zIndex:C,sourceX:O,sourceY:L,targetX:M,targetY:k,sourcePosition:Y,targetPosition:G}=ct(_.useCallback(he=>{const de=he.nodeLookup.get(b.source),Ie=he.nodeLookup.get(b.target);if(!de||!Ie)return{zIndex:b.zIndex,...mS};const _e=Hie({id:e,sourceNode:de,targetNode:Ie,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:he.connectionMode,onError:g});return{zIndex:Mie({selected:b.selected,zIndex:b.zIndex,sourceNode:de,targetNode:Ie,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),..._e||mS}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Ht),P=_.useMemo(()=>b.markerStart?`url('#${h1(b.markerStart,m)}')`:void 0,[b.markerStart,m]),V=_.useMemo(()=>b.markerEnd?`url('#${h1(b.markerEnd,m)}')`:void 0,[b.markerEnd,m]);if(b.hidden||O===null||L===null||M===null||k===null)return null;const Q=he=>{var xe;const{addSelectedEdges:de,unselectNodesAndEdges:Ie,multiSelectionActive:_e}=$.getState();R&&($.setState({nodesSelectionActive:!1}),b.selected&&_e?(Ie({nodes:[],edges:[b]}),(xe=I.current)==null||xe.blur()):de([e])),i&&i(he,b)},ne=s?he=>{s(he,{...b})}:void 0,le=a?he=>{a(he,{...b})}:void 0,K=o?he=>{o(he,{...b})}:void 0,q=l?he=>{l(he,{...b})}:void 0,ae=c?he=>{c(he,{...b})}:void 0,ye=he=>{var de;if(!E&&t3.includes(he.key)&&R){const{unselectNodesAndEdges:Ie,addSelectedEdges:_e}=$.getState();he.key==="Escape"?((de=I.current)==null||de.blur(),Ie({edges:[b]})):_e([e])}};return u.jsx("svg",{style:{zIndex:C},children:u.jsxs("g",{className:xn(["react-flow__edge",`react-flow__edge-${N}`,b.className,v,{selected:b.selected,animated:b.animated,inactive:!R&&!i,updating:D,selectable:R}]),onClick:Q,onDoubleClick:ne,onContextMenu:le,onMouseEnter:K,onMouseMove:q,onMouseLeave:ae,onKeyDown:A?ye:void 0,tabIndex:A?0:void 0,role:b.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":A?`${j3}-${m}`:void 0,ref:I,...b.domAttributes,children:[!W&&u.jsx(T,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:R,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:O,sourceY:L,targetX:M,targetY:k,sourcePosition:Y,targetPosition:G,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:P,markerEnd:V,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),S&&u.jsx(uoe,{edge:b,isReconnectable:S,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,sourceX:O,sourceY:L,targetX:M,targetY:k,sourcePosition:Y,targetPosition:G,setUpdateHover:F,setReconnecting:j})]})})}var foe=_.memo(doe);const hoe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function uD({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:y}){const{edgesFocusable:v,edgesReconnectable:g,elementsSelectable:E,onError:b}=ct(hoe,Ht),w=Qae(t);return u.jsxs("div",{className:"react-flow__edges",children:[u.jsx(noe,{defaultColor:e,rfId:n}),w.map(N=>u.jsx(foe,{id:N,edgesFocusable:v,edgesReconnectable:g,elementsSelectable:E,noPanClassName:i,onReconnect:s,onContextMenu:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:y},N))]})}uD.displayName="EdgeRenderer";const poe=_.memo(uD),moe=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function goe({children:e}){const t=ct(moe);return u.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function yoe(e){const t=xx(),n=_.useRef(!1);_.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const boe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function Eoe(e){const t=ct(boe),n=zt();return _.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function xoe(e){return e.connection.inProgress?{...e.connection,to:Hl(e.connection.to,e.transform)}:{...e.connection}}function voe(e){return xoe}function woe(e){const t=voe();return ct(t,Ht)}const _oe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Toe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:a,isValid:o,inProgress:l}=ct(_oe,Ht);return!(s&&i&&l)?null:u.jsx("svg",{style:e,width:s,height:a,className:"react-flow__connectionline react-flow__container",children:u.jsx("g",{className:xn(["react-flow__connection",i3(o)]),children:u.jsx(dD,{style:t,type:n,CustomComponent:r,isValid:o})})})}const dD=({style:e,type:t=Ts.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:a,fromHandle:o,fromPosition:l,to:c,toNode:d,toHandle:f,toPosition:h,pointer:p}=woe();if(!i)return;if(n)return u.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:s.x,fromY:s.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:h,connectionStatus:i3(r),toNode:d,toHandle:f,pointer:p});let m="";const y={sourceX:s.x,sourceY:s.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:h};switch(t){case Ts.Bezier:[m]=g3(y);break;case Ts.SimpleBezier:[m]=Z3(y);break;case Ts.Step:[m]=f1({...y,borderRadius:0});break;case Ts.SmoothStep:[m]=f1(y);break;default:[m]=b3(y)}return u.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};dD.displayName="ConnectionLine";const Noe={};function bS(e=Noe){_.useRef(e),zt(),_.useEffect(()=>{},[e])}function Soe(){zt(),_.useRef(!1),_.useEffect(()=>{},[])}function fD({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:y,connectionLineComponent:v,connectionLineContainerStyle:g,selectionKeyCode:E,selectionOnDrag:b,selectionMode:w,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,deleteKeyCode:S,onlyRenderVisibleElements:R,elementsSelectable:I,defaultViewport:D,translateExtent:F,minZoom:W,maxZoom:j,preventScrolling:$,defaultMarkerColor:C,zoomOnScroll:O,zoomOnPinch:L,panOnScroll:M,panOnScrollSpeed:k,panOnScrollMode:Y,zoomOnDoubleClick:G,panOnDrag:P,autoPanOnSelection:V,onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:le,onPaneMouseLeave:K,onPaneScroll:q,onPaneContextMenu:ae,paneClickDistance:ye,nodeClickDistance:he,onEdgeContextMenu:de,onEdgeMouseEnter:Ie,onEdgeMouseMove:_e,onEdgeMouseLeave:xe,reconnectRadius:je,onReconnect:be,onReconnectStart:Ve,onReconnectEnd:ke,noDragClassName:ce,noWheelClassName:Nt,noPanClassName:De,disableKeyboardA11y:xt,nodeExtent:it,rfId:z,viewport:X,onViewportChange:oe}){return bS(e),bS(t),Soe(),yoe(n),Eoe(X),u.jsx($ae,{onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:le,onPaneMouseLeave:K,onPaneContextMenu:ae,onPaneScroll:q,paneClickDistance:ye,deleteKeyCode:S,selectionKeyCode:E,selectionOnDrag:b,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:T,zoomActivationKeyCode:A,elementsSelectable:I,zoomOnScroll:O,zoomOnPinch:L,zoomOnDoubleClick:G,panOnScroll:M,panOnScrollSpeed:k,panOnScrollMode:Y,panOnDrag:P,autoPanOnSelection:V,defaultViewport:D,translateExtent:F,minZoom:W,maxZoom:j,onSelectionContextMenu:f,preventScrolling:$,noDragClassName:ce,noWheelClassName:Nt,noPanClassName:De,disableKeyboardA11y:xt,onViewportChange:oe,isControlledViewport:!!X,children:u.jsxs(goe,{children:[u.jsx(poe,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:a,onReconnect:be,onReconnectStart:Ve,onReconnectEnd:ke,onlyRenderVisibleElements:R,onEdgeContextMenu:de,onEdgeMouseEnter:Ie,onEdgeMouseMove:_e,onEdgeMouseLeave:xe,reconnectRadius:je,defaultMarkerColor:C,noPanClassName:De,disableKeyboardA11y:xt,rfId:z}),u.jsx(Toe,{style:y,type:m,component:v,containerStyle:g}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(Xae,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:o,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:he,onlyRenderVisibleElements:R,noPanClassName:De,noDragClassName:ce,disableKeyboardA11y:xt,nodeExtent:it,rfId:z}),u.jsx("div",{className:"react-flow__viewport-portal"})]})})}fD.displayName="GraphView";const koe=_.memo(fD),Aoe=c3(),ES=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:l=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const p=new Map,m=new Map,y=new Map,v=new Map,g=r??t??[],E=n??e??[],b=d??[0,0],w=f??Fu;v3(y,v,g);const{nodesInitialized:N}=p1(E,p,m,{nodeOrigin:b,nodeExtent:w,zIndexMode:h});let T=[0,0,1];if(a&&i&&s){const A=Td(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:S,y:R,zoom:I}=hx(A,i,s,l,c,(o==null?void 0:o.padding)??.1);T=[S,R,I]}return{rfId:"1",width:i??0,height:s??0,transform:T,nodes:E,nodesInitialized:N,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:v,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:Fu,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,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:o,fitViewResolver:null,connection:{...r3},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Aoe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:n3,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Coe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>Kse((p,m)=>{async function y(){const{nodeLookup:v,panZoom:g,fitViewOptions:E,fitViewResolver:b,width:w,height:N,minZoom:T,maxZoom:A}=m();g&&(await kie({nodes:v,width:w,height:N,panZoom:g,minZoom:T,maxZoom:A},E),b==null||b.resolve(!0),p({fitViewResolver:null}))}return{...ES({nodes:e,edges:t,width:i,height:s,fitView:a,fitViewOptions:o,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:v=>{const{nodeLookup:g,parentLookup:E,nodeOrigin:b,elevateNodesOnSelect:w,fitViewQueued:N,zIndexMode:T,nodesSelectionActive:A}=m(),{nodesInitialized:S,hasSelectedNodes:R}=p1(v,g,E,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:T}),I=A&&R;N&&S?(y(),p({nodes:v,nodesInitialized:S,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):p({nodes:v,nodesInitialized:S,nodesSelectionActive:I})},setEdges:v=>{const{connectionLookup:g,edgeLookup:E}=m();v3(g,E,v),p({edges:v})},setDefaultNodesAndEdges:(v,g)=>{if(v){const{setNodes:E}=m();E(v),p({hasDefaultNodes:!0})}if(g){const{setEdges:E}=m();E(g),p({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:g,nodeLookup:E,parentLookup:b,domNode:w,nodeOrigin:N,nodeExtent:T,debug:A,fitViewQueued:S,zIndexMode:R}=m(),{changes:I,updatedInternals:D}=Xie(v,E,b,w,N,T,R);D&&(Yie(E,b,{nodeOrigin:N,nodeExtent:T,zIndexMode:R}),S?(y(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(I==null?void 0:I.length)>0&&(A&&console.log("React Flow: trigger node changes",I),g==null||g(I)))},updateNodePositions:(v,g=!1)=>{const E=[];let b=[];const{nodeLookup:w,triggerNodeChanges:N,connection:T,updateConnection:A,onNodesChangeMiddlewareMap:S}=m();for(const[R,I]of v){const D=w.get(R),F=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(I!=null&&I.position)),W={id:R,type:"position",position:F?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:g};if(D&&T.inProgress&&T.fromNode.id===D.id){const j=Ha(D,T.fromHandle,Oe.Left,!0);A({...T,from:j})}F&&D.parentId&&E.push({id:R,parentId:D.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),b.push(W)}if(E.length>0){const{parentLookup:R,nodeOrigin:I}=m(),D=Ex(E,w,R,I);b.push(...D)}for(const R of S.values())b=R(b);N(b)},triggerNodeChanges:v=>{const{onNodesChange:g,setNodes:E,nodes:b,hasDefaultNodes:w,debug:N}=m();if(v!=null&&v.length){if(w){const T=U3(v,b);E(T)}N&&console.log("React Flow: trigger node changes",v),g==null||g(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:g,setEdges:E,edges:b,hasDefaultEdges:w,debug:N}=m();if(v!=null&&v.length){if(w){const T=$3(v,b);E(T)}N&&console.log("React Flow: trigger edge changes",v),g==null||g(v)}},addSelectedNodes:v=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:w,triggerEdgeChanges:N}=m();if(g){const T=v.map(A=>ca(A,!0));w(T);return}w(Do(b,new Set([...v]),!0)),N(Do(E))},addSelectedEdges:v=>{const{multiSelectionActive:g,edgeLookup:E,nodeLookup:b,triggerNodeChanges:w,triggerEdgeChanges:N}=m();if(g){const T=v.map(A=>ca(A,!0));N(T);return}N(Do(E,new Set([...v]))),w(Do(b,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:g}={})=>{const{edges:E,nodes:b,nodeLookup:w,triggerNodeChanges:N,triggerEdgeChanges:T}=m(),A=v||b,S=g||E,R=[];for(const D of A){if(!D.selected)continue;const F=w.get(D.id);F&&(F.selected=!1),R.push(ca(D.id,!1))}const I=[];for(const D of S)D.selected&&I.push(ca(D.id,!1));N(R),T(I)},setMinZoom:v=>{const{panZoom:g,maxZoom:E}=m();g==null||g.setScaleExtent([v,E]),p({minZoom:v})},setMaxZoom:v=>{const{panZoom:g,minZoom:E}=m();g==null||g.setScaleExtent([E,v]),p({maxZoom:v})},setTranslateExtent:v=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(v),p({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:g,triggerNodeChanges:E,triggerEdgeChanges:b,elementsSelectable:w}=m();if(!w)return;const N=g.reduce((A,S)=>S.selected?[...A,ca(S.id,!1)]:A,[]),T=v.reduce((A,S)=>S.selected?[...A,ca(S.id,!1)]:A,[]);E(N),b(T)},setNodeExtent:v=>{const{nodes:g,nodeLookup:E,parentLookup:b,nodeOrigin:w,elevateNodesOnSelect:N,nodeExtent:T,zIndexMode:A}=m();v[0][0]===T[0][0]&&v[0][1]===T[0][1]&&v[1][0]===T[1][0]&&v[1][1]===T[1][1]||(p1(g,E,b,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:A}),p({nodeExtent:v}))},panBy:v=>{const{transform:g,width:E,height:b,panZoom:w,translateExtent:N}=m();return Qie({delta:v,panZoom:w,transform:g,translateExtent:N,width:E,height:b})},setCenter:async(v,g,E)=>{const{width:b,height:w,maxZoom:N,panZoom:T}=m();if(!T)return!1;const A=typeof(E==null?void 0:E.zoom)<"u"?E.zoom:N;return await T.setViewport({x:b/2-v*A,y:w/2-g*A,zoom:A},{duration:E==null?void 0:E.duration,ease:E==null?void 0:E.ease,interpolate:E==null?void 0:E.interpolate}),!0},cancelConnection:()=>{p({connection:{...r3}})},updateConnection:v=>{p({connection:v})},reset:()=>p({...ES()})}},Object.is);function hD({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:l,fitView:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:p}){const[m]=_.useState(()=>Coe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:c,minZoom:a,maxZoom:o,fitViewOptions:l,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return u.jsx(Yse,{value:m,children:u.jsx(gae,{children:p})})}function Ioe({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:a,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p}){return _.useContext(wm)?u.jsx(u.Fragment,{children:e}):u.jsx(hD,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:a,fitView:o,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:p,children:e})}const Roe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Ooe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:a,onNodeClick:o,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:g,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:T,onNodeDragStart:A,onNodeDrag:S,onNodeDragStop:R,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onSelectionChange:W,onSelectionDragStart:j,onSelectionDrag:$,onSelectionDragStop:C,onSelectionContextMenu:O,onSelectionStart:L,onSelectionEnd:M,onBeforeDelete:k,connectionMode:Y,connectionLineType:G=Ts.Bezier,connectionLineStyle:P,connectionLineComponent:V,connectionLineContainerStyle:Q,deleteKeyCode:ne="Backspace",selectionKeyCode:le="Shift",selectionOnDrag:K=!1,selectionMode:q=Uu.Full,panActivationKeyCode:ae="Space",multiSelectionKeyCode:ye=zu()?"Meta":"Control",zoomActivationKeyCode:he=zu()?"Meta":"Control",snapToGrid:de,snapGrid:Ie,onlyRenderVisibleElements:_e=!1,selectNodesOnDrag:xe,nodesDraggable:je,autoPanOnNodeFocus:be,nodesConnectable:Ve,nodesFocusable:ke,nodeOrigin:ce=B3,edgesFocusable:Nt,edgesReconnectable:De,elementsSelectable:xt=!0,defaultViewport:it=sae,minZoom:z=.5,maxZoom:X=2,translateExtent:oe=Fu,preventScrolling:ve=!0,nodeExtent:Ae,defaultMarkerColor:st="#b1b1b7",zoomOnScroll:Xt=!0,zoomOnPinch:ze=!0,panOnScroll:an=!1,panOnScrollSpeed:vt=.5,panOnScrollMode:pt=ka.Free,zoomOnDoubleClick:jt=!0,panOnDrag:Vt=!0,onPaneClick:Qt,onPaneMouseEnter:Le,onPaneMouseMove:Je,onPaneMouseLeave:mt,onPaneScroll:gt,onPaneContextMenu:se,paneClickDistance:Ce=1,nodeClickDistance:Ke=0,children:on,onReconnect:Xe,onReconnectStart:re,onReconnectEnd:Ee,onEdgeContextMenu:me,onEdgeDoubleClick:Me,onEdgeMouseEnter:$e,onEdgeMouseMove:He,onEdgeMouseLeave:ft,reconnectRadius:at=10,onNodesChange:ln,onEdgesChange:ht,noDragClassName:In="nodrag",noWheelClassName:ut="nowheel",noPanClassName:jn="nopan",fitView:cn,fitViewOptions:dr,connectOnClick:Zt,attributionPosition:fr,proOptions:Bt,defaultEdgeOptions:er,elevateNodesOnSelect:Ot=!0,elevateEdgesOnSelect:vn=!1,disableKeyboardA11y:tr=!1,autoPanOnConnect:Rn,autoPanOnNodeDrag:Bn,autoPanOnSelection:wn=!0,autoPanSpeed:_n,connectionRadius:Tn,isValidConnection:Jt,onError:en,style:gn,id:Fn,nodeDragThreshold:Nn,connectionDragThreshold:Tr,viewport:yn,onViewportChange:ee,width:Te,height:Pe,colorMode:nt="light",debug:yt,onScroll:Lt,ariaLabelConfig:tn,zIndexMode:Un="basic",...Sn},On){const hr=Fn||"1",zl=cae(nt),Vl=_.useCallback(Kl=>{Kl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Lt==null||Lt(Kl)},[Lt]);return u.jsx("div",{"data-testid":"rf__wrapper",...Sn,onScroll:Vl,style:{...gn,...Roe},ref:On,className:xn(["react-flow",i,zl]),id:Fn,role:"application",children:u.jsxs(Ioe,{nodes:e,edges:t,width:Te,height:Pe,fitView:cn,fitViewOptions:dr,minZoom:z,maxZoom:X,nodeOrigin:ce,nodeExtent:Ae,zIndexMode:Un,children:[u.jsx(lae,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:g,nodesDraggable:je,autoPanOnNodeFocus:be,nodesConnectable:Ve,nodesFocusable:ke,edgesFocusable:Nt,edgesReconnectable:De,elementsSelectable:xt,elevateNodesOnSelect:Ot,elevateEdgesOnSelect:vn,minZoom:z,maxZoom:X,nodeExtent:Ae,onNodesChange:ln,onEdgesChange:ht,snapToGrid:de,snapGrid:Ie,connectionMode:Y,translateExtent:oe,connectOnClick:Zt,defaultEdgeOptions:er,fitView:cn,fitViewOptions:dr,onNodesDelete:I,onEdgesDelete:D,onDelete:F,onNodeDragStart:A,onNodeDrag:S,onNodeDragStop:R,onSelectionDrag:$,onSelectionDragStart:j,onSelectionDragStop:C,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:jn,nodeOrigin:ce,rfId:hr,autoPanOnConnect:Rn,autoPanOnNodeDrag:Bn,autoPanSpeed:_n,onError:en,connectionRadius:Tn,isValidConnection:Jt,selectNodesOnDrag:xe,nodeDragThreshold:Nn,connectionDragThreshold:Tr,onBeforeDelete:k,debug:yt,ariaLabelConfig:tn,zIndexMode:Un}),u.jsx(koe,{onInit:c,onNodeClick:o,onEdgeClick:l,onNodeMouseEnter:E,onNodeMouseMove:b,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:T,nodeTypes:s,edgeTypes:a,connectionLineType:G,connectionLineStyle:P,connectionLineComponent:V,connectionLineContainerStyle:Q,selectionKeyCode:le,selectionOnDrag:K,selectionMode:q,deleteKeyCode:ne,multiSelectionKeyCode:ye,panActivationKeyCode:ae,zoomActivationKeyCode:he,onlyRenderVisibleElements:_e,defaultViewport:it,translateExtent:oe,minZoom:z,maxZoom:X,preventScrolling:ve,zoomOnScroll:Xt,zoomOnPinch:ze,zoomOnDoubleClick:jt,panOnScroll:an,panOnScrollSpeed:vt,panOnScrollMode:pt,panOnDrag:Vt,autoPanOnSelection:wn,onPaneClick:Qt,onPaneMouseEnter:Le,onPaneMouseMove:Je,onPaneMouseLeave:mt,onPaneScroll:gt,onPaneContextMenu:se,paneClickDistance:Ce,nodeClickDistance:Ke,onSelectionContextMenu:O,onSelectionStart:L,onSelectionEnd:M,onReconnect:Xe,onReconnectStart:re,onReconnectEnd:Ee,onEdgeContextMenu:me,onEdgeDoubleClick:Me,onEdgeMouseEnter:$e,onEdgeMouseMove:He,onEdgeMouseLeave:ft,reconnectRadius:at,defaultMarkerColor:st,noDragClassName:In,noWheelClassName:ut,noPanClassName:jn,rfId:hr,disableKeyboardA11y:tr,nodeExtent:Ae,viewport:yn,onViewportChange:ee}),u.jsx(iae,{onSelectionChange:W}),on,u.jsx(Jse,{proOptions:Bt,position:fr}),u.jsx(Zse,{rfId:hr,disableKeyboardA11y:tr})]})})}var Loe=z3(Ooe);function Moe(e){const[t,n]=_.useState(e),r=_.useCallback(i=>n(s=>U3(i,s)),[]);return[t,n,r]}function Doe(e){const[t,n]=_.useState(e),r=_.useCallback(i=>n(s=>$3(i,s)),[]);return[t,n,r]}function Poe({dimensions:e,lineWidth:t,variant:n,className:r}){return u.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xn(["react-flow__background-pattern",n,r])})}function joe({radius:e,className:t}){return u.jsx("circle",{cx:e,cy:e,r:e,className:xn(["react-flow__background-pattern","dots",t])})}var Us;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Us||(Us={}));const Boe={[Us.Dots]:1,[Us.Lines]:1,[Us.Cross]:6},Foe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function pD({id:e,variant:t=Us.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:a,bgColor:o,style:l,className:c,patternClassName:d}){const f=_.useRef(null),{transform:h,patternId:p}=ct(Foe,Ht),m=r||Boe[t],y=t===Us.Dots,v=t===Us.Cross,g=Array.isArray(n)?n:[n,n],E=[g[0]*h[2]||1,g[1]*h[2]||1],b=m*h[2],w=Array.isArray(s)?s:[s,s],N=v?[b,b]:E,T=[w[0]*h[2]||1+N[0]/2,w[1]*h[2]||1+N[1]/2],A=`${p}${e||""}`;return u.jsxs("svg",{className:xn(["react-flow__background",c]),style:{...l,...Tm,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[u.jsx("pattern",{id:A,x:h[0]%E[0],y:h[1]%E[1],width:E[0],height:E[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:y?u.jsx(joe,{radius:b/2,className:d}):u.jsx(Poe,{dimensions:N,lineWidth:i,variant:t,className:d})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}pD.displayName="Background";const Uoe=_.memo(pD);function $oe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Hoe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function zoe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.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 Voe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 Koe(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.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 kf({children:e,className:t,...n}){return u.jsx("button",{type:"button",className:xn(["react-flow__controls-button",t]),...n,children:e})}const Yoe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function mD({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:a,onFitView:o,onInteractiveChange:l,className:c,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":p}){const m=zt(),{isInteractive:y,minZoomReached:v,maxZoomReached:g,ariaLabelConfig:E}=ct(Yoe,Ht),{zoomIn:b,zoomOut:w,fitView:N}=xx(),T=()=>{b(),s==null||s()},A=()=>{w(),a==null||a()},S=()=>{N(i),o==null||o()},R=()=>{m.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),l==null||l(!y)},I=h==="horizontal"?"horizontal":"vertical";return u.jsxs(_m,{className:xn(["react-flow__controls",I,c]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??E["controls.ariaLabel"],children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(kf,{onClick:T,className:"react-flow__controls-zoomin",title:E["controls.zoomIn.ariaLabel"],"aria-label":E["controls.zoomIn.ariaLabel"],disabled:g,children:u.jsx($oe,{})}),u.jsx(kf,{onClick:A,className:"react-flow__controls-zoomout",title:E["controls.zoomOut.ariaLabel"],"aria-label":E["controls.zoomOut.ariaLabel"],disabled:v,children:u.jsx(Hoe,{})})]}),n&&u.jsx(kf,{className:"react-flow__controls-fitview",onClick:S,title:E["controls.fitView.ariaLabel"],"aria-label":E["controls.fitView.ariaLabel"],children:u.jsx(zoe,{})}),r&&u.jsx(kf,{className:"react-flow__controls-interactive",onClick:R,title:E["controls.interactive.ariaLabel"],"aria-label":E["controls.interactive.ariaLabel"],children:y?u.jsx(Koe,{}):u.jsx(Voe,{})}),d]})}mD.displayName="Controls";const Woe=_.memo(mD);function qoe({id:e,x:t,y:n,width:r,height:i,style:s,color:a,strokeColor:o,strokeWidth:l,className:c,borderRadius:d,shapeRendering:f,selected:h,onClick:p}){const{background:m,backgroundColor:y}=s||{},v=a||m||y;return u.jsx("rect",{className:xn(["react-flow__minimap-node",{selected:h},c]),x:t,y:n,rx:d,ry:d,width:r,height:i,style:{fill:v,stroke:o,strokeWidth:l},shapeRendering:f,onClick:p?g=>p(g,e):void 0})}const Goe=_.memo(qoe),Xoe=e=>e.nodes.map(t=>t.id),l0=e=>e instanceof Function?e:()=>e;function Qoe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=Goe,onClick:a}){const o=ct(Xoe,Ht),l=l0(t),c=l0(e),d=l0(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return u.jsx(u.Fragment,{children:o.map(h=>u.jsx(Joe,{id:h,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:a,shapeRendering:f},h))})}function Zoe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:a,NodeComponent:o,onClick:l}){const{node:c,x:d,y:f,width:h,height:p}=ct(m=>{const y=m.nodeLookup.get(e);if(!y)return{node:void 0,x:0,y:0,width:0,height:0};const v=y.internals.userNode,{x:g,y:E}=y.internals.positionAbsolute,{width:b,height:w}=ls(v);return{node:v,x:g,y:E,width:b,height:w}},Ht);return!c||c.hidden||!u3(c)?null:u.jsx(o,{x:d,y:f,width:h,height:p,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:i,strokeColor:n(c),strokeWidth:s,shapeRendering:a,onClick:l,id:c.id})}const Joe=_.memo(Zoe);var ele=_.memo(Qoe);const tle=200,nle=150,rle=e=>!e.hidden,ile=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?l3(Td(e.nodeLookup,{filter:rle}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},sle="react-flow__minimap-desc";function gD({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:l,maskColor:c,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:p,onNodeClick:m,pannable:y=!1,zoomable:v=!1,ariaLabel:g,inversePan:E,zoomStep:b=1,offsetScale:w=5}){const N=zt(),T=_.useRef(null),{boundingRect:A,viewBB:S,rfId:R,panZoom:I,translateExtent:D,flowWidth:F,flowHeight:W,ariaLabelConfig:j}=ct(ile,Ht),$=(e==null?void 0:e.width)??tle,C=(e==null?void 0:e.height)??nle,O=A.width/$,L=A.height/C,M=Math.max(O,L),k=M*$,Y=M*C,G=w*M,P=A.x-(k-A.width)/2-G,V=A.y-(Y-A.height)/2-G,Q=k+G*2,ne=Y+G*2,le=`${sle}-${R}`,K=_.useRef(0),q=_.useRef();K.current=M,_.useEffect(()=>{if(T.current&&I)return q.current=ase({domNode:T.current,panZoom:I,getTransform:()=>N.getState().transform,getViewScale:()=>K.current}),()=>{var de;(de=q.current)==null||de.destroy()}},[I]),_.useEffect(()=>{var de;(de=q.current)==null||de.update({translateExtent:D,width:F,height:W,inversePan:E,pannable:y,zoomStep:b,zoomable:v})},[y,v,E,b,D,F,W]);const ae=p?de=>{var xe;const[Ie,_e]=((xe=q.current)==null?void 0:xe.pointer(de))||[0,0];p(de,{x:Ie,y:_e})}:void 0,ye=m?_.useCallback((de,Ie)=>{const _e=N.getState().nodeLookup.get(Ie).internals.userNode;m(de,_e)},[]):void 0,he=g??j["minimap.ariaLabel"];return u.jsx(_m,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r: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:xn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:u.jsxs("svg",{width:$,height:C,viewBox:`${P} ${V} ${Q} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":le,ref:T,onClick:ae,children:[he&&u.jsx("title",{id:le,children:he}),u.jsx(ele,{onClick:ye,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:a,nodeComponent:o}),u.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-G},${V-G}h${Q+G*2}v${ne+G*2}h${-Q-G*2}z + M${S.x},${S.y}h${S.width}v${S.height}h${-S.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}gD.displayName="MiniMap";const ale=_.memo(gD),ole=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,lle={[vl.Line]:"right",[vl.Handle]:"bottom-right"};function cle({nodeId:e,position:t,variant:n=vl.Handle,className:r,style:i=void 0,children:s,color:a,minWidth:o=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:p=!0,shouldResize:m,onResizeStart:y,onResize:v,onResizeEnd:g}){const E=W3(),b=typeof e=="string"?e:E,w=zt(),N=_.useRef(null),T=n===vl.Handle,A=ct(_.useCallback(ole(T&&p),[T,p]),Ht),S=_.useRef(null),R=t??lle[n];_.useEffect(()=>{if(!(!N.current||!b))return S.current||(S.current=Ese({domNode:N.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:D,transform:F,snapGrid:W,snapToGrid:j,nodeOrigin:$,domNode:C}=w.getState();return{nodeLookup:D,transform:F,snapGrid:W,snapToGrid:j,nodeOrigin:$,paneDomNode:C}},onChange:(D,F)=>{const{triggerNodeChanges:W,nodeLookup:j,parentLookup:$,nodeOrigin:C}=w.getState(),O=[],L={x:D.x,y:D.y},M=j.get(b);if(M&&M.expandParent&&M.parentId){const k=M.origin??C,Y=D.width??M.measured.width??0,G=D.height??M.measured.height??0,P={id:M.id,parentId:M.parentId,rect:{width:Y,height:G,...d3({x:D.x??M.position.x,y:D.y??M.position.y},{width:Y,height:G},M.parentId,j,k)}},V=Ex([P],j,$,C);O.push(...V),L.x=D.x?Math.max(k[0]*Y,D.x):void 0,L.y=D.y?Math.max(k[1]*G,D.y):void 0}if(L.x!==void 0&&L.y!==void 0){const k={id:b,type:"position",position:{...L}};O.push(k)}if(D.width!==void 0&&D.height!==void 0){const Y={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};O.push(Y)}for(const k of F){const Y={...k,type:"position"};O.push(Y)}W(O)},onEnd:({width:D,height:F})=>{const W={id:b,type:"dimensions",resizing:!1,dimensions:{width:D,height:F}};w.getState().triggerNodeChanges([W])}})),S.current.update({controlPosition:R,boundaries:{minWidth:o,minHeight:l,maxWidth:c,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:y,onResize:v,onResizeEnd:g,shouldResize:m}),()=>{var D;(D=S.current)==null||D.destroy()}},[R,o,l,c,d,f,y,v,g,m]);const I=R.split("-");return u.jsx("div",{className:xn(["react-flow__resize-control","nodrag",...I,n,r]),ref:N,style:{...i,scale:A,...a&&{[T?"backgroundColor":"borderColor"]:a}},children:s})}_.memo(cle);const ule=[{type:"sequential",label:"顺序",desc:"节点依次执行",Icon:u9},{type:"parallel",label:"并行",desc:"节点同时执行",Icon:z8},{type:"loop",label:"循环",desc:"节点循环执行",Icon:Xb}];let y1=0;function c0(){return y1+=1,`node_${y1}`}function u0(e,t,n){const r=Ks();return{id:e,type:"agentNode",position:t,data:{agent:{...r,name:(n==null?void 0:n.name)??`agent_${e.replace("node_","")}`,...n}}}}function dle({data:e,selected:t}){const n=e.agent;return u.jsxs("div",{className:`wfb-node ${t?"wfb-node--selected":""}`,children:[u.jsx(_l,{type:"target",position:Oe.Left,className:"wfb-handle"}),u.jsx("div",{className:"wfb-node-icon",children:u.jsx(La,{className:"icon"})}),u.jsxs("div",{className:"wfb-node-body",children:[u.jsx("div",{className:"wfb-node-name",children:n.name||"未命名节点"}),u.jsx("div",{className:"wfb-node-desc",children:n.instruction?n.instruction.slice(0,48):"点击编辑指令…"})]}),u.jsx(_l,{type:"source",position:Oe.Right,className:"wfb-handle"})]})}const fle={agentNode:dle},xS={type:"smoothstep",markerEnd:{type:$u.ArrowClosed,width:16,height:16}};function hle({onBack:e,onCreate:t}){const n=_.useRef(null),[r,i]=_.useState(""),[s,a]=_.useState(""),[o,l]=_.useState("sequential"),c=_.useMemo(()=>{y1=0;const C=c0();return u0(C,{x:80,y:120},{name:"agent_1"})},[]),[d,f,h]=Moe([c]),[p,m,y]=Doe([]),[v,g]=_.useState(c.id),E=d.find(C=>C.id===v)??null,b=r.trim()||"workflow_agent",w=_.useMemo(()=>hM({name:b,subAgents:d.map(C=>C.data.agent)}),[b,d]),N=Yo(b)??(w.has(b)?"名称须与 Agent 节点名称保持唯一":null),T=E?Yo(E.data.agent.name)??(w.has(E.data.agent.name)?"Agent 名称在当前工作流中必须唯一":null):null,A=d.length>0&&N===null&&d.every(C=>Yo(C.data.agent.name)===null&&!w.has(C.data.agent.name)),S=_.useCallback(C=>m(O=>H3({...C,...xS},O)),[m]),R=_.useCallback(()=>{const C=c0(),O=d.length*28,L=u0(C,{x:80+O,y:120+O});f(M=>M.concat(L)),g(C)},[d.length,f]),I=C=>{C.dataTransfer.setData("application/wfb-node","agentNode"),C.dataTransfer.effectAllowed="move"},D=_.useCallback(C=>{C.preventDefault(),C.dataTransfer.dropEffect="move"},[]),F=_.useCallback(C=>{if(C.preventDefault(),C.dataTransfer.getData("application/wfb-node")!=="agentNode"||!n.current)return;const L=n.current.screenToFlowPosition({x:C.clientX,y:C.clientY}),M=c0(),k=u0(M,L);f(Y=>Y.concat(k)),g(M)},[f]),W=_.useCallback(C=>{v&&f(O=>O.map(L=>L.id===v?{...L,data:{...L.data,agent:{...L.data.agent,...C}}}:L))},[v,f]),j=_.useCallback(()=>{v&&(f(C=>C.filter(O=>O.id!==v)),m(C=>C.filter(O=>O.source!==v&&O.target!==v)),g(null))},[v,f,m]),$=_.useCallback(()=>{if(!A)return;const C=d.map(L=>L.data.agent),O={...Ks(),name:b,description:s.trim(),instruction:s.trim(),subAgents:C,workflow:{type:o,nodes:d.map(L=>({id:L.id,agent:L.data.agent})),edges:p.map(L=>({from:L.source,to:L.target}))}};t(O)},[A,d,p,b,s,o,t]);return u.jsx("div",{className:"wfb",children:u.jsxs("div",{className:"wfb-grid",children:[u.jsxs("aside",{className:"wfb-palette",children:[u.jsx("div",{className:"wfb-section-label",children:"工作流信息"}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"名称"}),u.jsx("input",{className:`wfb-input ${N?"wfb-input--error":""}`,value:r,onChange:C=>i(C.target.value),placeholder:"my_workflow"}),N&&u.jsx("span",{className:"wfb-field-error",children:N})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"描述"}),u.jsx("textarea",{className:"wfb-input wfb-textarea",value:s,onChange:C=>a(C.target.value),placeholder:"这个工作流做什么…",rows:2})]}),u.jsx("div",{className:"wfb-section-label",children:"执行方式"}),u.jsx("div",{className:"wfb-types",children:ule.map(({type:C,label:O,desc:L,Icon:M})=>u.jsxs("button",{type:"button",className:`wfb-type ${o===C?"wfb-type--active":""}`,onClick:()=>l(C),children:[u.jsx(M,{className:"icon"}),u.jsxs("span",{className:"wfb-type-text",children:[u.jsx("span",{className:"wfb-type-name",children:O}),u.jsx("span",{className:"wfb-type-desc",children:L})]})]},C))}),u.jsx("div",{className:"wfb-section-label",children:"节点"}),u.jsxs("div",{className:"wfb-palette-item",draggable:!0,onDragStart:I,title:"拖拽到画布,或点击下方按钮添加",children:[u.jsx(s9,{className:"icon wfb-grip"}),u.jsx("span",{className:"wfb-node-icon wfb-node-icon--sm",children:u.jsx(La,{className:"icon"})}),u.jsx("span",{className:"wfb-palette-item-text",children:"Agent 节点"})]}),u.jsxs("button",{className:"wfb-add",type:"button",onClick:R,children:[u.jsx(pi,{className:"icon"}),"添加节点"]}),u.jsx("div",{className:"wfb-hint",children:"拖拽节点的圆点连线以表达执行顺序。"})]}),u.jsxs("div",{className:"wfb-canvas",children:[u.jsxs("button",{className:"wfb-create",onClick:$,disabled:!A,type:"button",children:[u.jsx(Ma,{className:"icon"}),"创建工作流"]}),u.jsxs(Loe,{nodes:d,edges:p,onNodesChange:h,onEdgesChange:y,onConnect:S,onInit:C=>n.current=C,nodeTypes:fle,defaultEdgeOptions:xS,onDrop:F,onDragOver:D,onNodeClick:(C,O)=>g(O.id),onPaneClick:()=>g(null),fitView:!0,fitViewOptions:{padding:.3,maxZoom:1},proOptions:{hideAttribution:!0},children:[u.jsx(Uoe,{gap:16,size:1,color:"hsl(240 5.9% 88%)"}),u.jsx(Woe,{showInteractive:!1}),u.jsx(ale,{pannable:!0,zoomable:!0,className:"wfb-minimap"})]})]}),u.jsx("aside",{className:"wfb-inspector",children:E?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"wfb-inspector-head",children:[u.jsx("div",{className:"wfb-section-label",children:"节点配置"}),u.jsx("button",{className:"wfb-icon-btn",type:"button",onClick:j,title:"删除节点",children:u.jsx(Il,{className:"icon"})})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"名称"}),u.jsx("input",{className:`wfb-input ${T?"wfb-input--error":""}`,value:E.data.agent.name,onChange:C=>W({name:C.target.value}),placeholder:"agent_name"}),T?u.jsx("span",{className:"wfb-field-error",children:T}):u.jsx("span",{className:"wfb-field-help",children:"仅使用英文字母、数字和下划线,且名称保持唯一。"})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"描述"}),u.jsx("input",{className:"wfb-input",value:E.data.agent.description,onChange:C=>W({description:C.target.value}),placeholder:"这个 agent 做什么…"})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"指令 (instruction)"}),u.jsx("textarea",{className:"wfb-input wfb-textarea",value:E.data.agent.instruction,onChange:C=>W({instruction:C.target.value}),placeholder:"你是一个…",rows:6})]}),u.jsxs("label",{className:"wfb-field",children:[u.jsx("span",{className:"wfb-field-label",children:"工具 (逗号分隔)"}),u.jsx("input",{className:"wfb-input",value:E.data.agent.tools.join(", "),onChange:C=>W({tools:C.target.value.split(",").map(O=>O.trim()).filter(Boolean)}),placeholder:"web_search, calculator"})]}),u.jsxs("div",{className:"wfb-inspector-meta",children:[u.jsx("span",{className:"wfb-meta-key",children:"节点 ID"}),u.jsx("code",{className:"wfb-meta-val",children:E.id})]})]}):u.jsxs("div",{className:"wfb-inspector-empty",children:[u.jsx(La,{className:"wfb-empty-icon"}),u.jsx("p",{children:"选择一个节点以编辑其配置"}),u.jsxs("p",{className:"wfb-empty-sub",children:["共 ",d.length," 个节点 · ",p.length," 条连线"]})]})})]})})}function ple(e){return u.jsx(hD,{children:u.jsx(hle,{...e})})}const vS=["#6366f1","#0ea5e9","#10b981","#f59e0b","#f43f5e","#a855f7","#14b8a6","#f472b6"];function d0(e){let t=0;for(let n=0;n>>0;return vS[t%vS.length]}function mle(e){const t=new Map;e.forEach(c=>t.set(c.span_id,c));const n=new Map,r=[];for(const c of e)c.parent_span_id!=null&&t.has(c.parent_span_id)?(n.get(c.parent_span_id)??n.set(c.parent_span_id,[]).get(c.parent_span_id)).push(c):r.push(c);const i=(c,d)=>c.start_time-d.start_time,s=(c,d)=>({span:c,depth:d,children:(n.get(c.span_id)??[]).sort(i).map(f=>s(f,d+1))}),a=r.sort(i).map(c=>s(c,0)),o=e.length?Math.min(...e.map(c=>c.start_time)):0,l=e.length?Math.max(...e.map(c=>c.end_time)):1;return{rootNodes:a,min:o,total:l-o||1}}function gle(e,t){const n=[],r=i=>{n.push(i),t.has(i.span.span_id)||i.children.forEach(r)};return e.forEach(r),n}function wS(e){const t=e/1e6;return t>=1e3?`${(t/1e3).toFixed(2)} s`:`${t.toFixed(t<10?2:1)} ms`}const yle=e=>e.replace(/^(gen_ai|a2ui|adk)\./,"");function _S(e){return Object.entries(e.attributes).filter(([,t])=>t!=null&&typeof t!="object").map(([t,n])=>{const r=String(n);return{key:yle(t),value:r,long:r.length>80||r.includes(` +`)}}).sort((t,n)=>Number(t.long)-Number(n.long))}function ble({appName:e,sessionId:t,onClose:n}){const[r,i]=_.useState(null),[s,a]=_.useState(""),[o,l]=_.useState(new Set),[c,d]=_.useState(null);_.useEffect(()=>{i(null),a(""),YC(e,t).then(E=>{i(E),d(E.length?E.reduce((b,w)=>b.start_time<=w.start_time?b:w).span_id:null)}).catch(E=>a(String(E)))},[e,t]);const{rootNodes:f,min:h,total:p}=_.useMemo(()=>mle(r??[]),[r]),m=_.useMemo(()=>gle(f,o),[f,o]),y=(r==null?void 0:r.find(E=>E.span_id===c))??null,v=p/1e6,g=E=>l(b=>{const w=new Set(b);return w.has(E)?w.delete(E):w.add(E),w});return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"drawer-scrim",onClick:n}),u.jsxs("aside",{className:"drawer drawer--trace",children:[u.jsxs("header",{className:"drawer-head",children:[u.jsxs("div",{children:[u.jsx("div",{className:"drawer-title",children:"调用链路观测"}),u.jsx("div",{className:"drawer-sub",children:r?`${r.length} 个调用 · ${v.toFixed(1)} ms`:"加载中"})]}),u.jsx("button",{className:"drawer-close",onClick:n,"aria-label":"关闭",children:u.jsx(Xr,{className:"icon"})})]}),r==null&&!s&&u.jsxs("div",{className:"drawer-loading",children:[u.jsx(bt,{className:"icon spin"})," 加载调用链路…"]}),s&&u.jsx("div",{className:"error",children:s}),r&&r.length===0&&u.jsx("div",{className:"drawer-empty",children:"该会话暂无调用链路(可能尚未产生调用)。"}),m.length>0&&u.jsxs("div",{className:"trace-split",children:[u.jsx("div",{className:"trace-tree scroll",children:m.map(E=>{const b=E.span,w=(b.start_time-h)/p*100,N=Math.max((b.end_time-b.start_time)/p*100,.6),T=E.children.length>0;return u.jsxs("button",{className:`trace-row ${c===b.span_id?"active":""}`,onClick:()=>d(b.span_id),children:[u.jsxs("span",{className:"trace-label",style:{paddingLeft:E.depth*14},children:[u.jsx("span",{className:`trace-caret ${T?"":"hidden"} ${o.has(b.span_id)?"":"open"}`,onClick:A=>{A.stopPropagation(),T&&g(b.span_id)},children:u.jsx(or,{className:"chev"})}),u.jsx("span",{className:"trace-dot",style:{background:d0(b.name)}}),u.jsx("span",{className:"trace-name",title:b.name,children:b.name})]}),u.jsx("span",{className:"trace-dur",children:wS(b.end_time-b.start_time)}),u.jsx("span",{className:"trace-track",children:u.jsx("span",{className:"trace-bar",style:{left:`${w}%`,width:`${N}%`,background:d0(b.name)}})})]},b.span_id)})}),u.jsx("div",{className:"trace-detail scroll",children:y?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"td-title",children:y.name}),u.jsxs("div",{className:"td-dur",children:[u.jsx("span",{className:"td-dot",style:{background:d0(y.name)}}),wS(y.end_time-y.start_time)]}),u.jsx("div",{className:"td-section",children:"属性"}),u.jsx("div",{className:"td-props",children:_S(y).filter(E=>!E.long).map(E=>u.jsxs("div",{className:"td-prop",children:[u.jsx("span",{className:"td-key",children:E.key}),u.jsx("span",{className:"td-val",children:E.value})]},E.key))}),_S(y).filter(E=>E.long).map(E=>u.jsxs("div",{className:"td-block",children:[u.jsx("div",{className:"td-section",children:E.key}),u.jsx("pre",{className:"td-pre",children:E.value})]},E.key))]}):u.jsx("div",{className:"drawer-empty",children:"选择左侧的一个调用查看详情"})})]})]})]})}function Ele(e){return e.toLowerCase()==="github"?u.jsx(i9,{className:"icon"}):u.jsx(f9,{className:"icon"})}function xle({branding:e,onUsername:t}){const[n,r]=_.useState(null),[i,s]=_.useState(""),[a,o]=_.useState(0),[l,c]=_.useState("");_.useEffect(()=>{let h=!0;return r(null),s(""),P9().then(p=>{h&&r(p)}).catch(p=>{h&&s(p instanceof Error?p.message:String(p))}),()=>{h=!1}},[a]);const d=O9.test(l),f=()=>{d&&t(l)};return u.jsxs("div",{className:"login",children:[u.jsx("header",{className:"login-top",children:u.jsxs("span",{className:"login-brand",children:[u.jsx("img",{className:"login-brand-logo",src:e.logoUrl||sE,width:20,height:20,alt:"","aria-hidden":!0}),e.title]})}),u.jsx("main",{className:"login-main",children:u.jsxs("div",{className:"login-card",children:[u.jsx(hd,{as:"h1",className:"login-title",duration:4.8,spread:22,children:e.title}),i?u.jsxs("div",{className:"login-provider-error",role:"alert",children:[u.jsx("p",{children:i}),u.jsx("button",{type:"button",onClick:()=>o(h=>h+1),children:"重试"})]}):n===null?null:n.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"login-sub",children:"登录以继续使用"}),u.jsx("div",{className:"login-providers",children:n.map(h=>u.jsxs("button",{className:"login-btn",onClick:()=>j9(h.loginUrl),children:[Ele(h.id),u.jsxs("span",{children:["使用 ",h.label," 登录"]})]},h.id))})]}):u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"login-sub",children:"输入一个用户名即可开始"}),u.jsxs("form",{className:"login-name",onSubmit:h=>{h.preventDefault(),f()},children:[u.jsx("input",{className:"login-name-input",value:l,onChange:h=>c(h.target.value),placeholder:"用户名(字母 + 数字,最多 16 位)",maxLength:16,autoFocus:!0}),u.jsx("button",{type:"submit",className:"login-name-go",disabled:!d,"aria-label":"进入",children:u.jsx(vC,{className:"icon"})})]}),u.jsx("p",{className:"login-hint","aria-live":"polite",children:l&&!d?"只能包含大小写字母和数字,最多 16 位。":""})]}),u.jsx("p",{className:"login-legal",children:"继续即表示你已阅读并同意服务条款与隐私政策"}),u.jsx("p",{className:"login-powered",children:"火山引擎 AgentKit 提供企业级 Agent 解决方案"})]})}),u.jsx("footer",{className:"login-footer",children:"© 2026 VeADK. All rights reserved."})]})}function vle({node:e,ctx:t}){const n=e.variant??"default";return u.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)})}Ya("Button",vle);function wle({node:e,ctx:t}){return u.jsx("div",{className:"a2ui-card","data-a2ui-id":e.id,"data-a2ui-component":e.component,children:t.render(e.child)})}Ya("Card",wle);const _le={start:"flex-start",center:"center",end:"flex-end",spaceBetween:"space-between",spaceAround:"space-around",spaceEvenly:"space-evenly",stretch:"stretch"},Tle={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"};function yD(e){return _le[e]??"flex-start"}function bD(e){return Tle[e]??"stretch"}function Nle({node:e,ctx:t}){const n=e.children??[];return u.jsx("div",{className:"a2ui-column","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"column",justifyContent:yD(e.justify),alignItems:bD(e.align)},children:n.map(r=>t.render(r))})}Ya("Column",Nle);function Sle({node:e}){const t=e.axis==="vertical";return u.jsx("div",{className:`a2ui-divider ${t?"a2ui-divider--v":"a2ui-divider--h"}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component})}Ya("Divider",Sle);const kle={send:"✈️",check:"✅",close:"✖️",star:"⭐",favorite:"❤️",info:"ℹ️",help:"❓",error:"⛔",calendarToday:"📅",event:"📅",schedule:"🕒",locationOn:"📍",accountCircle:"👤",mail:"✉️",call:"📞",home:"🏠",settings:"⚙️",search:"🔍"};function Ale({node:e}){const t=e.name??"";return u.jsx("span",{className:"a2ui-icon",title:t,"aria-label":t,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:kle[t]??"•"})}Ya("Icon",Ale);function Cle({node:e,ctx:t}){const n=e.children??[];return u.jsx("div",{className:"a2ui-row","data-a2ui-id":e.id,"data-a2ui-component":e.component,style:{display:"flex",flexDirection:"row",justifyContent:yD(e.justify),alignItems:bD(e.align??"center")},children:n.map(r=>t.render(r))})}Ya("Row",Cle);const Ile=new Set(["h1","h2","h3","h4","h5"]);function Rle({node:e,ctx:t}){const n=e.variant??"body",r=t.resolveString(e.text),i=Ile.has(n)?n:"p";return u.jsx(i,{className:`a2ui-text a2ui-text--${n}`,"data-a2ui-id":e.id,"data-a2ui-component":e.component,children:r})}Ya("Text",Rle);const Ole="创建 Agent",Lle={intelligent:"智能模式",custom:"自定义",template:"从模板新建",workflow:"工作流"},fo={app:"veadk.appName",view:"veadk.view",session:"veadk.sessionId"},Mle=new Set,Dle=[];function ao(){return{skills:[]}}function Ple(e,t){var r;const n=lI(e==null?void 0:e.events);if(n!=="新会话")return n;for(const i of t){if(i.role!=="user")continue;const s=(r=i.blocks.find(a=>a.kind==="text"))==null?void 0:r.text.trim();if(s)return s}return"新会话"}function ED(e,t){if(e.name===t)return e;for(const n of e.children){const r=ED(n,t);if(r)return r}}function xD(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(...xD(n)));return t}function TS(){const e=typeof localStorage<"u"?localStorage.getItem(fo.view):null;return e==="menu"||e==="intelligent"||e==="custom"||e==="template"||e==="workflow"?e:null}function jle({className:e}){return u.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[u.jsx("ellipse",{cx:"12",cy:"12",rx:"6.6",ry:"8.2"}),u.jsx("path",{d:"M12 8.2l1.05 2.75 2.75 1.05-2.75 1.05L12 15.8l-1.05-2.75L8.2 12l2.75-1.05z",fill:"currentColor",stroke:"none"})]})}function Ble(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:[u.jsx("rect",{x:"3",y:"4",width:"14",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none"}),u.jsx("rect",{x:"6",y:"10.4",width:"13",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.7"}),u.jsx("rect",{x:"9",y:"16.8",width:"9",height:"3.2",rx:"1.2",fill:"currentColor",stroke:"none",opacity:"0.45"})]})}function vD(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 Fle(e){if(!e)return"";const t=[];return e.ts&&t.push(vD(e.ts)),e.tokens!=null&&t.push(`${e.tokens.toLocaleString()} tokens`),t.join(" · ")}function Ule(e){return e.blocks.map(t=>t.kind==="text"?t.text:"").join("").trim()}const $le="send_a2ui_json_to_client";function Hle(e){return e.blocks.some(t=>t.kind==="text"?t.text.trim().length>0:t.kind==="attachment"?t.files.length>0:t.kind==="tool"?!(t.name===$le&&t.done):t.kind==="a2ui"?NI(t.messages).some(n=>n.components[n.rootId]):t.kind==="auth")}function zle(e){return e.blocks.some(t=>t.kind==="auth"&&!t.done)}function Vle(e){return new Promise((t,n)=>{let r="";try{r=new URL(e,window.location.href).protocol}catch{}if(r!=="http:"&&r!=="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 s=!1;const a=()=>{clearInterval(c),window.removeEventListener("message",l)},o=d=>{if(!s){s=!0,a();try{i.close()}catch{}t(d)}},l=d=>{if(d.origin!==window.location.origin)return;const f=d.data;f&&f.veadkOAuth&&typeof f.url=="string"&&o(f.url)};window.addEventListener("message",l);const c=setInterval(()=>{if(!s){if(i.closed){a();const d=window.prompt("授权完成后,请粘贴回调页面(浏览器地址栏)的完整 URL:");d&&d.trim()?(s=!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)&&o(d)}catch{}}},500)})}function Kle(e,t){const n=JSON.parse(JSON.stringify(e??{})),r=n.exchangedAuthCredential??n.exchanged_auth_credential??{},i=r.oauth2??{};return i.authResponseUri=t,i.auth_response_uri=t,r.oauth2=i,n.exchangedAuthCredential=r,n}function NS({text:e}){const[t,n]=_.useState(!1);return u.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?u.jsx(Li,{className:"icon"}):u.jsx(Kb,{className:"icon"})})}function Yle(e){return e==="cn-beijing"?"华北 2(北京)":e==="cn-shanghai"?"华东 2(上海)":e||"未指定"}function Wle({tasks:e,onCancel:t}){const[n,r]=_.useState(!1),[i,s]=_.useState(null),a=e.filter(f=>f.status==="running").length,o=e[0],l=a>0?"running":(o==null?void 0:o.status)??"idle",c=a>0?`${a} 个部署任务进行中`:(o==null?void 0:o.status)==="success"?"最近部署已完成":(o==null?void 0:o.status)==="error"?"最近部署失败":(o==null?void 0:o.status)==="cancelled"?"最近部署已取消":"部署任务",d=f=>{s(f.id),t(f).finally(()=>s(null))};return u.jsxs("div",{className:"global-deploy-center",children:[u.jsxs("button",{type:"button",className:`global-deploy-task is-${l}`,"aria-expanded":n,"aria-haspopup":"dialog",onClick:()=>r(f=>!f),children:[l==="running"?u.jsx(bt,{className:"global-deploy-task-icon spin"}):l==="success"?u.jsx(q8,{className:"global-deploy-task-icon"}):l==="error"?u.jsx(NC,{className:"global-deploy-task-icon"}):l==="cancelled"?u.jsx(G8,{className:"global-deploy-task-icon"}):u.jsx(d9,{className:"global-deploy-task-icon"}),u.jsx("span",{className:"global-deploy-task-detail",children:c}),u.jsx($h,{className:`global-deploy-task-chevron${n?" is-open":""}`})]}),n&&u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"global-deploy-task-scrim","aria-label":"关闭部署任务",onClick:()=>r(!1)}),u.jsxs("section",{className:"global-deploy-popover",role:"dialog","aria-label":"部署任务",children:[u.jsxs("header",{className:"global-deploy-popover-head",children:[u.jsx("span",{children:"部署任务"}),u.jsx("span",{children:e.length})]}),u.jsx("div",{className:"global-deploy-list",children:e.length===0?u.jsx("div",{className:"global-deploy-empty",children:"暂无部署任务"}):e.map(f=>{const h=`${f.label}${f.status==="running"&&typeof f.pct=="number"?` ${Math.round(f.pct)}%`:""}`;return u.jsxs("article",{className:`global-deploy-item is-${f.status}`,children:[u.jsxs("div",{className:"global-deploy-item-head",children:[u.jsx("span",{className:"global-deploy-runtime-name",children:f.runtimeName}),u.jsx("span",{className:"global-deploy-status",children:h})]}),u.jsxs("dl",{className:"global-deploy-meta",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Runtime 名称"}),u.jsx("dd",{children:f.runtimeName})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"部署地域"}),u.jsx("dd",{children:Yle(f.region)})]}),f.runtimeId&&u.jsxs("div",{children:[u.jsx("dt",{children:"Runtime ID"}),u.jsx("dd",{children:f.runtimeId})]})]}),f.message&&f.status==="error"?u.jsx(cp,{className:"global-deploy-error",message:f.message,onRetry:f.retry}):f.message?u.jsx("p",{className:"global-deploy-message",children:f.message}):null,f.status==="running"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"global-deploy-progress","aria-hidden":!0,children:u.jsx("span",{style:{width:`${Math.max(6,Math.min(100,f.pct??6))}%`}})}),u.jsx("div",{className:"global-deploy-item-actions",children:u.jsx("button",{type:"button",disabled:i===f.id,onClick:()=>d(f),children:i===f.id?"取消中…":"取消部署"})})]})]},f.id)})})]})]})]})}const SS=["今天想做点什么?","有什么可以帮你的?","需要我帮你查点什么吗?","有问题尽管问我","嗨,我们开始吧","开始一段新对话吧","今天想先解决哪件事?","把你的想法告诉我吧","我们从哪里开始?","有什么任务交给我?","准备好一起推进了吗?","说说你现在最关心的问题","今天也一起把事情做好","我在,随时可以开始"],kS=()=>SS[Math.floor(Math.random()*SS.length)];function f0(e){var t;for(const n of e)(t=n.previewUrl)!=null&&t.startsWith("blob:")&&URL.revokeObjectURL(n.previewUrl)}function qle(){return`draft-${Date.now()}-${Math.random().toString(36).slice(2)}`}function Gle(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"}function Xle(){const[e,t]=_.useState([]),[n,r]=_.useState(""),[i,s]=_.useState([]),[a,o]=_.useState(""),l=_.useRef(null),[c,d]=_.useState(!1),[f,h]=_.useState([]),[p,m]=_.useState({}),y=a?p[a]??[]:f,v=Ple(i.find(Z=>Z.id===a),y),g=(Z,ie)=>m(Se=>({...Se,[Z]:typeof ie=="function"?ie(Se[Z]??[]):ie})),[E,b]=_.useState(""),[w,N]=_.useState([]),[T,A]=_.useState(ao),[S,R]=_.useState(null),[I,D]=_.useState(!1),F=_.useRef(new Set),[W,j]=_.useState(()=>new Set),$=_.useRef(new Map),C=(Z,ie)=>j(Se=>{const Fe=new Set(Se);return ie?Fe.add(Z):Fe.delete(Z),Fe}),O=_.useRef(""),[L,M]=_.useState(""),[k,Y]=_.useState(!1),[G,P]=_.useState(kS),[V,Q]=_.useState(null),[ne,le]=_.useState(null),[K,q]=_.useState(""),[ae,ye]=_.useState(),[he,de]=_.useState(null),[Ie,_e]=_.useState({newChat:!0,search:!0,skillCenter:!0,history:!0,addAgent:!0,manageAgents:!0,addAgentkit:!0}),[xe,je]=_.useState("cloud"),[be,Ve]=_.useState(Su),[ke,ce]=_.useState("chat"),[Nt,De]=_.useState(!1),[xt,it]=_.useState(!1),[z,X]=_.useState(!1),[oe,ve]=_.useState({}),[Ae,st]=_.useState({}),[Xt,ze]=_.useState({}),vt=W.has(a)||c,pt=oe[a]??"",jt=Ae[a]??Mle,Vt=Xt[a]??Dle,Qt=S==null?void 0:S.graph,Le=T.targetAgent&&Qt?ED(Qt,T.targetAgent.name):Qt,Je=(Le==null?void 0:Le.skills)??(T.targetAgent?[]:(S==null?void 0:S.skills)??[]),mt=Qt?xD(Qt):[];function gt(Z){f0(Z);for(const ie of Z)ie.status==="uploading"?F.current.add(ie.id):ie.uri&&Kf(n,ie.uri).catch(Se=>M(String(Se)))}async function se(Z){try{await ky(n,K,Z),await Sy(n,K,Z),s(ie=>ie.filter(Se=>Se.id!==Z)),m(ie=>{const{[Z]:Se,...Fe}=ie;return Fe})}catch(ie){M(String(ie))}}function Ce(Z){const ie=w.find(Ge=>Ge.id===Z);if(!ie)return;const Se=w.filter(Ge=>Ge.id!==Z);f0([ie]),ie.status==="uploading"&&F.current.add(Z),N(Se),Se.length===0&&!E.trim()&&!!a&&y.length===0?(O.current="",o(""),se(a)):ie.uri&&Kf(n,ie.uri).catch(Ge=>M(String(Ge)))}const Ke=(Z,ie)=>{var ot,Qe,nn,Re,St;const Se=ie.author&&ie.author!=="user"?ie.author:void 0;Se&&(ve(wt=>({...wt,[Z]:Se})),st(wt=>({...wt,[Z]:new Set(wt[Z]??[]).add(Se)})),ze(wt=>{var At;return(At=wt[Z])!=null&&At.length?wt:{...wt,[Z]:[Se]}}));const Fe=((ot=ie.actions)==null?void 0:ot.transferToAgent)??((Qe=ie.actions)==null?void 0:Qe.transfer_to_agent);Fe&&ze(wt=>{const At=wt[Z]??[];return At[At.length-1]===Fe?wt:{...wt,[Z]:[...At,Fe]}}),(((nn=ie.actions)==null?void 0:nn.endOfAgent)??((Re=ie.actions)==null?void 0:Re.end_of_agent)??((St=ie.actions)==null?void 0:St.escalate))&&ze(wt=>{const At=wt[Z]??[];return At.length<=1?wt:{...wt,[Z]:At.slice(0,-1)}})},[on,Xe]=_.useState(TS),[re,Ee]=_.useState([]),me=_.useCallback(Z=>{Ee(ie=>{const Se=ie.findIndex(Ge=>Ge.id===Z.id);if(Se===-1)return[Z,...ie];const Fe=[...ie];return Fe[Se]={...Fe[Se],...Z},Fe})},[]),Me=_.useCallback(async Z=>{try{await QC(Z.id),Ee(ie=>ie.map(Se=>Se.id===Z.id?{...Se,status:"cancelled",label:"已取消",message:"部署已取消,相关 Runtime 资源已请求销毁。"}:Se))}catch(ie){const Se=ie instanceof Error?ie.message:String(ie);Ee(Fe=>Fe.map(Ge=>Ge.id===Z.id?{...Ge,message:`取消失败:${Se}`}:Ge))}},[]),[$e,He]=_.useState(!0),[ft,at]=_.useState(!1),[ln,ht]=_.useState(!1),[In,ut]=_.useState(!1),[jn,cn]=_.useState(null),[dr,Zt]=_.useState(!1),[fr,Bt]=_.useState(!1),er=_.useRef(null),[Ot,vn]=_.useState(()=>{const Z=Yi();return Rl(Z),Z}),[tr,Rn]=_.useState(!1),Bn=_.useRef(!1),wn=_.useRef(!1);function _n(Z){console.log("create agent draft:",Z),Xe(null),ee()}function Tn(Z,ie){console.log("Agent added, navigating to:",Z,ie),vn(Yi()),Xe(null),r(Z)}const{ref:Jt,onScroll:en}=SI(y),gn=_.useCallback(()=>{le(null),F9().then(Z=>{q(Z.userId),ye(Z.info),it(!!Z.local),Q(Z.status)}).catch(Z=>{le(Z instanceof Error?Z.message:String(Z))})},[]);_.useEffect(()=>{gn()},[gn]),_.useEffect(()=>{if(V!=="authenticated"||!K){de(null);return}let Z=!1;return de(null),tI().then(ie=>{Z||de(ie)}).catch(ie=>{console.warn("[app] /web/access failed; using ordinary-user access:",ie),Z||de(eI)}),()=>{Z=!0}},[V,K]),_.useEffect(()=>{JC().then(Z=>{_e(Z.features),je(Z.agentsSource),Ve(Z.branding),ce(Z.defaultView),De(!0)})},[]),_.useEffect(()=>{!he||!Nt||wn.current||(wn.current=!0,ke==="addAgent"&&he.capabilities.createAgents&&(Xe(null),at(!1),Zt(!1),Bt(!1),ht(!1),ut(!0)))},[he,ke,Nt]),_.useEffect(()=>{he&&(he.capabilities.createAgents||(Xe(null),cn(null),ht(!1),ut(!1),Ee([])),he.capabilities.manageAgents||Bt(!1))},[he]),_.useEffect(()=>{document.title=be.title;let Z=document.querySelector('link[rel~="icon"]');Z||(Z=document.createElement("link"),Z.rel="icon",document.head.appendChild(Z)),Z.removeAttribute("type"),Z.href=be.logoUrl||sE},[be]),_.useEffect(()=>{fetch("/web/runtime-config",{signal:AbortSignal.timeout(1e4)}).then(Z=>Z.ok?Z.json():null).then(Z=>{Z&&He(!!Z.credentials)}).catch(Z=>{console.warn("[app] /web/runtime-config probe failed; workbench stays hidden:",Z)})},[]);function Fn(Z){L9(Z),Bn.current=!0,wn.current=!1,de(null),Xe(null),cn(null),at(!1),ht(!1),ut(!1),Zt(!1),Bt(!1),ee(),q(Z),ye({name:Z}),it(!0),Q("authenticated")}function Nn(){wn.current=!1,de(null),xt?(M9(),q(""),ye(void 0),Q("unauthenticated")):B9()}_.useEffect(()=>{V!=="unauthenticated"&&HC().then(Z=>{if(t(Z),xe==="cloud"){r("");return}const ie=localStorage.getItem(fo.app),Se=Ot.flatMap(ot=>ot.apps.map(Qe=>Da(ot.id,Qe))),Fe=ie&&(Z.includes(ie)||Se.includes(ie)),Ge=["web_search_agent","web_demo"].find(ot=>Z.includes(ot))??Z.find(ot=>!/^\d/.test(ot))??Z[0];r(Fe?ie:Ge||"")}).catch(Z=>M(String(Z)))},[V,xe]),_.useEffect(()=>{n&&localStorage.setItem(fo.app,n)},[n]),_.useEffect(()=>{let Z=!1;if(R(null),A(ao()),!n){D(!1);return}return D(!0),id(n).then(ie=>{Z||R(ie)}).catch(()=>{Z||R(null)}).finally(()=>{Z||D(!1)}),()=>{Z=!0}},[n]),_.useEffect(()=>{he&&localStorage.setItem(fo.view,he.capabilities.createAgents?on??"chat":"chat")},[he,on]),_.useEffect(()=>{localStorage.setItem(fo.session,a),O.current=a},[a]),_.useEffect(()=>()=>$.current.forEach(Z=>Z.abort()),[]),_.useEffect(()=>{!n||!K||(async()=>{const Z=await yn(n);if(!Bn.current){Bn.current=!0;const ie=localStorage.getItem(fo.session)||"";if(TS()===null&&ie&&Z.some(Se=>Se.id===ie)){Pe(ie);return}}ee()})()},[n,K]),_.useEffect(()=>{const Z=er.current;Z&&Z.app===n&&(er.current=null,Pe(Z.sid))},[n]);function Tr(Z,ie){Zt(!1),Z===n?Pe(ie):(er.current={app:Z,sid:ie},r(Z))}async function yn(Z){try{const ie=await tE(Z,K),Se=await Promise.all(ie.map(Fe=>{var Ge;return(Ge=Fe.events)!=null&&Ge.length?Promise.resolve(Fe):zh(Z,K,Fe.id)}));return s(Se),Se}catch(ie){return M(String(ie)),[]}}function ee(){M(""),P(kS());const Z=a&&y.length===0&&w.length>0?a:"";O.current="",o(""),d(!1),h([]),A(ao()),gt(w),N([]),Z&&se(Z)}async function Te(Z){var ie;try{(ie=$.current.get(Z))==null||ie.abort(),await ky(n,K,Z),await Sy(n,K,Z),m(Se=>{const{[Z]:Fe,...Ge}=Se;return Ge}),Z===a&&ee(),await yn(n)}catch(Se){M(String(Se))}}async function Pe(Z){if(Z!==a&&(O.current=Z,M(""),d(!1),h([]),A(ao()),o(Z),p[Z]===void 0)){X(!0);try{const ie=await zh(n,K,Z);g(Z,Z9(ie.events??[]))}catch(ie){M(String(ie))}finally{X(!1)}}}async function nt(Z=!0){if(a)return a;l.current||(l.current=Hh(n,K));const ie=l.current;try{const Se=await ie;Z&&o(Se);const Fe=Date.now()/1e3,Ge={id:Se,lastUpdateTime:Fe,events:[]};return s(ot=>[Ge,...ot.filter(Qe=>Qe.id!==Se)]),Se}finally{l.current===ie&&(l.current=null)}}async function yt(Z){M("");let ie;try{ie=await nt()}catch(Fe){M(String(Fe));return}const Se=Array.from(Z).map(Fe=>({file:Fe,attachment:{id:qle(),mimeType:Gle(Fe),name:Fe.name,sizeBytes:Fe.size,status:"uploading"}}));N(Fe=>[...Fe,...Se.map(Ge=>Ge.attachment)]),await Promise.all(Se.map(async({file:Fe,attachment:Ge})=>{try{const ot=await zC(n,K,ie,Fe);if(F.current.delete(Ge.id)){ot.uri&&await Kf(n,ot.uri);return}N(Qe=>Qe.map(nn=>nn.id===Ge.id?ot:nn))}catch(ot){if(F.current.delete(Ge.id))return;const Qe=ot instanceof Error?ot.message:String(ot);N(nn=>nn.map(Re=>Re.id===Ge.id?{...Re,status:"error",error:Qe}:Re)),M(Qe)}}))}async function Lt(Z,ie=[],Se=ao()){if(!Z.trim()&&ie.length===0||vt||!n||!K)return;M("");const Fe=[];(Se.skills.length>0||Se.targetAgent)&&Fe.push({kind:"invocation",value:Se}),ie.length&&Fe.push({kind:"attachment",files:ie.map(Re=>({id:Re.id,mimeType:Re.mimeType,data:Re.data,uri:Re.uri,name:Re.name,sizeBytes:Re.sizeBytes}))}),Z.trim()&&Fe.push({kind:"text",text:Z});const Ge=[{role:"user",blocks:Fe,meta:{ts:Date.now()/1e3}},{role:"assistant",blocks:[]}],ot=!a;ot&&(h(Ge),d(!0));let Qe;try{Qe=await nt(!ot)}catch(Re){ot&&(h([]),d(!1),b(Z),A(Se)),M(String(Re));return}g(Qe,Ge),ot&&(O.current=Qe,o(Qe),h([]),d(!1));const nn=new AbortController;$.current.set(Qe,nn),C(Qe,!0),O.current=Qe,ve(Re=>({...Re,[Qe]:""})),st(Re=>({...Re,[Qe]:new Set})),ze(Re=>({...Re,[Qe]:[]}));try{let Re=Ki(),St=0,wt=Date.now()/1e3;for await(const At of Nu({appName:n,userId:K,sessionId:Qe,text:Z,attachments:ie,invocation:Se,signal:nn.signal})){if(nn.signal.aborted)break;const cs=At.error??At.errorMessage??At.error_message;if(typeof cs=="string"&&cs){O.current===Qe&&M(cs);break}Ke(Qe,At),Re=al(Re,At);const Qa=At.usageMetadata??At.usage_metadata;Qa!=null&&Qa.totalTokenCount&&(St=Qa.totalTokenCount),At.timestamp&&(wt=At.timestamp);const km=Re.blocks,Zs={tokens:St||void 0,ts:wt};g(Qe,Js=>{const us=Js.slice(),Ad=us[us.length-1];return(Ad==null?void 0:Ad.role)==="assistant"&&(us[us.length-1]={...Ad,blocks:km,meta:Zs}),us})}yn(n)}catch(Re){(Re==null?void 0:Re.name)!=="AbortError"&&!nn.signal.aborted&&O.current===Qe&&M(String(Re))}finally{$.current.get(Qe)===nn&&$.current.delete(Qe),C(Qe,!1),ve(Re=>({...Re,[Qe]:""})),ze(Re=>({...Re,[Qe]:[]}))}}function tn(Z,ie){var Ge,ot;const Se=((Ge=Z==null?void 0:Z.event)==null?void 0:Ge.name)??ie.id,Fe=((ot=Z==null?void 0:Z.event)==null?void 0:ot.context)??{};Lt(`[ui-action] ${Se}: ${JSON.stringify(Fe)}`)}async function Un(Z){if(!Z.authUri)throw new Error("事件中没有授权地址。");if(!n||!K||!a)throw new Error("会话尚未就绪。");const ie=a,Se=await Vle(Z.authUri),Fe=Kle(Z.authConfig,Se),Ge=Re=>Re.map(St=>St.kind==="auth"&&!St.done?{...St,done:!0}:St);g(ie,Re=>{const St=Re.slice(),wt=St[St.length-1];return(wt==null?void 0:wt.role)==="assistant"&&(St[St.length-1]={...wt,blocks:Ge(wt.blocks)}),St});const ot=y[y.length-1],Qe=Ge(ot&&ot.role==="assistant"?ot.blocks:[]),nn=new AbortController;$.current.set(ie,nn),C(ie,!0);try{let Re=Ki(),St=0,wt=Date.now()/1e3;for await(const At of Nu({appName:n,userId:K,sessionId:a,text:"",functionResponses:[{id:Z.callId,name:"adk_request_credential",response:Fe}],signal:nn.signal})){if(nn.signal.aborted)break;Ke(ie,At),Re=al(Re,At);const cs=At.usageMetadata??At.usage_metadata;cs!=null&&cs.totalTokenCount&&(St=cs.totalTokenCount),At.timestamp&&(wt=At.timestamp);const Qa=[...Qe,...Re.blocks];g(ie,km=>{var us;const Zs=km.slice(),Js=Zs[Zs.length-1];return(Js==null?void 0:Js.role)==="assistant"&&(Zs[Zs.length-1]={...Js,blocks:Qa,meta:{tokens:St||((us=Js.meta)==null?void 0:us.tokens),ts:wt}}),Zs})}yn(n)}catch(Re){(Re==null?void 0:Re.name)!=="AbortError"&&!nn.signal.aborted&&O.current===ie&&M(String(Re))}finally{$.current.get(ie)===nn&&$.current.delete(ie),C(ie,!1),ve(Re=>({...Re,[ie]:""})),ze(Re=>({...Re,[ie]:[]}))}}if(ne)return u.jsxs("div",{className:"boot boot-error",children:[u.jsx("p",{children:ne}),u.jsx("button",{type:"button",onClick:gn,children:"重试"})]});if(V===null)return u.jsx("div",{className:"boot"});if(V==="unauthenticated")return u.jsx(xle,{branding:be,onUsername:Fn});if(!he)return u.jsx("div",{className:"boot"});const Sn=he.capabilities.createAgents,On=he.capabilities.manageAgents,hr=Sn?on:null,zl=Sn&&In,Vl=Sn&&ln,Kl=On&&fr,wx=pI(e,Ot),Sd=Z=>{var ie;return((ie=wx.find(Se=>Se.id===Z))==null?void 0:ie.label)??Z},Yl=Ot.find(Z=>Z.runtimeId&&Z.apps.some(ie=>Da(Z.id,ie)===n)),kd=Yl&&Yl.runtimeId?{runtimeId:Yl.runtimeId,name:Yl.name,region:Yl.region??"cn-beijing"}:void 0,Sm=Z=>{vn(Yi()),O.current="",o(""),r(Z)},wD=async Z=>{const ie=await iE(Z.runtimeId,Z.name,Z.region);Sm(ie)};return u.jsxs("div",{className:"layout",children:[u.jsx(jF,{branding:be,access:he,agentsSource:xe,localApps:e,currentAgentId:n,currentAgentLabel:n?Sd(n):"",currentRuntime:kd,onSelectAgent:Sm,features:Ie,sessions:i,currentSessionId:a,streamingSids:W,onNewChat:()=>{Xe(null),at(!1),ht(!1),ut(!1),Zt(!1),Bt(!1),ee()},onSearch:()=>{Xe(null),at(!1),ht(!1),ut(!1),Bt(!1),Zt(!0),M("")},onQuickCreate:()=>{if(!Sn){M("当前账号没有添加 Agent 的权限。");return}O.current="",o(""),at(!1),ht(!1),Zt(!1),Bt(!1),Xe(null),cn(null),ut(!0),M("")},onSkillCenter:()=>{Xe(null),ht(!1),ut(!1),Zt(!1),Bt(!1),at(!0),M("")},onAddAgent:()=>{if(!Sn){M("当前账号没有添加 Agent 的权限。");return}O.current="",Xe(null),at(!1),Zt(!1),Bt(!1),o(""),ut(!1),ht(!0),M("")},onManageAgents:()=>{if(!On){M("当前账号没有管理 Agent 的权限。");return}O.current="",o(""),Xe(null),at(!1),ht(!1),ut(!1),Zt(!1),Bt(!0),M("")},onPickSession:Z=>{Xe(null),at(!1),ht(!1),ut(!1),Zt(!1),Bt(!1),M(""),Pe(Z)},onDeleteSession:Te,userInfo:ae,onLogout:Nn}),(()=>{const Z=u.jsx(qQ,{sessionId:a,sessionInitializing:c,appName:n,agentName:n?Sd(n):"Agent",value:E,onChange:b,onSubmit:()=>{const ie=E,Se=w,Fe=T;b(""),N([]),A(ao()),Lt(ie,Se,Fe),f0(Se)},disabled:!n||!K,busy:vt,showMeta:y.length>0,attachments:w,skills:Je,agents:mt,invocation:T,capabilitiesLoading:I,onInvocationChange:A,onAddFiles:yt,onRemoveAttachment:Ce});return u.jsxs("section",{className:"main-shell",children:[u.jsx(BF,{apps:wx.map(ie=>ie.id),appName:n,onAppChange:Sm,agentLabel:Sd,title:zl?"添加 Agent":Vl?"添加 AgentKit 智能体":ft?"技能中心":dr?"搜索":Kl?"管理 Agent":hr?void 0:v,crumbs:dr||Vl||ft||zl||!hr?void 0:hr==="menu"?[{label:Ole,onClick:()=>{Xe(null),cn(null),ut(!0)}},{label:"从 0 快速创建"}]:[{label:"从 0 快速创建",onClick:()=>Rn(!0)},{label:Lle[hr]}],rightContent:u.jsx(Wle,{tasks:Sn?re:[],onCancel:Me})}),u.jsxs("main",{className:"main",children:[L&&u.jsx("div",{className:"error",children:L}),z&&u.jsxs("div",{className:"session-loading",children:[u.jsx(bt,{className:"icon spin"})," 加载会话…"]}),Kl?u.jsx(zF,{currentRuntimeId:kd==null?void 0:kd.runtimeId,onConnect:wD}):zl?u.jsx(pL,{title:"您想以哪种方式添加 Agent 来运行?",sub:"选择最适合你的方式,下一步即可开始",cards:[{key:"scratch",icon:jle,title:"从 0 快速创建",desc:"用智能 / 自定义 / 模板 / 工作流的方式从零创建一个 Agent。",onClick:()=>{ut(!1),cn(null),Xe("menu")}}]}):dr?u.jsx(pF,{userId:K,appId:n,agentInfo:S,capabilitiesLoading:I,agentLabel:Sd,onOpenSession:Tr}):Vl?u.jsx(HF,{onAdded:ie=>{vn(Yi()),ht(!1),r(ie)},onCancel:()=>ht(!1)}):ft?u.jsx(nF,{}):hr!==null&&!$e?u.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:[u.jsx("div",{style:{fontSize:18,fontWeight:600},children:"需要配置火山引擎 AK/SK"}),u.jsxs("div",{style:{maxWidth:420,lineHeight:1.6},children:["智能体工作台需要 Volcengine 凭据才能使用。请在运行环境中设置"," ",u.jsx("code",{children:"VOLCENGINE_ACCESS_KEY"})," 与"," ",u.jsx("code",{children:"VOLCENGINE_SECRET_KEY"})," 后重试。"]})]}):hr==="menu"?u.jsx(TJ,{onSelect:ie=>{cn(null),Xe(ie)},onImport:ie=>{cn(ie),Xe("custom")}}):hr==="intelligent"?u.jsx(QJ,{userId:K,onBack:()=>Xe("menu"),onCreate:_n,onAgentAdded:Tn,onDeploymentTaskChange:me}):hr==="custom"?u.jsx(jee,{initialDraft:jn??void 0,onBack:()=>Xe("menu"),onCreate:_n,onAgentAdded:Tn,features:Ie,onDeploymentTaskChange:me}):hr==="template"?u.jsx(Uee,{onBack:()=>Xe("menu"),onCreate:_n}):hr==="workflow"?u.jsx(ple,{onBack:()=>Xe("menu"),onCreate:_n}):y.length===0?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"welcome",children:[u.jsx(hd,{as:"h1",className:"welcome-title",duration:4.8,spread:22,children:G}),Z]}),u.jsx(f_,{appName:n,activeAgent:pt,seenAgents:jt,execPath:Vt})]}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"transcript",ref:Jt,onScroll:en,children:y.map((ie,Se)=>{var ot;const Fe=Se===y.length-1;if(ie.role==="user"){const Qe=ie.blocks.map(St=>St.kind==="text"?St.text:"").join(""),nn=ie.blocks.flatMap(St=>St.kind==="attachment"?St.files:[]),Re=ie.blocks.find(St=>St.kind==="invocation");return u.jsxs($t.div,{className:"turn turn--user",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:[(Re==null?void 0:Re.kind)==="invocation"&&u.jsx(DE,{value:Re.value}),nn.length>0&&u.jsx(jE,{appName:n,items:nn}),Qe&&u.jsx("div",{className:"bubble",children:u.jsx(im,{text:Qe})}),u.jsxs("div",{className:"turn-actions turn-actions--right",children:[((ot=ie.meta)==null?void 0:ot.ts)&&u.jsx("span",{className:"meta-text",children:vD(ie.meta.ts)}),u.jsx(NS,{text:Qe})]})]},Se)}const Ge=ie.blocks.length===0;return u.jsx($t.div,{className:"turn turn--assistant",initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2,ease:"easeOut"},children:Ge?Fe&&vt?u.jsx(fL,{}):null:u.jsxs(u.Fragment,{children:[u.jsx(hL,{appName:n,blocks:ie.blocks,onAction:tn,onAuth:Un}),!(Fe&&vt)&&!Hle(ie)&&u.jsx("div",{className:"turn-empty",children:"本次没有返回可显示的内容。"}),!(Fe&&vt)&&!zle(ie)&&u.jsxs("div",{className:"turn-meta",children:[u.jsxs("div",{className:"turn-actions",children:[u.jsx("button",{className:"icon-btn",title:"Tracing 火焰图",onClick:()=>Y(!0),children:u.jsx(Ble,{})}),u.jsx(NS,{text:Ule(ie)})]}),ie.meta&&u.jsx("span",{className:"meta-text",children:Fle(ie.meta)})]})]})},Se)})}),u.jsx(f_,{appName:n,activeAgent:pt,seenAgents:jt,execPath:Vt}),Z]})]})]})})(),k&&a&&u.jsx(ble,{appName:n,sessionId:a,onClose:()=>Y(!1)}),tr&&u.jsx("div",{className:"confirm-scrim",onClick:()=>Rn(!1),children:u.jsxs("div",{className:"confirm-box",onClick:Z=>Z.stopPropagation(),children:[u.jsx("div",{className:"confirm-title",children:"返回创建首页?"}),u.jsx("div",{className:"confirm-text",children:"返回后当前填写的内容将会丢失,确定要返回吗?"}),u.jsxs("div",{className:"confirm-actions",children:[u.jsx("button",{className:"confirm-btn",onClick:()=>Rn(!1),children:"取消"}),u.jsx("button",{className:"confirm-btn confirm-btn--danger",onClick:()=>{cn(null),Xe("menu"),Rn(!1)},children:"确定返回"})]})]})})]})}(()=>{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})()||h0.createRoot(document.getElementById("root")).render(u.jsx(qe.StrictMode,{children:u.jsx(s6,{reducedMotion:"user",children:u.jsx(B8,{maskOpacity:.9,children:u.jsx(Xle,{})})})}));export{_ as A,Xp as B,Or as C,ece as D,zc as E,Pa as F,mR as G,Qle as R,Zn as V,qe as a,ll as b,rT as c,tce as d,hE as e,uH as f,Cu as g,lt as h,kV as i,MV as j,fH as k,Ku as l,MK as m,mV as n,gV as o,HK as p,lK as q,cK as r,SR as s,u as t,Be as u,kt as v,et as w,Jle as x,NV as y,nl as z}; diff --git a/veadk/webui/index.html b/veadk/webui/index.html index 5323b8e3..b50b92a9 100644 --- a/veadk/webui/index.html +++ b/veadk/webui/index.html @@ -5,7 +5,7 @@ VeADK Studio - +