diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3141e60e..3af04b28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: - name: UI typecheck working-directory: ui - run: pnpm exec tsc --noEmit + run: pnpm typecheck - name: UI unit tests run: node --test --experimental-strip-types ui/tests/*.test.mjs diff --git a/src/commands/up.rs b/src/commands/up.rs index 5807eed2..b1806050 100644 --- a/src/commands/up.rs +++ b/src/commands/up.rs @@ -41,6 +41,7 @@ use crate::store::{ log_path, now_ms, SshHostTest, Store, StoredAgentSelection, StoredChatSession, StoredRun, }; use crate::updates; +use crate::workspace_state::{GlobalWorkspaceState, WorkspaceState}; use crate::{browser, UpArgs}; pub async fn run(args: UpArgs) -> Result<()> { @@ -547,6 +548,10 @@ fn router(state: AppState, remote_auth: Option) -> Router { .route("/api/update/auto", post(set_auto_update)) .route("/api/update/install-cli", post(install_cli)) .route("/api/settings/ui-state", get(ui_state).post(set_ui_state)) + .route( + "/api/projects/{id}/ui-state", + get(project_ui_state).post(set_project_ui_state), + ) .route("/api/settings/ssh", get(ssh_settings)) .route("/api/settings/ssh/master", get(ssh_master_status)) .route("/api/settings/ssh/preflight", post(ssh_preflight)) @@ -4904,6 +4909,33 @@ async fn ui_state() -> ApiResult { .map_err(ApiError::from) } +async fn project_ui_state(Path(id): Path) -> ApiResult { + tokio::task::spawn_blocking(move || -> ApiResult { + let store = Store::open()?; + store + .get_local_project(&id)? + .ok_or_else(|| not_found("project"))?; + Ok(Json(json!(store.project_workspace_state(&id)?))) + }) + .await + .map_err(|error| ApiError::from(anyhow!("workspace task failed: {error}")))? +} + +async fn set_project_ui_state( + Path(id): Path, + Json(workspace): Json, +) -> ApiResult { + workspace.validate().map_err(bad_request)?; + tokio::task::spawn_blocking(move || -> ApiResult { + if !Store::open()?.set_project_workspace_state(&id, &workspace)? { + return Err(not_found("project")); + } + Ok(Json(json!(workspace))) + }) + .await + .map_err(|error| ApiError::from(anyhow!("workspace task failed: {error}")))? +} + #[derive(Deserialize)] #[serde(rename_all = "camelCase")] struct SetUiStateReq { @@ -4911,6 +4943,7 @@ struct SetUiStateReq { tour_completed: Option, #[serde(default)] preferred_agent: Option, + workspace: Option, } #[derive(Deserialize)] @@ -4924,6 +4957,9 @@ struct StoredAgentSelectionReq { } async fn set_ui_state(Json(req): Json) -> ApiResult { + if let Some(workspace) = &req.workspace { + workspace.validate().map_err(bad_request)?; + } tokio::task::spawn_blocking(move || -> Result> { let store = Store::open()?; let selection = req @@ -4960,6 +4996,9 @@ async fn set_ui_state(Json(req): Json) -> ApiResult { if let Some(selection) = selection { store.set_preferred_agent(&selection)?; } + if let Some(workspace) = req.workspace { + store.set_global_workspace_state(&workspace)?; + } Ok(Json(json!(store.ui_state()?))) }) .await @@ -7327,6 +7366,44 @@ pub(crate) async fn spa(uri: Uri) -> Response { mod tests { use super::*; + #[tokio::test] + async fn workspace_requests_validate_metadata_and_allow_independent_preferences() { + let preferences: SetUiStateReq = + serde_json::from_value(json!({"tourCompleted":true})).unwrap(); + assert!(preferences.workspace.is_none()); + let workspace: SetUiStateReq = serde_json::from_value(json!({"workspace":{ + "lastLocation":"/projects/project/tasks/new", "railOpen":true, + "panelWidth":500, "experimentsView":"tree" + }})) + .unwrap(); + assert!(workspace.preferred_agent.is_none()); + workspace.workspace.unwrap().validate().unwrap(); + assert!(serde_json::from_value::(json!({"workspace":{ + "lastLocation":null, "railOpen":true, "panelWidth":500, + "experimentsView":"grid" + }})) + .is_err()); + let invalid: GlobalWorkspaceState = serde_json::from_value(json!({ + "lastLocation":"/projects/project", "railOpen":true, + "panelWidth":500, "experimentsView":"tree" + })) + .unwrap(); + assert!(invalid.validate().is_err()); + let result = set_ui_state(Json(SetUiStateReq { + tour_completed: Some(true), + preferred_agent: None, + workspace: Some(invalid), + })) + .await; + assert_eq!(result.err().unwrap().0, StatusCode::BAD_REQUEST); + let unsupported: WorkspaceState = serde_json::from_value(json!({ + "version":2, "lastLocation":null, "tasks":{} + })) + .unwrap(); + let result = set_project_ui_state(Path("project".into()), Json(unsupported)).await; + assert_eq!(result.err().unwrap().0, StatusCode::BAD_REQUEST); + } + #[test] fn ssh_workspace_blocks_local_machine_actions_but_keeps_config_editing() { for path in [ diff --git a/src/commands/up_remote.rs b/src/commands/up_remote.rs index 2a1a54c0..4857bf61 100644 --- a/src/commands/up_remote.rs +++ b/src/commands/up_remote.rs @@ -41,7 +41,7 @@ use crate::{browser, UpArgs}; const HEALTH_TIMEOUT: Duration = Duration::from_secs(60); const INSTALL_TIMEOUT: Duration = Duration::from_secs(10 * 60); const PREPARE_TIMEOUT: Duration = Duration::from_secs(5 * 60); -pub(crate) const DASHBOARD_PROTOCOL: u32 = 1; +pub(crate) const DASHBOARD_PROTOCOL: u32 = 2; #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] diff --git a/src/main.rs b/src/main.rs index 20488a10..7a3e9d0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,6 +30,7 @@ mod remote; mod store; mod telemetry; mod updates; +mod workspace_state; use clap::{Args, Parser, Subcommand, ValueEnum}; diff --git a/src/store.rs b/src/store.rs index d9039658..6cafddd8 100644 --- a/src/store.rs +++ b/src/store.rs @@ -15,6 +15,7 @@ use serde::Serialize; use crate::error::{anyhow, Result}; use crate::local::model::{LocalExperiment, LocalProject}; +use crate::workspace_state::{GlobalWorkspaceState, WorkspaceState}; pub fn data_dir() -> PathBuf { // Resolution order (most to least authoritative): @@ -515,6 +516,7 @@ impl Store { "ALTER TABLE chat_sessions ADD COLUMN title_source TEXT", "ALTER TABLE local_projects ADD COLUMN paper_id TEXT", "ALTER TABLE local_projects ADD COLUMN github_sync_enabled INTEGER NOT NULL DEFAULT 1", + "ALTER TABLE local_projects ADD COLUMN workspace_state_json TEXT", "ALTER TABLE local_experiments ADD COLUMN chat_session_id TEXT", "ALTER TABLE ssh_host_tests ADD COLUMN tools_found INTEGER NOT NULL DEFAULT 0", "ALTER TABLE ssh_host_tests ADD COLUMN missing_tools TEXT NOT NULL DEFAULT ''", @@ -528,6 +530,7 @@ impl Store { "ALTER TABLE chat_sessions ADD COLUMN active_leaf_id TEXT", "ALTER TABLE chat_sessions ADD COLUMN parent_session_id TEXT", "ALTER TABLE ui_state ADD COLUMN preferred_service_tier TEXT", + "ALTER TABLE ui_state ADD COLUMN workspace_state_json TEXT", "ALTER TABLE chat_spawns ADD COLUMN wake_parent INTEGER NOT NULL DEFAULT 1", "ALTER TABLE chat_spawns ADD COLUMN attempts INTEGER NOT NULL DEFAULT 0", "ALTER TABLE chat_spawns ADD COLUMN finished_at INTEGER", @@ -748,7 +751,7 @@ impl Store { Ok(self.conn.query_row( "SELECT onboarding_completed, tour_completed, preferred_harness, preferred_model, preferred_service_tier, - preferred_permission_mode, preferred_reasoning_level + preferred_permission_mode, preferred_reasoning_level, workspace_state_json FROM ui_state WHERE id = 1", [], |row| { @@ -757,6 +760,7 @@ impl Store { let service_tier = row.get::<_, Option>(4)?; let permission_mode = row.get::<_, Option>(5)?; let reasoning_level = row.get::<_, Option>(6)?; + let workspace_json = row.get::<_, Option>(7)?; Ok(StoredUiState { onboarding_completed: row.get(0)?, tour_completed: row.get(1)?, @@ -767,6 +771,9 @@ impl Store { permission_mode, reasoning_level, }), + workspace: workspace_json + .as_deref() + .and_then(GlobalWorkspaceState::from_stored), }) }, )?) @@ -780,6 +787,36 @@ impl Store { Ok(()) } + pub fn set_global_workspace_state(&self, workspace: &GlobalWorkspaceState) -> Result<()> { + workspace.validate()?; + self.conn.execute( + "UPDATE ui_state SET workspace_state_json = ?1 WHERE id = 1", + params![serde_json::to_string(workspace)?], + )?; + Ok(()) + } + + pub fn project_workspace_state(&self, id: &str) -> Result> { + let json: Option = self.conn.query_row( + "SELECT workspace_state_json FROM local_projects WHERE id = ?1", + params![id], + |row| row.get(0), + )?; + Ok(json.as_deref().and_then(WorkspaceState::from_stored)) + } + + pub fn set_project_workspace_state( + &self, + id: &str, + workspace: &WorkspaceState, + ) -> Result { + workspace.validate()?; + Ok(self.conn.execute( + "UPDATE local_projects SET workspace_state_json = ?2 WHERE id = ?1", + params![id, serde_json::to_string(workspace)?], + )? > 0) + } + pub fn set_tour_completed(&self, completed: bool) -> Result<()> { self.conn.execute( "UPDATE ui_state SET tour_completed = ?1 WHERE id = 1", @@ -2701,12 +2738,13 @@ pub struct StoredAgentSelection { pub reasoning_level: Option, } -#[derive(Debug, Clone, Serialize, PartialEq, Eq)] +#[derive(Debug, Clone, Serialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct StoredUiState { pub onboarding_completed: bool, pub tour_completed: bool, pub preferred_agent: Option, + pub workspace: Option, } /// Normalized transcript entry; `parts_json` is the wire-format parts array @@ -2950,6 +2988,115 @@ mod tests { std::fs::remove_dir_all(dir).unwrap(); } + #[test] + fn workspace_state_roundtrips_without_touching_project_activity_or_preferences() { + let dir = std::env::temp_dir().join(format!("orx-workspace-{}", uuid::Uuid::new_v4())); + let store = Store::open_at(dir.clone()).unwrap(); + for id in ["first", "second"] { + store + .create_local_project(&LocalProject { + id: id.into(), + name: id.into(), + slug: id.into(), + github_owner: String::new(), + github_repo: String::new(), + github_sync_enabled: false, + baseline_branch: "main".into(), + repo_path: dir.join(id).to_string_lossy().into_owned(), + run_command: None, + paper_id: None, + created_at: 1, + updated_at: 2, + }) + .unwrap(); + } + let value = serde_json::json!({ + "version": 1, + "lastLocation": "/projects/first/tasks/new", + "lastTaskId": null, + "tasks": {"new": { + "tabs": [ + {"kind":"home", "view":"files"}, + {"kind":"experiment", "experimentId":"experiment", "view":"terminal", "runId":"run"}, + {"kind":"file", "path":"paper.tex", "source":"repo", "sessionId":"session", "ref":"main", "line":12}, + {"kind":"code", "experimentId":"experiment", "branch":"main", "view":"changes"}, + {"kind":"plan", "sessionId":"session", "promptId":"prompt"}, + {"kind":"subagent", "sessionId":"session", "spawnPartId":"part"} + ], + "active":{"kind":"home", "view":"files"}, "previewKey":"file:paper.tex", + "history":["home", "file:paper.tex"], "expanded":{"files":["src"]}, + "scroll":{"file:paper.tex":{"top":23.5,"left":2.0}}, "sourceModes":{"file:paper.tex":true}, + "filesView":"changes", "scope":"agent", "panelMax":true + }} + }); + let workspace: WorkspaceState = serde_json::from_value(value.clone()).unwrap(); + assert!(store.project_workspace_state("first").unwrap().is_none()); + assert!(store + .set_project_workspace_state("first", &workspace) + .unwrap()); + assert!(!store + .set_project_workspace_state("missing", &workspace) + .unwrap()); + assert!(store.project_workspace_state("second").unwrap().is_none()); + assert_eq!( + store + .get_local_project("first") + .unwrap() + .unwrap() + .updated_at, + 2 + ); + let preferences = store.ui_state().unwrap(); + let global: GlobalWorkspaceState = serde_json::from_value(serde_json::json!({ + "lastLocation":"/projects/first/settings/storage", "railOpen":false, + "panelWidth":620, "experimentsView":"table" + })) + .unwrap(); + store.set_global_workspace_state(&global).unwrap(); + assert_eq!( + store.ui_state().unwrap().preferred_agent, + preferences.preferred_agent + ); + assert_eq!( + store.ui_state().unwrap().onboarding_completed, + preferences.onboarding_completed + ); + store.set_tour_completed(true).unwrap(); + store.set_onboarding_completed(true).unwrap(); + store + .set_preferred_agent(&StoredAgentSelection { + harness: "codex".into(), + model: None, + service_tier: None, + permission_mode: None, + reasoning_level: None, + }) + .unwrap(); + assert_eq!(store.ui_state().unwrap().workspace, Some(global.clone())); + drop(store); + let store = Store::open_at(dir.clone()).unwrap(); + assert_eq!( + serde_json::to_value(store.project_workspace_state("first").unwrap()).unwrap(), + value + ); + assert_eq!(store.ui_state().unwrap().workspace, Some(global)); + for corrupt in [ + "not json", + "{\"version\":2,\"lastLocation\":null,\"tasks\":{}}", + ] { + store + .conn + .execute( + "UPDATE local_projects SET workspace_state_json = ?1 WHERE id = 'first'", + params![corrupt], + ) + .unwrap(); + assert!(store.project_workspace_state("first").unwrap().is_none()); + } + drop(store); + std::fs::remove_dir_all(dir).unwrap(); + } + #[test] fn ui_state_roundtrips_functional_preferences() { let dir = std::env::temp_dir().join(format!("orx-store-ui-state-{}", uuid::Uuid::new_v4())); @@ -2960,6 +3107,7 @@ mod tests { onboarding_completed: false, tour_completed: false, preferred_agent: None, + workspace: None, } ); @@ -2980,6 +3128,7 @@ mod tests { onboarding_completed: true, tour_completed: true, preferred_agent: Some(selection), + workspace: None, } ); let _ = std::fs::remove_dir_all(&dir); diff --git a/src/workspace_state.rs b/src/workspace_state.rs new file mode 100644 index 00000000..9243492d --- /dev/null +++ b/src/workspace_state.rs @@ -0,0 +1,337 @@ +use std::collections::BTreeMap; + +use serde::{Deserialize, Serialize}; + +use crate::error::{anyhow, Result}; + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct WorkspaceState { + pub version: u32, + pub last_task_id: Option, + pub last_location: Option, + pub tasks: BTreeMap, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct GlobalWorkspaceState { + pub last_location: Option, + pub rail_open: bool, + pub panel_width: f64, + pub experiments_view: ExperimentsView, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase", deny_unknown_fields)] +pub struct TaskWorkspace { + tabs: Vec, + active: Option, + preview_key: Option, + history: Vec, + expanded: BTreeMap>, + scroll: BTreeMap, + source_modes: BTreeMap, + files_view: FilesView, + scope: Scope, + panel_max: bool, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(deny_unknown_fields)] +struct ScrollPosition { + top: f64, + left: f64, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde( + tag = "kind", + rename_all = "camelCase", + rename_all_fields = "camelCase", + deny_unknown_fields +)] +pub enum Pane { + Home { + view: HomeView, + }, + Experiment { + experiment_id: String, + view: ExperimentView, + #[serde(skip_serializing_if = "Option::is_none")] + run_id: Option, + }, + File { + path: String, + #[serde(skip_serializing_if = "Option::is_none")] + source: Option, + #[serde(skip_serializing_if = "Option::is_none")] + session_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + r#ref: Option, + #[serde(skip_serializing_if = "Option::is_none")] + line: Option, + #[serde(skip_serializing_if = "Option::is_none")] + branch_label: Option, + }, + Code { + experiment_id: String, + branch: String, + view: FilesView, + }, + Plan { + session_id: String, + prompt_id: String, + }, + Subagent { + session_id: String, + spawn_part_id: String, + }, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub enum HomeView { + Experiments, + Files, + Artifacts, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub enum ExperimentView { + Overview, + Terminal, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub enum FileSource { + Repo, + Artifacts, + Abs, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub enum FilesView { + Files, + Changes, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub enum Scope { + Agent, + Project, +} + +#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub enum ExperimentsView { + Tree, + Table, +} + +impl Pane { + fn valid(&self) -> bool { + let nonempty = |value: &String| !value.is_empty(); + match self { + Self::Home { .. } => true, + Self::Experiment { + experiment_id, + run_id, + .. + } => nonempty(experiment_id) && run_id.as_ref().is_none_or(nonempty), + Self::File { + path, + session_id, + r#ref, + line, + branch_label, + .. + } => { + nonempty(path) + && session_id.as_ref().is_none_or(nonempty) + && r#ref.as_ref().is_none_or(nonempty) + && branch_label.as_ref().is_none_or(|label| !label.is_empty()) + && line.is_none_or(|line| line > 0 && line <= 9_007_199_254_740_991) + } + Self::Code { + experiment_id, + branch, + .. + } => nonempty(experiment_id) && nonempty(branch), + Self::Plan { + session_id, + prompt_id, + } => nonempty(session_id) && nonempty(prompt_id), + Self::Subagent { + session_id, + spawn_part_id, + } => nonempty(session_id) && nonempty(spawn_part_id), + } + } +} + +impl WorkspaceState { + pub fn validate(&self) -> Result<()> { + if self.version != 1 + || self.last_task_id.as_ref().is_some_and(|id| id.is_empty()) + || !self.last_location.as_deref().is_none_or(valid_location) + || self.tasks.iter().any(|(id, task)| { + id.is_empty() + || !task.tabs.iter().all(Pane::valid) + || !task.active.as_ref().is_none_or(Pane::valid) + || task.scroll.values().any(|position| { + !position.top.is_finite() + || !position.left.is_finite() + || position.top < 0.0 + || position.left < 0.0 + }) + }) + { + return Err(anyhow!("invalid workspace state")); + } + Ok(()) + } + + pub fn from_stored(json: &str) -> Option { + let state: Self = serde_json::from_str(json).ok()?; + state.validate().ok()?; + Some(state) + } +} + +impl GlobalWorkspaceState { + pub fn validate(&self) -> Result<()> { + if !self.last_location.as_deref().is_none_or(valid_location) + || !self.panel_width.is_finite() + || self.panel_width <= 0.0 + { + return Err(anyhow!("invalid global workspace state")); + } + Ok(()) + } + + pub fn from_stored(json: &str) -> Option { + let state: Self = serde_json::from_str(json).ok()?; + state.validate().ok()?; + Some(state) + } +} + +fn valid_location(location: &str) -> bool { + if !location.starts_with('/') + || location.starts_with("//") + || location.contains(['\\', '#']) + || location.chars().any(char::is_control) + { + return false; + } + let (path, query) = location.split_once('?').unwrap_or((location, "")); + let parts: Vec<_> = path.split('/').collect(); + let valid_id = |id: &str| { + urlencoding::decode(id).is_ok_and(|id| { + !id.is_empty() + && id != "." + && id != ".." + && !id.contains(['/', '\\', '?', '#']) + && !id.chars().any(char::is_control) + }) + }; + let valid_path = match parts.as_slice() { + ["", "projects"] => true, + ["", "projects", project, "skills"] => valid_id(project), + ["", "projects", project, "tasks", task] => valid_id(project) && valid_id(task), + ["", "projects", project, "settings", tab] => { + valid_id(project) + && urlencoding::decode(tab).is_ok_and(|tab| { + matches!( + tab.as_ref(), + "settings" + | "harnesses" + | "projects" + | "compute" + | "instances" + | "environment" + | "git" + | "storage" + ) + }) + } + _ => false, + }; + if !valid_path || query.is_empty() { + return valid_path; + } + let Ok(url) = reqwest::Url::parse(&format!("http://localhost/?{query}")) else { + return false; + }; + let mut pairs = url.query_pairs(); + let Some((key, json)) = pairs.next() else { + return true; + }; + key == "pane" + && pairs.next().is_none() + && serde_json::from_str::(&json) + .ok() + .is_some_and(|pane| pane.valid()) +} + +#[cfg(test)] +mod tests { + use super::*; + use serde_json::json; + + #[test] + fn workspace_schema_and_resume_locations_are_validated() { + let state = json!({"version":1,"lastLocation":"/projects/demo/tasks/new","tasks":{}}); + assert!(WorkspaceState::from_stored(&state.to_string()).is_some()); + for invalid in [ + json!({"version":2,"lastLocation":null,"tasks":{}}), + json!({"version":1,"lastLocation":"https://example.com","tasks":{}}), + json!({"version":1,"lastLocation":null,"tasks":{"new":{"tabs":[]}}}), + json!({"version":1,"lastLocation":null,"tasks":{},"content":"not metadata"}), + ] { + assert!(WorkspaceState::from_stored(&invalid.to_string()).is_none()); + } + for path in [ + "/", + "/projects/demo", + "//evil.test/projects", + "/projects/../tasks/new", + "/projects/demo/settings/unknown", + "/projects/demo/tasks/new?pane=garbage", + "/projects/demo/tasks/new#fragment", + ] { + assert!(!valid_location(path), "{path}"); + } + let pane = json!({"kind":"file","path":"研究/figure +100%?draft#1.tex","source":"repo","line":9_007_199_254_740_991_u64}); + let location = format!( + "/projects/demo/tasks/new?pane={}", + urlencoding::encode(&pane.to_string()) + ); + assert!(valid_location(&location)); + assert!(valid_location("/projects/demo/settings/%67it")); + assert!(valid_location(&format!( + "/projects/demo/tasks/new?%70ane={}&", + urlencoding::encode(&pane.to_string()) + ))); + assert!(valid_location("/projects/demo/tasks/new?pane=%7B%22kind%22%3A%22file%22%2C%22path%22%3A%22paper.tex%22%2C%22line%22%3Anull%7D")); + let invalid_line = + json!({"kind":"file","path":"paper.tex","line":9_007_199_254_740_992_u64}); + assert!(!serde_json::from_value::(invalid_line) + .unwrap() + .valid()); + assert!(!Pane::File { + path: "paper.tex".into(), + source: None, + session_id: None, + r#ref: None, + line: Some(0), + branch_label: None, + } + .valid()); + } +} diff --git a/ui/dist/assets/index-CcFnKEl5.js b/ui/dist/assets/index-CcFnKEl5.js deleted file mode 100644 index ed0ee638..00000000 --- a/ui/dist/assets/index-CcFnKEl5.js +++ /dev/null @@ -1,1056 +0,0 @@ -var YO=Object.defineProperty;var j6=e=>{throw TypeError(e)};var XO=(e,n,t)=>n in e?YO(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var nb=(e,n,t)=>XO(e,typeof n!="symbol"?n+"":n,t),A6=(e,n,t)=>n.has(e)||j6("Cannot "+t);var rr=(e,n,t)=>(A6(e,n,"read from private field"),t?t.call(e):n.get(e)),fi=(e,n,t)=>n.has(e)?j6("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),os=(e,n,t,r)=>(A6(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t);var T6=(e,n,t,r)=>({set _(s){os(e,n,s,t)},get _(){return rr(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function Ih(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rb={exports:{}},kf={};/** - * @license React - * react-jsx-runtime.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var M6;function ZO(){if(M6)return kf;M6=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:i}}return kf.Fragment=n,kf.jsx=t,kf.jsxs=t,kf}var R6;function QO(){return R6||(R6=1,rb.exports=ZO()),rb.exports}var f=QO(),sb={exports:{}},Ft={};/** - * @license React - * react.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var D6;function JO(){if(D6)return Ft;D6=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),m=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=m&&B[m]||B["@@iterator"],typeof B=="function"?B:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,v={};function b(B,X,V){this.props=B,this.context=X,this.refs=v,this.updater=V||S}b.prototype.isReactComponent={},b.prototype.setState=function(B,X){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,X,"setState")},b.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function x(){}x.prototype=b.prototype;function y(B,X,V){this.props=B,this.context=X,this.refs=v,this.updater=V||S}var C=y.prototype=new x;C.constructor=y,k(C,b.prototype),C.isPureReactComponent=!0;var j=Array.isArray;function N(){}var M={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function D(B,X,V){var ae=V.ref;return{$$typeof:e,type:B,key:X,ref:ae!==void 0?ae:null,props:V}}function I(B,X){return D(B.type,X,B.props)}function $(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function P(B){var X={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(V){return X[V]})}var F=/\/+/g;function W(B,X){return typeof B=="object"&&B!==null&&B.key!=null?P(""+B.key):X.toString(36)}function Z(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(N,N):(B.status="pending",B.then(function(X){B.status==="pending"&&(B.status="fulfilled",B.value=X)},function(X){B.status==="pending"&&(B.status="rejected",B.reason=X)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function U(B,X,V,ae,ce){var oe=typeof B;(oe==="undefined"||oe==="boolean")&&(B=null);var se=!1;if(B===null)se=!0;else switch(oe){case"bigint":case"string":case"number":se=!0;break;case"object":switch(B.$$typeof){case e:case n:se=!0;break;case _:return se=B._init,U(se(B._payload),X,V,ae,ce)}}if(se)return ce=ce(B),se=ae===""?"."+W(B,0):ae,j(ce)?(V="",se!=null&&(V=se.replace(F,"$&/")+"/"),U(ce,X,V,"",function(le){return le})):ce!=null&&($(ce)&&(ce=I(ce,V+(ce.key==null||B&&B.key===ce.key?"":(""+ce.key).replace(F,"$&/")+"/")+se)),X.push(ce)),1;se=0;var G=ae===""?".":ae+":";if(j(B))for(var ne=0;ne>>1,L=U[H];if(0>>1;Hs(V,J))aes(ce,V)?(U[H]=ce,U[ae]=J,H=ae):(U[H]=V,U[X]=J,H=X);else if(aes(ce,J))U[H]=ce,U[ae]=J,H=ae;else break e}}return Y}function s(U,Y){var J=U.sortIndex-Y.sortIndex;return J!==0?J:U.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var c=[],d=[],_=1,h=null,m=3,g=!1,S=!1,k=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function C(U){for(var Y=t(d);Y!==null;){if(Y.callback===null)r(d);else if(Y.startTime<=U)r(d),Y.sortIndex=Y.expirationTime,n(c,Y);else break;Y=t(d)}}function j(U){if(k=!1,C(U),!S)if(t(c)!==null)S=!0,N||(N=!0,P());else{var Y=t(d);Y!==null&&Z(j,Y.startTime-U)}}var N=!1,M=-1,z=5,D=-1;function I(){return v?!0:!(e.unstable_now()-DU&&I());){var H=h.callback;if(typeof H=="function"){h.callback=null,m=h.priorityLevel;var L=H(h.expirationTime<=U);if(U=e.unstable_now(),typeof L=="function"){h.callback=L,C(U),Y=!0;break t}h===t(c)&&r(c),C(U)}else r(c);h=t(c)}if(h!==null)Y=!0;else{var B=t(d);B!==null&&Z(j,B.startTime-U),Y=!1}}break e}finally{h=null,m=J,g=!1}Y=void 0}}finally{Y?P():N=!1}}}var P;if(typeof y=="function")P=function(){y($)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,W=F.port2;F.port1.onmessage=$,P=function(){W.postMessage(null)}}else P=function(){b($,0)};function Z(U,Y){M=b(function(){U(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125H?(U.sortIndex=J,n(d,U),t(c)===null&&U===t(d)&&(k?(x(M),M=-1):k=!0,Z(j,J-H))):(U.sortIndex=L,n(c,U),S||g||(S=!0,N||(N=!0,P()))),U},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(U){var Y=m;return function(){var J=m;m=Y;try{return U.apply(this,arguments)}finally{m=J}}}})(ob)),ob}var I6;function tI(){return I6||(I6=1,ab.exports=eI()),ab.exports}var lb={exports:{}},vs={};/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var B6;function nI(){if(B6)return vs;B6=1;var e=Bh();function n(c){var d="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),lb.exports=nI(),lb.exports}/** - * @license React - * react-dom-client.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var H6;function rI(){if(H6)return Cf;H6=1;var e=tI(),n=Bh(),t=IE();function r(a){var u="https://react.dev/errors/"+a;if(1L||(a.current=H[L],H[L]=null,L--)}function V(a,u){L++,H[L]=a.current,a.current=u}var ae=B(null),ce=B(null),oe=B(null),se=B(null);function G(a,u){switch(V(oe,u),V(ce,a),V(ae,null),u.nodeType){case 9:case 11:a=(a=u.documentElement)&&(a=a.namespaceURI)?Q3(a):0;break;default:if(a=u.tagName,u=u.namespaceURI)u=Q3(u),a=J3(u,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}X(ae),V(ae,a)}function ne(){X(ae),X(ce),X(oe)}function le(a){a.memoizedState!==null&&V(se,a);var u=ae.current,p=J3(u,a.type);u!==p&&(V(ce,a),V(ae,p))}function _e(a){ce.current===a&&(X(ae),X(ce)),se.current===a&&(X(se),xf._currentValue=J)}var ue,ze;function Ne(a){if(ue===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ue=u&&u[1]||"",ze=-1)":-1A||he[w]!==ye[A]){var Te=` -`+he[w].replace(" at new "," at ");return a.displayName&&Te.includes("")&&(Te=Te.replace("",a.displayName)),Te}while(1<=w&&0<=A);break}}}finally{Ie=!1,Error.prepareStackTrace=p}return(p=a?a.displayName||a.name:"")?Ne(p):""}function Fe(a,u){switch(a.tag){case 26:case 27:case 5:return Ne(a.type);case 16:return Ne("Lazy");case 13:return a.child!==u&&u!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return qe(a.type,!1);case 11:return qe(a.type.render,!1);case 1:return qe(a.type,!0);case 31:return Ne("Activity");default:return""}}function Ot(a){try{var u="",p=null;do u+=Fe(a,p),p=a,a=a.return;while(a);return u}catch(w){return` -Error generating stack: `+w.message+` -`+w.stack}}var xt=Object.prototype.hasOwnProperty,Nt=e.unstable_scheduleCallback,Jt=e.unstable_cancelCallback,ht=e.unstable_shouldYield,it=e.unstable_requestPaint,et=e.unstable_now,Pt=e.unstable_getCurrentPriorityLevel,we=e.unstable_ImmediatePriority,Oe=e.unstable_UserBlockingPriority,Je=e.unstable_NormalPriority,nt=e.unstable_LowPriority,De=e.unstable_IdlePriority,At=e.log,pt=e.unstable_setDisableYieldValue,It=null,nn=null;function gn(a){if(typeof At=="function"&&pt(a),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(It,a)}catch{}}var Ct=Math.clz32?Math.clz32:lr,xn=Math.log,rn=Math.LN2;function lr(a){return a>>>=0,a===0?32:31-(xn(a)/rn|0)|0}var _r=256,Ln=262144,Yn=4194304;function sn(a){var u=a&42;if(u!==0)return u;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function $n(a,u,p){var w=a.pendingLanes;if(w===0)return 0;var A=0,R=a.suspendedLanes,K=a.pingedLanes;a=a.warmLanes;var ee=w&134217727;return ee!==0?(w=ee&~R,w!==0?A=sn(w):(K&=ee,K!==0?A=sn(K):p||(p=ee&~a,p!==0&&(A=sn(p))))):(ee=w&~R,ee!==0?A=sn(ee):K!==0?A=sn(K):p||(p=w&~a,p!==0&&(A=sn(p)))),A===0?0:u!==0&&u!==A&&(u&R)===0&&(R=A&-A,p=u&-u,R>=p||R===32&&(p&4194048)!==0)?u:A}function Cn(a,u){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&u)===0}function mt(a,u){switch(a){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function an(){var a=Yn;return Yn<<=1,(Yn&62914560)===0&&(Yn=4194304),a}function Xe(a){for(var u=[],p=0;31>p;p++)u.push(a);return u}function ot(a,u){a.pendingLanes|=u,u!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function en(a,u,p,w,A,R){var K=a.pendingLanes;a.pendingLanes=p,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=p,a.entangledLanes&=p,a.errorRecoveryDisabledLanes&=p,a.shellSuspendCounter=0;var ee=a.entanglements,he=a.expirationTimes,ye=a.hiddenUpdates;for(p=K&~p;0"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Po=/[\n"\\]/g;function qn(a){return a.replace(Po,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Ei(a,u,p,w,A,R,K,ee){a.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?a.type=K:a.removeAttribute("type"),u!=null?K==="number"?(u===0&&a.value===""||a.value!=u)&&(a.value=""+wr(u)):a.value!==""+wr(u)&&(a.value=""+wr(u)):K!=="submit"&&K!=="reset"||a.removeAttribute("value"),u!=null?ti(a,K,wr(u)):p!=null?ti(a,K,wr(p)):w!=null&&a.removeAttribute("value"),A==null&&R!=null&&(a.defaultChecked=!!R),A!=null&&(a.checked=A&&typeof A!="function"&&typeof A!="symbol"),ee!=null&&typeof ee!="function"&&typeof ee!="symbol"&&typeof ee!="boolean"?a.name=""+wr(ee):a.removeAttribute("name")}function _a(a,u,p,w,A,R,K,ee){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(a.type=R),u!=null||p!=null){if(!(R!=="submit"&&R!=="reset"||u!=null)){ei(a);return}p=p!=null?""+wr(p):"",u=u!=null?""+wr(u):p,ee||u===a.value||(a.value=u),a.defaultValue=u}w=w??A,w=typeof w!="function"&&typeof w!="symbol"&&!!w,a.checked=ee?a.checked:!!w,a.defaultChecked=!!w,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(a.name=K),ei(a)}function ti(a,u,p){u==="number"&&$s(a.ownerDocument)===a||a.defaultValue===""+p||(a.defaultValue=""+p)}function ni(a,u,p,w){if(a=a.options,u){u={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ar=!1;if(hs)try{var ts={};Object.defineProperty(ts,"passive",{get:function(){Ar=!0}}),window.addEventListener("test",ts,ts),window.removeEventListener("test",ts,ts)}catch{Ar=!1}var Gr=null,ba=null,Ns=null;function Qa(){if(Ns)return Ns;var a,u=ba,p=u.length,w,A="value"in Gr?Gr.value:Gr.textContent,R=A.length;for(a=0;a=Wo),Hd=" ",te=!1;function me(a,u){switch(a){case"keyup":return l_.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ce(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var je=!1;function Ve(a,u){switch(a){case"compositionend":return Ce(u);case"keypress":return u.which!==32?null:(te=!0,Hd);case"textInput":return a=u.data,a===Hd&&te?null:a;default:return null}}function kt(a,u){if(je)return a==="compositionend"||!eu&&me(a,u)?(a=Qa(),Ns=ba=Gr=null,je=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1=u)return{node:p,offset:u-a};a=w}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=Dn(p)}}function wa(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?wa(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function Mr(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var u=$s(a.document);u instanceof a.HTMLIFrameElement;){try{var p=typeof u.contentWindow.location.href=="string"}catch{p=!1}if(p)a=u.contentWindow;else break;u=$s(a.document)}return u}function Xo(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}var js=hs&&"documentMode"in document&&11>=document.documentMode,tu=null,fg=null,qd=null,hg=!1;function xw(a,u,p){var w=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;hg||tu==null||tu!==$s(w)||(w=tu,"selectionStart"in w&&Xo(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),qd&&Yo(qd,w)||(qd=w,w=e0(fg,"onSelect"),0>=K,A-=K,Sa=1<<32-Ct(u)+A|p<Yt?(fn=ft,ft=null):fn=ft.sibling;var kn=ke(be,ft,xe[Yt],Re);if(kn===null){ft===null&&(ft=fn);break}a&&ft&&kn.alternate===null&&u(be,ft),pe=R(kn,pe,Yt),Sn===null?yt=kn:Sn.sibling=kn,Sn=kn,ft=fn}if(Yt===xe.length)return p(be,ft),hn&&to(be,Yt),yt;if(ft===null){for(;YtYt?(fn=ft,ft=null):fn=ft.sibling;var bl=ke(be,ft,kn.value,Re);if(bl===null){ft===null&&(ft=fn);break}a&&ft&&bl.alternate===null&&u(be,ft),pe=R(bl,pe,Yt),Sn===null?yt=bl:Sn.sibling=bl,Sn=bl,ft=fn}if(kn.done)return p(be,ft),hn&&to(be,Yt),yt;if(ft===null){for(;!kn.done;Yt++,kn=xe.next())kn=Le(be,kn.value,Re),kn!==null&&(pe=R(kn,pe,Yt),Sn===null?yt=kn:Sn.sibling=kn,Sn=kn);return hn&&to(be,Yt),yt}for(ft=w(ft);!kn.done;Yt++,kn=xe.next())kn=Ae(ft,be,Yt,kn.value,Re),kn!==null&&(a&&kn.alternate!==null&&ft.delete(kn.key===null?Yt:kn.key),pe=R(kn,pe,Yt),Sn===null?yt=kn:Sn.sibling=kn,Sn=kn);return a&&ft.forEach(function(KO){return u(be,KO)}),hn&&to(be,Yt),yt}function Un(be,pe,xe,Re){if(typeof xe=="object"&&xe!==null&&xe.type===k&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case g:e:{for(var yt=xe.key;pe!==null;){if(pe.key===yt){if(yt=xe.type,yt===k){if(pe.tag===7){p(be,pe.sibling),Re=A(pe,xe.props.children),Re.return=be,be=Re;break e}}else if(pe.elementType===yt||typeof yt=="object"&&yt!==null&&yt.$$typeof===z&&uc(yt)===pe.type){p(be,pe.sibling),Re=A(pe,xe.props),Xd(Re,xe),Re.return=be,be=Re;break e}p(be,pe);break}else u(be,pe);pe=pe.sibling}xe.type===k?(Re=ic(xe.props.children,be.mode,Re,xe.key),Re.return=be,be=Re):(Re=g_(xe.type,xe.key,xe.props,null,be.mode,Re),Xd(Re,xe),Re.return=be,be=Re)}return K(be);case S:e:{for(yt=xe.key;pe!==null;){if(pe.key===yt)if(pe.tag===4&&pe.stateNode.containerInfo===xe.containerInfo&&pe.stateNode.implementation===xe.implementation){p(be,pe.sibling),Re=A(pe,xe.children||[]),Re.return=be,be=Re;break e}else{p(be,pe);break}else u(be,pe);pe=pe.sibling}Re=xg(xe,be.mode,Re),Re.return=be,be=Re}return K(be);case z:return xe=uc(xe),Un(be,pe,xe,Re)}if(Z(xe))return dt(be,pe,xe,Re);if(P(xe)){if(yt=P(xe),typeof yt!="function")throw Error(r(150));return xe=yt.call(xe),zt(be,pe,xe,Re)}if(typeof xe.then=="function")return Un(be,pe,k_(xe),Re);if(xe.$$typeof===y)return Un(be,pe,x_(be,xe),Re);C_(be,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,pe!==null&&pe.tag===6?(p(be,pe.sibling),Re=A(pe,xe),Re.return=be,be=Re):(p(be,pe),Re=vg(xe,be.mode,Re),Re.return=be,be=Re),K(be)):p(be,pe)}return function(be,pe,xe,Re){try{Yd=0;var yt=Un(be,pe,xe,Re);return fu=null,yt}catch(ft){if(ft===du||ft===w_)throw ft;var Sn=ai(29,ft,null,be.mode);return Sn.lanes=Re,Sn.return=be,Sn}finally{}}}var fc=Uw(!0),qw=Uw(!1),tl=!1;function Mg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rg(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function nl(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function rl(a,u,p){var w=a.updateQueue;if(w===null)return null;if(w=w.shared,(En&2)!==0){var A=w.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),w.pending=u,u=m_(a),Nw(a,null,p),u}return p_(a,w,u,p),m_(a)}function Zd(a,u,p){if(u=u.updateQueue,u!==null&&(u=u.shared,(p&4194048)!==0)){var w=u.lanes;w&=a.pendingLanes,p|=w,u.lanes=p,Qe(a,p)}}function Dg(a,u){var p=a.updateQueue,w=a.alternate;if(w!==null&&(w=w.updateQueue,p===w)){var A=null,R=null;if(p=p.firstBaseUpdate,p!==null){do{var K={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};R===null?A=R=K:R=R.next=K,p=p.next}while(p!==null);R===null?A=R=u:R=R.next=u}else A=R=u;p={baseState:w.baseState,firstBaseUpdate:A,lastBaseUpdate:R,shared:w.shared,callbacks:w.callbacks},a.updateQueue=p;return}a=p.lastBaseUpdate,a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=u}var Lg=!1;function Qd(){if(Lg){var a=uu;if(a!==null)throw a}}function Jd(a,u,p,w){Lg=!1;var A=a.updateQueue;tl=!1;var R=A.firstBaseUpdate,K=A.lastBaseUpdate,ee=A.shared.pending;if(ee!==null){A.shared.pending=null;var he=ee,ye=he.next;he.next=null,K===null?R=ye:K.next=ye,K=he;var Te=a.alternate;Te!==null&&(Te=Te.updateQueue,ee=Te.lastBaseUpdate,ee!==K&&(ee===null?Te.firstBaseUpdate=ye:ee.next=ye,Te.lastBaseUpdate=he))}if(R!==null){var Le=A.baseState;K=0,Te=ye=he=null,ee=R;do{var ke=ee.lane&-536870913,Ae=ke!==ee.lane;if(Ae?(dn&ke)===ke:(w&ke)===ke){ke!==0&&ke===cu&&(Lg=!0),Te!==null&&(Te=Te.next={lane:0,tag:ee.tag,payload:ee.payload,callback:null,next:null});e:{var dt=a,zt=ee;ke=u;var Un=p;switch(zt.tag){case 1:if(dt=zt.payload,typeof dt=="function"){Le=dt.call(Un,Le,ke);break e}Le=dt;break e;case 3:dt.flags=dt.flags&-65537|128;case 0:if(dt=zt.payload,ke=typeof dt=="function"?dt.call(Un,Le,ke):dt,ke==null)break e;Le=h({},Le,ke);break e;case 2:tl=!0}}ke=ee.callback,ke!==null&&(a.flags|=64,Ae&&(a.flags|=8192),Ae=A.callbacks,Ae===null?A.callbacks=[ke]:Ae.push(ke))}else Ae={lane:ke,tag:ee.tag,payload:ee.payload,callback:ee.callback,next:null},Te===null?(ye=Te=Ae,he=Le):Te=Te.next=Ae,K|=ke;if(ee=ee.next,ee===null){if(ee=A.shared.pending,ee===null)break;Ae=ee,ee=Ae.next,Ae.next=null,A.lastBaseUpdate=Ae,A.shared.pending=null}}while(!0);Te===null&&(he=Le),A.baseState=he,A.firstBaseUpdate=ye,A.lastBaseUpdate=Te,R===null&&(A.shared.lanes=0),ll|=K,a.lanes=K,a.memoizedState=Le}}function Gw(a,u){if(typeof a!="function")throw Error(r(191,a));a.call(u)}function Vw(a,u){var p=a.callbacks;if(p!==null)for(a.callbacks=null,a=0;aR?R:8;var K=U.T,ee={};U.T=ee,e1(a,!1,u,p);try{var he=A(),ye=U.S;if(ye!==null&&ye(ee,he),he!==null&&typeof he=="object"&&typeof he.then=="function"){var Te=IL(he,w);nf(a,u,Te,di(a))}else nf(a,u,w,di(a))}catch(Le){nf(a,u,{then:function(){},status:"rejected",reason:Le},di())}finally{Y.p=R,K!==null&&ee.types!==null&&(K.types=ee.types),U.T=K}}function UL(){}function Qg(a,u,p,w){if(a.tag!==5)throw Error(r(476));var A=k5(a).queue;S5(a,A,u,J,p===null?UL:function(){return C5(a),p(w)})}function k5(a){var u=a.memoizedState;if(u!==null)return u;u={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:J},next:null};var p={};return u.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:p},next:null},a.memoizedState=u,a=a.alternate,a!==null&&(a.memoizedState=u),u}function C5(a){var u=k5(a);u.next===null&&(u=a.alternate.memoizedState),nf(a,u.next.queue,{},di())}function Jg(){return ss(xf)}function E5(){return Er().memoizedState}function N5(){return Er().memoizedState}function qL(a){for(var u=a.return;u!==null;){switch(u.tag){case 24:case 3:var p=di();a=nl(p);var w=rl(u,a,p);w!==null&&(Ws(w,u,p),Zd(w,u,p)),u={cache:zg()},a.payload=u;return}u=u.return}}function GL(a,u,p){var w=di();p={lane:w,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},L_(a)?j5(u,p):(p=gg(a,u,p,w),p!==null&&(Ws(p,a,w),A5(p,u,w)))}function z5(a,u,p){var w=di();nf(a,u,p,w)}function nf(a,u,p,w){var A={lane:w,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(L_(a))j5(u,A);else{var R=a.alternate;if(a.lanes===0&&(R===null||R.lanes===0)&&(R=u.lastRenderedReducer,R!==null))try{var K=u.lastRenderedState,ee=R(K,p);if(A.hasEagerState=!0,A.eagerState=ee,bs(ee,K))return p_(a,u,A,0),Gn===null&&__(),!1}catch{}finally{}if(p=gg(a,u,A,w),p!==null)return Ws(p,a,w),A5(p,u,w),!0}return!1}function e1(a,u,p,w){if(w={lane:2,revertLane:M1(),gesture:null,action:w,hasEagerState:!1,eagerState:null,next:null},L_(a)){if(u)throw Error(r(479))}else u=gg(a,p,w,2),u!==null&&Ws(u,a,2)}function L_(a){var u=a.alternate;return a===Wt||u!==null&&u===Wt}function j5(a,u){_u=z_=!0;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}function A5(a,u,p){if((p&4194048)!==0){var w=u.lanes;w&=a.pendingLanes,p|=w,u.lanes=p,Qe(a,p)}}var rf={readContext:ss,use:T_,useCallback:br,useContext:br,useEffect:br,useImperativeHandle:br,useLayoutEffect:br,useInsertionEffect:br,useMemo:br,useReducer:br,useRef:br,useState:br,useDebugValue:br,useDeferredValue:br,useTransition:br,useSyncExternalStore:br,useId:br,useHostTransitionStatus:br,useFormState:br,useActionState:br,useOptimistic:br,useMemoCache:br,useCacheRefresh:br};rf.useEffectEvent=br;var T5={readContext:ss,use:T_,useCallback:function(a,u){return As().memoizedState=[a,u===void 0?null:u],a},useContext:ss,useEffect:_5,useImperativeHandle:function(a,u,p){p=p!=null?p.concat([a]):null,R_(4194308,4,b5.bind(null,u,a),p)},useLayoutEffect:function(a,u){return R_(4194308,4,a,u)},useInsertionEffect:function(a,u){R_(4,2,a,u)},useMemo:function(a,u){var p=As();u=u===void 0?null:u;var w=a();if(hc){gn(!0);try{a()}finally{gn(!1)}}return p.memoizedState=[w,u],w},useReducer:function(a,u,p){var w=As();if(p!==void 0){var A=p(u);if(hc){gn(!0);try{p(u)}finally{gn(!1)}}}else A=u;return w.memoizedState=w.baseState=A,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:A},w.queue=a,a=a.dispatch=GL.bind(null,Wt,a),[w.memoizedState,a]},useRef:function(a){var u=As();return a={current:a},u.memoizedState=a},useState:function(a){a=Wg(a);var u=a.queue,p=z5.bind(null,Wt,u);return u.dispatch=p,[a.memoizedState,p]},useDebugValue:Xg,useDeferredValue:function(a,u){var p=As();return Zg(p,a,u)},useTransition:function(){var a=Wg(!1);return a=S5.bind(null,Wt,a.queue,!0,!1),As().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,u,p){var w=Wt,A=As();if(hn){if(p===void 0)throw Error(r(407));p=p()}else{if(p=u(),Gn===null)throw Error(r(349));(dn&127)!==0||Qw(w,u,p)}A.memoizedState=p;var R={value:p,getSnapshot:u};return A.queue=R,_5(e5.bind(null,w,R,a),[a]),w.flags|=2048,mu(9,{destroy:void 0},Jw.bind(null,w,R,p,u),null),p},useId:function(){var a=As(),u=Gn.identifierPrefix;if(hn){var p=ka,w=Sa;p=(w&~(1<<32-Ct(w)-1)).toString(32)+p,u="_"+u+"R_"+p,p=j_++,0<\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof w.is=="string"?K.createElement("select",{is:w.is}):K.createElement("select"),w.multiple?R.multiple=!0:w.size&&(R.size=w.size);break;default:R=typeof w.is=="string"?K.createElement(A,{is:w.is}):K.createElement(A)}}R[bn]=u,R[wn]=w;e:for(K=u.child;K!==null;){if(K.tag===5||K.tag===6)R.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===u)break e;for(;K.sibling===null;){if(K.return===null||K.return===u)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}u.stateNode=R;e:switch(as(R,A,w),A){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}w&&oo(u)}}return er(u),_1(u,u.type,a===null?null:a.memoizedProps,u.pendingProps,p),null;case 6:if(a&&u.stateNode!=null)a.memoizedProps!==w&&oo(u);else{if(typeof w!="string"&&u.stateNode===null)throw Error(r(166));if(a=oe.current,ou(u)){if(a=u.stateNode,p=u.memoizedProps,w=null,A=rs,A!==null)switch(A.tag){case 27:case 5:w=A.memoizedProps}a[bn]=u,a=!!(a.nodeValue===p||w!==null&&w.suppressHydrationWarning===!0||X3(a.nodeValue,p)),a||Jo(u,!0)}else a=t0(a).createTextNode(w),a[bn]=u,u.stateNode=a}return er(u),null;case 31:if(p=u.memoizedState,a===null||a.memoizedState!==null){if(w=ou(u),p!==null){if(a===null){if(!w)throw Error(r(318));if(a=u.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[bn]=u}else ac(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;er(u),a=!1}else p=kg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=p),a=!0;if(!a)return u.flags&256?(li(u),u):(li(u),null);if((u.flags&128)!==0)throw Error(r(558))}return er(u),null;case 13:if(w=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(A=ou(u),w!==null&&w.dehydrated!==null){if(a===null){if(!A)throw Error(r(318));if(A=u.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[bn]=u}else ac(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;er(u),A=!1}else A=kg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=A),A=!0;if(!A)return u.flags&256?(li(u),u):(li(u),null)}return li(u),(u.flags&128)!==0?(u.lanes=p,u):(p=w!==null,a=a!==null&&a.memoizedState!==null,p&&(w=u.child,A=null,w.alternate!==null&&w.alternate.memoizedState!==null&&w.alternate.memoizedState.cachePool!==null&&(A=w.alternate.memoizedState.cachePool.pool),R=null,w.memoizedState!==null&&w.memoizedState.cachePool!==null&&(R=w.memoizedState.cachePool.pool),R!==A&&(w.flags|=2048)),p!==a&&p&&(u.child.flags|=8192),H_(u,u.updateQueue),er(u),null);case 4:return ne(),a===null&&O1(u.stateNode.containerInfo),er(u),null;case 10:return ro(u.type),er(u),null;case 19:if(X(Cr),w=u.memoizedState,w===null)return er(u),null;if(A=(u.flags&128)!==0,R=w.rendering,R===null)if(A)af(w,!1);else{if(vr!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(R=N_(a),R!==null){for(u.flags|=128,af(w,!1),a=R.updateQueue,u.updateQueue=a,H_(u,a),u.subtreeFlags=0,a=p,p=u.child;p!==null;)zw(p,a),p=p.sibling;return V(Cr,Cr.current&1|2),hn&&to(u,w.treeForkCount),u.child}a=a.sibling}w.tail!==null&&et()>G_&&(u.flags|=128,A=!0,af(w,!1),u.lanes=4194304)}else{if(!A)if(a=N_(R),a!==null){if(u.flags|=128,A=!0,a=a.updateQueue,u.updateQueue=a,H_(u,a),af(w,!0),w.tail===null&&w.tailMode==="hidden"&&!R.alternate&&!hn)return er(u),null}else 2*et()-w.renderingStartTime>G_&&p!==536870912&&(u.flags|=128,A=!0,af(w,!1),u.lanes=4194304);w.isBackwards?(R.sibling=u.child,u.child=R):(a=w.last,a!==null?a.sibling=R:u.child=R,w.last=R)}return w.tail!==null?(a=w.tail,w.rendering=a,w.tail=a.sibling,w.renderingStartTime=et(),a.sibling=null,p=Cr.current,V(Cr,A?p&1|2:p&1),hn&&to(u,w.treeForkCount),a):(er(u),null);case 22:case 23:return li(u),Ig(),w=u.memoizedState!==null,a!==null?a.memoizedState!==null!==w&&(u.flags|=8192):w&&(u.flags|=8192),w?(p&536870912)!==0&&(u.flags&128)===0&&(er(u),u.subtreeFlags&6&&(u.flags|=8192)):er(u),p=u.updateQueue,p!==null&&H_(u,p.retryQueue),p=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(p=a.memoizedState.cachePool.pool),w=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(w=u.memoizedState.cachePool.pool),w!==p&&(u.flags|=2048),a!==null&&X(cc),null;case 24:return p=null,a!==null&&(p=a.memoizedState.cache),u.memoizedState.cache!==p&&(u.flags|=2048),ro(Rr),er(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function XL(a,u){switch(wg(u),u.tag){case 1:return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return ro(Rr),ne(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 26:case 27:case 5:return _e(u),null;case 31:if(u.memoizedState!==null){if(li(u),u.alternate===null)throw Error(r(340));ac()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 13:if(li(u),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(r(340));ac()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return X(Cr),null;case 4:return ne(),null;case 10:return ro(u.type),null;case 22:case 23:return li(u),Ig(),a!==null&&X(cc),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 24:return ro(Rr),null;case 25:return null;default:return null}}function t3(a,u){switch(wg(u),u.tag){case 3:ro(Rr),ne();break;case 26:case 27:case 5:_e(u);break;case 4:ne();break;case 31:u.memoizedState!==null&&li(u);break;case 13:li(u);break;case 19:X(Cr);break;case 10:ro(u.type);break;case 22:case 23:li(u),Ig(),a!==null&&X(cc);break;case 24:ro(Rr)}}function of(a,u){try{var p=u.updateQueue,w=p!==null?p.lastEffect:null;if(w!==null){var A=w.next;p=A;do{if((p.tag&a)===a){w=void 0;var R=p.create,K=p.inst;w=R(),K.destroy=w}p=p.next}while(p!==A)}}catch(ee){Bn(u,u.return,ee)}}function al(a,u,p){try{var w=u.updateQueue,A=w!==null?w.lastEffect:null;if(A!==null){var R=A.next;w=R;do{if((w.tag&a)===a){var K=w.inst,ee=K.destroy;if(ee!==void 0){K.destroy=void 0,A=u;var he=p,ye=ee;try{ye()}catch(Te){Bn(A,he,Te)}}}w=w.next}while(w!==R)}}catch(Te){Bn(u,u.return,Te)}}function n3(a){var u=a.updateQueue;if(u!==null){var p=a.stateNode;try{Vw(u,p)}catch(w){Bn(a,a.return,w)}}}function r3(a,u,p){p.props=_c(a.type,a.memoizedProps),p.state=a.memoizedState;try{p.componentWillUnmount()}catch(w){Bn(a,u,w)}}function lf(a,u){try{var p=a.ref;if(p!==null){switch(a.tag){case 26:case 27:case 5:var w=a.stateNode;break;case 30:w=a.stateNode;break;default:w=a.stateNode}typeof p=="function"?a.refCleanup=p(w):p.current=w}}catch(A){Bn(a,u,A)}}function Ca(a,u){var p=a.ref,w=a.refCleanup;if(p!==null)if(typeof w=="function")try{w()}catch(A){Bn(a,u,A)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(A){Bn(a,u,A)}else p.current=null}function s3(a){var u=a.type,p=a.memoizedProps,w=a.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":p.autoFocus&&w.focus();break e;case"img":p.src?w.src=p.src:p.srcSet&&(w.srcset=p.srcSet)}}catch(A){Bn(a,a.return,A)}}function p1(a,u,p){try{var w=a.stateNode;bO(w,a.type,p,u),w[wn]=u}catch(A){Bn(a,a.return,A)}}function i3(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&hl(a.type)||a.tag===4}function m1(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||i3(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&hl(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function g1(a,u,p){var w=a.tag;if(w===5||w===6)a=a.stateNode,u?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(a,u):(u=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,u.appendChild(a),p=p._reactRootContainer,p!=null||u.onclick!==null||(u.onclick=gr));else if(w!==4&&(w===27&&hl(a.type)&&(p=a.stateNode,u=null),a=a.child,a!==null))for(g1(a,u,p),a=a.sibling;a!==null;)g1(a,u,p),a=a.sibling}function P_(a,u,p){var w=a.tag;if(w===5||w===6)a=a.stateNode,u?p.insertBefore(a,u):p.appendChild(a);else if(w!==4&&(w===27&&hl(a.type)&&(p=a.stateNode),a=a.child,a!==null))for(P_(a,u,p),a=a.sibling;a!==null;)P_(a,u,p),a=a.sibling}function a3(a){var u=a.stateNode,p=a.memoizedProps;try{for(var w=a.type,A=u.attributes;A.length;)u.removeAttributeNode(A[0]);as(u,w,p),u[bn]=a,u[wn]=p}catch(R){Bn(a,a.return,R)}}var lo=!1,Or=!1,b1=!1,o3=typeof WeakSet=="function"?WeakSet:Set,Qr=null;function ZL(a,u){if(a=a.containerInfo,$1=l0,a=Mr(a),Xo(a)){if("selectionStart"in a)var p={start:a.selectionStart,end:a.selectionEnd};else e:{p=(p=a.ownerDocument)&&p.defaultView||window;var w=p.getSelection&&p.getSelection();if(w&&w.rangeCount!==0){p=w.anchorNode;var A=w.anchorOffset,R=w.focusNode;w=w.focusOffset;try{p.nodeType,R.nodeType}catch{p=null;break e}var K=0,ee=-1,he=-1,ye=0,Te=0,Le=a,ke=null;t:for(;;){for(var Ae;Le!==p||A!==0&&Le.nodeType!==3||(ee=K+A),Le!==R||w!==0&&Le.nodeType!==3||(he=K+w),Le.nodeType===3&&(K+=Le.nodeValue.length),(Ae=Le.firstChild)!==null;)ke=Le,Le=Ae;for(;;){if(Le===a)break t;if(ke===p&&++ye===A&&(ee=K),ke===R&&++Te===w&&(he=K),(Ae=Le.nextSibling)!==null)break;Le=ke,ke=Le.parentNode}Le=Ae}p=ee===-1||he===-1?null:{start:ee,end:he}}else p=null}p=p||{start:0,end:0}}else p=null;for(H1={focusedElem:a,selectionRange:p},l0=!1,Qr=u;Qr!==null;)if(u=Qr,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,Qr=a;else for(;Qr!==null;){switch(u=Qr,R=u.alternate,a=u.flags,u.tag){case 0:if((a&4)!==0&&(a=u.updateQueue,a=a!==null?a.events:null,a!==null))for(p=0;p title"))),as(R,w,p),R[bn]=a,Ge(R),w=R;break e;case"link":var K=h6("link","href",A).get(w+(p.href||""));if(K){for(var ee=0;eeUn&&(K=Un,Un=zt,zt=K);var be=ya(ee,zt),pe=ya(ee,Un);if(be&&pe&&(Ae.rangeCount!==1||Ae.anchorNode!==be.node||Ae.anchorOffset!==be.offset||Ae.focusNode!==pe.node||Ae.focusOffset!==pe.offset)){var xe=Le.createRange();xe.setStart(be.node,be.offset),Ae.removeAllRanges(),zt>Un?(Ae.addRange(xe),Ae.extend(pe.node,pe.offset)):(xe.setEnd(pe.node,pe.offset),Ae.addRange(xe))}}}}for(Le=[],Ae=ee;Ae=Ae.parentNode;)Ae.nodeType===1&&Le.push({element:Ae,left:Ae.scrollLeft,top:Ae.scrollTop});for(typeof ee.focus=="function"&&ee.focus(),ee=0;eep?32:p,U.T=null,p=C1,C1=null;var R=ul,K=_o;if(Wr=0,yu=ul=null,_o=0,(En&6)!==0)throw Error(r(331));var ee=En;if(En|=4,b3(R.current),p3(R,R.current,K,p),En=ee,_f(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(It,R)}catch{}return!0}finally{Y.p=A,U.T=w,O3(a,u)}}function B3(a,u,p){u=Ti(p,u),u=s1(a.stateNode,u,2),a=rl(a,u,2),a!==null&&(ot(a,2),Ea(a))}function Bn(a,u,p){if(a.tag===3)B3(a,a,p);else for(;u!==null;){if(u.tag===3){B3(u,a,p);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(cl===null||!cl.has(w))){a=Ti(p,a),p=$5(2),w=rl(u,p,2),w!==null&&(H5(p,w,u,a),ot(w,2),Ea(w));break}}u=u.return}}function j1(a,u,p){var w=a.pingCache;if(w===null){w=a.pingCache=new eO;var A=new Set;w.set(u,A)}else A=w.get(u),A===void 0&&(A=new Set,w.set(u,A));A.has(p)||(y1=!0,A.add(p),a=iO.bind(null,a,u,p),u.then(a,a))}function iO(a,u,p){var w=a.pingCache;w!==null&&w.delete(u),a.pingedLanes|=a.suspendedLanes&p,a.warmLanes&=~p,Gn===a&&(dn&p)===p&&(vr===4||vr===3&&(dn&62914560)===dn&&300>et()-q_?(En&2)===0&&wu(a,0):w1|=p,xu===dn&&(xu=0)),Ea(a)}function $3(a,u){u===0&&(u=an()),a=sc(a,u),a!==null&&(ot(a,u),Ea(a))}function aO(a){var u=a.memoizedState,p=0;u!==null&&(p=u.retryLane),$3(a,p)}function oO(a,u){var p=0;switch(a.tag){case 31:case 13:var w=a.stateNode,A=a.memoizedState;A!==null&&(p=A.retryLane);break;case 19:w=a.stateNode;break;case 22:w=a.stateNode._retryCache;break;default:throw Error(r(314))}w!==null&&w.delete(u),$3(a,p)}function lO(a,u){return Nt(a,u)}var Z_=null,ku=null,A1=!1,Q_=!1,T1=!1,fl=0;function Ea(a){a!==ku&&a.next===null&&(ku===null?Z_=ku=a:ku=ku.next=a),Q_=!0,A1||(A1=!0,uO())}function _f(a,u){if(!T1&&Q_){T1=!0;do for(var p=!1,w=Z_;w!==null;){if(a!==0){var A=w.pendingLanes;if(A===0)var R=0;else{var K=w.suspendedLanes,ee=w.pingedLanes;R=(1<<31-Ct(42|a)+1)-1,R&=A&~(K&~ee),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(p=!0,U3(w,R))}else R=dn,R=$n(w,w===Gn?R:0,w.cancelPendingCommit!==null||w.timeoutHandle!==-1),(R&3)===0||Cn(w,R)||(p=!0,U3(w,R));w=w.next}while(p);T1=!1}}function cO(){H3()}function H3(){Q_=A1=!1;var a=0;fl!==0&&xO()&&(a=fl);for(var u=et(),p=null,w=Z_;w!==null;){var A=w.next,R=P3(w,u);R===0?(w.next=null,p===null?Z_=A:p.next=A,A===null&&(ku=p)):(p=w,(a!==0||(R&3)!==0)&&(Q_=!0)),w=A}Wr!==0&&Wr!==5||_f(a),fl!==0&&(fl=0)}function P3(a,u){for(var p=a.suspendedLanes,w=a.pingedLanes,A=a.expirationTimes,R=a.pendingLanes&-62914561;0ee)break;var Te=he.transferSize,Le=he.initiatorType;Te&&Z3(Le)&&(he=he.responseEnd,K+=Te*(he"u"?null:document;function c6(a,u,p){var w=Cu;if(w&&typeof u=="string"&&u){var A=qn(u);A='link[rel="'+a+'"][href="'+A+'"]',typeof p=="string"&&(A+='[crossorigin="'+p+'"]'),l6.has(A)||(l6.add(A),a={rel:a,crossOrigin:p,href:u},w.querySelector(A)===null&&(u=w.createElement("link"),as(u,"link",a),Ge(u),w.head.appendChild(u)))}}function jO(a){po.D(a),c6("dns-prefetch",a,null)}function AO(a,u){po.C(a,u),c6("preconnect",a,u)}function TO(a,u,p){po.L(a,u,p);var w=Cu;if(w&&a&&u){var A='link[rel="preload"][as="'+qn(u)+'"]';u==="image"&&p&&p.imageSrcSet?(A+='[imagesrcset="'+qn(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(A+='[imagesizes="'+qn(p.imageSizes)+'"]')):A+='[href="'+qn(a)+'"]';var R=A;switch(u){case"style":R=Eu(a);break;case"script":R=Nu(a)}Ii.has(R)||(a=h({rel:"preload",href:u==="image"&&p&&p.imageSrcSet?void 0:a,as:u},p),Ii.set(R,a),w.querySelector(A)!==null||u==="style"&&w.querySelector(bf(R))||u==="script"&&w.querySelector(vf(R))||(u=w.createElement("link"),as(u,"link",a),Ge(u),w.head.appendChild(u)))}}function MO(a,u){po.m(a,u);var p=Cu;if(p&&a){var w=u&&typeof u.as=="string"?u.as:"script",A='link[rel="modulepreload"][as="'+qn(w)+'"][href="'+qn(a)+'"]',R=A;switch(w){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=Nu(a)}if(!Ii.has(R)&&(a=h({rel:"modulepreload",href:a},u),Ii.set(R,a),p.querySelector(A)===null)){switch(w){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(vf(R)))return}w=p.createElement("link"),as(w,"link",a),Ge(w),p.head.appendChild(w)}}}function RO(a,u,p){po.S(a,u,p);var w=Cu;if(w&&a){var A=vn(w).hoistableStyles,R=Eu(a);u=u||"default";var K=A.get(R);if(!K){var ee={loading:0,preload:null};if(K=w.querySelector(bf(R)))ee.loading=5;else{a=h({rel:"stylesheet",href:a,"data-precedence":u},p),(p=Ii.get(R))&&W1(a,p);var he=K=w.createElement("link");Ge(he),as(he,"link",a),he._p=new Promise(function(ye,Te){he.onload=ye,he.onerror=Te}),he.addEventListener("load",function(){ee.loading|=1}),he.addEventListener("error",function(){ee.loading|=2}),ee.loading|=4,r0(K,u,w)}K={type:"stylesheet",instance:K,count:1,state:ee},A.set(R,K)}}}function DO(a,u){po.X(a,u);var p=Cu;if(p&&a){var w=vn(p).hoistableScripts,A=Nu(a),R=w.get(A);R||(R=p.querySelector(vf(A)),R||(a=h({src:a,async:!0},u),(u=Ii.get(A))&&K1(a,u),R=p.createElement("script"),Ge(R),as(R,"link",a),p.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},w.set(A,R))}}function LO(a,u){po.M(a,u);var p=Cu;if(p&&a){var w=vn(p).hoistableScripts,A=Nu(a),R=w.get(A);R||(R=p.querySelector(vf(A)),R||(a=h({src:a,async:!0,type:"module"},u),(u=Ii.get(A))&&K1(a,u),R=p.createElement("script"),Ge(R),as(R,"link",a),p.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},w.set(A,R))}}function u6(a,u,p,w){var A=(A=oe.current)?n0(A):null;if(!A)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(u=Eu(p.href),p=vn(A).hoistableStyles,w=p.get(u),w||(w={type:"style",instance:null,count:0,state:null},p.set(u,w)),w):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){a=Eu(p.href);var R=vn(A).hoistableStyles,K=R.get(a);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(a,K),(R=A.querySelector(bf(a)))&&!R._p&&(K.instance=R,K.state.loading=5),Ii.has(a)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},Ii.set(a,p),R||OO(A,a,p,K.state))),u&&w===null)throw Error(r(528,""));return K}if(u&&w!==null)throw Error(r(529,""));return null;case"script":return u=p.async,p=p.src,typeof p=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=Nu(p),p=vn(A).hoistableScripts,w=p.get(u),w||(w={type:"script",instance:null,count:0,state:null},p.set(u,w)),w):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Eu(a){return'href="'+qn(a)+'"'}function bf(a){return'link[rel="stylesheet"]['+a+"]"}function d6(a){return h({},a,{"data-precedence":a.precedence,precedence:null})}function OO(a,u,p,w){a.querySelector('link[rel="preload"][as="style"]['+u+"]")?w.loading=1:(u=a.createElement("link"),w.preload=u,u.addEventListener("load",function(){return w.loading|=1}),u.addEventListener("error",function(){return w.loading|=2}),as(u,"link",p),Ge(u),a.head.appendChild(u))}function Nu(a){return'[src="'+qn(a)+'"]'}function vf(a){return"script[async]"+a}function f6(a,u,p){if(u.count++,u.instance===null)switch(u.type){case"style":var w=a.querySelector('style[data-href~="'+qn(p.href)+'"]');if(w)return u.instance=w,Ge(w),w;var A=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return w=(a.ownerDocument||a).createElement("style"),Ge(w),as(w,"style",A),r0(w,p.precedence,a),u.instance=w;case"stylesheet":A=Eu(p.href);var R=a.querySelector(bf(A));if(R)return u.state.loading|=4,u.instance=R,Ge(R),R;w=d6(p),(A=Ii.get(A))&&W1(w,A),R=(a.ownerDocument||a).createElement("link"),Ge(R);var K=R;return K._p=new Promise(function(ee,he){K.onload=ee,K.onerror=he}),as(R,"link",w),u.state.loading|=4,r0(R,p.precedence,a),u.instance=R;case"script":return R=Nu(p.src),(A=a.querySelector(vf(R)))?(u.instance=A,Ge(A),A):(w=p,(A=Ii.get(R))&&(w=h({},p),K1(w,A)),a=a.ownerDocument||a,A=a.createElement("script"),Ge(A),as(A,"link",w),a.head.appendChild(A),u.instance=A);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(w=u.instance,u.state.loading|=4,r0(w,p.precedence,a));return u.instance}function r0(a,u,p){for(var w=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=w.length?w[w.length-1]:null,R=A,K=0;K title"):null)}function IO(a,u,p){if(p===1||u.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return a=u.disabled,typeof u.precedence=="string"&&a==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function p6(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function BO(a,u,p,w){if(p.type==="stylesheet"&&(typeof w.media!="string"||matchMedia(w.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var A=Eu(w.href),R=u.querySelector(bf(A));if(R){u=R._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(a.count++,a=i0.bind(a),u.then(a,a)),p.state.loading|=4,p.instance=R,Ge(R);return}R=u.ownerDocument||u,w=d6(w),(A=Ii.get(A))&&W1(w,A),R=R.createElement("link"),Ge(R);var K=R;K._p=new Promise(function(ee,he){K.onload=ee,K.onerror=he}),as(R,"link",w),p.instance=R}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(p,u),(u=p.state.preload)&&(p.state.loading&3)===0&&(a.count++,p=i0.bind(a),u.addEventListener("load",p),u.addEventListener("error",p))}}var Y1=0;function $O(a,u){return a.stylesheets&&a.count===0&&o0(a,a.stylesheets),0Y1?50:800)+u);return a.unsuspend=p,function(){a.unsuspend=null,clearTimeout(w),clearTimeout(A)}}:null}function i0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)o0(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var a0=null;function o0(a,u){a.stylesheets=null,a.unsuspend!==null&&(a.count++,a0=new Map,u.forEach(HO,a),a0=null,i0.call(a))}function HO(a,u){if(!(u.state.loading&4)){var p=a0.get(a);if(p)var w=p.get(null);else{p=new Map,a0.set(a,p);for(var A=a.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),ib.exports=rI(),ib.exports}var iI=sI();const aI={},oI="en",$x=["en","zh-CN","fa"],BE="orx:locale",Hx=["localStorage","preferredLanguage","baseLocale"],F6=[],eh=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let U6=!1,E=()=>{var t;let e=Hx;!eh&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=PE(window.location.href));const n=lI(e);if(n)return U6||(U6=!0,$E(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function lI(e,n){let t;for(const r of e){if(r==="baseLocale")t=oI;else if(r==="preferredLanguage"&&!eh)t=hI();else if(r==="localStorage"&&!eh)t=localStorage.getItem(BE)??void 0;else if(FE(r)&&vp.has(r)){const i=vp.get(r);if(i){const l=i.getLocale();if(l instanceof Promise)continue;if(l!==void 0)return dI(l)}}const s=th(t);if(s)return s}}const cI=e=>{window.location.reload()};let $E=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=E()}catch{}const s=[];let i=Hx;!eh&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=PE(window.location.href));for(const c of i)if(c!=="baseLocale"){if(c==="localStorage"&&typeof window<"u")localStorage.setItem(BE,e);else if(FE(c)&&vp.has(c)){const d=vp.get(c);if(d){let _=d.setLocale(e);_ instanceof Promise&&(_=_.catch(h=>{throw new Error(`Custom strategy "${c}" setLocale failed.`,{cause:h})}),s.push(_))}}}const l=()=>{!eh&&t.reload&&window.location&&e!==r&&cI()};if(s.length)return Promise.all(s).then(()=>{l()});l()},uI=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function th(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of $x)if(t.toLowerCase()===n)return t}function HE(e){return!!e&&$x.some(n=>n===e)}function dI(e){const n=th(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${$x.join(", ")}`)}function fI(e,n){return e.exec(n.href)}function hI(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=th(t.fullTag);if(r)return r;const s=th(t.baseTag);if(s)return s}}function _I(e){return pI(e)}function pI(e){const n=typeof e=="string"?new URL(e,uI()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&th(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let q6,G6;function mI(e){if(F6.length===0)return;const n=typeof e=="string"?e:e.href;if(q6===n)return G6;const t=new URL(n,"http://example.com"),r=_I(t),s=r.href===t.href?[t]:[t,r];let i;for(const l of s){for(const o of F6){const c=new aI(o.match,l.href);if(fI(c,l)){i=o;break}}if(i)break}return q6=n,G6=i,i}function PE(e){const n=mI(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:Hx}const vp=new Map;function FE(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const gI=e=>`Actions for ${e==null?void 0:e.name}`,bI=e=>`${e==null?void 0:e.name} 的操作`,vI=e=>`عملیات ${e==null?void 0:e.name}`,xI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bI(e):t==="fa"?vI(e):gI(e)}),yI=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,wI=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,SI=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,kI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wI(e):t==="fa"?SI(e):yI(e)}),CI=e=>`Branch: ${e==null?void 0:e.branch}`,EI=e=>`分支:${e==null?void 0:e.branch}`,NI=e=>`شاخه: ${e==null?void 0:e.branch}`,zI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?EI(e):t==="fa"?NI(e):CI(e)}),jI=e=>`Browse code on ${e==null?void 0:e.branch}`,AI=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,TI=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,UE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AI(e):t==="fa"?TI(e):jI(e)}),MI=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,RI=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,DI=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,LI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?RI(e):t==="fa"?DI(e):MI(e)}),OI=e=>`Collapse ${e==null?void 0:e.name}`,II=e=>`折叠 ${e==null?void 0:e.name}`,BI=e=>`بستن ${e==null?void 0:e.name}`,$I=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?II(e):t==="fa"?BI(e):OI(e)}),HI=e=>`Committed changes versus ${e==null?void 0:e.parent}`,PI=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,FI=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,UI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?PI(e):t==="fa"?FI(e):HI(e)}),qI=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,GI=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,VI=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,WI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?GI(e):t==="fa"?VI(e):qI(e)}),KI=e=>`Copy ${e==null?void 0:e.value}`,YI=e=>`复制 ${e==null?void 0:e.value}`,XI=e=>`کپی ${e==null?void 0:e.value}`,ZI=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?YI(e):t==="fa"?XI(e):KI(e)}),QI=e=>`Delete ${e==null?void 0:e.name}`,JI=e=>`删除 ${e==null?void 0:e.name}`,eB=e=>`حذف ${e==null?void 0:e.name}`,qv=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?JI(e):t==="fa"?eB(e):QI(e)}),tB=e=>`Download ${e==null?void 0:e.name}`,nB=e=>`下载 ${e==null?void 0:e.name}`,rB=e=>`بارگیری ${e==null?void 0:e.name}`,V6=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nB(e):t==="fa"?rB(e):tB(e)}),sB=e=>`Expand ${e==null?void 0:e.name}`,iB=e=>`展开 ${e==null?void 0:e.name}`,aB=e=>`باز کردن ${e==null?void 0:e.name}`,oB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iB(e):t==="fa"?aB(e):sB(e)}),lB=e=>`Hide additional ${e==null?void 0:e.target}`,cB=e=>`隐藏其余${e==null?void 0:e.target}`,uB=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,dB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?cB(e):t==="fa"?uB(e):lB(e)}),fB=e=>`Hide error details for ${e==null?void 0:e.activity}`,hB=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,_B=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,pB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hB(e):t==="fa"?_B(e):fB(e)}),mB=e=>`${e==null?void 0:e.count} consecutive identical calls`,gB=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,bB=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,vB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?gB(e):t==="fa"?bB(e):mB(e)}),xB=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,yB=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,wB=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,SB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yB(e):t==="fa"?wB(e):xB(e)}),kB=e=>`Open ${e==null?void 0:e.branch} on GitHub`,CB=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,EB=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,qE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?CB(e):t==="fa"?EB(e):kB(e)}),NB=e=>`Open experiment ${e==null?void 0:e.name}`,zB=e=>`打开实验 ${e==null?void 0:e.name}`,jB=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,AB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zB(e):t==="fa"?jB(e):NB(e)}),TB=e=>`Open ${e==null?void 0:e.path} in the right pane`,MB=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,RB=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,DB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MB(e):t==="fa"?RB(e):TB(e)}),LB=e=>`Open ${e==null?void 0:e.name}`,OB=e=>`打开 ${e==null?void 0:e.name}`,IB=e=>`باز کردن ${e==null?void 0:e.name}`,BB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OB(e):t==="fa"?IB(e):LB(e)}),$B=e=>`Open logs for run ${e==null?void 0:e.run}`,HB=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,PB=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,FB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HB(e):t==="fa"?PB(e):$B(e)}),UB=e=>`Open ${e==null?void 0:e.name} on GitHub`,qB=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,GB=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,xp=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?qB(e):t==="fa"?GB(e):UB(e)}),VB=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,WB=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,KB=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,YB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WB(e):t==="fa"?KB(e):VB(e)}),XB=e=>`Overleaf — ${e==null?void 0:e.status}`,ZB=e=>`Overleaf — ${e==null?void 0:e.status}`,QB=e=>`Overleaf — ${e==null?void 0:e.status}`,JB=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZB(e):t==="fa"?QB(e):XB(e)}),e$=e=>`Preview /${e==null?void 0:e.name} skill`,t$=e=>`预览 /${e==null?void 0:e.name} 技能`,n$=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,r$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?t$(e):t==="fa"?n$(e):e$(e)}),s$=e=>`Remove annotation ${e==null?void 0:e.number}`,i$=e=>`移除批注 ${e==null?void 0:e.number}`,a$=e=>`حذف یادداشت ${e==null?void 0:e.number}`,o$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?i$(e):t==="fa"?a$(e):s$(e)}),l$=e=>`Remove ${e==null?void 0:e.name}`,c$=e=>`移除 ${e==null?void 0:e.name}`,u$=e=>`حذف ${e==null?void 0:e.name}`,d$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?c$(e):t==="fa"?u$(e):l$(e)}),f$=e=>`Remove queued message: ${e==null?void 0:e.text}`,h$=e=>`移除排队消息:${e==null?void 0:e.text}`,_$=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,p$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?h$(e):t==="fa"?_$(e):f$(e)}),m$=e=>`Retry queued message: ${e==null?void 0:e.text}`,g$=e=>`重试排队消息:${e==null?void 0:e.text}`,b$=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,v$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?g$(e):t==="fa"?b$(e):m$(e)}),x$=e=>`Run ${e==null?void 0:e.id}`,y$=e=>`运行 ${e==null?void 0:e.id}`,w$=e=>`اجرای ${e==null?void 0:e.id}`,S$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?y$(e):t==="fa"?w$(e):x$(e)}),k$=e=>`Show error details for ${e==null?void 0:e.activity}`,C$=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,E$=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,N$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?C$(e):t==="fa"?E$(e):k$(e)}),z$=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,j$=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,A$=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,T$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?j$(e):t==="fa"?A$(e):z$(e)}),M$=e=>`${e==null?void 0:e.name} skill`,R$=e=>`${e==null?void 0:e.name} 技能`,D$=e=>`مهارت ${e==null?void 0:e.name}`,L$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?R$(e):t==="fa"?D$(e):M$(e)}),O$=e=>`Value for ${e==null?void 0:e.name}`,I$=e=>`${e==null?void 0:e.name} 的值`,B$=e=>`مقدار ${e==null?void 0:e.name}`,$$=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?I$(e):t==="fa"?B$(e):O$(e)}),H$=()=>"Agent reported back",P$=()=>"智能体已返回结果",F$=()=>"عامل نتیجه را گزارش کرد",U$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P$():t==="fa"?F$():H$()}),q$=()=>"Browse",G$=()=>"浏览",V$=()=>"مرور",W$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G$():t==="fa"?V$():q$()}),K$=()=>"Browsing…",Y$=()=>"正在浏览…",X$=()=>"در حال مرور…",Z$=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y$():t==="fa"?X$():K$()}),Q$=()=>"Checked experiment status and updated notes",J$=()=>"已检查实验状态并更新笔记",eH=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",tH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J$():t==="fa"?eH():Q$()}),nH=()=>"Closed an agent",rH=()=>"已关闭智能体",sH=()=>"عامل بسته شد",iH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rH():t==="fa"?sH():nH()}),aH=()=>"Compacted context",oH=()=>"上下文已压缩",lH=()=>"زمینه فشرده شد",cH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oH():t==="fa"?lH():aH()}),uH=()=>"Compacting context…",dH=()=>"正在压缩上下文…",fH=()=>"در حال فشرده‌سازی زمینه…",hH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dH():t==="fa"?fH():uH()}),_H=e=>`Created ${e==null?void 0:e.target}`,pH=e=>`已创建 ${e==null?void 0:e.target}`,mH=e=>`${e==null?void 0:e.target} ایجاد شد`,gH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?pH(e):t==="fa"?mH(e):_H(e)}),bH=()=>"Delegate",vH=()=>"委派",xH=()=>"واگذاری",yH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vH():t==="fa"?xH():bH()}),wH=()=>"Delegating…",SH=()=>"正在委派…",kH=()=>"در حال واگذاری…",CH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SH():t==="fa"?kH():wH()}),EH=e=>`Deleted ${e==null?void 0:e.target}`,NH=e=>`已删除 ${e==null?void 0:e.target}`,zH=e=>`${e==null?void 0:e.target} حذف شد`,jH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?NH(e):t==="fa"?zH(e):EH(e)}),AH=()=>"Edit",TH=()=>"编辑",MH=()=>"ویرایش",RH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TH():t==="fa"?MH():AH()}),DH=e=>`Edited ${e==null?void 0:e.target}`,LH=e=>`已编辑 ${e==null?void 0:e.target}`,OH=e=>`${e==null?void 0:e.target} ویرایش شد`,IH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?LH(e):t==="fa"?OH(e):DH(e)}),BH=()=>"Editing…",$H=()=>"正在编辑…",HH=()=>"در حال ویرایش…",PH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$H():t==="fa"?HH():BH()}),FH=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,UH=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,qH=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,GH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?UH(e):t==="fa"?qH(e):FH(e)}),VH=e=>`Listed files matching ${e==null?void 0:e.pattern}`,WH=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,KH=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,YH=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WH(e):t==="fa"?KH(e):VH(e)}),XH=()=>"Load",ZH=()=>"加载",QH=()=>"بارگیری",JH=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZH():t==="fa"?QH():XH()}),eP=()=>"Loaded a skill",tP=()=>"已加载技能",nP=()=>"یک مهارت بارگیری شد",rP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tP():t==="fa"?nP():eP()}),sP=e=>`Loaded ${e==null?void 0:e.name} skill`,iP=e=>`已加载技能 ${e==null?void 0:e.name}`,aP=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,oP=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?iP(e):t==="fa"?aP(e):sP(e)}),lP=()=>"Loading…",cP=()=>"正在加载…",uP=()=>"در حال بارگیری…",dP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cP():t==="fa"?uP():lP()}),fP=e=>`Opened ${e==null?void 0:e.target}`,hP=e=>`已打开 ${e==null?void 0:e.target}`,_P=e=>`${e==null?void 0:e.target} باز شد`,pP=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hP(e):t==="fa"?_P(e):fP(e)}),mP=e=>`Ran ${e==null?void 0:e.command}`,gP=e=>`已运行 ${e==null?void 0:e.command}`,bP=e=>`${e==null?void 0:e.command} اجرا شد`,vP=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?gP(e):t==="fa"?bP(e):mP(e)}),xP=()=>"Ran a sub-agent",yP=()=>"已运行子智能体",wP=()=>"یک عامل فرعی اجرا شد",SP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yP():t==="fa"?wP():xP()}),kP=()=>"Read",CP=()=>"读取",EP=()=>"خواندن",NP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CP():t==="fa"?EP():kP()}),zP=()=>"Read experiment notes",jP=()=>"已读取实验笔记",AP=()=>"یادداشت‌های آزمایش خوانده شد",TP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jP():t==="fa"?AP():zP()}),MP=()=>"Read a paper",RP=()=>"已读取论文",DP=()=>"یک مقاله خوانده شد",LP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RP():t==="fa"?DP():MP()}),OP=e=>`Read ${e==null?void 0:e.name} skill`,IP=e=>`已读取技能 ${e==null?void 0:e.name}`,BP=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,cb=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?IP(e):t==="fa"?BP(e):OP(e)}),$P=e=>`Read ${e==null?void 0:e.target}`,HP=e=>`已读取 ${e==null?void 0:e.target}`,PP=e=>`${e==null?void 0:e.target} خوانده شد`,Ef=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HP(e):t==="fa"?PP(e):$P(e)}),FP=()=>"Read a web page",UP=()=>"已读取网页",qP=()=>"یک صفحهٔ وب خوانده شد",GP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UP():t==="fa"?qP():FP()}),VP=()=>"Reading…",WP=()=>"正在读取…",KP=()=>"در حال خواندن…",YP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WP():t==="fa"?KP():VP()}),XP=()=>"Resumed an agent",ZP=()=>"已恢复智能体",QP=()=>"عامل از سر گرفته شد",JP=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZP():t==="fa"?QP():XP()}),eF=()=>"Review",tF=()=>"查看",nF=()=>"بازبینی",rF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tF():t==="fa"?nF():eF()}),sF=()=>"Reviewed run log",iF=()=>"已查看运行日志",aF=()=>"گزارش اجرا بازبینی شد",oF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iF():t==="fa"?aF():sF()}),lF=()=>"Reviewed run logs",cF=()=>"已查看运行日志",uF=()=>"گزارش‌های اجرا بازبینی شد",dF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cF():t==="fa"?uF():lF()}),fF=()=>"Reviewed experiment status and notes",hF=()=>"已查看实验状态和笔记",_F=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",pF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hF():t==="fa"?_F():fF()}),mF=()=>"Reviewing…",gF=()=>"正在查看…",bF=()=>"در حال بازبینی…",vF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gF():t==="fa"?bF():mF()}),xF=()=>"Run",yF=()=>"运行",wF=()=>"اجرا",SF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yF():t==="fa"?wF():xF()}),kF=()=>"Running…",CF=()=>"正在运行…",EF=()=>"در حال اجرا…",GE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CF():t==="fa"?EF():kF()}),NF=()=>"Search",zF=()=>"搜索",jF=()=>"جست‌وجو",AF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zF():t==="fa"?jF():NF()}),TF=()=>"Searched alphaXiv full text",MF=()=>"已搜索 alphaXiv 全文",RF=()=>"متن کامل alphaXiv جست‌وجو شد",DF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MF():t==="fa"?RF():TF()}),LF=()=>"Searched alphaXiv semantically",OF=()=>"已对 alphaXiv 进行语义搜索",IF=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",BF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OF():t==="fa"?IF():LF()}),$F=()=>"Searched bioRxiv",HF=()=>"已搜索 bioRxiv",PF=()=>"bioRxiv جست‌وجو شد",FF=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HF():t==="fa"?PF():$F()}),UF=()=>"Searched code",qF=()=>"已搜索代码",GF=()=>"کد جست‌وجو شد",ub=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qF():t==="fa"?GF():UF()}),VF=e=>`Searched code for “${e==null?void 0:e.pattern}”`,WF=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,KF=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,db=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WF(e):t==="fa"?KF(e):VF(e)}),YF=e=>`Searched images for “${e==null?void 0:e.query}”`,XF=e=>`已搜索图片“${e==null?void 0:e.query}”`,ZF=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,QF=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XF(e):t==="fa"?ZF(e):YF(e)}),JF=()=>"Searched the literature",eU=()=>"已搜索文献",tU=()=>"منابع علمی جست‌وجو شد",W6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eU():t==="fa"?tU():JF()}),nU=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,rU=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,sU=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,iU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?rU(e):t==="fa"?sU(e):nU(e)}),aU=()=>"Searched OpenAlex",oU=()=>"已搜索 OpenAlex",lU=()=>"OpenAlex جست‌وجو شد",cU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oU():t==="fa"?lU():aU()}),uU=e=>`Searched the web for “${e==null?void 0:e.query}”`,dU=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,fU=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,K6=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dU(e):t==="fa"?fU(e):uU(e)}),hU=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,_U=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,pU=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,mU=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_U(e):t==="fa"?pU(e):hU(e)}),gU=()=>"Searching…",bU=()=>"正在搜索…",vU=()=>"در حال جست‌وجو…",xU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bU():t==="fa"?vU():gU()}),yU=()=>"Sent input to an agent",wU=()=>"已向智能体发送输入",SU=()=>"ورودی به عامل فرستاده شد",kU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wU():t==="fa"?SU():yU()}),CU=()=>"Spawned an agent",EU=()=>"已创建智能体",NU=()=>"یک عامل ساخته شد",zU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EU():t==="fa"?NU():CU()}),jU=()=>"Sub-agent",AU=()=>"子智能体",TU=()=>"عامل فرعی",MU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AU():t==="fa"?TU():jU()}),RU=()=>"Sub-agent interrupted",DU=()=>"子智能体已中断",LU=()=>"عامل فرعی متوقف شد",OU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DU():t==="fa"?LU():RU()}),IU=()=>"Sub-agent started",BU=()=>"子智能体已启动",$U=()=>"عامل فرعی آغاز شد",HU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BU():t==="fa"?$U():IU()}),PU=()=>"Updated experiment notes",FU=()=>"已更新实验笔记",UU=()=>"یادداشت‌های آزمایش به‌روز شد",qU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FU():t==="fa"?UU():PU()}),GU=()=>"Waiting on an agent",VU=()=>"正在等待智能体",WU=()=>"در انتظار عامل",KU=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VU():t==="fa"?WU():GU()}),YU=e=>`Approval required: ${e==null?void 0:e.label}`,XU=e=>`需要批准:${e==null?void 0:e.label}`,ZU=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,Y6=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XU(e):t==="fa"?ZU(e):YU(e)}),QU=()=>"The CLI is retrying the turn.",JU=()=>"CLI 正在重试本轮。",eq=()=>"CLI در حال تلاش دوباره برای این نوبت است.",tq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JU():t==="fa"?eq():QU()}),nq=()=>"Continue is available.",rq=()=>"可以继续。",sq=()=>"ادامه در دسترس است.",iq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rq():t==="fa"?sq():nq()}),aq=()=>"Retry is available.",oq=()=>"可以重试。",lq=()=>"تلاش دوباره در دسترس است.",cq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oq():t==="fa"?lq():aq()}),uq=()=>"Running a tool",dq=()=>"正在运行工具",fq=()=>"در حال اجرای ابزار",hq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dq():t==="fa"?fq():uq()}),_q=()=>"Tool activity completed",pq=()=>"工具活动已完成",mq=()=>"فعالیت ابزار کامل شد",gq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pq():t==="fa"?mq():_q()}),bq=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,vq=e=>`工具活动失败:${e==null?void 0:e.labels}`,xq=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,yq=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vq(e):t==="fa"?xq(e):bq(e)}),wq=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,Sq=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,kq=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,Cq=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Sq(e):t==="fa"?kq(e):wq(e)}),Eq=()=>"Turn did not finish.",Nq=()=>"本轮未完成。",zq=()=>"این نوبت کامل نشد.",jq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nq():t==="fa"?zq():Eq()}),Aq=()=>"Artifacts",Tq=()=>"产物",Mq=()=>"خروجی‌ها",Rq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tq():t==="fa"?Mq():Aq()}),Dq=()=>"Close panel",Lq=()=>"关闭面板",Oq=()=>"بستن پنل",yp=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lq():t==="fa"?Oq():Dq()}),Iq=()=>"Current task",Bq=()=>"当前任务",$q=()=>"وظیفهٔ فعلی",X6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bq():t==="fa"?$q():Iq()}),Hq=()=>"Drag to resize panel",Pq=()=>"拖动以调整面板大小",Fq=()=>"برای تغییر اندازهٔ پنل بکشید",Uq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pq():t==="fa"?Fq():Hq()}),qq=()=>"Drag toward the center to restore panel",Gq=()=>"向中央拖动以恢复面板",Vq=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",Wq=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gq():t==="fa"?Vq():qq()}),Kq=()=>"Entire project",Yq=()=>"整个项目",Xq=()=>"کل پروژه",Z6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yq():t==="fa"?Xq():Kq()}),Zq=()=>"Expand panel",Qq=()=>"展开面板",Jq=()=>"گسترش پنل",Q6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qq():t==="fa"?Jq():Zq()}),eG=e=>`Experiment filter: ${e==null?void 0:e.scope}`,tG=e=>`实验筛选:${e==null?void 0:e.scope}`,nG=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,rG=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?tG(e):t==="fa"?nG(e):eG(e)}),sG=()=>"Experiment view",iG=()=>"实验视图",aG=()=>"نمای آزمایش",oG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iG():t==="fa"?aG():sG()}),lG=()=>"Experiments",cG=()=>"实验",uG=()=>"آزمایش‌ها",dG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cG():t==="fa"?uG():lG()}),fG=()=>"Files",hG=()=>"文件",_G=()=>"فایل‌ها",pG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hG():t==="fa"?_G():fG()}),mG=()=>"Filter experiments",gG=()=>"筛选实验",bG=()=>"فیلتر آزمایش‌ها",vG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gG():t==="fa"?bG():mG()}),xG=()=>"Current task filtering is unavailable for unattributed experiments",yG=()=>"存在无法归属的实验时,不能按当前任务筛选",wG=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",SG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yG():t==="fa"?wG():xG()}),kG=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",CG=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",EG=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",NG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CG():t==="fa"?EG():kG()}),zG=()=>"Open a task to filter to its experiments",jG=()=>"请打开一个任务以筛选其实验",AG=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",TG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jG():t==="fa"?AG():zG()}),MG=()=>"projects",RG=()=>"项目",DG=()=>"پروژه‌ها",LG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RG():t==="fa"?DG():MG()}),OG=()=>"Restore panel",IG=()=>"还原面板",BG=()=>"بازگرداندن اندازهٔ پنل",J6=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IG():t==="fa"?BG():OG()}),$G=()=>"Retry",HG=()=>"重试",PG=()=>"تلاش دوباره",Ml=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HG():t==="fa"?PG():$G()}),FG=()=>"Select a project to browse its files.",UG=()=>"选择一个项目以浏览其文件。",qG=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",GG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UG():t==="fa"?qG():FG()}),VG=()=>"settings",WG=()=>"设置",KG=()=>"تنظیمات",YG=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WG():t==="fa"?KG():VG()}),XG=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,ZG=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,QG=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,JG=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZG(e):t==="fa"?QG(e):XG(e)}),eV=()=>"Sub-agent",tV=()=>"子智能体",nV=()=>"عامل فرعی",rV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tV():t==="fa"?nV():eV()}),sV=()=>"Table",iV=()=>"表格",aV=()=>"جدول",oV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iV():t==="fa"?aV():sV()}),lV=()=>"Tree",cV=()=>"树状图",uV=()=>"درخت",dV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cV():t==="fa"?uV():lV()}),fV=e=>`Collapse ${e==null?void 0:e.name}`,hV=e=>`折叠 ${e==null?void 0:e.name}`,_V=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,pV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hV(e):t==="fa"?_V(e):fV(e)}),mV=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,gV=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,bV=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,Px=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?gV(e):t==="fa"?bV(e):mV(e)}),vV=e=>`Delete folder ${e==null?void 0:e.name}`,xV=e=>`删除文件夹 ${e==null?void 0:e.name}`,yV=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,wV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xV(e):t==="fa"?yV(e):vV(e)}),SV=e=>`Expand ${e==null?void 0:e.name}`,kV=e=>`展开 ${e==null?void 0:e.name}`,CV=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,EV=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?kV(e):t==="fa"?CV(e):SV(e)}),NV=()=>"Binary or unsupported file — no inline preview.",zV=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",jV=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",AV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zV():t==="fa"?jV():NV()}),TV=()=>"Copy path",MV=()=>"复制路径",RV=()=>"کپی مسیر",VE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MV():t==="fa"?RV():TV()}),DV=()=>"Artifact not found",LV=()=>"找不到产物",OV=()=>"خروجی پیدا نشد",IV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LV():t==="fa"?OV():DV()}),BV=()=>"Open raw",$V=()=>"打开原始文件",HV=()=>"باز کردن فایل خام",PV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$V():t==="fa"?HV():BV()}),FV=()=>"Click an artifact to view it",UV=()=>"点击产物即可查看",qV=()=>"برای مشاهده، یک خروجی را انتخاب کنید",GV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UV():t==="fa"?qV():FV()}),VV=()=>"Copy artifacts directory path",WV=()=>"复制产物目录路径",KV=()=>"کپی مسیر پوشهٔ خروجی‌ها",YV=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WV():t==="fa"?KV():VV()}),XV=()=>"Delete artifact",ZV=()=>"删除产物",QV=()=>"حذف خروجی",e7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZV():t==="fa"?QV():XV()}),JV=()=>"Delete folder",eW=()=>"删除文件夹",tW=()=>"حذف پوشه",nW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eW():t==="fa"?tW():JV()}),rW=()=>"Failed to load:",sW=()=>"加载失败:",iW=()=>"بارگیری ناموفق بود:",aW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sW():t==="fa"?iW():rW()}),oW=()=>"File truncated — showing the first 512 KB.",lW=()=>"文件已截断——仅显示前 512 KB。",cW=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",uW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lW():t==="fa"?cW():oW()}),dW=()=>"Listing truncated — the folder has more artifacts.",fW=()=>"列表已截断——文件夹中还有更多产物。",hW=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",_W=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fW():t==="fa"?hW():dW()}),pW=()=>"Loading…",mW=()=>"正在加载…",gW=()=>"در حال بارگیری…",bW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mW():t==="fa"?gW():pW()}),vW=()=>"Loading artifacts…",xW=()=>"正在加载产物…",yW=()=>"در حال بارگیری خروجی‌ها…",wW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xW():t==="fa"?yW():vW()}),SW=()=>"Modified",kW=()=>"修改时间",CW=()=>"ویرایش‌شده",EW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kW():t==="fa"?CW():SW()}),NW=()=>"No artifacts yet",zW=()=>"尚无产物",jW=()=>"هنوز خروجی‌ای وجود ندارد",AW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zW():t==="fa"?jW():NW()}),TW=()=>"Open raw in new tab",MW=()=>"在新标签页中打开原始文件",RW=()=>"باز کردن فایل خام در زبانهٔ جدید",t7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MW():t==="fa"?RW():TW()}),DW=()=>"Storage settings",LW=()=>"存储设置",OW=()=>"تنظیمات ذخیره‌سازی",n7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LW():t==="fa"?OW():DW()}),IW=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files:",BW=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件:",$W=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید:",HW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BW():t==="fa"?$W():IW()}),PW=()=>"File too large to preview inline.",FW=()=>"文件太大,无法内嵌预览。",UW=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",qW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FW():t==="fa"?UW():PW()}),GW=()=>"This is the baseline branch, so there is no parent comparison.",VW=()=>"这是基线分支,因此没有父分支可供比较。",WW=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",KW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VW():t==="fa"?WW():GW()}),YW=()=>"Failed to load changes:",XW=()=>"加载更改失败:",ZW=()=>"بارگیری تغییرات ناموفق بود:",QW=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XW():t==="fa"?ZW():YW()}),JW=()=>"Loading changes…",eK=()=>"正在加载更改…",tK=()=>"در حال بارگیری تغییرات…",nK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eK():t==="fa"?tK():JW()}),rK=()=>"No committed changes from the parent branch.",sK=()=>"与父分支相比没有已提交的更改。",iK=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",aK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sK():t==="fa"?iK():rK()}),oK=e=>`agent ${e==null?void 0:e.number}`,lK=e=>`智能体 ${e==null?void 0:e.number}`,cK=e=>`عامل ${e==null?void 0:e.number}`,r7=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lK(e):t==="fa"?cK(e):oK(e)}),uK=()=>"agent sessions",dK=()=>"智能体会话",fK=()=>"نشست‌های عامل‌ها",hK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dK():t==="fa"?fK():uK()}),_K=()=>"All sessions",pK=()=>"所有会话",mK=()=>"همهٔ نشست‌ها",gK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pK():t==="fa"?mK():_K()}),bK=e=>`${e==null?void 0:e.count} annotations`,vK=e=>`${e==null?void 0:e.count} 条批注`,xK=e=>`${e==null?void 0:e.count} یادداشت`,yK=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vK(e):t==="fa"?xK(e):bK(e)}),wK=()=>"Archive",SK=()=>"归档",kK=()=>"بایگانی",CK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SK():t==="fa"?kK():wK()}),EK=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",NK=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",zK=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",jK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NK():t==="fa"?zK():EK()}),AK=()=>"Asked about selected text",TK=()=>"已询问所选文本",MK=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",RK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TK():t==="fa"?MK():AK()}),DK=()=>"Attachment",LK=()=>"附件",OK=()=>"پیوست",IK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LK():t==="fa"?OK():DK()}),BK=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,$K=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,HK=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,PK=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$K(e):t==="fa"?HK(e):BK(e)}),FK=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",UK=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",qK=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",GK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UK():t==="fa"?qK():FK()}),VK=()=>"Wait for the turn to finish before running a command.",WK=()=>"请等待本轮结束后再运行命令。",KK=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",YK=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WK():t==="fa"?KK():VK()}),XK=e=>`Exited with code ${e==null?void 0:e.code}`,ZK=e=>`退出码 ${e==null?void 0:e.code}`,QK=e=>`با کد ${e==null?void 0:e.code} خارج شد`,JK=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ZK(e):t==="fa"?QK(e):XK(e)}),eY=e=>`Command not run: ${e==null?void 0:e.error}`,tY=e=>`命令未运行:${e==null?void 0:e.error}`,nY=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,s7=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?tY(e):t==="fa"?nY(e):eY(e)}),rY=()=>"Collapse tool activity",sY=()=>"折叠工具活动",iY=()=>"بستن فعالیت ابزارها",aY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sY():t==="fa"?iY():rY()}),oY=()=>"Continue",lY=()=>"继续",cY=()=>"ادامه",uY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lY():t==="fa"?cY():oY()}),dY=e=>`Delete “${e==null?void 0:e.title}”? - -Its transcript will be permanently removed.`,fY=e=>`删除“${e==null?void 0:e.title}”? - -其对话记录将被永久移除。`,hY=e=>`«${e==null?void 0:e.title}» حذف شود؟ - -رونوشت آن برای همیشه حذف خواهد شد.`,_Y=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fY(e):t==="fa"?hY(e):dY(e)}),pY=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,mY=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,gY=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,bY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?mY(e):t==="fa"?gY(e):pY(e)}),vY=()=>"Could not exit Plan mode. Try again.",xY=()=>"无法退出计划模式。请重试。",yY=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",wY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xY():t==="fa"?yY():vY()}),SY=()=>"Expand tool activity",kY=()=>"展开工具活动",CY=()=>"باز کردن فعالیت ابزارها",EY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kY():t==="fa"?CY():SY()}),NY=()=>"experiments",zY=()=>"实验",jY=()=>"آزمایش‌ها",AY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zY():t==="fa"?jY():NY()}),TY=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,MY=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,RY=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,DY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MY(e):t==="fa"?RY(e):TY(e)}),LY=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,OY=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,IY=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,BY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OY(e):t==="fa"?IY(e):LY(e)}),$Y=e=>`Message not sent: ${e==null?void 0:e.error}`,HY=e=>`消息未发送:${e==null?void 0:e.error}`,PY=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,FY=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HY(e):t==="fa"?PY(e):$Y(e)}),UY=()=>"New session",qY=()=>"新会话",GY=()=>"نشست جدید",i7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qY():t==="fa"?GY():UY()}),VY=()=>"No active sessions",WY=()=>"没有活跃会话",KY=()=>"نشست فعالی وجود ندارد",YY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WY():t==="fa"?KY():VY()}),XY=()=>"No activity",ZY=()=>"无活动",QY=()=>"بدون فعالیت",JY=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZY():t==="fa"?QY():XY()}),eX=()=>"No archived sessions",tX=()=>"没有已归档的会话",nX=()=>"نشست بایگانی‌شده‌ای وجود ندارد",rX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tX():t==="fa"?nX():eX()}),sX=()=>"No sessions yet",iX=()=>"还没有会话",aX=()=>"هنوز نشستی وجود ندارد",oX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iX():t==="fa"?aX():sX()}),lX=()=>"1 annotation",cX=()=>"1 条批注",uX=()=>"۱ یادداشت",dX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cX():t==="fa"?uX():lX()}),fX=()=>"Open sub-agent transcript",hX=()=>"打开子智能体记录",_X=()=>"باز کردن متن گفت‌وگوی عامل فرعی",pX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hX():t==="fa"?_X():fX()}),mX=()=>"About this demo",gX=()=>"关于此演示",bX=()=>"دربارهٔ این نسخهٔ نمایشی",a7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gX():t==="fa"?bX():mX()}),vX=()=>"Accept and auto mode",xX=()=>"接受并使用自动模式",yX=()=>"پذیرش و حالت خودکار",wX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xX():t==="fa"?yX():vX()}),SX=()=>"Accept and bypass all",kX=()=>"接受并跳过所有审批",CX=()=>"پذیرش و عبور از همهٔ تأییدها",EX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kX():t==="fa"?CX():SX()}),NX=()=>"Active",zX=()=>"活跃",jX=()=>"فعال",AX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zX():t==="fa"?jX():NX()}),TX=()=>"All",MX=()=>"全部",RX=()=>"همه",DX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MX():t==="fa"?RX():TX()}),LX=()=>"Allow",OX=()=>"允许",IX=()=>"اجازه دادن",BX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OX():t==="fa"?IX():LX()}),$X=()=>"Approval required",HX=()=>"需要批准",PX=()=>"نیازمند تأیید",FX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HX():t==="fa"?PX():$X()}),UX=()=>"Archived",qX=()=>"已归档",GX=()=>"بایگانی‌شده",o7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qX():t==="fa"?GX():UX()}),VX=()=>"Artifacts",WX=()=>"产物",KX=()=>"خروجی‌ها",YX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WX():t==="fa"?KX():VX()}),XX=()=>"Ask about this",ZX=()=>"询问此内容",QX=()=>"دربارهٔ این بپرسید",JX=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZX():t==="fa"?QX():XX()}),eZ=()=>"Attach a PDF or image",tZ=()=>"附加 PDF 或图片",nZ=()=>"پیوست PDF یا تصویر",l7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tZ():t==="fa"?nZ():eZ()}),rZ=()=>"Bash",sZ=()=>"Bash",iZ=()=>"Bash",WE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sZ():t==="fa"?iZ():rZ()}),aZ=()=>"Browsed the web",oZ=()=>"已浏览网页",lZ=()=>"وب مرور شد",c7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oZ():t==="fa"?lZ():aZ()}),cZ=()=>"Built the project",uZ=()=>"已构建项目",dZ=()=>"پروژه ساخته شد",fZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uZ():t==="fa"?dZ():cZ()}),hZ=()=>"Cancel",_Z=()=>"取消",pZ=()=>"لغو",mZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Z():t==="fa"?pZ():hZ()}),gZ=()=>"Cancelled an experiment run",bZ=()=>"已取消实验运行",vZ=()=>"اجرای آزمایش لغو شد",xZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bZ():t==="fa"?vZ():gZ()}),yZ=()=>"Checked code style",wZ=()=>"已检查代码风格",SZ=()=>"سبک کد بررسی شد",kZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wZ():t==="fa"?SZ():yZ()}),CZ=()=>"Checked compute options",EZ=()=>"已检查算力选项",NZ=()=>"گزینه‌های رایانشی بررسی شد",zZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EZ():t==="fa"?NZ():CZ()}),jZ=()=>"Checked experiment status",AZ=()=>"已检查实验状态",TZ=()=>"وضعیت آزمایش بررسی شد",u7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AZ():t==="fa"?TZ():jZ()}),MZ=()=>"Checked Git status",RZ=()=>"已检查 Git 状态",DZ=()=>"وضعیت Git بررسی شد",LZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RZ():t==="fa"?DZ():MZ()}),OZ=()=>"Checked local times",IZ=()=>"已查询当地时间",BZ=()=>"زمان‌های محلی بررسی شد",$Z=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IZ():t==="fa"?BZ():OZ()}),HZ=()=>"Checked market data",PZ=()=>"已查询市场数据",FZ=()=>"داده‌های بازار بررسی شد",UZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PZ():t==="fa"?FZ():HZ()}),qZ=()=>"Checked sports data",GZ=()=>"已查询体育数据",VZ=()=>"داده‌های ورزشی بررسی شد",WZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GZ():t==="fa"?VZ():qZ()}),KZ=()=>"Checked the weather",YZ=()=>"已查询天气",XZ=()=>"آب‌وهوا بررسی شد",ZZ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YZ():t==="fa"?XZ():KZ()}),QZ=()=>"Checked types",JZ=()=>"已检查类型",eQ=()=>"نوع‌ها بررسی شد",tQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JZ():t==="fa"?eQ():QZ()}),nQ=()=>"Clear annotations",rQ=()=>"清除批注",sQ=()=>"پاک کردن یادداشت‌ها",d7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rQ():t==="fa"?sQ():nQ()}),iQ=()=>"Customize",aQ=()=>"自定义",oQ=()=>"سفارشی‌سازی",lQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aQ():t==="fa"?oQ():iQ()}),cQ=()=>"Data sources",uQ=()=>"数据源",dQ=()=>"منابع داده",fb=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uQ():t==="fa"?dQ():cQ()}),fQ=()=>"Delegated a task to a new agent",hQ=()=>"已将任务委派给新智能体",_Q=()=>"وظیفه به عامل جدید واگذار شد",pQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hQ():t==="fa"?_Q():fQ()}),mQ=()=>"Delete",gQ=()=>"删除",bQ=()=>"حذف",KE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gQ():t==="fa"?bQ():mQ()}),vQ=()=>"Deny",xQ=()=>"拒绝",yQ=()=>"رد کردن",wQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xQ():t==="fa"?yQ():vQ()}),SQ=()=>"Edit and re-send",kQ=()=>"编辑并重新发送",CQ=()=>"ویرایش و ارسال دوباره",f7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kQ():t==="fa"?CQ():SQ()}),EQ=()=>"Edit message",NQ=()=>"编辑消息",zQ=()=>"ویرایش پیام",jQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NQ():t==="fa"?zQ():EQ()}),AQ=()=>"Edited a file",TQ=()=>"已编辑文件",MQ=()=>"فایل ویرایش شد",h7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TQ():t==="fa"?MQ():AQ()}),RQ=()=>"Exit Bash mode",DQ=()=>"退出 Bash 模式",LQ=()=>"خروج از حالت Bash",_7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DQ():t==="fa"?LQ():RQ()}),OQ=()=>"Exit Plan mode",IQ=()=>"退出计划模式",BQ=()=>"خروج از حالت طرح",p7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IQ():t==="fa"?BQ():OQ()}),$Q=()=>"Experiments",HQ=()=>"实验",PQ=()=>"آزمایش‌ها",FQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HQ():t==="fa"?PQ():$Q()}),UQ=()=>"Failed:",qQ=()=>"失败:",GQ=()=>"ناموفق:",Fx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qQ():t==="fa"?GQ():UQ()}),VQ=()=>"Files",WQ=()=>"文件",KQ=()=>"فایل‌ها",YQ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WQ():t==="fa"?KQ():VQ()}),XQ=()=>"Filter sessions",ZQ=()=>"筛选会话",QQ=()=>"فیلتر نشست‌ها",m7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZQ():t==="fa"?QQ():XQ()}),JQ=()=>"is unavailable.",eJ=()=>"不可用。",tJ=()=>"در دسترس نیست.",nJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eJ():t==="fa"?tJ():JQ()}),rJ=()=>"Later queued messages will wait until this is retried or removed.",sJ=()=>"后续排队的消息会等待此消息重试或移除。",iJ=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",aJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sJ():t==="fa"?iJ():rJ()}),oJ=()=>"Listed files",lJ=()=>"已列出文件",cJ=()=>"فایل‌ها فهرست شد",g7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lJ():t==="fa"?cJ():oJ()}),uJ=()=>"Listed project runs",dJ=()=>"已列出项目运行",fJ=()=>"اجراهای پروژه فهرست شد",hJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dJ():t==="fa"?fJ():uJ()}),_J=()=>"Listed projects",pJ=()=>"已列出项目",mJ=()=>"پروژه‌ها فهرست شد",gJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pJ():t==="fa"?mJ():_J()}),bJ=()=>"Loading conversation…",vJ=()=>"正在加载对话…",xJ=()=>"در حال بارگیری گفتگو…",yJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vJ():t==="fa"?xJ():bJ()}),wJ=()=>"Next version",SJ=()=>"下一版本",kJ=()=>"نسخهٔ بعدی",b7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SJ():t==="fa"?kJ():wJ()}),CJ=()=>"Open the session this agent spawned",EJ=()=>"打开此智能体创建的会话",NJ=()=>"باز کردن نشست ساخته‌شده توسط این عامل",zJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EJ():t==="fa"?NJ():CJ()}),jJ=()=>"Opened web pages",AJ=()=>"已打开网页",TJ=()=>"صفحه‌های وب باز شد",MJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AJ():t==="fa"?TJ():jJ()}),RJ=()=>"Plan",DJ=()=>"计划",LJ=()=>"طرح",OJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DJ():t==="fa"?LJ():RJ()}),IJ=()=>"Plan approved",BJ=()=>"计划已批准",$J=()=>"طرح تأیید شد",HJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BJ():t==="fa"?$J():IJ()}),PJ=()=>"Plan rejected",FJ=()=>"计划已拒绝",UJ=()=>"طرح رد شد",qJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FJ():t==="fa"?UJ():PJ()}),GJ=()=>"Plan resolved",VJ=()=>"计划已处理",WJ=()=>"طرح تعیین تکلیف شد",KJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VJ():t==="fa"?WJ():GJ()}),YJ=()=>"Plan revision requested",XJ=()=>"已请求修改计划",ZJ=()=>"درخواست بازنگری طرح ثبت شد",QJ=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XJ():t==="fa"?ZJ():YJ()}),JJ=()=>"Previous version",eee=()=>"上一版本",tee=()=>"نسخهٔ قبلی",v7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eee():t==="fa"?tee():JJ()}),nee=()=>"Ran a command",ree=()=>"已运行命令",see=()=>"فرمان اجرا شد",iee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ree():t==="fa"?see():nee()}),aee=()=>"Ran tests",oee=()=>"已运行测试",lee=()=>"آزمون‌ها اجرا شد",cee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oee():t==="fa"?lee():aee()}),uee=()=>"Read a file",dee=()=>"已读取文件",fee=()=>"فایل خوانده شد",hee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dee():t==="fa"?fee():uee()}),_ee=()=>"Read Git history",pee=()=>"已读取 Git 历史",mee=()=>"تاریخچهٔ Git خوانده شد",gee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pee():t==="fa"?mee():_ee()}),bee=()=>"Read project details",vee=()=>"已读取项目详情",xee=()=>"جزئیات پروژه خوانده شد",yee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vee():t==="fa"?xee():bee()}),wee=()=>"Reject",See=()=>"拒绝",kee=()=>"رد کردن",Cee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?See():t==="fa"?kee():wee()}),Eee=()=>"Remove",Nee=()=>"移除",zee=()=>"حذف",jee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nee():t==="fa"?zee():Eee()}),Aee=()=>"Remove annotation",Tee=()=>"移除批注",Mee=()=>"حذف یادداشت",Ree=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tee():t==="fa"?Mee():Aee()}),Dee=()=>"Remove file",Lee=()=>"移除文件",Oee=()=>"حذف فایل",x7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lee():t==="fa"?Oee():Dee()}),Iee=()=>"Remove image",Bee=()=>"移除图片",$ee=()=>"حذف تصویر",y7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bee():t==="fa"?$ee():Iee()}),Hee=()=>"Remove queued message",Pee=()=>"移除排队消息",Fee=()=>"حذف پیام صف",w7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pee():t==="fa"?Fee():Hee()}),Uee=()=>"Rename",qee=()=>"重命名",Gee=()=>"تغییر نام",YE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qee():t==="fa"?Gee():Uee()}),Vee=()=>"Reviewed code changes",Wee=()=>"已审查代码更改",Kee=()=>"تغییرات کد بازبینی شد",Yee=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wee():t==="fa"?Kee():Vee()}),Xee=()=>"Run",Zee=()=>"运行",Qee=()=>"اجرا",S7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zee():t==="fa"?Qee():Xee()}),Jee=()=>"Selected chat text",ete=()=>"已选聊天文本",tte=()=>"متن انتخاب‌شدهٔ گفتگو",nte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ete():t==="fa"?tte():Jee()}),rte=()=>"Selected text:",ste=()=>"已选文本:",ite=()=>"متن انتخاب‌شده:",ate=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ste():t==="fa"?ite():rte()}),ote=()=>"Send",lte=()=>"发送",cte=()=>"ارسال",Gv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lte():t==="fa"?cte():ote()}),ute=()=>"Session options",dte=()=>"会话选项",fte=()=>"گزینه‌های نشست",k7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dte():t==="fa"?fte():ute()}),hte=()=>"Session title",_te=()=>"会话标题",pte=()=>"عنوان نشست",mte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_te():t==="fa"?pte():hte()}),gte=()=>"Show sidebar",bte=()=>"显示侧边栏",vte=()=>"نمایش نوار کناری",C7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bte():t==="fa"?vte():gte()}),xte=()=>"Started an experiment run",yte=()=>"已启动实验运行",wte=()=>"اجرای آزمایش آغاز شد",Ste=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yte():t==="fa"?wte():xte()}),kte=()=>"Reading the project to suggest where to start…",Cte=()=>"正在阅读项目以建议从哪里开始…",Ete=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",Nte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cte():t==="fa"?Ete():kte()}),zte=()=>"Starter prompts",jte=()=>"入门提示",Ate=()=>"پیشنهادهای شروع",Tte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jte():t==="fa"?Ate():zte()}),Mte=()=>"Stop",Rte=()=>"停止",Dte=()=>"توقف",E7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rte():t==="fa"?Dte():Mte()}),Lte=()=>"Submit",Ote=()=>"提交",Ite=()=>"ارسال",Bte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ote():t==="fa"?Ite():Lte()}),$te=()=>"Task",Hte=()=>"任务",Pte=()=>"وظیفه",Fte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hte():t==="fa"?Pte():$te()}),Ute=()=>"Tool failed",qte=()=>"工具失败",Gte=()=>"ابزار ناموفق بود",Vte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qte():t==="fa"?Gte():Ute()}),Wte=()=>"Used tools",Kte=()=>"已使用工具",Yte=()=>"ابزارها استفاده شد",XE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kte():t==="fa"?Yte():Wte()}),Xte=()=>"View full plan",Zte=()=>"查看完整计划",Qte=()=>"مشاهدهٔ طرح کامل",Jte=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zte():t==="fa"?Qte():Xte()}),ene=()=>"Waited for an experiment run",tne=()=>"已等待实验运行",nne=()=>"برای اجرای آزمایش صبر شد",rne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tne():t==="fa"?nne():ene()}),sne=()=>"Waiting for your input…",ine=()=>"正在等待你的输入…",ane=()=>"منتظر ورودی شما…",one=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ine():t==="fa"?ane():sne()}),lne=()=>"What should we research?",cne=()=>"我们应该研究什么?",une=()=>"چه چیزی را پژوهش کنیم؟",dne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cne():t==="fa"?une():lne()}),fne=()=>"You, mid-task",hne=()=>"你(任务进行中)",_ne=()=>"شما، هنگام انجام وظیفه",pne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hne():t==="fa"?_ne():fne()}),mne=()=>"Pasted image",gne=()=>"粘贴的图片",bne=()=>"تصویر جای‌گذاری‌شده",vne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gne():t==="fa"?bne():mne()}),xne=()=>"Plan",yne=()=>"计划",wne=()=>"طرح",ZE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yne():t==="fa"?wne():xne()}),Sne=()=>"Plan mode — ready to proceed?",kne=()=>"计划模式 — 准备好继续了吗?",Cne=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Ene=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kne():t==="fa"?Cne():Sne()}),Nne=()=>"Proposed plan",zne=()=>"提议的计划",jne=()=>"طرح پیشنهادی",N7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zne():t==="fa"?jne():Nne()}),Ane=()=>"Question",Tne=()=>"问题",Mne=()=>"پرسش",Rne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tne():t==="fa"?Mne():Ane()}),Dne=()=>"Queued",Lne=()=>"已排队",One=()=>"در صف",Ine=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lne():t==="fa"?One():Dne()}),Bne=()=>"Recents",$ne=()=>"最近",Hne=()=>"اخیر",QE=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ne():t==="fa"?Hne():Bne()}),Pne=()=>"Re-check its setup.",Fne=()=>"请重新检查其设置。",Une=()=>"راه‌اندازی آن را دوباره بررسی کنید.",qne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fne():t==="fa"?Une():Pne()}),Gne=()=>"Could not recover this turn. Try again.",Vne=()=>"无法恢复本轮。请重试。",Wne=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",Kne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vne():t==="fa"?Wne():Gne()}),Yne=()=>"Could not remove the queued message. Try again.",Xne=()=>"无法移除排队消息。请重试。",Zne=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",Qne=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xne():t==="fa"?Zne():Yne()}),Jne=e=>`Could not re-send: ${e==null?void 0:e.error}`,ere=e=>`无法重新发送:${e==null?void 0:e.error}`,tre=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,nre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ere(e):t==="fa"?tre(e):Jne(e)}),rre=()=>"Resolved",sre=()=>"已处理",ire=()=>"رسیدگی شد",are=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sre():t==="fa"?ire():rre()}),ore=()=>"Could not retry the queued message. Try again.",lre=()=>"无法重试排队消息。请重试。",cre=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",ure=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lre():t==="fa"?cre():ore()}),dre=()=>"run logs",fre=()=>"运行日志",hre=()=>"گزارش‌های اجرا",_re=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fre():t==="fa"?hre():dre()}),pre=()=>"Scroll to bottom",mre=()=>"滚动到底部",gre=()=>"رفتن به پایین گفتگو",z7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mre():t==="fa"?gre():pre()}),bre=()=>"The selected harness is unavailable",vre=()=>"所选智能体工具不可用",xre=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",hb=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vre():t==="fa"?xre():bre()}),yre=()=>"The chat session was not created",wre=()=>"未能创建聊天会话",Sre=()=>"نشست گفت‌وگو ایجاد نشد",kre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wre():t==="fa"?Sre():yre()}),Cre=()=>" · Spawned by another agent",Ere=()=>" · 由另一个智能体创建",Nre=()=>" · ساخته‌شده به‌دست عامل دیگر",zre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ere():t==="fa"?Nre():Cre()}),jre=()=>"Starting…",Are=()=>"正在启动…",Tre=()=>"در حال شروع…",Mre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Are():t==="fa"?Tre():jre()}),Rre=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,Dre=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,Lre=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,Ore=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Dre(e):t==="fa"?Lre(e):Rre(e)}),Ire=()=>"Could not stop the turn. Try again.",Bre=()=>"无法停止本轮。请重试。",$re=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",Hre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bre():t==="fa"?$re():Ire()}),Pre=e=>`Could not switch fork: ${e==null?void 0:e.error}`,Fre=e=>`无法切换分支:${e==null?void 0:e.error}`,Ure=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,qre=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Fre(e):t==="fa"?Ure(e):Pre(e)}),Gre=()=>"The agent",Vre=()=>"智能体",Wre=()=>"عامل",Kre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vre():t==="fa"?Wre():Gre()}),Yre=()=>"Thinking",Xre=()=>"正在思考",Zre=()=>"در حال فکر کردن",Qre=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xre():t==="fa"?Zre():Yre()}),Jre=()=>"Could not toggle Plan mode. Try again.",ese=()=>"无法切换计划模式。请重试。",tse=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",j7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ese():t==="fa"?tse():Jre()}),nse=()=>"This turn did not finish.",rse=()=>"本轮未完成。",sse=()=>"این نوبت کامل نشد.",ise=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rse():t==="fa"?sse():nse()}),ase=()=>"Type a custom answer…",ose=()=>"输入自定义回答…",lse=()=>"پاسخ دلخواه را بنویسید…",cse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ose():t==="fa"?lse():ase()}),use=()=>"Unarchive",dse=()=>"取消归档",fse=()=>"خارج کردن از بایگانی",hse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dse():t==="fa"?fse():use()}),_se=()=>"Untitled",pse=()=>"未命名",mse=()=>"بدون عنوان",_b=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pse():t==="fa"?mse():_se()}),gse=()=>"Could not update permissions. Try again.",bse=()=>"无法更新权限。请重试。",vse=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",xse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bse():t==="fa"?vse():gse()}),yse=()=>"Working…",wse=()=>"正在工作…",Sse=()=>"در حال کار…",Ux=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wse():t==="fa"?Sse():yse()}),kse=()=>"Close tab",Cse=()=>"关闭标签页",Ese=()=>"بستن زبانه",Nse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cse():t==="fa"?Ese():kse()}),zse=()=>"Changes",jse=()=>"更改",Ase=()=>"تغییرات",Tse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jse():t==="fa"?Ase():zse()}),Mse=()=>"Code browser view",Rse=()=>"代码浏览器视图",Dse=()=>"نمای مرورگر کد",Lse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rse():t==="fa"?Dse():Mse()}),Ose=()=>"Files",Ise=()=>"文件",Bse=()=>"فایل‌ها",$se=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ise():t==="fa"?Bse():Ose()}),Hse=()=>"Refresh",Pse=()=>"刷新",Fse=()=>"تازه‌سازی",A7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pse():t==="fa"?Fse():Hse()}),Use=()=>"listing truncated",qse=()=>"列表已截断",Gse=()=>"فهرست کوتاه شده است",Vse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qse():t==="fa"?Gse():Use()}),Wse=()=>"No files.",Kse=()=>"没有文件。",Yse=()=>"فایلی وجود ندارد.",Xse=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kse():t==="fa"?Yse():Wse()}),Zse=()=>"Refresh failed:",Qse=()=>"刷新失败:",Jse=()=>"تازه‌سازی ناموفق بود:",eie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qse():t==="fa"?Jse():Zse()}),tie=()=>"Cancelling…",nie=()=>"正在取消…",rie=()=>"در حال لغو…",sie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nie():t==="fa"?rie():tie()}),iie=()=>"Checking…",aie=()=>"正在检查…",oie=()=>"در حال بررسی…",la=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aie():t==="fa"?oie():iie()}),lie=()=>"Copied",cie=()=>"已复制",uie=()=>"کپی شد",nh=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cie():t==="fa"?uie():lie()}),die=e=>`Failed to load: ${e==null?void 0:e.error}`,fie=e=>`加载失败:${e==null?void 0:e.error}`,hie=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,JE=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fie(e):t==="fa"?hie(e):die(e)}),_ie=()=>"Loading…",pie=()=>"正在加载…",mie=()=>"در حال بارگیری…",eN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pie():t==="fa"?mie():_ie()}),gie=e=>`+ ${e==null?void 0:e.count} more`,bie=e=>`另有 ${e==null?void 0:e.count} 项`,vie=e=>`${e==null?void 0:e.count}+ مورد دیگر`,xie=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bie(e):t==="fa"?vie(e):gie(e)}),yie=()=>"Rendered view",wie=()=>"渲染视图",Sie=()=>"نمای رندرشده",wp=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wie():t==="fa"?Sie():yie()}),kie=()=>"Save",Cie=()=>"保存",Eie=()=>"ذخیره",Fa=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cie():t==="fa"?Eie():kie()}),Nie=()=>"Saving…",zie=()=>"正在保存…",jie=()=>"در حال ذخیره…",qi=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zie():t==="fa"?jie():Nie()}),Aie=()=>"Show less",Tie=()=>"收起",Mie=()=>"نمایش کمتر",tN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tie():t==="fa"?Mie():Aie()}),Rie=()=>"Show more",Die=()=>"展开",Lie=()=>"نمایش بیشتر",Oie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Die():t==="fa"?Lie():Rie()}),Iie=()=>"Stop",Bie=()=>"停止",$ie=()=>"توقف",nN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bie():t==="fa"?$ie():Iie()}),Hie=()=>"Stopping…",Pie=()=>"正在停止…",Fie=()=>"در حال توقف…",Uie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pie():t==="fa"?Fie():Hie()}),qie=()=>"View source",Gie=()=>"查看源代码",Vie=()=>"نمایش متن منبع",Fu=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gie():t==="fa"?Vie():qie()}),Wie=()=>"Runs as a remote Hugging Face Job",Kie=()=>"作为远程 Hugging Face Job 运行",Yie=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",Xie=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kie():t==="fa"?Yie():Wie()}),Zie=()=>"Runs as a Job on your Kubernetes cluster",Qie=()=>"作为 Kubernetes 集群上的 Job 运行",Jie=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",eae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qie():t==="fa"?Jie():Zie()}),tae=()=>"Runs directly on this computer",nae=()=>"直接在此计算机上运行",rae=()=>"مستقیماً روی این رایانه اجرا می‌شود",sae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nae():t==="fa"?rae():tae()}),iae=()=>"Runs in a remote Modal sandbox",aae=()=>"在远程 Modal 沙箱中运行",oae=()=>"در sandbox دوردست Modal اجرا می‌شود",lae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aae():t==="fa"?oae():iae()}),cae=()=>"Runs on an ephemeral OpenResearch box",uae=()=>"在临时 OpenResearch 主机上运行",dae=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",fae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uae():t==="fa"?dae():cae()}),hae=()=>"Runs on the connected Ray cluster",_ae=()=>"在已连接的 Ray 集群上运行",pae=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",mae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ae():t==="fa"?pae():hae()}),gae=()=>"Runs as a scheduled job on your Slurm cluster",bae=()=>"作为 Slurm 集群上的调度作业运行",vae=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",xae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bae():t==="fa"?vae():gae()}),yae=()=>"Runs on a host from your SSH config",wae=()=>"在 SSH 配置中的主机上运行",Sae=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",kae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wae():t==="fa"?Sae():yae()}),Cae=()=>"Runs through Tinker’s remote compute",Eae=()=>"通过 Tinker 远程算力运行",Nae=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",zae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eae():t==="fa"?Nae():Cae()}),jae=()=>"HF Jobs",Aae=()=>"HF Jobs",Tae=()=>"HF Jobs",Mae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aae():t==="fa"?Tae():jae()}),Rae=()=>"Kubernetes",Dae=()=>"Kubernetes",Lae=()=>"Kubernetes",Oae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dae():t==="fa"?Lae():Rae()}),Iae=()=>"This machine",Bae=()=>"此计算机",$ae=()=>"این رایانه",rN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bae():t==="fa"?$ae():Iae()}),Hae=()=>"Modal",Pae=()=>"Modal",Fae=()=>"Modal",Uae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pae():t==="fa"?Fae():Hae()}),qae=()=>"OpenResearch",Gae=()=>"OpenResearch",Vae=()=>"OpenResearch",Wae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gae():t==="fa"?Vae():qae()}),Kae=()=>"Ray",Yae=()=>"Ray",Xae=()=>"Ray",Zae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yae():t==="fa"?Xae():Kae()}),Qae=()=>"Slurm",Jae=()=>"Slurm",eoe=()=>"Slurm",toe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jae():t==="fa"?eoe():Qae()}),noe=()=>"SSH",roe=()=>"SSH",soe=()=>"SSH",ioe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?roe():t==="fa"?soe():noe()}),aoe=()=>"Tinker",ooe=()=>"Tinker",loe=()=>"Tinker",coe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ooe():t==="fa"?loe():aoe()}),uoe=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",doe=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",foe=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",hoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?doe():t==="fa"?foe():uoe()}),_oe=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",poe=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",moe=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",goe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?poe():t==="fa"?moe():_oe()}),boe=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",voe=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",xoe=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",yoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?voe():t==="fa"?xoe():boe()}),woe=()=>"This computer must stay awake and online while Tinker runs.",Soe=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",koe=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",Coe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Soe():t==="fa"?koe():woe()}),Eoe=()=>"Context window",Noe=()=>"上下文窗口",zoe=()=>"پنجرهٔ زمینه",joe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Noe():t==="fa"?zoe():Eoe()}),Aoe=()=>"Context window used",Toe=()=>"已使用的上下文窗口",Moe=()=>"پنجرهٔ زمینهٔ استفاده‌شده",Roe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Toe():t==="fa"?Moe():Aoe()}),Doe=e=>`${e==null?void 0:e.value} tokens`,Loe=e=>`${e==null?void 0:e.value} 个 token`,Ooe=e=>`${e==null?void 0:e.value} توکن`,Ioe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Loe(e):t==="fa"?Ooe(e):Doe(e)}),Boe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,$oe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,Hoe=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,Poe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$oe(e):t==="fa"?Hoe(e):Boe(e)}),Foe=()=>"No runs yet — ask the agent to launch one.",Uoe=()=>"尚无运行——让智能体启动一个。",qoe=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",Goe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uoe():t==="fa"?qoe():Foe()}),Voe=()=>"Run",Woe=()=>"运行",Koe=()=>"اجرا",T7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Woe():t==="fa"?Koe():Voe()}),Yoe=()=>"Switch run",Xoe=()=>"切换运行",Zoe=()=>"تغییر اجرا",Qoe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xoe():t==="fa"?Zoe():Yoe()}),Joe=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,ele=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,tle=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,nle=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ele(e):t==="fa"?tle(e):Joe(e)}),rle=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,sle=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,ile=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,ale=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sle(e):t==="fa"?ile(e):rle(e)}),ole=e=>`${e==null?void 0:e.value}m`,lle=e=>`${e==null?void 0:e.value} 分钟`,cle=e=>`${e==null?void 0:e.value} دقیقه`,ule=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?lle(e):t==="fa"?cle(e):ole(e)}),dle=e=>`${e==null?void 0:e.value}s`,fle=e=>`${e==null?void 0:e.value} 秒`,hle=e=>`${e==null?void 0:e.value} ثانیه`,_le=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?fle(e):t==="fa"?hle(e):dle(e)}),ple=()=>"Code",mle=()=>"代码",gle=()=>"کد",ble=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mle():t==="fa"?gle():ple()}),vle=()=>"created",xle=()=>"创建于",yle=()=>"ایجادشده",wle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xle():t==="fa"?yle():vle()}),Sle=()=>"from",kle=()=>"来自",Cle=()=>"از",Ele=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kle():t==="fa"?Cle():Sle()}),Nle=()=>"Logs",zle=()=>"日志",jle=()=>"گزارش‌ها",Ale=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zle():t==="fa"?jle():Nle()}),Tle=()=>"Latest run",Mle=()=>"最新运行",Rle=()=>"آخرین اجرا",Dle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mle():t==="fa"?Rle():Tle()}),Lle=()=>"Code",Ole=()=>"代码",Ile=()=>"کد",Ble=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ole():t==="fa"?Ile():Lle()}),$le=()=>"Commit",Hle=()=>"提交",Ple=()=>"کامیت",Fle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hle():t==="fa"?Ple():$le()}),Ule=()=>"created",qle=()=>"创建于",Gle=()=>"ایجادشده",Vle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qle():t==="fa"?Gle():Ule()}),Wle=()=>"Description",Kle=()=>"说明",Yle=()=>"توضیحات",Xle=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kle():t==="fa"?Yle():Wle()}),Zle=()=>"Duration",Qle=()=>"时长",Jle=()=>"مدت",ece=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qle():t==="fa"?Jle():Zle()}),tce=()=>"exit",nce=()=>"退出码",rce=()=>"خروج",sce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nce():t==="fa"?rce():tce()}),ice=()=>"from",ace=()=>"来自",oce=()=>"از",lce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ace():t==="fa"?oce():ice()}),cce=()=>"Logs",uce=()=>"日志",dce=()=>"گزارش‌ها",fce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uce():t==="fa"?dce():cce()}),hce=()=>"Run",_ce=()=>"运行",pce=()=>"اجرا",mce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ce():t==="fa"?pce():hce()}),gce=()=>"Run history",bce=()=>"运行历史",vce=()=>"تاریخچهٔ اجرا",xce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bce():t==="fa"?vce():gce()}),yce=()=>"Started",wce=()=>"开始时间",Sce=()=>"آغاز",kce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wce():t==="fa"?Sce():yce()}),Cce=()=>"Runs",Ece=()=>"运行",Nce=()=>"اجراها",zce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ece():t==="fa"?Nce():Cce()}),jce=()=>"No runs yet",Ace=()=>"还没有运行",Tce=()=>"هنوز اجرایی وجود ندارد",Mce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ace():t==="fa"?Tce():jce()}),Rce=()=>"No experiments yet.",Dce=()=>"还没有实验。",Lce=()=>"هنوز آزمایشی وجود ندارد.",Oce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dce():t==="fa"?Lce():Rce()}),Ice=()=>"Not run yet",Bce=()=>"尚未运行",$ce=()=>"هنوز اجرا نشده",Hce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bce():t==="fa"?$ce():Ice()}),Pce=()=>"1 run",Fce=()=>"1 次运行",Uce=()=>"۱ اجرا",qce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fce():t==="fa"?Uce():Pce()}),Gce=()=>"Open logs",Vce=()=>"打开日志",Wce=()=>"باز کردن گزارش‌ها",Kce=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vce():t==="fa"?Wce():Gce()}),Yce=e=>`${e==null?void 0:e.count} runs`,Xce=e=>`${e==null?void 0:e.count} 次运行`,Zce=e=>`${e==null?void 0:e.count} اجرا`,Qce=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xce(e):t==="fa"?Zce(e):Yce(e)}),Jce=()=>"Stop requested",eue=()=>"已请求停止",tue=()=>"درخواست توقف ثبت شد",nue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eue():t==="fa"?tue():Jce()}),rue=()=>"Stop run",sue=()=>"停止运行",iue=()=>"توقف اجرا",aue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sue():t==="fa"?iue():rue()}),oue=()=>"Code",lue=()=>"代码",cue=()=>"کد",uue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lue():t==="fa"?cue():oue()}),due=()=>"Experiments",fue=()=>"实验",hue=()=>"آزمایش‌ها",_ue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fue():t==="fa"?hue():due()}),pue=()=>"Logs",mue=()=>"日志",gue=()=>"گزارش‌ها",bue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mue():t==="fa"?gue():pue()}),vue=()=>"Stop failed:",xue=()=>"停止失败:",yue=()=>"توقف ناموفق بود:",wue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xue():t==="fa"?yue():vue()}),Sue=()=>"Clipboard access is unavailable.",kue=()=>"无法访问剪贴板。",Cue=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",Eue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kue():t==="fa"?Cue():Sue()}),Nue=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,zue=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,jue=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,Aue=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zue(e):t==="fa"?jue(e):Nue(e)}),Tue=()=>"Duplicate",Mue=()=>"创建副本",Rue=()=>"ایجاد نسخهٔ تکراری",Due=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mue():t==="fa"?Rue():Tue()}),Lue=e=>`File actions for ${e==null?void 0:e.path}`,Oue=e=>`${e==null?void 0:e.path} 的文件操作`,Iue=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,Bue=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Oue(e):t==="fa"?Iue(e):Lue(e)}),$ue=()=>"Open",Hue=()=>"打开",Pue=()=>"باز کردن",Fue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hue():t==="fa"?Pue():$ue()}),Uue=e=>`Rename ${e==null?void 0:e.path}`,que=e=>`重命名 ${e==null?void 0:e.path}`,Gue=e=>`تغییر نام ${e==null?void 0:e.path}`,Vue=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?que(e):t==="fa"?Gue(e):Uue(e)}),Wue=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,Kue=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,Yue=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,Xue=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Kue(e):t==="fa"?Yue(e):Wue(e)}),Zue=()=>"Binary file — no inline preview.",Que=()=>"二进制文件——无法内嵌预览。",Jue=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",ede=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Que():t==="fa"?Jue():Zue()}),tde=()=>"This file changed on disk. Your edits have not been overwritten.",nde=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",rde=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",M7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nde():t==="fa"?rde():tde()}),sde=()=>"Compile failed",ide=()=>"编译失败",ade=()=>"کامپایل ناموفق بود",ode=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ide():t==="fa"?ade():sde()}),lde=()=>"Compile PDF",cde=()=>"编译 PDF",ude=()=>"کامپایل PDF",R7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cde():t==="fa"?ude():lde()}),dde=()=>"Compiled, but the engine reported errors — check the output below.",fde=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",hde=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",_de=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fde():t==="fa"?hde():dde()}),pde=()=>"Copy command",mde=()=>"复制命令",gde=()=>"کپی فرمان",bde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mde():t==="fa"?gde():pde()}),vde=()=>"Copy install command",xde=()=>"复制安装命令",yde=()=>"کپی فرمان نصب",wde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xde():t==="fa"?yde():vde()}),Sde=()=>"This file was deleted on disk. Your edits have not been discarded.",kde=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",Cde=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",D7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kde():t==="fa"?Cde():Sde()}),Ede=()=>"Discard my edits and reload",Nde=()=>"放弃我的编辑并重新加载",zde=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",jde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nde():t==="fa"?zde():Ede()}),Ade=()=>"Discard unsaved changes and close this file?",Tde=()=>"要丢弃未保存的更改并关闭此文件吗?",Mde=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",Rde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tde():t==="fa"?Mde():Ade()}),Dde=()=>"Dismiss",Lde=()=>"关闭",Ode=()=>"بستن",Ide=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lde():t==="fa"?Ode():Dde()}),Bde=()=>"Dismiss compile message",$de=()=>"关闭编译消息",Hde=()=>"بستن پیام کامپایل",Pde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$de():t==="fa"?Hde():Bde()}),Fde=()=>"Dismiss Overleaf message",Ude=()=>"关闭 Overleaf 消息",qde=()=>"بستن پیام Overleaf",Gde=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ude():t==="fa"?qde():Fde()}),Vde=()=>"Download",Wde=()=>"下载",Kde=()=>"بارگیری",sN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wde():t==="fa"?Kde():Vde()}),Yde=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,Xde=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,Zde=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,Qde=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Xde(e):t==="fa"?Zde(e):Yde(e)}),Jde=()=>"Failed to load file:",efe=()=>"加载文件失败:",tfe=()=>"بارگیری فایل ناموفق بود:",L7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?efe():t==="fa"?tfe():Jde()}),nfe=()=>"File truncated — showing the first 512 KB.",rfe=()=>"文件已截断——仅显示前 512 KB。",sfe=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",ife=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rfe():t==="fa"?sfe():nfe()}),afe=()=>"The page below stops partway — the full file could not be loaded.",ofe=()=>"下方页面在中途结束——无法加载完整文件。",lfe=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",cfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ofe():t==="fa"?lfe():afe()}),ufe=e=>`Rendered HTML: ${e==null?void 0:e.name}`,dfe=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,ffe=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,hfe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?dfe(e):t==="fa"?ffe(e):ufe(e)}),_fe=()=>"Loading…",pfe=()=>"正在加载…",mfe=()=>"در حال بارگیری…",iN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pfe():t==="fa"?mfe():_fe()}),gfe=()=>"File not found.",bfe=()=>"找不到文件。",vfe=()=>"فایل پیدا نشد.",xfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bfe():t==="fa"?vfe():gfe()}),yfe=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,wfe=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,Sfe=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,kfe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wfe(e):t==="fa"?Sfe(e):yfe(e)}),Cfe=e=>`File not found on branch ${e==null?void 0:e.branch}.`,Efe=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,Nfe=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,zfe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Efe(e):t==="fa"?Nfe(e):Cfe(e)}),jfe=()=>"File not found on disk.",Afe=()=>"磁盘上找不到此文件。",Tfe=()=>"فایل روی دیسک پیدا نشد.",Mfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Afe():t==="fa"?Tfe():jfe()}),Rfe=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,Dfe=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,Lfe=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,Ofe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Dfe(e):t==="fa"?Lfe(e):Rfe(e)}),Ife=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,Bfe=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,$fe=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,Hfe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Bfe(e):t==="fa"?$fe(e):Ife(e)}),Pfe=()=>"Open in default editor",Ffe=()=>"在默认编辑器中打开",Ufe=()=>"باز کردن در ویرایشگر پیش‌فرض",O7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ffe():t==="fa"?Ufe():Pfe()}),qfe=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",Gfe=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",Vfe=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",Wfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gfe():t==="fa"?Vfe():qfe()}),Kfe=()=>"Overwrite disk file",Yfe=()=>"覆盖磁盘文件",Xfe=()=>"بازنویسی فایل روی دیسک",Zfe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Yfe():t==="fa"?Xfe():Kfe()}),Qfe=()=>"Compiled PDF is out of date",Jfe=()=>"已编译的 PDF 不是最新版本",ehe=()=>"PDF کامپایل‌شده به‌روز نیست",the=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jfe():t==="fa"?ehe():Qfe()}),nhe=()=>"project clone",rhe=()=>"项目克隆",she=()=>"کلون پروژه",p0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rhe():t==="fa"?she():nhe()}),ihe=()=>"Recompile PDF",ahe=()=>"重新编译 PDF",ohe=()=>"کامپایل دوبارهٔ PDF",I7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ahe():t==="fa"?ohe():ihe()}),lhe=()=>"Reload from disk",che=()=>"从磁盘重新加载",uhe=()=>"بارگذاری مجدد از دیسک",dhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?che():t==="fa"?uhe():lhe()}),fhe=()=>"Save failed",hhe=()=>"保存失败",_he=()=>"ذخیره ناموفق بود",phe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hhe():t==="fa"?_he():fhe()}),mhe=()=>"Saving…",ghe=()=>"正在保存…",bhe=()=>"در حال ذخیره…",vhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ghe():t==="fa"?bhe():mhe()}),xhe=()=>"Selected — press ⌘C",yhe=()=>"已选中 — 按 ⌘C 复制",whe=()=>"انتخاب شد — برای کپی ⌘C را بزنید",She=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yhe():t==="fa"?whe():xhe()}),khe=()=>"session’s worktree",Che=()=>"会话工作树",Ehe=()=>"درخت کاری نشست",m0=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Che():t==="fa"?Ehe():khe()}),Nhe=()=>"Show compiled PDF",zhe=()=>"显示已编译的 PDF",jhe=()=>"نمایش PDF کامپایل‌شده",B7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zhe():t==="fa"?jhe():Nhe()}),Ahe=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",The=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",Mhe=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",Rhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?The():t==="fa"?Mhe():Ahe()}),Dhe=()=>"This session's worktree isn't available — showing the project clone's copy.",Lhe=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",Ohe=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",Ihe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lhe():t==="fa"?Ohe():Dhe()}),Bhe=()=>"Unsaved",$he=()=>"未保存",Hhe=()=>"ذخیره نشده",aN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$he():t==="fa"?Hhe():Bhe()}),Phe=()=>"Unsaved — ⌘S to save",Fhe=()=>"未保存 — 按 ⌘S 保存",Uhe=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",qhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fhe():t==="fa"?Uhe():Phe()}),Ghe=()=>"Update orx on the remote machine to edit this file safely.",Vhe=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",Whe=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",Khe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vhe():t==="fa"?Whe():Ghe()}),Yhe=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",Xhe=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",Zhe=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",Qhe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xhe():t==="fa"?Zhe():Yhe()}),Jhe=()=>"Back to preview",e_e=()=>"返回预览",t_e=()=>"بازگشت به پیش‌نمایش",n_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e_e():t==="fa"?t_e():Jhe()}),r_e=e=>`${e==null?void 0:e.count} changed files`,s_e=e=>`${e==null?void 0:e.count} 个已更改文件`,i_e=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,a_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?s_e(e):t==="fa"?i_e(e):r_e(e)}),o_e=()=>"Changed files",l_e=()=>"已更改文件",c_e=()=>"فایل‌های تغییرکرده",u_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l_e():t==="fa"?c_e():o_e()}),d_e=()=>"Diff preview truncated",f_e=()=>"差异预览已截断",h_e=()=>"پیش‌نمایش تفاوت کوتاه شده است",__e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f_e():t==="fa"?h_e():d_e()}),p_e=e=>`${e==null?void 0:e.count} files shown (partial)`,m_e=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,g_e=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,b_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?m_e(e):t==="fa"?g_e(e):p_e(e)}),v_e=()=>"No changes.",x_e=()=>"没有更改。",y_e=()=>"تغییری وجود ندارد.",w_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x_e():t==="fa"?y_e():v_e()}),S_e=()=>"No complete file preview was available before the cutoff.",k_e=()=>"在截断位置之前没有完整的文件预览。",C_e=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",E_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k_e():t==="fa"?C_e():S_e()}),N_e=()=>"No textual diff for this file.",z_e=()=>"此文件没有文本差异。",j_e=()=>"برای این فایل تفاوت متنی وجود ندارد.",A_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z_e():t==="fa"?j_e():N_e()}),T_e=()=>"1 changed file",M_e=()=>"1 个已更改文件",R_e=()=>"۱ فایل تغییرکرده",D_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M_e():t==="fa"?R_e():T_e()}),L_e=()=>"1 file shown (partial)",O_e=()=>"显示 1 个文件(部分)",I_e=()=>"۱ فایل نمایش داده شده (ناقص)",B_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O_e():t==="fa"?I_e():L_e()}),$_e=()=>"Unable to parse this diff.",H_e=()=>"无法解析此差异。",P_e=()=>"خواندن این تفاوت ممکن نبود.",F_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?H_e():t==="fa"?P_e():$_e()}),U_e=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,q_e=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,G_e=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,V_e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?q_e(e):t==="fa"?G_e(e):U_e(e)}),W_e=()=>"View full diff",K_e=()=>"查看完整差异",Y_e=()=>"نمایش تفاوت کامل",X_e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K_e():t==="fa"?Y_e():W_e()}),Z_e=()=>"Create a token ↗",Q_e=()=>"创建令牌 ↗",J_e=()=>"ساخت توکن ↗",e0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q_e():t==="fa"?J_e():Z_e()}),t0e=()=>"All projects",n0e=()=>"所有项目",r0e=()=>"همهٔ پروژه‌ها",$7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n0e():t==="fa"?r0e():t0e()}),s0e=()=>"Configure Repository",i0e=()=>"配置仓库",a0e=()=>"پیکربندی مخزن",o0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i0e():t==="fa"?a0e():s0e()}),l0e=()=>"Create a new project",c0e=()=>"新建项目",u0e=()=>"ایجاد پروژهٔ جدید",d0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c0e():t==="fa"?u0e():l0e()}),f0e=()=>"Hide sidebar",h0e=()=>"隐藏侧边栏",_0e=()=>"پنهان کردن نوار کناری",H7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?h0e():t==="fa"?_0e():f0e()}),p0e=()=>"Project",m0e=()=>"项目",g0e=()=>"پروژه",b0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m0e():t==="fa"?g0e():p0e()}),v0e=e=>`${e==null?void 0:e.count} cancelled`,x0e=e=>`${e==null?void 0:e.count} 次取消`,y0e=e=>`${e==null?void 0:e.count} لغوشده`,w0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?x0e(e):t==="fa"?y0e(e):v0e(e)}),S0e=e=>`${e==null?void 0:e.count} done`,k0e=e=>`${e==null?void 0:e.count} 次完成`,C0e=e=>`${e==null?void 0:e.count} تمام‌شده`,E0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?k0e(e):t==="fa"?C0e(e):S0e(e)}),N0e=e=>`${e==null?void 0:e.count} failed`,z0e=e=>`${e==null?void 0:e.count} 次失败`,j0e=e=>`${e==null?void 0:e.count} ناموفق`,A0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?z0e(e):t==="fa"?j0e(e):N0e(e)}),T0e=e=>`${e==null?void 0:e.count} files`,M0e=e=>`${e==null?void 0:e.count} 个文件`,R0e=e=>`${e==null?void 0:e.count} فایل`,D0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?M0e(e):t==="fa"?R0e(e):T0e(e)}),L0e=e=>`${e==null?void 0:e.count}+ files`,O0e=e=>`至少 ${e==null?void 0:e.count} 个文件`,I0e=e=>`بیش از ${e==null?void 0:e.count} فایل`,B0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?O0e(e):t==="fa"?I0e(e):L0e(e)}),$0e=e=>`${e==null?void 0:e.count} live`,H0e=e=>`${e==null?void 0:e.count} 次进行中`,P0e=e=>`${e==null?void 0:e.count} فعال`,F0e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?H0e(e):t==="fa"?P0e(e):$0e(e)}),U0e=()=>"1 file",q0e=()=>"1 个文件",G0e=()=>"۱ فایل",V0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q0e():t==="fa"?G0e():U0e()}),W0e=()=>"1 run",K0e=()=>"1 次运行",Y0e=()=>"۱ اجرا",X0e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K0e():t==="fa"?Y0e():W0e()}),Z0e=e=>`${e==null?void 0:e.count} runs`,Q0e=e=>`${e==null?void 0:e.count} 次运行`,J0e=e=>`${e==null?void 0:e.count} اجرا`,epe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Q0e(e):t==="fa"?J0e(e):Z0e(e)}),tpe=()=>"No instances yet.",npe=()=>"还没有实例。",rpe=()=>"هنوز نمونه‌ای وجود ندارد.",spe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?npe():t==="fa"?rpe():tpe()}),ipe=()=>"Nothing running right now.",ape=()=>"当前没有运行中的实例。",ope=()=>"اکنون چیزی در حال اجرا نیست.",lpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ape():t==="fa"?ope():ipe()}),cpe=()=>"Select a project to see its history.",upe=()=>"请选择一个项目以查看其历史记录。",dpe=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",fpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?upe():t==="fa"?dpe():cpe()}),hpe=()=>"Select a project to see its runs.",_pe=()=>"请选择一个项目以查看其运行。",ppe=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",mpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_pe():t==="fa"?ppe():hpe()}),gpe=()=>"View history",bpe=()=>"查看历史记录",vpe=()=>"مشاهدهٔ تاریخچه",xpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bpe():t==="fa"?vpe():gpe()}),ype=e=>`View history (${e==null?void 0:e.count})`,wpe=e=>`查看历史记录(${e==null?void 0:e.count})`,Spe=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,kpe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wpe(e):t==="fa"?Spe(e):ype(e)}),Cpe=()=>"The engine exited without producing a PDF or a log.",Epe=()=>"引擎已退出,但没有生成 PDF 或日志。",Npe=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",zpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Epe():t==="fa"?Npe():Cpe()}),jpe=()=>"Loading…",Ape=()=>"正在加载…",Tpe=()=>"در حال بارگیری…",Mpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ape():t==="fa"?Tpe():jpe()}),Rpe=()=>"Copy",Dpe=()=>"复制",Lpe=()=>"کپی",oN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dpe():t==="fa"?Lpe():Rpe()}),Ope=()=>"Copy code",Ipe=()=>"复制代码",Bpe=()=>"کپی کد",$pe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ipe():t==="fa"?Bpe():Ope()}),Hpe=()=>"Download",Ppe=()=>"下载",Fpe=()=>"بارگیری",lN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ppe():t==="fa"?Fpe():Hpe()}),Upe=()=>"This browser can’t preview this media format.",qpe=()=>"此浏览器无法预览该媒体格式。",Gpe=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",Vpe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qpe():t==="fa"?Gpe():Upe()}),Wpe=()=>" · CLI configuration",Kpe=()=>" · CLI 配置",Ype=()=>" · پیکربندی CLI",cN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kpe():t==="fa"?Ype():Wpe()}),Xpe=()=>"· Default",Zpe=()=>"· 默认",Qpe=()=>"· پیش‌فرض",uN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zpe():t==="fa"?Qpe():Xpe()}),Jpe=()=>"Default model",eme=()=>"默认模型",tme=()=>"مدل پیش‌فرض",P7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eme():t==="fa"?tme():Jpe()}),nme=()=>"Detecting harnesses…",rme=()=>"正在检测智能体工具…",sme=()=>"در حال شناسایی ابزارهای عامل…",ime=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rme():t==="fa"?sme():nme()}),ame=()=>"Effort",ome=()=>"推理强度",lme=()=>"میزان استدلال",cme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ome():t==="fa"?lme():ame()}),ume=()=>"Fast speed ·",dme=()=>"快速 ·",fme=()=>"سرعت بالا ·",hme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dme():t==="fa"?fme():ume()}),_me=()=>"Mode",pme=()=>"模式",mme=()=>"حالت",F7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pme():t==="fa"?mme():_me()}),gme=()=>"Model",bme=()=>"模型",vme=()=>"مدل",pb=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bme():t==="fa"?vme():gme()}),xme=e=>`${e==null?void 0:e.count} more — search to find`,yme=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,wme=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,Sme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?yme(e):t==="fa"?wme(e):xme(e)}),kme=()=>"Not available",Cme=()=>"不可用",Eme=()=>"در دسترس نیست",Nme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cme():t==="fa"?Eme():kme()}),zme=()=>"Search models…",jme=()=>"搜索模型…",Ame=()=>"جست‌وجوی مدل‌ها…",Tme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jme():t==="fa"?Ame():zme()}),Mme=()=>"Sessions keep their harness. Start a new chat to switch.",Rme=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",Dme=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",Lme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rme():t==="fa"?Dme():Mme()}),Ome=()=>"Speed",Ime=()=>"速度",Bme=()=>"سرعت",U7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ime():t==="fa"?Bme():Ome()}),$me=()=>"Unavailable",Hme=()=>"不可用",Pme=()=>"در دسترس نیست",dN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hme():t==="fa"?Pme():$me()}),Fme=e=>`Use “${e==null?void 0:e.id}” as the model ID`,Ume=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,qme=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,Gme=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ume(e):t==="fa"?qme(e):Fme(e)}),Vme=()=>"Variant",Wme=()=>"变体",Kme=()=>"گونه",Yme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wme():t==="fa"?Kme():Vme()}),Xme=()=>"Advanced",Zme=()=>"高级",Qme=()=>"پیشرفته",Jme=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zme():t==="fa"?Qme():Xme()}),ege=()=>"Advanced · Connect GitHub",tge=()=>"高级 · 连接 GitHub",nge=()=>"پیشرفته · اتصال GitHub",rge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tge():t==="fa"?nge():ege()}),sge=()=>"Advanced · GitHub sync on",ige=()=>"高级 · GitHub 同步已开启",age=()=>"پیشرفته · همگام‌سازی GitHub روشن است",oge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ige():t==="fa"?age():sge()}),lge=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",cge=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",uge=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",dge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cge():t==="fa"?uge():lge()}),fge=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,hge=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,_ge=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,pge=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hge(e):t==="fa"?_ge(e):fge(e)}),mge=()=>"Choose an existing project folder",gge=()=>"选择现有项目文件夹",bge=()=>"انتخاب پوشهٔ موجود پروژه",q7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gge():t==="fa"?bge():mge()}),vge=()=>"Choosing…",xge=()=>"正在选择…",yge=()=>"در حال انتخاب…",wge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xge():t==="fa"?yge():vge()}),Sge=()=>"Clone destination",kge=()=>"克隆位置",Cge=()=>"مقصد کلون",Ege=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kge():t==="fa"?Cge():Sge()}),Nge=()=>"Clone paper project",zge=()=>"克隆论文项目",jge=()=>"کلون پروژهٔ مقاله",Age=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zge():t==="fa"?jge():Nge()}),Tge=()=>"Create project",Mge=()=>"创建项目",Rge=()=>"ایجاد پروژه",G7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mge():t==="fa"?Rge():Tge()}),Dge=()=>"Creating…",Lge=()=>"正在创建…",Oge=()=>"در حال ایجاد…",Ige=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lge():t==="fa"?Oge():Dge()}),Bge=()=>"Choose a different destination. This path is a file, not a folder.",$ge=()=>"请选择其他位置。此路径是文件,不是文件夹。",Hge=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",V7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$ge():t==="fa"?Hge():Bge()}),Pge=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",Fge=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",Uge=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",qge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fge():t==="fa"?Uge():Pge()}),Gge=()=>"Blank project",Vge=()=>"空白项目",Wge=()=>"پروژهٔ خالی",Kge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vge():t==="fa"?Wge():Gge()}),Yge=()=>"Cancel",Xge=()=>"取消",Zge=()=>"لغو",Qge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xge():t==="fa"?Zge():Yge()}),Jge=()=>"Change",e1e=()=>"更改",t1e=()=>"تغییر",n1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e1e():t==="fa"?t1e():Jge()}),r1e=()=>"Change selected paper",s1e=()=>"更改所选论文",i1e=()=>"تغییر مقالهٔ انتخاب‌شده",a1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s1e():t==="fa"?i1e():r1e()}),o1e=()=>"Check out a Git branch before using this folder.",l1e=()=>"使用此文件夹前,请先检出一个 Git 分支。",c1e=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",u1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l1e():t==="fa"?c1e():o1e()}),d1e=()=>"Checking project location.",f1e=()=>"正在检查项目位置。",h1e=()=>"در حال بررسی محل پروژه.",W7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f1e():t==="fa"?h1e():d1e()}),_1e=()=>"Existing folder",p1e=()=>"现有文件夹",m1e=()=>"پوشهٔ موجود",g1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),b1e=()=>"Experiment branches will be pushed to the remote GitHub repository.",v1e=()=>"实验分支将推送到远程 GitHub 仓库。",x1e=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",y1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v1e():t==="fa"?x1e():b1e()}),w1e=()=>"From a paper",S1e=()=>"从论文创建",k1e=()=>"از یک مقاله",C1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",N1e=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",z1e=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",j1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N1e():t==="fa"?z1e():E1e()}),A1e=()=>"my-research",T1e=()=>"my-research",M1e=()=>"my-research",K7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T1e():t==="fa"?M1e():A1e()}),R1e=()=>"No papers found. Try an arXiv ID, URL, or a different title.",D1e=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",L1e=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",O1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D1e():t==="fa"?L1e():R1e()}),I1e=()=>"No public repository found on alphaXiv",B1e=()=>"在 alphaXiv 上未找到公开仓库",$1e=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",H1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B1e():t==="fa"?$1e():I1e()}),P1e=()=>"OpenResearch will start a blank project with this paper's PDF.",F1e=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",U1e=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",q1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F1e():t==="fa"?U1e():P1e()}),G1e=()=>"Paper",V1e=()=>"论文",W1e=()=>"مقاله",K1e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?V1e():t==="fa"?W1e():G1e()}),Y1e=()=>"Project location",X1e=()=>"项目位置",Z1e=()=>"محل پروژه",mb=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?X1e():t==="fa"?Z1e():Y1e()}),Q1e=()=>"Project name",J1e=()=>"项目名称",ebe=()=>"نام پروژه",Y7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J1e():t==="fa"?ebe():Q1e()}),tbe=()=>"Search for a paper by arXiv ID, URL, or title",nbe=()=>"按 arXiv ID、网址或标题搜索论文",rbe=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",sbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nbe():t==="fa"?rbe():tbe()}),ibe=()=>"Sync experiments to GitHub",abe=()=>"将实验同步到 GitHub",obe=()=>"همگام‌سازی آزمایش‌ها با GitHub",lbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?abe():t==="fa"?obe():ibe()}),cbe=()=>"That folder no longer exists. Choose it again.",ube=()=>"该文件夹已不存在。请重新选择。",dbe=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",fbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ube():t==="fa"?dbe():cbe()}),hbe=()=>"The selected folder contains an invalid Git repository.",_be=()=>"所选文件夹包含无效的 Git 仓库。",pbe=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",mbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_be():t==="fa"?pbe():hbe()}),gbe=()=>"The selected path is not a folder.",bbe=()=>"所选路径不是文件夹。",vbe=()=>"مسیر انتخاب‌شده پوشه نیست.",xbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bbe():t==="fa"?vbe():gbe()}),ybe=e=>`Checking ${e==null?void 0:e.repository}.`,wbe=e=>`正在检查 ${e==null?void 0:e.repository}。`,Sbe=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,kbe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wbe(e):t==="fa"?Sbe(e):ybe(e)}),Cbe=e=>`Creates ${e==null?void 0:e.repository}.`,Ebe=e=>`将创建 ${e==null?void 0:e.repository}。`,Nbe=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,zbe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ebe(e):t==="fa"?Nbe(e):Cbe(e)}),jbe=e=>`Pushes to ${e==null?void 0:e.repository}.`,Abe=e=>`将推送到 ${e==null?void 0:e.repository}。`,Tbe=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,Mbe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Abe(e):t==="fa"?Tbe(e):jbe(e)}),Rbe=()=>"Project location is required.",Dbe=()=>"必须填写项目位置。",Lbe=()=>"محل پروژه الزامی است.",X7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dbe():t==="fa"?Lbe():Rbe()}),Obe=()=>"Choose a different destination. The paper repository needs a new or empty folder.",Ibe=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",Bbe=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",$be=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ibe():t==="fa"?Bbe():Obe()}),Hbe=()=>"A linked public code repository is cloned without credentials.",Pbe=()=>"关联的公开代码仓库无需凭据即可克隆。",Fbe=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",Ube=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pbe():t==="fa"?Fbe():Hbe()}),qbe=e=>`Run ${e==null?void 0:e.command} before creating the project.`,Gbe=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,Vbe=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,Wbe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Gbe(e):t==="fa"?Vbe(e):qbe(e)}),Kbe=()=>"Searching alphaXiv…",Ybe=()=>"正在搜索 alphaXiv…",Xbe=()=>"در حال جست‌وجوی alphaXiv…",Zbe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ybe():t==="fa"?Xbe():Kbe()}),Qbe=()=>"Use folder",Jbe=()=>"使用文件夹",eve=()=>"استفاده از پوشه",tve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jbe():t==="fa"?eve():Qbe()}),nve=()=>"Can’t reach OpenResearch. This page is no longer live.",rve=()=>"无法连接 OpenResearch。此页面已不再实时同步。",sve=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",Vv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rve():t==="fa"?sve():nve()}),ive=()=>"A workspace for your research agents",ave=()=>"面向研究智能体的工作空间",ove=()=>"فضای کاری برای عامل‌های پژوهشی شما",lve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ave():t==="fa"?ove():ive()}),cve=()=>"Add papers that represent your research interests, including papers by other authors.",uve=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",dve=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",fve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uve():t==="fa"?dve():cve()}),hve=()=>"API key",_ve=()=>"API 密钥",pve=()=>"کلید API",qx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ve():t==="fa"?pve():hve()}),mve=()=>"AI/ML",gve=()=>"人工智能与机器学习",bve=()=>"هوش مصنوعی و یادگیری ماشین",vve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gve():t==="fa"?bve():mve()}),xve=()=>"Biology",yve=()=>"生物学",wve=()=>"زیست‌شناسی",Sve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yve():t==="fa"?wve():xve()}),kve=()=>"Other",Cve=()=>"其他",Eve=()=>"سایر",Nve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"Physics",jve=()=>"物理学",Ave=()=>"فیزیک",Tve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jve():t==="fa"?Ave():zve()}),Mve=()=>"Back",Rve=()=>"返回",Dve=()=>"بازگشت",Z7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rve():t==="fa"?Dve():Mve()}),Lve=()=>"Check failed",Ove=()=>"检查失败",Ive=()=>"بررسی ناموفق بود",Bve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ove():t==="fa"?Ive():Lve()}),$ve=()=>"Checking",Hve=()=>"正在检查",Pve=()=>"در حال بررسی",Fve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hve():t==="fa"?Pve():$ve()}),Uve=()=>"Checking Git…",qve=()=>"正在检查 Git…",Gve=()=>"در حال بررسی Git…",Vve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qve():t==="fa"?Gve():Uve()}),Wve=()=>"Choose a coding agent",Kve=()=>"选择编程智能体",Yve=()=>"یک عامل کدنویسی انتخاب کنید",Xve=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kve():t==="fa"?Yve():Wve()}),Zve=()=>"Choose a coding agent to continue.",Qve=()=>"选择一个编程智能体以继续。",Jve=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",e2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qve():t==="fa"?Jve():Zve()}),t2e=()=>"Choose at least one research area to continue.",n2e=()=>"请至少选择一个研究领域后再继续。",r2e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",s2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n2e():t==="fa"?r2e():t2e()}),i2e=()=>"Choose one or more.",a2e=()=>"请选择一项或多项。",o2e=()=>"یک یا چند مورد را انتخاب کنید.",l2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a2e():t==="fa"?o2e():i2e()}),c2e=()=>"Choose your preferred coding agent",u2e=()=>"请选择首选编程智能体",d2e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",f2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u2e():t==="fa"?d2e():c2e()}),h2e=()=>"Consolidate your research",_2e=()=>"集中管理研究",p2e=()=>"پژوهش خود را یکپارچه کنید",m2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_2e():t==="fa"?p2e():h2e()}),g2e=()=>"Continue",b2e=()=>"继续",v2e=()=>"ادامه",Q7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b2e():t==="fa"?v2e():g2e()}),x2e=()=>"Describe your research area to continue.",y2e=()=>"请描述你的研究领域后再继续。",w2e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",S2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y2e():t==="fa"?w2e():x2e()}),k2e=()=>"Detecting Claude Code, Codex, OpenCode…",C2e=()=>"正在检测 Claude Code、Codex、OpenCode…",E2e=()=>"در حال شناسایی Claude Code، Codex و OpenCode…",N2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C2e():t==="fa"?E2e():k2e()}),z2e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",j2e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",A2e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",T2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j2e():t==="fa"?A2e():z2e()}),M2e=()=>"Everything stays local",R2e=()=>"一切都保留在本地",D2e=()=>"همه‌چیز محلی می‌ماند",L2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R2e():t==="fa"?D2e():M2e()}),O2e=()=>"Get started",I2e=()=>"开始使用",B2e=()=>"شروع",$2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I2e():t==="fa"?B2e():O2e()}),H2e=()=>"Git is required for local experiments. Install Git, then re-check.",P2e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",F2e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",U2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P2e():t==="fa"?F2e():H2e()}),q2e=()=>"Ground your agents",G2e=()=>"为智能体提供可靠依据",V2e=()=>"عامل‌هایتان را به منابع متصل کنید",W2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G2e():t==="fa"?V2e():q2e()}),K2e=()=>"Install broken",Y2e=()=>"安装损坏",X2e=()=>"نصب خراب است",Z2e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y2e():t==="fa"?X2e():K2e()}),Q2e=()=>"Install Git to continue",J2e=()=>"请安装 Git 后再继续",exe=()=>"برای ادامه Git را نصب کنید",txe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J2e():t==="fa"?exe():Q2e()}),nxe=()=>"Local Git",rxe=()=>"本地 Git",sxe=()=>"Git محلی",ixe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rxe():t==="fa"?sxe():nxe()}),axe=()=>"Not detected",oxe=()=>"未检测到",lxe=()=>"شناسایی نشد",J7=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oxe():t==="fa"?lxe():axe()}),cxe=()=>"Not found",uxe=()=>"未找到",dxe=()=>"پیدا نشد",fN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uxe():t==="fa"?dxe():cxe()}),fxe=()=>"Not signed in",hxe=()=>"未登录",_xe=()=>"وارد نشده",pxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hxe():t==="fa"?_xe():fxe()}),mxe=()=>"OpenResearch uses a coding agent already installed on this machine.",gxe=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",bxe=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",vxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gxe():t==="fa"?bxe():mxe()}),xxe=()=>"Other research area",yxe=()=>"其他研究领域",wxe=()=>"حوزهٔ پژوهشی دیگر",Sxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yxe():t==="fa"?wxe():xxe()}),kxe=()=>"Re-check",Cxe=()=>"重新检查",Exe=()=>"بررسی دوباره",Nxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cxe():t==="fa"?Exe():kxe()}),zxe=()=>"Ready",jxe=()=>"已就绪",Axe=()=>"آماده",Txe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jxe():t==="fa"?Axe():zxe()}),Mxe=()=>"Re-check Git before continuing",Rxe=()=>"请重新检查 Git 后再继续",Dxe=()=>"پیش از ادامه Git را دوباره بررسی کنید",Lxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rxe():t==="fa"?Dxe():Mxe()}),Oxe=()=>"Representative papers",Ixe=()=>"代表性论文",Bxe=()=>"مقاله‌های شاخص",$xe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ixe():t==="fa"?Bxe():Oxe()}),Hxe=()=>"Research background",Pxe=()=>"研究背景",Fxe=()=>"پیشینهٔ پژوهشی",Uxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pxe():t==="fa"?Fxe():Hxe()}),qxe=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",Gxe=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",Vxe=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",eS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gxe():t==="fa"?Vxe():qxe()}),Wxe=()=>"Search alphaXiv by title to link a paper…",Kxe=()=>"按标题搜索 alphaXiv 以关联论文…",Yxe=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",Xxe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Kxe():t==="fa"?Yxe():Wxe()}),Zxe=()=>"Searching alphaXiv…",Qxe=()=>"正在搜索 alphaXiv…",Jxe=()=>"در حال جست‌وجوی alphaXiv…",eye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qxe():t==="fa"?Jxe():Zxe()}),tye=()=>"Selected",nye=()=>"已选择",rye=()=>"انتخاب‌شده",sye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nye():t==="fa"?rye():tye()}),iye=()=>"Setting things up…",aye=()=>"正在设置…",oye=()=>"در حال راه‌اندازی…",lye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),cye=()=>"Sign in to at least one coding agent to continue",uye=()=>"请至少登录一个编程智能体后再继续",dye=()=>"برای ادامه، وارد دست‌کم یک عامل برنامه‌نویسی شوید",fye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uye():t==="fa"?dye():cye()}),hye=()=>"Sign in to at least one agent to continue.",_ye=()=>"请登录至少一个智能体以继续。",pye=()=>"برای ادامه دست‌کم به یک عامل وارد شوید.",mye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_ye():t==="fa"?pye():hye()}),gye=()=>"Signed in",bye=()=>"已登录",vye=()=>"وارد شده",xye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bye():t==="fa"?vye():gye()}),yye=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",wye=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",Sye=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",kye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wye():t==="fa"?Sye():yye()}),Cye=()=>"· Step 1 of 2",Eye=()=>"· 第 1 步,共 2 步",Nye=()=>"· مرحلهٔ ۱ از ۲",zye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Eye():t==="fa"?Nye():Cye()}),jye=()=>"· Step 2 of 2",Aye=()=>"· 第 2 步,共 2 步",Tye=()=>"· مرحلهٔ ۲ از ۲",Mye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Aye():t==="fa"?Tye():jye()}),Rye=()=>"Tell us about your research",Dye=()=>"介绍一下你的研究",Lye=()=>"از پژوهش خود بگویید",Oye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Dye():t==="fa"?Lye():Rye()}),Iye=()=>"Tell us your other research area",Bye=()=>"告诉我们你的其他研究领域",$ye=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",Hye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Bye():t==="fa"?$ye():Iye()}),Pye=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",Fye=()=>"在一处跟踪实验、产物、算力、技能和代码。",Uye=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",qye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Fye():t==="fa"?Uye():Pye()}),Gye=()=>"Unable to verify",Vye=()=>"无法验证",Wye=()=>"تأیید ممکن نیست",Kye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vye():t==="fa"?Wye():Gye()}),Yye=()=>"Update required",Xye=()=>"需要更新",Zye=()=>"نیازمند به‌روزرسانی",Qye=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xye():t==="fa"?Zye():Yye()}),Jye=()=>"Waiting for the Git check",e4e=()=>"正在等待 Git 检查",t4e=()=>"در انتظار بررسی Git",n4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e4e():t==="fa"?t4e():Jye()}),r4e=()=>"Waiting for the local tool checks",s4e=()=>"正在等待本地工具检查",i4e=()=>"در انتظار بررسی ابزارهای محلی",a4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s4e():t==="fa"?i4e():r4e()}),o4e=()=>"What areas are you interested in?",l4e=()=>"你对哪些领域感兴趣?",c4e=()=>"به چه حوزه‌هایی علاقه دارید؟",u4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l4e():t==="fa"?c4e():o4e()}),d4e=()=>"Your code, data, and experiment history stay on your machine.",f4e=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",h4e=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",_4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f4e():t==="fa"?h4e():d4e()}),p4e=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",m4e=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",g4e=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",b4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m4e():t==="fa"?g4e():p4e()}),v4e=()=>"Changed here and on Overleaf — choose which copy to keep",x4e=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",y4e=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",w4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x4e():t==="fa"?y4e():v4e()}),S4e=()=>"Create a token ↗",k4e=()=>"创建令牌 ↗",C4e=()=>"ساخت توکن ↗",E4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k4e():t==="fa"?C4e():S4e()}),N4e=()=>"Overleaf Git token",z4e=()=>"Overleaf Git 令牌",j4e=()=>"توکن Git در Overleaf",tS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z4e():t==="fa"?j4e():N4e()}),A4e=()=>"In step with Overleaf",T4e=()=>"已与 Overleaf 同步",M4e=()=>"با Overleaf همگام است",hN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T4e():t==="fa"?M4e():A4e()}),R4e=()=>"The last sync did not finish.",D4e=()=>"上次同步未完成。",L4e=()=>"آخرین همگام‌سازی کامل نشد.",O4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?D4e():t==="fa"?L4e():R4e()}),I4e=()=>"Link and sync",B4e=()=>"关联并同步",$4e=()=>"پیوند و همگام‌سازی",H4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B4e():t==="fa"?$4e():I4e()}),P4e=()=>"My projects ↗",F4e=()=>"我的项目 ↗",U4e=()=>"پروژه‌های من ↗",nS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F4e():t==="fa"?U4e():P4e()}),q4e=()=>"Nothing could be synced.",G4e=()=>"没有内容可以同步。",V4e=()=>"هیچ موردی قابل همگام‌سازی نبود.",W4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G4e():t==="fa"?V4e():q4e()}),K4e=()=>"Cancel",Y4e=()=>"取消",X4e=()=>"لغو",Z4e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y4e():t==="fa"?X4e():K4e()}),Q4e=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",J4e=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",ewe=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",twe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J4e():t==="fa"?ewe():Q4e()}),nwe=()=>"Keep this copy",rwe=()=>"保留此副本",swe=()=>"نگه داشتن این نسخه",iwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rwe():t==="fa"?swe():nwe()}),awe=()=>"Open in Overleaf",owe=()=>"在 Overleaf 中打开",lwe=()=>"باز کردن در Overleaf",cwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?owe():t==="fa"?lwe():awe()}),uwe=()=>"Replace the Overleaf token",dwe=()=>"替换 Overleaf 令牌",fwe=()=>"جایگزینی توکن Overleaf",rS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dwe():t==="fa"?fwe():uwe()}),hwe=()=>"Sync now",_we=()=>"立即同步",pwe=()=>"همگام‌سازی اکنون",mwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_we():t==="fa"?pwe():hwe()}),gwe=()=>"Unlink",bwe=()=>"取消关联",vwe=()=>"قطع پیوند",xwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bwe():t==="fa"?vwe():gwe()}),ywe=()=>"Upload a copy as a new project ↗",wwe=()=>"上传副本作为新项目 ↗",Swe=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",_N=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wwe():t==="fa"?Swe():ywe()}),kwe=()=>"Use Overleaf's",Cwe=()=>"使用 Overleaf 的副本",Ewe=()=>"استفاده از نسخهٔ Overleaf",Nwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Cwe():t==="fa"?Ewe():kwe()}),zwe=()=>"This paper stays in step with Overleaf.",jwe=()=>"此论文将与 Overleaf 保持同步。",Awe=()=>"این مقاله با Overleaf همگام می‌ماند.",Twe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jwe():t==="fa"?Awe():zwe()}),Mwe=e=>`Pulled ${e==null?void 0:e.paths}.`,Rwe=e=>`已拉取 ${e==null?void 0:e.paths}。`,Dwe=e=>`${e==null?void 0:e.paths} دریافت شد.`,Lwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Rwe(e):t==="fa"?Dwe(e):Mwe(e)}),Owe=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,Iwe=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,Bwe=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,$we=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Iwe(e):t==="fa"?Bwe(e):Owe(e)}),Hwe=e=>`Pushed ${e==null?void 0:e.paths}.`,Pwe=e=>`已推送 ${e==null?void 0:e.paths}。`,Fwe=e=>`${e==null?void 0:e.paths} ارسال شد.`,Uwe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Pwe(e):t==="fa"?Fwe(e):Hwe(e)}),qwe=()=>"Save the file first",Gwe=()=>"请先保存文件",Vwe=()=>"ابتدا فایل را ذخیره کنید",Wwe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Gwe():t==="fa"?Vwe():qwe()}),Kwe=()=>"Save this file to sync it with Overleaf",Ywe=()=>"保存此文件以与 Overleaf 同步",Xwe=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",pN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Ywe():t==="fa"?Xwe():Kwe()}),Zwe=()=>"Save token",Qwe=()=>"保存令牌",Jwe=()=>"ذخیرهٔ توکن",e5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qwe():t==="fa"?Jwe():Zwe()}),t5e=()=>"Send this paper to Overleaf",n5e=()=>"将此论文发送到 Overleaf",r5e=()=>"ارسال مقاله به Overleaf",s5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n5e():t==="fa"?r5e():t5e()}),i5e=()=>"Overleaf sync failed",a5e=()=>"Overleaf 同步失败",o5e=()=>"همگام‌سازی با Overleaf ناموفق بود",Wv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a5e():t==="fa"?o5e():i5e()}),l5e=()=>"Syncing with Overleaf…",c5e=()=>"正在与 Overleaf 同步…",u5e=()=>"در حال همگام‌سازی با Overleaf…",mN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?c5e():t==="fa"?u5e():l5e()}),d5e=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",f5e=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",h5e=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",_5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f5e():t==="fa"?h5e():d5e()}),p5e=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",m5e=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",g5e=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",b5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m5e():t==="fa"?g5e():p5e()}),v5e=()=>"Toggle Plan mode for this chat",x5e=()=>"切换此聊天的计划模式",y5e=()=>"تغییر حالت طرح این گفت‌وگو",w5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x5e():t==="fa"?y5e():v5e()}),S5e=()=>"Accept and auto mode",k5e=()=>"接受并使用自动模式",C5e=()=>"پذیرش و حالت خودکار",E5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?k5e():t==="fa"?C5e():S5e()}),N5e=()=>"Accept and bypass all",z5e=()=>"接受并跳过所有审批",j5e=()=>"پذیرش و عبور از همهٔ تأییدها",A5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?z5e():t==="fa"?j5e():N5e()}),T5e=()=>"Accept plan",M5e=()=>"接受计划",R5e=()=>"پذیرش طرح",D5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M5e():t==="fa"?R5e():T5e()}),L5e=e=>`${e==null?void 0:e.agent} proposed a plan`,O5e=e=>`${e==null?void 0:e.agent} 提出了一个计划`,I5e=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,B5e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?O5e(e):t==="fa"?I5e(e):L5e(e)}),$5e=e=>`${e==null?void 0:e.agent} is ready to proceed`,H5e=e=>`${e==null?void 0:e.agent} 已准备好继续`,P5e=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,F5e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?H5e(e):t==="fa"?P5e(e):$5e(e)}),U5e=()=>"Back",q5e=()=>"返回",G5e=()=>"بازگشت",V5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?q5e():t==="fa"?G5e():U5e()}),W5e=()=>"More approval options",K5e=()=>"更多批准选项",Y5e=()=>"گزینه‌های تأیید بیشتر",X5e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?K5e():t==="fa"?Y5e():W5e()}),Z5e=()=>"Open plan",Q5e=()=>"打开计划",J5e=()=>"باز کردن طرح",e3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Q5e():t==="fa"?J5e():Z5e()}),t3e=()=>"Reject",n3e=()=>"拒绝",r3e=()=>"رد کردن",s3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n3e():t==="fa"?r3e():t3e()}),i3e=()=>"Revise",a3e=()=>"修改",o3e=()=>"بازنگری",l3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a3e():t==="fa"?o3e():i3e()}),c3e=()=>"Revise…",u3e=()=>"修改…",d3e=()=>"بازنگری…",f3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u3e():t==="fa"?d3e():c3e()}),h3e=()=>"What should change? (optional)",_3e=()=>"需要更改什么?(可选)",p3e=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",m3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_3e():t==="fa"?p3e():h3e()}),g3e=e=>`${e==null?void 0:e.count} active`,b3e=e=>`${e==null?void 0:e.count} 个活跃`,v3e=e=>`${e==null?void 0:e.count} فعال`,x3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?b3e(e):t==="fa"?v3e(e):g3e(e)}),y3e=e=>`${e==null?void 0:e.count} total agents`,w3e=e=>`共 ${e==null?void 0:e.count} 个智能体`,S3e=e=>`در مجموع ${e==null?void 0:e.count} عامل`,k3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?w3e(e):t==="fa"?S3e(e):y3e(e)}),C3e=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,E3e=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,N3e=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,z3e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?E3e(e):t==="fa"?N3e(e):C3e(e)}),j3e=()=>"Agents",A3e=()=>"智能体",T3e=()=>"عامل‌ها",sS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A3e():t==="fa"?T3e():j3e()}),M3e=()=>"arXiv paper ID:",R3e=()=>"arXiv 论文 ID:",D3e=()=>"شناسهٔ مقالهٔ arXiv:",L3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R3e():t==="fa"?D3e():M3e()}),O3e=()=>"Cancel",I3e=()=>"取消",B3e=()=>"لغو",$3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I3e():t==="fa"?B3e():O3e()}),H3e=()=>"Created",P3e=()=>"创建时间",F3e=()=>"ایجادشده",U3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P3e():t==="fa"?F3e():H3e()}),q3e=()=>"Delete project?",G3e=()=>"删除项目?",V3e=()=>"پروژه حذف شود؟",W3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G3e():t==="fa"?V3e():q3e()}),K3e=()=>"Delete project",Y3e=()=>"删除项目",X3e=()=>"حذف پروژه",Z3e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y3e():t==="fa"?X3e():K3e()}),Q3e=()=>"Deleting…",J3e=()=>"正在删除…",e6e=()=>"در حال حذف…",t6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J3e():t==="fa"?e6e():Q3e()}),n6e=()=>"Experiments",r6e=()=>"实验",s6e=()=>"آزمایش‌ها",iS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?r6e():t==="fa"?s6e():n6e()}),i6e=()=>"The local folder and linked GitHub repository are kept.",a6e=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",o6e=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",l6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a6e():t==="fa"?o6e():i6e()}),c6e=()=>"The local folder is kept.",u6e=()=>"本地文件夹会保留。",d6e=()=>"پوشهٔ محلی نگه داشته می‌شود.",f6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u6e():t==="fa"?d6e():c6e()}),h6e=()=>"New project",_6e=()=>"新建项目",p6e=()=>"پروژهٔ جدید",gN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_6e():t==="fa"?p6e():h6e()}),m6e=()=>"No projects yet — create one to get started.",g6e=()=>"尚无项目——新建一个即可开始。",b6e=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",v6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?g6e():t==="fa"?b6e():m6e()}),x6e=()=>"Project",y6e=()=>"项目",w6e=()=>"پروژه",S6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?y6e():t==="fa"?w6e():x6e()}),k6e=()=>"Projects",C6e=()=>"项目",E6e=()=>"پروژه‌ها",N6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?C6e():t==="fa"?E6e():k6e()}),z6e=()=>"Repository",j6e=()=>"仓库",A6e=()=>"مخزن",aS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?j6e():t==="fa"?A6e():z6e()}),T6e=()=>"Idle",M6e=()=>"空闲",R6e=()=>"بیکار",D6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?M6e():t==="fa"?R6e():T6e()}),L6e=()=>"Local",O6e=()=>"本地",I6e=()=>"محلی",bN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?O6e():t==="fa"?I6e():L6e()}),B6e=()=>"1 total agent",$6e=()=>"共 1 个智能体",H6e=()=>"در مجموع ۱ عامل",P6e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$6e():t==="fa"?H6e():B6e()}),F6e=e=>`${e==null?void 0:e.count} running`,U6e=e=>`${e==null?void 0:e.count} 个运行中`,q6e=e=>`${e==null?void 0:e.count} در حال اجرا`,G6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?U6e(e):t==="fa"?q6e(e):F6e(e)}),V6e=e=>`${e==null?void 0:e.count} total`,W6e=e=>`共 ${e==null?void 0:e.count} 个`,K6e=e=>`در مجموع ${e==null?void 0:e.count}`,oS=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?W6e(e):t==="fa"?K6e(e):V6e(e)}),Y6e=e=>`${e==null?void 0:e.value}d`,X6e=e=>`${e==null?void 0:e.value} 天`,Z6e=e=>`${e==null?void 0:e.value}ر`,Q6e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?X6e(e):t==="fa"?Z6e(e):Y6e(e)}),J6e=e=>`${e==null?void 0:e.value}h`,e7e=e=>`${e==null?void 0:e.value} 小时`,t7e=e=>`${e==null?void 0:e.value}س`,n7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?e7e(e):t==="fa"?t7e(e):J6e(e)}),r7e=e=>`${e==null?void 0:e.value}m`,s7e=e=>`${e==null?void 0:e.value} 分钟`,i7e=e=>`${e==null?void 0:e.value}د`,a7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?s7e(e):t==="fa"?i7e(e):r7e(e)}),o7e=()=>"now",l7e=()=>"现在",c7e=()=>"اکنون",u7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l7e():t==="fa"?c7e():o7e()}),d7e=()=>"Installing the compatible binary. This may take a few minutes.",f7e=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",h7e=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",_7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f7e():t==="fa"?h7e():d7e()}),p7e=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,m7e=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,g7e=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,b7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?m7e(e):t==="fa"?g7e(e):p7e(e)}),v7e=()=>"Check again",x7e=()=>"再次检查",y7e=()=>"بررسی دوباره",lS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x7e():t==="fa"?y7e():v7e()}),w7e=()=>"Closing…",S7e=()=>"正在关闭…",k7e=()=>"در حال بستن…",C7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S7e():t==="fa"?k7e():w7e()}),E7e=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,N7e=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,z7e=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,j7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?N7e(e):t==="fa"?z7e(e):E7e(e)}),A7e=()=>"Preparing your remote workspace…",T7e=()=>"正在准备远程工作区…",M7e=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",R7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T7e():t==="fa"?M7e():A7e()}),D7e=e=>`Connecting to ${e==null?void 0:e.host}`,L7e=e=>`正在连接到 ${e==null?void 0:e.host}`,O7e=e=>`در حال اتصال به ${e==null?void 0:e.host}`,I7e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?L7e(e):t==="fa"?O7e(e):D7e(e)}),B7e=()=>"Close remote host picker",$7e=()=>"关闭远程主机选择器",H7e=()=>"بستن انتخاب‌گر میزبان راه‌دور",P7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$7e():t==="fa"?H7e():B7e()}),F7e=()=>"Choose a configured SSH host.",U7e=()=>"选择已配置的 SSH 主机。",q7e=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",G7e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?U7e():t==="fa"?q7e():F7e()}),V7e=()=>"Connect to remote",W7e=()=>"连接到远程主机",K7e=()=>"اتصال به میزبان راه‌دور",vN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W7e():t==="fa"?K7e():V7e()}),Y7e=()=>"Disconnect",X7e=()=>"断开连接",Z7e=()=>"قطع اتصال",Kv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?X7e():t==="fa"?Z7e():Y7e()}),Q7e=()=>"Your remote work is still running. Reconnect when you’re ready.",J7e=()=>"你的远程工作仍在运行。准备好后可以重新连接。",eSe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",tSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J7e():t==="fa"?eSe():Q7e()}),nSe=e=>`Disconnected from ${e==null?void 0:e.host}`,rSe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,sSe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,xN=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?rSe(e):t==="fa"?sSe(e):nSe(e)}),iSe=e=>`Could not connect to ${e==null?void 0:e.host}`,aSe=e=>`无法连接到 ${e==null?void 0:e.host}`,oSe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,lSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?aSe(e):t==="fa"?oSe(e):iSe(e)}),cSe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",uSe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",dSe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",fSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uSe():t==="fa"?dSe():cSe()}),hSe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",_Se=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",pSe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",mSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Se():t==="fa"?pSe():hSe()}),gSe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,bSe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,vSe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,xSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?bSe(e):t==="fa"?vSe(e):gSe(e)}),ySe=()=>"OpenResearch binary",wSe=()=>"OpenResearch 二进制文件",SSe=()=>"فایل اجرایی OpenResearch",kSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wSe():t==="fa"?SSe():ySe()}),CSe=()=>"Repository cache",ESe=()=>"仓库缓存",NSe=()=>"حافظهٔ نهان مخزن",zSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ESe():t==="fa"?NSe():CSe()}),jSe=()=>"OpenResearch Database",ASe=()=>"OpenResearch 数据库",TSe=()=>"پایگاه دادهٔ OpenResearch",MSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ASe():t==="fa"?TSe():jSe()}),RSe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",DSe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",LSe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",OSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DSe():t==="fa"?LSe():RSe()}),ISe=()=>"Install OpenResearch?",BSe=()=>"安装 OpenResearch?",$Se=()=>"OpenResearch نصب شود؟",HSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BSe():t==="fa"?$Se():ISe()}),PSe=()=>"Installing…",FSe=()=>"正在安装…",USe=()=>"در حال نصب…",qSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FSe():t==="fa"?USe():PSe()}),GSe=()=>"No matching SSH hosts",VSe=()=>"没有匹配的 SSH 主机",WSe=()=>"میزبان SSH منطبقی پیدا نشد",KSe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VSe():t==="fa"?WSe():GSe()}),YSe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,XSe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,ZSe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,QSe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XSe(e):t==="fa"?ZSe(e):YSe(e)}),JSe=()=>"Open remote",eke=()=>"打开远程工作区",tke=()=>"باز کردن راه‌دور",nke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eke():t==="fa"?tke():JSe()}),rke=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",ske=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",ike=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",ake=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ske():t==="fa"?ike():rke()}),oke=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",lke=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",cke=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",uke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lke():t==="fa"?cke():oke()}),dke=()=>"Preparing remote workspace…",fke=()=>"正在准备远程工作区…",hke=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",_ke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fke():t==="fa"?hke():dke()}),pke=()=>"Reconnect",mke=()=>"重新连接",gke=()=>"اتصال دوباره",cS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mke():t==="fa"?gke():pke()}),bke=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",vke=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",xke=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",yke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vke():t==="fa"?xke():bke()}),wke=e=>`Reconnecting to ${e==null?void 0:e.host}`,Ske=e=>`正在重新连接到 ${e==null?void 0:e.host}`,kke=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,Cke=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ske(e):t==="fa"?kke(e):wke(e)}),Eke=()=>"Search SSH hosts",Nke=()=>"搜索 SSH 主机",zke=()=>"جستجوی میزبان‌های SSH",uS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nke():t==="fa"?zke():Eke()}),jke=e=>`SSH: ${e==null?void 0:e.host}`,Ake=e=>`SSH:${e==null?void 0:e.host}`,Tke=e=>`SSH: ${e==null?void 0:e.host}`,gb=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ake(e):t==="fa"?Tke(e):jke(e)}),Mke=()=>"Start a new OpenResearch host",Rke=()=>"启动新的 OpenResearch 主机",Dke=()=>"راه‌اندازی میزبان جدید OpenResearch",Lke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Rke():t==="fa"?Dke():Mke()}),Oke=e=>`End ${e==null?void 0:e.count} pending approvals.`,Ike=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,Bke=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,$ke=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Ike(e):t==="fa"?Bke(e):Oke(e)}),Hke=()=>"Stop OpenResearch",Pke=()=>"停止 OpenResearch",Fke=()=>"توقف OpenResearch",Uke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Pke():t==="fa"?Fke():Hke()}),qke=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,Gke=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,Vke=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,Wke=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Gke(e):t==="fa"?Vke(e):qke(e)}),Kke=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,Yke=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,Xke=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,Zke=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Yke(e):t==="fa"?Xke(e):Kke(e)}),Qke=()=>"Stop OpenResearch on host",Jke=()=>"停止主机上的 OpenResearch",e8e=()=>"توقف OpenResearch روی میزبان",yN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Jke():t==="fa"?e8e():Qke()}),t8e=()=>"This will also:",n8e=()=>"这还将:",r8e=()=>"این کار همچنین:",s8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?n8e():t==="fa"?r8e():t8e()}),i8e=()=>"End 1 pending approval.",a8e=()=>"结束 1 个待审批请求。",o8e=()=>"۱ تأیید در انتظار را پایان می‌دهد.",l8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?a8e():t==="fa"?o8e():i8e()}),c8e=()=>"Leave 1 submitted experiment running.",u8e=()=>"让 1 个已提交实验继续运行。",d8e=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",f8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?u8e():t==="fa"?d8e():c8e()}),h8e=()=>"Disconnect 1 other client.",_8e=()=>"断开 1 个其他客户端。",p8e=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",m8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_8e():t==="fa"?p8e():h8e()}),g8e=()=>"Keep 1 queued message saved.",b8e=()=>"保留 1 条排队消息。",v8e=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",x8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?b8e():t==="fa"?v8e():g8e()}),y8e=()=>"Interrupt 1 active agent turn.",w8e=()=>"中断 1 个活动代理任务。",S8e=()=>"۱ نوبت فعال عامل را قطع می‌کند.",k8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?w8e():t==="fa"?S8e():y8e()}),C8e=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,E8e=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,N8e=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,z8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?E8e(e):t==="fa"?N8e(e):C8e(e)}),j8e=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,A8e=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,T8e=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,M8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?A8e(e):t==="fa"?T8e(e):j8e(e)}),R8e=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,D8e=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,L8e=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,O8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?D8e(e):t==="fa"?L8e(e):R8e(e)}),I8e=()=>"Stopping host…",B8e=()=>"正在停止主机…",$8e=()=>"در حال توقف میزبان…",H8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?B8e():t==="fa"?$8e():I8e()}),P8e=()=>"Update",F8e=()=>"更新",U8e=()=>"به‌روزرسانی",dS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?F8e():t==="fa"?U8e():P8e()}),q8e=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,G8e=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,V8e=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,W8e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?G8e(e):t==="fa"?V8e(e):q8e(e)}),K8e=()=>"Update OpenResearch?",Y8e=()=>"更新 OpenResearch?",X8e=()=>"OpenResearch به‌روزرسانی شود؟",Z8e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y8e():t==="fa"?X8e():K8e()}),Q8e=()=>"Updating…",J8e=()=>"正在更新…",eCe=()=>"در حال به‌روزرسانی…",tCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?J8e():t==="fa"?eCe():Q8e()}),nCe=()=>"Disable syncing",rCe=()=>"关闭同步",sCe=()=>"غیرفعال کردن همگام‌سازی",iCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rCe():t==="fa"?sCe():nCe()}),aCe=()=>"Enable GitHub syncing",oCe=()=>"启用 GitHub 同步",lCe=()=>"فعال‌سازی همگام‌سازی GitHub",cCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oCe():t==="fa"?lCe():aCe()}),uCe=()=>"Enabling…",dCe=()=>"正在启用…",fCe=()=>"در حال فعال‌سازی…",hCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dCe():t==="fa"?fCe():uCe()}),_Ce=()=>"Updating…",pCe=()=>"正在更新…",mCe=()=>"در حال به‌روزرسانی…",gCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pCe():t==="fa"?mCe():_Ce()}),bCe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,vCe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,xCe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,yCe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?vCe(e):t==="fa"?xCe(e):bCe(e)}),wCe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,SCe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,kCe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,CCe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?SCe(e):t==="fa"?kCe(e):wCe(e)}),ECe=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,NCe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,zCe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,jCe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?NCe(e):t==="fa"?zCe(e):ECe(e)}),ACe=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,TCe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,MCe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,RCe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?TCe(e):t==="fa"?MCe(e):ACe(e)}),DCe=()=>"CLI is retrying…",LCe=()=>"CLI 正在重试…",OCe=()=>"CLI در حال تلاش دوباره است…",ICe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LCe():t==="fa"?OCe():DCe()}),BCe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,$Ce=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,HCe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,PCe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$Ce(e):t==="fa"?HCe(e):BCe(e)}),FCe=()=>"Sending again…",UCe=()=>"正在重新发送…",qCe=()=>"در حال ارسال دوباره…",GCe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UCe():t==="fa"?qCe():FCe()}),VCe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,WCe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,KCe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,YCe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?WCe(e):t==="fa"?KCe(e):VCe(e)}),XCe=()=>"Retrying…",ZCe=()=>"正在重试…",QCe=()=>"در حال تلاش دوباره…",wN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZCe():t==="fa"?QCe():XCe()}),JCe=()=>"Default speed",e9e=()=>"默认速度",t9e=()=>"سرعت پیش‌فرض",n9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?e9e():t==="fa"?t9e():JCe()}),r9e=()=>"Standard",s9e=()=>"标准",i9e=()=>"استاندارد",a9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?s9e():t==="fa"?i9e():r9e()}),o9e=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,l9e=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,c9e=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,u9e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?l9e(e):t==="fa"?c9e(e):o9e(e)}),d9e=()=>"Appearance",f9e=()=>"外观",h9e=()=>"ظاهر",_9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f9e():t==="fa"?h9e():d9e()}),p9e=()=>"Check",m9e=()=>"检查",g9e=()=>"بررسی",b9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m9e():t==="fa"?g9e():p9e()}),v9e=()=>"Check again",x9e=()=>"再次检查",y9e=()=>"بررسی دوباره",$h=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?x9e():t==="fa"?y9e():v9e()}),w9e=()=>"Check for updates",S9e=()=>"检查更新",k9e=()=>"بررسی به‌روزرسانی",C9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S9e():t==="fa"?k9e():w9e()}),E9e=()=>"Check now",N9e=()=>"立即检查",z9e=()=>"اکنون بررسی کن",j9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?N9e():t==="fa"?z9e():E9e()}),A9e=()=>"Check setup",T9e=()=>"检查设置",M9e=()=>"بررسی راه‌اندازی",R9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?T9e():t==="fa"?M9e():A9e()}),D9e=()=>"orx checks a few times a day on its own.",L9e=()=>"orx 每天会自动检查几次。",O9e=()=>"orx روزی چند بار خودکار بررسی می‌کند.",I9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?L9e():t==="fa"?O9e():D9e()}),B9e=()=>"Choose a flavor",$9e=()=>"选择配置",H9e=()=>"انتخاب پیکربندی",P9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$9e():t==="fa"?H9e():B9e()}),F9e=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,U9e=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,q9e=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,G9e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?U9e(e):t==="fa"?q9e(e):F9e(e)}),V9e=()=>"clean",W9e=()=>"无更改",K9e=()=>"بدون تغییر",Y9e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?W9e():t==="fa"?K9e():V9e()}),X9e=e=>`Already linked at ${e==null?void 0:e.link}.`,Z9e=e=>`已链接到 ${e==null?void 0:e.link}。`,Q9e=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,J9e=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Z9e(e):t==="fa"?Q9e(e):X9e(e)}),eEe=e=>`Linked ${e==null?void 0:e.link}.`,tEe=e=>`已链接 ${e==null?void 0:e.link}。`,nEe=e=>`${e==null?void 0:e.link} پیوند شد.`,rEe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?tEe(e):t==="fa"?nEe(e):eEe(e)}),sEe=()=>"Connect",iEe=()=>"连接",aEe=()=>"اتصال",Gx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iEe():t==="fa"?aEe():sEe()}),oEe=()=>"Connected via GitHub CLI",lEe=()=>"已通过 GitHub CLI 连接",cEe=()=>"از طریق GitHub CLI متصل است",SN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lEe():t==="fa"?cEe():oEe()}),uEe=()=>"Connecting…",dEe=()=>"正在连接…",fEe=()=>"در حال اتصال…",kN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dEe():t==="fa"?fEe():uEe()}),hEe=e=>`CPU cores: ${e==null?void 0:e.count}`,_Ee=e=>`${e==null?void 0:e.count} 个 CPU 核心`,pEe=e=>`${e==null?void 0:e.count} هستهٔ CPU`,mEe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ee(e):t==="fa"?pEe(e):hEe(e)}),gEe=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",bEe=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",vEe=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",xEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bEe():t==="fa"?vEe():gEe()}),yEe=()=>"the current project",wEe=()=>"当前项目",SEe=()=>"پروژهٔ فعلی",kEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wEe():t==="fa"?SEe():yEe()}),CEe=e=>`${e==null?void 0:e.value} (custom)`,EEe=e=>`${e==null?void 0:e.value}(自定义)`,NEe=e=>`${e==null?void 0:e.value} (سفارشی)`,zEe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?EEe(e):t==="fa"?NEe(e):CEe(e)}),jEe=()=>"detached",AEe=()=>"分离头指针",TEe=()=>"جدا از شاخه",CN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AEe():t==="fa"?TEe():jEe()}),MEe=()=>"Disconnected",REe=()=>"已断开连接",DEe=()=>"قطع اتصال",EN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?REe():t==="fa"?DEe():MEe()}),LEe=()=>"Environment tab",OEe=()=>"环境标签页",IEe=()=>"زبانهٔ محیط",BEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OEe():t==="fa"?IEe():LEe()}),$Ee=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,HEe=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,PEe=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,FEe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HEe(e):t==="fa"?PEe(e):$Ee(e)}),UEe=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",qEe=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",GEe=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",VEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qEe():t==="fa"?GEe():UEe()}),WEe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",KEe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",YEe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",XEe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KEe():t==="fa"?YEe():WEe()}),ZEe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",QEe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",JEe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",eNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QEe():t==="fa"?JEe():ZEe()}),tNe=e=>`GPU × ${e==null?void 0:e.count}`,nNe=e=>`${e==null?void 0:e.count} 个 GPU`,rNe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,sNe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?nNe(e):t==="fa"?rNe(e):tNe(e)}),iNe=()=>"has changes",aNe=()=>"有更改",oNe=()=>"دارای تغییر",lNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aNe():t==="fa"?oNe():iNe()}),cNe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,uNe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,dNe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,fNe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?uNe(e):t==="fa"?dNe(e):cNe(e)}),hNe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",_Ne=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",pNe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",mNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ne():t==="fa"?pNe():hNe()}),gNe=()=>"Install",bNe=()=>"安装",vNe=()=>"نصب",xNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bNe():t==="fa"?vNe():gNe()}),yNe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,wNe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,SNe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,kNe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?wNe(e):t==="fa"?SNe(e):yNe(e)}),CNe=e=>`Install the ${e==null?void 0:e.command} command`,ENe=e=>`安装 ${e==null?void 0:e.command} 命令`,NNe=e=>`نصب فرمان ${e==null?void 0:e.command}`,zNe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?ENe(e):t==="fa"?NNe(e):CNe(e)}),jNe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",ANe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",TNe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",MNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ANe():t==="fa"?TNe():jNe()}),RNe=()=>"Install the new release now instead of waiting for the background update.",DNe=()=>"立即安装新版本,无需等待后台更新。",LNe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",ONe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DNe():t==="fa"?LNe():RNe()}),INe=()=>"Discard your unsaved Kubernetes changes?",BNe=()=>"要放弃未保存的 Kubernetes 更改吗?",$Ne=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",HNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BNe():t==="fa"?$Ne():INe()}),PNe=()=>"Key from",FNe=()=>"密钥来自",UNe=()=>"کلید از",qNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FNe():t==="fa"?UNe():PNe()}),GNe=()=>"Use current kubectl context",VNe=()=>"使用当前 kubectl 上下文",WNe=()=>"استفاده از کانتکست فعلی kubectl",KNe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VNe():t==="fa"?WNe():GNe()}),YNe=e=>`Use current context (${e==null?void 0:e.context})`,XNe=e=>`使用当前上下文(${e==null?void 0:e.context})`,ZNe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,QNe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?XNe(e):t==="fa"?ZNe(e):YNe(e)}),JNe=()=>"Language",eze=()=>"语言",tze=()=>"زبان",nze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eze():t==="fa"?tze():JNe()}),rze=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,sze=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,ize=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,aze=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?sze(e):t==="fa"?ize(e):rze(e)}),oze=()=>"Make default",lze=()=>"设为默认值",cze=()=>"پیش‌فرض شود",uze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lze():t==="fa"?cze():oze()}),dze=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",fze=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",hze=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",_ze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fze():t==="fa"?hze():dze()}),pze=()=>"Replace token ID",mze=()=>"替换令牌 ID",gze=()=>"جایگزینی شناسهٔ توکن",bze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mze():t==="fa"?gze():pze()}),vze=()=>"Replace token secret",xze=()=>"替换令牌密钥",yze=()=>"جایگزینی رمز توکن",wze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xze():t==="fa"?yze():vze()}),Sze=()=>"How to get a Modal token",kze=()=>"如何获取 Modal 令牌",Cze=()=>"روش دریافت توکن Modal",Eze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kze():t==="fa"?Cze():Sze()}),Nze=()=>"Token ID",zze=()=>"令牌 ID",jze=()=>"شناسهٔ توکن",Aze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zze():t==="fa"?jze():Nze()}),Tze=()=>"Token secret",Mze=()=>"令牌密钥",Rze=()=>"رمز توکن",Dze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mze():t==="fa"?Rze():Tze()}),Lze=e=>`${e==null?void 0:e.count} available — ${e==null?void 0:e.models}`,Oze=e=>`${e==null?void 0:e.count} 个可用 — ${e==null?void 0:e.models}`,Ize=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,Bze=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Oze(e):t==="fa"?Ize(e):Lze(e)}),$ze=e=>`Needs ${e==null?void 0:e.tool}`,Hze=e=>`需要 ${e==null?void 0:e.tool}`,Pze=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,Fze=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Hze(e):t==="fa"?Pze(e):$ze(e)}),Uze=()=>"Needs tools",qze=()=>"缺少工具",Gze=()=>"به ابزارها نیاز دارد",Vze=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qze():t==="fa"?Gze():Uze()}),Wze=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,Kze=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,Yze=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,Xze=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Kze(e):t==="fa"?Yze(e):Wze(e)}),Zze=()=>"New runs use SSH; choose a host when launching.",Qze=()=>"新运行将使用 SSH;启动时请选择主机。",Jze=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",eje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Qze():t==="fa"?Jze():Zze()}),tje=()=>"New token",nje=()=>"新令牌",rje=()=>"توکن جدید",sje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nje():t==="fa"?rje():tje()}),ije=()=>"No default flavor",aje=()=>"不设默认配置",oje=()=>"بدون پیکربندی پیش‌فرض",lje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aje():t==="fa"?oje():ije()}),cje=()=>"none",uje=()=>"无",dje=()=>"هیچ‌کدام",Vx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uje():t==="fa"?dje():cje()}),fje=()=>"Not connected",hje=()=>"未连接",_je=()=>"متصل نیست",NN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hje():t==="fa"?_je():fje()}),pje=()=>"not found on PATH",mje=()=>"在 PATH 中未找到",gje=()=>"در PATH پیدا نشد",bje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mje():t==="fa"?gje():pje()}),vje=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,xje=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,yje=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,wje=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?xje(e):t==="fa"?yje(e):vje(e)}),Sje=()=>"not initialized",kje=()=>"尚未初始化",Cje=()=>"راه‌اندازی نشده",Eje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kje():t==="fa"?Cje():Sje()}),Nje=()=>"Not set",zje=()=>"未设置",jje=()=>"تنظیم نشده",Aje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zje():t==="fa"?jje():Nje()}),Tje=()=>"OAuth (subscription login)",Mje=()=>"OAuth(订阅登录)",Rje=()=>"OAuth (ورود با اشتراک)",Dje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Mje():t==="fa"?Rje():Tje()}),Lje=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,Oje=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,Ije=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,Bje=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Oje(e):t==="fa"?Ije(e):Lje(e)}),$je=()=>"Setting up…",Hje=()=>"正在设置…",Pje=()=>"در حال راه‌اندازی…",Fje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Hje():t==="fa"?Pje():$je()}),Uje=()=>"Account",qje=()=>"账户",Gje=()=>"حساب",Wx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qje():t==="fa"?Gje():Uje()}),Vje=()=>"Add one with",Wje=()=>"使用以下命令添加:",Kje=()=>"یکی با این فرمان اضافه کنید:",Yje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Wje():t==="fa"?Kje():Vje()}),Xje=()=>"Add variable",Zje=()=>"添加变量",Qje=()=>"افزودن متغیر",Jje=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Zje():t==="fa"?Qje():Xje()}),eAe=()=>"Agent models",tAe=()=>"智能体模型",nAe=()=>"مدل‌های عامل",rAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tAe():t==="fa"?nAe():eAe()}),sAe=()=>"Anonymous usage analytics",iAe=()=>"匿名使用情况分析",aAe=()=>"تحلیل ناشناس استفاده",fS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iAe():t==="fa"?aAe():sAe()}),oAe=()=>"Auth",lAe=()=>"身份验证",cAe=()=>"احراز هویت",uAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lAe():t==="fa"?cAe():oAe()}),dAe=()=>"Authentication",fAe=()=>"身份验证",hAe=()=>"احراز هویت",_Ae=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fAe():t==="fa"?hAe():dAe()}),pAe=()=>"Back to Compute",mAe=()=>"返回算力设置",gAe=()=>"بازگشت به رایانش",zN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mAe():t==="fa"?gAe():pAe()}),bAe=()=>"Backend",vAe=()=>"后端",xAe=()=>"بک‌اند",yAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vAe():t==="fa"?xAe():bAe()}),wAe=()=>"Baseline",SAe=()=>"基线",kAe=()=>"خط مبنا",CAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SAe():t==="fa"?kAe():wAe()}),EAe=()=>"Binary",NAe=()=>"可执行文件",zAe=()=>"فایل اجرایی",jAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NAe():t==="fa"?zAe():EAe()}),AAe=()=>"Cancel",TAe=()=>"取消",MAe=()=>"لغو",Hh=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TAe():t==="fa"?MAe():AAe()}),RAe=()=>"Cancel new variable",DAe=()=>"取消新变量",LAe=()=>"لغو متغیر جدید",OAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DAe():t==="fa"?LAe():RAe()}),IAe=()=>"Checking compute targets…",BAe=()=>"正在检查算力目标…",$Ae=()=>"در حال بررسی مقصدهای رایانشی…",HAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BAe():t==="fa"?$Ae():IAe()}),PAe=()=>"Checking kubectl…",FAe=()=>"正在检查 kubectl…",UAe=()=>"در حال بررسی kubectl…",qAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FAe():t==="fa"?UAe():PAe()}),GAe=()=>"Checking Modal…",VAe=()=>"正在检查 Modal…",WAe=()=>"در حال بررسی Modal…",KAe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VAe():t==="fa"?WAe():GAe()}),YAe=()=>"Choose a preset flavor",XAe=()=>"选择预设规格",ZAe=()=>"یک پیکربندی آماده انتخاب کنید",hS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XAe():t==="fa"?ZAe():YAe()}),QAe=()=>"cluster default",JAe=()=>"集群默认值",eTe=()=>"پیش‌فرض خوشه",_S=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JAe():t==="fa"?eTe():QAe()}),tTe=()=>"cluster default (e.g. 4h, 30m)",nTe=()=>"集群默认值(例如 4h、30m)",rTe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",sTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nTe():t==="fa"?rTe():tTe()}),iTe=()=>"Cluster unreachable",aTe=()=>"无法连接集群",oTe=()=>"خوشه در دسترس نیست",lTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aTe():t==="fa"?oTe():iTe()}),cTe=()=>"Compute",uTe=()=>"算力",dTe=()=>"رایانش",jN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uTe():t==="fa"?dTe():cTe()}),fTe=()=>"Connect compute backends and choose where new runs execute.",hTe=()=>"连接算力后端,并选择新运行的执行位置。",_Te=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",pTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hTe():t==="fa"?_Te():fTe()}),mTe=()=>"Connected",gTe=()=>"已连接",bTe=()=>"متصل",vTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gTe():t==="fa"?bTe():mTe()}),xTe=()=>"Context",yTe=()=>"上下文",wTe=()=>"زمینه",STe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yTe():t==="fa"?wTe():xTe()}),kTe=()=>"Current",CTe=()=>"当前",ETe=()=>"فعلی",NTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CTe():t==="fa"?ETe():kTe()}),zTe=()=>"Currently off:",jTe=()=>"当前已关闭:",ATe=()=>"اکنون خاموش است:",TTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jTe():t==="fa"?ATe():zTe()}),MTe=()=>"Custom flavor",RTe=()=>"自定义规格",DTe=()=>"پیکربندی سفارشی",LTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RTe():t==="fa"?DTe():MTe()}),OTe=()=>"Custom flavor…",ITe=()=>"自定义规格…",BTe=()=>"پیکربندی سفارشی…",$Te=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ITe():t==="fa"?BTe():OTe()}),HTe=()=>"Data directory",PTe=()=>"数据目录",FTe=()=>"پوشهٔ داده",UTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PTe():t==="fa"?FTe():HTe()}),qTe=()=>"default",GTe=()=>"默认",VTe=()=>"پیش‌فرض",WTe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GTe():t==="fa"?VTe():qTe()}),KTe=()=>"Default",YTe=()=>"默认",XTe=()=>"پیش‌فرض",AN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YTe():t==="fa"?XTe():KTe()}),ZTe=()=>"Default destination",QTe=()=>"默认目标",JTe=()=>"مقصد پیش‌فرض",eMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QTe():t==="fa"?JTe():ZTe()}),tMe=()=>"Detecting hardware…",nMe=()=>"正在检测硬件…",rMe=()=>"در حال شناسایی سخت‌افزار…",sMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nMe():t==="fa"?rMe():tMe()}),iMe=()=>"Detecting harnesses…",aMe=()=>"正在检测智能体工具…",oMe=()=>"در حال شناسایی ابزارهای عامل…",lMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aMe():t==="fa"?oMe():iMe()}),cMe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",uMe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",dMe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",fMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uMe():t==="fa"?dMe():cMe()}),hMe=()=>"Effective URL",_Me=()=>"实际使用的网址",pMe=()=>"نشانی مؤثر",mMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Me():t==="fa"?pMe():hMe()}),gMe=()=>"Enable GitHub syncing for new projects",bMe=()=>"为新项目启用 GitHub 同步",vMe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",pS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bMe():t==="fa"?vMe():gMe()}),xMe=()=>"Environment",yMe=()=>"环境",wMe=()=>"محیط",TN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yMe():t==="fa"?wMe():xMe()}),SMe=()=>"Failed",kMe=()=>"失败",CMe=()=>"ناموفق",Kx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kMe():t==="fa"?CMe():SMe()}),EMe=()=>"General",NMe=()=>"常规",zMe=()=>"عمومی",jMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NMe():t==="fa"?zMe():EMe()}),AMe=()=>"GitHub publishing",TMe=()=>"GitHub 发布",MMe=()=>"انتشار در GitHub",RMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TMe():t==="fa"?MMe():AMe()}),DMe=()=>"Git token",LMe=()=>"Git 令牌",OMe=()=>"توکن Git",IMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LMe():t==="fa"?OMe():DMe()}),BMe=()=>"Harnesses",$Me=()=>"智能体工具",HMe=()=>"ابزارهای عامل",PMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Me():t==="fa"?HMe():BMe()}),FMe=()=>"hf_…",UMe=()=>"hf_…",qMe=()=>"hf_…",GMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UMe():t==="fa"?qMe():FMe()}),VMe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",WMe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",KMe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",YMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WMe():t==="fa"?KMe():VMe()}),XMe=()=>"Initialize Git",ZMe=()=>"初始化 Git",QMe=()=>"راه‌اندازی Git",JMe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZMe():t==="fa"?QMe():XMe()}),eRe=()=>"Install",tRe=()=>"安装",nRe=()=>"نصب",MN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tRe():t==="fa"?nRe():eRe()}),rRe=()=>"Install broken",sRe=()=>"安装损坏",iRe=()=>"نصب خراب است",aRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sRe():t==="fa"?iRe():rRe()}),oRe=()=>"Install GitHub CLI",lRe=()=>"安装 GitHub CLI",cRe=()=>"نصب GitHub CLI",uRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lRe():t==="fa"?cRe():oRe()}),dRe=()=>"Install updates automatically",fRe=()=>"自动安装更新",hRe=()=>"نصب خودکار به‌روزرسانی‌ها",mS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fRe():t==="fa"?hRe():dRe()}),_Re=()=>"Instance history",pRe=()=>"实例历史",mRe=()=>"تاریخچهٔ نمونه‌ها",gRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pRe():t==="fa"?mRe():_Re()}),bRe=()=>"Invalid Token",vRe=()=>"令牌无效",xRe=()=>"توکن نامعتبر",yRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vRe():t==="fa"?xRe():bRe()}),wRe=()=>"Jobs / Dashboard URL",SRe=()=>"Jobs / 控制台网址",kRe=()=>"نشانی Jobs / داشبورد",CRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SRe():t==="fa"?kRe():wRe()}),ERe=()=>"kubectl not found",NRe=()=>"未找到 kubectl",zRe=()=>"kubectl پیدا نشد",jRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NRe():t==="fa"?zRe():ERe()}),ARe=()=>"Latest",TRe=()=>"最新版本",MRe=()=>"جدیدترین",RRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TRe():t==="fa"?MRe():ARe()}),DRe=()=>"Loading…",LRe=()=>"正在加载…",ORe=()=>"در حال بارگیری…",Pl=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LRe():t==="fa"?ORe():DRe()}),IRe=()=>"Loading Ray settings…",BRe=()=>"正在加载 Ray 设置…",$Re=()=>"در حال بارگیری تنظیمات Ray…",HRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BRe():t==="fa"?$Re():IRe()}),PRe=()=>"Loading slurm settings…",FRe=()=>"正在加载 Slurm 设置…",URe=()=>"در حال بارگیری تنظیمات Slurm…",qRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FRe():t==="fa"?URe():PRe()}),GRe=()=>"Loading status…",VRe=()=>"正在加载状态…",WRe=()=>"در حال بارگیری وضعیت…",KRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VRe():t==="fa"?WRe():GRe()}),YRe=()=>"Local only",XRe=()=>"仅本地",ZRe=()=>"فقط محلی",QRe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XRe():t==="fa"?ZRe():YRe()}),JRe=()=>"Local repository",eDe=()=>"本地仓库",tDe=()=>"مخزن محلی",nDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eDe():t==="fa"?tDe():JRe()}),rDe=()=>"Login node",sDe=()=>"登录节点",iDe=()=>"گرهٔ ورود",aDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sDe():t==="fa"?iDe():rDe()}),oDe=()=>"Make GitHub syncing the default?",lDe=()=>"将 GitHub 同步设为默认值?",cDe=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",uDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lDe():t==="fa"?cDe():oDe()}),dDe=()=>"Missing bash/tar",fDe=()=>"缺少 bash/tar",hDe=()=>"bash/tar موجود نیست",_De=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fDe():t==="fa"?hDe():dDe()}),pDe=()=>"More compute options",mDe=()=>"更多算力选项",gDe=()=>"گزینه‌های رایانشی بیشتر",bDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mDe():t==="fa"?gDe():pDe()}),vDe=()=>"Move failed:",xDe=()=>"移动失败:",yDe=()=>"انتقال ناموفق بود:",wDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xDe():t==="fa"?yDe():vDe()}),SDe=()=>"Moved. orx is now using the new location.",kDe=()=>"已移动。orx 现在使用新位置。",CDe=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",EDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kDe():t==="fa"?CDe():SDe()}),NDe=()=>"Namespace",zDe=()=>"命名空间",jDe=()=>"فضای نام",ADe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zDe():t==="fa"?jDe():NDe()}),TDe=()=>"New location",MDe=()=>"新位置",RDe=()=>"محل جدید",DDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MDe():t==="fa"?RDe():TDe()}),LDe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",ODe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",IDe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",BDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ODe():t==="fa"?IDe():LDe()}),$De=()=>"New variable key",HDe=()=>"新变量键名",PDe=()=>"کلید متغیر جدید",FDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HDe():t==="fa"?PDe():$De()}),UDe=()=>"New variable value",qDe=()=>"新变量值",GDe=()=>"مقدار متغیر جدید",VDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qDe():t==="fa"?GDe():UDe()}),WDe=()=>"No code, prompts, file contents, or account identifiers are sent.",KDe=()=>"不会发送代码、提示词、文件内容或账户标识符。",YDe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",XDe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KDe():t==="fa"?YDe():WDe()}),ZDe=()=>"No hosts found in ~/.ssh/config.",QDe=()=>"在 ~/.ssh/config 中未找到主机。",JDe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",eLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QDe():t==="fa"?JDe():ZDe()}),tLe=()=>"No job-create permission",nLe=()=>"没有创建 Job 的权限",rLe=()=>"مجوز ساخت Job وجود ندارد",sLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nLe():t==="fa"?rLe():tLe()}),iLe=()=>"No Write Permissions",aLe=()=>"无写入权限",oLe=()=>"بدون مجوز نوشتن",lLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aLe():t==="fa"?oLe():iLe()}),cLe=()=>"No key on this computer to register — load a registered key with",uLe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",dLe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",fLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uLe():t==="fa"?dLe():cLe()}),hLe=()=>"No key on this computer yet — create one with",_Le=()=>"此计算机上还没有密钥——使用以下命令创建:",pLe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",mLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Le():t==="fa"?pLe():hLe()}),gLe=()=>"No Slurm CLI",bLe=()=>"无 Slurm CLI",vLe=()=>"بدون CLI اسلورم",xLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bLe():t==="fa"?vLe():gLe()}),yLe=()=>"None registered",wLe=()=>"未注册任何密钥",SLe=()=>"هیچ‌کدام ثبت نشده",kLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wLe():t==="fa"?SLe():yLe()}),CLe=()=>"Not checked",ELe=()=>"未检查",NLe=()=>"بررسی نشده",RN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ELe():t==="fa"?NLe():CLe()}),zLe=()=>"Not configured",jLe=()=>"未配置",ALe=()=>"پیکربندی نشده",rm=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jLe():t==="fa"?ALe():zLe()}),TLe=()=>"Not installed",MLe=()=>"未安装",RLe=()=>"نصب نیست",DLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MLe():t==="fa"?RLe():TLe()}),LLe=()=>"Not now",OLe=()=>"暂不",ILe=()=>"اکنون نه",BLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OLe():t==="fa"?ILe():LLe()}),$Le=()=>"Not on this computer",HLe=()=>"不在此计算机上",PLe=()=>"روی این رایانه نیست",FLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HLe():t==="fa"?PLe():$Le()}),ULe=()=>"Not set (pass --host per launch)",qLe=()=>"未设置(每次启动时传入 --host)",GLe=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",VLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qLe():t==="fa"?GLe():ULe()}),WLe=()=>"Not signed in",KLe=()=>"未登录",YLe=()=>"وارد نشده",DN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KLe():t==="fa"?YLe():WLe()}),XLe=()=>"On this computer",ZLe=()=>"在此计算机上",QLe=()=>"روی این رایانه",JLe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZLe():t==="fa"?QLe():XLe()}),eOe=()=>"Open a project to inspect its repository and GitHub publication state.",tOe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",nOe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",rOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tOe():t==="fa"?nOe():eOe()}),sOe=()=>"Open job page",iOe=()=>"打开作业页面",aOe=()=>"باز کردن صفحهٔ کار",gS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iOe():t==="fa"?aOe():sOe()}),oOe=()=>"Open on GitHub",lOe=()=>"在 GitHub 上打开",cOe=()=>"باز کردن در GitHub",bS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lOe():t==="fa"?cOe():oOe()}),uOe=()=>", or create one with",dOe=()=>",或使用以下命令创建:",fOe=()=>"، یا با این فرمان یکی بسازید:",hOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dOe():t==="fa"?fOe():uOe()}),_Oe=()=>"Org",pOe=()=>"组织",mOe=()=>"سازمان",gOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),bOe=()=>"Orgs",vOe=()=>"组织",xOe=()=>"سازمان‌ها",yOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vOe():t==="fa"?xOe():bOe()}),wOe=()=>"orx can't update this install",SOe=()=>"orx 无法更新此安装",kOe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",COe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SOe():t==="fa"?kOe():wOe()}),EOe=()=>"Overleaf",NOe=()=>"Overleaf",zOe=()=>"Overleaf",LN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NOe():t==="fa"?zOe():EOe()}),jOe=()=>"Overleaf Git authentication token",AOe=()=>"Overleaf Git 身份验证令牌",TOe=()=>"توکن احراز هویت Git در Overleaf",MOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?AOe():t==="fa"?TOe():jOe()}),ROe=()=>"Overridden by env",DOe=()=>"已被环境变量覆盖",LOe=()=>"بازنویسی‌شده توسط محیط",OOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?DOe():t==="fa"?LOe():ROe()}),IOe=()=>"Partition",BOe=()=>"分区",$Oe=()=>"پارتیشن",HOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BOe():t==="fa"?$Oe():IOe()}),POe=()=>"Path",FOe=()=>"路径",UOe=()=>"مسیر",qOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FOe():t==="fa"?UOe():POe()}),GOe=()=>"Plan",VOe=()=>"方案",WOe=()=>"سطح اشتراک",KOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VOe():t==="fa"?WOe():GOe()}),YOe=()=>"Project",XOe=()=>"项目",ZOe=()=>"پروژه",QOe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XOe():t==="fa"?ZOe():YOe()}),JOe=()=>"Ray version",eIe=()=>"Ray 版本",tIe=()=>"نسخهٔ Ray",nIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eIe():t==="fa"?tIe():JOe()}),rIe=()=>"Reachable",sIe=()=>"可访问",iIe=()=>"در دسترس",aIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sIe():t==="fa"?iIe():rIe()}),oIe=()=>"Reading ~/.ssh/config…",lIe=()=>"正在读取 ~/.ssh/config…",cIe=()=>"در حال خواندن ‎~/.ssh/config…",ON=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lIe():t==="fa"?cIe():oIe()}),uIe=()=>"Ready",dIe=()=>"就绪",fIe=()=>"آماده",Ph=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dIe():t==="fa"?fIe():uIe()}),hIe=()=>"Ready to move",_Ie=()=>"可以移动",pIe=()=>"آمادهٔ انتقال",mIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ie():t==="fa"?pIe():hIe()}),gIe=()=>"Configured",bIe=()=>"已配置",vIe=()=>"پیکربندی‌شده",Yx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bIe():t==="fa"?vIe():gIe()}),xIe=()=>"Refresh",yIe=()=>"刷新",wIe=()=>"تازه‌سازی",Fh=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yIe():t==="fa"?wIe():xIe()}),SIe=()=>"Remotes",kIe=()=>"远程仓库",CIe=()=>"مخزن‌های دوردست",EIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kIe():t==="fa"?CIe():SIe()}),NIe=()=>"Repository",zIe=()=>"仓库",jIe=()=>"مخزن",AIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zIe():t==="fa"?jIe():NIe()}),TIe=()=>"Restart to finish updating",MIe=()=>"重新启动以完成更新",RIe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",DIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MIe():t==="fa"?RIe():TIe()}),LIe=()=>"Running instances",OIe=()=>"正在运行的实例",IIe=()=>"نمونه‌های در حال اجرا",BIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OIe():t==="fa"?IIe():LIe()}),$Ie=()=>"Runtime",HIe=()=>"运行时间",PIe=()=>"زمان اجرا",FIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HIe():t==="fa"?PIe():$Ie()}),UIe=()=>". Save it under that key if it's meant for HF Jobs.",qIe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",GIe=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",VIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qIe():t==="fa"?GIe():UIe()}),WIe=()=>"Settings",KIe=()=>"设置",YIe=()=>"تنظیمات",Xx=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KIe():t==="fa"?YIe():WIe()}),XIe=()=>"Signed in",ZIe=()=>"已登录",QIe=()=>"وارد شده",JIe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZIe():t==="fa"?QIe():XIe()}),eBe=()=>"Source",tBe=()=>"来源",nBe=()=>"منبع",IN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tBe():t==="fa"?nBe():eBe()}),rBe=()=>"SSH Key",sBe=()=>"SSH 密钥",iBe=()=>"کلید SSH",aBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sBe():t==="fa"?iBe():rBe()}),oBe=()=>"Started",lBe=()=>"开始时间",cBe=()=>"آغاز",uBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lBe():t==="fa"?cBe():oBe()}),dBe=()=>"State",fBe=()=>"状态",hBe=()=>"وضعیت",_Be=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fBe():t==="fa"?hBe():dBe()}),pBe=()=>"Status",mBe=()=>"状态",gBe=()=>"وضعیت",kd=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mBe():t==="fa"?gBe():pBe()}),bBe=()=>"Storage",vBe=()=>"存储",xBe=()=>"ذخیره‌سازی",yBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vBe():t==="fa"?xBe():bBe()}),wBe=()=>"Sync",SBe=()=>"同步",kBe=()=>"همگام‌سازی",CBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SBe():t==="fa"?kBe():wBe()}),EBe=()=>"Syncing off",NBe=()=>"同步已关闭",zBe=()=>"همگام‌سازی خاموش",jBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NBe():t==="fa"?zBe():EBe()}),ABe=()=>"Test connection",TBe=()=>"测试连接",MBe=()=>"آزمایش اتصال",RBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TBe():t==="fa"?MBe():ABe()}),DBe=()=>"Testing…",LBe=()=>"正在测试…",OBe=()=>"در حال آزمایش…",IBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LBe():t==="fa"?OBe():DBe()}),BBe=()=>", then add it with",$Be=()=>",然后使用以下命令添加:",HBe=()=>"، سپس با این فرمان اضافه‌اش کنید:",PBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$Be():t==="fa"?HBe():BBe()}),FBe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",UBe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",qBe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",GBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UBe():t==="fa"?qBe():FBe()}),VBe=()=>"This saved destination is not configured. Set it up below or choose another backend.",WBe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",KBe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",YBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WBe():t==="fa"?KBe():VBe()}),XBe=()=>"This value looks like a Hugging Face token — compute runs only read it from",ZBe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",QBe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",JBe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZBe():t==="fa"?QBe():XBe()}),e$e=()=>"Time limit",t$e=()=>"时间限制",n$e=()=>"محدودیت زمانی",r$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?t$e():t==="fa"?n$e():e$e()}),s$e=()=>"Unable to verify",i$e=()=>"无法验证",a$e=()=>"تأیید ممکن نیست",Yv=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?i$e():t==="fa"?a$e():s$e()}),o$e=()=>"Unknown",l$e=()=>"未知",c$e=()=>"نامشخص",u$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?l$e():t==="fa"?c$e():o$e()}),d$e=()=>"Update required",f$e=()=>"需要更新",h$e=()=>"نیازمند به‌روزرسانی",_$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?f$e():t==="fa"?h$e():d$e()}),p$e=()=>"Updates",m$e=()=>"更新",g$e=()=>"به‌روزرسانی‌ها",vS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?m$e():t==="fa"?g$e():p$e()}),b$e=()=>"Usage analytics",v$e=()=>"使用情况分析",x$e=()=>"تحلیل استفاده",y$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?v$e():t==="fa"?x$e():b$e()}),w$e=()=>"value",S$e=()=>"值",k$e=()=>"مقدار",BN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?S$e():t==="fa"?k$e():w$e()}),C$e=()=>"Variables available to runs and the research agent (API keys, tokens).",E$e=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",N$e=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",z$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?E$e():t==="fa"?N$e():C$e()}),j$e=()=>"Version",A$e=()=>"版本",T$e=()=>"نسخه",$N=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?A$e():t==="fa"?T$e():j$e()}),M$e=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",R$e=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",D$e=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",L$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?R$e():t==="fa"?D$e():M$e()}),O$e=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",I$e=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",B$e=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",$$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?I$e():t==="fa"?B$e():O$e()}),H$e=()=>"Pick a login node first",P$e=()=>"请先选择登录节点",F$e=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",U$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?P$e():t==="fa"?F$e():H$e()}),q$e=()=>"Providers",G$e=()=>"提供商",V$e=()=>"ارائه‌دهندگان",W$e=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?G$e():t==="fa"?V$e():q$e()}),K$e=()=>"Reconnect",Y$e=()=>"重新连接",X$e=()=>"اتصال دوباره",HN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Y$e():t==="fa"?X$e():K$e()}),Z$e=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,Q$e=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,J$e=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,eHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?Q$e(e):t==="fa"?J$e(e):Z$e(e)}),tHe=()=>"Reinstall with the orx installer to get automatic updates.",nHe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",rHe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",sHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nHe():t==="fa"?rHe():tHe()}),iHe=()=>"Re-link",aHe=()=>"重新链接",oHe=()=>"پیوند دوباره",lHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aHe():t==="fa"?oHe():iHe()}),cHe=()=>"Remove token",uHe=()=>"移除令牌",dHe=()=>"حذف توکن",fHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uHe():t==="fa"?dHe():cHe()}),hHe=()=>"Removing…",_He=()=>"正在移除…",pHe=()=>"در حال حذف…",mHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_He():t==="fa"?pHe():hHe()}),gHe=()=>"Replace anyway",bHe=()=>"仍要替换",vHe=()=>"به‌هرحال جایگزین کن",xHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bHe():t==="fa"?vHe():gHe()}),yHe=()=>"Replace key",wHe=()=>"替换密钥",SHe=()=>"جایگزینی کلید",kHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wHe():t==="fa"?SHe():yHe()}),CHe=()=>"Replace token",EHe=()=>"替换令牌",NHe=()=>"جایگزینی توکن",zHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EHe():t==="fa"?NHe():CHe()}),jHe=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,AHe=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,THe=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,MHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AHe(e):t==="fa"?THe(e):jHe(e)}),RHe=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,DHe=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,LHe=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,OHe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?DHe(e):t==="fa"?LHe(e):RHe(e)}),IHe=()=>"Run `gh auth login` in your terminal.",BHe=()=>"请在终端中运行 `gh auth login`。",$He=()=>"در پایانه `gh auth login` را اجرا کنید.",HHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BHe():t==="fa"?$He():IHe()}),PHe=()=>"Saved",FHe=()=>"已保存",UHe=()=>"ذخیره شده",qHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FHe():t==="fa"?UHe():PHe()}),GHe=()=>"Set up",VHe=()=>"设置",WHe=()=>"راه‌اندازی",KHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VHe():t==="fa"?WHe():GHe()}),YHe=()=>"Set up SSH key",XHe=()=>"设置 SSH 密钥",ZHe=()=>"راه‌اندازی کلید SSH",QHe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),JHe=()=>"Sign in",ePe=()=>"登录",tPe=()=>"ورود",PN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ePe():t==="fa"?tPe():JHe()}),nPe=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,rPe=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,sPe=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,FN=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?rPe(e):t==="fa"?sPe(e):nPe(e)}),iPe=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",aPe=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",oPe=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",lPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aPe():t==="fa"?oPe():iPe()}),cPe=()=>"The terminal disconnected before setup completed. Try again.",uPe=()=>"设置完成前终端连接已断开。请重试。",dPe=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",xS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uPe():t==="fa"?dPe():cPe()}),fPe=()=>"Dark",hPe=()=>"深色",_Pe=()=>"تیره",pPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?hPe():t==="fa"?_Pe():fPe()}),mPe=()=>"Theme",gPe=()=>"主题",bPe=()=>"پوسته",yS=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gPe():t==="fa"?bPe():mPe()}),vPe=()=>"Light",xPe=()=>"浅色",yPe=()=>"روشن",wPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xPe():t==="fa"?yPe():vPe()}),SPe=()=>"System",kPe=()=>"系统",CPe=()=>"سیستم",EPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kPe():t==="fa"?CPe():SPe()}),NPe=()=>"Set up billing in the Tinker console",zPe=()=>"在 Tinker 控制台设置账单",jPe=()=>"تنظیم پرداخت در کنسول Tinker",APe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zPe():t==="fa"?jPe():NPe()}),TPe=()=>"Billing setup required",MPe=()=>"需要设置账单",RPe=()=>"تنظیم پرداخت لازم است",DPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?MPe():t==="fa"?RPe():TPe()}),LPe=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",OPe=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",IPe=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",BPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OPe():t==="fa"?IPe():LPe()}),$Pe=()=>"Invalid Key",HPe=()=>"密钥无效",PPe=()=>"کلید نامعتبر",FPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HPe():t==="fa"?PPe():$Pe()}),UPe=()=>"Token from",qPe=()=>"令牌来自",GPe=()=>"توکن از",VPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qPe():t==="fa"?GPe():UPe()}),WPe=()=>"Update now",KPe=()=>"立即更新",YPe=()=>"اکنون به‌روزرسانی کن",XPe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KPe():t==="fa"?YPe():WPe()}),ZPe=e=>`Update to ${e==null?void 0:e.version}`,QPe=e=>`更新到 ${e==null?void 0:e.version}`,JPe=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,eFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?QPe(e):t==="fa"?JPe(e):ZPe(e)}),tFe=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",nFe=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",rFe=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",sFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nFe():t==="fa"?rFe():tFe()}),iFe=()=>"Updating default destination…",aFe=()=>"正在更新默认运行位置…",oFe=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",lFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aFe():t==="fa"?oFe():iFe()}),cFe=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",uFe=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",dFe=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",fFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uFe():t==="fa"?dFe():cFe()}),hFe=()=>"Validating…",_Fe=()=>"正在验证…",pFe=()=>"در حال اعتبارسنجی…",UN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Fe():t==="fa"?pFe():hFe()}),mFe=()=>"View settings",gFe=()=>"查看设置",bFe=()=>"مشاهدهٔ تنظیمات",vFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gFe():t==="fa"?bFe():mFe()}),xFe=()=>"Skill",yFe=()=>"技能",wFe=()=>"مهارت",qN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yFe():t==="fa"?wFe():xFe()}),SFe=()=>"Loading skill…",kFe=()=>"正在加载技能…",CFe=()=>"در حال بارگیری مهارت…",EFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kFe():t==="fa"?CFe():SFe()}),NFe=e=>`Delete the “${e==null?void 0:e.name}” skill?`,zFe=e=>`删除技能“${e==null?void 0:e.name}”?`,jFe=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,AFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?zFe(e):t==="fa"?jFe(e):NFe(e)}),TFe=e=>`Delete skill ${e==null?void 0:e.name}`,MFe=e=>`删除技能 ${e==null?void 0:e.name}`,RFe=e=>`حذف مهارت ${e==null?void 0:e.name}`,DFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MFe(e):t==="fa"?RFe(e):TFe(e)}),LFe=e=>`Delete the “${e==null?void 0:e.name}” template?`,OFe=e=>`删除模板“${e==null?void 0:e.name}”?`,IFe=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,BFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OFe(e):t==="fa"?IFe(e):LFe(e)}),$Fe=e=>`Delete template ${e==null?void 0:e.name}`,HFe=e=>`删除模板 ${e==null?void 0:e.name}`,PFe=e=>`حذف قالب ${e==null?void 0:e.name}`,FFe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?HFe(e):t==="fa"?PFe(e):$Fe(e)}),UFe=()=>"SKILL.md folders the agent discovers on its own and you invoke with /name in chat. Skills installed in your coding agents are picked up automatically.",qFe=()=>"智能体会自动发现的 SKILL.md 技能文件夹,你可以在聊天中通过 /name 调用。你的编码智能体中已安装的技能会自动纳入。",GFe=()=>"پوشه‌های SKILL.md که عامل خودش پیدا می‌کند و شما با ‎/name در گفتگو فراخوانی می‌کنید. مهارت‌های نصب‌شده در عامل‌های کدنویسی شما به‌طور خودکار در نظر گرفته می‌شوند.",VFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qFe():t==="fa"?GFe():UFe()}),WFe=()=>"Drop a SKILL.md or .zip here, or click to choose",KFe=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",YFe=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",XFe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KFe():t==="fa"?YFe():WFe()}),ZFe=()=>"Drop a .tex or .zip here, or click to choose",QFe=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",JFe=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",eUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QFe():t==="fa"?JFe():ZFe()}),tUe=()=>"File too large (max 20 MB).",nUe=()=>"文件过大(最大 20 MB)。",rUe=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",GN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nUe():t==="fa"?rUe():tUe()}),sUe=()=>" + 1 file",iUe=()=>" + 1 个文件",aUe=()=>" + ۱ فایل",oUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iUe():t==="fa"?aUe():sUe()}),lUe=()=>"What the agent brings to every session, in every project: the skills it can use, and the LaTeX templates it writes papers into.",cUe=()=>"智能体在每个项目的每个会话中都会携带的内容:可用的技能,以及撰写论文所用的 LaTeX 模板。",uUe=()=>"آنچه عامل در هر نشست و در همهٔ پروژه‌ها همراه دارد: مهارت‌هایی که می‌تواند استفاده کند و قالب‌های LaTeX که مقاله‌ها را با آن‌ها می‌نویسد.",dUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cUe():t==="fa"?uUe():lUe()}),fUe=e=>` + ${e==null?void 0:e.count} files`,hUe=e=>` + ${e==null?void 0:e.count} 个文件`,_Ue=e=>` + ${e==null?void 0:e.count} فایل`,pUe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?hUe(e):t==="fa"?_Ue(e):fUe(e)}),mUe=()=>"Could not load skills:",gUe=()=>"无法加载技能:",bUe=()=>"بارگیری مهارت‌ها ممکن نشد:",vUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?gUe():t==="fa"?bUe():mUe()}),xUe=()=>"Could not load templates:",yUe=()=>"无法加载模板:",wUe=()=>"بارگیری قالب‌ها ممکن نشد:",SUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?yUe():t==="fa"?wUe():xUe()}),kUe=()=>"Customize",CUe=()=>"自定义",EUe=()=>"سفارشی‌سازی",NUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?CUe():t==="fa"?EUe():kUe()}),zUe=()=>"Delete skill",jUe=()=>"删除技能",AUe=()=>"حذف مهارت",TUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?jUe():t==="fa"?AUe():zUe()}),MUe=()=>"Delete template",RUe=()=>"删除模板",DUe=()=>"حذف قالب",LUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?RUe():t==="fa"?DUe():MUe()}),OUe=()=>"LaTeX templates",IUe=()=>"LaTeX 模板",BUe=()=>"قالب‌های LaTeX",$Ue=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?IUe():t==="fa"?BUe():OUe()}),HUe=()=>"Loading skills…",PUe=()=>"正在加载技能…",FUe=()=>"در حال بارگیری مهارت‌ها…",UUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?PUe():t==="fa"?FUe():HUe()}),qUe=()=>"Loading templates…",GUe=()=>"正在加载模板…",VUe=()=>"در حال بارگیری قالب‌ها…",WUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?GUe():t==="fa"?VUe():qUe()}),KUe=()=>"No skills yet.",YUe=()=>"尚无技能。",XUe=()=>"هنوز مهارتی وجود ندارد.",ZUe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?YUe():t==="fa"?XUe():KUe()}),QUe=()=>"No templates yet.",JUe=()=>"尚无模板。",eqe=()=>"هنوز قالبی وجود ندارد.",tqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JUe():t==="fa"?eqe():QUe()}),nqe=()=>"Skills",rqe=()=>"技能",sqe=()=>"مهارت‌ها",iqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rqe():t==="fa"?sqe():nqe()}),aqe=()=>"Uploading…",oqe=()=>"正在上传…",lqe=()=>"در حال بارگذاری…",cqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oqe():t==="fa"?lqe():aqe()}),uqe=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. With exactly one template available, the agent uses it without asking.",dqe=()=>"智能体会使用会议文档类或内部样式来撰写论文,而不是使用默认导言。请上传 .tex 文件,或包含 .cls 和 .sty 文件的 .zip 压缩包。当恰好只有一个模板可用时,智能体会直接使用,无需询问。",fqe=()=>"عامل به‌جای مقدمهٔ پیش‌فرض، مقاله‌ها را با کلاس همایش یا سبک سازمانی می‌نویسد. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید. وقتی دقیقاً یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",hqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dqe():t==="fa"?fqe():uqe()}),_qe=()=>"Upload a SKILL.md file or a .zip of a skill folder.",pqe=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",mqe=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",gqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pqe():t==="fa"?mqe():_qe()}),bqe=()=>"Upload a .tex file or a .zip of a template folder.",vqe=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",xqe=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",yqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vqe():t==="fa"?xqe():bqe()}),wqe=()=>"Close SSH config",Sqe=()=>"关闭 SSH 配置",kqe=()=>"بستن پیکربندی SSH",Cqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Sqe():t==="fa"?kqe():wqe()}),Eqe=()=>"Discard your unsaved SSH config changes?",Nqe=()=>"要放弃未保存的 SSH 配置更改吗?",zqe=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",jqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Nqe():t==="fa"?zqe():Eqe()}),Aqe=()=>"Loading SSH config…",Tqe=()=>"正在加载 SSH 配置…",Mqe=()=>"در حال بارگیری پیکربندی SSH…",Rqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Tqe():t==="fa"?Mqe():Aqe()}),Dqe=()=>"SSH config saved",Lqe=()=>"SSH 配置已保存",Oqe=()=>"پیکربندی SSH ذخیره شد",Iqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Lqe():t==="fa"?Oqe():Dqe()}),Bqe=()=>"SSH config",$qe=()=>"SSH 配置",Hqe=()=>"پیکربندی SSH",Pqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$qe():t==="fa"?Hqe():Bqe()}),Fqe=()=>"Configure SSH hosts…",Uqe=()=>"配置 SSH 主机…",qqe=()=>"پیکربندی میزبان‌های SSH…",VN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Uqe():t==="fa"?qqe():Fqe()}),Gqe=()=>"Cancelled",Vqe=()=>"已取消",Wqe=()=>"لغوشده",Kqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Vqe():t==="fa"?Wqe():Gqe()}),Yqe=()=>"Cancelling",Xqe=()=>"正在取消",Zqe=()=>"در حال لغو",Qqe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?Xqe():t==="fa"?Zqe():Yqe()}),Jqe=()=>"Done",eGe=()=>"已完成",tGe=()=>"انجام‌شده",nGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eGe():t==="fa"?tGe():Jqe()}),rGe=()=>"Editing",sGe=()=>"正在编辑",iGe=()=>"در حال ویرایش",aGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sGe():t==="fa"?iGe():rGe()}),oGe=()=>"Failed",lGe=()=>"失败",cGe=()=>"ناموفق",uGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lGe():t==="fa"?cGe():oGe()}),dGe=()=>"Idle",fGe=()=>"空闲",hGe=()=>"بی‌کار",_Ge=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fGe():t==="fa"?hGe():dGe()}),pGe=()=>"Running",mGe=()=>"运行中",gGe=()=>"در حال اجرا",bGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mGe():t==="fa"?gGe():pGe()}),vGe=()=>"Starting",xGe=()=>"正在启动",yGe=()=>"در حال آغاز",wGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xGe():t==="fa"?yGe():vGe()}),SGe=()=>"Copying…",kGe=()=>"正在复制…",CGe=()=>"در حال کپی…",EGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kGe():t==="fa"?CGe():SGe()}),NGe=()=>"Finalizing…",zGe=()=>"正在完成…",jGe=()=>"در حال نهایی‌سازی…",AGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zGe():t==="fa"?jGe():NGe()}),TGe=e=>`${e==null?void 0:e.size} free at target`,MGe=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,RGe=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,DGe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MGe(e):t==="fa"?RGe(e):TGe(e)}),LGe=e=>`Move all orx data to: -${e==null?void 0:e.path} - -The store is copied to the new location and activated there. Active runs or chats will block the move.`,OGe=e=>`将所有 orx 数据移动到: -${e==null?void 0:e.path} - -存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,IGe=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ -${e==null?void 0:e.path} - -مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,BGe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?OGe(e):t==="fa"?IGe(e):LGe(e)}),$Ge=()=>"Move data here",HGe=()=>"将数据移动到此处",PGe=()=>"انتقال داده به اینجا",FGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HGe():t==="fa"?PGe():$Ge()}),UGe=()=>"Moving…",qGe=()=>"正在移动…",GGe=()=>"در حال جابه‌جایی…",VGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?qGe():t==="fa"?GGe():UGe()}),WGe=()=>"Preparing…",KGe=()=>"正在准备…",YGe=()=>"در حال آماده‌سازی…",XGe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?KGe():t==="fa"?YGe():WGe()}),ZGe=()=>" (same disk, instant)",QGe=()=>"(同一磁盘,可立即完成)",JGe=()=>" (روی همان دیسک، فوری)",eVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?QGe():t==="fa"?JGe():ZGe()}),tVe=()=>"default location",nVe=()=>"默认位置",rVe=()=>"محل پیش‌فرض",sVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?nVe():t==="fa"?rVe():tVe()}),iVe=()=>"ORX_DATA_DIR environment variable",aVe=()=>"ORX_DATA_DIR 环境变量",oVe=()=>"متغیر محیطی ORX_DATA_DIR",lVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?aVe():t==="fa"?oVe():iVe()}),cVe=()=>"your saved setting",uVe=()=>"已保存的设置",dVe=()=>"تنظیم ذخیره‌شدهٔ شما",fVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?uVe():t==="fa"?dVe():cVe()}),hVe=()=>"XDG_DATA_HOME",_Ve=()=>"XDG_DATA_HOME",pVe=()=>"XDG_DATA_HOME",mVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?_Ve():t==="fa"?pVe():hVe()}),gVe=()=>"Verifying…",bVe=()=>"正在验证…",vVe=()=>"در حال بررسی…",xVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?bVe():t==="fa"?vVe():gVe()}),yVe=()=>"Loading…",wVe=()=>"正在加载…",SVe=()=>"در حال بارگیری…",kVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?wVe():t==="fa"?SVe():yVe()}),CVe=()=>"This sub-agent is no longer available.",EVe=()=>"此子智能体已不可用。",NVe=()=>"این عامل فرعی دیگر در دسترس نیست.",zVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?EVe():t==="fa"?NVe():CVe()}),jVe=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,AVe=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,TVe=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,MVe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?AVe(e):t==="fa"?TVe(e):jVe(e)}),RVe=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,DVe=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,LVe=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,OVe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?DVe(e):t==="fa"?LVe(e):RVe(e)}),IVe=()=>", a repo for training a mini-GPT from scratch.",BVe=()=>",一个从零训练迷你 GPT 的仓库。",$Ve=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",HVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?BVe():t==="fa"?$Ve():IVe()}),PVe=()=>"Close",FVe=()=>"关闭",UVe=()=>"بستن",qVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?FVe():t==="fa"?UVe():PVe()}),GVe=()=>"Create a new project",VVe=()=>"新建项目",WVe=()=>"ایجاد پروژهٔ جدید",KVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VVe():t==="fa"?WVe():GVe()}),YVe=()=>"Demo project",XVe=()=>"演示项目",ZVe=()=>"پروژهٔ نمایشی",QVe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XVe():t==="fa"?ZVe():YVe()}),JVe=()=>"Explore the demo",eWe=()=>"探索演示项目",tWe=()=>"دیدن پروژهٔ نمایشی",nWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?eWe():t==="fa"?tWe():JVe()}),rWe=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",sWe=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",iWe=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",aWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sWe():t==="fa"?iWe():rWe()}),oWe=()=>"nanochat",lWe=()=>"nanochat",cWe=()=>"nanochat",uWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lWe():t==="fa"?cWe():oWe()}),dWe=()=>"Couldn’t save your progress. Try again.",fWe=()=>"无法保存进度。请重试。",hWe=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",_We=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fWe():t==="fa"?hWe():dWe()}),pWe=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",mWe=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",gWe=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",bWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mWe():t==="fa"?gWe():pWe()}),vWe=()=>"Welcome to OpenResearch",xWe=()=>"欢迎使用 OpenResearch",yWe=()=>"به OpenResearch خوش آمدید",wWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xWe():t==="fa"?yWe():vWe()}),SWe=()=>"Baseline",kWe=()=>"基线",CWe=()=>"مبنا",EWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kWe():t==="fa"?CWe():SWe()}),NWe=()=>"Experiment",zWe=()=>"实验",jWe=()=>"آزمایش",wo=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zWe():t==="fa"?jWe():NWe()}),AWe=e=>`${e==null?void 0:e.count} experiments`,TWe=e=>`${e==null?void 0:e.count} 个实验`,MWe=e=>`${e==null?void 0:e.count} آزمایش`,RWe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?TWe(e):t==="fa"?MWe(e):AWe(e)}),DWe=()=>"1 experiment",LWe=()=>"1 个实验",OWe=()=>"۱ آزمایش",IWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?LWe():t==="fa"?OWe():DWe()}),BWe=()=>"Running",$We=()=>"运行中",HWe=()=>"در حال اجرا",PWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?$We():t==="fa"?HWe():BWe()}),FWe=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",UWe=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",qWe=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",GWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?UWe():t==="fa"?qWe():FWe()}),VWe=()=>"Ask the agent in chat to create and run your first experiment.",WWe=()=>"在聊天中让智能体创建并运行你的第一个实验。",KWe=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",YWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WWe():t==="fa"?KWe():VWe()}),XWe=()=>"Code",ZWe=()=>"代码",QWe=()=>"کد",JWe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZWe():t==="fa"?QWe():XWe()}),eKe=()=>"Logs",tKe=()=>"日志",nKe=()=>"گزارش‌ها",WN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tKe():t==="fa"?nKe():eKe()}),rKe=()=>"No experiments from the current task yet",sKe=()=>"当前任务尚无实验",iKe=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",aKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?sKe():t==="fa"?iKe():rKe()}),oKe=()=>"No experiments yet",lKe=()=>"尚无实验",cKe=()=>"هنوز آزمایشی وجود ندارد",uKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?lKe():t==="fa"?cKe():oKe()}),dKe=()=>"no runs",fKe=()=>"无运行",hKe=()=>"بدون اجرا",_Ke=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?fKe():t==="fa"?hKe():dKe()}),pKe=()=>"Open logs",mKe=()=>"打开日志",gKe=()=>"باز کردن گزارش‌ها",bKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?mKe():t==="fa"?gKe():pKe()}),vKe=()=>"other tasks",xKe=()=>"其他任务",yKe=()=>"وظایف دیگر",wKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?xKe():t==="fa"?yKe():vKe()}),SKe=()=>"Runs",kKe=()=>"运行",CKe=()=>"اجراها",EKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?kKe():t==="fa"?CKe():SKe()}),NKe=()=>"Switch to Entire project to see all experiments",zKe=()=>"切换到“整个项目”以查看所有实验",jKe=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",AKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?zKe():t==="fa"?jKe():NKe()}),TKe=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,MKe=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,RKe=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,DKe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?MKe(e):t==="fa"?RKe(e):TKe(e)}),LKe=()=>"Dismiss",OKe=()=>"关闭",IKe=()=>"بستن",BKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?OKe():t==="fa"?IKe():LKe()}),$Ke=()=>"Restart now",HKe=()=>"立即重新启动",PKe=()=>"هم‌اکنون دوباره راه‌اندازی کن",KN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?HKe():t==="fa"?PKe():$Ke()}),FKe=e=>`Could not restart: ${e==null?void 0:e.error}`,UKe=e=>`无法重新启动:${e==null?void 0:e.error}`,qKe=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,YN=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?UKe(e):t==="fa"?qKe(e):FKe(e)}),GKe=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",VKe=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",WKe=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",KKe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?VKe():t==="fa"?WKe():GKe()}),YKe=()=>"Restarting…",XKe=()=>"正在重新启动…",ZKe=()=>"در حال راه‌اندازی مجدد…",XN=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?XKe():t==="fa"?ZKe():YKe()}),QKe=()=>"macOS app",JKe=()=>"macOS 应用",eYe=()=>"برنامهٔ macOS",tYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?JKe():t==="fa"?eYe():QKe()}),nYe=()=>"Installed with cargo",rYe=()=>"通过 cargo 安装",sYe=()=>"نصب‌شده با cargo",iYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?rYe():t==="fa"?sYe():nYe()}),aYe=()=>"Installed with Homebrew",oYe=()=>"通过 Homebrew 安装",lYe=()=>"نصب‌شده با Homebrew",cYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?oYe():t==="fa"?lYe():aYe()}),uYe=()=>"Installed with the orx installer",dYe=()=>"通过 orx 安装程序安装",fYe=()=>"نصب‌شده با نصب‌کنندهٔ orx",hYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?dYe():t==="fa"?fYe():uYe()}),_Ye=()=>"Managed by Nix",pYe=()=>"由 Nix 管理",mYe=()=>"مدیریت‌شده با Nix",gYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?pYe():t==="fa"?mYe():_Ye()}),bYe=()=>"Unknown install",vYe=()=>"未知安装方式",xYe=()=>"روش نصب نامشخص",yYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?vYe():t==="fa"?xYe():bYe()}),wYe=()=>"Re-run your cargo install to update.",SYe=()=>"重新运行 cargo 安装命令以更新。",kYe=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",CYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?SYe():t==="fa"?kYe():wYe()}),EYe=()=>"Run brew upgrade to update.",NYe=()=>"运行 brew upgrade 以更新。",zYe=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",jYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?NYe():t==="fa"?zYe():EYe()}),AYe=()=>"Update it through your Nix configuration.",TYe=()=>"通过 Nix 配置进行更新。",MYe=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",RYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?TYe():t==="fa"?MYe():AYe()}),DYe=e=>`Current worktree · ${e==null?void 0:e.branch}`,LYe=e=>`当前工作树 · ${e==null?void 0:e.branch}`,OYe=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,IYe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?LYe(e):t==="fa"?OYe(e):DYe(e)}),BYe=e=>`Default branch · ${e==null?void 0:e.branch}`,$Ye=e=>`默认分支 · ${e==null?void 0:e.branch}`,HYe=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,PYe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?$Ye(e):t==="fa"?HYe(e):BYe(e)}),FYe=e=>`detached at ${e==null?void 0:e.branch}`,UYe=e=>`分离于 ${e==null?void 0:e.branch}`,qYe=e=>`جدا در ${e==null?void 0:e.branch}`,GYe=((e,n={})=>{const t=n.locale??E();return t==="zh-CN"?UYe(e):t==="fa"?qYe(e):FYe(e)}),VYe=()=>"Listing truncated.",WYe=()=>"列表已截断。",KYe=()=>"فهرست کوتاه شده است.",YYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?WYe():t==="fa"?KYe():VYe()}),XYe=()=>"Loading…",ZYe=()=>"正在加载…",QYe=()=>"در حال بارگیری…",JYe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?ZYe():t==="fa"?QYe():XYe()}),eXe=()=>"No changes yet.",tXe=()=>"尚无更改。",nXe=()=>"هنوز تغییری وجود ندارد.",rXe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?tXe():t==="fa"?nXe():eXe()}),sXe=()=>"No files.",iXe=()=>"没有文件。",aXe=()=>"فایلی وجود ندارد.",oXe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?iXe():t==="fa"?aXe():sXe()}),lXe=()=>"Refresh failed:",cXe=()=>"刷新失败:",uXe=()=>"تازه‌سازی ناموفق بود:",dXe=((e={},n={})=>{const t=n.locale??E();return t==="zh-CN"?cXe():t==="fa"?uXe():lXe()}),Xv=new Set;function ZN(e){if(e!==E()){$E(e,{reload:!1}),document.documentElement.lang=e;for(const n of Xv)n()}}function fXe(e){return Xv.add(e),()=>Xv.delete(e)}function qc(){return T.useSyncExternalStore(fXe,E,E)}const Ee=e=>`⁦${e}⁩`,Oa=e=>`⁨${e}⁩`,Gt=e=>new Intl.NumberFormat(E()).format(e);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QN=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hXe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _Xe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wS=e=>{const n=_Xe(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var bb={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 v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pXe=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},mXe=T.createContext({}),gXe=()=>T.useContext(mXe),bXe=T.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:l,...o},c)=>{const{size:d=24,strokeWidth:_=2,absoluteStrokeWidth:h=!1,color:m="currentColor",className:g=""}=gXe()??{},S=r??h?Number(t??_)*24/Number(n??d):t??_;return T.createElement("svg",{ref:c,...bb,width:n??d??bb.width,height:n??d??bb.height,stroke:e??m,strokeWidth:S,className:QN("lucide",g,s),...!i&&!pXe(o)&&{"aria-hidden":"true"},...o},[...l.map(([k,v])=>T.createElement(k,v)),...Array.isArray(i)?i:[i]])});/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rt=(e,n)=>{const t=T.forwardRef(({className:r,...s},i)=>T.createElement(bXe,{ref:i,iconNode:n,className:QN(`lucide-${hXe(wS(e))}`,`lucide-${e}`,r),...s}));return t.displayName=wS(e),t};/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vXe=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],xXe=rt("arrow-down",vXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yXe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],rh=rt("arrow-left",yXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wXe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],tp=rt("arrow-right",wXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const SXe=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],kXe=rt("arrow-up-right",SXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const CXe=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],JN=rt("blocks",CXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const EXe=[["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"}]],ez=rt("book-open",EXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const NXe=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],zXe=rt("calendar-days",NXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jXe=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],AXe=rt("chart-spline",jXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const TXe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mi=rt("check",TXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const MXe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ua=rt("chevron-down",MXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RXe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],tz=rt("chevron-left",RXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const DXe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qa=rt("chevron-right",DXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LXe=[["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"}]],nz=rt("circle-alert",LXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const OXe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],IXe=rt("circle-question-mark",OXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BXe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],rz=rt("circle-stop",BXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $Xe=[["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"}]],sz=rt("circle-x",$Xe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HXe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],PXe=rt("clock-3",HXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FXe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],UXe=rt("clock",FXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qXe=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],GXe=rt("cloud-upload",qXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const VXe=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Zv=rt("code",VXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WXe=[["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"}]],sm=rt("copy",WXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const KXe=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],iz=rt("corner-down-left",KXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YXe=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],XXe=rt("cpu",YXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ZXe=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],QXe=rt("download",ZXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JXe=[["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"}]],Zx=rt("ellipsis",JXe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eZe=[["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"}]],Ic=rt("external-link",eZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tZe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],az=rt("file-code",tZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nZe=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],rZe=rt("file-output",nZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sZe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],im=rt("file-text",sZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iZe=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Qx=rt("flask-conical",iZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aZe=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],oz=rt("folder-git-2",aZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oZe=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],sh=rt("folder-open",oZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lZe=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],cZe=rt("folder-plus",lZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uZe=[["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"}]],am=rt("folder-tree",uZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dZe=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],fZe=rt("funnel",dZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hZe=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],om=rt("git-branch",hZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _Ze=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],pZe=rt("git-commit-horizontal",_Ze);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mZe=[["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"}]],gZe=rt("globe",mZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bZe=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],vZe=rt("history",bZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xZe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Jx=rt("info",xZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yZe=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],wZe=rt("laptop",yZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const SZe=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],kZe=rt("lightbulb",SZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const CZe=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],SS=rt("lock",CZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const EZe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],NZe=rt("maximize-2",EZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zZe=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],lz=rt("message-square-quote",zZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jZe=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],AZe=rt("minimize-2",jZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const TZe=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],MZe=rt("monitor",TZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const RZe=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],DZe=rt("moon",RZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LZe=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],OZe=rt("mouse-pointer-click",LZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const IZe=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ey=rt("package",IZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const BZe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],cz=rt("panel-left",BZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $Ze=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],uz=rt("panel-right",$Ze);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const HZe=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],PZe=rt("paperclip",HZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const FZe=[["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"}]],ty=rt("pencil",FZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const UZe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ny=rt("plus",UZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qZe=[["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"}]],ua=rt("refresh-cw",qZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const GZe=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],VZe=rt("rotate-cw",GZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const WZe=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],ry=rt("scroll-text",WZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const KZe=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],dz=rt("search",KZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const YZe=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],kS=rt("server",YZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const XZe=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],ZZe=rt("settings-2",XZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const QZe=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],fz=rt("settings",QZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const JZe=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],hz=rt("sliders-horizontal",JZe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const eQe=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Cd=rt("square-terminal",eQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tQe=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],nQe=rt("sun",tQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rQe=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],sd=rt("terminal",rQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sQe=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],iQe=rt("toggle-right",sQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aQe=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ed=rt("trash-2",aQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oQe=[["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"}]],_z=rt("triangle-alert",oQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lQe=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],cQe=rt("upload",lQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uQe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],sy=rt("users",uQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dQe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Br=rt("x",dQe);/** - * @license lucide-react v1.23.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fQe=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],hQe=rt("zap",fQe),vb="demo_nanochat_v1",g0=e=>e.startsWith("demo_"),Gf="chat_demo_nanochat_v1",pz="chat_demo_nanochat_figures_v1",mz="chat_demo_nanochat_literature_v1",Qv="cpu-apple-silicon-pipeline-results.md",_Qe="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class Jv extends Error{constructor(t,r,s){super(t);nb(this,"currentVersion");nb(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function Fi(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function Gi(e){if(!e.ok){const n=await e.text().catch(()=>"");let t=n;try{const r=JSON.parse(n);if(typeof r=="object"&&r!==null&&("error"in r&&typeof r.error=="string"&&(t=r.error),e.status===409&&"code"in r&&r.code==="fileChanged"&&"exists"in r&&typeof r.exists=="boolean")){const s="currentVersion"in r&&typeof r.currentVersion=="string"?r.currentVersion:null;throw new Jv(t,s,r.exists)}}catch(r){if(r instanceof Jv)throw r}throw new Error(t||`HTTP ${e.status}`)}return await e.json()}const St=e=>fetch(e).then(n=>Gi(n)),jt=(e,n)=>fetch(e,{method:"POST",headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(t=>Gi(t)),Nd=(e,n)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>Gi(t)),gz=(e,n)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>Gi(t)),pQe=()=>St("/api/projects").then(e=>e.projects),mQe=()=>St("/api/projects/activity").then(e=>e.activity),gQe=()=>St("/api/settings/ui-state"),CS=e=>jt("/api/settings/ui-state",e),bQe=(e,n)=>jt("/api/onboarding/complete",{...e,...n}),bz=(e="")=>{const n=e?`?path=${encodeURIComponent(e)}`:"";return St(`/api/project-path/status${n}`)},vQe=()=>jt("/api/project-path/pick").then(e=>e.path),xQe=e=>jt("/api/projects",e),vz=e=>St(`/api/papers/search?q=${encodeURIComponent(e)}`).then(n=>n.papers),yQe=()=>St("/api/github/account"),wQe=e=>St(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),SQe=(e,n)=>St(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`),e2=e=>St(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(n=>n.paper),kQe=e=>jt("/api/projects/starter-prompts/prewarm",e),CQe=(e,n,t,r)=>St(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`),EQe=e=>jt(`/api/projects/${e}/open`).then(n=>n.project),NQe=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}}),zQe=e=>St(`/api/projects/${e}/experiments`).then(n=>n.experiments),iy=e=>St(`/api/projects/${e}/runs`).then(n=>n.runs),xz=e=>jt(`/api/runs/${e}/cancel`).then(()=>{}),jQe=(e,n)=>St(`/api/runs/${e}/log?offset=${n}`),AQe=e=>St(`/api/runs/${e}/diff`),TQe=e=>St(`/api/experiments/${e}/diff`),Gc=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),ES=(e,n,t={})=>St(`/api/projects/${e}/file?${Gc(t,new URLSearchParams({path:n}))}`),NS=(e,n,t={})=>`/api/projects/${e}/file/raw?${Gc(t,new URLSearchParams({path:n}))}`,MQe=e=>St(`/api/files/abs?path=${encodeURIComponent(e)}`),RQe=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,DQe=(e,n,t,r)=>gz(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),LQe=(e,n,t,r={})=>Nd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),OQe=(e,n,t={})=>jt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),IQe=()=>St("/api/latex/engine"),BQe=(e,n,t={})=>jt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),$Qe=()=>St("/api/overleaf/settings"),yz=e=>jt("/api/overleaf/token",{token:e}),HQe=()=>fetch("/api/overleaf/token",{method:"DELETE"}).then(e=>Gi(e)),PQe=(e,n,t={})=>St(`/api/projects/${e}/file/overleaf?${Gc(t,new URLSearchParams({path:n}))}`),FQe=(e,n,t)=>jt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),UQe=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf?${Gc(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>Gi(r)),qQe=(e,n,t={})=>jt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),GQe=(e,n,t={})=>St(`/api/projects/${e}/file/overleaf/status?${Gc(t,new URLSearchParams({path:n}))}`),VQe=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${Gc(t,new URLSearchParams({path:n}))}`,t2=(e,n={})=>{const t=Gc(n).toString();return St(`/api/projects/${e}/code-tree${t?`?${t}`:""}`)},wz=e=>St(`/api/chat/sessions/${e}/worktree`),lm=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,zS=()=>St("/api/settings/hf"),WQe=e=>jt("/api/settings/hf",{token:e}),jS=()=>St("/api/settings/tinker"),KQe=e=>jt("/api/settings/tinker",{key:e}),Sz=()=>St("/api/update"),YQe=()=>jt("/api/update/apply"),XQe=()=>jt("/api/update/restart"),ZQe=e=>jt("/api/update/auto",{enabled:e}),QQe=(e=!1)=>jt("/api/update/install-cli",{force:e}),AS=()=>St("/api/settings/k8s"),JQe=e=>jt("/api/settings/k8s",e),TS=()=>St("/api/settings/modal"),eJe=(e,n)=>jt("/api/settings/modal",{tokenId:e,tokenSecret:n}),tJe=()=>St("/api/settings/env").then(e=>e.vars),kz=(e,n)=>jt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),nJe=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>Gi(n)).then(n=>n.vars),rJe=()=>St("/api/settings/data-dir"),sJe=e=>jt("/api/settings/data-dir/validate",{path:e}),iJe=e=>jt("/api/settings/data-dir/move",{path:e}),Cz=()=>St("/api/settings/ssh").then(e=>e.hosts),aJe=()=>St("/api/settings/ssh/config"),oJe=(e,n)=>gz("/api/settings/ssh/config",{content:e,previousContent:n}),lJe=e=>St(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`),cJe=()=>St("/_orx/runtime"),uJe=()=>St("/api/remote/sessions").then(e=>e.sessions),dJe=(e,n)=>jt("/api/remote/sessions",{host:e,uiPreferences:n}),fJe=e=>jt("/_orx/install",e),hJe=()=>jt("/_orx/reconnect"),Ez=()=>jt("/_orx/disconnect"),_Je=()=>jt("/_orx/start-host"),Nz=()=>St("/_orx/stop-host"),zz=e=>jt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),pJe=()=>St("/api/settings/slurm"),mJe=e=>jt("/api/settings/slurm",e),gJe=()=>St("/api/settings/ray"),bJe=e=>jt("/api/settings/ray",e),vJe=e=>jt("/api/settings/ray/preflight",{address:e??null}),xJe=e=>St(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),yJe=e=>jt("/api/settings/compute/default",e),wJe=()=>St("/api/settings/local"),SJe=()=>St("/api/settings/openresearch"),MS=e=>St(`/api/projects/${e}/files`),kJe=(e,n)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>Gi(t)),CJe=(e,n,t)=>Nd(`/api/projects/${e}/files`,{path:n,...t}),id=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,jz=512e3,EJe=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},Az=(e,n)=>fetch(id(e,n),{headers:{Range:`bytes=0-${jz-1}`}}).then(t=>{var s;if(t.status===404)return null;if(t.status===416&&t.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=Number((s=t.headers.get("content-range"))==null?void 0:s.split("/").pop());return t.arrayBuffer().then(i=>EJe(i,Number.isFinite(r)&&r>i.byteLength))}),NJe=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",zJe=(e,n)=>fetch(id(e,n),{method:"HEAD"}).then(t=>{if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=t.headers.get("x-openresearch-presentation");return{size:Number(t.headers.get("content-length"))||0,presentation:NJe(r)?r:"download"}}),jJe=()=>St("/api/settings/profile"),AJe=()=>St("/api/settings/lit-sources"),TJe=e=>jt("/api/settings/lit-sources",e),ay=()=>St("/api/settings/projects"),Tz=(e,n)=>jt("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:n}),MJe=e=>St(`/api/projects/${e}/git`),RJe=e=>jt(`/api/projects/${e}/git/init`),DJe=e=>jt(`/api/projects/${e}/github`),LJe=e=>jt(`/api/projects/${e}/github/disable`),OJe=()=>St("/api/settings/telemetry"),IJe=e=>jt("/api/settings/telemetry",{enabled:e}),Sp=e=>e.displayName??Dz(e.id),kp="default";function cm(e,n){var l,o,c;const t=e==null?void 0:e.models.find(d=>d.id===n),r=(t==null?void 0:t.reasoningLevels)??((l=e==null?void 0:e.options)==null?void 0:l.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(d=>d.id===s)?s:r.some(d=>d.id===kp)?kp:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:i}}const n2="default";function Mz(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:n2,label:a9e(),description:n9e()},...t]:[]}function Cp(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(l=>l.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=Mz(e,n);return s.length===0?n2:t!=null&&s.some(l=>l.id===t)?t:n2}function Rz(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=cm(e,n);return r.length===0?kp:t&&r.some(i=>i.id===t)?t:s}const Ep=(e=!1,n=!1)=>{const t=new URLSearchParams;e&&t.set("refresh","1"),n&&t.set("retry","1");const r=t.size>0?`?${t.toString()}`:"";return St(`/api/harnesses${r}`).then(s=>s.harnesses)},BJe=()=>St("/api/skills").then(e=>e.skills),$Je=(e,n)=>St(`/api/skills/${encodeURIComponent(e)}${n?`?project=${encodeURIComponent(n)}`:""}`).then(t=>t.content),HJe=()=>St("/api/latex-templates").then(e=>e.templates),PJe=e=>jt("/api/latex-templates",e).then(n=>n.template),FJe=e=>fetch(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>Gi(n)),UJe=()=>St("/api/user-skills").then(e=>e.skills),qJe=e=>jt("/api/user-skills",e).then(n=>n.skill),GJe=e=>fetch(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>Gi(n));function Dz(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const np=e=>St(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(n=>n.sessions),VJe=(e,n,t={})=>jt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),WJe=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>Gi(n)),KJe=(e,n)=>Nd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),YJe=(e,n)=>Nd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),XJe=(e,n)=>Nd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),ZJe=(e,n)=>Nd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),Uu=e=>St(`/api/chat/sessions/${e}/messages`).then(n=>({messages:n.messages,queued:n.queued??[],activeLeafId:n.activeLeafId??null})),QJe=(e,n)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>Gi(t)),JJe=(e,n)=>jt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),eet=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,RS=(e,n,t={},r,s,i,l)=>jt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:l}),tet=(e,n)=>jt(`/api/chat/sessions/${e}/shell`,{command:n}),net=(e,n,t,r={})=>jt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),ret=(e,n,t)=>jt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),set=(e,n)=>jt(`/api/chat/sessions/${e}/branch`,{leafId:n}),iet=e=>jt(`/api/chat/sessions/${e}/interrupt`),aet=(e,n)=>jt(`/api/chat/sessions/${e}/respond`,n);function Ba(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(E(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function Np(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return _le({value:Gt(n)});const t=Math.floor(n/60);if(t<60)return ule({value:Gt(t)});const r=Math.floor(t/60);return r<24?ale({hours:Gt(r),minutes:Gt(t%60)}):nle({days:Gt(Math.floor(r/24)),hours:Gt(r%24)})}function ko(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&r{ad==="system"&&ly()});ly();function fet(e){return r2.add(e),()=>r2.delete(e)}function Iz(){return[T.useSyncExternalStore(fet,()=>ad,()=>ad),Oz]}var Ro=IE();const het=Ih(Ro);function cy(){return f.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function xb(){return f.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[f.jsx(cy,{}),"OpenResearch"]})}function _et(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function pet(e,n,t){var l;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(l=t.get(s))==null?void 0:l.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function met(e,n,t,r){const s=e.filter(d=>!r(d.id)),i=new Map(s.map(d=>[d.id,d])),l=new Map;for(const d of s){const _=d.parentId??null,h=l.get(_);h?h.push(d):l.set(_,[d])}const o=new Set(n.map(d=>d.id)),c=new Map;for(const d of t){const _=pet(d,i,l),h=_.findIndex(m=>o.has(m.id));c.set(d.id,{count:_.length,index:h,prevId:h>0?_[h-1].id:void 0,nextId:h<_.length-1?_[h+1].id:void 0})}return c}function zp(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function Uh(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function Bz(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||Uh(r)||!zp(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function $z(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=Bz(n.parts);return t?{messageId:n.id,toolId:t}:null}function get(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||Uh(r)))return r.type==="text"&&!!r.text}return!1}const rp=new Map;function bet(e,n){let t=rp.get(e);return t||(t=new Set,rp.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&rp.delete(e)}}function vet(e){var n;(n=rp.get(e.runId))==null||n.forEach(t=>t(e))}const s2=new Set;function od(e){return s2.add(e),()=>{s2.delete(e)}}function vl(e){s2.forEach(n=>n(e))}function xet(e,n,t){const r=T.useRef(t);r.current=t,T.useEffect(()=>{if(!n)return;let s=!1,i=!1,l=!1,o=null;const c=()=>{o&&clearInterval(o),o=null},d=()=>{o||(o=setInterval(()=>r.current(),5e3))},_=()=>{i=!1,np(e).then(m=>{var g;s||i||(l=!!((g=m.find(S=>S.id===n))!=null&&g.busy),l?d():c())}).catch(()=>{})},h=od(m=>{if(m.type==="reconnected"){r.current(),_();return}m.type!=="busy"||m.sessionId!==n||(i=!0,m.busy!==l&&(l=m.busy,l?d():(c(),r.current())))});return _(),()=>{s=!0,h(),c()}},[e,n])}const i2=new Set;function yet(e){return i2.add(e),()=>{i2.delete(e)}}function xl(){i2.forEach(e=>e())}const a2=new Set;function uy(e){return a2.add(e),()=>{a2.delete(e)}}function DS(e){a2.forEach(n=>n(e))}const o2=new Set;function wet(e){return o2.add(e),()=>{o2.delete(e)}}function yb(e){o2.forEach(n=>n(e))}const l2=new Set;function ket(e){return l2.add(e),()=>{l2.delete(e)}}function Cet(e){l2.forEach(n=>n(e))}let c2=!0;const u2=new Set;function Eet(e){return u2.add(e),()=>{u2.delete(e)}}function LS(){return c2}function OS(e){e!==c2&&(c2=e,u2.forEach(n=>n()))}const Net=8e3,zet=3e3;function jet(e){const n=T.useRef(e);n.current=e,T.useEffect(()=>{let t=null,r=!1,s,i,l=!1;const o=()=>{t==null||t.close();const c=new EventSource("/api/events");t=c,c.onerror=()=>{r||(l=!0,s??(s=window.setTimeout(()=>OS(!1),Net)),c.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},zet)))},c.onopen=()=>{var _,h;r||(window.clearTimeout(s),s=void 0,OS(!0),l&&(vl({type:"reconnected"}),xl(),DS({harness:"*",authState:"unknown"}),(h=(_=n.current).onReconnect)==null||h.call(_)),l=!0)};const d=_=>{try{return JSON.parse(_.data)}catch{return null}};c.addEventListener("run.updated",_=>{const h=d(_);h!=null&&h.run&&(xl(),n.current.onRun(h.run))}),c.addEventListener("experiment.updated",_=>{const h=d(_);h!=null&&h.experiment&&(xl(),n.current.onExperiment(h.experiment))}),c.addEventListener("project.updated",_=>{const h=d(_);h!=null&&h.project&&(xl(),n.current.onProject(h.project))}),c.addEventListener("files.updated",_=>{var m,g;const h=d(_);h!=null&&h.projectId&&((g=(m=n.current).onArtifacts)==null||g.call(m,h.projectId))}),c.addEventListener("run.log",_=>{const h=d(_);h!=null&&h.runId&&vet(h)}),c.addEventListener("chat.session",_=>{const h=d(_);h!=null&&h.session&&(xl(),vl({type:"session",session:h.session}))}),c.addEventListener("chat.session.deleted",_=>{const h=d(_);h!=null&&h.sessionId&&(xl(),vl({type:"sessionDeleted",sessionId:h.sessionId}))}),c.addEventListener("chat.message",_=>{const h=d(_);h!=null&&h.message&&(xl(),vl({type:"message",sessionId:h.sessionId,message:h.message}))}),c.addEventListener("chat.busy",_=>{const h=d(_);h!=null&&h.sessionId&&(xl(),vl({type:"busy",sessionId:h.sessionId,busy:h.busy}))}),c.addEventListener("chat.usage",_=>{const h=d(_);h!=null&&h.sessionId&&h.usage&&vl({type:"usage",sessionId:h.sessionId,usage:h.usage})}),c.addEventListener("chat.queued",_=>{const h=d(_);h!=null&&h.sessionId&&vl({type:"queued",sessionId:h.sessionId,items:h.items??[]})}),c.addEventListener("chat.branch",_=>{const h=d(_);h!=null&&h.sessionId&&vl({type:"branch",sessionId:h.sessionId,activeLeafId:h.activeLeafId??null})}),c.addEventListener("harness.auth",_=>{const h=d(_);h!=null&&h.harness&&h.authState&&DS(h)}),c.addEventListener("datadir.move.progress",_=>{const h=d(_);h&&yb({type:"progress",...h})}),c.addEventListener("datadir.move.done",_=>{const h=d(_);h&&yb({type:"done",path:h.path,oldPathLeft:h.oldPathLeft})}),c.addEventListener("datadir.move.error",_=>{const h=d(_);h&&yb({type:"error",error:h.error})}),c.addEventListener("update.status",_=>{const h=d(_);h&&Cet(h)})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const Aa=e=>new Intl.NumberFormat(E()).format(e);function Aet(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?ICe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?jCe({attempt:Aa(e.attempt),maximum:Aa(e.maximum),seconds:Aa(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?CCe({attempt:Aa(e.attempt),maximum:Aa(e.maximum)}):typeof e.attempt=="number"&&t!=null?RCe({attempt:Aa(e.attempt),seconds:Aa(t)}):typeof e.attempt=="number"?yCe({attempt:Aa(e.attempt)}):t!=null?PCe({seconds:Aa(t)}):wN()}function Tet(e,n){if(typeof e!="number")return GCe();const t=Math.max(0,Math.ceil((e-n)/1e3));return YCe({seconds:Aa(t)})}function Hz(e){return e==="retry"||e==="continue"?e:null}function Met(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Ret(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function IS(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Det(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function dy(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let l=0;l"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Let(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=dy(e);if(t.length===1)return t[0]}return e}function Oet(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function ld(e){return Oet(typeof e=="string"?dy(e):e)}function Iet(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function Bet(e,n){const t=ld(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function $et(e){var c;const n=ld(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let d=1;d - - - - -`,Pet='',Fet=` - - -`,Pz={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},Uet={alphaxiv:Het,openalex:Fet,biorxiv:Pet};function Fz({source:e,size:n=16,decorative:t=!1,className:r=""}){return f.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":Pz[e]},dangerouslySetInnerHTML:{__html:Uet[e]}})}function qet(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function Get(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=qet(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const Vet=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),Uz=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),jp="-",BS=[],Ket="arbitrary..",Yet=e=>{const n=Zet(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Xet(l);const o=l.split(jp),c=o[0]===""&&o.length>1?1:0;return qz(o,c,n)},getConflictingClassGroupIds:(l,o)=>{if(o){const c=r[l],d=t[l];return c?d?Vet(d,c):c:d||BS}return t[l]||BS}}},qz=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const d=qz(e,n+1,i);if(d)return d}const l=t.validators;if(l===null)return;const o=n===0?e.join(jp):e.slice(n).join(jp),c=l.length;for(let d=0;de.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Ket+r:void 0})(),Zet=e=>{const{theme:n,classGroups:t}=e;return Qet(t,n)},Qet=(e,n)=>{const t=Uz();for(const r in e){const s=e[r];fy(s,t,r,n)}return t},fy=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){ett(e,n,t);return}if(typeof e=="function"){ttt(e,n,t,r);return}ntt(e,n,t,r)},ett=(e,n,t)=>{const r=e===""?n:Gz(n,e);r.classGroupId=t},ttt=(e,n,t,r)=>{if(rtt(e)){fy(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Wet(t,e))},ntt=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let l=0;l{let t=e;const r=n.split(jp),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,stt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,l)=>{t[i]=l,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let l=t[i];if(l!==void 0)return l;if((l=r[i])!==void 0)return s(i,l),l},set(i,l){i in t?t[i]=l:s(i,l)}}},d2="!",$S=":",itt=[],HS=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),att=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let l=0,o=0,c=0,d;const _=s.length;for(let k=0;k<_;k++){const v=s[k];if(l===0&&o===0){if(v===$S){i.push(s.slice(c,k)),c=k+1;continue}if(v==="/"){d=k;continue}}v==="["?l++:v==="]"?l--:v==="("?o++:v===")"&&o--}const h=i.length===0?s:s.slice(c);let m=h,g=!1;h.endsWith(d2)?(m=h.slice(0,-1),g=!0):h.startsWith(d2)&&(m=h.slice(1),g=!0);const S=d&&d>c?d-c:void 0;return HS(i,g,m,S)};if(n){const s=n+$S,i=r;r=l=>l.startsWith(s)?i(l.slice(s.length)):HS(itt,!1,l,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},ott=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(l)):s.push(l)}return s.length>0&&(s.sort(),r.push(...s)),r}},ltt=e=>({cache:stt(e.cacheSize),parseClassName:att(e),sortModifiers:ott(e),postfixLookupClassGroupIds:ctt(e),...Yet(e)}),ctt=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:l}=n,o=[],c=e.trim().split(utt);let d="";for(let _=c.length-1;_>=0;_-=1){const h=c[_],{isExternal:m,modifiers:g,hasImportantModifier:S,baseClassName:k,maybePostfixModifierPosition:v}=t(h);if(m){d=h+(d.length>0?" "+d:d);continue}let b=!!v,x;if(b){const M=k.substring(0,v);x=r(M);const z=x&&l[x]?r(k):void 0;z&&z!==x&&(x=z,b=!1)}else x=r(k);if(!x){if(!b){d=h+(d.length>0?" "+d:d);continue}if(x=r(k),!x){d=h+(d.length>0?" "+d:d);continue}b=!1}const y=g.length===0?"":g.length===1?g[0]:i(g).join(":"),C=S?y+d2:y,j=C+x;if(o.indexOf(j)>-1)continue;o.push(j);const N=s(x,b);for(let M=0;M0?" "+d:d)}return d},ftt=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const l=c=>{const d=n.reduce((_,h)=>h(_),e());return t=ltt(d),r=t.cache.get,s=t.cache.set,i=o,o(c)},o=c=>{const d=r(c);if(d)return d;const _=dtt(c,t);return s(c,_),_};return i=l,(...c)=>i(ftt(...c))},htt=[],Kr=e=>{const n=t=>t[e]||htt;return n.isThemeGetter=!0,n},Wz=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Kz=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_tt=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ptt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mtt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gtt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,btt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,vtt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yl=e=>_tt.test(e),Qt=e=>!!e&&!Number.isNaN(Number(e)),Na=e=>!!e&&Number.isInteger(Number(e)),wb=e=>e.endsWith("%")&&Qt(e.slice(0,-1)),mo=e=>ptt.test(e),Yz=()=>!0,xtt=e=>mtt.test(e)&&!gtt.test(e),hy=()=>!1,ytt=e=>btt.test(e),wtt=e=>vtt.test(e),Stt=e=>!ct(e)&&!ut(e),ktt=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ctt=e=>Fl(e,Qz,hy),ct=e=>Wz.test(e),gc=e=>Fl(e,Jz,xtt),FS=e=>Fl(e,Rtt,Qt),Ett=e=>Fl(e,tj,Yz),Ntt=e=>Fl(e,ej,hy),US=e=>Fl(e,Xz,hy),ztt=e=>Fl(e,Zz,wtt),v0=e=>Fl(e,nj,ytt),ut=e=>Kz.test(e),Nf=e=>Vc(e,Jz),jtt=e=>Vc(e,ej),qS=e=>Vc(e,Xz),Att=e=>Vc(e,Qz),Ttt=e=>Vc(e,Zz),x0=e=>Vc(e,nj,!0),Mtt=e=>Vc(e,tj,!0),Fl=(e,n,t)=>{const r=Wz.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Vc=(e,n,t=!1)=>{const r=Kz.exec(e);return r?r[1]?n(r[1]):t:!1},Xz=e=>e==="position"||e==="percentage",Zz=e=>e==="image"||e==="url",Qz=e=>e==="length"||e==="size"||e==="bg-size",Jz=e=>e==="length",Rtt=e=>e==="number",ej=e=>e==="family-name",tj=e=>e==="number"||e==="weight",nj=e=>e==="shadow",GS=()=>{const e=Kr("color"),n=Kr("font"),t=Kr("text"),r=Kr("font-weight"),s=Kr("tracking"),i=Kr("leading"),l=Kr("breakpoint"),o=Kr("container"),c=Kr("spacing"),d=Kr("radius"),_=Kr("shadow"),h=Kr("inset-shadow"),m=Kr("text-shadow"),g=Kr("drop-shadow"),S=Kr("blur"),k=Kr("perspective"),v=Kr("aspect"),b=Kr("ease"),x=Kr("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...C(),ut,ct],N=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],z=()=>[ut,ct,c],D=()=>[yl,"full","auto",...z()],I=()=>[Na,"none","subgrid",ut,ct],$=()=>["auto",{span:["full",Na,ut,ct]},Na,ut,ct],P=()=>[Na,"auto",ut,ct],F=()=>["auto","min","max","fr",ut,ct],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...z()],Y=()=>[yl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],J=()=>[yl,"screen","full","dvw","lvw","svw","min","max","fit",...z()],H=()=>[yl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],L=()=>[e,ut,ct],B=()=>[...C(),qS,US,{position:[ut,ct]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],V=()=>["auto","cover","contain",Att,Ctt,{size:[ut,ct]}],ae=()=>[wb,Nf,gc],ce=()=>["","none","full",d,ut,ct],oe=()=>["",Qt,Nf,gc],se=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Qt,wb,qS,US],le=()=>["","none",S,ut,ct],_e=()=>["none",Qt,ut,ct],ue=()=>["none",Qt,ut,ct],ze=()=>[Qt,ut,ct],Ne=()=>[yl,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mo],breakpoint:[mo],color:[Yz],container:[mo],"drop-shadow":[mo],ease:["in","out","in-out"],font:[Stt],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mo],shadow:[mo],spacing:["px",Qt],text:[mo],"text-shadow":[mo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yl,ct,ut,v]}],container:["container"],"container-type":[{"@container":["","normal","size",ut,ct]}],"container-named":[ktt],columns:[{columns:[Qt,ct,ut,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[Na,"auto",ut,ct]}],basis:[{basis:[yl,"full","auto",o,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qt,yl,"auto","initial","none",ct]}],grow:[{grow:["",Qt,ut,ct]}],shrink:[{shrink:["",Qt,ut,ct]}],order:[{order:[Na,"first","last","none",ut,ct]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[o,"screen",...Y()]}],"min-w":[{"min-w":[o,"screen","none",...Y()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[l]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",t,Nf,gc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Mtt,Ett]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wb,ct]}],"font-family":[{font:[jtt,Ntt,n]}],"font-features":[{"font-features":[ct]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ut,ct]}],"line-clamp":[{"line-clamp":[Qt,"none",ut,FS]}],leading:[{leading:[i,...z()]}],"list-image":[{"list-image":["none",ut,ct]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ut,ct]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qt,"from-font","auto",ut,gc]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Qt,"auto",ut,ct]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"tab-size":[{tab:[Na,ut,ct]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ut,ct]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ut,ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:V()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Na,ut,ct],radial:["",ut,ct],conic:[Na,ut,ct]},Ttt,ztt]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ce()}],"rounded-s":[{"rounded-s":ce()}],"rounded-e":[{"rounded-e":ce()}],"rounded-t":[{"rounded-t":ce()}],"rounded-r":[{"rounded-r":ce()}],"rounded-b":[{"rounded-b":ce()}],"rounded-l":[{"rounded-l":ce()}],"rounded-ss":[{"rounded-ss":ce()}],"rounded-se":[{"rounded-se":ce()}],"rounded-ee":[{"rounded-ee":ce()}],"rounded-es":[{"rounded-es":ce()}],"rounded-tl":[{"rounded-tl":ce()}],"rounded-tr":[{"rounded-tr":ce()}],"rounded-br":[{"rounded-br":ce()}],"rounded-bl":[{"rounded-bl":ce()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qt,ut,ct]}],"outline-w":[{outline:["",Qt,Nf,gc]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",_,x0,v0]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,x0,v0]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Qt,gc]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",m,x0,v0]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Qt,ut,ct]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ut,ct]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Qt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:V()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ut,ct]}],filter:[{filter:["","none",ut,ct]}],blur:[{blur:le()}],brightness:[{brightness:[Qt,ut,ct]}],contrast:[{contrast:[Qt,ut,ct]}],"drop-shadow":[{"drop-shadow":["","none",g,x0,v0]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Qt,ut,ct]}],"hue-rotate":[{"hue-rotate":[Qt,ut,ct]}],invert:[{invert:["",Qt,ut,ct]}],saturate:[{saturate:[Qt,ut,ct]}],sepia:[{sepia:["",Qt,ut,ct]}],"backdrop-filter":[{"backdrop-filter":["","none",ut,ct]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[Qt,ut,ct]}],"backdrop-contrast":[{"backdrop-contrast":[Qt,ut,ct]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qt,ut,ct]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qt,ut,ct]}],"backdrop-invert":[{"backdrop-invert":["",Qt,ut,ct]}],"backdrop-opacity":[{"backdrop-opacity":[Qt,ut,ct]}],"backdrop-saturate":[{"backdrop-saturate":[Qt,ut,ct]}],"backdrop-sepia":[{"backdrop-sepia":["",Qt,ut,ct]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ut,ct]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qt,"initial",ut,ct]}],ease:[{ease:["linear","initial",b,ut,ct]}],delay:[{delay:[Qt,ut,ct]}],animate:[{animate:["none",x,ut,ct]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,ut,ct]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[ut,ct,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ne()}],"translate-x":[{"translate-x":Ne()}],"translate-y":[{"translate-y":Ne()}],"translate-z":[{"translate-z":Ne()}],"translate-none":["translate-none"],zoom:[{zoom:[Na,ut,ct]}],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ut,ct]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":L()}],"scrollbar-track-color":[{"scrollbar-track":L()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ut,ct]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Qt,Nf,gc,FS]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Dtt=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(Ou(e,"cacheSize",n),Ou(e,"prefix",t),Ou(e,"experimentalParseClassName",r),y0(e.theme,i.theme),y0(e.classGroups,i.classGroups),y0(e.conflictingClassGroups,i.conflictingClassGroups),y0(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),Ou(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),Ou(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),w0(e.theme,s.theme),w0(e.classGroups,s.classGroups),w0(e.conflictingClassGroups,s.conflictingClassGroups),w0(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),f2(e,s,"postfixLookupClassGroups"),f2(e,s,"orderSensitiveModifiers"),e),Ou=(e,n,t)=>{t!==void 0&&(e[n]=t)},y0=(e,n)=>{if(n)for(const t in n)Ou(e,t,n[t])},w0=(e,n)=>{if(n)for(const t in n)f2(e,n,t)},f2=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},Ltt=(e,...n)=>typeof e=="function"?PS(GS,e,...n):PS(()=>Dtt(GS(),e),...n),Ott=Ltt({extend:{theme:{text:["menu"]}}});function ls(...e){return Ott(...e)}const Itt={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function Mt({variant:e="default",className:n,...t}){return f.jsx("span",{className:ls("badge inline-flex items-center rounded-full border px-2 py-px font-sans text-sm font-medium",Itt[e],n),...t})}const Btt=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),$tt={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},Htt={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function rj(e,n,t,r){return ls(Btt,$tt[e],Htt[n],t&&"active",r)}function He({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("button",{className:rj(n,t,e,r),...s})}function ih({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return f.jsx("a",{className:rj(n,t,e,r),...s})}const Ptt=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45","[.chat-header.rail-hidden_>_&:first-child]:me-3"].join(" "),Ftt={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},Utt={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function sj(e,n,t,r){return ls(Ptt,Ftt[e],Utt[n],t&&"active",r)}const qt=T.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},l){return f.jsx("button",{ref:l,className:sj(r,t,n,s),...i})});function um({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return f.jsx("a",{className:sj(t,n,e,r),...s})}const qtt={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function ws({variant:e="default",className:n,...t}){return f.jsx("input",{className:ls("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",qtt[e],n),...t})}function Nr({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return f.jsx("button",{className:ls("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function Rt({className:e,...n}){return f.jsx("span",{className:ls("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function Pr({className:e,...n}){return f.jsx("div",{className:ls("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const Gtt={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function _y({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return f.jsxs("span",{className:ls("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[f.jsx("span",{className:ls("h-[7px] w-[7px] shrink-0 rounded-full bg-current",Gtt[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const Vtt=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function ij(e,n){return ls(Vtt,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function py({checked:e=!1,className:n,children:t,...r}){return f.jsx("button",{role:"switch","aria-checked":e,className:ij(e,n),...r,children:t??f.jsx("span",{})})}function Wtt({checked:e=!1,className:n,...t}){return f.jsx("span",{className:ij(e,n),...t,children:f.jsx("span",{})})}function Ktt(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Ytt=e=>{switch(e){case"success":return Qtt;case"info":return ent;case"warning":return Jtt;case"error":return tnt;default:return null}},Xtt=Array(12).fill(0),Ztt=({visible:e,className:n})=>tt.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},tt.createElement("div",{className:"sonner-spinner"},Xtt.map((t,r)=>tt.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Qtt=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Jtt=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),ent=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tnt=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},tt.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nnt=tt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},tt.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),tt.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),rnt=()=>{const[e,n]=tt.useState(document.hidden);return tt.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let snt=1;const int=100,VS=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:snt++};class ant{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-int;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=VS(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const l=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return l&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(d=>d.id!==s)),(l?void 0:this.toasts.find(d=>d.id===s))?this.toasts=this.toasts.map(d=>d.id===s?(this.publish({...d,...n,id:s,title:t}),{...d,...n,id:s,dismissible:o,title:t}):d):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,l;const o=s.then(async d=>{if(l=["resolve",d],tt.isValidElement(d))i=!1,this.create({id:r,type:"default",message:d});else if(lnt(d)&&!d.ok){i=!1;const h=typeof t.error=="function"?await t.error(`HTTP error! status: ${d.status}`):t.error,m=typeof t.description=="function"?await t.description(`HTTP error! status: ${d.status}`):t.description,S=typeof h=="object"&&!tt.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...S})}else if(d instanceof Error){i=!1;const h=typeof t.error=="function"?await t.error(d):t.error,m=typeof t.description=="function"?await t.description(d):t.description,S=typeof h=="object"&&!tt.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:m,...S})}else if(t.success!==void 0){i=!1;const h=typeof t.success=="function"?await t.success(d):t.success,m=typeof t.description=="function"?await t.description(d):t.description,S=typeof h=="object"&&!tt.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:m,...S})}}).catch(async d=>{if(l=["reject",d],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(d):t.error,h=typeof t.description=="function"?await t.description(d):t.description,g=typeof _=="object"&&!tt.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:h,...g})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((d,_)=>o.then(()=>l[0]==="reject"?_(l[1]):d(l[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(n,t)=>{const r=VS(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const Xs=new ant,ont=(e,n)=>Xs.message(e,n),lnt=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",cnt=ont,unt=()=>Xs.toasts,dnt=()=>Xs.getActiveToasts(),fnt=Object.assign(cnt,{success:Xs.success,info:Xs.info,warning:Xs.warning,error:Xs.error,custom:Xs.custom,message:Xs.message,promise:Xs.promise,dismiss:Xs.dismiss,loading:Xs.loading},{getHistory:unt,getToasts:dnt});Ktt("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function S0(e){return e.label!==void 0}const hnt=3,_nt="24px",pnt="16px",WS=4e3,mnt=356,gnt=14,bnt=45,vnt=200;function za(...e){return e.filter(Boolean).join(" ")}function xnt(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const ynt=e=>{var n,t,r,s,i,l,o,c,d;const{invert:_,toast:h,unstyled:m,interacting:g,setHeights:S,visibleToasts:k,heights:v,index:b,toasts:x,expanded:y,removeToast:C,defaultRichColors:j,closeButton:N,style:M,cancelButtonStyle:z,actionButtonStyle:D,className:I="",descriptionClassName:$="",duration:P,position:F,gap:W,expandByDefault:Z,classNames:U,icons:Y,closeButtonAriaLabel:J="Close toast"}=e,[H,L]=tt.useState(null),[B,X]=tt.useState(null),[V,ae]=tt.useState(!1),[ce,oe]=tt.useState(!1),[se,G]=tt.useState(!1),[ne,le]=tt.useState(!1),[_e,ue]=tt.useState(!1),[ze,Ne]=tt.useState(0),[Ie,qe]=tt.useState(0),Fe=tt.useRef(h.duration||P||WS),Ot=tt.useRef(null),xt=tt.useRef(null),Nt=b===0,Jt=b+1<=k,ht=h.type,it=ht??"default",et=h.dismissible!==!1,Pt=h.className||"",we=h.descriptionClassName||"",Oe=tt.useMemo(()=>v.findIndex(mt=>mt.toastId===h.id)||0,[v,h.id]),Je=tt.useMemo(()=>{var mt;return(mt=h.closeButton)!=null?mt:N},[h.closeButton,N]),nt=tt.useMemo(()=>h.duration||P||WS,[h.duration,P]),De=tt.useRef(0),At=tt.useRef(0),pt=tt.useRef(0),It=tt.useRef(null),[nn,gn]=F.split("-"),Ct=tt.useMemo(()=>v.reduce((mt,an,Xe)=>Xe>=Oe?mt:mt+an.height,0),[v,Oe]),xn=rnt(),rn=tt.useMemo(()=>{var mt;return(mt=e.swipeDirections)!=null?mt:xnt(F)},[e.swipeDirections,F]),lr=h.invert||_,_r=ht==="loading";At.current=tt.useMemo(()=>Oe*W+Ct,[Oe,Ct]),tt.useEffect(()=>{Fe.current=nt},[nt]),tt.useEffect(()=>{ae(!0)},[]),tt.useEffect(()=>{const mt=xt.current;if(mt){const an=mt.getBoundingClientRect().height;return qe(an),S(Xe=>[{toastId:h.id,height:an,position:h.position},...Xe]),()=>S(Xe=>Xe.filter(ot=>ot.toastId!==h.id))}},[S,h.id]),tt.useLayoutEffect(()=>{if(!V)return;const mt=xt.current,an=mt.style.height;mt.style.height="auto";const Xe=mt.getBoundingClientRect().height;mt.style.height=an,qe(Xe),S(ot=>ot.find(Be=>Be.toastId===h.id)?ot.map(Be=>Be.toastId===h.id?{...Be,height:Xe}:Be):[{toastId:h.id,height:Xe,position:h.position},...ot])},[V,h.title,h.description,S,h.id,h.jsx,h.action,h.cancel]);const Ln=tt.useCallback(()=>{oe(!0),Ne(At.current),S(mt=>mt.filter(an=>an.toastId!==h.id)),setTimeout(()=>{C(h)},vnt)},[h,C,S,At]);tt.useEffect(()=>{if(h.promise&&ht==="loading"||h.duration===1/0||h.type==="loading")return;let mt;return y||g||xn?(()=>{if(pt.current{Fe.current!==1/0&&(De.current=new Date().getTime(),mt=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),Ln()},Fe.current))})(),()=>clearTimeout(mt)},[y,g,h,ht,xn,Ln]),tt.useEffect(()=>{h.delete&&(Ln(),h.onDismiss==null||h.onDismiss.call(h,h))},[Ln,h.delete]);function Yn(){var mt;if(Y!=null&&Y.loading){var an;return tt.createElement("div",{className:za(U==null?void 0:U.loader,h==null||(an=h.classNames)==null?void 0:an.loader,"sonner-loader"),"data-visible":ht==="loading"},Y.loading)}return tt.createElement(Ztt,{className:za(U==null?void 0:U.loader,h==null||(mt=h.classNames)==null?void 0:mt.loader),visible:ht==="loading"})}const sn=h.icon||(Y==null?void 0:Y[ht])||Ytt(ht);var $n,Cn;return tt.createElement("li",{tabIndex:0,ref:xt,className:za(I,Pt,U==null?void 0:U.toast,h==null||(n=h.classNames)==null?void 0:n.toast,U==null?void 0:U[it],h==null||(t=h.classNames)==null?void 0:t[it]),"data-sonner-toast":"","data-rich-colors":($n=h.richColors)!=null?$n:j,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":V,"data-promise":!!h.promise,"data-swiped":_e,"data-removed":ce,"data-visible":Jt,"data-y-position":nn,"data-x-position":gn,"data-index":b,"data-front":Nt,"data-swiping":se,"data-dismissible":et,"data-type":ht,"data-invert":lr,"data-swipe-out":ne,"data-swipe-direction":B,"data-expanded":!!(y||Z&&V),"data-testid":h.testId,style:{"--index":b,"--toasts-before":b,"--z-index":x.length-b,"--offset":`${ce?ze:At.current}px`,"--initial-height":Z?"auto":`${Ie}px`,...M,...h.style},onDragEnd:()=>{G(!1),L(null),It.current=null},onPointerDown:mt=>{mt.button!==2&&(_r||!et||(Ot.current=new Date,Ne(At.current),mt.target.setPointerCapture(mt.pointerId),mt.target.tagName!=="BUTTON"&&(G(!0),It.current={x:mt.clientX,y:mt.clientY})))},onPointerUp:()=>{var mt,an,Xe;if(ne||!et)return;It.current=null;const ot=Number(((mt=xt.current)==null?void 0:mt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),en=Number(((an=xt.current)==null?void 0:an.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Be=new Date().getTime()-((Xe=Ot.current)==null?void 0:Xe.getTime()),Qe=H==="x"?ot:en,pn=Math.abs(Qe)/Be;if((H==="x"?rn.includes(ot>0?"right":"left"):rn.includes(en>0?"bottom":"top"))&&(Math.abs(Qe)>=bnt||pn>.11)){Ne(At.current),h.onDismiss==null||h.onDismiss.call(h,h),X(H==="x"?ot>0?"right":"left":en>0?"down":"up"),Ln(),le(!0);return}else{var Vt,wt;(Vt=xt.current)==null||Vt.style.setProperty("--swipe-amount-x","0px"),(wt=xt.current)==null||wt.style.setProperty("--swipe-amount-y","0px")}ue(!1),G(!1),L(null)},onPointerMove:mt=>{var an,Xe,ot;if(!It.current||!et||((an=window.getSelection())==null?void 0:an.toString().length)>0)return;const Be=mt.clientY-It.current.y,Qe=mt.clientX-It.current.x;!H&&(Math.abs(Qe)>1||Math.abs(Be)>1)&&L(Math.abs(Qe)>Math.abs(Be)?"x":"y");let pn={x:0,y:0};const Xn=Vt=>1/(1.5+Math.abs(Vt)/20);if(H==="y"){if(rn.includes("top")||rn.includes("bottom"))if(rn.includes("top")&&Be<0||rn.includes("bottom")&&Be>0)pn.y=Be;else{const Vt=Be*Xn(Be);pn.y=Math.abs(Vt)0)pn.x=Qe;else{const Vt=Qe*Xn(Qe);pn.x=Math.abs(Vt)0||Math.abs(pn.y)>0)&&ue(!0),(Xe=xt.current)==null||Xe.style.setProperty("--swipe-amount-x",`${pn.x}px`),(ot=xt.current)==null||ot.style.setProperty("--swipe-amount-y",`${pn.y}px`)}},Je&&!h.jsx&&ht!=="loading"?tt.createElement("button",{"aria-label":J,"data-disabled":_r,"data-close-button":!0,onClick:_r||!et?()=>{}:()=>{Ln(),h.onDismiss==null||h.onDismiss.call(h,h)},className:za(U==null?void 0:U.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(Cn=Y==null?void 0:Y.close)!=null?Cn:nnt):null,(ht||h.icon||h.promise)&&h.icon!==null&&((Y==null?void 0:Y[ht])!==null||h.icon)?tt.createElement("div",{"data-icon":"",className:za(U==null?void 0:U.icon,h==null||(s=h.classNames)==null?void 0:s.icon)},ht==="loading"?h.icon||Yn():h.promise?Yn():null,ht!=="loading"?sn:null):null,tt.createElement("div",{"data-content":"",className:za(U==null?void 0:U.content,h==null||(i=h.classNames)==null?void 0:i.content)},tt.createElement("div",{"data-title":"",className:za(U==null?void 0:U.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?tt.createElement("div",{"data-description":"",className:za($,we,U==null?void 0:U.description,h==null||(o=h.classNames)==null?void 0:o.description)},typeof h.description=="function"?h.description():h.description):null),tt.isValidElement(h.cancel)?h.cancel:h.cancel&&S0(h.cancel)?tt.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||z,onClick:mt=>{S0(h.cancel)&&et&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,mt),Ln())},className:za(U==null?void 0:U.cancelButton,h==null||(c=h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,tt.isValidElement(h.action)?h.action:h.action&&S0(h.action)?tt.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||D,onClick:mt=>{S0(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,mt),!mt.defaultPrevented&&Ln())},className:za(U==null?void 0:U.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function KS(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function wnt(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,l=i?"--mobile-offset":"--offset",o=i?pnt:_nt;function c(d){["top","right","bottom","left"].forEach(_=>{t[`${l}-${_}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?t[`${l}-${d}`]=o:t[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(o)}),t}const Snt=tt.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:o,closeButton:c,className:d,offset:_,mobileOffset:h,theme:m="light",richColors:g,duration:S,style:k,visibleToasts:v=hnt,toastOptions:b,dir:x=KS(),gap:y=gnt,icons:C,customAriaLabel:j,containerAriaLabel:N="Notifications"}=n,[M,z]=tt.useState([]),D=tt.useMemo(()=>r?M.filter(ae=>ae.toasterId===r):M.filter(ae=>!ae.toasterId),[M,r]),I=tt.useMemo(()=>Array.from(new Set([i].concat(D.filter(ae=>ae.position).map(ae=>ae.position)))),[D,i]),[$,P]=tt.useState([]),[F,W]=tt.useState(!1),[Z,U]=tt.useState(!1),[Y,J]=tt.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=tt.useRef(null),L=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=tt.useRef(null),X=tt.useRef(!1),V=tt.useCallback(ae=>{z(ce=>{var oe;return(oe=ce.find(se=>se.id===ae.id))!=null&&oe.delete||Xs.dismiss(ae.id),ce.filter(({id:se})=>se!==ae.id)})},[]);return tt.useEffect(()=>Xs.subscribe(ae=>{if(ae.dismiss){requestAnimationFrame(()=>{z(ce=>ce.map(oe=>oe.id===ae.id?{...oe,delete:!0}:oe))});return}setTimeout(()=>{het.flushSync(()=>{z(ce=>{const oe=ce.findIndex(se=>se.id===ae.id);return oe!==-1?[...ce.slice(0,oe),{...ce[oe],...ae},...ce.slice(oe+1)]:[ae,...ce]})})})}),[]),tt.useEffect(()=>{if(m!=="system"){J(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?J("dark"):J("light")),typeof window>"u")return;const ae=window.matchMedia("(prefers-color-scheme: dark)");try{ae.addEventListener("change",({matches:ce})=>{J(ce?"dark":"light")})}catch{ae.addListener(({matches:oe})=>{try{J(oe?"dark":"light")}catch(se){console.error(se)}})}},[m]),tt.useEffect(()=>{M.length<=1&&W(!1)},[M]),tt.useEffect(()=>{const ae=ce=>{var oe;if(l.length>0&&l.every(ne=>ce[ne]||ce.code===ne)){var G;W(!0),(G=H.current)==null||G.focus()}ce.code==="Escape"&&(document.activeElement===H.current||(oe=H.current)!=null&&oe.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[l]),tt.useEffect(()=>{if(H.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,X.current=!1)}},[H.current]),tt.createElement("section",{ref:t,"aria-label":j??`${N} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},I.map((ae,ce)=>{var oe;const[se,G]=ae.split("-");return D.length?tt.createElement("ol",{key:ae,dir:x==="auto"?KS():x,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":Y,"data-y-position":se,"data-x-position":G,style:{"--front-toast-height":`${((oe=$[0])==null?void 0:oe.height)||0}px`,"--width":`${mnt}px`,"--gap":`${y}px`,...k,...wnt(_,h)},onBlur:ne=>{X.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(X.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||X.current||(X.current=!0,B.current=ne.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{Z||W(!1)},onDragEnd:()=>W(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},D.filter(ne=>!ne.position&&ce===0||ne.position===ae).map((ne,le)=>{var _e,ue;return tt.createElement(ynt,{key:ne.id,icons:C,index:le,toast:ne,defaultRichColors:g,duration:(_e=b==null?void 0:b.duration)!=null?_e:S,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:s,visibleToasts:v,closeButton:(ue=b==null?void 0:b.closeButton)!=null?ue:c,interacting:Z,position:ae,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,closeButtonAriaLabel:b==null?void 0:b.closeButtonAriaLabel,removeToast:V,toasts:D.filter(ze=>ze.position==ne.position),heights:$.filter(ze=>ze.position==ne.position),setHeights:P,expandByDefault:o,gap:y,expanded:F,swipeDirections:n.swipeDirections})})):null}))});function knt(e){const[n]=Iz();return f.jsx(Snt,{theme:n,...e})}function fr(e,n,t){fnt[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function my({content:e,children:n,className:t}){const r=T.useRef(null),s=T.useRef(null);function i(){const o=r.current,c=s.current;if(!o||!c)return;c.matches(":popover-open")||c.showPopover();const d=o.getBoundingClientRect(),_=c.getBoundingClientRect(),h=Math.max(8,Math.min(d.left+d.width/2-_.width/2,window.innerWidth-_.width-8));c.style.left=`${h}px`,c.style.top=`${Math.max(8,d.top-_.height-6)}px`}function l(){var o,c;(o=r.current)!=null&&o.matches(":hover, :focus")||(c=s.current)==null||c.hidePopover()}return T.useEffect(()=>{const o=()=>{var c;return(c=s.current)==null?void 0:c.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),f.jsxs("span",{ref:r,className:ls("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:l,onFocus:i,onBlur:l,onKeyDown:o=>{var c;o.key==="Escape"&&((c=s.current)!=null&&c.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,f.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const Cnt=["alphaxiv","openalex","biorxiv"];let YS=null;function Ent(){const[e,n]=T.useState(YS),[t,r]=T.useState(!1),s=l=>{YS=l,n(l)};T.useEffect(()=>{AJe().then(s).catch(()=>{})},[]);const i=l=>{!e||t||(r(!0),TJe({...e,[l]:!e[l]}).then(s).catch(()=>{}).finally(()=>r(!1)))};return e?f.jsx("div",{className:"flex flex-col",children:Cnt.map(l=>{const o=e[l];return f.jsxs(Nr,{type:"button",role:"switch","aria-checked":o,disabled:t,onClick:()=>i(l),children:[f.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[f.jsx(Fz,{source:l,size:16,decorative:!0}),Pz[l]]}),f.jsx(Wtt,{checked:o,"aria-hidden":"true"})]},l)})}):f.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:Mpe()})}function Sb(e,n){if(!e)throw new Error("Assertion Error")}function bc(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function Nnt(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function znt(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` -`}]}function jnt(e,n){const t=n.value?n.value+` -`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function Ant(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Tnt(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const Rs=Ul(/[A-Za-z]/),ys=Ul(/[\dA-Za-z]/),Mnt=Ul(/[#-'*+\--9=?A-Z^-~]/);function Ap(e){return e!==null&&(e<32||e===127)}const h2=Ul(/\d/),Rnt=Ul(/[\dA-Fa-f]/),Dnt=Ul(/[!-/:-@[-`{-~]/);function gt(e){return e!==null&&e<-2}function Wn(e){return e!==null&&(e<0||e===32)}function un(e){return e===-2||e===-1||e===32}const dm=Ul(new RegExp("\\p{P}|\\p{S}","u")),Bc=Ul(/\s/);function Ul(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function zd(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(l=String.fromCharCode(i,o),s=1):l="�"}else l=String.fromCharCode(i);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+s+1,l=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function Lnt(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=zd(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,d),e.applyData(n,d)}function Ont(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Int(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function aj(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=r:s.push({type:"text",value:r}),s}function Bnt(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return aj(e,n);const s={src:zd(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function $nt(e,n){const t={src:zd(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function Hnt(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function Pnt(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return aj(e,n);const s={href:zd(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Fnt(e,n){const t={href:zd(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Unt(e,n,t){const r=e.all(n),s=t?qnt(t):oj(n),i={},l=[];if(typeof n.checked=="boolean"){const _=r[0];let h;_&&_.type==="element"&&_.tagName==="p"?h=_:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function Gnt(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&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 Ynt(e){const n=gy(e),t=lj(e);if(n&&t)return{start:n,end:t}}function Xnt(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),s.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=gy(n.children[1]),c=lj(n.children[n.children.length-1]);o&&c&&(l.position={start:o,end:c}),s.push(l)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function Znt(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,o=l?l.length:n.children.length;let c=-1;const d=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(QS(n.slice(s),s>0,!1)),i.join("")}function QS(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===XS||i===ZS;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===XS||i===ZS;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function ert(e,n){const t={type:"text",value:Jnt(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function trt(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const nrt={blockquote:Nnt,break:znt,code:jnt,delete:Ant,emphasis:Tnt,footnoteReference:Lnt,heading:Ont,html:Int,imageReference:Bnt,image:$nt,inlineCode:Hnt,linkReference:Pnt,link:Fnt,listItem:Unt,list:Gnt,paragraph:Vnt,root:Wnt,strong:Knt,table:Xnt,tableCell:Qnt,tableRow:Znt,text:ert,thematicBreak:trt,toml:k0,yaml:k0,definition:k0,footnoteDefinition:k0};function k0(){}const uj=-1,fm=0,Vf=1,Tp=2,by=3,vy=4,xy=5,yy=6,dj=7,fj=8,rrt=typeof self=="object"?self:globalThis,JS=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new rrt[e](n)},srt=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,l]=n[s];switch(i){case fm:case uj:return t(l,s);case Vf:{const o=t([],s);for(const c of l)o.push(r(c));return o}case Tp:{const o=t({},s);for(const[c,d]of l)o[r(c)]=r(d);return o}case by:return t(new Date(l),s);case vy:{const{source:o,flags:c}=l;return t(new RegExp(o,c),s)}case xy:{const o=t(new Map,s);for(const[c,d]of l)o.set(r(c),r(d));return o}case yy:{const o=t(new Set,s);for(const c of l)o.add(r(c));return o}case dj:{const{name:o,message:c}=l;return t(JS(o,c),s)}case fj:return t(BigInt(l),s);case"BigInt":return t(Object(BigInt(l)),s);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:o}=new Uint8Array(l);return t(new DataView(o),l)}}return t(JS(i,l),s)};return r},ek=e=>srt(new Map,e)(0),wc="",{toString:irt}={},{keys:art}=Object,zf=e=>{const n=typeof e;if(n!=="object"||!e)return[fm,n];const t=irt.call(e).slice(8,-1);switch(t){case"Array":return[Vf,wc];case"Object":return[Tp,wc];case"Date":return[by,wc];case"RegExp":return[vy,wc];case"Map":return[xy,wc];case"Set":return[yy,wc];case"DataView":return[Vf,t]}return t.includes("Array")?[Vf,t]:t.includes("Error")?[dj,t]:[Tp,t]},C0=([e,n])=>e===fm&&(n==="function"||n==="symbol"),ort=(e,n,t,r)=>{const s=(l,o)=>{const c=r.push(l)-1;return t.set(o,c),c},i=l=>{if(t.has(l))return t.get(l);let[o,c]=zf(l);switch(o){case fm:{let _=l;switch(c){case"bigint":o=fj,_=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);_=null;break;case"undefined":return s([uj],l)}return s([o,_],l)}case Vf:{if(c){let m=l;return c==="DataView"?m=new Uint8Array(l.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(l)),s([c,[...m]],l)}const _=[],h=s([o,_],l);for(const m of l)_.push(i(m));return h}case Tp:{if(c)switch(c){case"BigInt":return s([c,l.toString()],l);case"Boolean":case"Number":case"String":return s([c,l.valueOf()],l)}if(n&&"toJSON"in l)return i(l.toJSON());const _=[],h=s([o,_],l);for(const m of art(l))(e||!C0(zf(l[m])))&&_.push([i(m),i(l[m])]);return h}case by:return s([o,isNaN(l.getTime())?wc:l.toISOString()],l);case vy:{const{source:_,flags:h}=l;return s([o,{source:_,flags:h}],l)}case xy:{const _=[],h=s([o,_],l);for(const[m,g]of l)(e||!(C0(zf(m))||C0(zf(g))))&&_.push([i(m),i(g)]);return h}case yy:{const _=[],h=s([o,_],l);for(const m of l)(e||!C0(zf(m)))&&_.push(i(m));return h}}const{message:d}=l;return s([o,{name:c,message:d}],l)};return i},tk=(e,{json:n,lossy:t}={})=>{const r=[];return ort(!(n||t),!!n,new Map,r)(e),r},Mp=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?ek(tk(e,n)):structuredClone(e):(e,n)=>ek(tk(e,n));function lrt(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function crt(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function urt(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||lrt,r=e.options.footnoteBackLabel||crt,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&S.push({type:"text",value:" "});let x=typeof t=="string"?t:t(c,g);typeof x=="string"&&(x={type:"text",value:x}),S.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+m+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,g),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=_[_.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...S)}else _.push(...S);const b={type:"element",tagName:"li",properties:{id:n+"fn-"+m},children:e.wrap(_,!0)};e.patch(d,b),o.push(b)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Mp(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const qh=(function(e){if(e==null)return _rt;if(typeof e=="function")return hm(e);if(typeof e=="object")return Array.isArray(e)?drt(e):frt(e);if(typeof e=="string")return hrt(e);throw new Error("Expected function, string, or object as test")});function drt(e){const n=[];let t=-1;for(;++t":""))+")"})}return m;function m(){let g=hj,S,k,v;if((!n||i(c,d,_[_.length-1]||void 0))&&(g=grt(t(c,_)),g[0]===_2))return g;if("children"in c&&c.children){const b=c;if(b.children&&g[0]!==_j)for(k=(r?b.children.length:-1)+l,v=_.concat(b);k>-1&&k0&&t.push({type:"text",value:` -`}),t}function nk(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function rk(e,n){const t=vrt(e,n),r=t.one(e,void 0),s=urt(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` -`},s),i}function Rp(e,n){return e&&"run"in e?async function(t,r){const s=rk(t,{file:r,...n});await e.run(s,r)}:function(t,r){return rk(t,{file:r,...e||n})}}function sk(e){if(e)throw e}var kb,ik;function krt(){if(ik)return kb;ik=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):n.call(d)==="[object Array]"},i=function(d){if(!d||n.call(d)!=="[object Object]")return!1;var _=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!_&&!h)return!1;var m;for(m in d);return typeof m>"u"||e.call(d,m)},l=function(d,_){t&&_.name==="__proto__"?t(d,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):d[_.name]=_.newValue},o=function(d,_){if(_==="__proto__")if(e.call(d,_)){if(r)return r(d,_).value}else return;return d[_]};return kb=function c(){var d,_,h,m,g,S,k=arguments[0],v=1,b=arguments.length,x=!1;for(typeof k=="boolean"&&(x=k,k=arguments[1]||{},v=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});vl.length;let c;o&&l.push(s);try{c=e.apply(this,l)}catch(d){const _=d;if(o&&t)throw _;return s(_)}o||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(l,...o){t||(t=!0,n(l,...o))}function i(l){s(null,l)}}function Wf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ak(e.position):"start"in e||"end"in e?ak(e):"line"in e||"column"in e?g2(e):""}function g2(e){return ok(e&&e.line)+":"+ok(e&&e.column)}function ak(e){return g2(e&&e.start)+"-"+g2(e&&e.end)}function ok(e){return e&&typeof e=="number"?e:1}class ks extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},l=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(l=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Wf(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ks.prototype.file="";ks.prototype.name="";ks.prototype.reason="";ks.prototype.message="";ks.prototype.stack="";ks.prototype.column=void 0;ks.prototype.line=void 0;ks.prototype.ancestors=void 0;ks.prototype.cause=void 0;ks.prototype.fatal=void 0;ks.prototype.place=void 0;ks.prototype.ruleId=void 0;ks.prototype.source=void 0;const Ta={basename:zrt,dirname:jrt,extname:Art,join:Trt,sep:"/"};function zrt(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Gh(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else l<0&&(i=!0,l=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function jrt(e){if(Gh(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Art(e){Gh(e);let n=e.length,t=-1,r=0,s=-1,i=0,l;for(;n--;){const o=e.codePointAt(n);if(o===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function Trt(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function Rrt(e,n){let t="",r=0,s=-1,i=0,l=-1,o,c;for(;++l<=e.length;){if(l2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),s=l,i=0;continue}}else if(t.length>0){t="",r=0,s=l,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,l):t=e.slice(s+1,l),r=l-s-1;s=l,i=0}else o===46&&i>-1?i++:i=-1}return t}function Gh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Drt={cwd:Lrt};function Lrt(){return"/"}function b2(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ort(e){if(typeof e=="string")e=new URL(e);else if(!b2(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Irt(e)}function Irt(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 n=e.pathname;let t=-1;for(;++t0){let[g,...S]=_;const k=r[m][1];m2(k)&&m2(g)&&(g=Cb(!0,k,g)),r[m]=[d,g,...S]}}}}const Cy=new ky().freeze();function jb(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ab(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tb(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ck(e){if(!m2(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uk(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function E0(e){return Prt(e)?e:new pj(e)}function Prt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Frt(e){return typeof e=="string"||Urt(e)}function Urt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var dk=Object.prototype.hasOwnProperty;function fk(e,n,t){for(t of e.keys())if(Kf(t,n))return t}function Kf(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&Kf(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=fk(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=fk(n,s),!s)||!Kf(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(dk.call(e,t)&&++r&&!dk.call(n,t)||!(t in n)||!Kf(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}function hk(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const l=t.slice(s,r).trim();(l||!i)&&n.push(l),s=r+1,r=t.indexOf(",",s)}return n}function qrt(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Grt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vrt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wrt={};function _k(e,n){return(Wrt.jsx?Vrt:Grt).test(e)}const Krt=/[ \t\n\f\r]/g;function Yrt(e){return typeof e=="object"?e.type==="text"?pk(e.value):!1:pk(e)}function pk(e){return e.replace(Krt,"")===""}class Vh{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Vh.prototype.normal={};Vh.prototype.property={};Vh.prototype.space=void 0;function mj(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new Vh(t,r,n)}function ah(e){return e.toLowerCase()}class Js{constructor(n,t){this.attribute=t,this.property=n}}Js.prototype.attribute="";Js.prototype.booleanish=!1;Js.prototype.boolean=!1;Js.prototype.commaOrSpaceSeparated=!1;Js.prototype.commaSeparated=!1;Js.prototype.defined=!1;Js.prototype.mustUseProperty=!1;Js.prototype.number=!1;Js.prototype.overloadedBoolean=!1;Js.prototype.property="";Js.prototype.spaceSeparated=!1;Js.prototype.space=void 0;let Xrt=0;const $t=Wc(),Ir=Wc(),v2=Wc(),We=Wc(),Vn=Wc(),Mc=Wc(),hi=Wc();function Wc(){return 2**++Xrt}const x2=Object.freeze(Object.defineProperty({__proto__:null,boolean:$t,booleanish:Ir,commaOrSpaceSeparated:hi,commaSeparated:Mc,number:We,overloadedBoolean:v2,spaceSeparated:Vn},Symbol.toStringTag,{value:"Module"})),Mb=Object.keys(x2);class Ey extends Js{constructor(n,t,r,s){let i=-1;if(super(n,t),mk(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&tst.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(gk,rst);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!gk.test(i)){let l=i.replace(est,nst);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}s=Ey}return new s(r,n)}function nst(e){return"-"+e.toLowerCase()}function rst(e){return e.charAt(1).toUpperCase()}const kj=mj([gj,Zrt,xj,yj,wj],"html"),_m=mj([gj,Qrt,xj,yj,wj],"svg");function bk(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function sst(e){return e.join(" ").trim()}var ju={},Rb,vk;function ist(){if(vk)return Rb;vk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,o=/^\s+|\s+$/g,c=` -`,d="/",_="*",h="",m="comment",g="declaration";function S(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var x=1,y=1;function C(W){var Z=W.match(n);Z&&(x+=Z.length);var U=W.lastIndexOf(c);y=~U?W.length-U:y+W.length}function j(){var W={line:x,column:y};return function(Z){return Z.position=new N(W),D(),Z}}function N(W){this.start=W,this.end={line:x,column:y},this.source=b.source}N.prototype.content=v;function M(W){var Z=new Error(b.source+":"+x+":"+y+": "+W);if(Z.reason=W,Z.filename=b.source,Z.line=x,Z.column=y,Z.source=v,!b.silent)throw Z}function z(W){var Z=W.exec(v);if(Z){var U=Z[0];return C(U),v=v.slice(U.length),Z}}function D(){z(t)}function I(W){var Z;for(W=W||[];Z=$();)Z!==!1&&W.push(Z);return W}function $(){var W=j();if(!(d!=v.charAt(0)||_!=v.charAt(1))){for(var Z=2;h!=v.charAt(Z)&&(_!=v.charAt(Z)||d!=v.charAt(Z+1));)++Z;if(Z+=2,h===v.charAt(Z-1))return M("End of comment missing");var U=v.slice(2,Z-2);return y+=2,C(U),v=v.slice(Z),y+=2,W({type:m,comment:U})}}function P(){var W=j(),Z=z(r);if(Z){if($(),!z(s))return M("property missing ':'");var U=z(i),Y=W({type:g,property:k(Z[0].replace(e,h)),value:U?k(U[0].replace(e,h)):h});return z(l),Y}}function F(){var W=[];I(W);for(var Z;Z=P();)Z!==!1&&(W.push(Z),I(W));return W}return D(),F()}function k(v){return v?v.replace(o,h):h}return Rb=S,Rb}var xk;function ast(){if(xk)return ju;xk=1;var e=ju&&ju.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ju,"__esModule",{value:!0}),ju.default=t;const n=e(ist());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const l=(0,n.default)(r),o=typeof s=="function";return l.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:_}=c;o?s(d,_,c):_&&(i=i||{},i[d]=_)}),i}return ju}var jf={},yk;function ost(){if(yk)return jf;yk=1,Object.defineProperty(jf,"__esModule",{value:!0}),jf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(d){return!d||t.test(d)||e.test(d)},l=function(d,_){return _.toUpperCase()},o=function(d,_){return"".concat(_,"-")},c=function(d,_){return _===void 0&&(_={}),i(d)?d:(d=d.toLowerCase(),_.reactCompat?d=d.replace(s,o):d=d.replace(r,o),d.replace(n,l))};return jf.camelCase=c,jf}var Af,wk;function lst(){if(wk)return Af;wk=1;var e=Af&&Af.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(ast()),t=ost();function r(s,i){var l={};return!s||typeof s!="string"||(0,n.default)(s,function(o,c){o&&c&&(l[(0,t.camelCase)(o,i)]=c)}),l}return r.default=r,Af=r,Af}var cst=lst();const ust=Ih(cst),Ny={}.hasOwnProperty,dst=new Map,fst=/[A-Z]/g,hst=new Set(["table","tbody","thead","tfoot","tr"]),_st=new Set(["td","th"]),Cj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ej(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=wst(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=yst(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?_m:kj,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=Nj(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function Nj(e,n,t){if(n.type==="element")return pst(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return mst(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return bst(e,n,t);if(n.type==="mdxjsEsm")return gst(e,n);if(n.type==="root")return vst(e,n,t);if(n.type==="text")return xst(e,n)}function pst(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=_m,e.schema=s),e.ancestors.push(n);const i=jj(e,n.tagName,!1),l=Sst(e,n);let o=jy(e,n);return hst.has(n.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!Yrt(c):!0})),zj(e,l,i,n),zy(l,o),e.ancestors.pop(),e.schema=r,e.create(n,i,l,t)}function mst(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}oh(e,n.position)}function gst(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);oh(e,n.position)}function bst(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=_m,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:jj(e,n.name,!0),l=kst(e,n),o=jy(e,n);return zj(e,l,i,n),zy(l,o),e.ancestors.pop(),e.schema=r,e.create(n,i,l,t)}function vst(e,n,t){const r={};return zy(r,jy(e,n)),e.create(n,e.Fragment,r,t)}function xst(e,n){return n.value}function zj(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function zy(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function yst(e,n,t){return r;function r(s,i,l,o){const d=Array.isArray(l.children)?t:n;return o?d(i,l,o):d(i,l)}}function wst(e,n){return t;function t(r,s,i,l){const o=Array.isArray(i.children),c=gy(r);return n(s,i,l,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Sst(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&Ny.call(n.properties,s)){const i=Cst(e,s,n.properties[s]);if(i){const[l,o]=i;e.tableCellAlignToStyle&&l==="align"&&typeof o=="string"&&_st.has(n.tagName)?r=o:t[l]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function kst(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const l=i.expression;l.type;const o=l.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else oh(e,n.position);else{const s=r.name;let i;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,i=e.evaluater.evaluateExpression(o.expression)}else oh(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function jy(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:dst;for(;++ry.key).filter(y=>y!==void 0));let d=0;for(;d=e.children.length-_&&(N=s.length-(e.children.length-y)),N>=0&&(j=((b=s[N])==null?void 0:b.key)??j);j&&c.has(j)&&((x=s[N])==null?void 0:x.key)!==j;)j=`${j}+`;j&&c.add(j);const M=Aj(C,s[N]??null,t,j);i.push(M),M.react!==void 0&&l.push(M.react)}const h=n!==null&&Rst(e,n.node);if(n&&n.key===r&&h&&s.length===i.length&&i.every((y,C)=>y===s[C]))return n;const m=e.type==="element"&&Ast.has(e.tagName)?l.filter(y=>typeof y!="string"||!Tst.test(y)):l,g=m.length>0?m.length===1?m[0]:m:null;let S=h?n==null?void 0:n.shell:null;if(!S){const y=Ej({...e,children:[]},t);S={props:y.props,type:y.type}}return{children:i,key:r,node:e,react:f.jsx(S.type,{...S.props,children:g},r),shell:S}}function Rst(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:l,...o}=n;return Kf(s,o)}function Ku(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let l=0;ls?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);i0?(gi(e,e.length,0,n),e):n}const Ck={}.hasOwnProperty;function Mj(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function ia(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function tn(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return l;function l(c){return un(c)?(e.enter(t),o(c)):n(c)}function o(c){return un(c)&&i++l))return;const M=n.events.length;let z=M,D,I;for(;z--;)if(n.events[z][0]==="exit"&&n.events[z][1].type==="chunkFlow"){if(D){I=n.events[z][1].end;break}D=!0}for(b(r),N=M;Ny;){const j=t[C];n.containerState=j[1],j[0].exit.call(n,e)}t.length=y}function x(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Fst(e,n,t){return tn(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cd(e){if(e===null||Wn(e)||Bc(e))return 1;if(dm(e))return 2}function pm(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const h={...e[r][1].end},m={...e[t][1].start};Nk(h,-c),Nk(m,c),l={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:m},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:c>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[r][1].end={...l.start},e[t][1].start={...o.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=$i(d,[["enter",e[r][1],n],["exit",e[r][1],n]])),d=$i(d,[["enter",s,n],["enter",l,n],["exit",l,n],["enter",i,n]]),d=$i(d,pm(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),d=$i(d,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,d=$i(d,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,gi(e,r-1,t-r+3,d),t=r+d.length-_-2;break}}for(t=-1;++t0&&un(N)?tn(e,x,"linePrefix",i+1)(N):x(N)}function x(N){return N===null||gt(N)?e.check(zk,k,C)(N):(e.enter("codeFlowValue"),y(N))}function y(N){return N===null||gt(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),y)}function C(N){return e.exit("codeFenced"),n(N)}function j(N,M,z){let D=0;return I;function I(Z){return N.enter("lineEnding"),N.consume(Z),N.exit("lineEnding"),$}function $(Z){return N.enter("codeFencedFence"),un(Z)?tn(N,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):P(Z)}function P(Z){return Z===o?(N.enter("codeFencedFenceSequence"),F(Z)):z(Z)}function F(Z){return Z===o?(D++,N.consume(Z),F):D>=l?(N.exit("codeFencedFenceSequence"),un(Z)?tn(N,W,"whitespace")(Z):W(Z)):z(Z)}function W(Z){return Z===null||gt(Z)?(N.exit("codeFencedFence"),M(Z)):z(Z)}}}function eit(e,n,t){const r=this;return s;function s(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i)}function i(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const Db={name:"codeIndented",tokenize:nit},tit={partial:!0,tokenize:rit};function nit(e,n,t){const r=this;return s;function s(d){return e.enter("codeIndented"),tn(e,i,"linePrefix",5)(d)}function i(d){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?l(d):t(d)}function l(d){return d===null?c(d):gt(d)?e.attempt(tit,l,c)(d):(e.enter("codeFlowValue"),o(d))}function o(d){return d===null||gt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),o)}function c(d){return e.exit("codeIndented"),n(d)}}function rit(e,n,t){const r=this;return s;function s(l){return r.parser.lazy[r.now().line]?t(l):gt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):tn(e,i,"linePrefix",5)(l)}function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(l):gt(l)?s(l):t(l)}}const sit={name:"codeText",previous:ait,resolve:iit,tokenize:oit};function iit(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Tf(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Tf(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Tf(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function Bj(e,n,t,r,s,i,l,o,c){const d=c||Number.POSITIVE_INFINITY;let _=0;return h;function h(b){return b===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(b),e.exit(i),m):b===null||b===32||b===41||Ap(b)?t(b):(e.enter(r),e.enter(l),e.enter(o),e.enter("chunkString",{contentType:"string"}),k(b))}function m(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===62?(e.exit("chunkString"),e.exit(o),m(b)):b===null||b===60||gt(b)?t(b):(e.consume(b),b===92?S:g)}function S(b){return b===60||b===62||b===92?(e.consume(b),g):g(b)}function k(b){return!_&&(b===null||b===41||Wn(b))?(e.exit("chunkString"),e.exit(o),e.exit(l),e.exit(r),n(b)):_999||g===null||g===91||g===93&&!c||g===94&&!o&&"_hiddenFootnoteSupport"in l.parser.constructs?t(g):g===93?(e.exit(i),e.enter(s),e.consume(g),e.exit(s),e.exit(r),n):gt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||gt(g)||o++>999?(e.exit("chunkString"),_(g)):(e.consume(g),c||(c=!un(g)),g===92?m:h)}function m(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function Hj(e,n,t,r,s,i){let l;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),l=m===40?41:m,c):t(m)}function c(m){return m===l?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):(e.enter(i),d(m))}function d(m){return m===l?(e.exit(i),c(l)):m===null?t(m):gt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),tn(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(m))}function _(m){return m===l||m===null||gt(m)?(e.exit("chunkString"),d(m)):(e.consume(m),m===92?h:_)}function h(m){return m===l||m===92?(e.consume(m),_):_(m)}}function Yf(e,n){let t;return r;function r(s){return gt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):un(s)?tn(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const pit={name:"definition",tokenize:git},mit={partial:!0,tokenize:bit};function git(e,n,t){const r=this;let s;return i;function i(g){return e.enter("definition"),l(g)}function l(g){return $j.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function o(g){return s=ia(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),c):t(g)}function c(g){return Wn(g)?Yf(e,d)(g):d(g)}function d(g){return Bj(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function _(g){return e.attempt(mit,h,h)(g)}function h(g){return un(g)?tn(e,m,"whitespace")(g):m(g)}function m(g){return g===null||gt(g)?(e.exit("definition"),r.parser.defined.push(s),n(g)):t(g)}}function bit(e,n,t){return r;function r(o){return Wn(o)?Yf(e,s)(o):t(o)}function s(o){return Hj(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return un(o)?tn(e,l,"whitespace")(o):l(o)}function l(o){return o===null||gt(o)?n(o):t(o)}}const vit={name:"hardBreakEscape",tokenize:xit};function xit(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return gt(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const yit={name:"headingAtx",resolve:wit,tokenize:Sit};function wit(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},gi(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function Sit(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),l(_)}function l(_){return _===35&&r++<6?(e.consume(_),l):_===null||Wn(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),c(_)):_===null||gt(_)?(e.exit("atxHeading"),n(_)):un(_)?tn(e,o,"whitespace")(_):(e.enter("atxHeadingText"),d(_))}function c(_){return _===35?(e.consume(_),c):(e.exit("atxHeadingSequence"),o(_))}function d(_){return _===null||_===35||Wn(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),d)}}const kit=["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"],Ak=["pre","script","style","textarea"],Cit={concrete:!0,name:"htmlFlow",resolveTo:zit,tokenize:jit},Eit={partial:!0,tokenize:Tit},Nit={partial:!0,tokenize:Ait};function zit(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function jit(e,n,t){const r=this;let s,i,l,o,c;return d;function d(V){return _(V)}function _(V){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(V),h}function h(V){return V===33?(e.consume(V),m):V===47?(e.consume(V),i=!0,k):V===63?(e.consume(V),s=3,r.interrupt?n:L):Rs(V)?(e.consume(V),l=String.fromCharCode(V),v):t(V)}function m(V){return V===45?(e.consume(V),s=2,g):V===91?(e.consume(V),s=5,o=0,S):Rs(V)?(e.consume(V),s=4,r.interrupt?n:L):t(V)}function g(V){return V===45?(e.consume(V),r.interrupt?n:L):t(V)}function S(V){const ae="CDATA[";return V===ae.charCodeAt(o++)?(e.consume(V),o===ae.length?r.interrupt?n:P:S):t(V)}function k(V){return Rs(V)?(e.consume(V),l=String.fromCharCode(V),v):t(V)}function v(V){if(V===null||V===47||V===62||Wn(V)){const ae=V===47,ce=l.toLowerCase();return!ae&&!i&&Ak.includes(ce)?(s=1,r.interrupt?n(V):P(V)):kit.includes(l.toLowerCase())?(s=6,ae?(e.consume(V),b):r.interrupt?n(V):P(V)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(V):i?x(V):y(V))}return V===45||ys(V)?(e.consume(V),l+=String.fromCharCode(V),v):t(V)}function b(V){return V===62?(e.consume(V),r.interrupt?n:P):t(V)}function x(V){return un(V)?(e.consume(V),x):I(V)}function y(V){return V===47?(e.consume(V),I):V===58||V===95||Rs(V)?(e.consume(V),C):un(V)?(e.consume(V),y):I(V)}function C(V){return V===45||V===46||V===58||V===95||ys(V)?(e.consume(V),C):j(V)}function j(V){return V===61?(e.consume(V),N):un(V)?(e.consume(V),j):y(V)}function N(V){return V===null||V===60||V===61||V===62||V===96?t(V):V===34||V===39?(e.consume(V),c=V,M):un(V)?(e.consume(V),N):z(V)}function M(V){return V===c?(e.consume(V),c=null,D):V===null||gt(V)?t(V):(e.consume(V),M)}function z(V){return V===null||V===34||V===39||V===47||V===60||V===61||V===62||V===96||Wn(V)?j(V):(e.consume(V),z)}function D(V){return V===47||V===62||un(V)?y(V):t(V)}function I(V){return V===62?(e.consume(V),$):t(V)}function $(V){return V===null||gt(V)?P(V):un(V)?(e.consume(V),$):t(V)}function P(V){return V===45&&s===2?(e.consume(V),U):V===60&&s===1?(e.consume(V),Y):V===62&&s===4?(e.consume(V),B):V===63&&s===3?(e.consume(V),L):V===93&&s===5?(e.consume(V),H):gt(V)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Eit,X,F)(V)):V===null||gt(V)?(e.exit("htmlFlowData"),F(V)):(e.consume(V),P)}function F(V){return e.check(Nit,W,X)(V)}function W(V){return e.enter("lineEnding"),e.consume(V),e.exit("lineEnding"),Z}function Z(V){return V===null||gt(V)?F(V):(e.enter("htmlFlowData"),P(V))}function U(V){return V===45?(e.consume(V),L):P(V)}function Y(V){return V===47?(e.consume(V),l="",J):P(V)}function J(V){if(V===62){const ae=l.toLowerCase();return Ak.includes(ae)?(e.consume(V),B):P(V)}return Rs(V)&&l.length<8?(e.consume(V),l+=String.fromCharCode(V),J):P(V)}function H(V){return V===93?(e.consume(V),L):P(V)}function L(V){return V===62?(e.consume(V),B):V===45&&s===2?(e.consume(V),L):P(V)}function B(V){return V===null||gt(V)?(e.exit("htmlFlowData"),X(V)):(e.consume(V),B)}function X(V){return e.exit("htmlFlow"),n(V)}}function Ait(e,n,t){const r=this;return s;function s(l){return gt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):t(l)}function i(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function Tit(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Wh,n,t)}}const Mit={name:"htmlText",tokenize:Rit};function Rit(e,n,t){const r=this;let s,i,l;return o;function o(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),c}function c(L){return L===33?(e.consume(L),d):L===47?(e.consume(L),j):L===63?(e.consume(L),y):Rs(L)?(e.consume(L),z):t(L)}function d(L){return L===45?(e.consume(L),_):L===91?(e.consume(L),i=0,S):Rs(L)?(e.consume(L),x):t(L)}function _(L){return L===45?(e.consume(L),g):t(L)}function h(L){return L===null?t(L):L===45?(e.consume(L),m):gt(L)?(l=h,Y(L)):(e.consume(L),h)}function m(L){return L===45?(e.consume(L),g):h(L)}function g(L){return L===62?U(L):L===45?m(L):h(L)}function S(L){const B="CDATA[";return L===B.charCodeAt(i++)?(e.consume(L),i===B.length?k:S):t(L)}function k(L){return L===null?t(L):L===93?(e.consume(L),v):gt(L)?(l=k,Y(L)):(e.consume(L),k)}function v(L){return L===93?(e.consume(L),b):k(L)}function b(L){return L===62?U(L):L===93?(e.consume(L),b):k(L)}function x(L){return L===null||L===62?U(L):gt(L)?(l=x,Y(L)):(e.consume(L),x)}function y(L){return L===null?t(L):L===63?(e.consume(L),C):gt(L)?(l=y,Y(L)):(e.consume(L),y)}function C(L){return L===62?U(L):y(L)}function j(L){return Rs(L)?(e.consume(L),N):t(L)}function N(L){return L===45||ys(L)?(e.consume(L),N):M(L)}function M(L){return gt(L)?(l=M,Y(L)):un(L)?(e.consume(L),M):U(L)}function z(L){return L===45||ys(L)?(e.consume(L),z):L===47||L===62||Wn(L)?D(L):t(L)}function D(L){return L===47?(e.consume(L),U):L===58||L===95||Rs(L)?(e.consume(L),I):gt(L)?(l=D,Y(L)):un(L)?(e.consume(L),D):U(L)}function I(L){return L===45||L===46||L===58||L===95||ys(L)?(e.consume(L),I):$(L)}function $(L){return L===61?(e.consume(L),P):gt(L)?(l=$,Y(L)):un(L)?(e.consume(L),$):D(L)}function P(L){return L===null||L===60||L===61||L===62||L===96?t(L):L===34||L===39?(e.consume(L),s=L,F):gt(L)?(l=P,Y(L)):un(L)?(e.consume(L),P):(e.consume(L),W)}function F(L){return L===s?(e.consume(L),s=void 0,Z):L===null?t(L):gt(L)?(l=F,Y(L)):(e.consume(L),F)}function W(L){return L===null||L===34||L===39||L===60||L===61||L===96?t(L):L===47||L===62||Wn(L)?D(L):(e.consume(L),W)}function Z(L){return L===47||L===62||Wn(L)?D(L):t(L)}function U(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),n):t(L)}function Y(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),J}function J(L){return un(L)?tn(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):H(L)}function H(L){return e.enter("htmlTextData"),l(L)}}const Ty={name:"labelEnd",resolveAll:Iit,resolveTo:Bit,tokenize:$it},Dit={tokenize:Hit},Lit={tokenize:Pit},Oit={tokenize:Fit};function Iit(e){let n=-1;const t=[];for(;++n=3&&(d===null||gt(d))?(e.exit("thematicBreak"),n(d)):t(d)}function c(d){return d===s?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),un(d)?tn(e,o,"whitespace")(d):o(d))}}const Ks={continuation:{tokenize:Qit},exit:eat,name:"list",tokenize:Zit},Yit={partial:!0,tokenize:tat},Xit={partial:!0,tokenize:Jit};function Zit(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return o;function o(g){const S=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:h2(g)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(sp,t,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(g)}return t(g)}function c(g){return h2(g)&&++l<10?(e.consume(g),c):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):t(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Wh,r.interrupt?t:_,e.attempt(Yit,m,h))}function _(g){return r.containerState.initialBlankLine=!0,i++,m(g)}function h(g){return un(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):t(g)}function m(g){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(g)}}function Qit(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Wh,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tn(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!un(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Xit,n,l)(o))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,tn(e,e.attempt(Ks,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Jit(e,n,t){const r=this;return tn(e,s,"listItemIndent",r.containerState.size+1);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(i):t(i)}}function eat(e){e.exit(this.containerState.type)}function tat(e,n,t){const r=this;return tn(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const l=r.events[r.events.length-1];return!un(i)&&l&&l[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const Tk={name:"setextUnderline",resolveTo:nat,tokenize:rat};function nat(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",l,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function rat(e,n,t){const r=this;let s;return i;function i(d){let _=r.events.length,h;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){h=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),s=d,l(d)):t(d)}function l(d){return e.enter("setextHeadingLineSequence"),o(d)}function o(d){return d===s?(e.consume(d),o):(e.exit("setextHeadingLineSequence"),un(d)?tn(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||gt(d)?(e.exit("setextHeadingLine"),n(d)):t(d)}}const sat={tokenize:iat};function iat(e){const n=this,t=e.attempt(Wh,r,e.attempt(this.parser.constructs.flowInitial,s,tn(e,e.attempt(this.parser.constructs.flow,s,e.attempt(uit,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const aat={resolveAll:Fj()},oat=Pj("string"),lat=Pj("text");function Pj(e){return{resolveAll:Fj(e==="text"?cat:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,l,o);return l;function l(_){return d(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),c}function c(_){return d(_)?(t.exit("data"),i(_)):(t.consume(_),c)}function d(_){if(_===null)return!0;const h=s[_];let m=-1;if(h)for(;++m-1){const o=l[0];typeof o=="string"?l[0]=o.slice(r):l.shift()}i>0&&l.push(e[s].slice(0,i))}return l}function wat(e,n){let t=-1;const r=[];let s;for(;++t0){const At=Je.tokenStack[Je.tokenStack.length-1];(At[1]||Rk).call(Je,void 0,At[0])}for(Oe.position={start:wl(we.length>0?we[0][1].start:{line:1,column:1,offset:0}),end:wl(we.length>0?we[we.length-2][1].end:{line:1,column:1,offset:0})},De=-1;++De0&&(os(this,jl,rr(this,jl)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=Dk(t)),rr(this,jl)+qat(t,r)}}jl=new WeakMap;const Rat=new Set(["*","**","_","__"]);function Dk(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(Uat(n)){Lk(n,t,r);continue}const i=Bat(n,e,t);if(i>t){t=i-1;continue}const l=$at(n,e,t);if(l>t){t=l-1;continue}aa(e,t)||Lk(n,t,r)}return n}function Dat(e,n,t){const r=n[t];return r==="`"?Lat(e,n,t):r==="$"?Oat(e,n,t):r==="~"?Iat(e,n,t):t}function Lat(e,n,t){const r=Ry(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&Dp(n,t)&&!aa(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!aa(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||aa(n,t)?t+r:r>=3&&Dp(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function Oat(e,n,t){const r=Ry(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!aa(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||aa(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function Iat(e,n,t){const r=Ry(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(Dp(n,t)&&!aa(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!Dp(n,t)||aa(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function Bat(e,n,t){if(n[t]!=="<"||aa(n,t))return t;const r=n[t+1];if(r!==void 0&&!Wj(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` -`)return e.pendingHtml=null,s+1;return n.length}function $at(e,n,t){const r=Hat(n,t);if(!r)return t;if(aa(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Pat(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Hat(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Pat(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!Bk(s)||!Bk(r)}function Lk(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function Fat(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function Uat(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function qat(e,n){n.pendingHtml!==null&&(e=e.slice(0,Wat(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return ja(Gat(e,t));const r=Vat(n);if(r)return ja(qu(e,r));const s=Xat(n);return s?s.kind==="delim"?ja(w2(e,s.start,s.token.length)?Gj(e,s.token):e.slice(0,s.start)):w2(e,s.start,s.token.length)?s.kind==="fence"?ja(e):s.kind==="code"?ja(qu(e,s.token)):s.token==="$$"?ja(qu(e,(e.endsWith(` -`)?"":` -`)+"$$")):/\s/.test(e[e.length-1]??"")?ja(e):ja(qu(e,"$")):ja(s.kind==="fence"?e:e.slice(0,s.start)):ja(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function Gat(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return w2(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function Vat(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!Rat.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function Wat(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!Kat(e,s,r))break;t=s,r=s}return t}function Kat(e,n,t){if(e[t-1]!==">"||aa(e,n))return!1;const r=e[n+1];if(r!==void 0&&!Wj(r))return!1;for(let s=n+1;s"||i===` -`)return!1}return!0}function ja(e){var v;const n=e.lastIndexOf(` - -`),t=n===-1?0:n+2,r=e.slice(0,t),s=e.slice(t),i=s.indexOf(` -`),l=i===-1?s:s.slice(0,i),o=(v=l.match(/^( *)\|/))==null?void 0:v[1];if(o===void 0)return e;if(Ok(l)<2&&!Zat(l,o))return r;const c=l.trimEnd().endsWith("|")?l:Gj(l," |"),d=Ok(c),_=d<2?0:c.trimEnd().endsWith("|")?d-1:d;if(_===0)return e;const h=i===-1?"":s.slice(i+1),m=Ik(o,Array.from({length:_},()=>"-"));if(h.length===0)return r+c+` -`+m;const g=h.indexOf(` -`),S=g===-1?h:h.slice(0,g),k=g===-1?"":h.slice(g);if(Qat(S,o,_))return e;if(S.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(S.slice(o.length))){const b=Vj(S,o).map(x=>{const y=x.trim();if(y.length===0)return"-";let C=0;for(let j=0;j1&&y.endsWith(":")?":":"")});for(;b.length<_;)b.push("-");return r+c+` -`+Ik(o,b)+k}return r+c+` -`+m+` -`+h}function qu(e,n){return e+n.slice(Yat(e,n))}function Gj(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return qu(e,n);const r=e.slice(0,-t.length);return qu(r,n)+t}function Yat(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function Xat(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function Ok(e){let n=0;for(let t=0;t0}function Ik(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function Vj(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function Qat(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=Vj(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function Ry(e,n){let t=n+1;for(;tn+t}function Dp(e,n){return n===0||e[n-1]===` -`}function aa(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function Bk(e){return!!e&&/[A-Za-z0-9]/.test(e)}function Wj(e){return!!e&&/[A-Za-z]/.test(e)}const Kj=Cy().use(My);var Mh,td,nd,jc,rd,Rh,Dh,Lh,Ac,Oh,Tc;class Jat{constructor(){fi(this,Mh,Kj);fi(this,td,null);fi(this,nd,{});fi(this,jc,null);fi(this,rd,"");fi(this,Rh,[]);fi(this,Dh,[]);fi(this,Lh,[]);fi(this,Ac,0);fi(this,Oh,[]);fi(this,Tc,[])}reconfigure(n,t,r){rr(this,td)!==null&&rr(this,Mh)===n&&Yj(rr(this,nd),r)&&!!rr(this,jc)===t||(os(this,Mh,n),n.attachers.some(s=>s[0]===Rp)||(n=n(),n.use(Rp),n.freeze()),os(this,td,n),os(this,nd,r),os(this,rd,""),os(this,Rh,[]),os(this,Dh,[]),os(this,Lh,[]),os(this,Ac,0),os(this,Oh,[]),os(this,jc,t?new Mat:null))}update(n){rr(this,jc)&&(n=rr(this,jc).update(n));let t=rr(this,rd);if(n===t)return rr(this,Tc);const r=rr(this,Rh),s=eot(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let l=r[i]??0;i===-1&&(i=0);const o=bc(rr(this,td)),c=rr(this,Dh),d=c.slice(i).some(N=>N.some(S2));let _=o.parse(n.slice(l)),h=_.children.map(N=>bc(bc(N.position).start.offset)+l);os(this,rd,n),Sb(r.length===c.length),r.splice(i,r.length-i,...h);{const N=Ob(_,h,l);Sb(N.length===h.length),c.splice(i,c.length-i,...N)}if(d||S2(_)){i=0,l=0,_=o.parse(n),h=_.children.map(M=>bc(bc(M.position).start.offset)+l),r.splice(0,r.length,...h);const N=Ob(_,h,l);Sb(N.length===h.length),c.splice(0,c.length,...N)}const m=Ob(o.runSync(_),h,l),g=rr(this,Lh),S=rr(this,Oh),k=rr(this,Tc),v=S.length;let b=null,x=0;for(;xv&&(g.length=S.length=r.length);for(let N=r.length=C?D=v-(r.length-M):M=v){g[M]=String(rr(this,Ac)),os(this,Ac,rr(this,Ac)+1),S[M]=null,b&&(b[M]=void 0);continue}g[M]=g[D]??String(T6(this,Ac)._++),S[M]=S[D]??null,b&&(b[M]=k[D])}r.length[]);let s=0;for(const l of e.children){const o=(i=l.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||oot.test(e.slice(0,n))?e:""}const Fk=/[#.]/g;function hot(e,n){const t=e||"",r={};let s=0,i,l;for(;sd&&(d=_):_&&(d!==void 0&&d>-1&&c.push(` -`.repeat(d)||" "),d=-1,c.push(_))}return c.join("")}function nA(e,n,t){return e.type==="element"?Lot(e,n,t):e.type==="text"?t.whitespace==="normal"?rA(e,t):Oot(e):[]}function Lot(e,n,t){const r=sA(e,t),s=e.children||[];let i=-1,l=[];if(Rot(e))return l;let o,c;for(C2(e)||Yk(e)&&Gk(n,e,Yk)?c=` -`:Mot(e)?(o=2,c=2):tA(e)&&(o=1,c=1);++i15?d="…"+o.slice(s-15,s):d=o.slice(0,s);var _;i+15e.replace(Pot,"-$1").toLowerCase(),Uot={"&":"&",">":">","<":"<",'"':""","'":"'"},qot=/[&><"']/g,Ss=e=>String(e).replace(qot,n=>Uot[n]),ip=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?ip(e.body[0]):e:e.type==="font"?ip(e.body):e,Got=new Set(["mathord","textord","atom"]),Do=e=>Got.has(ip(e).type),Vot=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},E2={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Wot(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function Kot(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return Wot(n)}function Yot(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:Kot(r)}class Ly{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(E2)){var r=E2[t];r&&Yot(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Ke("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=Vot(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class Sl{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return Ra[Xot[this.id]]}sub(){return Ra[Zot[this.id]]}fracNum(){return Ra[Qot[this.id]]}fracDen(){return Ra[Jot[this.id]]}cramp(){return Ra[elt[this.id]]}text(){return Ra[tlt[this.id]]}isTight(){return this.size>=2}}var Oy=0,Lp=1,Yu=2,No=3,ch=4,Hi=5,ud=6,Ds=7,Ra=[new Sl(Oy,0,!1),new Sl(Lp,0,!0),new Sl(Yu,1,!1),new Sl(No,1,!0),new Sl(ch,2,!1),new Sl(Hi,2,!0),new Sl(ud,3,!1),new Sl(Ds,3,!0)],Xot=[ch,Hi,ch,Hi,ud,Ds,ud,Ds],Zot=[Hi,Hi,Hi,Hi,Ds,Ds,Ds,Ds],Qot=[Yu,No,ch,Hi,ud,Ds,ud,Ds],Jot=[No,No,Hi,Hi,Ds,Ds,Ds,Ds],elt=[Lp,Lp,No,No,Hi,Hi,Ds,Ds],tlt=[Oy,Lp,Yu,No,Yu,No,Yu,No],Ht={DISPLAY:Ra[Oy],TEXT:Ra[Yu],SCRIPT:Ra[ch],SCRIPTSCRIPT:Ra[ud]},N2=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function nlt(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var ap=[];N2.forEach(e=>e.blocks.forEach(n=>ap.push(...n)));function iA(e){for(var n=0;n=ap[n]&&e<=ap[n+1])return!0;return!1}var Yr=e=>e+" "+e,Au=80,rlt=function(n,t){return"M95,"+(622+n+t)+` -c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 -c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 -c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 -s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 -c69,-144,104.5,-217.7,106.5,-221 -l`+n/2.075+" -"+n+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+n)+`H845.2724 -s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 -c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},slt=function(n,t){return"M263,"+(601+n+t)+`c0.7,0,18,39.7,52,119 -c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 -c340,-704.7,510.7,-1060.3,512,-1067 -l`+n/2.084+" -"+n+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+n)+`H1012.3 -s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 -c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 -s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 -c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},ilt=function(n,t){return"M983 "+(10+n+t)+` -l`+n/3.13+" -"+n+` -c4,-6.7,10,-10,18,-10 H400000v`+(40+n)+` -H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 -s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 -c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 -c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 -c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 -c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},alt=function(n,t){return"M424,"+(2398+n+t)+` -c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 -c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 -s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 -s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 -l`+n/4.223+" -"+n+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+n)+`H1014.6 -s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 -c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2z M`+(1001+n)+" "+t+` -h400000v`+(40+n)+"h-400000z"},olt=function(n,t){return"M473,"+(2713+n+t)+` -c339.3,-1799.3,509.3,-2700,510,-2702 l`+n/5.298+" -"+n+` -c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+n)+`H1017.7 -s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 -c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 -s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},llt=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},clt=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` -H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 -h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 -c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},ult=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=rlt(t,Au);break;case"sqrtSize1":s=slt(t,Au);break;case"sqrtSize2":s=ilt(t,Au);break;case"sqrtSize3":s=alt(t,Au);break;case"sqrtSize4":s=olt(t,Au);break;case"sqrtTall":s=clt(t,Au,r)}return s},dlt=function(n,t){switch(n){case"⎜":return Yr("M291 0 H417 V"+t+" H291z");case"∣":return Yr("M145 0 H188 V"+t+" H145z");case"∥":return Yr("M145 0 H188 V"+t+" H145z")+Yr("M367 0 H410 V"+t+" H367z");case"⎟":return Yr("M457 0 H583 V"+t+" H457z");case"⎢":return Yr("M319 0 H403 V"+t+" H319z");case"⎥":return Yr("M263 0 H347 V"+t+" H263z");case"⎪":return Yr("M384 0 H504 V"+t+" H384z");case"⏐":return Yr("M312 0 H355 V"+t+" H312z");case"‖":return Yr("M257 0 H300 V"+t+" H257z")+Yr("M478 0 H521 V"+t+" H478z");default:return""}},Xk={doubleleftarrow:`M262 157 -l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 -c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 --86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 --2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z -m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l --10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 --33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 --17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 --13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 -c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 --107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 --5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 -c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 --45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 --331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 -H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 - 435 0h399565z`,leftgroupunder:`M400000 262 -H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 --3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 --18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 --196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 --4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 --10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z -m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 --152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 --2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 -v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 --83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 --68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Yr("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Yr("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Yr("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Yr("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 --.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 -c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Yr("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 -c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 --53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 -c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 --5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 --320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z -m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 -60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 --451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z -m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 -c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 --480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z -m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 -85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 --707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z -m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 -c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 --16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 --40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l --6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 -s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 -c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 --174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 --3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 --10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 --18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z -m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 --7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 --27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 --64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z -m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 --13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Yr("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Yr("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Yr("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 --52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 --167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 --70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 --40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 --37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 -c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 --19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 --2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 --68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 --8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 -c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 --11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 --11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 -3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 -10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 --1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 --7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 -H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 -c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 -c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, --5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 -c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 -c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 -s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 -121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 -s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 -c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z -M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 --27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 -13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 --84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 --119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 -151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 -c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 -c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 -c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z -M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, -1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, --152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z -M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},flt=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 -H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z -M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z -M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z -M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z -M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 -c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, --36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, -949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 -c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, --544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 -l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, --210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, -63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 -c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` -c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 -c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 -c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 -c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 -l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function hlt(e){return"toText"in e}class Ad{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(hlt(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var z2={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},_lt={ex:!0,em:!0,mu:!0},aA=function(n){return typeof n!="string"&&(n=n.unit),n in z2||n in _lt||n==="ex"},hr=function(n,t){var r;if(n.unit in z2)r=z2[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new Ke("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},Ze=function(n){return+n.toFixed(4)+"em"},Rl=function(n){return n.filter(t=>t).join(" ")},Iy=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=Fot(r)+":"+s+";")}return t},oA=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},lA=function(n){var t=document.createElement(n);t.className=Rl(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,cA=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+Ss(Rl(this.classes))+'"');var r=Iy(this.style);r&&(t+=' style="'+Ss(r)+'"');for(var s of Object.keys(this.attributes)){if(plt.test(s))throw new Ke("Invalid attribute name '"+s+"'");t+=" "+s+'="'+Ss(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class Td{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,oA.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return lA.call(this,"span")}toMarkup(){return cA.call(this,"span")}}class mm{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,oA.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return lA.call(this,"a")}toMarkup(){return cA.call(this,"a")}}class mlt{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+Ss(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=Ze(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Rl(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+Ze(this.italic)+";"),r+=Iy(this.style),r&&(n=!0,t+=' style="'+Ss(r)+'"');var s=Ss(this.text);return n?(t+=">",t+=s,t+="",t):s}}class Ao{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class j2{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var xlt=e=>e instanceof Td||e instanceof mm||e instanceof Ad,La={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},N0={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Zk={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function ylt(e,n){La[e]=n}function By(e,n,t){if(!La[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=La[n][r];if(!s&&e[0]in Zk&&(r=Zk[e[0]].charCodeAt(0),s=La[n][r]),!s&&t==="text"&&iA(r)&&(s=La[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var $b={};function wlt(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!$b[n]){var t=$b[n]={cssEmPerMu:N0.quad[n]/18};for(var r in N0)N0.hasOwnProperty(r)&&(t[r]=N0[r][n])}return $b[n]}var sr={math:{},text:{}};function O(e,n,t,r,s,i){sr[e][s]={font:n,group:t,replace:r},i&&r&&(sr[e][r]=sr[e][s])}var q="math",Pe="text",Q="main",de="ams",ar="accent-token",at="bin",Ls="close",Md="inner",Et="mathord",Fr="op-token",Si="open",Kh="punct",fe="rel",Lo="spacing",ge="textord";O(q,Q,fe,"≡","\\equiv",!0);O(q,Q,fe,"≺","\\prec",!0);O(q,Q,fe,"≻","\\succ",!0);O(q,Q,fe,"∼","\\sim",!0);O(q,Q,fe,"⊥","\\perp");O(q,Q,fe,"⪯","\\preceq",!0);O(q,Q,fe,"⪰","\\succeq",!0);O(q,Q,fe,"≃","\\simeq",!0);O(q,Q,fe,"∣","\\mid",!0);O(q,Q,fe,"≪","\\ll",!0);O(q,Q,fe,"≫","\\gg",!0);O(q,Q,fe,"≍","\\asymp",!0);O(q,Q,fe,"∥","\\parallel");O(q,Q,fe,"⋈","\\bowtie",!0);O(q,Q,fe,"⌣","\\smile",!0);O(q,Q,fe,"⊑","\\sqsubseteq",!0);O(q,Q,fe,"⊒","\\sqsupseteq",!0);O(q,Q,fe,"≐","\\doteq",!0);O(q,Q,fe,"⌢","\\frown",!0);O(q,Q,fe,"∋","\\ni",!0);O(q,Q,fe,"∝","\\propto",!0);O(q,Q,fe,"⊢","\\vdash",!0);O(q,Q,fe,"⊣","\\dashv",!0);O(q,Q,fe,"∋","\\owns");O(q,Q,Kh,".","\\ldotp");O(q,Q,Kh,"⋅","\\cdotp");O(q,Q,Kh,"⋅","·");O(Pe,Q,ge,"⋅","·");O(q,Q,ge,"#","\\#");O(Pe,Q,ge,"#","\\#");O(q,Q,ge,"&","\\&");O(Pe,Q,ge,"&","\\&");O(q,Q,ge,"ℵ","\\aleph",!0);O(q,Q,ge,"∀","\\forall",!0);O(q,Q,ge,"ℏ","\\hbar",!0);O(q,Q,ge,"∃","\\exists",!0);O(q,Q,ge,"∇","\\nabla",!0);O(q,Q,ge,"♭","\\flat",!0);O(q,Q,ge,"ℓ","\\ell",!0);O(q,Q,ge,"♮","\\natural",!0);O(q,Q,ge,"♣","\\clubsuit",!0);O(q,Q,ge,"℘","\\wp",!0);O(q,Q,ge,"♯","\\sharp",!0);O(q,Q,ge,"♢","\\diamondsuit",!0);O(q,Q,ge,"ℜ","\\Re",!0);O(q,Q,ge,"♡","\\heartsuit",!0);O(q,Q,ge,"ℑ","\\Im",!0);O(q,Q,ge,"♠","\\spadesuit",!0);O(q,Q,ge,"§","\\S",!0);O(Pe,Q,ge,"§","\\S");O(q,Q,ge,"¶","\\P",!0);O(Pe,Q,ge,"¶","\\P");O(q,Q,ge,"†","\\dag");O(Pe,Q,ge,"†","\\dag");O(Pe,Q,ge,"†","\\textdagger");O(q,Q,ge,"‡","\\ddag");O(Pe,Q,ge,"‡","\\ddag");O(Pe,Q,ge,"‡","\\textdaggerdbl");O(q,Q,Ls,"⎱","\\rmoustache",!0);O(q,Q,Si,"⎰","\\lmoustache",!0);O(q,Q,Ls,"⟯","\\rgroup",!0);O(q,Q,Si,"⟮","\\lgroup",!0);O(q,Q,at,"∓","\\mp",!0);O(q,Q,at,"⊖","\\ominus",!0);O(q,Q,at,"⊎","\\uplus",!0);O(q,Q,at,"⊓","\\sqcap",!0);O(q,Q,at,"∗","\\ast");O(q,Q,at,"⊔","\\sqcup",!0);O(q,Q,at,"◯","\\bigcirc",!0);O(q,Q,at,"∙","\\bullet",!0);O(q,Q,at,"‡","\\ddagger");O(q,Q,at,"≀","\\wr",!0);O(q,Q,at,"⨿","\\amalg");O(q,Q,at,"&","\\And");O(q,Q,fe,"⟵","\\longleftarrow",!0);O(q,Q,fe,"⇐","\\Leftarrow",!0);O(q,Q,fe,"⟸","\\Longleftarrow",!0);O(q,Q,fe,"⟶","\\longrightarrow",!0);O(q,Q,fe,"⇒","\\Rightarrow",!0);O(q,Q,fe,"⟹","\\Longrightarrow",!0);O(q,Q,fe,"↔","\\leftrightarrow",!0);O(q,Q,fe,"⟷","\\longleftrightarrow",!0);O(q,Q,fe,"⇔","\\Leftrightarrow",!0);O(q,Q,fe,"⟺","\\Longleftrightarrow",!0);O(q,Q,fe,"↦","\\mapsto",!0);O(q,Q,fe,"⟼","\\longmapsto",!0);O(q,Q,fe,"↗","\\nearrow",!0);O(q,Q,fe,"↩","\\hookleftarrow",!0);O(q,Q,fe,"↪","\\hookrightarrow",!0);O(q,Q,fe,"↘","\\searrow",!0);O(q,Q,fe,"↼","\\leftharpoonup",!0);O(q,Q,fe,"⇀","\\rightharpoonup",!0);O(q,Q,fe,"↙","\\swarrow",!0);O(q,Q,fe,"↽","\\leftharpoondown",!0);O(q,Q,fe,"⇁","\\rightharpoondown",!0);O(q,Q,fe,"↖","\\nwarrow",!0);O(q,Q,fe,"⇌","\\rightleftharpoons",!0);O(q,de,fe,"≮","\\nless",!0);O(q,de,fe,"","\\@nleqslant");O(q,de,fe,"","\\@nleqq");O(q,de,fe,"⪇","\\lneq",!0);O(q,de,fe,"≨","\\lneqq",!0);O(q,de,fe,"","\\@lvertneqq");O(q,de,fe,"⋦","\\lnsim",!0);O(q,de,fe,"⪉","\\lnapprox",!0);O(q,de,fe,"⊀","\\nprec",!0);O(q,de,fe,"⋠","\\npreceq",!0);O(q,de,fe,"⋨","\\precnsim",!0);O(q,de,fe,"⪹","\\precnapprox",!0);O(q,de,fe,"≁","\\nsim",!0);O(q,de,fe,"","\\@nshortmid");O(q,de,fe,"∤","\\nmid",!0);O(q,de,fe,"⊬","\\nvdash",!0);O(q,de,fe,"⊭","\\nvDash",!0);O(q,de,fe,"⋪","\\ntriangleleft");O(q,de,fe,"⋬","\\ntrianglelefteq",!0);O(q,de,fe,"⊊","\\subsetneq",!0);O(q,de,fe,"","\\@varsubsetneq");O(q,de,fe,"⫋","\\subsetneqq",!0);O(q,de,fe,"","\\@varsubsetneqq");O(q,de,fe,"≯","\\ngtr",!0);O(q,de,fe,"","\\@ngeqslant");O(q,de,fe,"","\\@ngeqq");O(q,de,fe,"⪈","\\gneq",!0);O(q,de,fe,"≩","\\gneqq",!0);O(q,de,fe,"","\\@gvertneqq");O(q,de,fe,"⋧","\\gnsim",!0);O(q,de,fe,"⪊","\\gnapprox",!0);O(q,de,fe,"⊁","\\nsucc",!0);O(q,de,fe,"⋡","\\nsucceq",!0);O(q,de,fe,"⋩","\\succnsim",!0);O(q,de,fe,"⪺","\\succnapprox",!0);O(q,de,fe,"≆","\\ncong",!0);O(q,de,fe,"","\\@nshortparallel");O(q,de,fe,"∦","\\nparallel",!0);O(q,de,fe,"⊯","\\nVDash",!0);O(q,de,fe,"⋫","\\ntriangleright");O(q,de,fe,"⋭","\\ntrianglerighteq",!0);O(q,de,fe,"","\\@nsupseteqq");O(q,de,fe,"⊋","\\supsetneq",!0);O(q,de,fe,"","\\@varsupsetneq");O(q,de,fe,"⫌","\\supsetneqq",!0);O(q,de,fe,"","\\@varsupsetneqq");O(q,de,fe,"⊮","\\nVdash",!0);O(q,de,fe,"⪵","\\precneqq",!0);O(q,de,fe,"⪶","\\succneqq",!0);O(q,de,fe,"","\\@nsubseteqq");O(q,de,at,"⊴","\\unlhd");O(q,de,at,"⊵","\\unrhd");O(q,de,fe,"↚","\\nleftarrow",!0);O(q,de,fe,"↛","\\nrightarrow",!0);O(q,de,fe,"⇍","\\nLeftarrow",!0);O(q,de,fe,"⇏","\\nRightarrow",!0);O(q,de,fe,"↮","\\nleftrightarrow",!0);O(q,de,fe,"⇎","\\nLeftrightarrow",!0);O(q,de,fe,"△","\\vartriangle");O(q,de,ge,"ℏ","\\hslash");O(q,de,ge,"▽","\\triangledown");O(q,de,ge,"◊","\\lozenge");O(q,de,ge,"Ⓢ","\\circledS");O(q,de,ge,"®","\\circledR");O(Pe,de,ge,"®","\\circledR");O(q,de,ge,"∡","\\measuredangle",!0);O(q,de,ge,"∄","\\nexists");O(q,de,ge,"℧","\\mho");O(q,de,ge,"Ⅎ","\\Finv",!0);O(q,de,ge,"⅁","\\Game",!0);O(q,de,ge,"‵","\\backprime");O(q,de,ge,"▲","\\blacktriangle");O(q,de,ge,"▼","\\blacktriangledown");O(q,de,ge,"■","\\blacksquare");O(q,de,ge,"⧫","\\blacklozenge");O(q,de,ge,"★","\\bigstar");O(q,de,ge,"∢","\\sphericalangle",!0);O(q,de,ge,"∁","\\complement",!0);O(q,de,ge,"ð","\\eth",!0);O(Pe,Q,ge,"ð","ð");O(q,de,ge,"╱","\\diagup");O(q,de,ge,"╲","\\diagdown");O(q,de,ge,"□","\\square");O(q,de,ge,"□","\\Box");O(q,de,ge,"◊","\\Diamond");O(q,de,ge,"¥","\\yen",!0);O(Pe,de,ge,"¥","\\yen",!0);O(q,de,ge,"✓","\\checkmark",!0);O(Pe,de,ge,"✓","\\checkmark");O(q,de,ge,"ℶ","\\beth",!0);O(q,de,ge,"ℸ","\\daleth",!0);O(q,de,ge,"ℷ","\\gimel",!0);O(q,de,ge,"ϝ","\\digamma",!0);O(q,de,ge,"ϰ","\\varkappa");O(q,de,Si,"┌","\\@ulcorner",!0);O(q,de,Ls,"┐","\\@urcorner",!0);O(q,de,Si,"└","\\@llcorner",!0);O(q,de,Ls,"┘","\\@lrcorner",!0);O(q,de,fe,"≦","\\leqq",!0);O(q,de,fe,"⩽","\\leqslant",!0);O(q,de,fe,"⪕","\\eqslantless",!0);O(q,de,fe,"≲","\\lesssim",!0);O(q,de,fe,"⪅","\\lessapprox",!0);O(q,de,fe,"≊","\\approxeq",!0);O(q,de,at,"⋖","\\lessdot");O(q,de,fe,"⋘","\\lll",!0);O(q,de,fe,"≶","\\lessgtr",!0);O(q,de,fe,"⋚","\\lesseqgtr",!0);O(q,de,fe,"⪋","\\lesseqqgtr",!0);O(q,de,fe,"≑","\\doteqdot");O(q,de,fe,"≓","\\risingdotseq",!0);O(q,de,fe,"≒","\\fallingdotseq",!0);O(q,de,fe,"∽","\\backsim",!0);O(q,de,fe,"⋍","\\backsimeq",!0);O(q,de,fe,"⫅","\\subseteqq",!0);O(q,de,fe,"⋐","\\Subset",!0);O(q,de,fe,"⊏","\\sqsubset",!0);O(q,de,fe,"≼","\\preccurlyeq",!0);O(q,de,fe,"⋞","\\curlyeqprec",!0);O(q,de,fe,"≾","\\precsim",!0);O(q,de,fe,"⪷","\\precapprox",!0);O(q,de,fe,"⊲","\\vartriangleleft");O(q,de,fe,"⊴","\\trianglelefteq");O(q,de,fe,"⊨","\\vDash",!0);O(q,de,fe,"⊪","\\Vvdash",!0);O(q,de,fe,"⌣","\\smallsmile");O(q,de,fe,"⌢","\\smallfrown");O(q,de,fe,"≏","\\bumpeq",!0);O(q,de,fe,"≎","\\Bumpeq",!0);O(q,de,fe,"≧","\\geqq",!0);O(q,de,fe,"⩾","\\geqslant",!0);O(q,de,fe,"⪖","\\eqslantgtr",!0);O(q,de,fe,"≳","\\gtrsim",!0);O(q,de,fe,"⪆","\\gtrapprox",!0);O(q,de,at,"⋗","\\gtrdot");O(q,de,fe,"⋙","\\ggg",!0);O(q,de,fe,"≷","\\gtrless",!0);O(q,de,fe,"⋛","\\gtreqless",!0);O(q,de,fe,"⪌","\\gtreqqless",!0);O(q,de,fe,"≖","\\eqcirc",!0);O(q,de,fe,"≗","\\circeq",!0);O(q,de,fe,"≜","\\triangleq",!0);O(q,de,fe,"∼","\\thicksim");O(q,de,fe,"≈","\\thickapprox");O(q,de,fe,"⫆","\\supseteqq",!0);O(q,de,fe,"⋑","\\Supset",!0);O(q,de,fe,"⊐","\\sqsupset",!0);O(q,de,fe,"≽","\\succcurlyeq",!0);O(q,de,fe,"⋟","\\curlyeqsucc",!0);O(q,de,fe,"≿","\\succsim",!0);O(q,de,fe,"⪸","\\succapprox",!0);O(q,de,fe,"⊳","\\vartriangleright");O(q,de,fe,"⊵","\\trianglerighteq");O(q,de,fe,"⊩","\\Vdash",!0);O(q,de,fe,"∣","\\shortmid");O(q,de,fe,"∥","\\shortparallel");O(q,de,fe,"≬","\\between",!0);O(q,de,fe,"⋔","\\pitchfork",!0);O(q,de,fe,"∝","\\varpropto");O(q,de,fe,"◀","\\blacktriangleleft");O(q,de,fe,"∴","\\therefore",!0);O(q,de,fe,"∍","\\backepsilon");O(q,de,fe,"▶","\\blacktriangleright");O(q,de,fe,"∵","\\because",!0);O(q,de,fe,"⋘","\\llless");O(q,de,fe,"⋙","\\gggtr");O(q,de,at,"⊲","\\lhd");O(q,de,at,"⊳","\\rhd");O(q,de,fe,"≂","\\eqsim",!0);O(q,Q,fe,"⋈","\\Join");O(q,de,fe,"≑","\\Doteq",!0);O(q,de,at,"∔","\\dotplus",!0);O(q,de,at,"∖","\\smallsetminus");O(q,de,at,"⋒","\\Cap",!0);O(q,de,at,"⋓","\\Cup",!0);O(q,de,at,"⩞","\\doublebarwedge",!0);O(q,de,at,"⊟","\\boxminus",!0);O(q,de,at,"⊞","\\boxplus",!0);O(q,de,at,"⋇","\\divideontimes",!0);O(q,de,at,"⋉","\\ltimes",!0);O(q,de,at,"⋊","\\rtimes",!0);O(q,de,at,"⋋","\\leftthreetimes",!0);O(q,de,at,"⋌","\\rightthreetimes",!0);O(q,de,at,"⋏","\\curlywedge",!0);O(q,de,at,"⋎","\\curlyvee",!0);O(q,de,at,"⊝","\\circleddash",!0);O(q,de,at,"⊛","\\circledast",!0);O(q,de,at,"⋅","\\centerdot");O(q,de,at,"⊺","\\intercal",!0);O(q,de,at,"⋒","\\doublecap");O(q,de,at,"⋓","\\doublecup");O(q,de,at,"⊠","\\boxtimes",!0);O(q,de,fe,"⇢","\\dashrightarrow",!0);O(q,de,fe,"⇠","\\dashleftarrow",!0);O(q,de,fe,"⇇","\\leftleftarrows",!0);O(q,de,fe,"⇆","\\leftrightarrows",!0);O(q,de,fe,"⇚","\\Lleftarrow",!0);O(q,de,fe,"↞","\\twoheadleftarrow",!0);O(q,de,fe,"↢","\\leftarrowtail",!0);O(q,de,fe,"↫","\\looparrowleft",!0);O(q,de,fe,"⇋","\\leftrightharpoons",!0);O(q,de,fe,"↶","\\curvearrowleft",!0);O(q,de,fe,"↺","\\circlearrowleft",!0);O(q,de,fe,"↰","\\Lsh",!0);O(q,de,fe,"⇈","\\upuparrows",!0);O(q,de,fe,"↿","\\upharpoonleft",!0);O(q,de,fe,"⇃","\\downharpoonleft",!0);O(q,Q,fe,"⊶","\\origof",!0);O(q,Q,fe,"⊷","\\imageof",!0);O(q,de,fe,"⊸","\\multimap",!0);O(q,de,fe,"↭","\\leftrightsquigarrow",!0);O(q,de,fe,"⇉","\\rightrightarrows",!0);O(q,de,fe,"⇄","\\rightleftarrows",!0);O(q,de,fe,"↠","\\twoheadrightarrow",!0);O(q,de,fe,"↣","\\rightarrowtail",!0);O(q,de,fe,"↬","\\looparrowright",!0);O(q,de,fe,"↷","\\curvearrowright",!0);O(q,de,fe,"↻","\\circlearrowright",!0);O(q,de,fe,"↱","\\Rsh",!0);O(q,de,fe,"⇊","\\downdownarrows",!0);O(q,de,fe,"↾","\\upharpoonright",!0);O(q,de,fe,"⇂","\\downharpoonright",!0);O(q,de,fe,"⇝","\\rightsquigarrow",!0);O(q,de,fe,"⇝","\\leadsto");O(q,de,fe,"⇛","\\Rrightarrow",!0);O(q,de,fe,"↾","\\restriction");O(q,Q,ge,"‘","`");O(q,Q,ge,"$","\\$");O(Pe,Q,ge,"$","\\$");O(Pe,Q,ge,"$","\\textdollar");O(q,Q,ge,"%","\\%");O(Pe,Q,ge,"%","\\%");O(q,Q,ge,"_","\\_");O(Pe,Q,ge,"_","\\_");O(Pe,Q,ge,"_","\\textunderscore");O(q,Q,ge,"∠","\\angle",!0);O(q,Q,ge,"∞","\\infty",!0);O(q,Q,ge,"′","\\prime");O(q,Q,ge,"△","\\triangle");O(q,Q,ge,"Γ","\\Gamma",!0);O(q,Q,ge,"Δ","\\Delta",!0);O(q,Q,ge,"Θ","\\Theta",!0);O(q,Q,ge,"Λ","\\Lambda",!0);O(q,Q,ge,"Ξ","\\Xi",!0);O(q,Q,ge,"Π","\\Pi",!0);O(q,Q,ge,"Σ","\\Sigma",!0);O(q,Q,ge,"Υ","\\Upsilon",!0);O(q,Q,ge,"Φ","\\Phi",!0);O(q,Q,ge,"Ψ","\\Psi",!0);O(q,Q,ge,"Ω","\\Omega",!0);O(q,Q,ge,"A","Α");O(q,Q,ge,"B","Β");O(q,Q,ge,"E","Ε");O(q,Q,ge,"Z","Ζ");O(q,Q,ge,"H","Η");O(q,Q,ge,"I","Ι");O(q,Q,ge,"K","Κ");O(q,Q,ge,"M","Μ");O(q,Q,ge,"N","Ν");O(q,Q,ge,"O","Ο");O(q,Q,ge,"P","Ρ");O(q,Q,ge,"T","Τ");O(q,Q,ge,"X","Χ");O(q,Q,ge,"¬","\\neg",!0);O(q,Q,ge,"¬","\\lnot");O(q,Q,ge,"⊤","\\top");O(q,Q,ge,"⊥","\\bot");O(q,Q,ge,"∅","\\emptyset");O(q,de,ge,"∅","\\varnothing");O(q,Q,Et,"α","\\alpha",!0);O(q,Q,Et,"β","\\beta",!0);O(q,Q,Et,"γ","\\gamma",!0);O(q,Q,Et,"δ","\\delta",!0);O(q,Q,Et,"ϵ","\\epsilon",!0);O(q,Q,Et,"ζ","\\zeta",!0);O(q,Q,Et,"η","\\eta",!0);O(q,Q,Et,"θ","\\theta",!0);O(q,Q,Et,"ι","\\iota",!0);O(q,Q,Et,"κ","\\kappa",!0);O(q,Q,Et,"λ","\\lambda",!0);O(q,Q,Et,"μ","\\mu",!0);O(q,Q,Et,"ν","\\nu",!0);O(q,Q,Et,"ξ","\\xi",!0);O(q,Q,Et,"ο","\\omicron",!0);O(q,Q,Et,"π","\\pi",!0);O(q,Q,Et,"ρ","\\rho",!0);O(q,Q,Et,"σ","\\sigma",!0);O(q,Q,Et,"τ","\\tau",!0);O(q,Q,Et,"υ","\\upsilon",!0);O(q,Q,Et,"ϕ","\\phi",!0);O(q,Q,Et,"χ","\\chi",!0);O(q,Q,Et,"ψ","\\psi",!0);O(q,Q,Et,"ω","\\omega",!0);O(q,Q,Et,"ε","\\varepsilon",!0);O(q,Q,Et,"ϑ","\\vartheta",!0);O(q,Q,Et,"ϖ","\\varpi",!0);O(q,Q,Et,"ϱ","\\varrho",!0);O(q,Q,Et,"ς","\\varsigma",!0);O(q,Q,Et,"φ","\\varphi",!0);O(q,Q,at,"∗","*",!0);O(q,Q,at,"+","+");O(q,Q,at,"−","-",!0);O(q,Q,at,"⋅","\\cdot",!0);O(q,Q,at,"∘","\\circ",!0);O(q,Q,at,"÷","\\div",!0);O(q,Q,at,"±","\\pm",!0);O(q,Q,at,"×","\\times",!0);O(q,Q,at,"∩","\\cap",!0);O(q,Q,at,"∪","\\cup",!0);O(q,Q,at,"∖","\\setminus",!0);O(q,Q,at,"∧","\\land");O(q,Q,at,"∨","\\lor");O(q,Q,at,"∧","\\wedge",!0);O(q,Q,at,"∨","\\vee",!0);O(q,Q,ge,"√","\\surd");O(q,Q,Si,"⟨","\\langle",!0);O(q,Q,Si,"∣","\\lvert");O(q,Q,Si,"∥","\\lVert");O(q,Q,Ls,"?","?");O(q,Q,Ls,"!","!");O(q,Q,Ls,"⟩","\\rangle",!0);O(q,Q,Ls,"∣","\\rvert");O(q,Q,Ls,"∥","\\rVert");O(q,Q,fe,"=","=");O(q,Q,fe,":",":");O(q,Q,fe,"≈","\\approx",!0);O(q,Q,fe,"≅","\\cong",!0);O(q,Q,fe,"≥","\\ge");O(q,Q,fe,"≥","\\geq",!0);O(q,Q,fe,"←","\\gets");O(q,Q,fe,">","\\gt",!0);O(q,Q,fe,"∈","\\in",!0);O(q,Q,fe,"","\\@not");O(q,Q,fe,"⊂","\\subset",!0);O(q,Q,fe,"⊃","\\supset",!0);O(q,Q,fe,"⊆","\\subseteq",!0);O(q,Q,fe,"⊇","\\supseteq",!0);O(q,de,fe,"⊈","\\nsubseteq",!0);O(q,de,fe,"⊉","\\nsupseteq",!0);O(q,Q,fe,"⊨","\\models");O(q,Q,fe,"←","\\leftarrow",!0);O(q,Q,fe,"≤","\\le");O(q,Q,fe,"≤","\\leq",!0);O(q,Q,fe,"<","\\lt",!0);O(q,Q,fe,"→","\\rightarrow",!0);O(q,Q,fe,"→","\\to");O(q,de,fe,"≱","\\ngeq",!0);O(q,de,fe,"≰","\\nleq",!0);O(q,Q,Lo," ","\\ ");O(q,Q,Lo," ","\\space");O(q,Q,Lo," ","\\nobreakspace");O(Pe,Q,Lo," ","\\ ");O(Pe,Q,Lo," "," ");O(Pe,Q,Lo," ","\\space");O(Pe,Q,Lo," ","\\nobreakspace");O(q,Q,Lo,"","\\nobreak");O(q,Q,Lo,"","\\allowbreak");O(q,Q,Kh,",",",");O(q,Q,Kh,";",";");O(q,de,at,"⊼","\\barwedge",!0);O(q,de,at,"⊻","\\veebar",!0);O(q,Q,at,"⊙","\\odot",!0);O(q,Q,at,"⊕","\\oplus",!0);O(q,Q,at,"⊗","\\otimes",!0);O(q,Q,ge,"∂","\\partial",!0);O(q,Q,at,"⊘","\\oslash",!0);O(q,de,at,"⊚","\\circledcirc",!0);O(q,de,at,"⊡","\\boxdot",!0);O(q,Q,at,"△","\\bigtriangleup");O(q,Q,at,"▽","\\bigtriangledown");O(q,Q,at,"†","\\dagger");O(q,Q,at,"⋄","\\diamond");O(q,Q,at,"⋆","\\star");O(q,Q,at,"◃","\\triangleleft");O(q,Q,at,"▹","\\triangleright");O(q,Q,Si,"{","\\{");O(Pe,Q,ge,"{","\\{");O(Pe,Q,ge,"{","\\textbraceleft");O(q,Q,Ls,"}","\\}");O(Pe,Q,ge,"}","\\}");O(Pe,Q,ge,"}","\\textbraceright");O(q,Q,Si,"{","\\lbrace");O(q,Q,Ls,"}","\\rbrace");O(q,Q,Si,"[","\\lbrack",!0);O(Pe,Q,ge,"[","\\lbrack",!0);O(q,Q,Ls,"]","\\rbrack",!0);O(Pe,Q,ge,"]","\\rbrack",!0);O(q,Q,Si,"(","\\lparen",!0);O(q,Q,Ls,")","\\rparen",!0);O(Pe,Q,ge,"<","\\textless",!0);O(Pe,Q,ge,">","\\textgreater",!0);O(q,Q,Si,"⌊","\\lfloor",!0);O(q,Q,Ls,"⌋","\\rfloor",!0);O(q,Q,Si,"⌈","\\lceil",!0);O(q,Q,Ls,"⌉","\\rceil",!0);O(q,Q,ge,"\\","\\backslash");O(q,Q,ge,"∣","|");O(q,Q,ge,"∣","\\vert");O(Pe,Q,ge,"|","\\textbar",!0);O(q,Q,ge,"∥","\\|");O(q,Q,ge,"∥","\\Vert");O(Pe,Q,ge,"∥","\\textbardbl");O(Pe,Q,ge,"~","\\textasciitilde");O(Pe,Q,ge,"\\","\\textbackslash");O(Pe,Q,ge,"^","\\textasciicircum");O(q,Q,fe,"↑","\\uparrow",!0);O(q,Q,fe,"⇑","\\Uparrow",!0);O(q,Q,fe,"↓","\\downarrow",!0);O(q,Q,fe,"⇓","\\Downarrow",!0);O(q,Q,fe,"↕","\\updownarrow",!0);O(q,Q,fe,"⇕","\\Updownarrow",!0);O(q,Q,Fr,"∐","\\coprod");O(q,Q,Fr,"⋁","\\bigvee");O(q,Q,Fr,"⋀","\\bigwedge");O(q,Q,Fr,"⨄","\\biguplus");O(q,Q,Fr,"⋂","\\bigcap");O(q,Q,Fr,"⋃","\\bigcup");O(q,Q,Fr,"∫","\\int");O(q,Q,Fr,"∫","\\intop");O(q,Q,Fr,"∬","\\iint");O(q,Q,Fr,"∭","\\iiint");O(q,Q,Fr,"∏","\\prod");O(q,Q,Fr,"∑","\\sum");O(q,Q,Fr,"⨂","\\bigotimes");O(q,Q,Fr,"⨁","\\bigoplus");O(q,Q,Fr,"⨀","\\bigodot");O(q,Q,Fr,"∮","\\oint");O(q,Q,Fr,"∯","\\oiint");O(q,Q,Fr,"∰","\\oiiint");O(q,Q,Fr,"⨆","\\bigsqcup");O(q,Q,Fr,"∫","\\smallint");O(Pe,Q,Md,"…","\\textellipsis");O(q,Q,Md,"…","\\mathellipsis");O(Pe,Q,Md,"…","\\ldots",!0);O(q,Q,Md,"…","\\ldots",!0);O(q,Q,Md,"⋯","\\@cdots",!0);O(q,Q,Md,"⋱","\\ddots",!0);O(q,Q,ge,"⋮","\\varvdots");O(Pe,Q,ge,"⋮","\\varvdots");O(q,Q,ar,"ˊ","\\acute");O(q,Q,ar,"ˋ","\\grave");O(q,Q,ar,"¨","\\ddot");O(q,Q,ar,"~","\\tilde");O(q,Q,ar,"ˉ","\\bar");O(q,Q,ar,"˘","\\breve");O(q,Q,ar,"ˇ","\\check");O(q,Q,ar,"^","\\hat");O(q,Q,ar,"⃗","\\vec");O(q,Q,ar,"˙","\\dot");O(q,Q,ar,"˚","\\mathring");O(q,Q,Et,"","\\@imath");O(q,Q,Et,"","\\@jmath");O(q,Q,ge,"ı","ı");O(q,Q,ge,"ȷ","ȷ");O(Pe,Q,ge,"ı","\\i",!0);O(Pe,Q,ge,"ȷ","\\j",!0);O(Pe,Q,ge,"ß","\\ss",!0);O(Pe,Q,ge,"æ","\\ae",!0);O(Pe,Q,ge,"œ","\\oe",!0);O(Pe,Q,ge,"ø","\\o",!0);O(Pe,Q,ge,"Æ","\\AE",!0);O(Pe,Q,ge,"Œ","\\OE",!0);O(Pe,Q,ge,"Ø","\\O",!0);O(Pe,Q,ar,"ˊ","\\'");O(Pe,Q,ar,"ˋ","\\`");O(Pe,Q,ar,"ˆ","\\^");O(Pe,Q,ar,"˜","\\~");O(Pe,Q,ar,"ˉ","\\=");O(Pe,Q,ar,"˘","\\u");O(Pe,Q,ar,"˙","\\.");O(Pe,Q,ar,"¸","\\c");O(Pe,Q,ar,"˚","\\r");O(Pe,Q,ar,"ˇ","\\v");O(Pe,Q,ar,"¨",'\\"');O(Pe,Q,ar,"˝","\\H");O(Pe,Q,ar,"◯","\\textcircled");var uA={"--":!0,"---":!0,"``":!0,"''":!0};O(Pe,Q,ge,"–","--",!0);O(Pe,Q,ge,"–","\\textendash");O(Pe,Q,ge,"—","---",!0);O(Pe,Q,ge,"—","\\textemdash");O(Pe,Q,ge,"‘","`",!0);O(Pe,Q,ge,"‘","\\textquoteleft");O(Pe,Q,ge,"’","'",!0);O(Pe,Q,ge,"’","\\textquoteright");O(Pe,Q,ge,"“","``",!0);O(Pe,Q,ge,"“","\\textquotedblleft");O(Pe,Q,ge,"”","''",!0);O(Pe,Q,ge,"”","\\textquotedblright");O(q,Q,ge,"°","\\degree",!0);O(Pe,Q,ge,"°","\\degree");O(Pe,Q,ge,"°","\\textdegree",!0);O(q,Q,ge,"£","\\pounds");O(q,Q,ge,"£","\\mathsterling",!0);O(Pe,Q,ge,"£","\\pounds");O(Pe,Q,ge,"£","\\textsterling",!0);O(q,de,ge,"✠","\\maltese");O(Pe,de,ge,"✠","\\maltese");var Qk='0123456789/@."';for(var Hb=0;Hb{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return l8[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return klt[i]}else{if(r===120485||r===120486)return l8[0];if(120486{if(Rl(e.classes)!==Rl(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},dA=e=>{for(var n=0;nt&&(t=l.height),l.depth>r&&(r=l.depth),l.maxFontSize>s&&(s=l.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},Ue=function(n,t,r,s){var i=new Td(n,t,r,s);return Hy(i),i},Ll=(e,n,t,r)=>new Td(e,n,t,r),dd=function(n,t,r){var s=Ue([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=Ze(s.height),s.maxFontSize=1,s},zlt=function(n,t,r,s){var i=new mm(n,t,r,s);return Hy(i),i},Oo=function(n){var t=new Ad(n);return Hy(t),t},fd=function(n,t){return n instanceof Ad?Ue([],[n],t):n},jlt=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,l=1;l{var t=Ue(["mspace"],[],n),r=hr(e,n);return t.style.marginRight=Ze(r),t},A0=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},L2={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},hA={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},_A=function(n,t){var[r,s,i]=hA[n],l=new Dl(r),o=new Ao([l],{width:Ze(s),height:Ze(i),style:"width:"+Ze(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=Ll(["overlay"],[o],t);return c.height=i,c.style.height=Ze(i),c.style.width=Ze(s),c},dr={number:3,unit:"mu"},xc={number:4,unit:"mu"},go={number:5,unit:"mu"},Alt={mord:{mop:dr,mbin:xc,mrel:go,minner:dr},mop:{mord:dr,mop:dr,mrel:go,minner:dr},mbin:{mord:xc,mop:xc,mopen:xc,minner:xc},mrel:{mord:go,mop:go,mopen:go,minner:go},mopen:{},mclose:{mop:dr,mbin:xc,mrel:go,minner:dr},mpunct:{mord:dr,mop:dr,mrel:go,mopen:dr,mclose:dr,mpunct:dr,minner:dr},minner:{mord:dr,mop:dr,mbin:xc,mrel:go,mopen:dr,mpunct:dr,minner:dr}},Tlt={mord:{mop:dr},mop:{mord:dr,mop:dr},mbin:{},mrel:{},mopen:{},mclose:{mop:dr},mpunct:{},minner:{mop:dr}},pA={},Ip={},Bp={};function st(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:l}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},c=0;c{var v=k.classes[0],b=S.classes[0];v==="mbin"&&Rlt.has(b)?k.classes[0]="mord":b==="mbin"&&Mlt.has(v)&&(S.classes[0]="mord")},{node:h},m,g),O2(i,(S,k)=>{var v,b,x=B2(k),y=B2(S),C=x&&y?S.hasClass("mtight")?(v=Tlt[x])==null?void 0:v[y]:(b=Alt[x])==null?void 0:b[y]:null;if(C)return fA(C,d)},{node:h},m,g),i},O2=function(n,t,r,s,i){s&&n.push(s);for(var l=0;lm=>{n.splice(h+1,0,m),l++})(l)}s&&n.pop()},mA=function(n){return n instanceof Ad||n instanceof mm||n instanceof Td&&n.hasClass("enclosing")?n:null},I2=function(n,t){var r=mA(n);if(r){var s=r.children;if(s.length){if(t==="right")return I2(s[s.length-1],"right");if(t==="left")return I2(s[0],"left")}}return n},B2=function(n,t){if(!n)return null;t&&(n=I2(n,t));var r=n.classes[0];return Llt[r]||null},uh=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return Ue(t.concat(r))},jn=function(n,t,r){if(!n)return Ue();if(Ip[n.type]){var s=Ip[n.type](n,t);if(r&&t.size!==r.size){s=Ue(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new Ke("Got group of unknown type: '"+n.type+"'")};function T0(e,n){var t=Ue(["base"],e,n),r=Ue(["strut"]);return r.style.height=Ze(t.height+t.depth),t.depth&&(r.style.verticalAlign=Ze(-t.depth)),t.children.unshift(r),t}function $2(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=Xr(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],l=[],o=0;o0&&(i.push(T0(l,n)),l=[]),i.push(r[o]));l.length>0&&i.push(T0(l,n));var d;t?(d=T0(Xr(t,n,!0),n),d.classes=["tag"],i.push(d)):s&&i.push(s);var _=Ue(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),d){var h=d.children[0];h.style.height=Ze(_.height+_.depth),_.depth&&(h.style.verticalAlign=Ze(-_.depth))}return _}function gA(e){return new Ad(e)}class Ye{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=Rl(this.classes));for(var r=0;r0&&(n+=' class ="'+Ss(Rl(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class Hr{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return Ss(this.toText())}toText(){return this.text}}class bA{constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",Ze(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var Olt=new Set(["\\imath","\\jmath"]),Ilt=new Set(["mrow","mtable"]),Ui=function(n,t,r){return sr[t][n]&&sr[t][n].replace&&n.charCodeAt(0)!==55349&&!(uA.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=sr[t][n].replace),new Hr(n)},Py=function(n){return n.length===1?n[0]:new Ye("mrow",n)},Blt={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},Fy=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=Blt[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(Olt.has(i))return null;if(sr[r][i]){var l=sr[r][i].replace;l&&(i=l)}var o=L2[t].fontName;return By(i,o,r)?L2[t].variant:null};function qb(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof Hr&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof Hr&&t.text===","}else return!1}var ki=function(n,t,r){if(n.length===1){var s=Kn(n[0],t);return r&&s instanceof Ye&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],l,o=0;o=1&&(l.type==="mn"||qb(l))){var d=c.children[0];d instanceof Ye&&d.type==="mn"&&(d.children=[...l.children,...d.children],i.pop())}else if(l.type==="mi"&&l.children.length===1){var _=l.children[0];if(_ instanceof Hr&&_.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var h=c.children[0];h instanceof Hr&&h.text.length>0&&(h.text=h.text.slice(0,1)+"̸"+h.text.slice(1),i.pop())}}}i.push(c),l=c}return i},Ol=function(n,t,r){return Py(ki(n,t,r))},Kn=function(n,t){if(!n)return new Ye("mrow");if(Bp[n.type])return Bp[n.type](n,t);throw new Ke("Got group of unknown type: '"+n.type+"'")};function c8(e,n,t,r,s){var i=ki(e,t),l;i.length===1&&i[0]instanceof Ye&&Ilt.has(i[0].type)?l=i[0]:l=new Ye("mrow",i);var o=new Ye("annotation",[new Hr(n)]);o.setAttribute("encoding","application/x-tex");var c=new Ye("semantics",[l,o]),d=new Ye("math",[c]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&d.setAttribute("display","block");var _=s?"katex":"katex-mathml";return Ue([_],[d])}var $lt=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],u8=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],d8=function(n,t){return t.size<2?n:$lt[n-1][t.size-1]};class So{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||So.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=u8[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new So(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:d8(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:u8[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=d8(So.BASESIZE,n);return this.size===t&&this.textSize===So.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==So.BASESIZE?["sizing","reset-size"+this.size,"size"+So.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=wlt(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}So.BASESIZE=6;var vA=function(n){return new So({style:n.displayMode?Ht.DISPLAY:Ht.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},xA=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=Ue(r,[n])}return n},Hlt=function(n,t,r){var s=vA(r),i;if(r.output==="mathml")return c8(n,t,s,r.displayMode,!0);if(r.output==="html"){var l=$2(n,s);i=Ue(["katex"],[l])}else{var o=c8(n,t,s,r.displayMode,!1),c=$2(n,s);i=Ue(["katex"],[o,c])}return xA(i,r)},Plt=function(n,t,r){var s=vA(r),i=$2(n,s),l=Ue(["katex"],[i]);return xA(l,r)},Flt={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},vm=function(n){var t=new Ye("mo",[new Hr(Flt[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Ult={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},qlt=new Set(["widehat","widecheck","widetilde","utilde"]),xm=function(n,t){function r(){var o=4e5,c=n.label.slice(1);if(qlt.has(c)&&"base"in n){var d=n.base.type==="ordgroup"?n.base.body.length:1,_,h,m;if(d>5)c==="widehat"||c==="widecheck"?(_=420,o=2364,m=.42,h=c+"4"):(_=312,o=2340,m=.34,h="tilde4");else{var g=[1,1,2,2,3,3][d];c==="widehat"||c==="widecheck"?(o=[0,1062,2364,2364,2364][g],_=[0,239,300,360,420][g],m=[0,.24,.3,.3,.36,.42][g],h=c+g):(o=[0,600,1033,2339,2340][g],_=[0,260,286,306,312][g],m=[0,.26,.286,.3,.306,.34][g],h="tilde"+g)}var S=new Dl(h),k=new Ao([S],{width:"100%",height:Ze(m),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:Ll([],[k],t),minWidth:0,height:m}}else{var v=[],b=Ult[c];if(!b)throw new Error('No SVG data for "'+c+'".');var[x,y,C]=b,j=C/1e3,N=x.length,M,z;if(N===1){if(b.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');M=["hide-tail"],z=[b[3]]}else if(N===2)M=["halfarrow-left","halfarrow-right"],z=["xMinYMin","xMaxYMin"];else if(N===3)M=["brace-left","brace-center","brace-right"],z=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+N+" children.");for(var D=0;D0&&(s.style.minWidth=Ze(i)),s},Glt=function(n,t,r,s,i){var l,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(l=Ue(["stretchy",t],[],i),t==="fbox"){var c=i.color&&i.getColor();c&&(l.style.borderColor=c)}}else{var d=[];/^[bx]cancel$/.test(t)&&d.push(new j2({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&d.push(new j2({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new Ao(d,{width:"100%",height:Ze(o)});l=Ll([],[_],i)}return l.height=o,l.style.height=Ze(o),l},Vlt={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Wlt={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Klt(e){return e in Vlt}function Xt(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function ym(e){var n=wm(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function wm(e){return e&&(e.type==="atom"||Wlt.hasOwnProperty(e.type))?e:null}var yA=e=>{if(e instanceof xi)return e;if(xlt(e)&&e.children.length===1)return yA(e.children[0])},Uy=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=Xt(e.base,"accent"),t=r.base,e.base=t,s=vlt(jn(e,n)),e.base=r):(r=Xt(e,"accent"),t=r.base);var i=jn(t,n.havingCrampedStyle()),l=r.isShifty&&Do(t),o=0;if(l){var c,d;o=(c=(d=yA(i))==null?void 0:d.skew)!=null?c:0}var _=r.label==="\\c",h=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),m;if(r.isStretchy)m=xm(r,n),m=Nn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:m,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Ze(2*o)+")",marginLeft:Ze(2*o)}:void 0}]});else{var g,S;r.label==="\\vec"?(g=_A("vec",n),S=hA.vec[1]):(g=bm({mode:r.mode,text:r.label},n,"textord"),g=blt(g),g.italic=0,S=g.width,_&&(h+=g.depth)),m=Ue(["accent-body"],[g]);var k=r.label==="\\textcircled";k&&(m.classes.push("accent-full"),h=i.height);var v=o;k||(v-=S/2),m.style.left=Ze(v),r.label==="\\textcircled"&&(m.style.top=".2em"),m=Nn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-h},{type:"elem",elem:m}]})}var b=Ue(["mord","accent"],[m],n);return s?(s.children[0]=b,s.height=Math.max(b.height,s.height),s.classes[0]="mord",s):b},wA=(e,n)=>{var t=e.isStretchy?vm(e.label):new Ye("mo",[Ui(e.label,e.mode)]),r=new Ye("mover",[Kn(e.base,n),t]);return r.setAttribute("accent","true"),r},Ylt=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));st({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=$p(n[0]),r=!Ylt.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:Uy,mathmlBuilder:wA});st({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:Uy,mathmlBuilder:wA});st({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=jn(e.base,n),r=xm(e,n),s=e.label==="\\utilde"?.12:0,i=Nn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return Ue(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=vm(e.label),r=new Ye("munder",[Kn(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var M0=e=>{var n=new Ye("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};st({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=fd(jn(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var l;e.below&&(r=n.havingStyle(t.sub()),l=fd(jn(e.below,r,n),n),l.classes.push(i+"-arrow-pad"));var o=xm(e,n),c=-n.fontMetrics().axisHeight+.5*o.height,d=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(d-=s.depth);var _;if(l){var h=-n.fontMetrics().axisHeight+l.height+.5*o.height+.111;_=Nn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:l,shift:h}]})}else _=Nn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]}]});return Ue(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=vm(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=M0(Kn(e.body,n));if(e.below){var i=M0(Kn(e.below,n));r=new Ye("munderover",[t,i,s])}else r=new Ye("mover",[t,s])}else if(e.below){var l=M0(Kn(e.below,n));r=new Ye("munder",[t,l])}else r=M0(),r=new Ye("mover",[t,r]);return r}});function SA(e,n){var t=Xr(e.body,n,!0);return Ue([e.mclass],t,n)}function kA(e,n){var t,r=ki(e.body,n);return e.mclass==="minner"?t=new Ye("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Ye("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Ye("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}st({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:$r(s),isCharacterBox:Do(s)}},htmlBuilder:SA,mathmlBuilder:kA});var Sm=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};st({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:Sm(n[0]),body:$r(n[1]),isCharacterBox:Do(n[1])}}});st({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],l;r!=="\\stackrel"?l=Sm(s):l="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:$r(s)},c={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:l,body:[c],isCharacterBox:Do(c)}},htmlBuilder:SA,mathmlBuilder:kA});st({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:Sm(n[0]),body:$r(n[0])}},htmlBuilder(e,n){var t=Xr(e.body,n,!0),r=Ue([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=ki(e.body,n),r=new Ye("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Xlt={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},f8=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),h8=e=>e.type==="textord"&&e.text==="@",Zlt=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function Qlt(e,n,t){var r=Xlt[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},l=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,l,o]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function Jlt(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new Ke("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(d))for(var h=0;h<2;h++){for(var m=!0,g=c+1;gAV=|." after @',l[c]);var S=Qlt(d,_,e),k={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};r.push(k),o=f8()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var v=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:v,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}st({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=fd(jn(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=Ze(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Ye("mrow",[Kn(e.label,n)]);return t=new Ye("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Ye("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});st({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=fd(jn(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Ye("mrow",[Kn(e.fragment,n)])}});st({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=Xt(n[0],"ordgroup"),s=r.body,i="",l=0;l=1114111)throw new Ke("\\@char with invalid code point "+i);return c<=65535?d=String.fromCharCode(c):(c-=65536,d=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:d}}});var CA=(e,n)=>{var t=Xr(e.body,n.withColor(e.color),!1);return Oo(t)},EA=(e,n)=>{var t=ki(e.body,n.withColor(e.color)),r=new Ye("mstyle",t);return r.setAttribute("mathcolor",e.color),r};st({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=Xt(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:$r(s)}},htmlBuilder:CA,mathmlBuilder:EA});st({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=Xt(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:CA,mathmlBuilder:EA});st({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&Xt(s,"size").value}},htmlBuilder(e,n){var t=Ue(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=Ze(hr(e.size,n)))),t},mathmlBuilder(e,n){var t=new Ye("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",Ze(hr(e.size,n)))),t}});var H2={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},NA=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new Ke("Expected a control sequence",e);return n},ect=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},zA=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};st({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(H2[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=H2[r.text]),Xt(n.parseFunction(),"internal");throw new Ke("Invalid token after macro prefix",r)}});st({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Ke("Expected a control sequence",r);for(var i=0,l,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){l=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ke('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new Ke('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new Ke("Expected a macro definition");o[i].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return l&&c.unshift(l),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:o},t===H2[t]),{type:"internal",mode:n.mode}}});st({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=NA(n.gullet.popToken());n.gullet.consumeSpaces();var s=ect(n);return zA(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});st({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=NA(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return zA(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var Hf=function(n,t,r){var s=sr.math[n]&&sr.math[n].replace,i=By(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},qy=function(n,t,r,s){var i=r.havingBaseStyle(t),l=Ue(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return l.height*=o,l.depth*=o,l.maxFontSize=i.sizeMultiplier,l},jA=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=Ze(i),n.height-=i,n.depth+=i},tct=function(n,t,r,s,i,l){var o=Ms(n,"Main-Regular",i,s),c=qy(o,t,s,l);return jA(c,s,t),c},nct=function(n,t,r,s){return Ms(n,"Size"+t+"-Regular",r,s)},AA=function(n,t,r,s,i,l){var o=nct(n,t,i,s),c=qy(Ue(["delimsizing","size"+t],[o],s),Ht.TEXT,s,l);return r&&jA(c,s,Ht.TEXT),c},Gb=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=Ue(["delimsizinginner",s],[Ue([],[Ms(n,t,r)])]);return{type:"elem",elem:i}},Vb=function(n,t,r){var s=La["Size4-Regular"][n.charCodeAt(0)]?La["Size4-Regular"][n.charCodeAt(0)][4]:La["Size1-Regular"][n.charCodeAt(0)][4],i=new Dl("inner",dlt(n,Math.round(1e3*t))),l=new Ao([i],{width:Ze(s),height:Ze(t),style:"width:"+Ze(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Ll([],[l],r);return o.height=t,o.style.height=Ze(t),o.style.width=Ze(s),{type:"elem",elem:o}},P2=.008,R0={type:"kern",size:-1*P2},rct=new Set(["|","\\lvert","\\rvert","\\vert"]),sct=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),TA=function(n,t,r,s,i,l){var o,c,d,_,h="",m=0;o=d=_=n,c=null;var g="Size1-Regular";n==="\\uparrow"?d=_="⏐":n==="\\Uparrow"?d=_="‖":n==="\\downarrow"?o=d="⏐":n==="\\Downarrow"?o=d="‖":n==="\\updownarrow"?(o="\\uparrow",d="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",d="‖",_="\\Downarrow"):rct.has(n)?(d="∣",h="vert",m=333):sct.has(n)?(d="∥",h="doublevert",m=556):n==="["||n==="\\lbrack"?(o="⎡",d="⎢",_="⎣",g="Size4-Regular",h="lbrack",m=667):n==="]"||n==="\\rbrack"?(o="⎤",d="⎥",_="⎦",g="Size4-Regular",h="rbrack",m=667):n==="\\lfloor"||n==="⌊"?(d=o="⎢",_="⎣",g="Size4-Regular",h="lfloor",m=667):n==="\\lceil"||n==="⌈"?(o="⎡",d=_="⎢",g="Size4-Regular",h="lceil",m=667):n==="\\rfloor"||n==="⌋"?(d=o="⎥",_="⎦",g="Size4-Regular",h="rfloor",m=667):n==="\\rceil"||n==="⌉"?(o="⎤",d=_="⎥",g="Size4-Regular",h="rceil",m=667):n==="("||n==="\\lparen"?(o="⎛",d="⎜",_="⎝",g="Size4-Regular",h="lparen",m=875):n===")"||n==="\\rparen"?(o="⎞",d="⎟",_="⎠",g="Size4-Regular",h="rparen",m=875):n==="\\{"||n==="\\lbrace"?(o="⎧",c="⎨",_="⎩",d="⎪",g="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",c="⎬",_="⎭",d="⎪",g="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",d="⎪",g="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",d="⎪",g="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",d="⎪",g="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",d="⎪",g="Size4-Regular");var S=Hf(o,g,i),k=S.height+S.depth,v=Hf(d,g,i),b=v.height+v.depth,x=Hf(_,g,i),y=x.height+x.depth,C=0,j=1;if(c!==null){var N=Hf(c,g,i);C=N.height+N.depth,j=2}var M=k+y+C,z=Math.max(0,Math.ceil((t-M)/(j*b))),D=M+z*j*b,I=s.fontMetrics().axisHeight;r&&(I*=s.sizeMultiplier);var $=D/2-I,P=[];if(h.length>0){var F=D-k-y,W=Math.round(D*1e3),Z=flt(h,Math.round(F*1e3)),U=new Dl(h,Z),Y=Ze(m/1e3),J=Ze(W/1e3),H=new Ao([U],{width:Y,height:J,viewBox:"0 0 "+m+" "+W}),L=Ll([],[H],s);L.height=W/1e3,L.style.width=Y,L.style.height=J,P.push({type:"elem",elem:L})}else{if(P.push(Gb(_,g,i)),P.push(R0),c===null){var B=D-k-y+2*P2;P.push(Vb(d,B,s))}else{var X=(D-k-y-C)/2+2*P2;P.push(Vb(d,X,s)),P.push(R0),P.push(Gb(c,g,i)),P.push(R0),P.push(Vb(d,X,s))}P.push(R0),P.push(Gb(o,g,i))}var V=s.havingBaseStyle(Ht.TEXT),ae=Nn({positionType:"bottom",positionData:$,children:P});return qy(Ue(["delimsizing","mult"],[ae],V),Ht.TEXT,s,l)},Wb=80,Kb=.08,Yb=function(n,t,r,s,i){var l=ult(n,s,r),o=new Dl(n,l),c=new Ao([o],{width:"400em",height:Ze(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ll(["hide-tail"],[c],i)},ict=function(n,t){var r=t.havingBaseSizing(),s=OA("\\surd",n*r.sizeMultiplier,LA,r),i=r.sizeMultiplier,l=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,c,d,_,h;return s.type==="small"?(_=1e3+1e3*l+Wb,n<1?i=1:n<1.4&&(i=.7),c=(1+l+Kb)/i,d=(1+l)/i,o=Yb("sqrtMain",c,_,l,t),o.style.minWidth="0.853em",h=.833/i):s.type==="large"?(_=(1e3+Wb)*Xf[s.size],d=(Xf[s.size]+l)/i,c=(Xf[s.size]+l+Kb)/i,o=Yb("sqrtSize"+s.size,c,_,l,t),o.style.minWidth="1.02em",h=1/i):(c=n+l+Kb,d=n+l,_=Math.floor(1e3*n+l)+Wb,o=Yb("sqrtTall",c,_,l,t),o.style.minWidth="0.742em",h=1.056),o.height=d,o.style.height=Ze(c),{span:o,advanceWidth:h,ruleWidth:(t.fontMetrics().sqrtRuleThickness+l)*i}},MA=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),act=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),RA=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Xf=[0,1.2,1.8,2.4,3],DA=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),MA.has(n)||RA.has(n))return AA(n,t,!1,r,s,i);if(act.has(n))return TA(n,Xf[t],!1,r,s,i);throw new Ke("Illegal delimiter: '"+n+"'")},oct=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],lct=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"stack"}],LA=[{type:"small",style:Ht.SCRIPTSCRIPT},{type:"small",style:Ht.SCRIPT},{type:"small",style:Ht.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],cct=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},OA=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),l=i;lt)return o}return r[r.length-1]},F2=function(n,t,r,s,i,l){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;RA.has(n)?o=oct:MA.has(n)?o=LA:o=lct;var c=OA(n,t,o,s);return c.type==="small"?tct(n,c.style,r,s,i,l):c.type==="large"?AA(n,c.size,r,s,i,l):TA(n,t,r,s,i,l)},Xb=function(n,t,r,s,i,l){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,d=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),h=Math.max(_/500*c,2*_-d);return F2(n,h,!0,s,i,l)},_8={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},uct=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function p8(e){return"isMiddle"in e}function km(e,n){var t=wm(e);if(t&&uct.has(t.text))return t;throw t?new Ke("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new Ke("Invalid delimiter type '"+e.type+"'",e)}st({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=km(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:_8[e.funcName].size,mclass:_8[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?Ue([e.mclass]):DA(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(Ui(e.delim,e.mode));var t=new Ye("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=Ze(Xf[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function m8(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}st({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new Ke("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:km(n[0],e).text,color:t}}});st({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=km(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Xt(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{m8(e);for(var t=Xr(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,l=0;l{m8(e);var t=ki(e.body,n);if(e.left!=="."){var r=new Ye("mo",[Ui(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Ye("mo",[Ui(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return Py(t)}});st({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=km(n[0],e);if(!e.parser.leftrightDepth)throw new Ke("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=uh(n,[]):(t=DA(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?Ui("|","text"):Ui(e.delim,e.mode),r=new Ye("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Cm=(e,n)=>{var t=fd(jn(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,l,o=Do(e.body);if(r==="sout")i=Ue(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,l=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=hr({number:.6,unit:"pt"},n),d=hr({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var h=t.height+t.depth+c+d;t.style.paddingLeft=Ze(h/2+c);var m=Math.floor(1e3*h*s),g=llt(m),S=new Ao([new Dl("phase",g)],{width:"400em",height:Ze(m/1e3),viewBox:"0 0 400000 "+m,preserveAspectRatio:"xMinYMin slice"});i=Ll(["hide-tail"],[S],n),i.style.height=Ze(h),l=t.depth+c+d}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var k,v,b=0;/box/.test(r)?(b=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),k=n.fontMetrics().fboxsep+(r==="colorbox"?0:b),v=k):r==="angl"?(b=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),k=4*b,v=Math.max(0,.25-t.depth)):(k=o?.2:0,v=k),i=Glt(t,r,k,v,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Ze(b)):r==="angl"&&b!==.049&&(i.style.borderTopWidth=Ze(b),i.style.borderRightWidth=Ze(b)),l=t.depth+v,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var x;if(e.backgroundColor)x=Nn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:l},{type:"elem",elem:t,shift:0}]});else{var y=/cancel|phase/.test(r)?["svg-align"]:[];x=Nn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:l,wrapperClasses:y}]})}return/cancel/.test(r)&&(x.height=t.height,x.depth=t.depth),/cancel/.test(r)&&!o?Ue(["mord","cancel-lap"],[x],n):Ue(["mord"],[x],n)},Em=(e,n)=>{var t,r=new Ye(e.label.includes("colorbox")?"mpadded":"menclose",[Kn(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+Ze(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};st({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=Xt(n[0],"color-token").color,l=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:l}},htmlBuilder:Cm,mathmlBuilder:Em});st({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=Xt(n[0],"color-token").color,l=Xt(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:l,borderColor:i,body:o}},htmlBuilder:Cm,mathmlBuilder:Em});st({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});st({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Cm,mathmlBuilder:Em});st({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:Cm,mathmlBuilder:Em});st({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var IA={};function Ga(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:l}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var n=e.parser.settings;if(!n.displayMode)throw new Ke("{"+e.envName+"} can be used only in display mode.")},dct=new Set(["gather","gather*"]);function Gy(e){if(!e.includes("ed"))return!e.includes("*")}function ql(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:l,colSeparationType:o,autoTag:c,singleRow:d,emptySingleRow:_,maxNumCols:h,leqno:m}=n;if(e.gullet.beginGroup(),d||e.gullet.macros.set("\\cr","\\\\\\relax"),!l){var g=e.gullet.expandMacroAsText("\\arraystretch");if(g==null)l=1;else if(l=parseFloat(g),!l||l<0)throw new Ke("Invalid \\arraystretch: "+g)}e.gullet.beginGroup();var S=[],k=[S],v=[],b=[],x=c!=null?[]:void 0;function y(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){x&&(e.gullet.macros.get("\\df@tag")?(x.push(e.subparse([new oa("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):x.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(y(),b.push(g8(e));;){var j=e.parseExpression(!1,d?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:j};t&&(N={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[N]}),S.push(N);var M=e.fetch().text;if(M==="&"){if(h&&S.length===h){if(d||o)throw new Ke("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(M==="\\end"){C(),S.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(k.length>1||!_)&&k.pop(),b.length0&&(y+=.25),d.push({pos:y,isDashed:Je[nt]})}for(C(l[0]),r=0;r0&&($+=x,M<$&&(M=$),$=0)),n.addJot&&rJe))for(r=0;r=o)){var ne=void 0;if(s>0||n.hskipBeforeAndAfter){var le,_e;ne=(le=(_e=V)==null?void 0:_e.pregap)!=null?le:m,ne!==0&&(Z=Ue(["arraycolsep"],[]),Z.style.width=Ze(ne),W.push(Z))}var ue=[];for(r=0;r0){for(var Jt=dd("hline",t,_),ht=dd("hdashline",t,_),it=[{type:"elem",elem:Nt,shift:0}];d.length>0;){var et=d.pop(),Pt=et.pos-P;et.isDashed?it.push({type:"elem",elem:ht,shift:Pt}):it.push({type:"elem",elem:Jt,shift:Pt})}Nt=Nn({positionType:"individualShift",children:it})}if(Y.length===0)return Ue(["mord"],[Nt],t);var we=Nn({positionType:"individualShift",children:Y}),Oe=Ue(["tag"],[we],t);return Oo([Nt,Oe])},fct={c:"center ",l:"left ",r:"right "},Wa=function(n,t){for(var r=[],s=new Ye("mtd",[],["mtr-glue"]),i=new Ye("mtd",[],["mml-eqn-num"]),l=0;l0){var S=n.cols,k="",v=!1,b=0,x=S.length;S[0].type==="separator"&&(m+="top ",b=1),S[S.length-1].type==="separator"&&(m+="bottom ",x-=1);for(var y=b;y0?"left ":"",m+=D[D.length-1].length>0?"right ":"";for(var I=1;I0&&g&&(v=1),r[S]={type:"align",align:k,pregap:v,postgap:0}}return l.colSeparationType=g?"align":"alignat",l};Ga({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=wm(n[0]),r=t?[n[0]]:Xt(n[0],"ordgroup").body,s=r.map(function(l){var o=ym(l),c=o.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new Ke("Unknown column alignment: "+c,l)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return ql(e.parser,i,Vy(e.envName))},htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new Ke("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=ql(e.parser,r,Vy(e.envName)),l=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(l).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=ql(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=wm(n[0]),r=t?[n[0]]:Xt(n[0],"ordgroup").body,s=r.map(function(o){var c=ym(o),d=c.text;if("lc".includes(d))return{type:"align",align:d};throw new Ke("Unknown column alignment: "+d,o)});if(s.length>1)throw new Ke("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},l=ql(e.parser,i,"script");if(l.body.length>0&&l.body[0].length>1)throw new Ke("{subarray} can contain only one column");return l},htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=ql(e.parser,n,Vy(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:HA,htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){dct.has(e.envName)&&Nm(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Gy(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ql(e.parser,n,"display")},htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:HA,htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Nm(e);var n={autoTag:Gy(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return ql(e.parser,n,"display")},htmlBuilder:Va,mathmlBuilder:Wa});Ga({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Nm(e),Jlt(e.parser)},htmlBuilder:Va,mathmlBuilder:Wa});re("\\nonumber","\\gdef\\@eqnsw{0}");re("\\notag","\\nonumber");st({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new Ke(e.funcName+" valid only within array environment")}});var b8=IA;st({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new Ke("Invalid environment name",s);for(var i="",l=0;l{var t=e.font,r=n.withFont(t);return jn(e.body,r)},FA=(e,n)=>{var t=e.font,r=n.withFont(t);return Kn(e.body,r)},v8={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};st({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=$p(n[0]),i=r;return i in v8&&(i=v8[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:PA,mathmlBuilder:FA});st({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:Sm(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:Do(r)}}});st({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,l=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:l}}},htmlBuilder:PA,mathmlBuilder:FA});var hct=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var l=jn(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;l.height=l.height0?S=3*m:S=7*m,k=n.fontMetrics().denom1):(h>0?(g=n.fontMetrics().num2,S=m):(g=n.fontMetrics().num3,S=3*m),k=n.fontMetrics().denom2);var v;if(_){var x=n.fontMetrics().axisHeight;g-l.depth-(x+.5*h){var t=new Ye("mfrac",[Kn(e.numer,n),Kn(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=hr(e.barSize,n);t.setAttribute("linethickness",Ze(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Ye("mo",[new Hr(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var l=new Ye("mo",[new Hr(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),s.push(l)}return Py(s)}return t},UA=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};st({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],l,o=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":l=!0;break;case"\\\\atopfrac":l=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":l=!1,o="(",c=")";break;case"\\\\bracefrac":l=!1,o="\\{",c="\\}";break;case"\\\\brackfrac":l=!1,o="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var d=r==="\\cfrac",_=null;return d||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),UA({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:d,hasBarLine:l,leftDelim:o,rightDelim:c,barSize:null},_)},htmlBuilder:hct,mathmlBuilder:_ct});st({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var x8=["display","text","script","scriptscript"],y8=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};st({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=$p(n[0]),l=i.type==="atom"&&i.family==="open"?y8(i.text):null,o=$p(n[1]),c=o.type==="atom"&&o.family==="close"?y8(o.text):null,d=Xt(n[2],"size"),_,h=null;d.isBlank?_=!0:(h=d.value,_=h.number>0);var m=null,g=n[3];if(g.type==="ordgroup"){if(g.body.length>0){var S=Xt(g.body[0],"textord");m=x8[Number(S.text)]}}else g=Xt(g,"textord"),m=x8[Number(g.text)];return UA({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:h,leftDelim:l,rightDelim:c},m)}});st({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:Xt(n[0],"size").value,token:s}}});st({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=Xt(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var l=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:l,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var qA=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?jn(e.sup,n.havingStyle(t.sup()),n):jn(e.sub,n.havingStyle(t.sub()),n),s=Xt(e.base,"horizBrace")):s=Xt(e,"horizBrace");var i=jn(s.base,n.havingBaseStyle(Ht.DISPLAY)),l=xm(s,n),o;if(s.isOver?o=Nn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:l,wrapperClasses:["svg-align"]}]}):o=Nn({positionType:"bottom",positionData:i.depth+.1+l.height,children:[{type:"elem",elem:l,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var c=Ue(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=Nn({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=Nn({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return Ue(["minner",s.isOver?"mover":"munder"],[o],n)},pct=(e,n)=>{var t=vm(e.label);return new Ye(e.isOver?"mover":"munder",[Kn(e.base,n),t])};st({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:qA,mathmlBuilder:pct});st({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=Xt(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:$r(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=Xr(e.body,n,!1);return zlt(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=Ol(e.body,n);return t instanceof Ye||(t=new Ye("mrow",[t])),t.setAttribute("href",e.href),t}});st({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=Xt(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=Xt(n[0],"raw").string,l=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,c={};switch(r){case"\\htmlClass":c.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var d=i.split(","),_=0;_{var t=Xr(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=Ue(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>Ol(e.body,n)});st({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:$r(n[0]),mathml:$r(n[1])}},htmlBuilder:(e,n)=>{var t=Xr(e.html,n,!1);return Oo(t)},mathmlBuilder:(e,n)=>Ol(e.mathml,n)});var Zb=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new Ke("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!aA(r))throw new Ke("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};st({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},o="";if(t[0])for(var c=Xt(t[0],"raw").string,d=c.split(","),_=0;_{var t=hr(e.height,n),r=0;e.totalheight.number>0&&(r=hr(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=hr(e.width,n));var i={height:Ze(t+r)};s>0&&(i.width=Ze(s)),r>0&&(i.verticalAlign=Ze(-r));var l=new mlt(e.src,e.alt,i);return l.height=t,l.depth=r,l},mathmlBuilder:(e,n)=>{var t=new Ye("mglyph",[]);t.setAttribute("alt",e.alt);var r=hr(e.height,n),s=0;if(e.totalheight.number>0&&(s=hr(e.totalheight,n)-r,t.setAttribute("valign",Ze(-s))),t.setAttribute("height",Ze(r+s)),e.width.number>0){var i=hr(e.width,n);t.setAttribute("width",Ze(i))}return t.setAttribute("src",e.src),t}});st({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=Xt(n[0],"size");if(t.settings.strict){var i=r[1]==="m",l=s.value.unit==="mu";i?(l||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):l&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return fA(e.dimension,n)},mathmlBuilder(e,n){var t=hr(e.dimension,n);return new bA(t)}});st({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=Ue([],[jn(e.body,n)]),t=Ue(["inner"],[t],n)):t=Ue(["inner"],[jn(e.body,n)]);var r=Ue(["fix"],[]),s=Ue([e.alignment],[t,r],n),i=Ue(["strut"]);return i.style.height=Ze(s.height+s.depth),s.depth&&(i.style.verticalAlign=Ze(-s.depth)),s.children.unshift(i),s=Ue(["thinbox"],[s],n),Ue(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Ye("mpadded",[Kn(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});st({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",l=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:l}}});st({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new Ke("Mismatched "+e.funcName)}});var w8=(e,n)=>{switch(n.style.size){case Ht.DISPLAY.size:return e.display;case Ht.TEXT.size:return e.text;case Ht.SCRIPT.size:return e.script;case Ht.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};st({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:$r(n[0]),text:$r(n[1]),script:$r(n[2]),scriptscript:$r(n[3])}},htmlBuilder:(e,n)=>{var t=w8(e,n),r=Xr(t,n,!1);return Oo(r)},mathmlBuilder:(e,n)=>{var t=w8(e,n);return Ol(t,n)}});var GA=(e,n,t,r,s,i,l)=>{e=Ue([],[e]);var o=t&&Do(t),c,d;if(n){var _=jn(n,r.havingStyle(s.sup()),r);d={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var h=jn(t,r.havingStyle(s.sub()),r);c={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}var m;if(d&&c){var g=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+l;m=Nn({positionType:"bottom",positionData:g,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ze(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ze(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var S=e.height-l;m=Nn({positionType:"top",positionData:S,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ze(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(d){var k=e.depth+l;m=Nn({positionType:"bottom",positionData:k,children:[{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ze(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var v=[m];if(c&&i!==0&&!o){var b=Ue(["mspace"],[],r);b.style.marginRight=Ze(i),v.unshift(b)}return Ue(["mop","op-limits"],v,r)},VA=new Set(["\\smallint"]),Rd=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=Xt(e.base,"op"),s=!0):i=Xt(e,"op");var l=n.style,o=!1;l.size===Ht.DISPLAY.size&&i.symbol&&!VA.has(i.name)&&(o=!0);var c,d;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",h="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(h=i.name.slice(1),i.name=h==="oiint"?"\\iint":"\\iiint"),c=Ms(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),d=c.italic,h.length>0){var m=_A(h+"Size"+(o?"2":"1"),n);c=Nn({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:m,shift:o?.08:0}]}),i.name="\\"+h,c.classes.unshift("mop"),c.italic=d}}else if(i.body){var g=Xr(i.body,n,!0);g.length===1&&g[0]instanceof xi?(c=g[0],c.classes[0]="mop"):c=Ue(["mop"],g,n)}else{for(var S=[],k=1;k{var t;if(e.symbol)t=new Ye("mo",[Ui(e.name,e.mode)]),VA.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Ye("mo",ki(e.body,n));else{t=new Ye("mi",[new Hr(e.name.slice(1))]);var r=new Ye("mo",[Ui("⁡","text")]);e.parentIsSupSub?t=new Ye("mrow",[t,r]):t=gA([t,r])}return t},mct={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};st({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=mct[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Rd,mathmlBuilder:Yh});st({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:$r(r)}},htmlBuilder:Rd,mathmlBuilder:Yh});var gct={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};st({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Rd,mathmlBuilder:Yh});st({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Rd,mathmlBuilder:Yh});st({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=gct[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Rd,mathmlBuilder:Yh});var WA=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=Xt(e.base,"operatorname"),s=!0):i=Xt(e,"operatorname");var l;if(i.body.length>0){for(var o=i.body.map(h=>{var m="text"in h?h.text:void 0;return typeof m=="string"?{type:"textord",mode:h.mode,text:m}:h}),c=Xr(o,n.withFont("mathrm"),!0),d=0;d{for(var t=ki(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new Hr(o)]}var c=new Ye("mi",t);c.setAttribute("mathvariant","normal");var d=new Ye("mo",[Ui("⁡","text")]);return e.parentIsSupSub?new Ye("mrow",[c,d]):gA([c,d])};st({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:$r(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:WA,mathmlBuilder:bct});re("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Yc({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?Oo(Xr(e.body,n,!1)):Ue(["mord"],Xr(e.body,n,!0),n)},mathmlBuilder(e,n){return Ol(e.body,n,!0)}});st({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=jn(e.body,n.havingCrampedStyle()),r=dd("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Nn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return Ue(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new Hr("‾")]);t.setAttribute("stretchy","true");var r=new Ye("mover",[Kn(e.body,n),t]);return r.setAttribute("accent","true"),r}});st({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:$r(r)}},htmlBuilder:(e,n)=>{var t=Xr(e.body,n.withPhantom(),!1);return Oo(t)},mathmlBuilder:(e,n)=>{var t=ki(e.body,n);return new Ye("mphantom",t)}});re("\\hphantom","\\smash{\\phantom{#1}}");st({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=Ue(["inner"],[jn(e.body,n.withPhantom())]),r=Ue(["fix"],[]);return Ue(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=ki($r(e.body),n),r=new Ye("mphantom",t),s=new Ye("mpadded",[r]);return s.setAttribute("width","0px"),s}});st({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=Xt(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=jn(e.body,n),r=hr(e.dy,n);return Nn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[Kn(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});st({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});st({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=Xt(n[0],"size"),l=Xt(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&Xt(s,"size").value,width:i.value,height:l.value}},htmlBuilder(e,n){var t=Ue(["mord","rule"],[],n),r=hr(e.width,n),s=hr(e.height,n),i=e.shift?hr(e.shift,n):0;return t.style.borderRightWidth=Ze(r),t.style.borderTopWidth=Ze(s),t.style.bottom=Ze(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=hr(e.width,n),r=hr(e.height,n),s=e.shift?hr(e.shift,n):0,i=n.color&&n.getColor()||"black",l=new Ye("mspace");l.setAttribute("mathbackground",i),l.setAttribute("width",Ze(t)),l.setAttribute("height",Ze(r));var o=new Ye("mpadded",[l]);return s>=0?o.setAttribute("height",Ze(s)):(o.setAttribute("height",Ze(s)),o.setAttribute("depth",Ze(-s))),o.setAttribute("voffset",Ze(s)),o}});function KA(e,n,t){for(var r=Xr(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return KA(e.body,t,n)};st({type:"sizing",names:S8,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:S8.indexOf(r)+1,body:i}},htmlBuilder:vct,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=ki(e.body,t),s=new Ye("mstyle",r);return s.setAttribute("mathsize",Ze(t.sizeMultiplier)),s}});st({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,l=t[0]&&Xt(t[0],"ordgroup");if(l)for(var o,c=0;c{var t=Ue([],[jn(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return Ue(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Ye("mpadded",[Kn(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});st({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=jn(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=fd(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+l&&(l=(l+h-t.height-t.depth)/2);var m=c.height-t.height-l-d;t.style.paddingLeft=Ze(_);var g=Nn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+m)},{type:"elem",elem:c},{type:"kern",size:d}]});if(e.index){var S=n.havingStyle(Ht.SCRIPTSCRIPT),k=jn(e.index,S,n),v=.6*(g.height-g.depth),b=Nn({positionType:"shift",positionData:-v,children:[{type:"elem",elem:k}]}),x=Ue(["root"],[b]);return Ue(["mord","sqrt"],[x,g],n)}else return Ue(["mord","sqrt"],[g],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Ye("mroot",[Kn(t,n),Kn(r,n)]):new Ye("msqrt",[Kn(t,n)])}});var U2={display:Ht.DISPLAY,text:Ht.TEXT,script:Ht.SCRIPT,scriptscript:Ht.SCRIPTSCRIPT};function xct(e){return e in U2}st({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),l=r.slice(1,r.length-5);if(!xct(l))throw new Error("Unknown style: "+l);return{type:"styling",mode:s.mode,style:l,body:i}},htmlBuilder(e,n){var t=U2[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),KA(e.body,r,n)},mathmlBuilder(e,n){var t=U2[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=ki(e.body,r),i=new Ye("mstyle",s),l={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=l[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var yct=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Ht.DISPLAY.size||r.alwaysHandleSupSub);return s?Rd:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Ht.DISPLAY.size||r.limits);return i?WA:null}else{if(r.type==="accent")return Do(r.base)?Uy:null;if(r.type==="horizBrace"){var l=!n.sub;return l===r.isOver?qA:null}else return null}else return null};Yc({type:"supsub",htmlBuilder(e,n){var t=yct(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,l=jn(r,n),o,c,d=n.fontMetrics(),_=0,h=0,m=r&&Do(r);if(s){var g=n.havingStyle(n.style.sup());o=jn(s,g,n),m||(_=l.height-g.fontMetrics().supDrop*g.sizeMultiplier/n.sizeMultiplier)}if(i){var S=n.havingStyle(n.style.sub());c=jn(i,S,n),m||(h=l.depth+S.fontMetrics().subDrop*S.sizeMultiplier/n.sizeMultiplier)}var k;n.style===Ht.DISPLAY?k=d.sup1:n.style.cramped?k=d.sup3:k=d.sup2;var v=n.sizeMultiplier,b=Ze(.5/d.ptPerEm/v),x=null;if(c){var y=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(l instanceof xi||y){var C;x=Ze(-((C=l.italic)!=null?C:0))}}var j;if(o&&c){_=Math.max(_,k,o.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var N=d.defaultRuleThickness,M=4*N;if(_-o.depth-(c.height-h)0&&(_+=z,h-=z)}var D=[{type:"elem",elem:c,shift:h,marginRight:b,marginLeft:x},{type:"elem",elem:o,shift:-_,marginRight:b}];j=Nn({positionType:"individualShift",children:D})}else if(c){h=Math.max(h,d.sub1,c.height-.8*d.xHeight);var I=[{type:"elem",elem:c,marginLeft:x,marginRight:b}];j=Nn({positionType:"shift",positionData:h,children:I})}else if(o)_=Math.max(_,k,o.depth+.25*d.xHeight),j=Nn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:b}]});else throw new Error("supsub must have either sup or sub.");var $=B2(l,"right")||"mord";return Ue([$],[l,Ue(["msupsub"],[j])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[Kn(e.base,n)];e.sub&&i.push(Kn(e.sub,n)),e.sup&&i.push(Kn(e.sup,n));var l;if(t)l=r?"mover":"munder";else if(e.sub)if(e.sup){var d=e.base;d&&d.type==="op"&&d.limits&&n.style===Ht.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(n.style===Ht.DISPLAY||d.limits)?l="munderover":l="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===Ht.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===Ht.DISPLAY)?l="munder":l="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Ht.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Ht.DISPLAY)?l="mover":l="msup"}return new Ye(l,i)}});Yc({type:"atom",htmlBuilder(e,n){return $y(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Ye("mo",[Ui(e.text,e.mode)]);if(e.family==="bin"){var r=Fy(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var YA={mi:"italic",mn:"normal",mtext:"normal"};Yc({type:"mathord",htmlBuilder(e,n){return bm(e,n,"mathord")},mathmlBuilder(e,n){var t=new Ye("mi",[Ui(e.text,e.mode,n)]),r=Fy(e,n)||"italic";return r!==YA[t.type]&&t.setAttribute("mathvariant",r),t}});Yc({type:"textord",htmlBuilder(e,n){return bm(e,n,"textord")},mathmlBuilder(e,n){var t=Ui(e.text,e.mode,n),r=Fy(e,n)||"normal",s;return e.mode==="text"?s=new Ye("mtext",[t]):/[0-9]/.test(e.text)?s=new Ye("mn",[t]):e.text==="\\prime"?s=new Ye("mo",[t]):s=new Ye("mi",[t]),r!==YA[s.type]&&s.setAttribute("mathvariant",r),s}});var Qb={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Jb={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Yc({type:"spacing",htmlBuilder(e,n){if(Jb.hasOwnProperty(e.text)){var t=Jb[e.text].className||"";if(e.mode==="text"){var r=bm(e,n,"textord");return r.classes.push(t),r}else return Ue(["mspace",t],[$y(e.text,e.mode,n)],n)}else{if(Qb.hasOwnProperty(e.text))return Ue(["mspace",Qb[e.text]],[],n);throw new Ke('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(Jb.hasOwnProperty(e.text))t=new Ye("mtext",[new Hr(" ")]);else{if(Qb.hasOwnProperty(e.text))return new Ye("mspace");throw new Ke('Unknown type of space "'+e.text+'"')}return t}});var k8=()=>{var e=new Ye("mtd",[]);return e.setAttribute("width","50%"),e};Yc({type:"tag",mathmlBuilder(e,n){var t=new Ye("mtable",[new Ye("mtr",[k8(),new Ye("mtd",[Ol(e.body,n)]),k8(),new Ye("mtd",[Ol(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var C8={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},E8={"\\textbf":"textbf","\\textmd":"textmd"},wct={"\\textit":"textit","\\textup":"textup"},N8=(e,n)=>{var t=e.font;if(t){if(C8[t])return n.withTextFontFamily(C8[t]);if(E8[t])return n.withTextFontWeight(E8[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(wct[t])};st({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:$r(s),font:r}},htmlBuilder(e,n){var t=N8(e,n),r=Xr(e.body,t,!0);return Ue(["mord","text"],r,t)},mathmlBuilder(e,n){var t=N8(e,n);return Ol(e.body,t)}});st({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=jn(e.body,n),r=dd("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=Nn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return Ue(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Ye("mo",[new Hr("‾")]);t.setAttribute("stretchy","true");var r=new Ye("munder",[Kn(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});st({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=jn(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return Nn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ye("mpadded",[Kn(e.body,n)],["vcenter"]);return new Ye("mrow",[t])}});st({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new Ke("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=z8(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),Al=pA,XA=`[ \r - ]`,Sct="\\\\[a-zA-Z@]+",kct="\\\\[^\uD800-\uDFFF]",Cct="("+Sct+")"+XA+"*",Ect=`\\\\( -|[ \r ]+ -?)[ \r ]*`,q2="[̀-ͯ]",Nct=new RegExp(q2+"+$"),zct="("+XA+"+)|"+(Ect+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(q2+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(q2+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+Cct)+("|"+kct+")");class j8{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(zct,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new oa("EOF",new Zs(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new Ke("Unexpected character: '"+n[t]+"'",new oa(n[t],new Zs(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` -`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new oa(s,new Zs(this,t,this.tokenRegex.lastIndex))}}class jct{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ke("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var Act=BA;re("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});re("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});re("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});re("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});re("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});re("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");re("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var A8={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};re("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new Ke("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=A8[n.text],r==null||r>=t)throw new Ke("Invalid base-"+t+" digit "+n.text);for(var s;(s=A8[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new Ke("\\newcommand's first argument must be a macro name");var i=s[0].text,l=e.isDefined(i);if(l&&!n)throw new Ke("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!l&&!t)throw new Ke("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",d=e.expandNextToken();d.text!=="]"&&d.text!=="EOF";)c+=d.text,d=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new Ke("Invalid number of arguments: "+c);o=parseInt(c),s=e.consumeArg().tokens}return l&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};re("\\newcommand",e=>Wy(e,!1,!0,!1));re("\\renewcommand",e=>Wy(e,!0,!1,!1));re("\\providecommand",e=>Wy(e,!0,!0,!0));re("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});re("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});re("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),Al[t],sr.math[t],sr.text[t]),""});re("\\bgroup","{");re("\\egroup","}");re("~","\\nobreakspace");re("\\lq","`");re("\\rq","'");re("\\aa","\\r a");re("\\AA","\\r A");re("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");re("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");re("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");re("ℬ","\\mathscr{B}");re("ℰ","\\mathscr{E}");re("ℱ","\\mathscr{F}");re("ℋ","\\mathscr{H}");re("ℐ","\\mathscr{I}");re("ℒ","\\mathscr{L}");re("ℳ","\\mathscr{M}");re("ℛ","\\mathscr{R}");re("ℭ","\\mathfrak{C}");re("ℌ","\\mathfrak{H}");re("ℨ","\\mathfrak{Z}");re("\\Bbbk","\\Bbb{k}");re("\\llap","\\mathllap{\\textrm{#1}}");re("\\rlap","\\mathrlap{\\textrm{#1}}");re("\\clap","\\mathclap{\\textrm{#1}}");re("\\mathstrut","\\vphantom{(}");re("\\underbar","\\underline{\\text{#1}}");re("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');re("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");re("\\ne","\\neq");re("≠","\\neq");re("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");re("∉","\\notin");re("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");re("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");re("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");re("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");re("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");re("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");re("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");re("⟂","\\perp");re("‼","\\mathclose{!\\mkern-0.8mu!}");re("∌","\\notni");re("⌜","\\ulcorner");re("⌝","\\urcorner");re("⌞","\\llcorner");re("⌟","\\lrcorner");re("©","\\copyright");re("®","\\textregistered");re("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');re("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');re("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');re("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');re("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");re("⋮","\\vdots");re("\\varGamma","\\mathit{\\Gamma}");re("\\varDelta","\\mathit{\\Delta}");re("\\varTheta","\\mathit{\\Theta}");re("\\varLambda","\\mathit{\\Lambda}");re("\\varXi","\\mathit{\\Xi}");re("\\varPi","\\mathit{\\Pi}");re("\\varSigma","\\mathit{\\Sigma}");re("\\varUpsilon","\\mathit{\\Upsilon}");re("\\varPhi","\\mathit{\\Phi}");re("\\varPsi","\\mathit{\\Psi}");re("\\varOmega","\\mathit{\\Omega}");re("\\substack","\\begin{subarray}{c}#1\\end{subarray}");re("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");re("\\boxed","\\fbox{$\\displaystyle{#1}$}");re("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");re("\\implies","\\DOTSB\\;\\Longrightarrow\\;");re("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");re("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");re("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var T8={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Tct=new Set(["bin","rel"]);re("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in T8?n=T8[t]:(t.slice(0,4)==="\\not"||t in sr.math&&Tct.has(sr.math[t].group))&&(n="\\dotsb"),n});var Ky={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};re("\\dotso",function(e){var n=e.future().text;return n in Ky?"\\ldots\\,":"\\ldots"});re("\\dotsc",function(e){var n=e.future().text;return n in Ky&&n!==","?"\\ldots\\,":"\\ldots"});re("\\cdots",function(e){var n=e.future().text;return n in Ky?"\\@cdots\\,":"\\@cdots"});re("\\dotsb","\\cdots");re("\\dotsm","\\cdots");re("\\dotsi","\\!\\cdots");re("\\dotsx","\\ldots\\,");re("\\DOTSI","\\relax");re("\\DOTSB","\\relax");re("\\DOTSX","\\relax");re("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");re("\\,","\\tmspace+{3mu}{.1667em}");re("\\thinspace","\\,");re("\\>","\\mskip{4mu}");re("\\:","\\tmspace+{4mu}{.2222em}");re("\\medspace","\\:");re("\\;","\\tmspace+{5mu}{.2777em}");re("\\thickspace","\\;");re("\\!","\\tmspace-{3mu}{.1667em}");re("\\negthinspace","\\!");re("\\negmedspace","\\tmspace-{4mu}{.2222em}");re("\\negthickspace","\\tmspace-{5mu}{.277em}");re("\\enspace","\\kern.5em ");re("\\enskip","\\hskip.5em\\relax");re("\\quad","\\hskip1em\\relax");re("\\qquad","\\hskip2em\\relax");re("\\tag","\\@ifstar\\tag@literal\\tag@paren");re("\\tag@paren","\\tag@literal{({#1})}");re("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ke("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});re("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");re("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");re("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");re("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");re("\\newline","\\\\\\relax");re("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var ZA=Ze(La["Main-Regular"][84][1]-.7*La["Main-Regular"][65][1]);re("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+ZA+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");re("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+ZA+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");re("\\hspace","\\@ifstar\\@hspacer\\@hspace");re("\\@hspace","\\hskip #1\\relax");re("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");re("\\ordinarycolon",":");re("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");re("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');re("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');re("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');re("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');re("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');re("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');re("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');re("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');re("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');re("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');re("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');re("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');re("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');re("∷","\\dblcolon");re("∹","\\eqcolon");re("≔","\\coloneqq");re("≕","\\eqqcolon");re("⩴","\\Coloneqq");re("\\ratio","\\vcentcolon");re("\\coloncolon","\\dblcolon");re("\\colonequals","\\coloneqq");re("\\coloncolonequals","\\Coloneqq");re("\\equalscolon","\\eqqcolon");re("\\equalscoloncolon","\\Eqqcolon");re("\\colonminus","\\coloneq");re("\\coloncolonminus","\\Coloneq");re("\\minuscolon","\\eqcolon");re("\\minuscoloncolon","\\Eqcolon");re("\\coloncolonapprox","\\Colonapprox");re("\\coloncolonsim","\\Colonsim");re("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");re("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");re("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");re("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");re("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");re("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");re("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");re("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");re("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");re("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");re("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");re("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");re("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");re("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");re("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");re("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");re("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");re("\\nleqq","\\html@mathml{\\@nleqq}{≰}");re("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");re("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");re("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");re("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");re("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");re("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");re("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");re("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");re("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");re("\\imath","\\html@mathml{\\@imath}{ı}");re("\\jmath","\\html@mathml{\\@jmath}{ȷ}");re("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");re("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");re("⟦","\\llbracket");re("⟧","\\rrbracket");re("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");re("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");re("⦃","\\lBrace");re("⦄","\\rBrace");re("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");re("⦵","\\minuso");re("\\darr","\\downarrow");re("\\dArr","\\Downarrow");re("\\Darr","\\Downarrow");re("\\lang","\\langle");re("\\rang","\\rangle");re("\\uarr","\\uparrow");re("\\uArr","\\Uparrow");re("\\Uarr","\\Uparrow");re("\\N","\\mathbb{N}");re("\\R","\\mathbb{R}");re("\\Z","\\mathbb{Z}");re("\\alef","\\aleph");re("\\alefsym","\\aleph");re("\\Alpha","\\mathrm{A}");re("\\Beta","\\mathrm{B}");re("\\bull","\\bullet");re("\\Chi","\\mathrm{X}");re("\\clubs","\\clubsuit");re("\\cnums","\\mathbb{C}");re("\\Complex","\\mathbb{C}");re("\\Dagger","\\ddagger");re("\\diamonds","\\diamondsuit");re("\\empty","\\emptyset");re("\\Epsilon","\\mathrm{E}");re("\\Eta","\\mathrm{H}");re("\\exist","\\exists");re("\\harr","\\leftrightarrow");re("\\hArr","\\Leftrightarrow");re("\\Harr","\\Leftrightarrow");re("\\hearts","\\heartsuit");re("\\image","\\Im");re("\\infin","\\infty");re("\\Iota","\\mathrm{I}");re("\\isin","\\in");re("\\Kappa","\\mathrm{K}");re("\\larr","\\leftarrow");re("\\lArr","\\Leftarrow");re("\\Larr","\\Leftarrow");re("\\lrarr","\\leftrightarrow");re("\\lrArr","\\Leftrightarrow");re("\\Lrarr","\\Leftrightarrow");re("\\Mu","\\mathrm{M}");re("\\natnums","\\mathbb{N}");re("\\Nu","\\mathrm{N}");re("\\Omicron","\\mathrm{O}");re("\\plusmn","\\pm");re("\\rarr","\\rightarrow");re("\\rArr","\\Rightarrow");re("\\Rarr","\\Rightarrow");re("\\real","\\Re");re("\\reals","\\mathbb{R}");re("\\Reals","\\mathbb{R}");re("\\Rho","\\mathrm{P}");re("\\sdot","\\cdot");re("\\sect","\\S");re("\\spades","\\spadesuit");re("\\sub","\\subset");re("\\sube","\\subseteq");re("\\supe","\\supseteq");re("\\Tau","\\mathrm{T}");re("\\thetasym","\\vartheta");re("\\weierp","\\wp");re("\\Zeta","\\mathrm{Z}");re("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");re("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");re("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");re("\\bra","\\mathinner{\\langle{#1}|}");re("\\ket","\\mathinner{|{#1}\\rangle}");re("\\braket","\\mathinner{\\langle{#1}\\rangle}");re("\\Bra","\\left\\langle#1\\right|");re("\\Ket","\\left|#1\\right\\rangle");var QA=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,l=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var c=h=>m=>{e&&(m.macros.set("|",l),s.length&&m.macros.set("\\|",o));var g=h;if(!h&&s.length){var S=m.future();S.text==="|"&&(m.popToken(),g=!0)}return{tokens:g?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var d=n.consumeArg().tokens,_=n.expandTokens([...i,...d,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};re("\\bra@ket",QA(!1));re("\\bra@set",QA(!0));re("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");re("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");re("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");re("\\angln","{\\angl n}");re("\\blue","\\textcolor{##6495ed}{#1}");re("\\orange","\\textcolor{##ffa500}{#1}");re("\\pink","\\textcolor{##ff00af}{#1}");re("\\red","\\textcolor{##df0030}{#1}");re("\\green","\\textcolor{##28ae7b}{#1}");re("\\gray","\\textcolor{gray}{#1}");re("\\purple","\\textcolor{##9d38bd}{#1}");re("\\blueA","\\textcolor{##ccfaff}{#1}");re("\\blueB","\\textcolor{##80f6ff}{#1}");re("\\blueC","\\textcolor{##63d9ea}{#1}");re("\\blueD","\\textcolor{##11accd}{#1}");re("\\blueE","\\textcolor{##0c7f99}{#1}");re("\\tealA","\\textcolor{##94fff5}{#1}");re("\\tealB","\\textcolor{##26edd5}{#1}");re("\\tealC","\\textcolor{##01d1c1}{#1}");re("\\tealD","\\textcolor{##01a995}{#1}");re("\\tealE","\\textcolor{##208170}{#1}");re("\\greenA","\\textcolor{##b6ffb0}{#1}");re("\\greenB","\\textcolor{##8af281}{#1}");re("\\greenC","\\textcolor{##74cf70}{#1}");re("\\greenD","\\textcolor{##1fab54}{#1}");re("\\greenE","\\textcolor{##0d923f}{#1}");re("\\goldA","\\textcolor{##ffd0a9}{#1}");re("\\goldB","\\textcolor{##ffbb71}{#1}");re("\\goldC","\\textcolor{##ff9c39}{#1}");re("\\goldD","\\textcolor{##e07d10}{#1}");re("\\goldE","\\textcolor{##a75a05}{#1}");re("\\redA","\\textcolor{##fca9a9}{#1}");re("\\redB","\\textcolor{##ff8482}{#1}");re("\\redC","\\textcolor{##f9685d}{#1}");re("\\redD","\\textcolor{##e84d39}{#1}");re("\\redE","\\textcolor{##bc2612}{#1}");re("\\maroonA","\\textcolor{##ffbde0}{#1}");re("\\maroonB","\\textcolor{##ff92c6}{#1}");re("\\maroonC","\\textcolor{##ed5fa6}{#1}");re("\\maroonD","\\textcolor{##ca337c}{#1}");re("\\maroonE","\\textcolor{##9e034e}{#1}");re("\\purpleA","\\textcolor{##ddd7ff}{#1}");re("\\purpleB","\\textcolor{##c6b9fc}{#1}");re("\\purpleC","\\textcolor{##aa87ff}{#1}");re("\\purpleD","\\textcolor{##7854ab}{#1}");re("\\purpleE","\\textcolor{##543b78}{#1}");re("\\mintA","\\textcolor{##f5f9e8}{#1}");re("\\mintB","\\textcolor{##edf2df}{#1}");re("\\mintC","\\textcolor{##e0e5cc}{#1}");re("\\grayA","\\textcolor{##f6f7f7}{#1}");re("\\grayB","\\textcolor{##f0f1f2}{#1}");re("\\grayC","\\textcolor{##e3e5e6}{#1}");re("\\grayD","\\textcolor{##d6d8da}{#1}");re("\\grayE","\\textcolor{##babec2}{#1}");re("\\grayF","\\textcolor{##888d93}{#1}");re("\\grayG","\\textcolor{##626569}{#1}");re("\\grayH","\\textcolor{##3b3e40}{#1}");re("\\grayI","\\textcolor{##21242c}{#1}");re("\\kaBlue","\\textcolor{##314453}{#1}");re("\\kaGreen","\\textcolor{##71B307}{#1}");var JA={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Mct{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new jct(Act,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new j8(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new oa("EOF",r.loc)),this.pushTokens(s),new oa("",Zs.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,l=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++l;else if(i.text==="}"){if(--l,l===-1)throw new Ke("Extra }",i)}else if(i.text==="EOF")throw new Ke("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((l===0||l===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(l!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new Ke("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new Ke("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ke("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,l=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var c=i[o];if(c.text==="#"){if(o===0)throw new Ke("Incomplete placeholder at end of macro body",c);if(c=i[--o],c.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(c.text))i.splice(o,2,...l[+c.text-1]);else throw new Ke("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new oa(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var l=s.replace(/##/g,"");l.includes("#"+(i+1));)++i;for(var o=new j8(s,this.settings),c=[],d=o.lex();d.text!=="EOF";)c.push(d),d=o.lex();c.reverse();var _={tokens:c,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||Al.hasOwnProperty(n)||sr.math.hasOwnProperty(n)||sr.text.hasOwnProperty(n)||JA.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Al.hasOwnProperty(n)&&!Al[n].primitive}}var M8=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,D0=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ev={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},R8={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class zm{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Mct(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new Ke("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new oa("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(zm.endOfExpression.has(s.text)||t&&s.text===t||n&&Al[s.text]&&Al[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(iA(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),l={type:"textord",mode:"text",loc:Zs.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:N}:void 0),N===!1?m.lastIndex=C+1:(S!==C&&x.push({type:"text",value:d.value.slice(S,C)}),Array.isArray(N)?x.push(...N):N&&x.push(N),S=C+y[0].length,b=!0),!m.global)break;y=m.exec(d.value)}return b?(S?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=L8(e,"(");let i=L8(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function rT(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Bc(t)||dm(t))&&(!n||t!==47)}sT.peek=dut;function rut(){this.buffer()}function sut(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function iut(){this.buffer()}function aut(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function out(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ia(this.sliceSerialize(e)).toLowerCase(),t.label=n}function lut(e){this.exit(e)}function cut(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=ia(this.sliceSerialize(e)).toLowerCase(),t.label=n}function uut(e){this.exit(e)}function dut(){return"["}function sT(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const l=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),l(),i+=s.move("]"),i}function fut(){return{enter:{gfmFootnoteCallString:rut,gfmFootnoteCall:sut,gfmFootnoteDefinitionLabelString:iut,gfmFootnoteDefinition:aut},exit:{gfmFootnoteCallString:out,gfmFootnoteCall:lut,gfmFootnoteDefinitionLabelString:cut,gfmFootnoteDefinition:uut}}}function hut(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:sT},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,l){const o=i.createTracker(l);let c=o.move("[^");const d=i.enter("footnoteDefinition"),_=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),_(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((n?` -`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?iT:_ut))),d(),c}}function _ut(e,n,t){return n===0?e:iT(e,n,t)}function iT(e,n,t){return(t?"":" ")+e}const put=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];aT.peek=xut;function mut(){return{canContainEols:["delete"],enter:{strikethrough:but},exit:{strikethrough:vut}}}function gut(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:put}],handlers:{delete:aT}}}function but(e){this.enter({type:"delete",children:[]},e)}function vut(e){this.exit(e)}function aT(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let l=s.move("~~");return l+=t.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),i(),l}function xut(){return"~"}function yut(e){return e.length}function wut(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||yut,i=[],l=[],o=[],c=[];let d=0,_=-1;for(;++_d&&(d=e[_].length);++bc[b])&&(c[b]=y)}k.push(x)}l[_]=k,o[_]=v}let h=-1;if(typeof r=="object"&&"length"in r)for(;++hc[h]&&(c[h]=x),g[h]=x),m[h]=y}l.splice(1,0,m),o.splice(1,0,g),_=-1;const S=[];for(;++_ "),i.shift(2);const l=t.indentLines(t.containerFlow(e,i.current()),Cut);return s(),l}function Cut(e,n,t){return">"+(t?"":" ")+e}function Eut(e,n){return I8(e,n.inConstruct,!0)&&!I8(e,n.notInConstruct,!1)}function I8(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++rl&&(l=i):i=1,s=r+n.length,r=t.indexOf(n,s);return l}function Nut(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function zut(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function jut(e,n,t,r){const s=zut(t),i=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(Nut(e,t)){const h=t.enter("codeIndented"),m=t.indentLines(i,Aut);return h(),m}const o=t.createTracker(r),c=s.repeat(Math.max(oT(i,s)+1,3)),d=t.enter("codeFenced");let _=o.move(c);if(e.lang){const h=t.enter(`codeFencedLang${l}`);_+=o.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...o.current()})),h()}if(e.lang&&e.meta){const h=t.enter(`codeFencedMeta${l}`);_+=o.move(" "),_+=o.move(t.safe(e.meta,{before:_,after:` -`,encode:["`"],...o.current()})),h()}return _+=o.move(` -`),i&&(_+=o.move(i+` -`)),_+=o.move(c),d(),_}function Aut(e,n,t){return(t?"":" ")+e}function Zy(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Tut(e,n,t,r){const s=Zy(t),i=s==='"'?"Quote":"Apostrophe",l=t.enter("definition");let o=t.enter("label");const c=t.createTracker(r);let d=c.move("[");return d+=c.move(t.safe(t.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(t.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(o=t.enter("destinationRaw"),d+=c.move(t.safe(e.url,{before:d,after:e.title?" ":` -`,...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(t.safe(e.title,{before:d,after:s,...c.current()})),d+=c.move(s),o()),l(),d}function Mut(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function dh(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hp(e,n,t){const r=cd(e),s=cd(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}lT.peek=Rut;function lT(e,n,t,r){const s=Mut(t),i=t.enter("emphasis"),l=t.createTracker(r),o=l.move(s);let c=l.move(t.containerPhrasing(e,{after:s,before:o,...l.current()}));const d=c.charCodeAt(0),_=Hp(r.before.charCodeAt(r.before.length-1),d,s);_.inside&&(c=dh(d)+c.slice(1));const h=c.charCodeAt(c.length-1),m=Hp(r.after.charCodeAt(0),h,s);m.inside&&(c=c.slice(0,-1)+dh(h));const g=l.move(s);return i(),t.attentionEncodeSurroundingInfo={after:m.outside,before:_.outside},o+c+g}function Rut(e,n,t){return t.options.emphasis||"*"}function Dut(e,n){let t=!1;return Sy(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,_2}),!!((!e.depth||e.depth<3)&&Ay(e)&&(n.options.setext||t))}function Lut(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(Dut(e,t)){const _=t.enter("headingSetext"),h=t.enter("phrasing"),m=t.containerPhrasing(e,{...i.current(),before:` -`,after:` -`});return h(),_(),m+` -`+(s===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(` -`))+1))}const l="#".repeat(s),o=t.enter("headingAtx"),c=t.enter("phrasing");i.move(l+" ");let d=t.containerPhrasing(e,{before:"# ",after:` -`,...i.current()});return/^[\t ]/.test(d)&&(d=dh(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,t.options.closeAtx&&(d+=" "+l),c(),o(),d}cT.peek=Out;function cT(e){return e.value||""}function Out(){return"<"}uT.peek=Iut;function uT(e,n,t,r){const s=Zy(t),i=s==='"'?"Quote":"Apostrophe",l=t.enter("image");let o=t.enter("label");const c=t.createTracker(r);let d=c.move("![");return d+=c.move(t.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(t.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(o=t.enter("destinationRaw"),d+=c.move(t.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(t.safe(e.title,{before:d,after:s,...c.current()})),d+=c.move(s),o()),d+=c.move(")"),l(),d}function Iut(){return"!"}dT.peek=But;function dT(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let l=t.enter("label");const o=t.createTracker(r);let c=o.move("![");const d=t.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(d+"]["),l();const _=t.stack;t.stack=[],l=t.enter("reference");const h=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return l(),t.stack=_,i(),s==="full"||!d||d!==h?c+=o.move(h+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function But(){return"!"}fT.peek=$ut;function fT(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}_T.peek=Hut;function _T(e,n,t,r){const s=Zy(t),i=s==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let o,c;if(hT(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let h=l.move("<");return h+=l.move(t.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),o(),t.stack=_,h}o=t.enter("link"),c=t.enter("label");let d=l.move("[");return d+=l.move(t.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(t.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(c=t.enter("destinationRaw"),d+=l.move(t.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),c(),e.title&&(c=t.enter(`title${i}`),d+=l.move(" "+s),d+=l.move(t.safe(e.title,{before:d,after:s,...l.current()})),d+=l.move(s),c()),d+=l.move(")"),o(),d}function Hut(e,n,t){return hT(e,t)?"<":"["}pT.peek=Put;function pT(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let l=t.enter("label");const o=t.createTracker(r);let c=o.move("[");const d=t.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(d+"]["),l();const _=t.stack;t.stack=[],l=t.enter("reference");const h=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return l(),t.stack=_,i(),s==="full"||!d||d!==h?c+=o.move(h+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Put(){return"["}function Qy(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Fut(e){const n=Qy(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function Uut(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function mT(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function qut(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let l=e.ordered?Uut(t):Qy(t);const o=e.ordered?l==="."?")":".":Fut(t);let c=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),mT(t)===l&&_){let h=-1;for(;++h-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let l=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(l-i.length)),o.shift(l);const c=t.enter("listItem"),d=t.indentLines(t.containerFlow(e,o.current()),_);return c(),d;function _(h,m,g){return m?(g?"":" ".repeat(l))+h:(g?i:i+" ".repeat(l-i.length))+h}}function Wut(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),l=t.containerPhrasing(e,r);return i(),s(),l}const Kut=qh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Yut(e,n,t,r){return(e.children.some(function(l){return Kut(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Xut(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}gT.peek=Zut;function gT(e,n,t,r){const s=Xut(t),i=t.enter("strong"),l=t.createTracker(r),o=l.move(s+s);let c=l.move(t.containerPhrasing(e,{after:s,before:o,...l.current()}));const d=c.charCodeAt(0),_=Hp(r.before.charCodeAt(r.before.length-1),d,s);_.inside&&(c=dh(d)+c.slice(1));const h=c.charCodeAt(c.length-1),m=Hp(r.after.charCodeAt(0),h,s);m.inside&&(c=c.slice(0,-1)+dh(h));const g=l.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:m.outside,before:_.outside},o+c+g}function Zut(e,n,t){return t.options.strong||"*"}function Qut(e,n,t,r){return t.safe(e.value,r)}function Jut(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function edt(e,n,t){const r=(mT(t)+(t.options.ruleSpaces?" ":"")).repeat(Jut(t));return t.options.ruleSpaces?r.slice(0,-1):r}const bT={blockquote:kut,break:B8,code:jut,definition:Tut,emphasis:lT,hardBreak:B8,heading:Lut,html:cT,image:uT,imageReference:dT,inlineCode:fT,link:_T,linkReference:pT,list:qut,listItem:Vut,paragraph:Wut,root:Yut,strong:gT,text:Qut,thematicBreak:edt};function tdt(){return{enter:{table:ndt,tableData:$8,tableHeader:$8,tableRow:sdt},exit:{codeText:idt,table:rdt,tableData:sv,tableHeader:sv,tableRow:sv}}}function ndt(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function rdt(e){this.exit(e),this.data.inTable=void 0}function sdt(e){this.enter({type:"tableRow",children:[]},e)}function sv(e){this.exit(e)}function $8(e){this.enter({type:"tableCell",children:[]},e)}function idt(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,adt));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function adt(e,n){return n==="|"?n:e}function odt(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";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:m,table:l,tableCell:c,tableRow:o}};function l(g,S,k,v){return d(_(g,k,v),g.align)}function o(g,S,k,v){const b=h(g,k,v),x=d([b]);return x.slice(0,x.indexOf(` -`))}function c(g,S,k,v){const b=k.enter("tableCell"),x=k.enter("phrasing"),y=k.containerPhrasing(g,{...v,before:i,after:i});return x(),b(),y}function d(g,S){return wut(g,{align:S,alignDelimiters:r,padding:t,stringLength:s})}function _(g,S,k){const v=g.children;let b=-1;const x=[],y=S.enter("table");for(;++b0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Cdt={tokenize:Rdt,partial:!0};function Edt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Adt,continuation:{tokenize:Tdt},exit:Mdt}},text:{91:{name:"gfmFootnoteCall",tokenize:jdt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ndt,resolveTo:zdt}}}}function Ndt(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){l=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!l||!l._balanced)return t(c);const d=ia(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function zdt(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function jdt(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,l;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?t(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(i>999||h===93&&!l||h===null||h===91||Wn(h))return t(h);if(h===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return s.includes(ia(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(h)}return Wn(h)||(l=!0),i++,e.consume(h),h===92?_:d}function _(h){return h===91||h===92||h===93?(e.consume(h),i++,d):d(h)}}function Adt(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0,o;return c;function c(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(S)}function _(S){if(l>999||S===93&&!o||S===null||S===91||Wn(S))return t(S);if(S===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return i=ia(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Wn(S)||(o=!0),l++,e.consume(S),S===92?h:_}function h(S){return S===91||S===92||S===93?(e.consume(S),l++,_):_(S)}function m(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(i)||s.push(i),tn(e,g,"gfmFootnoteDefinitionWhitespace")):t(S)}function g(S){return n(S)}}function Tdt(e,n,t){return e.check(Wh,n,e.attempt(Cdt,n,t))}function Mdt(e){e.exit("gfmFootnoteDefinition")}function Rdt(e,n,t){const r=this;return tn(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(i):t(i)}}function Ddt(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(l,o){let c=-1;for(;++c1?c(S):(l.consume(S),h++,g);if(h<2&&!t)return c(S);const v=l.exit("strikethroughSequenceTemporary"),b=cd(S);return v._open=!b||b===2&&!!k,v._close=!k||k===2&&!!b,o(S)}}}class Ldt{constructor(){this.map=[]}add(n,t,r){Odt(this,n,t,r)}consume(n){if(this.map.sort(function(i,l){return i[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function Odt(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const W=r.events[$][1].type;if(W==="lineEnding"||W==="linePrefix")$--;else break}const P=$>-1?r.events[$][1].type:null,F=P==="tableHead"||P==="tableRow"?N:c;return F===N&&r.parser.lazy[r.now().line]?t(I):F(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),d(I)}function d(I){return I===124||(l=!0,i+=1),_(I)}function _(I){return I===null?t(I):gt(I)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),g):t(I):un(I)?tn(e,_,"whitespace")(I):(i+=1,l&&(l=!1,s+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),l=!0,_):(e.enter("data"),h(I)))}function h(I){return I===null||I===124||Wn(I)?(e.exit("data"),_(I)):(e.consume(I),I===92?m:h)}function m(I){return I===92||I===124?(e.consume(I),h):h(I)}function g(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(I):(e.enter("tableDelimiterRow"),l=!1,un(I)?tn(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):S(I))}function S(I){return I===45||I===58?v(I):I===124?(l=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),k):j(I)}function k(I){return un(I)?tn(e,v,"whitespace")(I):v(I)}function v(I){return I===58?(i+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),b):I===45?(i+=1,b(I)):I===null||gt(I)?C(I):j(I)}function b(I){return I===45?(e.enter("tableDelimiterFiller"),x(I)):j(I)}function x(I){return I===45?(e.consume(I),x):I===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(I))}function y(I){return un(I)?tn(e,C,"whitespace")(I):C(I)}function C(I){return I===124?S(I):I===null||gt(I)?!l||s!==i?j(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(I)):j(I)}function j(I){return t(I)}function N(I){return e.enter("tableRow"),M(I)}function M(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),M):I===null||gt(I)?(e.exit("tableRow"),n(I)):un(I)?tn(e,M,"whitespace")(I):(e.enter("data"),z(I))}function z(I){return I===null||I===124||Wn(I)?(e.exit("data"),M(I)):(e.consume(I),I===92?D:z)}function D(I){return I===92||I===124?(e.consume(I),z):z(I)}}function Hdt(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],l=[0,0,0,0],o=!1,c=0,d,_,h;const m=new Ldt;for(;++tt[2]+1){const S=t[2]+1,k=t[3]-t[2]-1;e.add(S,k,[])}}e.add(t[3]+1,0,[["exit",h,n]])}return s!==void 0&&(i.end=Object.assign({},Iu(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function P8(e,n,t,r,s){const i=[],l=Iu(n.events,t);s&&(s.end=Object.assign({},l),i.push(["exit",s,n])),r.end=Object.assign({},l),i.push(["exit",r,n]),e.add(t+1,0,i)}function Iu(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Pdt={name:"tasklistCheck",tokenize:Udt};function Fdt(){return{text:{91:Pdt}}}function Udt(e,n,t){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Wn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),l):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),l):t(c)}function l(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(c)}function o(c){return gt(c)?n(c):un(c)?e.check({tokenize:qdt},n,t)(c):t(c)}}function qdt(e,n,t){return tn(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function Gdt(e){return Mj([mdt(),Edt(),Ddt(e),Bdt(),Fdt()])}const Vdt={};function NT(e){const n=this,t=e||Vdt,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Gdt(t)),i.push(fdt()),l.push(hdt(t))}function Wdt(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:l,mathTextData:o}};function e(c){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=d;const h=_.data.hChildren[0];h.type,h.tagName,h.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function l(c){const d=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=d,_.data.hChildren.push({type:"text",value:d})}function o(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function Kdt(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` -`,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,l,o,c){const d=i.value||"",_=o.createTracker(c),h="$".repeat(Math.max(oT(d,"$")+1,2)),m=o.enter("mathFlow");let g=_.move(h);if(i.meta){const S=o.enter("mathFlowMeta");g+=_.move(o.safe(i.meta,{after:` -`,before:g,encode:["$"],..._.current()})),S()}return g+=_.move(` -`),d&&(g+=_.move(d+` -`)),g+=_.move(h),m(),g}function r(i,l,o){let c=i.value||"",d=1;for(n||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(c);)d++;const _="$".repeat(d);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let h=-1;for(;++h]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}Xh.displayName="c";Xh.aliases=[];function Xh(e){e.register(Ya),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}jm.displayName="cpp";jm.aliases=[];function jm(e){e.register(Xh),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}t4.displayName="arduino";t4.aliases=["ino"];function t4(e){e.register(jm),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}n4.displayName="bash";n4.aliases=["sh","shell"];function n4(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],l=s.variable[1].inside,o=0;o>/g,function(X,V){return"(?:"+B[+V]+")"})}function r(L,B,X){return RegExp(t(L,B),"")}function s(L,B){for(var X=0;X>/g,function(){return"(?:"+L+")"});return L.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function l(L){return"\\b(?:"+L.trim().replace(/ /g,"|")+")\\b"}var o=l(i.typeDeclaration),c=RegExp(l(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),d=l(i.typeDeclaration+" "+i.contextual+" "+i.other),_=l(i.type+" "+i.typeDeclaration+" "+i.other),h=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),m=s(/\((?:[^()]|<>)*\)/.source,2),g=/@?\b[A-Za-z_]\w*\b/.source,S=t(/<<0>>(?:\s*<<1>>)?/.source,[g,h]),k=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[d,S]),v=/\[\s*(?:,\s*)*\]/.source,b=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,v]),x=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[h,m,v]),y=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[y,k,v]),j={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,M=/"(?:\\.|[^\\"\r\n])*"/.source,z=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[z]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[M]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[k]),lookbehind:!0,inside:j},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[g,C]),lookbehind:!0,inside:j},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[g]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,S]),lookbehind:!0,inside:j},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:j},{pattern:r(/(\bwhere\s+)<<0>>/.source,[g]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[b]),lookbehind:!0,inside:j},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,g]),inside:j}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[g]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[g]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[m]),lookbehind:!0,alias:"class-name",inside:j},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,k]),inside:j,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:j,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[g,h]),inside:{function:r(/^<<0>>/.source,[g]),generic:{pattern:RegExp(h),alias:"class-name",inside:j}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,S,g,C,c.source,m,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[S,m]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:c,"class-name":{pattern:RegExp(C),greedy:!0,inside:j},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var D=M+"|"+N,I=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[D]),$=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),P=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,F=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,$]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[P,F]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[P]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:n.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var W=/:[^}\r\n]+/.source,Z=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[I]),2),U=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Z,W]),Y=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[D]),2),J=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,W]);function H(L,B){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[L]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[B,W]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[U]),lookbehind:!0,greedy:!0,inside:H(U,Z)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[J]),lookbehind:!0,greedy:!0,inside:H(J,Y)}],char:{pattern:RegExp(N),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}Zh.displayName="markup";Zh.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function Zh(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var l={};l[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Dd.displayName="css";Dd.aliases=[];function Dd(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}s4.displayName="diff";s4.aliases=[];function s4(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r -?| -|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}i4.displayName="go";i4.aliases=[];function i4(e){e.register(Ya),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}a4.displayName="ini";a4.aliases=[];function a4(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}o4.displayName="java";o4.aliases=[];function o4(e){e.register(Ya),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}l4.displayName="regex";l4.aliases=[];function l4(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l="(?:[^\\\\-]|"+r.source+")",o=RegExp(l+"-"+l),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}c4.displayName="json";c4.aliases=["webmanifest"];function c4(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}u4.displayName="kotlin";u4.aliases=["kt","kts"];function u4(e){e.register(Ya),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}d4.displayName="less";d4.aliases=[];function d4(e){e.register(Dd),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}f4.displayName="lua";f4.aliases=[];function f4(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}h4.displayName="makefile";h4.aliases=[];function h4(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}_4.displayName="yaml";_4.aliases=["yml"];function _4(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),l=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,d){d=(d||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return c});return RegExp(_,d)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+l+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(l),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}p4.displayName="markdown";p4.aliases=["md"];function p4(e){e.register(Zh),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),l=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+l+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+l+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+l+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(n.languages.markdown[o].inside.content.inside[c]=n.languages.markdown[c])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(d){if(!(!d||typeof d=="string"))for(var _=0,h=d.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}g4.displayName="perl";g4.aliases=[];function g4(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}Tm.displayName="markup-templating";Tm.aliases=[];function Tm(e){e.register(Zh),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,l){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(c){if(typeof l=="function"&&!l(c))return c;for(var d=o.length,_;r.code.indexOf(_=t(s,d))!==-1;)++d;return o[d]=c,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,l=Object.keys(r.tokenStack);function o(c){for(var d=0;d=l.length);d++){var _=c[d];if(typeof _=="string"||_.content&&typeof _.content=="string"){var h=l[i],m=r.tokenStack[h],g=typeof _=="string"?_:_.content,S=t(s,h),k=g.indexOf(S);if(k>-1){++i;var v=g.substring(0,k),b=new n.Token(s,n.tokenize(m,r.grammar),"language-"+s,m),x=g.substring(k+S.length),y=[];v&&y.push.apply(y,o([v])),y.push(b),x&&y.push.apply(y,o([x])),typeof _=="string"?c.splice.apply(c,[d,1].concat(y)):_.content=y}}else _.content&&o(_.content)}return c}o(r.tokens)}}})})(e)}b4.displayName="php";b4.aliases=[];function b4(e){e.register(Tm),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,l=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:l};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:l}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(d){if(/<\?/.test(d.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(d,"php",_)}}),n.hooks.add("after-tokenize",function(d){n.languages["markup-templating"].tokenizePlaceholders(d,"php")})})(e)}v4.displayName="python";v4.aliases=["py"];function v4(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}x4.displayName="r";x4.aliases=[];function x4(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}y4.displayName="ruby";y4.aliases=["rb"];function y4(e){e.register(Ya),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}w4.displayName="rust";w4.aliases=[];function w4(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}S4.displayName="sass";S4.aliases=[];function S4(e){e.register(Dd),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}k4.displayName="scss";k4.aliases=[];function k4(e){e.register(Dd),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}C4.displayName="sql";C4.aliases=[];function C4(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}E4.displayName="swift";E4.aliases=[];function E4(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}N4.displayName="typescript";N4.aliases=["ts"];function N4(e){e.register(Am),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}Mm.displayName="basic";Mm.aliases=[];function Mm(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}z4.displayName="vbnet";z4.aliases=[];function z4(e){e.register(Mm),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const ift=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],U8={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function jT(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=48&&n<=57}function aft(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function oft(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function q8(e){return oft(e)||jT(e)}const lft=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function cft(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,l=-1,o="",c,d;t.position&&("start"in t.position||"indent"in t.position?(d=t.position.indent,c=t.position.start):c=t.position);let _=(c?c.line:0)||1,h=(c?c.column:0)||1,m=S(),g;for(i--;++i<=e.length;)if(g===10&&(h=(d?d[l]:0)||1),g=e.charCodeAt(i),g===38){const b=e.charCodeAt(i+1);if(b===9||b===10||b===12||b===32||b===38||b===60||Number.isNaN(b)||r&&b===r){o+=String.fromCharCode(g),h++;continue}const x=i+1;let y=x,C=x,j;if(b===35){C=++y;const F=e.charCodeAt(C);F===88||F===120?(j="hexadecimal",C=++y):j="decimal"}else j="named";let N="",M="",z="";const D=j==="named"?q8:j==="decimal"?jT:aft;for(C--;++C<=e.length;){const F=e.charCodeAt(C);if(!D(F))break;z+=String.fromCharCode(F),j==="named"&&ift.includes(z)&&(N=z,M=lh(z))}let I=e.charCodeAt(C)===59;if(I){C++;const F=j==="named"?lh(z):!1;F&&(N=z,M=F)}let $=1+C-x,P="";if(!(!I&&t.nonTerminated===!1))if(!z)j!=="named"&&k(4,$);else if(j==="named"){if(I&&!M)k(5,1);else if(N!==z&&(C=y+N.length,$=1+C-y,I=!1),!I){const F=N?1:3;if(t.attribute){const W=e.charCodeAt(C);W===61?(k(F,$),M=""):q8(W)?M="":k(F,$)}else k(F,$)}P=M}else{I||k(2,$);let F=Number.parseInt(z,j==="hexadecimal"?16:10);if(uft(F))k(7,$),P="�";else if(F in U8)k(6,$),P=U8[F];else{let W="";dft(F)&&k(6,$),F>65535&&(F-=65536,W+=String.fromCharCode(F>>>10|55296),F=56320|F&1023),P=W+String.fromCharCode(F)}}if(P){v(),m=S(),i=C-1,h+=C-x+1,s.push(P);const F=S();F.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,P,{start:m,end:F},e.slice(x-1,C)),m=F}else z=e.slice(x-1,C),o+=z,h+=z.length,i=C-1}else g===10&&(_++,l++,h=0),Number.isNaN(g)?v():(o+=String.fromCharCode(g),h++);return s.join("");function S(){return{line:_,column:h,offset:i+((c?c.offset:0)||0)}}function k(b,x){let y;t.warning&&(y=S(),y.column+=x,y.offset+=x,t.warning.call(t.warningContext||void 0,lft[b],y,b))}function v(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:m,end:S()}),o="")}}function uft(e){return e>=55296&&e<=57343||e>1114111}function dft(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var fft=0,O0={},Jr={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++fft}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(Jr.util.type(n)){case"Object":if(s=Jr.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=Jr.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(l,o){r[o]=e(l,t)}),r);default:return n}}},languages:{plain:O0,plaintext:O0,text:O0,txt:O0,extend:function(e,n){var t=Jr.util.clone(Jr.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||Jr.languages;var s=r[e],i={};for(var l in s)if(s.hasOwnProperty(l)){if(l==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(l)||(i[l]=s[l])}var c=r[e];return r[e]=i,Jr.languages.DFS(Jr.languages,function(d,_){_===c&&d!=e&&(this[d]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=Jr.util.objId;for(var l in n)if(n.hasOwnProperty(l)){t.call(n,l,n[l],r||l);var o=n[l],c=Jr.util.type(o);c==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):c==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,l,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(Jr.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Jr.tokenize(r.code,r.grammar),Jr.hooks.run("after-tokenize",r),Zf.stringify(Jr.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new hft;return op(s,s.head,e),AT(e,s,n,s.head,0),pft(s)},hooks:{all:{},add:function(e,n){var t=Jr.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=Jr.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:Zf};function Zf(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function G8(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function AT(e,n,t,r,s,i){for(var l in t)if(!(!t.hasOwnProperty(l)||!t[l])){var o=t[l];o=Array.isArray(o)?o:[o];for(var c=0;c=i.reach);b+=v.value.length,v=v.next){var x=v.value;if(n.length>e.length)return;if(!(x instanceof Zf)){var y=1,C;if(m){if(C=G8(k,b,e,h),!C||C.index>=e.length)break;var z=C.index,j=C.index+C[0].length,N=b;for(N+=v.value.length;z>=N;)v=v.next,N+=v.value.length;if(N-=v.value.length,b=N,v.value instanceof Zf)continue;for(var M=v;M!==n.tail&&(Ni.reach&&(i.reach=P);var F=v.prev;I&&(F=op(n,F,I),b+=I.length),_ft(n,F,y);var W=new Zf(l,_?Jr.tokenize(D,_):D,g,D);if(v=op(n,F,W),$&&op(n,v,$),y>1){var Z={cause:l+","+c,reach:P};AT(e,n,t,v.prev,b,Z),i&&Z.reach>i.reach&&(i.reach=Z.reach)}}}}}}function hft(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function op(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function _ft(e,n,t){for(var r=n.next,s=0;st)return null;try{return vt.highlight(e,n).children}catch{return null}}function DT(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:f.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(DT)},n)}function Sft(e,n,t=3e5){var r;return((r=RT(e,n,t))==null?void 0:r.map(DT))??e}function LT(e,n,t=3e5){const r=RT(e,n,t);if(!r)return e.split(` -`);const s=[];let i=[];const l=[];let o=0;const c=_=>{let h=_;for(let m=l.length-1;m>=0;m--)h=f.jsx("span",{className:l[m],children:h},o++);i.push(h)},d=_=>{var h;if(_.type==="text"){(_.value??"").split(` -`).forEach((m,g)=>{g>0&&(s.push(i),i=[]),m&&c(m)});return}_.type==="element"&&(l.push((((h=_.properties)==null?void 0:h.className)??[]).join(" ")),(_.children??[]).forEach(d),l.pop())};return r.forEach(d),s.push(i),s}function OT(e){return Array.isArray(e)?e.length===0:e===""}const V8=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function hd(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function fh(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function K2(e){var l;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const c=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!c)break;r+=c[0].length,t+=c[0].length,n=!0}const i=((l=/^[ \t]*/.exec(e.slice(r)))==null?void 0:l[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function kft(e,n){const t=e[n];if(t!=="`"&&t!=="~"||fh(e,n)||hd(e,n,t)<3)return!1;const r=e.lastIndexOf(` -`,n-1)+1,s=e.indexOf(` -`,n),i=e.slice(r,s===-1?e.length:s),l=K2(i);return l.indentation<=3&&r+l.offset===n}function Cft(e,n){const t=e[n],r=hd(e,n,t),s=e.lastIndexOf(` -`,n-1)+1,i=e.indexOf(` -`,n),l=K2(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` -`,n+r);if(o===-1)return e.length;for(o+=1;o=l.listIndent&&h.indentation<=l.listIndent+3&&g>=r&&/^[ \t\r]*$/.test(e.slice(m+g,d)))return c===-1?e.length:c+1;if(c===-1)return e.length;o=c+1}return e.length}function Eft(e,n,t){const r=hd(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function zft(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function Aft(e,{predictMath:n=!1}={}){const t=zft(e),r=new Set,s=new Set;for(let d=0;d`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),Aft(t,n)}function IT(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function Rft(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function zr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=Rft(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const Dft=1e5;function Lft({code:e,lang:n}){const[t,r]=T.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return f.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[f.jsx(qt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:oN(),"aria-label":$pe(),onClick:s,children:t?f.jsx(mi,{size:13}):f.jsx(sm,{size:13})}),f.jsx("pre",{children:f.jsx("code",{children:Sft(e,n,Dft)})})]})}function Oft(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function K8(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const l of n.matchAll(t)){const o=(l[1]??"").toLowerCase(),c=Oft(l[2]??"");if(!c[o==="run"?"id":"path"])continue;i=!0,l.index>s&&r.push({type:"text",value:n.slice(s,l.index),position:iv(e,s,l.index)});const _=l.index+l[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:c},position:iv(e,l.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sBT(e)}function Bft(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=Xj(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function X8({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,l=i!=null?`${s}:${i}`:s;return f.jsxs("button",{className:"file-chip",title:r?DB({path:Ee(e)}):e,...zr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[f.jsx(az,{size:12}),f.jsx("span",{className:"file-chip-label",children:l}),f.jsx(uz,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function $ft({id:e,label:n,onOpenRun:t}){return f.jsxs("button",{className:"file-chip run-chip",title:t?YB({id:Ee(e)}):S$({id:Ee(e)}),...zr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[f.jsx(ry,{size:12}),f.jsx("span",{className:"file-chip-label",children:n||WN()}),f.jsx(uz,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const $T={singleDollarTextMath:!0},Hft=Cy().use(My).use(NT).use(zT,$T).use(Ift).use(Rp).use(Bft).use(nT);function Pft(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const HT={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),l=String(t??"").replace(/\n$/,"");if(!(i!=null||l.includes(` -`)))return f.jsx("code",{className:s,...r,children:t});const c=i?V2(i[1]):null;return f.jsx(Lft,{code:l,lang:c})},pre:({children:e})=>f.jsx(f.Fragment,{children:e})},$a=T.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:l=!1}){qc();const o=T.useMemo(()=>({"file-mention":c=>f.jsx(X8,{path:c.path,lines:c.lines,exp:c.exp,onOpenFile:t}),"run-mention":c=>f.jsx($ft,{id:c.id,label:c.label,onOpenRun:r}),a:({node:c,href:d,children:_,...h})=>{if(d&&Pft(d)&&t){let m;try{m=decodeURI(d)}catch{return f.jsx("span",{children:_})}const g=s?s(m):m;return g?f.jsx(X8,{path:g,onOpenFile:t}):f.jsx("span",{children:_})}return f.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",...h,children:_})},th:({node:c,...d})=>f.jsx("th",{dir:"auto",...d}),td:({node:c,...d})=>f.jsx("td",{dir:"auto",...d}),img:({node:c,src:d,alt:_,className:h,...m})=>{if(!d||typeof d!="string")return null;const g=i?i(d):d;return g?f.jsx("img",{...m,src:g,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${h??""}`}):null},...HT}),[t,r,s,i]);return f.jsx("div",{dir:"auto","data-streaming":l||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:f.jsx(not,{content:IT(n,{predictMath:l}),processor:Hft,components:o,predict:l})})}),Z8="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function Fft({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:l}){const[o,c]=T.useState(!1),d=T.useRef(null),[_,h]=T.useState(!1),[m,g]=T.useState(""),S=T.useRef(null);T.useEffect(()=>{if(!o)return;const v=b=>{d.current&&!d.current.contains(b.target)&&c(!1)};return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[o]),T.useEffect(()=>{var v;_&&((v=S.current)==null||v.focus())},[_]);const k=()=>{l(m.trim()||"no specific feedback — use your judgment"),g(""),h(!1)};return f.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[f.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[f.jsx(ry,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),f.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?F5e({agent:Ee(n)}):B5e({agent:Ee(n)})}),f.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...zr(t),children:e3e()})]}),_?f.jsxs(f.Fragment,{children:[f.jsx("textarea",{dir:"auto",ref:S,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:m3e(),rows:2,value:m,onChange:v=>g(v.target.value),onKeyDown:v=>{v.key==="Escape"?(v.preventDefault(),g(""),h(!1)):v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),k())}}),f.jsxs("div",{className:Z8,children:[f.jsx(He,{size:"small",onClick:()=>{g(""),h(!1)},children:V5e()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),f.jsxs(He,{size:"small",variant:"primary",onClick:k,children:[l3e(),f.jsx(iz,{size:13})]})]})]}):f.jsxs("div",{className:Z8,children:[f.jsx(He,{size:"small",onClick:i,children:s3e()}),f.jsx(He,{size:"small",onClick:()=>h(!0),children:f3e()}),f.jsx("span",{className:"plan-strip-spacer flex-1"}),s?f.jsxs("div",{className:"plan-strip-approve relative flex",ref:d,children:[f.jsx(He,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:E5e()}),f.jsx(He,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":X5e(),onClick:()=>c(v=>!v),children:f.jsx(Ua,{size:13})}),o&&f.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:f.jsx(Nr,{onClick:()=>{c(!1),r("bypassPermissions")},children:A5e()})})]}):f.jsx(He,{size:"small",variant:"primary",onClick:()=>r(),children:D5e()})]})]})}function PT(e=!0){const[n,t]=T.useState(null),[r,s]=T.useState(null);return T.useEffect(()=>{if(!e)return;let i=!1;const l=ket(o=>{i=!0,t(o)});return Sz().then(o=>!i&&t(o)).catch(o=>s(o instanceof Error?o.message:String(o))),l},[e]),{status:n,error:r,apply:t}}const Uft=6e4,qft=500;function FT(e){const[n,t]=T.useState(!1),[r,s]=T.useState(null),i=T.useRef(!1);T.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const l=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{!l||n||(t(!0),s(null),(async()=>{try{await XQe();const c=Date.now()+Uft;for(;Date.now()setTimeout(_,qft));const d=await Sz().catch(()=>null);if(d&&d.instance!==l){window.location.reload();return}}throw new Error(KKe())}catch(c){if(i.current)return;s(c instanceof Error?c.message:String(c)),t(!1)}})())}}}function Q8({status:e}){const[n,t]=T.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:l}=FT(e);return!r||n===r?null:f.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[f.jsx(ua,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),f.jsx("span",{className:"min-w-0",children:i?YN({error:i}):DKe({version:Ee(r)})}),(e==null?void 0:e.canRestart)&&f.jsx(He,{type:"button",size:"small",disabled:s,onClick:l,children:s?XN():KN()}),f.jsx(qt,{type:"button",size:"small",className:"ms-auto","aria-label":BKe(),disabled:s,onClick:()=>t(r),children:f.jsx(Br,{size:13})})]})}function Gft({save:e,onSaved:n,placeholder:t,createHref:r}){const[s,i]=T.useState(""),[l,o]=T.useState(!1),[c,d]=T.useState(null);async function _(h){if(h.preventDefault(),!(l||!s.trim())){o(!0),d(null);try{n(await e(s.trim())),i("")}catch(m){d(m instanceof Error?m.message:String(m))}finally{o(!1)}}}return f.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[f.jsx("input",{type:"password",value:s,onChange:h=>i(h.target.value),placeholder:t,autoComplete:"off"}),f.jsx(He,{type:"submit",disabled:l||!s.trim(),children:l?qi():Fa()}),f.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:e0e()}),c&&f.jsx("div",{className:"error",children:c})]})}function Vft({cmd:e}){const[n,t]=T.useState(!1);return f.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[f.jsx("code",{className:"font-mono text-sm",children:e}),f.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?nh():ZI({value:Ee(e)}),title:n?nh():oN(),children:n?f.jsx(mi,{size:11,strokeWidth:3}):f.jsx(sm,{size:11})})]})}function Qh(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?f.jsx(Vft,{cmd:n},t):n):null}const Wft="/assets/slurm-logo-aGSXVZcE.svg",Kft="/assets/thinking-machines-BOdslTfm.png";function Yft(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return rN();case"tinker_job":return"Tinker";default:return e||"—"}}function Xft({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[f.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),f.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),f.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),f.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),f.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),f.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),f.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function Zft({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[f.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),f.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),f.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),f.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),f.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),f.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),f.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),f.jsxs("defs",{children:[f.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),f.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#BFF9B4"}),f.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),f.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[f.jsx("stop",{stopColor:"#80EE64"}),f.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),f.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),f.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),f.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),f.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),f.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function Qft({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:f.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Jft({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:f.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function eht({size:e=16}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[f.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),f.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function tht({size:e=16}){return f.jsx("img",{className:"tinker-logo block flex-none object-contain",src:Kft,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function nht({size:e=16}){return f.jsx("img",{className:"block flex-none object-contain",src:Wft,width:e,height:e,alt:"","aria-hidden":"true"})}function Rm({size:e=16}){return f.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function Jh({kind:e,size:n=16}){switch(e){case"modal_job":return f.jsx(Zft,{size:n});case"hf_job":return f.jsx(Xft,{size:n});case"k8s_job":return f.jsx(Qft,{size:n});case"ssh_job":return f.jsx(kS,{size:n,strokeWidth:1.5});case"slurm_job":return f.jsx(nht,{size:n});case"ray_job":return f.jsx(Jft,{size:n});case"openresearch_job":return f.jsx(eht,{size:n});case"tinker_job":return f.jsx(tht,{size:n});case"local_job":return f.jsx(wZe,{size:n,strokeWidth:1.5});default:return f.jsx(kS,{size:n})}}function A4({backend:e}){const n=oy(e),t=oet(e);return n?f.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[f.jsx(Jh,{kind:n}),f.jsx("span",{className:"backend-name",children:Yft(n)}),t&&f.jsx("span",{className:"backend-detail text-sm",children:t})]}):f.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function UT({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return f.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[f.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:f.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&f.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[f.jsx("span",{children:t??`${i}%`}),r]})]})}function Y2({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:f.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?f.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):f.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:f.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const qT=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),J8=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),Pf={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function rht(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:Cp(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:cm(n,t).defaultId}}function da(e){const[n,t]=T.useState(!1),r=T.useRef(null);return T.useEffect(()=>{if(!n)return;const s=l=>{var o,c;l.target instanceof Node&&!((o=r.current)!=null&&o.contains(l.target))&&!((c=e==null?void 0:e.current)!=null&&c.contains(l.target))&&t(!1)},i=l=>{var o;l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function sht({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:l,onSelectReasoning:o,onHarnesses:c,lockHarness:d=!1,className:_}){var oe,se,G,ne,le,_e;const[h,m]=T.useState([]),g=T.useRef(null),S=T.useRef(null),{open:k,setOpen:v,ref:b}=da(g),[x,y]=T.useState(""),[C,j]=T.useState("root"),N=()=>{v(!1),j("root"),y("")};T.useEffect(()=>{var ue;k&&(C==="reasoning"||C==="speed"||C==="permissions")&&((ue=S.current)==null||ue.focus())},[k,C]),T.useEffect(()=>{let ue=!0;const ze=(Ie=!1)=>Ep(Ie).then(qe=>{ue&&(m(qe),c==null||c(qe))}).catch(()=>{});ze();const Ne=uy(()=>void ze(!0));return()=>{ue=!1,Ne()}},[]);const M=T.useMemo(()=>{const ue=x.trim().toLowerCase();return(d&&e?h.filter(Ne=>Ne.id===e.harness):h).map(Ne=>{let Ie=Ne.models;return ue?Ie=Ie.filter(qe=>qe.id.toLowerCase().includes(ue)):Ne.id==="opencode"&&(Ie=Ie.slice(0,6)),{harness:Ne,models:Ie,hidden:ue?0:Ne.models.length-Ie.length}})},[h,x,d,e]),z=(ue,ze)=>{var Ie;const Ne=(e==null?void 0:e.harness)===ue.id;n({harness:ue.id,model:ze,serviceTier:Cp(ue,ze,Ne?e==null?void 0:e.serviceTier:null),permissionMode:Ne?e.permissionMode:((Ie=ue.options)==null?void 0:Ie.defaultPermissionMode)??null,reasoningLevel:Rz(ue,ze,Ne?e.reasoningLevel:null)}),N()},D=(e==null?void 0:e.model)!=null?(oe=h.find(ue=>ue.id===e.harness))==null?void 0:oe.models.find(ue=>ue.id===e.model):void 0,I=e?e.model?D?Sp(D):Dz(e.model):P7():pb(),$=(e==null?void 0:e.reasoningLevel)??l??((se=i[0])==null?void 0:se.id),P=(G=i.find(ue=>ue.id===$))==null?void 0:G.label,F=(e==null?void 0:e.permissionMode)??r??((ne=t[0])==null?void 0:ne.id),W=(le=t.find(ue=>ue.id===F))==null?void 0:le.label,Z=(e==null?void 0:e.harness)==="opencode"?Yme():cme(),U=h.find(ue=>ue.id===(e==null?void 0:e.harness)),Y=Mz(U,e==null?void 0:e.model),J=Cp(U,e==null?void 0:e.model,e==null?void 0:e.serviceTier),H=(_e=Y.find(ue=>ue.id===J))==null?void 0:_e.label,L=ue=>{o==null||o(ue),N()},B=ue=>{s==null||s(ue),N()},X=ue=>{e&&n({...e,serviceTier:ue}),N()},V=(ue,ze,Ne)=>f.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>j(Ne),children:[f.jsx("span",{className:"flex-1",children:ue}),ze&&f.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:ze}),f.jsx(qa,{size:14,className:"shrink-0 text-muted"})]}),ae=ue=>f.jsxs("button",{ref:S,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{j("root"),y("")},children:[f.jsx(tz,{size:15}),ue]}),ce=(ue,ze,Ne,Ie)=>f.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ue.map(qe=>f.jsxs(Nr,{onClick:()=>Ie(qe.id),children:[f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[qe.label,qe.id===Ne&&f.jsxs("span",{className:"font-normal text-muted",children:[" ",uN()]})]}),qe.description&&f.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:qe.description})]}),qe.id===ze&&f.jsx(mi,{size:13})]},qe.id))});return f.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:b,children:[f.jsxs("button",{ref:g,type:"button",className:ls("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",_),title:LI({label:`${I}${P?` · ${P}`:""}${H?` · ${H}`:""}`}),"aria-haspopup":"menu","aria-expanded":k,onClick:()=>{k?N():(j("root"),v(!0))},children:[J==="priority"?f.jsx(hQe,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?f.jsx(Y2,{harness:e.harness,size:14}):null,J==="priority"&&f.jsxs("span",{className:"sr-only",children:[hme()," "]}),f.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[I,P&&f.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:P})]}),f.jsx(Ua,{size:14,className:"shrink-0 text-muted"})]}),k&&f.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[C==="root"&&f.jsxs("div",{className:"model-root-menu p-1",children:[V(pb(),I,"models"),i.length>0&&V(Z,P,"reasoning"),Y.length>0&&V(U7(),H,"speed"),t.length>0&&V(F7(),W,"permissions")]}),C==="models"&&f.jsxs(f.Fragment,{children:[ae(pb()),f.jsx("input",{autoFocus:!0,type:"text",placeholder:Tme(),value:x,onChange:ue=>y(ue.target.value)}),f.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[M.map(({harness:ue,models:ze,hidden:Ne})=>f.jsxs("div",{className:"[&_.model-item]:ps-6",children:[f.jsxs("div",{className:qT,children:[f.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[f.jsx(Y2,{harness:ue.id,size:14}),ue.name]}),!ue.agentReady&&f.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[f.jsx(SS,{size:10})," ",dN()]})]}),ue.agentReady?f.jsxs(f.Fragment,{children:[ue.models.length===0&&f.jsxs(Nr,{onClick:()=>z(ue,null),children:[f.jsxs("span",{children:[P7(),f.jsx("span",{className:"model-id",children:cN()})]}),(e==null?void 0:e.harness)===ue.id&&(e==null?void 0:e.model)===null&&f.jsx(mi,{size:13})]}),ze.map(Ie=>f.jsxs(Nr,{title:Ie.id,onClick:()=>z(ue,Ie.id),children:[f.jsx("span",{children:Sp(Ie)}),(e==null?void 0:e.harness)===ue.id&&(e==null?void 0:e.model)===Ie.id&&f.jsx(mi,{size:13})]},Ie.id)),Ne>0&&f.jsx("div",{className:J8,children:Sme({count:Gt(Ne)})}),x.trim().length>0&&!ue.models.some(Ie=>Ie.id===x.trim())&&f.jsx(Nr,{onClick:()=>z(ue,x.trim()),children:f.jsx("span",{children:Gme({id:Ee(x.trim())})})})]}):f.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ue.agentNote?Qh(ue.agentNote):Nme()})]},ue.id)),h.length===0&&f.jsx("div",{className:J8,children:ime()})]}),d&&e&&h.length>1&&f.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-sm text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[f.jsx(SS,{size:11}),Lme()]})]}),C==="reasoning"&&f.jsxs(f.Fragment,{children:[ae(Z),ce(i,$,l,L)]}),C==="permissions"&&f.jsxs(f.Fragment,{children:[ae(F7()),ce(t,F,r,B)]}),C==="speed"&&f.jsxs(f.Fragment,{children:[ae(U7()),ce(Y,J??void 0,"default",X)]})]})]})}function hh({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:l=!1,variant:o="pill",title:c,numbered:d=!1,renderIcon:_,onSelect:h,className:m}){var M,z;const{open:g,setOpen:S,ref:k}=da();if(e.length===0)return null;const v=n??t??((M=e[0])==null?void 0:M.id)??null,b=e.find(D=>D.id===v),x=e.find(D=>D.id===t),y=o==="bare"&&(x==null?void 0:x.id)===kp?x:void 0,C=y?e.filter(D=>D.id!==y.id):e,j=(b==null?void 0:b.label)??((z=e[0])==null?void 0:z.label)??"",N=D=>{h(D),S(!1)};return f.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:k,children:[f.jsxs("button",{type:"button",className:ls(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,m),title:c,"aria-haspopup":"menu","aria-expanded":g,disabled:l,onClick:()=>S(D=>!D),children:[f.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[b&&(_==null?void 0:_(b)),f.jsx("span",{className:"truncate",children:j})]}),f.jsx(Ua,{size:12})]}),g&&f.jsxs("div",{className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(D=>D.description)?"min-w-80":""} ${o==="field"?"min-w-full":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&f.jsx("div",{className:qT,children:r}),y&&f.jsxs(f.Fragment,{children:[f.jsxs(Nr,{type:"button",onClick:()=>N(y.id),children:[f.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(y),f.jsxs("span",{children:[y.label,f.jsx("span",{className:"option-default text-muted font-normal",children:cN()})]})]}),v===y.id&&f.jsx(mi,{size:13})]}),f.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),C.map((D,I)=>f.jsxs(Nr,{type:"button",onClick:()=>N(D.id),children:[f.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(D),f.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[f.jsxs("span",{children:[D.label,!y&&D.id===t&&f.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",uN()]})]}),D.description&&f.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:D.description})]})]}),v===D.id?f.jsx(mi,{size:13}):d&&f.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:I+1})]},D.id))]})]})}const eC={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function iht(e){return eC[e]??eC.idle}const aht={done:nGe,failed:uGe,running:bGe,starting:wGe,cancelling:Qqe,cancelled:Kqe,editing:aGe,idle:_Ge};function GT(e){const n=aht[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function zo({status:e,label:n,className:t}){const r=iht(e);return f.jsx(_y,{tone:r.tone,live:r.live,className:t,children:n??GT(e)})}var av={exports:{}},tC;function oht(){return tC||(tC=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const l=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),d=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),h=c-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),m=d-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-l;return{cols:Math.max(2,Math.floor(m/i.css.cell.width)),rows:Math.max(1,Math.floor(h/i.css.cell.height))}}}})(),t})()))})(av)),av.exports}var lht=oht(),ov={exports:{}},nC;function cht(){return nC||(nC=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(l,o)=>{function c(_){try{const h=new URL(_),m=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return _.toLocaleLowerCase().startsWith(m.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,h,m,g={}){this._terminal=_,this._regex=h,this._handler=m,this._options=g}provideLinks(_,h){const m=d.computeLink(_,this._regex,this._terminal,this._handler);h(this._addCallbacks(m))}_addCallbacks(_){return _.map((h=>(h.leave=this._options.leave,h.hover=(m,g)=>{if(this._options.hover){const{range:S}=h;this._options.hover(m,g,S)}},h)))}};class d{static computeLink(h,m,g,S){const k=new RegExp(m.source,(m.flags||"")+"g"),[v,b]=d._getWindowedLineStrings(h-1,g),x=v.join("");let y;const C=[];for(;y=k.exec(x);){const j=y[0];if(!c(j))continue;const[N,M]=d._mapStrIdx(g,b,0,y.index),[z,D]=d._mapStrIdx(g,N,M,j.length);if(N===-1||M===-1||z===-1||D===-1)continue;const I={start:{x:M+1,y:N+1},end:{x:D,y:z+1}};C.push({range:I,text:j,activate:S})}return C}static _getWindowedLineStrings(h,m){let g,S=h,k=h,v=0,b="";const x=[];if(g=m.buffer.active.getLine(h)){const y=g.translateToString(!0);if(g.isWrapped&&y[0]!==" "){for(v=0;(g=m.buffer.active.getLine(--S))&&v<2048&&(b=g.translateToString(!0),v+=b.length,x.push(b),g.isWrapped&&b.indexOf(" ")===-1););x.reverse()}for(x.push(y),v=0;(g=m.buffer.active.getLine(++k))&&g.isWrapped&&v<2048&&(b=g.translateToString(!0),v+=b.length,x.push(b),b.indexOf(" ")===-1););}return[x,S]}static _mapStrIdx(h,m,g,S){const k=h.buffer.active,v=k.getNullCell();let b=g;for(;S;){const x=k.getLine(m);if(!x)return[-1,-1];for(let y=b;y{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.WebLinksAddon=void 0;const o=s(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(_,h){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}l.WebLinksAddon=class{constructor(_=d,h={}){this._handler=_,this._options=h}activate(_){this._terminal=_;const h=this._options,m=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,m,this._handler,h))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(ov)),ov.exports}var uht=cht(),lv={exports:{}},rC;function dht(){return rC||(rC=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(l,o,c){var d=this&&this.__decorate||function(x,y,C,j){var N,M=arguments.length,z=M<3?y:j===null?j=Object.getOwnPropertyDescriptor(y,C):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(x,y,C,j);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(z=(M<3?N(z):M>3?N(y,C,z):N(y,C))||z);return M>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(x,y){return function(C,j){y(C,j,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const h=c(9042),m=c(9924),g=c(844),S=c(4725),k=c(2585),v=c(3656);let b=o.AccessibilityManager=class extends g.Disposable{constructor(x,y,C,j){super(),this._terminal=x,this._coreBrowserService=C,this._renderService=j,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` -`)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,g.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let y=0;y0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,y){this._liveRegionDebouncer.refresh(x,y,this._terminal.rows)}_renderRows(x,y){const C=this._terminal.buffer,j=C.lines.length.toString();for(let N=x;N<=y;N++){const M=C.lines.get(C.ydisp+N),z=[],D=(M==null?void 0:M.translateToString(!0,void 0,void 0,z))||"",I=(C.ydisp+N+1).toString(),$=this._rowElements[N];$&&(D.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=D,this._rowColumns.set($,z)),$.setAttribute("aria-posinset",I),$.setAttribute("aria-setsize",j))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,y){const C=x.target,j=this._rowElements[y===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==j)return;let N,M;if(y===0?(N=C,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(N=this._rowElements.shift(),M=C,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const z=this._createAccessibilityTreeNode();this._rowElements.unshift(z),this._rowContainer.insertAdjacentElement("afterbegin",z)}else{const z=this._createAccessibilityTreeNode();this._rowElements.push(z),this._rowContainer.appendChild(z)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var D;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:x.anchorNode,offset:x.anchorOffset},C={node:x.focusNode,offset:x.focusOffset};if((y.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===C.node&&y.offset>C.offset)&&([y,C]=[C,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const j=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(j)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:j,offset:((D=j.textContent)==null?void 0:D.length)??0}),!this._rowContainer.contains(C.node))return;const N=({node:I,offset:$})=>{const P=I instanceof Text?I.parentNode:I;let F=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const W=this._rowColumns.get(P);if(!W)return console.warn("columns is null. Race condition?"),null;let Z=$=this._terminal.cols&&(++F,Z=0),{row:F,column:Z}},M=N(y),z=N(C);if(M&&z){if(M.row>z.row||M.row===z.row&&M.column>=z.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(z.row-M.row)*this._terminal.cols-M.column+z.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;yx;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x{function c(m){return m.replace(/\r?\n/g,"\r")}function d(m,g){return g?"\x1B[200~"+m+"\x1B[201~":m}function _(m,g,S,k){m=d(m=c(m),S.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),S.triggerDataEvent(m,!0),g.value=""}function h(m,g,S){const k=S.getBoundingClientRect(),v=m.clientX-k.left-10,b=m.clientY-k.top-10;g.style.width="20px",g.style.height="20px",g.style.left=`${v}px`,g.style.top=`${b}px`,g.style.zIndex="1000",g.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=d,o.copyHandler=function(m,g){m.clipboardData&&m.clipboardData.setData("text/plain",g.selectionText),m.preventDefault()},o.handlePasteEvent=function(m,g,S,k){m.stopPropagation(),m.clipboardData&&_(m.clipboardData.getData("text/plain"),g,S,k)},o.paste=_,o.moveTextAreaUnderMouseCursor=h,o.rightClickHandler=function(m,g,S,k,v){h(m,g,S),v&&k.rightClickSelect(m),g.value=k.selectionText,g.select()}},7239:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const d=c(1505);o.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,h,m){this._css.set(_,h,m)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,m){this._color.set(_,h,m)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,d,_,h){c.addEventListener(d,_,h);let m=!1;return{dispose:()=>{m||(m=!0,c.removeEventListener(d,_,h))}}}},3551:function(l,o,c){var d=this&&this.__decorate||function(b,x,y,C){var j,N=arguments.length,M=N<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,x,y,C);else for(var z=b.length-1;z>=0;z--)(j=b[z])&&(M=(N<3?j(M):N>3?j(x,y,M):j(x,y))||M);return N>3&&M&&Object.defineProperty(x,y,M),M},_=this&&this.__param||function(b,x){return function(y,C){x(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const h=c(3656),m=c(8460),g=c(844),S=c(2585),k=c(4725);let v=o.Linkifier=class extends g.Disposable{get currentLink(){return this._currentLink}constructor(b,x,y,C,j){super(),this._element=b,this._mouseService=x,this._renderService=y,this._bufferService=C,this._linkProviderService=j,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,g.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,g.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const x=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const y=b.composedPath();for(let C=0;C{N==null||N.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let y=!1;for(const[N,M]of this._linkProviderService.linkProviders.entries())x?(j=this._activeProviderReplies)!=null&&j.get(N)&&(y=this._checkLinkProviderResult(N,b,y)):M.provideLinks(b.y,(z=>{var I,$;if(this._isMouseOut)return;const D=z==null?void 0:z.map((P=>({link:P})));(I=this._activeProviderReplies)==null||I.set(N,D),y=this._checkLinkProviderResult(N,b,y),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,x){const y=new Set;for(let C=0;Cb?this._bufferService.cols:M.link.range.end.x;for(let I=z;I<=D;I++){if(y.has(I)){j.splice(N--,1);break}y.add(I)}}}}_checkLinkProviderResult(b,x,y){var N;if(!this._activeProviderReplies)return y;const C=this._activeProviderReplies.get(b);let j=!1;for(let M=0;Mthis._linkAtPosition(z.link,x)));M&&(y=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let M=0;Mthis._linkAtPosition(D.link,x)));if(z){y=!0,this._handleNewLink(z);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const x=this._positionFromMouseEvent(b,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,x){this._currentLink&&this._lastMouseEvent&&(!b||!x||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,g.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(b.link,x)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.pointerCursor},set:y=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,C;return(C=(y=this._currentLink)==null?void 0:y.state)==null?void 0:C.decorations.underline},set:y=>{var C,j,N;(C=this._currentLink)!=null&&C.state&&((N=(j=this._currentLink)==null?void 0:j.state)==null?void 0:N.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const C=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,j=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=j&&(this._clearCurrentLink(C,j),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(b,x,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(y,x.text)}_fireUnderlineEvent(b,x){const y=b.range,C=this._bufferService.buffer.ydisp,j=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-C-1,y.end.x,y.end.y-C-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(j)}_linkLeave(b,x,y){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(y,x.text)}_linkAtPosition(b,x){const y=b.range.start.y*this._bufferService.cols+b.range.start.x,C=b.range.end.y*this._bufferService.cols+b.range.end.x,j=x.y*this._bufferService.cols+x.x;return y<=j&&j<=C}_positionFromMouseEvent(b,x,y){const C=y.getCoords(b,x,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,x,y,C,j){return{x1:b,y1:x,x2:y,y2:C,cols:this._bufferService.cols,fg:j}}};o.Linkifier=v=d([_(1,k.IMouseService),_(2,k.IRenderService),_(3,S.IBufferService),_(4,k.ILinkProviderService)],v)},9042:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,o,c){var d=this&&this.__decorate||function(k,v,b,x){var y,C=arguments.length,j=C<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(k,v,b,x);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(j=(C<3?y(j):C>3?y(v,b,j):y(v,b))||j);return C>3&&j&&Object.defineProperty(v,b,j),j},_=this&&this.__param||function(k,v){return function(b,x){v(b,x,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const h=c(511),m=c(2585);let g=o.OscLinkProvider=class{constructor(k,v,b){this._bufferService=k,this._optionsService=v,this._oscLinkService=b}provideLinks(k,v){var D;const b=this._bufferService.buffer.lines.get(k-1);if(!b)return void v(void 0);const x=[],y=this._optionsService.rawOptions.linkHandler,C=new h.CellData,j=b.getTrimmedLength();let N=-1,M=-1,z=!1;for(let I=0;Iy?y.activate(W,Z,P):S(0,Z),hover:(W,Z)=>{var U;return(U=y==null?void 0:y.hover)==null?void 0:U.call(y,W,Z,P)},leave:(W,Z)=>{var U;return(U=y==null?void 0:y.leave)==null?void 0:U.call(y,W,Z,P)}})}z=!1,C.hasExtendedAttrs()&&C.extended.urlId?(M=I,N=C.extended.urlId):(M=-1,N=-1)}}v(x)}};function S(k,v){if(confirm(`Do you want to navigate to ${v}? - -WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=g=d([_(0,m.IBufferService),_(1,m.IOptionsService),_(2,m.IOscLinkService)],g)},6193:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,d,_){this._rowCount=_,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const d=c(3614),_=c(3656),h=c(3551),m=c(9042),g=c(3730),S=c(1680),k=c(3107),v=c(5744),b=c(2950),x=c(1296),y=c(428),C=c(4269),j=c(5114),N=c(8934),M=c(3230),z=c(9312),D=c(4725),I=c(6731),$=c(8055),P=c(8969),F=c(8460),W=c(844),Z=c(6114),U=c(8437),Y=c(2584),J=c(7399),H=c(5941),L=c(9074),B=c(2585),X=c(5435),V=c(4567),ae=c(779);class ce extends P.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(se={}){super(se),this.browser=Z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(D.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(g.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((G,ne)=>this.refresh(G,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((G=>this._reportWindowsOptions(G)))),this.register(this._inputHandler.onColor((G=>this._handleColorEvent(G)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((G=>this._afterResize(G.cols,G.rows)))),this.register((0,W.toDisposable)((()=>{var G,ne;this._customKeyEventHandler=void 0,(ne=(G=this.element)==null?void 0:G.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(se){if(this._themeService)for(const G of se){let ne,le="";switch(G.index){case 256:ne="foreground",le="10";break;case 257:ne="background",le="11";break;case 258:ne="cursor",le="12";break;default:ne="ansi",le="4;"+G.index}switch(G.type){case 0:const _e=$.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${le};${(0,H.toRgbString)(_e)}${Y.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((ue=>ue.ansi[G.index]=$.channels.toColor(...G.color)));else{const ue=ne;this._themeService.modifyColors((ze=>ze[ue]=$.channels.toColor(...G.color)))}break;case 2:this._themeService.restoreColor(G.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(se){se?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(se){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var se;return(se=this.textarea)==null?void 0:se.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const se=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(se);if(!G)return;const ne=Math.min(this.buffer.x,this.cols-1),le=this._renderService.dimensions.css.cell.height,_e=G.getWidth(ne),ue=this._renderService.dimensions.css.cell.width*_e,ze=this.buffer.y*this._renderService.dimensions.css.cell.height,Ne=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ne+"px",this.textarea.style.top=ze+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=le+"px",this.textarea.style.lineHeight=le+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(G=>{this.hasSelection()&&(0,d.copyHandler)(G,this._selectionService)})));const se=G=>(0,d.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",se)),this.register((0,_.addDisposableDomListener)(this.element,"paste",se)),Z.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(G=>{G.button===2&&(0,d.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(G=>{(0,d.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Z.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(G=>{G.button===1&&(0,d.moveTextAreaUnderMouseCursor)(G,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(se=>this._keyUp(se)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(se=>this._keyDown(se)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(se=>this._keyPress(se)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(se=>this._compositionHelper.compositionupdate(se)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(se=>this._inputEvent(se)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(se){var ne;if(!se)throw new Error("Terminal requires a parent element.");if(se.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ne=this.element)==null?void 0:ne.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=se.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),se.appendChild(this.element);const G=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),Z.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(j.CoreBrowserService,this.textarea,se.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(D.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(D.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(D.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(D.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(D.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(D.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(S.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(z.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(D.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(k.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const se=this,G=this.element;function ne(ue){const ze=se._mouseService.getMouseReportCoords(ue,se.screenElement);if(!ze)return!1;let Ne,Ie;switch(ue.overrideType||ue.type){case"mousemove":Ie=32,ue.buttons===void 0?(Ne=3,ue.button!==void 0&&(Ne=ue.button<3?ue.button:3)):Ne=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":Ie=0,Ne=ue.button<3?ue.button:3;break;case"mousedown":Ie=1,Ne=ue.button<3?ue.button:3;break;case"wheel":if(se._customWheelEventHandler&&se._customWheelEventHandler(ue)===!1||se.viewport.getLinesScrolled(ue)===0)return!1;Ie=ue.deltaY<0?0:1,Ne=4;break;default:return!1}return!(Ie===void 0||Ne===void 0||Ne>4)&&se.coreMouseService.triggerMouseEvent({col:ze.col,row:ze.row,x:ze.x,y:ze.y,button:Ne,action:Ie,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const le={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:ue=>(ne(ue),ue.buttons||(this._document.removeEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.removeEventListener("mousemove",le.mousedrag)),this.cancel(ue)),wheel:ue=>(ne(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&ne(ue)},mousemove:ue=>{ue.buttons||ne(ue)}};this.register(this.coreMouseService.onProtocolChange((ue=>{ue?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ue)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ue?le.mousemove||(G.addEventListener("mousemove",_e.mousemove),le.mousemove=_e.mousemove):(G.removeEventListener("mousemove",le.mousemove),le.mousemove=null),16&ue?le.wheel||(G.addEventListener("wheel",_e.wheel,{passive:!1}),le.wheel=_e.wheel):(G.removeEventListener("wheel",le.wheel),le.wheel=null),2&ue?le.mouseup||(le.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",le.mouseup),le.mouseup=null),4&ue?le.mousedrag||(le.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",le.mousedrag),le.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(G,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return ne(ue),le.mouseup&&this._document.addEventListener("mouseup",le.mouseup),le.mousedrag&&this._document.addEventListener("mousemove",le.mousedrag),this.cancel(ue)}))),this.register((0,_.addDisposableDomListener)(G,"wheel",(ue=>{if(!le.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ue)===!1)return!1;if(!this.buffer.hasScrollback){const ze=this.viewport.getLinesScrolled(ue);if(ze===0)return;const Ne=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let Ie="";for(let qe=0;qe{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(G,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(se,G){var ne;(ne=this._renderService)==null||ne.refreshRows(se,G)}updateCursorStyle(se){var G;(G=this._selectionService)!=null&&G.shouldColumnSelect(se)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(se,G,ne=0){var le;ne===1?(super.scrollLines(se,G,ne),this.refresh(0,this.rows-1)):(le=this.viewport)==null||le.scrollLines(se)}paste(se){(0,d.paste)(se,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(se){this._customKeyEventHandler=se}attachCustomWheelEventHandler(se){this._customWheelEventHandler=se}registerLinkProvider(se){return this._linkProviderService.registerLinkProvider(se)}registerCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(se);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(se)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(se){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+se)}registerDecoration(se){return this._decorationService.registerDecoration(se)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(se,G,ne){this._selectionService.setSelection(se,G,ne)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var se;(se=this._selectionService)==null||se.clearSelection()}selectAll(){var se;(se=this._selectionService)==null||se.selectAll()}selectLines(se,G){var ne;(ne=this._selectionService)==null||ne.selectLines(se,G)}_keyDown(se){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&se.altKey;if(!G&&!this._compositionHelper.keydown(se))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||se.key!=="Dead"&&se.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,J.evaluateKeyboardEvent)(se,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(se),ne.type===3||ne.type===2){const le=this.rows-1;return this.scrollLines(ne.type===2?-le:le),this.cancel(se,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,se)||(ne.cancel&&this.cancel(se,!0),!ne.key||!!(se.key&&!se.ctrlKey&&!se.altKey&&!se.metaKey&&se.key.length===1&&se.key.charCodeAt(0)>=65&&se.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==Y.C0.ETX&&ne.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||se.altKey||se.ctrlKey?this.cancel(se,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(se,G){const ne=se.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||se.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||se.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?ne:ne&&(!G.keyCode||G.keyCode>47)}_keyUp(se){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(se)||this.focus(),this.updateCursorStyle(se),this._keyPressHandled=!1)}_keyPress(se){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;if(this.cancel(se),se.charCode)G=se.charCode;else if(se.which===null||se.which===void 0)G=se.keyCode;else{if(se.which===0||se.charCode===0)return!1;G=se.which}return!(!G||(se.altKey||se.ctrlKey||se.metaKey)&&!this._isThirdLevelShift(this.browser,se)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(se){if(se.data&&se.inputType==="insertText"&&(!se.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=se.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(se),!0}return!1}resize(se,G){se!==this.cols||G!==this.rows?super.resize(se,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(se,G){var ne,le;(ne=this._charSizeService)==null||ne.measure(),(le=this.viewport)==null||le.syncScrollArea(!0)}clear(){var se;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let G=1;G{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,_){this._rowCount=_,c=c!==void 0?c:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=h-this._lastRefreshMs,g=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),g)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(l,o,c){var d=this&&this.__decorate||function(b,x,y,C){var j,N=arguments.length,M=N<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,x,y,C);else for(var z=b.length-1;z>=0;z--)(j=b[z])&&(M=(N<3?j(M):N>3?j(x,y,M):j(x,y))||M);return N>3&&M&&Object.defineProperty(x,y,M),M},_=this&&this.__param||function(b,x){return function(y,C){x(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const h=c(3656),m=c(4725),g=c(8460),S=c(844),k=c(2585);let v=o.Viewport=class extends S.Disposable{constructor(b,x,y,C,j,N,M,z){super(),this._viewportElement=b,this._scrollArea=x,this._bufferService=y,this._optionsService=C,this._charSizeService=j,this._renderService=N,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((D=>this._activeBuffer=D.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((D=>this._renderDimensions=D))),this._handleThemeChange(z.colors),this.register(z.onChangeColors((D=>this._handleThemeChange(D)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(b){if(b)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(b,x){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&y0&&(y=P),C=""}}return{bufferElements:j,cursorElement:y}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let x=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(b,x){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&x.altKey||y==="ctrl"&&x.ctrlKey||y==="shift"&&x.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const x=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(b,x))}};o.Viewport=v=d([_(2,k.IBufferService),_(3,k.IOptionsService),_(4,m.ICharSizeService),_(5,m.IRenderService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],v)},3107:function(l,o,c){var d=this&&this.__decorate||function(k,v,b,x){var y,C=arguments.length,j=C<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(k,v,b,x);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(j=(C<3?y(j):C>3?y(v,b,j):y(v,b))||j);return C>3&&j&&Object.defineProperty(v,b,j),j},_=this&&this.__param||function(k,v){return function(b,x){v(b,x,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const h=c(4725),m=c(844),g=c(2585);let S=o.BufferDecorationRenderer=class extends m.Disposable{constructor(k,v,b,x,y){super(),this._screenElement=k,this._bufferService=v,this._coreBrowserService=b,this._decorationService=x,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,m.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const k of this._decorationService.decorations)this._renderDecoration(k);this._dimensionsChanged=!1}_renderDecoration(k){this._refreshStyle(k),this._dimensionsChanged&&this._refreshXPosition(k)}_createElement(k){var x;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((x=k==null?void 0:k.options)==null?void 0:x.layer)==="top"),v.style.width=`${Math.round((k.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(k.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(k.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=k.options.x??0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(k,v),v}_refreshStyle(k){const v=k.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)k.element&&(k.element.style.display="none",k.onRenderEmitter.fire(k.element));else{let b=this._decorationElements.get(k);b||(b=this._createElement(k),k.element=b,this._decorationElements.set(k,b),this._container.appendChild(b),k.onDispose((()=>{this._decorationElements.delete(k),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",k.onRenderEmitter.fire(b)}}_refreshXPosition(k,v=k.element){if(!v)return;const b=k.options.x??0;(k.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(k){var v;(v=this._decorationElements.get(k))==null||v.remove(),this._decorationElements.delete(k),k.dispose()}};o.BufferDecorationRenderer=S=d([_(1,g.IBufferService),_(2,h.ICoreBrowserService),_(3,g.IDecorationService),_(4,h.IRenderService)],S)},5871:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,_){return d>=c.startBufferLine-this._linePadding[_||"full"]&&d<=c.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(l,o,c){var d=this&&this.__decorate||function(y,C,j,N){var M,z=arguments.length,D=z<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,j,N);else for(var I=y.length-1;I>=0;I--)(M=y[I])&&(D=(z<3?M(D):z>3?M(C,j,D):M(C,j))||D);return z>3&&D&&Object.defineProperty(C,j,D),D},_=this&&this.__param||function(y,C){return function(j,N){C(j,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const h=c(5871),m=c(4725),g=c(844),S=c(2585),k={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends g.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,C,j,N,M,z,D){var $;super(),this._viewportElement=y,this._screenElement=C,this._bufferService=j,this._decorationService=N,this._renderService=M,this._optionsService=z,this._coreBrowserService=D,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,g.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=y,v.center=C,v.right=y,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){k.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);k.left=C,k.center=C,k.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*k.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const C of y)C.position!=="full"&&this._renderColorZone(C);for(const C of y)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(b[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-k[y.position||"full"]/2),v[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+k[y.position||"full"]))}_queueRefresh(y,C){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=x=d([_(2,S.IBufferService),_(3,S.IDecorationService),_(4,m.IRenderService),_(5,S.IOptionsService),_(6,m.ICoreBrowserService)],x)},2950:function(l,o,c){var d=this&&this.__decorate||function(k,v,b,x){var y,C=arguments.length,j=C<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(k,v,b,x);else for(var N=k.length-1;N>=0;N--)(y=k[N])&&(j=(C<3?y(j):C>3?y(v,b,j):y(v,b))||j);return C>3&&j&&Object.defineProperty(v,b,j),j},_=this&&this.__param||function(k,v){return function(b,x){v(b,x,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const h=c(4725),m=c(2585),g=c(2584);let S=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(k,v,b,x,y,C){this._textarea=k,this._compositionView=v,this._bufferService=b,this._optionsService=x,this._coreService=y,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(k){this._compositionView.textContent=k.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(k){if(this._isComposing||this._isSendingComposition){if(k.keyCode===229||k.keyCode===16||k.keyCode===17||k.keyCode===18)return!1;this._finalizeComposition(!1)}return k.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(k){if(this._compositionView.classList.remove("active"),this._isComposing=!1,k){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const k=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(k,"");this._dataAlreadySent=b,v.length>k.length?this._coreService.triggerDataEvent(b,!0):v.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=S=d([_(2,m.IBufferService),_(3,m.IOptionsService),_(4,m.ICoreService),_(5,h.IRenderService)],S)},9806:(l,o)=>{function c(d,_,h){const m=h.getBoundingClientRect(),g=d.getComputedStyle(h),S=parseInt(g.getPropertyValue("padding-left")),k=parseInt(g.getPropertyValue("padding-top"));return[_.clientX-m.left-S,_.clientY-m.top-k]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(d,_,h,m,g,S,k,v,b){if(!S)return;const x=c(d,_,h);return x?(x[0]=Math.ceil((x[0]+(b?k/2:0))/k),x[1]=Math.ceil(x[1]/v),x[0]=Math.min(Math.max(x[0],1),m+(b?1:0)),x[1]=Math.min(Math.max(x[1],1),g),x):void 0}},9504:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const d=c(2584);function _(v,b,x,y){const C=v-h(v,x),j=b-h(b,x),N=Math.abs(C-j)-(function(M,z,D){let I=0;const $=M-h(M,D),P=z-h(z,D);for(let F=0;F=0&&vb?"A":"B"}function g(v,b,x,y,C,j){let N=v,M=b,z="";for(;N!==x||M!==y;)N+=C?1:-1,C&&N>j.cols-1?(z+=j.buffer.translateBufferLineToString(M,!1,v,N),N=0,v=0,M++):!C&&N<0&&(z+=j.buffer.translateBufferLineToString(M,!1,0,v+1),N=j.cols-1,v=N,M--);return z+j.buffer.translateBufferLineToString(M,!1,v,N)}function S(v,b){const x=b?"O":"[";return d.C0.ESC+x+v}function k(v,b){v=Math.floor(v);let x="";for(let y=0;y0?$-h($,P):D;const Z=$,U=(function(Y,J,H,L,B,X){let V;return V=_(H,L,B,X).length>0?L-h(L,B):J,Y=H&&Vv?"D":"C",k(Math.abs(C-v),S(N,y));N=j>b?"D":"C";const M=Math.abs(j-b);return k((function(z,D){return D.cols-z})(j>b?v:C,x)+(M-1)*x.cols+1+((j>b?C:v)-1),S(N,y))}},1296:function(l,o,c){var d=this&&this.__decorate||function(F,W,Z,U){var Y,J=arguments.length,H=J<3?W:U===null?U=Object.getOwnPropertyDescriptor(W,Z):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(F,W,Z,U);else for(var L=F.length-1;L>=0;L--)(Y=F[L])&&(H=(J<3?Y(H):J>3?Y(W,Z,H):Y(W,Z))||H);return J>3&&H&&Object.defineProperty(W,Z,H),H},_=this&&this.__param||function(F,W){return function(Z,U){W(Z,U,F)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const h=c(3787),m=c(2550),g=c(2223),S=c(6171),k=c(6052),v=c(4725),b=c(8055),x=c(8460),y=c(844),C=c(2585),j="xterm-dom-renderer-owner-",N="xterm-rows",M="xterm-fg-",z="xterm-bg-",D="xterm-focus",I="xterm-selection";let $=1,P=o.DomRenderer=class extends y.Disposable{constructor(F,W,Z,U,Y,J,H,L,B,X,V,ae,ce){super(),this._terminal=F,this._document=W,this._element=Z,this._screenElement=U,this._viewportElement=Y,this._helperContainer=J,this._linkifier2=H,this._charSizeService=B,this._optionsService=X,this._bufferService=V,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,k.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,S.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((oe=>this._injectCss(oe)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(j+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((oe=>this._handleLinkHover(oe)))),this.register(this._linkifier2.onHideLinkUnderline((oe=>this._handleLinkLeave(oe)))),this.register((0,y.toDisposable)((()=>{this._element.classList.remove(j+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new m.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Z of this._rowElements)Z.style.width=`${this.dimensions.css.canvas.width}px`,Z.style.height=`${this.dimensions.css.cell.height}px`,Z.style.lineHeight=`${this.dimensions.css.cell.height}px`,Z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${N} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${N} .xterm-dim { color: ${b.color.multiplyOpacity(F.foreground,.5).css};}`,W+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Z=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;W+=`@keyframes ${Z} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${U} { 50% { box-shadow: none; }}`,W+=`@keyframes ${Y} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,W+=`${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${N}.${D} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[J,H]of F.ansi.entries())W+=`${this._terminalSelector} .${M}${J} { color: ${H.css}; }${this._terminalSelector} .${M}${J}.xterm-dim { color: ${b.color.multiplyOpacity(H,.5).css}; }${this._terminalSelector} .${z}${J} { background-color: ${H.css}; }`;W+=`${this._terminalSelector} .${M}${g.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(F.background).css}; }${this._terminalSelector} .${M}${g.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${z}${g.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,W){for(let Z=this._rowElements.length;Z<=W;Z++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,W){this._refreshRowElements(F,W),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(D),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(D),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,W,Z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,W,Z),this.renderRows(0,this._bufferService.rows-1),!F||!W)return;this._selectionRenderModel.update(this._terminal,F,W,Z);const U=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,J=this._selectionRenderModel.viewportCappedStartRow,H=this._selectionRenderModel.viewportCappedEndRow;if(J>=this._bufferService.rows||H<0)return;const L=this._document.createDocumentFragment();if(Z){const B=F[0]>W[0];L.appendChild(this._createSelectionElement(J,B?W[0]:F[0],B?F[0]:W[0],H-J+1))}else{const B=U===J?F[0]:0,X=J===Y?W[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(J,B,X));const V=H-J-1;if(L.appendChild(this._createSelectionElement(J+1,0,this._bufferService.cols,V)),J!==H){const ae=Y===H?W[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(H,0,ae))}}this._selectionContainer.appendChild(L)}_createSelectionElement(F,W,Z,U=1){const Y=this._document.createElement("div"),J=W*this.dimensions.css.cell.width;let H=this.dimensions.css.cell.width*(Z-W);return J+H>this.dimensions.css.canvas.width&&(H=this.dimensions.css.canvas.width-J),Y.style.height=U*this.dimensions.css.cell.height+"px",Y.style.top=F*this.dimensions.css.cell.height+"px",Y.style.left=`${J}px`,Y.style.width=`${H}px`,Y}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,W){const Z=this._bufferService.buffer,U=Z.ybase+Z.y,Y=Math.min(Z.x,this._bufferService.cols-1),J=this._optionsService.rawOptions.cursorBlink,H=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=F;B<=W;B++){const X=B+Z.ydisp,V=this._rowElements[B],ae=Z.lines.get(X);if(!V||!ae)break;V.replaceChildren(...this._rowFactory.createRow(ae,X,X===U,H,L,Y,J,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${j}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,W,Z,U,Y,J){Z<0&&(F=0),U<0&&(W=0);const H=this._bufferService.rows-1;Z=Math.max(Math.min(Z,H),0),U=Math.max(Math.min(U,H),0),Y=Math.min(Y,this._bufferService.cols);const L=this._bufferService.buffer,B=L.ybase+L.y,X=Math.min(L.x,Y-1),V=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let oe=Z;oe<=U;++oe){const se=oe+L.ydisp,G=this._rowElements[oe],ne=L.lines.get(se);if(!G||!ne)break;G.replaceChildren(...this._rowFactory.createRow(ne,se,se===B,ae,ce,X,V,this.dimensions.css.cell.width,this._widthCache,J?oe===Z?F:0:-1,J?(oe===U?W:Y)-1:-1))}}};o.DomRenderer=P=d([_(7,C.IInstantiationService),_(8,v.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,v.ICoreBrowserService),_(12,v.IThemeService)],P)},3787:function(l,o,c){var d=this&&this.__decorate||function(N,M,z,D){var I,$=arguments.length,P=$<3?M:D===null?D=Object.getOwnPropertyDescriptor(M,z):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(N,M,z,D);else for(var F=N.length-1;F>=0;F--)(I=N[F])&&(P=($<3?I(P):$>3?I(M,z,P):I(M,z))||P);return $>3&&P&&Object.defineProperty(M,z,P),P},_=this&&this.__param||function(N,M){return function(z,D){M(z,D,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const h=c(2223),m=c(643),g=c(511),S=c(2585),k=c(8055),v=c(4725),b=c(4269),x=c(6171),y=c(3734);let C=o.DomRendererRowFactory=class{constructor(N,M,z,D,I,$,P){this._document=N,this._characterJoinerService=M,this._optionsService=z,this._coreBrowserService=D,this._coreService=I,this._decorationService=$,this._themeService=P,this._workCell=new g.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,M,z){this._selectionStart=N,this._selectionEnd=M,this._columnSelectMode=z}createRow(N,M,z,D,I,$,P,F,W,Z,U){const Y=[],J=this._characterJoinerService.getJoinedCharacters(M),H=this._themeService.colors;let L,B=N.getNoBgTrimmedLength();z&&B<$+1&&(B=$+1);let X=0,V="",ae=0,ce=0,oe=0,se=!1,G=0,ne=!1,le=0;const _e=[],ue=Z!==-1&&U!==-1;for(let ze=0;ze0&&ze===J[0][0]){Ie=!0;const pt=J.shift();Fe=new b.JoinedCellData(this._workCell,N.translateToString(!0,pt[0],pt[1]),pt[1]-pt[0]),qe=pt[1]-1,Ne=Fe.getWidth()}const Ot=this._isCellInSelection(ze,M),xt=z&&ze===$,Nt=ue&&ze>=Z&&ze<=U;let Jt=!1;this._decorationService.forEachDecorationAtCell(ze,M,void 0,(pt=>{Jt=!0}));let ht=Fe.getChars()||m.WHITESPACE_CELL_CHAR;if(ht===" "&&(Fe.isUnderline()||Fe.isOverline())&&(ht=" "),le=Ne*F-W.get(ht,Fe.isBold(),Fe.isItalic()),L){if(X&&(Ot&&ne||!Ot&&!ne&&Fe.bg===ae)&&(Ot&&ne&&H.selectionForeground||Fe.fg===ce)&&Fe.extended.ext===oe&&Nt===se&&le===G&&!xt&&!Ie&&!Jt){Fe.isInvisible()?V+=m.WHITESPACE_CELL_CHAR:V+=ht,X++;continue}X&&(L.textContent=V),L=this._document.createElement("span"),X=0,V=""}else L=this._document.createElement("span");if(ae=Fe.bg,ce=Fe.fg,oe=Fe.extended.ext,se=Nt,G=le,ne=Ot,Ie&&$>=ze&&$<=qe&&($=ze),!this._coreService.isCursorHidden&&xt&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&_e.push("xterm-cursor-blink"),_e.push(D==="bar"?"xterm-cursor-bar":D==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Fe.isBold()&&_e.push("xterm-bold"),Fe.isItalic()&&_e.push("xterm-italic"),Fe.isDim()&&_e.push("xterm-dim"),V=Fe.isInvisible()?m.WHITESPACE_CELL_CHAR:Fe.getChars()||m.WHITESPACE_CELL_CHAR,Fe.isUnderline()&&(_e.push(`xterm-underline-${Fe.extended.underlineStyle}`),V===" "&&(V=" "),!Fe.isUnderlineColorDefault()))if(Fe.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Fe.getUnderlineColor()).join(",")})`;else{let pt=Fe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Fe.isBold()&&pt<8&&(pt+=8),L.style.textDecorationColor=H.ansi[pt].css}Fe.isOverline()&&(_e.push("xterm-overline"),V===" "&&(V=" ")),Fe.isStrikethrough()&&_e.push("xterm-strikethrough"),Nt&&(L.style.textDecoration="underline");let it=Fe.getFgColor(),et=Fe.getFgColorMode(),Pt=Fe.getBgColor(),we=Fe.getBgColorMode();const Oe=!!Fe.isInverse();if(Oe){const pt=it;it=Pt,Pt=pt;const It=et;et=we,we=It}let Je,nt,De,At=!1;switch(this._decorationService.forEachDecorationAtCell(ze,M,void 0,(pt=>{pt.options.layer!=="top"&&At||(pt.backgroundColorRGB&&(we=50331648,Pt=pt.backgroundColorRGB.rgba>>8&16777215,Je=pt.backgroundColorRGB),pt.foregroundColorRGB&&(et=50331648,it=pt.foregroundColorRGB.rgba>>8&16777215,nt=pt.foregroundColorRGB),At=pt.options.layer==="top")})),!At&&Ot&&(Je=this._coreBrowserService.isFocused?H.selectionBackgroundOpaque:H.selectionInactiveBackgroundOpaque,Pt=Je.rgba>>8&16777215,we=50331648,At=!0,H.selectionForeground&&(et=50331648,it=H.selectionForeground.rgba>>8&16777215,nt=H.selectionForeground)),At&&_e.push("xterm-decoration-top"),we){case 16777216:case 33554432:De=H.ansi[Pt],_e.push(`xterm-bg-${Pt}`);break;case 50331648:De=k.channels.toColor(Pt>>16,Pt>>8&255,255&Pt),this._addStyle(L,`background-color:#${j((Pt>>>0).toString(16),"0",6)}`);break;default:Oe?(De=H.foreground,_e.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):De=H.background}switch(Je||Fe.isDim()&&(Je=k.color.multiplyOpacity(De,.5)),et){case 16777216:case 33554432:Fe.isBold()&&it<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(it+=8),this._applyMinimumContrast(L,De,H.ansi[it],Fe,Je,void 0)||_e.push(`xterm-fg-${it}`);break;case 50331648:const pt=k.channels.toColor(it>>16&255,it>>8&255,255&it);this._applyMinimumContrast(L,De,pt,Fe,Je,nt)||this._addStyle(L,`color:#${j(it.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,De,H.foreground,Fe,Je,nt)||Oe&&_e.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}_e.length&&(L.className=_e.join(" "),_e.length=0),xt||Ie||Jt?L.textContent=V:X++,le!==this.defaultSpacing&&(L.style.letterSpacing=`${le}px`),Y.push(L),ze=qe}return L&&X&&(L.textContent=V),Y}_applyMinimumContrast(N,M,z,D,I,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(D.getCode()))return!1;const P=this._getContrastCache(D);let F;if(I||$||(F=P.getColor(M.rgba,z.rgba)),F===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(D.isDim()?2:1);F=k.color.ensureContrastRatio(I||M,$||z,W),P.setColor((I||M).rgba,($||z).rgba,F??null)}return!!F&&(this._addStyle(N,`color:${F.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,M){N.setAttribute("style",`${N.getAttribute("style")||""}${M};`)}_isCellInSelection(N,M){const z=this._selectionStart,D=this._selectionEnd;return!(!z||!D)&&(this._columnSelectMode?z[0]<=D[0]?N>=z[0]&&M>=z[1]&&N=z[1]&&N>=D[0]&&M<=D[1]:M>z[1]&&M=z[0]&&N=z[0])}};function j(N,M,z){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=c.createElement("span");_.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const g=c.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[_,h,m,g],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(m),this._container.appendChild(g),d.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,d,_,h){c===this._font&&d===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=d,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,d,_){let h=0;if(!d&&!_&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const S=this._measure(c,0);return S>0&&(this._flat[h]=S),S}let m=c;d&&(m+="B"),_&&(m+="I");let g=this._holey.get(m);if(g===void 0){let S=0;d&&(S|=1),_&&(S|=2),g=this._measure(c,S),g>0&&this._holey.set(m,g)}return g}_measure(c,d){const _=this._measureElements[d];return _.textContent=c.repeat(32),_.offsetWidth/32}}},2223:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(l,o)=>{function c(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=d,o.allowRescaling=function(_,h,m,g){return h===1&&m>Math.ceil(1.5*g)&&_!==void 0&&_>255&&!d(_)&&!c(_)&&!(function(S){return 57344<=S&&S<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return c(_)||(function(h){return 9472<=h&&h<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,h,m=0){return(_-(2*Math.round(h)-m))%(2*Math.round(h))}},6052:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,h,m,g=!1){if(this.selectionStart=h,this.selectionEnd=m,!h||!m||h[0]===m[0]&&h[1]===m[1])return void this.clear();const S=_.buffers.active.ydisp,k=h[1]-S,v=m[1]-S,b=Math.max(k,0),x=Math.min(v,_.rows-1);b>=_.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=k,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=x,this.startCol=h[0],this.endCol=m[0])}isCellSelected(_,h,m){return!!this.hasSelection&&(m-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&m>=this.viewportCappedStartRow&&h=this.viewportCappedStartRow&&h>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m=this.startCol&&h=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,o,c){var d=this&&this.__decorate||function(x,y,C,j){var N,M=arguments.length,z=M<3?y:j===null?j=Object.getOwnPropertyDescriptor(y,C):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(x,y,C,j);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(z=(M<3?N(z):M>3?N(y,C,z):N(y,C))||z);return M>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(x,y){return function(C,j){y(C,j,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const h=c(2585),m=c(8460),g=c(844);let S=o.CharSizeService=class extends g.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,y,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(x,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=S=d([_(2,h.IOptionsService)],S);class k extends g.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,C){y!==void 0&&y>0&&C!==void 0&&C>0&&(this._result.width=y,this._result.height=C)}}class v extends k{constructor(y,C,j){super(),this._document=y,this._parentElement=C,this._optionsService=j,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class b extends k{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(l,o,c){var d=this&&this.__decorate||function(b,x,y,C){var j,N=arguments.length,M=N<3?x:C===null?C=Object.getOwnPropertyDescriptor(x,y):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,x,y,C);else for(var z=b.length-1;z>=0;z--)(j=b[z])&&(M=(N<3?j(M):N>3?j(x,y,M):j(x,y))||M);return N>3&&M&&Object.defineProperty(x,y,M),M},_=this&&this.__param||function(b,x){return function(y,C){x(y,C,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const h=c(3734),m=c(643),g=c(511),S=c(2585);class k extends h.AttributeData{constructor(x,y,C){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=y,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=k;let v=o.CharacterJoinerService=class VT{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new g.CellData}register(x){const y={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(y),y.id}deregister(x){for(let y=0;y1){const P=this._getJoinedRanges(j,z,M,y,N);for(let F=0;F1){const $=this._getJoinedRanges(j,z,M,y,N);for(let P=0;P<$.length;P++)C.push($[P])}return C}_getJoinedRanges(x,y,C,j,N){const M=x.substring(y,C);let z=[];try{z=this._characterJoiners[0].handler(M)}catch(D){console.error(D)}for(let D=1;D{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const d=c(844),_=c(8460),h=c(3656);class m extends d.Disposable{constructor(k,v,b){super(),this._textarea=k,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new g(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(k){this._window!==k&&(this._window=k,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=m;class g extends d.Disposable{constructor(k){super(),this._parentWindow=k,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(k){this._parentWindow=k,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var k;this._outerListener&&((k=this._resolutionMediaMatchList)==null||k.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const d=c(844);class _ extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const g=this.linkProviders.indexOf(m);g!==-1&&this.linkProviders.splice(g,1)}}}}o.LinkProviderService=_},8934:function(l,o,c){var d=this&&this.__decorate||function(S,k,v,b){var x,y=arguments.length,C=y<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(S,k,v,b);else for(var j=S.length-1;j>=0;j--)(x=S[j])&&(C=(y<3?x(C):y>3?x(k,v,C):x(k,v))||C);return y>3&&C&&Object.defineProperty(k,v,C),C},_=this&&this.__param||function(S,k){return function(v,b){k(v,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const h=c(4725),m=c(9806);let g=o.MouseService=class{constructor(S,k){this._renderService=S,this._charSizeService=k}getCoords(S,k,v,b,x){return(0,m.getCoords)(window,S,k,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(S,k){const v=(0,m.getCoordsRelativeToElement)(window,S,k);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=g=d([_(0,h.IRenderService),_(1,h.ICharSizeService)],g)},3230:function(l,o,c){var d=this&&this.__decorate||function(x,y,C,j){var N,M=arguments.length,z=M<3?y:j===null?j=Object.getOwnPropertyDescriptor(y,C):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(x,y,C,j);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(z=(M<3?N(z):M>3?N(y,C,z):N(y,C))||z);return M>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(x,y){return function(C,j){y(C,j,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const h=c(6193),m=c(4725),g=c(8460),S=c(844),k=c(7226),v=c(2585);let b=o.RenderService=class extends S.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,y,C,j,N,M,z,D){super(),this._rowCount=x,this._charSizeService=j,this._renderer=this.register(new S.MutableDisposable),this._pausedResizeTask=new k.DebouncedIdleTask,this._observerDisposable=this.register(new S.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((I,$)=>this._renderRows(I,$)),z),this.register(this._renderDebouncer),this.register(z.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(D.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(z.window,y),this.register(z.onWindowChange((I=>this._registerIntersectionObserver(I,y))))}_registerIntersectionObserver(x,y){if("IntersectionObserver"in x){const C=new x.IntersectionObserver((j=>this._handleIntersectionChange(j[j.length-1])),{threshold:0});C.observe(y),this._observerDisposable.value=(0,S.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,y,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,y,this._rowCount))}_renderRows(x,y){this._renderer.value&&(x=Math.min(x,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(x,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:y}),this._onRender.fire({start:x,end:y}),this._isNextRenderRedrawOnly=!0)}resize(x,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,y;this._renderer.value&&((y=(x=this._renderer.value).clearTextureAtlas)==null||y.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(x,y)})):this._renderer.value.handleResize(x,y),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,y,C){var j;this._selectionState.start=x,this._selectionState.end=y,this._selectionState.columnSelectMode=C,(j=this._renderer.value)==null||j.handleSelectionChanged(x,y,C)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=b=d([_(2,v.IOptionsService),_(3,m.ICharSizeService),_(4,v.IDecorationService),_(5,v.IBufferService),_(6,m.ICoreBrowserService),_(7,m.IThemeService)],b)},9312:function(l,o,c){var d=this&&this.__decorate||function(z,D,I,$){var P,F=arguments.length,W=F<3?D:$===null?$=Object.getOwnPropertyDescriptor(D,I):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(z,D,I,$);else for(var Z=z.length-1;Z>=0;Z--)(P=z[Z])&&(W=(F<3?P(W):F>3?P(D,I,W):P(D,I))||W);return F>3&&W&&Object.defineProperty(D,I,W),W},_=this&&this.__param||function(z,D){return function(I,$){D(I,$,z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const h=c(9806),m=c(9504),g=c(456),S=c(4725),k=c(8460),v=c(844),b=c(6114),x=c(4841),y=c(511),C=c(2585),j=" ",N=new RegExp(j,"g");let M=o.SelectionService=class extends v.Disposable{constructor(z,D,I,$,P,F,W,Z,U){super(),this._element=z,this._screenElement=D,this._linkifier=I,this._bufferService=$,this._coreService=P,this._mouseService=F,this._optionsService=W,this._renderService=Z,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new k.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new k.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new k.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new g.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const z=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;return!(!z||!D||z[0]===D[0]&&z[1]===D[1])}get selectionText(){const z=this._model.finalSelectionStart,D=this._model.finalSelectionEnd;if(!z||!D)return"";const I=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(z[0]===D[0])return"";const P=z[0]P.replace(N," "))).join(b.isWindows?`\r -`:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(z){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&z&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(z){const D=this._getMouseBufferCoords(z),I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(I&&$&&D)&&this._areCoordsInSelection(D,I,$)}isCellInSelection(z,D){const I=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!I||!$)&&this._areCoordsInSelection([z,D],I,$)}_areCoordsInSelection(z,D,I){return z[1]>D[1]&&z[1]=D[0]&&z[0]=D[0]}_selectWordAtCursor(z,D){var P,F;const I=(F=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:F.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(z);return!!$&&(this._selectWordAt($,D),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(z,D){this._model.clearSelection(),z=Math.max(z,0),D=Math.min(D,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,z],this._model.selectionEnd=[this._bufferService.cols,D],this.refresh(),this._onSelectionChange.fire()}_handleTrim(z){this._model.handleTrim(z)&&this.refresh()}_getMouseBufferCoords(z){const D=this._mouseService.getCoords(z,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(D)return D[0]--,D[1]--,D[1]+=this._bufferService.buffer.ydisp,D}_getMouseEventScrollAmount(z){let D=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,z,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return D>=0&&D<=I?0:(D>I&&(D-=I),D=Math.min(Math.max(D,-50),50),D/=50,D/Math.abs(D)+Math.round(14*D))}shouldForceSelection(z){return b.isMac?z.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:z.shiftKey}handleMouseDown(z){if(this._mouseDownTimeStamp=z.timeStamp,(z.button!==2||!this.hasSelection)&&z.button===0){if(!this._enabled){if(!this.shouldForceSelection(z))return;z.stopPropagation()}z.preventDefault(),this._dragScrollAmount=0,this._enabled&&z.shiftKey?this._handleIncrementalClick(z):z.detail===1?this._handleSingleClick(z):z.detail===2?this._handleDoubleClick(z):z.detail===3&&this._handleTripleClick(z),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(z){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(z))}_handleSingleClick(z){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(z)?3:0,this._model.selectionStart=this._getMouseBufferCoords(z),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const D=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);D&&D.length!==this._model.selectionStart[0]&&D.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(z){this._selectWordAtCursor(z,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(z){const D=this._getMouseBufferCoords(z);D&&(this._activeSelectionMode=2,this._selectLineAt(D[1]))}shouldColumnSelect(z){return z.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(z){if(z.stopImmediatePropagation(),!this._model.selectionStart)return;const D=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(z),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(z.ydisp+this._bufferService.rows,z.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=z.ydisp),this.refresh()}}_handleMouseUp(z){const D=z.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&D<500&&z.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(z,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const $=(0,m.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const z=this._model.finalSelectionStart,D=this._model.finalSelectionEnd,I=!(!z||!D||z[0]===D[0]&&z[1]===D[1]);I?z&&D&&(this._oldSelectionStart&&this._oldSelectionEnd&&z[0]===this._oldSelectionStart[0]&&z[1]===this._oldSelectionStart[1]&&D[0]===this._oldSelectionEnd[0]&&D[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(z,D,I)):this._oldHasSelection&&this._fireOnSelectionChange(z,D,I)}_fireOnSelectionChange(z,D,I){this._oldSelectionStart=z,this._oldSelectionEnd=D,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(z){this.clearSelection(),this._trimListener.dispose(),this._trimListener=z.activeBuffer.lines.onTrim((D=>this._handleTrim(D)))}_convertViewportColToCharacterIndex(z,D){let I=D;for(let $=0;D>=$;$++){const P=z.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:P>1&&D!==$&&(I+=P-1)}return I}setSelection(z,D,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[z,D],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(z){this._isClickInSelection(z)||(this._selectWordAtCursor(z,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(z,D,I=!0,$=!0){if(z[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,F=P.lines.get(z[1]);if(!F)return;const W=P.translateBufferLineToString(z[1],!1);let Z=this._convertViewportColToCharacterIndex(F,z[0]),U=Z;const Y=z[0]-Z;let J=0,H=0,L=0,B=0;if(W.charAt(Z)===" "){for(;Z>0&&W.charAt(Z-1)===" ";)Z--;for(;U1&&(B+=oe-1,U+=oe-1);ae>0&&Z>0&&!this._isCharWordSeparator(F.loadCell(ae-1,this._workCell));){F.loadCell(ae-1,this._workCell);const se=this._workCell.getChars().length;this._workCell.getWidth()===0?(J++,ae--):se>1&&(L+=se-1,Z-=se-1),Z--,ae--}for(;ce1&&(B+=se-1,U+=se-1),U++,ce++}}U++;let X=Z+Y-J+L,V=Math.min(this._bufferService.cols,U-Z+J+H-L-B);if(D||W.slice(Z,U).trim()!==""){if(I&&X===0&&F.getCodePoint(0)!==32){const ae=P.lines.get(z[1]-1);if(ae&&F.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,z[1]-1],!1,!0,!1);if(ce){const oe=this._bufferService.cols-ce.start;X-=oe,V+=oe}}}if($&&X+V===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const ae=P.lines.get(z[1]+1);if(ae!=null&&ae.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,z[1]+1],!1,!1,!0);ce&&(V+=ce.length)}}return{start:X,length:V}}}_selectWordAt(z,D){const I=this._getWordAt(z,D);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,z[1]--;this._model.selectionStart=[I.start,z[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(z){const D=this._getWordAt(z,!0);if(D){let I=z[1];for(;D.start<0;)D.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;D.start+D.length>this._bufferService.cols;)D.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?D.start:D.start+D.length,I]}}_isCharWordSeparator(z){return z.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(z.getChars())>=0}_selectLineAt(z){const D=this._bufferService.buffer.getWrappedRangeForLine(z),I={start:{x:0,y:D.first},end:{x:this._bufferService.cols-1,y:D.last}};this._model.selectionStart=[0,D.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(I,this._bufferService.cols)}};o.SelectionService=M=d([_(3,C.IBufferService),_(4,C.ICoreService),_(5,S.IMouseService),_(6,C.IOptionsService),_(7,S.IRenderService),_(8,S.ICoreBrowserService)],M)},4725:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const d=c(8343);o.ICharSizeService=(0,d.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),o.IMouseService=(0,d.createDecorator)("MouseService"),o.IRenderService=(0,d.createDecorator)("RenderService"),o.ISelectionService=(0,d.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,d.createDecorator)("ThemeService"),o.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(l,o,c){var d=this&&this.__decorate||function(M,z,D,I){var $,P=arguments.length,F=P<3?z:I===null?I=Object.getOwnPropertyDescriptor(z,D):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(M,z,D,I);else for(var W=M.length-1;W>=0;W--)($=M[W])&&(F=(P<3?$(F):P>3?$(z,D,F):$(z,D))||F);return P>3&&F&&Object.defineProperty(z,D,F),F},_=this&&this.__param||function(M,z){return function(D,I){z(D,I,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),m=c(8055),g=c(8460),S=c(844),k=c(2585),v=m.css.toColor("#ffffff"),b=m.css.toColor("#000000"),x=m.css.toColor("#ffffff"),y=m.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],z=[0,95,135,175,215,255];for(let D=0;D<216;D++){const I=z[D/36%6|0],$=z[D/6%6|0],P=z[D%6];M.push({css:m.channels.toCss(I,$,P),rgba:m.channels.toRgba(I,$,P)})}for(let D=0;D<24;D++){const I=8+10*D;M.push({css:m.channels.toCss(I,I,I),rgba:m.channels.toRgba(I,I,I)})}return M})());let j=o.ThemeService=class extends S.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new g.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:x,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:m.color.blend(b,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:m.color.blend(b,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(M={}){const z=this._colors;if(z.foreground=N(M.foreground,v),z.background=N(M.background,b),z.cursor=N(M.cursor,x),z.cursorAccent=N(M.cursorAccent,y),z.selectionBackgroundTransparent=N(M.selectionBackground,C),z.selectionBackgroundOpaque=m.color.blend(z.background,z.selectionBackgroundTransparent),z.selectionInactiveBackgroundTransparent=N(M.selectionInactiveBackground,z.selectionBackgroundTransparent),z.selectionInactiveBackgroundOpaque=m.color.blend(z.background,z.selectionInactiveBackgroundTransparent),z.selectionForeground=M.selectionForeground?N(M.selectionForeground,m.NULL_COLOR):void 0,z.selectionForeground===m.NULL_COLOR&&(z.selectionForeground=void 0),m.color.isOpaque(z.selectionBackgroundTransparent)&&(z.selectionBackgroundTransparent=m.color.opacity(z.selectionBackgroundTransparent,.3)),m.color.isOpaque(z.selectionInactiveBackgroundTransparent)&&(z.selectionInactiveBackgroundTransparent=m.color.opacity(z.selectionInactiveBackgroundTransparent,.3)),z.ansi=o.DEFAULT_ANSI_COLORS.slice(),z.ansi[0]=N(M.black,o.DEFAULT_ANSI_COLORS[0]),z.ansi[1]=N(M.red,o.DEFAULT_ANSI_COLORS[1]),z.ansi[2]=N(M.green,o.DEFAULT_ANSI_COLORS[2]),z.ansi[3]=N(M.yellow,o.DEFAULT_ANSI_COLORS[3]),z.ansi[4]=N(M.blue,o.DEFAULT_ANSI_COLORS[4]),z.ansi[5]=N(M.magenta,o.DEFAULT_ANSI_COLORS[5]),z.ansi[6]=N(M.cyan,o.DEFAULT_ANSI_COLORS[6]),z.ansi[7]=N(M.white,o.DEFAULT_ANSI_COLORS[7]),z.ansi[8]=N(M.brightBlack,o.DEFAULT_ANSI_COLORS[8]),z.ansi[9]=N(M.brightRed,o.DEFAULT_ANSI_COLORS[9]),z.ansi[10]=N(M.brightGreen,o.DEFAULT_ANSI_COLORS[10]),z.ansi[11]=N(M.brightYellow,o.DEFAULT_ANSI_COLORS[11]),z.ansi[12]=N(M.brightBlue,o.DEFAULT_ANSI_COLORS[12]),z.ansi[13]=N(M.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),z.ansi[14]=N(M.brightCyan,o.DEFAULT_ANSI_COLORS[14]),z.ansi[15]=N(M.brightWhite,o.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const D=Math.min(z.ansi.length-16,M.extendedAnsi.length);for(let I=0;I{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const d=c(8460),_=c(844);class h extends _.Disposable{constructor(g){super(),this._maxLength=g,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(g){if(this._maxLength===g)return;const S=new Array(g);for(let k=0;kthis._length)for(let S=this._length;S=g;v--)this._array[this._getCyclicIndex(v+k.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;vthis._maxLength){const v=this._length+k.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=k.length}trimStart(g){g>this._length&&(g=this._length),this._startIndex+=g,this._length-=g,this.onTrimEmitter.fire(g)}shiftElements(g,S,k){if(!(S<=0)){if(g<0||g>=this._length)throw new Error("start argument out of range");if(g+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let b=S-1;b>=0;b--)this.set(g+b+k,this.get(g+b));const v=g+S+k-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(d,_=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const m in d)h[m]=_<=1?d[m]:d[m]&&c(d[m],_-1);return h}},8055:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,d=0,_=0,h=0;var m,g,S,k,v;function b(y){const C=y.toString(16);return C.length<2?"0"+C:C}function x(y,C){return y>>0},y.toColor=function(C,j,N,M){return{css:y.toCss(C,j,N,M),rgba:y.toRgba(C,j,N,M)}}})(m||(o.channels=m={})),(function(y){function C(j,N){return h=Math.round(255*N),[c,d,_]=v.toChannels(j.rgba),{css:m.toCss(c,d,_,h),rgba:m.toRgba(c,d,_,h)}}y.blend=function(j,N){if(h=(255&N.rgba)/255,h===1)return{css:N.css,rgba:N.rgba};const M=N.rgba>>24&255,z=N.rgba>>16&255,D=N.rgba>>8&255,I=j.rgba>>24&255,$=j.rgba>>16&255,P=j.rgba>>8&255;return c=I+Math.round((M-I)*h),d=$+Math.round((z-$)*h),_=P+Math.round((D-P)*h),{css:m.toCss(c,d,_),rgba:m.toRgba(c,d,_)}},y.isOpaque=function(j){return(255&j.rgba)==255},y.ensureContrastRatio=function(j,N,M){const z=v.ensureContrastRatio(j.rgba,N.rgba,M);if(z)return m.toColor(z>>24&255,z>>16&255,z>>8&255)},y.opaque=function(j){const N=(255|j.rgba)>>>0;return[c,d,_]=v.toChannels(N),{css:m.toCss(c,d,_),rgba:N}},y.opacity=C,y.multiplyOpacity=function(j,N){return h=255&j.rgba,C(j,h*N/255)},y.toColorRGB=function(j){return[j.rgba>>24&255,j.rgba>>16&255,j.rgba>>8&255]}})(g||(o.color=g={})),(function(y){let C,j;try{const N=document.createElement("canvas");N.width=1,N.height=1;const M=N.getContext("2d",{willReadFrequently:!0});M&&(C=M,C.globalCompositeOperation="copy",j=C.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),d=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),m.toColor(c,d,_);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),d=parseInt(N.slice(2,3).repeat(2),16),_=parseInt(N.slice(3,4).repeat(2),16),h=parseInt(N.slice(4,5).repeat(2),16),m.toColor(c,d,_,h);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const M=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return c=parseInt(M[1]),d=parseInt(M[2]),_=parseInt(M[3]),h=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),m.toColor(c,d,_,h);if(!C||!j)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=j,C.fillStyle=N,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[c,d,_,h]=C.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(c,d,_,h),css:N}}})(S||(o.css=S={})),(function(y){function C(j,N,M){const z=j/255,D=N/255,I=M/255;return .2126*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))+.7152*(D<=.03928?D/12.92:Math.pow((D+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}y.relativeLuminance=function(j){return C(j>>16&255,j>>8&255,255&j)},y.relativeLuminance2=C})(k||(o.rgb=k={})),(function(y){function C(N,M,z){const D=N>>24&255,I=N>>16&255,$=N>>8&255;let P=M>>24&255,F=M>>16&255,W=M>>8&255,Z=x(k.relativeLuminance2(P,F,W),k.relativeLuminance2(D,I,$));for(;Z0||F>0||W>0);)P-=Math.max(0,Math.ceil(.1*P)),F-=Math.max(0,Math.ceil(.1*F)),W-=Math.max(0,Math.ceil(.1*W)),Z=x(k.relativeLuminance2(P,F,W),k.relativeLuminance2(D,I,$));return(P<<24|F<<16|W<<8|255)>>>0}function j(N,M,z){const D=N>>24&255,I=N>>16&255,$=N>>8&255;let P=M>>24&255,F=M>>16&255,W=M>>8&255,Z=x(k.relativeLuminance2(P,F,W),k.relativeLuminance2(D,I,$));for(;Z>>0}y.blend=function(N,M){if(h=(255&M)/255,h===1)return M;const z=M>>24&255,D=M>>16&255,I=M>>8&255,$=N>>24&255,P=N>>16&255,F=N>>8&255;return c=$+Math.round((z-$)*h),d=P+Math.round((D-P)*h),_=F+Math.round((I-F)*h),m.toRgba(c,d,_)},y.ensureContrastRatio=function(N,M,z){const D=k.relativeLuminance(N>>8),I=k.relativeLuminance(M>>8);if(x(D,I)>8));if(Wx(D,k.relativeLuminance(Z>>8))?F:Z}return F}const $=j(N,M,z),P=x(D,k.relativeLuminance($>>8));if(Px(D,k.relativeLuminance(F>>8))?$:F}return $}},y.reduceLuminance=C,y.increaseLuminance=j,y.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(v||(o.rgba=v={})),o.toPaddedHex=b,o.contrastRatio=x},8969:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const d=c(844),_=c(2585),h=c(4348),m=c(7866),g=c(744),S=c(7302),k=c(6975),v=c(8460),b=c(1753),x=c(1480),y=c(7994),C=c(9282),j=c(5435),N=c(5981),M=c(2660);let z=!1;class D extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event(($=>{var P;(P=this._onScrollApi)==null||P.fire($.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options($){for(const P in $)this.optionsService.options[P]=$[P]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new S.OptionsService($)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(g.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new j.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((P,F)=>this._inputHandler.parse(P,F)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,P){this._writeBuffer.write($,P)}writeSync($,P){this._logService.logLevel<=_.LogLevelEnum.WARN&&!z&&(this._logService.warn("writeSync is unreliable and will be removed soon."),z=!0),this._writeBuffer.writeSync($,P)}input($,P=!0){this.coreService.triggerDataEvent($,P)}resize($,P){isNaN($)||isNaN(P)||($=Math.max($,g.MINIMUM_COLS),P=Math.max(P,g.MINIMUM_ROWS),this._bufferService.resize($,P))}scroll($,P=!1){this._bufferService.scroll($,P)}scrollLines($,P,F){this._bufferService.scrollLines($,P,F)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const P=$-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler($,P){return this._inputHandler.registerEscHandler($,P)}registerDcsHandler($,P){return this._inputHandler.registerDcsHandler($,P)}registerCsiHandler($,P){return this._inputHandler.registerCsiHandler($,P)}registerOscHandler($,P){return this._inputHandler.registerOscHandler($,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?$=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const P of $)P.dispose()}))}}}o.CoreTerminal=D},8460:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let d=0;dd.fire(_)))},o.runAndSubscribe=function(c,d){return d(void 0),c((_=>d(_)))}},5435:function(l,o,c){var d=this&&this.__decorate||function(J,H,L,B){var X,V=arguments.length,ae=V<3?H:B===null?B=Object.getOwnPropertyDescriptor(H,L):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(J,H,L,B);else for(var ce=J.length-1;ce>=0;ce--)(X=J[ce])&&(ae=(V<3?X(ae):V>3?X(H,L,ae):X(H,L))||ae);return V>3&&ae&&Object.defineProperty(H,L,ae),ae},_=this&&this.__param||function(J,H){return function(L,B){H(L,B,J)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const h=c(2584),m=c(7116),g=c(2015),S=c(844),k=c(482),v=c(8437),b=c(8460),x=c(643),y=c(511),C=c(3734),j=c(2585),N=c(1480),M=c(6242),z=c(6351),D=c(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function P(J,H){if(J>24)return H.setWinLines||!1;switch(J){case 1:return!!H.restoreWin;case 2:return!!H.minimizeWin;case 3:return!!H.setWinPosition;case 4:return!!H.setWinSizePixels;case 5:return!!H.raiseWin;case 6:return!!H.lowerWin;case 7:return!!H.refreshWin;case 8:return!!H.setWinSizeChars;case 9:return!!H.maximizeWin;case 10:return!!H.fullscreenWin;case 11:return!!H.getWinState;case 13:return!!H.getWinPosition;case 14:return!!H.getWinSizePixels;case 15:return!!H.getScreenSizePixels;case 16:return!!H.getCellSizePixels;case 18:return!!H.getWinSizeChars;case 19:return!!H.getScreenSizeChars;case 20:return!!H.getIconTitle;case 21:return!!H.getWinTitle;case 22:return!!H.pushTitle;case 23:return!!H.popTitle;case 24:return!!H.setWinLines}return!1}var F;(function(J){J[J.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",J[J.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(o.WindowsOptionsReportType=F={}));let W=0;class Z extends S.Disposable{getAttrData(){return this._curAttrData}constructor(H,L,B,X,V,ae,ce,oe,se=new g.EscapeSequenceParser){super(),this._bufferService=H,this._charsetService=L,this._coreService=B,this._logService=X,this._optionsService=V,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=oe,this._parser=se,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new k.StringToUtf32,this._utf8Decoder=new k.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((G=>this._activeBuffer=G.activeBuffer))),this._parser.setCsiHandlerFallback(((G,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(G),params:ne.toArray()})})),this._parser.setEscHandlerFallback((G=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(G)})})),this._parser.setExecuteHandlerFallback((G=>{this._logService.debug("Unknown EXECUTE code: ",{code:G})})),this._parser.setOscHandlerFallback(((G,ne,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:G,action:ne,data:le})})),this._parser.setDcsHandlerFallback(((G,ne,le)=>{ne==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(G),action:ne,payload:le})})),this._parser.setPrintHandler(((G,ne,le)=>this.print(G,ne,le))),this._parser.registerCsiHandler({final:"@"},(G=>this.insertChars(G))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(G=>this.scrollLeft(G))),this._parser.registerCsiHandler({final:"A"},(G=>this.cursorUp(G))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(G=>this.scrollRight(G))),this._parser.registerCsiHandler({final:"B"},(G=>this.cursorDown(G))),this._parser.registerCsiHandler({final:"C"},(G=>this.cursorForward(G))),this._parser.registerCsiHandler({final:"D"},(G=>this.cursorBackward(G))),this._parser.registerCsiHandler({final:"E"},(G=>this.cursorNextLine(G))),this._parser.registerCsiHandler({final:"F"},(G=>this.cursorPrecedingLine(G))),this._parser.registerCsiHandler({final:"G"},(G=>this.cursorCharAbsolute(G))),this._parser.registerCsiHandler({final:"H"},(G=>this.cursorPosition(G))),this._parser.registerCsiHandler({final:"I"},(G=>this.cursorForwardTab(G))),this._parser.registerCsiHandler({final:"J"},(G=>this.eraseInDisplay(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(G=>this.eraseInDisplay(G,!0))),this._parser.registerCsiHandler({final:"K"},(G=>this.eraseInLine(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(G=>this.eraseInLine(G,!0))),this._parser.registerCsiHandler({final:"L"},(G=>this.insertLines(G))),this._parser.registerCsiHandler({final:"M"},(G=>this.deleteLines(G))),this._parser.registerCsiHandler({final:"P"},(G=>this.deleteChars(G))),this._parser.registerCsiHandler({final:"S"},(G=>this.scrollUp(G))),this._parser.registerCsiHandler({final:"T"},(G=>this.scrollDown(G))),this._parser.registerCsiHandler({final:"X"},(G=>this.eraseChars(G))),this._parser.registerCsiHandler({final:"Z"},(G=>this.cursorBackwardTab(G))),this._parser.registerCsiHandler({final:"`"},(G=>this.charPosAbsolute(G))),this._parser.registerCsiHandler({final:"a"},(G=>this.hPositionRelative(G))),this._parser.registerCsiHandler({final:"b"},(G=>this.repeatPrecedingCharacter(G))),this._parser.registerCsiHandler({final:"c"},(G=>this.sendDeviceAttributesPrimary(G))),this._parser.registerCsiHandler({prefix:">",final:"c"},(G=>this.sendDeviceAttributesSecondary(G))),this._parser.registerCsiHandler({final:"d"},(G=>this.linePosAbsolute(G))),this._parser.registerCsiHandler({final:"e"},(G=>this.vPositionRelative(G))),this._parser.registerCsiHandler({final:"f"},(G=>this.hVPosition(G))),this._parser.registerCsiHandler({final:"g"},(G=>this.tabClear(G))),this._parser.registerCsiHandler({final:"h"},(G=>this.setMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(G=>this.setModePrivate(G))),this._parser.registerCsiHandler({final:"l"},(G=>this.resetMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(G=>this.resetModePrivate(G))),this._parser.registerCsiHandler({final:"m"},(G=>this.charAttributes(G))),this._parser.registerCsiHandler({final:"n"},(G=>this.deviceStatus(G))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(G=>this.deviceStatusPrivate(G))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(G=>this.softReset(G))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(G=>this.setCursorStyle(G))),this._parser.registerCsiHandler({final:"r"},(G=>this.setScrollRegion(G))),this._parser.registerCsiHandler({final:"s"},(G=>this.saveCursor(G))),this._parser.registerCsiHandler({final:"t"},(G=>this.windowOptions(G))),this._parser.registerCsiHandler({final:"u"},(G=>this.restoreCursor(G))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(G=>this.insertColumns(G))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(G=>this.deleteColumns(G))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(G=>this.selectProtected(G))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(G=>this.requestMode(G,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(G=>this.requestMode(G,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((G=>(this.setTitle(G),this.setIconName(G),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((G=>this.setIconName(G)))),this._parser.registerOscHandler(2,new M.OscHandler((G=>this.setTitle(G)))),this._parser.registerOscHandler(4,new M.OscHandler((G=>this.setOrReportIndexedColor(G)))),this._parser.registerOscHandler(8,new M.OscHandler((G=>this.setHyperlink(G)))),this._parser.registerOscHandler(10,new M.OscHandler((G=>this.setOrReportFgColor(G)))),this._parser.registerOscHandler(11,new M.OscHandler((G=>this.setOrReportBgColor(G)))),this._parser.registerOscHandler(12,new M.OscHandler((G=>this.setOrReportCursorColor(G)))),this._parser.registerOscHandler(104,new M.OscHandler((G=>this.restoreIndexedColor(G)))),this._parser.registerOscHandler(110,new M.OscHandler((G=>this.restoreFgColor(G)))),this._parser.registerOscHandler(111,new M.OscHandler((G=>this.restoreBgColor(G)))),this._parser.registerOscHandler(112,new M.OscHandler((G=>this.restoreCursorColor(G)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const G in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:G},(()=>this.selectCharset("("+G))),this._parser.registerEscHandler({intermediates:")",final:G},(()=>this.selectCharset(")"+G))),this._parser.registerEscHandler({intermediates:"*",final:G},(()=>this.selectCharset("*"+G))),this._parser.registerEscHandler({intermediates:"+",final:G},(()=>this.selectCharset("+"+G))),this._parser.registerEscHandler({intermediates:"-",final:G},(()=>this.selectCharset("-"+G))),this._parser.registerEscHandler({intermediates:".",final:G},(()=>this.selectCharset("."+G))),this._parser.registerEscHandler({intermediates:"/",final:G},(()=>this.selectCharset("/"+G)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((G=>(this._logService.error("Parsing error: ",G),G))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new z.DcsHandler(((G,ne)=>this.requestStatusString(G,ne))))}_preserveStack(H,L,B,X){this._parseStack.paused=!0,this._parseStack.cursorStartX=H,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=B,this._parseStack.position=X}_logSlowResolvingAsync(H){this._logService.logLevel<=j.LogLevelEnum.WARN&&Promise.race([H,new Promise(((L,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(H,L){let B,X=this._activeBuffer.x,V=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(B),B;X=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,H.length>$&&(ae=this._parseStack.position+$)}if(this._logService.logLevel<=j.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof H=="string"?` "${H}"`:` "${Array.prototype.map.call(H,(G=>String.fromCharCode(G))).join("")}"`),typeof H=="string"?H.split("").map((G=>G.charCodeAt(0))):H),this._parseBuffer.length$)for(let G=ae;G0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let _e=this._parser.precedingJoinState;for(let ue=L;ueoe){if(se){const qe=le;let Fe=this._activeBuffer.x-Ie;for(this._activeBuffer.x=Ie,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ie>0&&le instanceof v.BufferLine&&le.copyCellsFrom(qe,Fe,0,Ie,!1);Fe=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(G&&(le.insertCells(this._activeBuffer.x,V-Ie,this._activeBuffer.getNullCell(ne)),le.getWidth(oe-1)===2&&le.setCellFromCodepoint(oe-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ne)),le.setCellFromCodepoint(this._activeBuffer.x++,X,V,ne),V>0)for(;--V;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=_e,this._activeBuffer.x0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(H,L){return H.final!=="t"||H.prefix||H.intermediates?this._parser.registerCsiHandler(H,L):this._parser.registerCsiHandler(H,(B=>!P(B.params[0],this._optionsService.rawOptions.windowOptions)||L(B)))}registerDcsHandler(H,L){return this._parser.registerDcsHandler(H,new z.DcsHandler(L))}registerEscHandler(H,L){return this._parser.registerEscHandler(H,L)}registerOscHandler(H,L){return this._parser.registerOscHandler(H,new M.OscHandler(L))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var H;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&H.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const H=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-H),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(H=this._bufferService.cols-1){this._activeBuffer.x=Math.min(H,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(H,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=H,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=H,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(H,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+H,this._activeBuffer.y+L)}cursorUp(H){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,H.params[0]||1)):this._moveCursor(0,-(H.params[0]||1)),!0}cursorDown(H){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,H.params[0]||1)):this._moveCursor(0,H.params[0]||1),!0}cursorForward(H){return this._moveCursor(H.params[0]||1,0),!0}cursorBackward(H){return this._moveCursor(-(H.params[0]||1),0),!0}cursorNextLine(H){return this.cursorDown(H),this._activeBuffer.x=0,!0}cursorPrecedingLine(H){return this.cursorUp(H),this._activeBuffer.x=0,!0}cursorCharAbsolute(H){return this._setCursor((H.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(H){return this._setCursor(H.length>=2?(H.params[1]||1)-1:0,(H.params[0]||1)-1),!0}charPosAbsolute(H){return this._setCursor((H.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(H){return this._moveCursor(H.params[0]||1,0),!0}linePosAbsolute(H){return this._setCursor(this._activeBuffer.x,(H.params[0]||1)-1),!0}vPositionRelative(H){return this._moveCursor(0,H.params[0]||1),!0}hVPosition(H){return this.cursorPosition(H),!0}tabClear(H){const L=H.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(H){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=H.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(H){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=H.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(H){const L=H.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(H,L,B,X=!1,V=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);ae.replaceCells(L,B,this._activeBuffer.getNullCell(this._eraseAttrData()),V),X&&(ae.isWrapped=!1)}_resetBufferLine(H,L=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+H);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+H),B.isWrapped=!1)}eraseInDisplay(H,L=!1){let B;switch(this._restrictCursor(this._bufferService.cols),H.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);B=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,L);this._dirtyRowTracker.markDirty(0);break;case 3:const X=this._activeBuffer.lines.length-this._bufferService.rows;X>0&&(this._activeBuffer.lines.trimStart(X),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-X,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-X,0),this._onScroll.fire(0))}return!0}eraseInLine(H,L=!1){switch(this._restrictCursor(this._bufferService.cols),H.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(H){this._restrictCursor();let L=H.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let se=oe;for(let G=1;G0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(H){return H.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(H.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(H){return(this._optionsService.rawOptions.termName+"").indexOf(H)===0}setMode(H){for(let L=0;LNe?1:2,_e=H.params[0];return ue=_e,ze=L?_e===2?4:_e===4?le(ae.modes.insertMode):_e===12?3:_e===20?le(ne.convertEol):0:_e===1?le(B.applicationCursorKeys):_e===3?ne.windowOptions.setWinLines?oe===80?2:oe===132?1:0:0:_e===6?le(B.origin):_e===7?le(B.wraparound):_e===8?3:_e===9?le(X==="X10"):_e===12?le(ne.cursorBlink):_e===25?le(!ae.isCursorHidden):_e===45?le(B.reverseWraparound):_e===66?le(B.applicationKeypad):_e===67?4:_e===1e3?le(X==="VT200"):_e===1002?le(X==="DRAG"):_e===1003?le(X==="ANY"):_e===1004?le(B.sendFocus):_e===1005?4:_e===1006?le(V==="SGR"):_e===1015?4:_e===1016?le(V==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?le(se===G):_e===2004?le(B.bracketedPasteMode):0,ae.triggerDataEvent(`${h.C0.ESC}[${L?"":"?"}${ue};${ze}$y`),!0;var ue,ze}_updateAttrColor(H,L,B,X,V){return L===2?(H|=50331648,H&=-16777216,H|=C.AttributeData.fromColorRGB([B,X,V])):L===5&&(H&=-50331904,H|=33554432|255&B),H}_extractColor(H,L,B){const X=[0,0,-1,0,0,0];let V=0,ae=0;do{if(X[ae+V]=H.params[L+ae],H.hasSubParams(L+ae)){const ce=H.getSubParams(L+ae);let oe=0;do X[1]===5&&(V=1),X[ae+oe+1+V]=ce[oe];while(++oe=2||X[1]===2&&ae+V>=5)break;X[1]&&(V=1)}while(++ae+L5)&&(H=1),L.extended.underlineStyle=H,L.fg|=268435456,H===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(H){H.fg=v.DEFAULT_ATTR_DATA.fg,H.bg=v.DEFAULT_ATTR_DATA.bg,H.extended=H.extended.clone(),H.extended.underlineStyle=0,H.extended.underlineColor&=-67108864,H.updateExtended()}charAttributes(H){if(H.length===1&&H.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=H.length;let B;const X=this._curAttrData;for(let V=0;V=30&&B<=37?(X.fg&=-50331904,X.fg|=16777216|B-30):B>=40&&B<=47?(X.bg&=-50331904,X.bg|=16777216|B-40):B>=90&&B<=97?(X.fg&=-50331904,X.fg|=16777224|B-90):B>=100&&B<=107?(X.bg&=-50331904,X.bg|=16777224|B-100):B===0?this._processSGR0(X):B===1?X.fg|=134217728:B===3?X.bg|=67108864:B===4?(X.fg|=268435456,this._processUnderline(H.hasSubParams(V)?H.getSubParams(V)[0]:1,X)):B===5?X.fg|=536870912:B===7?X.fg|=67108864:B===8?X.fg|=1073741824:B===9?X.fg|=2147483648:B===2?X.bg|=134217728:B===21?this._processUnderline(2,X):B===22?(X.fg&=-134217729,X.bg&=-134217729):B===23?X.bg&=-67108865:B===24?(X.fg&=-268435457,this._processUnderline(0,X)):B===25?X.fg&=-536870913:B===27?X.fg&=-67108865:B===28?X.fg&=-1073741825:B===29?X.fg&=2147483647:B===39?(X.fg&=-67108864,X.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):B===49?(X.bg&=-67108864,X.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?V+=this._extractColor(H,V,X):B===53?X.bg|=1073741824:B===55?X.bg&=-1073741825:B===59?(X.extended=X.extended.clone(),X.extended.underlineColor=-1,X.updateExtended()):B===100?(X.fg&=-67108864,X.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,X.bg&=-67108864,X.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(H){switch(H.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${L};${B}R`)}return!0}deviceStatusPrivate(H){if(H.params[0]===6){const L=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${L};${B}R`)}return!0}softReset(H){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(H){const L=H.params[0]||1;switch(L){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const B=L%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(H){const L=H.params[0]||1;let B;return(H.length<2||(B=H.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(H){if(!P(H.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=H.length>1?H.params[1]:0;switch(H.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(H){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(H){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(H){return this._windowTitle=H,this._onTitleChange.fire(H),!0}setIconName(H){return this._iconName=H,!0}setOrReportIndexedColor(H){const L=[],B=H.split(";");for(;B.length>1;){const X=B.shift(),V=B.shift();if(/^\d+$/.exec(X)){const ae=parseInt(X);if(Y(ae))if(V==="?")L.push({type:0,index:ae});else{const ce=(0,D.parseColor)(V);ce&&L.push({type:1,index:ae,color:ce})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(H){const L=H.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(H,L){this._getCurrentLinkId()&&this._finishHyperlink();const B=H.split(":");let X;const V=B.findIndex((ae=>ae.startsWith("id=")));return V!==-1&&(X=B[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:X,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(H,L){const B=H.split(";");for(let X=0;X=this._specialColors.length);++X,++L)if(B[X]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const V=(0,D.parseColor)(B[X]);V&&this._onColor.fire([{type:1,index:this._specialColors[L],color:V}])}return!0}setOrReportFgColor(H){return this._setOrReportSpecialColor(H,0)}setOrReportBgColor(H){return this._setOrReportSpecialColor(H,1)}setOrReportCursorColor(H){return this._setOrReportSpecialColor(H,2)}restoreIndexedColor(H){if(!H)return this._onColor.fire([{type:2}]),!0;const L=[],B=H.split(";");for(let X=0;X=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const H=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,H,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(H){return this._charsetService.setgLevel(H),!0}screenAlignmentPattern(){const H=new y.CellData;H.content=4194373,H.fg=this._curAttrData.fg,H.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L(this._coreService.triggerDataEvent(`${h.C0.ESC}${V}${h.C0.ESC}\\`),!0))(H==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:H==='"p'?'P1$r61;1"p':H==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:H==="m"?"P1$r0m":H===" q"?`P1$r${{block:2,underline:4,bar:6}[X.cursorStyle]-(X.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(H,L){this._dirtyRowTracker.markRangeDirty(H,L)}}o.InputHandler=Z;let U=class{constructor(J){this._bufferService=J,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(J){Jthis.end&&(this.end=J)}markRangeDirty(J,H){J>H&&(W=J,J=H,H=W),Jthis.end&&(this.end=H)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(J){return 0<=J&&J<256}U=d([_(0,j.IBufferService)],U)},844:(l,o)=>{function c(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},o.toDisposable=function(d){return{dispose:d}},o.disposeArray=c,o.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(_,h,m){this._data[_]||(this._data[_]={}),this._data[_][h]=m}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(d,_,h,m,g){this._data.get(d,_)||this._data.set(d,_,new c),this._data.get(d,_).set(h,m,g)}get(d,_,h,m){var g;return(g=this._data.get(d,_))==null?void 0:g.get(h,m)}clear(){this._data.clear()}}},6114:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,d=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=c.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),o.isIpad=d==="iPad",o.isIphone=d==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),o.isLinux=d.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const _=this._getKey(d);if(_===void 0||(c=this._search(_),c===-1)||this._getKey(this._array[c])!==_)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===d))do _(this._array[c]);while(++c=_;){let m=_+h>>1;const g=this._getKey(this._array[m]);if(g>d)h=m-1;else{if(!(g0&&this._getKey(this._array[m-1])===d;)m--;return m}_=m+1}}return _}}},7226:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const d=c(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(g){this._tasks.push(g),this._start()}flush(){for(;this._ib)return v-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-S))}ms`),void this._start();v=b}this.clear()}}class h extends _{_requestCallback(g){return setTimeout((()=>g(this._createDeadline(16))))}_cancelCallback(g){clearTimeout(g)}_createDeadline(g){const S=Date.now()+g;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}o.PriorityTaskQueue=h,o.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:h,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const d=c(643);o.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),m=h==null?void 0:h.get(_.cols-1),g=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);g&&m&&(g.isWrapped=m[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&m[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,m=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=m}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=d},9092:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const d=c(6349),_=c(7226),h=c(3734),m=c(8437),g=c(4634),S=c(511),k=c(643),v=c(4863),b=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,y,C){this._hasScrollback=x,this._optionsService=y,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=S.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=S.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,y){return new m.BufferLine(this._bufferService.cols,this.getNullCell(x),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&xo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:y}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=m.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,y){const C=this.getNullCell(m.DEFAULT_ATTR_DATA);let j=0;const N=this._getCorrectBufferLength(y);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(x,C)));else for(let z=this._rows;z>y;z--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(z),this.ybase=Math.max(this.ybase-z,0),this.ydisp=Math.max(this.ydisp-z,0),this.savedY=Math.max(this.savedY-z,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,y-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(x,y),this._cols>x))for(let M=0;M.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let y=0;for(;this._memoryCleanupPosition100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,y){this._cols!==x&&(x>this._cols?this._reflowLarger(x,y):this._reflowSmaller(x,y))}_reflowLarger(x,y){const C=(0,g.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(C.length>0){const j=(0,g.reflowLargerCreateNewLayout)(this.lines,C);(0,g.reflowLargerApplyNewLayout)(this.lines,j.layout),this._reflowLargerAdjustViewport(x,y,j.countRemoved)}}_reflowLargerAdjustViewport(x,y,C){const j=this.getNullCell(m.DEFAULT_ATTR_DATA);let N=C;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;M--){let z=this.lines.get(M);if(!z||!z.isWrapped&&z.getTrimmedLength()<=x)continue;const D=[z];for(;z.isWrapped&&M>0;)z=this.lines.get(--M),D.unshift(z);const I=this.ybase+this.y;if(I>=M&&I0&&(j.push({start:M+D.length+N,newLines:Z}),N+=Z.length),D.push(...Z);let U=P.length-1,Y=P[U];Y===0&&(U--,Y=P[U]);let J=D.length-F-1,H=$;for(;J>=0;){const B=Math.min(H,Y);if(D[U]===void 0)break;if(D[U].copyCellsFrom(D[J],H-B,Y-B,B,!0),Y-=B,Y===0&&(U--,Y=P[U]),H-=B,H===0){J--;const X=Math.max(J,0);H=(0,g.getWrappedLineTrimmedLength)(D,X,this._cols)}}for(let B=0;B0;)this.ybase===0?this.y0){const M=[],z=[];for(let U=0;U=0;U--)if(P&&P.start>I+F){for(let Y=P.newLines.length-1;Y>=0;Y--)this.lines.set(U--,P.newLines[Y]);U++,M.push({index:I+1,amount:P.newLines.length}),F+=P.newLines.length,P=j[++$]}else this.lines.set(U,z[I--]);let W=0;for(let U=M.length-1;U>=0;U--)M[U].index+=W,this.lines.onInsertEmitter.fire(M[U]),W+=M[U].amount;const Z=Math.max(0,D+N-this.lines.maxLength);Z>0&&this.lines.onTrimEmitter.fire(Z)}}translateBufferLineToString(x,y,C=0,j){const N=this.lines.get(x);return N?N.translateToString(y,C,j):""}getWrappedRangeForLine(x){let y=x,C=x;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;C+10;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let y=0;y{y.line-=C,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((C=>{y.line>=C.index&&(y.line+=C.amount)}))),y.register(this.lines.onDelete((C=>{y.line>=C.index&&y.lineC.index&&(y.line-=C.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const d=c(3734),_=c(511),h=c(643),m=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let g=0;class S{constructor(v,b,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const y=b||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let C=0;C>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):x]}set(v,b){this._data[3*v+1]=b[h.CHAR_DATA_ATTR_INDEX],b[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,m.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return g=3*v,b.content=this._data[g+0],b.fg=this._data[g+1],b.bg=this._data[g+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,x,y){268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=b|x<<22,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}addCodepointToCell(v,b,x){let y=this._data[3*v+0];2097152&y?this._combined[v]+=(0,m.stringFromCodePoint)(b):2097151&y?(this._combined[v]=(0,m.stringFromCodePoint)(2097151&y)+(0,m.stringFromCodePoint)(b),y&=-2097152,y|=2097152):y=b|4194304,x&&(y&=-12582913,y|=x<<22),this._data[3*v+0]=y}insertCells(v,b,x){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,x),b=0;--C)this.setCell(v+b+C,this.loadCell(v+C,y));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const y=new Uint32Array(x);y.set(this._data),this._data=y}for(let y=this.length;y=v&&delete this._combined[N]}const C=Object.keys(this._extendedAttrs);for(let j=0;j=v&&delete this._extendedAttrs[N]}}return this.length=v,4*x*2=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,x,y,C){const j=v._data;if(C)for(let M=y-1;M>=0;M--){for(let z=0;z<3;z++)this._data[3*(x+M)+z]=j[3*(b+M)+z];268435456&j[3*(b+M)+2]&&(this._extendedAttrs[x+M]=v._extendedAttrs[b+M])}else for(let M=0;M=b&&(this._combined[z-b+x]=v._combined[z])}}translateToString(v,b,x,y){b=b??0,x=x??this.length,v&&(x=Math.min(x,this.getTrimmedLength())),y&&(y.length=0);let C="";for(;b>22||1}return y&&y.push(b),C}}o.BufferLine=S},4841:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,d){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(l,o)=>{function c(d,_,h){if(_===d.length-1)return d[_].getTrimmedLength();const m=!d[_].hasContent(h-1)&&d[_].getWidth(h-1)===1,g=d[_+1].getWidth(0)===2;return m&&g?h-1:h}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(d,_,h,m,g){const S=[];for(let k=0;k=k&&m0&&(z>y||x[z].getTrimmedLength()===0);z--)M++;M>0&&(S.push(k+x.length-M),S.push(M)),k+=x.length-1}return S},o.reflowLargerCreateNewLayout=function(d,_){const h=[];let m=0,g=_[m],S=0;for(let k=0;kc(d,x,_))).reduce(((b,x)=>b+x));let S=0,k=0,v=0;for(;vb&&(S-=b,k++);const x=d[k].getWidth(S-1)===2;x&&S--;const y=x?h-1:h;m.push(y),v+=y}return m},o.getWrappedLineTrimmedLength=c},5295:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const d=c(8460),_=c(844),h=c(9092);class m extends _.Disposable{constructor(S,k){super(),this._optionsService=S,this._bufferService=k,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(S){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(S),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(S,k){this._normal.resize(S,k),this._alt.resize(S,k),this.setupTabStops(S)}setupTabStops(S){this._normal.setupTabStops(S),this._alt.setupTabStops(S)}}o.BufferSet=m},511:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const d=c(482),_=c(643),h=c(3734);class m extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(S){const k=new m;return k.setFromCharData(S),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(S[_.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(S[_.CHAR_DATA_CHAR_INDEX].length===2){const v=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|S[_.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=S[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[_.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=S[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=m},643:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const d=c(8460),_=c(844);class h{get id(){return this._id}constructor(g){this.line=g,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(g){return this._disposables.push(g),g}}o.Marker=h,h._nextId=1},7116:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,o)=>{var c,d,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=` -`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(o.C0=c={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(d||(o.C1=d={})),(function(h){h.ST=`${c.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const d=c(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(h,m,g,S){const k={type:0,cancel:!1,key:void 0},v=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?k.key=m?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?k.key=m?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?k.key=m?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(k.key=m?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:k.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(k.key=d.C0.ESC+k.key);break;case 9:if(h.shiftKey){k.key=d.C0.ESC+"[Z";break}k.key=d.C0.HT,k.cancel=!0;break;case 13:k.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,k.cancel=!0;break;case 27:k.key=d.C0.ESC,h.altKey&&(k.key=d.C0.ESC+d.C0.ESC),k.cancel=!0;break;case 37:if(h.metaKey)break;v?(k.key=d.C0.ESC+"[1;"+(v+1)+"D",k.key===d.C0.ESC+"[1;3D"&&(k.key=d.C0.ESC+(g?"b":"[1;5D"))):k.key=m?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;v?(k.key=d.C0.ESC+"[1;"+(v+1)+"C",k.key===d.C0.ESC+"[1;3C"&&(k.key=d.C0.ESC+(g?"f":"[1;5C"))):k.key=m?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;v?(k.key=d.C0.ESC+"[1;"+(v+1)+"A",g||k.key!==d.C0.ESC+"[1;3A"||(k.key=d.C0.ESC+"[1;5A")):k.key=m?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;v?(k.key=d.C0.ESC+"[1;"+(v+1)+"B",g||k.key!==d.C0.ESC+"[1;3B"||(k.key=d.C0.ESC+"[1;5B")):k.key=m?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(k.key=d.C0.ESC+"[2~");break;case 46:k.key=v?d.C0.ESC+"[3;"+(v+1)+"~":d.C0.ESC+"[3~";break;case 36:k.key=v?d.C0.ESC+"[1;"+(v+1)+"H":m?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:k.key=v?d.C0.ESC+"[1;"+(v+1)+"F":m?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?k.type=2:h.ctrlKey?k.key=d.C0.ESC+"[5;"+(v+1)+"~":k.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?k.type=3:h.ctrlKey?k.key=d.C0.ESC+"[6;"+(v+1)+"~":k.key=d.C0.ESC+"[6~";break;case 112:k.key=v?d.C0.ESC+"[1;"+(v+1)+"P":d.C0.ESC+"OP";break;case 113:k.key=v?d.C0.ESC+"[1;"+(v+1)+"Q":d.C0.ESC+"OQ";break;case 114:k.key=v?d.C0.ESC+"[1;"+(v+1)+"R":d.C0.ESC+"OR";break;case 115:k.key=v?d.C0.ESC+"[1;"+(v+1)+"S":d.C0.ESC+"OS";break;case 116:k.key=v?d.C0.ESC+"[15;"+(v+1)+"~":d.C0.ESC+"[15~";break;case 117:k.key=v?d.C0.ESC+"[17;"+(v+1)+"~":d.C0.ESC+"[17~";break;case 118:k.key=v?d.C0.ESC+"[18;"+(v+1)+"~":d.C0.ESC+"[18~";break;case 119:k.key=v?d.C0.ESC+"[19;"+(v+1)+"~":d.C0.ESC+"[19~";break;case 120:k.key=v?d.C0.ESC+"[20;"+(v+1)+"~":d.C0.ESC+"[20~";break;case 121:k.key=v?d.C0.ESC+"[21;"+(v+1)+"~":d.C0.ESC+"[21~";break;case 122:k.key=v?d.C0.ESC+"[23;"+(v+1)+"~":d.C0.ESC+"[23~";break;case 123:k.key=v?d.C0.ESC+"[24;"+(v+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(g&&!S||!h.altKey||h.metaKey)!g||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?k.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(k.key=d.C0.US),h.key==="@"&&(k.key=d.C0.NUL)):h.keyCode===65&&(k.type=1);else{const b=_[h.keyCode],x=b==null?void 0:b[h.shiftKey?1:0];if(x)k.key=d.C0.ESC+x;else if(h.keyCode>=65&&h.keyCode<=90){const y=h.ctrlKey?h.keyCode-64:h.keyCode+32;let C=String.fromCharCode(y);h.shiftKey&&(C=C.toUpperCase()),k.key=d.C0.ESC+C}else if(h.keyCode===32)k.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let y=h.code.slice(3,4);h.shiftKey||(y=y.toLowerCase()),k.key=d.C0.ESC+y,k.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?k.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?k.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?k.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?k.key=d.C0.DEL:h.keyCode===219?k.key=d.C0.ESC:h.keyCode===220?k.key=d.C0.FS:h.keyCode===221&&(k.key=d.C0.GS)}return k}},482:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,d=0,_=c.length){let h="";for(let m=d;m<_;++m){let g=c[m];g>65535?(g-=65536,h+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):h+=String.fromCharCode(g)}return h},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const _=c.length;if(!_)return 0;let h=0,m=0;if(this._interim){const g=c.charCodeAt(m++);56320<=g&&g<=57343?d[h++]=1024*(this._interim-55296)+g-56320+65536:(d[h++]=this._interim,d[h++]=g),this._interim=0}for(let g=m;g<_;++g){const S=c.charCodeAt(g);if(55296<=S&&S<=56319){if(++g>=_)return this._interim=S,h;const k=c.charCodeAt(g);56320<=k&&k<=57343?d[h++]=1024*(S-55296)+k-56320+65536:(d[h++]=S,d[h++]=k)}else S!==65279&&(d[h++]=S)}return h}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const _=c.length;if(!_)return 0;let h,m,g,S,k=0,v=0,b=0;if(this.interim[0]){let C=!1,j=this.interim[0];j&=(224&j)==192?31:(240&j)==224?15:7;let N,M=0;for(;(N=63&this.interim[++M])&&M<4;)j<<=6,j|=N;const z=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,D=z-M;for(;b=_)return 0;if(N=c[b++],(192&N)!=128){b--,C=!0;break}this.interim[M++]=N,j<<=6,j|=63&N}C||(z===2?j<128?b--:d[k++]=j:z===3?j<2048||j>=55296&&j<=57343||j===65279||(d[k++]=j):j<65536||j>1114111||(d[k++]=j)),this.interim.fill(0)}const x=_-4;let y=b;for(;y<_;){for(;!(!(y=_)return this.interim[0]=h,k;if(m=c[y++],(192&m)!=128){y--;continue}if(v=(31&h)<<6|63&m,v<128){y--;continue}d[k++]=v}else if((240&h)==224){if(y>=_)return this.interim[0]=h,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=h,this.interim[1]=m,k;if(g=c[y++],(192&g)!=128){y--;continue}if(v=(15&h)<<12|(63&m)<<6|63&g,v<2048||v>=55296&&v<=57343||v===65279)continue;d[k++]=v}else if((248&h)==240){if(y>=_)return this.interim[0]=h,k;if(m=c[y++],(192&m)!=128){y--;continue}if(y>=_)return this.interim[0]=h,this.interim[1]=m,k;if(g=c[y++],(192&g)!=128){y--;continue}if(y>=_)return this.interim[0]=h,this.interim[1]=m,this.interim[2]=g,k;if(S=c[y++],(192&S)!=128){y--;continue}if(v=(7&h)<<18|(63&m)<<12|(63&g)<<6|63&S,v<65536||v>1114111)continue;d[k++]=v}}return k}}},225:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const d=c(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let m;o.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let g=0;g<_.length;++g)m.fill(0,_[g][0],_[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?m[g]:(function(S,k){let v,b=0,x=k.length-1;if(Sk[x][1])return!1;for(;x>=b;)if(v=b+x>>1,S>k[v][1])b=v+1;else{if(!(S=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,S){let k=this.wcwidth(g),v=k===0&&S!==0;if(v){const b=d.UnicodeService.extractWidth(S);b===0?v=!1:b>k&&(k=b)}return d.UnicodeService.createPropertyValue(0,k,v)}}},5981:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const d=c(8460),_=c(844);class h extends _.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,S){if(S!==void 0&&this._syncCalls>S)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let k;for(this._isSyncWriting=!0;k=this._writeBuffer.shift();){this._action(k);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,S){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(S)}_innerWrite(g=0,S=!0){const k=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,S);if(b){const y=C=>Date.now()-k>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(k,C);return void b.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(y)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-k>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=h},5941:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function _(h,m){const g=h.toString(16),S=g.length<2?"0"+g:g;switch(m){case 4:return g[0];case 8:return S;case 12:return(S+S).slice(0,3);default:return S+S}}o.parseColor=function(h){if(!h)return;let m=h.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const g=c.exec(m);if(g){const S=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/S*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/S*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/S*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),d.exec(m)&&[3,6,9,12].includes(m.length))){const g=m.length/3,S=[0,0,0];for(let k=0;k<3;++k){const v=parseInt(m.slice(g*k,g*k+g),16);S[k]=g===1?v<<4:g===2?v:g===3?v>>4:v>>8}return S}},o.toRgbString=function(h,m=16){const[g,S,k]=h;return`rgb:${_(g,m)}/${_(S,m)}/${_(k,m)}`}},5770:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const d=c(482),_=c(8742),h=c(5770),m=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(S,k){this._handlers[S]===void 0&&(this._handlers[S]=[]);const v=this._handlers[S];return v.push(k),{dispose:()=>{const b=v.indexOf(k);b!==-1&&v.splice(b,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}reset(){if(this._active.length)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(S,k){if(this.reset(),this._ident=S,this._active=this._handlers[S]||m,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(k);else this._handlerFb(this._ident,"HOOK",k)}put(S,k,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(S,k,v);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(S,k,v))}unhook(S,k=!0){if(this._active.length){let v=!1,b=this._active.length-1,x=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=k,x=this._stack.fallThrough,this._stack.paused=!1),!x&&v===!1){for(;b>=0&&(v=this._active[b].unhook(S),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",S);this._active=m,this._ident=0}};const g=new _.Params;g.addParam(0),o.DcsHandler=class{constructor(S){this._handler=S,this._data="",this._params=g,this._hitLimit=!1}hook(S){this._params=S.length>1||S.params[0]?S.clone():g,this._data="",this._hitLimit=!1}put(S,k,v){this._hitLimit||(this._data+=(0,d.utf32ToString)(S,k,v),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(S){let k=!1;if(this._hitLimit)k=!1;else if(S&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((v=>(this._params=g,this._data="",this._hitLimit=!1,v)));return this._params=g,this._data="",this._hitLimit=!1,k}}},2015:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const d=c(844),_=c(8742),h=c(6242),m=c(6351);class g{constructor(b){this.table=new Uint8Array(b)}setDefault(b,x){this.table.fill(b<<4|x)}add(b,x,y,C){this.table[x<<8|b]=y<<4|C}addMany(b,x,y,C){for(let j=0;jz)),x=(M,z)=>b.slice(M,z),y=x(32,127),C=x(0,24);C.push(25),C.push.apply(C,x(28,32));const j=x(0,14);let N;for(N in v.setDefault(1,0),v.addMany(y,0,2,0),j)v.addMany([24,26,153,154],N,3,0),v.addMany(x(128,144),N,3,0),v.addMany(x(144,152),N,3,0),v.add(156,N,0,0),v.add(27,N,11,1),v.add(157,N,4,8),v.addMany([152,158,159],N,0,7),v.add(155,N,11,3),v.add(144,N,11,9);return v.addMany(C,0,3,0),v.addMany(C,1,3,1),v.add(127,1,0,1),v.addMany(C,8,0,8),v.addMany(C,3,3,3),v.add(127,3,0,3),v.addMany(C,4,3,4),v.add(127,4,0,4),v.addMany(C,6,3,6),v.addMany(C,5,3,5),v.add(127,5,0,5),v.addMany(C,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(y,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(x(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(y,7,0,7),v.addMany(C,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(x(64,127),3,7,0),v.addMany(x(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(x(48,60),4,8,4),v.addMany(x(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(x(32,64),6,0,6),v.add(127,6,0,6),v.addMany(x(64,127),6,0,0),v.addMany(x(32,48),3,9,5),v.addMany(x(32,48),5,9,5),v.addMany(x(48,64),5,0,6),v.addMany(x(64,127),5,7,0),v.addMany(x(32,48),4,9,5),v.addMany(x(32,48),1,9,2),v.addMany(x(32,48),2,9,2),v.addMany(x(48,127),2,10,0),v.addMany(x(48,80),1,10,0),v.addMany(x(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(x(96,127),1,10,0),v.add(80,1,11,9),v.addMany(C,9,0,9),v.add(127,9,0,9),v.addMany(x(28,32),9,0,9),v.addMany(x(32,48),9,9,12),v.addMany(x(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(C,11,0,11),v.addMany(x(32,128),11,0,11),v.addMany(x(28,32),11,0,11),v.addMany(C,10,0,10),v.add(127,10,0,10),v.addMany(x(28,32),10,0,10),v.addMany(x(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(x(32,48),10,9,12),v.addMany(C,12,0,12),v.add(127,12,0,12),v.addMany(x(28,32),12,0,12),v.addMany(x(32,48),12,9,12),v.addMany(x(48,64),12,0,11),v.addMany(x(64,127),12,12,13),v.addMany(x(64,127),10,12,13),v.addMany(x(64,127),9,12,13),v.addMany(C,13,13,13),v.addMany(y,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(S,0,2,0),v.add(S,8,5,8),v.add(S,6,0,6),v.add(S,11,0,11),v.add(S,13,13,13),v})();class k extends d.Disposable{constructor(b=o.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,y,C)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,y)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,x=[64,126]){let y=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=b.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let j=0;jN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=N}}if(b.final.length!==1)throw new Error("final must be a single byte");const C=b.final.charCodeAt(0);if(x[0]>C||C>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return y<<=8,y|=C,y}identToString(b){const x=[];for(;b;)x.push(String.fromCharCode(255&b)),b>>=8;return x.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,x){const y=this._identifier(b,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const C=this._escHandlers[y];return C.push(x),{dispose:()=>{const j=C.indexOf(x);j!==-1&&C.splice(j,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,x){this._executeHandlers[b.charCodeAt(0)]=x}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,x){const y=this._identifier(b);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const C=this._csiHandlers[y];return C.push(x),{dispose:()=>{const j=C.indexOf(x);j!==-1&&C.splice(j,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,x){return this._dcsParser.registerHandler(this._identifier(b),x)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,x){return this._oscParser.registerHandler(b,x)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(b,x,y,C,j){this._parseStack.state=b,this._parseStack.handlers=x,this._parseStack.handlerPos=y,this._parseStack.transition=C,this._parseStack.chunkPos=j}parse(b,x,y){let C,j=0,N=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const z=this._parseStack.handlers;let D=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&D>-1){for(;D>=0&&(C=z[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 4:if(y===!1&&D>-1){for(;D>=0&&(C=z[D](),C!==!0);D--)if(C instanceof Promise)return this._parseStack.handlerPos=D,C}this._parseStack.handlers=[];break;case 6:if(j=b[this._parseStack.chunkPos],C=this._dcsParser.unhook(j!==24&&j!==26,y),C)return C;j===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(j=b[this._parseStack.chunkPos],C=this._oscParser.end(j!==24&&j!==26,y),C)return C;j===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let z=M;z>4){case 2:for(let F=z+1;;++F){if(F>=x||(j=b[F])<32||j>126&&j=x||(j=b[F])<32||j>126&&j=x||(j=b[F])<32||j>126&&j=x||(j=b[F])<32||j>126&&j=0&&(C=D[I](this._params),C!==!0);I--)if(C instanceof Promise)return this._preserveStack(3,D,I,N,z),C;I<0&&this._csiHandlerFb(this._collect<<8|j,this._params),this.precedingJoinState=0;break;case 8:do switch(j){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(j-48)}while(++z47&&j<60);z--;break;case 9:this._collect<<=8,this._collect|=j;break;case 10:const $=this._escHandlers[this._collect<<8|j];let P=$?$.length-1:-1;for(;P>=0&&(C=$[P](),C!==!0);P--)if(C instanceof Promise)return this._preserveStack(4,$,P,N,z),C;P<0&&this._escHandlerFb(this._collect<<8|j),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|j,this._params);break;case 13:for(let F=z+1;;++F)if(F>=x||(j=b[F])===24||j===26||j===27||j>127&&j=x||(j=b[F])<32||j>127&&j{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const d=c(5770),_=c(482),h=[];o.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,g){this._handlers[m]===void 0&&(this._handlers[m]=[]);const S=this._handlers[m];return S.push(g),{dispose:()=>{const k=S.indexOf(g);k!==-1&&S.splice(k,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,g,S){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(m,g,S);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(m,g,S))}start(){this.reset(),this._state=1}put(m,g,S){if(this._state!==3){if(this._state===1)for(;g0&&this._put(m,g,S)}}end(m,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let S=!1,k=this._active.length-1,v=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,S=g,v=this._stack.fallThrough,this._stack.paused=!1),!v&&S===!1){for(;k>=0&&(S=this._active[k].end(m),S!==!0);k--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,S;k--}for(;k>=0;k--)if(S=this._active[k].end(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,S}else this._handlerFb(this._id,"END",m);this._active=h,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,g,S){this._hitLimit||(this._data+=(0,_.utf32ToString)(m,g,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let g=!1;if(this._hitLimit)g=!1;else if(m&&(g=this._handler(this._data),g instanceof Promise))return g.then((S=>(this._data="",this._hitLimit=!1,S)));return this._data="",this._hitLimit=!1,g}}},8742:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class d{static fromArray(h){const m=new d;if(!h.length)return m;for(let g=Array.isArray(h[0])?1:0;g256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let m=0;m>8,S=255&this._subParamsIdx[m];S-g>0&&h.push(Array.prototype.slice.call(this._subParams,g,S))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const m=this._subParamsIdx[h]>>8,g=255&this._subParamsIdx[h];return g-m>0?this._subParams.subarray(m,g):null}getSubParamsAll(){const h={};for(let m=0;m>8,S=255&this._subParamsIdx[m];S-g>0&&(h[m]=this._subParams.slice(g,S))}return h}addDigit(h){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,S=g[m-1];g[m-1]=~S?Math.min(10*S+h,c):h}}o.Params=d},5741:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const _={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(_),d.dispose=()=>this._wrappedAddonDispose(_),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const d=c(3785),_=c(511);o.BufferApiView=class{constructor(h,m){this._buffer=h,this.type=m}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const m=this._buffer.lines.get(h);if(m)return new d.BufferLineApiView(m)}getNullCell(){return new _.CellData}}},3785:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const d=c(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new d.CellData)}translateToString(_,h,m){return this._line.translateToString(_,h,m)}}},8285:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const d=c(8771),_=c(8460),h=c(844);class m extends h.Disposable{constructor(S){super(),this._core=S,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=m},7975:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,(_=>d(_.toArray())))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,((_,h)=>d(_,h.toArray())))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(l,o,c){var d=this&&this.__decorate||function(v,b,x,y){var C,j=arguments.length,N=j<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,x,y);else for(var M=v.length-1;M>=0;M--)(C=v[M])&&(N=(j<3?C(N):j>3?C(b,x,N):C(b,x))||N);return j>3&&N&&Object.defineProperty(b,x,N),N},_=this&&this.__param||function(v,b){return function(x,y){b(x,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const h=c(8460),m=c(844),g=c(5295),S=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let k=o.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const x=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===v.fg&&y.getBg(0)===v.bg||(y=x.getBlankLine(v,b),this._cachedBlankLine=y),y.isWrapped=b;const C=x.ybase+x.scrollTop,j=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;j===x.lines.length-1?N?x.lines.recycle().copyFrom(y):x.lines.push(y.clone()):x.lines.splice(j+1,0,y.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=j-C+1;x.lines.shiftElements(C+1,N-1,-1),x.lines.set(j,y.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(v,b,x){const y=this.buffer;if(v<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else v+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const C=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+v,y.ybase),0),C!==y.ydisp&&(b||this._onScroll.fire(y.ydisp))}};o.BufferService=k=d([_(0,S.IOptionsService)],k)},7994:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(l,o,c){var d=this&&this.__decorate||function(y,C,j,N){var M,z=arguments.length,D=z<3?C:N===null?N=Object.getOwnPropertyDescriptor(C,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,C,j,N);else for(var I=y.length-1;I>=0;I--)(M=y[I])&&(D=(z<3?M(D):z>3?M(C,j,D):M(C,j))||D);return z>3&&D&&Object.defineProperty(C,j,D),D},_=this&&this.__param||function(y,C){return function(j,N){C(j,N,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const h=c(2585),m=c(8460),g=c(844),S={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function k(y,C){let j=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(j|=64,j|=y.action):(j|=3&y.button,4&y.button&&(j|=64),8&y.button&&(j|=128),y.action===32?j|=32:y.action!==0||C||(j|=3)),j}const v=String.fromCharCode,b={DEFAULT:y=>{const C=[k(y,!1)+32,y.col+32,y.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${v(C[0])}${v(C[1])}${v(C[2])}`},SGR:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${k(y,!0)};${y.col};${y.row}${C}`},SGR_PIXELS:y=>{const C=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${k(y,!0)};${y.x};${y.y}${C}`}};let x=o.CoreMouseService=class extends g.Disposable{constructor(y,C){super(),this._bufferService=y,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const j of Object.keys(S))this.addProtocol(j,S[j]);for(const j of Object.keys(b))this.addEncoding(j,b[j]);this.reset()}addProtocol(y,C){this._protocols[y]=C}addEncoding(y,C){this._encodings[y]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const C=this._encodings[this._activeEncoding](y);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,C,j){if(j){if(y.x!==C.x||y.y!==C.y)return!1}else if(y.col!==C.col||y.row!==C.row)return!1;return y.button===C.button&&y.action===C.action&&y.ctrl===C.ctrl&&y.alt===C.alt&&y.shift===C.shift}};o.CoreMouseService=x=d([_(0,h.IBufferService),_(1,h.ICoreService)],x)},6975:function(l,o,c){var d=this&&this.__decorate||function(x,y,C,j){var N,M=arguments.length,z=M<3?y:j===null?j=Object.getOwnPropertyDescriptor(y,C):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(x,y,C,j);else for(var D=x.length-1;D>=0;D--)(N=x[D])&&(z=(M<3?N(z):M>3?N(y,C,z):N(y,C))||z);return M>3&&z&&Object.defineProperty(y,C,z),z},_=this&&this.__param||function(x,y){return function(C,j){y(C,j,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const h=c(1439),m=c(8460),g=c(844),S=c(2585),k=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=o.CoreService=class extends g.Disposable{constructor(x,y,C){super(),this._bufferService=x,this._logService=y,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.clone)(v)}reset(){this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.clone)(v)}triggerDataEvent(x,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((j=>j.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=b=d([_(0,S.IBufferService),_(1,S.ILogService),_(2,S.IOptionsService)],b)},9074:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const d=c(8055),_=c(8460),h=c(844),m=c(6106);let g=0,S=0;class k extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const y=new v(x);if(y){const C=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),C.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,y,C){let j=0,N=0;for(const M of this._decorations.getKeyIterator(y))j=M.options.x??0,N=j+(M.options.width??1),x>=j&&x{g=N.options.x??0,S=g+(N.options.width??1),x>=g&&x{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const d=c(2585),_=c(8343);class h{constructor(...g){this._entries=new Map;for(const[S,k]of g)this.set(S,k)}set(g,S){const k=this._entries.get(g);return this._entries.set(g,S),k}forEach(g){for(const[S,k]of this._entries.entries())g(S,k)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=h,o.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(m,g){this._services.set(m,g)}getService(m){return this._services.get(m)}createInstance(m,...g){const S=(0,_.getServiceDependencies)(m).sort(((b,x)=>b.index-x.index)),k=[];for(const b of S){const x=this._services.get(b.id);if(!x)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${b.id}.`);k.push(x)}const v=S.length>0?S[0].index:g.length;if(g.length!==v)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${v+1} conflicts with ${g.length} static arguments`);return new m(...g,...k)}}},7866:function(l,o,c){var d=this&&this.__decorate||function(v,b,x,y){var C,j=arguments.length,N=j<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,x):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,b,x,y);else for(var M=v.length-1;M>=0;M--)(C=v[M])&&(N=(j<3?C(N):j>3?C(b,x,N):C(b,x))||N);return j>3&&N&&Object.defineProperty(b,x,N),N},_=this&&this.__param||function(v,b){return function(x,y){b(x,y,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const h=c(844),m=c(2585),g={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let S,k=o.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;bJSON.stringify(N))).join(", ")})`);const j=y.apply(this,C);return S.trace(`GlyphRenderer#${y.name} return`,j),j}}},7302:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const d=c(8460),_=c(844),h=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class g extends _.Disposable{constructor(k){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const b in k)if(b in v)try{const x=k[b];v[b]=this._sanitizeAndValidateOption(b,x)}catch(x){console.error(x)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(k,v){return this.onOptionChange((b=>{b===k&&v(this.rawOptions[k])}))}onMultipleOptionChange(k,v){return this.onOptionChange((b=>{k.indexOf(b)!==-1&&v()}))}_setupOptions(){const k=b=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,x)=>{if(!(b in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);x=this._sanitizeAndValidateOption(b,x),this.rawOptions[b]!==x&&(this.rawOptions[b]=x,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const x={get:k.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,x)}}_sanitizeAndValidateOption(k,v){switch(k){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[k]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${k}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=m.includes(v)?v:o.DEFAULT_OPTIONS[k];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${k} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${k} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${k} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${k} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=g},2660:function(l,o,c){var d=this&&this.__decorate||function(g,S,k,v){var b,x=arguments.length,y=x<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,k):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(g,S,k,v);else for(var C=g.length-1;C>=0;C--)(b=g[C])&&(y=(x<3?b(y):x>3?b(S,k,y):b(S,k))||y);return x>3&&y&&Object.defineProperty(S,k,y),y},_=this&&this.__param||function(g,S){return function(k,v){S(k,v,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const h=c(2585);let m=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const S=this._bufferService.buffer;if(g.id===void 0){const C=S.addMarker(S.ybase+S.y),j={data:g,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(j,C))),this._dataByLinkId.set(j.id,j),j.id}const k=g,v=this._getEntryIdKey(k),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,S.ybase+S.y),b.id;const x=S.addMarker(S.ybase+S.y),y={id:this._nextId++,key:this._getEntryIdKey(k),data:k,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(y,x))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(g,S){const k=this._dataByLinkId.get(g);if(k&&k.lines.every((v=>v.line!==S))){const v=this._bufferService.buffer.addMarker(S);k.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(k,v)))}}getLinkData(g){var S;return(S=this._dataByLinkId.get(g))==null?void 0:S.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,S){const k=g.lines.indexOf(S);k!==-1&&(g.lines.splice(k,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=m=d([_(0,h.IBufferService)],m)},8343:(l,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",d="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[d]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const h=function(m,g,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(k,v,b){v[c]===v?v[d].push({id:k,index:b}):(v[d]=[{id:k,index:b}],v[c]=v)})(h,m,S)};return h.toString=()=>_,o.serviceRegistry.set(_,h),h}},2585:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const d=c(8343);var _;o.IBufferService=(0,d.createDecorator)("BufferService"),o.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),o.ICoreService=(0,d.createDecorator)("CoreService"),o.ICharsetService=(0,d.createDecorator)("CharsetService"),o.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,d.createDecorator)("LogService"),o.IOptionsService=(0,d.createDecorator)("OptionsService"),o.IOscLinkService=(0,d.createDecorator)("OscLinkService"),o.IUnicodeService=(0,d.createDecorator)("UnicodeService"),o.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(l,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const d=c(8460),_=c(225);class h{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,S,k=!1){return(16777215&g)<<3|(3&S)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const g=new _.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let S=0,k=0;const v=g.length;for(let b=0;b=v)return S+this.wcwidth(x);const j=g.charCodeAt(b);56320<=j&&j<=57343?x=1024*(x-55296)+j-56320+65536:S+=this.wcwidth(j)}const y=this.charProperties(x,k);let C=h.extractWidth(y);h.extractShouldJoin(y)&&(C-=h.extractWidth(k)),S+=C,k=y}return S}charProperties(g,S){return this._activeProvider.charProperties(g,S)}}o.UnicodeService=h}},r={};function s(l){var o=r[l];if(o!==void 0)return o.exports;var c=r[l]={exports:{}};return t[l].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var l=i;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const o=s(9042),c=s(3236),d=s(844),_=s(5741),h=s(8285),m=s(7975),g=s(7090),S=["cols","rows"];class k extends d.Disposable{constructor(b){super(),this._core=this.register(new c.Terminal(b)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const x=C=>this._core.options[C],y=(C,j)=>{this._checkReadonlyOptions(C),this._core.options[C]=j};for(const C in this._core.options){const j={get:x.bind(this,C),set:y.bind(this,C)};Object.defineProperty(this._publicOptions,C,j)}}_checkReadonlyOptions(b){if(S.includes(b))throw new Error(`Option "${b}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const x in b)this._publicOptions[x]=b[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,x=!0){this._core.input(b,x)}resize(b,x){this._verifyIntegers(b,x),this._core.resize(b,x)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){return this._checkProposedApi(),this._verifyPositiveIntegers(b.x??0,b.width??0,b.height??0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,x,y){this._verifyIntegers(b,x,y),this._core.select(b,x,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,x){this._verifyIntegers(b,x),this._core.selectLines(b,x)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,x){this._core.write(b,x)}writeln(b,x){this._core.write(b),this._core.write(`\r -`,x)}paste(b){this._core.paste(b)}refresh(b,x){this._verifyIntegers(b,x),this._core.refresh(b,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return o}_verifyIntegers(...b){for(const x of b)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const x of b)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}l.Terminal=k})(),i})()))})(lv)),lv.exports}var fht=dht();function T4(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new fht.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new lht.FitAddon;s.loadAddon(i),t&&s.loadAddon(new uht.WebLinksAddon((c,d)=>{let _;try{_=new URL(d)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const l=()=>{try{i.fit()}catch{}};l();const o=new ResizeObserver(l);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const WT="overflow-hidden rounded-md bg-terminal p-2";function e_(e){return typeof e=="object"&&e!==null}function KT(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function hht(e){return e_(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||KT(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function _ht(e){return e_(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&KT(e.partitions)&&(e.error===null||typeof e.error=="string")}function pht(e){return!e_(e)||e.type!=="complete"?null:e.backend==="ssh"&&hht(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&_ht(e.result)?{backend:"slurm",result:e.result}:null}function mht(e){return e_(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function M4({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const l=new URLSearchParams({host:e,backend:n});return f.jsx(YT,{path:`${t}?${l}`,label:FN({host:Ee(e)}),active:r,onError:i,onComplete:o=>{const c=pht(o);return c?(s(c),!0):!1}})}function ght({login:e,onComplete:n,onError:t}){return f.jsx(YT,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!e_(r)||r.type!=="complete"?!1:(n(),!0)})}function YT({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const l=T.useRef(null),o=T.useRef(null),c=T.useRef(s),d=T.useRef(i),[_,h]=T.useState(null);return c.current=s,d.current=i,T.useEffect(()=>{const m=l.current;if(!m)return;const{terminal:g,dispose:S}=T4(m,!1,!0);o.current=g,g.focus();const k=location.protocol==="https:"?"wss:":"ws:",v=new URL(e,`${k}//${location.host}`),b=new WebSocket(v);b.binaryType="arraybuffer";let x=!1,y=!1,C=!1;const j=z=>{var D;y||(y=!0,C||g.writeln(z),g.options.disableStdin=!0,g.blur(),h(z),(D=d.current)==null||D.call(d,z))},N=g.onData(z=>{b.readyState===WebSocket.OPEN&&b.send(new TextEncoder().encode(z))}),M=g.onResize(({cols:z,rows:D})=>{b.readyState===WebSocket.OPEN&&b.send(JSON.stringify({type:"resize",cols:z,rows:D}))});return b.onopen=()=>{b.send(JSON.stringify({type:"resize",cols:g.cols,rows:g.rows}))},b.onmessage=z=>{if(z.data instanceof ArrayBuffer){C=!0,g.write(new Uint8Array(z.data));return}if(typeof z.data!="string")return;let D;try{D=JSON.parse(z.data)}catch{return}if(c.current(D)){x=!0,b.close();return}const I=mht(D);I&&j(I)},b.onerror=()=>j(xS()),b.onclose=()=>{!x&&!y&&j(xS())},()=>{b.onopen=null,b.onmessage=null,b.onerror=null,b.onclose=null,N.dispose(),M.dispose(),b.close(),o.current=null,S()}},[e]),T.useEffect(()=>{const m=o.current;m&&(m.options.disableStdin=!r||_!==null,r&&_===null?m.focus():m.blur())},[r,_]),f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:`${t} ${WT}`,role:"group","aria-label":n,children:f.jsx("div",{ref:l,className:"h-full overflow-hidden"})}),_?f.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function bht({host:e,transcript:n}){const t=T.useRef(null);return T.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=T4(r,!0,!0);return s.write(n),i},[n]),f.jsx("div",{className:`mt-3 h-40 ${WT}`,role:"group","aria-label":FN({host:Ee(e)}),children:f.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}const Pp="font-mono text-sm leading-[1.55] [tab-size:4]",XT="whitespace-pre-wrap break-words",ZT="file-view-gutter text-right text-muted select-none";function QT(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function JT({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:l,scrollRequest:o,onScrollRequestHandled:c}){const d=T.useMemo(()=>LT(e,e4(i)),[e,i]),{ruleCh:_,codeCh:h}=QT(d.length),m=T.useRef(null),g=T.useRef(null),S=()=>{const b=m.current;b&&g.current&&(g.current.scrollTop=b.scrollTop)};T.useLayoutEffect(S,[e]),T.useLayoutEffect(()=>{var N;const b=m.current;if(!b||!l)return;const x=e.split(` -`),y=Math.min(Math.max(Math.trunc(l),1),x.length);let C=0;for(let M=0;M{if(!s){if((b.metaKey||b.ctrlKey)&&b.key.toLowerCase()==="s"){b.preventDefault(),t();return}if(b.key==="Tab"){b.preventDefault();const x=b.currentTarget,{selectionStart:y,selectionEnd:C}=x,j=e.slice(0,y)+" "+e.slice(C);n(j),requestAnimationFrame(()=>{x.selectionStart=x.selectionEnd=y+1})}}},v=`absolute inset-0 m-0 py-3.5 pe-4 ${Pp} ${XT} [scrollbar-gutter:stable]`;return f.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${Pp}`,children:[f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${_}ch`},"aria-hidden":"true"}),f.jsx("div",{ref:g,className:`file-view-code ${v} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:d.map((b,x)=>f.jsxs("div",{"data-line":x+1,className:"relative",style:{paddingInlineStart:`${h}ch`},children:[f.jsx("span",{className:`${ZT} absolute start-0 pe-[1ch]`,style:{width:`${_}ch`},children:x+1}),OT(b)?f.jsx("br",{}):b]},x))}),f.jsx("textarea",{ref:m,className:`file-view-editarea ${v} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${h}ch`},value:e,onChange:b=>{s||n(b.target.value)},onScroll:S,onKeyDown:k,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}const vht='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function R4(e,n,t="[data-initial-focus]"){const r=T.useRef(n);r.current=n,T.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,l=()=>[...s.querySelectorAll(vht)];(s.querySelector(t)??l()[0]??s).focus();const o=c=>{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key!=="Tab")return;const d=l(),_=d[0],h=d.at(-1);!_||!h?(c.preventDefault(),s.focus()):c.shiftKey&&document.activeElement===_?(c.preventDefault(),h.focus()):!c.shiftKey&&document.activeElement===h&&(c.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function eM({onClose:e,onSaved:n}){const[t,r]=T.useState(null),[s,i]=T.useState(""),[l,o]=T.useState(null),[c,d]=T.useState(!1),_=T.useRef(null),h=T.useRef(e),m=t!==null&&s!==t.content,g=T.useRef(m),S=T.useRef(c);g.current=m,S.current=c,h.current=e,T.useEffect(()=>{aJe().then(b=>{r(b),i(b.content)}).catch(b=>o(b instanceof Error?b.message:String(b)))},[]);const k=()=>{S.current||g.current&&!window.confirm(jqe())||h.current()};R4(_,k,"textarea");async function v(){if(!(!t||!m||c)){d(!0);try{await oJe(s,t.content),r({...t,content:s}),n==null||n(),fr(Iqe(),"success")}catch(b){fr(b instanceof Error?b.message:String(b),"error")}finally{d(!1)}}}return Ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:b=>{b.target===b.currentTarget&&k()},children:f.jsxs("div",{ref:_,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:Pqe()}),f.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),f.jsx(qt,{className:"absolute end-3.5 top-3.5","aria-label":Cqe(),onClick:k,disabled:c,children:f.jsx(Br,{size:16})}),f.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:l?f.jsx("p",{className:"m-5 text-sm text-accent-red",children:l}):t===null?f.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[f.jsx(Rt,{})," ",Rqe()]}):f.jsx(JT,{value:s,onChange:i,onSave:()=>void v(),path:t.path})}),f.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[f.jsx(He,{onClick:k,disabled:c,children:Hh()}),f.jsx(He,{variant:"primary",onClick:()=>void v(),disabled:!m||c,children:c?qi():Fa()})]})]})}),document.body)}const Ha=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),_d=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),xht=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),Dm="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Pi=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),D4=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Co=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),X2=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),lp=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Tu=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function cv(e){return e.agentReady?{cls:"ok",variant:"success",label:JIe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:aRe()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:Yv()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:_$e()}:{cls:"warn",variant:"warning",label:DN()}:{cls:"warn",variant:"warning",label:DLe()}}function yht({h:e}){return e.authMethod?f.jsx(f.Fragment,{children:e.authMethod==="oauth"?Dje():qx()}):f.jsx(f.Fragment,{children:"—"})}function wht(){const[e,n]=T.useState(null),[t,r]=T.useState("claude-code"),[s,i]=T.useState(!1),l=(c,d=!1)=>{i(!0),Ep(c,d).then(n).catch(()=>{}).finally(()=>i(!1))};T.useEffect(()=>l(!1),[]),T.useEffect(()=>uy(()=>l(!0)),[]);const o=e==null?void 0:e.find(c=>c.id===t);return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:PMe()}),f.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(c=>f.jsxs("button",{className:c.id===t?"active":"",onClick:()=>r(c.id),children:[c.name,f.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${cv(c).cls}`})]},c.id))}),e?o?f.jsxs("div",{className:Ha,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx(Mt,{variant:cv(o).variant,children:cv(o).label}),f.jsx("div",{className:"spacer flex-1"}),f.jsxs(He,{size:"small",onClick:()=>l(!0,!0),disabled:s,children:[f.jsx(ua,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Fh()]})]}),f.jsxs("div",{className:_d,children:[f.jsx("span",{className:"k",children:jAe()}),f.jsx("span",{className:"v",children:o.binPath??bje()}),f.jsx("span",{className:"k",children:$N()}),f.jsx("span",{className:"v",children:o.version??"—"}),f.jsx("span",{className:"k",children:uAe()}),f.jsx("span",{className:"v",children:f.jsx(yht,{h:o})}),o.account&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:o.id==="opencode"?W$e():Wx()}),f.jsx("span",{className:"v",children:o.account})]}),o.org&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:gOe()}),f.jsx("span",{className:"v",children:o.org})]}),o.plan&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:KOe()}),f.jsx("span",{className:"v",children:o.plan})]}),f.jsx("span",{className:"k",children:rAe()}),f.jsx("span",{className:"v",children:o.models.length>0?Bze({count:Gt(o.models.length),models:new Intl.ListFormat(E()).format(o.models.slice(0,4).map(c=>Ee(Sp(c))))}):Vx()})]}),o.agentNote&&f.jsx("p",{className:Pi,children:Qh(o.agentNote)})]}):null:f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",lMe()]})]})}function Sht({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?f.jsx(Mt,{variant:"success",children:vTe()}):f.jsx(Mt,{variant:"error",children:sLe()}):f.jsx(Mt,{variant:"error",children:lTe()}):f.jsx(Mt,{variant:"error",children:jRe()})}function kht({onEditState:e}){const[n,t]=T.useState(null),[r,s]=T.useState(null),[i,l]=T.useState(""),[o,c]=T.useState(""),[d,_]=T.useState(!1),[h,m]=T.useState(!1),[g,S]=T.useState(null),k=C=>{t(C),l(C.context??""),c(C.namespace)};T.useEffect(()=>{AS().then(k).catch(C=>s(C instanceof Error?C.message:String(C)))},[]);const v=n!==null&&i===(n.context??"")&&o.trim()===n.namespace,b=n!==null&&!v;T.useEffect(()=>{e==null||e({dirty:b,saving:d})},[b,d,e]);async function x(){if(!(h||d||!v)){m(!0);try{t(await AS())}catch(C){fr(C instanceof Error?C.message:String(C),"error")}finally{m(!1)}}}async function y(C){if(C.preventDefault(),!(d||h)){_(!0),S(null);try{k(await JQe({context:i,namespace:o.trim()}))}catch(j){S(j instanceof Error?j.message:String(j))}finally{_(!1)}}}return f.jsx(f.Fragment,{children:r?f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r}):n?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"text-subtext",children:kd()}),f.jsx("dd",{className:"m-0",children:h||d?f.jsx(Mt,{children:la()}):b?f.jsx(Mt,{children:aN()}):f.jsx(Sht,{s:n})})]}),v&&!h&&!d&&n.preflight.error&&f.jsx("p",{className:`${Dm} break-words`,children:n.preflight.error}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:y,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[STe(),f.jsx(hh,{choices:[{id:"",label:n.currentContext?QNe({context:Ee(n.currentContext)}):KNe()},...i&&!n.contexts.includes(i)?[{id:i,label:wje({context:Ee(i)})}]:[],...n.contexts.map(C=>({id:C,label:C}))],value:i,variant:"field",dropDown:!0,disabled:d||h,onSelect:l})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[ADe(),f.jsx(ws,{type:"text",value:o,disabled:d||h,onChange:C=>c(C.target.value),placeholder:WTe(),autoComplete:"off",spellCheck:!1})]}),g&&f.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:g}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(He,{type:"button",onClick:()=>void x(),disabled:d||h||!v,children:[f.jsx(ua,{size:13})," ",h?la():$h()]}),f.jsx(He,{variant:"primary",type:"submit",disabled:d||h||v,children:d?qi():Fa()})]})]})]}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",qAe()]})})}function Cht(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[l,o]=T.useState(""),[c,d]=T.useState(!0),[_,h]=T.useState(!1);T.useEffect(()=>{let S=!0;return TS().then(k=>{S&&n(k)}).catch(k=>{S&&r(k instanceof Error?k.message:String(k))}).finally(()=>{S&&d(!1)}),()=>{S=!1}},[]);async function m(){if(!(c||_)){d(!0),r(null);try{n(await TS())}catch(S){n(null),r(S instanceof Error?S.message:String(S))}finally{d(!1)}}}async function g(S){if(S.preventDefault(),!(!s.trim()||!l.trim()||c||_||e!=null&&e.processEnv)){h(!0),r(null);try{n(await eJe(s.trim(),l.trim())),i(""),o("")}catch(k){r(k instanceof Error?k.message:String(k))}finally{h(!1)}}}return f.jsxs(f.Fragment,{children:[c?f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",KAe()]}):e&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:kd()}),f.jsx("dd",{className:"m-0",children:f.jsx(Mt,{variant:e.tokenConfigured?"success":"warning",children:e.tokenConfigured?Yx():rm()})})]}),(e==null?void 0:e.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:_ze()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:g,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e!=null&&e.tokenConfigured?bze():Aze(),f.jsx(ws,{type:"password",value:s,onChange:S=>i(S.target.value),placeholder:(e==null?void 0:e.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:e==null?void 0:e.processEnv})]}),f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e!=null&&e.tokenConfigured?wze():Dze(),f.jsx(ws,{type:"password",value:l,onChange:S=>o(S.target.value),placeholder:(e==null?void 0:e.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:e==null?void 0:e.processEnv})]}),f.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:Eze()}),t&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:t}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(He,{type:"button",disabled:c||_,onClick:()=>void m(),children:[f.jsx(ua,{size:13})," ",Fh()]}),f.jsx(He,{variant:"primary",type:"submit",disabled:!s.trim()||!l.trim()||c||_||(e==null?void 0:e.processEnv),children:_?qi():Fa()})]})]})]})}const tM="rounded-sm border-border-strong bg-surface text-subtext",nM="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",Eht=5e3;function rM(e){const[n,t]=T.useState({}),r=e.join("\0");return T.useEffect(()=>{const i=r?r.split("\0"):[];if(i.length===0){t({});return}let l=!1;const o=async()=>{const d=await Promise.all(i.map(async _=>{try{return[_,(await lJe(_)).running]}catch{return null}}));l||t(_=>{const h={};for(const m of d)m&&(h[m[0]]=m[1]);for(const m of i)h[m]===void 0&&_[m]!==void 0&&(h[m]=_[m]);return h})};o();const c=window.setInterval(o,Eht);return()=>{l=!0,window.clearInterval(c)}},[r]),[n,i=>t(l=>({...l,[i]:!0}))]}function Nht({test:e,connecting:n,masterRunning:t}){if(n)return f.jsx("span",{role:"status",children:f.jsx(Mt,{className:nM,children:kN()})});if(e===void 0)return f.jsx(Mt,{className:tM,children:RN()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?f.jsx(Mt,{className:"rounded-sm",variant:"warning",children:EN()}):f.jsx(Mt,{className:"rounded-sm",variant:"success",children:Ph()}):f.jsx(Mt,{className:"rounded-sm",variant:"error",children:r.length===1?Fze({tool:Ee(r[0])}):Vze()}):f.jsx(Mt,{className:"rounded-sm",variant:"error",children:Kx()});return f.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&f.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:Ba(e.testedAt)})]})}function zht({remote:e=!1}){const[n,t]=T.useState(null),[r,s]=T.useState(!1),[i,l]=T.useState(0),[o,c]=T.useState({}),[d,_]=T.useState({}),[h,m]=T.useState(null),[g,S]=T.useState(!1),[k,v]=T.useState(0),b=e?[]:(n==null?void 0:n.filter(M=>{const z=o[M.host]??M.lastTest;return(z==null?void 0:z.reachable)&&z.toolsFound}).map(M=>M.host))??[],[x,y]=rM(b);T.useEffect(()=>{Cz().then(t).catch(()=>t([]))},[i]);function C(M){S(!1),v(z=>z+1),m(M),_(z=>({...z,[M]:!0}))}function j(){S(!1),m(null)}function N(M,z){_(D=>({...D,[M]:!z}))}return f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-3 flex justify-end",children:f.jsxs(He,{variant:"ghost",onClick:()=>s(!0),children:[f.jsx(fz,{size:14})," ",VN()]})}),n===null?f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",ON()]}):n.length===0?f.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:eLe()}):f.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:n.map(M=>{const z=o[M.host]??M.lastTest,D=h===M.host,I=d[M.host]??!1,$=!e&&(D||(z==null?void 0:z.reachable)===!1),P=`${M.user?`${M.user}@`:""}${M.hostname??M.host}${M.port?`:${M.port}`:""}`;return f.jsxs("div",{children:[f.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[$?f.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":I,"aria-label":I?$I({name:Ee(M.host)}):oB({name:Ee(M.host)}),onClick:F=>{F.stopPropagation(),N(M.host,I)},children:f.jsx(Ua,{size:15,className:`text-muted transition-transform duration-120 ease-standard${I?" rotate-180":""}`})}):f.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"truncate text-base font-medium text-text",title:M.host,children:M.host}),f.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:P,children:P})]})]}),!e&&f.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[f.jsx("div",{className:"text-start",children:f.jsx(Nht,{test:z,connecting:D&&!g,masterRunning:x[M.host]})}),f.jsx(He,{size:"small",type:"button",className:"justify-self-end",onClick:F=>{F.stopPropagation(),D&&!g?j():C(M.host)},disabled:!D&&h!==null&&!g,children:D?g?Ml():Hh():(z==null?void 0:z.reachable)===!1?Ml():z?HN():Gx()})]})]}),$&&(I||D)&&f.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${I?"":" hidden"}`,children:[!D&&(z==null?void 0:z.error)&&f.jsx(bht,{host:M.host,transcript:z.error}),D&&f.jsx(M4,{host:M.host,backend:"ssh",active:I,onComplete:F=>{F.backend==="ssh"&&(c(W=>({...W,[M.host]:F.result})),y(M.host),S(!1),m(null))},onError:F=>{S(!0),c(W=>({...W,[M.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:F,testedAt:Date.now()}}))}},k)]})]},M.host)})}),r&&f.jsx(eM,{onClose:()=>s(!1),onSaved:()=>l(M=>M+1)})]})}function jht({test:e,connecting:n,masterRunning:t}){return n?f.jsx(Mt,{className:nM,children:kN()}):e===null?f.jsx(Mt,{className:tM,children:RN()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?f.jsx(Mt,{className:"rounded-sm",variant:"warning",children:EN()}):f.jsx(Mt,{className:"rounded-sm",variant:"success",children:Ph()}):f.jsx(Mt,{className:"rounded-sm",variant:"error",children:_De()}):f.jsx(Mt,{className:"rounded-sm",variant:"error",children:xLe()}):f.jsx(Mt,{className:"rounded-sm",variant:"error",children:Kx()})}function Aht({remote:e=!1}){const[n,t]=T.useState(null),[r,s]=T.useState(null),[i,l]=T.useState(""),[o,c]=T.useState(""),[d,_]=T.useState(""),[h,m]=T.useState(""),[g,S]=T.useState(!1),[k,v]=T.useState(null),[b,x]=T.useState(null),[y,C]=T.useState(!1),[j,N]=T.useState(!1),[M,z]=T.useState(0),D=!e&&i&&(b!=null&&b.reachable)&&b.slurmFound&&b.toolsFound?[i]:[],[I,$]=rM(D);function P(){N(!1),z(U=>U+1),C(!0)}const F=U=>{t(U),l(U.host??""),c(U.partition??""),_(U.account??""),m(U.timeLimit??"")};T.useEffect(()=>{pJe().then(F).catch(U=>s(U instanceof Error?U.message:String(U)))},[]);const W=n!==null&&i===(n.host??"")&&o.trim()===(n.partition??"")&&d.trim()===(n.account??"")&&h.trim()===(n.timeLimit??"");async function Z(U){if(U.preventDefault(),!g){S(!0),v(null);try{F(await mJe({host:i,partition:o.trim(),account:d.trim(),timeLimit:h.trim()}))}catch(Y){v(Y instanceof Error?Y.message:String(Y))}finally{S(!1)}}}return f.jsx(f.Fragment,{children:r?f.jsx("div",{className:"error",children:r}):n?f.jsxs(f.Fragment,{children:[!y&&(b==null?void 0:b.error)&&f.jsx("p",{className:Dm,children:b.error}),f.jsxs("form",{className:D4,onSubmit:Z,children:[f.jsx("div",{className:"max-w-xl",children:f.jsxs("label",{children:[aDe(),f.jsx(hh,{choices:[{id:"",label:VLe()},...i&&!n.hosts.some(U=>U.host===i)?[{id:i,label:`${i} (not in ~/.ssh/config)`}]:[],...n.hosts.map(U=>({id:U.host,label:U.host}))],value:i,variant:"field",dropDown:!0,disabled:g||y,onSelect:U=>{l(U),x(null),C(!1),N(!1)}})]})}),f.jsxs("div",{className:"actions",children:[!e&&f.jsx(He,{type:"button",onClick:()=>{y&&!j?(N(!1),C(!1)):P()},disabled:!i,title:i?void 0:U$e(),children:y?j?Ml():Hh():b?HN():Gx()}),f.jsx("span",{role:"status",children:f.jsx(jht,{test:b,connecting:y&&!j,masterRunning:I[i]})})]}),f.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[f.jsxs("div",{className:"row2",children:[f.jsxs("label",{children:[HOe(),f.jsx(ws,{type:"text",list:"slurm-partitions",value:o,onChange:U=>c(U.target.value),placeholder:_S(),autoComplete:"off",spellCheck:!1}),f.jsx("datalist",{id:"slurm-partitions",children:b==null?void 0:b.partitions.map(U=>f.jsx("option",{value:U},U))})]}),f.jsxs("label",{children:[Wx(),f.jsx(ws,{type:"text",value:d,onChange:U=>_(U.target.value),placeholder:_S(),autoComplete:"off",spellCheck:!1})]})]}),f.jsxs("label",{className:"mt-3 block max-w-xl",children:[r$e(),f.jsx(ws,{type:"text",value:h,onChange:U=>m(U.target.value),placeholder:sTe(),autoComplete:"off",spellCheck:!1})]})]}),k&&f.jsx("div",{className:"error",children:k}),f.jsx("div",{className:"actions",children:f.jsx(He,{variant:"primary",type:"submit",disabled:g||W||y,children:g?qi():Fa()})})]}),!e&&y&&f.jsx(M4,{host:i,backend:"slurm",onComplete:U=>{U.backend==="slurm"&&(x(U.result),$(i),N(!1),C(!1))},onError:U=>{N(!0),x({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:U})}},M)]}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",qRe()]})})}function Tht(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[l,o]=T.useState(!1),[c,d]=T.useState(null),[_,h]=T.useState(null),m=_!==null&&_!=="testing"?_:null,g=b=>{n(b),i(b.address??"")};T.useEffect(()=>{gJe().then(g).catch(b=>r(b instanceof Error?b.message:String(b)))},[]);const S=e!==null&&s===(e.address??"");async function k(b){if(b.preventDefault(),!l){o(!0),d(null);try{g(await bJe({address:s}))}catch(x){d(x instanceof Error?x.message:String(x))}finally{o(!1)}}}async function v(){h("testing");try{h(await vJe(s.trim()||void 0))}catch(b){h({reachable:!1,address:s.trim()||"(unknown)",rayVersion:null,error:b instanceof Error?b.message:String(b)})}}return f.jsx(f.Fragment,{children:t?f.jsx("div",{className:"error",children:t}):e?f.jsxs(f.Fragment,{children:[(m==null?void 0:m.error)&&f.jsx("p",{className:Dm,children:m.error}),f.jsxs("form",{className:D4,onSubmit:k,children:[f.jsxs("label",{children:[CRe(),f.jsx(ws,{type:"text",value:s,onChange:b=>{i(b.target.value),h(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[mMe(),": ",Ee(e.resolvedAddress)," · ",IN(),": ",e.source]}),c&&f.jsx("div",{className:"error",children:c}),f.jsxs("div",{className:"actions",children:[f.jsx(He,{variant:"primary",type:"submit",disabled:l||S,children:l?qi():Fa()}),f.jsx(He,{type:"button",onClick:()=>void v(),disabled:_==="testing",children:RBe()}),f.jsx(Mht,{test:_})]}),(m==null?void 0:m.reachable)&&m.rayVersion&&f.jsxs("p",{className:"m-0 text-sm text-subtext",children:[nIe(),": ",m.rayVersion]})]})]}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",HRe()]})})}function Mht({test:e}){return e===null?null:e==="testing"?f.jsx(Mt,{children:IBe()}):e.reachable?f.jsx(Mt,{variant:"success",children:aIe()}):f.jsx(Mt,{variant:"error",children:Kx()})}function Rht(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:ko(e.memBytes),r=e.gpus.length===0?null:sNe({count:e.gpus.length});return[n,e.cpuCount>0?mEe({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function Dht({remote:e}){const[n,t]=T.useState(null),[r,s]=T.useState(null),[i,l]=T.useState(!0),[o,c]=T.useState(0),[d,_]=T.useState(!0),[h,m]=T.useState(!1);async function g(){l(!0),s(null);try{t(await SJe())}catch(S){s(S instanceof Error?S.message:String(S))}finally{l(!1)}}return T.useEffect(()=>{g()},[e]),f.jsxs(f.Fragment,{children:[r&&!n?f.jsx("div",{className:"error",children:r}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:xht,children:[f.jsx("span",{className:"k",children:kd()}),f.jsx("span",{className:"v",children:i||h?f.jsxs(Mt,{className:"gap-1.5",role:"status",children:[f.jsx(Rt,{}),h?Fje():la()]}):r?f.jsx(Mt,{variant:"warning",children:Yv()}):n?n.loggedIn?n.sshKeyStatus==="matched"?f.jsx(Mt,{variant:"success",children:Ph()}):n.sshKeyStatus==="unknown"?f.jsx(Mt,{variant:"warning",children:Yv()}):f.jsx(Mt,{variant:"warning",children:rm()}):f.jsx(Mt,{variant:"warning",children:DN()}):null}),f.jsx("span",{className:"k",children:yOe()}),f.jsx("span",{className:"v",children:n!=null&&n.loggedIn&&n.orgs.length>0?n.orgs.join(", "):"—"}),f.jsx("span",{className:"k",children:aBe()}),f.jsx("span",{className:"v",children:i||!(n!=null&&n.loggedIn)?"—":n.sshKeyStatus==="matched"?f.jsx(Mt,{variant:"success",children:JLe()}):n.sshKeyStatus==="no_local_match"?f.jsx(Mt,{variant:"warning",children:FLe()}):n.sshKeyStatus==="none_registered"?f.jsx(Mt,{variant:"error",children:kLe()}):f.jsx(Mt,{children:u$e()})})]}),e&&n&&!n.loggedIn&&f.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:aze({command:Ee("orx login")})}),!e&&o>0&&f.jsx(ght,{login:d,onComplete:()=>{m(!1),c(0),g()},onError:S=>{m(!1),fr(S,"error")}},o),e&&(n==null?void 0:n.loggedIn)&&n.sshKeyStatus==="none_registered"&&(n.sshKeyPath?f.jsxs("p",{dir:"auto",className:Pi,children:[Yje()," ",f.jsxs("code",{children:["orx ssh-key add ",n.sshKeyPath]}),"."]}):f.jsxs("p",{dir:"auto",className:Pi,children:[mLe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),PBe()," ",f.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(n==null?void 0:n.loggedIn)&&n.sshKeyStatus==="no_local_match"&&(n.sshKeyPath?f.jsx("p",{dir:"auto",className:Pi,children:eHe({register:Ee(`orx ssh-key add ${n.sshKeyPath}`),load:Ee("ssh-add")})}):f.jsxs("p",{dir:"auto",className:Pi,children:[fLe()," ",f.jsx("code",{children:"ssh-add"}),hOe()," ",f.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!i&&(r||(n==null?void 0:n.error))&&f.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(n==null?void 0:n.error)})]}),f.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[f.jsxs(He,{onClick:()=>void g(),disabled:i||h,children:[f.jsx(ua,{size:13})," ",i?la():$h()]}),!e&&n&&(!n.loggedIn||n.sshKeyStatus!=="matched")&&f.jsxs(He,{variant:"primary",disabled:i||h,onClick:()=>{_(!n.loggedIn),m(!0),c(S=>S+1)},children:[h?f.jsx(Rt,{}):f.jsx(Cd,{size:13})," ",n.loggedIn?QHe():PN()]})]})]})}const pd={local:rN,tinker:coe,hf:Mae,modal:Uae,k8s:Oae,ssh:ioe,slurm:toe,ray:Zae,openresearch:Wae},Lht={local:sae,ssh:kae,tinker:zae,hf:Xie,modal:lae,k8s:eae,slurm:xae,ray:mae,openresearch:fae},Lm={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},sC=["hf","modal","slurm","ray","openresearch"],uv=["hf","modal","openresearch"],sM={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},Z2=["tinker","hf","modal","ray","k8s"],Oht={tinker:Coe,hf:hoe,modal:goe,openresearch:yoe},iC="__custom__";function Mf(e,n){return!!(n&&!(sM[e]??[]).includes(n))}function Iht({settings:e,projectId:n,onSaved:t}){const r=e.configuredDefaultBackend??e.defaultBackend??"local",s=e.defaultFlavor??"",[i,l]=T.useState(r),[o,c]=T.useState(s),[d,_]=T.useState(Mf(r,s)),[h,m]=T.useState(!1),[g,S]=T.useState(null),k=e.targets.find($=>$.id===i),v=e.targets.filter($=>$.configured||$.id===r),b=sC.includes(i),x=uv.includes(i),y=sM[i]??[],C=i===r&&(!b||o.trim()===s),j=pd[i](),N=Oht[i],M=h?lFe():x&&!o.trim()?G9e({destination:j}):i==="ssh"?eje():Xze({destination:j});T.useEffect(()=>{l(r),c(s),_(Mf(r,s))},[r,s]);async function z($,P){const F=sC.includes($);if(!(h||uv.includes($)&&!P.trim())){m(!0),S(null);try{t(await yJe({backend:$,flavor:F&&P.trim()||null,projectId:n}))}catch(W){S(W instanceof Error?W.message:String(W)),l(r),c(s),_(Mf(r,s))}finally{m(!1)}}}function D($){const P=e.targets.find(W=>W.id===$);if(!P)return;l(P.id);const F=P.id===r?s:"";c(F),_(Mf(P.id,F)),uv.includes(P.id)||z(P.id,F)}function I($){if($===iC){_(!0);return}_(!1),c($),(!x||$)&&z(i,$)}return f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:eMe()}),f.jsxs("div",{children:[f.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:$=>{$.preventDefault(),C||z(i,o)},children:[f.jsx(hh,{choices:v.map($=>({id:$.id,label:pd[$.id]()})),value:i,variant:"field",dropDown:!0,disabled:h,renderIcon:$=>{const P=e.targets.find(F=>F.id===$.id);return P?f.jsx(Jh,{kind:Lm[P.id],size:16}):null},onSelect:D}),b&&f.jsx("div",{children:d?f.jsxs("div",{className:"relative",children:[f.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:o,onChange:$=>c($.target.value),onBlur:()=>{if(x&&!o.trim()){i===r&&(c(s),_(Mf(r,s)));return}C||z(i,o)},placeholder:LTe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:h}),f.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":hS(),title:hS(),onMouseDown:$=>$.preventDefault(),onClick:()=>_(!1),children:f.jsx(Ua,{size:12})})]}):f.jsx(hh,{choices:[{id:"",label:x?P9e():lje()},...o&&!y.includes(o)?[{id:o,label:zEe({value:Ee(o)})}]:[],...y.map($=>({id:$,label:$})),{id:iC,label:$Te()}],value:o,variant:"field",dropDown:!0,disabled:h,onSelect:I})})]}),g&&f.jsx("div",{className:"error mt-2.5",children:g}),k&&!k.configured&&f.jsx("p",{className:Pi,children:YBe()})]}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:M}),N&&f.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:N()})]})}function Bht({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,l=e.unverified?R9e():e.id==="openresearch"?PN():e.id==="ray"?Gx():KHe();return f.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&f.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":pd[e.id](),"aria-describedby":i,"aria-haspopup":Z2.includes(e.id)?"dialog":void 0}),f.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:f.jsx(Jh,{kind:Lm[e.id],size:48})}),f.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:pd[e.id]()}),f.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:Lht[e.id]()}),f.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?f.jsxs(f.Fragment,{children:[e.id==="tinker"?qNe():VPe()," ",f.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:BEe()})]}):t??e.summary}),f.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[f.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?AN():e.configured?!r||Z2.includes(e.id)?Yx():vFe():l}),r&&f.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:f.jsx(tp,{size:16})})]})]})}function $ht({target:e,isDefault:n,onBack:t,remote:r}){return f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[f.jsx(rh,{size:16})," ",zN()]}),f.jsxs("div",{className:"flex items-center justify-between gap-6",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:f.jsx(Jh,{kind:Lm[e.id],size:36})}),f.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:pd[e.id]()})]}),n&&f.jsx(Mt,{className:"flex-none border-primary bg-primary-subtle text-primary",children:AN()})]}),f.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&f.jsx(zht,{remote:r}),e.id==="slurm"&&f.jsx(Aht,{remote:r}),e.id==="openresearch"&&f.jsx(Dht,{remote:r})]})]})}function Hht({target:e,onClose:n}){const t=T.useRef(null),[r,s]=T.useState({dirty:!1,saving:!1});T.useEffect(()=>{const l=t.current;return l==null||l.showModal(),()=>l==null?void 0:l.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(HNe())||n()};return f.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:l=>{l.key==="Escape"&&(l.preventDefault(),i())},onCancel:l=>{l.preventDefault(),i()},children:[f.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[f.jsx(Jh,{kind:Lm[e.id],size:32}),f.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:pd[e.id]()})]}),f.jsx(qt,{title:yp(),"aria-label":yp(),onClick:i,disabled:r.saving,children:f.jsx(Br,{size:14})})]}),e.id==="tinker"&&f.jsx(Fht,{target:e}),e.id==="hf"&&f.jsx(qht,{}),e.id==="modal"&&f.jsx(Cht,{}),e.id==="ray"&&f.jsx(Tht,{}),e.id==="k8s"&&f.jsx(kht,{onEditState:s})]})}function Pht({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){const[s,i]=T.useState(null),[l,o]=T.useState(null),[c,d]=T.useState(null),[_,h]=T.useState(null),[m,g]=T.useState(null),[S,k]=T.useState(null),v=T.useRef(0);T.useEffect(()=>{v.current++,i(null),d(null),o(null),h(null)},[e==null?void 0:e.id]),T.useEffect(()=>{wJe().then(g).catch(D=>k(D instanceof Error?D.message:String(D)))},[]),T.useEffect(()=>{const D=++v.current;xJe(e==null?void 0:e.id).then(I=>{D===v.current&&(i(I),o(null))}).catch(I=>{if(D!==v.current)return;const $=I instanceof Error?I.message:String(I);i(P=>(P===null?o($):h($),P))})},[c,e==null?void 0:e.id]);const b=D=>{v.current++,i(D),h(null)},x=s?s.targets:null,y=(s==null?void 0:s.configuredDefaultBackend)??(s==null?void 0:s.defaultBackend),C=x?[...x].sort((D,I)=>+(I.id===y)-+(D.id===y)):null,j=(C==null?void 0:C.filter(D=>D.configured))??[],N=(C==null?void 0:C.filter(D=>!D.configured))??[],M=D=>f.jsx(Bht,{target:D,isDefault:y===D.id,summary:D.id==="local"?m?Rht(m):S??sMe():void 0,onOpen:D.id==="local"?void 0:()=>d(D.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${D.id}`),z=c?s==null?void 0:s.targets.find(D=>D.id===c):null;return z&&!Z2.includes(z.id)?f.jsx($ht,{target:z,isDefault:y===z.id,onBack:()=>d(null),remote:r}):f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:jN()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:pTe()}),f.jsx(o_t,{projectId:e==null?void 0:e.id,onViewHistory:n}),l?f.jsx("div",{className:"error",children:l}):s?f.jsxs(f.Fragment,{children:[_&&f.jsx("div",{className:"error",children:_}),f.jsx(Iht,{settings:s,projectId:e==null?void 0:e.id,onSaved:b}),f.jsxs("section",{className:"mb-8",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:Yx()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:j.map(M)})]}),N.length>0&&f.jsxs("section",{className:"mb-3.5",children:[f.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:bDe()}),f.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:N.map(M)})]}),z&&f.jsx(Hht,{target:z,onClose:()=>d(null)})]}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",HAe()]})]})}function Fht({target:e}){const[n,t]=T.useState(""),[r,s]=T.useState(!1),[i,l]=T.useState(null),[o,c]=T.useState(null),[d,_]=T.useState(!0);T.useEffect(()=>{let g=!0;return jS().then(S=>{g&&c(S)}).catch(S=>{g&&l(S instanceof Error?S.message:String(S))}).finally(()=>{g&&_(!1)}),()=>{g=!1}},[]);async function h(){if(!(d||r)){_(!0),l(null),c(null);try{c(await jS())}catch(g){l(g instanceof Error?g.message:String(g))}finally{_(!1)}}}async function m(g){if(g.preventDefault(),!(!n.trim()||r||d)){s(!0),l(null);try{c(await KQe(n.trim())),t("")}catch(S){l(S instanceof Error?S.message:String(S))}finally{s(!1)}}}return f.jsxs(f.Fragment,{children:[d?f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",la()]}):o&&f.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[f.jsx("dt",{className:"font-medium text-subtext",children:kd()}),f.jsx("dd",{className:"m-0",children:f.jsx(Mt,{variant:o.validationStatus==="valid"?"success":o.validationStatus==="invalid"?"error":"warning",children:o.validationStatus==="valid"?Ph():o.validationStatus==="invalid"?FPe():o.validationStatus==="billingRequired"?DPe():rm()})})]}),(o==null?void 0:o.validationStatus)==="billingRequired"&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:f.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:APe()})}),(o==null?void 0:o.processEnv)&&f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:BPe()}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:m,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||o!==null&&o.validationStatus!=="missing"?kHe():qx(),f.jsx(ws,{type:"password",value:n,placeholder:(o==null?void 0:o.maskedKey)??"",onChange:g=>t(g.target.value),autoComplete:"new-password"})]}),i&&f.jsx("p",{className:"m-0 text-sm text-accent-red",children:i}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(He,{type:"button",disabled:r||d,onClick:()=>void h(),children:[f.jsx(ua,{size:13})," ",d?la():$h()]}),f.jsx(He,{variant:"primary",type:"submit",disabled:!n.trim()||r||d,children:r?UN():Fa()})]})]})]})}function Uht({settings:e}){return e.validationStatus==="missing"?f.jsx(Mt,{variant:"warning",children:rm()}):e.validationStatus==="invalid"?f.jsx(Mt,{variant:"error",children:yRe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?f.jsx(Mt,{variant:"success",children:Ph()}):e.jobsWrite===!1?f.jsxs("span",{className:"inline-flex items-center gap-2",children:[f.jsx(Mt,{variant:"warning",children:lLe()}),f.jsx(my,{content:mNe(),className:"text-subtext",children:f.jsx(Jx,{size:15})})]}):null}function qht(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[l,o]=T.useState(!1),[c,d]=T.useState(!1),[_,h]=T.useState(null),m=T.useRef(!1);T.useEffect(()=>{zS().then(k=>{m.current||n(k)}).catch(k=>{m.current||r(k instanceof Error?k.message:String(k))})},[]);async function g(){if(!(l||c||!e&&!t)){d(!0),r(null);try{n(await zS()),m.current=!1}catch(k){r(k instanceof Error?k.message:String(k))}finally{d(!1)}}}async function S(k){if(k.preventDefault(),!(!s.trim()||l||c||!e&&!t)){o(!0),h(null);try{const v=await WQe(s.trim());m.current=!0,n(v),r(null),i("")}catch(v){h(v instanceof Error?v.message:String(v))}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[t?f.jsx("div",{className:"error",children:t}):e?f.jsxs(f.Fragment,{children:[f.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[e.username&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:Wx()}),f.jsx("dd",{className:"m-0 text-text",children:e.username})]}),(e.validationStatus==="missing"||e.validationStatus==="invalid"||e.validationStatus==="valid"&&e.jobsWrite!==null)&&f.jsxs("div",{className:"flex items-center justify-between gap-4",children:[f.jsx("dt",{className:"font-medium text-subtext",children:kd()}),f.jsx("dd",{className:"m-0 text-text",children:f.jsx(Uht,{settings:e})})]})]}),e.validationStatus==="unreachable"&&e.validationError&&f.jsx("p",{className:Dm,children:e.validationError}),e.source==="env"&&f.jsx("p",{className:Pi,children:YMe()}),e.validationStatus==="valid"&&e.jobsWrite===null&&f.jsx("p",{className:Pi,children:fNe({login:Ee("hf auth login"),url:Ee("huggingface.co/settings/tokens")})})]}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",KRe()]}),f.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:S,children:[f.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e!=null&&e.configured?zHe():sje(),f.jsx(ws,{type:"password",value:s,onChange:k=>i(k.target.value),placeholder:(e==null?void 0:e.maskedToken)??GMe(),autoComplete:"off"})]}),_&&f.jsx("div",{className:"error",children:_}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsxs(He,{type:"button",disabled:l||c||!e&&!t,onClick:()=>void g(),children:[f.jsx(ua,{size:13})," ",c?la():$h()]}),f.jsx(He,{variant:"primary",type:"submit",disabled:!s.trim()||l||c||!e&&!t,children:l?UN():Fa()})]})]})]})}const iM=/^hf_[A-Za-z0-9]{10,}$/;function aM(){return f.jsx("tr",{children:f.jsx("td",{colSpan:3,children:f.jsxs("p",{dir:"auto",className:Pi,children:[JBe()," ",f.jsx("code",{children:"HF_TOKEN"}),VIe()]})})})}const aC=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function Q2(e,n){const t=n instanceof Error?n.message:String(n);fr(t.includes(e)?t:`${e}: ${t}`,"error")}function Ght({name:e,entry:n,onVars:t}){const[r,s]=T.useState(""),[i,l]=T.useState(!1);async function o(){if(!(!r.trim()||i)){l(!0);try{t(await kz(e,r.trim())),s("")}catch(d){Q2(e,d)}finally{l(!1)}}}async function c(){if(!i){l(!0);try{t(await nJe(e))}catch(d){Q2(e,d)}finally{l(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{className:"font-mono text-sm",children:e}),f.jsx("td",{className:"text-base text-subtext",children:n?f.jsxs(f.Fragment,{children:[n.maskedValue,n.inProcessEnv&&f.jsx(Mt,{children:OOe()})]}):f.jsx(ws,{variant:"inline",className:"text-base",type:"password",value:r,onChange:d=>s(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),o()),d.key==="Escape"&&!i&&s("")},placeholder:BN(),"aria-label":$$({name:Ee(e)}),autoComplete:"new-password",disabled:i})}),f.jsx("td",{children:n?f.jsx(qt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:qv({name:Ee(e)}),"aria-label":qv({name:Ee(e)}),onClick:()=>void c(),disabled:i,children:f.jsx(Ed,{size:13})}):r.trim()&&f.jsx(He,{size:"small",onClick:()=>void o(),disabled:i,children:i?qi():Fa()})})]}),!n&&e!=="HF_TOKEN"&&iM.test(r.trim())&&f.jsx(aM,{})]})}function Vht({onVars:e,onDone:n}){const[t,r]=T.useState(""),[s,i]=T.useState(""),[l,o]=T.useState(!1);async function c(){if(!(!t.trim()||!s.trim()||l)){o(!0);try{e(await kz(t.trim(),s.trim())),n()}catch(_){Q2(t.trim(),_)}finally{o(!1)}}}const d=_=>{_.key==="Enter"&&(_.preventDefault(),c()),_.key==="Escape"&&!l&&n()};return f.jsxs(f.Fragment,{children:[f.jsxs("tr",{children:[f.jsx("td",{children:f.jsx(ws,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:t,onChange:_=>r(_.target.value),onKeyDown:d,placeholder:"MY_API_KEY","aria-label":FDe(),autoComplete:"off",spellCheck:!1,disabled:l})}),f.jsx("td",{children:f.jsx(ws,{variant:"inline",className:"text-base",type:"password",value:s,onChange:_=>i(_.target.value),onKeyDown:d,placeholder:BN(),"aria-label":VDe(),autoComplete:"new-password",disabled:l})}),f.jsxs("td",{children:[f.jsx(He,{size:"small",onClick:()=>void c(),disabled:l||!t.trim()||!s.trim(),children:l?qi():Fa()}),f.jsx(qt,{title:Hh(),"aria-label":OAe(),onClick:n,disabled:l,children:f.jsx(Br,{size:13})})]})]}),t.trim()!=="HF_TOKEN"&&iM.test(s.trim())&&f.jsx(aM,{})]})}function Wht(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(!1);T.useEffect(()=>{tJe().then(n).catch(c=>r(c instanceof Error?c.message:String(c)))},[]);const l=e===null?[]:e.map(c=>c.key).filter(c=>!aC.includes(c)),o=[...aC,...l];return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[f.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:z$e()}),f.jsxs(He,{size:"small",className:"shrink-0",onClick:()=>i(!0),disabled:s||e===null,children:[f.jsx(ny,{size:12})," ",Jje()]})]}),f.jsx("div",{className:Ha,children:t?f.jsx("div",{className:"error",children:t}):e===null?f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]}):f.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:f.jsxs("tbody",{children:[o.map(c=>f.jsx(Ght,{name:c,entry:e.find(d=>d.key===c),onVars:n},c)),s&&f.jsx(Vht,{onVars:n,onDone:()=>i(!1)})]})})})]})}const Rf=[{value:"system",label:EPe,icon:MZe},{value:"light",label:wPe,icon:nQe},{value:"dark",label:pPe,icon:DZe}],Kht=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function Yht(){const e=qc(),[n,t]=Iz(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const l=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=l.findIndex(h=>h===document.activeElement),d=((o===-1?Rf.findIndex(h=>h.value===n):o)+i+Rf.length)%Rf.length;t(Rf[d].value),(_=l[d])==null||_.focus()};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:_9e()}),f.jsxs("div",{className:`${Ha} mt-3`,children:[f.jsxs("div",{className:`${Co} pb-3.5`,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:yS()}),f.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":yS(),onKeyDown:r,children:Rf.map(({value:s,label:i,icon:l})=>f.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[f.jsx(l,{size:14}),i()]},s))})]}),f.jsxs("div",{className:Co,children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:nze()}),f.jsx("div",{className:"w-52 flex-none",children:f.jsx(hh,{choices:Kht,value:e,variant:"field",dropDown:!0,onSelect:s=>{HE(s)&&ZN(s)}})})]})]})]})}const Xht={installer:hYe,"app-bundle":tYe,cargo:iYe,homebrew:cYe,nix:gYe,unknown:yYe},dv={cargo:CYe,homebrew:jYe,nix:RYe};function Zht(){var _;const{status:e,error:n,apply:t}=PT(),[r,s]=T.useState(null),[i,l]=T.useState(null),o=FT(e),c=r!==null||o.restarting;if(!e)return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:vS()}),n?f.jsx("div",{className:Ha,children:f.jsx("div",{className:"error",children:n})}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]})]});const d=async(h,m)=>{s(h),l(null);try{await m()}catch(g){l(g instanceof Error?g.message:String(g))}finally{s(null)}};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:vS()}),f.jsxs("div",{className:`${Ha} mt-3`,children:[f.jsxs("div",{className:`${_d} pb-3.5`,children:[f.jsx("div",{className:"k",children:$N()}),f.jsx("div",{className:"v",children:e.current}),f.jsx("div",{className:"k",children:RRe()}),f.jsx("div",{className:"v",children:e.latest??"—"}),f.jsx("div",{className:"k",children:MN()}),f.jsx("div",{className:"v",children:Xht[e.channel]()})]}),e.restartRequired&&f.jsxs("div",{className:Co,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:DIe()}),f.jsx("p",{children:o.error?YN({error:o.error}):OHe({installed:Ee(e.installedVersion??"—"),current:Ee(e.current??e.installedVersion??"—")})})]}),e.canRestart&&f.jsx(He,{size:"small",type:"button",disabled:c,onClick:o.restart,children:o.restarting?XN():KN()})]}),e.selfUpdates?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:Co,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:mS()}),f.jsxs("p",{children:[BDe(),e.envDisabled&&sFe()]})]}),f.jsx(py,{type:"button",checked:e.autoUpdate,"aria-label":mS(),disabled:c,onClick:()=>void d("auto",()=>ZQe(!e.autoUpdate).then(t))})]}),f.jsxs("div",{className:Co,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:e.updateAvailable?eFe({version:Ee(e.latest??"—")}):C9e()}),f.jsx("p",{children:e.updateAvailable?ONe():I9e()})]}),f.jsx(He,{size:"small",type:"button",disabled:c,onClick:()=>void d("apply",()=>YQe().then(t)),children:r==="apply"?Ux():e.updateAvailable?XPe():j9e()})]})]}):f.jsx("div",{className:Co,children:f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:COe()}),f.jsx("p",{children:((_=dv[e.channel])==null?void 0:_.call(dv))??sHe()})]})}),e.channel==="app-bundle"&&f.jsx(Jht,{busy:r,disabled:c,run:d}),i&&f.jsx("div",{className:"error",children:i})]})]})}function Qht(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null);T.useEffect(()=>{OJe().then(n).catch(o=>i(o instanceof Error?o.message:String(o)))},[]);const l=()=>{!e||t||(r(!0),i(null),IJe(!e.preferenceEnabled).then(n).catch(o=>i(o instanceof Error?o.message:String(o))).finally(()=>r(!1)))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:y$e()}),e?f.jsxs("div",{className:`${Ha} mt-3`,children:[f.jsxs("div",{className:Co,children:[f.jsxs("div",{children:[f.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[fS(),e.locked&&e.reason&&f.jsx(my,{content:`${TTe()} ${e.reason}.`,className:"text-subtext",children:f.jsx(Jx,{size:15})})]}),f.jsx("p",{children:XDe()})]}),f.jsx(py,{type:"button",checked:e.enabled,"aria-label":fS(),disabled:t||e.locked,onClick:l})]}),s&&f.jsx("div",{className:"error",children:s})]}):s?f.jsx("div",{className:"error",children:s}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]})]})}function Jht({busy:e,disabled:n,run:t}){const[r,s]=T.useState(null),[i,l]=T.useState(!1),o=c=>void t("cli",()=>QQe(c).then(d=>{s(d),l(!1)}).catch(d=>{throw l(!c&&String((d==null?void 0:d.message)??d).includes("--force")),d}));return f.jsxs("div",{className:Co,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:zNe({command:Ee("orx")})}),r?f.jsxs("p",{children:[r.alreadyCurrent?J9e({link:Ee(r.link)}):rEe({link:Ee(r.link)}),!r.onPath&&u9e({directory:Ee(r.dir)})]}):f.jsx("p",{children:kNe({command:Ee("orx")})})]}),f.jsx(He,{size:"small",type:"button",disabled:n,onClick:()=>o(i),children:e==="cli"?Ux():i?xHe():r?lHe():xNe()})]})}function e_t(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null),l=()=>(i(null),ay().then(n).catch(c=>i(c instanceof Error?c.message:String(c))));T.useEffect(()=>void l(),[]);const o=()=>{if(!e||t)return;const c=!e.githubForNewProjects;r(!0),i(null),Tz(c,!0).then(n).catch(d=>i(d instanceof Error?d.message:String(d))).finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:jMe()}),e?f.jsxs("div",{className:`${Ha} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[f.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[f.jsx("h3",{children:RMe()}),f.jsx(Mt,{variant:e.githubAuthenticated?"success":e.ghInstalled?"warning":"error",children:e.githubAuthenticated?SN():NN()})]}),f.jsxs("div",{className:Co,children:[f.jsxs("div",{children:[f.jsx("div",{className:"project-default-title text-base font-medium",children:pS()}),f.jsx("p",{children:L$e()})]}),f.jsx(py,{type:"button",checked:e.githubForNewProjects,"aria-label":pS(),disabled:t||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:o})]}),!e.githubAuthenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(oM,{ghInstalled:e.ghInstalled,onCheck:l})}),s&&f.jsx("div",{className:"error",children:s})]}):s?f.jsx("div",{className:"error",children:s}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]})]})}function oM({ghInstalled:e,onCheck:n}){const[t,r]=T.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:Qh(e?HHe():MNe())}),f.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&f.jsxs(ih,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[uRe()," ",f.jsx(Ic,{size:12})]}),f.jsx(He,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?la():$h()})]})]})}function t_t(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null);return T.useEffect(()=>{$Qe().then(l=>n(l.hasToken)).catch(l=>i(l instanceof Error?l.message:String(l)))},[]),f.jsxs("div",{className:X2,children:[f.jsx("h3",{children:LN()}),f.jsxs("div",{className:_d,children:[f.jsx("span",{className:"k",children:IMe()}),f.jsx("span",{className:"v",children:f.jsx(Mt,{variant:e?"success":"default",children:e===null?s?dN():la():e?qHe():Aje()})})]}),f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:$$e()}),e?f.jsx("div",{className:lp,children:f.jsx(He,{disabled:t,onClick:()=>{r(!0),i(null),HQe().then(l=>n(l.hasToken)).catch(l=>i(l instanceof Error?l.message:String(l))).finally(()=>r(!1))},children:t?mHe():fHe()})}):f.jsx(Gft,{save:yz,onSaved:l=>n(l.hasToken),placeholder:MOe(),createHref:"https://www.overleaf.com/user/settings"}),s&&f.jsx("div",{className:"error",children:s})]})}function n_t({project:e,publicationError:n,onProjectUpdate:t}){const[r,s]=T.useState(null),[i,l]=T.useState(!1),[o,c]=T.useState(null),[d,_]=T.useState(!1),[h,m]=T.useState(!1),[g,S]=T.useState(null),k=T.useRef(0),v=!!(r!=null&&r.github.owner&&r.github.repo),b=(j=!0)=>{const N=++k.current;return j&&s(null),c(null),e?MJe(e.id).then(M=>{N===k.current&&s(M)}).catch(M=>{N===k.current&&c(M instanceof Error?M.message:String(M))}):Promise.resolve()};T.useEffect(()=>void b(),[e==null?void 0:e.id]);const x=j=>{const N=j instanceof Error?j.message:String(j);return N.toLowerCase().includes("archived")?VEe():N.includes("(fetch first)")||N.includes("non-fast-forward")?XEe():N.includes("403")||N.toLowerCase().includes("permission denied")?eNe():N},y=()=>{e&&(l(!0),c(null),DJe(e.id).then(j=>{s(j.git),t(j.project),ay().then(N=>{!N.githubForNewProjects&&!N.githubDefaultPromptSeen&&_(!0)}).catch(()=>{})}).catch(j=>c(x(j))).finally(()=>l(!1)))},C=j=>{m(!0),S(null),Tz(j,!0).then(()=>_(!1)).catch(N=>S(N instanceof Error?N.message:String(N))).finally(()=>m(!1))};return f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:AIe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:MHe({project:(e==null?void 0:e.name)??kEe()})}),e?o&&!r?f.jsx("div",{className:"error",children:o}):r?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:X2,children:[f.jsx("h3",{children:nDe()}),f.jsxs("div",{className:_d,children:[f.jsx("span",{className:"k",children:qOe()}),f.jsx("span",{className:"v",children:r.path}),f.jsx("span",{className:"k",children:"Git"}),f.jsx("span",{className:"v",children:r.gitVersion??fN()}),f.jsx("span",{className:"k",children:_Be()}),f.jsx("span",{className:"v",children:r.initialized?FEe({branch:Ee(r.currentBranch??CN()),state:r.clean?Y9e():lNe()}):Eje()}),f.jsx("span",{className:"k",children:CAe()}),f.jsx("span",{className:"v",children:r.baselineBranch}),f.jsx("span",{className:"k",children:EIe()}),f.jsx("span",{className:"v",children:r.remotes.length?r.remotes.map(j=>`${j.name}: ${j.url}`).join(" · "):Vx()})]}),!r.initialized&&f.jsx("div",{className:lp,children:f.jsx(He,{variant:"primary",onClick:()=>void RJe(e.id).then(s).catch(j=>c(String(j))),children:JMe()})})]}),f.jsxs("div",{className:X2,children:[f.jsx("h3",{children:"GitHub"}),f.jsxs("div",{className:_d,children:[f.jsx("span",{className:"k",children:_Ae()}),f.jsx("span",{className:"v",children:f.jsx(Mt,{variant:r.github.authenticated?"success":r.github.ghInstalled?"warning":"error",children:r.github.authenticated?SN():NN()})}),f.jsx("span",{className:"k",children:QOe()}),f.jsx("span",{className:"v",children:v?f.jsxs(f.Fragment,{children:[f.jsxs("span",{children:[r.github.owner,"/",r.github.repo]}),!r.github.enabled&&f.jsx(Mt,{children:jBe()})]}):f.jsx(Mt,{children:QRe()})}),r.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"k",children:CBe()}),f.jsx("span",{className:"v",children:r.github.syncStatus})]})]}),!r.github.authenticated&&f.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:f.jsx(oM,{ghInstalled:r.github.ghInstalled,onCheck:()=>b(!1)})}),r.github.authenticated&&!r.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:v?fFe():xEe()}),f.jsxs("div",{className:lp,children:[v&&r.github.url&&f.jsxs(ih,{href:r.github.url,target:"_blank",rel:"noreferrer",children:[bS()," ",f.jsx(Ic,{size:12})]}),f.jsx(He,{variant:"primary",disabled:i,onClick:y,children:i?hCe():cCe()})]})]}),r.github.enabled&&f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:fMe()}),f.jsxs("div",{className:lp,children:[r.github.url&&f.jsxs(ih,{href:r.github.url,target:"_blank",rel:"noreferrer",children:[bS()," ",f.jsx(Ic,{size:12})]}),f.jsx(He,{disabled:i,onClick:()=>{l(!0),LJe(e.id).then(j=>{s(j.git),t(j.project)}).catch(j=>c(j instanceof Error?j.message:String(j))).finally(()=>l(!1))},children:i?gCe():iCe()})]})]})]}),f.jsx(t_t,{}),n&&f.jsx("div",{className:"error",children:x(n)}),o&&f.jsx("div",{className:"error",children:x(o)})]}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]}):f.jsx("div",{className:Ha,children:f.jsx("p",{className:Pi,children:rOe()})}),d&&f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>C(!1),children:f.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:j=>j.stopPropagation(),children:[f.jsx("h2",{id:"github-default-title",children:uDe()}),f.jsx("p",{children:GBe()}),g&&f.jsx("div",{className:"error",children:g}),f.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[f.jsx(He,{disabled:h,onClick:()=>C(!1),children:BLe()}),f.jsx(He,{variant:"primary",disabled:h,onClick:()=>C(!0),children:h?qi():uze()})]})]})})]})}const r_t={env:lVe,config:fVe,xdg:mVe,default:sVe},fv={preparing:XGe,copying:EGe,verifying:xVe,finalizing:AGe},s_t=e=>{var n;return((n=fv[e])==null?void 0:n.call(fv))??e};function i_t(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[l,o]=T.useState(!1),[c,d]=T.useState(null),[_,h]=T.useState({kind:"idle"}),[m,g]=T.useState(null),S=()=>rJe().then(C=>{n(C),i(j=>j||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));T.useEffect(()=>{S()},[]),T.useEffect(()=>wet(C=>{C.type==="progress"?h(j=>{const N=j.kind==="moving"?j.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||N}}):C.type==="done"?(h({kind:"done",oldPathLeft:C.oldPathLeft}),d(null),i(""),S()):C.type==="error"&&h({kind:"error",message:C.error})}),[]);const k=(e==null?void 0:e.source)==="env",v=s.trim(),b=e!==null&&v===e.current;async function x(){if(!(l||!v)){o(!0),g(null),d(null);try{d(await sJe(v))}catch(C){g(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function y(C){if(C.preventDefault(),!(_.kind==="moving"||!v||b)&&(g(null),!!window.confirm(BGe({path:Ee(v)})))){h({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await iJe(v)}catch(j){h({kind:"idle"}),g(j instanceof Error?j.message:String(j))}}}return f.jsxs(f.Fragment,{children:[f.jsx("h2",{children:yBe()}),f.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:lPe()}),t?f.jsx("div",{className:Ha,children:f.jsx("div",{className:"error",children:t})}):e?f.jsxs("div",{className:Ha,children:[f.jsx("div",{className:"settings-card-head mb-3",children:f.jsx("h3",{children:UTe()})}),f.jsxs("div",{className:_d,children:[f.jsx("span",{className:"k",children:NTe()}),f.jsx("span",{className:"v",children:e.current}),f.jsx("span",{className:"k",children:IN()}),f.jsx("span",{className:"v",children:r_t[e.source]()})]}),!k&&f.jsxs("form",{className:D4,onSubmit:y,children:[f.jsxs("label",{children:[DDe(),f.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),d(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),c&&!c.error&&c.ok&&f.jsxs("p",{className:Pi,children:[mIe()," ",ko(c.treeBytes??0),c.freeBytes!=null&&` — ${DGe({size:Ee(ko(c.freeBytes))})}`,c.sameFilesystem?eVe():"","."]}),c&&c.ok===!1&&c.error&&f.jsx("div",{className:"error",children:c.error}),m&&f.jsx("div",{className:"error",children:m}),_.kind==="moving"&&f.jsx(UT,{value:_.copied,max:_.total,label:s_t(_.phase),caption:_.total>0?f.jsxs("span",{className:"text-sm",children:[ko(_.copied)," / ",ko(_.total)]}):void 0}),_.kind==="done"&&f.jsxs("p",{className:Pi,children:[EDe(),_.oldPathLeft&&f.jsxs(f.Fragment,{children:[" ",Bje({path:Ee(_.oldPathLeft)})]})]}),_.kind==="error"&&f.jsxs("div",{className:"error",children:[wDe()," ",_.message]}),f.jsxs("div",{className:"actions",children:[f.jsx(He,{type:"button",onClick:x,disabled:l||!v||b||_.kind==="moving",children:l?la():b9e()}),f.jsx(He,{variant:"primary",type:"submit",disabled:!v||b||_.kind==="moving",children:_.kind==="moving"?VGe():FGe()})]})]})]}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]})]})}const J2=e=>e==="running"||e==="starting";function a_t(e){return J2(e.status)?Np(Date.now()-e.createdAt):e.endedAt?Np(e.endedAt-e.createdAt):"—"}function lM({instances:e,emptyLabel:n}){return e.length===0?f.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):f.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:f.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:yAe()}),f.jsx("th",{children:kd()}),f.jsx("th",{children:uBe()}),f.jsx("th",{children:FIe()})]})}),f.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return f.jsxs("tr",{children:[f.jsx("td",{children:f.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[f.jsx(A4,{backend:t.backend}),r&&f.jsx(um,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:gS(),"aria-label":gS(),onClick:i=>i.stopPropagation(),children:f.jsx(Ic,{size:12})})]})}),f.jsx("td",{children:f.jsx(zo,{status:Fi(t)})}),f.jsx("td",{children:Ba(t.createdAt)}),f.jsx("td",{children:a_t(t)})]},t.id)})})]})})}function o_t({projectId:e,onViewHistory:n}){const[t,r]=T.useState(null),[s,i]=T.useState(null),[l,o]=T.useState(!1),[,c]=T.useState(0);T.useEffect(()=>{const g=setInterval(()=>c(S=>S+1),3e4);return()=>clearInterval(g)},[]);const d=()=>{if(!e){r([]);return}o(!0),iy(e).then(g=>{r(g),i(null)}).catch(g=>{i(g instanceof Error?g.message:String(g)),r(S=>S??[])}).finally(()=>o(!1))};T.useEffect(()=>d(),[e]);const _=(g,S)=>S.createdAt-g.createdAt,h=t==null?void 0:t.filter(g=>J2(g.status)).sort(_),m=t==null?void 0:t.filter(g=>!J2(g.status)).sort(_);return f.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[f.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[f.jsx("div",{children:f.jsxs("h2",{children:[BIe(),h&&h.length>0&&f.jsx("span",{className:"count-badge",children:h.length})]})}),f.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[f.jsxs(He,{size:"small",onClick:d,disabled:l,children:[f.jsx(ua,{size:12,className:l?"animate-[spin_0.9s_linear_infinite]":""})," ",Fh()]}),f.jsx(He,{size:"small",onClick:n,children:m!=null&&m.length?kpe({count:Gt(m.length)}):xpe()})]})]}),s&&f.jsx("div",{className:"error",children:s}),!h||!m?f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]}):f.jsx(lM,{instances:h,emptyLabel:e?lpe():mpe()})]})}function l_t({projectId:e,onBack:n}){const[t,r]=T.useState(null),[s,i]=T.useState(null),[l,o]=T.useState(!1),[,c]=T.useState(0);T.useEffect(()=>{const _=setInterval(()=>c(h=>h+1),3e4);return()=>clearInterval(_)},[]);const d=()=>{if(!e){r([]);return}o(!0),iy(e).then(_=>{r(_.sort((h,m)=>m.createdAt-h.createdAt)),i(null)}).catch(_=>{i(_ instanceof Error?_.message:String(_)),r(h=>h??[])}).finally(()=>o(!1))};return T.useEffect(d,[e]),f.jsxs(f.Fragment,{children:[f.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[f.jsx(rh,{size:14})," ",zN()]}),f.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[f.jsx("h1",{children:gRe()}),f.jsxs(He,{size:"small",onClick:d,disabled:l,children:[f.jsx(ua,{size:12,className:l?"animate-[spin_0.9s_linear_infinite]":""})," ",Fh()]})]}),s&&f.jsx("div",{className:"error",children:s}),t?f.jsx(lM,{instances:t,emptyLabel:e?spe():fpe()}):f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",Pl()]})]})}const cM=["projects","harnesses","storage"],c_t=[{id:"compute",label:jN,icon:f.jsx(XXe,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:TN,icon:f.jsx(Cd,{size:15}),activeTabs:["environment"]},{id:"settings",label:Xx,icon:f.jsx(fz,{size:15}),activeTabs:["settings",...cM]}];function u_t(e){return cM.includes(e)}function d_t({tab:e,project:n,githubPublicationError:t,onProjectUpdate:r,onSelectTab:s,remote:i=!1}){const l=e==="settings"||u_t(e);return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[l&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:Xx()}),f.jsxs("div",{className:"settings-stack mt-4.5",children:[f.jsx("section",{className:Tu,children:f.jsx(Yht,{})}),f.jsx("section",{className:Tu,children:f.jsx(e_t,{})}),f.jsx("section",{className:Tu,children:f.jsx(wht,{})}),!i&&f.jsx("section",{className:Tu,children:f.jsx(i_t,{})}),f.jsx("section",{className:Tu,children:f.jsx(Qht,{})}),!i&&f.jsx("section",{className:Tu,children:f.jsx(Zht,{})})]})]}),e==="compute"&&f.jsx(Pht,{project:n,onViewHistory:()=>s("instances"),onOpenEnvironment:()=>s("environment"),remote:i}),e==="instances"&&f.jsx(l_t,{projectId:n==null?void 0:n.id,onBack:()=>s("compute")}),e==="environment"&&f.jsxs(f.Fragment,{children:[f.jsx("h1",{children:TN()}),f.jsx(Wht,{})]}),e==="git"&&f.jsx(n_t,{project:n,publicationError:t,onProjectUpdate:r})]})}function f_t({skills:e,activeIndex:n,onPick:t,onHover:r}){return f.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden",children:e.map((s,i)=>f.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-start py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-sm [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${i===n?"active":""}`,onMouseDown:l=>{l.preventDefault(),t(s)},onMouseEnter:()=>r(i),children:[f.jsxs("span",{className:"skill-name flex items-center gap-1.5",children:["/",s.name,s.source!=="command"&&f.jsx(Mt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:qN()})]}),f.jsx("span",{className:"skill-desc",children:s.description})]},s.name))})}const oC={name:"plan",get description(){return w5e()},source:"command"};function hv(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r1&&/[ \t]$/.test(i)&&(i=i.replace(/[ \t]+$/,_=>_.includes(" ")||_.length>=r?_:s));let l=e.slice(n.end);if(!l)l=s;else if(!l.startsWith(` -`)){const _=(c=/^[ \t]+/.exec(l))==null?void 0:c[0];l=_?`${_.length>=r?_:s}${l.slice(_.length)}`:s+l}const o=((d=/^[ \t]+/.exec(l))==null?void 0:d[0].length)??0;return{text:`${i}/${t}${l}`,cursor:i.length+t.length+1+o}}function cC(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function __t(e,n){const t=e.filter(r=>r.name.toLowerCase()!==oC.name);return n?[oC,...t]:t}function p_t(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function uC(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const m_t=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"],_v=new Map;function g_t(e,n){const t=`${n}\0${e}`,r=_v.get(t);if(r)return r;const s=$Je(e,n).catch(i=>{throw _v.delete(t),i});return _v.set(t,s),s}function uM(e,n,t,r,s,i=!1){let l=0;return h_t(e,n).map((o,c)=>{const d=l+o.text.length;l=d;const _=o.text.slice(1).toLowerCase();return o.command&&s?s(o.text,_,d,c):o.command?f.jsxs("span",{className:t,onMouseDown:void 0,children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.text.slice(1)]},c):i?f.jsx("span",{"aria-hidden":"true",children:o.text},c):f.jsx(T.Fragment,{children:o.text},c)})}function b_t({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const l=T.useRef(null),o=T.useRef(null),c=T.useRef(null),d=T.useId(),[_,h]=T.useState(!1),[m,g]=T.useState(null),[S,k]=T.useState(!1),[v,b]=T.useState({}),x=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},y=()=>{const N=l.current;if(!N)return;const M=N.getBoundingClientRect(),z=Math.min(420,window.innerWidth-32),D=Math.max(16,Math.min(M.left-4,window.innerWidth-z-16));b(M.top>300?{bottom:window.innerHeight-M.top+12,left:D,width:z}:{left:D,top:M.bottom+12,width:z})},C=()=>{x(),y(),h(!0),!(m!==null||S)&&(k(!0),g_t(n,s).then(g).catch(()=>g(null)).finally(()=>k(!1)))},j=()=>{x(),c.current=window.setTimeout(()=>h(!1),120)};return T.useEffect(()=>()=>x(),[]),T.useEffect(()=>{if(!_)return;const N=()=>y();return window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[_]),f.jsxs(T.Fragment,{children:[f.jsxs("span",{ref:l,role:"button",tabIndex:0,"aria-controls":d,"aria-expanded":_,"aria-label":r$({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:C,onMouseLeave:j,onFocus:C,onBlur:j,onKeyDown:N=>{var M,z;if(N.key==="Escape"){h(!1);return}if(N.key==="Enter"||N.key===" "){N.preventDefault(),C();return}_&&(N.key==="ArrowDown"||N.key==="PageDown")&&(N.preventDefault(),(M=o.current)==null||M.scrollBy({top:N.key==="PageDown"?240:48,behavior:"smooth"})),_&&(N.key==="ArrowUp"||N.key==="PageUp")&&(N.preventDefault(),(z=o.current)==null||z.scrollBy({top:N.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:N=>{var M,z;N.preventDefault(),(M=i.current)==null||M.focus(),(z=i.current)==null||z.setSelectionRange(t,t),x()},children:[f.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),f.jsxs("span",{className:"relative z-1",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),e.slice(1)]})]}),_&&Ro.createPortal(f.jsxs("div",{id:d,ref:o,role:"dialog","aria-label":L$({name:n}),style:{...v,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:x,onMouseLeave:j,onFocus:x,onBlur:j,onMouseDown:N=>N.stopPropagation(),children:[f.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[f.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),f.jsx(Mt,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:qN()})]}),f.jsx("div",{className:"p-4 text-sm text-text",children:S&&m===null?f.jsx("span",{className:"text-muted",children:EFe()}):f.jsx($a,{text:m??r.description})})]}),document.body)]})}function v_t({text:e,isCommand:n}){return f.jsx(f.Fragment,{children:uM(e,n,"skill-chip mx-1 inline-flex items-center rounded-md px-2 py-1 font-medium text-skill-blue transition-colors hover:bg-skill-blue-subtle")})}function x_t({text:e,isCommand:n,skills:t,projectId:r,textareaRef:s}){const i=T.useRef(null);return T.useLayoutEffect(()=>{const l=s.current,o=i.current;if(!l||!o)return;const c=()=>{const _=getComputedStyle(l);for(const h of m_t)o.style.setProperty(h,_.getPropertyValue(h));o.style.width=`${l.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};c();const d=new ResizeObserver(c);return d.observe(l),()=>d.disconnect()},[e,s]),T.useLayoutEffect(()=>{const l=s.current;if(!l)return;const o=()=>{i.current&&(i.current.scrollTop=l.scrollTop)};return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)},[s,e]),f.jsxs("div",{ref:i,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[uM(e,n,"",void 0,(l,o,c,d)=>{const _=t.find(h=>h.name===o);return _&&_.source!=="command"?f.jsx(b_t,{label:l,name:o,end:c,skill:_,projectId:r,textareaRef:s},`${d}:${c}`):f.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[f.jsx("span",{className:"text-skill-blue-slash",children:"/"}),l.slice(1)]},`${d}:${c}`)},!0),"​"]})}function ex({size:e=16,className:n}){return f.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[f.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),f.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function dM({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const l=T.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),c=[];return n.activeTurnCount>0&&c.push(n.activeTurnCount===1?k8e():O8e({count:Gt(n.activeTurnCount)})),n.pendingPermissionCount>0&&c.push(n.pendingPermissionCount===1?l8e():$ke({count:Gt(n.pendingPermissionCount)})),o>0&&c.push(o===1?m8e():z8e({count:Gt(o)})),n.queuedMessageCount>0&&c.push(n.queuedMessageCount===1?x8e():M8e({count:Gt(n.queuedMessageCount)})),n.activeRunCount>0&&c.push(n.activeRunCount===1?f8e():Zke({count:Gt(n.activeRunCount)})),R4(l,s),Ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:d=>{!r&&d.target===d.currentTarget&&s()},children:f.jsxs("div",{ref:l,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":c.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[f.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:Wke({host:Ee(e)})}),c.length>0&&f.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[f.jsx("p",{className:"m-0 font-medium",children:s8e()}),f.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:c.map(d=>f.jsx("li",{children:d},d))})]}),f.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[f.jsx(He,{disabled:r,onClick:s,children:Hh()}),f.jsx(He,{variant:"danger",disabled:r,onClick:i,children:r?H8e():Uke()})]})]})}),document.body)}function Ff({runtime:e,corner:n=!1}){const[t,r]=T.useState(!1),[s,i]=T.useState(!1),[l,o]=T.useState(!1),[c,d]=T.useState(null),_=da();async function h(){if(c){o(!0);try{await zz(c),d(null)}catch(m){d(null),fr(m instanceof Error?m.message:String(m),"error")}finally{o(!1)}}}return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[f.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[f.jsx("div",{className:"text-sm font-medium text-text",children:j7e({host:Ee(e.session.host),user:Ee(e.session.user??"")})}),f.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",Ee(e.session.version??"…")]})]}),f.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[f.jsx(Nr,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await Ez(),_.setOpen(!1)}catch(m){fr(m instanceof Error?m.message:String(m),"error")}finally{r(!1)}},children:t?C7e():Kv()}),f.jsx(my,{content:ake(),className:"me-2 shrink-0 text-subtext",children:f.jsx(Jx,{size:15})})]}),f.jsx(Nr,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{d(await Nz()),_.setOpen(!1)}catch(m){fr(m instanceof Error?m.message:String(m),"error")}finally{i(!1)}},children:yN()})]}),n?f.jsxs(He,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(m=>!m),children:[f.jsx(ex,{size:14,className:"shrink-0"}),f.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:gb({host:Ee(e.session.host)})})]}):f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(qt,{size:"small","aria-label":gb({host:Ee(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(m=>!m),children:f.jsx(ex,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:gb({host:Ee(e.session.host)})}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ee(e.session.version??"…")]})]})]})]}),c&&f.jsx(dM,{host:e.session.host,preview:c,currentClientAttached:e.session.status==="connected",stopping:l,onClose:()=>{l||d(null)},onConfirm:()=>void h()})]})}function y_t(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const tx=6.5,dC=2*Math.PI*tx;function w_t({usage:e}){return!e||e.usedTokens<=0?null:f.jsx(S_t,{usage:e})}function S_t({usage:e}){const{open:n,setOpen:t,ref:r}=da(),{usedTokens:s,contextWindow:i}=e,l=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=l===null?"var(--accent)":y_t(l),c=l===null?"":new Intl.NumberFormat(E(),{style:"percent"}).format(l/100);return f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[f.jsx("button",{type:"button",className:`${l===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:Roe(),onClick:()=>t(d=>!d),children:l===null?b0(s):f.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:tx,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),f.jsx("circle",{cx:"8",cy:"8",r:tx,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${dC*Math.max(l,2)/100} ${dC}`,transform:"rotate(-90 8 8)"})]})}),n&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[f.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[f.jsx("span",{children:joe()}),f.jsx("span",{className:"context-meter-value text-text tabular-nums",children:l===null?Ioe({value:Ee(b0(s))}):Poe({used:Ee(b0(s)),total:Ee(b0(i)),percent:Ee(c)})})]}),l!==null&&f.jsx(UT,{value:s,max:i,fillColor:o})]})]})}const Fp="!";function fC(e){return e.startsWith(Fp)?e.slice(Fp.length).trim():null}function k_t(e){return e.startsWith(Fp)?e.slice(Fp.length):e}const L4="orx:demo-read-sessions";function fM(){try{const e=JSON.parse(sessionStorage.getItem(L4)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function C_t(e){try{const n=fM();n.add(e),sessionStorage.setItem(L4,JSON.stringify([...n]))}catch{}}function E_t(){try{sessionStorage.removeItem(L4)}catch{}}function N_t(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function z_t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function j_t(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` - -${t} -${e.replace(/^\n|\n$/g,"")} -${t} - -`}function nx(e,n){return n?` - -\\[ -${e} -\\] - -`:`\\(${e}\\)`}function A_t(e,n){const t=n.trim().split(` -`),r=" ".repeat(e.length+1);return[`${e} ${t[0]??""}`,...t.slice(1).map(s=>s?`${r}${s}`:"")].join(` -`)}function T_t(e,n){if(e.length===0)return"";const t=Math.max(...e.map(l=>l.length)),r=l=>`| ${Array.from({length:t},(o,c)=>l[c]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` -`)}function M_t(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function R_t(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function D_t(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const L_t={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function _h({variant:e="list",className:n,...t}){return f.jsx("span",{className:ls("title",L_t[e],n),...t})}const hM="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",O4="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",Il=256,_M=1024,pM=2e4,pv=8,I0="chat-annotations";function Nc(e){return e instanceof Element?e:e.parentElement}function hC(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function mv(e,n){return hC(e).compareBoundaryPoints(Range.START_TO_START,hC(n))<0}function _C(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const O_t=new Set(["A","B","CODE","EM","I","STRONG"]);function I_t(e,n){var s,i;const t=Nc(e.endContainer);if(Array.from(n.childNodes).every(l=>l.nodeType===Node.TEXT_NODE)){let l=Nc(e.startContainer);for(;l&&l.matches(".md *")&&l.contains(t);){if(O_t.has(l.tagName)){const o=l.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}l=l.parentElement}}const r=(s=Nc(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const l=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&l instanceof HTMLElement&&(l.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(l),n.replaceChildren(o))}}function B_t(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function $_t(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(l=>e.intersectsNode(l));for(const l of i){const o=l.closest(".katex-display")??l,c=document.createRange();c.selectNode(o);const d={container:c.startContainer,offset:c.startOffset},_={container:c.endContainer,offset:c.endOffset};if(mv(s,d)&&t.append(_C(s,d)),t.append(o.cloneNode(!0)),s=_,!mv(s,r))break}return i.length===0?t.append(e.cloneContents()):mv(s,r)&&t.append(_C(s,r)),I_t(e,t),B_t(t),t}function H_t(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>ph(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` - -${T_t(n,!!e.querySelector("tr:first-child th"))} - -`:""}function mM(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const i=[];for(const l of Array.from(e.children).filter(o=>o instanceof HTMLElement&&o.tagName==="LI")){const o=l.getAttribute("value"),c=o===null?s:Number(o),d=Number.isFinite(c)?c:s;s=d+1;const _=Array.from(l.childNodes).map(h=>h instanceof HTMLElement&&h.matches("UL, OL")?` -${mM(h).trim()} -`:ph(h)).join("").trim();i.push(A_t(n?`${d}.`:"-",_))}return` - -${i.join(` -`)} - -`}function ph(e){var r,s,i,l,o;if(e.nodeType===Node.TEXT_NODE)return N_t(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(ph).join("");if(e.matches(".katex-display")){const c=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return c?nx(c,!0):""}if(e.matches(".katex")){const c=(l=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:l.trim();return c?nx(c,!1):""}if(e.tagName==="BR")return` -`;if(e.tagName==="TABLE")return H_t(e);if(e.matches("UL, OL"))return mM(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return z_t(e.textContent??"");if(e.tagName==="PRE")return j_t(e.textContent??"");const n=Array.from(e.childNodes).map(ph).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const c=e.getAttribute("href");return c?`[${n}](${c})`:n}if(e.tagName==="LI")return`${n.trim()} -`;if(e.matches("TH, TD"))return`${n.trim()} | `;if(e.tagName==="TR")return`${n.replace(/ \| $/,"")} -`;if(e.tagName==="BLOCKQUOTE")return` - -${n.trim().split(` -`).map(c=>`> ${c}`).join(` -`)} - -`;const t=M_t(e.tagName,n);return t?` - -${t} - -`:e.matches("P, DIV, UL, OL, TABLE")?` - -${n.trim()} - -`:n}function P_t(e,n){return ph(e).replace(/\r\n?/g,` -`).replace(/[ \t]+\n/g,` -`).replace(/\n{3,}/g,` - -`).trim()||n}function pC(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function F_t(e,n){var s,i,l,o;if(!R_t(e))return;const t=pC(e);if(t.length<8)return;let r;for(const c of n.querySelectorAll(".msg-assistant > .md .katex")){const _=[(s=c.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=c.querySelector(".katex-html"))==null?void 0:i.textContent,c.textContent].filter(S=>!!S).map(pC).find(S=>D_t(S,t));if(!_)continue;const h=(o=(l=c.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:l.textContent)==null?void 0:o.trim();if(!h)continue;const m=!!c.closest(".katex-display"),g={markdown:nx(h,m).trim(),delta:Math.abs(_.length-t.length)};(!r||g.deltaz.width>0&&z.height>0),S=g[0]??t.getBoundingClientRect(),k=g.filter(z=>z.topS.top),v=k.length>0?k:[S],b=Math.min(...v.map(z=>z.left)),x=Math.max(...v.map(z=>z.right)),y=Math.min(...v.map(z=>z.top)),C=Math.max(...v.map(z=>z.bottom)),j=34,N=74,M=y>=j+pv?y-j-pv:C+pv;return{text:P_t(m,h),range:t.cloneRange(),x:Math.min(window.innerWidth-N,Math.max(N,b+(x-b)/2)),top:M}}function q_t(e,n){const[t,r]=T.useState(null),s=T.useRef(!1),i=T.useCallback(()=>{const c=e.current;r(c?U_t(c):null)},[e]);T.useEffect(()=>{let c=null;const d=()=>{s.current||i()},_=m=>{const g=e.current,S=m.target;!m.isPrimary||m.button!==0||!g||!(S instanceof Node)||!g.contains(S)||(s.current=!0,r(null))},h=m=>{!m.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",d),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("pointercancel",h,!0),()=>{document.removeEventListener("selectionchange",d),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("pointercancel",h,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[i]),T.useEffect(()=>{if(!t)return;const c=d=>{const _=d.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",i)}},[t,i]);const l=T.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),o=T.useCallback(()=>r(null),[]);return{action:t,add:l,dismiss:o}}function G_t(e){T.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(I0);return}const t=new Highlight(...n);return CSS.highlights.set(I0,t),()=>{CSS.highlights.get(I0)===t&&CSS.highlights.delete(I0)}},[e])}function V_t({annotation:e}){const n=T.useRef(null),[t,r]=T.useState();return T.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?F_t(e.text,s):void 0)},[e.id,e.text]),f.jsx("div",{ref:n,children:f.jsx($a,{text:t??e.text})})}function W_t({annotations:e,onRemove:n}){return e.map((t,r)=>f.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[f.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),f.jsxs("div",{className:"min-w-0",children:[f.jsx("div",{className:"text-sm text-muted mb-1",children:ate()}),f.jsx(V_t,{annotation:t})]}),n&&f.jsx(qt,{type:"button",size:"small","data-annotation-remove":!0,title:Ree(),"aria-label":o$({number:Gt(r+1)}),onClick:()=>n(t.id),children:f.jsx(Br,{size:13})})]},t.id))}function I4({annotations:e,variant:n,onClear:t,onRemove:r}){const s=T.useRef(null),i=T.useRef(null),l=T.useId(),o=da(s),c=n==="sent",d=T.useRef(null),_=()=>{d.current!==null&&window.clearTimeout(d.current),d.current=null,o.setOpen(!0)},h=()=>{d.current=window.setTimeout(()=>{var S;(S=i.current)!=null&&S.contains(document.activeElement)||o.setOpen(!1)},160)},m=()=>{const S=c||!o.open;o.setOpen(S),S&&window.requestAnimationFrame(()=>{var k;return(k=i.current)==null?void 0:k.focus()})},g=S=>{r==null||r(S),window.requestAnimationFrame(()=>{var v,b;(b=((v=i.current)==null?void 0:v.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||b.focus()})};return T.useEffect(()=>()=>{d.current!==null&&window.clearTimeout(d.current)},[]),f.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:c?_:void 0,onMouseLeave:c?h:void 0,children:[f.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[f.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${c?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":l,onClick:m,children:[f.jsx(lz,{size:c?13:14,className:"text-muted"}),e.length===1?dX():yK({count:Gt(e.length)})]}),t&&f.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:d7(),"aria-label":d7(),onClick:t,children:f.jsx(Br,{size:13})})]}),o.open&&f.jsx("div",{id:l,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${c?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":nte(),children:f.jsx(W_t,{annotations:e,onRemove:r?g:void 0})})]})}function K_t(e){return f.jsx(I4,{...e,variant:"composer"})}const Y_t=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),mC=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),X_t=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),Z_t=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),rx="prompt-actions flex flex-wrap gap-2",Rc="local-",gM="bash",gC=[];function bC(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(Rc)),n]}function Q_t(e,n){switch(n.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return n.onlyIfAbsent&&n.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:n.messages},queuedBySession:{...e.queuedBySession,[n.sessionId]:n.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.activeLeafId??null}};case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(Rc),l=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:bC(t,n.message)},activeLeafBySession:r&&!i&&!l?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${Rc}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:gM,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?bC(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,l)=>r.push({id:`img${l}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,l)=>r.push({id:`annotation${l}`,type:"annotation",text:i.text}));const s={id:`${Rc}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"busy":{const t=new Set(e.busySessions);return n.busy?t.add(n.sessionId):t.delete(n.sessionId),{...e,busySessions:t}}case"seedBusy":{const t=new Set(n.sessions),r=new Set(n.known);for(const s of e.busySessions)r.has(s)||t.add(s);return{...e,busySessions:t}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}};case"forget":{const t={...e.messagesBySession};delete t[n.sessionId];const r=new Set(e.busySessions);r.delete(n.sessionId);const s={...e.queuedBySession};delete s[n.sessionId];const i={...e.activeLeafBySession};return delete i[n.sessionId],{messagesBySession:t,busySessions:r,queuedBySession:s,activeLeafBySession:i}}}}function J_t(e){if(!e)return"";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return u7e();const t=Math.floor(n/60);if(t<60)return a7e({value:Gt(t)});const r=Math.floor(t/60);return r<24?n7e({value:Gt(r)}):Q6e({value:Gt(Math.floor(r/24))})}function Sc(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function gv(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function e0t(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function xs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function bv(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function vv(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=Il));s++);return r}function t0t(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function Xu(...e){const n=new Set,t=new RegExp(`^${Dc}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=Il||r++>=_M)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function Om(e){return e.replace(/^Exit code \d+\s*/i,"").split(` -`).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` -`).trim()}function n0t(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function r0t(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Let(r),bM(r)}function bM(e){return i0t(e).replace(/[\t\r ]+/g," ").trim()}function s0t(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&xM(s)?{ref:r,path:s}:null}function l0t(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function vC(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function c0t(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!d.startsWith("-"));if(!o)return null;const c=vC(s,o);if(!c)return null;s=c}return s?vC(s,e):e}const Ma="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",u0t=new RegExp(`\\bchat_(${Ma})\\b`,"gi"),Dc=`(?:${Ma}|[0-9a-f]{8})`;function Zu(e){const n=[];let t="",r="",s=null,i=!1;const l=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=d=>{let _=1,h=null,m=!1;for(let g=d;g{let _=!1;for(let h=d;hBet(t.raw,n))}function Bi(e,n){return Im(e,n).length>0}function d0t(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,pM).matchAll(u0t))if(n.add(t[0].toLowerCase()),n.size>=Il)break;return[...n]}function sx(e,n){if(!e)return[];const t=new Set,r=e.slice(0,pM),s=n==="runs"?[new RegExp(`/runs/(${Ma})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Ma})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Ma})\\b`,"gim"),new RegExp(`={3,}\\s*(${Ma})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Ma})`,"gi"),new RegExp(`^\\s*id:\\s*(${Ma})`,"gim"),new RegExp(`={3,}\\s*(${Ma})\\s*={3,}`,"gi")];for(const l of s)for(const o of r.matchAll(l))if(t.add(o[1]),t.size>=Il)return[...t];const i=new RegExp(`^\\s*(${Ma})(?:\\s|$)`,"gim");for(const l of r.matchAll(i))if(t.add(l[1]),t.size>=Il)break;return[...t]}function wM(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function SM(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const l of e.matchAll(s)){if((l.index??0)>=t)break;i=l[1]??l[2]??l[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(l=>l[0])}function kM(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const l of e.matchAll(s)){const o=l.index??0;if(o>=t)break;const c=o+l[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(i=l[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(l=>l[0])}function f0t(e,n,t=[],r=[]){const s=Im(e,"logs"),i=new Set;if(s.length===0){if(!Bi(e,"logs"))return[];const o=t.length>0?[]:sx(n,"runs");for(const c of t.length>0?t:o.length>0?o:r)if(i.add(c),i.size>=Il)break;return Xu([...i])}let l=!1;for(const{invocation:o,offset:c}of wM(e,s)){const d=ld(o.raw);if((d==null?void 0:d[0])!=="logs")continue;const _=d.slice(1);let h=null;for(let v=0;v<_.length;v++){const b=_[v];if(b!=="--head"){if(b==="--bytes"||b==="--range"){v++;continue}if(!(b.startsWith("--bytes=")||b.startsWith("--range="))){h=b;break}}}if(!h){l=!0;continue}if(new RegExp(`^${Dc}$`,"i").test(h)){i.add(h);continue}const m=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(h);if(!m){l=!0;continue}const g=m[1],S=SM(e,g,c,Dc);for(const v of S)i.add(v);const k=kM(e,g,c,Dc);for(const v of k)i.add(v);S.length===0&&k.length===0&&(l=!0)}if(i.size===0||l){const o=t.length>0?[]:sx(n,"runs"),c=t.length>0?t:o.length>0?o:r;for(const d of c)if(i.add(d),i.size>=Il)break}return Xu([...i])}function Mu(e,n,t=[],r=[]){const s=Im(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let l=!1;for(const{invocation:o,offset:c}of wM(e,s)){const d=ld(o.raw),_=(d==null?void 0:d[0])==="exp"&&(d[1]==="status"||d[1]==="desc")?d[2]:null;let h=!1;_&&new RegExp(`^${Dc}$`,"i").test(_)&&(i.add(_),h=!0);const m=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(m){const g=m[1],S=SM(e,g,c,Dc);if(S.length>0){for(const v of S)i.add(v);h=!0}const k=kM(e,g,c,Dc);for(const v of k)i.add(v);k.length>0&&(h=!0)}h||(l=!0)}if(i.size===0||l){const o=t.length>0?[]:sx(n,"experiments"),c=t.length>0?t:o.length>0?o:r;for(const d of c)if(i.add(d),i.size>=Il)break}return Xu([...i])}function Bl(e){var b,x,y,C;const n=e.tool??"tool",t=((b=e.state)==null?void 0:b.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},l=xs(i,"command","cmd"),o=t0t(i,"commandArgv"),c=((x=e.state)==null?void 0:x.output)||((y=e.state)==null?void 0:y.error),d=Xu(vv(i,"targetIds")),_=Xu(vv(i,"runTargetIds")),h=Xu(vv(i,"experimentTargetIds")),m=xs(i,"filePath","file_path","notebookPath","notebook_path","path"),g=xs(i,"description"),S=n.toLowerCase().split(/(?::|\.|__)+/),k=S.at(-1)??n.toLowerCase();if(k==="run"&&S.includes("web")){const j=bv(i,"search_query","q"),N=bv(i,"image_query","q"),M=bv(i,"find","pattern");return j?{kind:"web",label:K6({query:j})}:N?{kind:"web",label:QF({query:N})}:M?{kind:"web",label:mU({pattern:M})}:Array.isArray(i.open)?{kind:"web",label:MJ()}:Array.isArray(i.weather)?{kind:"web",label:ZZ()}:Array.isArray(i.finance)?{kind:"web",label:UZ()}:Array.isArray(i.sports)?{kind:"web",label:WZ()}:Array.isArray(i.time)?{kind:"web",label:$Z()}:{kind:"web",label:c7()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(k)??k){case"bash":{if(!l&&!(o!=null&&o.length))return{kind:"command",label:iee()};const j=r0t(l??(o==null?void 0:o.join(" "))??""),N=Zu(j);let M=N.map(oe=>oe.raw);if(o!=null&&o.length){const oe=Iet(o);M=oe===null?[o]:Zu(bM(oe)).map(se=>se.raw)}let z=null;for(const oe of M)if(z=$et(oe),z)break;const D=M.some(oe=>{const se=ld(oe);return se!==null&&se[0]!=="discover"&&se[0]!=="paper"});if(z&&!D){const oe=z.kind==="discover"?{keyword:DF(),embedding:BF(),openalex:cU(),biorxiv:FF()}[z.strategy]:null,se=z.kind==="discover"?z.query?GH({activity:oe??W6(),query:z.query}):oe??W6():z.id?Ef({target:Ee(z.id)}):LP();return{kind:z.kind==="paper"?"read":"search",label:se,litCall:z}}if(Bi(j,"agent\\s+spawn"))return{kind:"agent",label:pQ(),spawnedSessionIds:d0t(c),litCall:z??void 0};const I=N.map(oe=>yM(oe.raw)),$=Bi(j,"exp\\s+status"),P=Bi(j,"exp\\s+desc"),F=Im(j,"exp\\s+desc").some(oe=>(ld(oe.raw)??[]).some(G=>G==="--set"||G.startsWith("--set=")||G==="--stdin")),W=F?qU():TP(),Z=F?tH():pF();if(Bi(j,"logs")){const oe=f0t(j,c,_,d);return{kind:"project",label:oe.length===1?oF():dF(),runIds:oe,litCall:z??void 0}}if(Bi(j,"exp\\s+run"))return{kind:"project",label:Ste(),litCall:z??void 0};if(Bi(j,"exp\\s+wait"))return{kind:"project",label:rne(),litCall:z??void 0};if(Bi(j,"exp\\s+cancel"))return{kind:"project",label:xZ(),litCall:z??void 0};const U=Bi(j,"project\\s+view");if(U&&$&&P)return{kind:"project",label:Z,experimentIds:Mu(j,c,h,d),litCall:z??void 0};if(U&&P)return{kind:"project",label:W,experimentIds:Mu(j,c,h,d),litCall:z??void 0};if(U&&$)return{kind:"project",label:u7(),experimentIds:Mu(j,c,h,d),litCall:z??void 0};if(U)return{kind:"project",label:yee(),litCall:z??void 0};if($&&P)return{kind:"project",label:Z,experimentIds:Mu(j,c,h,d),litCall:z??void 0};if($)return{kind:"project",label:u7(),experimentIds:Mu(j,c,h,d),litCall:z??void 0};if(P)return{kind:"project",label:W,experimentIds:Mu(j,c,h,d),litCall:z??void 0};if(Bi(j,"runs?"))return{kind:"project",label:hJ(),litCall:z??void 0};if(Bi(j,"projects"))return{kind:"project",label:gJ(),litCall:z??void 0};if(Bi(j,"compute"))return{kind:"project",label:zZ(),litCall:z??void 0};const Y=I.map(o0t).find(oe=>oe!=null);if(Y){const oe=gv(Y.path);return{kind:oe?"skill":"read",label:oe?cb({name:Ee(oe)}):Ef({target:Ee(Sc(Y.path))}),filePath:Y.path,fileRef:Y.ref,labelTarget:oe?`${oe} skill`:Sc(Y.path)}}const J=I.findIndex(oe=>oe!=null&&["sed","cat","head","tail"].includes(oe.name)),H=J>=0?I[J]:null,L=H?a0t(H):null,B=L?c0t(L,N,J,xs(i,"cwd","workdir")):null;if(L&&B){const oe=gv(B);return{kind:oe?"skill":"read",label:oe?cb({name:Ee(oe)}):Ef({target:Ee(Sc(L))}),filePath:B,labelTarget:oe?`${oe} skill`:Sc(L)}}if(I.some(oe=>(oe==null?void 0:oe.name)==="find"||(oe==null?void 0:oe.name)==="ls"||(oe==null?void 0:oe.name)==="rg"&&oe.args.includes("--files")))return{kind:"search",label:g7()};const X=I.findIndex(oe=>(oe==null?void 0:oe.name)==="rg"||(oe==null?void 0:oe.name)==="grep");if(X>=0){const oe=l0t(N[X].raw);return{kind:"search",label:oe?db({pattern:Ee(oe)}):ub(),searchPattern:oe??void 0}}const V=I.find(oe=>(oe==null?void 0:oe.name)==="git"),ae=V==null?void 0:V.args[0];if(ae==="grep"){const oe=V==null?void 0:V.args.slice(1).find(se=>!se.startsWith("-"));return{kind:"search",label:oe?db({pattern:Ee(oe)}):ub(),searchPattern:oe}}if(ae==="status")return{kind:"command",label:LZ()};if(ae==="diff")return{kind:"command",label:Yee()};if(ae==="log")return{kind:"command",label:gee()};const ce=oe=>I.some(se=>!se||!["cargo","pnpm","npm","yarn"].includes(se.name)?!1:se.args[0]===oe||se.args[0]==="run"&&se.args[1]===oe);return ce("test")?{kind:"command",label:cee()}:I.some(oe=>(oe==null?void 0:oe.name)==="tsc")||ce("typecheck")?{kind:"command",label:tQ()}:ce("lint")?{kind:"command",label:kZ()}:ce("build")?{kind:"command",label:fZ()}:{kind:"command",label:vP({command:Ee(j)})}}case"skill":{const j=xs(i,"skill","name"),N=j?e0t(n,j):null;return{kind:"skill",label:j?oP({name:Ee(j)}):rP(),filePath:N??void 0,labelTarget:N&&j?`${j} skill`:void 0}}case"read":{const j=m?Sc(m):null,N=m?gv(m):null;return N?{kind:"skill",label:cb({name:Ee(N)}),filePath:m??void 0,labelTarget:`${N} skill`}:j?{kind:"read",label:Ef({target:Ee(j)}),filePath:m??void 0,labelTarget:j}:{kind:"read",label:hee()}}case"edit":case"write":case"notebookedit":{const j=n0t(i),N=m??(j==null?void 0:j.path)??null,M=N?Sc(N):null,z=M?(j==null?void 0:j.type)==="add"?gH({target:Ee(M)}):(j==null?void 0:j.type)==="delete"?jH({target:Ee(M)}):IH({target:Ee(M)}):null;return M?{kind:"edit",label:z??h7(),filePath:N??void 0,labelTarget:M}:{kind:"edit",label:h7()}}case"grep":{const j=xs(i,"pattern");return{kind:"search",label:j?db({pattern:Ee(j)}):ub(),searchPattern:j??void 0}}case"glob":{const j=xs(i,"pattern");return{kind:"search",label:j?YH({pattern:Ee(j)}):g7()}}case"websearch":{const j=xs(i,"query"),N=xs(i,"url"),M=xs(i,"pattern");return j?{kind:"web",label:K6({query:j})}:M&&N?{kind:"web",label:iU({pattern:M})}:N?{kind:"web",label:pP({target:Ee(N)})}:{kind:"web",label:g??c7()}}case"webfetch":{const j=xs(i,"url");return{kind:"web",label:j?Ef({target:Ee(j)}):g??GP()}}case"task":return{kind:"agent",label:g??SP()};case"subagent":return{kind:"agent",label:h0t(i)};case"error":return{kind:"command",label:Vte()};case"contextcompaction":return{kind:"command",label:cH(),progressLabel:hH()};default:{const j=g??m??l??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:j?`${n}: ${j}`:n}}}}function h0t(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return zU();case"sendInput":return kU();case"resumeAgent":return JP();case"wait":return KU();case"closeAgent":return iH()}switch(typeof e.kind=="string"?e.kind:""){case"started":return HU();case"interacted":return U$();case"interrupted":return OU()}return MU()}function Up({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=f.jsx(Cd,{...t});if(e.litCall)r=f.jsx(Fz,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=f.jsx(JN,{...t});break;case"read":case"project":r=f.jsx(ez,{...t});break;case"search":r=f.jsx(dz,{...t});break;case"edit":r=f.jsx(ty,{...t});break;case"web":r=f.jsx(gZe,{...t});break;case"agent":r=f.jsx(sy,{...t});break}return f.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function xv({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=T.useState(!1),l=T.useRef(null),o=T.useRef(!1);return T.useEffect(()=>{var c,d;!s||!o.current||(o.current=!1,(d=(c=l.current)==null?void 0:c.querySelector("button"))==null||d.focus())},[s]),f.jsxs("span",{className:"tool-target-overflow inline",children:[s&&f.jsx("span",{className:"tool-target-reveal",ref:l,children:e.map((c,d)=>f.jsxs("span",{children:[d>0&&", ",n||t?f.jsx("button",{className:"tool-target",...n?zr(_=>n(c.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(c.id)}},children:c.label}):f.jsx("span",{children:c.label})]},c.id))}),s&&", ",f.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?dB({target:r}):T$({count:Gt(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current=!s&&c.detail===0,i(d=>!d)},children:s?tN():xie({count:Gt(e.length)})})]})}function ix({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:l}){var o,c,d,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return f.jsxs("a",{className:"tool-target",href:Get(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,f.jsx(kXe,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const h=e.filePath;return f.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...zr(m=>n(h,void 0,void 0,e.fileRef,m),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const h=e.spawnedSessionIds,m=h.slice(0,3),g=h.slice(m.length).map((S,k)=>({id:S,label:r7({number:Gt(m.length+k+1)})}));return f.jsxs(f.Fragment,{children:[e.label," — ",m.map((S,k)=>f.jsxs("span",{children:[k>0&&", ",f.jsx("button",{className:"tool-target",title:zJ(),onClick:v=>{v.preventDefault(),v.stopPropagation(),r(S)},children:r7({number:Gt(k+1)})})]},S)),g.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(xv,{items:g,onSelect:r,targetType:hK()})]})]})}if((d=e.runIds)!=null&&d.length){const h=s?e.runIds.filter(S=>!!s(S)):e.runIds;if(h.length===0)return e.label;const m=h.slice(0,3),g=h.slice(m.length).map(S=>({id:S,label:(s==null?void 0:s(S))||wo()}));return f.jsxs(f.Fragment,{children:[e.label," — ",m.map((S,k)=>f.jsxs("span",{children:[k>0&&", ",t?f.jsx("button",{className:"tool-target",title:FB({run:Ee(S)}),...zr(v=>t(S,v),{stopPropagation:!0}),children:(s==null?void 0:s(S))||wo()}):f.jsx("span",{children:(s==null?void 0:s(S))||wo()})]},S)),g.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(xv,{items:g,onOpen:t,targetType:_re()})]})]})}if((_=e.experimentIds)!=null&&_.length){const h=l?e.experimentIds.filter(S=>!!l(S)):e.experimentIds;if(h.length===0)return e.label;const m=h.slice(0,3),g=h.slice(m.length).map(S=>({id:S,label:(l==null?void 0:l(S))||wo()}));return f.jsxs(f.Fragment,{children:[e.label," — ",m.map((S,k)=>f.jsxs("span",{children:[k>0&&", ",i?f.jsx("button",{className:"tool-target",title:AB({name:(l==null?void 0:l(S))||Ee(S)}),...zr(v=>i(S,v),{stopPropagation:!0}),children:(l==null?void 0:l(S))||wo()}):f.jsx("span",{children:(l==null?void 0:l(S))||wo()})]},S)),g.length>0&&f.jsxs(f.Fragment,{children:[", ",f.jsx(xv,{items:g,onOpen:i,targetType:AY()})]})]})}return e.label}function B4(e){const n=e.progressLabel??{skill:dP(),read:YP(),search:xU(),edit:PH(),project:vF(),web:Z$(),agent:CH(),command:GE()}[e.kind];return{...e,label:n}}function CM(e,n){const t=Bl({tool:e,state:{status:"running",input:n}});return{skill:JH(),read:NP(),search:AF(),edit:RH(),project:rF(),web:W$(),agent:yH(),command:SF()}[t.kind]}function _0t(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const p0t=250;function m0t(e,n){const[t,r]=T.useState(e),s=T.useRef(Date.now()),i=T.useRef(e);return T.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const l=p0t-(Date.now()-s.current);if(l<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},l);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const g0t=160;function EM(e){const[n,t]=T.useState(!1);return T.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),g0t);return()=>window.clearTimeout(r)},[e]),e&&n}function b0t(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:XE()}}function v0t(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function x0t(e){const n=[];let t=null;for(const r of e){const s=Bl(r),i=v0t(r,s),l=n[n.length-1];i&&l&&t===i?l.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function y0t({part:e,busy:n,recovering:t,onRecover:r}){var m,g;const s=(m=e.state)==null?void 0:m.input,i=(s==null?void 0:s.nextRetryAt)??null,[l,o]=T.useState(Date.now());if(T.useEffect(()=>{if(typeof i!="number"||(o(Date.now()),i<=Date.now()))return;const S=window.setInterval(()=>{const k=Date.now();o(k),k>=i&&window.clearInterval(S)},1e3);return()=>window.clearInterval(S)},[i]),e.id==="turn-retry"){const S=Aet(s??{},l);return f.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[f.jsx(Rt,{}),f.jsx("span",{children:S})]})}const c=Hz(s==null?void 0:s.recoveryAction),d=s==null?void 0:s.turnId;if(c!=="retry"&&c!=="continue"||!d)return null;const _=c==="retry"?Ml():uY(),h=Om(((g=e.state)==null?void 0:g.error)||ise());return f.jsxs("div",{className:"turn-recovery-row flex items-center justify-between gap-2 py-1.5 px-2.5 border border-border rounded-md bg-background",children:[f.jsx("span",{className:"min-w-0 truncate text-sm text-accent-red",title:h,children:h}),f.jsx(He,{type:"button",size:"small",disabled:n||t,onClick:()=>r==null?void 0:r(d,c),children:t?Mre():_})]})}function xC({part:e,repeatCount:n=1,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:l,experimentName:o}){const c=e.state,d=Bl(e),_=(c==null?void 0:c.status)==="error",h=Om((c==null?void 0:c.error)||(c==null?void 0:c.output)||""),m=_&&!!h,[g,S]=T.useState(!1),k=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,v=f.jsxs(f.Fragment,{children:[_&&f.jsxs("span",{className:"sr-only",children:[Fx()," "]}),_?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(sz,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):f.jsx(Up,{activity:d,className:"text-muted"}),f.jsxs("span",{className:`${hM} ${_?"text-accent-red":"text-subtext"}`,children:[f.jsx(ix,{activity:d,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:l,experimentName:o}),n>1&&f.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:vB({count:Gt(n)}),children:["×",n]})]})]});return m?f.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[f.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[v,f.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":g,"aria-controls":k,"aria-label":g?pB({activity:d.label}):N$({activity:d.label}),onClick:()=>S(b=>!b),children:f.jsx(qa,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${g?"rotate-90":""}`})})]}),g&&f.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:k,children:f.jsx("div",{className:O4,children:h.slice(0,2e4)})})]}):f.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:v})}function w0t({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:l,experimentName:o}){var j,N,M,z;const[c,d]=T.useState(!1),_=x0t(e),h=_.map(({activity:D})=>D),m=n?_.at(-1):void 0,g=m==null?void 0:m.part,S=m==null?void 0:m.activity,k=((j=g==null?void 0:g.state)==null?void 0:j.status)!=="error"?(S&&B4(S))??null:null,v=!!g&&((N=g.state)==null?void 0:N.status)==="running"&&!(k!=null&&k.progressLabel)&&(_0t((M=g.state)==null?void 0:M.input)||(k==null?void 0:k.kind)==="command"&&!xs(((z=g.state)==null?void 0:z.input)??{},"command","cmd")),b=m0t(k,v),x=EM(b!=null),y=b??b0t(h),C=b?b.label:XE();return e.length===1?b?f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[f.jsx(Up,{activity:b,className:x?"tool-running-shimmer-icon":"text-muted"}),f.jsx("span",{className:`${x?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:C,children:f.jsx(ix,{activity:b,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:l,experimentName:o})})]})}):f.jsx("div",{className:"tool-group my-3.5 mx-0",children:f.jsx(xC,{part:e[0],onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:l,experimentName:o})}):f.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[f.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[f.jsx(Up,{activity:y,className:x?"tool-running-shimmer-icon":"text-muted"}),b?f.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${x?"tool-running-shimmer":""}`,title:C,children:f.jsx(ix,{activity:b,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:l,experimentName:o})}):f.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:()=>d(D=>!D),"aria-expanded":c,children:C}),f.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:()=>d(D=>!D),"aria-expanded":c,"aria-label":c?aY():EY(),children:f.jsx(qa,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${c?"open":""}`})})]}),f.jsx("div",{className:`tool-group-disclosure ${c?"open":""}`,"aria-hidden":!c,inert:!c,children:f.jsx("div",{className:"tool-group-disclosure-inner",children:f.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_.map(({part:D,count:I})=>f.jsx(xC,{part:D,repeatCount:I,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:l,experimentName:o},D.id))})})})]})}function S0t({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,l]=T.useState([]),o=!n,c=h=>n==null?void 0:n({promptId:e.id,...h});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const g=s.approved===!0?{label:HJ(),icon:mi,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:QJ(),icon:ty,iconClass:"text-accent-amber"}:s.approved===!1?{label:qJ(),icon:Br,iconClass:"text-accent-red"}:{label:KJ(),icon:im,iconClass:"text-muted"},S=g.icon;return f.jsxs("details",{className:X_t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?ZE():N7()}),f.jsx(S,{size:17,strokeWidth:1.8,className:`shrink-0 ${g.iconClass}`}),f.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:g.label}),f.jsx(qa,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),f.jsxs("div",{className:`${mC} ms-6`,children:[f.jsx($a,{text:s.plan??"",onOpenFile:t}),s.note&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const h=(s.answers??[]).join(", ")||s.note||"",m=(s.annotations??[]).map((g,S)=>({id:`${e.id}-annotation-${S}`,text:g.text}));return f.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[m.length>0&&f.jsx(I4,{annotations:m,variant:"sent"}),f.jsxs("details",{className:Y_t,children:[f.jsxs("summary",{children:[f.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||Rne()}),f.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${h?"chosen":""}`,children:h||are()})]}),f.jsxs("div",{className:mC,children:[s.header&&s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&f.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(g=>{var S;return f.jsx("li",{className:(S=s.answers)!=null&&S.includes(g.label)?"sel":"",children:g.label},g.label)})}),s.note&&s.note!==h&&f.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const h=!!r;return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[f.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Ene():N7()}),f.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${h?"clamped":""}`,children:f.jsx($a,{text:s.plan??"",onOpenFile:t})}),h&&f.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...zr(m=>r(s.plan??"",e.id,m)),children:Jte()}),!o&&!h&&f.jsxs("div",{className:rx,children:[f.jsx(He,{size:"small",variant:"primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:wX()}),f.jsx(He,{size:"small",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:EX()}),f.jsx(He,{size:"small",onClick:()=>c({approve:!1}),children:Cee()})]})]})}if(s.kind==="permission"){const h=s.toolInput??{},m=xs(h,"command","cmd","filePath","file_path","path")||"",g=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",S=xs(h,"description")||"",k=g||S||CM(s.tool,h),v=`permission-heading-${e.id}`;return f.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":v,children:[f.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[f.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:f.jsx(_z,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),f.jsx("span",{id:v,className:"text-base font-semibold text-text",children:FX()})]}),f.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[f.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:k}),m&&f.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:m}),!o&&f.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[f.jsx(He,{size:"small",variant:"ghost",onClick:()=>c({approve:!1}),children:wQ()}),f.jsx(He,{size:"small",variant:"primary",onClick:()=>c({approve:!0}),children:BX()})]})]})]})}const d=h=>l(m=>s.multiSelect?m.includes(h)?m.filter(g=>g!==h):[...m,h]:[h]);return f.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&f.jsx("div",{className:Z_t,children:s.header}),s.question&&f.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),f.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(h=>{const m=i.includes(h.label);return f.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${m?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?d(h.label):c({answers:[h.label]}),children:[f.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:h.label}),h.description&&f.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:h.description})]},h.label)})}),s.multiSelect&&!o&&f.jsx("div",{className:rx,children:f.jsx(He,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>c({answers:i}),children:Bte()})})]})}function k0t(e,n){return e.role==="user"?!0:e.parts.some(t=>zp(t,n))}function C0t(e){const n=e.text??"",t=n.startsWith("data:")?n:eet(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function E0t({count:e,index:n,prevId:t,nextId:r,onSelect:s,pagerDisabled:i,onEdit:l,editDisabled:o}){const c=e>1;return f.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${c?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[c&&f.jsxs(f.Fragment,{children:[f.jsx(qt,{size:"small",title:v7(),"aria-label":v7(),disabled:i||!t,onClick:()=>t&&s(t),children:f.jsx(tz,{size:14})}),f.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[n+1,"/",e]}),f.jsx(qt,{size:"small",title:b7(),"aria-label":b7(),disabled:i||!r,onClick:()=>r&&s(r),children:f.jsx(qa,{size:14})})]}),f.jsx(qt,{size:"small",title:f7(),"aria-label":f7(),disabled:o,onClick:l,children:f.jsx(ty,{size:13})})]})}const N0t=T.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:l,runExperimentName:o,onOpenExperiment:c,experimentName:d,onRespond:_,onOpenPlan:h,onOpenSubagent:m,busy:g=!1,recoveringTurnId:S,onRecover:k,skills:v,predictTextTail:b=!1,forkCount:x,forkIndex:y=0,forkPrevId:C,forkNextId:j,forkDisabled:N,branchDisabled:M,onFork:z,onSelectFork:D}){var Z,U;qc();const[I,$]=T.useState(null),P=z0t(n);if(P)return f.jsx(j0t,{part:P});if(n.role==="user"){const Y=n.parts.filter(V=>V.type==="text").map(V=>V.text??"").join(` -`),J=V=>!!(v!=null&&v.some(ae=>ae.name===V)),H=n.parts.filter(V=>V.type==="image"&&V.text).map(C0t),L=H.filter(V=>!V.isPdf),B=H.filter(V=>V.isPdf),X=n.parts.filter(V=>V.type==="annotation"&&V.text).map(V=>({id:V.id,text:V.text??""}));if(I!==null){const V=()=>{const ae=I.trim();!ae||N||($(null),z(n.id,ae))};return f.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:f.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[f.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":jQ(),value:I,autoFocus:!0,onChange:ae=>$(ae.target.value),onKeyDown:ae=>{ae.key==="Escape"?(ae.preventDefault(),$(null)):ae.key==="Enter"&&!ae.shiftKey&&!ae.nativeEvent.isComposing&&(ae.preventDefault(),V())}}),f.jsxs("div",{className:`${rx} justify-end`,children:[f.jsx(He,{size:"small",onClick:()=>$(null),children:mZ()}),f.jsx(He,{size:"small",variant:"primary",onClick:V,disabled:N||!I.trim(),children:Gv()})]})]})})}return f.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[X.length>0&&f.jsx(I4,{annotations:X,variant:"sent"}),f.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:me-0.5 [&_.skill-chip]:align-baseline",children:[f.jsx(v_t,{text:Y,isCommand:J}),L.length>0&&f.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:L.map((V,ae)=>f.jsx("a",{href:V.src,target:"_blank",rel:"noreferrer",children:f.jsx("img",{src:V.src,alt:IK()})},ae))}),B.length>0&&f.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:B.map((V,ae)=>f.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:V.src,target:"_blank",rel:"noreferrer",children:[f.jsx(im,{size:15}),f.jsx("span",{children:V.name})]},ae))})]}),x!==void 0&&f.jsx(E0t,{count:x,index:y,prevId:C,nextId:j,onSelect:D,pagerDisabled:M,onEdit:()=>$(Y),editDisabled:N})]})}const F=n.parts.find(Uh),W=F?n.parts.filter(Y=>Y!==F):n.parts;return f.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[NM(W,{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:l,runExperimentName:o,onOpenExperiment:c,experimentName:d,onRespond:_,onOpenPlan:h,onOpenSubagent:m,predictTextTail:b}),F&&f.jsx(y0t,{part:F,busy:g,recovering:S===((U=(Z=F.state)==null?void 0:Z.input)==null?void 0:U.turnId),onRecover:k})]})});function z0t(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===gM?n:null}function j0t({part:e}){var c;const n=e.state,t=xs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.exitCode)=="number"?n.input.exitCode:null,l=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` -`),o=r?GE():s&&i!==null?JK({code:Gt(i)}):null;return f.jsx("div",{className:"msg-shell self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:f.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[f.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[f.jsxs("span",{className:"sr-only",children:[WE()," "]}),f.jsx(Cd,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),f.jsx("span",{children:t})]}),l&&f.jsx("div",{className:`${O4} mt-2`,children:l.slice(0,2e4)}),o&&f.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function NM(e,n){var x,y;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:l,runExperimentName:o,onOpenExperiment:c,experimentName:d,onRespond:_,onOpenPlan:h,onOpenSubagent:m,predictTextTail:g=!1}=n,S=e.filter(C=>C.type!=="steer"&&zp(C,t)).at(-1),k=[];let v=[];const b=()=>{v.length!==0&&(k.push(f.jsx(w0t,{parts:v,pendingTail:v.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:l,runExperimentName:o,onOpenExperiment:c,experimentName:d},`tg-${v[0].id}`)),v=[])};for(const C of e)if(zp(C,t)){if(C.type==="tool"&&(T0t(C.tool)||(((x=C.children)==null?void 0:x.length)??0)>0)){b(),k.push(f.jsx(R0t,{part:C,pendingTail:g&&((y=C.state)==null?void 0:y.status)==="running"||C.id===r,onOpenSubagent:m},C.id));continue}if(C.type==="tool"){v.push(C);continue}b(),C.type==="text"?k.push(f.jsx($a,{text:C.text,onOpenFile:s,onOpenRun:i,predict:g&&C.id===(S==null?void 0:S.id)},C.id)):C.type==="steer"?k.push(f.jsx("div",{dir:"auto",role:"note","aria-label":pne(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&k.push(f.jsx(S0t,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:h},C.id))}return b(),k}function A0t(e){return Bl(e).label}function T0t(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function zM(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function $4(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&$4(t.children,n);if(r)return r}return null}function M0t({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:l}){var S,k,v,b;const o=e.children??[],c=((S=e.state)==null?void 0:S.status)==="running",d=((k=e.state)==null?void 0:k.status)==="error",_=d?Om(((v=e.state)==null?void 0:v.error)||((b=e.state)==null?void 0:b.output)||""):"",h=NM(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:l,predictTextTail:c,pendingTailToolId:c?Bz(o):null}),g=o.some(x=>x.type==="text"&&!!x.text)?"":zM(e);return f.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[d&&f.jsxs("span",{className:"sr-only",children:[Fx()," "]}),_&&f.jsx("div",{className:O4,children:_.slice(0,2e4)}),h.length===0&&!g&&!_?f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Ux():JY()}):f.jsxs(f.Fragment,{children:[h,g&&f.jsx($a,{text:g,onOpenFile:n,onOpenRun:t})]})]})}function R0t({part:e,pendingTail:n,onOpenSubagent:t}){var d,_,h,m;const r=((d=e.state)==null?void 0:d.status)==="error",s=Om(((_=e.state)==null?void 0:_.error)||((h=e.state)==null?void 0:h.output)||""),i=n&&!r?B4(Bl(e)):Bl(e),l=EM(!!(n&&!r)),o=(((m=e.children)==null?void 0:m.length)??0)===0&&!r&&!zM(e),c=f.jsxs(f.Fragment,{children:[r&&f.jsxs("span",{className:"sr-only",children:[Fx()," "]}),r?f.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:f.jsx(sz,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):f.jsx(Up,{activity:i,className:`subagent-icon ${l?"tool-running-shimmer-icon":"text-muted"}`}),f.jsx("span",{className:`${hM} ${l?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?f.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):f.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:pX(),...zr(g=>t==null?void 0:t(e.id,i.label,g)),disabled:!t,children:[c,f.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:f.jsx(qa,{size:12})})]})}function D0t(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var l,o;for(const c of s){const d=`${i}/${c.id}`;c.type==="tool"&&((l=c.state)!=null&&l.status)&&n.set(d,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,d)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function H4(e){const n=(t,r)=>{var s;for(const i of t){const l=i.prompt;if(i.type==="prompt"&&(l==null?void 0:l.kind)==="permission"&&!l.resolved){const o=l.toolInput??{},d=xs(o,"reason","description")||CM(l.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:d}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function L0t(e){const[n,t]=T.useState({text:"",sequence:0}),r=T.useRef(null);return T.useEffect(()=>{var S,k,v,b,x;const s=((S=e[0])==null?void 0:S.id)??"",{messageId:i,states:l}=D0t(e),o=H4(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:l,permissionPath:(o==null?void 0:o.path)??null},t(y=>({text:o?Y6({label:Oa(o.label)}):"",sequence:y.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,d=r.current.permissionPath,_=[...l].filter(([y,C])=>{var j;return((j=c.get(y))==null?void 0:j.status)!==C.status});if(r.current={transcript:s,messageId:i,states:l,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==d){t(y=>({text:Y6({label:Oa(o.label)}),sequence:y.sequence+1}));return}const h=(k=_.find(([,y])=>Uh(y.part)))==null?void 0:k[1].part;if((h==null?void 0:h.id)==="turn-recovery"){const y=Hz((b=(v=h.state)==null?void 0:v.input)==null?void 0:b.recoveryAction);t(C=>({text:`${jq()}${y?` ${y==="retry"?cq():iq()}`:""}`,sequence:C.sequence+1}));return}if((h==null?void 0:h.id)==="turn-retry"){t(y=>({text:tq(),sequence:y.sequence+1}));return}const m=_.filter(([,y])=>y.status==="error");if(m.length>0){const y=m.slice(0,2).map(([,C])=>Bl(C.part).label).join(", ");t(C=>({text:m.length===1?yq({labels:y}):Cq({count:Gt(m.length),labels:y}),sequence:C.sequence+1}));return}const g=_.filter(([,y])=>y.status==="running");if(g.length>0){const y=(x=g.at(-1))==null?void 0:x[1].part;t(C=>({text:y?B4(Bl(y)).label:hq(),sequence:C.sequence+1}));return}_.some(([,y])=>y.status==="completed")&&t(y=>({text:gq(),sequence:y.sequence+1}))},[e]),n}const O0t=T.memo(function({messages:n,allMessages:t,canFork:r,onFork:s,onSelectFork:i,busy:l,onOpenFile:o,onOpenRun:c,onOpenSpawnedSession:d,runExperimentName:_,onOpenExperiment:h,experimentName:m,onRespond:g,onOpenPlan:S,onOpenSubagent:k,recoveringTurnId:v,onRecover:b,skills:x}){var D;qc();const y=((D=H4(n))==null?void 0:D.id)??null,C=T.useMemo(()=>n.filter(I=>k0t(I,y)),[n,y]),j=T.useMemo(()=>{const I=C.filter($=>$.role==="user"&&!$.id.startsWith(Rc));return met(t,n,I,$=>$.startsWith(Rc))},[n,C,t]),N=C.at(-1),M=L0t(n),z=l?$z(n):null;return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:f.jsx("span",{children:M.text},M.sequence)}),C.map(I=>{var W,Z,U,Y,J,H;const $=I.parts.find(Uh),P=(Z=(W=$==null?void 0:$.state)==null?void 0:W.input)==null?void 0:Z.turnId,F=$?l||v!==null:!1;return f.jsx(N0t,{message:I,forkCount:(U=j.get(I.id))==null?void 0:U.count,forkIndex:(Y=j.get(I.id))==null?void 0:Y.index,forkPrevId:(J=j.get(I.id))==null?void 0:J.prevId,forkNextId:(H=j.get(I.id))==null?void 0:H.nextId,forkDisabled:!r,branchDisabled:l,onFork:s,onSelectFork:i,activePermissionId:y,pendingTailToolId:(z==null?void 0:z.messageId)===I.id?z.toolId:null,onOpenFile:o,onOpenRun:c,onOpenSpawnedSession:d,runExperimentName:_,onOpenExperiment:h,experimentName:m,onRespond:g,onOpenPlan:S,onOpenSubagent:k,busy:F,recoveringTurnId:P===v?v:null,onRecover:b,skills:x,predictTextTail:l&&I===N&&I.role==="assistant"},I.id)})]})}),yC=(e,n)=>e==="all"?!0:e==="archived"?n:!n,jM=[{id:"active",label:AX,railLabel:QE},{id:"archived",label:o7,railLabel:o7},{id:"all",label:DX,railLabel:gK}];function I0t({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=da();return f.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[f.jsx(qt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:m7(),"aria-label":m7(),onClick:()=>r(i=>!i),children:f.jsx(hz,{size:13})}),t&&f.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:jM.map(i=>f.jsxs(Nr,{onClick:()=>{n(i.id),r(!1)},children:[f.jsx("span",{children:i.label()}),e===i.id&&f.jsx(mi,{size:13})]},i.id))})]})}const B0t=14,$0t=500,H0t=1200;function AM({title:e,animate:n}){return n?f.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?f.jsx("span",{"aria-hidden":!0,children:t},r):f.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*B0t,$0t)}ms`},children:t},r))}):f.jsx(f.Fragment,{children:e})}function P0t({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:l,onRename:o,onSetArchived:c,onDelete:d}){var j;const{open:_,setOpen:h,ref:m}=da(),g=((j=e.title)==null?void 0:j.trim())||"Untitled",[S,k]=T.useState(!1),[v,b]=T.useState(""),x=T.useRef(null);function y(){var N;b(((N=e.title)==null?void 0:N.trim())||""),k(!0)}function C(){var M;const N=v.trim();k(!1),N&&N!==(((M=e.title)==null?void 0:M.trim())||"")&&o(N)}return T.useEffect(()=>{var N,M;S&&((N=x.current)==null||N.focus(),(M=x.current)==null||M.select())},[S]),f.jsxs("div",{ref:m,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${S?"editing":""}`,title:`${Pf[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?zre():""}`,onClick:()=>{S||(_?h(!1):l())},onKeyDown:N=>{N.target===N.currentTarget&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),_?h(!1):l())},children:[f.jsx("span",{className:"session-dot",children:r?f.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&f.jsx("span",{className:"unread-dot"})}),e.parentSessionId&&!S&&f.jsx(sy,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),S?f.jsx("input",{ref:x,className:"session-title-input","aria-label":mte(),value:v,onChange:N=>b(N.target.value),onClick:N=>N.stopPropagation(),onBlur:C,onKeyDown:N=>{N.stopPropagation(),N.key==="Enter"?(N.preventDefault(),C()):N.key==="Escape"&&(N.preventDefault(),k(!1))}}):f.jsx("span",{className:"session-title",children:f.jsx(AM,{title:g,animate:i!==void 0},i??"static")}),f.jsx("span",{className:"session-time",children:J_t(e.updatedAt)}),f.jsx("button",{className:"session-menu-btn",title:k7(),"aria-label":k7(),onClick:N=>{N.stopPropagation(),h(M=>!M)},children:f.jsx(Zx,{size:14})}),_&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[f.jsx(Nr,{onClick:N=>{N.stopPropagation(),h(!1),y()},children:f.jsx("span",{children:YE()})}),f.jsx(Nr,{onClick:N=>{N.stopPropagation(),h(!1),c(!e.archived)},children:f.jsx("span",{children:e.archived?hse():CK()})}),f.jsx(Nr,{danger:!0,onClick:N=>{N.stopPropagation(),h(!1),d()},children:f.jsx("span",{children:KE()})})]})]})}const wC=[ez,dz,Cd,Qx],yv=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],SC="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function F0t({onClose:e,onConfigureSsh:n}){const[t,r]=T.useState(null),[s,i]=T.useState([]),[l,o]=T.useState(""),[c,d]=T.useState(null),[_,h]=T.useState(null),m=T.useRef(null);T.useEffect(()=>{Promise.all([Cz(),uJe()]).then(([v,b])=>{r(v),i(b)}).catch(v=>d(v instanceof Error?v.message:String(v)))},[]),R4(m,e);async function g(v){const b=window.open("/remote-launch","_blank");if(!b){fr(uke(),"error");return}h(v);try{const x=await dJe(v,{theme:det(),locale:E()});b.location.replace(x.gatewayUrl),e()}catch(x){b.close(),fr(x instanceof Error?x.message:String(x),"error")}finally{h(null)}}const S=t==null?void 0:t.filter(v=>v.host.toLocaleLowerCase().includes(l.trim().toLocaleLowerCase())),k=new Map(s.map(v=>[v.host,v]));return Ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:v=>{v.target===v.currentTarget&&e()},children:f.jsxs("div",{ref:m,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[f.jsx(qt,{className:"absolute end-3.5 top-3.5","aria-label":P7e(),onClick:e,children:f.jsx(Br,{size:16})}),f.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[f.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:vN()}),f.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:G7e()}),f.jsx(ws,{"data-initial-focus":!0,className:"mt-4",value:l,onChange:v=>o(v.target.value),placeholder:uS(),"aria-label":uS()})]}),f.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:c?f.jsx("p",{className:"m-3 text-sm text-accent-red",children:c}):t===null?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[f.jsx(Rt,{})," ",ON()]}):(S==null?void 0:S.length)===0?f.jsx("p",{className:"m-3 text-sm text-subtext",children:KSe()}):S==null?void 0:S.map(v=>{const b=k.get(v.host);return f.jsxs(He,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===v.host,onClick:()=>void g(v.host),children:[f.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:v.host}),_===v.host?f.jsx(Rt,{}):b?f.jsx("span",{className:"text-sm text-subtext",children:nke()}):null]},v.host)})}),f.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:f.jsxs(He,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[f.jsx(hz,{size:15}),VN()]})})]})}),document.body)}function U0t({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:l,experimentsActive:o,filesActive:c,artifactsActive:d,onOpenExperiments:_,onOpenArtifacts:h,onOpenFile:m,onOpenRun:g,runExperimentName:S,onOpenExperiment:k,experimentName:v,onOpenPlan:b,onOpenSubagent:x,onOpenWorktree:y,runtime:C,onOpenDemoWelcome:j,composerPrefill:N=null,onActiveSessionChange:M,preferredAgent:z,onPreferredAgentChange:D,children:I}){var c_,$d,Hd;const[$,P]=T.useState([]),[F,W]=T.useState(!1),[Z,U]=T.useState(!1),[Y,J]=T.useState(null),[H,L]=T.useState(new Set),[B,X]=T.useState("active"),[V,ae]=T.useState(""),[ce,oe]=T.useState([]),se=T.useRef(0),G=T.useRef({projectId:e,activeId:Y});G.current={projectId:e,activeId:Y};const[ne,le]=T.useState([]),[_e,ue]=T.useState(null),[ze,Ne]=T.useState(null),Ie=T.useRef(Promise.resolve()),qe=T.useRef(0),Fe=T.useRef(0),[Ot,xt]=T.useState(null),Nt=T.useRef(null),Jt=T.useRef(!1),ht=T.useRef(null),[it,et]=T.useReducer(Q_t,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[Pt,we]=T.useState([]),[Oe,Je]=T.useState(z);T.useEffect(()=>Je(z),[z]);const[nt,De]=T.useState({}),[At,pt]=T.useState({}),[It,nn]=T.useState(null),gn=T.useRef(!1),Ct=T.useRef(null),[xn,rn]=T.useState(null),lr=T.useRef(null),[_r,Ln]=T.useState(new Map),Yn=T.useRef(new Map),sn=T.useRef(new Set),$n=T.useRef(new Set),Cn=T.useRef(0),mt=T.useRef([]),an=T.useRef(null),Xe=T.useRef(null),ot=T.useRef(!0),[en,Be]=T.useState(!0),Qe=T.useRef(null),pn=da(),Xn=T.useCallback(te=>{var me;se.current+=1,oe(Ce=>[...Ce,{id:`annotation-${se.current}`,...te}]),(me=Qe.current)==null||me.focus()},[]),Vt=q_t(Xe,Xn);G_t(ce),T.useEffect(()=>{oe([]),Vt.dismiss()},[Y,e,Vt.dismiss]);const[wt,on]=T.useState([]),[yn,bn]=T.useState(0),[wn,An]=T.useState(!1),[Hn,jr]=T.useState(0),cs=T.useRef(!1);T.useEffect(()=>{BJe().then(on).catch(()=>{})},[i]);function us(te){if(!es)return;if(te.source==="command"&&te.name==="plan"){ni(V,es);return}const me=lC(V,es,te.name,2);ae(me.text),window.requestAnimationFrame(()=>{var Ce,je;(Ce=Qe.current)==null||Ce.focus(),(je=Qe.current)==null||je.setSelectionRange(me.cursor,me.cursor),jr(me.cursor)})}function yr(te){const me=te.selectionStart;if(cs.current||me!==te.selectionEnd)return!1;const Ce=hv(V,me);if(!Ce||Ce.end!==me||!ba(Ce.query))return!1;const je=cC(V,Ce);return ae(je.text),jr(je.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(je.cursor,je.cursor)),!0}function Ci(te){ue(null);let je=ne.reduce((Ve,kt)=>Ve+kt.size,0);for(const Ve of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ve.type))continue;if(Ve.size>31457280){ue(PK({name:Ee(Ve.name)}));continue}if(je+Ve.size>41943040){ue(GK());continue}je+=Ve.size;const kt=new FileReader;kt.onload=()=>{const Rn=kt.result;le(Tr=>[...Tr,{dataUrl:Rn,mediaType:Ve.type,name:Ve.name,size:Ve.size}])},kt.readAsDataURL(Ve)}}function Qn(te){const me=Array.from(te.clipboardData.items).filter(Ce=>Ce.kind==="file"&&(Ce.type.startsWith("image/")||Ce.type==="application/pdf")).map(Ce=>Ce.getAsFile()).filter(Ce=>Ce!==null);me.length>0&&(te.preventDefault(),Ci(me))}const Tt=$.find(te=>te.id===Y),pr=Oe??rht(Pt),vn=Tt?{harness:Tt.harness,model:nt.model??Tt.model,serviceTier:nt.serviceTier!==void 0?nt.serviceTier:Tt.serviceTier,permissionMode:nt.permissionMode??Tt.permissionMode,reasoningLevel:nt.reasoningLevel??Tt.reasoningLevel}:pr?{...pr,...nt}:null,Ge=vn?Pt.find(te=>te.id===vn.harness):void 0,Lt=Ge==null?void 0:Ge.options,Os=T.useMemo(()=>__t(wt,Lt==null?void 0:Lt.planActivation),[wt,Lt==null?void 0:Lt.planActivation]),Cs=fC(V),Es=Cs!==null,es=hv(V,Hn),Is=(es==null?void 0:es.query)??null,ha=Is===null?[]:Os.filter(te=>te.name.startsWith(Is)),mr=!Es&&Is!==null&&(es==null?void 0:es.end)===Hn&&ha.some(te=>te.name!==Is)&&!wn?ha:[],Bs=mr.length>0,qr=Math.min(yn,Math.max(0,mr.length-1));T.useEffect(()=>bn(0),[Is]);const wr=vn&&Ge&&Ge.models.length>0&&!Ge.models.some(te=>te.id===vn.model)?Ge.models[0].id:(vn==null?void 0:vn.model)??null,Ut=vn&&{...vn,model:wr,serviceTier:Cp(Ge,wr,vn.serviceTier),reasoningLevel:Rz(Ge,wr,vn.reasoningLevel)},Ho=cm(Ge,Ut==null?void 0:Ut.model),ei=te=>{if(!Ut)return;const me={...Ut,...te},Ce={};te.model!==void 0&&te.model!==Ut.model&&(Ce.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Ut.serviceTier&&(Ce.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Ut.permissionMode&&(Ce.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Ut.reasoningLevel&&(Ce.reasoningLevel=te.reasoningLevel),pt(je=>({...je,...Ce})),Je(me),D(me).catch(()=>{}),Tt?De(je=>({...je,...te})):te.harness&&te.harness!==Ut.harness&&De({})},cr=T.useCallback(te=>{const me=Ie.current.catch(()=>{}).then(te);return Ie.current=me.then(()=>{},()=>{}),me},[]),$s=te=>{if(te==="plan"&&(Ge==null?void 0:Ge.id)==="claude-code"?(pt(je=>({...je,permissionMode:te})),De(je=>({...je,permissionMode:te}))):(De(je=>{const Ve={...je};return delete Ve.permissionMode,Ve}),ei({permissionMode:te})),!Tt)return;const me=Tt.id,Ce=++qe.current;Ne(null),cr(()=>ZJe(me,te)).then(je=>{P(Ve=>Ve.map(kt=>kt.id===je.id?je:kt)),qe.current===Ce&&De(Ve=>{const kt={...Ve};return delete kt.permissionMode,kt})}).catch(()=>{qe.current===Ce&&(De(je=>{const Ve={...je};return delete Ve.permissionMode,Ve}),Ne(xse()))})},Po=te=>ei({reasoningLevel:te}),qn=(Ut==null?void 0:Ut.harness)==="claude-code"?Ut.permissionMode==="plan":(Lt==null?void 0:Lt.planActivation)==="command"?Ot??(Tt==null?void 0:Tt.planMode)??!1:!1;T.useEffect(()=>{Ot===null||(Tt==null?void 0:Tt.planMode)!==Ot||(Nt.current=null,xt(null))},[Tt==null?void 0:Tt.planMode,Ot]);async function Ei(te){if(pt(je=>({...je,planMode:te})),Nt.current=te,xt(te),!Tt)return;const me=Tt.id,Ce=++Fe.current;Ne(null);try{const je=await cr(()=>XJe(me,te));P(Ve=>Ve.map(kt=>kt.id===je.id?je:kt)),Fe.current===Ce&&(Nt.current=null,xt(null),Ne(null))}catch(je){throw Fe.current===Ce&&(Nt.current=null,xt(null)),je}}async function _a(){if((Ut==null?void 0:Ut.harness)==="claude-code"){$s("auto");return}if(Tt)try{await Ei(!1)}catch{Ne(wY())}}async function ti(){const te=!qn;try{if((Ut==null?void 0:Ut.harness)==="claude-code")$s(te?"plan":"auto");else if((Lt==null?void 0:Lt.planActivation)==="command")await Ei(te);else throw new Error(hb())}catch{Ne(j7())}}function ni(te,me){const Ce=cC(te,me);ae(Ce.text),An(!0),ti(),window.requestAnimationFrame(()=>{var je,Ve;(je=Qe.current)==null||je.focus(),(Ve=Qe.current)==null||Ve.setSelectionRange(Ce.cursor,Ce.cursor),jr(Ce.cursor)})}mt.current=$;const ds=T.useCallback(async()=>{const te=mt.current.map(me=>me.id);try{const me=(await np(e)).filter(je=>!$n.current.has(je.id)),Ce=new Set(me.map(je=>je.id));for(const je of te)Ce.has(je)||Mn(je);return P(je=>{const Ve=new Map(je.map(kt=>[kt.id,kt.contextUsage]));return me.map(kt=>({...kt,contextUsage:kt.contextUsage??Ve.get(kt.id)}))}),Yn.current=new Map(me.map(je=>[je.id,je.title])),et({type:"seedBusy",sessions:me.filter(je=>je.busy).map(je=>je.id),known:me.map(je=>je.id)}),me}catch{return null}},[e]),Ni=T.useCallback(async te=>{const me=G.current.activeId===te?Ct.current:void 0,[{messages:Ce,queued:je,activeLeafId:Ve}]=await Promise.all([Uu(te),ds()]),kt=me!==void 0&&G.current.activeId===te&&Ct.current!==me;et({type:"seed",sessionId:te,messages:Ce,queued:je,activeLeafId:kt?Ct.current:Ve})},[ds,et]);T.useEffect(()=>{P([]),mt.current=[],J(null);const te=fM();L(e===vb?new Set([pz,mz].filter(me=>!te.has(me))):new Set),ae(""),le([]),et({type:"reset"}),sn.current=new Set,Ln(new Map),Yn.current=new Map,ds().then(me=>{me&&J(Ce=>{var je,Ve;return Ce??(e===vb?(je=me.find(kt=>kt.id===Gf))==null?void 0:je.id:void 0)??((Ve=me.find(kt=>!kt.archived))==null?void 0:Ve.id)??null})})},[e,ds]),T.useEffect(()=>{pt({}),lr.current=null},[Y]),T.useEffect(()=>{!Y||sn.current.has(Y)||(sn.current.add(Y),Uu(Y).then(({messages:te,queued:me,activeLeafId:Ce})=>et({type:"seed",sessionId:Y,messages:te,queued:me,activeLeafId:Ce})).catch(()=>{et({type:"seed",sessionId:Y,messages:[],onlyIfAbsent:!0}),sn.current.delete(Y)}))},[Y]),T.useEffect(()=>od(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||$n.current.has(te.session.id))return;const me=Yn.current.has(te.session.id),Ce=Yn.current.get(te.session.id)!==te.session.title;Yn.current.set(te.session.id,te.session.title),me&&Ce&&te.session.titleSource==="generated"&&(Ln(je=>{const Ve=new Map(je);return Ve.set(te.session.id,(je.get(te.session.id)??0)+1),Ve}),window.setTimeout(()=>{Ln(je=>{if(!je.has(te.session.id))return je;const Ve=new Map(je);return Ve.delete(te.session.id),Ve})},H0t)),P(je=>{const Ve=je.findIndex(Rn=>Rn.id===te.session.id);if(Ve<0)return[te.session,...je];const kt=je.slice();return kt[Ve]={...te.session,contextUsage:te.session.contextUsage??je[Ve].contextUsage},kt});break}case"sessionDeleted":Mn(te.sessionId);break;case"message":Cn.current++,et({type:"upsertMessage",sessionId:te.sessionId,message:te.message});break;case"busy":et({type:"busy",sessionId:te.sessionId,busy:te.busy});break;case"queued":et({type:"setQueued",sessionId:te.sessionId,items:te.items});break;case"branch":et({type:"activeLeaf",sessionId:te.sessionId,leafId:te.activeLeafId});break;case"usage":P(me=>me.map(Ce=>Ce.id===te.sessionId?{...Ce,contextUsage:te.usage}:Ce));break}}),[e]),T.useEffect(()=>od(te=>{if(te.type!=="reconnected"||(ds(),!Y||!sn.current.has(Y)))return;const me=Ce=>{const je=Cn.current;Uu(Y).then(({messages:Ve,queued:kt,activeLeafId:Rn})=>{et({type:"seed",sessionId:Y,messages:Ve,queued:kt,activeLeafId:Rn}),Ce&&Cn.current!==je&&me(!1)}).catch(()=>{})};me(!0)}),[Y,ds]);const ri=Y?it.messagesBySession[Y]??gC:gC,Fo=Y?it.activeLeafBySession[Y]??null:null;Ct.current=Fo;const Zr=T.useMemo(()=>_et(ri,Fo),[ri,Fo]),On=Y?it.busySessions.has(Y):!1,pa=!On&&!!(Ge!=null&&Ge.agentReady),Uo=On&&$z(Zr)!=null,Od=On&&get(Zr),fs=Y?it.queuedBySession[Y]??[]:[],gr=fs.some(te=>te.dispatchState==="retrying"),Vl=fs.findIndex(te=>te.dispatchState==="blocked"),ma=fs.reduce((te,me)=>me.dispatchState!=="retrying"||typeof me.nextRetryAt!="number"?te:te===null?me.nextRetryAt:Math.min(te,me.nextRetryAt),null),[ga,Vi]=T.useState(()=>Date.now());T.useEffect(()=>{if(!gr||ma===null||(Vi(Date.now()),ma<=Date.now()))return;const te=window.setInterval(()=>{const me=Date.now();Vi(me),me>=ma&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[gr,ma]),T.useEffect(()=>{const te=fs.reduce((me,Ce)=>Ce.planMode??me,void 0);te!==void 0?(Jt.current=!0,Nt.current=te,xt(te)):Jt.current&&(Jt.current=!1,Nt.current=null,xt(null))},[fs]);const qo=!!Y&&!(Y in it.messagesBySession),Go=T.useMemo(()=>{const te=new Set;for(const me of it.busySessions)(it.messagesBySession[me]??[]).some(Ce=>Ce.parts.some(je=>je.type==="prompt"&&je.prompt&&!je.prompt.resolved&&je.prompt.nativeId))&&te.add(me);return te},[it.busySessions,it.messagesBySession]),Za=Y?Go.has(Y):!1,Zn=Tt,hs=Zn?_r.get(Zn.id):void 0,Ar=T.useMemo(()=>{var te;for(let me=Zr.length-1;me>=0;me--)for(const Ce of Zr[me].parts)if(Ce.type==="prompt"&&((te=Ce.prompt)==null?void 0:te.kind)==="plan"&&!Ce.prompt.resolved)return{promptId:Ce.id,plan:Ce.prompt.plan??"",synthesized:!!Ce.prompt.synthesized};return null},[Zr]),ts=T.useMemo(()=>{const te=Zn==null?void 0:Zn.harness;if(!Y||te!=="claude-code"&&te!=="codex")return null;for(let me=Zr.length-1;me>=0;me--)for(const Ce of Zr[me].parts)if(!(Ce.type!=="prompt"||!Ce.prompt||Ce.prompt.resolved)&&Ce.prompt.kind==="question")return Ce.prompt.nativeId&&!it.busySessions.has(Y)?null:Ce.id;return null},[Zr,Zn==null?void 0:Zn.harness,Y,it.busySessions]),Gr=Es&&!ts,ba=te=>!ts&&!Es&&Os.some(me=>me.name===te),[Ns,Qa]=T.useState(null),va=Ns&&Ns.sessionId===Y?Ns:null;T.useEffect(()=>{if(!Ns)return;const te=it.busySessions.has(Ns.sessionId),me=Ns.sessionId===Y&&Ar&&Ar.promptId!==Ns.promptId;(!te||me)&&Qa(null)},[Ns,Ar,it.busySessions,Y]);const ns=T.useMemo(()=>H4(Zr),[Zr]),Tn=On&&!!(Ge!=null&&Ge.supportsSteering)&&!!(Ge!=null&&Ge.agentReady)&&!Ar&&!ts&&!ns&&ne.length===0&&ce.length===0,ur=T.useMemo(()=>b&&Y?(te,me,Ce)=>b(te,Y,me,Ce):void 0,[b,Y]),Wi=T.useMemo(()=>x&&Y?(te,me,Ce)=>x(Y,te,me,Ce):void 0,[x,Y]),Ki=T.useMemo(()=>m&&((te,me,Ce,je,Ve)=>m(te,Y??void 0,me,Ce,je,Ve)),[m,Y]);T.useEffect(()=>{qe.current+=1,Fe.current+=1;const te=(Y?it.queuedBySession[Y]??[]:[]).reduce((me,Ce)=>Ce.planMode??me,void 0);Jt.current=te!==void 0,Nt.current=te??null,xt(te??null),De({}),Ne(null)},[Y]),T.useEffect(()=>{M==null||M(Y)},[Y,M]);const si=i==="chat"&&(Zr.length>0||On),_s=(Ut==null?void 0:Ut.harness)??null,Vr=(Ut==null?void 0:Ut.model)??null,[Hs,Sr]=T.useState(null),zi=(Hs==null?void 0:Hs.projectId)===e&&(Hs.prompts!==null||Hs.harness===_s),Wl=i==="chat"&&!si&&!qo;T.useEffect(()=>{if(!Wl||!_s||zi)return;let te=!0;return CQe(e,_s,Vr,E()).then(me=>{te&&Sr({projectId:e,harness:_s,prompts:me.prompts})}).catch(()=>{te&&Sr({projectId:e,harness:_s,prompts:null})}),()=>{te=!1}},[e,_s,Vr,zi,Wl]);const Kl=zi&&Hs?Hs.prompts:null,Ja=_s!==null&&!zi,Qc=te=>{ae(te),An(!1),window.requestAnimationFrame(()=>{const me=Qe.current;me&&(me.focus(),me.setSelectionRange(te.length,te.length),jr(te.length))})};T.useEffect(()=>{N&&(ae(N),An(!1),jr(N.length))},[N]);const Ps=T.useCallback(te=>{const me=te.scrollHeight-te.scrollTop-te.clientHeight<60;ot.current=me,Be(me)},[]),ps=T.useCallback(()=>{ot.current=!0,Be(!0);const te=an.current;te&&(te.scrollTop=te.scrollHeight)},[]);T.useLayoutEffect(()=>{ps()},[Y,si,ps]),T.useLayoutEffect(()=>{ot.current&&ps()},[Zr,On,ps]),T.useEffect(()=>{const te=an.current,me=Xe.current;if(!te||!me)return;const Ce=new ResizeObserver(()=>{if(ot.current){te.scrollTop=te.scrollHeight;return}Ps(te)});return Ce.observe(me),Ce.observe(te),()=>Ce.disconnect()},[si,Ps]);const Id=T.useCallback(te=>{te.currentTarget.blur(),ps()},[ps]);async function Jc({queue:te=!1}={}){var u_,d_,f_,bs,Yo;const me=V.trim(),Ce=ts?null:p_t(me,Lt==null?void 0:Lt.planActivation),je=!!Ce,Ve=!qn,kt=uC(Lt==null?void 0:Lt.planActivation,je?Ve:void 0,Nt.current),Rn=je&&(Ge==null?void 0:Ge.id)==="claude-code"?Ve?"plan":"auto":void 0,Tr=Ce?Ce.prompt:me,ji=ne,ii=ce,xa=ii.map(Dn=>({text:Dn.text})),dg=e;let Ql=Y;const Pd=()=>{const Dn=G.current;return Dn.projectId===dg&&Dn.activeId===Ql},Jl=()=>{Pd()&&(ae(Dn=>Dn||me),le(Dn=>Dn.length?Dn:ji),oe(Dn=>Dn.length?Dn:ii))};if(je&&!Tr&&ji.length===0&&ii.length===0){ae(""),An(!1);try{if((Ge==null?void 0:Ge.id)==="claude-code")$s(Ve?"plan":"auto");else if((Lt==null?void 0:Lt.planActivation)==="command")await Ei(Ve);else throw new Error(hb())}catch{Ne(j7()),Jl()}return}const kr=Ut?{...Ut,...Rn?{permissionMode:Rn}:{}}:null;Rn&&$s(Rn);let ec=null;const Fd=Nt.current;je&&(Lt==null?void 0:Lt.planActivation)==="command"&&(ec=++Fe.current,Nt.current=Ve,xt(Ve));const Ko=()=>{ec===null||Fe.current!==ec||(Nt.current=Fd,xt(Fd))};if(!Tr&&ji.length===0&&ii.length===0)return;if((Tr||ii.length>0)&&ts&&ji.length===0){ae(""),oe([]),gs({promptId:ts,answers:[],note:Tr||void 0,annotations:xa}).then(Dn=>{Dn||Jl()});return}const Ud=JSON.stringify({text:Tr,images:ji.map(Dn=>({mediaType:Dn.mediaType,name:Dn.name,dataUrl:Dn.dataUrl})),annotations:xa,settings:kr?{model:kr.model,serviceTier:kr.serviceTier,permissionMode:kr.permissionMode,planMode:kt,reasoningLevel:kr.reasoningLevel}:null}),tc=((u_=lr.current)==null?void 0:u_.signature)===Ud?lr.current.id:`ct_${crypto.randomUUID()}`;if(lr.current={signature:Ud,id:tc},On){if(!Y||!(Ge!=null&&Ge.agentReady)){Ko();return}const Dn=Y;ae(""),le([]),oe([]),ue(null);const ya=kr?{model:kr.model,serviceTier:kr.serviceTier,permissionMode:kr.permissionMode,planMode:(Lt==null?void 0:Lt.planActivation)==="command"?kt??(Tt==null?void 0:Tt.planMode):kt,reasoningLevel:kr.reasoningLevel}:{};De({});const wa=ji.map(Mr=>({mediaType:Mr.mediaType,dataBase64:Mr.dataUrl.slice(Mr.dataUrl.indexOf(",")+1),name:Mr.name}));try{(d_=(await cr(()=>RS(Dn,Tr,ya,wa.length?wa:void 0,xa,tc,Tn&&!te&&!je?"steer":void 0))).turn)!=null&&d_.existing&&await Ni(Dn),pt({}),((f_=lr.current)==null?void 0:f_.id)===tc&&(lr.current=null)}catch{Ko(),Jl()}return}if(!(Ge!=null&&Ge.agentReady)){Ko();return}if(!kr){Ko();return}ae(""),le([]),oe([]),ue(null);let Xi=Y;try{if(!Xi){const js=await Yl(kr,kt);Xi=js.id,Ql=js.id}et({type:"optimisticUser",sessionId:Xi,text:Tr||RK(),attachments:ji.map(js=>({url:js.dataUrl,mediaType:js.mediaType,name:js.name})),annotations:ii}),et({type:"busy",sessionId:Xi,busy:!0}),ps(),B==="archived"&&X("active");const Dn=kr?{model:kr.model,serviceTier:kr.serviceTier,permissionMode:kr.permissionMode,planMode:kt,reasoningLevel:kr.reasoningLevel}:{};De({});const ya=ji.map(js=>({mediaType:js.mediaType,dataBase64:js.dataUrl.slice(js.dataUrl.indexOf(",")+1),name:js.name})),wa=Xi;if(!wa)throw new Error(kre());(bs=(await cr(()=>RS(wa,Tr,Dn,ya.length?ya:void 0,xa,tc))).turn)!=null&&bs.existing&&await Ni(wa),pt({}),((Yo=lr.current)==null?void 0:Yo.id)===tc&&(lr.current=null)}catch(Dn){if(Jl(),Ko(),!Xi)return;const ya=Dn instanceof Error?Dn.message:String(Dn);if(!/session is busy/i.test(ya)&&await np(e).then(Mr=>{var Xo;return!!((Xo=Mr.find(js=>js.id===Xi))!=null&&Xo.busy)}).catch(()=>!1)){Pd()&&(ae(Mr=>Mr===Tr?"":Mr),le(Mr=>Mr===ji?[]:Mr),oe(Mr=>Mr===ii?[]:Mr));return}et({type:"busy",sessionId:Xi,busy:!1}),et({type:"localError",sessionId:Xi,text:FY({error:Ee(ya)})})}}async function Yl(te,me){const Ce=await VJe(e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:me,reasoningLevel:te.reasoningLevel});return sn.current.add(Ce.id),P(je=>[Ce,...je]),J(Ce.id),G.current={projectId:e,activeId:Ce.id},Ce}function ie(){const te=k_t(V);ae(te),window.requestAnimationFrame(()=>{var me,Ce;(me=Qe.current)==null||me.focus(),(Ce=Qe.current)==null||Ce.setSelectionRange(te.length,te.length),jr(te.length)})}async function ve(){const te=Cs;if(!te)return;if(Ne(null),On){Ne(YK());return}const me=V,Ce=G.current,je=()=>{const Rn=G.current;Rn.projectId!==Ce.projectId||Rn.activeId!==Ce.activeId||ae(Tr=>Tr||me)};ae(""),An(!1);let Ve=Y;if(!Ve){if(!(Ge!=null&&Ge.agentReady)||!Ut){je(),Ne(hb());return}try{const Rn=uC(Lt==null?void 0:Lt.planActivation,void 0,Nt.current);Ve=(await Yl(Ut,Rn)).id,De({})}catch(Rn){je();const Tr=Rn instanceof Error?Rn.message:String(Rn);Ne(s7({error:Ee(Tr)}));return}}B==="archived"&&X("active");const kt=`${Rc}shell-${Date.now()}`;et({type:"localShell",sessionId:Ve,id:kt,command:te}),ps();try{const{message:Rn}=await tet(Ve,te);et({type:"upsertMessage",sessionId:Ve,message:Rn})}catch(Rn){const Tr=Rn instanceof Error?Rn.message:String(Rn);et({type:"localShell",sessionId:Ve,id:kt,command:te,error:s7({error:Ee(Tr)})})}}function Se(){Y&&iet(Y).catch(()=>{Ne(Hre())})}const Me=T.useCallback(async(te,me)=>{if(!(!Y||gn.current)){gn.current=!0,Ne(null),nn(te);try{const Ce=Met({model:At.model,serviceTier:At.serviceTier,permissionMode:At.permissionMode,planMode:At.planMode,reasoningLevel:At.reasoningLevel}),je=Y;(await net(je,te,me,Ce)).turn.existing&&await Ni(je),pt({})}catch{Ne(Kne())}finally{gn.current=!1,nn(null)}}},[Y,At,Ni]),$e=T.useCallback((te,me)=>{if(!Y||On||!(Ge!=null&&Ge.agentReady))return;const Ce=Y;et({type:"busy",sessionId:Ce,busy:!0}),ps(),cr(()=>ret(Ce,te,me)).catch(je=>{et({type:"busy",sessionId:Ce,busy:!1});const Ve=je instanceof Error?je.message:String(je);et({type:"localError",sessionId:Ce,text:nre({error:Ee(Ve)})})})},[Y,On,Ge==null?void 0:Ge.agentReady,ps,cr]),_t=T.useCallback(te=>{if(!Y||On)return;const me=Y,Ce=Ct.current;et({type:"activeLeaf",sessionId:me,leafId:te}),cr(()=>set(me,te)).catch(je=>{et({type:"activeLeaf",sessionId:me,leafId:Ce});const Ve=je instanceof Error?je.message:String(je);et({type:"localError",sessionId:me,text:qre({error:Ee(Ve)})})})},[Y,On,cr]);function lt(te){if(!Y)return;const me=Y;QJe(me,te).then(({removed:Ce})=>{if(Ce)return Ni(me)}).catch(()=>Ne(Qne()))}async function Bt(te){if(!Y||xn)return;const me=Y;Ne(null),rn(te);try{await JJe(me,te),await Ni(me)}catch{Ne(ure())}finally{rn(null)}}T.useEffect(()=>{if(!On||i!=="chat")return;function te(me){var Ce;me.key!=="Escape"||me.defaultPrevented||(me.preventDefault(),Se(),(Ce=Qe.current)==null||Ce.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[On,Y,i]);function Mn(te){$n.current.add(te),P(me=>me.filter(Ce=>Ce.id!==te)),J(me=>me===te?null:me),L(me=>{if(!me.has(te))return me;const Ce=new Set(me);return Ce.delete(te),Ce}),sn.current.delete(te),Yn.current.delete(te),et({type:"forget",sessionId:te})}function zs(te,me){const Ce=te.archived;P(je=>je.map(Ve=>Ve.id===te.id?{...Ve,archived:me}:Ve)),yC(B,me)||J(je=>je===te.id?null:je),KJe(te.id,me).catch(()=>{P(je=>je.map(Ve=>Ve.id===te.id?{...Ve,archived:Ce}:Ve))})}function ms(te,me){const Ce=te.title;P(je=>je.map(Ve=>Ve.id===te.id?{...Ve,title:me}:Ve)),YJe(te.id,me).catch(()=>{P(je=>je.map(Ve=>Ve.id===te.id?{...Ve,title:Ce}:Ve))})}async function Fs(te){var Ce;const me=((Ce=te.title)==null?void 0:Ce.trim())||_b();if(window.confirm(_Y({title:Oa(me)}))){try{await WJe(te.id)}catch(je){fr(bY({title:Oa(me),error:Ee(je instanceof Error?je.message:String(je))}),"error");return}Mn(te.id)}}const gs=T.useCallback(te=>{if(!Y)return Promise.resolve(!1);const me=Y;return et({type:"busy",sessionId:me,busy:!0}),cr(()=>aet(me,te)).then(()=>!0).catch(()=>!1).finally(()=>{Uu(me).then(({messages:Ce,queued:je,activeLeafId:Ve})=>et({type:"seed",sessionId:me,messages:Ce,queued:je,activeLeafId:Ve})).catch(()=>{}),np(e).then(Ce=>{var je;return et({type:"busy",sessionId:me,busy:!!((je=Ce.find(Ve=>Ve.id===me))!=null&&je.busy)})}).catch(()=>{})})},[Y,e,cr]),Vo=$.filter(te=>yC(B,te.archived)),Yi=/Mac|iPhone|iPad/.test(navigator.platform),Xl=Yi?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",Zl=Yi?"⌘ Enter":"Ctrl + Enter",Bd=T.useCallback(()=>{X("active"),J(null),l("chat")},[l]),ug=T.useCallback(te=>{X("all"),J(te),l("chat")},[l]);T.useEffect(()=>{const te=me=>{me.repeat||me.key!=="Enter"||!me.metaKey&&!me.ctrlKey||me.altKey||!me.shiftKey||(me.preventDefault(),Bd())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[Bd]);const l_=f.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:py-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,f.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${c?"active":""}`,onClick:y,children:[f.jsx(sh,{size:15}),YQ()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${d?"active":""}`,"data-onboarding":"nav-artifacts",onClick:h,children:[f.jsx(ey,{size:15}),YX()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${o?"active":""}`,onClick:_,children:[f.jsx(Qx,{size:15}),FQ()]}),f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>l("skills"),children:[f.jsx(JN,{size:15}),lQ()]}),c_t.map(te=>f.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>l(te.id),children:[te.icon,te.label()]},te.id))]}),f.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-1.5 ps-4.5",children:[f.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((c_=jM.find(te=>te.id===B))==null?void 0:c_.railLabel())??QE()}),f.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[f.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-sm font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":Xl,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:Bd,children:[f.jsx(ny,{size:13}),Fte()]}),f.jsx(I0t,{value:B,onChange:X})]})]}),f.jsxs("div",{className:"rail-body",children:[Vo.map(te=>f.jsx(P0t,{session:te,active:te.id===Y&&i==="chat",unread:H.has(te.id),busy:it.busySessions.has(te.id),waiting:Go.has(te.id),revealTitle:_r.get(te.id),onOpen:()=>{J(te.id),e===vb&&C_t(te.id),L(me=>{if(!me.has(te.id))return me;const Ce=new Set(me);return Ce.delete(te.id),Ce}),l("chat")},onRename:me=>ms(te,me),onSetArchived:me=>zs(te,me),onDelete:()=>void Fs(te)},te.id)),Vo.length===0&&f.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:B==="archived"?rX():$.length>0?YY():oX()})]}),C.kind==="ssh"?f.jsx(Ff,{runtime:C}):f.jsx("div",{className:"relative shrink-0 border-t border-border",children:f.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[f.jsx(qt,{size:"small","aria-label":vN(),"aria-haspopup":"dialog",onClick:()=>W(!0),children:f.jsx(ex,{size:14,className:"shrink-0"})}),f.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[f.jsx("span",{className:"truncate text-sm leading-tight",children:bN()}),f.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",Ee(C.version)]})]})]})}),F&&f.jsx(F0t,{onClose:()=>W(!1),onConfigureSsh:()=>{W(!1),U(!0)}}),Z&&f.jsx(eM,{onClose:()=>{U(!1),W(!0)}})]}),eu=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${r?"":" rail-hidden"}`,Wo=!r&&f.jsx(qt,{title:C7(),"aria-label":C7(),onClick:s,children:f.jsx(cz,{size:15})});return i!=="chat"?f.jsxs(f.Fragment,{children:[r&&l_,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&f.jsx("div",{className:eu,children:Wo}),f.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:I})]})]}):f.jsxs(f.Fragment,{children:[r&&l_,f.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[f.jsxs("div",{className:eu,children:[Wo,f.jsx(_h,{variant:"header",title:Zn?(($d=Zn.title)==null?void 0:$d.trim())||_b():i7(),children:Zn?f.jsx(AM,{title:((Hd=Zn.title)==null?void 0:Hd.trim())||_b(),animate:hs!==void 0},hs??"static"):i7()}),j&&f.jsx(qt,{"data-tip":a7(),"aria-label":a7(),onClick:j,children:f.jsx(IXe,{size:15})})]}),qo?f.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[f.jsx(Rt,{}),f.jsx("span",{children:yJ()})]}):si?f.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:an,onScroll:te=>{Ps(te.currentTarget),Vt.dismiss()},children:f.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:Xe,children:[f.jsx(O0t,{messages:Zr,allMessages:ri,canFork:pa,onFork:$e,onSelectFork:_t,busy:On,onOpenFile:Ki,onOpenRun:g,onOpenSpawnedSession:ug,runExperimentName:S,onOpenExperiment:k,experimentName:v,onRespond:gs,onOpenPlan:ur,onOpenSubagent:Wi,recoveringTurnId:It,onRecover:Me,skills:Os}),On&&Za&&f.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:one()}),On&&!Za&&!Uo&&!Od&&f.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:f.jsx("span",{className:"tool-running-shimmer",children:Qre()})})]})}):f.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[f.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:f.jsx(cy,{})}),f.jsx("h2",{children:dne()}),f.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[f.jsx(sh,{size:19}),f.jsx("span",{children:n})]}),Ja&&f.jsx("div",{className:SC,role:"status","aria-live":"polite","aria-label":Nte(),"aria-busy":"true",children:wC.map((te,me)=>f.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${yv[me].box}`,children:[f.jsxs("span",{className:`flex w-full items-center gap-2.5 ${yv[me].icon}`,children:[f.jsx(te,{size:17}),f.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),f.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},me))}),Kl&&Kl.length>0&&f.jsx("div",{className:SC,role:"group","aria-label":Tte(),children:Kl.map((te,me)=>{const Ce=wC[me],je=yv[me];return f.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${je.box}`,onClick:()=>Qc(te.prompt),children:[f.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[f.jsx(Ce,{size:17,className:je.icon}),te.title]}),f.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},me)})})]}),Vt.action&&f.jsxs(He,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:Vt.action.x,top:Vt.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:Vt.add,children:[f.jsx(lz,{size:14}),JX()]}),f.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[si&&f.jsx(qt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${en?"opacity-0":"opacity-100"}`,title:z7(),"aria-label":z7(),inert:en,onClick:Id,children:On&&!Za?f.jsx(Zx,{size:18,className:"tool-running-shimmer-icon"}):f.jsx(xXe,{size:16})}),Ar&&!(va&&Ar.promptId===va.promptId)&&f.jsx(Fft,{synthesized:Ar.synthesized,agentLabel:Zn?Pf[Zn.harness]:Kre(),showResumeModes:(Zn==null?void 0:Zn.harness)==="claude-code",onView:te=>ur==null?void 0:ur(Ar.plan,Ar.promptId,te),onApprove:te=>gs({promptId:Ar.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>gs({promptId:Ar.promptId,approve:!1}),onRevise:te=>{Y&&Qa({sessionId:Y,promptId:Ar.promptId}),gs({promptId:Ar.promptId,approve:!1,note:te})}}),fs.length>0&&f.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:fs.map((te,me)=>f.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} - -${te.error}`:te.text,children:[te.dispatchState==="blocked"?f.jsx(_z,{size:13,className:"shrink-0 text-accent-amber"}):f.jsx(UXe,{size:13,className:"shrink-0 text-muted"}),f.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:te.text}),te.dispatchState!=="blocked"&&f.jsx("span",{className:"shrink-0 text-sm text-muted",children:te.dispatchState==="retrying"?Tet(te.nextRetryAt,ga):Ine()}),te.dispatchState==="blocked"?f.jsxs(f.Fragment,{children:[f.jsx("button",{onClick:()=>void Bt(te.id),"aria-label":v$({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:xn===te.id?wN():Ml()}),f.jsx("button",{onClick:()=>lt(te.id),"aria-label":p$({text:te.text}),disabled:xn!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:jee()}),me===Vl&&melt(te.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:f.jsx(Br,{size:11})})]},te.id))}),f.jsxs("div",{className:`composer-box relative flex flex-col border ${Gr?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[Ge&&!Ge.agentReady&&f.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[f.jsxs("strong",{children:[Ge.name," ",nJ()]})," ",Ge.agentNote?Qh(Ge.agentNote):qne()]}),Bs&&f.jsx(f_t,{skills:mr,activeIndex:qr,onPick:us,onHover:bn}),ce.length>0&&f.jsx(K_t,{annotations:ce,onClear:()=>{oe([]),window.requestAnimationFrame(()=>{var te;return(te=Qe.current)==null?void 0:te.focus()})},onRemove:te=>{const me=ce.filter(Ce=>Ce.id!==te);oe(me),me.length===0&&window.requestAnimationFrame(()=>{var Ce;return(Ce=Qe.current)==null?void 0:Ce.focus()})}}),ne.length>0&&f.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:ne.map((te,me)=>{const Ce=()=>le(je=>je.filter((Ve,kt)=>kt!==me));return te.mediaType==="application/pdf"?f.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:te.name,children:[f.jsx(im,{size:22}),f.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:te.name??"document.pdf"}),f.jsx("button",{title:x7(),"aria-label":x7(),onClick:Ce,children:f.jsx(Br,{size:11})})]},me):f.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[f.jsx("img",{src:te.dataUrl,alt:vne()}),f.jsx("button",{title:y7(),"aria-label":y7(),onClick:Ce,children:f.jsx(Br,{size:11})})]},me)})}),_e&&f.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:_e}),ze&&f.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:ze}),f.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${Gr?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[f.jsx("textarea",{dir:"auto",ref:Qe,className:"relative z-1 bg-transparent",value:V,placeholder:ts?cse():Tn&&Ge?Ore({harness:Ee(Pf[Ge.id]),shortcut:Ee(Zl)}):Ut?Ge!=null&&Ge.agentReady?BY({harness:Ee(Pf[Ut.harness])}):DY({harness:Ee(Pf[Ut.harness])}):jK(),rows:2,onPaste:Qn,onDragOver:te=>{te.dataTransfer.types.includes("Files")&&te.preventDefault()},onDrop:te=>{te.dataTransfer.files.length!==0&&(te.preventDefault(),Ci(Array.from(te.dataTransfer.files)))},onChange:te=>{const me=te.target.value,Ce=te.target.selectionStart;jr(Ce);const je=Ce>0&&/\s/.test(me[Ce-1])&&!ts&&!cs.current&&fC(me)===null?hv(me,Ce-1):null;if((je==null?void 0:je.query)==="plan"&&(Lt!=null&&Lt.planActivation)){ni(me,je);return}const Ve=je?Os.find(kt=>kt.source!=="command"&&kt.name===je.query):void 0;if(Ve&&je){const kt=lC(me,je,Ve.name,2);ae(kt.text),window.requestAnimationFrame(()=>{var Rn;(Rn=Qe.current)==null||Rn.setSelectionRange(kt.cursor,kt.cursor),jr(kt.cursor)});return}ae(me),An(!1)},onSelect:te=>jr(te.currentTarget.selectionStart),onCompositionStart:()=>{cs.current=!0},onCompositionEnd:()=>{cs.current=!1},onKeyDown:te=>{if(Bs){if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const me=te.key==="ArrowDown"?1:-1;bn((qr+me+mr.length)%mr.length);return}if(te.key==="Tab"||te.key==="Enter"){te.preventDefault(),us(mr[qr]);return}if(te.key==="Escape"){te.preventDefault(),An(!0);return}}if(te.key==="Backspace"&&yr(te.currentTarget)){te.preventDefault();return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){if(te.preventDefault(),Gr){ve();return}Jc({queue:te.metaKey||te.ctrlKey})}}}),f.jsx(x_t,{text:V,isCommand:ba,skills:Os,projectId:e,textareaRef:Qe})]}),f.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[f.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:pn.ref,children:[f.jsx(qt,{type:"button",className:"composer-bare",title:fb(),"aria-label":fb(),"aria-haspopup":"dialog","aria-expanded":pn.open,onClick:()=>pn.setOpen(te=>!te),children:f.jsx(iQe,{size:16})}),pn.open&&f.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[f.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:fb()}),f.jsx(Ent,{})]})]}),f.jsx("input",{ref:ht,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:te=>{Ci(Array.from(te.target.files??[])),te.target.value=""}}),f.jsx(qt,{type:"button",className:"composer-attach",title:l7(),"aria-label":l7(),onClick:()=>{var te;return(te=ht.current)==null?void 0:te.click()},children:f.jsx(PZe,{size:16})}),qn&&f.jsxs(He,{type:"button",variant:"ghost",active:!0,className:"group",title:p7(),"aria-label":p7(),onClick:()=>void _a(),children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(kZe,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Br,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:OJ()})]}),Gr&&f.jsxs(He,{type:"button",variant:"ghost",active:!0,className:"group",title:_7(),"aria-label":_7(),onClick:ie,children:[f.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[f.jsx(Cd,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),f.jsx(Br,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),f.jsx("span",{children:WE()})]}),f.jsx("div",{className:"min-w-0 flex-1"}),f.jsxs("div",{className:"flex min-w-0 items-center",children:[f.jsx(sht,{value:Ut,onSelect:ei,permissionChoices:Ge!=null&&Ge.agentReady?(Lt==null?void 0:Lt.permissionModes)??[]:[],defaultPermissionId:(Lt==null?void 0:Lt.defaultPermissionMode)??null,onSelectPermission:$s,reasoningChoices:Ge!=null&&Ge.agentReady?Ho.choices:[],defaultReasoningId:Ho.defaultId,onSelectReasoning:Po,onHarnesses:we,lockHarness:!!Tt}),f.jsx(w_t,{usage:Tt==null?void 0:Tt.contextUsage})]}),On&&!ts?f.jsx(qt,{className:"send-btn",variant:"stop",title:E7(),"aria-label":E7(),onClick:Se,children:f.jsx(Br,{size:16})}):f.jsx(qt,{className:"send-btn",variant:"primary",title:Gr?S7():Gv(),"aria-label":Gr?S7():Gv(),onClick:()=>void(Gr?ve():Jc()),disabled:Gr?!Cs||!Y&&!(Ge!=null&&Ge.agentReady):!(Ge!=null&&Ge.agentReady)||!V.trim()&&ne.length===0&&ce.length===0,children:f.jsx(iz,{size:16})})]})]})]})]})]})}function yo({className:e,...n}){return f.jsx("div",{className:ls("relative flex min-h-0 flex-1 flex-col",e),...n})}function Qu({className:e,...n}){return f.jsx("div",{className:ls("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function ta({className:e,...n}){return f.jsx("div",{className:ls("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const kC=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function q0t({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:l,onOpenSubagent:o}){const[c,d]=T.useState(null),_=T.useRef(null),h=T.useRef(null),m=T.useRef(!0);if(T.useLayoutEffect(()=>{m.current=!0;const S=_.current;S&&(S.scrollTop=S.scrollHeight)},[e,n]),T.useLayoutEffect(()=>{const S=_.current;S&&m.current&&(S.scrollTop=S.scrollHeight)},[c]),T.useEffect(()=>{const S=_.current,k=h.current;if(!S||!k)return;const v=new ResizeObserver(()=>{m.current&&(S.scrollTop=S.scrollHeight)});return v.observe(k),v.observe(S),()=>v.disconnect()},[c===null]),T.useEffect(()=>{let S=!0;const k=new Set;let v=0;const b=()=>{const y=++v;Uu(e).then(({messages:C})=>{!S||y!==v||d(j=>{if(!j)return C;const N=C.map(z=>k.has(z.id)?j.find(D=>D.id===z.id)??z:z),M=new Set(C.map(z=>z.id));return[...N,...j.filter(z=>!M.has(z.id))]})}).catch(()=>S&&d(C=>C??[]))};b();const x=od(y=>{if(y.type==="reconnected"){k.clear(),b();return}y.type!=="message"||y.sessionId!==e||(k.add(y.message.id),d(C=>{const j=C?C.slice():[],N=j.findIndex(M=>M.id===y.message.id);return N===-1?j.push(y.message):j[N]=y.message,j}))});return()=>{S=!1,x()}},[e]),c===null)return f.jsx(yo,{children:f.jsx("div",{className:kC,children:f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:kVe()})})});let g=null;for(const S of c)if(g=$4(S.parts,n),g)break;return f.jsx(yo,{children:f.jsx("div",{className:kC,ref:_,onScroll:S=>{const k=S.currentTarget;m.current=k.scrollHeight-k.scrollTop-k.clientHeight<60},children:f.jsx("div",{ref:h,children:g?f.jsx(M0t,{spawn:g,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:l,onOpenSubagent:o}):f.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:zVe()})})})})}function CC(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function zn(e){for(var n=1;n=0||(_[c]=l[c]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function _n(e,n){return MM(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,l,o,c,d=[],_=!0,h=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(d.push(i.value),d.length!==r);_=!0);}catch(m){h=!0,l=m}finally{try{if(!_&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(h)throw l}}return d}})(e,n)||Bm(e,n)||DM()}function TM(e){return MM(e)||RM(e)||Bm(e)||DM()}function bi(e){return(function(n){if(Array.isArray(n))return ox(n)})(e)||RM(e)||Bm(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function MM(e){if(Array.isArray(e))return e}function RM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Bm(e,n){if(e){if(typeof e=="string")return ox(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ox(e,n):void 0}}function ox(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,l=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return l=c.done,c},e:function(c){o=!0,i=c},f:function(){try{l||t.return==null||t.return()}finally{if(o)throw i}}}}var B0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function t_(e,n){return e(n={exports:{}},n.exports),n.exports}var pi=t_((function(e){/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?b.slice(0,y):C;switch(C){case"diff":k--;break e;case"deleted":case"new":var j=b.slice(y+1);j.indexOf("file mode")===0&&(l[C==="new"?"newMode":"oldMode"]=j.slice(10));break;case"similarity":l.similarity=parseInt(b.split(" ")[2],10);break;case"index":var N=b.slice(y+1).split(" "),M=N[0].split("..");l.oldRevision=M[0],l.newRevision=M[1],N[1]&&(l.oldMode=l.newMode=N[1]);break;case"copy":case"rename":var z=b.slice(y+1);z.indexOf("from")===0?l.oldPath=z.slice(5):l.newPath=z.slice(3),x=C;break;case"---":var D=b.slice(y+1),I=g[++k].slice(4);D==="/dev/null"?(I=I.slice(2),x="add"):I==="/dev/null"?(D=D.slice(2),x="delete"):(x="modify",D=D.slice(2),I=I.slice(2)),D&&(l.oldPath=D),I&&(l.newPath=I),m=5;break e}}l.type=x||"modify"}else if(v.indexOf("Binary")===0)l.isBinary=!0,l.type=v.indexOf("/dev/null and")>=0?"add":v.indexOf("and /dev/null")>=0?"delete":"modify",m=2,l=null;else if(m===5)if(v.indexOf("@@")===0){var $=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(v);o={content:v,oldStart:$[1]-0,newStart:$[4]-0,oldLines:$[3]-0||1,newLines:$[6]-0||1,changes:[]},l.hunks.push(o),c=o.oldStart,d=o.newStart}else{var P=v.slice(0,1),F={content:v.slice(1)};switch(P){case"+":F.type="insert",F.isInsert=!0,F.lineNumber=d,d++;break;case"-":F.type="delete",F.isDelete=!0,F.lineNumber=c,c++;break;case" ":F.type="normal",F.isNormal=!0,F.oldLineNumber=c,F.newLineNumber=d,c++,d++;break;case"\\":var W=o.changes[o.changes.length-1];W.isDelete||(l.newEndingNewLine=!1),W.isInsert||(l.oldEndingNewLine=!1)}F.type&&o.changes.push(F)}k++}return h}};e.exports=s})()}));function Gl(e){return e.type==="insert"}function vi(e){return e.type==="delete"}function To(e){return e.type==="normal"}function K0t(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,l,o){var c=_n(i,3),d=c[0],_=c[1],h=c[2];return _?Gl(l)&&h>=0?(d.splice(h+1,0,l),[d,l,h+2]):(d.push(l),[d,l,vi(l)&&vi(_)?h:o]):(d.push(l),[d,l,vi(l)?o:-1])}),[[],null,-1]);return _n(s,1)[0]})(e.changes):e.changes;return zn(zn({},e),{},{isPlain:!1,changes:t})}function lx(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` -`),i=r.indexOf(` -`,s+1),l=r.slice(0,s),o=r.slice(s+1,i),c=l.split(" ").slice(1,-3).join(" "),d=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(d),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(d),r.slice(i+1)].join(` -`)})(e.trimStart());return W0t.parse(t).map((function(r){return(function(s,i){var l=s.hunks.map((function(o){return K0t(o,i)}));return zn(zn({},s),{},{hunks:l})})(r,n)}))}function Y0t(e){return e[0]}function X0t(e){return e[e.length-1]}function cx(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function mh(e){return e==="old"?function(n){return Gl(n)?-1:To(n)?n.oldLineNumber:n.lineNumber}:function(n){return vi(n)?-1:To(n)?n.newLineNumber:n.lineNumber}}function OM(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},spt=function(e,n){var t=this.__data__,r=$m(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Bu(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var d=i.get(e),_=i.get(n);if(d&&_)return d==n&&_==e;var h=-1,m=!0,g=2&t?new Ppt:void 0;for(i.set(e,n),i.set(n,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},tr={};tr["[object Float32Array]"]=tr["[object Float64Array]"]=tr["[object Int8Array]"]=tr["[object Int16Array]"]=tr["[object Int32Array]"]=tr["[object Uint8Array]"]=tr["[object Uint8ClampedArray]"]=tr["[object Uint16Array]"]=tr["[object Uint32Array]"]=!0,tr["[object Arguments]"]=tr["[object Array]"]=tr["[object ArrayBuffer]"]=tr["[object Boolean]"]=tr["[object DataView]"]=tr["[object Date]"]=tr["[object Error]"]=tr["[object Function]"]=tr["[object Map]"]=tr["[object Number]"]=tr["[object Object]"]=tr["[object RegExp]"]=tr["[object Set]"]=tr["[object String]"]=tr["[object WeakMap]"]=!1;var rmt=function(e){return md(e)&&U4(e.length)&&!!tr[Ld(e)]},smt=function(e){return function(n){return e(n)}},RC=t_((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&$M.process,i=(function(){try{var l=r&&r.require&&r.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),DC=RC&&RC.isTypedArray,q4=DC?smt(DC):rmt,imt=Object.prototype.hasOwnProperty,amt=function(e,n){var t=yi(e),r=!t&&Um(e),s=!t&&!r&&qp(e),i=!t&&!r&&!s&&q4(e),l=t||r||s||i,o=l?Qpt(e.length,String):[],c=o.length;for(var d in e)!imt.call(e,d)||l&&(d=="length"||s&&(d=="offset"||d=="parent")||i&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||GM(d,c))||o.push(d);return o},omt=Object.prototype,VM=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||omt)},lmt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),cmt=Object.prototype.hasOwnProperty,WM=function(e){if(!VM(e))return lmt(e);var n=[];for(var t in Object(e))cmt.call(e,t)&&t!="constructor"&&n.push(t);return n},qm=function(e){return e!=null&&U4(e.length)&&!PM(e)},G4=function(e){return qm(e)?amt(e):WM(e)},LC=function(e){return Wpt(e,G4,Zpt)},umt=Object.prototype.hasOwnProperty,dmt=function(e,n,t,r,s,i){var l=1&t,o=LC(e),c=o.length;if(c!=LC(n).length&&!l)return!1;for(var d=c;d--;){var _=o[d];if(!(l?_ in n:umt.call(n,_)))return!1}var h=i.get(e),m=i.get(n);if(h&&m)return h==n&&m==e;var g=!0;i.set(e,n),i.set(n,e);for(var S=l;++d1)return!1;if(e.length===1){var n=_n(e,1)[0];return n.type==="text"&&!n.value}return!0}function Jmt(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=$l(e,Zmt),l=s?function(o,c){return s(o,HC,c)}:HC;return f.jsx("td",zn(zn({},i),{},{"data-change-key":n,children:r?Qmt(r)?" ":r.map(l):t||" "}))}var tR=T.memo(Jmt);function nR(e,n){return function(){var t=n==="old"?Ym(e):Xm(e);return t===-1?void 0:t}}function rR(e,n){return function(t){return e&&t?f.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function Gp(e,n){return n?function(t){e(),n(t)}:e}function PC(e,n,t,r){return T.useMemo((function(){var s=eR(e,(function(i){return function(l){return i&&i(n,l)}}));return s.onMouseEnter=Gp(t,s.onMouseEnter),s.onMouseLeave=Gp(r,s.onMouseLeave),s}),[e,t,r,n])}function FC(e,n,t,r,s,i,l,o,c){var d={change:n,side:r,inHoverState:o,renderDefault:nR(n,r),wrapInAnchor:rR(s,i)};return f.jsx("td",zn(zn({className:e},l),{},{"data-change-key":t,children:c(d)}))}function egt(e){var n,t,r,s=e.change,i=e.selected,l=e.tokens,o=e.className,c=e.generateLineClassName,d=e.gutterClassName,_=e.codeClassName,h=e.gutterEvents,m=e.codeEvents,g=e.hideGutter,S=e.gutterAnchor,k=e.generateAnchorID,v=e.renderToken,b=e.renderGutter,x=s.type,y=s.content,C=Tl(s),j=(n=_n(T.useState(!1),2),t=n[0],r=n[1],[t,T.useCallback((function(){return r(!0)}),[]),T.useCallback((function(){return r(!1)}),[])]),N=_n(j,3),M=N[0],z=N[1],D=N[2],I=T.useMemo((function(){return{change:s}}),[s]),$=PC(h,I,z,D),P=PC(m,I,z,D),F=k(s),W=c({changes:[s],defaultGenerate:function(){return o}}),Z=pi("diff-gutter","diff-gutter-".concat(x),d,{"diff-gutter-selected":i}),U=pi("diff-code","diff-code-".concat(x),_,{"diff-code-selected":i});return f.jsxs("tr",{id:F,className:pi("diff-line",W),children:[!g&&FC(Z,s,C,"old",S,F,$,M,b),!g&&FC(Z,s,C,"new",S,F,$,M,b),f.jsx(tR,zn({className:U,changeKey:C,text:y,tokens:l,renderToken:v},P))]})}var tgt=T.memo(egt);function ngt(e){var n=e.hideGutter,t=e.element;return f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var rgt=["hideGutter","selectedChanges","tokens","lineClassName"],sgt=["hunk","widgets","className"];function igt(e){var n=e.hunk,t=e.widgets,r=e.className,s=$l(e,sgt),i=(function(l,o){return l.reduce((function(c,d){var _=Tl(d);c.push(["change",_,d]);var h=o[_];return h&&c.push(["widget",_,h]),c}),[])})(n.changes,t);return f.jsx("tbody",{className:pi("diff-hunk",r),children:i.map((function(l){return(function(o,c){var d=_n(o,3),_=d[0],h=d[1],m=d[2],g=c.hideGutter,S=c.selectedChanges,k=c.tokens,v=c.lineClassName,b=$l(c,rgt);if(_==="change"){var x=vi(m)?"old":"new",y=vi(m)?Ym(m):Xm(m),C=k?k[x][y-1]:null;return f.jsx(tgt,zn({className:v,change:m,hideGutter:g,selected:S.includes(h),tokens:C},b),"change".concat(h))}return _==="widget"?f.jsx(ngt,{hideGutter:g,element:m},"widget".concat(h)):null})(l,s)}))})}var sR=0;function H0(e,n,t,r){var s=T.useCallback((function(){return n(e)}),[e,n]),i=T.useCallback((function(){return n("")}),[n]);return T.useMemo((function(){var l=eR(r,(function(o){return function(c){return o&&o({side:e,change:t},c)}}));return l.onMouseEnter=Gp(s,l.onMouseEnter),l.onMouseLeave=Gp(i,l.onMouseLeave),l}),[t,r,s,e,i])}function kv(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,l=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,d=e.anchorID,_=e.gutterAnchor,h=e.gutterAnchorTarget,m=e.hideGutter,g=e.hover,S=e.renderToken,k=e.renderGutter;if(!n){var v=pi("diff-gutter","diff-gutter-omit",i),b=pi("diff-code","diff-code-omit",l);return[!m&&f.jsx("td",{className:v},"gutter"),f.jsx("td",{className:b},"code")]}var x=n.type,y=n.content,C=Tl(n),j=t===sR?"old":"new",N=zn({id:d||void 0,className:pi("diff-gutter","diff-gutter-".concat(x),ax({"diff-gutter-selected":r},"diff-line-hover-"+j,g),i),children:k({change:n,side:j,inHoverState:g,renderDefault:nR(n,j),wrapInAnchor:rR(_,h)})},o),M=pi("diff-code","diff-code-".concat(x),ax({"diff-code-selected":r},"diff-line-hover-"+j,g),l);return[!m&&f.jsx("td",zn(zn({},N),{},{"data-change-key":C}),"gutter"),f.jsx(tR,zn({className:M,changeKey:C,text:y,tokens:s,renderToken:S},c),"code")]}function agt(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,l=e.oldTokens,o=e.newTokens,c=e.monotonous,d=e.gutterClassName,_=e.codeClassName,h=e.gutterEvents,m=e.codeEvents,g=e.hideGutter,S=e.generateAnchorID,k=e.generateLineClassName,v=e.gutterAnchor,b=e.renderToken,x=e.renderGutter,y=_n(T.useState(""),2),C=y[0],j=y[1],N=H0("old",j,t,h),M=H0("new",j,r,h),z=H0("old",j,t,m),D=H0("new",j,r,m),I=t&&S(t),$=r&&S(r),P=k({changes:[t,r],defaultGenerate:function(){return n}}),F={monotonous:c,hideGutter:g,gutterClassName:d,codeClassName:_,gutterEvents:h,codeEvents:m,renderToken:b,renderGutter:x},W=zn(zn({},F),{},{change:t,side:sR,selected:s,tokens:l,gutterEvents:N,codeEvents:z,anchorID:I,gutterAnchor:v,gutterAnchorTarget:I,hover:C==="old"}),Z=zn(zn({},F),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:M,codeEvents:D,anchorID:t===r?null:$,gutterAnchor:v,gutterAnchorTarget:t===r?I:$,hover:C==="new"});if(c)return f.jsx("tr",{className:pi("diff-line",P),children:kv(t?W:Z)});var U=(function(Y,J){return Y&&!J?"diff-line-old-only":!Y&&J?"diff-line-new-only":Y===J?"diff-line-normal":"diff-line-compare"})(t,r);return f.jsxs("tr",{className:pi("diff-line",U,P),children:[kv(W),kv(Z)]})}var ogt=T.memo(agt);function lgt(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?f.jsx("tr",{className:"diff-widget",children:f.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):f.jsxs("tr",{className:"diff-widget",children:[f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),f.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var cgt=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],ugt=["hunk","widgets","className"];function P0(e,n){return(e?Tl(e):"00")+(n?Tl(n):"00")}function dgt(e){var n=e.hunk,t=e.widgets,r=e.className,s=$l(e,ugt),i=(function(l,o){for(var c=function(b){if(!b)return null;var x=Tl(b);return o[x]||null},d=[],_=0;_=(i==null?void 0:i.value.length))return[e];var o=function(h,m){var g=i.value.slice(h,m);return[].concat(bi(s),[zn(zn({},i),{},{value:g})])};if(n>0){var c=o(0,n);l.push(Gu(c))}var d=o(Math.max(n,0),t);if(l.push(r?(function(h,m){return[m].concat(bi(Gu(h)))})(d,r):Gu(d)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=$l(e,Tgt);t.push(s);var i,l=P4(r);try{for(l.s();!(i=l.n()).done;)lR(i.value,n,t)}catch(o){l.e(o)}finally{l.f()}t.pop()}else n.push(Gu([].concat(bi(t.slice(1)),[e])));return n}function Mgt(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(c){var d=X4(c);return d.value.includes(` -`)?d.value.split(` -`).map((function(_){return zgt(c,zn(zn({},d),{},{value:_}))})):[c]})(t),i=TM(s),l=i[0],o=i.slice(1);return[].concat(bi(n.slice(0,-1)),[[].concat(bi(r),[l])],bi(o.map((function(c){return[c]}))))}),[[]])}function VC(e){return Mgt(lR(e))}var Rgt=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?Gm(e,n,void 0,t):!!r},Dgt=function(e,n){return Gm(e,n)},Lgt=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function Ogt(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=Lgt(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&Rgt(t,r,(function(i,l,o){return o==="chlidren"||Dgt(i,l)}))))?e.children[e.children.length-1]=(function(i,l){return"value"in i&&"value"in l?zn(zn({},i),{},{value:"".concat(i.value).concat(l.value)}):i})(s,n):e.children.push(n),e.children[e.children.length-1]}function WC(e){var n,t={type:"root",children:[]},r=P4(e);try{var s=function(){var i=n.value;i.reduce((function(l,o,c){return Ogt(l,c===i.length-1?zn({},o):zn(zn({},o),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(i){r.e(i)}finally{r.f()}return t}var Igt=Object.prototype.hasOwnProperty,Bgt=aR((function(e,n,t){Igt.call(e,t)?e[t].push(n):K4(e,t,[n])})),$gt=Object.prototype.hasOwnProperty,Hgt=function(e){if(e==null)return!0;if(qm(e)&&(yi(e)||typeof e=="string"||typeof e.splice=="function"||qp(e)||q4(e)||Um(e)))return!e.length;var n=_x(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(VM(e))return!WM(e).length;for(var t in e)if($gt.call(e,t))return!1;return!0},Pgt=function(e,n){var t=n.start,r=n.length,s=t+r,i=e.reduce((function(l,o){var c=_n(l,2),d=c[0],_=c[1],h=_+X4(o).value.length;if(_>s||hr.length?t:r,c=t.length>r.length?r:t,d=o.indexOf(c);if(d!=-1)return l=[new n.Diff(1,o.substring(0,d)),new n.Diff(0,c),new n.Diff(1,o.substring(d+c.length))],t.length>r.length&&(l[0][0]=l[2][0]=-1),l;if(c.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var h=_[0],m=_[1],g=_[2],S=_[3],k=_[4],v=this.diff_main(h,g,s,i),b=this.diff_main(m,S,s,i);return v.concat([new n.Diff(0,k)],b)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var l=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,l),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var c=0,d=0,_=0,h="",m="";c=1&&_>=1){o.splice(c-d-_,d+_),c=c-d-_;for(var g=this.diff_main(h,m,!1,s),S=g.length-1;S>=0;S--)o.splice(c,0,g[S]);c+=g.length}_=0,d=0,h="",m=""}c++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,l=r.length,o=Math.ceil((i+l)/2),c=o,d=2*o,_=new Array(d),h=new Array(d),m=0;ms);y++){for(var C=-y+k;C<=y-v;C+=2){for(var j=c+C,N=($=C==-y||C!=y&&_[j-1]<_[j+1]?_[j+1]:_[j-1]+1)-C;$i)v+=2;else if(N>l)k+=2;else if(S&&(D=c+g-C)>=0&&D=(z=i-h[D]))return this.diff_bisectSplit_(t,r,$,N,s)}for(var M=-y+b;M<=y-x;M+=2){for(var z,D=c+M,I=(z=M==-y||M!=y&&h[D-1]i)x+=2;else if(I>l)b+=2;else if(!S&&(j=c+g-M)>=0&&j=(z=i-z))return this.diff_bisectSplit_(t,r,$,N,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,l){var o=t.substring(0,s),c=r.substring(0,i),d=t.substring(s),_=r.substring(i),h=this.diff_main(o,c,!1,l),m=this.diff_main(d,_,!1,l);return h.concat(m)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function l(d){for(var _="",h=0,m=-1,g=s.length;mi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=k.length?[x,y,C,j,z]:null}var c,d,_,h,m,g=o(s,i,Math.ceil(s.length/4)),S=o(s,i,Math.ceil(s.length/2));return g||S?(c=S?g&&g[4].length>S[4].length?g:S:g,t.length>r.length?(d=c[0],_=c[1],h=c[2],m=c[3]):(h=c[0],m=c[1],d=c[2],_=c[3]),[d,_,h,m,c[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,l=null,o=0,c=0,d=0,_=0,h=0;o0?s[i-1]:-1,c=0,d=0,_=0,h=0,l=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=k?(S>=m.length/2||S>=g.length/2)&&(t.splice(o,0,new n.Diff(0,g.substring(0,S))),t[o-1][1]=m.substring(0,m.length-S),t[o+1][1]=g.substring(S),o++):(k>=m.length/2||k>=g.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,k))),t[o-1][0]=1,t[o-1][1]=g.substring(0,g.length-k),t[o+1][0]=-1,t[o+1][1]=m.substring(k),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(k,v){if(!k||!v)return 6;var b=k.charAt(k.length-1),x=v.charAt(0),y=b.match(n.nonAlphaNumericRegex_),C=x.match(n.nonAlphaNumericRegex_),j=y&&b.match(n.whitespaceRegex_),N=C&&x.match(n.whitespaceRegex_),M=j&&b.match(n.linebreakRegex_),z=N&&x.match(n.linebreakRegex_),D=M&&k.match(n.blanklineEndRegex_),I=z&&v.match(n.blanklineStartRegex_);return D||I?5:M||z?4:y&&!j&&N?3:j||N?2:y||C?1:0}for(var s=1;s=g&&(g=S,_=i,h=l,m=o)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=h,m?t[s+1][1]=m:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,l=null,o=0,c=!1,d=!1,_=!1,h=!1;o0?s[i-1]:-1,_=h=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,l=0,o="",c="";s1?(i!==0&&l!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(s-i-l>0&&t[s-i-l-1][0]==0?t[s-i-l-1][1]+=c.substring(0,r):(t.splice(0,0,new n.Diff(0,c.substring(0,r))),s++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(t[s][1]=c.substring(c.length-r)+t[s][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),s-=i+l,t.splice(s,i+l),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),c.length&&(t.splice(s,0,new n.Diff(1,c)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,l=0,i=0,o="",c=""}t[t.length-1][1]===""&&t.pop();var d=!1;for(s=1;sr));s++)o=i,c=l;return t.length!=s&&t[s][0]===-1?c:c+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,c=0;c");switch(d){case 1:r[c]=''+_+"";break;case-1:r[c]=''+_+"";break;case 0:r[c]=""+_+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),l=this;function o(N,M){var z=N/r.length,D=Math.abs(s-M);return l.Match_Distance?z+D/l.Match_Distance:D?1:z}var c=this.Match_Threshold,d=t.indexOf(r,s);d!=-1&&(c=Math.min(o(0,d),c),(d=t.lastIndexOf(r,s+r.length))!=-1&&(c=Math.min(o(0,d),c)));var _,h,m=1<=v;y--){var C=i[t.charAt(y-1)];if(x[y]=k===0?(x[y+1]<<1|1)&C:(x[y+1]<<1|1)&C|(g[y+1]|g[y])<<1|1|g[y+1],x[y]&m){var j=o(k,y-1);if(j<=c){if(c=j,!((d=y-1)>s))break;v=Math.max(1,2*s-d)}}}if(o(k+1,s)>c)break;g=x}return d},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(l),this.diff_cleanupEfficiency(l));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)l=t,i=this.diff_text1(l);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,l=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,l=s}if(l.length===0)return[];for(var o=[],c=new n.patch_obj,d=0,_=0,h=0,m=i,g=i,S=0;S=2*this.Patch_Margin&&d&&(this.patch_addContext_(c,m),o.push(c),c=new n.patch_obj,d=0,m=g,_=h)}k!==1&&(_+=v.length),k!==-1&&(h+=v.length)}return d&&(this.patch_addContext_(c,m),o.push(c)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(c=this.match_main(r,h.substring(0,this.Match_MaxBits),_))!=-1&&((m=this.match_main(r,h.substring(h.length-this.Match_MaxBits),_+h.length-this.Match_MaxBits))==-1||c>=m)&&(c=-1):c=this.match_main(r,h,_),c==-1)l[o]=!1,i-=t[o].length2-t[o].length1;else if(l[o]=!0,i=c-_,h==(d=m==-1?r.substring(c,c+h.length):r.substring(c,m+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(t[o].diffs)+r.substring(c+h.length);else{var g=this.diff_main(h,d,!1);if(h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)l[o]=!1;else{this.diff_cleanupSemanticLossless(g);for(var S,k=0,v=0;vo[0][1].length){var c=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],l.start1-=c,l.start2-=c,l.length1+=c,l.length2+=c}return(o=(l=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),l.length1+=r,l.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,c),l.length1+=c,l.length2+=c),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(d.length1+=m.length,l+=m.length,_=!1,d.diffs.push(new n.Diff(h,m)),i.diffs.shift()):(m=m.substring(0,r-d.length1-this.Patch_Margin),d.length1+=m.length,l+=m.length,h===0?(d.length2+=m.length,o+=m.length):_=!1,d.diffs.push(new n.Diff(h,m)),m==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(m.length))}c=(c=this.diff_text2(d.diffs)).substring(c.length-this.Patch_Margin);var g=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);g!==""&&(d.length1+=g.length,d.length2+=g.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===0?d.diffs[d.diffs.length-1][1]+=g:d.diffs.push(new n.Diff(0,g))),_||t.splice(++s,0,d)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?Wgt:Kgt,r=Y4(e.map((function(o){return o.changes})),cR).map(t).reduce((function(o,c){var d=_n(o,2),_=d[0],h=d[1],m=_n(c,2),g=m[0],S=m[1];return[_.concat(g),h.concat(S)]}),[[],[]]),s=_n(r,2),i=s[0],l=s[1];return Fgt(YC(i),YC(l))}var Xgt=["enhancers"],JC=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=_n(Ngt(e,$l(t,Xgt)),2),l=i[0],o=i[1],c=[VC(l),VC(o)],d=(n=[c[0],c[1]],s.reduce((function(k,v){return v(k)}),n)),_=_n(d,2),h=_[0],m=_[1],g=[h.map(WC),m.map(WC)],S=g[1];return{old:g[0].map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]})),new:S.map((function(k){var v;return(v=k.children)!==null&&v!==void 0?v:[]}))}};const mx=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--color-diff-selection)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--color-diff-gutter-selection)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--color-diff-insert-gutter)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--color-diff-delete-gutter)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--color-diff-insert-code)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--color-diff-delete-code)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--color-diff-insert-edit)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--color-diff-delete-edit)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--color-diff-omit-gutter)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:start-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),Zgt=2e3,Qgt={highlight(e,n){return vt.highlight(e,n).children}};function Jgt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function Z4(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function e1t(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function gx(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function t1t(e){const n=[Ygt(e.hunks,{type:"line"})],t=e4(e1t(e));return t&&vt.registered(t)?JC(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:Qgt}):JC(e.hunks,{enhancers:n,highlight:!1})}function n1t(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:lx(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:lx(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const r1t=({change:e,side:n})=>n==="old"?null:Jgt(e);function dR({bytesRead:e,byteLimit:n}){return f.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[f.jsx("h4",{children:__e()}),f.jsx("p",{children:V_e({limit:Ee(ko(n)),read:Ee(ko(e))})})]})}function fR({file:e,defaultExpanded:n}){const[t,r]=T.useState(n),{additions:s,deletions:i}=T.useMemo(()=>Z4(e),[e]),l=t&&s+i<=Zgt,o=T.useMemo(()=>{if(l)try{return t1t(e)}catch{return}},[e,l]);return f.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[f.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(c=>!c),children:[f.jsx("span",{className:"chev",children:t?f.jsx(Ua,{size:14}):f.jsx(qa,{size:14})}),f.jsx("span",{className:"path",children:f.jsx("code",{children:gx(e)})}),f.jsxs("span",{className:"stats",children:[f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:A_e()}):f.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:f.jsx(ggt,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:r1t,tokens:o,viewType:"unified"})}))]})}function s1t({files:e,className:n}){return f.jsx("div",{className:n?`${mx} ${n}`:mx,children:e.map((t,r)=>f.jsx(fR,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function i1t(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function hR({diff:e,partial:n=!1}){var m;const t=T.useMemo(()=>n1t(e,n),[e,n]),r=t.files,s=T.useMemo(()=>r.map((g,S)=>({file:g,key:`${g.oldPath}→${g.newPath}#${S}`,changes:Z4(g)})),[r]),[i,l]=T.useState(null),[o,c]=T.useState(!1),d=o&&!n,_=s.some(g=>g.key===i)?i:((m=s[0])==null?void 0:m.key)??null,h=s.find(g=>g.key===_)??null;return t.failed?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?E_e():F_e()}):s.length===0?f.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:w_e()}):f.jsxs("div",{className:"diff-explorer @container",children:[f.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[f.jsx("strong",{children:n?s.length===1?B_e():b_e({count:Gt(s.length)}):s.length===1?D_e():a_e({count:Gt(s.length)})}),!n&&f.jsx("button",{type:"button",onClick:()=>c(g=>!g),children:d?n_e():X_e()})]}),d?f.jsx(s1t,{files:r}):f.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[f.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":u_e(),children:s.map(g=>f.jsxs("button",{type:"button",className:g.key===_?"active":"","aria-pressed":g.key===_,onClick:()=>l(g.key),children:[f.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${g.file.type}`,children:i1t(g.file)}),f.jsx("code",{title:gx(g.file),children:gx(g.file)}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",g.changes.additions]}),f.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",g.changes.deletions]})]},g.key))}),f.jsx("div",{className:`${mx} diff-explorer-preview min-w-0`,children:h&&f.jsx(fR,{file:h.file,defaultExpanded:!0},h.key)})]})]})}function a1t({experiment:e,refreshKey:n,onLoadingChange:t}){const[r,s]=T.useState(null),[i,l]=T.useState(null);return T.useEffect(()=>{let o=!1;return t(!0),l(null),s(null),TQe(e.id).then(c=>{o||s(c)}).catch(c=>{o||l(c.message)}).finally(()=>{o||t(!1)}),()=>{o=!0}},[e.id,n,t]),f.jsx(Qu,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:i?f.jsxs(ta,{children:[QW()," ",Ee(i)]}):r?r.diff.trim()?f.jsxs(f.Fragment,{children:[r.truncated&&f.jsx(dR,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),f.jsx(hR,{diff:r.diff,partial:r.truncated})]}):f.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?aK():KW()}):f.jsx(ta,{children:nK()})})}function _R({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:l,refreshing:o,onRefresh:c}){return f.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":Lse(),children:[f.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:$se()}),f.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:Tse()})]}),r&&f.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[f.jsx(om,{size:12}),f.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&f.jsx(um,{href:i,target:"_blank",rel:"noopener noreferrer",title:l,"aria-label":l,children:f.jsx(Rm,{size:13})}),f.jsx("span",{className:"flex-1"}),f.jsx(qt,{title:A7(),"aria-label":A7(),onClick:c,children:o?f.jsx(Rt,{}):f.jsx(VZe,{size:13})})]})}const o1t=/\.(md|mdx|markdown)$/i,l1t=/\.tex$/i,c1t=/\.html?$/i,u1t=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,d1t=/\.(csv|tsv|xlsx?|ods)$/i,f1t=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,h1t=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,_1t=/\.pdf$/i,p1t=/\.(docx?|log|rtf|txt)$/i;function m1t(e){return u1t.test(e)}function Q4(e){return o1t.test(e)}function pR(e){return l1t.test(e)}function g1t(e){return c1t.test(e)}function gd({name:e}){const n=Q4(e)?"markdown":m1t(e)?"image":d1t.test(e)?"spreadsheet":f1t.test(e)?"code":h1t.test(e)?"archive":_1t.test(e)?"pdf":p1t.test(e)||pR(e)?"document":"file";let t;return n==="markdown"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),f.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),f.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=f.jsxs(f.Fragment,{children:[f.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=f.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),f.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=f.jsxs(f.Fragment,{children:[f.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),f.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),f.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),f.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function mR(e,n){const t=navigator.clipboard;if(!t){fr(Eue(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>fr(nh(),"success")).catch(r=>fr(r instanceof Error?r.message:String(r),"error"))}function gR({name:e,onCommit:n,onCancel:t}){const[r,s]=T.useState(e),i=T.useRef(!1),l=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return f.jsx(ws,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":Vue({path:Ee(e)}),onFocus:o=>{const c=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,c>0?c:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:l,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function bR(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function vR({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:l}){const o=T.useRef(null),c=T.useRef(l);c.current=l;const[d,_]=T.useState({x:e.x,y:e.y});T.useLayoutEffect(()=>{var k;const g=o.current;if(!g)return;const S=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-g.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-g.offsetHeight-8))}),(k=g.querySelector("button"))==null||k.focus(),()=>{g.contains(document.activeElement)&&(S==null||S.focus())}},[e]),T.useEffect(()=>{const g=()=>c.current(),S=v=>{var b;(b=o.current)!=null&&b.contains(v.target instanceof Node?v.target:null)||c.current()},k=v=>{if(v.key==="Tab"){v.preventDefault(),c.current();return}v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),c.current())};return document.addEventListener("pointerdown",S),window.addEventListener("blur",g),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),document.addEventListener("keydown",k,!0),()=>{document.removeEventListener("pointerdown",S),window.removeEventListener("blur",g),window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0),document.removeEventListener("keydown",k,!0)}},[]);const h=g=>{c.current(),g()},m=(g,S,k=!1)=>f.jsx(Nr,{size:"compact",role:"menuitem",danger:k,onClick:()=>h(S),children:f.jsx("span",{children:g})});return Ro.createPortal(f.jsxs("div",{ref:o,role:"menu","aria-label":Bue({path:Ee(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:d.x,top:d.y},onContextMenu:g=>g.preventDefault(),onKeyDown:g=>{var b,x;if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const S=[...((b=o.current)==null?void 0:b.querySelectorAll("button"))??[]],k=S.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:S[0]),v=g.key==="ArrowDown"?1:-1;(x=S[(k+v+S.length)%S.length])==null||x.focus()},children:[m(Fue(),n),t&&m(YE(),t),r&&m(Due(),r),m(VE(),s),i&&m(KE(),i,!0)]}),document.body)}const bx=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),e9=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function t9(){return{dirs:new Map,files:[]}}function xR(e){const n=t9();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[m?f.jsx(Ua,{size:13,className:e9}):f.jsx(qa,{size:13,className:e9}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),m&&f.jsx(J4,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:l,renamingPath:o,onContextMenu:c,onRename:d,onCancelRename:_})]})}function J4({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:l,onContextMenu:o,onRename:c,onCancelRename:d}){const _=[...e.dirs.keys()].sort((m,g)=>m.localeCompare(g)),h=[...e.files].sort((m,g)=>m.localeCompare(g));return f.jsxs(f.Fragment,{children:[_.map(m=>{const g=n?`${n}/${m}`:m;return f.jsx(b1t,{name:m,node:e.dirs.get(m),path:g,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:l,onContextMenu:o,onRename:c,onCancelRename:d},`d:${g}`)}),h.map(m=>{const g=n?`${n}/${m}`:m;if(l===g&&c&&d)return f.jsxs("div",{className:bx,style:{paddingInlineStart:8+t*14},children:[f.jsx(gd,{name:m}),f.jsx(gR,{name:m,onCommit:k=>c(g,k),onCancel:d})]},`f:${g}`);const S=zr(k=>i(g,k));return f.jsxs("button",{type:"button",className:bx,style:{paddingInlineStart:8+t*14},...S,onContextMenu:k=>{o&&(k.preventDefault(),o(k,g))},onKeyDown:k=>{if(o&&(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10")){k.preventDefault(),o(k,g);return}S.onKeyDown(k)},title:SB({name:Ee(g)}),children:[f.jsx(gd,{name:m}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:m})]},`f:${g}`)})]})}function v1t({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:l,onOpenFile:o}){const c=t.branchName,d=`${e}:${c}`,[_,h]=T.useState(null),[m,g]=T.useState(null),[S,k]=T.useState(!1),[v,b]=T.useState(!1),[x,y]=T.useState(0),[C,j]=T.useState(void 0),N=T.useRef(0),M=T.useRef(null),z=T.useCallback(()=>{M.current=d;const P=++N.current;k(!0),t2(e,{ref:c}).then(F=>{P===N.current&&(h(F),g(null))}).catch(F=>{P===N.current&&g(F.message)}).finally(()=>{P===N.current&&k(!1)})},[e,c,d]);T.useEffect(()=>(N.current++,M.current=null,h(null),g(null),k(!1),()=>{N.current++}),[d]),T.useEffect(()=>{r==="files"&&M.current!==d&&z()},[r,d,z]),T.useEffect(()=>{j(void 0);const P=t.chatSessionId;if(!P)return;let F=!1;return wz(P).then(W=>{!F&&W.exists&&W.branch===c&&j(P)}).catch(()=>{}),()=>{F=!0}},[t.chatSessionId,c]);const D=T.useMemo(()=>_?xR(_.entries):null,[_]),I=r==="files"?S:v,$=T.useCallback(P=>{const F=new Set(s);F.has(P)?F.delete(P):F.add(P),l(F)},[s,l]);return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[f.jsx(_R,{view:r,onViewChange:i,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?lm(n.githubOwner,n.githubRepo,c):void 0,githubTitle:qE({branch:Ee(c)}),refreshing:I,onRefresh:()=>r==="files"?z():y(P=>P+1)}),r==="changes"?f.jsx(a1t,{experiment:t,refreshKey:x,onLoadingChange:b},t.id):f.jsxs(f.Fragment,{children:[(_==null?void 0:_.truncated)&&f.jsx(ta,{children:Vse()}),m&&D&&f.jsxs(ta,{children:[eie()," ",Ee(m)]}),f.jsx(Qu,{children:D?D.dirs.size===0&&D.files.length===0?f.jsx(ta,{children:Xse()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(J4,{node:D,parentPath:"",depth:0,toggled:s,onToggle:$,onOpenFile:(P,F)=>C?o(P,C,void 0,F):o(P,void 0,c,F)})}):f.jsx(ta,{children:m?JE({error:Ee(m)}):eN()})})]})]})}function x1t({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:l,canRenameFile:o}){var J;const c=n.id,[d,_]=T.useState(null),[h,m]=T.useState(null),[g,S]=T.useState(null),[k,v]=T.useState(!0),[b,x]=T.useState(null),[y,C]=T.useState(null),j=T.useRef(0),N=T.useCallback(()=>{const H=++j.current;v(!0),(async()=>{if(!e)return[null,await t2(c,{ref:n.baselineBranch})];const B=await wz(e),X=B.exists?{sessionId:e}:{ref:n.baselineBranch};return[B,await t2(c,X)]})().then(([B,X])=>{H===j.current&&(_(B),m(X),S(null))}).catch(B=>{H===j.current&&S(B.message)}).finally(()=>{H===j.current&&v(!1)})},[e,c,n.baselineBranch]);T.useEffect(()=>(_(null),m(null),S(null),N(),()=>{j.current++}),[N]),xet(c,e,N);const M=T.useMemo(()=>h?xR(h.entries):null,[h]),z=T.useCallback(H=>{const L=new Set(r);L.has(H)?L.delete(H):L.add(H),i(L)},[r,i]),D=e&&(d!=null&&d.exists)?d:null,I=(D==null?void 0:D.branch)??(D!=null&&D.baselineBranch?GYe({branch:Ee(D.baselineBranch)}):CN()),$=((J=D==null?void 0:D.files)==null?void 0:J.length)??0,P=D?IYe({branch:Ee(`${I}${$>0?"*":""}`)}):PYe({branch:Ee(n.baselineBranch)}),F=D?D.branch:n.baselineBranch,W=(H,L)=>D?l(H,e,void 0,L):l(H,void 0,n.baselineBranch,L),Z=(h==null?void 0:h.root)==="worktree",U=async(H,L)=>{try{await LQe(c,H,L,{sessionId:e}),N()}catch(B){fr(B instanceof Error?B.message:String(B),"error")}},Y=H=>{const L=(h==null?void 0:h.path)??n.repoPath;mR(L,H)};return f.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[f.jsx(_R,{view:D?t:"files",onViewChange:s,showViewToggle:!!D,branchLabel:P,branchTitle:P,githubHref:n.githubEnabled&&F?lm(n.githubOwner,n.githubRepo,F):void 0,githubTitle:F?qE({branch:Ee(F)}):void 0,refreshing:k,onRefresh:N}),g&&(d||h)&&f.jsxs(ta,{children:[dXe()," ",Ee(g)]}),!h||e&&!d?f.jsx(Qu,{children:f.jsx(ta,{children:g?JE({error:Ee(g)}):eN()})}):D&&t==="changes"?f.jsx(Qu,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:$===0||!D.diff?f.jsx("div",{className:"changes-note text-sm text-muted",children:rXe()}):f.jsxs(f.Fragment,{children:[D.diff.truncated&&f.jsx(dR,{bytesRead:D.diff.bytesRead,byteLimit:D.diff.byteLimit}),f.jsx(hR,{diff:D.diff.diff,partial:D.diff.truncated})]})}):f.jsxs(Qu,{children:[h.truncated&&f.jsx(ta,{children:YYe()}),M?M.dirs.size===0&&M.files.length===0?f.jsx(ta,{children:oXe()}):f.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:f.jsx(J4,{node:M,parentPath:"",depth:0,toggled:r,onToggle:z,onOpenFile:W,renamingPath:y,onContextMenu:(H,L)=>{x(bR(H,L))},onRename:(H,L)=>{C(null),U(H,{action:"rename",newName:L})},onCancelRename:()=>C(null)})}):f.jsx(ta,{children:JYe()})]}),b&&f.jsx(vR,{target:b,onOpen:()=>W(b.path,"keepOpen"),onRename:Z&&o(b.path)?()=>C(b.path):void 0,onDuplicate:Z?()=>void U(b.path,{action:"duplicate"}):void 0,onCopyPath:()=>Y(b.path),onDelete:Z?()=>{window.confirm(Aue({path:Ee(b.path)}))&&U(b.path,{action:"delete"})}:void 0,onClose:()=>x(null)})]})}function yR({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=T.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` -`),h=LT(_,e4(n));return _.endsWith(` -`)?h.slice(0,-1):h},[e,n]),l=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=T.useRef(null);T.useEffect(()=>{var _;r!==void 0&&(l?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,l]);const{ruleCh:c}=QT(i.length),d=T.useMemo(()=>i.map((_,h)=>f.jsxs("div",{ref:h+1===l?o:void 0,className:`file-view-line flex items-stretch ${h+1===l?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[f.jsx("span",{"data-line":h+1,className:`${ZT} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),f.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${Pp} ${XT}`,children:OT(_)?f.jsx("br",{}):_})]},h)),[i,c,l]);return f.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${Pp}`,children:[i.length>0&&f.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),d]})}function wR(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function n9({url:e,name:n}){return f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[Vpe()," ",f.jsxs("a",{href:e,download:n,children:[lN()," ",Ee(n)]})]})}function vx({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=T.useState(!1);if(T.useEffect(()=>i(!1),[e,n]),s)return f.jsx(n9,{url:n,name:t});let l;return e==="image"?l=f.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:f.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?l=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?l=f.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:f.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):l=f.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:f.jsx(n9,{url:n,name:t})}),f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[l,r&&f.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:f.jsxs("a",{href:n,download:t,children:[lN()," ",t]})})]})}function SR(e,n=!0){const[t,r]=T.useState(null);return T.useEffect(()=>{if(!n)return;const s=new AbortController;let i=!1;const l=async()=>{if(!(i||document.visibilityState==="hidden")){i=!0;try{const d=await fetch(e,{method:"HEAD",cache:"no-store",signal:s.signal});if(s.signal.aborted)return;d.status===404?r("missing"):d.ok&&r(d.headers.get("etag")??d.headers.get("content-length"))}catch{}finally{i=!1}}};l();const o=window.setInterval(()=>void l(),2e3);window.addEventListener("focus",l),document.addEventListener("visibilitychange",l);const c=od(d=>{d.type==="reconnected"&&l()});return()=>{s.abort(),window.clearInterval(o),window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",l),c()}},[e,n]),t}const r9="tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]";function y1t(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function w1t(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),l=s.indexOf("?"),o=l===-1?s:s.slice(0,l),c=l===-1?"":s.slice(l+1),d=o.startsWith("/")?[]:n.split("/").filter(g=>g.length>0);for(const g of o.split("/"))if(!(!g||g==="."))if(g===".."){if(d.length===0)return null;d.pop()}else d.push(g);const _=d.join("/");if(!_)return null;const h=new URLSearchParams(c);h.delete("path");const m=h.toString();return{path:_,url:`${id(e,_)}${m?`&${m}`:""}${i}`}}function S1t(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` ----`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const kR="orx:files-tree-width",CR="orx:artifacts-collapsed:",ER=180,NR=320,k1t=8,C1t=280;function E1t(){try{const e=Number(localStorage.getItem(kR));if(Number.isFinite(e)&&e>=ER&&e<=NR)return e}catch{}return C1t}function N1t(e){try{const n=localStorage.getItem(`${CR}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function xh(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=xh(t.children??[],n);if(r)return r}}return null}function zR({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(y1t(i))return i;const l=w1t(e,n,i);if(!l)return null;const o=xh(r,l.path);if(!o)return l.url;const c=l.url.indexOf("#"),d=c===-1?l.url:l.url.slice(0,c),_=c===-1?"":l.url.slice(c);return`${d}&v=${o.modifiedAt}:${o.size}${_}`};return f.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:f.jsx(cot,{remarkPlugins:[NT,[zT,$T]],rehypePlugins:[nT],components:{a:({href:i,children:l,...o})=>{const c=!i||i.startsWith("#"),d=c?i:s(i);return d?f.jsx("a",{...o,href:d,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:l}):f.jsx("span",{children:l})},img:({src:i,alt:l})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?f.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[f.jsx("img",{src:o,alt:l??"",loading:"lazy"}),l&&f.jsx("span",{className:"artifact-img-caption",children:l})]}):null},...HT},children:IT(S1t(t))})})}function z1t(e){return e.presentation==="text"&&Q4(e.name)?"markdown":wR(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function j1t(e,n,t,r){const[s,i]=T.useState(null),[l,o]=T.useState(!1),[c,d]=T.useState(!1),[_,h]=T.useState(null),m=T.useRef(0),g=T.useRef(!1),S=t==="markdown"||t==="text"&&n.size<=jz;return T.useEffect(()=>{if(o(!1),d(!1),h(null),!S)return;let k=!1;const v=++m.current;return Az(e,n.path).then(x=>{if(!x)throw new Error(IV());return x}).then(x=>{k||v!==m.current||(x.binary?o(!0):(g.current=!0,i(x.content)),d(x.truncated))}).catch(x=>{!k&&v===m.current&&!g.current&&h(x instanceof Error?x.message:String(x))}),()=>{k=!0}},[e,n.path,n.modifiedAt,n.size,t,S,r]),{text:s,binary:l,truncated:c,error:_,wantsText:S}}function A1t({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=z1t(n),i=SR(id(e,n.path)),{text:l,binary:o,truncated:c,error:d,wantsText:_}=j1t(e,n,s,i),[h,m]=T.useState(!1),g=s==="markdown",S=n.path.split("/").slice(0,-1).join("/"),k=`${id(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let v;return s==="image"||s==="audio"||s==="video"||s==="pdf"?v=f.jsx(vx,{kind:s,url:k,name:n.name}):s==="download"||!_||o?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?AV():qW()," ",f.jsx("a",{href:k,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?sN():PV()})]}):d?v=f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[aW()," ",Ee(d)]}):l===null?v=f.jsxs(Pr,{children:[f.jsx(Rt,{})," ",bW()]}):g&&!h?v=f.jsx(zR,{projectId:e,folder:S,markdown:l,entries:r}):v=f.jsx(yR,{text:l,path:n.path}),f.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[f.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[f.jsx(gd,{name:n.name}),f.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ee(n.path),children:n.name}),f.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[EW()," ",new Date(n.modifiedAt).toLocaleString(E(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&f.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:ko(n.size)}),g&&f.jsx(qt,{size:"small",active:h,"data-tip":h?wp():Fu(),"data-tip-align":"end","aria-label":h?wp():Fu(),onClick:()=>m(b=>!b),children:f.jsx(Zv,{size:13})}),f.jsx(um,{size:"small",href:k,target:"_blank",rel:"noopener noreferrer","data-tip":t7(),"data-tip-align":"end","aria-label":t7(),children:f.jsx(Ic,{size:13})}),f.jsx(qt,{size:"small","data-tip":e7(),"data-tip-align":"end","aria-label":e7(),onClick:()=>{window.confirm(Px({path:Ee(n.path)}))&&t(n.path)},children:f.jsx(Ed,{size:13})})]}),f.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${g&&!h?"doc":""}`,children:[v,c&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:uW()})]})]})}function jR({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:l,onDelete:o,renamingPath:c,onContextMenu:d,onRename:_,onCancelRename:h}){return f.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(m=>{var S;const g={paddingInlineStart:8+Math.min(n,k1t)*14};if(m.isDir){const k=!t.has(m.path);return f.jsxs("div",{className:"min-w-0 max-w-full",children:[f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:g,onClick:()=>s(m.path),children:[f.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":k?pV({name:Ee(m.name)}):EV({name:Ee(m.name)}),onClick:v=>{v.stopPropagation(),s(m.path)},children:f.jsx(qa,{size:13,className:k?"open":""})}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:m.name}),f.jsx(qt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":nW(),"data-tip-align":"end","aria-label":wV({name:Ee(m.name)}),onClick:v=>{v.stopPropagation(),window.confirm(Px({path:Ee(m.path)}))&&o(m.path)},children:f.jsx(Ed,{size:12})})]}),k&&(((S=m.children)==null?void 0:S.length)??0)>0&&f.jsx(jR,{entries:m.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:l,onDelete:o,renamingPath:c,onContextMenu:d,onRename:_,onCancelRename:h})]},m.path)}return c===m.path?f.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:g,children:[f.jsx(gd,{name:m.name}),f.jsx(gR,{name:m.name,onCommit:k=>_(m.path,k),onCancel:h})]},m.path):f.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===m.path?"selected":""}`,style:g,title:kI({path:Ee(m.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===m.path,onClick:()=>i(m.path),onDoubleClick:()=>l(m.path),onContextMenu:k=>{k.preventDefault(),i(m.path),d(k,m.path)},onAuxClick:k=>{k.button===1&&(k.preventDefault(),i(m.path),l(m.path))},onKeyDown:k=>{if(k.key==="ContextMenu"||k.shiftKey&&k.key==="F10"){k.preventDefault(),i(m.path),d(k,m.path);return}if(k.key===" "){k.preventDefault(),k.stopPropagation(),i(m.path);return}k.key==="Enter"&&(k.preventDefault(),k.stopPropagation(),i(m.path),l(m.path))},children:[f.jsx(gd,{name:m.name}),f.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:m.name})]},m.path)})})}function T1t({dir:e,onOpenStorage:n}){const[t,r]=T.useState(!1);return f.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:Ee(e),children:[f.jsx("code",{className:"path-front-ellipsis",children:e}),f.jsx(qt,{size:"small",className:r9,"data-tip":t?nh():VE(),"aria-label":YV(),onClick:()=>{var s;(s=navigator.clipboard)==null||s.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:t?f.jsx(mi,{size:12}):f.jsx(sm,{size:12})}),n&&f.jsx(qt,{size:"small",className:r9,"data-tip":n7(),"data-tip-align":"end","aria-label":n7(),onClick:n,children:f.jsx(ZZe,{size:12})})]})}function M1t({project:e,artifacts:n,onChanged:t,onOpenFile:r,canRenameFile:s,onOpenStorage:i}){const[l,o]=T.useState(null),[c,d]=T.useState(()=>N1t(e.id)),[_,h]=T.useState(E1t),[m,g]=T.useState(null),[S,k]=T.useState(null),v=T.useRef(null);T.useEffect(()=>{try{localStorage.setItem(`${CR}${e.id}`,JSON.stringify([...c]))}catch{}},[e.id,c]);const b=z=>{var F;z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId);const D=(F=v.current)==null?void 0:F.getBoundingClientRect(),I=document.body.style.userSelect;document.body.style.userSelect="none";const $=W=>{const Z=Math.round(W.clientX-((D==null?void 0:D.left)??0)),U=Math.min(Math.max(Z,ER),NR);h(U);try{localStorage.setItem(kR,String(U))}catch{}},P=()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",P),window.removeEventListener("pointercancel",P),document.body.style.userSelect=I};window.addEventListener("pointermove",$),window.addEventListener("pointerup",P),window.addEventListener("pointercancel",P)};T.useEffect(()=>{if(!l||!n)return;const z=xh(n.entries,l);(!z||z.isDir)&&o(null)},[l,n]);const x=z=>d(D=>{const I=new Set(D);return I.has(z)?I.delete(z):I.add(z),I}),y=z=>{(l===z||l!=null&&l.startsWith(z+"/"))&&o(null),kJe(e.id,z).catch(()=>{}).finally(t)},C=async(z,D)=>{try{await CJe(e.id,z,D),D.action==="rename"&&l===z&&o(null),t()}catch(I){fr(I instanceof Error?I.message:String(I),"error")}},j=z=>{n&&mR(n.dir,z)};if(!n)return f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs(Pr,{className:"p-5",children:[f.jsx(Rt,{})," ",wW()]})});const N=z=>f.jsx(jR,{entries:z,depth:0,collapsed:c,selected:l,onToggle:x,onSelect:o,onOpenFile:r,onDelete:y,renamingPath:S,onContextMenu:(D,I)=>{g(bR(D,I))},onRename:(D,I)=>{k(null),C(D,{action:"rename",newName:I})},onCancelRename:()=>k(null)}),M=l?xh(n.entries,l):null;return n.entries.length===0?f.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:f.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-sm [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[f.jsx(ey,{size:28,strokeWidth:1.5}),f.jsx("h3",{children:AW()}),f.jsx("p",{children:HW()}),f.jsx(T1t,{dir:n.dir,onOpenStorage:i})]})}):f.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[f.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:v,style:{width:_},children:[f.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:b}),f.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[N(n.entries),n.truncated&&f.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:_W()})]})]}),M?f.jsx(A1t,{projectId:e.id,entry:M,onDelete:y,artifactEntries:n.entries},M.path):f.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[f.jsx(OZe,{size:22,strokeWidth:1.5}),f.jsx("span",{children:GV()})]}),m&&f.jsx(vR,{target:m,onOpen:()=>r(m.path),onRename:s(m.path)?()=>k(m.path):void 0,onDuplicate:()=>void C(m.path,{action:"duplicate"}),onCopyPath:()=>j(m.path),onDelete:()=>{window.confirm(Px({path:Ee(m.path)}))&&y(m.path)},onClose:()=>g(null)})]})}const AR=20*1024*1024,TR="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",MR="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",RR="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",R1t="font-mono text-base font-medium text-text",D1t="mt-1 mb-0 text-sm leading-relaxed text-text";function DR(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function L1t(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function LR({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=T.useState(!1),l=T.useRef(null);return f.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var d;if(o.preventDefault(),i(!1),n)return;const c=(d=o.dataTransfer.files)==null?void 0:d[0];c&&r(c)},onClick:()=>{var o;n||(o=l.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=l.current)==null||c.click())},children:[f.jsx("input",{ref:l,type:"file",accept:e,hidden:!0,onChange:o=>{var d;const c=(d=o.target.files)==null?void 0:d[0];c&&r(c),o.target.value=""}}),n?f.jsxs(f.Fragment,{children:[f.jsx(Rt,{}),f.jsx("span",{children:cqe()})]}):f.jsxs(f.Fragment,{children:[f.jsx(cQe,{size:20,strokeWidth:1.5}),f.jsx("span",{children:t})]})]})}function OR({bytes:e,updatedAt:n}){return f.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[ko(e),n>0&&f.jsxs("span",{className:"text-muted",children:[" · ",Ba(n)]})]})}function O1t({skill:e,onDeleted:n,onError:t}){const[r,s]=T.useState(!1);return f.jsxs("div",{className:RR,children:[f.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[f.jsxs("code",{className:R1t,children:["/",e.name]}),e.origin&&f.jsx(Mt,{children:e.origin})]}),f.jsx(OR,{bytes:e.bytes,updatedAt:e.updatedAt}),!e.origin&&f.jsx(qt,{"data-tip":TUe(),"data-tip-align":"end","aria-label":DFe({name:Ee(e.name)}),disabled:r,onClick:()=>{window.confirm(AFe({name:Ee(e.name)}))&&(s(!0),GJe(e.name).then(n).catch(i=>{s(!1),t(i instanceof Error?i.message:String(i))}))},children:f.jsx(Ed,{size:13})})]})}function I1t({template:e,onChanged:n,onError:t}){const[r,s]=T.useState(!1),i=e.supportFiles.length;return f.jsxs("div",{className:RR,children:[f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("span",{className:"text-base font-medium text-text",children:e.name}),f.jsxs("p",{className:D1t,children:[e.entry,i>0&&(i===1?oUe():pUe({count:Gt(i)}))]})]}),f.jsx(OR,{bytes:e.bytes,updatedAt:e.updatedAt}),f.jsx(qt,{"data-tip":LUe(),"data-tip-align":"end","aria-label":FFe({name:Ee(e.name)}),disabled:r,onClick:()=>{window.confirm(BFe({name:Ee(e.name)}))&&(s(!0),FJe(e.name).then(n).catch(l=>{s(!1),t(l instanceof Error?l.message:String(l))}))},children:f.jsx(Ed,{size:13})})]})}function B1t(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(!1),[l,o]=T.useState(null),[c,d]=T.useState(null),_=T.useCallback(()=>{i(!0),UJe().then(g=>{n(g),d(null)}).catch(g=>{n([]),d(g instanceof Error?g.message:String(g))}).finally(()=>i(!1))},[]);T.useEffect(()=>{_()},[_]);const h=T.useRef(!1),m=T.useCallback(async g=>{if(!h.current){if(o(null),!L1t(g.name)){o(gqe());return}if(g.size>AR){o(GN());return}h.current=!0,r(!0);try{await qJe({filename:g.name,contentBase64:await DR(g)}),_()}catch(S){o(S instanceof Error?S.message:String(S))}finally{h.current=!1,r(!1)}}},[_]);return f.jsxs("section",{className:TR,children:[f.jsxs("div",{className:"flex items-baseline gap-2.5",children:[f.jsx("h3",{children:iqe()}),f.jsxs(He,{className:"ms-auto",size:"small",onClick:_,disabled:s,children:[f.jsx(ua,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Fh()]})]}),f.jsx("p",{className:MR,children:VFe()}),f.jsx(LR,{accept:".md,.markdown,.zip",busy:t,prompt:XFe(),onFile:g=>void m(g)}),l&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:l}),e===null?f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(Rt,{})," ",UUe()]}):c?f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[vUe()," ",c]}):e.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:ZUe()}):f.jsx("div",{className:"flex flex-col mt-1",children:e.map(g=>f.jsx(O1t,{skill:g,onDeleted:_,onError:o},g.name))})]})}function $1t(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null),[l,o]=T.useState(null),c=T.useCallback(()=>{HJe().then(h=>{n(h),o(null)}).catch(h=>{n([]),o(h instanceof Error?h.message:String(h))})},[]);T.useEffect(()=>{c()},[c]);const d=T.useRef(!1),_=T.useCallback(async h=>{if(d.current)return;i(null);const m=h.name.toLowerCase();if(!m.endsWith(".tex")&&!m.endsWith(".zip")){i(yqe());return}if(h.size>AR){i(GN());return}d.current=!0,r(!0);try{await PJe({filename:h.name,contentBase64:await DR(h)}),c()}catch(g){i(g instanceof Error?g.message:String(g))}finally{d.current=!1,r(!1)}},[c]);return f.jsxs("section",{className:TR,children:[f.jsx("h3",{children:$Ue()}),f.jsx("p",{className:MR,children:hqe()}),f.jsx(LR,{accept:".tex,.zip",busy:t,prompt:eUe(),onFile:h=>void _(h)}),s&&f.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:s}),e===null?f.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[f.jsx(Rt,{})," ",WUe()]}):l?f.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[SUe()," ",l]}):e.length===0?f.jsx("div",{className:"pt-3 text-sm text-subtext",children:tqe()}):f.jsx("div",{className:"flex flex-col mt-1",children:e.map(h=>f.jsx(I1t,{template:h,onChanged:c,onError:i},h.name))})]})}function H1t(){return f.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[f.jsx("h1",{children:NUe()}),f.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:dUe()}),f.jsx(B1t,{}),f.jsx($1t,{})]})}const P1t="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Cl({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:l,onClose:o}){return f.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?P1t:""}`,onClick:i,onDoubleClick:l,title:s?OVe({label:n}):n,"aria-label":s?MVe({label:n}):n,children:[t,f.jsx("span",{className:"tab-label","data-label":n,children:f.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),f.jsx("span",{role:"button",className:"tab-close",title:Nse(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:f.jsx(Br,{size:12})})]})}const s9=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function F1t({owner:e,repo:n,branch:t}){return!e||!n?f.jsx("span",{className:s9,children:f.jsx("code",{children:t})}):f.jsxs("a",{className:s9,href:lm(e,n,t),target:"_blank",rel:"noopener noreferrer",title:xp({name:Ee(t)}),children:[f.jsx("code",{children:t}),f.jsx(Rm,{size:12})]})}const Cv=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),i9=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function a9(e){return new Date(e).toLocaleString(E(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function o9(e,n){return Np((e.endedAt??n)-e.createdAt)}function U1t({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const l=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[c,d]=T.useState(()=>Date.now());return T.useEffect(()=>{if(!o)return;d(Date.now());const _=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),f.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:f.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[f.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[f.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[f.jsx("h1",{children:e.title||e.slug}),f.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),f.jsx(zo,{status:l?Fi(l):"idle"})]}),f.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[l&&f.jsxs(He,{...zr(_=>s(l.id,_)),children:[f.jsx(sd,{size:15}),fce()]}),f.jsxs(He,{...zr(i),children:[f.jsx(am,{size:15}),Ble()]})]}),e.description&&f.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[f.jsx("h2",{children:Xle()}),f.jsx($a,{text:e.description})]}),f.jsxs("section",{className:Cv,children:[f.jsx("h2",{children:l?Dle():zce()}),l&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[f.jsx(zo,{status:Fi(l)}),f.jsx(A4,{backend:l.backend}),f.jsxs("span",{title:kce(),children:[f.jsx(zXe,{size:13}),a9(l.createdAt)]}),f.jsxs("span",{title:ece(),children:[f.jsx(PXe,{size:13}),o9(l,c)]}),l.commitSha&&f.jsxs("span",{title:Fle(),children:[f.jsx(pZe,{size:14}),f.jsx("code",{children:l.commitSha.slice(0,7)})]}),l.exitCode!==null&&l.exitCode!==void 0&&l.exitCode!==0&&f.jsxs("span",{children:[sce()," ",l.exitCode]})]}),l.command&&f.jsxs("code",{className:i9,children:["$ ",l.command]}),l.resultMarkdown&&f.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${l.status==="failed"?"failed":""}`,children:f.jsx($a,{text:l.resultMarkdown})})]})]}),f.jsxs("section",{className:Cv,children:[f.jsx("h2",{children:"Git"}),f.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[f.jsx(F1t,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&f.jsxs("span",{children:[lce()," ",f.jsx("code",{children:n.slug})]}),f.jsxs("span",{title:a9(e.createdAt),children:[Vle()," ",Ba(e.createdAt)]})]}),e.runCommand!==(l==null?void 0:l.command)&&f.jsxs("code",{className:i9,children:["$ ",e.runCommand]})]}),r.length>0&&f.jsxs("section",{className:Cv,children:[f.jsx("h2",{children:xce()}),f.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,h)=>f.jsxs("button",{...zr(m=>s(_.id,m)),children:[f.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[mce()," ",r.length-h]}),f.jsx(zo,{status:Fi(_)}),f.jsx("span",{children:Ba(_.createdAt)}),f.jsx("span",{children:o9(_,c)}),f.jsx(sd,{size:13})]},_.id))})]})]})})}function l9(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=T4(t,!0);let i=!1,l=0,o=!1,c=!1;async function d(){if(o){c=!0;return}o=!0;try{for(;;){const h=await jQe(e,l);if(i)return;if(h.dataBase64&&r.write(l9(h.dataBase64)),l=h.nextOffset,h.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,d())}}const _=bet(e,h=>{if(i)return;const m=l9(h.dataBase64);!o&&h.offset===l?(r.write(m),l+=m.length):h.offset+m.length>l&&d()});return d(),()=>{i=!0,_(),s()}},[e]),f.jsx("div",{ref:n,className:"h-full w-full"})}function G1t({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:l,onOpenView:o,onOpenCode:c}){const d=r.filter(_=>_.experimentId===e.id).sort((_,h)=>h.createdAt-_.createdAt);return t==="overview"?f.jsx(U1t,{experiment:e,parentExperiment:l,project:n,runs:d,onOpenLogs:(_,h)=>o("terminal",_,h),onOpenCode:_=>c("files",_)}):f.jsx(V1t,{experiment:e,expRuns:d,selectedRunId:s,onSelectRun:i})}function V1t({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=T.useState(null),[l,o]=T.useState(null),[c,d]=T.useState(!1),_=T.useRef(null),h=t&&n.find(b=>b.id===t)||n[0]||null,m=(h==null?void 0:h.status)==="running"||(h==null?void 0:h.status)==="starting",g=!!(h&&m&&(h.cancelRequested||l===h.id)),S=b=>{const x=n.findIndex(y=>y.id===b);return x===-1?n.length:n.length-x},k=T.useRef(null);T.useEffect(()=>{if(k.current===null){k.current=new Set(n.map(x=>x.id));return}const b=n.find(x=>!k.current.has(x.id));for(const x of n)k.current.add(x.id);b&&r(b.id)},[n,r]),T.useEffect(()=>{if(!c)return;const b=x=>{var y;(y=_.current)!=null&&y.contains(x.target)||d(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c]);async function v(){if(h){i(null),o(h.id);try{await xz(h.id)}catch(b){o(null),i(b instanceof Error?b.message:String(b))}}}return f.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[f.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[f.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),f.jsx("span",{className:"flex-1"}),s&&f.jsx("span",{className:"error",role:"alert",children:s}),m&&f.jsxs(He,{size:"small",variant:"ghost",disabled:g,onClick:()=>void v(),children:[f.jsx(rz,{size:13}),g?sie():nN()]}),n.length>0&&h&&f.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[f.jsxs(He,{title:Qoe(),"aria-expanded":c,onClick:()=>d(b=>!b),children:[f.jsxs("span",{children:[T7()," ",S(h.id)]}),f.jsx(zo,{status:g?"cancelling":Fi(h)}),f.jsx(Ua,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&f.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(b=>f.jsxs(Nr,{className:"justify-start",active:b.id===(h==null?void 0:h.id),onClick:()=>{r(b.id),d(!1)},children:[f.jsxs("span",{className:"font-medium",children:[T7()," ",S(b.id)]}),f.jsx(zo,{status:Fi(b)}),f.jsx("span",{className:"ms-auto text-xs text-muted",children:Ba(b.createdAt)})]},b.id))})]})]}),f.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:h?f.jsx(q1t,{runId:h.id},h.id):f.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:Goe()})})]})}let xx=!1;function W1t(e){xx=!0;try{return window.confirm(e)}finally{xx=!1}}const yx=e=>e.replace(/\r\n/g,` -`),c9=(e,n,t)=>{const r=yx(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r -`),conflict:null}},xo=e=>e.draft!==e.baseline,K1t=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),Y1t=e=>e.crlf?e.draft.replace(/\n/g,`\r -`):e.draft;function X1t(e,n,t){return!xo(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}function Z1t({projectId:e,filePath:n,sessionId:t,enabled:r,ready:s,source:i}){const[l,o]=T.useState(void 0),[c,d]=T.useState(null),[_,h]=T.useState(null),[m,g]=T.useState(!1),[S,k]=T.useState(null),[v,b]=T.useState(null),[x,y]=T.useState(!1),[C,j]=T.useState(null),[N,M]=T.useState(null),[z,D]=T.useState(!1),[I,$]=T.useState(0),P=T.useCallback(Y=>{D(Y),Y&&$(J=>J+1)},[]),F=T.useRef(i);F.current=i,T.useEffect(()=>{if(!r)return;let Y=!1;return IQe().then(J=>{Y||(o(J.engine),d(J.hint),h(J.installCommand))}).catch(()=>{Y||o(null)}),()=>{Y=!0}},[r]);const W=T.useRef(!1),Z=T.useCallback(()=>{if(W.current)return;W.current=!0,g(!0);const Y=F.current;M(null),b(null),j(null),BQe(e,n,{sessionId:t}).then(J=>{var L,B;const H=J.pdfPath;if(J.ok&&H){k(X=>({path:H,version:((X==null?void 0:X.version)??0)+1,source:Y})),y(J.hadErrors),j(J.note),J.hadErrors&&b(((L=J.log)==null?void 0:L.trim())||null),P(!0);return}k(null),y(!1),j(J.note),D(!1),b(((B=J.log)==null?void 0:B.trim())||zpe())}).catch(J=>{k(null),y(!1),j(null),D(!1),M(J instanceof Error?J.message:String(J))}).finally(()=>{W.current=!1,g(!1)})},[e,n,t,P]),U=T.useRef(null);return T.useEffect(()=>{!r||!s||!l||U.current!==n&&(U.current=n,Z())},[r,s,l,n,Z]),{engine:l,installHint:c,installCommand:_,compiling:m,compiled:S,stale:S!==null&&S.source!==i,log:v,builtWithErrors:x,note:C,error:N,showPdf:z,setShowPdf:P,viewNonce:I,compile:Z,dismiss:()=>{M(null),b(null)}}}const Q1t=3e4;function J1t({projectId:e,filePath:n,sessionId:t,enabled:r,savedSource:s,dirty:i,onPulled:l}){const[o,c]=T.useState(!1),[d,_]=T.useState(null),[h,m]=T.useState(!1),[g,S]=T.useState(!1),[k,v]=T.useState(null),[b,x]=T.useState(null),[y,C]=T.useState(!1),j=T.useCallback(P=>{c(P.hasToken),_(P.link)},[]);T.useEffect(()=>{let P=!1;if(m(!1),_(null),v(null),x(null),C(!1),D.current=!1,!!r)return PQe(e,n,{sessionId:t}).then(F=>{P||j(F)}).catch(F=>{P||x(F instanceof Error?F.message:String(F))}).finally(()=>{P||m(!0)}),()=>{P=!0}},[r,e,n,t,j]),T.useEffect(()=>{C(!1)},[s]);const N=T.useRef(!1),M=T.useRef(l);M.current=l;const z=T.useRef(i);z.current=i;const D=T.useRef(!1),I=T.useCallback(P=>!o||!d||N.current||z.current?!1:(N.current=!0,S(!0),x(null),qQe(e,n,{sessionId:t,resolve:P}).then(F=>{D.current=!1,v(F),F.pulled.includes(n)&&(z.current?C(!0):M.current(F.pulled))}).catch(F=>{D.current=!0,v(null),x(F instanceof Error?F.message:String(F))}).finally(()=>{N.current=!1,S(!1)}),!0),[e,n,t,o,d]),$=T.useRef(null);return T.useEffect(()=>{if(!r||!h||!o||!d||i)return;const P=`${n}:${d.projectId}:${s}`;$.current!==P&&I()&&($.current=P)},[r,h,o,d,n,s,i,g,I]),T.useEffect(()=>{if(!r||!h||!o||!d||i)return;const P=setInterval(()=>{N.current||D.current||GQe(e,n,{sessionId:t}).then(F=>{F.remoteChanged&&I()}).catch(F=>{D.current=!0,x(F instanceof Error?F.message:String(F))})},Q1t);return()=>clearInterval(P)},[r,h,o,d,i,e,n,t,I]),{hasToken:o,link:d,loaded:h,syncing:g,last:k,error:b,blocked:i,staleOnDisk:y,reloaded:()=>C(!1),uploadUrl:VQe(e,n,{sessionId:t}),saveToken:async P=>{const F=await yz(P);$.current=null,D.current=!1,x(null),c(F.hasToken)},linkProject:async P=>{j(await FQe(e,n,{project:P,sessionId:t}))},unlink:async()=>{j(await UQe(e,n,{sessionId:t})),$.current=null,D.current=!1,v(null),x(null)},sync:P=>{D.current=!1,I(P)}}}function IR(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function u9(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),l=s.indexOf("?"),o=l===-1?s:s.slice(0,l),c=l===-1?"":s.slice(l+1);let d;try{d=decodeURI(o)}catch{return null}if(!d||d.includes("\0"))return null;const _=d.startsWith("/"),h=_?[]:e.split("/").filter(Boolean);for(const m of d.split("/"))if(!(!m||m===".")){if(m===".."){if(h.length===0)return null;h.pop();continue}h.push(m)}return h.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${h.join("/")}`,query:c,hash:i}}function ebt(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const d9=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],tbt=4e6,nbt=200,f9=16e6,rbt=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),h9=e=>e.startsWith("//")?`https:${e}`:e;async function sbt(e,n){var s;let t=tbt;const r=new Map;for(const{element:i,attribute:l,url:o,typePrefixes:c}of e){if(r.has(o)){const S=r.get(o);S&&i.setAttribute(l,S);continue}if(n.aborted)return;if(r.size>=nbt)continue;r.set(o,null);const d=await fetch(o,{signal:n}).catch(()=>null);if(!(d!=null&&d.ok))continue;const _=d.headers.get("content-type")??"",h=Number(d.headers.get("content-length"));if(!c.some(S=>_.startsWith(S))||!(Number.isFinite(h)&&h>0&&h<=t)){await((s=d.body)==null?void 0:s.cancel().catch(()=>{}));continue}const m=await d.blob().catch(()=>null),g=m&&await rbt(m);!m||!g||(t-=m.size,r.set(o,g),i.setAttribute(l,g))}}async function ibt(e,n,t){var l;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(d9.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:d,typePrefixes:_}of d9){if(!o.matches(c))continue;const h=o.getAttribute(d);if(!h)continue;const m=n(h);m&&(m===h?o.setAttribute(d,h9(h)):s.push({element:o,attribute:d,url:m,typePrefixes:_}))}await sbt(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!IR(c)||(o.setAttribute("href",h9(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((l=r.querySelector("base[href]"))==null?void 0:l.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function abt(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${f9-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const l=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(l)&&l>f9}}function obt({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,l]=T.useState(null);return T.useEffect(()=>{let o=!1;const c=new AbortController;return l(null),abt(e,n,t,c.signal).then(async({text:d,partial:_})=>({source:await ibt(d,s,c.signal),partial:_})).then(d=>{o||l(d)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?f.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[f.jsx(Rt,{})," ",iN()]}):f.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:cfe()}),f.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:hfe({name:Ee(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function lbt({overleaf:e}){var h;const n=T.useRef(null),{open:t,setOpen:r,ref:s}=da(n),i=T.useId(),[l,o]=T.useState({top:0,left:0,maxHeight:0}),c=((h=e.last)==null?void 0:h.conflicts.length)??0,d=e.hasToken&&!!e.error,_=d?Wv():c?w4e():!e.hasToken||!e.link?s5e():e.syncing?mN():e.blocked?pN():hN();return T.useEffect(()=>{c&&r(!0)},[c,r]),T.useEffect(()=>{d&&fr(Wv(),"error",{id:i,duration:5e3})},[d,e.error,i]),T.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const m=n.current.getBoundingClientRect(),g=Math.min(384,window.innerWidth-16),S=Math.min(m.bottom+6,window.innerHeight-80);o({top:S,left:Math.max(8,Math.min(m.right-g,window.innerWidth-g-8)),maxHeight:window.innerHeight-S-8}),(s.current.querySelector("input")??s.current).focus();const k=()=>r(!1),v=b=>{var x;b.target instanceof Node&&!((x=s.current)!=null&&x.contains(b.target))&&k()};return window.addEventListener("resize",k),window.addEventListener("scroll",v,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",v,!0)}},[t,s,r]),f.jsxs(f.Fragment,{children:[f.jsx(qt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":JB({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?f.jsx(Rt,{}):f.jsx(GXe,{size:13,className:d||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&Ro.createPortal(f.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":LN(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:l,onBlur:m=>{var g;m.relatedTarget instanceof Node&&!m.currentTarget.contains(m.relatedTarget)&&!((g=n.current)!=null&&g.contains(m.relatedTarget))&&r(!1)},children:[f.jsx("div",{className:"absolute end-3 top-3",children:f.jsx(qt,{size:"small","aria-label":Gde(),onClick:()=>{var m;r(!1),(m=n.current)==null||m.focus()},children:f.jsx(Br,{size:13})})}),f.jsx(dbt,{overleaf:e})]}),document.body)]})}const U0=e=>Oa(new Intl.ListFormat(E()).format(e.map(Ee)));function cbt(e){if(e.error)return O4e();if(e.syncing)return mN();if(e.blocked)return pN();const n=e.last;return n?n.pulled.length&&n.pushed.length?$we({pulled:U0(n.pulled),pushed:U0(n.pushed)}):n.pulled.length?Lwe({paths:U0(n.pulled)}):n.pushed.length?Uwe({paths:U0(n.pushed)}):n.conflicts.length?W4e():hN():Twe()}function ubt({href:e}){return f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:_N()})}function dbt({overleaf:e}){var m,g;const[n,t]=T.useState(""),[r,s]=T.useState(!1),[i,l]=T.useState(null),[o,c]=T.useState(!1),d=()=>{t(""),l(null),c(!0)},_=!e.hasToken||o;async function h(S){S.preventDefault();const k=n.trim();if(!(r||!k)){s(!0),l(null);try{_?(await e.saveToken(k),c(!1)):await e.linkProject(k),t("")}catch(v){l(v instanceof Error?v.message:String(v))}finally{s(!1)}}}if(e.link&&!_){const S=((m=e.last)==null?void 0:m.conflicts)??[];return f.jsxs("div",{className:"flex flex-col gap-3",children:[f.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[f.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&f.jsx(Rt,{}),e.error?Wv():cbt(e)]}),e.error&&f.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),f.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[f.jsx(He,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?Wwe():void 0,onClick:()=>e.sync(),children:e.error?Ml():mwe()}),f.jsxs(ih,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[cwe()," ",f.jsx(Ic,{size:12})]})]}),S.map(k=>f.jsxs("div",{className:"space-y-2 text-sm",children:[f.jsxs("p",{className:"break-words text-accent-red",children:[f.jsx("code",{className:"font-mono",children:k})," ",twe()]}),f.jsxs("div",{className:"flex flex-wrap gap-2",children:[f.jsx(He,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[k]:"keep-local"}),children:iwe()}),f.jsx(He,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[k]:"take-overleaf"}),children:Nwe()})]})]},k)),((g=e.last)==null?void 0:g.note)&&f.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),f.jsxs("details",{className:"border-t border-border pt-3",children:[f.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:f.jsx("span",{className:"ms-2",children:Xx()})}),f.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[f.jsx(He,{variant:"ghost",className:"font-normal",type:"button",onClick:d,children:rS()}),f.jsx(ih,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:_N()}),f.jsx(He,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(k=>{l(k instanceof Error?k.message:String(k))}),children:xwe()})]})]})]})}return f.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:h,children:[f.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?_5e():b5e()}),f.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[f.jsx(ws,{className:"basis-full min-w-0","aria-label":_?tS():nS(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:S=>t(S.target.value),placeholder:_?tS():"https://www.overleaf.com/project/…",autoComplete:"off"}),f.jsx(He,{type:"submit",disabled:r||!n.trim(),children:r?_?qi():la():_?e5e():H4e()}),f.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?E4e():nS()})]}),(i||e.error)&&f.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),f.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[f.jsx(ubt,{href:e.uploadUrl}),o?f.jsx(He,{variant:"ghost",type:"button",onClick:()=>c(!1),children:Z4e()}):e.hasToken&&f.jsx(He,{variant:"ghost",type:"button",onClick:d,children:rS()})]})]})}function fbt({command:e}){const[n,t]=T.useState("idle"),r=T.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const l=document.createRange();l.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(l)}t("select"),setTimeout(()=>t("idle"),4e3)}};return f.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[f.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),f.jsx(qt,{"data-tip":n==="copied"?nh():n==="select"?She():bde(),"aria-label":wde(),onClick:()=>void s(),children:n==="copied"?f.jsx(mi,{size:13}):f.jsx(sm,{size:13})})]})}function hbt({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:l,onOpenFile:o,scrollPosition:c,onScrollPositionChange:d,lineScrollRequest:_,onLineScrollRequestHandled:h,onEdit:m,artifactVersion:g,artifactEntries:S=[],initialBuffer:k,onBufferStateChange:v,remote:b=!1}){var en;const[x,y]=T.useState(null),[C,j]=T.useState(null),[N,M]=T.useState(0),z=t==="artifacts",D=t==="abs",I=Q4(n),$=pR(n),P=g1t(n),F=I||P,[W,Z]=T.useState(!1),[U,Y]=T.useState(k??null),J=T.useRef(U),H=T.useRef(v);H.current=v,T.useEffect(()=>(H.current=v,()=>{H.current=void 0}),[v]);const L=Be=>{var Qe;J.current=Be,Y(Be),(Qe=H.current)==null||Qe.call(H,Be&&(xo(Be)||Be.conflict)?Be:null)},[B,X]=T.useState(!1),V=T.useRef(!1),[ae,ce]=T.useState(null),oe=T.useRef(0),se=T.useRef(null),G=T.useRef(c),ne=(x==null?void 0:x.file)??null,le=U&&xo(U)?U.path:(x==null?void 0:x.source)==="checkout"?x.file.path:n,_e=le.split("/").slice(0,-1).join("/"),ue=(x==null?void 0:x.source)==="artifact",ze=T.useCallback(Be=>{var Qe;return((Qe=u9(_e,Be,D))==null?void 0:Qe.path)??null},[D,_e]),Ne=T.useCallback(Be=>D?RQe(Be):ue?id(e,Be):NS(e,Be,{sessionId:r,ref:s}),[ue,s,D,e,r]),Ie=T.useCallback(Be=>{if(IR(Be))return Be;const Qe=u9(_e,Be,D);return Qe?ebt(Ne(Qe.path),Qe):null},[D,_e,Ne]),qe=wR(ne==null?void 0:ne.presentation),Fe=(x==null?void 0:x.source)==="artifact"&&!z,Ot=z&&(x==null?void 0:x.source)==="checkout",xt=!s&&(x==null?void 0:x.source)==="checkout"&&ne!=null&&!ne.notFound,Nt=r!=null&&(x==null?void 0:x.source)==="checkout"&&x.file.root==="clone",Jt=xt&&ne!=null&&!ne.binary&&!ne.truncated&&!qe&&!Nt,ht=Jt&&ne.version===void 0,it=U!==null&&xo(U),et=!ht&&(Jt&&typeof ne.version=="string"||it),Pt=(U==null?void 0:U.draft)??yx((ne==null?void 0:ne.content)??""),we=(U==null?void 0:U.baseline)??yx((ne==null?void 0:ne.content)??""),Oe=et&&U!==null&&xo(U);T.useEffect(()=>{if(!et||(x==null?void 0:x.source)!=="checkout"||typeof(ne==null?void 0:ne.version)!="string")return;const Be=J.current;Be&&xo(Be)||(L(c9(ne.path,ne.content,ne.version)),ce(null))},[ne==null?void 0:ne.content,ne==null?void 0:ne.version,et,x==null?void 0:x.source,n]);const Je=async Be=>{const Qe=J.current;if(!et||!Qe||!xo(Qe))return!0;if(V.current)return!1;if(Qe.conflict&&Be===void 0)return ce(Qe.conflict.exists?M7():D7()),!1;const pn=Qe.draft,Xn=Y1t(Qe);V.current=!0,X(!0),ce(null);try{const Vt=await DQe(e,le,Xn,{sessionId:r,expectedVersion:Be??Qe.version}),wt=J.current??Qe;return oe.current++,L({...wt,baseline:pn,version:Vt.version,conflict:null}),y(on=>on&&on.source==="checkout"?{source:"checkout",file:{...on.file,content:Xn,version:Vt.version}}:on),!0}catch(Vt){if(Vt instanceof Jv){const wt=J.current??Qe;return xo(wt)&&L({...wt,conflict:{currentVersion:Vt.currentVersion,exists:Vt.exists}}),!1}return ce(Vt instanceof Error?Vt.message:String(Vt)),!1}finally{V.current=!1,X(!1)}},nt=$&&xt&&!Nt,De=Z1t({projectId:e,filePath:le,sessionId:r,enabled:nt,ready:ne!=null&&!ne.notFound,source:et?Pt:(ne==null?void 0:ne.content)??""}),At=J1t({projectId:e,filePath:le,sessionId:r,enabled:nt,savedSource:we,dirty:Oe,onPulled:T.useCallback(Be=>{Be.includes(le)&&M(Qe=>Qe+1)},[le])}),pt=$&&De.showPdf&&De.compiled!=null,It=ht&&it,nn=(et||It)&&!(F&&!W)&&!pt,gn=De.compiled?`${NS(e,De.compiled.path,{sessionId:r})}&v=${De.compiled.version}`:null,Ct=gn?`${gn}&view=${De.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,xn=De.compiled?De.compiled.path.split("/").pop()??De.compiled.path:null,rn=async()=>{Oe&&!await Je()||$&&De.engine&&De.compile()},lr=async()=>{Oe&&await rn()},[_r,Ln]=T.useState(!1),[Yn,sn]=T.useState(null),$n=async()=>{Ln(!0),sn(null);try{await OQe(e,le,{sessionId:r})}catch(Be){sn(Be instanceof Error?Be.message:String(Be))}finally{Ln(!1)}},Cn=T.useCallback(()=>{V.current||M(Be=>Be+1)},[]),mt=()=>{L(null),ce(null),Cn()},an=SR(Ne(le),!s&&!B);T.useEffect(()=>{if(!C||s)return;const Be=window.setInterval(()=>{document.visibilityState!=="hidden"&&Cn()},2e3);return()=>window.clearInterval(Be)},[C,s,Cn]);const Xe=`${Ne(le)}&v=${encodeURIComponent(an??g??"")}&reload=${N}`;T.useEffect(()=>{let Be=!1;const Qe=++oe.current,pn=async()=>{const wt=await zJe(e,n),on=(wt==null?void 0:wt.presentation)==="text"||(wt==null?void 0:wt.presentation)==="unknown",yn=wt&&on?await Az(e,n):null,bn=wt===null||on&&yn===null;return{path:n,content:(yn==null?void 0:yn.content)??"",truncated:(yn==null?void 0:yn.truncated)??!1,binary:(yn==null?void 0:yn.binary)??(wt==null?void 0:wt.presentation)==="download",notFound:bn,presentation:yn?yn.binary?"download":"text":(wt==null?void 0:wt.presentation)??"download"}},Xn=async()=>{for(const wt of[`artifacts/${n}`,n]){const on=await ES(e,wt,{sessionId:r}).catch(()=>null);if(on&&!on.notFound)return on}return null};return(D?MQe(n).then(wt=>({source:"absolute",file:wt})):z?pn().then(async wt=>{if(!wt.notFound)return{source:"artifact",file:wt};const on=await Xn();return on?{source:"checkout",file:on}:{source:"artifact",file:wt}}):ES(e,n,{sessionId:r,ref:s}).then(wt=>wt.notFound&&!s?pn().then(on=>on.notFound?{source:"checkout",file:wt}:{source:"artifact",file:on,checkoutRoot:wt.root}):{source:"checkout",file:wt})).then(wt=>{var yn,bn;if(Be||Qe!==oe.current)return;const on=J.current;if(on&&xo(on)){const wn=wt.source==="checkout"?wt.file:null,An=wn!==null&&wn.path===on.path&&(!r||wn.root==="worktree"),Hn=X1t(on,An&&typeof wn.version=="string"?wn.version:null,An&&!wn.notFound);Hn&&(Hn.currentVersion!==((yn=on.conflict)==null?void 0:yn.currentVersion)||Hn.exists!==((bn=on.conflict)==null?void 0:bn.exists))?L({...on,conflict:Hn}):!Hn&&on.conflict&&L({...on,conflict:null})}y(wt),j(null)}).catch(wt=>{!Be&&Qe===oe.current&&j(wt.message)}),()=>{Be=!0}},[e,n,t,r,s,N,g,an]),T.useLayoutEffect(()=>{const Be=se.current,Qe=G.current;!Be||!ne||!Qe||(Be.scrollTop=Qe.top,Be.scrollLeft=Qe.left)},[ne]);const ot=Be=>{if(Be.source==="absolute")return Mfe();if(z)return kfe({root:r?m0():p0()});if(s)return zfe({branch:Ee(s)});if(r&&Be.source==="checkout"&&Be.file.root==="clone")return Qhe();const Qe=Be.source==="checkout"?Be.file.root:Be.checkoutRoot;return Ofe({root:Qe==="worktree"?m0():p0()})};return f.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[f.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[f.jsx(gd,{name:le}),f.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":Ee(le),children:le.split("/").pop()||le}),l&&f.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:zI({branch:Ee(l)}),children:[f.jsx(om,{size:11}),l]}),nn&&(B||Oe||ae)&&f.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ae?"text-accent-red":"text-muted"}`,title:ae??(B?qi():qhe()),children:B?f.jsxs(f.Fragment,{children:[f.jsx(Rt,{})," ",vhe()]}):ae?phe():aN()}),$&&De.compiled&&f.jsx(qt,{size:"small",active:!De.showPdf,"data-tip":De.stale&&De.showPdf?the():De.showPdf?Fu():B7(),"data-tip-align":"end","aria-label":De.showPdf?Fu():B7(),onClick:()=>De.setShowPdf(!De.showPdf),children:De.showPdf?f.jsx(Zv,{size:13}):f.jsx(im,{size:13,className:De.stale?"text-accent-amber":void 0})}),$&&gn&&xn&&f.jsx(um,{size:"small","data-tip":De.stale?Qde({name:Ee(xn)}):V6({name:Ee(xn)}),"data-tip-align":"end","aria-label":V6({name:Ee(xn)}),href:gn,download:xn,children:f.jsx(QXe,{size:13,className:De.stale?"text-accent-amber":void 0})}),nt&&f.jsx(lbt,{overleaf:At}),$&&xt&&f.jsx(qt,{size:"small","data-tip":De.compiled?I7():R7(),"data-tip-align":"end","aria-label":De.compiled?I7():R7(),disabled:De.compiling||!De.engine,onClick:()=>void rn(),children:De.compiling?f.jsx(Rt,{}):f.jsx(rZe,{size:13})}),F&&f.jsx(qt,{size:"small",active:W,"data-tip":W?wp():Fu(),"data-tip-align":"end","aria-label":W?wp():Fu(),onClick:()=>Z(Be=>!Be),children:f.jsx(Zv,{size:13})}),xt&&!b&&f.jsx(qt,{size:"small","data-tip":Yn??O7(),"data-tip-align":"end","aria-label":O7(),disabled:_r,onClick:()=>void $n(),children:_r?f.jsx(Rt,{}):f.jsx(Ic,{size:13})})]}),!C&&Ot&&(x==null?void 0:x.source)==="checkout"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:Hfe({root:x.file.root==="worktree"?m0():p0()})}),ht&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:Khe()}),C&&ne!==null&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[L7()," ",Ee(C)]}),(U==null?void 0:U.conflict)&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",role:"status",children:U.conflict.exists?M7():D7()}),((en=U==null?void 0:U.conflict)==null?void 0:en.exists)&&U.conflict.currentVersion&&f.jsx(He,{disabled:B,onPointerDown:Be=>Be.preventDefault(),onClick:()=>{var Be;return void Je(((Be=U.conflict)==null?void 0:Be.currentVersion)??void 0)},children:Zfe()}),f.jsx(He,{disabled:B,onPointerDown:Be=>Be.preventDefault(),onClick:mt,children:dhe()})]}),(De.error||De.log)&&f.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx("span",{className:`flex-1 min-w-0 text-sm ${De.builtWithErrors?"text-subtext":"text-accent-red"}`,children:De.error??(De.builtWithErrors?_de():ode())}),f.jsx(qt,{"data-tip":Ide(),"data-tip-align":"end","aria-label":Pde(),onClick:De.dismiss,children:f.jsx(Br,{size:13})})]}),De.log&&f.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:De.log})]}),nt&&At.staleOnDisk&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[f.jsx("span",{className:"flex-1 min-w-0",children:Wfe()}),f.jsx(He,{onClick:()=>{At.reloaded(),M(Be=>Be+1)},children:jde()})]}),$&&xt&&De.engine===null&&De.installHint&&f.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[De.installHint,De.installCommand&&f.jsx(fbt,{command:De.installCommand})]}),De.note&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:De.note}),pt&&De.stale&&f.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:Rhe()}),f.jsxs("div",{ref:se,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Be=>{const Qe={top:Be.currentTarget.scrollTop,left:Be.currentTarget.scrollLeft};G.current=Qe,d==null||d(Qe)},children:[!nn&&!C&&!z&&(x==null?void 0:x.source)==="checkout"&&!x.file.notFound&&!s&&r&&x.file.root==="clone"&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Ihe()}),!nn&&!C&&(x==null?void 0:x.source)==="artifact"&&!x.file.notFound&&Fe&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:Xue({root:x.checkoutRoot==="worktree"?m0():p0()})}),C&&ne===null?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[L7()," ",Ee(C)]}):ne===null?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:iN()}):nn?f.jsx(JT,{value:Pt,onChange:Be=>{const Qe=J.current??(ne&&typeof ne.version=="string"?c9(ne.path,ne.content,ne.version):null);Qe&&L(K1t(Qe,Be)),m==null||m(),ae&&ce(null)},onSave:()=>void lr(),onBlur:()=>{xx||lr()},readOnly:It,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:h}):ne.notFound?f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:x?ot(x):xfe()}):qe?f.jsx(vx,{kind:qe,url:Xe,name:n.split("/").pop()??n}):ne.binary?f.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[ede()," ",f.jsx("a",{href:Xe,download:n.split("/").pop()??n,children:sN()})]}):pt&&Ct&&xn?f.jsx(vx,{kind:"pdf",url:Ct,name:xn,downloadBar:!1},Ct):I&&!W?f.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:ue?f.jsx(zR,{projectId:e,folder:_e,markdown:ne.content,entries:S}):f.jsx($a,{text:ne.content,resolveFilePath:ze,resolveImageSrc:Ie,onOpenFile:o&&((Be,Qe,pn,Xn,Vt)=>o(Be,r,s,Vt))})}):P&&!W?f.jsx(obt,{html:ne.content,truncated:ne.truncated,url:Xe,name:le,resolveSrc:Ie}):f.jsxs(f.Fragment,{children:[f.jsx(yR,{text:ne.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:h}),ne.truncated&&f.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:ife()})]})]})]})}const Ev=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function _bt({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:l,ref:o}=da(),c=T.useRef(null);return T.useEffect(()=>{if(!i)return;const d=_=>{var h;_.key==="Escape"&&((h=c.current)==null||h.focus())};return document.addEventListener("keydown",d,!0),()=>document.removeEventListener("keydown",d,!0)},[i]),f.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-start [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:start-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[f.jsx(qt,{className:"project-back text-text","aria-label":$7(),onClick:n,children:f.jsx(rh,{size:18})}),f.jsxs("div",{className:"project-switcher",ref:o,children:[f.jsxs("button",{ref:c,className:`brand${i?" open":""}`,onClick:()=>l(d=>!d),"aria-expanded":i,children:[f.jsxs("span",{className:"brand-project-copy",children:[f.jsx("span",{className:"brand-project-label",children:b0e()}),f.jsx("span",{className:"brand-project",children:e})]}),f.jsx(Ua,{className:"project-chevron",size:14})]}),i&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu",children:[f.jsx(Nr,{onClick:()=>{l(!1),r()},children:f.jsxs("span",{className:Ev,children:[f.jsx(oz,{size:14}),o0e()]})}),f.jsx(Nr,{onClick:()=>{l(!1),n()},children:f.jsxs("span",{className:Ev,children:[f.jsx(vZe,{size:14}),$7()]})}),f.jsx(Nr,{onClick:()=>{var d;(d=c.current)==null||d.focus(),l(!1),t()},children:f.jsxs("span",{className:Ev,children:[f.jsx(cZe,{size:14}),d0e()]})})]})]}),s&&f.jsx(qt,{"data-tip":H7(),"data-tip-align":"end","aria-label":H7(),onClick:s,children:f.jsx(cz,{size:15})})]})}function _9(){const e=T.useSyncExternalStore(Eet,LS,LS);return f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":Vv()}),!e&&f.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[f.jsx(nz,{size:13,className:"shrink-0 text-accent-amber"}),f.jsx("span",{dir:"auto",className:"min-w-0",children:Vv()})]})]})}const p9=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),yh=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),m9=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),BR=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),g9=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),pbt=[{id:"AI/ML",label:vve},{id:"Biology",label:Sve},{id:"Physics",label:Tve},{id:"Other",label:Nve}];function mbt({onDone:e,preferredAgent:n}){const[t,r]=T.useState(0),[s,i]=T.useState(null),[l,o]=T.useState(),[c,d]=T.useState(!1),[_,h]=T.useState(null),[m,g]=T.useState(null),[S,k]=T.useState(!1),[v,b]=T.useState([]),[x,y]=T.useState(""),[C,j]=T.useState(""),[N,M]=T.useState([]),[z,D]=T.useState(""),[I,$]=T.useState([]),[P,F]=T.useState(!1),W=T.useRef(0),[Z,U]=T.useState(!1),[Y,J]=T.useState(!1),H=(s==null?void 0:s.some(G=>G.agentReady))??!1,L=l!=null,B=T.useRef(0),X=(G,ne=!1)=>{const le=++B.current;k(!0),U(!1),J(!1),o(void 0);const _e=()=>le===B.current;Promise.allSettled([Ep(G,ne).then(ue=>_e()&&i(ue)),bz().then(ue=>_e()&&o(ue.gitVersion))]).then(([ue,ze])=>{_e()&&(ue.status==="rejected"&&(U(!0),i(null)),ze.status==="rejected"&&(J(!0),o(void 0)))}).finally(()=>_e()&&k(!1))};T.useEffect(()=>X(!1),[]),T.useEffect(()=>{if(s===null)return;const G=s.filter(ne=>ne.agentReady);g(ne=>{var _e;if(ne&&G.some(ue=>ue.id===ne))return ne;const le=n&&G.find(ue=>ue.id===n.harness);return(le==null?void 0:le.id)??((_e=G[0])==null?void 0:_e.id)??null})},[s,n]),T.useEffect(()=>uy(()=>{Ep(!0).then(G=>{i(G),U(!1)}).catch(()=>U(!0))}),[]),T.useEffect(()=>{jJe().then(G=>{b(G.researchAreas),y(G.otherArea??""),j(G.background??""),M(G.papers)}).catch(()=>{})},[]),T.useEffect(()=>{const G=z.trim();if(G.length<3){$([]),F(!1);return}const ne=++W.current;F(!0);const le=setTimeout(()=>{vz(G).then(_e=>ne===W.current&&$(_e)).catch(()=>ne===W.current&&$([])).finally(()=>ne===W.current&&F(!1))},350);return()=>clearTimeout(le)},[z]);const V=G=>{const ne=N.some(le=>le.paperId===G.paperId);M(le=>le.some(_e=>_e.paperId===G.paperId)?le:[...le,{paperId:G.paperId,title:b9(G.title)}]),D(""),$([]),ne||e2(G.paperId).then(le=>{var ue;const _e=(ue=le.title)==null?void 0:ue.trim();_e&&M(ze=>ze.map(Ne=>Ne.paperId===G.paperId?{...Ne,title:_e}:Ne))}).catch(()=>{})},ae=G=>M(ne=>ne.filter(le=>le.paperId!==G)),ce=G=>{b(ne=>ne.includes(G)?ne.filter(le=>le!==G):[...ne,G])},oe=v.length>0&&(!v.includes("Other")||x.trim().length>0),se=async()=>{const G=s==null?void 0:s.find(le=>le.id===m&&le.agentReady);if(!G||c)return;const ne=bbt(G);d(!0),h(null);try{const le=await bQe(ne,{researchAreas:v,otherArea:v.includes("Other")?x:null,background:C||null,papers:N});e(le.project,le.selection)}catch(le){h(le instanceof Error?le.message:String(le))}finally{d(!1)}};return f.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${t===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:f.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${t===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:t===0?f.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[f.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[f.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:f.jsx(xb,{})}),f.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:lve()})]}),f.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[f.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),f.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:m2e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:qye()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:W2e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:kye()})]})}),f.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:f.jsxs("span",{children:[f.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:L2e()}),f.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:_4e()})]})})]})]}),f.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:f.jsxs(He,{variant:"primary",size:"large",onClick:()=>r(1),children:[Q7()," ",f.jsx(tp,{size:20})]})})]}):t===1?f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(xb,{}),f.jsx("span",{children:zye()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:Xve()}),f.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:vxe()}),s!==null&&!H&&f.jsx("p",{className:p9,children:mye()}),s!==null&&H&&m===null&&f.jsx("p",{className:p9,children:e2e()}),f.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:s!==null?s.map(G=>f.jsx(xbt,{h:G,selected:m===G.id,onSelect:()=>g(G.id)},G.id)):Z?f.jsx("div",{className:yh,children:eS()}):f.jsxs(Pr,{className:"py-2",children:[f.jsx(Rt,{})," ",N2e()]})}),(l===null||Y)&&f.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[f.jsx(ybt,{gitVersion:l,error:Y}),Y?f.jsx("p",{className:m9,children:eS()}):f.jsx("p",{className:m9,children:U2e()})]}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(He,{variant:"ghost",onClick:()=>r(0),children:[f.jsx(rh,{size:12})," ",Z7()]}),(Z||Y||l===null||s!==null&&!H)&&f.jsxs(He,{variant:"ghost",onClick:()=>X(!0,!0),disabled:S,children:[f.jsx(ua,{size:12,className:S?"animate-[spin_0.9s_linear_infinite]":""})," ",Nxe()]}),f.jsx("div",{className:"flex-1"}),f.jsxs(He,{variant:"primary",onClick:()=>r(2),disabled:S||!H||m===null||!L,title:S?a4e():H?m===null?f2e():Y?Lxe():l===void 0?n4e():l===null?txe():void 0:fye(),children:[Q7()," ",f.jsx(tp,{size:13})]})]})]}):f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[f.jsx(xb,{}),f.jsx("span",{children:Mye()})]}),f.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:Oye()}),f.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:f.jsxs("div",{className:BR,children:[f.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[f.jsx("legend",{children:u4e()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:l2e()}),f.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:pbt.map(G=>f.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[f.jsx("input",{type:"checkbox",checked:v.includes(G.id),onChange:()=>ce(G.id),disabled:c}),f.jsx("span",{children:G.label()})]},G.id))}),v.includes("Other")&&f.jsx("input",{className:"onb-other-area w-full mt-2",value:x,onChange:G=>y(G.target.value),disabled:c,placeholder:Hye(),"aria-label":Sxe()})]}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:Uxe()}),f.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:G=>j(G.target.value),disabled:c,rows:4,placeholder:T2e()}),f.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:$xe()}),f.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:fve()}),f.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[f.jsx("input",{id:"onb-paper-search",value:z,onChange:G=>D(G.target.value),disabled:c,placeholder:Xxe()}),P?f.jsx("div",{className:yh,children:eye()}):I.length>0?f.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:I.map(G=>f.jsxs("button",{type:"button",onClick:()=>V(G),disabled:c,children:[f.jsx(_h,{children:b9(G.title)}),f.jsx("span",{className:"id",children:G.paperId})]},G.paperId))}):null]}),N.length>0&&f.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:N.map(G=>f.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[f.jsx(_h,{children:G.title||G.paperId}),f.jsx("span",{className:"id",children:G.paperId}),f.jsx("button",{type:"button","aria-label":d$({name:Ee(G.paperId)}),onClick:()=>ae(G.paperId),disabled:c,children:f.jsx(Br,{size:12})})]},G.paperId))})]})}),!oe&&f.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:v.length===0?s2e():S2e()}),f.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[f.jsxs(He,{variant:"ghost",onClick:()=>r(1),disabled:c,children:[f.jsx(rh,{size:12})," ",Z7()]}),f.jsx("div",{className:"flex-1"}),f.jsx(He,{variant:"primary",onClick:()=>void se(),disabled:c||m===null||!oe,children:c?f.jsxs(f.Fragment,{children:[f.jsx(Rt,{})," ",lye()]}):f.jsxs(f.Fragment,{children:[$2e()," ",f.jsx(tp,{size:13})]})})]}),m===null&&f.jsx("p",{className:g9,children:b4e()}),_&&f.jsx("p",{className:g9,children:_})]})})})}function b9(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function gbt(e){return e.agentReady?{tone:"success",label:xye()}:e.installed?e.installBroken?{tone:"warning",label:Z2e()}:e.authState==="unknown"?{tone:"warning",label:Kye()}:e.authState==="unsupported"?{tone:"warning",label:Qye()}:e.installed?{tone:"warning",label:pxe()}:{tone:"neutral",label:J7()}:{tone:"neutral",label:J7()}}function bbt(e){var t,r;const n=((t=e.models[0])==null?void 0:t.id)??null;return{harness:e.id,model:n,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:cm(e,n).defaultId}}function vbt({harness:e}){return f.jsx(Y2,{harness:e,size:26})}function xbt({h:e,selected:n,onSelect:t}){var c;const r=gbt(e),s=n?{tone:"success",label:sye()}:r,l=[(c=e.version)==null?void 0:c.replace(/\s*\(.*\)$/,""),e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(d=>Sp(d)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · "),o=f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[f.jsx(vbt,{harness:e.id}),f.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),f.jsx(_y,{tone:s.tone,children:s.label})]});return e.agentReady?f.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,f.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??qx(),e.plan?` · ${e.plan}`:""]}),f.jsx("div",{className:`${yh} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:l,children:l})]}):f.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,f.jsx("div",{className:yh,children:Qh(e.agentNote)})]})}function ybt({gitVersion:e,error:n}){return f.jsxs("div",{className:BR,children:[f.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[f.jsx("span",{className:"onb-card-name font-semibold text-base",children:ixe()}),f.jsx(_y,{tone:e?"success":n||e===null?"danger":"warning",children:e?Txe():n?Bve():e===null?fN():Fve()})]}),(e||!n&&e===void 0)&&f.jsx("div",{className:yh,children:e??Vve()})]})}function Nv(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function wbt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Sbt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function kbt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function Cbt({onCreated:e,onCancel:n,remote:t=!1}){const[r,s]=T.useState("blank"),[i,l]=T.useState(""),[o,c]=T.useState(!1),[d,_]=T.useState(""),[h,m]=T.useState(!1),[g,S]=T.useState(null),[k,v]=T.useState(null),[b,x]=T.useState(!1),[y,C]=T.useState(!1),[j,N]=T.useState(!1),[M,z]=T.useState(null),[D,I]=T.useState(!1),[$,P]=T.useState(!1),[F,W]=T.useState(void 0),[Z,U]=T.useState("research-project"),[Y,J]=T.useState(null),[H,L]=T.useState(!1),[B,X]=T.useState(!1),[V,ae]=T.useState(""),[ce,oe]=T.useState(null),[se,G]=T.useState([]),[ne,le]=T.useState(!1),[_e,ue]=T.useState(""),[ze,Ne]=T.useState(0),Ie=T.useRef(0),qe=T.useRef(0),Fe=T.useRef(0),Ot=T.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),xt=r==="paper"?Sbt(ce==null?void 0:ce.repoUrl):null,Nt=i.trim()?`~/OpenResearch/${Nv(i,48)}`:"",Jt=`~/OpenResearch/${Nv(i||(ce==null?void 0:ce.title)||(ce==null?void 0:ce.paperId)||"")}`,ht=r==="blank"&&!h?Nt:r==="paper"&&ce&&!h?Jt:d,it=xt??(r==="folder"&&(g!=null&&g.githubOwner)&&g.githubRepo?{owner:g.githubOwner,repo:g.githubRepo}:null);T.useEffect(()=>{yQe().then(({login:Xe})=>W(Xe)).catch(()=>W(null)),ay().then(Xe=>P(Xe.githubForNewProjects)).catch(()=>{})},[]),T.useEffect(()=>{let Xe=!0;L(!0);const ot=setTimeout(()=>{wQe(i.trim()).then(({repo:en})=>Xe&&U(en)).catch(()=>Xe&&U(Nv(i,48))).finally(()=>Xe&&L(!1))},150);return()=>{Xe=!1,clearTimeout(ot)}},[i]),T.useEffect(()=>{let Xe=!0;if(J(null),X(!!it),!!it)return SQe(it.owner,it.repo).then(({canPush:ot})=>{Xe&&ot&&J(`github.com/${it.owner}/${it.repo}`)}).catch(()=>{}).finally(()=>Xe&&X(!1)),()=>{Xe=!1}},[it==null?void 0:it.owner,it==null?void 0:it.repo]),T.useEffect(()=>{const Xe=++qe.current,ot=ht.trim();if(!ot){S(null),v(null),x(!1);return}x(!0),v(null);const en=setTimeout(()=>{bz(ot).then(Be=>{Xe===qe.current&&S(Be)}).catch(Be=>{Xe===qe.current&&(S(null),v(Be instanceof Error?Be.message:String(Be)))}).finally(()=>{Xe===qe.current&&x(!1)})},200);return()=>clearTimeout(en)},[r,ze,ht]),T.useEffect(()=>{const Xe=++Ie.current;if(r!=="paper"||ce){le(!1);return}const ot=V.trim(),en=wbt(ot);if(!en&&ot.length<3){G([]),ue(""),le(!1);return}z(null),le(!0),G([]),ue("");const Be=setTimeout(()=>{if(en){e2(en).then(Qe=>{var pn;Xe===Ie.current&&(oe(Qe),o||l(((pn=Qe.title)==null?void 0:pn.trim())||Qe.paperId))}).catch(Qe=>Xe===Ie.current&&z(Qe instanceof Error?Qe.message:String(Qe))).finally(()=>Xe===Ie.current&&le(!1));return}vz(ot).then(Qe=>{Xe===Ie.current&&(G(Qe),ue(ot))}).catch(Qe=>Xe===Ie.current&&z(Qe instanceof Error?Qe.message:String(Qe))).finally(()=>Xe===Ie.current&&le(!1))},350);return()=>clearTimeout(Be)},[r,ce,V,o]);async function et(Xe){var en;const ot=++Ie.current;le(!0),z(null);try{const Be=await e2(Xe);if(ot!==Ie.current)return;oe(Be),G([]),o||l(((en=Be.title)==null?void 0:en.trim())||Be.paperId)}catch(Be){ot===Ie.current&&z(Be instanceof Error?Be.message:String(Be))}finally{ot===Ie.current&&le(!1)}}function Pt(){Ie.current+=1,Fe.current+=1,oe(null),ae(""),G([]),ue(""),le(!1),C(!1),_(""),m(!1),Ot.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||l("")}function we(Xe){if(Xe===r)return;Ie.current+=1,Fe.current+=1,Ot.current[r]={name:i,nameTouched:o,path:d,pathTouched:h};const ot=Ot.current[Xe];s(Xe),z(null),v(null),S(null),le(!1),C(!1),l(ot.name),c(ot.nameTouched),_(ot.path),m(ot.pathTouched)}async function Oe(){if(y)return;const Xe=++Fe.current;C(!0),z(null);try{const ot=await vQe();if(Xe!==Fe.current||!ot)return;if(m(!0),S(null),x(!0),_(ot),Ne(en=>en+1),r==="folder"&&!o){const en=ot.replace(/[\\/]+$/,"").split(/[\\/]/).pop();en&&l(en)}}catch(ot){Xe===Fe.current&&z(ot instanceof Error?ot.message:String(ot))}finally{Xe===Fe.current&&C(!1)}}async function Je(Xe){if(Xe.preventDefault(),!!$n){N(!0),z(null);try{const ot=await xQe({name:i.trim(),path:ht.trim(),createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:$,locale:E(),...r==="paper"&&ce?{paperId:ce.paperId,cloneUrl:ce.repoUrl??void 0}:{}});e(ot.project,ot.githubPublicationError)}catch(ot){z(ot instanceof Error?ot.message:String(ot))}finally{N(!1)}}}const nt=i.trim(),De=r==="paper"&&ce&&!ce.repoUrl?ce.paperId:null,At=r==="folder"&&(g==null?void 0:g.gitState)==="ready"?g.resolvedPath??null:null,pt=nt!==""&&(r==="blank"||De!==null||At!==null);T.useEffect(()=>{if(!pt)return;const Xe=window.setTimeout(()=>{kQe({name:nt,paperId:De??void 0,path:At??void 0,locale:E()}).catch(()=>{})},1200);return()=>window.clearTimeout(Xe)},[pt,nt,De,At]);const It=(g==null?void 0:g.gitVersion)===null,nn=r==="folder"&&!!ht.trim()&&g!==null&&g.exists===!1,gn=r==="blank"&&(g==null?void 0:g.exists)===!0,Ct=!!ht.trim()&&(g==null?void 0:g.exists)===!0&&g.directory===!1,xn=r==="paper"&&!!(ce!=null&&ce.repoUrl)&&(g==null?void 0:g.empty)===!1,rn=r==="paper"&&!!ce&&!(ce!=null&&ce.repoUrl)&&(g==null?void 0:g.empty)===!1,lr=r==="folder"&&((g==null?void 0:g.gitState)==="detached"||(g==null?void 0:g.gitState)==="invalid"),_r=h&&!ht.trim()||Ct||xn||rn,Ln=h&&!ht.trim()||Ct||gn,Yn=h&&!ht.trim()?X7():Ct?V7():gn?qge():null,sn=h&&!ht.trim()?X7():Ct?V7():xn?$be():rn?dge():null,$n=!!(i.trim()&&ht.trim())&&!j&&!y&&!b&&g!==null&&!k&&!It&&!nn&&!gn&&!Ct&&!xn&&!rn&&!lr&&(r!=="paper"||!!ce)&&(!$||typeof F=="string"&&!H&&!B),Cn=Y??`github.com/${F??"you"}/${Z}`,mt=F===void 0||H||B,an=r==="paper"&&!ce&&V.trim().length>=3&&_e===V.trim()&&!ne&&se.length===0&&!M;return f.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:Je,children:[f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[f.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>we("blank"),children:Kge()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>we("folder"),children:g1e()}),f.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),f.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>we("paper"),children:C1e()})]}),r==="paper"&&!ce&&f.jsxs("label",{className:"!font-normal",children:[K1e(),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:V,onChange:Xe=>{z(null),ue(""),ae(Xe.target.value)},placeholder:sbe()}),!an&&f.jsx("span",{className:"repo-hint",children:ne?Zbe():Ube()}),an&&f.jsx("span",{className:"project-path-notice block",children:O1e()}),se.length>0&&f.jsx("div",{className:"paper-results",children:se.map(Xe=>f.jsxs("button",{type:"button",onClick:()=>void et(Xe.paperId),children:[f.jsx(_h,{children:Xe.title}),f.jsx("span",{className:"id",children:Xe.paperId})]},Xe.paperId))})]}),ce&&r==="paper"&&f.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[f.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[f.jsxs("div",{className:"meta",children:[f.jsx(_h,{className:"block",children:ce.title||ce.paperId}),ce.repoUrl&&f.jsx("div",{className:"id",children:kbt(ce.repoUrl)})]}),f.jsx(He,{size:"small",type:"button","aria-label":a1e(),onClick:Pt,children:n1e()})]}),!ce.repoUrl&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[f.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[f.jsx(nz,{size:16})," ",H1e()]}),f.jsx("span",{className:"text-sm font-normal text-accent-amber",children:q1e()})]})]}),(r!=="paper"||ce)&&f.jsxs(f.Fragment,{children:[r==="blank"&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:Y7()}),f.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:Xe=>{c(!0),l(Xe.target.value)},placeholder:K7()})]}),r==="paper"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:ce!=null&&ce.repoUrl?Ege():mb()}),f.jsx("input",{className:"text-sm font-normal",value:ht,onChange:Xe=>{m(!0),S(null),_(Xe.target.value)},"aria-describedby":_r?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),b&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:W7()}),_r&&f.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:sn})]}):r==="folder"&&!t?f.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":d?pge({path:Ee(d)}):q7(),disabled:y,title:d||void 0,onClick:()=>void Oe(),children:[f.jsx(sh,{className:d?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),f.jsx("span",{className:d?"text-sm":"placeholder",children:y?wge():d||q7()}),f.jsx(qa,{className:"folder-picker-chevron",size:15})]}):r==="folder"?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:mb()}),f.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:d,onChange:Xe=>{m(!0),S(null),_(Xe.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?f.jsxs("label",{className:"project-location-field",children:[f.jsx("span",{className:"project-location-label !font-medium",children:mb()}),f.jsx("input",{className:"text-sm font-normal",value:ht,onChange:Xe=>{m(!0),S(null),_(Xe.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":Ln?"blank-destination-description":void 0,spellCheck:!1}),b&&f.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:W7()}),Ln&&f.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Yn})]}):null,r!=="blank"&&ht&&f.jsxs("label",{className:"!font-normal",children:[f.jsx("span",{className:"project-field-label !font-medium",children:Y7()}),f.jsx("input",{className:"text-sm font-normal",value:i,onChange:Xe=>{c(!0),l(Xe.target.value)},placeholder:K7()})]}),It&&f.jsx("div",{className:"project-path-notice error",children:j1e()}),!It&&r==="folder"&&d.trim()&&!b&&(g==null?void 0:g.exists)===!1&&f.jsx("div",{className:"project-path-notice error",children:fbe()}),!It&&r==="folder"&&d.trim()&&!b&&Ct&&f.jsx("div",{className:"project-path-notice error",children:xbe()}),!It&&r==="folder"&&!b&&(g==null?void 0:g.gitState)==="detached"&&f.jsx("div",{className:"project-path-notice error",children:u1e()}),!It&&r==="folder"&&!b&&(g==null?void 0:g.gitState)==="invalid"&&f.jsx("div",{className:"project-path-notice error",children:mbe()}),k&&f.jsx("div",{className:"project-path-notice error",role:"alert",children:k})]}),M&&f.jsx("div",{className:"error",role:"alert",children:M}),(r!=="paper"||ce)&&ht&&(r!=="blank"||i.trim())&&f.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[f.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${$&&F===null?" text-accent-red":" text-text"}`,"aria-expanded":D,"aria-controls":"new-project-advanced-settings",onClick:()=>I(Xe=>!Xe),children:[$?F===null?rge():oge():Jme(),f.jsx(Ua,{className:D?"rotate-180":"",size:16})]}),D&&f.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[f.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[f.jsx("input",{className:"m-0",type:"checkbox",checked:$,onChange:Xe=>P(Xe.target.checked),disabled:j}),f.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:lbe()})]}),f.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[f.jsx("span",{children:mt?kbe({repository:Ee(Cn)}):Y?Mbe({repository:Ee(Cn)}):zbe({repository:Ee(Cn)})}),f.jsx("span",{children:y1e()}),F===null&&f.jsx("span",{children:Wbe({command:Ee("gh auth login")})})]})]})]}),f.jsxs("div",{className:"actions new-project-actions",children:[n&&f.jsx(He,{type:"button",onClick:n,children:Qge()}),f.jsx(He,{variant:"primary",className:"ms-auto",disabled:!$n,children:j?Ige():r==="paper"?ce!=null&&ce.repoUrl?Age():G7():r==="folder"?tve():G7()})]})]})}function $R({onClose:e,onCreated:n,remote:t=!1}){const r=T.useRef(null),s=T.useRef(e);return s.current=e,T.useEffect(()=>{const i=r.current;if(!i)return;const l=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const c=d=>{if(d.key==="Escape"){d.preventDefault(),d.stopPropagation(),s.current();return}if(d.key==="Enter"&&(d.metaKey||d.ctrlKey)&&!d.altKey&&d.shiftKey){d.preventDefault(),d.stopPropagation();return}if(d.key!=="Tab")return;const _=o();if(_.length===0){d.preventDefault(),i.focus();return}const h=_[0],m=_[_.length-1];d.shiftKey&&document.activeElement===h?(d.preventDefault(),m.focus()):!d.shiftKey&&document.activeElement===m&&(d.preventDefault(),h.focus())};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0),l==null||l.focus()}},[]),f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:f.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[f.jsx("h2",{id:"new-project-dialog-title",children:gN()}),f.jsx(Cbt,{onCancel:e,onCreated:n,remote:t})]})})}function Ebt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=T.useRef(null),l=T.useRef(r),o=T.useRef(n);l.current=r,o.current=n,T.useEffect(()=>{const d=i.current;if(!d)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,h=()=>[...d.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(h()[0]??d).focus();const m=g=>{if(g.key==="Escape"){g.preventDefault(),o.current||l.current();return}if(g.key!=="Tab")return;const S=h();if(S.length===0){g.preventDefault(),d.focus();return}const k=S[0],v=S[S.length-1];g.shiftKey&&document.activeElement===k?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),k.focus())};return document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("keydown",m,!0),_==null||_.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return f.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:d=>{!n&&d.target===d.currentTarget&&r()},children:f.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[f.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:W3e()}),f.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[f.jsx("p",{className:"m-0",children:z3e({name:Oa(e.name)})}),f.jsx("p",{className:"m-0",children:c?l6e():f6e()}),t&&f.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),f.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[f.jsx(He,{disabled:n,onClick:r,children:$3e()}),f.jsx(He,{variant:"danger",disabled:n,onClick:s,children:n?t6e():Z3e()})]})]})})}function v9(){return f.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function x9({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,l]=T.useState(!1),[o,c]=T.useState(null),[d,_]=T.useState(null),[h,m]=T.useState(null),[g,S]=T.useState({}),k=T.useRef(0),v=e.map(x=>x.id).join("\0");T.useEffect(()=>{let x=!0,y=null;const C=()=>{y=null;const M=++k.current;mQe().then(z=>{!x||M!==k.current||S(Object.fromEntries(z.map(D=>[D.projectId,D])))}).catch(()=>{})},j=()=>{y===null&&(y=setTimeout(C,100))};C();const N=yet(j);return()=>{x=!1,N(),y!==null&&clearTimeout(y)}},[v]);async function b(x){c(x.id),_(null);try{await NQe(x.id),_(null),m(null),r(x.id)}catch(y){_(y instanceof Error?y.message:String(y))}finally{c(null)}}return f.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[f.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[f.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[f.jsx("h2",{children:N6e()}),f.jsxs(He,{onClick:()=>l(!0),children:[f.jsx(ny,{size:15})," ",gN()]})]}),f.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:f.jsxs("div",{children:[f.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[f.jsx("span",{children:S6e()}),f.jsx("span",{children:sS()}),f.jsx("span",{children:iS()}),f.jsx("span",{children:aS()})]}),e.length===0?f.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:v6e()}):[...e].sort((x,y)=>{var N,M;const C=((N=g[x.id])==null?void 0:N.lastMessageAt)??x.createdAt;return(((M=g[y.id])==null?void 0:M.lastMessageAt)??y.createdAt)-C||x.name.localeCompare(y.name)}).map(x=>{const y=g[x.id],C=x.githubEnabled?x.githubUrl??(x.githubOwner&&x.githubRepo?`https://github.com/${x.githubOwner}/${x.githubRepo}`:null):null,j=C?x.githubOwner&&x.githubRepo?`${x.githubOwner}/${x.githubRepo}`:C.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):bN(),N=y?y.activeAgents>0?x3e({count:Gt(y.activeAgents)}):D6e():"—",M=y?y.totalAgents===1?P6e():k3e({count:Gt(y.totalAgents)}):"—",z=y?y.runningExperiments>0?G6e({count:Gt(y.runningExperiments)}):y.totalExperiments===0?Vx():oS({count:Gt(y.totalExperiments)}):"—",D=y&&y.runningExperiments>0?oS({count:Gt(y.totalExperiments)}):null;return f.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[f.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":BB({name:Oa(x.name)}),onClick:()=>n(x.id)}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:x.name}),f.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[f.jsxs("span",{children:[U3e()," ",Ba(x.createdAt)]}),x.paperId&&f.jsx("span",{"aria-hidden":"true",children:"·"}),x.paperId&&f.jsxs("span",{children:[L3e()," ",Ee(x.paperId)]}),f.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":qv({name:Oa(x.name)}),disabled:o===x.id,onClick:I=>{I.stopPropagation(),_(null),m(x)},children:f.jsx(Ed,{size:14})})]})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:sS()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[y&&y.activeAgents>0&&f.jsx(v9,{}),N]}),f.jsx("span",{className:"text-xs text-muted",children:M})]}),f.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:iS()}),f.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[y&&y.runningExperiments>0&&f.jsx(v9,{}),z]}),D&&f.jsx("span",{className:"text-xs text-muted",children:D})]}),f.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[f.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:aS()}),C?f.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:C,target:"_blank",rel:"noreferrer","aria-label":xp({name:Oa(x.name)}),children:[f.jsx("span",{className:"inline-flex shrink-0",children:f.jsx(Rm,{size:14})}),f.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:Ee(j)})]}):f.jsx("span",{className:"text-sm text-text pointer-events-none",children:j})]})]},x.id)})]})})]}),i&&f.jsx($R,{remote:s,onClose:()=>l(!1),onCreated:(x,y)=>{l(!1),t(x,y)}}),h&&f.jsx(Ebt,{project:h,deleting:o===h.id,error:d,onClose:()=>{_(null),m(null)},onConfirm:()=>void b(h)})]})}function Nbt({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:l}){const[o,c]=T.useState(new Set),[d,_]=T.useState(null),h=new Map;for(const S of e){const k=h.get(S.experimentId);k?k.push(S):h.set(S.experimentId,[S])}for(const S of h.values())S.sort((k,v)=>v.createdAt-k.createdAt);const m=[...n].sort((S,k)=>{var x,y,C,j;const v=((y=(x=h.get(S.id))==null?void 0:x[0])==null?void 0:y.createdAt)??S.createdAt;return(((j=(C=h.get(k.id))==null?void 0:C[0])==null?void 0:j.createdAt)??k.createdAt)-v});if(m.length===0)return f.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:f.jsx("p",{children:t??Oce()})});async function g(S){_(null),c(k=>new Set(k).add(S));try{await l(S)}catch(k){c(v=>{const b=new Set(v);return b.delete(S),b}),_(k instanceof Error?k.message:String(k))}}return f.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[d&&f.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[wue()," ",d]}),f.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":_ue(),children:m.map(S=>{const k=h.get(S.id)??[],v=k[0]??null,b=k.find(j=>j.status==="running"||j.status==="starting"),x=b??v,y=!!(b&&(b.cancelRequested||o.has(b.id))),C=b?y?"cancelling":Fi(b):v?Fi(v):"idle";return f.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(S,"preview"),onDoubleClick:()=>r(S,"keepOpen"),onAuxClick:j=>{j.button===1&&(j.preventDefault(),r(S,"keepOpen"))},children:[f.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[f.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...zr(j=>r(S,j),{stopPropagation:!0}),children:S.title||S.slug}),f.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:S.branchName,children:[f.jsx(om,{size:14,"aria-hidden":"true"}),f.jsx("code",{children:S.branchName})]})]}),f.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[f.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:f.jsx(zo,{status:C})}),f.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:f.jsx("span",{children:k.length===1?qce():Qce({count:Gt(k.length)})})}),f.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:f.jsx("span",{children:v?Ba(v.createdAt):Hce()})})]}),f.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":xI({name:S.title||S.slug}),onClick:j=>j.stopPropagation(),onDoubleClick:j=>j.stopPropagation(),onAuxClick:j=>j.stopPropagation(),children:[f.jsxs(He,{size:"small",disabled:!x,title:x?Kce():Mce(),...zr(j=>{x&&s(S.id,x.id,j)},{stopPropagation:!0}),children:[f.jsx(sd,{size:15}),bue()]}),f.jsxs(He,{size:"small",title:UE({branch:Ee(S.branchName)}),...zr(j=>i(S.id,j),{stopPropagation:!0}),children:[f.jsx(am,{size:15}),uue()]}),b&&f.jsxs(He,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:y,title:y?nue():aue(),onClick:()=>void g(b.id),children:[f.jsx(rz,{size:15}),y?Uie():nN()]})]})]},S.id)})})]})}function zbt({onClose:e,onCreateProject:n}){const[t,r]=T.useState(!1),[s,i]=T.useState(null),l=T.useRef(null),o=T.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(_We())).finally(()=>r(!1)))},[t]);return T.useEffect(()=>{const c=d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),o(e))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),T.useEffect(()=>{const c=l.current;if(!c)return;const d=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??c).focus();const h=m=>{if(m.key!=="Tab")return;const g=_();if(g.length===0){m.preventDefault(),c.focus();return}const S=g[0],k=g[g.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),k.focus()):!m.shiftKey&&document.activeElement===k&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",h,!0),()=>{document.removeEventListener("keydown",h,!0),d==null||d.focus()}},[]),Ro.createPortal(f.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:f.jsxs("div",{ref:l,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[f.jsx(qt,{className:"absolute end-3.5 top-3.5","aria-label":qVe(),onClick:()=>o(e),disabled:t,children:f.jsx(Br,{size:16})}),f.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[f.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:f.jsx(cy,{})}),f.jsxs("div",{children:[f.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:QVe()}),f.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:wWe()})]})]}),f.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[f.jsxs("p",{dir:"auto",children:[bWe()," ",f.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:uWe()}),HVe()]}),f.jsx("p",{dir:"auto",children:aWe()})]}),s&&f.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),f.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[f.jsx(He,{onClick:()=>o(n),disabled:t,children:KVe()}),f.jsx(He,{variant:"primary",onClick:()=>o(e),disabled:t,children:t?qi():nWe()})]})]})}),document.body)}function Ur(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function Qm(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}dp.prototype=Qm.prototype={constructor:dp,on:function(e,n){var t=this._,r=Abt(e+"",t),s,i=-1,l=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),w9.hasOwnProperty(n)?{space:w9[n],local:e}:e}function Mbt(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===wx&&n.documentElement.namespaceURI===wx?n.createElement(e):n.createElementNS(t,e)}}function Rbt(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function HR(e){var n=Jm(e);return(n.local?Rbt:Mbt)(n)}function Dbt(){}function ew(e){return e==null?Dbt:function(){return this.querySelector(e)}}function Lbt(e){typeof e!="function"&&(e=ew(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=y&&(y=x+1);!(j=v[y])&&++y=0;)(l=r[s])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function avt(e){e||(e=ovt);function n(h,m){return h&&m?e(h.__data__,m.__data__):!h-!m}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function lvt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cvt(){return Array.from(this)}function uvt(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?yvt:typeof n=="function"?Svt:wvt)(e,n,t??"")):bd(this.node(),e)}function bd(e,n){return e.style.getPropertyValue(n)||GR(e).getComputedStyle(e,null).getPropertyValue(n)}function Cvt(e){return function(){delete this[e]}}function Evt(e,n){return function(){this[e]=n}}function Nvt(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function zvt(e,n){return arguments.length>1?this.each((n==null?Cvt:typeof n=="function"?Nvt:Evt)(e,n)):this.node()[e]}function VR(e){return e.trim().split(/^|\s+/)}function tw(e){return e.classList||new WR(e)}function WR(e){this._node=e,this._names=VR(e.getAttribute("class")||"")}WR.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function KR(e,n){for(var t=tw(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function n2t(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function Sx(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:l,y:o,dx:c,dy:d,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:_}})}Sx.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function f2t(e){return!e.ctrlKey&&!e.button}function h2t(){return this.parentNode}function _2t(e,n){return n??{x:e.x,y:e.y}}function p2t(){return navigator.maxTouchPoints||"ontouchstart"in this}function eD(){var e=f2t,n=h2t,t=_2t,r=p2t,s={},i=Qm("start","drag","end"),l=0,o,c,d,_,h=0;function m(C){C.on("mousedown.drag",g).filter(r).on("touchstart.drag",v).on("touchmove.drag",b,d2t).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(C,j){if(!(_||!e.call(this,C,j))){var N=y(this,n.call(this,C,j),C,j,"mouse");N&&(_i(C.view).on("mousemove.drag",S,wh).on("mouseup.drag",k,wh),QR(C.view),zv(C),d=!1,o=C.clientX,c=C.clientY,N("start",C))}}function S(C){if(Ju(C),!d){var j=C.clientX-o,N=C.clientY-c;d=j*j+N*N>h}s.mouse("drag",C)}function k(C){_i(C.view).on("mousemove.drag mouseup.drag",null),JR(C.view,d),Ju(C),s.mouse("end",C)}function v(C,j){if(e.call(this,C,j)){var N=C.changedTouches,M=n.call(this,C,j),z=N.length,D,I;for(D=0;D>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?G0(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?G0(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=g2t.exec(e))?new Qs(n[1],n[2],n[3],1):(n=b2t.exec(e))?new Qs(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=v2t.exec(e))?G0(n[1],n[2],n[3],n[4]):(n=x2t.exec(e))?G0(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=y2t.exec(e))?j9(n[1],n[2]/100,n[3]/100,1):(n=w2t.exec(e))?j9(n[1],n[2]/100,n[3]/100,n[4]):S9.hasOwnProperty(e)?E9(S9[e]):e==="transparent"?new Qs(NaN,NaN,NaN,0):null}function E9(e){return new Qs(e>>16&255,e>>8&255,e&255,1)}function G0(e,n,t,r){return r<=0&&(e=n=t=NaN),new Qs(e,n,t,r)}function C2t(e){return e instanceof r_||(e=$c(e)),e?(e=e.rgb(),new Qs(e.r,e.g,e.b,e.opacity)):new Qs}function kx(e,n,t,r){return arguments.length===1?C2t(e):new Qs(e,n,t,r??1)}function Qs(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}nw(Qs,kx,tD(r_,{brighter(e){return e=e==null?Wp:Math.pow(Wp,e),new Qs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sh:Math.pow(Sh,e),new Qs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qs(Lc(this.r),Lc(this.g),Lc(this.b),Kp(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:N9,formatHex:N9,formatHex8:E2t,formatRgb:z9,toString:z9}));function N9(){return`#${zc(this.r)}${zc(this.g)}${zc(this.b)}`}function E2t(){return`#${zc(this.r)}${zc(this.g)}${zc(this.b)}${zc((isNaN(this.opacity)?1:this.opacity)*255)}`}function z9(){const e=Kp(this.opacity);return`${e===1?"rgb(":"rgba("}${Lc(this.r)}, ${Lc(this.g)}, ${Lc(this.b)}${e===1?")":`, ${e})`}`}function Kp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Lc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zc(e){return e=Lc(e),(e<16?"0":"")+e.toString(16)}function j9(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new na(e,n,t,r)}function nD(e){if(e instanceof na)return new na(e.h,e.s,e.l,e.opacity);if(e instanceof r_||(e=$c(e)),!e)return new na;if(e instanceof na)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),l=NaN,o=i-s,c=(i+s)/2;return o?(n===i?l=(t-r)/o+(t0&&c<1?0:l,new na(l,o,c,e.opacity)}function N2t(e,n,t,r){return arguments.length===1?nD(e):new na(e,n,t,r??1)}function na(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}nw(na,N2t,tD(r_,{brighter(e){return e=e==null?Wp:Math.pow(Wp,e),new na(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sh:Math.pow(Sh,e),new na(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new Qs(jv(e>=240?e-240:e+120,s,r),jv(e,s,r),jv(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new na(A9(this.h),V0(this.s),V0(this.l),Kp(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=Kp(this.opacity);return`${e===1?"hsl(":"hsla("}${A9(this.h)}, ${V0(this.s)*100}%, ${V0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function A9(e){return e=(e||0)%360,e<0?e+360:e}function V0(e){return Math.max(0,Math.min(1,e||0))}function jv(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const rw=e=>()=>e;function z2t(e,n){return function(t){return e+t*n}}function j2t(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function A2t(e){return(e=+e)==1?rD:function(n,t){return t-n?j2t(n,t,e):rw(isNaN(n)?t:n)}}function rD(e,n){var t=n-e;return t?z2t(e,t):rw(isNaN(e)?n:e)}const Yp=(function e(n){var t=A2t(n);function r(s,i){var l=t((s=kx(s)).r,(i=kx(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),d=rD(s.opacity,i.opacity);return function(_){return s.r=l(_),s.g=o(_),s.b=c(_),s.opacity=d(_),s+""}}return r.gamma=e,r})(1);function T2t(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[l]?o[l]+=i:o[++l]=i),(r=r[0])===(s=s[0])?o[l]?o[l]+=s:o[++l]=s:(o[++l]=null,c.push({i:l,x:Da(r,s)})),t=Av.lastIndex;return t180?_+=360:_-d>180&&(d+=360),m.push({i:h.push(s(h)+"rotate(",null,r)-2,x:Da(d,_)})):_&&h.push(s(h)+"rotate("+_+r)}function o(d,_,h,m){d!==_?m.push({i:h.push(s(h)+"skewX(",null,r)-2,x:Da(d,_)}):_&&h.push(s(h)+"skewX("+_+r)}function c(d,_,h,m,g,S){if(d!==h||_!==m){var k=g.push(s(g)+"scale(",null,",",null,")");S.push({i:k-4,x:Da(d,h)},{i:k-2,x:Da(_,m)})}else(h!==1||m!==1)&&g.push(s(g)+"scale("+h+","+m+")")}return function(d,_){var h=[],m=[];return d=e(d),_=e(_),i(d.translateX,d.translateY,_.translateX,_.translateY,h,m),l(d.rotate,_.rotate,h,m),o(d.skewX,_.skewX,h,m),c(d.scaleX,d.scaleY,_.scaleX,_.scaleY,h,m),d=_=null,function(g){for(var S=-1,k=m.length,v;++S=0&&e._call.call(void 0,n),e=e._next;--vd}function R9(){Hc=(Zp=Ch.now())+eg,vd=Uf=0;try{V2t()}finally{vd=0,K2t(),Hc=0}}function W2t(){var e=Ch.now(),n=e-Zp;n>oD&&(eg-=n,Zp=e)}function K2t(){for(var e,n=Xp,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Xp=t);qf=e,Nx(r)}function Nx(e){if(!vd){Uf&&(Uf=clearTimeout(Uf));var n=e-Hc;n>24?(e<1/0&&(Uf=setTimeout(R9,e-Ch.now()-eg)),Lf&&(Lf=clearInterval(Lf))):(Lf||(Zp=Ch.now(),Lf=setInterval(W2t,oD)),vd=1,lD(R9))}}function D9(e,n,t){var r=new Qp;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var Y2t=Qm("start","end","cancel","interrupt"),X2t=[],uD=0,L9=1,zx=2,hp=3,O9=4,jx=5,_p=6;function tg(e,n,t,r,s,i){var l=e.__transition;if(!l)e.__transition={};else if(t in l)return;Z2t(e,t,{name:n,index:r,group:s,on:Y2t,tween:X2t,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:uD})}function iw(e,n){var t=fa(e,n);if(t.state>uD)throw new Error("too late; already scheduled");return t}function Xa(e,n){var t=fa(e,n);if(t.state>hp)throw new Error("too late; already running");return t}function fa(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function Z2t(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=cD(i,0,t.time);function i(d){t.state=L9,t.timer.restart(l,t.delay,t.time),t.delay<=d&&l(d-t.delay)}function l(d){var _,h,m,g;if(t.state!==L9)return c();for(_ in r)if(g=r[_],g.name===t.name){if(g.state===hp)return D9(l);g.state===O9?(g.state=_p,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[_]):+_zx&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function Nxt(e,n,t){var r,s,i=Ext(n)?iw:Xa;return function(){var l=i(this,e),o=l.on;o!==r&&(s=(r=o).copy()).on(n,t),l.on=s}}function zxt(e,n){var t=this._id;return arguments.length<2?fa(this.node(),t).on.on(e):this.each(Nxt(t,e,n))}function jxt(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function Axt(){return this.on("end.remove",jxt(this._id))}function Txt(e){var n=this._name,t=this._id;typeof e!="function"&&(e=ew(e));for(var r=this._groups,s=r.length,i=new Array(s),l=0;l()=>e;function nyt(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Eo(e,n,t){this.k=e,this.x=n,this.y=t}Eo.prototype={constructor:Eo,scale:function(e){return e===1?this:new Eo(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Eo(this.k,this.x+this.k*e,this.y+this.k*n)},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 ng=new Eo(1,0,0);_D.prototype=Eo.prototype;function _D(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ng;return e.__zoom}function Tv(e){e.stopImmediatePropagation()}function Of(e){e.preventDefault(),e.stopImmediatePropagation()}function ryt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function syt(){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 I9(){return this.__zoom||ng}function iyt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ayt(){return navigator.maxTouchPoints||"ontouchstart"in this}function oyt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],l=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function pD(){var e=ryt,n=syt,t=oyt,r=iyt,s=ayt,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],o=250,c=fp,d=Qm("start","zoom","end"),_,h,m,g=500,S=150,k=0,v=10;function b(W){W.property("__zoom",I9).on("wheel.zoom",z,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",I).filter(s).on("touchstart.zoom",$).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(W,Z,U,Y){var J=W.selection?W.selection():W;J.property("__zoom",I9),W!==J?j(W,Z,U,Y):J.interrupt().each(function(){N(this,arguments).event(Y).start().zoom(null,typeof Z=="function"?Z.apply(this,arguments):Z).end()})},b.scaleBy=function(W,Z,U,Y){b.scaleTo(W,function(){var J=this.__zoom.k,H=typeof Z=="function"?Z.apply(this,arguments):Z;return J*H},U,Y)},b.scaleTo=function(W,Z,U,Y){b.transform(W,function(){var J=n.apply(this,arguments),H=this.__zoom,L=U==null?C(J):typeof U=="function"?U.apply(this,arguments):U,B=H.invert(L),X=typeof Z=="function"?Z.apply(this,arguments):Z;return t(y(x(H,X),L,B),J,l)},U,Y)},b.translateBy=function(W,Z,U,Y){b.transform(W,function(){return t(this.__zoom.translate(typeof Z=="function"?Z.apply(this,arguments):Z,typeof U=="function"?U.apply(this,arguments):U),n.apply(this,arguments),l)},null,Y)},b.translateTo=function(W,Z,U,Y,J){b.transform(W,function(){var H=n.apply(this,arguments),L=this.__zoom,B=Y==null?C(H):typeof Y=="function"?Y.apply(this,arguments):Y;return t(ng.translate(B[0],B[1]).scale(L.k).translate(typeof Z=="function"?-Z.apply(this,arguments):-Z,typeof U=="function"?-U.apply(this,arguments):-U),H,l)},Y,J)};function x(W,Z){return Z=Math.max(i[0],Math.min(i[1],Z)),Z===W.k?W:new Eo(Z,W.x,W.y)}function y(W,Z,U){var Y=Z[0]-U[0]*W.k,J=Z[1]-U[1]*W.k;return Y===W.x&&J===W.y?W:new Eo(W.k,Y,J)}function C(W){return[(+W[0][0]+ +W[1][0])/2,(+W[0][1]+ +W[1][1])/2]}function j(W,Z,U,Y){W.on("start.zoom",function(){N(this,arguments).event(Y).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(Y).end()}).tween("zoom",function(){var J=this,H=arguments,L=N(J,H).event(Y),B=n.apply(J,H),X=U==null?C(B):typeof U=="function"?U.apply(J,H):U,V=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),ae=J.__zoom,ce=typeof Z=="function"?Z.apply(J,H):Z,oe=c(ae.invert(X).concat(V/ae.k),ce.invert(X).concat(V/ce.k));return function(se){if(se===1)se=ce;else{var G=oe(se),ne=V/G[2];se=new Eo(ne,X[0]-G[0]*ne,X[1]-G[1]*ne)}L.zoom(null,se)}})}function N(W,Z,U){return!U&&W.__zooming||new M(W,Z)}function M(W,Z){this.that=W,this.args=Z,this.active=0,this.sourceEvent=null,this.extent=n.apply(W,Z),this.taps=0}M.prototype={event:function(W){return W&&(this.sourceEvent=W),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(W,Z){return this.mouse&&W!=="mouse"&&(this.mouse[1]=Z.invert(this.mouse[0])),this.touch0&&W!=="touch"&&(this.touch0[1]=Z.invert(this.touch0[0])),this.touch1&&W!=="touch"&&(this.touch1[1]=Z.invert(this.touch1[0])),this.that.__zoom=Z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(W){var Z=_i(this.that).datum();d.call(W,this.that,new nyt(W,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:d}),Z)}};function z(W,...Z){if(!e.apply(this,arguments))return;var U=N(this,Z).event(W),Y=this.__zoom,J=Math.max(i[0],Math.min(i[1],Y.k*Math.pow(2,r.apply(this,arguments)))),H=ea(W);if(U.wheel)(U.mouse[0][0]!==H[0]||U.mouse[0][1]!==H[1])&&(U.mouse[1]=Y.invert(U.mouse[0]=H)),clearTimeout(U.wheel);else{if(Y.k===J)return;U.mouse=[H,Y.invert(H)],pp(this),U.start()}Of(W),U.wheel=setTimeout(L,S),U.zoom("mouse",t(y(x(Y,J),U.mouse[0],U.mouse[1]),U.extent,l));function L(){U.wheel=null,U.end()}}function D(W,...Z){if(m||!e.apply(this,arguments))return;var U=W.currentTarget,Y=N(this,Z,!0).event(W),J=_i(W.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",V,!0),H=ea(W,U),L=W.clientX,B=W.clientY;QR(W.view),Tv(W),Y.mouse=[H,this.__zoom.invert(H)],pp(this),Y.start();function X(ae){if(Of(ae),!Y.moved){var ce=ae.clientX-L,oe=ae.clientY-B;Y.moved=ce*ce+oe*oe>k}Y.event(ae).zoom("mouse",t(y(Y.that.__zoom,Y.mouse[0]=ea(ae,U),Y.mouse[1]),Y.extent,l))}function V(ae){J.on("mousemove.zoom mouseup.zoom",null),JR(ae.view,Y.moved),Of(ae),Y.event(ae).end()}}function I(W,...Z){if(e.apply(this,arguments)){var U=this.__zoom,Y=ea(W.changedTouches?W.changedTouches[0]:W,this),J=U.invert(Y),H=U.k*(W.shiftKey?.5:2),L=t(y(x(U,H),Y,J),n.apply(this,Z),l);Of(W),o>0?_i(this).transition().duration(o).call(j,L,Y,W):_i(this).call(b.transform,L,Y,W)}}function $(W,...Z){if(e.apply(this,arguments)){var U=W.touches,Y=U.length,J=N(this,Z,W.changedTouches.length===Y).event(W),H,L,B,X;for(Tv(W),L=0;L`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} 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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},Eh=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],mD=["Enter"," ","Escape"],gD={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 xd;(function(e){e.Strict="strict",e.Loose="loose"})(xd||(xd={}));var Oc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Oc||(Oc={}));var Nh;(function(e){e.Partial="partial",e.Full="full"})(Nh||(Nh={}));const bD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var zl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zl||(zl={}));var Jp;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jp||(Jp={}));var bt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(bt||(bt={}));const B9={[bt.Left]:bt.Right,[bt.Right]:bt.Left,[bt.Top]:bt.Bottom,[bt.Bottom]:bt.Top};function vD(e){return e===null?null:e?"valid":"invalid"}const xD=e=>"id"in e&&"source"in e&&"target"in e,lyt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ow=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),s_=(e,n=[0,0])=>{const{width:t,height:r}=$o(e),s=e.origin??n,i=t*s[0],l=r*s[1];return{x:e.position.x-i,y:e.position.y-l}},cyt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let l=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(l=i?n.nodeLookup.get(s):ow(s)?s:n.nodeLookup.get(s.id));const o=l?em(l,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return rg(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return sg(t)},i_=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=rg(t,em(s)),r=!0)}),r?sg(t):{x:0,y:0,width:0,height:0}},lw=(e,n,[t,r,s]=[0,0,1],i=!1,l=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,d=n.width/s,_=n.height/s,h=[];for(const m of e.values()){const{measured:g,selectable:S=!0,hidden:k=!1}=m;if(l&&!S||k)continue;const v=g.width??m.width??m.initialWidth??0,b=g.height??m.height??m.initialHeight??0,{x,y}=m.internals.positionAbsolute,C=kD(o,c,d,_,x,y,v,b),j=v*b,N=i&&C>0;(!m.internals.handleBounds||N||C>=j||m.dragging)&&h.push(m)}return h},uyt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function dyt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function fyt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},l){if(e.size===0)return!0;const o=dyt(e,l),c=i_(o),d=uw(c,n,t,(l==null?void 0:l.minZoom)??s,(l==null?void 0:l.maxZoom)??i,(l==null?void 0:l.padding)??.1);return await r.setViewport(d,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function yD({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const l=t.get(e),o=l.parentId?t.get(l.parentId):void 0,{x:c,y:d}=o?o.internals.positionAbsolute:{x:0,y:0},_=l.origin??r;let h=l.extent||s;if(l.extent==="parent"&&!l.expandParent)if(!o)i==null||i("005",ca.error005());else{const g=o.measured.width,S=o.measured.height;g&&S&&(h=[[c,d],[c+g,d+S]])}else o&&Fc(l.extent)&&(h=[[l.extent[0][0]+c,l.extent[0][1]+d],[l.extent[1][0]+c,l.extent[1][1]+d]]);const m=Fc(h)?Pc(n,h,l.measured):n;return(l.measured.width===void 0||l.measured.height===void 0)&&(i==null||i("015",ca.error015())),{position:{x:m.x-c+(l.measured.width??0)*_[0],y:m.y-d+(l.measured.height??0)*_[1]},positionAbsolute:m}}async function hyt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(m=>m.id)),l=[];for(const m of t){if(m.deletable===!1)continue;const g=i.has(m.id),S=!g&&m.parentId&&l.find(k=>k.id===m.parentId);(g||S)&&l.push(m)}const o=new Set(n.map(m=>m.id)),c=r.filter(m=>m.deletable!==!1),_=uyt(l,c);for(const m of c)o.has(m.id)&&!_.find(S=>S.id===m.id)&&_.push(m);if(!s)return{edges:_,nodes:l};const h=await s({nodes:l,edges:_});return typeof h=="boolean"?h?{edges:_,nodes:l}:{edges:[],nodes:[]}:h}const yd=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),Pc=(e={x:0,y:0},n,t)=>({x:yd(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:yd(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function wD(e,n,t){const{width:r,height:s}=$o(t),{x:i,y:l}=t.internals.positionAbsolute;return Pc(e,[[i,l],[i+r,l+s]],n)}const $9=(e,n,t)=>et?-yd(Math.abs(e-t),1,n)/n:0,cw=(e,n,t=15,r=40)=>{const s=$9(e.x,r,n.width-r)*t,i=$9(e.y,r,n.height-r)*t;return[s,i]},rg=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Ax=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),sg=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),zh=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=ow(e)?e.internals.positionAbsolute:s_(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},em=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=ow(e)?e.internals.positionAbsolute:s_(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},SD=(e,n)=>sg(rg(Ax(e),Ax(n))),kD=(e,n,t,r,s,i,l,o)=>{const c=Math.max(0,Math.min(e+t,s+l)-Math.max(e,s)),d=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*d)},tm=(e,n)=>kD(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),H9=e=>ra(e.width)&&ra(e.height)&&ra(e.x)&&ra(e.y),ra=e=>!isNaN(e)&&isFinite(e),CD=(e,n)=>(t,r)=>{},a_=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),o_=({x:e,y:n},[t,r,s],i=!1,l=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?a_(o,l):o},wd=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Ru(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 _yt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Ru(e,t),s=Ru(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Ru(e.top??e.y??0,t),s=Ru(e.bottom??e.y??0,t),i=Ru(e.left??e.x??0,n),l=Ru(e.right??e.x??0,n);return{top:r,right:l,bottom:s,left:i,x:i+l,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function pyt(e,n,t,r,s,i){const{x:l,y:o}=wd(e,[n,t,r]),{x:c,y:d}=wd({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-c,h=i-d;return{left:Math.floor(l),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(h)}}const uw=(e,n,t,r,s,i)=>{const l=_yt(i,n,t),o=(n-l.x)/e.width,c=(t-l.y)/e.height,d=Math.min(o,c),_=yd(d,r,s),h=e.x+e.width/2,m=e.y+e.height/2,g=n/2-h*_,S=t/2-m*_,k=pyt(e,g,S,_,n,t),v={left:Math.min(k.left-l.left,0),top:Math.min(k.top-l.top,0),right:Math.min(k.right-l.right,0),bottom:Math.min(k.bottom-l.bottom,0)};return{x:g-v.left+v.right,y:S-v.top+v.bottom,zoom:_}},jh=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Fc(e){return e!=null&&e!=="parent"}function $o(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function ED(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function ND(e,n={width:0,height:0},t,r,s){const i={...e},l=r.get(t);if(l){const o=l.origin||s;i.x+=l.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=l.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function P9(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function myt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function gyt(e){return{...gD,...e||{}}}function Jf(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:l}=sa(e),o=o_({x:i-((s==null?void 0:s.left)??0),y:l-((s==null?void 0:s.top)??0)},r),{x:c,y:d}=t?a_(o,n):o;return{xSnapped:c,ySnapped:d,...o}}const dw=e=>({width:e.offsetWidth,height:e.offsetHeight}),zD=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},byt=["INPUT","SELECT","TEXTAREA"];function jD(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:byt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const AD=e=>"clientX"in e,sa=(e,n)=>{var i,l;const t=AD(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},F9=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(l=>{const o=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:s,position:l.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...dw(l)}})};function TD({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:l,targetControlY:o}){const c=e*.125+s*.375+l*.375+t*.125,d=n*.125+i*.375+o*.375+r*.125,_=Math.abs(c-e),h=Math.abs(d-n);return[c,d,_,h]}function Y0(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function U9({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case bt.Left:return[n-Y0(n-r,i),t];case bt.Right:return[n+Y0(r-n,i),t];case bt.Top:return[n,t-Y0(t-s,i)];case bt.Bottom:return[n,t+Y0(s-t,i)]}}function MD({sourceX:e,sourceY:n,sourcePosition:t=bt.Bottom,targetX:r,targetY:s,targetPosition:i=bt.Top,curvature:l=.25}){const[o,c]=U9({pos:t,x1:e,y1:n,x2:r,y2:s,c:l}),[d,_]=U9({pos:i,x1:r,y1:s,x2:e,y2:n,c:l}),[h,m,g,S]=TD({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:d,targetControlY:_});return[`M${e},${n} C${o},${c} ${d},${_} ${r},${s}`,h,m,g,S]}function RD({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const yyt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,wyt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Syt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",ca.error006()),n;const r=t.getEdgeId||yyt;let s;return xD(e)?s={...e}:s={...e,id:r(e)},wyt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function DD({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,l,o]=RD({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,l,o]}const q9={[bt.Left]:{x:-1,y:0},[bt.Right]:{x:1,y:0},[bt.Top]:{x:0,y:-1},[bt.Bottom]:{x:0,y:1}},kyt=({source:e,sourcePosition:n=bt.Bottom,target:t})=>n===bt.Left||n===bt.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function Cyt({source:e,sourcePosition:n=bt.Bottom,target:t,targetPosition:r=bt.Top,center:s,offset:i,stepPosition:l}){const o=q9[n],c=q9[r],d={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+c.x*i,y:t.y+c.y*i},h=kyt({source:d,sourcePosition:n,target:_}),m=h.x!==0?"x":"y",g=h[m];let S=[],k,v;const b={x:0,y:0},x={x:0,y:0},[,,y,C]=RD({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[m]*c[m]===-1){m==="x"?(k=s.x??d.x+(_.x-d.x)*l,v=s.y??(d.y+_.y)/2):(k=s.x??(d.x+_.x)/2,v=s.y??d.y+(_.y-d.y)*l);const z=[{x:k,y:d.y},{x:k,y:_.y}],D=[{x:d.x,y:v},{x:_.x,y:v}];o[m]===g?S=m==="x"?z:D:S=m==="x"?D:z}else{const z=[{x:d.x,y:_.y}],D=[{x:_.x,y:d.y}];if(m==="x"?S=o.x===g?D:z:S=o.y===g?z:D,n===r){const W=Math.abs(e[m]-t[m]);if(W<=i){const Z=Math.min(i-1,i-W);o[m]===g?b[m]=(d[m]>e[m]?-1:1)*Z:x[m]=(_[m]>t[m]?-1:1)*Z}}if(n!==r){const W=m==="x"?"y":"x",Z=o[m]===c[W],U=d[W]>_[W],Y=d[W]<_[W];(o[m]===1&&(!Z&&U||Z&&Y)||o[m]!==1&&(!Z&&Y||Z&&U))&&(S=m==="x"?z:D)}const I={x:d.x+b.x,y:d.y+b.y},$={x:_.x+x.x,y:_.y+x.y},P=Math.max(Math.abs(I.x-S[0].x),Math.abs($.x-S[0].x)),F=Math.max(Math.abs(I.y-S[0].y),Math.abs($.y-S[0].y));P>=F?(k=(I.x+$.x)/2,v=S[0].y):(k=S[0].x,v=(I.y+$.y)/2)}const j={x:d.x+b.x,y:d.y+b.y},N={x:_.x+x.x,y:_.y+x.y};return[[e,...j.x!==S[0].x||j.y!==S[0].y?[j]:[],...S,...N.x!==S[S.length-1].x||N.y!==S[S.length-1].y?[N]:[],t],k,v,y,C]}function Eyt(e,n,t,r){const s=Math.min(G9(e,n)/2,G9(n,t)/2,r),{x:i,y:l}=n;if(e.x===i&&i===t.x||e.y===l&&l===t.y)return`L${i} ${l}`;if(e.y===l){const d=e.xt.id===n):e[0])||null}function Mx(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function zyt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((l,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const d=Mx(c,n);i.has(d)||(l.push({id:d,color:c.color||t,...c}),i.add(d))}}),l),[]).sort((l,o)=>l.id.localeCompare(o.id))}const LD=1e3,jyt=10,fw={nodeOrigin:[0,0],nodeExtent:Eh,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Ayt={...fw,checkEquality:!0};function hw(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function Tyt(e,n,t){const r=hw(fw,t);for(const s of e.values())if(s.parentId)pw(s,e,n,r);else{const i=s_(s,r.nodeOrigin),l=Fc(s.extent)?s.extent:r.nodeExtent,o=Pc(i,l,$o(s));s.internals.positionAbsolute=o}}function Myt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function _w(e){return e==="manual"}function Rx(e,n,t,r={}){var _,h;const s=hw(Ayt,r),i={i:0},l=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!_w(s.zIndexMode)?LD:0;let c=e.length>0,d=!1;n.clear(),t.clear();for(const m of e){let g=l.get(m.id);if(s.checkEquality&&m===(g==null?void 0:g.internals.userNode))n.set(m.id,g);else{const S=s_(m,s.nodeOrigin),k=Fc(m.extent)?m.extent:s.nodeExtent,v=Pc(S,k,$o(m));g={...s.defaults,...m,measured:{width:(_=m.measured)==null?void 0:_.width,height:(h=m.measured)==null?void 0:h.height},internals:{positionAbsolute:v,handleBounds:Myt(m,g),z:OD(m,o,s.zIndexMode),userNode:m}},n.set(m.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(c=!1),m.parentId&&pw(g,n,t,r,i),d||(d=m.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:d}}function Ryt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function pw(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:l,nodeExtent:o,zIndexMode:c}=hw(fw,r),d=e.parentId,_=n.get(d);if(!_){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Ryt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&c==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*jyt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const h=i&&!_w(c)?LD:0,{x:m,y:g,z:S}=Dyt(e,_,l,o,h,c),{positionAbsolute:k}=e.internals,v=m!==k.x||g!==k.y;(v||S!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:m,y:g}:k,z:S}})}function OD(e,n,t){const r=ra(e.zIndex)?e.zIndex:0;return _w(t)?r:r+(e.selected?n:0)}function Dyt(e,n,t,r,s,i){const{x:l,y:o}=n.internals.positionAbsolute,c=$o(e),d=s_(e,t),_=Fc(e.extent)?Pc(d,e.extent,c):d;let h=Pc({x:l+_.x,y:o+_.y},r,c);e.extent==="parent"&&(h=wD(h,c,n));const m=OD(e,s,i),g=n.internals.z??0;return{x:h.x,y:h.y,z:g>=m?g+1:m}}function mw(e,n,t,r=[0,0]){var l;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const d=((l=i.get(o.parentId))==null?void 0:l.expandedRect)??zh(c),_=SD(d,o.rect);i.set(o.parentId,{expandedRect:_,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},d)=>{var y;const _=c.internals.positionAbsolute,h=$o(c),m=c.origin??r,g=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,S=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,k=Math.max(h.width,Math.round(o.width)),v=Math.max(h.height,Math.round(o.height)),b=(k-h.width)*m[0],x=(v-h.height)*m[1];(g>0||S>0||b||x)&&(s.push({id:d,type:"position",position:{x:c.position.x-g+b,y:c.position.y-S+x}}),(y=t.get(d))==null||y.forEach(C=>{e.some(j=>j.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+g,y:C.position.y+S}})})),(h.width0){const g=mw(m,n,t,s);d.push(...g)}return{changes:d,updatedInternals:c}}async function Oyt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const l=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!l&&(l.x!==t[0]||l.y!==t[1]||l.k!==t[2])}function Y9(e,n,t,r,s,i){let l=s;const o=r.get(l)||new Map;r.set(l,o.set(t,n)),l=`${s}-${e}`;const c=r.get(l)||new Map;if(r.set(l,c.set(t,n)),i){l=`${s}-${e}-${i}`;const d=r.get(l)||new Map;r.set(l,d.set(t,n))}}function ID(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:l=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:l,targetHandle:o},d=`${s}-${l}--${i}-${o}`,_=`${i}-${o}--${s}-${l}`;Y9("source",c,_,e,s,l),Y9("target",c,d,e,i,o),n.set(r.id,r)}}function BD(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:BD(t,n):!1}function X9(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Iyt(e,n,t,r){const s=new Map;for(const[i,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!BD(l,e))&&(l.draggable||n&&typeof l.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.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 s}function Mv({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var l,o,c;const s=[];for(const[d,_]of n){const h=(l=t.get(d))==null?void 0:l.internals.userNode;h&&s.push({...h,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function Byt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},l=a_(i,n);return{x:l.x-i.x,y:l.y-i.y}}function $yt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},l=0,o=new Map,c=!1,d={x:0,y:0},_=null,h=!1,m=null,g=!1,S=!1,k=null;function v({noDragClassName:x,handleSelector:y,domNode:C,isSelectable:j,nodeId:N,nodeClickDistance:M=0}){m=_i(C);function z({x:P,y:F}){const{nodeLookup:W,nodeExtent:Z,snapGrid:U,snapToGrid:Y,nodeOrigin:J,onNodeDrag:H,onSelectionDrag:L,onError:B,updateNodePositions:X}=n();i={x:P,y:F};let V=!1;const ae=o.size>1,ce=ae&&Z?Ax(i_(o)):null,oe=ae&&Y?Byt({dragItems:o,snapGrid:U,x:P,y:F}):null;for(const[se,G]of o){if(!W.has(se))continue;let ne={x:P-G.distance.x,y:F-G.distance.y};Y&&(ne=oe?{x:Math.round(ne.x+oe.x),y:Math.round(ne.y+oe.y)}:a_(ne,U));let le=null;if(ae&&Z&&!G.extent&&ce){const{positionAbsolute:ze}=G.internals,Ne=ze.x-ce.x+Z[0][0],Ie=ze.x+G.measured.width-ce.x2+Z[1][0],qe=ze.y-ce.y+Z[0][1],Fe=ze.y+G.measured.height-ce.y2+Z[1][1];le=[[Ne,qe],[Ie,Fe]]}const{position:_e,positionAbsolute:ue}=yD({nodeId:se,nextPosition:ne,nodeLookup:W,nodeExtent:le||Z,nodeOrigin:J,onError:B});V=V||G.position.x!==_e.x||G.position.y!==_e.y,G.position=_e,G.internals.positionAbsolute=ue}if(S=S||V,!!V&&(X(o,!0),k&&(r||H||!N&&L))){const[se,G]=Mv({nodeId:N,dragItems:o,nodeLookup:W});r==null||r(k,o,se,G),H==null||H(k,se,G),N||L==null||L(k,G)}}async function D(){if(!_)return;const{transform:P,panBy:F,autoPanSpeed:W,autoPanOnNodeDrag:Z}=n();if(!Z){c=!1,cancelAnimationFrame(l);return}const[U,Y]=cw(d,_,W);(U!==0||Y!==0)&&(i.x=(i.x??0)-U/P[2],i.y=(i.y??0)-Y/P[2],await F({x:U,y:Y})&&z(i)),l=requestAnimationFrame(D)}function I(P){var ae;const{nodeLookup:F,multiSelectionActive:W,nodesDraggable:Z,transform:U,snapGrid:Y,snapToGrid:J,selectNodesOnDrag:H,onNodeDragStart:L,onSelectionDragStart:B,unselectNodesAndEdges:X}=n();h=!0,(!H||!j)&&!W&&N&&((ae=F.get(N))!=null&&ae.selected||X()),j&&H&&N&&(e==null||e(N));const V=Jf(P.sourceEvent,{transform:U,snapGrid:Y,snapToGrid:J,containerBounds:_});if(i=V,o=Iyt(F,Z,V,N),o.size>0&&(t||L||!N&&B)){const[ce,oe]=Mv({nodeId:N,dragItems:o,nodeLookup:F});t==null||t(P.sourceEvent,o,ce,oe),L==null||L(P.sourceEvent,ce,oe),N||B==null||B(P.sourceEvent,oe)}}const $=eD().clickDistance(M).on("start",P=>{const{domNode:F,nodeDragThreshold:W,transform:Z,snapGrid:U,snapToGrid:Y}=n();_=(F==null?void 0:F.getBoundingClientRect())||null,g=!1,S=!1,k=P.sourceEvent,W===0&&I(P),i=Jf(P.sourceEvent,{transform:Z,snapGrid:U,snapToGrid:Y,containerBounds:_}),d=sa(P.sourceEvent,_)}).on("drag",P=>{const{autoPanOnNodeDrag:F,transform:W,snapGrid:Z,snapToGrid:U,nodeDragThreshold:Y,nodeLookup:J}=n(),H=Jf(P.sourceEvent,{transform:W,snapGrid:Z,snapToGrid:U,containerBounds:_});if(k=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||N&&!J.has(N))&&(g=!0),!g){if(!c&&F&&h&&(c=!0,D()),!h){const L=sa(P.sourceEvent,_),B=L.x-d.x,X=L.y-d.y;Math.sqrt(B*B+X*X)>Y&&I(P)}(i.x!==H.xSnapped||i.y!==H.ySnapped)&&o&&h&&(d=sa(P.sourceEvent,_),z(H))}}).on("end",P=>{if(!h||g){g&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,h=!1,cancelAnimationFrame(l),o.size>0){const{nodeLookup:F,updateNodePositions:W,onNodeDragStop:Z,onSelectionDragStop:U}=n();if(S&&(W(o,!1),S=!1),s||Z||!N&&U){const[Y,J]=Mv({nodeId:N,dragItems:o,nodeLookup:F,dragging:!1});s==null||s(P.sourceEvent,o,Y,J),Z==null||Z(P.sourceEvent,Y,J),N||U==null||U(P.sourceEvent,J)}}}).filter(P=>{const F=P.target;return!P.button&&(!x||!X9(F,`.${x}`,C))&&(!y||X9(F,y,C))});m.call($)}function b(){m==null||m.on(".drag",null)}return{update:v,destroy:b}}function Hyt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())tm(s,zh(i))>0&&r.push(i);return r}const Pyt=250;function Fyt(e,n,t,r){var o,c;let s=[],i=1/0;const l=Hyt(e,t,n+Pyt);for(const d of l){const _=[...((o=d.internals.handleBounds)==null?void 0:o.source)??[],...((c=d.internals.handleBounds)==null?void 0:c.target)??[]];for(const h of _){if(r.nodeId===h.nodeId&&r.type===h.type&&r.id===h.id)continue;const{x:m,y:g}=Uc(d,h,h.position,!0),S=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(g-e.y,2));S>n||(S1){const d=r.type==="source"?"target":"source";return s.find(_=>_.type===d)??s[0]}return s[0]}function $D(e,n,t,r,s,i=!1){var d,_,h;const l=r.get(e);if(!l)return null;const o=s==="strict"?(d=l.internals.handleBounds)==null?void 0:d[n]:[...((_=l.internals.handleBounds)==null?void 0:_.source)??[],...((h=l.internals.handleBounds)==null?void 0:h.target)??[]],c=(t?o==null?void 0:o.find(m=>m.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...Uc(l,c,c.position,!0)}:c}function HD(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Uyt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const PD=()=>!0;function qyt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:l,domNode:o,nodeLookup:c,lib:d,autoPanOnConnect:_,flowId:h,panBy:m,cancelConnection:g,onConnectStart:S,onConnect:k,onConnectEnd:v,isValidConnection:b=PD,onReconnectEnd:x,updateConnection:y,getTransform:C,getFromHandle:j,autoPanSpeed:N,dragThreshold:M=1,handleDomNode:z}){const D=zD(e.target);let I=0,$;const{x:P,y:F}=sa(e),W=HD(i,z),Z=o==null?void 0:o.getBoundingClientRect();let U=!1;if(!Z||!W)return;const Y=$D(s,W,r,c,n);if(!Y)return;let J=sa(e,Z),H=!1,L=null,B=!1,X=null;function V(){if(!_||!Z)return;const[_e,ue]=cw(J,Z,N);m({x:_e,y:ue}),I=requestAnimationFrame(V)}const ae={...Y,nodeId:s,type:W,position:Y.position},ce=c.get(s);let se={inProgress:!0,isValid:null,from:Uc(ce,ae,bt.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:ce,to:J,toHandle:null,toPosition:B9[ae.position],toNode:null,pointer:J};function G(){U=!0,y(se),S==null||S(e,{nodeId:s,handleId:r,handleType:W})}M===0&&G();function ne(_e){if(!U){const{x:Fe,y:Ot}=sa(_e),xt=Fe-P,Nt=Ot-F;if(!(xt*xt+Nt*Nt>M*M))return;G()}if(!j()||!ae){le(_e);return}const ue=C();J=sa(_e,Z),$=Fyt(o_(J,ue,!1,[1,1]),t,c,ae),H||(V(),H=!0);const ze=FD(_e,{handle:$,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:l?"target":"source",isValidConnection:b,doc:D,lib:d,flowId:h,nodeLookup:c});X=ze.handleDomNode,L=ze.connection,B=Uyt(!!$,ze.isValid);const Ne=c.get(s),Ie=Ne?Uc(Ne,ae,bt.Left,!0):se.from,qe={...se,from:Ie,isValid:B,to:ze.toHandle&&B?wd({x:ze.toHandle.x,y:ze.toHandle.y},ue):J,toHandle:ze.toHandle,toPosition:B&&ze.toHandle?ze.toHandle.position:B9[ae.position],toNode:ze.toHandle?c.get(ze.toHandle.nodeId):null,pointer:J};y(qe),se=qe}function le(_e){if(!("touches"in _e&&_e.touches.length>0)){if(U){($||X)&&L&&B&&(k==null||k(L));const{inProgress:ue,...ze}=se,Ne={...ze,toPosition:se.toHandle?se.toPosition:null};v==null||v(_e,Ne),i&&(x==null||x(_e,Ne))}g(),cancelAnimationFrame(I),H=!1,B=!1,L=null,X=null,D.removeEventListener("mousemove",ne),D.removeEventListener("mouseup",le),D.removeEventListener("touchmove",ne),D.removeEventListener("touchend",le)}}D.addEventListener("mousemove",ne),D.addEventListener("mouseup",le),D.addEventListener("touchmove",ne),D.addEventListener("touchend",le)}function FD(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:l,lib:o,flowId:c,isValidConnection:d=PD,nodeLookup:_}){const h=i==="target",m=n?l.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:g,y:S}=sa(e),k=l.elementFromPoint(g,S),v=k!=null&&k.classList.contains(`${o}-flow__handle`)?k:m,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const x=HD(void 0,v),y=v.getAttribute("data-nodeid"),C=v.getAttribute("data-handleid"),j=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!y||!x)return b;const M={source:h?y:r,sourceHandle:h?C:s,target:h?r:y,targetHandle:h?s:C};b.connection=M;const D=j&&N&&(t===xd.Strict?h&&x==="source"||!h&&x==="target":y!==r||C!==s);b.isValid=D&&d(M),b.toHandle=$D(y,x,C,_,t,!0)}return b}const Dx={onPointerDown:qyt,isValid:FD};function Gyt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=_i(e);function i({translateExtent:o,width:c,height:d,zoomStep:_=1,pannable:h=!0,zoomable:m=!0,inversePan:g=!1}){const S=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const C=t(),j=y.sourceEvent.ctrlKey&&jh()?10:1,N=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*_,M=C[2]*Math.pow(2,N*j);n.scaleTo(M)};let k=[0,0];const v=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(k=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},b=y=>{const C=t();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const j=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],N=[j[0]-k[0],j[1]-k[1]];k=j;const M=r()*Math.max(C[2],Math.log(C[2]))*(g?-1:1),z={x:C[0]-N[0]*M,y:C[1]-N[1]*M},D=[[0,0],[c,d]];n.setViewportConstrained({x:z.x,y:z.y,zoom:C[2]},D,o)},x=pD().on("start",v).on("zoom",h?b:null).on("zoom.wheel",m?S:null);s.call(x,{})}function l(){s.on("zoom",null)}return{update:i,destroy:l,pointer:ea}}const ig=e=>({x:e.x,y:e.y,zoom:e.k}),Rv=({x:e,y:n,zoom:t})=>ng.translate(e,n).scale(t),Vu=(e,n)=>e.target.closest(`.${n}`),UD=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Vyt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Dv=(e,n=0,t=Vyt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},qD=e=>{const n=e.ctrlKey&&jh()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function Wyt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:d}){return _=>{if(Vu(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const h=t.property("__zoom").k||1;if(_.ctrlKey&&l){const v=ea(_),b=qD(_),x=h*Math.pow(2,b);r.scaleTo(t,x,v,_);return}const m=_.deltaMode===1?20:1;let g=s===Oc.Vertical?0:_.deltaX*m,S=s===Oc.Horizontal?0:_.deltaY*m;!jh()&&_.shiftKey&&s!==Oc.Vertical&&(g=_.deltaY*m,S=0),r.translateBy(t,-(g/h)*i,-(S/h)*i,{internal:!0});const k=ig(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(_,k),e.panScrollTimeout=setTimeout(()=>{d==null||d(_,k),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,k))}}function Kyt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",l=!n&&i&&!r.ctrlKey,o=Vu(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),l||o)return null;r.preventDefault(),t.call(this,r,s)}}function Yyt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,l,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=ig(r.transform);e.mouseButton=((l=r.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function Xyt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var l,o;e.usedRightMouseButton=!!(t&&UD(n,e.mouseButton??0)),(l=i.sourceEvent)!=null&&l.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,ig(i.transform)))}}function Zyt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return l=>{var o;if(!((o=l.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&UD(n,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=ig(l.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(l.sourceEvent,c)},t?150:0)}}}function Qyt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:o,noPanClassName:c,lib:d,connectionInProgress:_}){return h=>{var v;const m=e||n,g=t&&h.ctrlKey,S=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(Vu(h,`${d}-flow__node`)||Vu(h,`${d}-flow__edge`)))return!0;if(!r&&!m&&!s&&!i&&!t||l||_&&!S||Vu(h,o)&&S||Vu(h,c)&&(!S||s&&S&&!e)||!t&&h.ctrlKey&&S)return!1;if(!t&&h.type==="touchstart"&&((v=h.touches)==null?void 0:v.length)>1)return h.preventDefault(),!1;if(!m&&!s&&!g&&S||!r&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(r)&&!r.includes(h.button)&&h.type==="mousedown")return!1;const k=Array.isArray(r)&&r.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||S)&&k}}function Jyt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:o,onDraggingChange:c}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),h=pD().scaleExtent([n,t]).translateExtent(r),m=_i(e).call(h);x({x:s.x,y:s.y,zoom:yd(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const g=m.on("wheel.zoom"),S=m.on("dblclick.zoom");h.wheelDelta(qD);async function k($,P){return m?new Promise(F=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?Qf:fp).transform(Dv(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>F(!0)),$)}):!1}function v({noWheelClassName:$,noPanClassName:P,onPaneContextMenu:F,userSelectionActive:W,panOnScroll:Z,panOnDrag:U,panOnScrollMode:Y,panOnScrollSpeed:J,preventScrolling:H,zoomOnPinch:L,zoomOnScroll:B,zoomOnDoubleClick:X,zoomActivationKeyPressed:V,lib:ae,onTransformChange:ce,connectionInProgress:oe,paneClickDistance:se,selectionOnDrag:G}){W&&!d.isZoomingOrPanning&&b();const ne=Z&&!V&&!W;h.clickDistance(G?1/0:!ra(se)||se<0?0:se);const le=ne?Wyt({zoomPanValues:d,noWheelClassName:$,d3Selection:m,d3Zoom:h,panOnScrollMode:Y,panOnScrollSpeed:J,zoomOnPinch:L,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:o}):Kyt({noWheelClassName:$,preventScrolling:H,d3ZoomHandler:g});m.on("wheel.zoom",le,{passive:!1});const _e=Yyt({zoomPanValues:d,onDraggingChange:c,onPanZoomStart:l});h.on("start",_e);const ue=Xyt({zoomPanValues:d,panOnDrag:U,onPaneContextMenu:!!F,onPanZoom:i,onTransformChange:ce});h.on("zoom",ue);const ze=Zyt({zoomPanValues:d,panOnDrag:U,panOnScroll:Z,onPaneContextMenu:F,onPanZoomEnd:o,onDraggingChange:c});h.on("end",ze);const Ne=Qyt({zoomActivationKeyPressed:V,panOnDrag:U,zoomOnScroll:B,panOnScroll:Z,zoomOnDoubleClick:X,zoomOnPinch:L,userSelectionActive:W,noPanClassName:P,noWheelClassName:$,lib:ae,connectionInProgress:oe});h.filter(Ne),X?m.on("dblclick.zoom",S):m.on("dblclick.zoom",null)}function b(){h.on("zoom",null)}async function x($,P,F){const W=Rv($),Z=h==null?void 0:h.constrain()(W,P,F);return Z&&await k(Z),Z}async function y($,P){const F=Rv($);return await k(F,P),F}function C($){if(m){const P=Rv($),F=m.property("__zoom");(F.k!==$.zoom||F.x!==$.x||F.y!==$.y)&&(h==null||h.transform(m,P,null,{sync:!0}))}}function j(){const $=m?_D(m.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}async function N($,P){return m?new Promise(F=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?Qf:fp).scaleTo(Dv(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>F(!0)),$)}):!1}async function M($,P){return m?new Promise(F=>{h==null||h.interpolate((P==null?void 0:P.interpolate)==="linear"?Qf:fp).scaleBy(Dv(m,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>F(!0)),$)}):!1}function z($){h==null||h.scaleExtent($)}function D($){h==null||h.translateExtent($)}function I($){const P=!ra($)||$<0?0:$;h==null||h.clickDistance(P)}return{update:v,destroy:b,setViewport:y,setViewportConstrained:x,getViewport:j,scaleTo:N,scaleBy:M,setScaleExtent:z,setTranslateExtent:D,syncViewport:C,setClickDistance:I}}var Sd;(function(e){e.Line="line",e.Handle="handle"})(Sd||(Sd={}));function e4t({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const l=e-n,o=t-r,c=[l>0?1:l<0?-1:0,o>0?1:o<0?-1:0];return l&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function Z9(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function El(e,n){return Math.max(0,n-e)}function Nl(e,n){return Math.max(0,e-n)}function X0(e,n,t){return Math.max(0,n-e,e-t)}function Q9(e,n){return e?!n:n}function t4t(e,n,t,r,s,i,l,o){let{affectsX:c,affectsY:d}=n;const{isHorizontal:_,isVertical:h}=n,m=_&&h,{xSnapped:g,ySnapped:S}=t,{minWidth:k,maxWidth:v,minHeight:b,maxHeight:x}=r,{x:y,y:C,width:j,height:N,aspectRatio:M}=e;let z=Math.floor(_?g-e.pointerX:0),D=Math.floor(h?S-e.pointerY:0);const I=j+(c?-z:z),$=N+(d?-D:D),P=-i[0]*j,F=-i[1]*N;let W=X0(I,k,v),Z=X0($,b,x);if(l){let J=0,H=0;c&&z<0?J=El(y+z+P,l[0][0]):!c&&z>0&&(J=Nl(y+I+P,l[1][0])),d&&D<0?H=El(C+D+F,l[0][1]):!d&&D>0&&(H=Nl(C+$+F,l[1][1])),W=Math.max(W,J),Z=Math.max(Z,H)}if(o){let J=0,H=0;c&&z>0?J=Nl(y+z,o[0][0]):!c&&z<0&&(J=El(y+I,o[1][0])),d&&D>0?H=Nl(C+D,o[0][1]):!d&&D<0&&(H=El(C+$,o[1][1])),W=Math.max(W,J),Z=Math.max(Z,H)}if(s){if(_){const J=X0(I/M,b,x)*M;if(W=Math.max(W,J),l){let H=0;!c&&!d||c&&!d&&m?H=Nl(C+F+I/M,l[1][1])*M:H=El(C+F+(c?z:-z)/M,l[0][1])*M,W=Math.max(W,H)}if(o){let H=0;!c&&!d||c&&!d&&m?H=El(C+I/M,o[1][1])*M:H=Nl(C+(c?z:-z)/M,o[0][1])*M,W=Math.max(W,H)}}if(h){const J=X0($*M,k,v)/M;if(Z=Math.max(Z,J),l){let H=0;!c&&!d||d&&!c&&m?H=Nl(y+$*M+P,l[1][0])/M:H=El(y+(d?D:-D)*M+P,l[0][0])/M,Z=Math.max(Z,H)}if(o){let H=0;!c&&!d||d&&!c&&m?H=El(y+$*M,o[1][0])/M:H=Nl(y+(d?D:-D)*M,o[0][0])/M,Z=Math.max(Z,H)}}}D=D+(D<0?Z:-Z),z=z+(z<0?W:-W),s&&(m?I>$*M?D=(Q9(c,d)?-z:z)/M:z=(Q9(c,d)?-D:D)*M:_?(D=z/M,d=c):(z=D*M,c=d));const U=c?y+z:y,Y=d?C+D:C;return{width:j+(c?-z:z),height:N+(d?-D:D),x:i[0]*z*(c?-1:1)+U,y:i[1]*D*(d?-1:1)+Y}}const GD={width:0,height:0,x:0,y:0},n4t={...GD,pointerX:0,pointerY:0,aspectRatio:1};function r4t(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,l=e.measured.height??0,o=t[0]*i,c=t[1]*l;return[[r-o,s-c],[r+i-o,s+l-c]]}function s4t({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=_i(e);let l={controlDirection:Z9("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:d,boundaries:_,keepAspectRatio:h,resizeDirection:m,onResizeStart:g,onResize:S,onResizeEnd:k,shouldResize:v}){let b={...GD},x={...n4t};l={boundaries:_,resizeDirection:m,keepAspectRatio:h,controlDirection:Z9(d)};let y,C=null,j=[],N,M,z,D=!1;const I=eD().on("start",$=>{const{nodeLookup:P,transform:F,snapGrid:W,snapToGrid:Z,nodeOrigin:U,paneDomNode:Y}=t();if(y=P.get(n),!y)return;C=(Y==null?void 0:Y.getBoundingClientRect())??null;const{xSnapped:J,ySnapped:H}=Jf($.sourceEvent,{transform:F,snapGrid:W,snapToGrid:Z,containerBounds:C});b={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...b,pointerX:J,pointerY:H,aspectRatio:b.width/b.height},N=void 0,M=Fc(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(N=P.get(y.parentId)),N&&y.extent==="parent"&&(M=[[0,0],[N.measured.width,N.measured.height]]),j=[],z=void 0;for(const[L,B]of P)if(B.parentId===n&&(j.push({id:L,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const X=r4t(B,y,B.origin??U);z?z=[[Math.min(X[0][0],z[0][0]),Math.min(X[0][1],z[0][1])],[Math.max(X[1][0],z[1][0]),Math.max(X[1][1],z[1][1])]]:z=X}g==null||g($,{...b})}).on("drag",$=>{const{transform:P,snapGrid:F,snapToGrid:W,nodeOrigin:Z}=t(),U=Jf($.sourceEvent,{transform:P,snapGrid:F,snapToGrid:W,containerBounds:C}),Y=[];if(!y)return;const{x:J,y:H,width:L,height:B}=b,X={},V=y.origin??Z,{width:ae,height:ce,x:oe,y:se}=t4t(x,l.controlDirection,U,l.boundaries,l.keepAspectRatio,V,M,z),G=ae!==L,ne=ce!==B,le=oe!==J&&G,_e=se!==H&≠if(!le&&!_e&&!G&&!ne)return;if((le||_e||V[0]===1||V[1]===1)&&(X.x=le?oe:b.x,X.y=_e?se:b.y,b.x=X.x,b.y=X.y,j.length>0)){const Ie=oe-J,qe=se-H;for(const Fe of j)Fe.position={x:Fe.position.x-Ie+V[0]*(ae-L),y:Fe.position.y-qe+V[1]*(ce-B)},Y.push(Fe)}if((G||ne)&&(X.width=G&&(!l.resizeDirection||l.resizeDirection==="horizontal")?ae:b.width,X.height=ne&&(!l.resizeDirection||l.resizeDirection==="vertical")?ce:b.height,b.width=X.width,b.height=X.height),N&&y.expandParent){const Ie=V[0]*(X.width??0);X.x&&X.x{D&&(k==null||k($,{...b}),s==null||s({...b}),D=!1)});i.call(I)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}var Lv={exports:{}},Ov={},Iv={exports:{}},Bv={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var J9;function i4t(){if(J9)return Bv;J9=1;var e=Bh();function n(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function o(h,m){var g=m(),S=r({inst:{value:g,getSnapshot:m}}),k=S[0].inst,v=S[1];return i(function(){k.value=g,k.getSnapshot=m,c(k)&&v({inst:k})},[h,g,m]),s(function(){return c(k)&&v({inst:k}),h(function(){c(k)&&v({inst:k})})},[h]),l(g),g}function c(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!t(h,g)}catch{return!0}}function d(h,m){return m()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:o;return Bv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,Bv}var eE;function a4t(){return eE||(eE=1,Iv.exports=i4t()),Iv.exports}/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var tE;function o4t(){if(tE)return Ov;tE=1;var e=Bh(),n=a4t();function t(d,_){return d===_&&(d!==0||1/d===1/_)||d!==d&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,l=e.useEffect,o=e.useMemo,c=e.useDebugValue;return Ov.useSyncExternalStoreWithSelector=function(d,_,h,m,g){var S=i(null);if(S.current===null){var k={hasValue:!1,value:null};S.current=k}else k=S.current;S=o(function(){function b(N){if(!x){if(x=!0,y=N,N=m(N),g!==void 0&&k.hasValue){var M=k.value;if(g(M,N))return C=M}return C=N}if(M=C,r(y,N))return M;var z=m(N);return g!==void 0&&g(M,z)?(y=N,M):(y=N,C=z)}var x=!1,y,C,j=h===void 0?null:h;return[function(){return b(_())},j===null?void 0:function(){return b(j())}]},[_,h,m,g]);var v=s(d,S[0],S[1]);return l(function(){k.hasValue=!0,k.value=v},[v]),c(v),v},Ov}var nE;function l4t(){return nE||(nE=1,Lv.exports=o4t()),Lv.exports}var c4t=l4t();const u4t=Ih(c4t),d4t={},rE=e=>{let n;const t=new Set,r=(_,h)=>{const m=typeof _=="function"?_(n):_;if(!Object.is(m,n)){const g=n;n=h??(typeof m!="object"||m===null)?m:Object.assign({},n,m),t.forEach(S=>S(n,g))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>d,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(d4t?"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."),t.clear()}},d=n=e(r,s,c);return c},f4t=e=>e?rE(e):rE,{useDebugValue:h4t}=tt,{useSyncExternalStoreWithSelector:_4t}=u4t,p4t=e=>e;function VD(e,n=p4t,t){const r=_4t(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return h4t(r),r}const sE=(e,n)=>{const t=f4t(e),r=(s,i=n)=>VD(t,s,i);return Object.assign(r,t),r},m4t=(e,n)=>e?sE(e,n):sE;function ir(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const ag=T.createContext(null),g4t=ag.Provider,WD=ca.error001("react");function mn(e,n){const t=T.useContext(ag);if(t===null)throw new Error(WD);return VD(t,e,n)}function or(){const e=T.useContext(ag);if(e===null)throw new Error(WD);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const iE={display:"none"},b4t={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},KD="react-flow__node-desc",YD="react-flow__edge-desc",v4t="react-flow__aria-live",x4t=e=>e.ariaLiveMessage,y4t=e=>e.ariaLabelConfig;function w4t({rfId:e}){const n=mn(x4t);return f.jsx("div",{id:`${v4t}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:b4t,children:n})}function S4t({rfId:e,disableKeyboardA11y:n}){const t=mn(y4t);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${KD}-${e}`,style:iE,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${YD}-${e}`,style:iE,children:t["edge.a11yDescription.default"]}),!n&&f.jsx(w4t,{rfId:e})]})}const og=T.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const l=`${e}`.split("-");return f.jsx("div",{className:Ur(["react-flow__panel",t,...l]),style:r,ref:i,...s,children:n})});og.displayName="Panel";const aE="https://reactflow.dev?utm_source=attribution";function k4t({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(og,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${aE}`,children:f.jsx("a",{href:aE,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const C4t=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},Z0=e=>e.id;function E4t(e,n){return ir(e.selectedNodes.map(Z0),n.selectedNodes.map(Z0))&&ir(e.selectedEdges.map(Z0),n.selectedEdges.map(Z0))}function N4t({onSelectionChange:e}){const n=or(),{selectedNodes:t,selectedEdges:r}=mn(C4t,E4t);return T.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const z4t=e=>!!e.onSelectionChangeHandlers;function j4t({onSelectionChange:e}){const n=mn(z4t);return e||n?f.jsx(N4t,{onSelectionChange:e}):null}const XD=[0,0],A4t={x:0,y:0,zoom:1},T4t=["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"],oE=[...T4t,"rfId"],M4t=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}),lE={translateExtent:Eh,nodeOrigin:XD,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function R4t(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:l,reset:o,setDefaultNodesAndEdges:c}=mn(M4t,ir),d=or();T.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{_.current=lE,o()}),[]);const _=T.useRef(lE);return T.useEffect(()=>{for(const h of oE){const m=e[h],g=_.current[h];m!==g&&(typeof e[h]>"u"||(h==="nodes"?n(m):h==="edges"?t(m):h==="minZoom"?r(m):h==="maxZoom"?s(m):h==="translateExtent"?i(m):h==="nodeExtent"?l(m):h==="ariaLabelConfig"?d.setState({ariaLabelConfig:gyt(m)}):h==="fitView"?d.setState({fitViewQueued:m}):h==="fitViewOptions"?d.setState({fitViewOptions:m}):d.setState({[h]:m})))}_.current=e},oE.map(h=>e[h])),null}function cE(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function D4t(e){var r;const[n,t]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){t(e);return}const s=cE(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=cE())!=null&&r.matches?"dark":"light"}const uE=typeof document<"u"?document:null;function Ah(e=null,n={target:uE,actInsideInputWithModifier:!0}){const[t,r]=T.useState(!1),s=T.useRef(!1),i=T.useRef(new Set([])),[l,o]=T.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",` -`).replace(` - -`,` -+`).split(` -`)),_=d.reduce((h,m)=>h.concat(...m),[]);return[d,_]}return[[],[]]},[e]);return T.useEffect(()=>{const c=(n==null?void 0:n.target)??uE,d=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=g=>{var v,b;if(s.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!s.current||s.current&&!d)&&jD(g))return!1;const k=fE(g.code,o);if(i.current.add(g[k]),dE(l,i.current,!1)){const x=((b=(v=g.composedPath)==null?void 0:v.call(g))==null?void 0:b[0])||g.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";n.preventDefault!==!1&&(s.current||!y)&&g.preventDefault(),r(!0)}},h=g=>{const S=fE(g.code,o);dE(l,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[S]),g.key==="Meta"&&i.current.clear(),s.current=!1},m=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",_),c==null||c.addEventListener("keyup",h),window.addEventListener("blur",m),window.addEventListener("contextmenu",m),()=>{c==null||c.removeEventListener("keydown",_),c==null||c.removeEventListener("keyup",h),window.removeEventListener("blur",m),window.removeEventListener("contextmenu",m)}}},[e,r]),t}function dE(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function fE(e,n){return n.includes(e)?"code":"key"}const L4t=()=>{const e=or();return T.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:l}=e.getState();return l?(await l.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:l,panZoom:o}=e.getState(),c=uw(n,r,s,i,l,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:l}=e.getState();if(!l)return n;const{x:o,y:c}=l.getBoundingClientRect(),d={x:n.x-o,y:n.y-c},_=t.snapGrid??s,h=t.snapToGrid??i;return o_(d,r,h,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),l=wd(n,t);return{x:l.x+s,y:l.y+i}}}),[])};function ZD(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const l=r.get(i.id);l?l.push(i):r.set(i.id,[i])}for(const i of n){const l=r.get(i.id);if(!l){t.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){t.push({...l[0].item});continue}const o={...i};for(const c of l)O4t(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function O4t(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function I4t(e,n){return ZD(e,n)}function B4t(e,n){return ZD(e,n)}function Cc(e,n){return{id:e,type:"select",selected:n}}function Wu(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const l=n.has(s);!(i.selected===void 0&&!l)&&i.selected!==l&&(t&&(i.selected=l),r.push(Cc(i.id,l)))}return r}function hE({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,l]of e.entries()){const o=n.get(l.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==l&&t.push({id:l.id,item:l,type:"replace"}),c===void 0&&t.push({item:l,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function _E(e){return{id:e.id,type:"remove"}}const $4t=CD();function H4t(e,n,t={}){return Syt(e,n,{...t,onError:t.onError??$4t})}const pE=e=>lyt(e),P4t=e=>xD(e);function QD(e){return T.forwardRef(e)}const F4t=typeof window<"u"?T.useLayoutEffect:T.useEffect;function mE(e){const[n,t]=T.useState(BigInt(0)),[r]=T.useState(()=>U4t(()=>t(s=>s+BigInt(1))));return F4t(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function U4t(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const JD=T.createContext(null);function q4t({children:e}){const n=or(),t=T.useCallback(o=>{const{nodes:c=[],setNodes:d,hasDefaultNodes:_,onNodesChange:h,nodeLookup:m,fitViewQueued:g,onNodesChangeMiddlewareMap:S}=n.getState();let k=c;for(const b of o)k=typeof b=="function"?b(k):b;let v=hE({items:k,lookup:m});for(const b of S.values())v=b(v);_&&d(k),v.length>0?h==null||h(v):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:x,setNodes:y}=n.getState();b&&y(x)})},[]),r=mE(t),s=T.useCallback(o=>{const{edges:c=[],setEdges:d,hasDefaultEdges:_,onEdgesChange:h,edgeLookup:m}=n.getState();let g=c;for(const S of o)g=typeof S=="function"?S(g):S;_?d(g):h&&h(hE({items:g,lookup:m}))},[]),i=mE(s),l=T.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(JD.Provider,{value:l,children:e})}function G4t(){const e=T.useContext(JD);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const V4t=e=>!!e.panZoom;function gw(){const e=L4t(),n=or(),t=G4t(),r=mn(V4t),s=T.useMemo(()=>{const i=h=>n.getState().nodeLookup.get(h),l=h=>{t.nodeQueue.push(h)},o=h=>{t.edgeQueue.push(h)},c=h=>{var b,x;const{nodeLookup:m,nodeOrigin:g}=n.getState(),S=pE(h)?h:m.get(h.id),k=S.parentId?ND(S.position,S.measured,S.parentId,m,g):S.position,v={...S,position:k,width:((b=S.measured)==null?void 0:b.width)??S.width,height:((x=S.measured)==null?void 0:x.height)??S.height};return zh(v)},d=(h,m,g={replace:!1})=>{l(S=>S.map(k=>{if(k.id===h){const v=typeof m=="function"?m(k):m;return g.replace&&pE(v)?v:{...k,...v}}return k}))},_=(h,m,g={replace:!1})=>{o(S=>S.map(k=>{if(k.id===h){const v=typeof m=="function"?m(k):m;return g.replace&&P4t(v)?v:{...k,...v}}return k}))};return{getNodes:()=>n.getState().nodes.map(h=>({...h})),getNode:h=>{var m;return(m=i(h))==null?void 0:m.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:h=[]}=n.getState();return h.map(m=>({...m}))},getEdge:h=>n.getState().edgeLookup.get(h),setNodes:l,setEdges:o,addNodes:h=>{const m=Array.isArray(h)?h:[h];t.nodeQueue.push(g=>[...g,...m])},addEdges:h=>{const m=Array.isArray(h)?h:[h];t.edgeQueue.push(g=>[...g,...m])},toObject:()=>{const{nodes:h=[],edges:m=[],transform:g}=n.getState(),[S,k,v]=g;return{nodes:h.map(b=>({...b})),edges:m.map(b=>({...b})),viewport:{x:S,y:k,zoom:v}}},deleteElements:async({nodes:h=[],edges:m=[]})=>{const{nodes:g,edges:S,onNodesDelete:k,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:C}=n.getState(),{nodes:j,edges:N}=await hyt({nodesToRemove:h,edgesToRemove:m,nodes:g,edges:S,onBeforeDelete:C}),M=N.length>0,z=j.length>0;if(M){const D=N.map(_E);v==null||v(N),x(D)}if(z){const D=j.map(_E);k==null||k(j),b(D)}return(z||M)&&(y==null||y({nodes:j,edges:N})),{deletedNodes:j,deletedEdges:N}},getIntersectingNodes:(h,m=!0,g)=>{const S=H9(h),k=S?h:c(h),v=g!==void 0;return k?(g||n.getState().nodes).filter(b=>{const x=n.getState().nodeLookup.get(b.id);if(x&&!S&&(b.id===h.id||!x.internals.positionAbsolute))return!1;const y=zh(v?b:x),C=tm(y,k);return m&&C>0||C>=y.width*y.height||C>=k.width*k.height}):[]},isNodeIntersecting:(h,m,g=!0)=>{const k=H9(h)?h:c(h);if(!k)return!1;const v=tm(k,m);return g&&v>0||v>=m.width*m.height||v>=k.width*k.height},updateNode:d,updateNodeData:(h,m,g={replace:!1})=>{d(h,S=>{const k=typeof m=="function"?m(S):m;return g.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},g)},updateEdge:_,updateEdgeData:(h,m,g={replace:!1})=>{_(h,S=>{const k=typeof m=="function"?m(S):m;return g.replace?{...S,data:k}:{...S,data:{...S.data,...k}}},g)},getNodesBounds:h=>{const{nodeLookup:m,nodeOrigin:g}=n.getState();return cyt(h,{nodeLookup:m,nodeOrigin:g})},getHandleConnections:({type:h,id:m,nodeId:g})=>{var S;return Array.from(((S=n.getState().connectionLookup.get(`${g}-${h}${m?`-${m}`:""}`))==null?void 0:S.values())??[])},getNodeConnections:({type:h,handleId:m,nodeId:g})=>{var S;return Array.from(((S=n.getState().connectionLookup.get(`${g}${h?m?`-${h}-${m}`:`-${h}`:""}`))==null?void 0:S.values())??[])},fitView:async h=>{const m=n.getState().fitViewResolver??myt();return n.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:m}),t.nodeQueue.push(g=>[...g]),m.promise}}},[]);return T.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const gE=e=>e.selected,W4t=typeof window<"u"?window:void 0;function K4t({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=or(),{deleteElements:r}=gw(),s=Ah(e,{actInsideInputWithModifier:!1}),i=Ah(n,{target:W4t});T.useEffect(()=>{if(s){const{edges:l,nodes:o}=t.getState();r({nodes:o.filter(gE),edges:l.filter(gE)}),t.setState({nodesSelectionActive:!1})}},[s]),T.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function Y4t(e){const n=or();T.useEffect(()=>{const t=()=>{var s,i,l,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=dw(e.current);(r.height===0||r.width===0)&&((o=(l=n.getState()).onError)==null||o.call(l,"004",ca.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const lg={position:"absolute",width:"100%",height:"100%",top:0,left:0},X4t=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Z4t({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=Oc.Free,zoomOnDoubleClick:l=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:d,minZoom:_,maxZoom:h,zoomActivationKeyCode:m,preventScrolling:g=!0,children:S,noWheelClassName:k,noPanClassName:v,onViewportChange:b,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:C}){const j=or(),N=T.useRef(null),{userSelectionActive:M,lib:z,connectionInProgress:D}=mn(X4t,ir),I=Ah(m),$=T.useRef();Y4t(N);const P=T.useCallback(F=>{b==null||b({x:F[0],y:F[1],zoom:F[2]}),x||j.setState({transform:F})},[b,x]);return T.useEffect(()=>{if(N.current){$.current=Jyt({domNode:N.current,minZoom:_,maxZoom:h,translateExtent:d,viewport:c,onDraggingChange:U=>j.setState(Y=>Y.paneDragging===U?Y:{paneDragging:U}),onPanZoomStart:(U,Y)=>{const{onViewportChangeStart:J,onMoveStart:H}=j.getState();H==null||H(U,Y),J==null||J(Y)},onPanZoom:(U,Y)=>{const{onViewportChange:J,onMove:H}=j.getState();H==null||H(U,Y),J==null||J(Y)},onPanZoomEnd:(U,Y)=>{const{onViewportChangeEnd:J,onMoveEnd:H}=j.getState();H==null||H(U,Y),J==null||J(Y)}});const{x:F,y:W,zoom:Z}=$.current.getViewport();return j.setState({panZoom:$.current,transform:[F,W,Z],domNode:N.current.closest(".react-flow")}),()=>{var U;(U=$.current)==null||U.destroy()}}},[]),T.useEffect(()=>{var F;(F=$.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:o,zoomActivationKeyPressed:I,preventScrolling:g,noPanClassName:v,userSelectionActive:M,noWheelClassName:k,lib:z,onTransformChange:P,connectionInProgress:D,selectionOnDrag:C,paneClickDistance:y})},[e,n,t,r,s,i,l,o,I,g,v,M,k,z,P,D,C,y]),f.jsx("div",{className:"react-flow__renderer",ref:N,style:lg,children:S})}const Q4t=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function J4t(){const{userSelectionActive:e,userSelectionRect:n}=mn(Q4t,ir);return e&&n?f.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const $v=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},ewt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function twt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=Nh.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:l,onSelectionStart:o,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:_,onPaneScroll:h,onPaneMouseEnter:m,onPaneMouseMove:g,onPaneMouseLeave:S,children:k}){const v=T.useRef(0),b=or(),{userSelectionActive:x,elementsSelectable:y,dragging:C,panBy:j,autoPanSpeed:N}=mn(ewt,ir),M=y&&(e||x),z=T.useRef(null),D=T.useRef(),I=T.useRef(new Set),$=T.useRef(new Set),P=T.useRef(!1),F=T.useRef(!1),W=T.useRef({x:0,y:0}),Z=T.useRef(!1),U=G=>{if(F.current||P.current||b.getState().connection.inProgress){F.current=!1,P.current=!1;return}d==null||d(G),b.getState().resetSelectedElements(),b.setState({nodesSelectionActive:!1})},Y=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}_==null||_(G)},J=h?G=>h(G):void 0,H=G=>{F.current&&(G.stopPropagation(),F.current=!1)},L=G=>{var Fe,Ot;const{domNode:ne,transform:le}=b.getState();if(D.current=ne==null?void 0:ne.getBoundingClientRect(),!D.current)return;const _e=G.target===z.current;if(!_e&&!!G.target.closest(".nokey")||!e||!(l&&_e||n)||G.button!==0||!G.isPrimary)return;(Ot=(Fe=G.target)==null?void 0:Fe.setPointerCapture)==null||Ot.call(Fe,G.pointerId),F.current=!1;const{x:Ne,y:Ie}=sa(G.nativeEvent,D.current),qe=o_({x:Ne,y:Ie},le);b.setState({userSelectionRect:{width:0,height:0,startX:qe.x,startY:qe.y,x:Ne,y:Ie}}),_e||(G.stopPropagation(),G.preventDefault())};function B(G,ne){const{userSelectionRect:le}=b.getState();if(!le)return;const{transform:_e,nodeLookup:ue,edgeLookup:ze,connectionLookup:Ne,triggerNodeChanges:Ie,triggerEdgeChanges:qe,defaultEdgeOptions:Fe}=b.getState(),Ot={x:le.startX,y:le.startY},{x:xt,y:Nt}=wd(Ot,_e),Jt={startX:Ot.x,startY:Ot.y,x:GPt.id)),$.current=new Set;const et=(Fe==null?void 0:Fe.selectable)??!0;for(const Pt of I.current){const we=Ne.get(Pt);if(we)for(const{edgeId:Oe}of we.values()){const Je=ze.get(Oe);Je&&(Je.selectable??et)&&$.current.add(Oe)}}if(!P9(ht,I.current)){const Pt=Wu(ue,I.current,!0);Ie(Pt)}if(!P9(it,$.current)){const Pt=Wu(ze,$.current);qe(Pt)}b.setState({userSelectionRect:Jt,userSelectionActive:!0,nodesSelectionActive:!1})}function X(){if(!s||!D.current)return;const[G,ne]=cw(W.current,D.current,N);j({x:G,y:ne}).then(le=>{if(!F.current||!le){v.current=requestAnimationFrame(X);return}const{x:_e,y:ue}=W.current;B(_e,ue),v.current=requestAnimationFrame(X)})}const V=()=>{cancelAnimationFrame(v.current),v.current=0,Z.current=!1};T.useEffect(()=>()=>V(),[]);const ae=G=>{const{userSelectionRect:ne,transform:le,resetSelectedElements:_e}=b.getState();if(!D.current||!ne)return;const{x:ue,y:ze}=sa(G.nativeEvent,D.current);W.current={x:ue,y:ze};const Ne=wd({x:ne.startX,y:ne.startY},le);if(!F.current){const Ie=n?0:i;if(Math.hypot(ue-Ne.x,ze-Ne.y)<=Ie)return;_e(),o==null||o(G)}F.current=!0,Z.current||(X(),Z.current=!0),B(ue,ze)},ce=G=>{var ne,le;if(!M){G.target===z.current&&b.getState().connection.inProgress&&(P.current=!0);return}G.button===0&&((le=(ne=G.target)==null?void 0:ne.releasePointerCapture)==null||le.call(ne,G.pointerId),!x&&G.target===z.current&&b.getState().userSelectionRect&&(U==null||U(G)),b.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(c==null||c(G),b.setState({nodesSelectionActive:I.current.size>0})),V())},oe=G=>{var ne,le;(le=(ne=G.target)==null?void 0:ne.releasePointerCapture)==null||le.call(ne,G.pointerId),V()},se=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:Ur(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:M?void 0:$v(U,z),onContextMenu:$v(Y,z),onWheel:$v(J,z),onPointerEnter:M?void 0:m,onPointerMove:M?ae:g,onPointerUp:ce,onPointerCancel:M?oe:void 0,onPointerDownCapture:M?L:void 0,onClickCapture:M?H:void 0,onPointerLeave:S,ref:z,style:lg,children:[k,f.jsx(J4t,{})]})}function Lx({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:o,onError:c}=n.getState(),d=o.get(e);if(!d){c==null||c("012",ca.error012(e));return}n.setState({nodesSelectionActive:!1}),d.selected?(t||d.selected&&l)&&(i({nodes:[d],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function eL({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:l}){const o=or(),[c,d]=T.useState(!1),_=T.useRef();return T.useEffect(()=>{_.current=$yt({getStoreItems:()=>o.getState(),onNodeMouseDown:h=>{Lx({id:h,store:o,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),T.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:l}),()=>{var h;(h=_.current)==null||h.destroy()}},[t,r,n,i,e,s,l]),c}const nwt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function tL(){const e=or();return T.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:l,onError:o,updateNodePositions:c,nodeLookup:d,nodeOrigin:_}=e.getState(),h=new Map,m=nwt(l),g=s?i[0]:5,S=s?i[1]:5,k=t.direction.x*g*t.factor,v=t.direction.y*S*t.factor;for(const[,b]of d){if(!m(b))continue;let x={x:b.internals.positionAbsolute.x+k,y:b.internals.positionAbsolute.y+v};s&&(x=a_(x,i));const{position:y,positionAbsolute:C}=yD({nodeId:b.id,nextPosition:x,nodeLookup:d,nodeExtent:r,nodeOrigin:_,onError:o});b.position=y,b.internals.positionAbsolute=C,h.set(b.id,b)}c(h)},[])}const bw=T.createContext(null),rwt=bw.Provider;bw.Consumer;const nL=()=>T.useContext(bw),swt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rL=T.createContext(null);function iwt({children:e}){const n=mn(swt,ir);return f.jsx(rL.Provider,{value:n,children:e})}function awt(){const e=T.useContext(rL);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const owt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},lwt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:l}=r,{fromHandle:o,toHandle:c,isValid:d}=l;if(!o&&!s)return owt;const _=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===xd.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&d}};function cwt({type:e="source",position:n=bt.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:l,onConnect:o,children:c,className:d,onMouseDown:_,onTouchStart:h,...m},g){var Z,U;const S=l||null,k=e==="target",v=or(),b=nL(),{connectOnClick:x,noPanClassName:y,rfId:C}=awt(),{connectingFrom:j,connectingTo:N,clickConnecting:M,isPossibleEndHandle:z,connectionInProcess:D,clickConnectionInProcess:I,valid:$}=mn(lwt(b,S,e),ir);b||(U=(Z=v.getState()).onError)==null||U.call(Z,"010",ca.error010());const P=Y=>{const{defaultEdgeOptions:J,onConnect:H,hasDefaultEdges:L}=v.getState(),B={...J,...Y};if(L){const{edges:X,setEdges:V,onError:ae}=v.getState();V(H4t(B,X,{onError:ae}))}H==null||H(B),o==null||o(B)},F=Y=>{if(!b)return;const J=AD(Y.nativeEvent);if(s&&(J&&Y.button===0||!J)){const H=v.getState();Dx.onPointerDown(Y.nativeEvent,{handleDomNode:Y.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:k,handleId:S,nodeId:b,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...L)=>{var B,X;return(X=(B=v.getState()).onConnectEnd)==null?void 0:X.call(B,...L)},updateConnection:H.updateConnection,onConnect:P,isValidConnection:t||((...L)=>{var B,X;return((X=(B=v.getState()).isValidConnection)==null?void 0:X.call(B,...L))??!0}),getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}J?_==null||_(Y):h==null||h(Y)},W=Y=>{const{onClickConnectStart:J,onClickConnectEnd:H,connectionClickStartHandle:L,connectionMode:B,isValidConnection:X,lib:V,rfId:ae,nodeLookup:ce,connection:oe}=v.getState();if(!b||!L&&!s)return;if(!L){J==null||J(Y.nativeEvent,{nodeId:b,handleId:S,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:S}});return}const se=zD(Y.target),G=t||X,{connection:ne,isValid:le}=Dx.isValid(Y.nativeEvent,{handle:{nodeId:b,id:S,type:e},connectionMode:B,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:G,flowId:ae,doc:se,lib:V,nodeLookup:ce});le&&ne&&P(ne);const _e=structuredClone(oe);delete _e.inProgress,_e.toPosition=_e.toHandle?_e.toHandle.position:null,H==null||H(Y,_e),v.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":S,"data-nodeid":b,"data-handlepos":n,"data-id":`${C}-${b}-${S}-${e}`,className:Ur(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,d,{source:!k,target:k,connectable:r,connectablestart:s,connectableend:i,clickconnecting:M,connectingfrom:j,connectingto:N,valid:$,connectionindicator:r&&(!D||z)&&(D||I?i:s)}]),onMouseDown:F,onTouchStart:F,onClick:x?W:void 0,ref:g,...m,children:c})}const Hl=T.memo(QD(cwt));function uwt({data:e,isConnectable:n,sourcePosition:t=bt.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Hl,{type:"source",position:t,isConnectable:n})]})}function dwt({data:e,isConnectable:n,targetPosition:t=bt.Top,sourcePosition:r=bt.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Hl,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,f.jsx(Hl,{type:"source",position:r,isConnectable:n})]})}function fwt(){return null}function hwt({data:e,isConnectable:n,targetPosition:t=bt.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Hl,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const nm={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},bE={input:uwt,default:dwt,output:hwt,group:fwt};function _wt(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const pwt=e=>{const{width:n,height:t,x:r,y:s}=i_(e.nodeLookup,{filter:i=>!!i.selected});return{width:ra(n)?n:null,height:ra(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function mwt({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=or(),{width:s,height:i,transformString:l,userSelectionActive:o}=mn(pwt,ir),c=tL(),d=T.useRef(null);T.useEffect(()=>{var g;t||(g=d.current)==null||g.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(eL({nodeRef:d,disabled:!_}),!_)return null;const h=e?g=>{const S=r.getState().nodes.filter(k=>k.selected);e(g,S)}:void 0,m=g=>{Object.prototype.hasOwnProperty.call(nm,g.key)&&(g.preventDefault(),c({direction:nm[g.key],factor:g.shiftKey?4:1}))};return f.jsx("div",{className:Ur(["react-flow__nodesselection","react-flow__container",n]),style:{transform:l},children:f.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:m,style:{width:s,height:i}})})}const vE=typeof window<"u"?window:void 0,gwt=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function sL({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:d,selectionOnDrag:_,selectionMode:h,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:C,panOnScrollSpeed:j,panOnScrollMode:N,zoomOnDoubleClick:M,panOnDrag:z,autoPanOnSelection:D,defaultViewport:I,translateExtent:$,minZoom:P,maxZoom:F,preventScrolling:W,onSelectionContextMenu:Z,noWheelClassName:U,noPanClassName:Y,disableKeyboardA11y:J,onViewportChange:H,isControlledViewport:L}){const{nodesSelectionActive:B,userSelectionActive:X}=mn(gwt,ir),V=Ah(d,{target:vE}),ae=Ah(k,{target:vE}),ce=ae||z,oe=ae||C,se=_&&ce!==!0,G=V||X||se;return K4t({deleteKeyCode:c,multiSelectionKeyCode:S}),f.jsx(Z4t,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:oe,panOnScrollSpeed:j,panOnScrollMode:N,zoomOnDoubleClick:M,panOnDrag:!V&&ce,defaultViewport:I,translateExtent:$,minZoom:P,maxZoom:F,zoomActivationKeyCode:v,preventScrolling:W,noWheelClassName:U,noPanClassName:Y,onViewportChange:H,isControlledViewport:L,paneClickDistance:o,selectionOnDrag:se,children:f.jsxs(twt,{onSelectionStart:m,onSelectionEnd:g,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:ce,autoPanOnSelection:D,isSelecting:!!G,selectionMode:h,selectionKeyPressed:V,paneClickDistance:o,selectionOnDrag:se,children:[e,B&&f.jsx(mwt,{onSelectionContextMenu:Z,noPanClassName:Y,disableKeyboardA11y:J})]})})}sL.displayName="FlowRenderer";const bwt=T.memo(sL),vwt=e=>n=>e?lw(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function xwt(e){return mn(T.useCallback(vwt(e),[e]),ir)}const ywt=e=>e.updateNodeInternals;function wwt(){const e=mn(ywt),[n]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return T.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function Swt({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=or(),i=T.useRef(null),l=T.useRef(null),o=T.useRef(e.sourcePosition),c=T.useRef(e.targetPosition),d=T.useRef(n),_=t&&!!e.internals.handleBounds;return T.useEffect(()=>{i.current&&!e.hidden&&(!_||l.current!==i.current)&&(l.current&&(r==null||r.unobserve(l.current)),r==null||r.observe(i.current),l.current=i.current)},[_,e.hidden]),T.useEffect(()=>()=>{l.current&&(r==null||r.unobserve(l.current),l.current=null)},[]),T.useEffect(()=>{if(i.current){const h=d.current!==n,m=o.current!==e.sourcePosition,g=c.current!==e.targetPosition;(h||m||g)&&(d.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function kwt({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:l,nodesDraggable:o,elementsSelectable:c,nodesConnectable:d,nodesFocusable:_,resizeObserver:h,noDragClassName:m,noPanClassName:g,disableKeyboardA11y:S,rfId:k,nodeTypes:v,nodeClickDistance:b,onError:x}){const{node:y,internals:C,isParent:j}=mn(G=>{const ne=G.nodeLookup.get(e),le=G.parentLookup.has(e);return{node:ne,internals:ne.internals,isParent:le}},ir);let N=y.type||"default",M=(v==null?void 0:v[N])||bE[N];M===void 0&&(x==null||x("003",ca.error003(N)),N="default",M=(v==null?void 0:v.default)||bE.default);const z=!!(y.draggable||o&&typeof y.draggable>"u"),D=!!(y.selectable||c&&typeof y.selectable>"u"),I=!!(y.connectable||d&&typeof y.connectable>"u"),$=!!(y.focusable||_&&typeof y.focusable>"u"),P=or(),F=ED(y),W=Swt({node:y,nodeType:N,hasDimensions:F,resizeObserver:h}),Z=eL({nodeRef:W,disabled:y.hidden||!z,noDragClassName:m,handleSelector:y.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:b}),U=tL();if(y.hidden)return null;const Y=$o(y),J=_wt(y),H=D||z||n||t||r||s,L=t?G=>t(G,{...C.userNode}):void 0,B=r?G=>r(G,{...C.userNode}):void 0,X=s?G=>s(G,{...C.userNode}):void 0,V=i?G=>i(G,{...C.userNode}):void 0,ae=l?G=>l(G,{...C.userNode}):void 0,ce=G=>{const{selectNodesOnDrag:ne,nodeDragThreshold:le}=P.getState();D&&(!ne||!z||le>0)&&Lx({id:e,store:P,nodeRef:W}),n&&n(G,{...C.userNode})},oe=G=>{if(!(jD(G.nativeEvent)||S)){if(mD.includes(G.key)&&D){const ne=G.key==="Escape";Lx({id:e,store:P,unselect:ne,nodeRef:W})}else if(z&&y.selected&&Object.prototype.hasOwnProperty.call(nm,G.key)){G.preventDefault();const{ariaLabelConfig:ne}=P.getState();P.setState({ariaLiveMessage:ne["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),U({direction:nm[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var Ne;if(S||!((Ne=W.current)!=null&&Ne.matches(":focus-visible")))return;const{transform:G,width:ne,height:le,autoPanOnNodeFocus:_e,setCenter:ue}=P.getState();if(!_e)return;lw(new Map([[e,y]]),{x:0,y:0,width:ne,height:le},G,!0).length>0||ue(y.position.x+Y.width/2,y.position.y+Y.height/2,{zoom:G[2]})};return f.jsx("div",{className:Ur(["react-flow__node",`react-flow__node-${N}`,{[g]:z},y.className,{selected:y.selected,selectable:D,parent:j,draggable:z,dragging:Z}]),ref:W,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:F?"visible":"hidden",...y.style,...J},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:B,onMouseLeave:X,onContextMenu:V,onClick:ce,onDoubleClick:ae,onKeyDown:$?oe:void 0,tabIndex:$?0:void 0,onFocus:$?se:void 0,role:y.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${KD}-${k}`,"aria-label":y.ariaLabel,...y.domAttributes,children:f.jsx(rwt,{value:e,children:f.jsx(M,{id:e,data:y.data,type:N,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:y.selected??!1,selectable:D,draggable:z,deletable:y.deletable??!0,isConnectable:I,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:Z,dragHandle:y.dragHandle,zIndex:C.z,parentId:y.parentId,...Y})})})}var Cwt=T.memo(kwt);const Ewt=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function iL(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=mn(Ewt,ir),l=xwt(e.onlyRenderVisibleElements),o=wwt();return f.jsx("div",{className:"react-flow__nodes",style:lg,children:l.map(c=>f.jsx(Cwt,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}iL.displayName="NodeRenderer";const Nwt=T.memo(iL);function zwt(e){return mn(T.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),l=t.nodeLookup.get(s.target);i&&l&&xyt({sourceNode:i,targetNode:l,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),ir)}const jwt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Awt=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},xE={[Jp.Arrow]:jwt,[Jp.ArrowClosed]:Awt};function Twt(e){const n=or();return T.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(xE,e)?xE[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",ca.error009(e)),null)},[e])}const Mwt=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:o="auto-start-reverse"})=>{const c=Twt(n);return c?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:f.jsx(c,{color:t,strokeWidth:l})}):null},aL=({defaultColor:e,rfId:n})=>{const t=mn(i=>i.edges),r=mn(i=>i.defaultEdgeOptions),s=T.useMemo(()=>zyt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:s.map(i=>f.jsx(Mwt,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};aL.displayName="MarkerDefinitions";var Rwt=T.memo(aL);function oL({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:o=2,children:c,className:d,..._}){const[h,m]=T.useState({x:1,y:0,width:0,height:0}),g=Ur(["react-flow__edge-textwrapper",d]),S=T.useRef(null);return T.useEffect(()=>{if(S.current){const k=S.current.getBBox();m({x:k.x,y:k.y,width:k.width,height:k.height})}},[t]),t?f.jsxs("g",{transform:`translate(${e-h.width/2} ${n-h.height/2})`,className:g,visibility:h.width?"visible":"hidden",..._,children:[s&&f.jsx("rect",{width:h.width+2*l[0],x:-l[0],y:-l[1],height:h.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:o,ry:o}),f.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:S,style:r,children:t}),c]}):null}oL.displayName="EdgeText";const Dwt=T.memo(oL);function cg({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:d=20,..._}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{..._,d:e,fill:"none",className:Ur(["react-flow__edge-path",_.className])}),d?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,r&&ra(n)&&ra(t)?f.jsx(Dwt,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function yE({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===bt.Left||e===bt.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function lL({sourceX:e,sourceY:n,sourcePosition:t=bt.Bottom,targetX:r,targetY:s,targetPosition:i=bt.Top}){const[l,o]=yE({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,d]=yE({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,h,m,g]=TD({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:l,sourceControlY:o,targetControlX:c,targetControlY:d});return[`M${e},${n} C${l},${o} ${c},${d} ${r},${s}`,_,h,m,g]}function cL(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:l,targetPosition:o,label:c,labelStyle:d,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:b})=>{const[x,y,C]=lL({sourceX:t,sourceY:r,sourcePosition:l,targetX:s,targetY:i,targetPosition:o}),j=e.isInternal?void 0:n;return f.jsx(cg,{id:j,path:x,labelX:y,labelY:C,label:c,labelStyle:d,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:b})})}const Lwt=cL({isInternal:!1}),uL=cL({isInternal:!0});Lwt.displayName="SimpleBezierEdge";uL.displayName="SimpleBezierEdgeInternal";function dL(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:l,labelStyle:o,labelShowBg:c,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:h,style:m,sourcePosition:g=bt.Bottom,targetPosition:S=bt.Top,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,j]=Tx({sourceX:t,sourceY:r,sourcePosition:g,targetX:s,targetY:i,targetPosition:S,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return f.jsx(cg,{id:N,path:y,labelX:C,labelY:j,label:l,labelStyle:o,labelShowBg:c,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:h,style:m,markerEnd:k,markerStart:v,interactionWidth:x})})}const fL=dL({isInternal:!1}),hL=dL({isInternal:!0});fL.displayName="SmoothStepEdge";hL.displayName="SmoothStepEdgeInternal";function _L(e){return T.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return f.jsx(fL,{...t,id:r,pathOptions:T.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const Owt=_L({isInternal:!1}),pL=_L({isInternal:!0});Owt.displayName="StepEdge";pL.displayName="StepEdgeInternal";function mL(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:l,labelStyle:o,labelShowBg:c,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:S,interactionWidth:k})=>{const[v,b,x]=DD({sourceX:t,sourceY:r,targetX:s,targetY:i}),y=e.isInternal?void 0:n;return f.jsx(cg,{id:y,path:v,labelX:b,labelY:x,label:l,labelStyle:o,labelShowBg:c,labelBgStyle:d,labelBgPadding:_,labelBgBorderRadius:h,style:m,markerEnd:g,markerStart:S,interactionWidth:k})})}const Iwt=mL({isInternal:!1}),gL=mL({isInternal:!0});Iwt.displayName="StraightEdge";gL.displayName="StraightEdgeInternal";function bL(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:l=bt.Bottom,targetPosition:o=bt.Top,label:c,labelStyle:d,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,pathOptions:b,interactionWidth:x})=>{const[y,C,j]=MD({sourceX:t,sourceY:r,sourcePosition:l,targetX:s,targetY:i,targetPosition:o,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return f.jsx(cg,{id:N,path:y,labelX:C,labelY:j,label:c,labelStyle:d,labelShowBg:_,labelBgStyle:h,labelBgPadding:m,labelBgBorderRadius:g,style:S,markerEnd:k,markerStart:v,interactionWidth:x})})}const Bwt=bL({isInternal:!1}),vL=bL({isInternal:!0});Bwt.displayName="BezierEdge";vL.displayName="BezierEdgeInternal";const wE={default:vL,straight:gL,step:pL,smoothstep:hL,simplebezier:uL},SE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},$wt=(e,n,t)=>t===bt.Left?e-n:t===bt.Right?e+n:e,Hwt=(e,n,t)=>t===bt.Top?e-n:t===bt.Bottom?e+n:e,kE="react-flow__edgeupdater";function CE({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:l,type:o}){return f.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:l,className:Ur([kE,`${kE}-${o}`]),cx:$wt(n,r,e),cy:Hwt(t,r,e),r,stroke:"transparent",fill:"transparent"})}function Pwt({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:l,sourcePosition:o,targetPosition:c,onReconnect:d,onReconnectStart:_,onReconnectEnd:h,setReconnecting:m,setUpdateHover:g}){const S=or(),k=(C,j)=>{if(C.button!==0)return;const{autoPanOnConnect:N,domNode:M,connectionMode:z,connectionRadius:D,lib:I,onConnectStart:$,cancelConnection:P,nodeLookup:F,rfId:W,panBy:Z,updateConnection:U}=S.getState(),Y=j.type==="target",J=(B,X)=>{m(!1),h==null||h(B,t,j.type,X)},H=B=>d==null?void 0:d(t,B),L=(B,X)=>{m(!0),_==null||_(C,t,j.type),$==null||$(B,X)};Dx.onPointerDown(C.nativeEvent,{autoPanOnConnect:N,connectionMode:z,connectionRadius:D,domNode:M,handleId:j.id,nodeId:j.nodeId,nodeLookup:F,isTarget:Y,edgeUpdaterType:j.type,lib:I,flowId:W,cancelConnection:P,panBy:Z,isValidConnection:(...B)=>{var X,V;return((V=(X=S.getState()).isValidConnection)==null?void 0:V.call(X,...B))??!0},onConnect:H,onConnectStart:L,onConnectEnd:(...B)=>{var X,V;return(V=(X=S.getState()).onConnectEnd)==null?void 0:V.call(X,...B)},onReconnectEnd:J,updateConnection:U,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},v=C=>k(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>k(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),x=()=>g(!0),y=()=>g(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(CE,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:v,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&f.jsx(CE,{position:c,centerX:i,centerY:l,radius:n,onMouseDown:b,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function Fwt({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:l,onMouseEnter:o,onMouseMove:c,onMouseLeave:d,reconnectRadius:_,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,rfId:S,edgeTypes:k,noPanClassName:v,onError:b,disableKeyboardA11y:x}){let y=mn(ue=>ue.edgeLookup.get(e));const C=mn(ue=>ue.defaultEdgeOptions);y=C?{...C,...y}:y;let j=y.type||"default",N=(k==null?void 0:k[j])||wE[j];N===void 0&&(b==null||b("011",ca.error011(j)),j="default",N=(k==null?void 0:k.default)||wE.default);const M=!!(y.focusable||n&&typeof y.focusable>"u"),z=typeof h<"u"&&(y.reconnectable||t&&typeof y.reconnectable>"u"),D=!!(y.selectable||r&&typeof y.selectable>"u"),I=T.useRef(null),[$,P]=T.useState(!1),[F,W]=T.useState(!1),Z=or(),{zIndex:U=y.zIndex,sourceX:Y,sourceY:J,targetX:H,targetY:L,sourcePosition:B,targetPosition:X}=mn(T.useCallback(ue=>{const ze=ue.nodeLookup.get(y.source),Ne=ue.nodeLookup.get(y.target);if(!ze||!Ne)return SE;const Ie=Nyt({id:e,sourceNode:ze,targetNode:Ne,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ue.connectionMode,onError:b}),qe=vyt({selected:y.selected,zIndex:y.zIndex,sourceNode:ze,targetNode:Ne,elevateOnSelect:ue.elevateEdgesOnSelect,zIndexMode:ue.zIndexMode});return{...Ie||SE,zIndex:qe}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),ir),V=T.useMemo(()=>y.markerStart?`url('#${Mx(y.markerStart,S)}')`:void 0,[y.markerStart,S]),ae=T.useMemo(()=>y.markerEnd?`url('#${Mx(y.markerEnd,S)}')`:void 0,[y.markerEnd,S]);if(y.hidden||Y===null||J===null||H===null||L===null)return null;const ce=ue=>{var qe;const{addSelectedEdges:ze,unselectNodesAndEdges:Ne,multiSelectionActive:Ie}=Z.getState();D&&(Z.setState({nodesSelectionActive:!1}),y.selected&&Ie?(Ne({nodes:[],edges:[y]}),(qe=I.current)==null||qe.blur()):ze([e])),s&&s(ue,y)},oe=i?ue=>{i(ue,{...y})}:void 0,se=l?ue=>{l(ue,{...y})}:void 0,G=o?ue=>{o(ue,{...y})}:void 0,ne=c?ue=>{c(ue,{...y})}:void 0,le=d?ue=>{d(ue,{...y})}:void 0,_e=ue=>{var ze;if(!x&&mD.includes(ue.key)&&D){const{unselectNodesAndEdges:Ne,addSelectedEdges:Ie}=Z.getState();ue.key==="Escape"?((ze=I.current)==null||ze.blur(),Ne({edges:[y]})):Ie([e])}};return f.jsx("svg",{style:{zIndex:U},children:f.jsxs("g",{className:Ur(["react-flow__edge",`react-flow__edge-${j}`,y.className,v,{selected:y.selected,animated:y.animated,inactive:!D&&!s,updating:$,selectable:D}]),onClick:ce,onDoubleClick:oe,onContextMenu:se,onMouseEnter:G,onMouseMove:ne,onMouseLeave:le,onKeyDown:M?_e:void 0,tabIndex:M?0:void 0,role:y.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":M?`${YD}-${S}`:void 0,ref:I,...y.domAttributes,children:[!F&&f.jsx(N,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:D,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:Y,sourceY:J,targetX:H,targetY:L,sourcePosition:B,targetPosition:X,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:V,markerEnd:ae,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),z&&f.jsx(Pwt,{edge:y,isReconnectable:z,reconnectRadius:_,onReconnect:h,onReconnectStart:m,onReconnectEnd:g,sourceX:Y,sourceY:J,targetX:H,targetY:L,sourcePosition:B,targetPosition:X,setUpdateHover:P,setReconnecting:W})]})})}var Uwt=T.memo(Fwt);const qwt=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function xL({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:_,reconnectRadius:h,onEdgeDoubleClick:m,onReconnectStart:g,onReconnectEnd:S,disableKeyboardA11y:k}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,onError:y}=mn(qwt,ir),C=zwt(n);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(Rwt,{defaultColor:e,rfId:t}),C.map(j=>f.jsx(Uwt,{id:j,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:x,noPanClassName:s,onReconnect:i,onContextMenu:l,onMouseEnter:o,onMouseMove:c,onMouseLeave:d,onClick:_,reconnectRadius:h,onDoubleClick:m,onReconnectStart:g,onReconnectEnd:S,rfId:t,onError:y,edgeTypes:r,disableKeyboardA11y:k},j))]})}xL.displayName="EdgeRenderer";const Gwt=T.memo(xL),Vwt=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Wwt({children:e}){const n=mn(Vwt);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function Kwt(e){const n=gw(),t=T.useRef(!1);T.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const Ywt=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function Xwt(e){const n=mn(Ywt),t=or();return T.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function Zwt(e){return e.connection.inProgress?{...e.connection,to:o_(e.connection.to,e.transform)}:{...e.connection}}function Qwt(e){return Zwt}function Jwt(e){const n=Qwt();return mn(n,ir)}const e5t=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function t5t({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:l,isValid:o,inProgress:c}=mn(e5t,ir);return!(i&&s&&c)?null:f.jsx("svg",{style:e,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:Ur(["react-flow__connection",vD(o)]),children:f.jsx(yL,{style:n,type:t,CustomComponent:r,isValid:o})})})}const yL=({style:e,type:n=zl.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:l,fromHandle:o,fromPosition:c,to:d,toNode:_,toHandle:h,toPosition:m,pointer:g}=Jwt();if(!s)return;if(t)return f.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:l,fromHandle:o,fromX:i.x,fromY:i.y,toX:d.x,toY:d.y,fromPosition:c,toPosition:m,connectionStatus:vD(r),toNode:_,toHandle:h,pointer:g});let S="";const k={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:d.x,targetY:d.y,targetPosition:m};switch(n){case zl.Bezier:[S]=MD(k);break;case zl.SimpleBezier:[S]=lL(k);break;case zl.Step:[S]=Tx({...k,borderRadius:0});break;case zl.SmoothStep:[S]=Tx(k);break;default:[S]=DD(k)}return f.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:e})};yL.displayName="ConnectionLine";const n5t={};function EE(e=n5t){T.useRef(e),or(),T.useEffect(()=>{},[e])}function r5t(){or(),T.useRef(!1),T.useEffect(()=>{},[])}function wL({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:_,onSelectionContextMenu:h,onSelectionStart:m,onSelectionEnd:g,connectionLineType:S,connectionLineStyle:k,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,multiSelectionKeyCode:j,panActivationKeyCode:N,zoomActivationKeyCode:M,deleteKeyCode:z,onlyRenderVisibleElements:D,elementsSelectable:I,defaultViewport:$,translateExtent:P,minZoom:F,maxZoom:W,preventScrolling:Z,defaultMarkerColor:U,zoomOnScroll:Y,zoomOnPinch:J,panOnScroll:H,panOnScrollSpeed:L,panOnScrollMode:B,zoomOnDoubleClick:X,panOnDrag:V,autoPanOnSelection:ae,onPaneClick:ce,onPaneMouseEnter:oe,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:ne,onPaneContextMenu:le,paneClickDistance:_e,nodeClickDistance:ue,onEdgeContextMenu:ze,onEdgeMouseEnter:Ne,onEdgeMouseMove:Ie,onEdgeMouseLeave:qe,reconnectRadius:Fe,onReconnect:Ot,onReconnectStart:xt,onReconnectEnd:Nt,noDragClassName:Jt,noWheelClassName:ht,noPanClassName:it,disableKeyboardA11y:et,nodeExtent:Pt,rfId:we,viewport:Oe,onViewportChange:Je}){return EE(e),EE(n),r5t(),Kwt(t),Xwt(Oe),f.jsx(bwt,{onPaneClick:ce,onPaneMouseEnter:oe,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:le,onPaneScroll:ne,paneClickDistance:_e,deleteKeyCode:z,selectionKeyCode:x,selectionOnDrag:y,selectionMode:C,onSelectionStart:m,onSelectionEnd:g,multiSelectionKeyCode:j,panActivationKeyCode:N,zoomActivationKeyCode:M,elementsSelectable:I,zoomOnScroll:Y,zoomOnPinch:J,zoomOnDoubleClick:X,panOnScroll:H,panOnScrollSpeed:L,panOnScrollMode:B,panOnDrag:V,autoPanOnSelection:ae,defaultViewport:$,translateExtent:P,minZoom:F,maxZoom:W,onSelectionContextMenu:h,preventScrolling:Z,noDragClassName:Jt,noWheelClassName:ht,noPanClassName:it,disableKeyboardA11y:et,onViewportChange:Je,isControlledViewport:!!Oe,children:f.jsxs(Wwt,{children:[f.jsx(Gwt,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:l,onReconnect:Ot,onReconnectStart:xt,onReconnectEnd:Nt,onlyRenderVisibleElements:D,onEdgeContextMenu:ze,onEdgeMouseEnter:Ne,onEdgeMouseMove:Ie,onEdgeMouseLeave:qe,reconnectRadius:Fe,defaultMarkerColor:U,noPanClassName:it,disableKeyboardA11y:et,rfId:we}),f.jsx(t5t,{style:k,type:S,component:v,containerStyle:b}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(Nwt,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:d,onNodeContextMenu:_,nodeClickDistance:ue,onlyRenderVisibleElements:D,noPanClassName:it,noDragClassName:Jt,disableKeyboardA11y:et,nodeExtent:Pt,rfId:we}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}wL.displayName="GraphView";const s5t=T.memo(wL),i5t=CD(),NE=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:l,fitViewOptions:o,minZoom:c=.5,maxZoom:d=2,nodeOrigin:_,nodeExtent:h,zIndexMode:m="basic"}={})=>{const g=new Map,S=new Map,k=new Map,v=new Map,b=r??n??[],x=t??e??[],y=_??[0,0],C=h??Eh;ID(k,v,b);const{nodesInitialized:j}=Rx(x,g,S,{nodeOrigin:y,nodeExtent:C,zIndexMode:m});let N=[0,0,1];if(l&&s&&i){const M=i_(g,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:z,y:D,zoom:I}=uw(M,s,i,c,d,(o==null?void 0:o.padding)??.1);N=[z,D,I]}return{rfId:"1",width:s??0,height:i??0,transform:N,nodes:x,nodesInitialized:j,nodeLookup:g,parentLookup:S,edges:b,edgeLookup:v,connectionLookup:k,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:d,translateExtent:Eh,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:l??!1,fitViewOptions:o,fitViewResolver:null,connection:{...bD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:i5t,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:gD,zIndexMode:m,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},a5t=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:l,fitViewOptions:o,minZoom:c,maxZoom:d,nodeOrigin:_,nodeExtent:h,zIndexMode:m})=>m4t((g,S)=>{async function k(){const{nodeLookup:v,panZoom:b,fitViewOptions:x,fitViewResolver:y,width:C,height:j,minZoom:N,maxZoom:M}=S();b&&(await fyt({nodes:v,width:C,height:j,panZoom:b,minZoom:N,maxZoom:M},x),y==null||y.resolve(!0),g({fitViewResolver:null}))}return{...NE({nodes:e,edges:n,width:s,height:i,fitView:l,fitViewOptions:o,minZoom:c,maxZoom:d,nodeOrigin:_,nodeExtent:h,defaultNodes:t,defaultEdges:r,zIndexMode:m}),setNodes:v=>{const{nodeLookup:b,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:C,fitViewQueued:j,zIndexMode:N,nodesSelectionActive:M}=S(),{nodesInitialized:z,hasSelectedNodes:D}=Rx(v,b,x,{nodeOrigin:y,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:N}),I=M&&D;j&&z?(k(),g({nodes:v,nodesInitialized:z,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:I})):g({nodes:v,nodesInitialized:z,nodesSelectionActive:I})},setEdges:v=>{const{connectionLookup:b,edgeLookup:x}=S();ID(b,x,v),g({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:x}=S();x(v),g({hasDefaultNodes:!0})}if(b){const{setEdges:x}=S();x(b),g({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:x,parentLookup:y,domNode:C,nodeOrigin:j,nodeExtent:N,debug:M,fitViewQueued:z,zIndexMode:D}=S(),{changes:I,updatedInternals:$}=Lyt(v,x,y,C,j,N,D);$&&(Tyt(x,y,{nodeOrigin:j,nodeExtent:N,zIndexMode:D}),z?(k(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(I==null?void 0:I.length)>0&&(M&&console.log("React Flow: trigger node changes",I),b==null||b(I)))},updateNodePositions:(v,b=!1)=>{const x=[];let y=[];const{nodeLookup:C,triggerNodeChanges:j,connection:N,updateConnection:M,onNodesChangeMiddlewareMap:z}=S();for(const[D,I]of v){const $=C.get(D),P=!!($!=null&&$.expandParent&&($!=null&&$.parentId)&&(I!=null&&I.position)),F={id:D,type:"position",position:P?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:b};if($&&N.inProgress&&N.fromNode.id===$.id){const W=Uc($,N.fromHandle,bt.Left,!0);M({...N,from:W})}P&&$.parentId&&x.push({id:D,parentId:$.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),y.push(F)}if(x.length>0){const{parentLookup:D,nodeOrigin:I}=S(),$=mw(x,C,D,I);y.push(...$)}for(const D of z.values())y=D(y);j(y)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:x,nodes:y,hasDefaultNodes:C,debug:j}=S();if(v!=null&&v.length){if(C){const N=I4t(v,y);x(N)}j&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:x,edges:y,hasDefaultEdges:C,debug:j}=S();if(v!=null&&v.length){if(C){const N=B4t(v,y);x(N)}j&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:j}=S();if(b){const N=v.map(M=>Cc(M,!0));C(N);return}C(Wu(y,new Set([...v]),!0)),j(Wu(x))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:x,nodeLookup:y,triggerNodeChanges:C,triggerEdgeChanges:j}=S();if(b){const N=v.map(M=>Cc(M,!0));j(N);return}j(Wu(x,new Set([...v]))),C(Wu(y,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:x,nodes:y,nodeLookup:C,triggerNodeChanges:j,triggerEdgeChanges:N}=S(),M=v||y,z=b||x,D=[];for(const $ of M){if(!$.selected)continue;const P=C.get($.id);P&&(P.selected=!1),D.push(Cc($.id,!1))}const I=[];for(const $ of z)$.selected&&I.push(Cc($.id,!1));j(D),N(I)},setMinZoom:v=>{const{panZoom:b,maxZoom:x}=S();b==null||b.setScaleExtent([v,x]),g({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:x}=S();b==null||b.setScaleExtent([x,v]),g({maxZoom:v})},setTranslateExtent:v=>{var b;(b=S().panZoom)==null||b.setTranslateExtent(v),g({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:C}=S();if(!C)return;const j=b.reduce((M,z)=>z.selected?[...M,Cc(z.id,!1)]:M,[]),N=v.reduce((M,z)=>z.selected?[...M,Cc(z.id,!1)]:M,[]);x(j),y(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:x,parentLookup:y,nodeOrigin:C,elevateNodesOnSelect:j,nodeExtent:N,zIndexMode:M}=S();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(Rx(b,x,y,{nodeOrigin:C,nodeExtent:v,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:M}),g({nodeExtent:v}))},panBy:v=>{const{transform:b,width:x,height:y,panZoom:C,translateExtent:j}=S();return Oyt({delta:v,panZoom:C,transform:b,translateExtent:j,width:x,height:y})},setCenter:async(v,b,x)=>{const{width:y,height:C,maxZoom:j,panZoom:N}=S();if(!N)return!1;const M=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:j;return await N.setViewport({x:y/2-v*M,y:C/2-b*M,zoom:M},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{g({connection:{...bD}})},updateConnection:v=>{g({connection:v})},reset:()=>g({...NE()})}},Object.is);function o5t({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:l,initialMaxZoom:o,initialFitViewOptions:c,fitView:d,nodeOrigin:_,nodeExtent:h,zIndexMode:m,children:g}){const[S]=T.useState(()=>a5t({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:d,minZoom:l,maxZoom:o,fitViewOptions:c,nodeOrigin:_,nodeExtent:h,zIndexMode:m}));return f.jsx(g4t,{value:S,children:f.jsx(q4t,{children:f.jsx(iwt,{children:g})})})}function l5t({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:l,fitView:o,fitViewOptions:c,minZoom:d,maxZoom:_,nodeOrigin:h,nodeExtent:m,zIndexMode:g}){return T.useContext(ag)?f.jsx(f.Fragment,{children:e}):f.jsx(o5t,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:l,fitView:o,initialFitViewOptions:c,initialMinZoom:d,initialMaxZoom:_,nodeOrigin:h,nodeExtent:m,zIndexMode:g,children:e})}const c5t={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function u5t({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:l,onNodeClick:o,onEdgeClick:c,onInit:d,onMove:_,onMoveStart:h,onMoveEnd:m,onConnect:g,onConnectStart:S,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:j,onNodeDoubleClick:N,onNodeDragStart:M,onNodeDrag:z,onNodeDragStop:D,onNodesDelete:I,onEdgesDelete:$,onDelete:P,onSelectionChange:F,onSelectionDragStart:W,onSelectionDrag:Z,onSelectionDragStop:U,onSelectionContextMenu:Y,onSelectionStart:J,onSelectionEnd:H,onBeforeDelete:L,connectionMode:B,connectionLineType:X=zl.Bezier,connectionLineStyle:V,connectionLineComponent:ae,connectionLineContainerStyle:ce,deleteKeyCode:oe="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:ne=Nh.Full,panActivationKeyCode:le="Space",multiSelectionKeyCode:_e=jh()?"Meta":"Control",zoomActivationKeyCode:ue=jh()?"Meta":"Control",snapToGrid:ze,snapGrid:Ne,onlyRenderVisibleElements:Ie=!1,selectNodesOnDrag:qe,nodesDraggable:Fe,autoPanOnNodeFocus:Ot,nodesConnectable:xt,nodesFocusable:Nt,nodeOrigin:Jt=XD,edgesFocusable:ht,edgesReconnectable:it,elementsSelectable:et=!0,defaultViewport:Pt=A4t,minZoom:we=.5,maxZoom:Oe=2,translateExtent:Je=Eh,preventScrolling:nt=!0,nodeExtent:De,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:pt=!0,zoomOnPinch:It=!0,panOnScroll:nn=!1,panOnScrollSpeed:gn=.5,panOnScrollMode:Ct=Oc.Free,zoomOnDoubleClick:xn=!0,panOnDrag:rn=!0,onPaneClick:lr,onPaneMouseEnter:_r,onPaneMouseMove:Ln,onPaneMouseLeave:Yn,onPaneScroll:sn,onPaneContextMenu:$n,paneClickDistance:Cn=1,nodeClickDistance:mt=0,children:an,onReconnect:Xe,onReconnectStart:ot,onReconnectEnd:en,onEdgeContextMenu:Be,onEdgeDoubleClick:Qe,onEdgeMouseEnter:pn,onEdgeMouseMove:Xn,onEdgeMouseLeave:Vt,reconnectRadius:wt=10,onNodesChange:on,onEdgesChange:yn,noDragClassName:bn="nodrag",noWheelClassName:wn="nowheel",noPanClassName:An="nopan",fitView:Hn,fitViewOptions:jr,connectOnClick:cs,attributionPosition:us,proOptions:yr,defaultEdgeOptions:Ci,elevateNodesOnSelect:Qn=!0,elevateEdgesOnSelect:Tt=!1,disableKeyboardA11y:pr=!1,autoPanOnConnect:vn,autoPanOnNodeDrag:Ge,autoPanOnSelection:Lt=!0,autoPanSpeed:Os,connectionRadius:Cs,isValidConnection:Es,onError:es,style:Is,id:ha,nodeDragThreshold:Zt,connectionDragThreshold:mr,viewport:Bs,onViewportChange:qr,width:wr,height:Ut,colorMode:Ho="light",debug:ei,onScroll:cr,ariaLabelConfig:$s,zIndexMode:Po="basic",...qn},Ei){const _a=ha||"1",ti=D4t(Ho),ni=T.useCallback(ds=>{ds.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),cr==null||cr(ds)},[cr]);return f.jsx("div",{"data-testid":"rf__wrapper",...qn,onScroll:ni,style:{...Is,...c5t},ref:Ei,className:Ur(["react-flow",s,ti]),id:ha,role:"application",children:f.jsxs(l5t,{nodes:e,edges:n,width:wr,height:Ut,fitView:Hn,fitViewOptions:jr,minZoom:we,maxZoom:Oe,nodeOrigin:Jt,nodeExtent:De,zIndexMode:Po,children:[f.jsx(R4t,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:g,onConnectStart:S,onConnectEnd:k,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Fe,autoPanOnNodeFocus:Ot,nodesConnectable:xt,nodesFocusable:Nt,edgesFocusable:ht,edgesReconnectable:it,elementsSelectable:et,elevateNodesOnSelect:Qn,elevateEdgesOnSelect:Tt,minZoom:we,maxZoom:Oe,nodeExtent:De,onNodesChange:on,onEdgesChange:yn,snapToGrid:ze,snapGrid:Ne,connectionMode:B,translateExtent:Je,connectOnClick:cs,defaultEdgeOptions:Ci,fitView:Hn,fitViewOptions:jr,onNodesDelete:I,onEdgesDelete:$,onDelete:P,onNodeDragStart:M,onNodeDrag:z,onNodeDragStop:D,onSelectionDrag:Z,onSelectionDragStart:W,onSelectionDragStop:U,onMove:_,onMoveStart:h,onMoveEnd:m,noPanClassName:An,nodeOrigin:Jt,rfId:_a,autoPanOnConnect:vn,autoPanOnNodeDrag:Ge,autoPanSpeed:Os,onError:es,connectionRadius:Cs,isValidConnection:Es,selectNodesOnDrag:qe,nodeDragThreshold:Zt,connectionDragThreshold:mr,onBeforeDelete:L,debug:ei,ariaLabelConfig:$s,zIndexMode:Po}),f.jsx(s5t,{onInit:d,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:C,onNodeContextMenu:j,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:l,connectionLineType:X,connectionLineStyle:V,connectionLineComponent:ae,connectionLineContainerStyle:ce,selectionKeyCode:se,selectionOnDrag:G,selectionMode:ne,deleteKeyCode:oe,multiSelectionKeyCode:_e,panActivationKeyCode:le,zoomActivationKeyCode:ue,onlyRenderVisibleElements:Ie,defaultViewport:Pt,translateExtent:Je,minZoom:we,maxZoom:Oe,preventScrolling:nt,zoomOnScroll:pt,zoomOnPinch:It,zoomOnDoubleClick:xn,panOnScroll:nn,panOnScrollSpeed:gn,panOnScrollMode:Ct,panOnDrag:rn,autoPanOnSelection:Lt,onPaneClick:lr,onPaneMouseEnter:_r,onPaneMouseMove:Ln,onPaneMouseLeave:Yn,onPaneScroll:sn,onPaneContextMenu:$n,paneClickDistance:Cn,nodeClickDistance:mt,onSelectionContextMenu:Y,onSelectionStart:J,onSelectionEnd:H,onReconnect:Xe,onReconnectStart:ot,onReconnectEnd:en,onEdgeContextMenu:Be,onEdgeDoubleClick:Qe,onEdgeMouseEnter:pn,onEdgeMouseMove:Xn,onEdgeMouseLeave:Vt,reconnectRadius:wt,defaultMarkerColor:At,noDragClassName:bn,noWheelClassName:wn,noPanClassName:An,rfId:_a,disableKeyboardA11y:pr,nodeExtent:De,viewport:Bs,onViewportChange:qr}),f.jsx(j4t,{onSelectionChange:F}),an,f.jsx(k4t,{proOptions:yr,position:us}),f.jsx(S4t,{rfId:_a,disableKeyboardA11y:pr})]})})}var d5t=QD(u5t);function f5t({dimensions:e,lineWidth:n,variant:t,className:r}){return f.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ur(["react-flow__background-pattern",t,r])})}function h5t({radius:e,className:n}){return f.jsx("circle",{cx:e,cy:e,r:e,className:Ur(["react-flow__background-pattern","dots",n])})}var jo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(jo||(jo={}));const _5t={[jo.Dots]:1,[jo.Lines]:1,[jo.Cross]:6},p5t=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function SL({id:e,variant:n=jo.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:l,bgColor:o,style:c,className:d,patternClassName:_}){const h=T.useRef(null),{transform:m,patternId:g}=mn(p5t,ir),S=r||_5t[n],k=n===jo.Dots,v=n===jo.Cross,b=Array.isArray(t)?t:[t,t],x=[b[0]*m[2]||1,b[1]*m[2]||1],y=S*m[2],C=Array.isArray(i)?i:[i,i],j=v?[y,y]:x,N=[C[0]*m[2]||1+j[0]/2,C[1]*m[2]||1+j[1]/2],M=`${g}${e||""}`;return f.jsxs("svg",{className:Ur(["react-flow__background",d]),style:{...c,...lg,"--xy-background-color-props":o,"--xy-background-pattern-color-props":l},ref:h,"data-testid":"rf__background",children:[f.jsx("pattern",{id:M,x:m[0]%x[0],y:m[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:k?f.jsx(h5t,{radius:y/2,className:_}):f.jsx(f5t,{dimensions:j,lineWidth:s,variant:n,className:_})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}SL.displayName="Background";const m5t=T.memo(SL);function g5t(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function b5t(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function v5t(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 x5t(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 y5t(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 Q0({children:e,className:n,...t}){return f.jsx("button",{type:"button",className:Ur(["react-flow__controls-button",n]),...t,children:e})}const w5t=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function kL({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:l,onFitView:o,onInteractiveChange:c,className:d,children:_,position:h="bottom-left",orientation:m="vertical","aria-label":g}){const S=or(),{isInteractive:k,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:x}=mn(w5t,ir),{zoomIn:y,zoomOut:C,fitView:j}=gw(),N=()=>{y(),i==null||i()},M=()=>{C(),l==null||l()},z=()=>{j(s),o==null||o()},D=()=>{S.setState({nodesDraggable:!k,nodesConnectable:!k,elementsSelectable:!k}),c==null||c(!k)},I=m==="horizontal"?"horizontal":"vertical";return f.jsxs(og,{className:Ur(["react-flow__controls",I,d]),position:h,style:e,"data-testid":"rf__controls","aria-label":g??x["controls.ariaLabel"],children:[n&&f.jsxs(f.Fragment,{children:[f.jsx(Q0,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:b,children:f.jsx(g5t,{})}),f.jsx(Q0,{onClick:M,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:v,children:f.jsx(b5t,{})})]}),t&&f.jsx(Q0,{className:"react-flow__controls-fitview",onClick:z,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:f.jsx(v5t,{})}),r&&f.jsx(Q0,{className:"react-flow__controls-interactive",onClick:D,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:k?f.jsx(y5t,{}):f.jsx(x5t,{})}),_]})}kL.displayName="Controls";T.memo(kL);function S5t({id:e,x:n,y:t,width:r,height:s,style:i,color:l,strokeColor:o,strokeWidth:c,className:d,borderRadius:_,shapeRendering:h,selected:m,onClick:g}){const{background:S,backgroundColor:k}=i||{},v=l||S||k;return f.jsx("rect",{className:Ur(["react-flow__minimap-node",{selected:m},d]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:v,stroke:o,strokeWidth:c},shapeRendering:h,onClick:g?b=>g(b,e):void 0})}const k5t=T.memo(S5t),C5t=e=>e.nodes.map(n=>n.id),Hv=e=>e instanceof Function?e:()=>e;function E5t({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=k5t,onClick:l}){const o=mn(C5t,ir),c=Hv(n),d=Hv(e),_=Hv(t),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:o.map(m=>f.jsx(z5t,{id:m,nodeColorFunc:c,nodeStrokeColorFunc:d,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:l,shapeRendering:h},m))})}function N5t({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:o,onClick:c}){const{node:d,x:_,y:h,width:m,height:g}=mn(S=>{const k=S.nodeLookup.get(e);if(!k)return{node:void 0,x:0,y:0,width:0,height:0};const v=k.internals.userNode,{x:b,y:x}=k.internals.positionAbsolute,{width:y,height:C}=$o(v);return{node:v,x:b,y:x,width:y,height:C}},ir);return!d||d.hidden||!ED(d)?null:f.jsx(o,{x:_,y:h,width:m,height:g,style:d.style,selected:!!d.selected,className:r(d),color:n(d),borderRadius:s,strokeColor:t(d),strokeWidth:i,shapeRendering:l,onClick:c,id:d.id})}const z5t=T.memo(N5t);var j5t=T.memo(E5t);const A5t=200,T5t=150,M5t=e=>!e.hidden,R5t=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?SD(i_(e.nodeLookup,{filter:M5t}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},D5t="react-flow__minimap-desc";function CL({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:o,bgColor:c,maskColor:d,maskStrokeColor:_,maskStrokeWidth:h,position:m="bottom-right",onClick:g,onNodeClick:S,pannable:k=!1,zoomable:v=!1,ariaLabel:b,inversePan:x,zoomStep:y=1,offsetScale:C=5}){const j=or(),N=T.useRef(null),{boundingRect:M,viewBB:z,rfId:D,panZoom:I,translateExtent:$,flowWidth:P,flowHeight:F,ariaLabelConfig:W}=mn(R5t,ir),Z=(e==null?void 0:e.width)??A5t,U=(e==null?void 0:e.height)??T5t,Y=M.width/Z,J=M.height/U,H=Math.max(Y,J),L=H*Z,B=H*U,X=C*H,V=M.x-(L-M.width)/2-X,ae=M.y-(B-M.height)/2-X,ce=L+X*2,oe=B+X*2,se=`${D5t}-${D}`,G=T.useRef(0),ne=T.useRef();G.current=H,T.useEffect(()=>{if(N.current&&I)return ne.current=Gyt({domNode:N.current,panZoom:I,getTransform:()=>j.getState().transform,getViewScale:()=>G.current}),()=>{var ze;(ze=ne.current)==null||ze.destroy()}},[I]),T.useEffect(()=>{var ze;(ze=ne.current)==null||ze.update({translateExtent:$,width:P,height:F,inversePan:x,pannable:k,zoomStep:y,zoomable:v})},[k,v,x,y,$,P,F]);const le=g?ze=>{var qe;const[Ne,Ie]=((qe=ne.current)==null?void 0:qe.pointer(ze))||[0,0];g(ze,{x:Ne,y:Ie})}:void 0,_e=S?T.useCallback((ze,Ne)=>{const Ie=j.getState().nodeLookup.get(Ne).internals.userNode;S(ze,Ie)},[]):void 0,ue=b??W["minimap.ariaLabel"];return f.jsx(og,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*H:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Ur(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:Z,height:U,viewBox:`${V} ${ae} ${ce} ${oe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:N,onClick:le,children:[ue&&f.jsx("title",{id:se,children:ue}),f.jsx(j5t,{onClick:_e,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:l,nodeComponent:o}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-X},${ae-X}h${ce+X*2}v${oe+X*2}h${-ce-X*2}z - M${z.x},${z.y}h${z.width}v${z.height}h${-z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}CL.displayName="MiniMap";T.memo(CL);const L5t=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,O5t={[Sd.Line]:"right",[Sd.Handle]:"bottom-right"};function I5t({nodeId:e,position:n,variant:t=Sd.Handle,className:r,style:s=void 0,children:i,color:l,minWidth:o=10,minHeight:c=10,maxWidth:d=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:m,autoScale:g=!0,shouldResize:S,onResizeStart:k,onResize:v,onResizeEnd:b}){const x=nL(),y=typeof e=="string"?e:x,C=or(),j=T.useRef(null),N=t===Sd.Handle,M=mn(T.useCallback(L5t(N&&g),[N,g]),ir),z=T.useRef(null),D=n??O5t[t];T.useEffect(()=>{if(!(!j.current||!y))return z.current||(z.current=s4t({domNode:j.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:$,transform:P,snapGrid:F,snapToGrid:W,nodeOrigin:Z,domNode:U}=C.getState();return{nodeLookup:$,transform:P,snapGrid:F,snapToGrid:W,nodeOrigin:Z,paneDomNode:U}},onChange:($,P)=>{const{triggerNodeChanges:F,nodeLookup:W,parentLookup:Z,nodeOrigin:U}=C.getState(),Y=[],J={x:$.x,y:$.y},H=W.get(y);if(H&&H.expandParent&&H.parentId){const L=H.origin??U,B=$.width??H.measured.width??0,X=$.height??H.measured.height??0,V={id:H.id,parentId:H.parentId,rect:{width:B,height:X,...ND({x:$.x??H.position.x,y:$.y??H.position.y},{width:B,height:X},H.parentId,W,L)}},ae=mw([V],W,Z,U);Y.push(...ae),J.x=$.x?Math.max(L[0]*B,$.x):void 0,J.y=$.y?Math.max(L[1]*X,$.y):void 0}if(J.x!==void 0&&J.y!==void 0){const L={id:y,type:"position",position:{...J}};Y.push(L)}if($.width!==void 0&&$.height!==void 0){const B={id:y,type:"dimensions",resizing:!0,setAttributes:m?m==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};Y.push(B)}for(const L of P){const B={...L,type:"position"};Y.push(B)}F(Y)},onEnd:({width:$,height:P})=>{const F={id:y,type:"dimensions",resizing:!1,dimensions:{width:$,height:P}};C.getState().triggerNodeChanges([F])}})),z.current.update({controlPosition:D,boundaries:{minWidth:o,minHeight:c,maxWidth:d,maxHeight:_},keepAspectRatio:h,resizeDirection:m,onResizeStart:k,onResize:v,onResizeEnd:b,shouldResize:S}),()=>{var $;($=z.current)==null||$.destroy()}},[D,o,c,d,_,h,k,v,b,S]);const I=D.split("-");return f.jsx("div",{className:Ur(["react-flow__resize-control","nodrag",...I,t,r]),ref:j,style:{...s,scale:M,...l&&{[N?"backgroundColor":"borderColor"]:l}},children:i})}T.memo(I5t);function B5t(){const[e,n]=T.useState(0),[t,r]=T.useState(0);return{ref:T.useCallback(i=>{if(!i)return;function l(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(l),c=new MutationObserver(l);return o.observe(i),c.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),l(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const J0=8;function $5t(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},l]=T.useState({viewWidth:0,viewHeight:0});T.useEffect(()=>{function _(){l({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,c=0,d=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,c=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,c=e.y-r-_;break}const h=o,m=c;o=Math.min(Math.max(o,J0),i-t-J0),c=Math.min(Math.max(c,J0),s-r-J0),d=e.anchor==="left"||e.anchor==="right"?m-c:h-o}return{x:o,y:c,arrowAdjustment:d}}const Pv=380,Fv=12,H5t=350,P5t=150,Ox=new EventTarget;function F5t(){Ox.dispatchEvent(new Event("move"))}function U5t(e,n){const[t,r]=T.useState(null),s=T.useRef(void 0),i=T.useRef(void 0);T.useEffect(()=>{const d=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return Ox.addEventListener("move",d),()=>{Ox.removeEventListener("move",d),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),T.useEffect(()=>{r(d=>{var h;if(!d)return d;const _=((h=e.current)==null?void 0:h.getBoundingClientRect())??null;return _&&d.x===_.x&&d.y===_.y&&d.width===_.width&&d.height===_.height?d:_})},[e,n]);const l=T.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var d;r(((d=e.current)==null?void 0:d.getBoundingClientRect())??null)},H5t)},[e]),o=T.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),P5t)},[]),c=T.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:l,onMouseLeave:o,keepOpen:c}}function q5t(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(E(),t)}function G5t({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:l,onMouseEnter:o,onMouseLeave:c}){const d=B5t(),_=s.right+Fv+Pv<=window.innerWidth,h=s.x-Fv-Pv>=0,m=_?"right":h?"left":s.y>window.innerHeight/2?"above":"below",{x:g,y:S}=$5t({x:s.x,y:s.y,width:s.width,height:s.height,anchor:m,distance:Fv},d),[k,v]=T.useState(null),b=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null;T.useEffect(()=>{if(v(null),!b)return;let $=!1;return AQe(b).then(P=>{let F=P.diff;if(P.truncated){const Y=F.lastIndexOf(` -diff --git `);F=Y!==-1?F.slice(0,Y+1):F.slice(0,F.lastIndexOf(` -`)+1)}let W=[];try{W=F.trim()?lx(F):[]}catch{return}if(P.truncated&&W.every(Y=>Y.hunks.length===0))return;let Z=0,U=0;for(const Y of W){const J=Z4(Y);Z+=J.additions,U+=J.deletions}$||v({fileCount:W.length,additions:Z,deletions:U,truncated:P.truncated})}).catch(()=>{}),()=>{$=!0}},[b]);const x={done:0,failed:0,cancelled:0,live:0};for(const $ of n)$.status==="done"?x.done+=1:$.status==="failed"?x.failed+=1:$.status==="cancelled"?x.cancelled+=1:x.live+=1;const y=t?Np((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,j=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,N=T.useRef(null),[M,z]=T.useState(!1),[D,I]=T.useState(!1);return T.useEffect(()=>{z(!1)},[j]),T.useEffect(()=>{const $=N.current;$&&I($.scrollHeight>$.clientHeight+1)},[j,M]),Ro.createPortal(f.jsxs("div",{ref:d.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Pv,left:g,top:S,visibility:d.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[f.jsxs("div",{className:"hc-head",children:[f.jsx("span",{className:"hc-slug",children:e.slug}),f.jsx(zo,{status:t?Fi(t):"idle"})]}),e.title&&f.jsx("div",{className:"hc-title",children:e.title}),f.jsxs("div",{className:"hc-actions",children:[i&&f.jsxs("button",{type:"button",...zr(i),children:[f.jsx(sd,{size:13}),Ale()]}),f.jsxs("button",{type:"button",...zr(l),children:[f.jsx(am,{size:13}),ble()]})]}),j&&f.jsx("div",{className:`hc-body${M?" expanded":""}`,ref:N,children:j}),j&&(D||M)&&f.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>z($=>!$),children:M?tN():Oie()}),C&&f.jsx("div",{className:"hc-failure",children:C}),f.jsxs("div",{className:"hc-stats",children:[f.jsx("span",{children:new Intl.ListFormat(E(),{style:"short"}).format([n.length===1?X0e():epe({count:Gt(n.length)}),...x.done>0?[E0e({count:Gt(x.done)})]:[],...x.failed>0?[A0e({count:Gt(x.failed)})]:[],...x.cancelled>0?[w0e({count:Gt(x.cancelled)})]:[],...x.live>0?[F0e({count:Gt(x.live)})]:[]])}),t&&oy(t.backend)&&f.jsx(A4,{backend:t.backend}),y&&f.jsx("span",{children:y}),t&&f.jsx("span",{children:Ba(t.createdAt)})]}),f.jsxs("div",{className:"hc-git",children:[f.jsxs("div",{className:"hc-git-row",children:[f.jsxs("span",{className:"hc-branch",title:e.branchName,children:[f.jsx(om,{size:12}),e.branchName]}),r&&f.jsxs("span",{children:[Ele()," ",f.jsx("span",{children:r})]})]}),k&&k.fileCount>0&&f.jsx("div",{className:"hc-git-row",title:k.truncated?WI({parent:Ee(r??"parent")}):UI({parent:Ee(r??"parent")}),children:f.jsxs("span",{children:[k.truncated&&"≥ ",f.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",k.additions]})," ",f.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",k.deletions]})," · ",k.fileCount===1&&!k.truncated?V0e():k.truncated?B0e({count:Gt(k.fileCount)}):D0e({count:Gt(k.fileCount)})]})})]}),f.jsxs("div",{className:"hc-foot",children:[f.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),f.jsxs("span",{children:[wle()," ",q5t(e.createdAt)]})]})]}),document.body)}const zE=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),V5t=264,jE=132,mp=44,W5t=72,K5t=148,Y5t=44;function X5t(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const l=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(l):t.push(l)}const r=(i,l)=>i.exp.createdAt-l.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function Z5t(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((d,_)=>d+r(_),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function l(o){if(n(o)){const _=[];let h=0;for(const m of o.children)i(m)?_.push(...l(m)):h+=r(m);return h>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:h,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let c=0;const d=[];return(function _(h){c+=1;for(const m of h.children)n(m)?d.push(...l(m)):i(m)?_(m):c+=r(m)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:d}]}return e.flatMap(l)}function Ix(e){return e.kind==="exp"?V5t:K5t}function ep(e){return e.kind==="exp"?e.exp.id:e.id}function gp(e){if(e.children.length===0)return Ix(e);const n=e.children.reduce((t,r)=>t+gp(r),0)+mp*(e.children.length-1);return Math.max(Ix(e),n)}function Q5t(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const J5t=T.memo(function({data:n}){qc();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:l,githubOwner:o,githubRepo:c,onOpenView:d,onOpenCode:_}=n,h=r?Fi(r):void 0,m=h==="running"||h==="starting"||h==="cancelling",g=i?EWe():m?PWe():wo(),S=s.slice(-8),k=T.useRef(null),v=U5t(k,n);return f.jsxs("div",{ref:k,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${m?"live":""}`,onMouseEnter:v.onMouseEnter,onMouseLeave:v.onMouseLeave,children:[f.jsx(Hl,{type:"target",position:bt.Top}),f.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...zr(b=>d(t.id,"overview",b)),children:[f.jsxs("div",{className:"node-eyebrow",children:[f.jsx("span",{children:g}),f.jsx(zo,{status:h??"idle"})]}),f.jsx("div",{className:"node-head",children:f.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&f.jsx("div",{className:"node-title",children:t.title||t.description}),f.jsxs("div",{className:"node-meta",children:[f.jsx("span",{children:EKe()}),S.length>0?f.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:S.map(b=>f.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${Q5t(Fi(b))}`,title:GT(Fi(b))},b.id))}):f.jsx("span",{children:_Ke()}),f.jsx("span",{className:"flex-1"}),r&&f.jsx("span",{children:Ba(r.createdAt)})]})]}),f.jsxs("div",{className:"node-actions",onClick:b=>b.stopPropagation(),children:[s.length>0&&f.jsxs("button",{className:"node-action",title:bKe(),...zr(b=>d(t.id,"terminal",b)),children:[f.jsx(sd,{size:13}),WN()]}),f.jsxs("button",{className:"node-action",title:UE({branch:Ee(t.branchName)}),...zr(b=>_(t.id,t.branchName,"files",b)),children:[f.jsx(am,{size:13}),JWe()]}),o&&c&&f.jsx("a",{className:"node-action node-action-ext",title:xp({name:Ee(t.branchName)}),"aria-label":xp({name:Ee(t.branchName)}),href:lm(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:b=>b.stopPropagation(),children:f.jsx(Rm,{size:13})})]}),f.jsx(Hl,{type:"source",position:bt.Bottom}),v.rect&&f.jsx(G5t,{exp:t,runs:s,latestRun:r,parentSlug:l,anchor:v.rect,onOpenLogs:s.length>0?b=>d(t.id,"terminal",b):void 0,onOpenCode:b=>_(t.id,t.branchName,"files",b),onMouseEnter:v.keepOpen,onMouseLeave:v.onMouseLeave})]})}),e3t=T.memo(function({data:n}){qc();const{count:t,onShowProjectScope:r}=n;return f.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:AKe(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[f.jsx(Hl,{type:"target",position:bt.Top}),f.jsx(Zx,{size:14}),f.jsxs("span",{className:"elided-node-label",children:[t===1?IWe():RWe({count:Gt(t)}),f.jsx("span",{className:"elided-node-sub",children:wKe()})]}),f.jsx(Hl,{type:"source",position:bt.Bottom})]})}),t3t={exp:J5t,elided:e3t},EL={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},n3t={...EL.style,strokeDasharray:"4 4"};function r3t({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:l}){const{nodes:o,edges:c}=T.useMemo(()=>{const d=new Map;for(const b of n){const x=d.get(b.experimentId);x?x.push(b):d.set(b.experimentId,[b])}for(const b of d.values())b.sort((x,y)=>x.createdAt-y.createdAt);const _=[],h=[],m=b=>!i||b.exp.chatSessionId===i,g=Z5t(X5t(e),m),S=new Map(e.map(b=>[b.id,b.slug]));function k(b,x,y){const C=x-Ix(b)/2;if(b.kind==="exp"){const M=d.get(b.exp.id)??[];_.push({id:b.exp.id,type:"exp",position:{x:C,y},data:{exp:b.exp,latestRun:M[M.length-1]??null,runs:M,isBaseline:!b.exp.parentExperimentId,parentSlug:b.exp.parentExperimentId?S.get(b.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else _.push({id:b.id,type:"elided",position:{x:C,y:y+(jE-Y5t)/2},data:{count:b.count,onShowProjectScope:l}});if(b.children.length===0)return;const j=b.children.reduce((M,z)=>M+gp(z),0)+mp*(b.children.length-1);let N=x-j/2;for(const M of b.children){const z=gp(M),D=b.kind==="elided"||M.kind==="elided";h.push({id:`e-${ep(b)}-${ep(M)}`,source:ep(b),target:ep(M),...D?{style:n3t}:{}}),k(M,N+z/2,y+jE+W5t),N+=z+mp}}let v=0;for(const b of g){const x=gp(b);k(b,v+x/2,0),v+=x+mp}return{nodes:_,edges:h}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,l]);return e.length===0?f.jsxs("div",{className:zE,children:[f.jsx("p",{className:"empty-state-title",children:uKe()}),f.jsx("p",{className:"empty-state-hint",children:YWe()})]}):o.length===0&&i?f.jsxs("div",{className:zE,children:[f.jsx("p",{className:"empty-state-title",children:aKe()}),f.jsx("p",{className:"empty-state-hint",children:GWe()})]}):f.jsx(d5t,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:o,edges:c,nodeTypes:t3t,defaultEdgeOptions:EL,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:F5t,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:f.jsx(m5t,{variant:jo.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const AE=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" "),Uv=(e,n)=>e.id===n.id&&e.view===n.view,Du=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,vw=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,vo=(e,n,t)=>`${e}:${n??""}:${vw(t)}`,NL=e=>({...e,lineScrollRequest:void 0});function If(e){return typeof e=="object"&&"path"in e?NL(e):e}const Lu=(e,n)=>e.branch===n.branch;function Kt(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${vw(e)}`:`experiment:${e.id}:${e.view}`}function Bf(e,n){const t=e.filter(r=>Kt(r)!==n);return t.length===e.length?e:t}function s3t(e){return e!==void 0}function TE(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===Gf&&n){const r={path:Qv,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[Kt(r)],panelOpen:!0}}if(e===pz){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(Kt),panelOpen:!0}}if(e===mz){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(Kt),panelOpen:!0}}return t}function i3t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a3t(e,n,t,r,s){let i=e,l;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const d=m=>{const g=v=>v.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[S,k]=[g(i),g(m)];return S===k?"":S.startsWith(`${k}/`)?S.slice(k.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&c?d(c):null,h=i.startsWith("/")&&o?d(o):null;if(!i.startsWith("/"))l=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(h!==null)i=h;else{const m=s?i3t(s):"[^/]+",g=i.match(new RegExp(`/files/${m}/(.+)$`)),S=g?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),k=g||S?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(g)return{path:g[1],source:"artifacts"};S?(l=S[1],i=S[2]):k&&(i=k[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:l}:null}function o3t(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const Bx="orx:panel-width",zL="orx:experiments-view";function l3t(){try{return localStorage.getItem(zL)==="tree"?"tree":"table"}catch{return"table"}}const Th=360,c3t=10,u3t=272,d3t=380,f3t=u3t+56,h3t=80,_3t=48;function bp(){return Math.max(Th,window.innerWidth-f3t-d3t)}function p3t(){const e=bp();try{const n=Number(localStorage.getItem(Bx));if(Number.isFinite(n)&&n>=Th)return Math.min(n,e)}catch{}return Math.max(Th,Math.min(760,e,Math.round(window.innerWidth*.4)))}function $f(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function ME(e){const n=T.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function RE({runtime:e}){var Yl;const n=qc(),{status:t}=PT(e.kind==="local"),[r,s]=T.useState(null),[i,l]=T.useState(null),o=T.useRef(void 0);o.current=i==null?void 0:i.tourCompleted;const c=T.useRef(!1),[d,_]=T.useState(null),h=T.useRef(null),[m,g]=T.useState(null),[S,k]=T.useState([]),[v,b]=T.useState([]),x=T.useRef(v);x.current=v;const y=T.useRef(new Map),C=T.useRef(new Set),j=T.useRef(null),N=T.useRef(!1),M=T.useRef(new Map),z=T.useRef(new Map),D=T.useRef(0),I=T.useRef(S);I.current=S;const[$,P]=T.useState(null),[F,W]=T.useState(l3t),[Z,U]=T.useState("project"),Y=T.useRef(null),{open:J,setOpen:H,ref:L}=da(Y),[B,X]=T.useState(null),[V,ae]=T.useState(!1),ce=S.every(ie=>ie.chatSessionId),oe=B&&ce?Z:"project",se=T.useMemo(()=>oe!=="agent"?S:S.filter(ie=>ie.chatSessionId===B),[S,oe,B]),G=T.useMemo(()=>{if(oe!=="agent")return v;const ie=new Set(se.map(ve=>ve.id));return v.filter(ve=>ie.has(ve.experimentId))},[v,se,oe]);T.useEffect(()=>{try{localStorage.setItem(zL,F)}catch{}},[F]);const[ne,le]=T.useState(null),[_e,ue]=T.useState("experiments"),[ze,Ne]=T.useState([]),[Ie,qe]=T.useState(!1),[Fe,Ot]=T.useState(!1),[xt,Nt]=T.useState(!1),[Jt,ht]=T.useState([]),[it,et]=T.useState([]),Pt=T.useRef(new Map),we=T.useRef(new Map),Oe=T.useRef(0),[Je,nt]=T.useState([]),[De,At]=T.useState([]),[pt,It]=T.useState([]),[nn,gn]=T.useState([]),[Ct,xn]=T.useState(null),[rn,lr]=T.useState("files"),[_r,Ln]=T.useState(new Set),[Yn,sn]=T.useState(!1),[$n,Cn]=T.useState(!1),[mt,an]=T.useState(p3t),[Xe,ot]=T.useState(!0),[en,Be]=T.useState(!1),[Qe,pn]=T.useState(!1),[Xn,Vt]=T.useState("chat"),[wt,on]=T.useState(null),yn=T.useRef(new Map),bn=T.useRef(TE()),wn=T.useRef(null),An=T.useRef(!1),Hn=T.useRef(ze);Hn.current=ze;const jr=T.useRef(nn);jr.current=nn;const cs=T.useRef(null),us=T.useCallback(ie=>{const ve=[...ie];jr.current=ve,gn(ve)},[]),yr=T.useCallback(ie=>{cs.current=ie,xn(ie)},[]),Ci=T.useCallback(ie=>{const ve=Kt(ie);ht($e=>Bf($e,ve)),et($e=>Bf($e,ve)),nt($e=>Bf($e,ve)),At($e=>Bf($e,ve)),It($e=>Bf($e,ve));const Se=mr.current;Se&&"path"in ie&&Pt.current.delete(vo(Se,wn.current,ie));const Me=Hn.current.filter($e=>Kt($e)!==ve);Hn.current=Me,Ne(Me)},[]),Qn=T.useCallback(ie=>{An.current=!1;const ve=Kt(ie),Se=[...Hn.current.filter(Me=>Kt(Me)!==ve),If(ie)];Hn.current=Se,Ne(Se),ue(ie)},[]),Tt=T.useCallback((ie,ve)=>{An.current=!1;const Se=Kt(ie),Me=cs.current,$e=Tft({order:jr.current,previewKey:Me?Kt(Me):null},Se,ve);$e.replacedKey&&Me&&typeof Me!="string"&&Kt(Me)===$e.replacedKey&&Ci(Me),us($e.order),$e.previewKey===null?yr(null):$e.previewKey===Se&&yr(If(ie));const _t=[...Hn.current.filter(lt=>Kt(lt)!==Se),If(ie)];Hn.current=_t,Ne(_t),ue(ie)},[Ci,us,yr]),pr=T.useCallback(ie=>{const ve=cs.current;ve&&Kt(ve)===Kt(ie)&&yr(null)},[yr]);T.useEffect(()=>{let ie=!1;const ve=Me=>{const $e=cs.current,_t=Me.target;if(_t instanceof Element&&_t.closest("input, textarea, [contenteditable='true']")!==null){ie=!1;return}if($e&&Kt($e)===Kt(bn.current.rightTab)&&(Me.metaKey||Me.ctrlKey)&&!Me.altKey&&!Me.shiftKey&&Me.key.toLowerCase()==="k"){Me.preventDefault(),ie=!0;return}if(ie&&Me.key==="Enter"){Me.preventDefault(),ie=!1;const Bt=cs.current;Bt&&pr(Bt);return}ie=!1},Se=()=>{ie=!1};return window.addEventListener("keydown",ve),window.addEventListener("blur",Se),window.addEventListener("pointerdown",Se),()=>{window.removeEventListener("keydown",ve),window.removeEventListener("blur",Se),window.removeEventListener("pointerdown",Se)}},[pr]);const vn=T.useCallback((ie,ve)=>{An.current=!1;const Se=Kt(ie),Me=cs.current;Me&&Kt(Me)===Se&&yr(null);const $e=Mft({order:jr.current,previewKey:Me?Kt(Me):null},Se,Hn.current.map(Kt));us($e.order);const _t=Hn.current.filter(Bt=>Kt(Bt)!==Se);if(Hn.current=_t,Ne(_t),!ve)return;const lt=$e.fallbackKey?_t.find(Bt=>Kt(Bt)===$e.fallbackKey):void 0;lt?ue(lt):(sn(!1),Cn(!1))},[us,yr]),Ge=T.useCallback(ie=>{ie!=="chat"&&(An.current=!1),Vt(ie)},[]);bn.current={rightTab:If(_e),tabHistory:ze,experimentsTabOpen:Ie,filesTabOpen:Fe,artifactsTabOpen:xt,expTabs:Jt,fileTabs:it,planTabs:Je,subagentTabs:De,codeTabs:pt,contentTabOrder:jr.current,previewTab:cs.current,filesView:rn,filesToggled:_r,selectedRunId:ne,scope:Z,panelOpen:Yn,panelMax:$n};const Lt=T.useCallback(ie=>{const ve=wn.current;if(ve===ie)return;ve&&yn.current.set(ve,bn.current);let Se=ie?yn.current.get(ie):void 0;if(!Se){const Me=ie===Gf&&o.current===!1&&!c.current;Me&&(c.current=!0,ae(!0)),Se=TE(ie??void 0,Me)}if(ie&&An.current){An.current=!1;const Me="experiments";Se={...Se,rightTab:Me,tabHistory:[...Se.tabHistory.filter($e=>Kt($e)!==Kt(Me)),Me],experimentsTabOpen:!0,panelOpen:!0}}ue(Se.rightTab),Hn.current=Se.tabHistory,Ne(Se.tabHistory),qe(Se.experimentsTabOpen),Ot(Se.filesTabOpen),Nt(Se.artifactsTabOpen),ht(Se.expTabs),et(Se.fileTabs),nt(Se.planTabs),At(Se.subagentTabs),It(Se.codeTabs),us(Se.contentTabOrder),yr(Se.previewTab),lr(Se.filesView),Ln(Se.filesToggled),le(Se.selectedRunId),U(Se.scope),sn(Se.panelOpen),Cn(Se.panelMax),wn.current=ie,X(ie)},[us,yr]),Os=(i==null?void 0:i.onboardingCompleted)??!1,[Cs,Es]=T.useState(!1),es=T.useCallback(()=>Es(!0),[]),Is=T.useCallback(async()=>{const ie=await CS({tourCompleted:!0});l(ve=>ve&&{...ve,tourCompleted:ie.tourCompleted}),Es(!1)},[]),ha=T.useCallback(async()=>{await Is(),pn(!0)},[Is]);T.useEffect(()=>{!m||!g0(m)||en||!Os||i!=null&&i.tourCompleted||es()},[m,en,Os,es,i==null?void 0:i.tourCompleted]);const Zt=(r==null?void 0:r.find(ie=>ie.id===m))??null;T.useEffect(()=>{const ie=en||d||i===null?null:Zt==null?void 0:Zt.name;document.title=ie?`${Oa(ie)} — OpenResearch`:"OpenResearch"},[en,d,i,Zt]);const mr=T.useRef(m);mr.current=m;const Bs=T.useCallback(()=>{Vt("chat"),qe(!0),Qn("experiments"),sn(!0),wn.current||(An.current=!0)},[Qn]),qr=T.useCallback(()=>{_(null),s(null),l(null),Promise.allSettled([pQe(),gQe()]).then(([ie,ve])=>{const Se=[];ie.status==="fulfilled"?(s(ie.value),g(Me=>{var $e;return Me&&ie.value.some(_t=>_t.id===Me)?Me:(($e=ie.value[0])==null?void 0:$e.id)??null})):Se.push(LG()),ve.status==="fulfilled"?(h.current=ve.value.preferredAgent,l(ve.value)):Se.push(YG()),Se.length>0&&_(JG({items:new Intl.ListFormat(E()).format(Se)}))})},[]);T.useEffect(()=>{qr()},[qr]);const wr=T.useRef(Promise.resolve()),Ut=T.useRef(0),Ho=T.useCallback(ie=>{const ve=++Ut.current;l(Me=>Me&&{...Me,preferredAgent:ie});const Se=wr.current.then(()=>CS({preferredAgent:ie})).then(Me=>{h.current=Me.preferredAgent,ve===Ut.current&&l($e=>$e&&{...$e,preferredAgent:Me.preferredAgent})}).catch(Me=>{throw ve===Ut.current&&l($e=>$e&&{...$e,preferredAgent:h.current}),Me});return wr.current=Se.catch(()=>{}),Se},[]);T.useEffect(()=>{const ie=()=>an(ve=>Math.min(ve,bp()));return window.addEventListener("resize",ie),()=>window.removeEventListener("resize",ie)},[]);const ei=T.useCallback(ie=>{N.current=!1,M.current.clear(),z.current.clear();const ve=++D.current;iy(ie).then(Se=>{if(mr.current!==ie||j.current!==ie||D.current!==ve)return;M.current=new Map(Se.map($e=>[$e.id,$e]));const Me=[...z.current.values()].some($e=>{const _t=M.current.get($e.id);return!_t||_t.status!=="running"&&_t.updatedAt<=$e.updatedAt});z.current.clear();for(const $e of Se){const _t=y.current.get($e.id);(!_t||_t.updatedAt<$e.updatedAt)&&y.current.set($e.id,$e)}b($e=>{const _t=new Map(Se.map(lt=>[lt.id,lt]));for(const lt of $e){const Bt=_t.get(lt.id);(!Bt||Bt.updatedAt<=lt.updatedAt)&&_t.set(lt.id,lt)}return[..._t.values()]}),N.current=!0,Me&&Bs()}).catch(()=>{D.current===ve&&z.current.clear()})},[Bs]);T.useEffect(()=>{if(!m)return;const ie=wn.current;ie&&yn.current.set(ie,bn.current),wn.current=null,An.current=!1,X(null),j.current=m,y.current.clear(),C.current.clear(),EQe(m).catch(()=>{}),k([]),b([]),P(null),le(null),ht([]),et([]),ae(!1),nt([]),At([]),It([]),us([]),yr(null),lr("files"),Ln(new Set),Hn.current=[],Ne([]),ue("experiments"),qe(!1),Ot(!1),Nt(!1),sn(!1),Cn(!1),U("project"),zQe(m).then(k).catch(()=>{}),ei(m),MS(m).then(P).catch(()=>{})},[ei,m,us,yr]);const cr=T.useCallback(()=>{const ie=mr.current;ie&&MS(ie).then(P).catch(()=>{})},[]),$s=T.useCallback(()=>{cr(),Vt("chat"),Nt(!0),Qn("artifacts"),sn(!0)},[cr,Qn]);jet({onReconnect:()=>{const ie=mr.current;ie&&(j.current=ie,y.current.clear(),C.current.clear(),ei(ie))},onRun:ie=>{if(ie.projectId!==mr.current||ie.projectId!==j.current)return;const ve=y.current.get(ie.id),Se=C.current.has(ie.id);if(ve&&ve.updatedAt>ie.updatedAt||(y.current.set(ie.id,ie),C.current.add(ie.id),b(_t=>$f(_t,ie)),ie.status!=="running"||(ve==null?void 0:ve.status)==="running"))return;const Me=M.current.get(ie.id),$e=N.current&&(!Me||Me.status!=="running"&&Me.updatedAt<=ie.updatedAt);Se&&ve||$e?Bs():N.current||z.current.set(ie.id,ie)},onExperiment:ie=>{ie.projectId===mr.current&&k(ve=>$f(ve,ie))},onProject:ie=>{s(ve=>ve?$f(ve,ie):[ie])},onArtifacts:ie=>{ie===mr.current&&cr()}});const Po=T.useCallback(()=>U("project"),[]),qn=T.useCallback((ie,ve="overview",Se="preview")=>{const Me={id:ie,view:ve};ht($e=>$e.some(_t=>Uv(_t,Me))?$e:[...$e,Me]),Tt(Me,Se),sn(!0)},[Tt]),Ei=T.useCallback((ie,ve="preview")=>{const Se=x.current.filter($e=>$e.id===ie||$e.id.startsWith(ie)),Me=Se.length===1?Se[0]:null;Me&&(le(Me.id),qn(Me.experimentId,"terminal",ve))},[qn]),_a=T.useMemo(()=>new Map(S.map(ie=>{var ve;return[ie.id,((ve=ie.title)==null?void 0:ve.trim())||ie.slug||wo()]})),[S,n]),ti=ME(_a),ni=T.useMemo(()=>{const ie=new Map;for(const ve of v)ie.set(ve.id,ti.get(ve.experimentId)??wo());return ie},[ti,v,n]),ds=ME(ni),Ni=T.useCallback(ie=>{const ve=ds.get(ie);if(ve)return ve;const Se=[...ds].filter(([Me])=>Me.startsWith(ie));return Se.length===1?Se[0][1]:""},[ds]),ri=T.useCallback(ie=>{const ve=ti.get(ie);if(ve)return ve;const Se=[...ti].filter(([Me])=>Me.startsWith(ie));return Se.length===1?Se[0][1]:""},[ti]),Fo=T.useCallback((ie,ve="preview")=>{const Se=I.current.filter(Me=>Me.id===ie||Me.id.startsWith(ie));Se.length===1&&qn(Se[0].id,"overview",ve)},[qn]),Zr=T.useCallback(ie=>{const ve=Jt.findIndex(Se=>Uv(Se,ie));ve!==-1&&(ht(Se=>Se.filter((Me,$e)=>$e!==ve)),vn(ie,Kt(_e)===Kt(ie)))},[Jt,vn,_e]),On=T.useCallback((ie,ve="preview")=>{const Se=NL(ie);et(Me=>{const $e=Me.findIndex(lt=>Du(lt,ie));if($e===-1)return[...Me,Se];const _t=Me.slice();return _t[$e]=Se,_t}),Tt(ie,ve),sn(!0)},[Tt]),pa=T.useCallback((ie,ve,Se,Me,$e,_t)=>{const lt=r==null?void 0:r.find(Fs=>Fs.id===m),Bt=a3t(ie,lt==null?void 0:lt.repoPath,ve,(lt==null?void 0:lt.artifactsDir)??(lt==null?void 0:lt.filesDir),lt==null?void 0:lt.slug);if(!Bt)return null;const Mn=$e?I.current.find(Fs=>Fs.id===$e||$e.length>=6&&Fs.id.startsWith($e)):void 0,zs=Se??(Mn==null?void 0:Mn.branchName),ms=Bt.source==null||Bt.source==="repo";return zs&&ms&&(Bt.ref=zs),_t&&!Bt.ref&&ms&&(Bt.branchLabel=_t),Me!=null&&(Bt.line=Me,Bt.lineScrollRequest=++Oe.current),Bt},[r,m]),Uo=T.useCallback((ie,ve,Se,Me,$e,_t,lt="preview")=>{const Bt=pa(ie,ve,Se,Me,$e,_t);Bt&&On(Bt,lt)},[On,pa]),Od=T.useCallback(ie=>On({path:ie,source:"artifacts"},"keepOpen"),[On]),fs=T.useCallback((ie,ve,Se,Me,$e,_t="preview")=>{const lt=pa(ie,ve,$e,Se,Me);lt&&On(lt,_t)},[On,pa]),gr=T.useCallback((ie,ve)=>{pr(ie),ve()},[pr]),Vl=T.useCallback(ie=>{const ve=it.findIndex(Me=>Du(Me,ie));if(ve===-1)return;const Se=m?vo(m,B,ie):null;Se&&we.current.has(Se)&&!W1t(Rde())||(et(Me=>Me.filter(($e,_t)=>_t!==ve)),Se&&(Pt.current.delete(Se),we.current.delete(Se)),B===Gf&&Du(ie,{path:Qv,source:"artifacts"})&&ae(!1),vn(ie,Kt(_e)===Kt(ie)))},[B,it,vn,m,_e]),ma=T.useCallback(ie=>{ie.lineScrollRequest!==void 0&&ue(ve=>typeof ve!="object"||!("path"in ve)||!Du(ve,ie)||ve.lineScrollRequest!==ie.lineScrollRequest?ve:If(ve))},[]),ga=T.useCallback((ie,ve,Se,Me="preview")=>{const $e={kind:"plan",sessionId:ve,promptId:Se,plan:ie};nt(_t=>{const lt=_t.findIndex(Mn=>Mn.promptId===Se);if(lt===-1)return[..._t,$e];const Bt=_t.slice();return Bt[lt]=$e,Bt}),Tt($e,Me),sn(!0)},[Tt]),Vi=T.useCallback(ie=>{const ve=Je.findIndex(Se=>Se.promptId===ie.promptId);ve!==-1&&(nt(Se=>Se.filter((Me,$e)=>$e!==ve)),vn(ie,Kt(_e)===Kt(ie)))},[vn,Je,_e]),qo=T.useCallback((ie,ve,Se,Me="preview")=>{const $e={kind:"subagent",sessionId:ie,spawnPartId:ve,label:Se};At(_t=>_t.some(lt=>lt.spawnPartId===ve)?_t:[..._t,$e]),Tt($e,Me),sn(!0)},[Tt]),Go=T.useCallback(ie=>{const ve=De.findIndex(Se=>Se.spawnPartId===ie.spawnPartId);ve!==-1&&(At(Se=>Se.filter((Me,$e)=>$e!==ve)),vn(ie,Kt(_e)===Kt(ie)))},[vn,_e,De]),[Za,Zn]=T.useState({});T.useEffect(()=>{if(Zn(lt=>{const Bt=new Set(De.map(Mn=>Mn.spawnPartId));return Object.keys(lt).every(Mn=>Bt.has(Mn))?lt:Object.fromEntries(Object.entries(lt).filter(([Mn])=>Bt.has(Mn)))}),De.length===0)return;let ie=!0;const ve=new Set,Se=(lt,Bt,Mn)=>{Zn(zs=>{var Fs;let ms=zs;for(const gs of Bt)if(!(Mn&&ve.has(gs.spawnPartId)))for(const Vo of lt){const Yi=$4(Vo.parts,gs.spawnPartId);if(!Yi)continue;Mn||ve.add(gs.spawnPartId);const Xl={label:A0t(Yi),running:((Fs=Yi.state)==null?void 0:Fs.status)==="running"},Zl=ms[gs.spawnPartId];(!Zl||Zl.label!==Xl.label||Zl.running!==Xl.running)&&(ms===zs&&(ms={...zs}),ms[gs.spawnPartId]=Xl);break}return ms})};let Me=0;const $e=()=>{const lt=++Me;for(const Bt of new Set(De.map(Mn=>Mn.sessionId)))Uu(Bt).then(({messages:Mn})=>{ie&<===Me&&Se(Mn,De.filter(zs=>zs.sessionId===Bt),!0)}).catch(()=>{})};$e();const _t=od(lt=>{if(lt.type==="reconnected"){ve.clear(),$e();return}if(lt.type!=="message")return;const Bt=De.filter(Mn=>Mn.sessionId===lt.sessionId);Bt.length&&Se([lt.message],Bt,!1)});return()=>{ie=!1,_t()}},[De]);const hs=T.useCallback((ie,ve,Se="files",Me="preview")=>{const $e={code:!0,experimentId:ie,branch:ve,view:Se,toggled:new Set};It(_t=>_t.some(lt=>Lu(lt,$e))?_t.map(lt=>Lu(lt,$e)?{...lt,experimentId:ie,view:Se}:lt):[..._t,$e]),Tt($e,Me),sn(!0)},[Tt]),Ar=T.useCallback((ie,ve)=>{It(Se=>Se.map(Me=>Lu(Me,ie)?{...Me,...ve}:Me))},[]),ts=T.useCallback(ie=>{const ve=pt.findIndex(Se=>Lu(Se,ie));ve!==-1&&(It(Se=>Se.filter((Me,$e)=>$e!==ve)),vn(ie,Kt(_e)===Kt(ie)))},[pt,vn,_e]),Gr=T.useCallback(()=>{Vt("chat"),Ot(!0),Qn("files"),sn(!0)},[Qn]),ba=T.useCallback(ie=>{ie==="experiments"?qe(!1):ie==="files"?Ot(!1):Nt(!1),vn(ie,_e===ie)},[vn,_e]),Ns=ie=>{ie.preventDefault(),ie.currentTarget.setPointerCapture(ie.pointerId);const Se=document.body.style.userSelect;document.body.style.userSelect="none";const Me=$n,$e=ie.clientX,_t=mt;let lt=!1;function Bt(){window.removeEventListener("pointermove",Mn),window.removeEventListener("pointerup",Bt),window.removeEventListener("pointercancel",Bt),document.body.style.userSelect=Se}function Mn(zs){if(Me){const Vo=zs.clientX-$e;if(lt||Vo<_3t)return;lt=!0,Cn(!1);const Yi=Math.min(Math.max(_t,Th),bp());an(Yi);try{localStorage.setItem(Bx,String(Yi))}catch{}window.removeEventListener("pointermove",Mn);return}const ms=Math.round(window.innerWidth-zs.clientX-c3t),Fs=bp();if(ms>Fs+h3t){Cn(!0);return}Cn(!1);const gs=Math.min(Math.max(ms,Th),Fs);an(gs);try{localStorage.setItem(Bx,String(gs))}catch{}}window.addEventListener("pointermove",Mn),window.addEventListener("pointerup",Bt),window.addEventListener("pointercancel",Bt)},Qa=(ie,ve)=>{s(Se=>Se?$f(Se,ie):[ie]),g(ie.id),Be(!1),ve&&(on({projectId:ie.id,message:ve}),Ge("git"))},va=ie=>{s(ve=>ve&&ve.filter(Se=>Se.id!==ie)),m===ie&&g(null)},ns=typeof _e=="object"&&"id"in _e?_e:null,Tn=typeof _e=="object"&&"path"in _e?_e:null,ur=(Tn==null?void 0:Tn.source)==="artifacts"&&$?xh($.entries,Tn.path):null,Wi=ur?`${ur.modifiedAt}:${ur.size}`:null,Ki=B===Gf&&V?it.find(ie=>Du(ie,{path:Qv,source:"artifacts"})):void 0,si=Ki?[Ki]:[],_s=typeof _e=="object"&&"kind"in _e&&_e.kind==="plan"?_e:null,Vr=typeof _e=="object"&&"kind"in _e&&_e.kind==="subagent"?_e:null,Hs=typeof _e=="object"&&"code"in _e?_e:null,Sr=Hs?pt.find(ie=>Lu(ie,Hs))??null:null,zi=new Map;for(const ie of[...Jt,...it,...Je,...De,...pt])zi.set(Kt(ie),ie);const Wl=Ki?Kt(Ki):null,Kl=nn.filter(ie=>ie!==Wl).map(ie=>zi.get(ie)).filter(s3t),Ja=ie=>Ct!==null&&Kt(Ct)===Kt(ie),Qc=ie=>f.jsx(Cl,{active:Tn!==null&&Du(Tn,ie),label:ie.path.split("/").pop()||ie.path,icon:f.jsx(az,{size:12,className:"shrink-0"}),preview:Ja(ie),onSelect:()=>Qn(ie),onPromote:()=>pr(ie),onClose:()=>Vl(ie)},`file:${vw(ie)}`),Ps=ns?S.find(ie=>ie.id===ns.id)??null:null,ps=Sr?S.find(ie=>ie.id===Sr.experimentId)??null:null,Id=ie=>{var Se,Me;if("path"in ie)return Qc(ie);if("id"in ie){const $e=S.find(_t=>_t.id===ie.id);return f.jsx(Cl,{active:ns!==null&&Uv(ns,ie),label:$e?$e.title||$e.slug:"…",icon:ie.view==="overview"?f.jsx(AXe,{size:12,className:"shrink-0"}):f.jsx(sd,{size:12,className:"shrink-0"}),preview:Ja(ie),onSelect:()=>Qn(ie),onPromote:()=>pr(ie),onClose:()=>Zr(ie)},Kt(ie))}if("kind"in ie&&ie.kind==="plan")return f.jsx(Cl,{active:_s!==null&&_s.promptId===ie.promptId,label:ZE(),icon:f.jsx(ry,{size:12,className:"shrink-0"}),preview:Ja(ie),onSelect:()=>Qn(ie),onPromote:()=>pr(ie),onClose:()=>Vi(ie)},Kt(ie));if("kind"in ie)return f.jsx(Cl,{active:Vr!==null&&Vr.spawnPartId===ie.spawnPartId,label:((Se=Za[ie.spawnPartId])==null?void 0:Se.label)??ie.label??rV(),shimmer:((Me=Za[ie.spawnPartId])==null?void 0:Me.running)??!1,icon:f.jsx(sy,{size:12,className:"shrink-0"}),preview:Ja(ie),onSelect:()=>Qn(ie),onPromote:()=>pr(ie),onClose:()=>Go(ie)},Kt(ie));const ve=S.find($e=>$e.id===ie.experimentId);return f.jsx(Cl,{active:Sr!==null&&Lu(Sr,ie),label:(ve==null?void 0:ve.slug)??ie.branch,icon:f.jsx(sh,{size:12,className:"shrink-0"}),preview:Ja(ie),onSelect:()=>Qn(ie),onPromote:()=>pr(ie),onClose:()=>ts(ie)},Kt(ie))};if(d)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsxs("div",{className:AE,children:[f.jsx("p",{children:d}),f.jsx(He,{variant:"primary",onClick:qr,children:Ml()})]}),e.kind==="ssh"&&f.jsx(Ff,{runtime:e,corner:!0})]});if(r===null||i===null)return f.jsxs("div",{className:"app flex flex-col h-full",children:[f.jsx("div",{className:AE,children:f.jsx(Rt,{})}),e.kind==="ssh"&&f.jsx(Ff,{runtime:e,corner:!0})]});if(r.length===0)return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(_9,{}),e.kind==="local"&&f.jsx(Q8,{status:t}),Os?f.jsx(x9,{remote:e.kind==="ssh",projects:r,onOpen:g,onCreated:Qa,onDeleted:va}):f.jsx(mbt,{preferredAgent:i.preferredAgent,onDone:(ie,ve)=>{E_t(),h.current=ve,s([ie]),g(ie.id),l(Se=>({...Se??{tourCompleted:!1},onboardingCompleted:!0,preferredAgent:ve}))}}),e.kind==="ssh"&&f.jsx(Ff,{runtime:e,corner:!0})]});const Jc=f.jsx(_bt,{projectName:((Yl=r.find(ie=>ie.id===m))==null?void 0:Yl.name)??"",onHome:()=>Be(!0),onNewProject:()=>pn(!0),onRepository:()=>Ge("git"),onCollapse:()=>ot(!1)});return f.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&f.jsx(_9,{}),e.kind==="local"&&f.jsx(Q8,{status:t}),en?f.jsxs(f.Fragment,{children:[f.jsx(x9,{remote:e.kind==="ssh",projects:r,onOpen:ie=>{g(ie),Be(!1)},onCreated:Qa,onDeleted:va}),e.kind==="ssh"&&f.jsx(Ff,{runtime:e,corner:!0})]}):f.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[m&&f.jsx(U0t,{projectId:m,projectName:(Zt==null?void 0:Zt.name)??"",railHeader:Jc,railOpen:Xe,onShowRail:()=>ot(!0),mainView:Xn,onSelectMainView:Ge,experimentsActive:Xn==="chat"&&Yn&&_e==="experiments",filesActive:Xn==="chat"&&Yn&&_e==="files",artifactsActive:Xn==="chat"&&Yn&&_e==="artifacts",onOpenExperiments:Bs,onOpenArtifacts:$s,onOpenFile:fs,onOpenRun:Ei,runExperimentName:Ni,onOpenExperiment:Fo,experimentName:ri,onOpenPlan:ga,onOpenSubagent:qo,onOpenWorktree:Gr,composerPrefill:Zt&&g0(Zt.id)&&(i==null?void 0:i.tourCompleted)===!1?_Qe:null,runtime:e,onOpenDemoWelcome:Zt&&g0(Zt.id)?es:void 0,onActiveSessionChange:Lt,preferredAgent:i.preferredAgent,onPreferredAgentChange:Ho,children:Xn==="skills"?f.jsx(H1t,{}):Xn!=="chat"?f.jsx(d_t,{remote:e.kind==="ssh",tab:Xn,project:Zt,githubPublicationError:wt&&wt.projectId===(Zt==null?void 0:Zt.id)?wt.message:null,onProjectUpdate:ie=>{s(ve=>ve?$f(ve,ie):[ie]),ie.githubEnabled&&on(null)},onSelectTab:Ge}):null}),Xn==="chat"&&Yn&&f.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${$n?"max":""}`,style:$n?void 0:{width:mt},"data-onboarding":"experiments",children:[f.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${$n?"cursor-e-resize":"cursor-col-resize"}`,title:$n?Wq():Uq(),onPointerDown:Ns}),f.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[f.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[si.map(Qc),Fe&&f.jsx(Cl,{active:_e==="files",label:pG(),icon:f.jsx(sh,{size:12,className:"shrink-0"}),onSelect:()=>Qn("files"),onClose:()=>ba("files")}),xt&&f.jsx(Cl,{active:_e==="artifacts",label:Rq(),icon:f.jsx(ey,{size:12,className:"shrink-0"}),onSelect:()=>Qn("artifacts"),onClose:()=>ba("artifacts")}),Ie&&f.jsx(Cl,{active:_e==="experiments",label:dG(),icon:f.jsx(Qx,{size:12,className:"shrink-0"}),onSelect:()=>Qn("experiments"),onClose:()=>ba("experiments")}),Kl.map(Id)]}),f.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[f.jsx(qt,{title:$n?J6():Q6(),"aria-label":$n?J6():Q6(),onClick:()=>Cn(ie=>!ie),children:$n?f.jsx(AZe,{size:14}):f.jsx(NZe,{size:14})}),f.jsx(qt,{title:yp(),"aria-label":yp(),onClick:()=>{An.current=!1,sn(!1),Cn(!1)},children:f.jsx(Br,{size:14})})]})]}),_e==="artifacts"?f.jsx(yo,{children:Zt&&f.jsx(M1t,{project:Zt,artifacts:$,onChanged:cr,onOpenFile:Od,canRenameFile:ie=>!we.current.has(vo(Zt.id,B,{path:ie,source:"artifacts"})),onOpenStorage:e.kind==="ssh"?void 0:()=>Ge("storage")},Zt.id)}):_e==="experiments"?f.jsxs(yo,{children:[f.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[f.jsx("span",{className:"flex-1"}),f.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[f.jsxs("div",{className:"option-picker relative inline-flex",ref:L,children:[f.jsx(qt,{size:"small",ref:Y,className:"experiment-scope-trigger",active:oe==="agent",title:rG({scope:oe==="agent"?X6():Z6()}),"aria-label":vG(),"aria-expanded":J,onClick:()=>H(ie=>!ie),children:f.jsx(fZe,{size:16,strokeWidth:2.5})}),J&&f.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[f.jsxs(Nr,{"aria-pressed":oe==="agent",disabled:!B||!ce,title:B?ce?void 0:SG():TG(),onClick:()=>{U("agent"),H(!1)},children:[f.jsx("span",{children:X6()}),oe==="agent"&&f.jsx(mi,{size:13})]}),f.jsxs(Nr,{"aria-pressed":oe==="project",onClick:()=>{U("project"),H(!1)},children:[f.jsx("span",{children:Z6()}),oe==="project"&&f.jsx(mi,{size:13})]})]})]}),f.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":oG(),children:[f.jsx("button",{className:F==="table"?"active":"","aria-pressed":F==="table",onClick:()=>W("table"),children:oV()}),f.jsx("button",{className:F==="tree"?"active":"","aria-pressed":F==="tree",onClick:()=>W("tree"),children:dV()})]})]})]}),f.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:F==="tree"?Zt&&f.jsx(r3t,{experiments:S,runs:G,project:Zt,onOpenView:qn,onOpenCode:hs,agentSessionId:oe==="agent"?B:null,onShowProjectScope:Po}):f.jsx(Nbt,{runs:G,emptyHint:oe==="agent"&&S.length>0?NG():void 0,experiments:se,onOpen:(ie,ve)=>{qn(ie.id,"overview",ve)},onOpenLogs:(ie,ve,Se)=>{le(ve),qn(ie,"terminal",Se)},onOpenCode:(ie,ve)=>{const Se=S.find(Me=>Me.id===ie);Se&&hs(Se.id,Se.branchName,"files",ve)},onCancel:xz})})]}):_e==="files"?f.jsx(yo,{children:Zt?f.jsx(x1t,{sessionId:B??void 0,project:Zt,view:rn,toggled:_r,onViewChange:lr,onToggledChange:Ln,canRenameFile:ie=>!we.current.has(vo(Zt.id,B,{path:ie,source:"repo",sessionId:B??void 0})),onOpenFile:(ie,ve,Se,Me)=>Uo(ie,ve,Se,void 0,void 0,void 0,Me)},`files:${B??`project:${Zt.id}`}`):f.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:f.jsx(Qu,{children:f.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[f.jsx(oz,{size:22}),f.jsx("p",{children:GG()})]})})})}):Tn?f.jsx(yo,{children:m&&f.jsx(hbt,{remote:e.kind==="ssh",projectId:m,path:Tn.path,source:Tn.source,sessionId:Tn.source==="artifacts"?B??void 0:Tn.sessionId,gitRef:Tn.ref,line:Tn.line,branchLabel:o3t(Tn,Zt==null?void 0:Zt.baselineBranch),artifactVersion:Wi,artifactEntries:Tn.source==="artifacts"?$==null?void 0:$.entries:void 0,initialBuffer:we.current.get(vo(m,B,Tn)),onBufferStateChange:ie=>{const ve=vo(m,B,Tn);ie?we.current.set(ve,ie):we.current.delete(ve)},onOpenFile:(ie,ve,Se,Me)=>gr(Tn,()=>Uo(ie,ve,Se,void 0,void 0,void 0,Me)),scrollPosition:Pt.current.get(vo(m,B,Tn)),onScrollPositionChange:ie=>{Pt.current.set(vo(m,B,Tn),ie)},lineScrollRequest:Tn.lineScrollRequest,onLineScrollRequestHandled:()=>ma(Tn),onEdit:()=>pr(Tn)},vo(m,B,Tn))}):_s?f.jsx(yo,{children:f.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:f.jsx($a,{text:_s.plan,onOpenFile:(ie,ve,Se,Me,$e)=>gr(_s,()=>Uo(ie,_s.sessionId,Me,ve,Se,void 0,$e))})})}):Vr?f.jsx(q0t,{sessionId:Vr.sessionId,spawnPartId:Vr.spawnPartId,onOpenFile:(ie,ve,Se,Me,$e)=>gr(Vr,()=>fs(ie,Vr.sessionId,ve,Se,Me,$e)),onOpenRun:(ie,ve)=>gr(Vr,()=>Ei(ie,ve)),runExperimentName:Ni,onOpenExperiment:(ie,ve)=>gr(Vr,()=>Fo(ie,ve)),experimentName:ri,onOpenSubagent:(ie,ve,Se)=>gr(Vr,()=>qo(Vr.sessionId,ie,ve,Se))},Vr.spawnPartId):Sr?f.jsx(yo,{children:m&&Zt&&Sr&&ps&&f.jsx(v1t,{projectId:m,project:Zt,experiment:ps,view:Sr.view,toggled:Sr.toggled,onViewChange:ie=>Ar(Sr,{view:ie}),onToggledChange:ie=>Ar(Sr,{toggled:ie}),onOpenFile:(ie,ve,Se,Me)=>gr(Sr,()=>Uo(ie,ve,Se,void 0,void 0,ps.branchName,Me))},`code:${Sr.branch}`)}):f.jsx(yo,{children:ns&&Ps&&Zt&&f.jsx(G1t,{experiment:Ps,project:Zt,view:ns.view,runs:v,selectedRunId:ne,onSelectRun:le,parentExperiment:S.find(ie=>ie.id===Ps.parentExperimentId)??null,onOpenView:(ie,ve,Se)=>{ve&&le(ve),gr(ns,()=>qn(Ps.id,ie,Se))},onOpenCode:(ie,ve)=>gr(ns,()=>hs(Ps.id,Ps.branchName,ie,ve))},`${ns.id}:${ns.view}`)})]})]}),Qe&&f.jsx($R,{remote:e.kind==="ssh",onClose:()=>pn(!1),onCreated:(ie,ve)=>{pn(!1),Qa(ie,ve)}}),Cs&&!en&&Zt&&g0(Zt.id)&&f.jsx(zbt,{onClose:Is,onCreateProject:ha})]})}const m3t="data:image/svg+xml,"+encodeURIComponent('');function g3t(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?m3t:"/favicon.svg")}function DE(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function b3t(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!DE("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&Oz(n),!DE("orx:locale")&&t&&HE(t)&&ZN(t)}function v3t(e){return e.includes("ssh ")&&e.includes("failed")}function LE({host:e,overlay:n=!1}){return f.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:xN({host:Ee(e)})}),f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:Vv()}),f.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:fSe()})]})})}function OE({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var D,I,$;const{session:s}=e,[i,l]=T.useState(s.installPaths),[o,c]=T.useState(!1),[d,_]=T.useState(null);T.useEffect(()=>l(s.installPaths),[(D=s.installPaths)==null?void 0:D.binary,(I=s.installPaths)==null?void 0:I.database,($=s.installPaths)==null?void 0:$.cache]);async function h(){if(i){c(!0);try{await fJe(i)}catch(P){fr(P instanceof Error?P.message:String(P),"error")}finally{c(!1)}}}async function m(P=!1){r(P?s.error:null),c(!0);try{await hJe()}catch(F){fr(F instanceof Error?F.message:String(F),"error")}finally{c(!1)}}async function g(){c(!0);try{await Ez()}catch(P){fr(P instanceof Error?P.message:String(P),"error")}finally{c(!1)}}async function S(){c(!0);try{_(await Nz())}catch(P){fr(P instanceof Error?P.message:String(P),"error")}finally{c(!1)}}async function k(){if(d){c(!0);try{await zz(d),_(null)}catch(P){_(null),fr(P instanceof Error?P.message:String(P),"error")}finally{c(!1)}}}async function v(){c(!0);try{await _Je()}catch(P){fr(P instanceof Error?P.message:String(P),"error")}finally{c(!1)}}const b=s.status==="applying"||o,x=s.status==="needsInstall",y=s.status==="needsUpdate",C=i&&x,j=["connecting","applying","reconnecting"].includes(s.status),N=s.status==="disconnected"&&s.error!==null&&v3t(s.error)&&t!==s.error&&!s.canStartNewHost,M=x?HSe():y?Z8e():s.status==="applying"?b7e({host:Ee(s.host)}):s.status==="reconnecting"?Cke({host:Ee(s.host)}):s.status==="disconnected"?s.error?lSe({host:Ee(s.host)}):s.canStartNewHost?xSe({host:Ee(s.host)}):xN({host:Ee(s.host)}):I7e({host:Ee(s.host)}),z=s.error??(s.canStartNewHost?mSe():x?QSe({user:Ee(s.user??""),host:Ee(s.host)}):y?W8e({host:Ee(s.host)}):s.status==="applying"?_7e():s.status==="reconnecting"?yke():s.status==="disconnected"?tSe():R7e());return f.jsxs(f.Fragment,{children:[f.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:f.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[f.jsxs("div",{className:"flex items-start gap-3",children:[j&&f.jsx(Rt,{className:"mt-2"}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:M}),!N&&f.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:z})]})]}),N&&f.jsx(M4,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void m(!0)}),C&&f.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[f.jsx("p",{className:"m-0 text-sm text-subtext",children:OSe()}),[["binary",kSe()],["database",MSe()],["cache",zSe()]].map(([P,F])=>f.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[F,f.jsx(ws,{value:i[P],onChange:W=>l({...i,[P]:W.target.value}),disabled:b,dir:"ltr"})]},P)),!s.error&&f.jsx("div",{className:"flex justify-end pt-1",children:f.jsx(He,{variant:"primary",disabled:b,onClick:()=>void h(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(Rt,{})," ",qSe()]}):y?dS():MN()})})]}),y&&i&&f.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&f.jsx(He,{variant:"primary",disabled:b,onClick:()=>void h(),children:b?f.jsxs(f.Fragment,{children:[f.jsx(Rt,{})," ",tCe()]}):dS()})}),s.status==="disconnected"&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?f.jsxs(He,{variant:"primary",disabled:o,onClick:()=>void v(),children:[o?f.jsx(Rt,{}):null,s.error?cS():Lke()]}):f.jsxs(He,{variant:"primary",disabled:o,onClick:()=>void m(),children:[o?f.jsx(Rt,{}):null,cS()]})}),(s.status==="connecting"||s.status==="reconnecting")&&f.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:f.jsx(He,{disabled:o,onClick:()=>void g(),children:Kv()})}),y&&s.error&&f.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[f.jsx(He,{disabled:o,onClick:()=>void g(),children:Kv()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid m(),children:[o?f.jsx(Rt,{}):null,lS()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid S(),children:[o?f.jsx(Rt,{}):null,yN()]})]}),x&&s.error&&f.jsx("div",{className:"mt-6 flex justify-end",children:f.jsxs(He,{variant:"primary",disabled:o,onClick:()=>void m(),children:[o?f.jsx(Rt,{}):null,lS()]})})]})}),d&&f.jsx(dM,{host:s.host,preview:d,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void k()})]})}function x3t({children:e}){const n=T.useRef(null);return T.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),f.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function y3t(){const e=location.pathname==="/remote-launch",[n,t]=T.useState(null),[r,s]=T.useState(null),i=T.useRef(!1),l=T.useRef(!1),o=T.useRef(!1),[c,d]=T.useState(null);if(T.useEffect(()=>{if(e)return;let m=!0,g;const S=async()=>{try{const k=await cJe();if(!m)return;k.kind==="ssh"&&(o.current||(o.current=!0,b3t(k)),k.session.status==="connected"?(i.current=!0,l.current=!0,d(null)):k.session.status==="disconnected"&&k.session.error===null&&(l.current=!1)),t(v=>JSON.stringify(v)===JSON.stringify(k)?v:k),s(null),k.kind==="ssh"&&(g=window.setTimeout(()=>void S(),2e3))}catch(k){m&&(s(k instanceof Error?k.message:String(k)),g=window.setTimeout(()=>void S(),2e3))}};return S(),()=>{m=!1,g!==void 0&&window.clearTimeout(g)}},[e]),T.useEffect(()=>{const m=(n==null?void 0:n.kind)==="ssh";g3t(m),m&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return f.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[f.jsx(Rt,{})," ",_ke()]});if(!n)return f.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?f.jsxs(f.Fragment,{children:[f.jsx("span",{children:r}),f.jsx(He,{onClick:()=>location.reload(),children:Ml()})]}):f.jsx(Rt,{})});if(n.kind==="local")return f.jsx(RE,{runtime:n});if(!(l.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?f.jsx(LE,{host:n.session.host}):f.jsx(OE,{runtime:n,retriedInteractiveError:c,setRetriedInteractiveError:d});const h=n.session.status!=="connected"||r!==null;return f.jsxs("div",{className:"relative h-full",children:[f.jsx("div",{className:"h-full",inert:h,children:f.jsx(RE,{runtime:n})}),h&&f.jsx(x3t,{children:r?f.jsx(LE,{host:n.session.host,overlay:!0}):f.jsx(OE,{runtime:n,overlay:!0,retriedInteractiveError:c,setRetriedInteractiveError:d})})]})}const w3t=E();document.documentElement.lang=w3t;document.documentElement.dir="ltr";iI.createRoot(document.getElementById("root")).render(f.jsxs(T.StrictMode,{children:[f.jsx(y3t,{}),f.jsx(knt,{})]})); diff --git a/ui/dist/assets/index-DiCc4Q1T.js b/ui/dist/assets/index-DiCc4Q1T.js new file mode 100644 index 00000000..3db7af08 --- /dev/null +++ b/ui/dist/assets/index-DiCc4Q1T.js @@ -0,0 +1,1056 @@ +var CP=Object.defineProperty;var Uk=e=>{throw TypeError(e)};var EP=(e,n,t)=>n in e?CP(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Es=(e,n,t)=>EP(e,typeof n!="symbol"?n+"":n,t),qk=(e,n,t)=>n.has(e)||Uk("Cannot "+t);var rr=(e,n,t)=>(qk(e,n,"read from private field"),t?t.call(e):n.get(e)),wi=(e,n,t)=>n.has(e)?Uk("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),gs=(e,n,t,r)=>(qk(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t);var Gk=(e,n,t,r)=>({set _(s){gs(e,n,s,t)},get _(){return rr(e,n,r)}});(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=t(s);fetch(s.href,i)}})();function q_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ov={exports:{}},xh={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vk;function NP(){if(Vk)return xh;Vk=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return xh.Fragment=n,xh.jsx=t,xh.jsxs=t,xh}var Wk;function zP(){return Wk||(Wk=1,Ov.exports=NP()),Ov.exports}var h=zP(),Iv={exports:{}},Wt={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Kk;function jP(){if(Kk)return Wt;Kk=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator;function m(P){return P===null||typeof P!="object"?null:(P=p&&P[p]||P["@@iterator"],typeof P=="function"?P:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,b={};function v(P,X,W){this.props=P,this.context=X,this.refs=b,this.updater=W||x}v.prototype.isReactComponent={},v.prototype.setState=function(P,X){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,X,"setState")},v.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function y(){}y.prototype=v.prototype;function w(P,X,W){this.props=P,this.context=X,this.refs=b,this.updater=W||x}var C=w.prototype=new y;C.constructor=w,S(C,v.prototype),C.isPureReactComponent=!0;var z=Array.isArray;function E(){}var R={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function M(P,X,W){var ie=W.ref;return{$$typeof:e,type:P,key:X,ref:ie!==void 0?ie:null,props:W}}function O(P,X){return M(P.type,X,P.props)}function I(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function H(P){var X={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(W){return X[W]})}var U=/\/+/g;function F(P,X){return typeof P=="object"&&P!==null&&P.key!=null?H(""+P.key):X.toString(36)}function Y(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(E,E):(P.status="pending",P.then(function(X){P.status==="pending"&&(P.status="fulfilled",P.value=X)},function(X){P.status==="pending"&&(P.status="rejected",P.reason=X)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function q(P,X,W,ie,le){var ae=typeof P;(ae==="undefined"||ae==="boolean")&&(P=null);var se=!1;if(P===null)se=!0;else switch(ae){case"bigint":case"string":case"number":se=!0;break;case"object":switch(P.$$typeof){case e:case n:se=!0;break;case _:return se=P._init,q(se(P._payload),X,W,ie,le)}}if(se)return le=le(P),se=ie===""?"."+F(P,0):ie,z(le)?(W="",se!=null&&(W=se.replace(U,"$&/")+"/"),q(le,X,W,"",function(ce){return ce})):le!=null&&(I(le)&&(le=O(le,W+(le.key==null||P&&P.key===le.key?"":(""+le.key).replace(U,"$&/")+"/")+se)),X.push(le)),1;se=0;var G=ie===""?".":ie+":";if(z(P))for(var oe=0;oe>>1,D=q[B];if(0>>1;Bs(W,Z))ies(le,W)?(q[B]=le,q[ie]=Z,B=ie):(q[B]=W,q[X]=Z,B=X);else if(ies(le,Z))q[B]=le,q[ie]=Z,B=ie;else break e}}return Q}function s(q,Q){var Z=q.sortIndex-Q.sortIndex;return Z!==0?Z:q.id-Q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],_=1,f=null,p=3,m=!1,x=!1,S=!1,b=!1,v=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function C(q){for(var Q=t(u);Q!==null;){if(Q.callback===null)r(u);else if(Q.startTime<=q)r(u),Q.sortIndex=Q.expirationTime,n(c,Q);else break;Q=t(u)}}function z(q){if(S=!1,C(q),!x)if(t(c)!==null)x=!0,E||(E=!0,H());else{var Q=t(u);Q!==null&&Y(z,Q.startTime-q)}}var E=!1,R=-1,N=5,M=-1;function O(){return b?!0:!(e.unstable_now()-Mq&&O());){var B=f.callback;if(typeof B=="function"){f.callback=null,p=f.priorityLevel;var D=B(f.expirationTime<=q);if(q=e.unstable_now(),typeof D=="function"){f.callback=D,C(q),Q=!0;break t}f===t(c)&&r(c),C(q)}else r(c);f=t(c)}if(f!==null)Q=!0;else{var P=t(u);P!==null&&Y(z,P.startTime-q),Q=!1}}break e}finally{f=null,p=Z,m=!1}Q=void 0}}finally{Q?H():E=!1}}}var H;if(typeof w=="function")H=function(){w(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,F=U.port2;U.port1.onmessage=I,H=function(){F.postMessage(null)}}else H=function(){v(I,0)};function Y(q,Q){R=v(function(){q(e.unstable_now())},Q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125B?(q.sortIndex=Z,n(u,q),t(c)===null&&q===t(u)&&(S?(y(R),R=-1):S=!0,Y(z,Z-B))):(q.sortIndex=D,n(c,q),x||m||(x=!0,E||(E=!0,H()))),q},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(q){var Q=p;return function(){var Z=p;p=Q;try{return q.apply(this,arguments)}finally{p=Z}}}})(Pv)),Pv}var Zk;function AP(){return Zk||(Zk=1,$v.exports=TP()),$v.exports}var Hv={exports:{}},Ns={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Qk;function RP(){if(Qk)return Ns;Qk=1;var e=G_();function n(c){var u="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Hv.exports=RP(),Hv.exports}/** + * @license React + * react-dom-client.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var e7;function MP(){if(e7)return yh;e7=1;var e=AP(),n=G_(),t=yj();function r(l){var d="https://react.dev/errors/"+l;if(1D||(l.current=B[D],B[D]=null,D--)}function W(l,d){D++,B[D]=l.current,l.current=d}var ie=P(null),le=P(null),ae=P(null),se=P(null);function G(l,d){switch(W(ae,d),W(le,l),W(ie,null),d.nodeType){case 9:case 11:l=(l=d.documentElement)&&(l=l.namespaceURI)?dk(l):0;break;default:if(l=d.tagName,d=d.namespaceURI)d=dk(d),l=hk(d,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}X(ie),W(ie,l)}function oe(){X(ie),X(le),X(ae)}function ce(l){l.memoizedState!==null&&W(se,l);var d=ie.current,g=hk(d,l.type);d!==g&&(W(le,l),W(ie,g))}function pe(l){le.current===l&&(X(ie),X(le)),se.current===l&&(X(se),mh._currentValue=Z)}var ue,Ee;function Te(l){if(ue===void 0)try{throw Error()}catch(g){var d=g.stack.trim().match(/\n( *(at )?)/);ue=d&&d[1]||"",Ee=-1)":-1A||_e[k]!==Se[A]){var Re=` +`+_e[k].replace(" at new "," at ");return l.displayName&&Re.includes("")&&(Re=Re.replace("",l.displayName)),Re}while(1<=k&&0<=A);break}}}finally{Ie=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?Te(g):""}function He(l,d){switch(l.tag){case 26:case 27:case 5:return Te(l.type);case 16:return Te("Lazy");case 13:return l.child!==d&&d!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return Le(l.type,!1);case 11:return Le(l.type.render,!1);case 1:return Le(l.type,!0);case 31:return Te("Activity");default:return""}}function Tt(l){try{var d="",g=null;do d+=He(l,g),g=l,l=l.return;while(l);return d}catch(k){return` +Error generating stack: `+k.message+` +`+k.stack}}var Et=Object.prototype.hasOwnProperty,Vt=e.unstable_scheduleCallback,$t=e.unstable_cancelCallback,rt=e.unstable_shouldYield,nt=e.unstable_requestPaint,ut=e.unstable_now,pt=e.unstable_getCurrentPriorityLevel,ve=e.unstable_ImmediatePriority,Oe=e.unstable_UserBlockingPriority,Je=e.unstable_NormalPriority,ft=e.unstable_LowPriority,mt=e.unstable_IdlePriority,Ht=e.log,Fe=e.unstable_setDisableYieldValue,Pt=null,Jt=null;function nn(l){if(typeof Ht=="function"&&Fe(l),Jt&&typeof Jt.setStrictMode=="function")try{Jt.setStrictMode(Pt,l)}catch{}}var Lt=Math.clz32?Math.clz32:Gn,Rn=Math.log,Kt=Math.LN2;function Gn(l){return l>>>=0,l===0?32:31-(Rn(l)/Kt|0)|0}var cr=256,vn=262144,wr=4194304;function Qn(l){var d=l&42;if(d!==0)return d;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Wn(l,d,g){var k=l.pendingLanes;if(k===0)return 0;var A=0,L=l.suspendedLanes,K=l.pingedLanes;l=l.warmLanes;var ne=k&134217727;return ne!==0?(k=ne&~L,k!==0?A=Qn(k):(K&=ne,K!==0?A=Qn(K):g||(g=ne&~l,g!==0&&(A=Qn(g))))):(ne=k&~L,ne!==0?A=Qn(ne):K!==0?A=Qn(K):g||(g=k&~l,g!==0&&(A=Qn(g)))),A===0?0:d!==0&&d!==A&&(d&L)===0&&(L=A&-A,g=d&-d,L>=g||L===32&&(g&4194048)!==0)?d:A}function Mn(l,d){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&d)===0}function gt(l,d){switch(l){case 1:case 2:case 4:case 8:case 64:return d+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function an(){var l=wr;return wr<<=1,(wr&62914560)===0&&(wr=4194304),l}function Ge(l){for(var d=[],g=0;31>g;g++)d.push(l);return d}function at(l,d){l.pendingLanes|=d,d!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function rn(l,d,g,k,A,L){var K=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var ne=l.entanglements,_e=l.expirationTimes,Se=l.hiddenUpdates;for(g=K&~g;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var Vr=/[\n"\\]/g;function _r(l){return l.replace(Vr,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function go(l,d,g,k,A,L,K,ne){l.name="",K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"?l.type=K:l.removeAttribute("type"),d!=null?K==="number"?(d===0&&l.value===""||l.value!=d)&&(l.value=""+On(d)):l.value!==""+On(d)&&(l.value=""+On(d)):K!=="submit"&&K!=="reset"||l.removeAttribute("value"),d!=null?sa(l,K,On(d)):g!=null?sa(l,K,On(g)):k!=null&&l.removeAttribute("value"),A==null&&L!=null&&(l.defaultChecked=!!L),A!=null&&(l.checked=A&&typeof A!="function"&&typeof A!="symbol"),ne!=null&&typeof ne!="function"&&typeof ne!="symbol"&&typeof ne!="boolean"?l.name=""+On(ne):l.removeAttribute("name")}function us(l,d,g,k,A,L,K,ne){if(L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(l.type=L),d!=null||g!=null){if(!(L!=="submit"&&L!=="reset"||d!=null)){Ut(l);return}g=g!=null?""+On(g):"",d=d!=null?""+On(d):g,ne||d===l.value||(l.value=d),l.defaultValue=d}k=k??A,k=typeof k!="function"&&typeof k!="symbol"&&!!k,l.checked=ne?l.checked:!!k,l.defaultChecked=!!k,K!=null&&typeof K!="function"&&typeof K!="symbol"&&typeof K!="boolean"&&(l.name=K),Ut(l)}function sa(l,d,g){d==="number"&&Ii(l.ownerDocument)===l||l.defaultValue===""+g||(l.defaultValue=""+g)}function Os(l,d,g,k){if(l=l.options,d){d={};for(var A=0;A"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kn=!1;if(Is)try{var di={};Object.defineProperty(di,"passive",{get:function(){Kn=!0}}),window.addEventListener("test",di,di),window.removeEventListener("test",di,di)}catch{Kn=!1}var er=null,Bs=null,pr=null;function pl(){if(pr)return pr;var l,d=Bs,g=d.length,k,A="value"in er?er.value:er.textContent,L=A.length;for(l=0;l=gr),Lc=" ",ia=!1;function vl(l,d){switch(l){case"keyup":return is.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function te(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var be=!1;function Ne(l,d){switch(l){case"compositionend":return te(d);case"keypress":return d.which!==32?null:(ia=!0,Lc);case"textInput":return l=d.data,l===Lc&&ia?null:l;default:return null}}function Me(l,d){if(be)return l==="compositionend"||!ko&&vl(l,d)?(l=pl(),pr=Bs=er=null,be=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1=d)return{node:g,offset:d-l};l=k}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=$d(g)}}function Hd(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?Hd(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Nn(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var d=Ii(l.document);d instanceof l.HTMLIFrameElement;){try{var g=typeof d.contentWindow.location.href=="string"}catch{g=!1}if(g)l=d.contentWindow;else break;d=Ii(l.document)}return d}function la(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}var Co=Is&&"documentMode"in document&&11>=document.documentMode,tr=null,yl=null,Xr=null,W1=!1;function L3(l,d,g){var k=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;W1||tr==null||tr!==Ii(k)||(k=tr,"selectionStart"in k&&la(k)?k={start:k.selectionStart,end:k.selectionEnd}:(k=(k.ownerDocument&&k.ownerDocument.defaultView||window).getSelection(),k={anchorNode:k.anchorNode,anchorOffset:k.anchorOffset,focusNode:k.focusNode,focusOffset:k.focusOffset}),Xr&&xl(Xr,k)||(Xr=k,k=np(yl,"onSelect"),0>=K,A-=K,Ia=1<<32-Lt(d)+A|g<en?(mn=xt,xt=null):mn=xt.sibling;var kn=Ce(xe,xt,we[en],De);if(kn===null){xt===null&&(xt=mn);break}l&&xt&&kn.alternate===null&&d(xe,xt),me=L(kn,me,en),Sn===null?zt=kn:Sn.sibling=kn,Sn=kn,xt=mn}if(en===we.length)return g(xe,xt),gn&&No(xe,en),zt;if(xt===null){for(;enen?(mn=xt,xt=null):mn=xt.sibling;var Ul=Ce(xe,xt,kn.value,De);if(Ul===null){xt===null&&(xt=mn);break}l&&xt&&Ul.alternate===null&&d(xe,xt),me=L(Ul,me,en),Sn===null?zt=Ul:Sn.sibling=Ul,Sn=Ul,xt=mn}if(kn.done)return g(xe,xt),gn&&No(xe,en),zt;if(xt===null){for(;!kn.done;en++,kn=we.next())kn=Be(xe,kn.value,De),kn!==null&&(me=L(kn,me,en),Sn===null?zt=kn:Sn.sibling=kn,Sn=kn);return gn&&No(xe,en),zt}for(xt=k(xt);!kn.done;en++,kn=we.next())kn=je(xt,xe,en,kn.value,De),kn!==null&&(l&&kn.alternate!==null&&xt.delete(kn.key===null?en:kn.key),me=L(kn,me,en),Sn===null?zt=kn:Sn.sibling=kn,Sn=kn);return l&&xt.forEach(function(kP){return d(xe,kP)}),gn&&No(xe,en),zt}function $n(xe,me,we,De){if(typeof we=="object"&&we!==null&&we.type===S&&we.key===null&&(we=we.props.children),typeof we=="object"&&we!==null){switch(we.$$typeof){case m:e:{for(var zt=we.key;me!==null;){if(me.key===zt){if(zt=we.type,zt===S){if(me.tag===7){g(xe,me.sibling),De=A(me,we.props.children),De.return=xe,xe=De;break e}}else if(me.elementType===zt||typeof zt=="object"&&zt!==null&&zt.$$typeof===N&&Uc(zt)===me.type){g(xe,me.sibling),De=A(me,we.props),Wd(De,we),De.return=xe,xe=De;break e}g(xe,me);break}else d(xe,me);me=me.sibling}we.type===S?(De=Bc(we.props.children,xe.mode,De,we.key),De.return=xe,xe=De):(De=v0(we.type,we.key,we.props,null,xe.mode,De),Wd(De,we),De.return=xe,xe=De)}return K(xe);case x:e:{for(zt=we.key;me!==null;){if(me.key===zt)if(me.tag===4&&me.stateNode.containerInfo===we.containerInfo&&me.stateNode.implementation===we.implementation){g(xe,me.sibling),De=A(me,we.children||[]),De.return=xe,xe=De;break e}else{g(xe,me);break}else d(xe,me);me=me.sibling}De=eb(we,xe.mode,De),De.return=xe,xe=De}return K(xe);case N:return we=Uc(we),$n(xe,me,we,De)}if(Y(we))return _t(xe,me,we,De);if(H(we)){if(zt=H(we),typeof zt!="function")throw Error(r(150));return we=zt.call(we),Dt(xe,me,we,De)}if(typeof we.then=="function")return $n(xe,me,E0(we),De);if(we.$$typeof===w)return $n(xe,me,w0(xe,we),De);N0(xe,we)}return typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint"?(we=""+we,me!==null&&me.tag===6?(g(xe,me.sibling),De=A(me,we),De.return=xe,xe=De):(g(xe,me),De=J1(we,xe.mode,De),De.return=xe,xe=De),K(xe)):g(xe,me)}return function(xe,me,we,De){try{Vd=0;var zt=$n(xe,me,we,De);return rf=null,zt}catch(xt){if(xt===nf||xt===k0)throw xt;var Sn=mi(29,xt,null,xe.mode);return Sn.lanes=De,Sn.return=xe,Sn}finally{}}}var Gc=r6(!0),s6=r6(!1),El=!1;function db(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hb(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Nl(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function zl(l,d,g){var k=l.updateQueue;if(k===null)return null;if(k=k.shared,(zn&2)!==0){var A=k.pending;return A===null?d.next=d:(d.next=A.next,A.next=d),k.pending=d,d=b0(l),H3(l,null,g),d}return g0(l,k,d,g),b0(l)}function Kd(l,d,g){if(d=d.updateQueue,d!==null&&(d=d.shared,(g&4194048)!==0)){var k=d.lanes;k&=l.pendingLanes,g|=k,d.lanes=g,on(l,g)}}function _b(l,d){var g=l.updateQueue,k=l.alternate;if(k!==null&&(k=k.updateQueue,g===k)){var A=null,L=null;if(g=g.firstBaseUpdate,g!==null){do{var K={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};L===null?A=L=K:L=L.next=K,g=g.next}while(g!==null);L===null?A=L=d:L=L.next=d}else A=L=d;g={baseState:k.baseState,firstBaseUpdate:A,lastBaseUpdate:L,shared:k.shared,callbacks:k.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=d:l.next=d,g.lastBaseUpdate=d}var pb=!1;function Yd(){if(pb){var l=tf;if(l!==null)throw l}}function Xd(l,d,g,k){pb=!1;var A=l.updateQueue;El=!1;var L=A.firstBaseUpdate,K=A.lastBaseUpdate,ne=A.shared.pending;if(ne!==null){A.shared.pending=null;var _e=ne,Se=_e.next;_e.next=null,K===null?L=Se:K.next=Se,K=_e;var Re=l.alternate;Re!==null&&(Re=Re.updateQueue,ne=Re.lastBaseUpdate,ne!==K&&(ne===null?Re.firstBaseUpdate=Se:ne.next=Se,Re.lastBaseUpdate=_e))}if(L!==null){var Be=A.baseState;K=0,Re=Se=_e=null,ne=L;do{var Ce=ne.lane&-536870913,je=Ce!==ne.lane;if(je?(pn&Ce)===Ce:(k&Ce)===Ce){Ce!==0&&Ce===ef&&(pb=!0),Re!==null&&(Re=Re.next={lane:0,tag:ne.tag,payload:ne.payload,callback:null,next:null});e:{var _t=l,Dt=ne;Ce=d;var $n=g;switch(Dt.tag){case 1:if(_t=Dt.payload,typeof _t=="function"){Be=_t.call($n,Be,Ce);break e}Be=_t;break e;case 3:_t.flags=_t.flags&-65537|128;case 0:if(_t=Dt.payload,Ce=typeof _t=="function"?_t.call($n,Be,Ce):_t,Ce==null)break e;Be=f({},Be,Ce);break e;case 2:El=!0}}Ce=ne.callback,Ce!==null&&(l.flags|=64,je&&(l.flags|=8192),je=A.callbacks,je===null?A.callbacks=[Ce]:je.push(Ce))}else je={lane:Ce,tag:ne.tag,payload:ne.payload,callback:ne.callback,next:null},Re===null?(Se=Re=je,_e=Be):Re=Re.next=je,K|=Ce;if(ne=ne.next,ne===null){if(ne=A.shared.pending,ne===null)break;je=ne,ne=je.next,je.next=null,A.lastBaseUpdate=je,A.shared.pending=null}}while(!0);Re===null&&(_e=Be),A.baseState=_e,A.firstBaseUpdate=Se,A.lastBaseUpdate=Re,L===null&&(A.shared.lanes=0),Ml|=K,l.lanes=K,l.memoizedState=Be}}function i6(l,d){if(typeof l!="function")throw Error(r(191,l));l.call(d)}function a6(l,d){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;lL?L:8;var K=q.T,ne={};q.T=ne,Lb(l,!1,d,g);try{var _e=A(),Se=q.S;if(Se!==null&&Se(ne,_e),_e!==null&&typeof _e=="object"&&typeof _e.then=="function"){var Re=h$(_e,k);Jd(l,d,Re,yi(l))}else Jd(l,d,k,yi(l))}catch(Be){Jd(l,d,{then:function(){},status:"rejected",reason:Be},yi())}finally{Q.p=L,K!==null&&ne.types!==null&&(K.types=ne.types),q.T=K}}function v$(){}function Rb(l,d,g,k){if(l.tag!==5)throw Error(r(476));var A=B6(l).queue;I6(l,A,d,Z,g===null?v$:function(){return $6(l),g(k)})}function B6(l){var d=l.memoizedState;if(d!==null)return d;d={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:Z},next:null};var g={};return d.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:g},next:null},l.memoizedState=d,l=l.alternate,l!==null&&(l.memoizedState=d),d}function $6(l){var d=B6(l);d.next===null&&(d=l.alternate.memoizedState),Jd(l,d.next.queue,{},yi())}function Mb(){return _s(mh)}function P6(){return Cr().memoizedState}function H6(){return Cr().memoizedState}function x$(l){for(var d=l.return;d!==null;){switch(d.tag){case 24:case 3:var g=yi();l=Nl(g);var k=zl(d,l,g);k!==null&&(ti(k,d,g),Kd(k,d,g)),d={cache:lb()},l.payload=d;return}d=d.return}}function y$(l,d,g){var k=yi();g={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},I0(l)?U6(d,g):(g=Z1(l,d,g,k),g!==null&&(ti(g,l,k),q6(g,d,k)))}function F6(l,d,g){var k=yi();Jd(l,d,g,k)}function Jd(l,d,g,k){var A={lane:k,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(I0(l))U6(d,A);else{var L=l.alternate;if(l.lanes===0&&(L===null||L.lanes===0)&&(L=d.lastRenderedReducer,L!==null))try{var K=d.lastRenderedState,ne=L(K,g);if(A.hasEagerState=!0,A.eagerState=ne,Cs(ne,K))return g0(l,d,A,0),Hn===null&&m0(),!1}catch{}finally{}if(g=Z1(l,d,A,k),g!==null)return ti(g,l,k),q6(g,d,k),!0}return!1}function Lb(l,d,g,k){if(k={lane:2,revertLane:dv(),gesture:null,action:k,hasEagerState:!1,eagerState:null,next:null},I0(l)){if(d)throw Error(r(479))}else d=Z1(l,g,k,2),d!==null&&ti(d,l,2)}function I0(l){var d=l.alternate;return l===Qt||d!==null&&d===Qt}function U6(l,d){af=T0=!0;var g=l.pending;g===null?d.next=d:(d.next=g.next,g.next=d),l.pending=d}function q6(l,d,g){if((g&4194048)!==0){var k=d.lanes;k&=l.pendingLanes,g|=k,d.lanes=g,on(l,g)}}var eh={readContext:_s,use:M0,useCallback:vr,useContext:vr,useEffect:vr,useImperativeHandle:vr,useLayoutEffect:vr,useInsertionEffect:vr,useMemo:vr,useReducer:vr,useRef:vr,useState:vr,useDebugValue:vr,useDeferredValue:vr,useTransition:vr,useSyncExternalStore:vr,useId:vr,useHostTransitionStatus:vr,useFormState:vr,useActionState:vr,useOptimistic:vr,useMemoCache:vr,useCacheRefresh:vr};eh.useEffectEvent=vr;var G6={readContext:_s,use:M0,useCallback:function(l,d){return Hs().memoizedState=[l,d===void 0?null:d],l},useContext:_s,useEffect:z6,useImperativeHandle:function(l,d,g){g=g!=null?g.concat([l]):null,D0(4194308,4,R6.bind(null,d,l),g)},useLayoutEffect:function(l,d){return D0(4194308,4,l,d)},useInsertionEffect:function(l,d){D0(4,2,l,d)},useMemo:function(l,d){var g=Hs();d=d===void 0?null:d;var k=l();if(Vc){nn(!0);try{l()}finally{nn(!1)}}return g.memoizedState=[k,d],k},useReducer:function(l,d,g){var k=Hs();if(g!==void 0){var A=g(d);if(Vc){nn(!0);try{g(d)}finally{nn(!1)}}}else A=d;return k.memoizedState=k.baseState=A,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:A},k.queue=l,l=l.dispatch=y$.bind(null,Qt,l),[k.memoizedState,l]},useRef:function(l){var d=Hs();return l={current:l},d.memoizedState=l},useState:function(l){l=Nb(l);var d=l.queue,g=F6.bind(null,Qt,d);return d.dispatch=g,[l.memoizedState,g]},useDebugValue:Tb,useDeferredValue:function(l,d){var g=Hs();return Ab(g,l,d)},useTransition:function(){var l=Nb(!1);return l=I6.bind(null,Qt,l.queue,!0,!1),Hs().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,d,g){var k=Qt,A=Hs();if(gn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=d(),Hn===null)throw Error(r(349));(pn&127)!==0||d6(k,d,g)}A.memoizedState=g;var L={value:g,getSnapshot:d};return A.queue=L,z6(_6.bind(null,k,L,l),[l]),k.flags|=2048,lf(9,{destroy:void 0},h6.bind(null,k,L,g,d),null),g},useId:function(){var l=Hs(),d=Hn.identifierPrefix;if(gn){var g=Ba,k=Ia;g=(k&~(1<<32-Lt(k)-1)).toString(32)+g,d="_"+d+"R_"+g,g=A0++,0<\/script>",L=L.removeChild(L.firstChild);break;case"select":L=typeof k.is=="string"?K.createElement("select",{is:k.is}):K.createElement("select"),k.multiple?L.multiple=!0:k.size&&(L.size=k.size);break;default:L=typeof k.is=="string"?K.createElement(A,{is:k.is}):K.createElement(A)}}L[Ct]=d,L[_n]=k;e:for(K=d.child;K!==null;){if(K.tag===5||K.tag===6)L.appendChild(K.stateNode);else if(K.tag!==4&&K.tag!==27&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===d)break e;for(;K.sibling===null;){if(K.return===null||K.return===d)break e;K=K.return}K.sibling.return=K.return,K=K.sibling}d.stateNode=L;e:switch(ms(L,A,k),A){case"button":case"input":case"select":case"textarea":k=!!k.autoFocus;break e;case"img":k=!0;break e;default:k=!1}k&&Mo(d)}}return Xn(d),Kb(d,d.type,l===null?null:l.memoizedProps,d.pendingProps,g),null;case 6:if(l&&d.stateNode!=null)l.memoizedProps!==k&&Mo(d);else{if(typeof k!="string"&&d.stateNode===null)throw Error(r(166));if(l=ae.current,Qu(d)){if(l=d.stateNode,g=d.memoizedProps,k=null,A=hs,A!==null)switch(A.tag){case 27:case 5:k=A.memoizedProps}l[Ct]=d,l=!!(l.nodeValue===g||k!==null&&k.suppressHydrationWarning===!0||uk(l.nodeValue,g)),l||kl(d,!0)}else l=rp(l).createTextNode(k),l[Ct]=d,d.stateNode=l}return Xn(d),null;case 31:if(g=d.memoizedState,l===null||l.memoizedState!==null){if(k=Qu(d),g!==null){if(l===null){if(!k)throw Error(r(318));if(l=d.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(557));l[Ct]=d}else $c(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Xn(d),l=!1}else g=sb(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return d.flags&256?(bi(d),d):(bi(d),null);if((d.flags&128)!==0)throw Error(r(558))}return Xn(d),null;case 13:if(k=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(A=Qu(d),k!==null&&k.dehydrated!==null){if(l===null){if(!A)throw Error(r(318));if(A=d.memoizedState,A=A!==null?A.dehydrated:null,!A)throw Error(r(317));A[Ct]=d}else $c(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;Xn(d),A=!1}else A=sb(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=A),A=!0;if(!A)return d.flags&256?(bi(d),d):(bi(d),null)}return bi(d),(d.flags&128)!==0?(d.lanes=g,d):(g=k!==null,l=l!==null&&l.memoizedState!==null,g&&(k=d.child,A=null,k.alternate!==null&&k.alternate.memoizedState!==null&&k.alternate.memoizedState.cachePool!==null&&(A=k.alternate.memoizedState.cachePool.pool),L=null,k.memoizedState!==null&&k.memoizedState.cachePool!==null&&(L=k.memoizedState.cachePool.pool),L!==A&&(k.flags|=2048)),g!==l&&g&&(d.child.flags|=8192),F0(d,d.updateQueue),Xn(d),null);case 4:return oe(),l===null&&mv(d.stateNode.containerInfo),Xn(d),null;case 10:return jo(d.type),Xn(d),null;case 19:if(X(kr),k=d.memoizedState,k===null)return Xn(d),null;if(A=(d.flags&128)!==0,L=k.rendering,L===null)if(A)nh(k,!1);else{if(xr!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(L=j0(l),L!==null){for(d.flags|=128,nh(k,!1),l=L.updateQueue,d.updateQueue=l,F0(d,l),d.subtreeFlags=0,l=g,g=d.child;g!==null;)F3(g,l),g=g.sibling;return W(kr,kr.current&1|2),gn&&No(d,k.treeForkCount),d.child}l=l.sibling}k.tail!==null&&ut()>W0&&(d.flags|=128,A=!0,nh(k,!1),d.lanes=4194304)}else{if(!A)if(l=j0(L),l!==null){if(d.flags|=128,A=!0,l=l.updateQueue,d.updateQueue=l,F0(d,l),nh(k,!0),k.tail===null&&k.tailMode==="hidden"&&!L.alternate&&!gn)return Xn(d),null}else 2*ut()-k.renderingStartTime>W0&&g!==536870912&&(d.flags|=128,A=!0,nh(k,!1),d.lanes=4194304);k.isBackwards?(L.sibling=d.child,d.child=L):(l=k.last,l!==null?l.sibling=L:d.child=L,k.last=L)}return k.tail!==null?(l=k.tail,k.rendering=l,k.tail=l.sibling,k.renderingStartTime=ut(),l.sibling=null,g=kr.current,W(kr,A?g&1|2:g&1),gn&&No(d,k.treeForkCount),l):(Xn(d),null);case 22:case 23:return bi(d),gb(),k=d.memoizedState!==null,l!==null?l.memoizedState!==null!==k&&(d.flags|=8192):k&&(d.flags|=8192),k?(g&536870912)!==0&&(d.flags&128)===0&&(Xn(d),d.subtreeFlags&6&&(d.flags|=8192)):Xn(d),g=d.updateQueue,g!==null&&F0(d,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),k=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(k=d.memoizedState.cachePool.pool),k!==g&&(d.flags|=2048),l!==null&&X(Fc),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),d.memoizedState.cache!==g&&(d.flags|=2048),jo(Tr),Xn(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function E$(l,d){switch(nb(d),d.tag){case 1:return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return jo(Tr),oe(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 26:case 27:case 5:return pe(d),null;case 31:if(d.memoizedState!==null){if(bi(d),d.alternate===null)throw Error(r(340));$c()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 13:if(bi(d),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(r(340));$c()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return X(kr),null;case 4:return oe(),null;case 10:return jo(d.type),null;case 22:case 23:return bi(d),gb(),l!==null&&X(Fc),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 24:return jo(Tr),null;case 25:return null;default:return null}}function pS(l,d){switch(nb(d),d.tag){case 3:jo(Tr),oe();break;case 26:case 27:case 5:pe(d);break;case 4:oe();break;case 31:d.memoizedState!==null&&bi(d);break;case 13:bi(d);break;case 19:X(kr);break;case 10:jo(d.type);break;case 22:case 23:bi(d),gb(),l!==null&&X(Fc);break;case 24:jo(Tr)}}function rh(l,d){try{var g=d.updateQueue,k=g!==null?g.lastEffect:null;if(k!==null){var A=k.next;g=A;do{if((g.tag&l)===l){k=void 0;var L=g.create,K=g.inst;k=L(),K.destroy=k}g=g.next}while(g!==A)}}catch(ne){Dn(d,d.return,ne)}}function Al(l,d,g){try{var k=d.updateQueue,A=k!==null?k.lastEffect:null;if(A!==null){var L=A.next;k=L;do{if((k.tag&l)===l){var K=k.inst,ne=K.destroy;if(ne!==void 0){K.destroy=void 0,A=d;var _e=g,Se=ne;try{Se()}catch(Re){Dn(A,_e,Re)}}}k=k.next}while(k!==L)}}catch(Re){Dn(d,d.return,Re)}}function mS(l){var d=l.updateQueue;if(d!==null){var g=l.stateNode;try{a6(d,g)}catch(k){Dn(l,l.return,k)}}}function gS(l,d,g){g.props=Wc(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(k){Dn(l,d,k)}}function sh(l,d){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var k=l.stateNode;break;case 30:k=l.stateNode;break;default:k=l.stateNode}typeof g=="function"?l.refCleanup=g(k):g.current=k}}catch(A){Dn(l,d,A)}}function $a(l,d){var g=l.ref,k=l.refCleanup;if(g!==null)if(typeof k=="function")try{k()}catch(A){Dn(l,d,A)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(A){Dn(l,d,A)}else g.current=null}function bS(l){var d=l.type,g=l.memoizedProps,k=l.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":g.autoFocus&&k.focus();break e;case"img":g.src?k.src=g.src:g.srcSet&&(k.srcset=g.srcSet)}}catch(A){Dn(l,l.return,A)}}function Yb(l,d,g){try{var k=l.stateNode;K$(k,l.type,g,d),k[_n]=d}catch(A){Dn(l,l.return,A)}}function vS(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&Bl(l.type)||l.tag===4}function Xb(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||vS(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&Bl(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Zb(l,d,g){var k=l.tag;if(k===5||k===6)l=l.stateNode,d?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(l,d):(d=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,d.appendChild(l),g=g._reactRootContainer,g!=null||d.onclick!==null||(d.onclick=ui));else if(k!==4&&(k===27&&Bl(l.type)&&(g=l.stateNode,d=null),l=l.child,l!==null))for(Zb(l,d,g),l=l.sibling;l!==null;)Zb(l,d,g),l=l.sibling}function U0(l,d,g){var k=l.tag;if(k===5||k===6)l=l.stateNode,d?g.insertBefore(l,d):g.appendChild(l);else if(k!==4&&(k===27&&Bl(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(U0(l,d,g),l=l.sibling;l!==null;)U0(l,d,g),l=l.sibling}function xS(l){var d=l.stateNode,g=l.memoizedProps;try{for(var k=l.type,A=d.attributes;A.length;)d.removeAttributeNode(A[0]);ms(d,k,g),d[Ct]=l,d[_n]=g}catch(L){Dn(l,l.return,L)}}var Lo=!1,Mr=!1,Qb=!1,yS=typeof WeakSet=="function"?WeakSet:Set,as=null;function N$(l,d){if(l=l.containerInfo,vv=up,l=Nn(l),la(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var k=g.getSelection&&g.getSelection();if(k&&k.rangeCount!==0){g=k.anchorNode;var A=k.anchorOffset,L=k.focusNode;k=k.focusOffset;try{g.nodeType,L.nodeType}catch{g=null;break e}var K=0,ne=-1,_e=-1,Se=0,Re=0,Be=l,Ce=null;t:for(;;){for(var je;Be!==g||A!==0&&Be.nodeType!==3||(ne=K+A),Be!==L||k!==0&&Be.nodeType!==3||(_e=K+k),Be.nodeType===3&&(K+=Be.nodeValue.length),(je=Be.firstChild)!==null;)Ce=Be,Be=je;for(;;){if(Be===l)break t;if(Ce===g&&++Se===A&&(ne=K),Ce===L&&++Re===k&&(_e=K),(je=Be.nextSibling)!==null)break;Be=Ce,Ce=Be.parentNode}Be=je}g=ne===-1||_e===-1?null:{start:ne,end:_e}}else g=null}g=g||{start:0,end:0}}else g=null;for(xv={focusedElem:l,selectionRange:g},up=!1,as=d;as!==null;)if(d=as,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,as=l;else for(;as!==null;){switch(d=as,L=d.alternate,l=d.flags,d.tag){case 0:if((l&4)!==0&&(l=d.updateQueue,l=l!==null?l.events:null,l!==null))for(g=0;g title"))),ms(L,k,g),L[Ct]=l,Pn(L),k=L;break e;case"link":var K=Nk("link","href",A).get(k+(g.href||""));if(K){for(var ne=0;ne$n&&(K=$n,$n=Dt,Dt=K);var xe=Pd(ne,Dt),me=Pd(ne,$n);if(xe&&me&&(je.rangeCount!==1||je.anchorNode!==xe.node||je.anchorOffset!==xe.offset||je.focusNode!==me.node||je.focusOffset!==me.offset)){var we=Be.createRange();we.setStart(xe.node,xe.offset),je.removeAllRanges(),Dt>$n?(je.addRange(we),je.extend(me.node,me.offset)):(we.setEnd(me.node,me.offset),je.addRange(we))}}}}for(Be=[],je=ne;je=je.parentNode;)je.nodeType===1&&Be.push({element:je,left:je.scrollLeft,top:je.scrollTop});for(typeof ne.focus=="function"&&ne.focus(),ne=0;neg?32:g,q.T=null,g=iv,iv=null;var L=Dl,K=$o;if(Zr=0,hf=Dl=null,$o=0,(zn&6)!==0)throw Error(r(331));var ne=zn;if(zn|=4,RS(L.current),jS(L,L.current,K,g),zn=ne,uh(0,!1),Jt&&typeof Jt.onPostCommitFiberRoot=="function")try{Jt.onPostCommitFiberRoot(Pt,L)}catch{}return!0}finally{Q.p=A,q.T=k,XS(l,d)}}function QS(l,d,g){d=Fi(g,d),d=Bb(l.stateNode,d,2),l=zl(l,d,2),l!==null&&(at(l,2),Pa(l))}function Dn(l,d,g){if(l.tag===3)QS(l,l,g);else for(;d!==null;){if(d.tag===3){QS(d,l,g);break}else if(d.tag===1){var k=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof k.componentDidCatch=="function"&&(Ll===null||!Ll.has(k))){l=Fi(g,l),g=J6(2),k=zl(d,g,2),k!==null&&(eS(g,k,d,l),at(k,2),Pa(k));break}}d=d.return}}function cv(l,d,g){var k=l.pingCache;if(k===null){k=l.pingCache=new T$;var A=new Set;k.set(d,A)}else A=k.get(d),A===void 0&&(A=new Set,k.set(d,A));A.has(g)||(tv=!0,A.add(g),l=D$.bind(null,l,d,g),d.then(l,l))}function D$(l,d,g){var k=l.pingCache;k!==null&&k.delete(d),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,Hn===l&&(pn&g)===g&&(xr===4||xr===3&&(pn&62914560)===pn&&300>ut()-V0?(zn&2)===0&&_f(l,0):nv|=g,df===pn&&(df=0)),Pa(l)}function JS(l,d){d===0&&(d=an()),l=Ic(l,d),l!==null&&(at(l,d),Pa(l))}function O$(l){var d=l.memoizedState,g=0;d!==null&&(g=d.retryLane),JS(l,g)}function I$(l,d){var g=0;switch(l.tag){case 31:case 13:var k=l.stateNode,A=l.memoizedState;A!==null&&(g=A.retryLane);break;case 19:k=l.stateNode;break;case 22:k=l.stateNode._retryCache;break;default:throw Error(r(314))}k!==null&&k.delete(d),JS(l,g)}function B$(l,d){return Vt(l,d)}var J0=null,mf=null,uv=!1,ep=!1,fv=!1,Il=0;function Pa(l){l!==mf&&l.next===null&&(mf===null?J0=mf=l:mf=mf.next=l),ep=!0,uv||(uv=!0,P$())}function uh(l,d){if(!fv&&ep){fv=!0;do for(var g=!1,k=J0;k!==null;){if(l!==0){var A=k.pendingLanes;if(A===0)var L=0;else{var K=k.suspendedLanes,ne=k.pingedLanes;L=(1<<31-Lt(42|l)+1)-1,L&=A&~(K&~ne),L=L&201326741?L&201326741|1:L?L|2:0}L!==0&&(g=!0,rk(k,L))}else L=pn,L=Wn(k,k===Hn?L:0,k.cancelPendingCommit!==null||k.timeoutHandle!==-1),(L&3)===0||Mn(k,L)||(g=!0,rk(k,L));k=k.next}while(g);fv=!1}}function $$(){ek()}function ek(){ep=uv=!1;var l=0;Il!==0&&X$()&&(l=Il);for(var d=ut(),g=null,k=J0;k!==null;){var A=k.next,L=tk(k,d);L===0?(k.next=null,g===null?J0=A:g.next=A,A===null&&(mf=g)):(g=k,(l!==0||(L&3)!==0)&&(ep=!0)),k=A}Zr!==0&&Zr!==5||uh(l),Il!==0&&(Il=0)}function tk(l,d){for(var g=l.suspendedLanes,k=l.pingedLanes,A=l.expirationTimes,L=l.pendingLanes&-62914561;0ne)break;var Re=_e.transferSize,Be=_e.initiatorType;Re&&fk(Be)&&(_e=_e.responseEnd,K+=Re*(_e"u"?null:document;function Sk(l,d,g){var k=gf;if(k&&typeof d=="string"&&d){var A=_r(d);A='link[rel="'+l+'"][href="'+A+'"]',typeof g=="string"&&(A+='[crossorigin="'+g+'"]'),wk.has(A)||(wk.add(A),l={rel:l,crossOrigin:g,href:d},k.querySelector(A)===null&&(d=k.createElement("link"),ms(d,"link",l),Pn(d),k.head.appendChild(d)))}}function iP(l){Po.D(l),Sk("dns-prefetch",l,null)}function aP(l,d){Po.C(l,d),Sk("preconnect",l,d)}function oP(l,d,g){Po.L(l,d,g);var k=gf;if(k&&l&&d){var A='link[rel="preload"][as="'+_r(d)+'"]';d==="image"&&g&&g.imageSrcSet?(A+='[imagesrcset="'+_r(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(A+='[imagesizes="'+_r(g.imageSizes)+'"]')):A+='[href="'+_r(l)+'"]';var L=A;switch(d){case"style":L=bf(l);break;case"script":L=vf(l)}Ki.has(L)||(l=f({rel:"preload",href:d==="image"&&g&&g.imageSrcSet?void 0:l,as:d},g),Ki.set(L,l),k.querySelector(A)!==null||d==="style"&&k.querySelector(_h(L))||d==="script"&&k.querySelector(ph(L))||(d=k.createElement("link"),ms(d,"link",l),Pn(d),k.head.appendChild(d)))}}function lP(l,d){Po.m(l,d);var g=gf;if(g&&l){var k=d&&typeof d.as=="string"?d.as:"script",A='link[rel="modulepreload"][as="'+_r(k)+'"][href="'+_r(l)+'"]',L=A;switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":L=vf(l)}if(!Ki.has(L)&&(l=f({rel:"modulepreload",href:l},d),Ki.set(L,l),g.querySelector(A)===null)){switch(k){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(ph(L)))return}k=g.createElement("link"),ms(k,"link",l),Pn(k),g.head.appendChild(k)}}}function cP(l,d,g){Po.S(l,d,g);var k=gf;if(k&&l){var A=Zt(k).hoistableStyles,L=bf(l);d=d||"default";var K=A.get(L);if(!K){var ne={loading:0,preload:null};if(K=k.querySelector(_h(L)))ne.loading=5;else{l=f({rel:"stylesheet",href:l,"data-precedence":d},g),(g=Ki.get(L))&&Nv(l,g);var _e=K=k.createElement("link");Pn(_e),ms(_e,"link",l),_e._p=new Promise(function(Se,Re){_e.onload=Se,_e.onerror=Re}),_e.addEventListener("load",function(){ne.loading|=1}),_e.addEventListener("error",function(){ne.loading|=2}),ne.loading|=4,ip(K,d,k)}K={type:"stylesheet",instance:K,count:1,state:ne},A.set(L,K)}}}function uP(l,d){Po.X(l,d);var g=gf;if(g&&l){var k=Zt(g).hoistableScripts,A=vf(l),L=k.get(A);L||(L=g.querySelector(ph(A)),L||(l=f({src:l,async:!0},d),(d=Ki.get(A))&&zv(l,d),L=g.createElement("script"),Pn(L),ms(L,"link",l),g.head.appendChild(L)),L={type:"script",instance:L,count:1,state:null},k.set(A,L))}}function fP(l,d){Po.M(l,d);var g=gf;if(g&&l){var k=Zt(g).hoistableScripts,A=vf(l),L=k.get(A);L||(L=g.querySelector(ph(A)),L||(l=f({src:l,async:!0,type:"module"},d),(d=Ki.get(A))&&zv(l,d),L=g.createElement("script"),Pn(L),ms(L,"link",l),g.head.appendChild(L)),L={type:"script",instance:L,count:1,state:null},k.set(A,L))}}function kk(l,d,g,k){var A=(A=ae.current)?sp(A):null;if(!A)throw Error(r(446));switch(l){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(d=bf(g.href),g=Zt(A).hoistableStyles,k=g.get(d),k||(k={type:"style",instance:null,count:0,state:null},g.set(d,k)),k):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){l=bf(g.href);var L=Zt(A).hoistableStyles,K=L.get(l);if(K||(A=A.ownerDocument||A,K={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},L.set(l,K),(L=A.querySelector(_h(l)))&&!L._p&&(K.instance=L,K.state.loading=5),Ki.has(l)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},Ki.set(l,g),L||dP(A,l,g,K.state))),d&&k===null)throw Error(r(528,""));return K}if(d&&k!==null)throw Error(r(529,""));return null;case"script":return d=g.async,g=g.src,typeof g=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=vf(g),g=Zt(A).hoistableScripts,k=g.get(d),k||(k={type:"script",instance:null,count:0,state:null},g.set(d,k)),k):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,l))}}function bf(l){return'href="'+_r(l)+'"'}function _h(l){return'link[rel="stylesheet"]['+l+"]"}function Ck(l){return f({},l,{"data-precedence":l.precedence,precedence:null})}function dP(l,d,g,k){l.querySelector('link[rel="preload"][as="style"]['+d+"]")?k.loading=1:(d=l.createElement("link"),k.preload=d,d.addEventListener("load",function(){return k.loading|=1}),d.addEventListener("error",function(){return k.loading|=2}),ms(d,"link",g),Pn(d),l.head.appendChild(d))}function vf(l){return'[src="'+_r(l)+'"]'}function ph(l){return"script[async]"+l}function Ek(l,d,g){if(d.count++,d.instance===null)switch(d.type){case"style":var k=l.querySelector('style[data-href~="'+_r(g.href)+'"]');if(k)return d.instance=k,Pn(k),k;var A=f({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return k=(l.ownerDocument||l).createElement("style"),Pn(k),ms(k,"style",A),ip(k,g.precedence,l),d.instance=k;case"stylesheet":A=bf(g.href);var L=l.querySelector(_h(A));if(L)return d.state.loading|=4,d.instance=L,Pn(L),L;k=Ck(g),(A=Ki.get(A))&&Nv(k,A),L=(l.ownerDocument||l).createElement("link"),Pn(L);var K=L;return K._p=new Promise(function(ne,_e){K.onload=ne,K.onerror=_e}),ms(L,"link",k),d.state.loading|=4,ip(L,g.precedence,l),d.instance=L;case"script":return L=vf(g.src),(A=l.querySelector(ph(L)))?(d.instance=A,Pn(A),A):(k=g,(A=Ki.get(L))&&(k=f({},g),zv(k,A)),l=l.ownerDocument||l,A=l.createElement("script"),Pn(A),ms(A,"link",k),l.head.appendChild(A),d.instance=A);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(k=d.instance,d.state.loading|=4,ip(k,g.precedence,l));return d.instance}function ip(l,d,g){for(var k=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),A=k.length?k[k.length-1]:null,L=A,K=0;K title"):null)}function hP(l,d,g){if(g===1||d.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return l=d.disabled,typeof d.precedence=="string"&&l==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function jk(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function _P(l,d,g,k){if(g.type==="stylesheet"&&(typeof k.media!="string"||matchMedia(k.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var A=bf(k.href),L=d.querySelector(_h(A));if(L){d=L._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(l.count++,l=op.bind(l),d.then(l,l)),g.state.loading|=4,g.instance=L,Pn(L);return}L=d.ownerDocument||d,k=Ck(k),(A=Ki.get(A))&&Nv(k,A),L=L.createElement("link"),Pn(L);var K=L;K._p=new Promise(function(ne,_e){K.onload=ne,K.onerror=_e}),ms(L,"link",k),g.instance=L}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(g,d),(d=g.state.preload)&&(g.state.loading&3)===0&&(l.count++,g=op.bind(l),d.addEventListener("load",g),d.addEventListener("error",g))}}var jv=0;function pP(l,d){return l.stylesheets&&l.count===0&&cp(l,l.stylesheets),0jv?50:800)+d);return l.unsuspend=g,function(){l.unsuspend=null,clearTimeout(k),clearTimeout(A)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var lp=null;function cp(l,d){l.stylesheets=null,l.unsuspend!==null&&(l.count++,lp=new Map,d.forEach(mP,l),lp=null,op.call(l))}function mP(l,d){if(!(d.state.loading&4)){var g=lp.get(l);if(g)var k=g.get(null);else{g=new Map,lp.set(l,g);for(var A=l.querySelectorAll("link[data-precedence],style[data-precedence]"),L=0;L"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Bv.exports=MP(),Bv.exports}var DP=LP();const OP=!1;var wj=T.useLayoutEffect;function IP(e,n,t){T.useEffect(()=>{if(!e.current||t||typeof IntersectionObserver!="function")return()=>n();const r=new IntersectionObserver(s=>{n(s.pop())},{rootMargin:"100px"});return r.observe(e.current),()=>{r.disconnect(),n()}},[n,t,e])}function BP(e){const n=T.useRef(null);return T.useImperativeHandle(e,()=>n.current,[]),n}function t_(e){return e[e.length-1]}function ed(e,n){return typeof e=="function"?e(n):e}const Sj=Object.prototype.hasOwnProperty,$P=Object.prototype.propertyIsEnumerable;function kj(e){for(const n in e)if(Sj.call(e,n))return!0;return!1}const PP=()=>Object.create(null),Xc=(e,n)=>cu(e,n,PP);function cu(e,n,t=()=>({}),r=0){if(e===n)return e;if(r>500)return n;const s=n,i=s7(e)&&s7(s);if(!i&&!(Dm(e)&&Dm(s)))return s;const a=i?e:n7(e);if(!a)return s;const o=i?s:n7(s);if(!o)return s;const c=a.length,u=o.length,_=i?new Array(u):t();let f=0;for(let p=0;p"u")return!0;const t=n.prototype;return!(!r7(t)||!t.hasOwnProperty("isPrototypeOf"))}function r7(e){return Object.prototype.toString.call(e)==="[object Object]"}function s7(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ic(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let r=0,s=e.length;rs||!ic(e[a],n[a],t)))return!1;return s===i}return!1}const HP=/[\x00-\x1f\x7f"<>`{}]/g;function FP(e){return e.replace(HP,n=>"%"+n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function i7(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return FP(n)}const UP=["http:","https:","mailto:","tel:"];function Om(e,n){if(!e)return!1;try{const t=new URL(e);return!n.has(t.protocol)}catch{return!1}}function wh(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const n=/%25|%5C/gi;let t=0,r="",s;for(;(s=n.exec(e))!==null;)r+=i7(e.slice(t,s.index))+s[0],t=n.lastIndex;r=r+i7(t?e.slice(t):e);let i=!1;return r.startsWith("//")&&(i=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:i}}function qP(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function GP(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,r&&(r.next=i,i.prev=r)):(i.next.prev=void 0,t=i.next,i.next=void 0,r&&(i.prev=r,r.next=i)),r=i)};return{get(i){const a=n.get(i);if(a)return s(a),a.value},set(i,a){if(n.size>=e&&t){const c=t;n.delete(c.key),c.next&&(t=c.next,c.next.prev=void 0),c===r&&(r=void 0)}const o=n.get(i);if(o)o.value=a,s(o);else{const c={key:i,value:a,prev:r};r&&(r.next=c),r=c,t||(t=c),n.set(i,c)}},clear(){n.clear(),t=void 0,r=void 0}}}const nc=4,Cj=5;function Ej(e,n,t=new Uint16Array(6)){const r=e.indexOf("/",n),s=r===-1?e.length:r,i=e.substring(n,s);if(!i||!i.includes("$"))return t[0]=0,t[1]=n,t[2]=n,t[3]=s,t[4]=s,t[5]=s,t;if(i==="$"){const c=e.length;return t[0]=2,t[1]=n,t[2]=n,t[3]=c,t[4]=c,t[5]=c,t}if(i.charCodeAt(0)===36)return t[0]=1,t[1]=n,t[2]=n+1,t[3]=s,t[4]=s,t[5]=s,t;const a=i.indexOf("{");let o;if(a!==-1&&a+1!I.parse&&I.caseSensitive===N&&I.prefix===E&&I.suffix===R));if(O)y=O;else{const I=VP(z,f,N,E,R);y=I,I.parent=s,I.depth=i;let H;z===1?H=s.dynamic??(s.dynamic=[]):z===3?H=s.optional??(s.optional=[]):H=s.wildcard??(s.wildcard=[]),H.push(I),H.length===2&&(a==null||a.push(H))}break}}s=y}if(S&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const v=Pf(f);v.kind=Cj,v.parent=s,i++,v.depth=i,s.pathless??(s.pathless=[]),s.pathless.push(v),s=v}const b=(t.path||!t.children)&&!t.isRoot;if(b&&f.endsWith("/")){const v=Pf(f);v.kind=nc,v.parent=s,i++,v.depth=i,s.index=v,s=v}s.parse=S??null,s.priority=((_=p==null?void 0:p.params)==null?void 0:_.priority)??0,b&&!s.route&&(s.route=t,s.fullPath=f)}if(t.children)for(const f of t.children)jg(e,n,f,c,s,i,a,o)}function Nj(e,n){if(e.parse&&!n.parse)return-1;if(!e.parse&&n.parse)return 1;if(e.parse&&n.parse&&(e.priority||n.priority))return n.priority-e.priority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function Pf(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function VP(e,n,t,r,s){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,priority:0,caseSensitive:t,prefix:r,suffix:s}}function WP(e,n){const t=Pf("/"),r=new Uint16Array(6),s=[];for(const i of e)jg(!1,r,i,1,t,0,s);for(const i of s)i.sort(Nj);n.masksTree=t,n.flatCache=Im(1e3)}function KP(e,n){e||(e="/");const t=n.flatCache.get(e);if(t!==void 0)return t;const r=Dw(e,n.masksTree);return n.flatCache.set(e,r),r}function YP(e,n,t,r,s){e||(e="/"),r||(r="/");const i=n?`case\0${e}`:e;let a=s.singleCache.get(i);return a||(a=Pf("/"),jg(n,new Uint16Array(6),{from:e},1,a,0),s.singleCache.set(i,a)),Dw(r,a,t)}function XP(e,n,t=!1){const r=t?e:`nofuzz\0${e}`,s=n.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let i;try{i=Dw(e,n.segmentTree,t)}catch(a){if(a instanceof URIError)i=null;else throw a}return i&&(i.branch=jj(i.route)),n.matchCache.set(r,i),i}function ZP(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function QP(e,n=!1,t){const r=Pf(e.fullPath),s=new Uint16Array(6),i=[],a={},o={};let c=0;jg(n,s,e,1,r,0,i,u=>{if(t==null||t(u,c),u.id in a&&Lw(),a[u.id]=u,c!==0&&u.path){const _=ZP(u.fullPath);(!o[_]||u.fullPath.endsWith("/"))&&(o[_]=u)}c++});for(const u of i)u.sort(Nj);return{processedTree:{segmentTree:r,singleCache:Im(1e3),matchCache:Im(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Dw(e,n,t=!1){const r=e.split("/"),s=eH(e,r,n,t);if(!s)return null;const[i]=zj(e,r,s);return{route:s.node.route,rawParams:i}}function zj(e,n,t){var _,f,p,m;const r=JP(t.node);let s=null;const i=Object.create(null);let a=((_=t.extract)==null?void 0:_.part)??0,o=((f=t.extract)==null?void 0:f.node)??0,c=((p=t.extract)==null?void 0:p.path)??0,u=((m=t.extract)==null?void 0:m.segment)??0;for(;o=0;E--){const R=f.wildcard[E],{prefix:N,suffix:M}=R;if(!(N&&(w||!(R.caseSensitive?C:z??(z=C.toLowerCase())).startsWith(N)))){if(M){if(w)continue;const O=n.slice(p).join("/"),I=O.slice(-M.length);if((R.caseSensitive?I:I.toLowerCase())!==M||O.length-M.length=0;R--){const N=f.optional[R];o.push({node:N,index:p,skipped:E,statics:x,dynamics:S,optionals:b,extract:v,rawParams:y})}if(!w)for(let R=f.optional.length-1;R>=0;R--){const N=f.optional[R],{prefix:M,suffix:O}=N;if(M||O){const I=N.caseSensitive?C:z??(z=C.toLowerCase());if(M&&!I.startsWith(M)||O&&I.indexOf(O,I.length-O.length)=0;E--){const R=f.dynamic[E],{prefix:N,suffix:M}=R;if(N||M){const O=R.caseSensitive?C:z??(z=C.toLowerCase());if(N&&!O.startsWith(N)||M&&O.indexOf(M,O.length-M.length)=0;E--){const R=f.pathless[E];o.push({node:R,index:p,skipped:m,statics:x,dynamics:S,optionals:b,extract:v,rawParams:y})}}if(u)return u;if(r&&c){let _=c.index;for(let p=0;pe.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===nc)>(e.node.kind===nc)||n.node.kind===nc==(e.node.kind===nc)&&n.node.depth>e.node.depth))):!0}function cm(e){return um(e.filter(n=>n!==void 0).join("/"))}function um(e){return e.replace(/\/{2,}/g,"/")}function Tj(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Wo(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function Aj(e){return Wo(Tj(e))}function Bm(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function nH(e,n,t){return Bm(e,t)===Bm(n,t)}function rH({base:e,to:n,trailingSlash:t="never",cache:r}){if(n.includes("//")&&(n=um(n)),n.startsWith("/"))return n.length===1||t==="preserve"?n:t==="always"?n.endsWith("/")?n:`${n}/`:n.endsWith("/")?n.slice(0,-1):n;const s=n===".";let i;if(r){i=s?e:e+"\0"+n;const u=r.get(i);if(u)return u}let a;if(s)a=e.split("/");else{for(e.includes("//")&&(e=um(e)),a=e.split("/");a.length>1&&t_(a)==="";)a.pop();const u=n.split("/");for(let _=0,f=u.length;_1?a.pop():a=[""]:p==="."||a.push(p)}}a.length>1&&(t_(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));const o=a.join("/"),c=(s?um(o):o)||"/";return i&&r&&r.set(i,c),c}function sH(e){const n=new Map(e.map(s=>[encodeURIComponent(s),s])),t=Array.from(n.keys()).map(s=>s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(t,"g");return s=>s.replace(r,i=>n.get(i)??i)}function Fv(e,n,t){const r=n[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(s=>l7(s,t)).join("/"):l7(r,t)}function o7({path:e,params:n,decoder:t,...r}){let s=!1;const i=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:i,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:i,isMissingParams:s};const a=e.length;let o=0,c,u="";for(;oe.state.__TSR_key||e.href;function fH(e){const n=e.getAttribute(c7);if(n)return`[${c7}="${n}"]`;let t="",r=e,s;for(;s=r.parentNode;){let i=1,a=r;for(;a=a.previousElementSibling;)i++;const o=`${r.localName}:nth-child(${i})`;t=t?`${o} > ${t}`:o,r=s}return t}let vp=!1;const fm="window";function jy(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function u7(e){const n=new Set;for(const t of e){if(t===fm)continue;const r=jy(t);r&&n.add(r)}return n}function dH(e,n){const t=e.options.scrollRestoration,r=e._scroll;t&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||uH,i=new Set,a=o=>{const c=Jl[o]||(Jl[o]={});for(const u of i)u===document?c[fm]={scrollX,scrollY}:u.isConnected&&(c[fH(u)]={scrollX:u.scrollLeft,scrollY:u.scrollTop})};t&&!r.restoration&&(r.restoration=!0,vp=!1,history.scrollRestoration="manual",document.addEventListener("scroll",o=>{vp||i.add(o.target)},!0),e.subscribe("onBeforeLoad",o=>{o.fromLocation&&a(s(o.fromLocation)),i.clear()}),addEventListener("pagehide",()=>{a(s(e.stores.resolvedLocation.get()??e.stores.location.get())),cH()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",o=>{var S;const c=e.options.scrollRestorationBehavior,u=e.options.scrollToTopSelectors,_=r.next,f=r.hash;let p;if(i.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const m=s(o.toLocation),x=o.fromLocation&&s(o.fromLocation);if(r.restoring&&x&&x!==m){const b=Jl[x];if(b){let v=Jl[m];for(const y in b){if(y===fm){if(_)continue}else{const w=jy(y);if(!w||_&&u&&(p??(p=u7(u)),p.has(w)))continue}v||(v=Jl[m]={}),v[y]??(v[y]=b[y])}}}vp=!0;try{const b=o.toLocation.hash,v=o.toLocation.state.__hashScrollIntoViewOptions??!0;let y=!1;if(_){!b&&u&&(p??(p=u7(u)));const w=b&&v&&f,C=r.restoring?Jl[m]:void 0;if(C)for(const z in C){const{scrollX:E,scrollY:R}=C[z];if(z===fm){if(w)continue;scrollTo({top:R,left:E,behavior:c}),y=!0}else{const N=jy(z);N&&(N.scrollLeft=E,N.scrollTop=R,p==null||p.delete(N))}}if(!b){const z={top:0,left:0,behavior:c};if(y||scrollTo(z),p)for(const E of p)E.scrollTo(z)}}!y&&b&&v&&((S=document.getElementById(b))==null||S.scrollIntoView(v))}finally{vp=!1}}))}function hH(e,n=String){const t=new URLSearchParams;for(const r in e){const s=e[r];s!==void 0&&t.set(r,n(s))}return t.toString()}function Uv(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function _H(e){const n=new URLSearchParams(e),t=Object.create(null);for(const[r,s]of n.entries()){const i=t[r];i==null?t[r]=Uv(s):Array.isArray(i)?i.push(Uv(s)):t[r]=[i,Uv(s)]}return t}const pH=/^(?:\s|["[{\d-]|fa|nu|tr)/,mH=bH(JSON.parse),gH=vH(JSON.stringify,JSON.parse);function bH(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=_H(n);for(const r in t){const s=t[r];if(typeof s=="string")try{t[r]=e(s)}catch{}}return t}}function vH(e,n){const t=n===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(n&&typeof s=="string"){if(t&&!pH.test(s))return s;try{return n(s),e(s)}catch{}}return s}return s=>{const i=hH(s,r);return i?`?${i}`:""}}const Ff="__root__";function xH(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function Rj(e){return e instanceof Response&&!!e.options}function yH(e){return{input:({url:n})=>{for(const t of e)n=Ty(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=Mj(e[t],n);return n}}}function wH(e){const n=Aj(e.basepath),t=`/${n}`,r=e.caseSensitive?t:t.toLowerCase(),s=`${r}/`;return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(s)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=cm(["/",n,i.pathname]),i)}}function Ty(e,n){var r;const t=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function Mj(e,n){var r;const t=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function SH(e,n){const{createMutableStore:t,createReadonlyStore:r,batch:s}=n,i=new Map,a=t("idle"),o=t(e),c=t(void 0),u=t([]),_=r(()=>u.get().map(S=>i.get(S).get())),f=r(()=>({status:a.get(),isLoading:a.get()==="pending",matches:_.get(),location:o.get(),resolvedLocation:c.get()}));function p(S){let b=i.get(S);return b||(b=t(void 0),i.set(S,b)),b}const m={status:a,location:o,resolvedLocation:c,ids:u,matches:_,byRoute:i,__store:f,getMatchStore:p,setMatches:x};function x(S){const b=u.get(),v=S.map(y=>y.routeId);s(()=>{GP(b,v)||u.set(v);for(const y of b)v.includes(y)||i.get(y).set(()=>{});for(const y of S){const w=p(y.routeId);w.get()!==y&&w.set(y)}})}return m}var ac="__TSR_index",f7="popstate",d7="beforeunload";function kH(e){let n=e.getLocation();const t=new Set,r=a=>{n=e.getLocation(),t.forEach(o=>o({location:n,action:a}))},s=a=>{e.notifyOnIndexChange??!0?r(a):n=e.getLocation()},i=async({task:a,navigateOpts:o,...c})=>{var f,p;if((o==null?void 0:o.ignoreBlocker)??!1){a();return}const u=((f=e.getBlockers)==null?void 0:f.call(e))??[],_=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&u.length&&_)for(const m of u){const x=$m(c.path,c.state);if(await m.blockerFn({currentLocation:n,nextLocation:x,action:c.type})){(p=e.onBlocked)==null||p.call(e);return}}a()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:a=>(t.add(a),()=>{t.delete(a)}),push:(a,o,c)=>{const u=n.state[ac];o=h7(u+1,o),i({task:()=>{e.pushState(a,o),r({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:a,state:o})},replace:(a,o,c)=>{const u=n.state[ac];o=h7(u,o),i({task:()=>{e.replaceState(a,o),r({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:a,state:o})},go:(a,o)=>{i({task:()=>{e.go(a),s({type:"GO",index:a})},navigateOpts:o,type:"GO"})},back:a=>{i({task:()=>{e.back((a==null?void 0:a.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:a,type:"BACK"})},forward:a=>{i({task:()=>{e.forward((a==null?void 0:a.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:a,type:"FORWARD"})},canGoBack:()=>n.state[ac]!==0,createHref:a=>e.createHref(a),block:a=>{var c;if(!e.setBlockers)return()=>{};const o=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...o,a]),()=>{var _,f;const u=((_=e.getBlockers)==null?void 0:_.call(e))??[];(f=e.setBlockers)==null||f.call(e,u.filter(p=>p!==a))}},flush:()=>{var a;return(a=e.flush)==null?void 0:a.call(e)},destroy:()=>{var a;return(a=e.destroy)==null?void 0:a.call(e)},notify:r}}function h7(e,n){n||(n={});const t=Ow();return{...n,key:t,__TSR_key:t,[ac]:e}}function CH(e){var R,N;const n=typeof document<"u"?window:void 0,t=n.history.pushState,r=n.history.replaceState;let s=[];const i=()=>s,a=M=>s=M,o=(M=>M),c=(()=>$m(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!((R=n.history.state)!=null&&R.__TSR_key)&&!((N=n.history.state)!=null&&N.key)){const M=Ow();n.history.replaceState({[ac]:0,key:M,__TSR_key:M},"")}let u=c(),_,f=!1,p=!1,m=!1,x=!1;const S=()=>u;let b;const v=()=>{b&&(E._ignoreSubscribers=!0,(b[2]?n.history.pushState:n.history.replaceState)(b[1],"",b[0]),E._ignoreSubscribers=!1,b=void 0,_=void 0)},y=(M,O,I)=>{const H=o(O),U=!!b;U||(_=u),u=$m(O,I),b=[H,I,(b==null?void 0:b[2])||M],U||queueMicrotask(()=>v())},w=M=>{u=c(),E.notify({type:M})},C=async()=>{if(p){p=!1;return}const M=c(),O=M.state[ac]-u.state[ac],I=O===1,H=O===-1,U=!I&&!H||f;f=!1;const F=U?"GO":H?"BACK":"FORWARD",Y=U?{type:"GO",index:O}:{type:H?"BACK":"FORWARD"};if(m)m=!1;else{const q=i();if(typeof document<"u"&&q.length){for(const Q of q)if(await Q.blockerFn({currentLocation:u,nextLocation:M,action:F})){p=!0,n.history.go(1),E.notify(Y);return}}}u=c(),E.notify(Y)},z=M=>{if(x){x=!1;return}let O=!1;const I=i();if(typeof document<"u"&&I.length)for(const H of I){const U=H.enableBeforeUnload??!0;if(U===!0){O=!0;break}if(typeof U=="function"&&U()===!0){O=!0;break}}if(O)return M.preventDefault(),M.returnValue=""},E=kH({getLocation:S,getLength:()=>n.history.length,pushState:(M,O)=>y(!0,M,O),replaceState:(M,O)=>y(!1,M,O),back:M=>(M&&(m=!0),x=!0,n.history.back()),forward:M=>{M&&(m=!0),x=!0,n.history.forward()},go:M=>{f=!0,n.history.go(M)},createHref:M=>o(M),flush:v,destroy:()=>{n.history.pushState=t,n.history.replaceState=r,n.removeEventListener(d7,z,{capture:!0}),n.removeEventListener(f7,C)},onBlocked:()=>{_&&u!==_&&(u=_)},getBlockers:i,setBlockers:a,notifyOnIndexChange:!1});return n.addEventListener(d7,z,{capture:!0}),n.addEventListener(f7,C),n.history.pushState=function(...M){const O=t.apply(n.history,M);return E._ignoreSubscribers||w("PUSH"),O},n.history.replaceState=function(...M){const O=r.apply(n.history,M);return E._ignoreSubscribers||w("REPLACE"),O},E}function EH(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function $m(e,n){const t=EH(e),r=t.indexOf("#"),s=t.indexOf("?"),i=Ow();return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,r===-1?void 0:r):"",state:n||{[ac]:0,key:i,__TSR_key:i}}}function Ow(){return(Math.random()+1).toString(36).substring(7)}function _7(e){var n,t;return e.options.loader||e.options.beforeLoad||e.lazyFn||((n=e.options.component)==null?void 0:n.preload)||((t=e.options.pendingComponent)==null?void 0:t.preload)}function Tg(e,n){return{fromLocation:n,toLocation:e,pathChanged:(n==null?void 0:n.pathname)!==e.pathname,hrefChanged:(n==null?void 0:n.href)!==e.href,hashChanged:(n==null?void 0:n.hash)!==e.hash}}function p7({key:e,__TSR_key:n,__TSR_index:t,__hashScrollIntoViewOptions:r,...s}){return s}function NH(e,n,t,r){var s,i,a,o;for(const c of n){if(r&&e._tx!==r)return;t.some(u=>u.routeId===c.routeId)||(i=(s=e.routesById[c.routeId].options).onLeave)==null||i.call(s,c)}for(const c of t){if(r&&e._tx!==r)return;(o=(a=e.routesById[c.routeId].options)[n.some(u=>u.routeId===c.routeId)?"onStay":"onEnter"])==null||o.call(a,c)}}var zH=class{constructor(e,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async t=>(t(),!1),this.update=t=>{const r=this.options,s=this.basepath??(r==null?void 0:r.basepath)??"/",i=this.basepath===void 0,a=r==null?void 0:r.rewrite;if(this.options={...r,...t},this.isServer=this.options.isServer??OP??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=sH(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=CH()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let u;this.resolvePathCache=Im(1e3),u=this.buildRouteTree(),this.setRoutes(u)}if(!this.stores&&this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=SH(this.latestLocation,u),dH(this)}const o=this.options.basepath??"/",c=this.options.rewrite;if(i||s!==o||a!==c){this.basepath=o;const u=[],_=Aj(o);_&&_!=="/"&&u.push(wH({basepath:o})),c&&u.push(c),this.rewrite=u.length===0?void 0:u.length===1?u[0]:yH(u),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=QP(this.routeTree,this.options.caseSensitive,(r,s)=>{r.init({originalIndex:s})});return this.options.routeMasks&&WP(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,r)=>{const s={eventType:t,fn:r};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=t=>{for(const r of this.subscribers)if(r.eventType===t.type)try{r.fn(t)}catch(s){console.error(s)}},this.parseLocation=(t,r)=>{const s=({pathname:c,search:u,hash:_,href:f,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const v=this.options.parseSearch(u),y=this.options.stringifySearch(v);return{href:c+y+_,publicHref:c+y+_,pathname:wh(c).path,external:!1,searchStr:y,search:Xc(r==null?void 0:r.search,v),hash:wh(_.slice(1)).path,state:cu(r==null?void 0:r.state,p)}}const m=new URL(f,this.origin),x=Ty(this.rewrite,m),S=this.options.parseSearch(x.search),b=this.options.stringifySearch(S);return x.search=b,{href:x.href.replace(x.origin,""),publicHref:f,pathname:wh(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:b,search:Xc(r==null?void 0:r.search,S),hash:wh(x.hash.slice(1)).path,state:cu(r==null?void 0:r.state,p)}},i=s(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=s(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,r)=>rH({base:t,to:r,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,r,s)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:r},s):this.matchRoutesInternal(t,r),this.getMatchedRoutes=t=>{const r=Object.create(null),s=XP(Wo(t),this.processedTree,!0);return s&&Object.assign(r,s.rawParams),[(s==null?void 0:s.branch)||[this.routesById.__root__],r,s==null?void 0:s.route]},this.buildLocation=t=>{const r=(i={})=>{var M,O;if(i.href){const I=$m(i.href,{});i={...i,to:Ty(this.rewrite,new URL(I.pathname,this.origin)).pathname,search:this.options.parseSearch(I.search),hash:I.hash.slice(1)}}const a=i._fromLocation||this._pendingLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o[1],u=o[2],_=o[3],f=this.resolvePathWithBase(c,i.to?`${i.to}`:".");let p=m7(i.params,_);const m=this.routesByPath[Wo(f)];let x;if(m)x=this.getRouteBranch(m);else if(f.includes("$"))x=[];else{const[I,H,U]=this.getMatchedRoutes(f);x=I,this.options.notFoundRoute&&(!U||U.path!=="/"&&H["**"])&&(x=[...x,this.options.notFoundRoute])}if(x.length&&kj(p))for(const I of x){const H=((M=I.options.params)==null?void 0:M.stringify)??I.options.stringifyParams;if(H){p===_&&(p=Object.assign(Object.create(null),p));try{Object.assign(p,H(p))}catch{}}}const S=t.leaveParams?f:wh(o7({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let b=u;if(t._includeValidateSearch&&((O=this.options.search)!=null&&O.strict)){const I={};x.forEach(H=>{if(H.options.validateSearch)try{Object.assign(I,dm(H.options.validateSearch,{...I,...b}))}catch{}}),b=I}b=TH(b,i,x,t._includeValidateSearch),b=Xc(u,b);const v=this.options.stringifySearch(b),y=i.hash===!0?a.hash:i.hash?ed(i.hash,a.hash):void 0,w=y?`#${y}`:"";let C=i.state===!0?a.state:i.state?ed(i.state,a.state):{};i.state&&(C=cu(a.state,C));const z=`${S}${v}${w}`;let E,R,N=!1;if(this.rewrite){const I=new URL(z,this.origin),H=Mj(this.rewrite,I);E=I.href.replace(I.origin,""),H.origin!==this.origin?(R=H.href,N=!0):R=H.pathname+H.search+H.hash}else E=qP(z),R=E;return{publicHref:R,href:E,pathname:S,search:b,searchStr:v,state:C,hash:y??"",external:N,unmaskOnReload:i.unmaskOnReload}},s=r(t);if(t.mask)s.maskedLocation=r({from:t.from,...t.mask});else if(this.options.routeMasks){const i=KP(s.pathname,this.processedTree);if(i){const a=Object.assign(Object.create(null),i.rawParams),{from:o,params:c,...u}=i.route,_=m7(c,a);s.maskedLocation=r({from:t.from,...u,params:_})}}return s},this.commitLocation=async({viewTransition:t,ignoreBlocker:r,...s})=>{let i;const a=Wo(this.latestLocation.href)===Wo(s.href)&&ic(p7(s.state),p7(this.latestLocation.state)),o=this._commitPromise;let c;const u=new Promise(_=>{c=_});if(u.resolve=()=>{c(),o==null||o.resolve()},this._commitPromise=u,a)this.load();else{let{maskedLocation:_,hashScrollIntoView:f,...p}=s;_&&(p={..._,state:{..._.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=f??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,i=s.replace?"REPLACE":"PUSH",this.history[i==="REPLACE"?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.next=s.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:t,resetScroll:r,hashScrollIntoView:s,viewTransition:i,ignoreBlocker:a,...o}={})=>{const c=this.buildLocation({...o,_includeValidateSearch:!0});this._pendingLocation=c;const u=this.commitLocation({...c,viewTransition:i,replace:t,resetScroll:r,hashScrollIntoView:s,ignoreBlocker:a});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),u},this.navigate=async({to:t,reloadDocument:r,href:s,publicHref:i,...a})=>{var c,u;let o=!1;if(s)try{new URL(`${s}`),o=!0}catch{}if(o&&!r&&(r=!0),r){if(t!==void 0||!s){const f=this.buildLocation({to:t,...a});s=s??f.publicHref,i=i??f.publicHref}const _=!o&&i?i:s;if(Om(_,this.protocolAllowlist))return;if(!a.ignoreBlocker){const f=((u=(c=this.history).getBlockers)==null?void 0:u.call(c))??[];for(const p of f)if(p!=null&&p.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(_):window.location.href=_;return}return this.buildAndCommitLocation({...a,href:s,to:t,_isNavigate:!0})},this.load=async t=>{this.updateLatestLocation(),t!=null&&t.action&&(this._scroll.hash=t.action.type==="PUSH"||t.action.type==="REPLACE"),await $H(this,t)},this.startViewTransition=t=>{var s,i;const r=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,r&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&((i=(s=window.CSS)==null?void 0:s.supports)!=null&&i.call(s,"selector(:active-view-transition-type(a))"))){const o=this.latestLocation,c=this.stores.resolvedLocation.get(),u=typeof r.types=="function"?r.types(Tg(o,c)):r.types;if(u===!1)return t();a={update:t,types:u}}else a=t;return document.startViewTransition(a).updateCallbackDone}return t()},this.invalidate=t=>{var u,_;const r=this._committed,s=t==null?void 0:t.filter,i=this._preloads,a=new Set([...r,...this._cache.values(),...[...(i==null?void 0:i.values())??[]].flat(),...((u=this._tx)==null?void 0:u[3])??[]].filter(f=>!s||s(f)).map(f=>f.id)),o=[];for(const[f,p]of i??[])p.some(m=>a.has(m.id))&&(i.delete(f),o.push(f));const c=f=>{if(a.has(f.id)){const p=this.routesById[f.routeId],m={...f,invalid:!0,...(t!=null&&t.forcePending||f.status==="error"||f.status==="notFound")&&_7(p)?{status:"pending",error:void 0}:void 0};return f._flight=void 0,m}return f};this._committed=r.map(c);for(const[f,p]of this._cache)a.has(f)&&(p.invalid=!0,t!=null&&t.forcePending&&(p.status="pending"));for(const f of a)(_=this._flights)==null||_.delete(f);for(const f of o)f.abort();return this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.resolveRedirect=t=>{const r=t.headers.get("Location");if(t.options.href){if(r)try{const s=new URL(r);if(this.origin&&s.origin===this.origin){const i=s.pathname+s.search+s.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}}else{const s=this.buildLocation(t.options).publicHref||"/";t.options.href=s,t.headers.set("Location",s)}if(t.options.href&&Om(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{var u;const r=this._cache,s=this._preloads,i=t==null?void 0:t.filter,a=[],o=[];for(const[_,f]of r)(!i||i(f))&&(o.push(_),a.push(f));const c=[];for(const[_,f]of s??[])(!i||f.some(i))&&(c.push(_),a.push(...f));for(const _ of o)r.delete(_);for(const _ of c)s.delete(_);for(const _ of a){const f=_._flight;_._flight=void 0,f&&!--f[2]&&(((u=this._flights)==null?void 0:u.get(_.id))===f&&this._flights.delete(_.id),c.push(f[1]))}for(const _ of c)_.abort()},this.loadRouteChunk=Uf,this.preloadRoute=t=>PH(this,t),this.matchRoute=(t,r)=>{const s={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(s),a=this.stores.status.get()==="pending";if(r!=null&&r.pending&&!a)return!1;const o=(r==null?void 0:r.pending)??!a?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),c=YP(i.pathname,(r==null?void 0:r.caseSensitive)??!1,(r==null?void 0:r.fuzzy)??!1,o.pathname,this.processedTree);return!c||t.params&&!ic(c.rawParams,t.params,{partial:!0})?!1:(r==null?void 0:r.includeSearch)??!0?ic(o.search,i.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??gH,parseSearch:e.parseSearch??mH,protocolAllowlist:e.protocolAllowlist??UP}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:n,processedTree:t}){this.routesById=e,this.routesByPath=n,this.processedTree=t;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let n=this.routeBranchCache.get(e);return n||(n=jj(e),this.routeBranchCache.set(e,n)),n}matchRoutesInternal(e,n){var p,m;const[t,r,s]=this.getMatchedRoutes(e.pathname);let i=t,a=!1;(s?s.path!=="/"&&r["**"]:Wo(e.pathname))&&(this.options.notFoundRoute?i=[...i,this.options.notFoundRoute]:a=!0);const o=a?AH(this.options.notFoundMode,i):void 0,c=new Array(i.length),u=this._committed,_=(x,S)=>{const b=u[S];return(b==null?void 0:b.routeId)===x.id?b:x===this.options.notFoundRoute?u.find(v=>v.routeId===x.id):void 0};let f;for(let x=0;x{const m=p(c.preSearchFilters?c.preSearchFilters.reduce((x,S)=>S(x),f):f);return c.postSearchFilters?c.postSearchFilters.reduce((x,S)=>S(x),m):m};s.push(_)}const u=c.validateSearch;if(r&&u){const _=({search:f,next:p,meta:m})=>{const x=p(f);try{const S=dm(u,x);if(m&&S)for(const b in S)b in x||(m.defaulted||(m.defaulted=new Map)).set(b,S[b]);return{...x,...S}}catch{}return x};s.push(_)}}const i=(o,c,u)=>{if(o>=s.length){if(!n.search)return{};if(n.search===!0)return c;const f=ed(n.search,c);return u&&(u.explicit=f),f}const _=(f,p)=>{if(p){const m=u||{};return{search:i(o+1,f,m),meta:m}}return i(o+1,f,u)};return s[o]({search:c,next:_,meta:u})};return i(0,e)}function AH(e,n){if(e!=="root"){let t;for(let r=n.length-1;r>=0;r--){const s=n[r];if(s.options.notFoundComponent)return s.id;t||(t=s.children&&s.id)}if(t)return t}return Ff}function m7(e,n){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return n;const t=Object.assign(Object.create(null),n);return Object.assign(t,ed(e,t))}function g7(e,n){var r;const t=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;t&&Object.assign(n,t(n))}function Ay(e,n){var t,r;return(r=(t=e.options[n])==null?void 0:t.preload)==null?void 0:r.call(t)}function RH(e,n){const t=Ay(e,"component");let r=Ay(e,"pendingComponent");return n&&(r?r=r.then(n):n()),t&&r?Promise.all([t,r]).then(()=>{}):t??r}function Uf(e,n,t){const r=()=>n===!1?void 0:n?Ay(e,n):RH(e,t),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const i=e.lazyFn().then(a=>{{const{id:o,...c}=a.options;Object.assign(e.options,c),e._lazy=!0}},a=>{throw e._lazy=void 0,a});return e._lazy=i,i.then(r)}function Iw(e){const n=e.findIndex(t=>t.status!=="success"||t._notFound)+1;return n&&n{const s=()=>r(n);n.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(t,r).finally(()=>n.removeEventListener("abort",s))})}function Ru(e,n){return e.routesById[n.routeId]}function r_(e,n,t){return Rj(e)?[Ei,e]:td(e)?(e.routeId||(e.routeId=t),[Ag,e]):n?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Jo,e]):[Qa,e]}function Bw(e,n){var r,s;let t=r_(n,!0,e.id);if(t[0]!==Jo)return t;try{(s=(r=e.options).onError)==null||s.call(r,t[1])}catch(i){t=r_(i,!0,e.id)}return t}function Uh(e,n,t,r,s){return s[0].signal.aborted?uc:Hw(e,n,t,Bw(t,r),s)}async function MH(e,n,t,r,s,i){var _,f;const[a,o]=n,c=t[0].signal,u=!!t[3];for(let p=t[6]??0;pe.navigate({...C,_fromLocation:a}),buildLocation:e.buildLocation,cause:u?"preload":m.cause,abortController:t[0],preload:u,matches:o,routeId:x.id};try{const C=m._ctx||(m._ctx=x.options.context?x.options.context({...b,deps:m.loaderDeps,context:S})||{}:void 0);m.context={...S,...C}}catch(C){return Ko(e,m),[p,Uh(e,n,x,C,t)]}if(c.aborted)return[p,uc];const v=m.paramsError??m.searchError;if(v!==void 0)return Ko(e,m),[p,Uh(e,n,x,v,t)];const y=x.options.beforeLoad;if(!y)continue;const w=m.status;p>=i&&(m.status="pending",(f=t[7])==null||f.call(t));try{s_(e,m,"beforeLoad",t[0]);const C=await Au(y({...b,search:m.search,context:m.context,...e.options.additionalContext}),c);if(c.aborted)return[p,uc];const z=Hw(e,n,x,r_(C,!1,x.id),t);if(z[0]!==Qa)return Ko(e,m),[p,z];m.context={...m.context,...C}}catch(C){return Ko(e,m),[p,Uh(e,n,x,C,t)]}finally{m.status=w,s_(e,m,!1,t[0])}}s()}function $w(e,n,t){var r;if(!(!t||--t[2])){if(((r=e._flights)==null?void 0:r.get(n.id))===t){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(n)&&s[3].some(i=>i.id===n.id)&&s[3].some(i=>i.isFetching==="beforeLoad"))return;e._flights.delete(n.id)}return t[1]}}function Ko(e,n){var r;const t=n._flight;n._flight=void 0,(r=$w(e,n,t))==null||r.abort()}function ai(e,n,t,r){var i;const s=[];for(const a of n)if(!(t!=null&&t.includes(a))){const o=a._flight;if(a._flight=void 0,r&&(o==null?void 0:o[2])===1&&((i=e._flights)==null?void 0:i.get(a.id))===o&&(t!=null&&t.some(c=>c.id===a.id)))o[2]=0;else{const c=$w(e,a,o);c&&s.push(c)}}for(const a of s)a.abort()}function Pw(e){for(const n of e){const t=n._flight;t&&t[2]++}}function s_(e,n,t,r){var a;if(n.isFetching=t,r&&((a=e._tx)==null?void 0:a[0])!==r)return;const s=e.stores.byRoute.get(n.routeId),i=s==null?void 0:s.get();(i==null?void 0:i.id)===n.id&&s.set({...i,isFetching:t})}function Lj(e,n,t,r,s,i,a){const o=n[0];return{params:t.params,location:o,navigate:c=>e.navigate({...c,_fromLocation:o}),cause:a?"preload":t.cause,abortController:s,preload:a,deps:t.loaderDeps,parentMatchPromise:i,context:t.context,route:r,...e.options.additionalContext}}async function b7(e,n,t,r,s,i,a){const o=a[0],c=o.signal;if(c.aborted)return uc;if(!s)return[Qa,void 0];let u=t._flight;s_(e,t,"loader",o);try{if(!u){const _=new AbortController;u=[Promise.resolve().then(()=>s(Lj(e,n,t,r,_,i,!!a[3]))).then(f=>r_(f,!1,r.id),f=>r_(f,!0,r.id)).then(f=>{var p;return f[0]!==Qa&&((p=e._flights)==null?void 0:p.get(t.id))===u&&(e._flights.delete(t.id),u[2]||_.abort()),f[0]===Jo&&u[2]?Bw(r,f[1]):f}),_,1],(e._flights??(e._flights=new Map)).set(t.id,u)}return t._flight=u,t.abortController=u[1],Hw(e,n,r,await Au(u[0],c),a)}catch(_){if(_!==c||!c.aborted)throw _;return Ko(e,t),uc}finally{s_(e,t,!1,o)}}function v7(e,n,t){n[0]!==Ei&&(e.status="success",e.error=void 0,n[0]===Qa?(e.loaderData=n[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=t):e.invalid=!0)}function LH(e,n,t){const r=e._cache.get(n.id);if(r!==t||e._committed.some(i=>i.id===n.id&&i._flight===n._flight))return;const s={...n,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(n.id,s),r&&Ko(e,r)}function x7(e,n){return n[0]===Jo||n[0]===Ag?{...e,status:n[0]===Jo?"error":"notFound",error:n[1],_flight:void 0}:e}function DH(e,n,t,r,s,i,a){var H,U;const o=n[1][t],c=Ru(e,o),u=!!i[3],_=e._cache.get(o.id);let f,p=!1,m;try{if(o.status==="success"&&(f=c.options.shouldReload,typeof f=="function"&&(f=f(Lj(e,n,o,c,i[0],s,u))),i[0].signal.aborted&&(m=uc)),!m)if(o.status!=="success")p=!0;else{const F=u||o.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;p=!!(o.invalid||f||f===void 0&&Date.now()-o.updatedAt>=F&&(i[5]||o.cause==="enter"||i[2].some(Y=>Y.routeId===o.routeId&&Y.id!==o.id)))}}catch(F){o.invalid=!0,Ko(e,o),m=Uh(e,n,c,F,i)}const x=c.options.loader,S=typeof x=="function",b=S?x:x==null?void 0:x.handler,v=!u||c.options.preload!==!1;let y=v&&x?(H=e._flights)==null?void 0:H.get(o.id):void 0;y===o._flight||m?y=void 0:y&&!p&&!u&&f===void 0?p=!0:p||(y=void 0);const w=!!(x&&p&&o.status==="success"&&!u&&!i[4]&&((S?void 0:x.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),C=p&&v,z=C&&!w&&(o.status!=="success"||!!x),E=t>=a?i[7]:void 0,R=c.lazyFn&&c._lazy!==!0?E:void 0;if(C&&!x&&(o.invalid=!1,o.updatedAt=Date.now()),y&&y[2]++,z){const F=o._flight;o._flight=y,(U=$w(e,o,F))==null||U.abort(),t>=a&&(o.status="pending"),E==null||E()}C||(o.isFetching=!1);const N=(m?Promise.resolve(m):z?b7(e,n,o,c,b,s,i):Promise.resolve([Qa,o.loaderData])).then(F=>(z&&(v7(o,F,u),F[0]===Qa&&(x&&!i[0].signal.aborted&&LH(e,o,_),t>=a&&(o.status="pending"))),F)),M=Au(Promise.resolve().then(()=>Uf(c,void 0,R)),i[0].signal).then(()=>{},F=>n[1].some((Y,q)=>q<=t&&(Y.status==="error"||Y.status==="notFound"||Y._notFound))?void 0:[t,Uh(e,n,c,F,i)]).then(F=>N.then(Y=>(z&&!F&&Y[0]===Qa&&o.status==="pending"&&!i[0].signal.aborted&&(o.status="success",E==null||E()),F)));if(r.push([t,N,M]),!w)return N.then(F=>x7(o,F));const O={...o,status:"pending",preload:!1,_flight:y};o.invalid=!1,o.isFetching="loader";const I=b7(e,n,O,c,b,s,i).then(F=>(o.isFetching=!1,v7(O,F,!1),F));return(n[2]??(n[2]=[])).push([t,I,M,O]),I.then(F=>x7(O,F))}async function Ry(e,n,t,r,s=0){const i=t==null?void 0:t[1][1];let a=i!=null&&i.routeId?n.findIndex(o=>o.routeId===i.routeId):(t==null?void 0:t[0])??n.length-1;a<0&&(a=0);for(let o=a;o>=0;o--){const c=Ru(e,n[o]);try{const u=Uf(c,!1);u&&await Au(u,r)}catch(u){if(u===r&&r.aborted)throw u}if(c.options.notFoundComponent)return o}return i!=null&&i.routeId?a:s}function mu(e,n){n[2]&&(ai(e,n[2].map(t=>t[3])),n[2]=void 0)}async function y7(e,n,t,r){let s;try{await Promise.all(e.map(i=>i[1].then(async a=>{const o=i[0];if(!(r&&o>=await r)){if(a[0]>=Ei)throw[o,a];!s&&a[0]!==Qa&&(s=[o,a],await Promise.all((t??[]).map(c=>{if(!(c[0]<=o))return c[1].then(u=>{if(u[0]===Ei)throw[c[0],u]})})))}})))}catch(i){return i}return n??s}function Hw(e,n,t,r,s,i){for(;r[0]===Ei;){const a=r[1],o=a.options;if(o.reloadDocument?s[3]:s[1]>=20)return r;try{return o.href&&o.reloadDocument?(e.resolveRedirect(a),r):[Ei,a,e.buildLocation({...o,_fromLocation:n[0],_includeValidateSearch:!0})]}catch(c){r=i?[Jo,c]:Bw(t,c),i=!0}}return r}async function Dj(e,n,t,r,s,i){const a=n[1];let o=await s,c=!1;const u=a.findIndex(m=>m._notFound),_=m=>m[1][0]===Ag?Ry(e,a,m,r.signal):m[0];let f=u<0?a.length:u;if(((o==null?void 0:o[1][0])??0)>=Ei)f=0;else if(o){f=o[2]??(o[2]=await _(o));for(const m of t){if(m[0]>=f)break;const x=await m[1];if(x[0]!==Qa&&x[0]=f)break;const x=await m[2];if(x){o=x;break}}if(((o==null?void 0:o[1][0])??0)>=Ei){const m=o[1];if(m[0]!==Ei||m[1].options.reloadDocument||m[2])return mu(e,n),m;c=!0,o=[0,[Jo,new Error("Too many redirects")]]}const p=o?o[2]??await _(o):u;if(p>=0){const m=o==null?void 0:o[1],x=m==null?void 0:m[0],S=a[p],b=m==null?void 0:m[1],v=()=>{m&&(S._notFound=void 0,x===Jo?S.status="error":(b.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=b,S.isFetching=!1)};v(),m||i==null||i();const y=Ru(e,S);try{await Au(m?Promise.resolve().then(()=>Uf(y,x===Jo?"errorComponent":"notFoundComponent")):Promise.all([Uf(y),Uf(y,"notFoundComponent")]),r.signal)}catch(w){if(w===r.signal&&r.signal.aborted)return mu(e,n),uc}m?c&&(r.abort(),await Promise.all([...t.map(w=>w[1]),...t.map(w=>w[2]),...(n[2]??[]).map(w=>w[1])]),mu(e,n),ai(e,a),v()):S.status="success"}return n}async function Oj(e,n,t,r=0,s=n[1].length){var a,o;const i=n[1];for(let c=r;cy._notFound);if(e.options.notFoundMode!=="root"&&u>=0){const y=await Ry(e,t,void 0,i,u);t[u]._notFound=void 0,t[y]._notFound=!0,u=y}let _=u<0?t.length:u+1,f=0;for(;f<_&&f!==u;){const y=t[f],w=r[2][f],C=c[f];if((w==null?void 0:w.id)!==y.id||w.status!=="success"||w._notFound||y.preload||(C==null?void 0:C.id)!==y.id||C.status!=="success"||C._notFound)break;f++}const p=[],m=r[6]??0;let x=m?Promise.resolve(t[m-1]):void 0;const S=()=>{for(let y=m;y<_&&!i.aborted;y++)x=DH(e,s,y,p,x,r,f)},b=await MH(e,s,r,_,S,f);if(b){if(r[4]=!0,_=b[0],b[1][0]===Ag){const y=await Ry(e,t,b,i);b[2]=y,_=Math.min(_,y+1)}else b[1][0]>=Ei&&(_=0);S()}if(!i.aborted&&!r[3]){const y=[];for(const[w,C]of e._flights??[])C[2]||(e._flights.delete(w),y.push(C[1]));for(const w of y)w.abort()}const v=Dj(e,s,p,r[0],y7(p,b,s[2]),r[7]);(o=s[2])!=null&&o.length&&(s[3]=y7(s[2],void 0,void 0,v.then(y=>n_(y)?0:Iw(t).length,()=>0))),a=await v}catch(c){if(mu(e,s),c===i&&i.aborted)return uc;throw c}return n_(a)?a:Oj(e,a,i,r[6]===t.length?r[6]:0)}function My(e,n){var i,a;if(e._tx!==n)return;const t=n[3],r=e.stores.matches.get();let s=e._pending;for(let o=0;o0){s[3]=setTimeout(()=>My(e,n),y);return}s[2]=0}const b=t.map(y=>({...y,_flight:void 0}));b[o].status="pending";const v=s[4]=e.startTransition(()=>e.stores.setMatches(b),b).then(y=>(y&&e._pending===s&&s[4]===v&&!s[2]&&(s[2]=Date.now()+x),y));return}}function Sh(e,n){var r;const t=e._pending;(e._tx===n||!((r=e._tx)!=null&&r[3].some(s=>s.id===(t==null?void 0:t[1]))))&&(clearTimeout(t==null?void 0:t[3]),e._pending=void 0)}async function w7(e,n){const t=e._pending;if(!t)return;clearTimeout(t[3]);const r=t[2]-Date.now();if(!t[4]||r<=0||!Iw(n[3]).some(i=>i.id===t[1]))return;let s;try{await Au(new Promise(i=>{s=setTimeout(i,r)}),n[0].signal)}catch{}clearTimeout(s)}function Bj(e,n){e._committed=n,e.stores.setMatches(n)}function OH(e,n,t,r){const s=e._committed,i=e._cache;for(const c of t)c.preload=!1,r&&(c._assetEnd=void 0);const a=Iw(t).length,o=new Map;{const c=Date.now();for(const u of[...s,...i.values()]){if(u.status!=="success"||t.some((f,p)=>f.id===u.id&&(p=(u.preload?_.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:_.options.gcTime??e.options.defaultGcTime??3e5)||o.set(u.id,i.get(u.id)===u?u:{...u,_flight:void 0,isFetching:!1,context:{}})}}n[3]=[],e._cache=o,Bj(e,t),ai(e,[...i.values(),...s],[...t,...o.values()]),NH(e,s,t,n)}async function xp(e,n){let t=e._tx;for(;t&&t!==n;){if(await t[5],e._tx===t)return;t=e._tx}}function $j(e,n,t){const r=t[1].options,s=t[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:s.publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=n[1]+1,e._pendingLocation=s;const i=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),i}async function IH(e,n,t,r,s){const i=t.map(c=>({...c}));Pw(i);for(const c of r)Ko(e,i[c[0]]),i[c[0]]=c[3];const a=[n[2],i];let o;try{o=await Dj(e,a,r,n[0],s)}catch(c){throw ai(e,i),c}if(n_(o)){ai(e,i),o[0]===Ei&&e._tx===n&&e._committed===t&&await $j(e,n,o);return}if(await Oj(e,o,n[0].signal),e._tx!==n||e._committed!==t){ai(e,i);return}for(const c of i){const u=e._cache.get(c.id);u!=null&&u._flight&&u._flight===c._flight&&(e._cache.delete(c.id),Ko(e,u))}Bj(e,i),ai(e,t,i)}async function BH(e,n,t,r,s,i){const a=await Ij(e,n[2],n[3],[n[0],n[1],e._committed,void 0,s,t,i,r]);if(n_(a)){const f=a[0]===Ei&&e._tx===n;if((!f||a[1].options.reloadDocument)&&Sh(e,n),ai(e,n[3]),n[3]=[],!f)return;if(e._tx!==n){Sh(e,n);return}await $j(e,n,a);return}const o=a[1];if(e._tx===n&&await w7(e,n),e._tx!==n){Sh(e,n),ai(e,o),mu(e,a);return}const c=n[2],u=Tg(c,e.stores.resolvedLocation.get()),_=a[2];await e.startViewTransition(async()=>{var m;if(e._tx===n&&await w7(e,n),e._tx!==n){Sh(e,n),ai(e,o),mu(e,a);return}const f=()=>{Sh(e,n),OH(e,n,o,i),e._tx===n&&(e.emit({type:"onLoad",...u}),e._tx===n&&e.emit({type:"onBeforeRouteMount",...u}))},p=await e.startTransition(f,o);if(e._tx!==n){mu(e,a);return}_!=null&&_.length&&IH(e,n,o,_,a[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set("idle"),e._tx===n&&e.emit({type:"onResolved",...u}),p&&e._tx===n&&e.emit({type:"onRendered",...u})}),e._tx===n&&((m=e._commitPromise)==null||m.resolve(),e._commitPromise=void 0)})}async function $H(e,n){var C;const t=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),i=e.latestLocation,a=e._pendingLocation,o=(a==null?void 0:a.href)===i.href?a._redirects??0:0,c=e._handoff,u=c==null?void 0:c[0](),_=new AbortController,f=e._preflight;if(e._preflight=_,u||c==null||c[1](),f==null||f.abort(),!_.signal.aborted){const z=Tg(i,r);e.emit({type:"onBeforeNavigate",...z}),_.signal.aborted||e.emit({type:"onBeforeLoad",...z})}if(_.signal.aborted){await xp(e,t);return}const p=s.href===i.href;let m=_;const x=e.matchRoutes(i,{_controller:_});Pw(x);const S=u?c[1](x):void 0;if(S?m=u:u==null||u.abort(),_.signal.aborted){ai(e,x),await xp(e,t);return}e._preflight=void 0;let b;const v=()=>BH(e,w,p,()=>My(e,w),n==null?void 0:n.sync,S),y=n!=null&&n.sync?new Promise(z=>b=z):Promise.resolve().then(v).then(),w=[m,o,i,x,Date.now(),y];if(e._tx=w,t){for(const z of e.stores.matches.get()){if(e._tx!==w)break;z.isFetching&&s_(e,z,!1)}t[0].abort(),ai(e,t[3],w[3],!0)}if(e._tx!==w){ai(e,w[3]),w[3]=[],b==null||b(),await xp(e,w);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(i)}),(S||!e._committed.length&&((C=x[0])==null?void 0:C.status)!=="success"&&!x.some(z=>z._notFound))&&My(e,w),b==null||b(v()),await y,await xp(e,w)}async function PH(e,n){let t=e.buildLocation(n);for(let r=0;;r++){const s=e._committed,i=new AbortController;let a,o,c;try{try{a=e.matchRoutes(t,{_controller:i}),Pw(a),o=(e._preloads??(e._preloads=new Map)).set(i,a),c=await Ij(e,t,a,[i,r,s,!0])}finally{o&&(o=o.delete(i),ai(e,a)),i.abort()}if(!n_(c))return c[1];if(!o||c.length<3)return;t=c[2]}catch(u){td(u)||console.error(u);return}}}const HH="Error preloading route! ☝️";var Pj=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=n=>{var c,u;this.originalIndex=n.originalIndex;const t=this.options,r=!(t!=null&&t.path)&&!(t!=null&&t.id);this.parentRoute=(u=(c=this.options).getParentRoute)==null?void 0:u.call(c),r?this._path=Ff:this.parentRoute||Lw();let s=r?Ff:t==null?void 0:t.path;s&&s!=="/"&&(s=Tj(s));const i=(t==null?void 0:t.id)||s;let a=r?Ff:cm([this.parentRoute.id==="__root__"?"":this.parentRoute.id,i]);s==="__root__"&&(s="/"),a!=="__root__"&&(a=cm(["/",a]));const o=a==="__root__"?"/":cm([this.parentRoute.fullPath,s]);this._path=s,this._id=a,this._fullPath=o,this._to=Wo(o)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>xH({from:this.fullPath,...n}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},FH=class extends Pj{constructor(e){super(e)}},Fw=class extends T.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,n){const t=e.getResetKey();return n.error&&n.resetKey!==t?{resetKey:t,error:null}:{resetKey:t}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,n){var t,r;(r=(t=this.props).onCatch)==null||r.call(t,e,n)}render(){const e=this.state.error;return e?T.createElement(this.props.errorComponent??UH,{error:e,reset:this.reset}):this.props.children}};function UH({error:e}){const[n,t]=T.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(r=>!r),children:n?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),n?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function qH({children:e,fallback:n=null}){return h.jsx(Xe.Fragment,{children:Hj()?e:n})}function Hj(){return Xe.useSyncExternalStore(GH,()=>!0,()=>!1)}function GH(){return()=>{}}var Fj=T.createContext(null);function Vs(e){return T.useContext(Fj)}var Rg=T.createContext(void 0),VH=T.createContext(void 0),sr=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(sr||{});function WH({update:e,notify:n,unwatched:t}){return{link:r,unlink:s,propagate:i,checkDirty:a,shallowPropagate:o};function r(u,_,f){const p=_.depsTail;if(p!==void 0&&p.dep===u)return;const m=p!==void 0?p.nextDep:_.deps;if(m!==void 0&&m.dep===u){m.version=f,_.depsTail=m;return}const x=u.subsTail;if(x!==void 0&&x.version===f&&x.sub===_)return;const S=_.depsTail=u.subsTail={version:f,dep:u,sub:_,prevDep:p,nextDep:m,prevSub:x,nextSub:void 0};m!==void 0&&(m.prevDep=S),p!==void 0?p.nextDep=S:_.deps=S,x!==void 0?x.nextSub=S:u.subs=S}function s(u,_=u.sub){const f=u.dep,p=u.prevDep,m=u.nextDep,x=u.nextSub,S=u.prevSub;return m!==void 0?m.prevDep=p:_.depsTail=p,p!==void 0?p.nextDep=m:_.deps=m,x!==void 0?x.prevSub=S:f.subsTail=S,S!==void 0?S.nextSub=x:(f.subs=x)===void 0&&t(f),m}function i(u){let _=u.nextSub,f;e:do{const p=u.sub;let m=p.flags;if(m&60?m&12?m&4?!(m&48)&&c(u,p)?(p.flags=m|40,m&=1):m=0:p.flags=m&-9|32:m=0:p.flags=m|32,m&2&&n(p),m&1){const x=p.subs;if(x!==void 0){const S=(u=x).nextSub;S!==void 0&&(f={value:_,prev:f},_=S);continue}}if((u=_)!==void 0){_=u.nextSub;continue}for(;f!==void 0;)if(u=f.value,f=f.prev,u!==void 0){_=u.nextSub;continue e}break}while(!0)}function a(u,_){let f,p=0,m=!1;e:do{const x=u.dep,S=x.flags;if(_.flags&16)m=!0;else if((S&17)===17){if(e(x)){const b=x.subs;b.nextSub!==void 0&&o(b),m=!0}}else if((S&33)===33){(u.nextSub!==void 0||u.prevSub!==void 0)&&(f={value:u,prev:f}),u=x.deps,_=x,++p;continue}if(!m){const b=u.nextDep;if(b!==void 0){u=b;continue}}for(;p--;){const b=_.subs,v=b.nextSub!==void 0;if(v?(u=f.value,f=f.prev):u=b,m){if(e(_)){v&&o(b),_=u.sub;continue}m=!1}else _.flags&=-33;_=u.sub;const y=u.nextDep;if(y!==void 0){u=y;continue e}}return m}while(!0)}function o(u){do{const _=u.sub,f=_.flags;(f&48)===32&&(_.flags=f|16,(f&6)===2&&n(_))}while((u=u.nextSub)!==void 0)}function c(u,_){let f=_.depsTail;for(;f!==void 0;){if(f===u)return!0;f=f.prevDep}return!1}}function KH(e,n,t){var i,a,o;const r=typeof e=="object",s=r?e:void 0;return{next:(i=r?e.next:e)==null?void 0:i.bind(s),error:(a=r?e.error:n)==null?void 0:a.bind(s),complete:(o=r?e.complete:t)==null?void 0:o.bind(s)}}const Ly=[];let hm=0;const{link:S7,unlink:YH,propagate:XH,checkDirty:Uj,shallowPropagate:k7}=WH({update(e){return e._update()},notify(e){Ly[Dy++]=e,e.flags&=~sr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=sr.Mutable|sr.Dirty,Hm(e))}});let yp=0,Dy=0,Wa,Oy=0;function ZH(e){try{++Oy,e()}finally{--Oy||qj()}}function Hm(e){const n=e.depsTail;let t=n!==void 0?n.nextDep:e.deps;for(;t!==void 0;)t=YH(t,e)}function qj(){if(!(Oy>0)){for(;yp{var u;s.get(),o.current?(u=a.next)==null||u.call(a,s._snapshot):o.current=!0});return{unsubscribe:()=>{c.stop()}}},_update(i){const a=Wa,o=(n==null?void 0:n.compare)??Object.is;if(t)Wa=s,++hm,s.depsTail=void 0;else if(i===void 0)return!1;t&&(s.flags=sr.Mutable|sr.RecursedCheck);try{const c=s._snapshot,u=typeof i=="function"?i(c):i===void 0&&t?r(c):i;return c===void 0||!o(c,u)?(s._snapshot=u,!0):!1}finally{Wa=a,t&&(s.flags&=~sr.RecursedCheck),Hm(s)}}};return t?(s.flags=sr.Mutable|sr.Dirty,s.get=function(){const i=s.flags;if(i&sr.Dirty||i&sr.Pending&&Uj(s.deps,s)){if(s._update()){const a=s.subs;a!==void 0&&k7(a)}}else i&sr.Pending&&(s.flags=i&~sr.Pending);return Wa!==void 0&&S7(s,Wa,hm),s._snapshot}):s.set=function(i){if(s._update(i)){const a=s.subs;a!==void 0&&(XH(a),k7(a),qj())}},s}function QH(e){const n=()=>{const r=Wa;Wa=t,++hm,t.depsTail=void 0,t.flags=sr.Watching|sr.RecursedCheck;try{return e()}finally{Wa=r,t.flags&=~sr.RecursedCheck,Hm(t)}},t={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:sr.Watching|sr.RecursedCheck,notify(){const r=this.flags;r&sr.Dirty||r&sr.Pending&&Uj(this.deps,this)?n():this.flags=sr.Watching},stop(){this.flags=sr.None,this.depsTail=void 0,Hm(this)}};return n(),t}var qv={exports:{}},Gv={},Vv={exports:{}},Wv={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var E7;function JH(){if(E7)return Wv;E7=1;var e=G_();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var t=typeof Object.is=="function"?Object.is:n,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function o(f,p){var m=p(),x=r({inst:{value:m,getSnapshot:p}}),S=x[0].inst,b=x[1];return i(function(){S.value=m,S.getSnapshot=p,c(S)&&b({inst:S})},[f,m,p]),s(function(){return c(S)&&b({inst:S}),f(function(){c(S)&&b({inst:S})})},[f]),a(m),m}function c(f){var p=f.getSnapshot;f=f.value;try{var m=p();return!t(f,m)}catch{return!0}}function u(f,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return Wv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_,Wv}var N7;function eF(){return N7||(N7=1,Vv.exports=JH()),Vv.exports}/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var z7;function tF(){if(z7)return Gv;z7=1;var e=G_(),n=eF();function t(u,_){return u===_&&(u!==0||1/u===1/_)||u!==u&&_!==_}var r=typeof Object.is=="function"?Object.is:t,s=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,c=e.useDebugValue;return Gv.useSyncExternalStoreWithSelector=function(u,_,f,p,m){var x=i(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=o(function(){function v(E){if(!y){if(y=!0,w=E,E=p(E),m!==void 0&&S.hasValue){var R=S.value;if(m(R,E))return C=R}return C=E}if(R=C,r(w,E))return R;var N=p(E);return m!==void 0&&m(R,N)?(w=E,R):(w=E,C=N)}var y=!1,w,C,z=f===void 0?null:f;return[function(){return v(_())},z===null?void 0:function(){return v(z())}]},[_,f,p,m]);var b=s(u,x[0],x[1]);return a(function(){S.hasValue=!0,S.value=b},[b]),c(b),b},Gv}var j7;function nF(){return j7||(j7=1,qv.exports=tF()),qv.exports}var Gj=nF();const rF=q_(Gj);function sF(e,n){return e===n}function to(e,n,t=sF){const r=T.useCallback(a=>{if(!e)return()=>{};const{unsubscribe:o}=e.subscribe(a);return o},[e]),s=T.useCallback(()=>e==null?void 0:e.get(),[e]);return Gj.useSyncExternalStoreWithSelector(r,s,s,n,t)}var T7={};function Uw(e,n){const t=T.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??n.options.defaultStructuralSharing?t.current=cu(t.current,s):s}}function Mu(e){const n=Vs(),t=T.useContext(e.from?VH:Rg),r=e.from??t,s=n.stores.getMatchStore(r),i=Uw(e,n),a=to(s,o=>o?i(o):T7);if(a!==T7)return a;(e.shouldThrow??!0)&&Lw()}function Vj(e){return Mu({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function Wj(e){const{select:n,...t}=e;return Mu({...t,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function Kj(e){return Mu({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function Yj(e){return Mu({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Mg(e){const n=Vs();return T.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}function Xj(e){return Mu({...e,select:n=>e.select?e.select(n.context):n.context})}function Kv(e){const n=T.useRef(e);return ic(n.current,e,{ignoreUndefined:!1})||(n.current=e),n.current}function iF(e,n){return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}function aF(e,n,t){if(e!=null&&e.external)return Om(e.href,t)?void 0:e.href;if(!hF(n)&&!(typeof n!="string"||n.indexOf(":")===-1))try{return new URL(n),Om(n,t)?void 0:n}catch{}}function oF(e,n,t,r,s,i){if(i)return!1;if(t!=null&&t.exact){if(!nH(e.pathname,n.pathname,r))return!1}else{const a=Bm(e.pathname,r),o=Bm(n.pathname,r);if(!(a.startsWith(o)&&(a.length===o.length||a[o.length]==="/")))return!1}return((t==null?void 0:t.includeSearch)??!0)&&!ic(e.search,n.search,{partial:!(t!=null&&t.exact),ignoreUndefined:!(t!=null&&t.explicitUndefined)})?!1:t!=null&&t.includeHash?s&&e.hash===n.hash:!0}function lF(e,n){const t=Vs(),r=BP(n),{activeProps:s,inactiveProps:i,activeOptions:a,to:o,preload:c,preloadDelay:u,preloadIntentProximity:_,hashScrollIntoView:f,replace:p,startTransition:m,resetScroll:x,viewTransition:S,children:b,target:v,disabled:y,style:w,className:C,onClick:z,onBlur:E,onFocus:R,onMouseEnter:N,onMouseLeave:M,onTouchStart:O,ignoreBlocker:I,params:H,search:U,hash:F,state:Y,mask:q,reloadDocument:Q,unsafeRelative:Z,from:B,_fromLocation:D,...P}=e,X=Hj(),W=Kv(e.search),ie=Kv(e.params),le=Kv(a),ae=T.useMemo(()=>e,[t,e.from,e._fromLocation,e.hash,e.to,W,ie,e.state,e.mask,e.unsafeRelative]),se=T.useCallback(nt=>{const ut=t.buildLocation({_fromLocation:nt,...ae}),pt=dF(ut.maskedLocation?ut.maskedLocation.publicHref:ut.publicHref,ut.maskedLocation?ut.maskedLocation.external:ut.external,t.history,y),ve=aF(pt,o,t.protocolAllowlist);return[pt==null?void 0:pt.href,ve,oF(nt,ut,le,t.basepath,X,ve!==void 0)]},[le,y,X,ae,t,o]),[G,oe,ce]=to(t.stores.location,se,iF),pe=ce?ed(s,{})??cF:Yv,ue=ce?Yv:ed(i,{})??Yv,Ee=[C,pe.className,ue.className].filter(Boolean).join(" "),Te=(w||pe.style||ue.style)&&{...w,...pe.style,...ue.style},Ie=T.useRef(!1),Le=e.reloadDocument||oe||y?!1:c??t.options.defaultPreload,He=u??t.options.defaultPreloadDelay??0,Tt=T.useCallback(()=>{t.preloadRoute(ae).catch(nt=>{console.warn(nt),console.warn(HH)})},[t,ae]),Et=T.useCallback(nt=>{if(!nt){Xv(r);return}if(!(nt.isIntersecting??Le==="intent")){nt.isIntersecting===!1&&Xv(r);return}if(!He){Tt();return}qh.has(r)||qh.set(r,setTimeout(()=>{qh.delete(r),Tt()},He))},[Tt,r,Le,He]);IP(r,Et,Le!=="viewport"),T.useEffect(()=>{Ie.current||Le==="render"&&(Tt(),Ie.current=!0)},[Tt,Le]);const Vt=nt=>{const ut=nt.currentTarget.getAttribute("target"),pt=v!==void 0?v:ut;!y&&!(nt.metaKey||nt.altKey||nt.ctrlKey||nt.shiftKey)&&!nt.defaultPrevented&&(!pt||pt==="_self")&&nt.button===0&&(nt.preventDefault(),t.navigate({...ae,replace:p,resetScroll:x,hashScrollIntoView:f,startTransition:m,viewTransition:S,ignoreBlocker:I}))};if(oe)return{...P,ref:r,href:oe,...b&&{children:b},...v&&{target:v},...y&&{disabled:y},...w&&{style:w},...C&&{className:C},...z&&{onClick:z},...E&&{onBlur:E},...R&&{onFocus:R},...N&&{onMouseEnter:N},...M&&{onMouseLeave:M},...O&&{onTouchStart:O}};const $t=()=>{Le==="intent"&&Tt()},rt=()=>{Le==="intent"&&Xv(r)};return{...P,...pe,...ue,href:G,ref:r,onClick:yf([z,Vt]),onBlur:yf([E,rt]),onFocus:yf([R,Et]),onMouseEnter:yf([N,Et]),onMouseLeave:yf([M,rt]),onTouchStart:yf([O,$t]),disabled:!!y,target:v,...Te&&{style:Te},...Ee&&{className:Ee},...y&&uF,...ce&&fF}}var Yv={},cF={className:"active"},uF={role:"link","aria-disabled":!0},fF={"data-status":"active","aria-current":"page"},qh=new WeakMap,Xv=e=>{clearTimeout(qh.get(e)),qh.delete(e)},yf=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function dF(e,n,t,r){if(!r)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function hF(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}var Lg=T.forwardRef((e,n)=>{const{_asChild:t,...r}=e,{type:s,...i}=lF(r,n),a=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;if(!t){const{disabled:o,...c}=i;return T.createElement("a",c,a)}return T.createElement(t,i,a)}),_F=class extends Pj{constructor(n){super(n),this.useMatch=t=>Mu({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Xj({...t,from:this.id}),this.useSearch=t=>Yj({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Kj({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Wj({...t,from:this.id}),this.useLoaderData=t=>Vj({...t,from:this.id}),this.useNavigate=()=>Mg({from:this.fullPath}),this.Link=Xe.forwardRef((t,r)=>h.jsx(Lg,{ref:r,from:this.fullPath,...t}))}};function pF(e){return new _F(e)}var mF=class extends FH{constructor(e){super(e),this.useMatch=n=>Mu({select:n==null?void 0:n.select,from:this.id,structuralSharing:n==null?void 0:n.structuralSharing}),this.useRouteContext=n=>Xj({...n,from:this.id}),this.useSearch=n=>Yj({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useParams=n=>Kj({select:n==null?void 0:n.select,structuralSharing:n==null?void 0:n.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Wj({...n,from:this.id}),this.useLoaderData=n=>Vj({...n,from:this.id}),this.useNavigate=()=>Mg({from:this.fullPath}),this.Link=Xe.forwardRef((n,t)=>h.jsx(Lg,{ref:t,from:this.fullPath,...n}))}};function gF(e){return new mF(e)}function ao(e){return n=>{const t=pF(n);return t.isRoot=!1,t}}function bF(e){const n=Vs(),t=`not-found-${to(n.stores.location,r=>r.pathname)}-${to(n.stores.status,r=>r)}`;return h.jsx(Fw,{getResetKey:()=>t,onCatch:(r,s)=>{var i;if(td(r))(i=e.onCatch)==null||i.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(td(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function vF(){return h.jsx("p",{children:"Not Found"})}function zf(e){return h.jsx(h.Fragment,{children:e.children})}function Zj(e,n,t){return n.options.notFoundComponent?h.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...t}):h.jsx(vF,{})}function Dg(e,n){const t=(n==null?void 0:n.options.pendingComponent)??e.options.defaultPendingComponent;return t?h.jsx(t,{}):null}var xF=(e,n)=>e[0]===n[0]&&e[1]===n[1],Qj=(e,n,t)=>!n.isRoot||n.options.shellComponent||n.options.wrapInSuspense||t===!1||t==="data-only"||!e.ssr,Jj=T.memo(function({routeId:n}){const t=Vs();return h.jsx(yF,{router:t,match:to(t.stores.getMatchStore(n),r=>r)})});function yF({router:e,match:n}){var f,p;const t=e.routesById[n.routeId],r=Dg(e,t),s=t.options.errorComponent??e.options.defaultErrorComponent,i=t.options.onCatch??e.options.defaultOnCatch,a=t.isRoot?t.options.notFoundComponent??((f=e.options.notFoundRoute)==null?void 0:f.options.component):t.options.notFoundComponent,o=n.ssr===!1||n.ssr==="data-only",c=Qj(e,t,n.ssr)&&(t.options.wrapInSuspense??r??(((p=t.options.errorComponent)==null?void 0:p.preload)||o))?T.Suspense:zf,u=s?Fw:zf,_=a?bF:zf;return h.jsxs(t.isRoot?t.options.shellComponent??zf:zf,{children:[h.jsx(Rg.Provider,{value:n.routeId,children:h.jsx(c,{fallback:r,children:h.jsx(u,{getResetKey:()=>n,errorComponent:s,onCatch:(m,x)=>{if(td(m))throw m.routeId??(m.routeId=n.routeId),m;i==null||i(m,x)},children:h.jsx(_,{fallback:m=>{if(m.routeId??(m.routeId=n.routeId),m.routeId!==n.routeId)throw m;return T.createElement(a,m)},children:o?h.jsx(qH,{fallback:r,children:h.jsx(A7,{match:n})}):h.jsx(A7,{match:n})})})})}),null]})}var A7=T.memo(function({match:n}){const t=Vs(),r=n.routeId,s=t.routesById[r],i=T.useMemo(()=>{var c;const o=(c=s.options.remountDeps??t.options.defaultRemountDeps)==null?void 0:c({routeId:r,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return o?JSON.stringify(o):void 0},[r,n.loaderDeps,n._strictParams,n._strictSearch,s.options.remountDeps,t.options.defaultRemountDeps]),a=T.useMemo(()=>{const o=s.options.component??t.options.defaultComponent;return o?h.jsx(o,{},i):h.jsx(i_,{})},[i,s.options.component,t.options.defaultComponent]);if(n.status==="pending"){if(t.ssr&&!Qj(t,s,n.ssr))return a;if(t._tx)throw t._tx[5];return Dg(t,s)}if(n.status==="notFound")return Zj(t,s,n.error);if(n.status==="error")throw n.error;return a}),i_=T.memo(function(){const n=Vs(),t=T.useContext(Rg);let r,s,i;{const o=n.stores.getMatchStore(t);[r,s]=to(o,c=>[!!c._notFound,c.error],xF),i=to(n.stores.ids,c=>c[c.indexOf(t)+1])}if(r)return Zj(n,n.routesById[t],s);if(!i)return null;const a=h.jsx(Jj,{routeId:i});return t===Ff?h.jsx(T.Suspense,{fallback:Dg(n),children:a}):a});function eT(e,n){const t=e[1];e.length=0,t==null||t(n)}function wF({t:e}){const n=Vs(),t=n._rendered??(n._rendered=[]);return n.startTransition=(r,s)=>new Promise(i=>{eT(t,!1),t.push(s,i),e(n),T.startTransition(r)}),wj(()=>{const r=n.history.subscribe(n.load);n.updateLatestLocation();const s=n.latestLocation,i=n.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Wo(s.publicHref)!==Wo(i.publicHref))return n.commitLocation({...i,replace:!0,ignoreBlocker:!0}),r;const a=n.stores.resolvedLocation.get();return(a==null?void 0:a.href)===s.href&&a.state.__TSR_key===s.state.__TSR_key?t.push(n.stores.matches.get(),o=>{o&&n.emit({type:"onRendered",...Tg(a,a)})}):n._tx||n.load({sync:!0}).catch(console.error),r},[n,n.history]),null}function SF(){const e=Vs(),n=e.routesById[Ff],t=Dg(e,n),r=e.ssr?zf:T.Suspense,s=h.jsxs(h.Fragment,{children:[h.jsx(wF,{t:T.useState()[1]}),h.jsx(r,{fallback:t,children:h.jsx(kF,{})})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:s}):s}function kF(){const e=Vs(),n=e._rendered,t=to(e.stores.matches,a=>n[0]??a),r=t[0],s=r==null?void 0:r.routeId;wj(()=>{n[0]===t&&eT(n,!0)},[n,t]);const i=s?h.jsx(Jj,{routeId:s}):null;return h.jsx(Rg.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?i:h.jsx(Fw,{getResetKey:()=>r,onCatch:void 0,children:i})})}var CF=e=>({createMutableStore:C7,createReadonlyStore:C7,batch:ZH}),EF=e=>new NF(e),NF=class extends zH{constructor(e){super(e,CF)}};function zF({router:e,children:n,...t}){kj(t)&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const r=h.jsx(Fj.Provider,{value:e,children:n});return e.options.Wrap?h.jsx(e.options.Wrap,{children:r}):r}function jF({router:e,...n}){return h.jsx(zF,{router:e,...n,children:h.jsx(SF,{})})}function TF(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const t=!!(e.condition??!0),r=e.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function AF(e,n){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:i=!1}=TF(e),a=Vs(),{history:o}=a,[c,u]=T.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return T.useEffect(()=>{const _=async f=>{function p(v){const y=a.parseLocation(v),[,w,C]=a.getMatchedRoutes(y.pathname);return C===void 0?{routeId:"__notFound__",fullPath:y.pathname,pathname:y.pathname,params:w,search:a.options.parseSearch(v.search)}:{routeId:C.id,fullPath:C.fullPath,pathname:y.pathname,params:w,search:a.options.parseSearch(v.search)}}const m=p(f.currentLocation),x=p(f.nextLocation);if(m.routeId==="__notFound__"&&x.routeId!=="__notFound__")return!1;const S=await t({action:f.action,current:m,next:x});if(!i)return S;if(!S)return!1;const b=await new Promise(v=>{u({status:"blocked",current:m,next:x,action:f.action,proceed:()=>v(!1),reset:()=>v(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),b};return s?void 0:o.block({blockerFn:_,enableBeforeUnload:r})},[t,r,s,i,o,a]),c}function tT(e){const n=Vs({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n;return to(t.stores.__store,Uw(e,t))}function RF(e){const n=Vs();return to(n.stores.location,Uw(e,n))}const MF={},LF="en",qw=["en","zh-CN","fa"],nT="orx:locale",Gw=["localStorage","preferredLanguage","baseLocale"],R7=[],a_=typeof window>"u";globalThis.__paraglide=globalThis.__paraglide??{};globalThis.__paraglide.ssr=globalThis.__paraglide.ssr??{};let M7=!1,j=()=>{var t;let e=Gw;!a_&&typeof window<"u"&&((t=window.location)!=null&&t.href)&&(e=iT(window.location.href));const n=DF(e);if(n)return M7||(M7=!0,rT(n,{reload:!1})),n;throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found")};function DF(e,n){let t;for(const r of e){if(r==="baseLocale")t=LF;else if(r==="preferredLanguage"&&!a_)t=PF();else if(r==="localStorage"&&!a_)t=localStorage.getItem(nT)??void 0;else if(aT(r)&&Fm.has(r)){const i=Fm.get(r);if(i){const a=i.getLocale();if(a instanceof Promise)continue;if(a!==void 0)return BF(a)}}const s=o_(t);if(s)return s}}const OF=e=>{window.location.reload()};let rT=(e,n)=>{var o;const t={reload:!0,...n};let r;try{r=j()}catch{}const s=[];let i=Gw;!a_&&typeof window<"u"&&((o=window.location)!=null&&o.href)&&(i=iT(window.location.href));for(const c of i)if(c!=="baseLocale"){if(c==="localStorage"&&typeof window<"u")localStorage.setItem(nT,e);else if(aT(c)&&Fm.has(c)){const u=Fm.get(c);if(u){let _=u.setLocale(e);_ instanceof Promise&&(_=_.catch(f=>{throw new Error(`Custom strategy "${c}" setLocale failed.`,{cause:f})}),s.push(_))}}}const a=()=>{!a_&&t.reload&&window.location&&e!==r&&OF()};if(s.length)return Promise.all(s).then(()=>{a()});a()},IF=()=>typeof window<"u"?window.location.origin:"http://fallback.com";function o_(e){if(typeof e!="string")return;const n=e.toLowerCase();for(const t of qw)if(t.toLowerCase()===n)return t}function sT(e){return!!e&&qw.some(n=>n===e)}function BF(e){const n=o_(e);if(n)return n;throw new Error(`Invalid locale: ${e}. Expected one of: ${qw.join(", ")}`)}function $F(e,n){return e.exec(n.href)}function PF(){var n;if(!((n=navigator==null?void 0:navigator.languages)!=null&&n.length))return;const e=navigator.languages.map(t=>({fullTag:t,baseTag:t.split("-")[0]}));for(const t of e){const r=o_(t.fullTag);if(r)return r;const s=o_(t.baseTag);if(s)return s}}function HF(e){return FF(e)}function FF(e){const n=typeof e=="string"?new URL(e,IF()):new URL(e),t=n.pathname.split("/").filter(Boolean);return t.length>0&&o_(t[0])&&(n.pathname="/"+t.slice(1).join("/")),n}let L7,D7;function UF(e){if(R7.length===0)return;const n=typeof e=="string"?e:e.href;if(L7===n)return D7;const t=new URL(n,"http://example.com"),r=HF(t),s=r.href===t.href?[t]:[t,r];let i;for(const a of s){for(const o of R7){const c=new MF(o.match,a.href);if($F(c,a)){i=o;break}}if(i)break}return L7=n,D7=i,i}function iT(e){const n=UF(e);return n&&n.exclude!==!0&&Array.isArray(n.strategy)?n.strategy:Gw}const Fm=new Map;function aT(e){return typeof e=="string"&&/^custom-[A-Za-z0-9_-]+$/.test(e)}const qF=e=>`Actions for ${e==null?void 0:e.name}`,GF=e=>`${e==null?void 0:e.name} 的操作`,VF=e=>`عملیات ${e==null?void 0:e.name}`,WF=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?GF(e):t==="fa"?VF(e):qF(e)}),KF=e=>`${e==null?void 0:e.path} — press Space to preview; double-click or press Enter to keep open in a tab`,YF=e=>`${e==null?void 0:e.path}——按空格键预览;双击或按 Enter 以在标签页中保持打开`,XF=e=>`${e==null?void 0:e.path} — برای پیش‌نمایش Space و برای باز نگه‌داشتن در زبانه دوبار کلیک کنید یا Enter را بزنید`,ZF=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?YF(e):t==="fa"?XF(e):KF(e)}),QF=e=>`Branch: ${e==null?void 0:e.branch}`,JF=e=>`分支:${e==null?void 0:e.branch}`,eU=e=>`شاخه: ${e==null?void 0:e.branch}`,tU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?JF(e):t==="fa"?eU(e):QF(e)}),nU=e=>`Browse code on ${e==null?void 0:e.branch}`,rU=e=>`浏览分支 ${e==null?void 0:e.branch} 上的代码`,sU=e=>`مرور کد در شاخهٔ ${e==null?void 0:e.branch}`,oT=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?rU(e):t==="fa"?sU(e):nU(e)}),iU=e=>`Harness and model for this chat: ${e==null?void 0:e.label}`,aU=e=>`此聊天的智能体工具和模型:${e==null?void 0:e.label}`,oU=e=>`ابزار عامل و مدل این گفتگو: ${e==null?void 0:e.label}`,lU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?aU(e):t==="fa"?oU(e):iU(e)}),cU=e=>`Collapse ${e==null?void 0:e.name}`,uU=e=>`折叠 ${e==null?void 0:e.name}`,fU=e=>`بستن ${e==null?void 0:e.name}`,dU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?uU(e):t==="fa"?fU(e):cU(e)}),hU=e=>`Committed changes versus ${e==null?void 0:e.parent}`,_U=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改`,pU=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent}`,mU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_U(e):t==="fa"?pU(e):hU(e)}),gU=e=>`Committed changes versus ${e==null?void 0:e.parent} (diff truncated; counts are lower bounds)`,bU=e=>`与 ${e==null?void 0:e.parent} 相比的已提交更改(差异已截断,计数为下限)`,vU=e=>`تغییرات کامیت‌شده نسبت به ${e==null?void 0:e.parent} (تفاوت کوتاه شده و شمارش‌ها حد پایین‌اند)`,xU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?bU(e):t==="fa"?vU(e):gU(e)}),yU=e=>`Copy ${e==null?void 0:e.value}`,wU=e=>`复制 ${e==null?void 0:e.value}`,SU=e=>`کپی ${e==null?void 0:e.value}`,kU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?wU(e):t==="fa"?SU(e):yU(e)}),CU=e=>`Delete ${e==null?void 0:e.name}`,EU=e=>`删除 ${e==null?void 0:e.name}`,NU=e=>`حذف ${e==null?void 0:e.name}`,Iy=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?EU(e):t==="fa"?NU(e):CU(e)}),zU=e=>`Download ${e==null?void 0:e.name}`,jU=e=>`下载 ${e==null?void 0:e.name}`,TU=e=>`بارگیری ${e==null?void 0:e.name}`,O7=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?jU(e):t==="fa"?TU(e):zU(e)}),AU=e=>`Expand ${e==null?void 0:e.name}`,RU=e=>`展开 ${e==null?void 0:e.name}`,MU=e=>`باز کردن ${e==null?void 0:e.name}`,LU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?RU(e):t==="fa"?MU(e):AU(e)}),DU=e=>`Hide additional ${e==null?void 0:e.target}`,OU=e=>`隐藏其余${e==null?void 0:e.target}`,IU=e=>`پنهان کردن موارد بیشترِ ${e==null?void 0:e.target}`,BU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?OU(e):t==="fa"?IU(e):DU(e)}),$U=e=>`Hide error details for ${e==null?void 0:e.activity}`,PU=e=>`隐藏 ${e==null?void 0:e.activity} 的错误详情`,HU=e=>`پنهان کردن جزئیات خطای ${e==null?void 0:e.activity}`,FU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?PU(e):t==="fa"?HU(e):$U(e)}),UU=e=>`${e==null?void 0:e.count} consecutive identical calls`,qU=e=>`连续 ${e==null?void 0:e.count} 次相同调用`,GU=e=>`${e==null?void 0:e.count} فراخوانی یکسان پیاپی`,VU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qU(e):t==="fa"?GU(e):UU(e)}),WU=e=>`${e==null?void 0:e.name} — double-click or press Enter to keep open`,KU=e=>`${e==null?void 0:e.name}——双击或按 Enter 以保持打开`,YU=e=>`${e==null?void 0:e.name} — برای باز نگه‌داشتن دوبار کلیک کنید یا Enter را بزنید`,XU=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?KU(e):t==="fa"?YU(e):WU(e)}),ZU=e=>`Open ${e==null?void 0:e.branch} on GitHub`,QU=e=>`在 GitHub 上打开 ${e==null?void 0:e.branch}`,JU=e=>`باز کردن ${e==null?void 0:e.branch} در GitHub`,lT=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?QU(e):t==="fa"?JU(e):ZU(e)}),eq=e=>`Open experiment ${e==null?void 0:e.name}`,tq=e=>`打开实验 ${e==null?void 0:e.name}`,nq=e=>`باز کردن آزمایش ${e==null?void 0:e.name}`,rq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?tq(e):t==="fa"?nq(e):eq(e)}),sq=e=>`Open ${e==null?void 0:e.path} in the right pane`,iq=e=>`在右侧面板中打开 ${e==null?void 0:e.path}`,aq=e=>`باز کردن ${e==null?void 0:e.path} در پنل سمت راست`,oq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?iq(e):t==="fa"?aq(e):sq(e)}),lq=e=>`Open ${e==null?void 0:e.name}`,cq=e=>`打开 ${e==null?void 0:e.name}`,uq=e=>`باز کردن ${e==null?void 0:e.name}`,fq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cq(e):t==="fa"?uq(e):lq(e)}),dq=e=>`Open logs for run ${e==null?void 0:e.run}`,hq=e=>`打开运行 ${e==null?void 0:e.run} 的日志`,_q=e=>`باز کردن گزارش‌های اجرای ${e==null?void 0:e.run}`,pq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?hq(e):t==="fa"?_q(e):dq(e)}),mq=e=>`Open ${e==null?void 0:e.name} on GitHub`,gq=e=>`在 GitHub 上打开 ${e==null?void 0:e.name}`,bq=e=>`باز کردن ${e==null?void 0:e.name} در GitHub`,Um=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?gq(e):t==="fa"?bq(e):mq(e)}),vq=e=>`Open logs for run ${e==null?void 0:e.id} in the right pane`,xq=e=>`在右侧面板中打开运行 ${e==null?void 0:e.id} 的日志`,yq=e=>`باز کردن گزارش اجرای ${e==null?void 0:e.id} در پنل سمت راست`,wq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?xq(e):t==="fa"?yq(e):vq(e)}),Sq=e=>`Overleaf — ${e==null?void 0:e.status}`,kq=e=>`Overleaf — ${e==null?void 0:e.status}`,Cq=e=>`Overleaf — ${e==null?void 0:e.status}`,Eq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?kq(e):t==="fa"?Cq(e):Sq(e)}),Nq=e=>`Preview /${e==null?void 0:e.name} skill`,zq=e=>`预览 /${e==null?void 0:e.name} 技能`,jq=e=>`پیش‌نمایش مهارت ‎/${e==null?void 0:e.name}`,Tq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?zq(e):t==="fa"?jq(e):Nq(e)}),Aq=e=>`Remove annotation ${e==null?void 0:e.number}`,Rq=e=>`移除批注 ${e==null?void 0:e.number}`,Mq=e=>`حذف یادداشت ${e==null?void 0:e.number}`,Lq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Rq(e):t==="fa"?Mq(e):Aq(e)}),Dq=e=>`Remove ${e==null?void 0:e.name}`,Oq=e=>`移除 ${e==null?void 0:e.name}`,Iq=e=>`حذف ${e==null?void 0:e.name}`,Bq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Oq(e):t==="fa"?Iq(e):Dq(e)}),$q=e=>`Remove queued message: ${e==null?void 0:e.text}`,Pq=e=>`移除排队消息:${e==null?void 0:e.text}`,Hq=e=>`حذف پیام صف: ${e==null?void 0:e.text}`,Fq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Pq(e):t==="fa"?Hq(e):$q(e)}),Uq=e=>`Retry queued message: ${e==null?void 0:e.text}`,qq=e=>`重试排队消息:${e==null?void 0:e.text}`,Gq=e=>`تلاش دوباره برای پیام صف: ${e==null?void 0:e.text}`,Vq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qq(e):t==="fa"?Gq(e):Uq(e)}),Wq=e=>`Run ${e==null?void 0:e.id}`,Kq=e=>`运行 ${e==null?void 0:e.id}`,Yq=e=>`اجرای ${e==null?void 0:e.id}`,Xq=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Kq(e):t==="fa"?Yq(e):Wq(e)}),Zq=e=>`Show error details for ${e==null?void 0:e.activity}`,Qq=e=>`显示 ${e==null?void 0:e.activity} 的错误详情`,Jq=e=>`نمایش جزئیات خطای ${e==null?void 0:e.activity}`,eG=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Qq(e):t==="fa"?Jq(e):Zq(e)}),tG=e=>`Show ${e==null?void 0:e.count} more ${e==null?void 0:e.target}`,nG=e=>`再显示 ${e==null?void 0:e.count} 个${e==null?void 0:e.target}`,rG=e=>`نمایش ${e==null?void 0:e.count} مورد دیگر از ${e==null?void 0:e.target}`,sG=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?nG(e):t==="fa"?rG(e):tG(e)}),iG=e=>`${e==null?void 0:e.name} skill`,aG=e=>`${e==null?void 0:e.name} 技能`,oG=e=>`مهارت ${e==null?void 0:e.name}`,lG=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?aG(e):t==="fa"?oG(e):iG(e)}),cG=e=>`Value for ${e==null?void 0:e.name}`,uG=e=>`${e==null?void 0:e.name} 的值`,fG=e=>`مقدار ${e==null?void 0:e.name}`,dG=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?uG(e):t==="fa"?fG(e):cG(e)}),hG=()=>"Agent reported back",_G=()=>"智能体已返回结果",pG=()=>"عامل نتیجه را گزارش کرد",mG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_G():t==="fa"?pG():hG()}),gG=()=>"Browse",bG=()=>"浏览",vG=()=>"مرور",xG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bG():t==="fa"?vG():gG()}),yG=()=>"Browsing…",wG=()=>"正在浏览…",SG=()=>"در حال مرور…",kG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wG():t==="fa"?SG():yG()}),CG=()=>"Checked experiment status and updated notes",EG=()=>"已检查实验状态并更新笔记",NG=()=>"وضعیت آزمایش بررسی و یادداشت‌ها به‌روز شد",zG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EG():t==="fa"?NG():CG()}),jG=()=>"Closed an agent",TG=()=>"已关闭智能体",AG=()=>"عامل بسته شد",RG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TG():t==="fa"?AG():jG()}),MG=()=>"Compacted context",LG=()=>"上下文已压缩",DG=()=>"زمینه فشرده شد",OG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LG():t==="fa"?DG():MG()}),IG=()=>"Compacting context…",BG=()=>"正在压缩上下文…",$G=()=>"در حال فشرده‌سازی زمینه…",PG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BG():t==="fa"?$G():IG()}),HG=e=>`Created ${e==null?void 0:e.target}`,FG=e=>`已创建 ${e==null?void 0:e.target}`,UG=e=>`${e==null?void 0:e.target} ایجاد شد`,qG=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?FG(e):t==="fa"?UG(e):HG(e)}),GG=()=>"Delegate",VG=()=>"委派",WG=()=>"واگذاری",KG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VG():t==="fa"?WG():GG()}),YG=()=>"Delegating…",XG=()=>"正在委派…",ZG=()=>"در حال واگذاری…",QG=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XG():t==="fa"?ZG():YG()}),JG=e=>`Deleted ${e==null?void 0:e.target}`,eV=e=>`已删除 ${e==null?void 0:e.target}`,tV=e=>`${e==null?void 0:e.target} حذف شد`,nV=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?eV(e):t==="fa"?tV(e):JG(e)}),rV=()=>"Edit",sV=()=>"编辑",iV=()=>"ویرایش",aV=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sV():t==="fa"?iV():rV()}),oV=e=>`Edited ${e==null?void 0:e.target}`,lV=e=>`已编辑 ${e==null?void 0:e.target}`,cV=e=>`${e==null?void 0:e.target} ویرایش شد`,uV=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?lV(e):t==="fa"?cV(e):oV(e)}),fV=()=>"Editing…",dV=()=>"正在编辑…",hV=()=>"در حال ویرایش…",_V=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dV():t==="fa"?hV():fV()}),pV=e=>`${e==null?void 0:e.activity} for “${e==null?void 0:e.query}”`,mV=e=>`${e==null?void 0:e.activity}:“${e==null?void 0:e.query}”`,gV=e=>`${e==null?void 0:e.activity}: «${e==null?void 0:e.query}»`,bV=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mV(e):t==="fa"?gV(e):pV(e)}),vV=e=>`Listed files matching ${e==null?void 0:e.pattern}`,xV=e=>`已列出与 ${e==null?void 0:e.pattern} 匹配的文件`,yV=e=>`فایل‌های مطابق ${e==null?void 0:e.pattern} فهرست شد`,wV=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?xV(e):t==="fa"?yV(e):vV(e)}),SV=()=>"Load",kV=()=>"加载",CV=()=>"بارگیری",EV=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kV():t==="fa"?CV():SV()}),NV=()=>"Loaded a skill",zV=()=>"已加载技能",jV=()=>"یک مهارت بارگیری شد",TV=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zV():t==="fa"?jV():NV()}),AV=e=>`Loaded ${e==null?void 0:e.name} skill`,RV=e=>`已加载技能 ${e==null?void 0:e.name}`,MV=e=>`مهارت ${e==null?void 0:e.name} بارگیری شد`,LV=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?RV(e):t==="fa"?MV(e):AV(e)}),DV=()=>"Loading…",OV=()=>"正在加载…",IV=()=>"در حال بارگیری…",BV=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OV():t==="fa"?IV():DV()}),$V=e=>`Opened ${e==null?void 0:e.target}`,PV=e=>`已打开 ${e==null?void 0:e.target}`,HV=e=>`${e==null?void 0:e.target} باز شد`,FV=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?PV(e):t==="fa"?HV(e):$V(e)}),UV=e=>`Ran ${e==null?void 0:e.command}`,qV=e=>`已运行 ${e==null?void 0:e.command}`,GV=e=>`${e==null?void 0:e.command} اجرا شد`,VV=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qV(e):t==="fa"?GV(e):UV(e)}),WV=()=>"Ran a sub-agent",KV=()=>"已运行子智能体",YV=()=>"یک عامل فرعی اجرا شد",XV=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KV():t==="fa"?YV():WV()}),ZV=()=>"Read",QV=()=>"读取",JV=()=>"خواندن",eW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QV():t==="fa"?JV():ZV()}),tW=()=>"Read experiment notes",nW=()=>"已读取实验笔记",rW=()=>"یادداشت‌های آزمایش خوانده شد",sW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nW():t==="fa"?rW():tW()}),iW=()=>"Read a paper",aW=()=>"已读取论文",oW=()=>"یک مقاله خوانده شد",lW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aW():t==="fa"?oW():iW()}),cW=e=>`Read ${e==null?void 0:e.name} skill`,uW=e=>`已读取技能 ${e==null?void 0:e.name}`,fW=e=>`مهارت ${e==null?void 0:e.name} خوانده شد`,Zv=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?uW(e):t==="fa"?fW(e):cW(e)}),dW=e=>`Read ${e==null?void 0:e.target}`,hW=e=>`已读取 ${e==null?void 0:e.target}`,_W=e=>`${e==null?void 0:e.target} خوانده شد`,kh=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?hW(e):t==="fa"?_W(e):dW(e)}),pW=()=>"Read a web page",mW=()=>"已读取网页",gW=()=>"یک صفحهٔ وب خوانده شد",bW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mW():t==="fa"?gW():pW()}),vW=()=>"Reading…",xW=()=>"正在读取…",yW=()=>"در حال خواندن…",wW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xW():t==="fa"?yW():vW()}),SW=()=>"Resumed an agent",kW=()=>"已恢复智能体",CW=()=>"عامل از سر گرفته شد",EW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kW():t==="fa"?CW():SW()}),NW=()=>"Review",zW=()=>"查看",jW=()=>"بازبینی",TW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zW():t==="fa"?jW():NW()}),AW=()=>"Reviewed run log",RW=()=>"已查看运行日志",MW=()=>"گزارش اجرا بازبینی شد",LW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RW():t==="fa"?MW():AW()}),DW=()=>"Reviewed run logs",OW=()=>"已查看运行日志",IW=()=>"گزارش‌های اجرا بازبینی شد",BW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OW():t==="fa"?IW():DW()}),$W=()=>"Reviewed experiment status and notes",PW=()=>"已查看实验状态和笔记",HW=()=>"وضعیت و یادداشت‌های آزمایش بازبینی شد",FW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PW():t==="fa"?HW():$W()}),UW=()=>"Reviewing…",qW=()=>"正在查看…",GW=()=>"در حال بازبینی…",VW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qW():t==="fa"?GW():UW()}),WW=()=>"Run",KW=()=>"运行",YW=()=>"اجرا",XW=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KW():t==="fa"?YW():WW()}),ZW=()=>"Running…",QW=()=>"正在运行…",JW=()=>"در حال اجرا…",cT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QW():t==="fa"?JW():ZW()}),eK=()=>"Search",tK=()=>"搜索",nK=()=>"جست‌وجو",rK=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tK():t==="fa"?nK():eK()}),sK=()=>"Searched alphaXiv full text",iK=()=>"已搜索 alphaXiv 全文",aK=()=>"متن کامل alphaXiv جست‌وجو شد",oK=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iK():t==="fa"?aK():sK()}),lK=()=>"Searched alphaXiv semantically",cK=()=>"已对 alphaXiv 进行语义搜索",uK=()=>"جست‌وجوی معنایی در alphaXiv انجام شد",fK=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cK():t==="fa"?uK():lK()}),dK=()=>"Searched bioRxiv",hK=()=>"已搜索 bioRxiv",_K=()=>"bioRxiv جست‌وجو شد",pK=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hK():t==="fa"?_K():dK()}),mK=()=>"Searched code",gK=()=>"已搜索代码",bK=()=>"کد جست‌وجو شد",Qv=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gK():t==="fa"?bK():mK()}),vK=e=>`Searched code for “${e==null?void 0:e.pattern}”`,xK=e=>`已在代码中搜索“${e==null?void 0:e.pattern}”`,yK=e=>`کد برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,Jv=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?xK(e):t==="fa"?yK(e):vK(e)}),wK=e=>`Searched images for “${e==null?void 0:e.query}”`,SK=e=>`已搜索图片“${e==null?void 0:e.query}”`,kK=e=>`تصاویر برای «${e==null?void 0:e.query}» جست‌وجو شد`,CK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?SK(e):t==="fa"?kK(e):wK(e)}),EK=()=>"Searched the literature",NK=()=>"已搜索文献",zK=()=>"منابع علمی جست‌وجو شد",I7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NK():t==="fa"?zK():EK()}),jK=e=>`Searched “${e==null?void 0:e.pattern}” on a page`,TK=e=>`已在页面中搜索“${e==null?void 0:e.pattern}”`,AK=e=>`صفحه برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,RK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?TK(e):t==="fa"?AK(e):jK(e)}),MK=()=>"Searched OpenAlex",LK=()=>"已搜索 OpenAlex",DK=()=>"OpenAlex جست‌وجو شد",OK=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LK():t==="fa"?DK():MK()}),IK=e=>`Searched the web for “${e==null?void 0:e.query}”`,BK=e=>`已在网页中搜索“${e==null?void 0:e.query}”`,$K=e=>`وب برای «${e==null?void 0:e.query}» جست‌وجو شد`,B7=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?BK(e):t==="fa"?$K(e):IK(e)}),PK=e=>`Searched a web page for “${e==null?void 0:e.pattern}”`,HK=e=>`已在网页中搜索“${e==null?void 0:e.pattern}”`,FK=e=>`صفحهٔ وب برای «${e==null?void 0:e.pattern}» جست‌وجو شد`,UK=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?HK(e):t==="fa"?FK(e):PK(e)}),qK=()=>"Searching…",GK=()=>"正在搜索…",VK=()=>"در حال جست‌وجو…",WK=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GK():t==="fa"?VK():qK()}),KK=()=>"Sent input to an agent",YK=()=>"已向智能体发送输入",XK=()=>"ورودی به عامل فرستاده شد",ZK=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YK():t==="fa"?XK():KK()}),QK=()=>"Spawned an agent",JK=()=>"已创建智能体",eY=()=>"یک عامل ساخته شد",tY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JK():t==="fa"?eY():QK()}),nY=()=>"Sub-agent",rY=()=>"子智能体",sY=()=>"عامل فرعی",iY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rY():t==="fa"?sY():nY()}),aY=()=>"Sub-agent interrupted",oY=()=>"子智能体已中断",lY=()=>"عامل فرعی متوقف شد",cY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oY():t==="fa"?lY():aY()}),uY=()=>"Sub-agent started",fY=()=>"子智能体已启动",dY=()=>"عامل فرعی آغاز شد",hY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fY():t==="fa"?dY():uY()}),_Y=()=>"Updated experiment notes",pY=()=>"已更新实验笔记",mY=()=>"یادداشت‌های آزمایش به‌روز شد",gY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pY():t==="fa"?mY():_Y()}),bY=()=>"Waiting on an agent",vY=()=>"正在等待智能体",xY=()=>"در انتظار عامل",yY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vY():t==="fa"?xY():bY()}),wY=e=>`Approval required: ${e==null?void 0:e.label}`,SY=e=>`需要批准:${e==null?void 0:e.label}`,kY=e=>`نیازمند تأیید: ${e==null?void 0:e.label}`,$7=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?SY(e):t==="fa"?kY(e):wY(e)}),CY=()=>"The CLI is retrying the turn.",EY=()=>"CLI 正在重试本轮。",NY=()=>"CLI در حال تلاش دوباره برای این نوبت است.",zY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EY():t==="fa"?NY():CY()}),jY=()=>"Continue is available.",TY=()=>"可以继续。",AY=()=>"ادامه در دسترس است.",RY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TY():t==="fa"?AY():jY()}),MY=()=>"Retry is available.",LY=()=>"可以重试。",DY=()=>"تلاش دوباره در دسترس است.",OY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LY():t==="fa"?DY():MY()}),IY=()=>"Running a tool",BY=()=>"正在运行工具",$Y=()=>"در حال اجرای ابزار",PY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BY():t==="fa"?$Y():IY()}),HY=()=>"Tool activity completed",FY=()=>"工具活动已完成",UY=()=>"فعالیت ابزار کامل شد",qY=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FY():t==="fa"?UY():HY()}),GY=e=>`Tool activity failed: ${e==null?void 0:e.labels}`,VY=e=>`工具活动失败:${e==null?void 0:e.labels}`,WY=e=>`فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,KY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?VY(e):t==="fa"?WY(e):GY(e)}),YY=e=>`${e==null?void 0:e.count} tool activities failed: ${e==null?void 0:e.labels}`,XY=e=>`${e==null?void 0:e.count} 个工具活动失败:${e==null?void 0:e.labels}`,ZY=e=>`${e==null?void 0:e.count} فعالیت ابزار ناموفق بود: ${e==null?void 0:e.labels}`,QY=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?XY(e):t==="fa"?ZY(e):YY(e)}),JY=()=>"Turn did not finish.",eX=()=>"本轮未完成。",tX=()=>"این نوبت کامل نشد.",nX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eX():t==="fa"?tX():JY()}),rX=()=>"Artifacts",sX=()=>"产物",iX=()=>"خروجی‌ها",aX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sX():t==="fa"?iX():rX()}),oX=()=>"Close panel",lX=()=>"关闭面板",cX=()=>"بستن پنل",qm=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lX():t==="fa"?cX():oX()}),uX=()=>"Current task",fX=()=>"当前任务",dX=()=>"وظیفهٔ فعلی",P7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fX():t==="fa"?dX():uX()}),hX=()=>"Drag to resize panel",_X=()=>"拖动以调整面板大小",pX=()=>"برای تغییر اندازهٔ پنل بکشید",mX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_X():t==="fa"?pX():hX()}),gX=()=>"Drag toward the center to restore panel",bX=()=>"向中央拖动以恢复面板",vX=()=>"برای بازگرداندن پنل به‌سوی مرکز بکشید",xX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bX():t==="fa"?vX():gX()}),yX=()=>"Entire project",wX=()=>"整个项目",SX=()=>"کل پروژه",H7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wX():t==="fa"?SX():yX()}),kX=()=>"Expand panel",CX=()=>"展开面板",EX=()=>"گسترش پنل",F7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CX():t==="fa"?EX():kX()}),NX=e=>`Experiment filter: ${e==null?void 0:e.scope}`,zX=e=>`实验筛选:${e==null?void 0:e.scope}`,jX=e=>`فیلتر آزمایش: ${e==null?void 0:e.scope}`,TX=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?zX(e):t==="fa"?jX(e):NX(e)}),AX=()=>"Experiment view",RX=()=>"实验视图",MX=()=>"نمای آزمایش",LX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RX():t==="fa"?MX():AX()}),DX=()=>"Experiments",OX=()=>"实验",IX=()=>"آزمایش‌ها",BX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OX():t==="fa"?IX():DX()}),$X=()=>"Files",PX=()=>"文件",HX=()=>"فایل‌ها",FX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PX():t==="fa"?HX():$X()}),UX=()=>"Filter experiments",qX=()=>"筛选实验",GX=()=>"فیلتر آزمایش‌ها",VX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qX():t==="fa"?GX():UX()}),WX=()=>"Current task filtering is unavailable for unattributed experiments",KX=()=>"存在无法归属的实验时,不能按当前任务筛选",YX=()=>"برای آزمایش‌های بدون وظیفه، فیلتر وظیفهٔ کنونی در دسترس نیست",XX=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KX():t==="fa"?YX():WX()}),ZX=()=>"No experiments from the current task yet. Switch to Entire project to see all experiments.",QX=()=>"当前任务还没有实验。切换到“整个项目”即可查看所有实验。",JX=()=>"وظیفهٔ کنونی هنوز آزمایشی ندارد. برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",eZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QX():t==="fa"?JX():ZX()}),tZ=()=>"Open a task to filter to its experiments",nZ=()=>"请打开一个任务以筛选其实验",rZ=()=>"برای محدود کردن آزمایش‌ها، یک وظیفه را باز کنید",sZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nZ():t==="fa"?rZ():tZ()}),iZ=()=>"projects",aZ=()=>"项目",oZ=()=>"پروژه‌ها",Gh=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aZ():t==="fa"?oZ():iZ()}),lZ=()=>"Restore panel",cZ=()=>"还原面板",uZ=()=>"بازگرداندن اندازهٔ پنل",U7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cZ():t==="fa"?uZ():lZ()}),fZ=()=>"Retry",dZ=()=>"重试",hZ=()=>"تلاش دوباره",Ji=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dZ():t==="fa"?hZ():fZ()}),_Z=()=>"Select a project to browse its files.",pZ=()=>"选择一个项目以浏览其文件。",mZ=()=>"برای مرور فایل‌ها، یک پروژه را انتخاب کنید.",gZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pZ():t==="fa"?mZ():_Z()}),bZ=()=>"settings",vZ=()=>"设置",xZ=()=>"تنظیمات",yZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vZ():t==="fa"?xZ():bZ()}),wZ=e=>`Couldn’t load OpenResearch ${e==null?void 0:e.items}.`,SZ=e=>`无法加载 OpenResearch 的${e==null?void 0:e.items}。`,kZ=e=>`بارگذاری ${e==null?void 0:e.items} در OpenResearch ناموفق بود.`,CZ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?SZ(e):t==="fa"?kZ(e):wZ(e)}),EZ=()=>"Sub-agent",NZ=()=>"子智能体",zZ=()=>"عامل فرعی",jZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NZ():t==="fa"?zZ():EZ()}),TZ=()=>"Table",AZ=()=>"表格",RZ=()=>"جدول",MZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AZ():t==="fa"?RZ():TZ()}),LZ=()=>"Tree",DZ=()=>"树状图",OZ=()=>"درخت",IZ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DZ():t==="fa"?OZ():LZ()}),BZ=e=>`Collapse ${e==null?void 0:e.name}`,$Z=e=>`折叠 ${e==null?void 0:e.name}`,PZ=e=>`بستن پوشهٔ ${e==null?void 0:e.name}`,HZ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$Z(e):t==="fa"?PZ(e):BZ(e)}),FZ=e=>`Delete “${e==null?void 0:e.path}” from the artifacts directory?`,UZ=e=>`从产物目录中删除“${e==null?void 0:e.path}”?`,qZ=e=>`«${e==null?void 0:e.path}» از پوشهٔ خروجی‌ها حذف شود؟`,Vw=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?UZ(e):t==="fa"?qZ(e):FZ(e)}),GZ=e=>`Delete folder ${e==null?void 0:e.name}`,VZ=e=>`删除文件夹 ${e==null?void 0:e.name}`,WZ=e=>`حذف پوشهٔ ${e==null?void 0:e.name}`,KZ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?VZ(e):t==="fa"?WZ(e):GZ(e)}),YZ=e=>`Expand ${e==null?void 0:e.name}`,XZ=e=>`展开 ${e==null?void 0:e.name}`,ZZ=e=>`باز کردن پوشهٔ ${e==null?void 0:e.name}`,QZ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?XZ(e):t==="fa"?ZZ(e):YZ(e)}),JZ=()=>"Binary or unsupported file — no inline preview.",eQ=()=>"二进制文件或不受支持的文件 — 无法内嵌预览。",tQ=()=>"فایل دودویی یا پشتیبانی‌نشده است — پیش‌نمایش درون‌صفحه‌ای ندارد.",nQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eQ():t==="fa"?tQ():JZ()}),rQ=()=>"Copy path",sQ=()=>"复制路径",iQ=()=>"کپی مسیر",uT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sQ():t==="fa"?iQ():rQ()}),aQ=()=>"Artifact not found",oQ=()=>"找不到产物",lQ=()=>"خروجی پیدا نشد",cQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oQ():t==="fa"?lQ():aQ()}),uQ=()=>"Open raw",fQ=()=>"打开原始文件",dQ=()=>"باز کردن فایل خام",hQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fQ():t==="fa"?dQ():uQ()}),_Q=()=>"Click an artifact to view it",pQ=()=>"点击产物即可查看",mQ=()=>"برای مشاهده، یک خروجی را انتخاب کنید",gQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pQ():t==="fa"?mQ():_Q()}),bQ=()=>"Copy artifacts directory path",vQ=()=>"复制产物目录路径",xQ=()=>"کپی مسیر پوشهٔ خروجی‌ها",yQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vQ():t==="fa"?xQ():bQ()}),wQ=()=>"Delete artifact",SQ=()=>"删除产物",kQ=()=>"حذف خروجی",q7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SQ():t==="fa"?kQ():wQ()}),CQ=()=>"Delete folder",EQ=()=>"删除文件夹",NQ=()=>"حذف پوشه",zQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EQ():t==="fa"?NQ():CQ()}),jQ=()=>"Failed to load:",TQ=()=>"加载失败:",AQ=()=>"بارگیری ناموفق بود:",RQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TQ():t==="fa"?AQ():jQ()}),MQ=()=>"File truncated — showing the first 512 KB.",LQ=()=>"文件已截断——仅显示前 512 KB。",DQ=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",OQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LQ():t==="fa"?DQ():MQ()}),IQ=()=>"Listing truncated — the folder has more artifacts.",BQ=()=>"列表已截断——文件夹中还有更多产物。",$Q=()=>"فهرست کوتاه شده است — خروجی‌های بیشتری در پوشه وجود دارد.",PQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BQ():t==="fa"?$Q():IQ()}),HQ=()=>"Loading…",FQ=()=>"正在加载…",UQ=()=>"در حال بارگیری…",fT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FQ():t==="fa"?UQ():HQ()}),qQ=()=>"Loading artifacts…",GQ=()=>"正在加载产物…",VQ=()=>"در حال بارگیری خروجی‌ها…",WQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GQ():t==="fa"?VQ():qQ()}),KQ=()=>"Modified",YQ=()=>"修改时间",XQ=()=>"ویرایش‌شده",ZQ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YQ():t==="fa"?XQ():KQ()}),QQ=()=>"No artifacts yet",JQ=()=>"尚无产物",eJ=()=>"هنوز خروجی‌ای وجود ندارد",tJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JQ():t==="fa"?eJ():QQ()}),nJ=()=>"Open raw in new tab",rJ=()=>"在新标签页中打开原始文件",sJ=()=>"باز کردن فایل خام در زبانهٔ جدید",G7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rJ():t==="fa"?sJ():nJ()}),iJ=()=>"Storage settings",aJ=()=>"存储设置",oJ=()=>"تنظیمات ذخیره‌سازی",V7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aJ():t==="fa"?oJ():iJ()}),lJ=()=>"This is the project's durable output space for reports, figures, images, CSVs, PDFs, and other research artifacts. Ask the agent for a write-up or add your own files:",cJ=()=>"这里是项目的持久输出空间,用于保存报告、图表、图片、CSV、PDF 和其他研究产物。你可以让智能体撰写报告,也可以自行添加文件:",uJ=()=>"این فضای پایدار خروجی پروژه برای گزارش‌ها، نمودارها، تصاویر، فایل‌های CSV و PDF و دیگر خروجی‌های پژوهشی است. از عامل بخواهید گزارشی بنویسد یا فایل‌های خودتان را اضافه کنید:",fJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cJ():t==="fa"?uJ():lJ()}),dJ=()=>"File too large to preview inline.",hJ=()=>"文件太大,无法内嵌预览。",_J=()=>"فایل برای پیش‌نمایش درون‌صفحه‌ای بیش از حد بزرگ است.",pJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hJ():t==="fa"?_J():dJ()}),mJ=()=>"This is the baseline branch, so there is no parent comparison.",gJ=()=>"这是基线分支,因此没有父分支可供比较。",bJ=()=>"این شاخهٔ مبناست، بنابراین شاخهٔ والدی برای مقایسه ندارد.",vJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gJ():t==="fa"?bJ():mJ()}),xJ=()=>"Failed to load changes:",yJ=()=>"加载更改失败:",wJ=()=>"بارگیری تغییرات ناموفق بود:",SJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yJ():t==="fa"?wJ():xJ()}),kJ=()=>"Loading changes…",CJ=()=>"正在加载更改…",EJ=()=>"در حال بارگیری تغییرات…",NJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CJ():t==="fa"?EJ():kJ()}),zJ=()=>"No committed changes from the parent branch.",jJ=()=>"与父分支相比没有已提交的更改。",TJ=()=>"نسبت به شاخهٔ والد تغییر ثبت‌شده‌ای وجود ندارد.",AJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jJ():t==="fa"?TJ():zJ()}),RJ=e=>`agent ${e==null?void 0:e.number}`,MJ=e=>`智能体 ${e==null?void 0:e.number}`,LJ=e=>`عامل ${e==null?void 0:e.number}`,W7=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?MJ(e):t==="fa"?LJ(e):RJ(e)}),DJ=()=>"agent sessions",OJ=()=>"智能体会话",IJ=()=>"نشست‌های عامل‌ها",BJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OJ():t==="fa"?IJ():DJ()}),$J=()=>"All sessions",PJ=()=>"所有会话",HJ=()=>"همهٔ نشست‌ها",dT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PJ():t==="fa"?HJ():$J()}),FJ=e=>`${e==null?void 0:e.count} annotations`,UJ=e=>`${e==null?void 0:e.count} 条批注`,qJ=e=>`${e==null?void 0:e.count} یادداشت`,GJ=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?UJ(e):t==="fa"?qJ(e):FJ(e)}),VJ=()=>"Archive",WJ=()=>"归档",KJ=()=>"بایگانی",YJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WJ():t==="fa"?KJ():VJ()}),XJ=()=>"Ask the research agent… (/ for commands and skills, ! for shell)",ZJ=()=>"询问研究智能体…(输入 / 使用命令和技能,输入 ! 运行 shell)",QJ=()=>"از عامل پژوهش بپرسید… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)",JJ=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZJ():t==="fa"?QJ():XJ()}),eee=()=>"Asked about selected text",tee=()=>"已询问所选文本",nee=()=>"دربارهٔ متن انتخاب‌شده پرسیده شد",ree=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tee():t==="fa"?nee():eee()}),see=()=>"Attachment",iee=()=>"附件",aee=()=>"پیوست",oee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iee():t==="fa"?aee():see()}),lee=e=>`${e==null?void 0:e.name} is too large — each attachment must be under 30 MB.`,cee=e=>`${e==null?void 0:e.name} 太大 — 每个附件必须小于 30 MB。`,uee=e=>`${e==null?void 0:e.name} بیش از حد بزرگ است — هر پیوست باید کمتر از ۳۰ مگابایت باشد.`,fee=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cee(e):t==="fa"?uee(e):lee(e)}),dee=()=>"Attachments exceed the 40 MB total limit — remove one and try again.",hee=()=>"附件总大小超过 40 MB 限制 — 请移除一个附件后重试。",_ee=()=>"حجم پیوست‌ها از سقف ۴۰ مگابایت بیشتر است — یکی را حذف و دوباره تلاش کنید.",pee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hee():t==="fa"?_ee():dee()}),mee=()=>"Wait for the turn to finish before running a command.",gee=()=>"请等待本轮结束后再运行命令。",bee=()=>"پیش از اجرای فرمان، صبر کنید تا نوبت تمام شود.",vee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gee():t==="fa"?bee():mee()}),xee=e=>`Exited with code ${e==null?void 0:e.code}`,yee=e=>`退出码 ${e==null?void 0:e.code}`,wee=e=>`با کد ${e==null?void 0:e.code} خارج شد`,See=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?yee(e):t==="fa"?wee(e):xee(e)}),kee=e=>`Command not run: ${e==null?void 0:e.error}`,Cee=e=>`命令未运行:${e==null?void 0:e.error}`,Eee=e=>`فرمان اجرا نشد: ${e==null?void 0:e.error}`,K7=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Cee(e):t==="fa"?Eee(e):kee(e)}),Nee=()=>"Collapse tool activity",zee=()=>"折叠工具活动",jee=()=>"بستن فعالیت ابزارها",Tee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zee():t==="fa"?jee():Nee()}),Aee=()=>"Continue",Ree=()=>"继续",Mee=()=>"ادامه",Lee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ree():t==="fa"?Mee():Aee()}),Dee=e=>`Delete “${e==null?void 0:e.title}”? + +Its transcript will be permanently removed.`,Oee=e=>`删除“${e==null?void 0:e.title}”? + +其对话记录将被永久移除。`,Iee=e=>`«${e==null?void 0:e.title}» حذف شود؟ + +رونوشت آن برای همیشه حذف خواهد شد.`,Bee=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Oee(e):t==="fa"?Iee(e):Dee(e)}),$ee=e=>`Failed to delete “${e==null?void 0:e.title}”: ${e==null?void 0:e.error}`,Pee=e=>`删除“${e==null?void 0:e.title}”失败:${e==null?void 0:e.error}`,Hee=e=>`حذف «${e==null?void 0:e.title}» ناموفق بود: ${e==null?void 0:e.error}`,Fee=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Pee(e):t==="fa"?Hee(e):$ee(e)}),Uee=()=>"Could not exit Plan mode. Try again.",qee=()=>"无法退出计划模式。请重试。",Gee=()=>"خروج از حالت طرح ممکن نشد. دوباره تلاش کنید.",Vee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qee():t==="fa"?Gee():Uee()}),Wee=()=>"Expand tool activity",Kee=()=>"展开工具活动",Yee=()=>"باز کردن فعالیت ابزارها",Xee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kee():t==="fa"?Yee():Wee()}),Zee=()=>"experiments",Qee=()=>"实验",Jee=()=>"آزمایش‌ها",ete=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qee():t==="fa"?Jee():Zee()}),tte=e=>`${e==null?void 0:e.harness} is unavailable — open the model picker`,nte=e=>`${e==null?void 0:e.harness} 不可用 — 请打开模型选择器`,rte=e=>`در حال حاضر ${e==null?void 0:e.harness} در دسترس نیست — انتخاب‌گر مدل را باز کنید`,ste=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?nte(e):t==="fa"?rte(e):tte(e)}),ite=e=>`Message ${e==null?void 0:e.harness}… (/ for commands and skills, ! for shell)`,ate=e=>`给 ${e==null?void 0:e.harness} 发消息…(输入 / 使用命令和技能,输入 ! 运行 shell)`,ote=e=>`پیام به ${e==null?void 0:e.harness}… (/ برای فرمان‌ها و مهارت‌ها، ! برای شل)`,lte=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ate(e):t==="fa"?ote(e):ite(e)}),cte=e=>`Message not sent: ${e==null?void 0:e.error}`,ute=e=>`消息未发送:${e==null?void 0:e.error}`,fte=e=>`پیام ارسال نشد: ${e==null?void 0:e.error}`,dte=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ute(e):t==="fa"?fte(e):cte(e)}),hte=()=>"New session",_te=()=>"新会话",pte=()=>"نشست جدید",Y7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_te():t==="fa"?pte():hte()}),mte=()=>"No active sessions",gte=()=>"没有活跃会话",bte=()=>"نشست فعالی وجود ندارد",vte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gte():t==="fa"?bte():mte()}),xte=()=>"No activity",yte=()=>"无活动",wte=()=>"بدون فعالیت",Ste=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yte():t==="fa"?wte():xte()}),kte=()=>"No archived sessions",Cte=()=>"没有已归档的会话",Ete=()=>"نشست بایگانی‌شده‌ای وجود ندارد",Nte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cte():t==="fa"?Ete():kte()}),zte=()=>"No sessions yet",jte=()=>"还没有会话",Tte=()=>"هنوز نشستی وجود ندارد",Ate=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jte():t==="fa"?Tte():zte()}),Rte=()=>"1 annotation",Mte=()=>"1 条批注",Lte=()=>"۱ یادداشت",Dte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mte():t==="fa"?Lte():Rte()}),Ote=()=>"Open sub-agent transcript",Ite=()=>"打开子智能体记录",Bte=()=>"باز کردن متن گفت‌وگوی عامل فرعی",$te=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ite():t==="fa"?Bte():Ote()}),Pte=()=>"About this demo",Hte=()=>"关于此演示",Fte=()=>"دربارهٔ این نسخهٔ نمایشی",X7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hte():t==="fa"?Fte():Pte()}),Ute=()=>"Accept and auto mode",qte=()=>"接受并使用自动模式",Gte=()=>"پذیرش و حالت خودکار",Vte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qte():t==="fa"?Gte():Ute()}),Wte=()=>"Accept and bypass all",Kte=()=>"接受并跳过所有审批",Yte=()=>"پذیرش و عبور از همهٔ تأییدها",Xte=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kte():t==="fa"?Yte():Wte()}),Zte=()=>"Active",Qte=()=>"活跃",Jte=()=>"فعال",ene=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qte():t==="fa"?Jte():Zte()}),tne=()=>"All",nne=()=>"全部",rne=()=>"همه",sne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nne():t==="fa"?rne():tne()}),ine=()=>"Allow",ane=()=>"允许",one=()=>"اجازه دادن",lne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ane():t==="fa"?one():ine()}),cne=()=>"Approval required",une=()=>"需要批准",fne=()=>"نیازمند تأیید",dne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?une():t==="fa"?fne():cne()}),hne=()=>"Archived",_ne=()=>"已归档",pne=()=>"بایگانی‌شده",Z7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ne():t==="fa"?pne():hne()}),mne=()=>"Artifacts",gne=()=>"产物",bne=()=>"خروجی‌ها",vne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gne():t==="fa"?bne():mne()}),xne=()=>"Ask about this",yne=()=>"询问此内容",wne=()=>"دربارهٔ این بپرسید",Sne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yne():t==="fa"?wne():xne()}),kne=()=>"Attach a PDF or image",Cne=()=>"附加 PDF 或图片",Ene=()=>"پیوست PDF یا تصویر",Q7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cne():t==="fa"?Ene():kne()}),Nne=()=>"Bash",zne=()=>"Bash",jne=()=>"Bash",hT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zne():t==="fa"?jne():Nne()}),Tne=()=>"Browsed the web",Ane=()=>"已浏览网页",Rne=()=>"وب مرور شد",J7=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ane():t==="fa"?Rne():Tne()}),Mne=()=>"Built the project",Lne=()=>"已构建项目",Dne=()=>"پروژه ساخته شد",One=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lne():t==="fa"?Dne():Mne()}),Ine=()=>"Cancel",Bne=()=>"取消",$ne=()=>"لغو",Pne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bne():t==="fa"?$ne():Ine()}),Hne=()=>"Cancelled an experiment run",Fne=()=>"已取消实验运行",Une=()=>"اجرای آزمایش لغو شد",qne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fne():t==="fa"?Une():Hne()}),Gne=()=>"Checked code style",Vne=()=>"已检查代码风格",Wne=()=>"سبک کد بررسی شد",Kne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vne():t==="fa"?Wne():Gne()}),Yne=()=>"Checked compute options",Xne=()=>"已检查算力选项",Zne=()=>"گزینه‌های رایانشی بررسی شد",Qne=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xne():t==="fa"?Zne():Yne()}),Jne=()=>"Checked experiment status",ere=()=>"已检查实验状态",tre=()=>"وضعیت آزمایش بررسی شد",e8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ere():t==="fa"?tre():Jne()}),nre=()=>"Checked Git status",rre=()=>"已检查 Git 状态",sre=()=>"وضعیت Git بررسی شد",ire=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rre():t==="fa"?sre():nre()}),are=()=>"Checked local times",ore=()=>"已查询当地时间",lre=()=>"زمان‌های محلی بررسی شد",cre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ore():t==="fa"?lre():are()}),ure=()=>"Checked market data",fre=()=>"已查询市场数据",dre=()=>"داده‌های بازار بررسی شد",hre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fre():t==="fa"?dre():ure()}),_re=()=>"Checked sports data",pre=()=>"已查询体育数据",mre=()=>"داده‌های ورزشی بررسی شد",gre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pre():t==="fa"?mre():_re()}),bre=()=>"Checked the weather",vre=()=>"已查询天气",xre=()=>"آب‌وهوا بررسی شد",yre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vre():t==="fa"?xre():bre()}),wre=()=>"Checked types",Sre=()=>"已检查类型",kre=()=>"نوع‌ها بررسی شد",Cre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sre():t==="fa"?kre():wre()}),Ere=()=>"Clear annotations",Nre=()=>"清除批注",zre=()=>"پاک کردن یادداشت‌ها",t8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nre():t==="fa"?zre():Ere()}),jre=()=>"Customize",Tre=()=>"自定义",Are=()=>"سفارشی‌سازی",Rre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tre():t==="fa"?Are():jre()}),Mre=()=>"Data sources",Lre=()=>"数据源",Dre=()=>"منابع داده",ex=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lre():t==="fa"?Dre():Mre()}),Ore=()=>"Delegated a task to a new agent",Ire=()=>"已将任务委派给新智能体",Bre=()=>"وظیفه به عامل جدید واگذار شد",$re=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ire():t==="fa"?Bre():Ore()}),Pre=()=>"Delete",Hre=()=>"删除",Fre=()=>"حذف",_T=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hre():t==="fa"?Fre():Pre()}),Ure=()=>"Deny",qre=()=>"拒绝",Gre=()=>"رد کردن",Vre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qre():t==="fa"?Gre():Ure()}),Wre=()=>"Edit and re-send",Kre=()=>"编辑并重新发送",Yre=()=>"ویرایش و ارسال دوباره",n8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kre():t==="fa"?Yre():Wre()}),Xre=()=>"Edit message",Zre=()=>"编辑消息",Qre=()=>"ویرایش پیام",Jre=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zre():t==="fa"?Qre():Xre()}),ese=()=>"Edited a file",tse=()=>"已编辑文件",nse=()=>"فایل ویرایش شد",r8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tse():t==="fa"?nse():ese()}),rse=()=>"Exit Bash mode",sse=()=>"退出 Bash 模式",ise=()=>"خروج از حالت Bash",s8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sse():t==="fa"?ise():rse()}),ase=()=>"Exit Plan mode",ose=()=>"退出计划模式",lse=()=>"خروج از حالت طرح",i8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ose():t==="fa"?lse():ase()}),cse=()=>"Experiments",use=()=>"实验",fse=()=>"آزمایش‌ها",dse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?use():t==="fa"?fse():cse()}),hse=()=>"Failed:",_se=()=>"失败:",pse=()=>"ناموفق:",Ww=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_se():t==="fa"?pse():hse()}),mse=()=>"Files",gse=()=>"文件",bse=()=>"فایل‌ها",vse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gse():t==="fa"?bse():mse()}),xse=()=>"Filter sessions",yse=()=>"筛选会话",wse=()=>"فیلتر نشست‌ها",a8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yse():t==="fa"?wse():xse()}),Sse=()=>"is unavailable.",kse=()=>"不可用。",Cse=()=>"در دسترس نیست.",Ese=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kse():t==="fa"?Cse():Sse()}),Nse=()=>"Later queued messages will wait until this is retried or removed.",zse=()=>"后续排队的消息会等待此消息重试或移除。",jse=()=>"پیام‌های بعدی صف تا تلاش دوباره یا حذف این پیام منتظر می‌مانند.",Tse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zse():t==="fa"?jse():Nse()}),Ase=()=>"Listed files",Rse=()=>"已列出文件",Mse=()=>"فایل‌ها فهرست شد",o8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rse():t==="fa"?Mse():Ase()}),Lse=()=>"Listed project runs",Dse=()=>"已列出项目运行",Ose=()=>"اجراهای پروژه فهرست شد",Ise=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dse():t==="fa"?Ose():Lse()}),Bse=()=>"Listed projects",$se=()=>"已列出项目",Pse=()=>"پروژه‌ها فهرست شد",Hse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$se():t==="fa"?Pse():Bse()}),Fse=()=>"Loading conversation…",Use=()=>"正在加载对话…",qse=()=>"در حال بارگیری گفتگو…",Gse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Use():t==="fa"?qse():Fse()}),Vse=()=>"Next version",Wse=()=>"下一版本",Kse=()=>"نسخهٔ بعدی",l8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wse():t==="fa"?Kse():Vse()}),Yse=()=>"Open the session this agent spawned",Xse=()=>"打开此智能体创建的会话",Zse=()=>"باز کردن نشست ساخته‌شده توسط این عامل",Qse=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xse():t==="fa"?Zse():Yse()}),Jse=()=>"Opened web pages",eie=()=>"已打开网页",tie=()=>"صفحه‌های وب باز شد",nie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eie():t==="fa"?tie():Jse()}),rie=()=>"Plan",sie=()=>"计划",iie=()=>"طرح",aie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sie():t==="fa"?iie():rie()}),oie=()=>"Plan approved",lie=()=>"计划已批准",cie=()=>"طرح تأیید شد",uie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lie():t==="fa"?cie():oie()}),fie=()=>"Plan rejected",die=()=>"计划已拒绝",hie=()=>"طرح رد شد",_ie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?die():t==="fa"?hie():fie()}),pie=()=>"Plan resolved",mie=()=>"计划已处理",gie=()=>"طرح تعیین تکلیف شد",bie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mie():t==="fa"?gie():pie()}),vie=()=>"Plan revision requested",xie=()=>"已请求修改计划",yie=()=>"درخواست بازنگری طرح ثبت شد",wie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xie():t==="fa"?yie():vie()}),Sie=()=>"Previous version",kie=()=>"上一版本",Cie=()=>"نسخهٔ قبلی",c8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kie():t==="fa"?Cie():Sie()}),Eie=()=>"Ran a command",Nie=()=>"已运行命令",zie=()=>"فرمان اجرا شد",jie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nie():t==="fa"?zie():Eie()}),Tie=()=>"Ran tests",Aie=()=>"已运行测试",Rie=()=>"آزمون‌ها اجرا شد",Mie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Aie():t==="fa"?Rie():Tie()}),Lie=()=>"Read a file",Die=()=>"已读取文件",Oie=()=>"فایل خوانده شد",Iie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Die():t==="fa"?Oie():Lie()}),Bie=()=>"Read Git history",$ie=()=>"已读取 Git 历史",Pie=()=>"تاریخچهٔ Git خوانده شد",Hie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$ie():t==="fa"?Pie():Bie()}),Fie=()=>"Read project details",Uie=()=>"已读取项目详情",qie=()=>"جزئیات پروژه خوانده شد",Gie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Uie():t==="fa"?qie():Fie()}),Vie=()=>"Reject",Wie=()=>"拒绝",Kie=()=>"رد کردن",Yie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wie():t==="fa"?Kie():Vie()}),Xie=()=>"Remove",Zie=()=>"移除",Qie=()=>"حذف",Jie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zie():t==="fa"?Qie():Xie()}),eae=()=>"Remove annotation",tae=()=>"移除批注",nae=()=>"حذف یادداشت",rae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tae():t==="fa"?nae():eae()}),sae=()=>"Remove file",iae=()=>"移除文件",aae=()=>"حذف فایل",u8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iae():t==="fa"?aae():sae()}),oae=()=>"Remove image",lae=()=>"移除图片",cae=()=>"حذف تصویر",f8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lae():t==="fa"?cae():oae()}),uae=()=>"Remove queued message",fae=()=>"移除排队消息",dae=()=>"حذف پیام صف",d8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fae():t==="fa"?dae():uae()}),hae=()=>"Rename",_ae=()=>"重命名",pae=()=>"تغییر نام",pT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ae():t==="fa"?pae():hae()}),mae=()=>"Reviewed code changes",gae=()=>"已审查代码更改",bae=()=>"تغییرات کد بازبینی شد",vae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gae():t==="fa"?bae():mae()}),xae=()=>"Run",yae=()=>"运行",wae=()=>"اجرا",h8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yae():t==="fa"?wae():xae()}),Sae=()=>"Selected chat text",kae=()=>"已选聊天文本",Cae=()=>"متن انتخاب‌شدهٔ گفتگو",Eae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kae():t==="fa"?Cae():Sae()}),Nae=()=>"Selected text:",zae=()=>"已选文本:",jae=()=>"متن انتخاب‌شده:",Tae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zae():t==="fa"?jae():Nae()}),Aae=()=>"Send",Rae=()=>"发送",Mae=()=>"ارسال",By=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rae():t==="fa"?Mae():Aae()}),Lae=()=>"Session options",Dae=()=>"会话选项",Oae=()=>"گزینه‌های نشست",_8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dae():t==="fa"?Oae():Lae()}),Iae=()=>"Session title",Bae=()=>"会话标题",$ae=()=>"عنوان نشست",Pae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bae():t==="fa"?$ae():Iae()}),Hae=()=>"Show sidebar",Fae=()=>"显示侧边栏",Uae=()=>"نمایش نوار کناری",p8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fae():t==="fa"?Uae():Hae()}),qae=()=>"Started an experiment run",Gae=()=>"已启动实验运行",Vae=()=>"اجرای آزمایش آغاز شد",Wae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Gae():t==="fa"?Vae():qae()}),Kae=()=>"Reading the project to suggest where to start…",Yae=()=>"正在阅读项目以建议从哪里开始…",Xae=()=>"در حال خواندن پروژه برای پیشنهاد نقطهٔ شروع…",Zae=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yae():t==="fa"?Xae():Kae()}),Qae=()=>"Starter prompts",Jae=()=>"入门提示",eoe=()=>"پیشنهادهای شروع",toe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jae():t==="fa"?eoe():Qae()}),noe=()=>"Stop",roe=()=>"停止",soe=()=>"توقف",m8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?roe():t==="fa"?soe():noe()}),ioe=()=>"Submit",aoe=()=>"提交",ooe=()=>"ارسال",loe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aoe():t==="fa"?ooe():ioe()}),coe=()=>"Task",uoe=()=>"任务",foe=()=>"وظیفه",doe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uoe():t==="fa"?foe():coe()}),hoe=()=>"Tool failed",_oe=()=>"工具失败",poe=()=>"ابزار ناموفق بود",moe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_oe():t==="fa"?poe():hoe()}),goe=()=>"Used tools",boe=()=>"已使用工具",voe=()=>"ابزارها استفاده شد",mT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?boe():t==="fa"?voe():goe()}),xoe=()=>"View full plan",yoe=()=>"查看完整计划",woe=()=>"مشاهدهٔ طرح کامل",Soe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yoe():t==="fa"?woe():xoe()}),koe=()=>"Waited for an experiment run",Coe=()=>"已等待实验运行",Eoe=()=>"برای اجرای آزمایش صبر شد",Noe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Coe():t==="fa"?Eoe():koe()}),zoe=()=>"Waiting for your input…",joe=()=>"正在等待你的输入…",Toe=()=>"منتظر ورودی شما…",Aoe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?joe():t==="fa"?Toe():zoe()}),Roe=()=>"What should we research?",Moe=()=>"我们应该研究什么?",Loe=()=>"چه چیزی را پژوهش کنیم؟",Doe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Moe():t==="fa"?Loe():Roe()}),Ooe=()=>"You, mid-task",Ioe=()=>"你(任务进行中)",Boe=()=>"شما، هنگام انجام وظیفه",$oe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ioe():t==="fa"?Boe():Ooe()}),Poe=()=>"Pasted image",Hoe=()=>"粘贴的图片",Foe=()=>"تصویر جای‌گذاری‌شده",Uoe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hoe():t==="fa"?Foe():Poe()}),qoe=()=>"Plan",Goe=()=>"计划",Voe=()=>"طرح",gT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Goe():t==="fa"?Voe():qoe()}),Woe=()=>"Plan mode — ready to proceed?",Koe=()=>"计划模式 — 准备好继续了吗?",Yoe=()=>"حالت طرح — آماده‌اید ادامه دهید؟",Xoe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Koe():t==="fa"?Yoe():Woe()}),Zoe=()=>"Proposed plan",Qoe=()=>"提议的计划",Joe=()=>"طرح پیشنهادی",g8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qoe():t==="fa"?Joe():Zoe()}),ele=()=>"Question",tle=()=>"问题",nle=()=>"پرسش",rle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tle():t==="fa"?nle():ele()}),sle=()=>"Queued",ile=()=>"已排队",ale=()=>"در صف",ole=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ile():t==="fa"?ale():sle()}),lle=()=>"Recents",cle=()=>"最近",ule=()=>"اخیر",bT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cle():t==="fa"?ule():lle()}),fle=()=>"Re-check its setup.",dle=()=>"请重新检查其设置。",hle=()=>"راه‌اندازی آن را دوباره بررسی کنید.",_le=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dle():t==="fa"?hle():fle()}),ple=()=>"Could not recover this turn. Try again.",mle=()=>"无法恢复本轮。请重试。",gle=()=>"بازیابی این نوبت ممکن نشد. دوباره تلاش کنید.",ble=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mle():t==="fa"?gle():ple()}),vle=()=>"Could not remove the queued message. Try again.",xle=()=>"无法移除排队消息。请重试。",yle=()=>"حذف پیام در صف ممکن نشد. دوباره تلاش کنید.",wle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xle():t==="fa"?yle():vle()}),Sle=e=>`Could not re-send: ${e==null?void 0:e.error}`,kle=e=>`无法重新发送:${e==null?void 0:e.error}`,Cle=e=>`ارسال دوباره ممکن نشد: ${e==null?void 0:e.error}`,Ele=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?kle(e):t==="fa"?Cle(e):Sle(e)}),Nle=()=>"Resolved",zle=()=>"已处理",jle=()=>"رسیدگی شد",Tle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zle():t==="fa"?jle():Nle()}),Ale=()=>"Could not retry the queued message. Try again.",Rle=()=>"无法重试排队消息。请重试。",Mle=()=>"تلاش دوباره برای پیام در صف ممکن نشد. دوباره تلاش کنید.",Lle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rle():t==="fa"?Mle():Ale()}),Dle=()=>"run logs",Ole=()=>"运行日志",Ile=()=>"گزارش‌های اجرا",Ble=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ole():t==="fa"?Ile():Dle()}),$le=()=>"Scroll to bottom",Ple=()=>"滚动到底部",Hle=()=>"رفتن به پایین گفتگو",b8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ple():t==="fa"?Hle():$le()}),Fle=()=>"The selected harness is unavailable",Ule=()=>"所选智能体工具不可用",qle=()=>"ابزار عامل انتخاب‌شده در دسترس نیست",tx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ule():t==="fa"?qle():Fle()}),Gle=()=>"The chat session was not created",Vle=()=>"未能创建聊天会话",Wle=()=>"نشست گفت‌وگو ایجاد نشد",Kle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vle():t==="fa"?Wle():Gle()}),Yle=()=>" · Spawned by another agent",Xle=()=>" · 由另一个智能体创建",Zle=()=>" · ساخته‌شده به‌دست عامل دیگر",Qle=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xle():t==="fa"?Zle():Yle()}),Jle=()=>"Starting…",ece=()=>"正在启动…",tce=()=>"در حال شروع…",nce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ece():t==="fa"?tce():Jle()}),rce=e=>`Steer ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} to queue)`,sce=e=>`向 ${e==null?void 0:e.harness} 补充指示…(按 ${e==null?void 0:e.shortcut} 排队)`,ice=e=>`راهنمایی ${e==null?void 0:e.harness}… (${e==null?void 0:e.shortcut} برای افزودن به صف)`,ace=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?sce(e):t==="fa"?ice(e):rce(e)}),oce=()=>"Could not stop the turn. Try again.",lce=()=>"无法停止本轮。请重试。",cce=()=>"توقف این نوبت ممکن نشد. دوباره تلاش کنید.",uce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lce():t==="fa"?cce():oce()}),fce=e=>`Could not switch fork: ${e==null?void 0:e.error}`,dce=e=>`无法切换分支:${e==null?void 0:e.error}`,hce=e=>`تغییر شاخه ممکن نشد: ${e==null?void 0:e.error}`,_ce=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?dce(e):t==="fa"?hce(e):fce(e)}),pce=()=>"The agent",mce=()=>"智能体",gce=()=>"عامل",bce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mce():t==="fa"?gce():pce()}),vce=()=>"Thinking",xce=()=>"正在思考",yce=()=>"در حال فکر کردن",wce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xce():t==="fa"?yce():vce()}),Sce=()=>"Could not toggle Plan mode. Try again.",kce=()=>"无法切换计划模式。请重试。",Cce=()=>"تغییر حالت طرح ممکن نشد. دوباره تلاش کنید.",v8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kce():t==="fa"?Cce():Sce()}),Ece=()=>"This turn did not finish.",Nce=()=>"本轮未完成。",zce=()=>"این نوبت کامل نشد.",jce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nce():t==="fa"?zce():Ece()}),Tce=()=>"Type a custom answer…",Ace=()=>"输入自定义回答…",Rce=()=>"پاسخ دلخواه را بنویسید…",Mce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ace():t==="fa"?Rce():Tce()}),Lce=()=>"Unarchive",Dce=()=>"取消归档",Oce=()=>"خارج کردن از بایگانی",Ice=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dce():t==="fa"?Oce():Lce()}),Bce=()=>"Untitled",$ce=()=>"未命名",Pce=()=>"بدون عنوان",nx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$ce():t==="fa"?Pce():Bce()}),Hce=()=>"Could not update permissions. Try again.",Fce=()=>"无法更新权限。请重试。",Uce=()=>"به‌روزرسانی مجوزها انجام نشد. دوباره تلاش کنید.",qce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fce():t==="fa"?Uce():Hce()}),Gce=()=>"Working…",Vce=()=>"正在工作…",Wce=()=>"در حال کار…",Kw=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vce():t==="fa"?Wce():Gce()}),Kce=()=>"Close tab",Yce=()=>"关闭标签页",Xce=()=>"بستن زبانه",Zce=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yce():t==="fa"?Xce():Kce()}),Qce=()=>"Changes",Jce=()=>"更改",eue=()=>"تغییرات",tue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jce():t==="fa"?eue():Qce()}),nue=()=>"Code browser view",rue=()=>"代码浏览器视图",sue=()=>"نمای مرورگر کد",iue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rue():t==="fa"?sue():nue()}),aue=()=>"Files",oue=()=>"文件",lue=()=>"فایل‌ها",cue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oue():t==="fa"?lue():aue()}),uue=()=>"Refresh",fue=()=>"刷新",due=()=>"تازه‌سازی",x8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fue():t==="fa"?due():uue()}),hue=()=>"listing truncated",_ue=()=>"列表已截断",pue=()=>"فهرست کوتاه شده است",mue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ue():t==="fa"?pue():hue()}),gue=()=>"No files.",bue=()=>"没有文件。",vue=()=>"فایلی وجود ندارد.",xue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bue():t==="fa"?vue():gue()}),yue=()=>"Refresh failed:",wue=()=>"刷新失败:",Sue=()=>"تازه‌سازی ناموفق بود:",kue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wue():t==="fa"?Sue():yue()}),Cue=()=>"Cancelling…",Eue=()=>"正在取消…",Nue=()=>"در حال لغو…",zue=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Eue():t==="fa"?Nue():Cue()}),jue=()=>"Checking…",Tue=()=>"正在检查…",Aue=()=>"در حال بررسی…",Sa=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tue():t==="fa"?Aue():jue()}),Rue=()=>"Copied",Mue=()=>"已复制",Lue=()=>"کپی شد",l_=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mue():t==="fa"?Lue():Rue()}),Due=e=>`Failed to load: ${e==null?void 0:e.error}`,Oue=e=>`加载失败:${e==null?void 0:e.error}`,Iue=e=>`بارگذاری ناموفق بود: ${e==null?void 0:e.error}`,vT=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Oue(e):t==="fa"?Iue(e):Due(e)}),Bue=()=>"Loading…",$ue=()=>"正在加载…",Pue=()=>"در حال بارگیری…",xT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$ue():t==="fa"?Pue():Bue()}),Hue=e=>`+ ${e==null?void 0:e.count} more`,Fue=e=>`另有 ${e==null?void 0:e.count} 项`,Uue=e=>`${e==null?void 0:e.count}+ مورد دیگر`,que=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Fue(e):t==="fa"?Uue(e):Hue(e)}),Gue=()=>"Rendered view",Vue=()=>"渲染视图",Wue=()=>"نمای رندرشده",Gm=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vue():t==="fa"?Wue():Gue()}),Kue=()=>"Save",Yue=()=>"保存",Xue=()=>"ذخیره",oo=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yue():t==="fa"?Xue():Kue()}),Zue=()=>"Saving…",Que=()=>"正在保存…",Jue=()=>"در حال ذخیره…",na=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Que():t==="fa"?Jue():Zue()}),efe=()=>"Show less",tfe=()=>"收起",nfe=()=>"نمایش کمتر",yT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tfe():t==="fa"?nfe():efe()}),rfe=()=>"Show more",sfe=()=>"展开",ife=()=>"نمایش بیشتر",afe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sfe():t==="fa"?ife():rfe()}),ofe=()=>"Stop",lfe=()=>"停止",cfe=()=>"توقف",wT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lfe():t==="fa"?cfe():ofe()}),ufe=()=>"Stopping…",ffe=()=>"正在停止…",dfe=()=>"در حال توقف…",hfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ffe():t==="fa"?dfe():ufe()}),_fe=()=>"View source",pfe=()=>"查看源代码",mfe=()=>"نمایش متن منبع",Df=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pfe():t==="fa"?mfe():_fe()}),gfe=()=>"Runs as a remote Hugging Face Job",bfe=()=>"作为远程 Hugging Face Job 运行",vfe=()=>"به‌صورت Hugging Face Job دوردست اجرا می‌شود",xfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bfe():t==="fa"?vfe():gfe()}),yfe=()=>"Runs as a Job on your Kubernetes cluster",wfe=()=>"作为 Kubernetes 集群上的 Job 运行",Sfe=()=>"به‌صورت Job روی خوشهٔ Kubernetes اجرا می‌شود",kfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wfe():t==="fa"?Sfe():yfe()}),Cfe=()=>"Runs directly on this computer",Efe=()=>"直接在此计算机上运行",Nfe=()=>"مستقیماً روی این رایانه اجرا می‌شود",zfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Efe():t==="fa"?Nfe():Cfe()}),jfe=()=>"Runs in a remote Modal sandbox",Tfe=()=>"在远程 Modal 沙箱中运行",Afe=()=>"در sandbox دوردست Modal اجرا می‌شود",Rfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tfe():t==="fa"?Afe():jfe()}),Mfe=()=>"Runs on an ephemeral OpenResearch box",Lfe=()=>"在临时 OpenResearch 主机上运行",Dfe=()=>"روی میزبان موقت OpenResearch اجرا می‌شود",Ofe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lfe():t==="fa"?Dfe():Mfe()}),Ife=()=>"Runs on the connected Ray cluster",Bfe=()=>"在已连接的 Ray 集群上运行",$fe=()=>"روی خوشهٔ متصل Ray اجرا می‌شود",Pfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bfe():t==="fa"?$fe():Ife()}),Hfe=()=>"Runs as a scheduled job on your Slurm cluster",Ffe=()=>"作为 Slurm 集群上的调度作业运行",Ufe=()=>"به‌صورت کار زمان‌بندی‌شده روی خوشهٔ Slurm اجرا می‌شود",qfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ffe():t==="fa"?Ufe():Hfe()}),Gfe=()=>"Runs on a host from your SSH config",Vfe=()=>"在 SSH 配置中的主机上运行",Wfe=()=>"روی میزبانی از پیکربندی SSH اجرا می‌شود",Kfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vfe():t==="fa"?Wfe():Gfe()}),Yfe=()=>"Runs through Tinker’s remote compute",Xfe=()=>"通过 Tinker 远程算力运行",Zfe=()=>"از طریق رایانش دوردست Tinker اجرا می‌شود",Qfe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Xfe():t==="fa"?Zfe():Yfe()}),Jfe=()=>"HF Jobs",ede=()=>"HF Jobs",tde=()=>"HF Jobs",nde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ede():t==="fa"?tde():Jfe()}),rde=()=>"Kubernetes",sde=()=>"Kubernetes",ide=()=>"Kubernetes",ade=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sde():t==="fa"?ide():rde()}),ode=()=>"This machine",lde=()=>"此计算机",cde=()=>"این رایانه",ST=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lde():t==="fa"?cde():ode()}),ude=()=>"Modal",fde=()=>"Modal",dde=()=>"Modal",hde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fde():t==="fa"?dde():ude()}),_de=()=>"OpenResearch",pde=()=>"OpenResearch",mde=()=>"OpenResearch",gde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pde():t==="fa"?mde():_de()}),bde=()=>"Ray",vde=()=>"Ray",xde=()=>"Ray",yde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vde():t==="fa"?xde():bde()}),wde=()=>"Slurm",Sde=()=>"Slurm",kde=()=>"Slurm",Cde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sde():t==="fa"?kde():wde()}),Ede=()=>"SSH",Nde=()=>"SSH",zde=()=>"SSH",jde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Nde():t==="fa"?zde():Ede()}),Tde=()=>"Tinker",Ade=()=>"Tinker",Rde=()=>"Tinker",Mde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ade():t==="fa"?Rde():Tde()}),Lde=()=>"A Hugging Face Job runs remotely in your account using the selected hardware. Usage is billed by Hugging Face.",Dde=()=>"Hugging Face Job 使用所选硬件在你的账户中远程运行。费用由 Hugging Face 收取。",Ode=()=>"یک Hugging Face Job با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود. هزینه را Hugging Face دریافت می‌کند.",Ide=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dde():t==="fa"?Ode():Lde()}),Bde=()=>"A Modal sandbox runs remotely in your account using the selected hardware and scales to zero after the run.",$de=()=>"Modal 沙箱使用所选硬件在你的账户中远程运行,并在运行结束后缩容到零。",Pde=()=>"یک sandbox از Modal با سخت‌افزار انتخاب‌شده در حساب شما از راه دور اجرا می‌شود و پس از اجرا به صفر مقیاس می‌یابد.",Hde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$de():t==="fa"?Pde():Bde()}),Fde=()=>"An ephemeral OpenResearch box runs the experiment, is billed to your organization, and is deleted when the run ends.",Ude=()=>"临时 OpenResearch 主机运行实验,费用计入你的组织,并在运行结束后删除。",qde=()=>"یک میزبان موقت OpenResearch آزمایش را اجرا می‌کند، هزینه به سازمان شما منظور می‌شود و میزبان پس از پایان حذف می‌گردد.",Gde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ude():t==="fa"?qde():Fde()}),Vde=()=>"This computer must stay awake and online while Tinker runs.",Wde=()=>"Tinker 运行时,此计算机必须保持唤醒和联网。",Kde=()=>"هنگام اجرای Tinker، این رایانه باید روشن و آنلاین بماند.",Yde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wde():t==="fa"?Kde():Vde()}),Xde=()=>"Context window",Zde=()=>"上下文窗口",Qde=()=>"پنجرهٔ زمینه",Jde=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zde():t==="fa"?Qde():Xde()}),ehe=()=>"Context window used",the=()=>"已使用的上下文窗口",nhe=()=>"پنجرهٔ زمینهٔ استفاده‌شده",rhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?the():t==="fa"?nhe():ehe()}),she=e=>`${e==null?void 0:e.value} tokens`,ihe=e=>`${e==null?void 0:e.value} 个 token`,ahe=e=>`${e==null?void 0:e.value} توکن`,ohe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ihe(e):t==="fa"?ahe(e):she(e)}),lhe=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,che=e=>`${e==null?void 0:e.used} / ${e==null?void 0:e.total}(${e==null?void 0:e.percent})`,uhe=e=>`${e==null?void 0:e.used} از ${e==null?void 0:e.total} (${e==null?void 0:e.percent})`,fhe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?che(e):t==="fa"?uhe(e):lhe(e)}),dhe=()=>"No runs yet — ask the agent to launch one.",hhe=()=>"尚无运行——让智能体启动一个。",_he=()=>"هنوز اجرایی وجود ندارد — از عامل بخواهید یکی را آغاز کند.",phe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hhe():t==="fa"?_he():dhe()}),mhe=()=>"Run",ghe=()=>"运行",bhe=()=>"اجرا",y8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ghe():t==="fa"?bhe():mhe()}),vhe=()=>"Switch run",xhe=()=>"切换运行",yhe=()=>"تغییر اجرا",whe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xhe():t==="fa"?yhe():vhe()}),She=e=>`${e==null?void 0:e.days}d ${e==null?void 0:e.hours}h`,khe=e=>`${e==null?void 0:e.days} 天 ${e==null?void 0:e.hours} 小时`,Che=e=>`${e==null?void 0:e.days} روز و ${e==null?void 0:e.hours} ساعت`,Ehe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?khe(e):t==="fa"?Che(e):She(e)}),Nhe=e=>`${e==null?void 0:e.hours}h ${e==null?void 0:e.minutes}m`,zhe=e=>`${e==null?void 0:e.hours} 小时 ${e==null?void 0:e.minutes} 分钟`,jhe=e=>`${e==null?void 0:e.hours} ساعت و ${e==null?void 0:e.minutes} دقیقه`,The=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?zhe(e):t==="fa"?jhe(e):Nhe(e)}),Ahe=e=>`${e==null?void 0:e.value}m`,Rhe=e=>`${e==null?void 0:e.value} 分钟`,Mhe=e=>`${e==null?void 0:e.value} دقیقه`,Lhe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Rhe(e):t==="fa"?Mhe(e):Ahe(e)}),Dhe=e=>`${e==null?void 0:e.value}s`,Ohe=e=>`${e==null?void 0:e.value} 秒`,Ihe=e=>`${e==null?void 0:e.value} ثانیه`,Bhe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Ohe(e):t==="fa"?Ihe(e):Dhe(e)}),$he=()=>"Code",Phe=()=>"代码",Hhe=()=>"کد",Fhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Phe():t==="fa"?Hhe():$he()}),Uhe=()=>"created",qhe=()=>"创建于",Ghe=()=>"ایجادشده",Vhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qhe():t==="fa"?Ghe():Uhe()}),Whe=()=>"from",Khe=()=>"来自",Yhe=()=>"از",Xhe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Khe():t==="fa"?Yhe():Whe()}),Zhe=()=>"Logs",Qhe=()=>"日志",Jhe=()=>"گزارش‌ها",e_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qhe():t==="fa"?Jhe():Zhe()}),t_e=()=>"Latest run",n_e=()=>"最新运行",r_e=()=>"آخرین اجرا",s_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?n_e():t==="fa"?r_e():t_e()}),i_e=()=>"Code",a_e=()=>"代码",o_e=()=>"کد",l_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?a_e():t==="fa"?o_e():i_e()}),c_e=()=>"Commit",u_e=()=>"提交",f_e=()=>"کامیت",d_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?u_e():t==="fa"?f_e():c_e()}),h_e=()=>"created",__e=()=>"创建于",p_e=()=>"ایجادشده",m_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?__e():t==="fa"?p_e():h_e()}),g_e=()=>"Description",b_e=()=>"说明",v_e=()=>"توضیحات",x_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?b_e():t==="fa"?v_e():g_e()}),y_e=()=>"Duration",w_e=()=>"时长",S_e=()=>"مدت",k_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?w_e():t==="fa"?S_e():y_e()}),C_e=()=>"exit",E_e=()=>"退出码",N_e=()=>"خروج",z_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?E_e():t==="fa"?N_e():C_e()}),j_e=()=>"from",T_e=()=>"来自",A_e=()=>"از",R_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?T_e():t==="fa"?A_e():j_e()}),M_e=()=>"Logs",L_e=()=>"日志",D_e=()=>"گزارش‌ها",O_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?L_e():t==="fa"?D_e():M_e()}),I_e=()=>"Run",B_e=()=>"运行",$_e=()=>"اجرا",P_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?B_e():t==="fa"?$_e():I_e()}),H_e=()=>"Run history",F_e=()=>"运行历史",U_e=()=>"تاریخچهٔ اجرا",q_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?F_e():t==="fa"?U_e():H_e()}),G_e=()=>"Started",V_e=()=>"开始时间",W_e=()=>"آغاز",K_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?V_e():t==="fa"?W_e():G_e()}),Y_e=()=>"Runs",X_e=()=>"运行",Z_e=()=>"اجراها",Q_e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?X_e():t==="fa"?Z_e():Y_e()}),J_e=()=>"No runs yet",e0e=()=>"还没有运行",t0e=()=>"هنوز اجرایی وجود ندارد",n0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?e0e():t==="fa"?t0e():J_e()}),r0e=()=>"No experiments yet.",s0e=()=>"还没有实验。",i0e=()=>"هنوز آزمایشی وجود ندارد.",a0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s0e():t==="fa"?i0e():r0e()}),o0e=()=>"Not run yet",l0e=()=>"尚未运行",c0e=()=>"هنوز اجرا نشده",u0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?l0e():t==="fa"?c0e():o0e()}),f0e=()=>"1 run",d0e=()=>"1 次运行",h0e=()=>"۱ اجرا",_0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?d0e():t==="fa"?h0e():f0e()}),p0e=()=>"Open logs",m0e=()=>"打开日志",g0e=()=>"باز کردن گزارش‌ها",b0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?m0e():t==="fa"?g0e():p0e()}),v0e=e=>`${e==null?void 0:e.count} runs`,x0e=e=>`${e==null?void 0:e.count} 次运行`,y0e=e=>`${e==null?void 0:e.count} اجرا`,w0e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?x0e(e):t==="fa"?y0e(e):v0e(e)}),S0e=()=>"Stop requested",k0e=()=>"已请求停止",C0e=()=>"درخواست توقف ثبت شد",E0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?k0e():t==="fa"?C0e():S0e()}),N0e=()=>"Stop run",z0e=()=>"停止运行",j0e=()=>"توقف اجرا",T0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?z0e():t==="fa"?j0e():N0e()}),A0e=()=>"Code",R0e=()=>"代码",M0e=()=>"کد",L0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?R0e():t==="fa"?M0e():A0e()}),D0e=()=>"Experiments",O0e=()=>"实验",I0e=()=>"آزمایش‌ها",B0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?O0e():t==="fa"?I0e():D0e()}),$0e=()=>"Logs",P0e=()=>"日志",H0e=()=>"گزارش‌ها",F0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?P0e():t==="fa"?H0e():$0e()}),U0e=()=>"Stop failed:",q0e=()=>"停止失败:",G0e=()=>"توقف ناموفق بود:",V0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q0e():t==="fa"?G0e():U0e()}),W0e=()=>"Clipboard access is unavailable.",K0e=()=>"无法访问剪贴板。",Y0e=()=>"دسترسی به کلیپ‌بورد در دسترس نیست.",X0e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?K0e():t==="fa"?Y0e():W0e()}),Z0e=e=>`Delete “${e==null?void 0:e.path}”? This cannot be undone.`,Q0e=e=>`删除“${e==null?void 0:e.path}”?此操作无法撤销。`,J0e=e=>`«${e==null?void 0:e.path}» حذف شود؟ این کار قابل بازگشت نیست.`,epe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Q0e(e):t==="fa"?J0e(e):Z0e(e)}),tpe=()=>"Duplicate",npe=()=>"创建副本",rpe=()=>"ایجاد نسخهٔ تکراری",spe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?npe():t==="fa"?rpe():tpe()}),ipe=e=>`File actions for ${e==null?void 0:e.path}`,ape=e=>`${e==null?void 0:e.path} 的文件操作`,ope=e=>`عملیات فایل برای ${e==null?void 0:e.path}`,lpe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ape(e):t==="fa"?ope(e):ipe(e)}),cpe=()=>"Open",upe=()=>"打开",fpe=()=>"باز کردن",dpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?upe():t==="fa"?fpe():cpe()}),hpe=e=>`Rename ${e==null?void 0:e.path}`,_pe=e=>`重命名 ${e==null?void 0:e.path}`,ppe=e=>`تغییر نام ${e==null?void 0:e.path}`,mpe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_pe(e):t==="fa"?ppe(e):hpe(e)}),gpe=e=>`Not in the ${e==null?void 0:e.root} — showing the copy from the project’s artifacts.`,bpe=e=>`${e==null?void 0:e.root} 中没有该文件——当前显示项目产物中的副本。`,vpe=e=>`فایل در ${e==null?void 0:e.root} نیست — نسخهٔ موجود در خروجی‌های پروژه نمایش داده می‌شود.`,xpe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?bpe(e):t==="fa"?vpe(e):gpe(e)}),ype=()=>"Binary file — no inline preview.",wpe=()=>"二进制文件——无法内嵌预览。",Spe=()=>"فایل دودویی است — پیش‌نمایش درون‌خطی ندارد.",kpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wpe():t==="fa"?Spe():ype()}),Cpe=()=>"This file changed on disk. Your edits have not been overwritten.",Epe=()=>"此文件已在磁盘上更改。您的编辑未被覆盖。",Npe=()=>"این فایل روی دیسک تغییر کرده است. ویرایش‌های شما جایگزین نشده‌اند.",w8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Epe():t==="fa"?Npe():Cpe()}),zpe=()=>"Compile failed",jpe=()=>"编译失败",Tpe=()=>"کامپایل ناموفق بود",Ape=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jpe():t==="fa"?Tpe():zpe()}),Rpe=()=>"Compile PDF",Mpe=()=>"编译 PDF",Lpe=()=>"کامپایل PDF",S8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mpe():t==="fa"?Lpe():Rpe()}),Dpe=()=>"Compiled, but the engine reported errors — check the output below.",Ope=()=>"编译已完成,但引擎报告了错误 — 请查看下方输出。",Ipe=()=>"کامپایل انجام شد، اما موتور خطا گزارش کرد — خروجی پایین را بررسی کنید.",Bpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ope():t==="fa"?Ipe():Dpe()}),$pe=()=>"Copy command",Ppe=()=>"复制命令",Hpe=()=>"کپی فرمان",Fpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ppe():t==="fa"?Hpe():$pe()}),Upe=()=>"Copy install command",qpe=()=>"复制安装命令",Gpe=()=>"کپی فرمان نصب",Vpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qpe():t==="fa"?Gpe():Upe()}),Wpe=()=>"This file was deleted on disk. Your edits have not been discarded.",Kpe=()=>"此文件已从磁盘删除。您的编辑未被丢弃。",Ype=()=>"این فایل از روی دیسک حذف شده است. ویرایش‌های شما حذف نشده‌اند.",k8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kpe():t==="fa"?Ype():Wpe()}),Xpe=()=>"Discard my edits and reload",Zpe=()=>"放弃我的编辑并重新加载",Qpe=()=>"نادیده گرفتن ویرایش‌های من و بارگیری دوباره",Jpe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zpe():t==="fa"?Qpe():Xpe()}),eme=()=>"Discard unsaved changes and close this file?",tme=()=>"要丢弃未保存的更改并关闭此文件吗?",nme=()=>"تغییرات ذخیره‌نشده حذف و فایل بسته شود؟",C8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tme():t==="fa"?nme():eme()}),rme=()=>"Dismiss",sme=()=>"关闭",ime=()=>"بستن",ame=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sme():t==="fa"?ime():rme()}),ome=()=>"Dismiss compile message",lme=()=>"关闭编译消息",cme=()=>"بستن پیام کامپایل",ume=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lme():t==="fa"?cme():ome()}),fme=()=>"Dismiss Overleaf message",dme=()=>"关闭 Overleaf 消息",hme=()=>"بستن پیام Overleaf",_me=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dme():t==="fa"?hme():fme()}),pme=()=>"Download",mme=()=>"下载",gme=()=>"بارگیری",kT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mme():t==="fa"?gme():pme()}),bme=e=>`Download ${e==null?void 0:e.name} (out of date — recompile first)`,vme=e=>`下载 ${e==null?void 0:e.name}(版本过旧 — 请先重新编译)`,xme=e=>`دانلود ${e==null?void 0:e.name} (قدیمی است — ابتدا دوباره کامپایل کنید)`,yme=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?vme(e):t==="fa"?xme(e):bme(e)}),wme=()=>"Failed to load file:",Sme=()=>"加载文件失败:",kme=()=>"بارگیری فایل ناموفق بود:",E8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sme():t==="fa"?kme():wme()}),Cme=()=>"File truncated — showing the first 512 KB.",Eme=()=>"文件已截断——仅显示前 512 KB。",Nme=()=>"فایل کوتاه شده است — فقط ۵۱۲ کیلوبایت نخست نمایش داده می‌شود.",zme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Eme():t==="fa"?Nme():Cme()}),jme=()=>"The page below stops partway — the full file could not be loaded.",Tme=()=>"下方页面在中途结束——无法加载完整文件。",Ame=()=>"صفحهٔ زیر در میانه متوقف می‌شود — فایل کامل بارگیری نشد.",Rme=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tme():t==="fa"?Ame():jme()}),Mme=e=>`Rendered HTML: ${e==null?void 0:e.name}`,Lme=e=>`已渲染的 HTML:${e==null?void 0:e.name}`,Dme=e=>`HTML رندرشده: ${e==null?void 0:e.name}`,Ome=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Lme(e):t==="fa"?Dme(e):Mme(e)}),Ime=()=>"Loading…",Bme=()=>"正在加载…",$me=()=>"در حال بارگیری…",CT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bme():t==="fa"?$me():Ime()}),Pme=()=>"File not found.",Hme=()=>"找不到文件。",Fme=()=>"فایل پیدا نشد.",Ume=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hme():t==="fa"?Fme():Pme()}),qme=e=>`File not found in the project’s artifacts or the ${e==null?void 0:e.root}.`,Gme=e=>`在项目产物或${e==null?void 0:e.root}中找不到此文件。`,Vme=e=>`فایل در خروجی‌های پروژه یا ${e==null?void 0:e.root} پیدا نشد.`,Wme=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Gme(e):t==="fa"?Vme(e):qme(e)}),Kme=e=>`File not found on branch ${e==null?void 0:e.branch}.`,Yme=e=>`在分支 ${e==null?void 0:e.branch} 上找不到此文件。`,Xme=e=>`فایل در شاخهٔ ${e==null?void 0:e.branch} پیدا نشد.`,Zme=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Yme(e):t==="fa"?Xme(e):Kme(e)}),Qme=()=>"File not found on disk.",Jme=()=>"磁盘上找不到此文件。",ege=()=>"فایل روی دیسک پیدا نشد.",tge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jme():t==="fa"?ege():Qme()}),nge=e=>`File not found in the ${e==null?void 0:e.root} or the project’s artifacts.`,rge=e=>`在${e==null?void 0:e.root}或项目产物中找不到此文件。`,sge=e=>`فایل در ${e==null?void 0:e.root} یا خروجی‌های پروژه پیدا نشد.`,ige=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?rge(e):t==="fa"?sge(e):nge(e)}),age=e=>`Not in the project’s artifacts — showing the copy from the ${e==null?void 0:e.root}.`,oge=e=>`项目产物中没有此文件 — 正在显示${e==null?void 0:e.root}中的副本。`,lge=e=>`در خروجی‌های پروژه نیست — نسخهٔ موجود در ${e==null?void 0:e.root} نمایش داده می‌شود.`,cge=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?oge(e):t==="fa"?lge(e):age(e)}),uge=()=>"Open in default editor",fge=()=>"在默认编辑器中打开",dge=()=>"باز کردن در ویرایشگر پیش‌فرض",N8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fge():t==="fa"?dge():uge()}),hge=()=>"Overleaf's copy of this file was pulled while you had unsaved edits, so what you see is no longer what is on disk. Saving now sends this draft to Overleaf instead.",_ge=()=>"你有未保存的编辑时,Overleaf 上的文件副本被拉取,因此当前内容已与磁盘不同。现在保存会将此草稿发送到 Overleaf。",pge=()=>"هنگامی که ویرایش‌های ذخیره‌نشده داشتید، نسخهٔ Overleaf این فایل دریافت شد؛ بنابراین آنچه می‌بینید دیگر با فایل روی دیسک یکی نیست. ذخیره‌سازی اکنون این پیش‌نویس را به Overleaf می‌فرستد.",mge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ge():t==="fa"?pge():hge()}),gge=()=>"Overwrite disk file",bge=()=>"覆盖磁盘文件",vge=()=>"بازنویسی فایل روی دیسک",xge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bge():t==="fa"?vge():gge()}),yge=()=>"Compiled PDF is out of date",wge=()=>"已编译的 PDF 不是最新版本",Sge=()=>"PDF کامپایل‌شده به‌روز نیست",kge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wge():t==="fa"?Sge():yge()}),Cge=()=>"project clone",Ege=()=>"项目克隆",Nge=()=>"کلون پروژه",wp=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ege():t==="fa"?Nge():Cge()}),zge=()=>"Recompile PDF",jge=()=>"重新编译 PDF",Tge=()=>"کامپایل دوبارهٔ PDF",z8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jge():t==="fa"?Tge():zge()}),Age=()=>"Reload from disk",Rge=()=>"从磁盘重新加载",Mge=()=>"بارگذاری مجدد از دیسک",Lge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rge():t==="fa"?Mge():Age()}),Dge=()=>"Save failed",Oge=()=>"保存失败",Ige=()=>"ذخیره ناموفق بود",Bge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Oge():t==="fa"?Ige():Dge()}),$ge=()=>"Saving…",Pge=()=>"正在保存…",Hge=()=>"در حال ذخیره…",Fge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pge():t==="fa"?Hge():$ge()}),Uge=()=>"Selected — press ⌘C",qge=()=>"已选中 — 按 ⌘C 复制",Gge=()=>"انتخاب شد — برای کپی ⌘C را بزنید",Vge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qge():t==="fa"?Gge():Uge()}),Wge=()=>"session’s worktree",Kge=()=>"会话工作树",Yge=()=>"درخت کاری نشست",Sp=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kge():t==="fa"?Yge():Wge()}),Xge=()=>"Show compiled PDF",Zge=()=>"显示已编译的 PDF",Qge=()=>"نمایش PDF کامپایل‌شده",j8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zge():t==="fa"?Qge():Xge()}),Jge=()=>"This PDF was compiled from an earlier version of the source — recompile to update it.",e1e=()=>"此 PDF 由较早版本的源文件编译而成——请重新编译以更新。",t1e=()=>"این PDF از نسخه‌ای قدیمی‌تر از منبع ساخته شده است — برای به‌روزرسانی دوباره کامپایل کنید.",n1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?e1e():t==="fa"?t1e():Jge()}),r1e=()=>"This session's worktree isn't available — showing the project clone's copy.",s1e=()=>"此会话的工作树不可用——当前显示项目克隆中的副本。",i1e=()=>"درخت کاری این نشست در دسترس نیست — نسخهٔ کلون پروژه نمایش داده می‌شود.",a1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s1e():t==="fa"?i1e():r1e()}),o1e=()=>"Unsaved",l1e=()=>"未保存",c1e=()=>"ذخیره نشده",ET=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?l1e():t==="fa"?c1e():o1e()}),u1e=()=>"Unsaved — ⌘S to save",f1e=()=>"未保存 — 按 ⌘S 保存",d1e=()=>"ذخیره نشده — برای ذخیره ⌘S را بزنید",h1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?f1e():t==="fa"?d1e():u1e()}),_1e=()=>"Update orx on the remote machine to edit this file safely.",p1e=()=>"请更新远程计算机上的 orx,以安全编辑此文件。",m1e=()=>"برای ویرایش ایمن این فایل، orx را روی دستگاه ریموت به‌روز کنید.",g1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?p1e():t==="fa"?m1e():_1e()}),b1e=()=>"This session’s worktree isn’t available, and the file isn’t in the project clone or its artifacts.",v1e=()=>"此会话的工作树不可用,项目克隆和产物中也没有此文件。",x1e=()=>"درخت کاری این نشست در دسترس نیست و فایل در نسخهٔ محلی پروژه یا خروجی‌های آن هم پیدا نشد.",y1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?v1e():t==="fa"?x1e():b1e()}),w1e=()=>"Back to preview",S1e=()=>"返回预览",k1e=()=>"بازگشت به پیش‌نمایش",C1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?S1e():t==="fa"?k1e():w1e()}),E1e=e=>`${e==null?void 0:e.count} changed files`,N1e=e=>`${e==null?void 0:e.count} 个已更改文件`,z1e=e=>`${e==null?void 0:e.count} فایل تغییرکرده`,j1e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?N1e(e):t==="fa"?z1e(e):E1e(e)}),T1e=()=>"Changed files",A1e=()=>"已更改文件",R1e=()=>"فایل‌های تغییرکرده",M1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A1e():t==="fa"?R1e():T1e()}),L1e=()=>"Diff preview truncated",D1e=()=>"差异预览已截断",O1e=()=>"پیش‌نمایش تفاوت کوتاه شده است",I1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D1e():t==="fa"?O1e():L1e()}),B1e=e=>`${e==null?void 0:e.count} files shown (partial)`,$1e=e=>`显示 ${e==null?void 0:e.count} 个文件(部分)`,P1e=e=>`${e==null?void 0:e.count} فایل نمایش داده شده (ناقص)`,H1e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$1e(e):t==="fa"?P1e(e):B1e(e)}),F1e=()=>"No changes.",U1e=()=>"没有更改。",q1e=()=>"تغییری وجود ندارد.",G1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?U1e():t==="fa"?q1e():F1e()}),V1e=()=>"No complete file preview was available before the cutoff.",W1e=()=>"在截断位置之前没有完整的文件预览。",K1e=()=>"پیش از نقطهٔ برش، پیش‌نمایش کاملی از هیچ فایلی موجود نبود.",Y1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?W1e():t==="fa"?K1e():V1e()}),X1e=()=>"No textual diff for this file.",Z1e=()=>"此文件没有文本差异。",Q1e=()=>"برای این فایل تفاوت متنی وجود ندارد.",J1e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Z1e():t==="fa"?Q1e():X1e()}),ebe=()=>"1 changed file",tbe=()=>"1 个已更改文件",nbe=()=>"۱ فایل تغییرکرده",rbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tbe():t==="fa"?nbe():ebe()}),sbe=()=>"1 file shown (partial)",ibe=()=>"显示 1 个文件(部分)",abe=()=>"۱ فایل نمایش داده شده (ناقص)",obe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ibe():t==="fa"?abe():sbe()}),lbe=()=>"Unable to parse this diff.",cbe=()=>"无法解析此差异。",ube=()=>"خواندن این تفاوت ممکن نبود.",fbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cbe():t==="fa"?ube():lbe()}),dbe=e=>`Showing the first ${e==null?void 0:e.limit} (${e==null?void 0:e.read} read). View the complete diff locally with git.`,hbe=e=>`正在显示前 ${e==null?void 0:e.limit}(已读取 ${e==null?void 0:e.read})。请在本地使用 git 查看完整差异。`,_be=e=>`نخستین ${e==null?void 0:e.limit} نمایش داده می‌شود (${e==null?void 0:e.read} خوانده شد). تفاوت کامل را با git به‌صورت محلی ببینید.`,pbe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?hbe(e):t==="fa"?_be(e):dbe(e)}),mbe=()=>"View full diff",gbe=()=>"查看完整差异",bbe=()=>"نمایش تفاوت کامل",vbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gbe():t==="fa"?bbe():mbe()}),xbe=()=>"Create a token ↗",ybe=()=>"创建令牌 ↗",wbe=()=>"ساخت توکن ↗",Sbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ybe():t==="fa"?wbe():xbe()}),kbe=()=>"All projects",Cbe=()=>"所有项目",Ebe=()=>"همهٔ پروژه‌ها",T8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cbe():t==="fa"?Ebe():kbe()}),Nbe=()=>"Configure Repository",zbe=()=>"配置仓库",jbe=()=>"پیکربندی مخزن",Tbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zbe():t==="fa"?jbe():Nbe()}),Abe=()=>"Create a new project",Rbe=()=>"新建项目",Mbe=()=>"ایجاد پروژهٔ جدید",Lbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rbe():t==="fa"?Mbe():Abe()}),Dbe=()=>"Hide sidebar",Obe=()=>"隐藏侧边栏",Ibe=()=>"پنهان کردن نوار کناری",A8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Obe():t==="fa"?Ibe():Dbe()}),Bbe=()=>"Project",$be=()=>"项目",Pbe=()=>"پروژه",Hbe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$be():t==="fa"?Pbe():Bbe()}),Fbe=e=>`${e==null?void 0:e.count} cancelled`,Ube=e=>`${e==null?void 0:e.count} 次取消`,qbe=e=>`${e==null?void 0:e.count} لغوشده`,Gbe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Ube(e):t==="fa"?qbe(e):Fbe(e)}),Vbe=e=>`${e==null?void 0:e.count} done`,Wbe=e=>`${e==null?void 0:e.count} 次完成`,Kbe=e=>`${e==null?void 0:e.count} تمام‌شده`,Ybe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Wbe(e):t==="fa"?Kbe(e):Vbe(e)}),Xbe=e=>`${e==null?void 0:e.count} failed`,Zbe=e=>`${e==null?void 0:e.count} 次失败`,Qbe=e=>`${e==null?void 0:e.count} ناموفق`,Jbe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Zbe(e):t==="fa"?Qbe(e):Xbe(e)}),eve=e=>`${e==null?void 0:e.count} files`,tve=e=>`${e==null?void 0:e.count} 个文件`,nve=e=>`${e==null?void 0:e.count} فایل`,rve=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?tve(e):t==="fa"?nve(e):eve(e)}),sve=e=>`${e==null?void 0:e.count}+ files`,ive=e=>`至少 ${e==null?void 0:e.count} 个文件`,ave=e=>`بیش از ${e==null?void 0:e.count} فایل`,ove=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ive(e):t==="fa"?ave(e):sve(e)}),lve=e=>`${e==null?void 0:e.count} live`,cve=e=>`${e==null?void 0:e.count} 次进行中`,uve=e=>`${e==null?void 0:e.count} فعال`,fve=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cve(e):t==="fa"?uve(e):lve(e)}),dve=()=>"1 file",hve=()=>"1 个文件",_ve=()=>"۱ فایل",pve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hve():t==="fa"?_ve():dve()}),mve=()=>"1 run",gve=()=>"1 次运行",bve=()=>"۱ اجرا",vve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gve():t==="fa"?bve():mve()}),xve=e=>`${e==null?void 0:e.count} runs`,yve=e=>`${e==null?void 0:e.count} 次运行`,wve=e=>`${e==null?void 0:e.count} اجرا`,Sve=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?yve(e):t==="fa"?wve(e):xve(e)}),kve=()=>"No instances yet.",Cve=()=>"还没有实例。",Eve=()=>"هنوز نمونه‌ای وجود ندارد.",Nve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cve():t==="fa"?Eve():kve()}),zve=()=>"Nothing running right now.",jve=()=>"当前没有运行中的实例。",Tve=()=>"اکنون چیزی در حال اجرا نیست.",Ave=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jve():t==="fa"?Tve():zve()}),Rve=()=>"Select a project to see its history.",Mve=()=>"请选择一个项目以查看其历史记录。",Lve=()=>"برای دیدن تاریخچه یک پروژه انتخاب کنید.",Dve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mve():t==="fa"?Lve():Rve()}),Ove=()=>"Select a project to see its runs.",Ive=()=>"请选择一个项目以查看其运行。",Bve=()=>"برای دیدن اجراها یک پروژه انتخاب کنید.",$ve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ive():t==="fa"?Bve():Ove()}),Pve=()=>"View history",Hve=()=>"查看历史记录",Fve=()=>"مشاهدهٔ تاریخچه",Uve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hve():t==="fa"?Fve():Pve()}),qve=e=>`View history (${e==null?void 0:e.count})`,Gve=e=>`查看历史记录(${e==null?void 0:e.count})`,Vve=e=>`مشاهدهٔ تاریخچه (${e==null?void 0:e.count})`,Wve=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Gve(e):t==="fa"?Vve(e):qve(e)}),Kve=()=>"The engine exited without producing a PDF or a log.",Yve=()=>"引擎已退出,但没有生成 PDF 或日志。",Xve=()=>"موتور بدون تولید PDF یا گزارش خارج شد.",Zve=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yve():t==="fa"?Xve():Kve()}),Qve=()=>"Loading…",Jve=()=>"正在加载…",exe=()=>"در حال بارگیری…",txe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jve():t==="fa"?exe():Qve()}),nxe=()=>"Copy",rxe=()=>"复制",sxe=()=>"کپی",NT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rxe():t==="fa"?sxe():nxe()}),ixe=()=>"Copy code",axe=()=>"复制代码",oxe=()=>"کپی کد",lxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?axe():t==="fa"?oxe():ixe()}),cxe=()=>"Download",uxe=()=>"下载",fxe=()=>"بارگیری",zT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uxe():t==="fa"?fxe():cxe()}),dxe=()=>"This browser can’t preview this media format.",hxe=()=>"此浏览器无法预览该媒体格式。",_xe=()=>"این مرورگر نمی‌تواند این قالب رسانه را پیش‌نمایش کند.",pxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hxe():t==="fa"?_xe():dxe()}),mxe=()=>" · CLI configuration",gxe=()=>" · CLI 配置",bxe=()=>" · پیکربندی CLI",jT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gxe():t==="fa"?bxe():mxe()}),vxe=()=>"· Default",xxe=()=>"· 默认",yxe=()=>"· پیش‌فرض",TT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xxe():t==="fa"?yxe():vxe()}),wxe=()=>"Default model",Sxe=()=>"默认模型",kxe=()=>"مدل پیش‌فرض",R8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Sxe():t==="fa"?kxe():wxe()}),Cxe=()=>"Detecting harnesses…",Exe=()=>"正在检测智能体工具…",Nxe=()=>"در حال شناسایی ابزارهای عامل…",zxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Exe():t==="fa"?Nxe():Cxe()}),jxe=()=>"Effort",Txe=()=>"推理强度",Axe=()=>"میزان استدلال",Rxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Txe():t==="fa"?Axe():jxe()}),Mxe=()=>"Fast speed ·",Lxe=()=>"快速 ·",Dxe=()=>"سرعت بالا ·",Oxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lxe():t==="fa"?Dxe():Mxe()}),Ixe=()=>"Mode",Bxe=()=>"模式",$xe=()=>"حالت",M8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bxe():t==="fa"?$xe():Ixe()}),Pxe=()=>"Model",Hxe=()=>"模型",Fxe=()=>"مدل",rx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hxe():t==="fa"?Fxe():Pxe()}),Uxe=e=>`${e==null?void 0:e.count} more — search to find`,qxe=e=>`还有 ${e==null?void 0:e.count} 个——搜索即可查找`,Gxe=e=>`${e==null?void 0:e.count} مورد دیگر — برای یافتن جست‌وجو کنید`,Vxe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?qxe(e):t==="fa"?Gxe(e):Uxe(e)}),Wxe=()=>"Not available",Kxe=()=>"不可用",Yxe=()=>"در دسترس نیست",Xxe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kxe():t==="fa"?Yxe():Wxe()}),Zxe=()=>"Search models…",Qxe=()=>"搜索模型…",Jxe=()=>"جست‌وجوی مدل‌ها…",eye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qxe():t==="fa"?Jxe():Zxe()}),tye=()=>"Sessions keep their harness. Start a new chat to switch.",nye=()=>"会话将沿用当前的智能体工具。新建聊天即可切换。",rye=()=>"نشست‌ها ابزار عامل خود را نگه می‌دارند. برای تغییر، گفتگوی جدیدی بسازید",sye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nye():t==="fa"?rye():tye()}),iye=()=>"Speed",aye=()=>"速度",oye=()=>"سرعت",L8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aye():t==="fa"?oye():iye()}),lye=()=>"Unavailable",cye=()=>"不可用",uye=()=>"در دسترس نیست",rc=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cye():t==="fa"?uye():lye()}),fye=e=>`Use “${e==null?void 0:e.id}” as the model ID`,dye=e=>`使用“${e==null?void 0:e.id}”作为模型 ID`,hye=e=>`از «${e==null?void 0:e.id}» به‌عنوان شناسهٔ مدل استفاده کنید`,_ye=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?dye(e):t==="fa"?hye(e):fye(e)}),pye=()=>"Variant",mye=()=>"变体",gye=()=>"گونه",bye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mye():t==="fa"?gye():pye()}),vye=()=>"Advanced",xye=()=>"高级",yye=()=>"پیشرفته",wye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xye():t==="fa"?yye():vye()}),Sye=()=>"Advanced · Connect GitHub",kye=()=>"高级 · 连接 GitHub",Cye=()=>"پیشرفته · اتصال GitHub",Eye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kye():t==="fa"?Cye():Sye()}),Nye=()=>"Advanced · GitHub sync on",zye=()=>"高级 · GitHub 同步已开启",jye=()=>"پیشرفته · همگام‌سازی GitHub روشن است",Tye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zye():t==="fa"?jye():Nye()}),Aye=()=>"Choose a different destination. A paper project needs a new or empty folder of its own.",Rye=()=>"请选择其他位置。论文项目需要拥有独立的新文件夹或空文件夹。",Mye=()=>"مقصد دیگری انتخاب کنید. پروژهٔ مقاله باید پوشهٔ جدید یا خالیِ جداگانه‌ای داشته باشد.",Lye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Rye():t==="fa"?Mye():Aye()}),Dye=e=>`Change project folder; current folder: ${e==null?void 0:e.path}`,Oye=e=>`更改项目文件夹;当前文件夹:${e==null?void 0:e.path}`,Iye=e=>`تغییر پوشهٔ پروژه؛ پوشهٔ کنونی: ${e==null?void 0:e.path}`,Bye=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Oye(e):t==="fa"?Iye(e):Dye(e)}),$ye=()=>"Choose an existing project folder",Pye=()=>"选择现有项目文件夹",Hye=()=>"انتخاب پوشهٔ موجود پروژه",D8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pye():t==="fa"?Hye():$ye()}),Fye=()=>"Choosing…",Uye=()=>"正在选择…",qye=()=>"در حال انتخاب…",Gye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Uye():t==="fa"?qye():Fye()}),Vye=()=>"Clone destination",Wye=()=>"克隆位置",Kye=()=>"مقصد کلون",Yye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Wye():t==="fa"?Kye():Vye()}),Xye=()=>"Clone paper project",Zye=()=>"克隆论文项目",Qye=()=>"کلون پروژهٔ مقاله",Jye=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Zye():t==="fa"?Qye():Xye()}),e2e=()=>"Create project",t2e=()=>"创建项目",n2e=()=>"ایجاد پروژه",O8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?t2e():t==="fa"?n2e():e2e()}),r2e=()=>"Creating…",s2e=()=>"正在创建…",i2e=()=>"در حال ایجاد…",a2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s2e():t==="fa"?i2e():r2e()}),o2e=()=>"Choose a different destination. This path is a file, not a folder.",l2e=()=>"请选择其他位置。此路径是文件,不是文件夹。",c2e=()=>"مقصد دیگری انتخاب کنید. این مسیر فایل است، نه پوشه.",I8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?l2e():t==="fa"?c2e():o2e()}),u2e=()=>"A folder already exists here. Choose a different name or location, or use Existing folder.",f2e=()=>"此处已有文件夹。请选择其他名称或位置,或使用“现有文件夹”。",d2e=()=>"پوشه‌ای در این محل وجود دارد. نام یا محل دیگری انتخاب کنید، یا از «پوشهٔ موجود» استفاده کنید.",h2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?f2e():t==="fa"?d2e():u2e()}),_2e=()=>"Blank project",p2e=()=>"空白项目",m2e=()=>"پروژهٔ خالی",g2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?p2e():t==="fa"?m2e():_2e()}),b2e=()=>"Cancel",v2e=()=>"取消",x2e=()=>"لغو",y2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?v2e():t==="fa"?x2e():b2e()}),w2e=()=>"Change",S2e=()=>"更改",k2e=()=>"تغییر",C2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?S2e():t==="fa"?k2e():w2e()}),E2e=()=>"Change selected paper",N2e=()=>"更改所选论文",z2e=()=>"تغییر مقالهٔ انتخاب‌شده",j2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?N2e():t==="fa"?z2e():E2e()}),T2e=()=>"Check out a Git branch before using this folder.",A2e=()=>"使用此文件夹前,请先检出一个 Git 分支。",R2e=()=>"پیش از استفاده از این پوشه، یک شاخهٔ Git را checkout کنید.",M2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A2e():t==="fa"?R2e():T2e()}),L2e=()=>"Checking project location.",D2e=()=>"正在检查项目位置。",O2e=()=>"در حال بررسی محل پروژه.",B8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D2e():t==="fa"?O2e():L2e()}),I2e=()=>"Existing folder",B2e=()=>"现有文件夹",$2e=()=>"پوشهٔ موجود",P2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?B2e():t==="fa"?$2e():I2e()}),H2e=()=>"Experiment branches will be pushed to the remote GitHub repository.",F2e=()=>"实验分支将推送到远程 GitHub 仓库。",U2e=()=>"شاخه‌های آزمایش به مخزن دوردست GitHub فرستاده می‌شوند.",q2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?F2e():t==="fa"?U2e():H2e()}),G2e=()=>"From a paper",V2e=()=>"从论文创建",W2e=()=>"از یک مقاله",K2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?V2e():t==="fa"?W2e():G2e()}),Y2e=()=>"Git is required for experiments but is not installed. Install Git, then restart OpenResearch.",X2e=()=>"实验需要 Git,但尚未安装。请安装 Git,然后重新启动 OpenResearch。",Z2e=()=>"Git برای آزمایش‌ها لازم است اما نصب نیست. Git را نصب و سپس OpenResearch را دوباره راه‌اندازی کنید.",Q2e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?X2e():t==="fa"?Z2e():Y2e()}),J2e=()=>"my-research",ewe=()=>"my-research",twe=()=>"my-research",$8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ewe():t==="fa"?twe():J2e()}),nwe=()=>"No papers found. Try an arXiv ID, URL, or a different title.",rwe=()=>"未找到论文。请尝试 arXiv ID、网址或其他标题。",swe=()=>"مقاله‌ای پیدا نشد. یک شناسهٔ arXiv، نشانی یا عنوان دیگری را امتحان کنید.",iwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rwe():t==="fa"?swe():nwe()}),awe=()=>"No public repository found on alphaXiv",owe=()=>"在 alphaXiv 上未找到公开仓库",lwe=()=>"مخزن عمومی‌ای در alphaXiv پیدا نشد",cwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?owe():t==="fa"?lwe():awe()}),uwe=()=>"OpenResearch will start a blank project with this paper's PDF.",fwe=()=>"OpenResearch 将使用此论文的 PDF 创建空白项目。",dwe=()=>"OpenResearch یک پروژهٔ خالی با PDF این مقاله آغاز می‌کند.",hwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fwe():t==="fa"?dwe():uwe()}),_we=()=>"Paper",pwe=()=>"论文",mwe=()=>"مقاله",gwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pwe():t==="fa"?mwe():_we()}),bwe=()=>"Project location",vwe=()=>"项目位置",xwe=()=>"محل پروژه",sx=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vwe():t==="fa"?xwe():bwe()}),ywe=()=>"Project name",wwe=()=>"项目名称",Swe=()=>"نام پروژه",P8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wwe():t==="fa"?Swe():ywe()}),kwe=()=>"Search for a paper by arXiv ID, URL, or title",Cwe=()=>"按 arXiv ID、网址或标题搜索论文",Ewe=()=>"جست‌وجوی مقاله با شناسهٔ arXiv، نشانی یا عنوان",Nwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cwe():t==="fa"?Ewe():kwe()}),zwe=()=>"Sync experiments to GitHub",jwe=()=>"将实验同步到 GitHub",Twe=()=>"همگام‌سازی آزمایش‌ها با GitHub",Awe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jwe():t==="fa"?Twe():zwe()}),Rwe=()=>"That folder no longer exists. Choose it again.",Mwe=()=>"该文件夹已不存在。请重新选择。",Lwe=()=>"آن پوشه دیگر وجود ندارد. دوباره انتخابش کنید.",Dwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mwe():t==="fa"?Lwe():Rwe()}),Owe=()=>"The selected folder contains an invalid Git repository.",Iwe=()=>"所选文件夹包含无效的 Git 仓库。",Bwe=()=>"پوشهٔ انتخاب‌شده یک مخزن Git نامعتبر دارد.",$we=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Iwe():t==="fa"?Bwe():Owe()}),Pwe=()=>"The selected path is not a folder.",Hwe=()=>"所选路径不是文件夹。",Fwe=()=>"مسیر انتخاب‌شده پوشه نیست.",Uwe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hwe():t==="fa"?Fwe():Pwe()}),qwe=e=>`Checking ${e==null?void 0:e.repository}.`,Gwe=e=>`正在检查 ${e==null?void 0:e.repository}。`,Vwe=e=>`در حال بررسی ${e==null?void 0:e.repository}.`,Wwe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Gwe(e):t==="fa"?Vwe(e):qwe(e)}),Kwe=e=>`Creates ${e==null?void 0:e.repository}.`,Ywe=e=>`将创建 ${e==null?void 0:e.repository}。`,Xwe=e=>`${e==null?void 0:e.repository} را ایجاد می‌کند.`,Zwe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Ywe(e):t==="fa"?Xwe(e):Kwe(e)}),Qwe=e=>`Pushes to ${e==null?void 0:e.repository}.`,Jwe=e=>`将推送到 ${e==null?void 0:e.repository}。`,e4e=e=>`به ${e==null?void 0:e.repository} پوش می‌کند.`,t4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Jwe(e):t==="fa"?e4e(e):Qwe(e)}),n4e=()=>"Project location is required.",r4e=()=>"必须填写项目位置。",s4e=()=>"محل پروژه الزامی است.",H8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?r4e():t==="fa"?s4e():n4e()}),i4e=()=>"Choose a different destination. The paper repository needs a new or empty folder.",a4e=()=>"请选择其他位置。论文仓库需要一个新的或空的文件夹。",o4e=()=>"مقصد دیگری انتخاب کنید. مخزن مقاله به پوشه‌ای جدید یا خالی نیاز دارد.",l4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?a4e():t==="fa"?o4e():i4e()}),c4e=()=>"A linked public code repository is cloned without credentials.",u4e=()=>"关联的公开代码仓库无需凭据即可克隆。",f4e=()=>"مخزن عمومی کدِ پیوندشده بدون نیاز به اعتبارنامه کلون می‌شود.",d4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?u4e():t==="fa"?f4e():c4e()}),h4e=e=>`Run ${e==null?void 0:e.command} before creating the project.`,_4e=e=>`创建项目前请运行 ${e==null?void 0:e.command}。`,p4e=e=>`پیش از ساخت پروژه، ${e==null?void 0:e.command} را اجرا کنید.`,m4e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_4e(e):t==="fa"?p4e(e):h4e(e)}),g4e=()=>"Searching alphaXiv…",b4e=()=>"正在搜索 alphaXiv…",v4e=()=>"در حال جست‌وجوی alphaXiv…",x4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?b4e():t==="fa"?v4e():g4e()}),y4e=()=>"Use folder",w4e=()=>"使用文件夹",S4e=()=>"استفاده از پوشه",k4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?w4e():t==="fa"?S4e():y4e()}),C4e=()=>"Can’t reach OpenResearch. This page is no longer live.",E4e=()=>"无法连接 OpenResearch。此页面已不再实时同步。",N4e=()=>"دسترسی به OpenResearch ممکن نیست. این صفحه دیگر همگام نیست.",$y=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?E4e():t==="fa"?N4e():C4e()}),z4e=()=>"A workspace for your research agents",j4e=()=>"面向研究智能体的工作空间",T4e=()=>"فضای کاری برای عامل‌های پژوهشی شما",A4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?j4e():t==="fa"?T4e():z4e()}),R4e=()=>"Add papers that represent your research interests, including papers by other authors.",M4e=()=>"添加能够代表你研究兴趣的论文,也可以包括其他作者的论文。",L4e=()=>"مقاله‌هایی را که نمایندهٔ علایق پژوهشی شما هستند، از جمله آثار نویسندگان دیگر، اضافه کنید.",D4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?M4e():t==="fa"?L4e():R4e()}),O4e=()=>"API key",I4e=()=>"API 密钥",B4e=()=>"کلید API",Yw=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?I4e():t==="fa"?B4e():O4e()}),$4e=()=>"AI/ML",P4e=()=>"人工智能与机器学习",H4e=()=>"هوش مصنوعی و یادگیری ماشین",F4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?P4e():t==="fa"?H4e():$4e()}),U4e=()=>"Biology",q4e=()=>"生物学",G4e=()=>"زیست‌شناسی",V4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q4e():t==="fa"?G4e():U4e()}),W4e=()=>"Other",K4e=()=>"其他",Y4e=()=>"سایر",X4e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?K4e():t==="fa"?Y4e():W4e()}),Z4e=()=>"Physics",Q4e=()=>"物理学",J4e=()=>"فیزیک",e5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Q4e():t==="fa"?J4e():Z4e()}),t5e=()=>"Back",n5e=()=>"返回",r5e=()=>"بازگشت",F8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?n5e():t==="fa"?r5e():t5e()}),s5e=()=>"Check failed",i5e=()=>"检查失败",a5e=()=>"بررسی ناموفق بود",o5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?i5e():t==="fa"?a5e():s5e()}),l5e=()=>"Checking",c5e=()=>"正在检查",u5e=()=>"در حال بررسی",f5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?c5e():t==="fa"?u5e():l5e()}),d5e=()=>"Checking Git…",h5e=()=>"正在检查 Git…",_5e=()=>"در حال بررسی Git…",p5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?h5e():t==="fa"?_5e():d5e()}),m5e=()=>"Choose a coding agent",g5e=()=>"选择编程智能体",b5e=()=>"یک عامل کدنویسی انتخاب کنید",v5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?g5e():t==="fa"?b5e():m5e()}),x5e=()=>"Choose a coding agent to continue.",y5e=()=>"选择一个编程智能体以继续。",w5e=()=>"برای ادامه یک عامل کدنویسی انتخاب کنید.",S5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y5e():t==="fa"?w5e():x5e()}),k5e=()=>"Choose at least one research area to continue.",C5e=()=>"请至少选择一个研究领域后再继续。",E5e=()=>"برای ادامه دست‌کم یک حوزهٔ پژوهشی انتخاب کنید.",N5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?C5e():t==="fa"?E5e():k5e()}),z5e=()=>"Choose one or more.",j5e=()=>"请选择一项或多项。",T5e=()=>"یک یا چند مورد را انتخاب کنید.",A5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?j5e():t==="fa"?T5e():z5e()}),R5e=()=>"Choose your preferred coding agent",M5e=()=>"请选择首选编程智能体",L5e=()=>"عامل برنامه‌نویسی ترجیحی خود را انتخاب کنید",D5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?M5e():t==="fa"?L5e():R5e()}),O5e=()=>"Consolidate your research",I5e=()=>"集中管理研究",B5e=()=>"پژوهش خود را یکپارچه کنید",$5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?I5e():t==="fa"?B5e():O5e()}),P5e=()=>"Continue",H5e=()=>"继续",F5e=()=>"ادامه",U8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?H5e():t==="fa"?F5e():P5e()}),U5e=()=>"Describe your research area to continue.",q5e=()=>"请描述你的研究领域后再继续。",G5e=()=>"برای ادامه حوزهٔ پژوهشی خود را شرح دهید.",V5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q5e():t==="fa"?G5e():U5e()}),W5e=()=>"Detecting Claude Code, Codex, OpenCode…",K5e=()=>"正在检测 Claude Code、Codex、OpenCode…",Y5e=()=>"در حال شناسایی Claude Code، Codex و OpenCode…",X5e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?K5e():t==="fa"?Y5e():W5e()}),Z5e=()=>"e.g. I work on sample-efficient RL for LLM post-training, focused on reward-model-free methods.",Q5e=()=>"例如:我研究用于 LLM 后训练的样本高效强化学习,重点关注无需奖励模型的方法。",J5e=()=>"مثلاً روی یادگیری تقویتی کم‌نمونه برای پس‌آموزش LLM با تمرکز بر روش‌های بدون مدل پاداش کار می‌کنم.",e3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Q5e():t==="fa"?J5e():Z5e()}),t3e=()=>"Everything stays local",n3e=()=>"一切都保留在本地",r3e=()=>"همه‌چیز محلی می‌ماند",s3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?n3e():t==="fa"?r3e():t3e()}),i3e=()=>"Get started",a3e=()=>"开始使用",o3e=()=>"شروع",l3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?a3e():t==="fa"?o3e():i3e()}),c3e=()=>"Git is required for local experiments. Install Git, then re-check.",u3e=()=>"本地实验需要 Git。请安装 Git,然后重新检查。",f3e=()=>"Git برای آزمایش‌های محلی لازم است. آن را نصب و دوباره بررسی کنید.",d3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?u3e():t==="fa"?f3e():c3e()}),h3e=()=>"Ground your agents",_3e=()=>"为智能体提供可靠依据",p3e=()=>"عامل‌هایتان را به منابع متصل کنید",m3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_3e():t==="fa"?p3e():h3e()}),g3e=()=>"Install broken",b3e=()=>"安装损坏",v3e=()=>"نصب خراب است",x3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?b3e():t==="fa"?v3e():g3e()}),y3e=()=>"Install Git to continue",w3e=()=>"请安装 Git 后再继续",S3e=()=>"برای ادامه Git را نصب کنید",k3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?w3e():t==="fa"?S3e():y3e()}),C3e=()=>"Local Git",E3e=()=>"本地 Git",N3e=()=>"Git محلی",z3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?E3e():t==="fa"?N3e():C3e()}),j3e=()=>"Not detected",T3e=()=>"未检测到",A3e=()=>"شناسایی نشد",q8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?T3e():t==="fa"?A3e():j3e()}),R3e=()=>"Not found",M3e=()=>"未找到",L3e=()=>"پیدا نشد",AT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?M3e():t==="fa"?L3e():R3e()}),D3e=()=>"Not signed in",O3e=()=>"未登录",I3e=()=>"وارد نشده",B3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?O3e():t==="fa"?I3e():D3e()}),$3e=()=>"OpenResearch uses a coding agent already installed on this machine.",P3e=()=>"OpenResearch 使用这台计算机上已安装的编程智能体。",H3e=()=>"OpenResearch از عامل کدنویسی نصب‌شده روی این دستگاه استفاده می‌کند.",F3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?P3e():t==="fa"?H3e():$3e()}),U3e=()=>"Other research area",q3e=()=>"其他研究领域",G3e=()=>"حوزهٔ پژوهشی دیگر",V3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?q3e():t==="fa"?G3e():U3e()}),W3e=()=>"Re-check",K3e=()=>"重新检查",Y3e=()=>"بررسی دوباره",X3e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?K3e():t==="fa"?Y3e():W3e()}),Z3e=()=>"Ready",Q3e=()=>"已就绪",J3e=()=>"آماده",e6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Q3e():t==="fa"?J3e():Z3e()}),t6e=()=>"Re-check Git before continuing",n6e=()=>"请重新检查 Git 后再继续",r6e=()=>"پیش از ادامه Git را دوباره بررسی کنید",s6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?n6e():t==="fa"?r6e():t6e()}),i6e=()=>"Representative papers",a6e=()=>"代表性论文",o6e=()=>"مقاله‌های شاخص",l6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?a6e():t==="fa"?o6e():i6e()}),c6e=()=>"Research background",u6e=()=>"研究背景",f6e=()=>"پیشینهٔ پژوهشی",d6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?u6e():t==="fa"?f6e():c6e()}),h6e=()=>"Couldn’t reach orx. Check that it’s still running, then re-check.",_6e=()=>"无法连接到 orx。请确认它仍在运行,然后重新检查。",p6e=()=>"ارتباط با orx برقرار نشد. مطمئن شوید هنوز در حال اجراست و دوباره بررسی کنید.",G8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_6e():t==="fa"?p6e():h6e()}),m6e=()=>"Search alphaXiv by title to link a paper…",g6e=()=>"按标题搜索 alphaXiv 以关联论文…",b6e=()=>"برای پیوند مقاله، عنوان را در alphaXiv جست‌وجو کنید…",v6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?g6e():t==="fa"?b6e():m6e()}),x6e=()=>"Searching alphaXiv…",y6e=()=>"正在搜索 alphaXiv…",w6e=()=>"در حال جست‌وجوی alphaXiv…",S6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y6e():t==="fa"?w6e():x6e()}),k6e=()=>"Selected",C6e=()=>"已选择",E6e=()=>"انتخاب‌شده",N6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?C6e():t==="fa"?E6e():k6e()}),z6e=()=>"Setting things up…",j6e=()=>"正在设置…",T6e=()=>"در حال راه‌اندازی…",A6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?j6e():t==="fa"?T6e():z6e()}),R6e=()=>"Sign in to at least one coding agent to continue",M6e=()=>"请至少登录一个编程智能体后再继续",L6e=()=>"برای ادامه، وارد دست‌کم یک عامل برنامه‌نویسی شوید",D6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?M6e():t==="fa"?L6e():R6e()}),O6e=()=>"Sign in to at least one agent to continue.",I6e=()=>"请登录至少一个智能体以继续。",B6e=()=>"برای ادامه دست‌کم به یک عامل وارد شوید.",$6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?I6e():t==="fa"?B6e():O6e()}),P6e=()=>"Signed in",H6e=()=>"已登录",F6e=()=>"وارد شده",U6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?H6e():t==="fa"?F6e():P6e()}),q6e=()=>"Connected to alphaXiv, bioRxiv, and OpenAlex to ground your agents in the latest research.",G6e=()=>"已连接 alphaXiv、bioRxiv 和 OpenAlex,让智能体以最新研究为依据。",V6e=()=>"به alphaXiv، bioRxiv و OpenAlex متصل است تا عامل‌هایتان بر تازه‌ترین پژوهش‌ها تکیه کنند.",W6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?G6e():t==="fa"?V6e():q6e()}),K6e=()=>"· Step 1 of 2",Y6e=()=>"· 第 1 步,共 2 步",X6e=()=>"· مرحلهٔ ۱ از ۲",Z6e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Y6e():t==="fa"?X6e():K6e()}),Q6e=()=>"· Step 2 of 2",J6e=()=>"· 第 2 步,共 2 步",eSe=()=>"· مرحلهٔ ۲ از ۲",tSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?J6e():t==="fa"?eSe():Q6e()}),nSe=()=>"Tell us about your research",rSe=()=>"介绍一下你的研究",sSe=()=>"از پژوهش خود بگویید",iSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rSe():t==="fa"?sSe():nSe()}),aSe=()=>"Tell us your other research area",oSe=()=>"告诉我们你的其他研究领域",lSe=()=>"حوزهٔ پژوهشی دیگر خود را بنویسید",cSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oSe():t==="fa"?lSe():aSe()}),uSe=()=>"Track experiments, artifacts, compute, skills, and code all in one place.",fSe=()=>"在一处跟踪实验、产物、算力、技能和代码。",dSe=()=>"آزمایش‌ها، خروجی‌ها، رایانش، مهارت‌ها و کد را یک‌جا دنبال کنید.",hSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fSe():t==="fa"?dSe():uSe()}),_Se=()=>"Unable to verify",pSe=()=>"无法验证",mSe=()=>"تأیید ممکن نیست",gSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pSe():t==="fa"?mSe():_Se()}),bSe=()=>"Update required",vSe=()=>"需要更新",xSe=()=>"نیازمند به‌روزرسانی",ySe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vSe():t==="fa"?xSe():bSe()}),wSe=()=>"Waiting for the Git check",SSe=()=>"正在等待 Git 检查",kSe=()=>"در انتظار بررسی Git",CSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SSe():t==="fa"?kSe():wSe()}),ESe=()=>"Waiting for the local tool checks",NSe=()=>"正在等待本地工具检查",zSe=()=>"در انتظار بررسی ابزارهای محلی",jSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NSe():t==="fa"?zSe():ESe()}),TSe=()=>"What areas are you interested in?",ASe=()=>"你对哪些领域感兴趣?",RSe=()=>"به چه حوزه‌هایی علاقه دارید؟",MSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ASe():t==="fa"?RSe():TSe()}),LSe=()=>"Your code, data, and experiment history stay on your machine.",DSe=()=>"你的代码、数据和实验历史都保留在自己的计算机上。",OSe=()=>"کد، داده‌ها و تاریخچهٔ آزمایش شما روی رایانهٔ خودتان می‌ماند.",ISe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DSe():t==="fa"?OSe():LSe()}),BSe=()=>"Your selected agent is no longer ready. Go back to Step 1 and choose another.",$Se=()=>"所选智能体已无法使用。请返回第 1 步并选择其他智能体。",PSe=()=>"عامل انتخاب‌شده دیگر آماده نیست. به مرحلهٔ ۱ برگردید و عامل دیگری را انتخاب کنید.",HSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Se():t==="fa"?PSe():BSe()}),FSe=()=>"Changed here and on Overleaf — choose which copy to keep",USe=()=>"此处和 Overleaf 都有更改 — 请选择要保留的版本",qSe=()=>"هم اینجا و هم در Overleaf تغییر کرده است — نسخه‌ای را که می‌خواهید نگه دارید انتخاب کنید",GSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?USe():t==="fa"?qSe():FSe()}),VSe=()=>"Create a token ↗",WSe=()=>"创建令牌 ↗",KSe=()=>"ساخت توکن ↗",YSe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WSe():t==="fa"?KSe():VSe()}),XSe=()=>"Overleaf Git token",ZSe=()=>"Overleaf Git 令牌",QSe=()=>"توکن Git در Overleaf",V8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZSe():t==="fa"?QSe():XSe()}),JSe=()=>"In step with Overleaf",eke=()=>"已与 Overleaf 同步",tke=()=>"با Overleaf همگام است",RT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eke():t==="fa"?tke():JSe()}),nke=()=>"The last sync did not finish.",rke=()=>"上次同步未完成。",ske=()=>"آخرین همگام‌سازی کامل نشد.",ike=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rke():t==="fa"?ske():nke()}),ake=()=>"Link and sync",oke=()=>"关联并同步",lke=()=>"پیوند و همگام‌سازی",cke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oke():t==="fa"?lke():ake()}),uke=()=>"My projects ↗",fke=()=>"我的项目 ↗",dke=()=>"پروژه‌های من ↗",W8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fke():t==="fa"?dke():uke()}),hke=()=>"Nothing could be synced.",_ke=()=>"没有内容可以同步。",pke=()=>"هیچ موردی قابل همگام‌سازی نبود.",mke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_ke():t==="fa"?pke():hke()}),gke=()=>"Cancel",bke=()=>"取消",vke=()=>"لغو",xke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bke():t==="fa"?vke():gke()}),yke=()=>"changed here and on Overleaf. Both copies are untouched — choose which one to keep.",wke=()=>"在此处和 Overleaf 上均有更改。两个副本均未被修改——请选择要保留的版本。",Ske=()=>"هم اینجا و هم در Overleaf تغییر کرده است. هر دو نسخه دست‌نخورده‌اند — انتخاب کنید کدام نگه داشته شود.",kke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wke():t==="fa"?Ske():yke()}),Cke=()=>"Keep this copy",Eke=()=>"保留此副本",Nke=()=>"نگه داشتن این نسخه",zke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Eke():t==="fa"?Nke():Cke()}),jke=()=>"Open in Overleaf",Tke=()=>"在 Overleaf 中打开",Ake=()=>"باز کردن در Overleaf",Rke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tke():t==="fa"?Ake():jke()}),Mke=()=>"Replace the Overleaf token",Lke=()=>"替换 Overleaf 令牌",Dke=()=>"جایگزینی توکن Overleaf",K8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lke():t==="fa"?Dke():Mke()}),Oke=()=>"Sync now",Ike=()=>"立即同步",Bke=()=>"همگام‌سازی اکنون",$ke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ike():t==="fa"?Bke():Oke()}),Pke=()=>"Unlink",Hke=()=>"取消关联",Fke=()=>"قطع پیوند",Uke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hke():t==="fa"?Fke():Pke()}),qke=()=>"Upload a copy as a new project ↗",Gke=()=>"上传副本作为新项目 ↗",Vke=()=>"بارگذاری یک کپی به‌عنوان پروژهٔ جدید ↗",MT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Gke():t==="fa"?Vke():qke()}),Wke=()=>"Use Overleaf's",Kke=()=>"使用 Overleaf 的副本",Yke=()=>"استفاده از نسخهٔ Overleaf",Xke=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Kke():t==="fa"?Yke():Wke()}),Zke=()=>"This paper stays in step with Overleaf.",Qke=()=>"此论文将与 Overleaf 保持同步。",Jke=()=>"این مقاله با Overleaf همگام می‌ماند.",e7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qke():t==="fa"?Jke():Zke()}),t7e=e=>`Pulled ${e==null?void 0:e.paths}.`,n7e=e=>`已拉取 ${e==null?void 0:e.paths}。`,r7e=e=>`${e==null?void 0:e.paths} دریافت شد.`,s7e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?n7e(e):t==="fa"?r7e(e):t7e(e)}),i7e=e=>`Pulled ${e==null?void 0:e.pulled}; pushed ${e==null?void 0:e.pushed}.`,a7e=e=>`已拉取 ${e==null?void 0:e.pulled};已推送 ${e==null?void 0:e.pushed}。`,o7e=e=>`${e==null?void 0:e.pulled} دریافت و ${e==null?void 0:e.pushed} ارسال شد.`,l7e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?a7e(e):t==="fa"?o7e(e):i7e(e)}),c7e=e=>`Pushed ${e==null?void 0:e.paths}.`,u7e=e=>`已推送 ${e==null?void 0:e.paths}。`,f7e=e=>`${e==null?void 0:e.paths} ارسال شد.`,d7e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?u7e(e):t==="fa"?f7e(e):c7e(e)}),h7e=()=>"Save the file first",_7e=()=>"请先保存文件",p7e=()=>"ابتدا فایل را ذخیره کنید",m7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_7e():t==="fa"?p7e():h7e()}),g7e=()=>"Save this file to sync it with Overleaf",b7e=()=>"保存此文件以与 Overleaf 同步",v7e=()=>"برای همگام‌سازی با Overleaf این فایل را ذخیره کنید",LT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?b7e():t==="fa"?v7e():g7e()}),x7e=()=>"Save token",y7e=()=>"保存令牌",w7e=()=>"ذخیرهٔ توکن",S7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y7e():t==="fa"?w7e():x7e()}),k7e=()=>"Send this paper to Overleaf",C7e=()=>"将此论文发送到 Overleaf",E7e=()=>"ارسال مقاله به Overleaf",N7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?C7e():t==="fa"?E7e():k7e()}),z7e=()=>"Overleaf sync failed",j7e=()=>"Overleaf 同步失败",T7e=()=>"همگام‌سازی با Overleaf ناموفق بود",Py=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?j7e():t==="fa"?T7e():z7e()}),A7e=()=>"Syncing with Overleaf…",R7e=()=>"正在与 Overleaf 同步…",M7e=()=>"در حال همگام‌سازی با Overleaf…",DT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?R7e():t==="fa"?M7e():A7e()}),L7e=()=>"Paste an Overleaf Git authentication token to keep this paper in step with an Overleaf project. Create one in Overleaf under Account Settings — Git integration comes with a paid Overleaf plan.",D7e=()=>"粘贴 Overleaf Git 身份验证令牌,使此论文与 Overleaf 项目保持同步。请在 Overleaf 的“账户设置”中创建令牌 — Git 集成功能需要付费 Overleaf 套餐。",O7e=()=>"برای همگام نگه داشتن این مقاله با یک پروژهٔ Overleaf، توکن احراز هویت Git در Overleaf را جای‌گذاری کنید. آن را در بخش تنظیمات حساب Overleaf بسازید — یکپارچه‌سازی Git به طرح پولی Overleaf نیاز دارد.",I7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D7e():t==="fa"?O7e():L7e()}),B7e=()=>"Paste the URL of the Overleaf project this paper belongs to. Overleaf cannot create one over Git, so open or create the project there first.",$7e=()=>"粘贴此论文所属 Overleaf 项目的 URL。Overleaf 无法通过 Git 创建项目,因此请先在 Overleaf 中打开或创建项目。",P7e=()=>"نشانی پروژهٔ Overleaf مربوط به این مقاله را جای‌گذاری کنید. Overleaf نمی‌تواند پروژه را از طریق Git بسازد؛ پس ابتدا پروژه را در آنجا باز یا ایجاد کنید.",H7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$7e():t==="fa"?P7e():B7e()}),F7e=()=>"Toggle Plan mode for this chat",U7e=()=>"切换此聊天的计划模式",q7e=()=>"تغییر حالت طرح این گفت‌وگو",G7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?U7e():t==="fa"?q7e():F7e()}),V7e=()=>"Accept and auto mode",W7e=()=>"接受并使用自动模式",K7e=()=>"پذیرش و حالت خودکار",Y7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?W7e():t==="fa"?K7e():V7e()}),X7e=()=>"Accept and bypass all",Z7e=()=>"接受并跳过所有审批",Q7e=()=>"پذیرش و عبور از همهٔ تأییدها",J7e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Z7e():t==="fa"?Q7e():X7e()}),e8e=()=>"Accept plan",t8e=()=>"接受计划",n8e=()=>"پذیرش طرح",r8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?t8e():t==="fa"?n8e():e8e()}),s8e=e=>`${e==null?void 0:e.agent} proposed a plan`,i8e=e=>`${e==null?void 0:e.agent} 提出了一个计划`,a8e=e=>`طرح پیشنهادیِ ${e==null?void 0:e.agent}`,o8e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?i8e(e):t==="fa"?a8e(e):s8e(e)}),l8e=e=>`${e==null?void 0:e.agent} is ready to proceed`,c8e=e=>`${e==null?void 0:e.agent} 已准备好继续`,u8e=e=>`طرحِ ${e==null?void 0:e.agent} آمادهٔ ادامه است`,f8e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?c8e(e):t==="fa"?u8e(e):l8e(e)}),d8e=()=>"Back",h8e=()=>"返回",_8e=()=>"بازگشت",p8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?h8e():t==="fa"?_8e():d8e()}),m8e=()=>"More approval options",g8e=()=>"更多批准选项",b8e=()=>"گزینه‌های تأیید بیشتر",v8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?g8e():t==="fa"?b8e():m8e()}),x8e=()=>"Open plan",y8e=()=>"打开计划",w8e=()=>"باز کردن طرح",S8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?y8e():t==="fa"?w8e():x8e()}),k8e=()=>"Reject",C8e=()=>"拒绝",E8e=()=>"رد کردن",N8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?C8e():t==="fa"?E8e():k8e()}),z8e=()=>"Revise",j8e=()=>"修改",T8e=()=>"بازنگری",A8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?j8e():t==="fa"?T8e():z8e()}),R8e=()=>"Revise…",M8e=()=>"修改…",L8e=()=>"بازنگری…",D8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?M8e():t==="fa"?L8e():R8e()}),O8e=()=>"What should change? (optional)",I8e=()=>"需要更改什么?(可选)",B8e=()=>"چه چیزی باید تغییر کند؟ (اختیاری)",$8e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?I8e():t==="fa"?B8e():O8e()}),P8e=e=>`${e==null?void 0:e.count} active`,H8e=e=>`${e==null?void 0:e.count} 个活跃`,F8e=e=>`${e==null?void 0:e.count} فعال`,U8e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?H8e(e):t==="fa"?F8e(e):P8e(e)}),q8e=e=>`${e==null?void 0:e.count} total agents`,G8e=e=>`共 ${e==null?void 0:e.count} 个智能体`,V8e=e=>`در مجموع ${e==null?void 0:e.count} عامل`,W8e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?G8e(e):t==="fa"?V8e(e):q8e(e)}),K8e=e=>`Delete ${e==null?void 0:e.name} from OpenResearch? Its experiments, runs, and chats will be permanently removed.`,Y8e=e=>`从 OpenResearch 中删除 ${e==null?void 0:e.name}?其实验、运行和聊天将被永久移除。`,X8e=e=>`${e==null?void 0:e.name} از OpenResearch حذف شود؟ آزمایش‌ها، اجراها و گفتگوهای آن برای همیشه حذف می‌شوند.`,Z8e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Y8e(e):t==="fa"?X8e(e):K8e(e)}),Q8e=()=>"Agents",J8e=()=>"智能体",eCe=()=>"عامل‌ها",Y8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?J8e():t==="fa"?eCe():Q8e()}),tCe=()=>"arXiv paper ID:",nCe=()=>"arXiv 论文 ID:",rCe=()=>"شناسهٔ مقالهٔ arXiv:",sCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nCe():t==="fa"?rCe():tCe()}),iCe=()=>"Cancel",aCe=()=>"取消",oCe=()=>"لغو",lCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aCe():t==="fa"?oCe():iCe()}),cCe=()=>"Created",uCe=()=>"创建时间",fCe=()=>"ایجادشده",dCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uCe():t==="fa"?fCe():cCe()}),hCe=()=>"Delete project?",_Ce=()=>"删除项目?",pCe=()=>"پروژه حذف شود؟",mCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Ce():t==="fa"?pCe():hCe()}),gCe=()=>"Delete project",bCe=()=>"删除项目",vCe=()=>"حذف پروژه",xCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bCe():t==="fa"?vCe():gCe()}),yCe=()=>"Deleting…",wCe=()=>"正在删除…",SCe=()=>"در حال حذف…",kCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wCe():t==="fa"?SCe():yCe()}),CCe=()=>"Experiments",ECe=()=>"实验",NCe=()=>"آزمایش‌ها",X8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ECe():t==="fa"?NCe():CCe()}),zCe=()=>"The local folder and linked GitHub repository are kept.",jCe=()=>"本地文件夹和已关联的 GitHub 仓库都会保留。",TCe=()=>"پوشهٔ محلی و مخزن پیوندشدهٔ GitHub نگه داشته می‌شوند.",ACe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jCe():t==="fa"?TCe():zCe()}),RCe=()=>"The local folder is kept.",MCe=()=>"本地文件夹会保留。",LCe=()=>"پوشهٔ محلی نگه داشته می‌شود.",DCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MCe():t==="fa"?LCe():RCe()}),OCe=()=>"New project",ICe=()=>"新建项目",BCe=()=>"پروژهٔ جدید",OT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ICe():t==="fa"?BCe():OCe()}),$Ce=()=>"No projects yet — create one to get started.",PCe=()=>"尚无项目——新建一个即可开始。",HCe=()=>"هنوز پروژه‌ای نیست — برای شروع یکی بسازید.",FCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PCe():t==="fa"?HCe():$Ce()}),UCe=()=>"Project",qCe=()=>"项目",GCe=()=>"پروژه",VCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qCe():t==="fa"?GCe():UCe()}),WCe=()=>"Projects",KCe=()=>"项目",YCe=()=>"پروژه‌ها",XCe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KCe():t==="fa"?YCe():WCe()}),ZCe=()=>"Repository",QCe=()=>"仓库",JCe=()=>"مخزن",Z8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QCe():t==="fa"?JCe():ZCe()}),e9e=()=>"Idle",t9e=()=>"空闲",n9e=()=>"بیکار",r9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?t9e():t==="fa"?n9e():e9e()}),s9e=()=>"Local",i9e=()=>"本地",a9e=()=>"محلی",IT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?i9e():t==="fa"?a9e():s9e()}),o9e=()=>"1 total agent",l9e=()=>"共 1 个智能体",c9e=()=>"در مجموع ۱ عامل",u9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?l9e():t==="fa"?c9e():o9e()}),f9e=e=>`${e==null?void 0:e.count} running`,d9e=e=>`${e==null?void 0:e.count} 个运行中`,h9e=e=>`${e==null?void 0:e.count} در حال اجرا`,_9e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?d9e(e):t==="fa"?h9e(e):f9e(e)}),p9e=e=>`${e==null?void 0:e.count} total`,m9e=e=>`共 ${e==null?void 0:e.count} 个`,g9e=e=>`در مجموع ${e==null?void 0:e.count}`,Q8=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?m9e(e):t==="fa"?g9e(e):p9e(e)}),b9e=e=>`${e==null?void 0:e.value}d`,v9e=e=>`${e==null?void 0:e.value} 天`,x9e=e=>`${e==null?void 0:e.value}ر`,y9e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?v9e(e):t==="fa"?x9e(e):b9e(e)}),w9e=e=>`${e==null?void 0:e.value}h`,S9e=e=>`${e==null?void 0:e.value} 小时`,k9e=e=>`${e==null?void 0:e.value}س`,C9e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?S9e(e):t==="fa"?k9e(e):w9e(e)}),E9e=e=>`${e==null?void 0:e.value}m`,N9e=e=>`${e==null?void 0:e.value} 分钟`,z9e=e=>`${e==null?void 0:e.value}د`,j9e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?N9e(e):t==="fa"?z9e(e):E9e(e)}),T9e=()=>"now",A9e=()=>"现在",R9e=()=>"اکنون",M9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A9e():t==="fa"?R9e():T9e()}),L9e=()=>"Installing the compatible binary. This may take a few minutes.",D9e=()=>"正在安装兼容的二进制文件。这可能需要几分钟。",O9e=()=>"در حال نصب فایل اجرایی سازگار. این کار ممکن است چند دقیقه طول بکشد.",I9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D9e():t==="fa"?O9e():L9e()}),B9e=e=>`Setting up OpenResearch on ${e==null?void 0:e.host}`,$9e=e=>`正在设置 ${e==null?void 0:e.host} 上的 OpenResearch`,P9e=e=>`در حال راه‌اندازی OpenResearch روی ${e==null?void 0:e.host}`,H9e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?$9e(e):t==="fa"?P9e(e):B9e(e)}),F9e=()=>"Check again",U9e=()=>"再次检查",q9e=()=>"بررسی دوباره",J8=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?U9e():t==="fa"?q9e():F9e()}),G9e=()=>"Closing…",V9e=()=>"正在关闭…",W9e=()=>"در حال بستن…",K9e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?V9e():t==="fa"?W9e():G9e()}),Y9e=e=>`Connected to ${e==null?void 0:e.host} as ${e==null?void 0:e.user}`,X9e=e=>`已以 ${e==null?void 0:e.user} 身份连接到 ${e==null?void 0:e.host}`,Z9e=e=>`اتصال به ${e==null?void 0:e.host} با کاربر ${e==null?void 0:e.user}`,Q9e=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?X9e(e):t==="fa"?Z9e(e):Y9e(e)}),J9e=()=>"Preparing your remote workspace…",eEe=()=>"正在准备远程工作区…",tEe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",nEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eEe():t==="fa"?tEe():J9e()}),rEe=e=>`Connecting to ${e==null?void 0:e.host}`,sEe=e=>`正在连接到 ${e==null?void 0:e.host}`,iEe=e=>`در حال اتصال به ${e==null?void 0:e.host}`,aEe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?sEe(e):t==="fa"?iEe(e):rEe(e)}),oEe=()=>"Close remote host picker",lEe=()=>"关闭远程主机选择器",cEe=()=>"بستن انتخاب‌گر میزبان راه‌دور",uEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lEe():t==="fa"?cEe():oEe()}),fEe=()=>"Choose a configured SSH host.",dEe=()=>"选择已配置的 SSH 主机。",hEe=()=>"یک میزبان SSH پیکربندی‌شده انتخاب کنید.",_Ee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dEe():t==="fa"?hEe():fEe()}),pEe=()=>"Connect to remote",mEe=()=>"连接到远程主机",gEe=()=>"اتصال به میزبان راه‌دور",BT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mEe():t==="fa"?gEe():pEe()}),bEe=()=>"Disconnect",vEe=()=>"断开连接",xEe=()=>"قطع اتصال",Hy=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vEe():t==="fa"?xEe():bEe()}),yEe=()=>"Your remote work is still running. Reconnect when you’re ready.",wEe=()=>"你的远程工作仍在运行。准备好后可以重新连接。",SEe=()=>"کار راه‌دور شما همچنان در حال اجرا است. هر زمان آماده بودید دوباره متصل شوید.",kEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wEe():t==="fa"?SEe():yEe()}),CEe=e=>`Disconnected from ${e==null?void 0:e.host}`,EEe=e=>`已断开与 ${e==null?void 0:e.host} 的连接`,NEe=e=>`اتصال به ${e==null?void 0:e.host} قطع شد`,$T=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?EEe(e):t==="fa"?NEe(e):CEe(e)}),zEe=e=>`Could not connect to ${e==null?void 0:e.host}`,jEe=e=>`无法连接到 ${e==null?void 0:e.host}`,TEe=e=>`اتصال به ${e==null?void 0:e.host} ممکن نشد`,AEe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?jEe(e):t==="fa"?TEe(e):zEe(e)}),REe=()=>"Restart local OpenResearch and select this SSH host again. Work on the remote host continues.",MEe=()=>"请重新启动本地 OpenResearch 并再次选择此 SSH 主机。远程主机上的工作仍在继续。",LEe=()=>"OpenResearch محلی را دوباره راه‌اندازی کنید و این میزبان SSH را دوباره انتخاب کنید. کار روی میزبان راه‌دور ادامه دارد.",DEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MEe():t==="fa"?LEe():REe()}),OEe=()=>"OpenResearch agents have stopped. Submitted experiments may still be running.",IEe=()=>"OpenResearch 智能体已停止。已提交的实验可能仍在运行。",BEe=()=>"عامل‌های OpenResearch متوقف شده‌اند. آزمایش‌های ارسال‌شده ممکن است همچنان در حال اجرا باشند.",$Ee=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IEe():t==="fa"?BEe():OEe()}),PEe=e=>`OpenResearch is not running on ${e==null?void 0:e.host}`,HEe=e=>`OpenResearch 未在 ${e==null?void 0:e.host} 上运行`,FEe=e=>`OpenResearch روی ${e==null?void 0:e.host} در حال اجرا نیست`,UEe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?HEe(e):t==="fa"?FEe(e):PEe(e)}),qEe=()=>"OpenResearch binary",GEe=()=>"OpenResearch 二进制文件",VEe=()=>"فایل اجرایی OpenResearch",WEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GEe():t==="fa"?VEe():qEe()}),KEe=()=>"Repository cache",YEe=()=>"仓库缓存",XEe=()=>"حافظهٔ نهان مخزن",ZEe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YEe():t==="fa"?XEe():KEe()}),QEe=()=>"OpenResearch Database",JEe=()=>"OpenResearch 数据库",eNe=()=>"پایگاه دادهٔ OpenResearch",tNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JEe():t==="fa"?eNe():QEe()}),nNe=()=>"OpenResearch will use these locations for your remote SSH user and does not require sudo.",rNe=()=>"OpenResearch 将为你的远程 SSH 用户使用以下位置,无需 sudo。",sNe=()=>"OpenResearch از این مسیرها برای کاربر SSH راه‌دور شما استفاده می‌کند و به sudo نیاز ندارد.",iNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rNe():t==="fa"?sNe():nNe()}),aNe=()=>"Install OpenResearch?",oNe=()=>"安装 OpenResearch?",lNe=()=>"OpenResearch نصب شود؟",cNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oNe():t==="fa"?lNe():aNe()}),uNe=()=>"Installing…",fNe=()=>"正在安装…",dNe=()=>"در حال نصب…",hNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fNe():t==="fa"?dNe():uNe()}),_Ne=()=>"No matching SSH hosts",pNe=()=>"没有匹配的 SSH 主机",mNe=()=>"میزبان SSH منطبقی پیدا نشد",gNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pNe():t==="fa"?mNe():_Ne()}),bNe=e=>`OpenResearch is not installed for ${e==null?void 0:e.user} on ${e==null?void 0:e.host}. Install it now?`,vNe=e=>`${e==null?void 0:e.user} 尚未在 ${e==null?void 0:e.host} 上安装 OpenResearch。现在安装吗?`,xNe=e=>`OpenResearch برای ${e==null?void 0:e.user} روی ${e==null?void 0:e.host} نصب نیست. اکنون نصب شود؟`,yNe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?vNe(e):t==="fa"?xNe(e):bNe(e)}),wNe=()=>"Open remote",SNe=()=>"打开远程工作区",kNe=()=>"باز کردن راه‌دور",CNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SNe():t==="fa"?kNe():wNe()}),ENe=()=>"Closing this tab or disconnecting leaves agents and experiments running. Approval requests remain pending for up to 55 minutes. A host restart or administrator policy may stop OpenResearch.",NNe=()=>"关闭此标签页或断开连接后,代理和实验仍会继续运行。审批请求最多保持待处理 55 分钟。主机重启或管理员策略可能会停止 OpenResearch。",zNe=()=>"بستن این زبانه یا قطع اتصال، عامل‌ها و آزمایش‌ها را در حال اجرا نگه می‌دارد. درخواست‌های تأیید تا ۵۵ دقیقه در انتظار می‌مانند. راه‌اندازی مجدد میزبان یا سیاست مدیر ممکن است OpenResearch را متوقف کند.",jNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NNe():t==="fa"?zNe():ENe()}),TNe=()=>"Your browser blocked the remote workspace tab. Allow pop-ups and try again.",ANe=()=>"浏览器阻止了远程工作区标签页。请允许弹出窗口后重试。",RNe=()=>"مرورگر زبانهٔ فضای کاری راه‌دور را مسدود کرد. پنجره‌های بازشو را مجاز کنید و دوباره تلاش کنید.",MNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ANe():t==="fa"?RNe():TNe()}),LNe=()=>"Preparing remote workspace…",DNe=()=>"正在准备远程工作区…",ONe=()=>"در حال آماده‌سازی فضای کاری راه‌دور…",INe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DNe():t==="fa"?ONe():LNe()}),BNe=()=>"Reconnect",$Ne=()=>"重新连接",PNe=()=>"اتصال دوباره",eC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Ne():t==="fa"?PNe():BNe()}),HNe=()=>"The connection dropped. Your remote work remains running while OpenResearch reconnects.",FNe=()=>"连接已中断。OpenResearch 重新连接期间,你的远程工作仍会继续运行。",UNe=()=>"اتصال قطع شد. هنگام اتصال دوبارهٔ OpenResearch، کار راه‌دور شما همچنان اجرا می‌شود.",qNe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FNe():t==="fa"?UNe():HNe()}),GNe=e=>`Reconnecting to ${e==null?void 0:e.host}`,VNe=e=>`正在重新连接到 ${e==null?void 0:e.host}`,WNe=e=>`در حال اتصال دوباره به ${e==null?void 0:e.host}`,KNe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?VNe(e):t==="fa"?WNe(e):GNe(e)}),YNe=()=>"Search SSH hosts",XNe=()=>"搜索 SSH 主机",ZNe=()=>"جستجوی میزبان‌های SSH",tC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XNe():t==="fa"?ZNe():YNe()}),QNe=e=>`SSH: ${e==null?void 0:e.host}`,JNe=e=>`SSH:${e==null?void 0:e.host}`,eze=e=>`SSH: ${e==null?void 0:e.host}`,ix=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?JNe(e):t==="fa"?eze(e):QNe(e)}),tze=()=>"Start a new OpenResearch host",nze=()=>"启动新的 OpenResearch 主机",rze=()=>"راه‌اندازی میزبان جدید OpenResearch",sze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nze():t==="fa"?rze():tze()}),ize=e=>`End ${e==null?void 0:e.count} pending approvals.`,aze=e=>`结束 ${e==null?void 0:e.count} 个待审批请求。`,oze=e=>`${e==null?void 0:e.count} تأیید در انتظار را پایان می‌دهد.`,lze=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?aze(e):t==="fa"?oze(e):ize(e)}),cze=()=>"Stop OpenResearch",uze=()=>"停止 OpenResearch",fze=()=>"توقف OpenResearch",dze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uze():t==="fa"?fze():cze()}),hze=e=>`Stop OpenResearch on ${e==null?void 0:e.host}?`,_ze=e=>`停止 ${e==null?void 0:e.host} 上的 OpenResearch?`,pze=e=>`OpenResearch روی ${e==null?void 0:e.host} متوقف شود؟`,mze=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_ze(e):t==="fa"?pze(e):hze(e)}),gze=e=>`Leave ${e==null?void 0:e.count} submitted experiments running.`,bze=e=>`让 ${e==null?void 0:e.count} 个已提交实验继续运行。`,vze=e=>`${e==null?void 0:e.count} آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.`,xze=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?bze(e):t==="fa"?vze(e):gze(e)}),yze=()=>"Stop OpenResearch on host",wze=()=>"停止主机上的 OpenResearch",Sze=()=>"توقف OpenResearch روی میزبان",PT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wze():t==="fa"?Sze():yze()}),kze=()=>"This will also:",Cze=()=>"这还将:",Eze=()=>"این کار همچنین:",Nze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Cze():t==="fa"?Eze():kze()}),zze=()=>"End 1 pending approval.",jze=()=>"结束 1 个待审批请求。",Tze=()=>"۱ تأیید در انتظار را پایان می‌دهد.",Aze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jze():t==="fa"?Tze():zze()}),Rze=()=>"Leave 1 submitted experiment running.",Mze=()=>"让 1 个已提交实验继续运行。",Lze=()=>"۱ آزمایش ارسال‌شده را در حال اجرا نگه می‌دارد.",Dze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Mze():t==="fa"?Lze():Rze()}),Oze=()=>"Disconnect 1 other client.",Ize=()=>"断开 1 个其他客户端。",Bze=()=>"اتصال ۱ کارخواه دیگر را قطع می‌کند.",$ze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ize():t==="fa"?Bze():Oze()}),Pze=()=>"Keep 1 queued message saved.",Hze=()=>"保留 1 条排队消息。",Fze=()=>"۱ پیام در صف را ذخیره نگه می‌دارد.",Uze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Hze():t==="fa"?Fze():Pze()}),qze=()=>"Interrupt 1 active agent turn.",Gze=()=>"中断 1 个活动代理任务。",Vze=()=>"۱ نوبت فعال عامل را قطع می‌کند.",Wze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Gze():t==="fa"?Vze():qze()}),Kze=e=>`Disconnect ${e==null?void 0:e.count} other clients.`,Yze=e=>`断开 ${e==null?void 0:e.count} 个其他客户端。`,Xze=e=>`اتصال ${e==null?void 0:e.count} کارخواه دیگر را قطع می‌کند.`,Zze=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Yze(e):t==="fa"?Xze(e):Kze(e)}),Qze=e=>`Keep ${e==null?void 0:e.count} queued messages saved.`,Jze=e=>`保留 ${e==null?void 0:e.count} 条排队消息。`,eje=e=>`${e==null?void 0:e.count} پیام در صف را ذخیره نگه می‌دارد.`,tje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Jze(e):t==="fa"?eje(e):Qze(e)}),nje=e=>`Interrupt ${e==null?void 0:e.count} active agent turns.`,rje=e=>`中断 ${e==null?void 0:e.count} 个活动代理任务。`,sje=e=>`${e==null?void 0:e.count} نوبت فعال عامل را قطع می‌کند.`,ije=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?rje(e):t==="fa"?sje(e):nje(e)}),aje=()=>"Stopping host…",oje=()=>"正在停止主机…",lje=()=>"در حال توقف میزبان…",cje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oje():t==="fa"?lje():aje()}),uje=()=>"Update",fje=()=>"更新",dje=()=>"به‌روزرسانی",nC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fje():t==="fa"?dje():uje()}),hje=e=>`The OpenResearch installation on ${e==null?void 0:e.host} is not compatible with this dashboard. Update it now?`,_je=e=>`${e==null?void 0:e.host} 上的 OpenResearch 与此仪表板不兼容。现在更新吗?`,pje=e=>`نسخهٔ OpenResearch روی ${e==null?void 0:e.host} با این داشبورد سازگار نیست. اکنون به‌روزرسانی شود؟`,mje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_je(e):t==="fa"?pje(e):hje(e)}),gje=()=>"Update OpenResearch?",bje=()=>"更新 OpenResearch?",vje=()=>"OpenResearch به‌روزرسانی شود؟",xje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bje():t==="fa"?vje():gje()}),yje=()=>"Updating…",wje=()=>"正在更新…",Sje=()=>"در حال به‌روزرسانی…",kje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wje():t==="fa"?Sje():yje()}),Cje=()=>"Disable syncing",Eje=()=>"关闭同步",Nje=()=>"غیرفعال کردن همگام‌سازی",zje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Eje():t==="fa"?Nje():Cje()}),jje=()=>"Enable GitHub syncing",Tje=()=>"启用 GitHub 同步",Aje=()=>"فعال‌سازی همگام‌سازی GitHub",Rje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Tje():t==="fa"?Aje():jje()}),Mje=()=>"Enabling…",Lje=()=>"正在启用…",Dje=()=>"در حال فعال‌سازی…",Oje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Lje():t==="fa"?Dje():Mje()}),Ije=()=>"Updating…",Bje=()=>"正在更新…",$je=()=>"در حال به‌روزرسانی…",Pje=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Bje():t==="fa"?$je():Ije()}),Hje=e=>`Retrying · attempt ${e==null?void 0:e.attempt}`,Fje=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次`,Uje=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt}`,qje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Fje(e):t==="fa"?Uje(e):Hje(e)}),Gje=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum}`,Vje=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次`,Wje=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum}`,Kje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Vje(e):t==="fa"?Wje(e):Gje(e)}),Yje=e=>`Retrying · attempt ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} · next attempt in ${e==null?void 0:e.seconds}s`,Xje=e=>`正在重试 · 第 ${e==null?void 0:e.attempt}/${e==null?void 0:e.maximum} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,Zje=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} از ${e==null?void 0:e.maximum} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,Qje=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?Xje(e):t==="fa"?Zje(e):Yje(e)}),Jje=e=>`Retrying · attempt ${e==null?void 0:e.attempt} · next attempt in ${e==null?void 0:e.seconds}s`,eTe=e=>`正在重试 · 第 ${e==null?void 0:e.attempt} 次 · ${e==null?void 0:e.seconds} 秒后再次尝试`,tTe=e=>`در حال تلاش دوباره · تلاش ${e==null?void 0:e.attempt} · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,nTe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?eTe(e):t==="fa"?tTe(e):Jje(e)}),rTe=()=>"CLI is retrying…",sTe=()=>"CLI 正在重试…",iTe=()=>"CLI در حال تلاش دوباره است…",aTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sTe():t==="fa"?iTe():rTe()}),oTe=e=>`Retrying · next attempt in ${e==null?void 0:e.seconds}s`,lTe=e=>`正在重试 · ${e==null?void 0:e.seconds} 秒后再次尝试`,cTe=e=>`در حال تلاش دوباره · تلاش بعدی تا ${e==null?void 0:e.seconds} ثانیه`,uTe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?lTe(e):t==="fa"?cTe(e):oTe(e)}),fTe=()=>"Sending again…",dTe=()=>"正在重新发送…",hTe=()=>"در حال ارسال دوباره…",_Te=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dTe():t==="fa"?hTe():fTe()}),pTe=e=>`Sending again in ${e==null?void 0:e.seconds}s…`,mTe=e=>`将在 ${e==null?void 0:e.seconds} 秒后重新发送…`,gTe=e=>`ارسال دوباره تا ${e==null?void 0:e.seconds} ثانیه…`,bTe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?mTe(e):t==="fa"?gTe(e):pTe(e)}),vTe=()=>"Retrying…",xTe=()=>"正在重试…",yTe=()=>"در حال تلاش دوباره…",HT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xTe():t==="fa"?yTe():vTe()}),wTe=()=>"Default speed",STe=()=>"默认速度",kTe=()=>"سرعت پیش‌فرض",CTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?STe():t==="fa"?kTe():wTe()}),ETe=()=>"Standard",NTe=()=>"标准",zTe=()=>"استاندارد",jTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NTe():t==="fa"?zTe():ETe()}),TTe=e=>` Add ${e==null?void 0:e.directory} to your PATH to use it.`,ATe=e=>` 请将 ${e==null?void 0:e.directory} 添加到 PATH 后使用。`,RTe=e=>` برای استفاده، ${e==null?void 0:e.directory} را به PATH اضافه کنید.`,MTe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ATe(e):t==="fa"?RTe(e):TTe(e)}),LTe=()=>"Appearance",DTe=()=>"外观",OTe=()=>"ظاهر",ITe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DTe():t==="fa"?OTe():LTe()}),BTe=()=>"Check",$Te=()=>"检查",PTe=()=>"بررسی",HTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Te():t==="fa"?PTe():BTe()}),FTe=()=>"Check again",UTe=()=>"再次检查",qTe=()=>"بررسی دوباره",V_=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UTe():t==="fa"?qTe():FTe()}),GTe=()=>"Check for updates",VTe=()=>"检查更新",WTe=()=>"بررسی به‌روزرسانی",KTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VTe():t==="fa"?WTe():GTe()}),YTe=()=>"Check now",XTe=()=>"立即检查",ZTe=()=>"اکنون بررسی کن",QTe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XTe():t==="fa"?ZTe():YTe()}),JTe=()=>"Check setup",eAe=()=>"检查设置",tAe=()=>"بررسی راه‌اندازی",nAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eAe():t==="fa"?tAe():JTe()}),rAe=()=>"orx checks a few times a day on its own.",sAe=()=>"orx 每天会自动检查几次。",iAe=()=>"orx روزی چند بار خودکار بررسی می‌کند.",aAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sAe():t==="fa"?iAe():rAe()}),oAe=()=>"Choose a flavor",lAe=()=>"选择配置",cAe=()=>"انتخاب پیکربندی",uAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lAe():t==="fa"?cAe():oAe()}),fAe=e=>`Choose a flavor to use ${e==null?void 0:e.destination} for new runs.`,dAe=e=>`请选择一个配置,以便新运行使用${e==null?void 0:e.destination}。`,hAe=e=>`برای اجرای کارهای جدید روی ${e==null?void 0:e.destination} یک پیکربندی انتخاب کنید.`,_Ae=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?dAe(e):t==="fa"?hAe(e):fAe(e)}),pAe=()=>"clean",mAe=()=>"无更改",gAe=()=>"بدون تغییر",bAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mAe():t==="fa"?gAe():pAe()}),vAe=e=>`Already linked at ${e==null?void 0:e.link}.`,xAe=e=>`已链接到 ${e==null?void 0:e.link}。`,yAe=e=>`از قبل در ${e==null?void 0:e.link} پیوند شده است.`,wAe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?xAe(e):t==="fa"?yAe(e):vAe(e)}),SAe=e=>`Linked ${e==null?void 0:e.link}.`,kAe=e=>`已链接 ${e==null?void 0:e.link}。`,CAe=e=>`${e==null?void 0:e.link} پیوند شد.`,EAe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?kAe(e):t==="fa"?CAe(e):SAe(e)}),NAe=()=>"Connect",zAe=()=>"连接",jAe=()=>"اتصال",Xw=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zAe():t==="fa"?jAe():NAe()}),TAe=()=>"Connected via GitHub CLI",AAe=()=>"已通过 GitHub CLI 连接",RAe=()=>"از طریق GitHub CLI متصل است",FT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AAe():t==="fa"?RAe():TAe()}),MAe=()=>"Connecting…",LAe=()=>"正在连接…",DAe=()=>"در حال اتصال…",UT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LAe():t==="fa"?DAe():MAe()}),OAe=e=>`CPU cores: ${e==null?void 0:e.count}`,IAe=e=>`${e==null?void 0:e.count} 个 CPU 核心`,BAe=e=>`${e==null?void 0:e.count} هستهٔ CPU`,$Ae=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?IAe(e):t==="fa"?BAe(e):OAe(e)}),PAe=()=>"Create a private repository and automatically push experiment branches for collaborator visibility.",HAe=()=>"创建私有仓库,并自动推送实验分支以便协作者查看。",FAe=()=>"یک مخزن خصوصی بسازید و شاخه‌های آزمایش را برای مشاهدهٔ همکاران به‌طور خودکار پوش کنید.",UAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HAe():t==="fa"?FAe():PAe()}),qAe=()=>"the current project",GAe=()=>"当前项目",VAe=()=>"پروژهٔ فعلی",WAe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GAe():t==="fa"?VAe():qAe()}),KAe=e=>`${e==null?void 0:e.value} (custom)`,YAe=e=>`${e==null?void 0:e.value}(自定义)`,XAe=e=>`${e==null?void 0:e.value} (سفارشی)`,ZAe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?YAe(e):t==="fa"?XAe(e):KAe(e)}),QAe=()=>"detached",JAe=()=>"分离头指针",eRe=()=>"جدا از شاخه",qT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JAe():t==="fa"?eRe():QAe()}),tRe=()=>"Disconnected",nRe=()=>"已断开连接",rRe=()=>"قطع اتصال",GT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nRe():t==="fa"?rRe():tRe()}),sRe=()=>"Environment tab",iRe=()=>"环境标签页",aRe=()=>"زبانهٔ محیط",oRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iRe():t==="fa"?aRe():sRe()}),lRe=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,cRe=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,uRe=e=>`${e==null?void 0:e.branch} · ${e==null?void 0:e.state}`,fRe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cRe(e):t==="fa"?uRe(e):lRe(e)}),dRe=()=>"GitHub rejected the push because this repository is archived and read-only. The local project is still available. Unarchive the repository on GitHub, then enable syncing here.",hRe=()=>"GitHub 拒绝了推送,因为此仓库已归档且为只读。你的本地项目仍然可用。请在 GitHub 上取消归档该仓库,然后在此处启用同步。",_Re=()=>"GitHub پوش را نپذیرفت، چون این مخزن بایگانی‌شده و فقط‌خواندنی است. پروژهٔ محلی همچنان در دسترس است. مخزن را در GitHub از بایگانی خارج کنید و سپس همگام‌سازی را اینجا فعال کنید.",pRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hRe():t==="fa"?_Re():dRe()}),mRe=()=>"GitHub contains changes that are not in this local project. Pull the latest GitHub changes and resolve any conflicts in Git, then try enabling syncing again.",gRe=()=>"GitHub 上有本地项目中不存在的更改。请拉取 GitHub 上的最新更改,在 Git 中解决冲突,然后再次尝试启用同步。",bRe=()=>"GitHub تغییراتی دارد که در پروژهٔ محلی نیست. تازه‌ترین تغییرات GitHub را دریافت و تعارض‌ها را در Git حل کنید، سپس دوباره همگام‌سازی را فعال کنید.",vRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gRe():t==="fa"?bRe():mRe()}),xRe=()=>"GitHub rejected the push. Make sure your connected account has write access to this repository, then try again.",yRe=()=>"GitHub 拒绝了推送。请确认已连接的账户对此仓库有写入权限,然后重试。",wRe=()=>"GitHub پوش را نپذیرفت. مطمئن شوید حساب متصل اجازهٔ نوشتن در این مخزن را دارد و دوباره تلاش کنید.",SRe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yRe():t==="fa"?wRe():xRe()}),kRe=e=>`GPU × ${e==null?void 0:e.count}`,CRe=e=>`${e==null?void 0:e.count} 个 GPU`,ERe=e=>`${e==null?void 0:e.count} پردازندهٔ گرافیکی`,NRe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?CRe(e):t==="fa"?ERe(e):kRe(e)}),zRe=()=>"has changes",jRe=()=>"有更改",TRe=()=>"دارای تغییر",ARe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jRe():t==="fa"?TRe():zRe()}),RRe=e=>`This token is valid but does not report whether it can launch Jobs; OAuth tokens from ${e==null?void 0:e.login} never do. Launches may still work. For a definitive check, save a write-scoped token from ${e==null?void 0:e.url}.`,MRe=e=>`此令牌有效,但不会报告能否启动 Jobs;来自 ${e==null?void 0:e.login} 的 OAuth 令牌从不提供该信息。启动仍可能成功。如需最终确认,请从 ${e==null?void 0:e.url} 保存具有写入权限的令牌。`,LRe=e=>`این توکن معتبر است، اما مشخص نمی‌کند که می‌تواند Jobs را اجرا کند؛ توکن‌های OAuth از ${e==null?void 0:e.login} هرگز چنین اطلاعاتی نمی‌دهند. اجراها ممکن است کار کنند. برای بررسی قطعی، یک توکن دارای مجوز نوشتن از ${e==null?void 0:e.url} ذخیره کنید.`,DRe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?MRe(e):t==="fa"?LRe(e):RRe(e)}),ORe=()=>"This token is valid, but cannot submit Hugging Face Jobs. Create a token with Jobs write permission in Hugging Face token settings, then replace it here.",IRe=()=>"此令牌有效,但无法提交 Hugging Face 任务。请在 Hugging Face 令牌设置中创建具有 Jobs 写入权限的令牌,然后在此处替换。",BRe=()=>"این توکن معتبر است، اما اجازهٔ ارسال کار به Hugging Face را ندارد. در تنظیمات توکن Hugging Face، توکنی با مجوز نوشتن Jobs بسازید و آن را اینجا جایگزین کنید.",$Re=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IRe():t==="fa"?BRe():ORe()}),PRe=()=>"Install",HRe=()=>"安装",FRe=()=>"نصب",URe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HRe():t==="fa"?FRe():PRe()}),qRe=e=>`Adds ${e==null?void 0:e.command} to your terminal, pointing at this app, so the CLI and app are always the same version.`,GRe=e=>`将 ${e==null?void 0:e.command} 添加到终端并指向此应用,使 CLI 和应用始终使用同一版本。`,VRe=e=>`فرمان ${e==null?void 0:e.command} را به ترمینال شما و با اشاره به این برنامه اضافه می‌کند تا CLI و برنامه همیشه یک نسخه باشند.`,WRe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?GRe(e):t==="fa"?VRe(e):qRe(e)}),KRe=e=>`Install the ${e==null?void 0:e.command} command`,YRe=e=>`安装 ${e==null?void 0:e.command} 命令`,XRe=e=>`نصب فرمان ${e==null?void 0:e.command}`,ZRe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?YRe(e):t==="fa"?XRe(e):KRe(e)}),QRe=()=>"Install GitHub CLI, then run `gh auth login` in your terminal.",JRe=()=>"请安装 GitHub CLI,然后在终端中运行 `gh auth login`。",eMe=()=>"GitHub CLI را نصب کنید و سپس در پایانه `gh auth login` را اجرا کنید.",tMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JRe():t==="fa"?eMe():QRe()}),nMe=()=>"Install the new release now instead of waiting for the background update.",rMe=()=>"立即安装新版本,无需等待后台更新。",sMe=()=>"نسخهٔ جدید را اکنون نصب کنید و منتظر به‌روزرسانی پس‌زمینه نمانید.",iMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rMe():t==="fa"?sMe():nMe()}),aMe=()=>"Discard your unsaved Kubernetes changes?",oMe=()=>"要放弃未保存的 Kubernetes 更改吗?",lMe=()=>"تغییرات ذخیره‌نشدهٔ Kubernetes کنار گذاشته شود؟",cMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oMe():t==="fa"?lMe():aMe()}),uMe=()=>"Key from",fMe=()=>"密钥来自",dMe=()=>"کلید از",hMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fMe():t==="fa"?dMe():uMe()}),_Me=()=>"Use current kubectl context",pMe=()=>"使用当前 kubectl 上下文",mMe=()=>"استفاده از کانتکست فعلی kubectl",gMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pMe():t==="fa"?mMe():_Me()}),bMe=e=>`Use current context (${e==null?void 0:e.context})`,vMe=e=>`使用当前上下文(${e==null?void 0:e.context})`,xMe=e=>`استفاده از کانتکست فعلی (${e==null?void 0:e.context})`,yMe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?vMe(e):t==="fa"?xMe(e):bMe(e)}),wMe=()=>"Language",SMe=()=>"语言",kMe=()=>"زبان",CMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SMe():t==="fa"?kMe():wMe()}),EMe=e=>`Run ${e==null?void 0:e.command} in a terminal to sign in.`,NMe=e=>`在终端中运行 ${e==null?void 0:e.command} 以登录。`,zMe=e=>`برای ورود، ${e==null?void 0:e.command} را در ترمینال اجرا کنید.`,jMe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?NMe(e):t==="fa"?zMe(e):EMe(e)}),TMe=()=>"Make default",AMe=()=>"设为默认值",RMe=()=>"پیش‌فرض شود",MMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AMe():t==="fa"?RMe():TMe()}),LMe=()=>"Modal credentials are set in the process environment. Remove those overrides before replacing the token here.",DMe=()=>"Modal 凭据已在进程环境中设置。请先移除这些覆盖设置,再在此处替换令牌。",OMe=()=>"اعتبارنامه‌های Modal در محیط فرایند تنظیم شده‌اند. پیش از جایگزینی توکن در اینجا، این تنظیمات را حذف کنید.",IMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DMe():t==="fa"?OMe():LMe()}),BMe=()=>"Replace token ID",$Me=()=>"替换令牌 ID",PMe=()=>"جایگزینی شناسهٔ توکن",HMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Me():t==="fa"?PMe():BMe()}),FMe=()=>"Replace token secret",UMe=()=>"替换令牌密钥",qMe=()=>"جایگزینی رمز توکن",GMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UMe():t==="fa"?qMe():FMe()}),VMe=()=>"How to get a Modal token",WMe=()=>"如何获取 Modal 令牌",KMe=()=>"روش دریافت توکن Modal",YMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WMe():t==="fa"?KMe():VMe()}),XMe=()=>"Token ID",ZMe=()=>"令牌 ID",QMe=()=>"شناسهٔ توکن",JMe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZMe():t==="fa"?QMe():XMe()}),eLe=()=>"Token secret",tLe=()=>"令牌密钥",nLe=()=>"رمز توکن",rLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tLe():t==="fa"?nLe():eLe()}),sLe=e=>`${e==null?void 0:e.count} available — ${e==null?void 0:e.models}`,iLe=e=>`${e==null?void 0:e.count} 个可用 — ${e==null?void 0:e.models}`,aLe=e=>`${e==null?void 0:e.count} مدل در دسترس — ${e==null?void 0:e.models}`,oLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?iLe(e):t==="fa"?aLe(e):sLe(e)}),lLe=e=>`Needs ${e==null?void 0:e.tool}`,cLe=e=>`需要 ${e==null?void 0:e.tool}`,uLe=e=>`به ${e==null?void 0:e.tool} نیاز دارد`,fLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cLe(e):t==="fa"?uLe(e):lLe(e)}),dLe=()=>"Needs tools",hLe=()=>"缺少工具",_Le=()=>"به ابزارها نیاز دارد",pLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hLe():t==="fa"?_Le():dLe()}),mLe=e=>`New runs use ${e==null?void 0:e.destination} unless another backend is specified.`,gLe=e=>`除非另行指定后端,否则新运行将使用${e==null?void 0:e.destination}。`,bLe=e=>`اجراهای جدید از ${e==null?void 0:e.destination} استفاده می‌کنند، مگر اینکه سامانهٔ دیگری مشخص شود.`,vLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?gLe(e):t==="fa"?bLe(e):mLe(e)}),xLe=()=>"New runs use SSH; choose a host when launching.",yLe=()=>"新运行将使用 SSH;启动时请选择主机。",wLe=()=>"اجراهای جدید از SSH استفاده می‌کنند؛ هنگام اجرا یک میزبان انتخاب کنید.",SLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yLe():t==="fa"?wLe():xLe()}),kLe=()=>"New token",CLe=()=>"新令牌",ELe=()=>"توکن جدید",NLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CLe():t==="fa"?ELe():kLe()}),zLe=()=>"No default flavor",jLe=()=>"不设默认配置",TLe=()=>"بدون پیکربندی پیش‌فرض",ALe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jLe():t==="fa"?TLe():zLe()}),RLe=()=>"none",MLe=()=>"无",LLe=()=>"هیچ‌کدام",Zw=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MLe():t==="fa"?LLe():RLe()}),DLe=()=>"Not connected",OLe=()=>"未连接",ILe=()=>"متصل نیست",VT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OLe():t==="fa"?ILe():DLe()}),BLe=()=>"not found on PATH",$Le=()=>"在 PATH 中未找到",PLe=()=>"در PATH پیدا نشد",HLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Le():t==="fa"?PLe():BLe()}),FLe=e=>`${e==null?void 0:e.context} (not in kubeconfig)`,ULe=e=>`${e==null?void 0:e.context}(不在 kubeconfig 中)`,qLe=e=>`${e==null?void 0:e.context} (در kubeconfig نیست)`,GLe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ULe(e):t==="fa"?qLe(e):FLe(e)}),VLe=()=>"not initialized",WLe=()=>"尚未初始化",KLe=()=>"راه‌اندازی نشده",YLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WLe():t==="fa"?KLe():VLe()}),XLe=()=>"Not set",ZLe=()=>"未设置",QLe=()=>"تنظیم نشده",JLe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZLe():t==="fa"?QLe():XLe()}),eDe=()=>"OAuth (subscription login)",tDe=()=>"OAuth(订阅登录)",nDe=()=>"OAuth (ورود با اشتراک)",rDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tDe():t==="fa"?nDe():eDe()}),sDe=e=>`The old copy was left at ${e==null?void 0:e.path} on a different disk. You can delete it after confirming everything works.`,iDe=e=>`旧副本保留在另一磁盘的 ${e==null?void 0:e.path}。确认一切正常后即可删除。`,aDe=e=>`نسخهٔ قدیمی در ${e==null?void 0:e.path} روی دیسکی دیگر باقی ماند. پس از اطمینان از درست کار کردن همه‌چیز می‌توانید آن را حذف کنید.`,oDe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?iDe(e):t==="fa"?aDe(e):sDe(e)}),lDe=()=>"Setting up…",cDe=()=>"正在设置…",uDe=()=>"در حال راه‌اندازی…",fDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cDe():t==="fa"?uDe():lDe()}),dDe=()=>"Account",hDe=()=>"账户",_De=()=>"حساب",Qw=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hDe():t==="fa"?_De():dDe()}),pDe=()=>"Add one with",mDe=()=>"使用以下命令添加:",gDe=()=>"یکی با این فرمان اضافه کنید:",bDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mDe():t==="fa"?gDe():pDe()}),vDe=()=>"Add variable",xDe=()=>"添加变量",yDe=()=>"افزودن متغیر",wDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xDe():t==="fa"?yDe():vDe()}),SDe=()=>"Agent models",kDe=()=>"智能体模型",CDe=()=>"مدل‌های عامل",EDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kDe():t==="fa"?CDe():SDe()}),NDe=()=>"Anonymous usage analytics",zDe=()=>"匿名使用情况分析",jDe=()=>"تحلیل ناشناس استفاده",rC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zDe():t==="fa"?jDe():NDe()}),TDe=()=>"Auth",ADe=()=>"身份验证",RDe=()=>"احراز هویت",MDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ADe():t==="fa"?RDe():TDe()}),LDe=()=>"Authentication",DDe=()=>"身份验证",ODe=()=>"احراز هویت",IDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DDe():t==="fa"?ODe():LDe()}),BDe=()=>"Back to Compute",$De=()=>"返回算力设置",PDe=()=>"بازگشت به رایانش",WT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$De():t==="fa"?PDe():BDe()}),HDe=()=>"Backend",FDe=()=>"后端",UDe=()=>"بک‌اند",qDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FDe():t==="fa"?UDe():HDe()}),GDe=()=>"Baseline",VDe=()=>"基线",WDe=()=>"خط مبنا",KDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VDe():t==="fa"?WDe():GDe()}),YDe=()=>"Binary",XDe=()=>"可执行文件",ZDe=()=>"فایل اجرایی",QDe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XDe():t==="fa"?ZDe():YDe()}),JDe=()=>"Cancel",eOe=()=>"取消",tOe=()=>"لغو",W_=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eOe():t==="fa"?tOe():JDe()}),nOe=()=>"Cancel new variable",rOe=()=>"取消新变量",sOe=()=>"لغو متغیر جدید",iOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rOe():t==="fa"?sOe():nOe()}),aOe=()=>"Checking compute targets…",oOe=()=>"正在检查算力目标…",lOe=()=>"در حال بررسی مقصدهای رایانشی…",cOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oOe():t==="fa"?lOe():aOe()}),uOe=()=>"Checking kubectl…",fOe=()=>"正在检查 kubectl…",dOe=()=>"در حال بررسی kubectl…",hOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fOe():t==="fa"?dOe():uOe()}),_Oe=()=>"Checking Modal…",pOe=()=>"正在检查 Modal…",mOe=()=>"در حال بررسی Modal…",gOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pOe():t==="fa"?mOe():_Oe()}),bOe=()=>"Choose a preset flavor",vOe=()=>"选择预设规格",xOe=()=>"یک پیکربندی آماده انتخاب کنید",sC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vOe():t==="fa"?xOe():bOe()}),yOe=()=>"cluster default",wOe=()=>"集群默认值",SOe=()=>"پیش‌فرض خوشه",iC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wOe():t==="fa"?SOe():yOe()}),kOe=()=>"cluster default (e.g. 4h, 30m)",COe=()=>"集群默认值(例如 4h、30m)",EOe=()=>"پیش‌فرض خوشه (مثلاً 4h یا 30m)",NOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?COe():t==="fa"?EOe():kOe()}),zOe=()=>"Cluster unreachable",jOe=()=>"无法连接集群",TOe=()=>"خوشه در دسترس نیست",AOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jOe():t==="fa"?TOe():zOe()}),ROe=()=>"Compute",MOe=()=>"算力",LOe=()=>"رایانش",KT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MOe():t==="fa"?LOe():ROe()}),DOe=()=>"Connect compute backends and choose where new runs execute.",OOe=()=>"连接算力后端,并选择新运行的执行位置。",IOe=()=>"backendهای رایانشی را متصل و محل اجرای کارهای جدید را انتخاب کنید.",BOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OOe():t==="fa"?IOe():DOe()}),$Oe=()=>"Connected",POe=()=>"已连接",HOe=()=>"متصل",FOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?POe():t==="fa"?HOe():$Oe()}),UOe=()=>"Context",qOe=()=>"上下文",GOe=()=>"زمینه",VOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qOe():t==="fa"?GOe():UOe()}),WOe=()=>"Current",KOe=()=>"当前",YOe=()=>"فعلی",XOe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KOe():t==="fa"?YOe():WOe()}),ZOe=()=>"Currently off:",QOe=()=>"当前已关闭:",JOe=()=>"اکنون خاموش است:",eIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QOe():t==="fa"?JOe():ZOe()}),tIe=()=>"Custom flavor",nIe=()=>"自定义规格",rIe=()=>"پیکربندی سفارشی",sIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nIe():t==="fa"?rIe():tIe()}),iIe=()=>"Custom flavor…",aIe=()=>"自定义规格…",oIe=()=>"پیکربندی سفارشی…",lIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aIe():t==="fa"?oIe():iIe()}),cIe=()=>"Data directory",uIe=()=>"数据目录",fIe=()=>"پوشهٔ داده",dIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uIe():t==="fa"?fIe():cIe()}),hIe=()=>"default",_Ie=()=>"默认",pIe=()=>"پیش‌فرض",mIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Ie():t==="fa"?pIe():hIe()}),gIe=()=>"Default",bIe=()=>"默认",vIe=()=>"پیش‌فرض",YT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bIe():t==="fa"?vIe():gIe()}),xIe=()=>"Default destination",yIe=()=>"默认目标",wIe=()=>"مقصد پیش‌فرض",SIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yIe():t==="fa"?wIe():xIe()}),kIe=()=>"Detecting hardware…",CIe=()=>"正在检测硬件…",EIe=()=>"در حال شناسایی سخت‌افزار…",NIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CIe():t==="fa"?EIe():kIe()}),zIe=()=>"Detecting harnesses…",jIe=()=>"正在检测智能体工具…",TIe=()=>"در حال شناسایی ابزارهای عامل…",AIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jIe():t==="fa"?TIe():zIe()}),RIe=()=>"Disabling syncing stops automatic pushes. Compute continues to use direct source snapshots. This does not delete the GitHub repository or code already pushed.",MIe=()=>"关闭同步会停止自动推送。算力执行仍使用直接的源代码快照。此操作不会删除 GitHub 仓库或已推送的代码。",LIe=()=>"خاموش کردن همگام‌سازی، push خودکار را متوقف می‌کند. رایانش همچنان از snapshot مستقیم منبع استفاده می‌کند. این کار مخزن GitHub یا کدهای ازپیش pushشده را حذف نمی‌کند.",DIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MIe():t==="fa"?LIe():RIe()}),OIe=()=>"Effective URL",IIe=()=>"实际使用的网址",BIe=()=>"نشانی مؤثر",$Ie=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IIe():t==="fa"?BIe():OIe()}),PIe=()=>"Enable GitHub syncing for new projects",HIe=()=>"为新项目启用 GitHub 同步",FIe=()=>"فعال‌سازی همگام‌سازی GitHub برای پروژه‌های جدید",aC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HIe():t==="fa"?FIe():PIe()}),UIe=()=>"Environment",qIe=()=>"环境",GIe=()=>"محیط",XT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qIe():t==="fa"?GIe():UIe()}),VIe=()=>"Failed",WIe=()=>"失败",KIe=()=>"ناموفق",Jw=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WIe():t==="fa"?KIe():VIe()}),YIe=()=>"General",XIe=()=>"常规",ZIe=()=>"عمومی",QIe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XIe():t==="fa"?ZIe():YIe()}),JIe=()=>"GitHub publishing",eBe=()=>"GitHub 发布",tBe=()=>"انتشار در GitHub",nBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eBe():t==="fa"?tBe():JIe()}),rBe=()=>"Git token",sBe=()=>"Git 令牌",iBe=()=>"توکن Git",aBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sBe():t==="fa"?iBe():rBe()}),oBe=()=>"Harnesses",lBe=()=>"智能体工具",cBe=()=>"ابزارهای عامل",uBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lBe():t==="fa"?cBe():oBe()}),fBe=()=>"hf_…",dBe=()=>"hf_…",hBe=()=>"hf_…",_Be=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dBe():t==="fa"?hBe():fBe()}),pBe=()=>"HF_TOKEN is set in the environment and overrides any token saved here.",mBe=()=>"环境中已设置 HF_TOKEN,它会覆盖此处保存的令牌。",gBe=()=>"مقدار HF_TOKEN در محیط تنظیم شده و هر توکن ذخیره‌شده در اینجا را بازنویسی می‌کند.",bBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mBe():t==="fa"?gBe():pBe()}),vBe=()=>"Initialize Git",xBe=()=>"初始化 Git",yBe=()=>"راه‌اندازی Git",wBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xBe():t==="fa"?yBe():vBe()}),SBe=()=>"Install",kBe=()=>"安装",CBe=()=>"نصب",ZT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kBe():t==="fa"?CBe():SBe()}),EBe=()=>"Install broken",NBe=()=>"安装损坏",zBe=()=>"نصب خراب است",jBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NBe():t==="fa"?zBe():EBe()}),TBe=()=>"Install GitHub CLI",ABe=()=>"安装 GitHub CLI",RBe=()=>"نصب GitHub CLI",MBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ABe():t==="fa"?RBe():TBe()}),LBe=()=>"Install updates automatically",DBe=()=>"自动安装更新",OBe=()=>"نصب خودکار به‌روزرسانی‌ها",oC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DBe():t==="fa"?OBe():LBe()}),IBe=()=>"Instance history",BBe=()=>"实例历史",$Be=()=>"تاریخچهٔ نمونه‌ها",PBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BBe():t==="fa"?$Be():IBe()}),HBe=()=>"Invalid Token",FBe=()=>"令牌无效",UBe=()=>"توکن نامعتبر",qBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FBe():t==="fa"?UBe():HBe()}),GBe=()=>"Jobs / Dashboard URL",VBe=()=>"Jobs / 控制台网址",WBe=()=>"نشانی Jobs / داشبورد",KBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VBe():t==="fa"?WBe():GBe()}),YBe=()=>"kubectl not found",XBe=()=>"未找到 kubectl",ZBe=()=>"kubectl پیدا نشد",QBe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XBe():t==="fa"?ZBe():YBe()}),JBe=()=>"Latest",e$e=()=>"最新版本",t$e=()=>"جدیدترین",n$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?e$e():t==="fa"?t$e():JBe()}),r$e=()=>"Loading…",s$e=()=>"正在加载…",i$e=()=>"در حال بارگیری…",vc=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?s$e():t==="fa"?i$e():r$e()}),a$e=()=>"Loading Ray settings…",o$e=()=>"正在加载 Ray 设置…",l$e=()=>"در حال بارگیری تنظیمات Ray…",c$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?o$e():t==="fa"?l$e():a$e()}),u$e=()=>"Loading slurm settings…",f$e=()=>"正在加载 Slurm 设置…",d$e=()=>"در حال بارگیری تنظیمات Slurm…",h$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?f$e():t==="fa"?d$e():u$e()}),_$e=()=>"Loading status…",p$e=()=>"正在加载状态…",m$e=()=>"در حال بارگیری وضعیت…",g$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?p$e():t==="fa"?m$e():_$e()}),b$e=()=>"Local only",v$e=()=>"仅本地",x$e=()=>"فقط محلی",y$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?v$e():t==="fa"?x$e():b$e()}),w$e=()=>"Local repository",S$e=()=>"本地仓库",k$e=()=>"مخزن محلی",C$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?S$e():t==="fa"?k$e():w$e()}),E$e=()=>"Login node",N$e=()=>"登录节点",z$e=()=>"گرهٔ ورود",j$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?N$e():t==="fa"?z$e():E$e()}),T$e=()=>"Make GitHub syncing the default?",A$e=()=>"将 GitHub 同步设为默认值?",R$e=()=>"همگام‌سازی GitHub پیش‌فرض شود؟",M$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?A$e():t==="fa"?R$e():T$e()}),L$e=()=>"Missing bash/tar",D$e=()=>"缺少 bash/tar",O$e=()=>"bash/tar موجود نیست",I$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?D$e():t==="fa"?O$e():L$e()}),B$e=()=>"More compute options",$$e=()=>"更多算力选项",P$e=()=>"گزینه‌های رایانشی بیشتر",H$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$$e():t==="fa"?P$e():B$e()}),F$e=()=>"Move failed:",U$e=()=>"移动失败:",q$e=()=>"انتقال ناموفق بود:",G$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?U$e():t==="fa"?q$e():F$e()}),V$e=()=>"Moved. orx is now using the new location.",W$e=()=>"已移动。orx 现在使用新位置。",K$e=()=>"منتقل شد. orx اکنون از محل جدید استفاده می‌کند.",Y$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?W$e():t==="fa"?K$e():V$e()}),X$e=()=>"Namespace",Z$e=()=>"命名空间",Q$e=()=>"فضای نام",J$e=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Z$e():t==="fa"?Q$e():X$e()}),ePe=()=>"New location",tPe=()=>"新位置",nPe=()=>"محل جدید",rPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tPe():t==="fa"?nPe():ePe()}),sPe=()=>"New releases are downloaded and installed in the background. Turning this off keeps the notice but leaves the install to you.",iPe=()=>"新版本会在后台下载并安装。关闭后仍会显示通知,但需要手动安装。",aPe=()=>"نسخه‌های جدید در پس‌زمینه دریافت و نصب می‌شوند. خاموش کردن این گزینه اعلان را نگه می‌دارد، اما نصب را به شما می‌سپارد.",oPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iPe():t==="fa"?aPe():sPe()}),lPe=()=>"New variable key",cPe=()=>"新变量键名",uPe=()=>"کلید متغیر جدید",fPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cPe():t==="fa"?uPe():lPe()}),dPe=()=>"New variable value",hPe=()=>"新变量值",_Pe=()=>"مقدار متغیر جدید",pPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hPe():t==="fa"?_Pe():dPe()}),mPe=()=>"No code, prompts, file contents, or account identifiers are sent.",gPe=()=>"不会发送代码、提示词、文件内容或账户标识符。",bPe=()=>"هیچ کد، پرامپت، محتوای فایل یا شناسهٔ حسابی ارسال نمی‌شود.",vPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gPe():t==="fa"?bPe():mPe()}),xPe=()=>"No hosts found in ~/.ssh/config.",yPe=()=>"在 ~/.ssh/config 中未找到主机。",wPe=()=>"میزبانی در ‎~/.ssh/config پیدا نشد.",SPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yPe():t==="fa"?wPe():xPe()}),kPe=()=>"No job-create permission",CPe=()=>"没有创建 Job 的权限",EPe=()=>"مجوز ساخت Job وجود ندارد",NPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CPe():t==="fa"?EPe():kPe()}),zPe=()=>"No Write Permissions",jPe=()=>"无写入权限",TPe=()=>"بدون مجوز نوشتن",APe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jPe():t==="fa"?TPe():zPe()}),RPe=()=>"No key on this computer to register — load a registered key with",MPe=()=>"此计算机上没有可注册的密钥——使用以下命令加载已注册的密钥:",LPe=()=>"کلیدی برای ثبت روی این رایانه نیست — کلید ثبت‌شده را با این فرمان بار کنید:",DPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MPe():t==="fa"?LPe():RPe()}),OPe=()=>"No key on this computer yet — create one with",IPe=()=>"此计算机上还没有密钥——使用以下命令创建:",BPe=()=>"هنوز کلیدی روی این رایانه نیست — با این فرمان یکی بسازید:",$Pe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IPe():t==="fa"?BPe():OPe()}),PPe=()=>"No Slurm CLI",HPe=()=>"无 Slurm CLI",FPe=()=>"بدون CLI اسلورم",UPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HPe():t==="fa"?FPe():PPe()}),qPe=()=>"None registered",GPe=()=>"未注册任何密钥",VPe=()=>"هیچ‌کدام ثبت نشده",WPe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GPe():t==="fa"?VPe():qPe()}),KPe=()=>"Not checked",YPe=()=>"未检查",XPe=()=>"بررسی نشده",QT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YPe():t==="fa"?XPe():KPe()}),ZPe=()=>"Not configured",QPe=()=>"未配置",JPe=()=>"پیکربندی نشده",Og=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QPe():t==="fa"?JPe():ZPe()}),eHe=()=>"Not installed",tHe=()=>"未安装",nHe=()=>"نصب نیست",rHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tHe():t==="fa"?nHe():eHe()}),sHe=()=>"Not now",iHe=()=>"暂不",aHe=()=>"اکنون نه",oHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iHe():t==="fa"?aHe():sHe()}),lHe=()=>"Not on this computer",cHe=()=>"不在此计算机上",uHe=()=>"روی این رایانه نیست",fHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cHe():t==="fa"?uHe():lHe()}),dHe=()=>"Not set (pass --host per launch)",hHe=()=>"未设置(每次启动时传入 --host)",_He=()=>"تنظیم نشده (در هر اجرا ‎--host بدهید)",pHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hHe():t==="fa"?_He():dHe()}),mHe=()=>"Not signed in",gHe=()=>"未登录",bHe=()=>"وارد نشده",JT=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gHe():t==="fa"?bHe():mHe()}),vHe=()=>"On this computer",xHe=()=>"在此计算机上",yHe=()=>"روی این رایانه",wHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xHe():t==="fa"?yHe():vHe()}),SHe=()=>"Open a project to inspect its repository and GitHub publication state.",kHe=()=>"打开项目以查看其仓库和 GitHub 发布状态。",CHe=()=>"پروژه‌ای را باز کنید تا مخزن و وضعیت انتشار GitHub آن را ببینید.",EHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kHe():t==="fa"?CHe():SHe()}),NHe=()=>"Open job page",zHe=()=>"打开作业页面",jHe=()=>"باز کردن صفحهٔ کار",lC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zHe():t==="fa"?jHe():NHe()}),THe=()=>"Open on GitHub",AHe=()=>"在 GitHub 上打开",RHe=()=>"باز کردن در GitHub",cC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AHe():t==="fa"?RHe():THe()}),MHe=()=>", or create one with",LHe=()=>",或使用以下命令创建:",DHe=()=>"، یا با این فرمان یکی بسازید:",OHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LHe():t==="fa"?DHe():MHe()}),IHe=()=>"Org",BHe=()=>"组织",$He=()=>"سازمان",PHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BHe():t==="fa"?$He():IHe()}),HHe=()=>"Orgs",FHe=()=>"组织",UHe=()=>"سازمان‌ها",qHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FHe():t==="fa"?UHe():HHe()}),GHe=()=>"orx can't update this install",VHe=()=>"orx 无法更新此安装",WHe=()=>"orx نمی‌تواند این نصب را به‌روزرسانی کند",KHe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VHe():t==="fa"?WHe():GHe()}),YHe=()=>"Overleaf",XHe=()=>"Overleaf",ZHe=()=>"Overleaf",eA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XHe():t==="fa"?ZHe():YHe()}),QHe=()=>"Overleaf Git authentication token",JHe=()=>"Overleaf Git 身份验证令牌",eFe=()=>"توکن احراز هویت Git در Overleaf",tFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?JHe():t==="fa"?eFe():QHe()}),nFe=()=>"Overridden by env",rFe=()=>"已被环境变量覆盖",sFe=()=>"بازنویسی‌شده توسط محیط",iFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?rFe():t==="fa"?sFe():nFe()}),aFe=()=>"Partition",oFe=()=>"分区",lFe=()=>"پارتیشن",cFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oFe():t==="fa"?lFe():aFe()}),uFe=()=>"Path",fFe=()=>"路径",dFe=()=>"مسیر",hFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fFe():t==="fa"?dFe():uFe()}),_Fe=()=>"Plan",pFe=()=>"方案",mFe=()=>"سطح اشتراک",gFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pFe():t==="fa"?mFe():_Fe()}),bFe=()=>"Project",vFe=()=>"项目",xFe=()=>"پروژه",yFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vFe():t==="fa"?xFe():bFe()}),wFe=()=>"Ray version",SFe=()=>"Ray 版本",kFe=()=>"نسخهٔ Ray",CFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SFe():t==="fa"?kFe():wFe()}),EFe=()=>"Reachable",NFe=()=>"可访问",zFe=()=>"در دسترس",jFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NFe():t==="fa"?zFe():EFe()}),TFe=()=>"Reading ~/.ssh/config…",AFe=()=>"正在读取 ~/.ssh/config…",RFe=()=>"در حال خواندن ‎~/.ssh/config…",tA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AFe():t==="fa"?RFe():TFe()}),MFe=()=>"Ready",LFe=()=>"就绪",DFe=()=>"آماده",K_=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LFe():t==="fa"?DFe():MFe()}),OFe=()=>"Ready to move",IFe=()=>"可以移动",BFe=()=>"آمادهٔ انتقال",$Fe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IFe():t==="fa"?BFe():OFe()}),PFe=()=>"Configured",HFe=()=>"已配置",FFe=()=>"پیکربندی‌شده",e4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HFe():t==="fa"?FFe():PFe()}),UFe=()=>"Refresh",qFe=()=>"刷新",GFe=()=>"تازه‌سازی",Y_=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qFe():t==="fa"?GFe():UFe()}),VFe=()=>"Remotes",WFe=()=>"远程仓库",KFe=()=>"مخزن‌های دوردست",YFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WFe():t==="fa"?KFe():VFe()}),XFe=()=>"Repository",ZFe=()=>"仓库",QFe=()=>"مخزن",JFe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZFe():t==="fa"?QFe():XFe()}),eUe=()=>"Restart to finish updating",tUe=()=>"重新启动以完成更新",nUe=()=>"برای تکمیل به‌روزرسانی، دوباره راه‌اندازی کنید",rUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tUe():t==="fa"?nUe():eUe()}),sUe=()=>"Running instances",iUe=()=>"正在运行的实例",aUe=()=>"نمونه‌های در حال اجرا",oUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iUe():t==="fa"?aUe():sUe()}),lUe=()=>"Runtime",cUe=()=>"运行时间",uUe=()=>"زمان اجرا",fUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cUe():t==="fa"?uUe():lUe()}),dUe=()=>". Save it under that key if it's meant for HF Jobs.",hUe=()=>"读取它。如果它用于 HF Jobs,请以该键名保存。",_Ue=()=>"می‌خوانند. اگر برای HF Jobs است، آن را با همان کلید ذخیره کنید.",pUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hUe():t==="fa"?_Ue():dUe()}),mUe=()=>"Settings",gUe=()=>"设置",bUe=()=>"تنظیمات",t4=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gUe():t==="fa"?bUe():mUe()}),vUe=()=>"Signed in",xUe=()=>"已登录",yUe=()=>"وارد شده",wUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xUe():t==="fa"?yUe():vUe()}),SUe=()=>"Source",kUe=()=>"来源",CUe=()=>"منبع",nA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kUe():t==="fa"?CUe():SUe()}),EUe=()=>"SSH Key",NUe=()=>"SSH 密钥",zUe=()=>"کلید SSH",jUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NUe():t==="fa"?zUe():EUe()}),TUe=()=>"Started",AUe=()=>"开始时间",RUe=()=>"آغاز",MUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AUe():t==="fa"?RUe():TUe()}),LUe=()=>"State",DUe=()=>"状态",OUe=()=>"وضعیت",IUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DUe():t==="fa"?OUe():LUe()}),BUe=()=>"Status",$Ue=()=>"状态",PUe=()=>"وضعیت",yd=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Ue():t==="fa"?PUe():BUe()}),HUe=()=>"Storage",FUe=()=>"存储",UUe=()=>"ذخیره‌سازی",qUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FUe():t==="fa"?UUe():HUe()}),GUe=()=>"Sync",VUe=()=>"同步",WUe=()=>"همگام‌سازی",KUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VUe():t==="fa"?WUe():GUe()}),YUe=()=>"Syncing off",XUe=()=>"同步已关闭",ZUe=()=>"همگام‌سازی خاموش",QUe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XUe():t==="fa"?ZUe():YUe()}),JUe=()=>"Test connection",eqe=()=>"测试连接",tqe=()=>"آزمایش اتصال",nqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eqe():t==="fa"?tqe():JUe()}),rqe=()=>"Testing…",sqe=()=>"正在测试…",iqe=()=>"در حال آزمایش…",aqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sqe():t==="fa"?iqe():rqe()}),oqe=()=>", then add it with",lqe=()=>",然后使用以下命令添加:",cqe=()=>"، سپس با این فرمان اضافه‌اش کنید:",uqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lqe():t==="fa"?cqe():oqe()}),fqe=()=>"This is useful when collaborators follow project changes on GitHub. New projects will enable syncing automatically, creating a private repository when needed and pushing experiment branches for visibility.",dqe=()=>"当协作者在 GitHub 上关注项目更改时,此功能很有用。新项目将自动启用同步,在需要时创建私有仓库,并推送实验分支以便查看。",hqe=()=>"وقتی همکاران تغییرات پروژه را در GitHub دنبال می‌کنند، این گزینه مفید است. پروژه‌های جدید همگام‌سازی را خودکار فعال می‌کنند، در صورت نیاز مخزن خصوصی می‌سازند و شاخه‌های آزمایش را برای دیده‌شدن push می‌کنند.",_qe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dqe():t==="fa"?hqe():fqe()}),pqe=()=>"This saved destination is not configured. Set it up below or choose another backend.",mqe=()=>"已保存的目标尚未配置。请在下方完成设置或选择其他后端。",gqe=()=>"این مقصد ذخیره‌شده پیکربندی نشده است. آن را در پایین راه‌اندازی یا backend دیگری انتخاب کنید.",bqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mqe():t==="fa"?gqe():pqe()}),vqe=()=>"This value looks like a Hugging Face token — compute runs only read it from",xqe=()=>"此值看起来像 Hugging Face 令牌——算力运行只会从",yqe=()=>"این مقدار شبیه توکن Hugging Face است — اجراهای رایانشی آن را فقط از",wqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xqe():t==="fa"?yqe():vqe()}),Sqe=()=>"Time limit",kqe=()=>"时间限制",Cqe=()=>"محدودیت زمانی",Eqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kqe():t==="fa"?Cqe():Sqe()}),Nqe=()=>"Unable to verify",zqe=()=>"无法验证",jqe=()=>"تأیید ممکن نیست",Fy=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zqe():t==="fa"?jqe():Nqe()}),Tqe=()=>"Unknown",Aqe=()=>"未知",Rqe=()=>"نامشخص",Mqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Aqe():t==="fa"?Rqe():Tqe()}),Lqe=()=>"Update required",Dqe=()=>"需要更新",Oqe=()=>"نیازمند به‌روزرسانی",Iqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Dqe():t==="fa"?Oqe():Lqe()}),Bqe=()=>"Updates",$qe=()=>"更新",Pqe=()=>"به‌روزرسانی‌ها",uC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$qe():t==="fa"?Pqe():Bqe()}),Hqe=()=>"Usage analytics",Fqe=()=>"使用情况分析",Uqe=()=>"تحلیل استفاده",qqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Fqe():t==="fa"?Uqe():Hqe()}),Gqe=()=>"value",Vqe=()=>"值",Wqe=()=>"مقدار",rA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Vqe():t==="fa"?Wqe():Gqe()}),Kqe=()=>"Variables available to runs and the research agent (API keys, tokens).",Yqe=()=>"可供运行和研究智能体使用的变量(API 密钥、令牌)。",Xqe=()=>"متغیرهای در دسترس اجراها و عامل پژوهشی (کلیدهای API، توکن‌ها).",Zqe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Yqe():t==="fa"?Xqe():Kqe()}),Qqe=()=>"Version",Jqe=()=>"版本",eGe=()=>"نسخه",sA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Jqe():t==="fa"?eGe():Qqe()}),tGe=()=>"When enabled, each new project gets a private GitHub repository. Experiment branches are pushed automatically for collaborator visibility. Compute always uses direct source snapshots.",nGe=()=>"启用后,每个新项目都会获得一个私有 GitHub 仓库。实验分支会自动推送,便于协作者查看。算力执行始终使用直接的源代码快照。",rGe=()=>"با فعال شدن، هر پروژهٔ جدید یک مخزن خصوصی GitHub می‌گیرد. شاخه‌های آزمایش برای دیده‌شدن توسط همکاران خودکار push می‌شوند. رایانش همیشه از snapshot مستقیم منبع استفاده می‌کند.",sGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nGe():t==="fa"?rGe():tGe()}),iGe=()=>"With a token saved, a paper opened in the dashboard can be kept in step with an Overleaf project, in both directions. Overleaf's Git integration comes with a paid Overleaf plan; without one, a paper can still be uploaded to Overleaf as a new project. The token stays on this machine and is not sent to compute backends.",aGe=()=>"保存令牌后,可让控制台中打开的论文与 Overleaf 项目双向保持同步。Overleaf 的 Git 集成需要付费方案;没有付费方案时,仍可将论文作为新项目上传到 Overleaf。令牌仅保存在此计算机上,不会发送到算力后端。",oGe=()=>"با ذخیرهٔ توکن، مقاله‌ای که در داشبورد باز شده می‌تواند در هر دو جهت با یک پروژهٔ Overleaf همگام بماند. یکپارچه‌سازی Git در Overleaf به طرح پولی نیاز دارد؛ بدون آن هم می‌توان مقاله را به‌عنوان پروژه‌ای جدید در Overleaf بارگذاری کرد. توکن روی همین دستگاه می‌ماند و به backendهای رایانشی فرستاده نمی‌شود.",lGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aGe():t==="fa"?oGe():iGe()}),cGe=()=>"Pick a login node first",uGe=()=>"请先选择登录节点",fGe=()=>"ابتدا یک گرهٔ ورود انتخاب کنید",dGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uGe():t==="fa"?fGe():cGe()}),hGe=()=>"Providers",_Ge=()=>"提供商",pGe=()=>"ارائه‌دهندگان",mGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Ge():t==="fa"?pGe():hGe()}),gGe=()=>"Reconnect",bGe=()=>"重新连接",vGe=()=>"اتصال دوباره",iA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bGe():t==="fa"?vGe():gGe()}),xGe=e=>`Register this computer with ${e==null?void 0:e.register}, or load a registered key with ${e==null?void 0:e.load}.`,yGe=e=>`使用 ${e==null?void 0:e.register} 注册此计算机,或使用 ${e==null?void 0:e.load} 加载已注册的密钥。`,wGe=e=>`این رایانه را با ${e==null?void 0:e.register} ثبت کنید، یا کلید ثبت‌شده را با ${e==null?void 0:e.load} بار کنید.`,SGe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?yGe(e):t==="fa"?wGe(e):xGe(e)}),kGe=()=>"Reinstall with the orx installer to get automatic updates.",CGe=()=>"请使用 orx 安装程序重新安装,以获得自动更新。",EGe=()=>"برای دریافت به‌روزرسانی خودکار، با نصب‌کنندهٔ orx دوباره نصب کنید.",NGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CGe():t==="fa"?EGe():kGe()}),zGe=()=>"Re-link",jGe=()=>"重新链接",TGe=()=>"پیوند دوباره",AGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jGe():t==="fa"?TGe():zGe()}),RGe=()=>"Remove token",MGe=()=>"移除令牌",LGe=()=>"حذف توکن",DGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MGe():t==="fa"?LGe():RGe()}),OGe=()=>"Removing…",IGe=()=>"正在移除…",BGe=()=>"در حال حذف…",$Ge=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IGe():t==="fa"?BGe():OGe()}),PGe=()=>"Replace anyway",HGe=()=>"仍要替换",FGe=()=>"به‌هرحال جایگزین کن",UGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HGe():t==="fa"?FGe():PGe()}),qGe=()=>"Replace key",GGe=()=>"替换密钥",VGe=()=>"جایگزینی کلید",WGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GGe():t==="fa"?VGe():qGe()}),KGe=()=>"Replace token",YGe=()=>"替换令牌",XGe=()=>"جایگزینی توکن",ZGe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YGe():t==="fa"?XGe():KGe()}),QGe=e=>`Git and GitHub settings for ${e==null?void 0:e.project}. Local Git powers experiments; publishing is optional.`,JGe=e=>`${e==null?void 0:e.project} 的 Git 和 GitHub 设置。本地 Git 为实验提供支持;发布是可选的。`,eVe=e=>`تنظیمات Git و GitHub برای ${e==null?void 0:e.project}. Git محلی آزمایش‌ها را ممکن می‌کند؛ انتشار اختیاری است.`,tVe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?JGe(e):t==="fa"?eVe(e):QGe(e)}),nVe=e=>`Version ${e==null?void 0:e.installed} is installed. This window is still running ${e==null?void 0:e.current}.`,rVe=e=>`已安装版本 ${e==null?void 0:e.installed}。此窗口仍在运行 ${e==null?void 0:e.current}。`,sVe=e=>`نسخهٔ ${e==null?void 0:e.installed} نصب شده است. این پنجره هنوز نسخهٔ ${e==null?void 0:e.current} را اجرا می‌کند.`,iVe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?rVe(e):t==="fa"?sVe(e):nVe(e)}),aVe=()=>"Run `gh auth login` in your terminal.",oVe=()=>"请在终端中运行 `gh auth login`。",lVe=()=>"در پایانه `gh auth login` را اجرا کنید.",cVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oVe():t==="fa"?lVe():aVe()}),uVe=()=>"Saved",fVe=()=>"已保存",dVe=()=>"ذخیره شده",hVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fVe():t==="fa"?dVe():uVe()}),_Ve=()=>"Set up",pVe=()=>"设置",mVe=()=>"راه‌اندازی",gVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pVe():t==="fa"?mVe():_Ve()}),bVe=()=>"Set up SSH key",vVe=()=>"设置 SSH 密钥",xVe=()=>"راه‌اندازی کلید SSH",yVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vVe():t==="fa"?xVe():bVe()}),wVe=()=>"Sign in",SVe=()=>"登录",kVe=()=>"ورود",aA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SVe():t==="fa"?kVe():wVe()}),CVe=e=>`SSH connection terminal for ${e==null?void 0:e.host}`,EVe=e=>`${e==null?void 0:e.host} 的 SSH 连接终端`,NVe=e=>`پایانهٔ اتصال SSH برای ${e==null?void 0:e.host}`,oA=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?EVe(e):t==="fa"?NVe(e):CVe(e)}),zVe=()=>"The local database, run logs, artifacts, and chat attachments. Moving this directory copies the entire store.",jVe=()=>"本地数据库、运行日志、产物和聊天附件。移动此目录会复制整个存储。",TVe=()=>"پایگاه دادهٔ محلی، گزارش اجراها، خروجی‌ها و پیوست‌های گفتگو. انتقال این پوشه، کل مخزن داده را کپی می‌کند.",AVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jVe():t==="fa"?TVe():zVe()}),RVe=()=>"The terminal disconnected before setup completed. Try again.",MVe=()=>"设置完成前终端连接已断开。请重试。",LVe=()=>"ارتباط ترمینال پیش از تکمیل راه‌اندازی قطع شد. دوباره تلاش کنید.",fC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MVe():t==="fa"?LVe():RVe()}),DVe=()=>"Dark",OVe=()=>"深色",IVe=()=>"تیره",BVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?OVe():t==="fa"?IVe():DVe()}),$Ve=()=>"Theme",PVe=()=>"主题",HVe=()=>"پوسته",dC=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PVe():t==="fa"?HVe():$Ve()}),FVe=()=>"Light",UVe=()=>"浅色",qVe=()=>"روشن",GVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UVe():t==="fa"?qVe():FVe()}),VVe=()=>"System",WVe=()=>"系统",KVe=()=>"سیستم",YVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WVe():t==="fa"?KVe():VVe()}),XVe=()=>"Set up billing in the Tinker console",ZVe=()=>"在 Tinker 控制台设置账单",QVe=()=>"تنظیم پرداخت در کنسول Tinker",JVe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZVe():t==="fa"?QVe():XVe()}),eWe=()=>"Billing setup required",tWe=()=>"需要设置账单",nWe=()=>"تنظیم پرداخت لازم است",rWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?tWe():t==="fa"?nWe():eWe()}),sWe=()=>"TINKER_API_KEY is set in the process environment and overrides keys saved here. The status reflects that key.",iWe=()=>"进程环境中已设置 TINKER_API_KEY,它会覆盖此处保存的密钥。状态显示的是该密钥的检查结果。",aWe=()=>"متغیر TINKER_API_KEY در محیط فرایند تنظیم شده و بر کلیدهای ذخیره‌شده در اینجا اولویت دارد. وضعیت مربوط به همان کلید است.",oWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iWe():t==="fa"?aWe():sWe()}),lWe=()=>"Invalid Key",cWe=()=>"密钥无效",uWe=()=>"کلید نامعتبر",fWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cWe():t==="fa"?uWe():lWe()}),dWe=()=>"Token from",hWe=()=>"令牌来自",_We=()=>"توکن از",pWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hWe():t==="fa"?_We():dWe()}),mWe=()=>"Update now",gWe=()=>"立即更新",bWe=()=>"اکنون به‌روزرسانی کن",vWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gWe():t==="fa"?bWe():mWe()}),xWe=e=>`Update to ${e==null?void 0:e.version}`,yWe=e=>`更新到 ${e==null?void 0:e.version}`,wWe=e=>`به‌روزرسانی به ${e==null?void 0:e.version}`,SWe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?yWe(e):t==="fa"?wWe(e):xWe(e)}),kWe=()=>" Updates are switched off for this environment by ORX_NO_UPDATE_CHECK, so this setting has no effect.",CWe=()=>" 此环境已通过 ORX_NO_UPDATE_CHECK 关闭更新,因此此设置不会生效。",EWe=()=>" به‌روزرسانی در این محیط با ORX_NO_UPDATE_CHECK خاموش شده است؛ بنابراین این تنظیم اثری ندارد.",NWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CWe():t==="fa"?EWe():kWe()}),zWe=()=>"Updating default destination…",jWe=()=>"正在更新默认运行位置…",TWe=()=>"در حال به‌روزرسانی مقصد پیش‌فرض…",AWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jWe():t==="fa"?TWe():zWe()}),RWe=()=>"Use this repository for automatic experiment-branch pushes when your connected account can write to it. Otherwise, OpenResearch creates a separate private repository for collaboration.",MWe=()=>"当已连接的账户有写入权限时,使用此仓库自动推送实验分支。否则,OpenResearch 会另建一个私有仓库用于协作。",LWe=()=>"اگر حساب متصل اجازهٔ نوشتن داشته باشد، شاخه‌های آزمایش خودکار به این مخزن پوش می‌شوند. در غیر این صورت OpenResearch یک مخزن خصوصی جداگانه برای همکاری می‌سازد.",DWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MWe():t==="fa"?LWe():RWe()}),OWe=()=>"Validating…",IWe=()=>"正在验证…",BWe=()=>"در حال اعتبارسنجی…",lA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IWe():t==="fa"?BWe():OWe()}),$We=()=>"View settings",PWe=()=>"查看设置",HWe=()=>"مشاهدهٔ تنظیمات",FWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PWe():t==="fa"?HWe():$We()}),UWe=()=>"Skill",qWe=()=>"技能",GWe=()=>"مهارت",cA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qWe():t==="fa"?GWe():UWe()}),VWe=()=>"Loading skill…",WWe=()=>"正在加载技能…",KWe=()=>"در حال بارگیری مهارت…",YWe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WWe():t==="fa"?KWe():VWe()}),XWe=e=>`Delete the “${e==null?void 0:e.name}” skill?`,ZWe=e=>`删除技能“${e==null?void 0:e.name}”?`,QWe=e=>`مهارت «${e==null?void 0:e.name}» حذف شود؟`,JWe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?ZWe(e):t==="fa"?QWe(e):XWe(e)}),eKe=e=>`Delete skill ${e==null?void 0:e.name}`,tKe=e=>`删除技能 ${e==null?void 0:e.name}`,nKe=e=>`حذف مهارت ${e==null?void 0:e.name}`,rKe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?tKe(e):t==="fa"?nKe(e):eKe(e)}),sKe=e=>`Delete the “${e==null?void 0:e.name}” template?`,iKe=e=>`删除模板“${e==null?void 0:e.name}”?`,aKe=e=>`قالب «${e==null?void 0:e.name}» حذف شود؟`,oKe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?iKe(e):t==="fa"?aKe(e):sKe(e)}),lKe=e=>`Delete template ${e==null?void 0:e.name}`,cKe=e=>`删除模板 ${e==null?void 0:e.name}`,uKe=e=>`حذف قالب ${e==null?void 0:e.name}`,fKe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?cKe(e):t==="fa"?uKe(e):lKe(e)}),dKe=()=>"SKILL.md folders the agent discovers on its own and you invoke with /name in chat. Skills installed in your coding agents are picked up automatically.",hKe=()=>"智能体会自动发现的 SKILL.md 技能文件夹,你可以在聊天中通过 /name 调用。你的编码智能体中已安装的技能会自动纳入。",_Ke=()=>"پوشه‌های SKILL.md که عامل خودش پیدا می‌کند و شما با ‎/name در گفتگو فراخوانی می‌کنید. مهارت‌های نصب‌شده در عامل‌های کدنویسی شما به‌طور خودکار در نظر گرفته می‌شوند.",pKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hKe():t==="fa"?_Ke():dKe()}),mKe=()=>"Drop a SKILL.md or .zip here, or click to choose",gKe=()=>"将 SKILL.md 或 .zip 拖放到此处,或点击选择",bKe=()=>"یک فایل SKILL.md یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",vKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gKe():t==="fa"?bKe():mKe()}),xKe=()=>"Drop a .tex or .zip here, or click to choose",yKe=()=>"将 .tex 或 .zip 拖放到此处,或点击选择",wKe=()=>"یک فایل .tex یا .zip را اینجا رها کنید، یا برای انتخاب کلیک کنید",SKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yKe():t==="fa"?wKe():xKe()}),kKe=()=>"File too large (max 20 MB).",CKe=()=>"文件过大(最大 20 MB)。",EKe=()=>"فایل بیش از حد بزرگ است (حداکثر ۲۰ مگابایت).",uA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CKe():t==="fa"?EKe():kKe()}),NKe=()=>" + 1 file",zKe=()=>" + 1 个文件",jKe=()=>" + ۱ فایل",TKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zKe():t==="fa"?jKe():NKe()}),AKe=()=>"What the agent brings to every session, in every project: the skills it can use, and the LaTeX templates it writes papers into.",RKe=()=>"智能体在每个项目的每个会话中都会携带的内容:可用的技能,以及撰写论文所用的 LaTeX 模板。",MKe=()=>"آنچه عامل در هر نشست و در همهٔ پروژه‌ها همراه دارد: مهارت‌هایی که می‌تواند استفاده کند و قالب‌های LaTeX که مقاله‌ها را با آن‌ها می‌نویسد.",LKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?RKe():t==="fa"?MKe():AKe()}),DKe=e=>` + ${e==null?void 0:e.count} files`,OKe=e=>` + ${e==null?void 0:e.count} 个文件`,IKe=e=>` + ${e==null?void 0:e.count} فایل`,BKe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?OKe(e):t==="fa"?IKe(e):DKe(e)}),$Ke=()=>"Could not load skills:",PKe=()=>"无法加载技能:",HKe=()=>"بارگیری مهارت‌ها ممکن نشد:",FKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?PKe():t==="fa"?HKe():$Ke()}),UKe=()=>"Could not load templates:",qKe=()=>"无法加载模板:",GKe=()=>"بارگیری قالب‌ها ممکن نشد:",VKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qKe():t==="fa"?GKe():UKe()}),WKe=()=>"Customize",KKe=()=>"自定义",YKe=()=>"سفارشی‌سازی",XKe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?KKe():t==="fa"?YKe():WKe()}),ZKe=()=>"Delete skill",QKe=()=>"删除技能",JKe=()=>"حذف مهارت",eYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?QKe():t==="fa"?JKe():ZKe()}),tYe=()=>"Delete template",nYe=()=>"删除模板",rYe=()=>"حذف قالب",sYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?nYe():t==="fa"?rYe():tYe()}),iYe=()=>"LaTeX templates",aYe=()=>"LaTeX 模板",oYe=()=>"قالب‌های LaTeX",lYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?aYe():t==="fa"?oYe():iYe()}),cYe=()=>"Loading skills…",uYe=()=>"正在加载技能…",fYe=()=>"در حال بارگیری مهارت‌ها…",dYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uYe():t==="fa"?fYe():cYe()}),hYe=()=>"Loading templates…",_Ye=()=>"正在加载模板…",pYe=()=>"در حال بارگیری قالب‌ها…",mYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?_Ye():t==="fa"?pYe():hYe()}),gYe=()=>"No skills yet.",bYe=()=>"尚无技能。",vYe=()=>"هنوز مهارتی وجود ندارد.",xYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?bYe():t==="fa"?vYe():gYe()}),yYe=()=>"No templates yet.",wYe=()=>"尚无模板。",SYe=()=>"هنوز قالبی وجود ندارد.",kYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wYe():t==="fa"?SYe():yYe()}),CYe=()=>"Skills",EYe=()=>"技能",NYe=()=>"مهارت‌ها",zYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?EYe():t==="fa"?NYe():CYe()}),jYe=()=>"Uploading…",TYe=()=>"正在上传…",AYe=()=>"در حال بارگذاری…",RYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?TYe():t==="fa"?AYe():jYe()}),MYe=()=>"A conference class or house style the agent writes papers into instead of its default preamble. Upload a .tex file or a .zip containing its .cls and .sty files. With exactly one template available, the agent uses it without asking.",LYe=()=>"智能体会使用会议文档类或内部样式来撰写论文,而不是使用默认导言。请上传 .tex 文件,或包含 .cls 和 .sty 文件的 .zip 压缩包。当恰好只有一个模板可用时,智能体会直接使用,无需询问。",DYe=()=>"عامل به‌جای مقدمهٔ پیش‌فرض، مقاله‌ها را با کلاس همایش یا سبک سازمانی می‌نویسد. یک فایل .tex یا فایل .zip شامل فایل‌های .cls و .sty بارگذاری کنید. وقتی دقیقاً یک قالب موجود باشد، عامل بدون پرسش از آن استفاده می‌کند.",OYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?LYe():t==="fa"?DYe():MYe()}),IYe=()=>"Upload a SKILL.md file or a .zip of a skill folder.",BYe=()=>"请上传 SKILL.md 文件或技能文件夹的 .zip 压缩包。",$Ye=()=>"یک فایل SKILL.md یا فایل .zip از پوشهٔ مهارت بارگذاری کنید.",PYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?BYe():t==="fa"?$Ye():IYe()}),HYe=()=>"Upload a .tex file or a .zip of a template folder.",FYe=()=>"请上传 .tex 文件或模板文件夹的 .zip 压缩包。",UYe=()=>"یک فایل .tex یا فایل .zip از پوشهٔ قالب بارگذاری کنید.",qYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?FYe():t==="fa"?UYe():HYe()}),GYe=()=>"Close SSH config",VYe=()=>"关闭 SSH 配置",WYe=()=>"بستن پیکربندی SSH",KYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?VYe():t==="fa"?WYe():GYe()}),YYe=()=>"Discard your unsaved SSH config changes?",XYe=()=>"要放弃未保存的 SSH 配置更改吗?",ZYe=()=>"تغییرات ذخیره‌نشدهٔ پیکربندی SSH کنار گذاشته شود؟",QYe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?XYe():t==="fa"?ZYe():YYe()}),JYe=()=>"Loading SSH config…",eXe=()=>"正在加载 SSH 配置…",tXe=()=>"در حال بارگیری پیکربندی SSH…",nXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?eXe():t==="fa"?tXe():JYe()}),rXe=()=>"SSH config saved",sXe=()=>"SSH 配置已保存",iXe=()=>"پیکربندی SSH ذخیره شد",aXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sXe():t==="fa"?iXe():rXe()}),oXe=()=>"SSH config",lXe=()=>"SSH 配置",cXe=()=>"پیکربندی SSH",uXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lXe():t==="fa"?cXe():oXe()}),fXe=()=>"Configure SSH hosts…",dXe=()=>"配置 SSH 主机…",hXe=()=>"پیکربندی میزبان‌های SSH…",fA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dXe():t==="fa"?hXe():fXe()}),_Xe=()=>"Cancelled",pXe=()=>"已取消",mXe=()=>"لغوشده",gXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pXe():t==="fa"?mXe():_Xe()}),bXe=()=>"Cancelling",vXe=()=>"正在取消",xXe=()=>"در حال لغو",yXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vXe():t==="fa"?xXe():bXe()}),wXe=()=>"Done",SXe=()=>"已完成",kXe=()=>"انجام‌شده",CXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SXe():t==="fa"?kXe():wXe()}),EXe=()=>"Editing",NXe=()=>"正在编辑",zXe=()=>"در حال ویرایش",jXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NXe():t==="fa"?zXe():EXe()}),TXe=()=>"Failed",AXe=()=>"失败",RXe=()=>"ناموفق",MXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AXe():t==="fa"?RXe():TXe()}),LXe=()=>"Idle",DXe=()=>"空闲",OXe=()=>"بی‌کار",IXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DXe():t==="fa"?OXe():LXe()}),BXe=()=>"Running",$Xe=()=>"运行中",PXe=()=>"در حال اجرا",HXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Xe():t==="fa"?PXe():BXe()}),FXe=()=>"Starting",UXe=()=>"正在启动",qXe=()=>"در حال آغاز",GXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UXe():t==="fa"?qXe():FXe()}),VXe=()=>"Copying…",WXe=()=>"正在复制…",KXe=()=>"در حال کپی…",YXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WXe():t==="fa"?KXe():VXe()}),XXe=()=>"Finalizing…",ZXe=()=>"正在完成…",QXe=()=>"در حال نهایی‌سازی…",JXe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZXe():t==="fa"?QXe():XXe()}),eZe=e=>`${e==null?void 0:e.size} free at target`,tZe=e=>`目标位置可用空间 ${e==null?void 0:e.size}`,nZe=e=>`${e==null?void 0:e.size} فضای آزاد در مقصد`,rZe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?tZe(e):t==="fa"?nZe(e):eZe(e)}),sZe=e=>`Move all orx data to: +${e==null?void 0:e.path} + +The store is copied to the new location and activated there. Active runs or chats will block the move.`,iZe=e=>`将所有 orx 数据移动到: +${e==null?void 0:e.path} + +存储内容会复制到新位置并在那里启用。活跃的运行或聊天会阻止移动。`,aZe=e=>`همهٔ داده‌های orx به این محل منتقل شوند؟ +${e==null?void 0:e.path} + +مخزن داده به محل جدید کپی و همان‌جا فعال می‌شود. اجراها یا گفتگوهای فعال مانع انتقال خواهند شد.`,oZe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?iZe(e):t==="fa"?aZe(e):sZe(e)}),lZe=()=>"Move data here",cZe=()=>"将数据移动到此处",uZe=()=>"انتقال داده به اینجا",fZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?cZe():t==="fa"?uZe():lZe()}),dZe=()=>"Moving…",hZe=()=>"正在移动…",_Ze=()=>"در حال جابه‌جایی…",pZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?hZe():t==="fa"?_Ze():dZe()}),mZe=()=>"Preparing…",gZe=()=>"正在准备…",bZe=()=>"در حال آماده‌سازی…",vZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?gZe():t==="fa"?bZe():mZe()}),xZe=()=>" (same disk, instant)",yZe=()=>"(同一磁盘,可立即完成)",wZe=()=>" (روی همان دیسک، فوری)",SZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?yZe():t==="fa"?wZe():xZe()}),kZe=()=>"default location",CZe=()=>"默认位置",EZe=()=>"محل پیش‌فرض",NZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?CZe():t==="fa"?EZe():kZe()}),zZe=()=>"ORX_DATA_DIR environment variable",jZe=()=>"ORX_DATA_DIR 环境变量",TZe=()=>"متغیر محیطی ORX_DATA_DIR",AZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?jZe():t==="fa"?TZe():zZe()}),RZe=()=>"your saved setting",MZe=()=>"已保存的设置",LZe=()=>"تنظیم ذخیره‌شدهٔ شما",DZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?MZe():t==="fa"?LZe():RZe()}),OZe=()=>"XDG_DATA_HOME",IZe=()=>"XDG_DATA_HOME",BZe=()=>"XDG_DATA_HOME",$Ze=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?IZe():t==="fa"?BZe():OZe()}),PZe=()=>"Verifying…",HZe=()=>"正在验证…",FZe=()=>"در حال بررسی…",UZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?HZe():t==="fa"?FZe():PZe()}),qZe=()=>"Loading…",GZe=()=>"正在加载…",VZe=()=>"در حال بارگیری…",WZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?GZe():t==="fa"?VZe():qZe()}),KZe=()=>"This sub-agent is no longer available.",YZe=()=>"此子智能体已不可用。",XZe=()=>"این عامل فرعی دیگر در دسترس نیست.",ZZe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?YZe():t==="fa"?XZe():KZe()}),QZe=e=>`${e==null?void 0:e.label} (preview; double-click or Command/Control K, then Enter to keep open)`,JZe=e=>`${e==null?void 0:e.label}(预览;双击或按 Command/Control K 后按 Enter 以保持打开)`,eQe=e=>`${e==null?void 0:e.label} (پیش‌نمایش؛ برای باز نگه‌داشتن دوبار کلیک کنید یا Command/Control K و سپس Enter را بزنید)`,tQe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?JZe(e):t==="fa"?eQe(e):QZe(e)}),nQe=e=>`${e==null?void 0:e.label} (double-click or ⌘/Ctrl+K Enter to keep open)`,rQe=e=>`${e==null?void 0:e.label}(双击或按 ⌘/Ctrl+K 后按 Enter 以保持打开)`,sQe=e=>`${e==null?void 0:e.label} (برای باز نگه‌داشتن دوبار کلیک کنید یا ⌘/Ctrl+K و سپس Enter را بزنید)`,iQe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?rQe(e):t==="fa"?sQe(e):nQe(e)}),aQe=()=>", a repo for training a mini-GPT from scratch.",oQe=()=>",一个从零训练迷你 GPT 的仓库。",lQe=()=>"، اثر Andrej Karpathy، مخزنی برای آموزش یک GPT کوچک از صفر، استفاده می‌کند.",cQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?oQe():t==="fa"?lQe():aQe()}),uQe=()=>"Close",fQe=()=>"关闭",dQe=()=>"بستن",hQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?fQe():t==="fa"?dQe():uQe()}),_Qe=()=>"Create a new project",pQe=()=>"新建项目",mQe=()=>"ایجاد پروژهٔ جدید",gQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?pQe():t==="fa"?mQe():_Qe()}),bQe=()=>"Demo project",vQe=()=>"演示项目",xQe=()=>"پروژهٔ نمایشی",yQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?vQe():t==="fa"?xQe():bQe()}),wQe=()=>"Explore the demo",SQe=()=>"探索演示项目",kQe=()=>"دیدن پروژهٔ نمایشی",CQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?SQe():t==="fa"?kQe():wQe()}),EQe=()=>"Look through the agent conversations, experiments, runs, and artifacts to see how a project on OpenResearch comes together.",NQe=()=>"浏览智能体对话、实验、运行和产物,了解 OpenResearch 项目是如何形成的。",zQe=()=>"گفتگوهای عامل، آزمایش‌ها، اجراها و خروجی‌ها را ببینید تا با شکل‌گیری یک پروژه در OpenResearch آشنا شوید.",jQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NQe():t==="fa"?zQe():EQe()}),TQe=()=>"nanochat",AQe=()=>"nanochat",RQe=()=>"nanochat",MQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AQe():t==="fa"?RQe():TQe()}),LQe=()=>"Couldn’t save your progress. Try again.",DQe=()=>"无法保存进度。请重试。",OQe=()=>"ذخیرهٔ پیشرفت ممکن نشد. دوباره تلاش کنید.",IQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DQe():t==="fa"?OQe():LQe()}),BQe=()=>"This is a demo project showing how OpenResearch works. This demo uses Andrej Karpathy's",$Qe=()=>"这是一个展示 OpenResearch 工作方式的演示项目。本演示使用 Andrej Karpathy 的",PQe=()=>"این پروژهٔ نمایشی نحوهٔ کار OpenResearch را نشان می‌دهد. این نسخهٔ نمایشی از",HQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Qe():t==="fa"?PQe():BQe()}),FQe=()=>"Welcome to OpenResearch",UQe=()=>"欢迎使用 OpenResearch",qQe=()=>"به OpenResearch خوش آمدید",GQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UQe():t==="fa"?qQe():FQe()}),VQe=()=>"Baseline",WQe=()=>"基线",KQe=()=>"مبنا",YQe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WQe():t==="fa"?KQe():VQe()}),XQe=()=>"Experiment",ZQe=()=>"实验",QQe=()=>"آزمایش",Go=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZQe():t==="fa"?QQe():XQe()}),JQe=e=>`${e==null?void 0:e.count} experiments`,eJe=e=>`${e==null?void 0:e.count} 个实验`,tJe=e=>`${e==null?void 0:e.count} آزمایش`,nJe=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?eJe(e):t==="fa"?tJe(e):JQe(e)}),rJe=()=>"1 experiment",sJe=()=>"1 个实验",iJe=()=>"۱ آزمایش",aJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?sJe():t==="fa"?iJe():rJe()}),oJe=()=>"Running",lJe=()=>"运行中",cJe=()=>"در حال اجرا",uJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?lJe():t==="fa"?cJe():oJe()}),fJe=()=>"Ask in this task to create one, or switch to Entire project to see all experiments.",dJe=()=>"在此任务中请求创建实验,或切换到“整个项目”查看所有实验。",hJe=()=>"در این وظیفه بخواهید یکی ساخته شود، یا برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید.",_Je=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?dJe():t==="fa"?hJe():fJe()}),pJe=()=>"Ask the agent in chat to create and run your first experiment.",mJe=()=>"在聊天中让智能体创建并运行你的第一个实验。",gJe=()=>"در گفتگو از عامل بخواهید نخستین آزمایش شما را بسازد و اجرا کند.",bJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?mJe():t==="fa"?gJe():pJe()}),vJe=()=>"Code",xJe=()=>"代码",yJe=()=>"کد",wJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xJe():t==="fa"?yJe():vJe()}),SJe=()=>"Logs",kJe=()=>"日志",CJe=()=>"گزارش‌ها",dA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?kJe():t==="fa"?CJe():SJe()}),EJe=()=>"No experiments from the current task yet",NJe=()=>"当前任务尚无实验",zJe=()=>"وظیفهٔ فعلی هنوز آزمایشی ندارد",jJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?NJe():t==="fa"?zJe():EJe()}),TJe=()=>"No experiments yet",AJe=()=>"尚无实验",RJe=()=>"هنوز آزمایشی وجود ندارد",MJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?AJe():t==="fa"?RJe():TJe()}),LJe=()=>"no runs",DJe=()=>"无运行",OJe=()=>"بدون اجرا",IJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?DJe():t==="fa"?OJe():LJe()}),BJe=()=>"Open logs",$Je=()=>"打开日志",PJe=()=>"باز کردن گزارش‌ها",HJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?$Je():t==="fa"?PJe():BJe()}),FJe=()=>"other tasks",UJe=()=>"其他任务",qJe=()=>"وظایف دیگر",GJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?UJe():t==="fa"?qJe():FJe()}),VJe=()=>"Runs",WJe=()=>"运行",KJe=()=>"اجراها",YJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?WJe():t==="fa"?KJe():VJe()}),XJe=()=>"Switch to Entire project to see all experiments",ZJe=()=>"切换到“整个项目”以查看所有实验",QJe=()=>"برای دیدن همهٔ آزمایش‌ها به «کل پروژه» بروید",JJe=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ZJe():t==="fa"?QJe():XJe()}),eet=e=>`Updated to ${e==null?void 0:e.version}. Restart to use it.`,tet=e=>`已更新到 ${e==null?void 0:e.version}。重新启动即可使用。`,net=e=>`به ${e==null?void 0:e.version} به‌روزرسانی شد. برای استفاده دوباره راه‌اندازی کنید.`,ret=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?tet(e):t==="fa"?net(e):eet(e)}),set=()=>"Dismiss",iet=()=>"关闭",aet=()=>"بستن",oet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?iet():t==="fa"?aet():set()}),cet=()=>"Restart now",uet=()=>"立即重新启动",fet=()=>"هم‌اکنون دوباره راه‌اندازی کن",hA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?uet():t==="fa"?fet():cet()}),det=e=>`Could not restart: ${e==null?void 0:e.error}`,het=e=>`无法重新启动:${e==null?void 0:e.error}`,_et=e=>`راه‌اندازی مجدد ممکن نشد: ${e==null?void 0:e.error}`,_A=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?het(e):t==="fa"?_et(e):det(e)}),pet=()=>"The updated OpenResearch did not come back in time. Restart it by hand.",met=()=>"更新后的 OpenResearch 未能及时恢复。请手动重新启动。",get=()=>"OpenResearch به‌روزشده به‌موقع برنگشت. آن را به‌صورت دستی دوباره راه‌اندازی کنید.",bet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?met():t==="fa"?get():pet()}),vet=()=>"Restarting…",xet=()=>"正在重新启动…",yet=()=>"در حال راه‌اندازی مجدد…",pA=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?xet():t==="fa"?yet():vet()}),wet=()=>"macOS app",ket=()=>"macOS 应用",Cet=()=>"برنامهٔ macOS",Eet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ket():t==="fa"?Cet():wet()}),Net=()=>"Installed with cargo",zet=()=>"通过 cargo 安装",jet=()=>"نصب‌شده با cargo",Tet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?zet():t==="fa"?jet():Net()}),Aet=()=>"Installed with Homebrew",Ret=()=>"通过 Homebrew 安装",Met=()=>"نصب‌شده با Homebrew",Let=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ret():t==="fa"?Met():Aet()}),Det=()=>"Installed with the orx installer",Oet=()=>"通过 orx 安装程序安装",Iet=()=>"نصب‌شده با نصب‌کنندهٔ orx",Bet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Oet():t==="fa"?Iet():Det()}),$et=()=>"Managed by Nix",Pet=()=>"由 Nix 管理",Het=()=>"مدیریت‌شده با Nix",Fet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Pet():t==="fa"?Het():$et()}),Uet=()=>"Unknown install",qet=()=>"未知安装方式",Get=()=>"روش نصب نامشخص",Vet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?qet():t==="fa"?Get():Uet()}),Wet=()=>"Re-run your cargo install to update.",Ket=()=>"重新运行 cargo 安装命令以更新。",Yet=()=>"برای به‌روزرسانی، نصب cargo را دوباره اجرا کنید.",Xet=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ket():t==="fa"?Yet():Wet()}),Zet=()=>"Run brew upgrade to update.",Qet=()=>"运行 brew upgrade 以更新。",Jet=()=>"برای به‌روزرسانی brew upgrade را اجرا کنید.",ett=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Qet():t==="fa"?Jet():Zet()}),ttt=()=>"Update it through your Nix configuration.",ntt=()=>"通过 Nix 配置进行更新。",rtt=()=>"از طریق پیکربندی Nix به‌روزرسانی کنید.",stt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?ntt():t==="fa"?rtt():ttt()}),itt=e=>`Current worktree · ${e==null?void 0:e.branch}`,att=e=>`当前工作树 · ${e==null?void 0:e.branch}`,ott=e=>`درخت کاری کنونی · ${e==null?void 0:e.branch}`,ltt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?att(e):t==="fa"?ott(e):itt(e)}),ctt=e=>`Default branch · ${e==null?void 0:e.branch}`,utt=e=>`默认分支 · ${e==null?void 0:e.branch}`,ftt=e=>`شاخهٔ پیش‌فرض · ${e==null?void 0:e.branch}`,dtt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?utt(e):t==="fa"?ftt(e):ctt(e)}),htt=e=>`detached at ${e==null?void 0:e.branch}`,_tt=e=>`分离于 ${e==null?void 0:e.branch}`,ptt=e=>`جدا در ${e==null?void 0:e.branch}`,mtt=((e,n={})=>{const t=n.locale??j();return t==="zh-CN"?_tt(e):t==="fa"?ptt(e):htt(e)}),gtt=()=>"Listing truncated.",btt=()=>"列表已截断。",vtt=()=>"فهرست کوتاه شده است.",xtt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?btt():t==="fa"?vtt():gtt()}),ytt=()=>"Loading…",wtt=()=>"正在加载…",Stt=()=>"در حال بارگیری…",ktt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?wtt():t==="fa"?Stt():ytt()}),Ctt=()=>"No changes yet.",Ett=()=>"尚无更改。",Ntt=()=>"هنوز تغییری وجود ندارد.",ztt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ett():t==="fa"?Ntt():Ctt()}),jtt=()=>"No files.",Ttt=()=>"没有文件。",Att=()=>"فایلی وجود ندارد.",Rtt=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ttt():t==="fa"?Att():jtt()}),Mtt=()=>"Refresh failed:",Ltt=()=>"刷新失败:",Dtt=()=>"تازه‌سازی ناموفق بود:",Ott=((e={},n={})=>{const t=n.locale??j();return t==="zh-CN"?Ltt():t==="fa"?Dtt():Mtt()}),ze=e=>`⁦${e}⁩`,Ja=e=>`⁨${e}⁩`,Xt=e=>new Intl.NumberFormat(j()).format(e),hC="demo_nanochat_v1",ou=e=>e.startsWith("demo_"),_m="chat_demo_nanochat_v1",mA="chat_demo_nanochat_figures_v1",gA="chat_demo_nanochat_literature_v1",pm="cpu-apple-silicon-pipeline-results.md",Itt="Run the Muon matrix LR 2× probe experiment. When it finishes, compare its step-100 and step-200 val_bpb against the baseline and tell me whether doubling the matrix learning rate helps early training.";class Uy extends Error{constructor(t,r,s){super(t);Es(this,"currentVersion");Es(this,"exists");this.name="FileChangedError",this.currentVersion=r,this.exists=s}}function ea(e){return(e.status==="running"||e.status==="starting")&&e.cancelRequested?"cancelling":e.status}async function ra(e){if(!e.ok){const n=await e.text().catch(()=>"");let t=n;try{const r=JSON.parse(n);if(typeof r=="object"&&r!==null&&("error"in r&&typeof r.error=="string"&&(t=r.error),e.status===409&&"code"in r&&r.code==="fileChanged"&&"exists"in r&&typeof r.exists=="boolean")){const s="currentVersion"in r&&typeof r.currentVersion=="string"?r.currentVersion:null;throw new Uy(t,s,r.exists)}}catch(r){if(r instanceof Uy)throw r}throw new Error(t||`HTTP ${e.status}`)}return await e.json()}const jt=e=>fetch(e).then(n=>ra(n)),Mt=(e,n,t=!1)=>fetch(e,{method:"POST",keepalive:t,headers:n===void 0?{}:{"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}).then(r=>ra(r)),wd=(e,n)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ra(t)),bA=(e,n)=>fetch(e,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(n)}).then(t=>ra(t)),n4=()=>jt("/api/projects").then(e=>e.projects),Btt=()=>jt("/api/projects/activity").then(e=>e.activity),Ig=()=>jt("/api/settings/ui-state"),vA=e=>jt(`/api/projects/${encodeURIComponent(e)}/ui-state`),$tt=(e,n,t=!1)=>Mt(`/api/projects/${encodeURIComponent(e)}/ui-state`,n,t),Ptt=(e,n=!1)=>Mt("/api/settings/ui-state",{workspace:e},n),_C=e=>Mt("/api/settings/ui-state",e),Htt=(e,n)=>Mt("/api/onboarding/complete",{...e,...n}),xA=(e="")=>{const n=e?`?path=${encodeURIComponent(e)}`:"";return jt(`/api/project-path/status${n}`)},Ftt=()=>Mt("/api/project-path/pick").then(e=>e.path),Utt=e=>Mt("/api/projects",e),yA=e=>jt(`/api/papers/search?q=${encodeURIComponent(e)}`).then(n=>n.papers),qtt=()=>jt("/api/github/account"),Gtt=e=>jt(`/api/github/project-repo-preview?name=${encodeURIComponent(e)}`),Vtt=(e,n)=>jt(`/api/github/repo-access?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(n)}`),qy=e=>jt(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(n=>n.paper),Wtt=e=>Mt("/api/projects/starter-prompts/prewarm",e),Ktt=(e,n,t,r)=>jt(`/api/projects/${e}/starter-prompts?${new URLSearchParams({harness:n,...t?{model:t}:{},locale:r})}`),Ytt=e=>Mt(`/api/projects/${e}/open`).then(n=>n.project),Xtt=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async n=>{if(!n.ok){const t=await n.json().catch(()=>null);throw new Error((t==null?void 0:t.error)??`delete failed (${n.status})`)}}),Ztt=e=>jt(`/api/projects/${e}/experiments`).then(n=>n.experiments),r4=e=>jt(`/api/projects/${e}/runs`).then(n=>n.runs),wA=e=>Mt(`/api/runs/${e}/cancel`).then(()=>{}),Qtt=(e,n)=>jt(`/api/runs/${e}/log?offset=${n}`),Jtt=e=>jt(`/api/runs/${e}/diff`),ent=e=>jt(`/api/experiments/${e}/diff`),Lu=(e,n=new URLSearchParams)=>(e.sessionId&&n.set("sessionId",e.sessionId),e.ref&&n.set("ref",e.ref),n),pC=(e,n,t={})=>jt(`/api/projects/${e}/file?${Lu(t,new URLSearchParams({path:n}))}`),mC=(e,n,t={})=>`/api/projects/${e}/file/raw?${Lu(t,new URLSearchParams({path:n}))}`,tnt=e=>jt(`/api/files/abs?path=${encodeURIComponent(e)}`),nnt=e=>`/api/files/abs/raw?path=${encodeURIComponent(e)}`,rnt=(e,n,t,r)=>bA(`/api/projects/${e}/file`,{path:n,content:t,sessionId:r.sessionId,expectedVersion:r.expectedVersion}),snt=(e,n,t,r={})=>wd(`/api/projects/${e}/file`,{path:n,...t,sessionId:r.sessionId}),int=(e,n,t={})=>Mt(`/api/projects/${e}/file/open`,{path:n,sessionId:t.sessionId}),ant=()=>jt("/api/latex/engine"),ont=(e,n,t={})=>Mt(`/api/projects/${e}/file/latex`,{path:n,sessionId:t.sessionId}),lnt=()=>jt("/api/overleaf/settings"),SA=e=>Mt("/api/overleaf/token",{token:e}),cnt=()=>fetch("/api/overleaf/token",{method:"DELETE"}).then(e=>ra(e)),unt=(e,n,t={})=>jt(`/api/projects/${e}/file/overleaf?${Lu(t,new URLSearchParams({path:n}))}`),fnt=(e,n,t)=>Mt(`/api/projects/${e}/file/overleaf`,{path:n,project:t.project,sessionId:t.sessionId}),dnt=(e,n,t={})=>fetch(`/api/projects/${e}/file/overleaf?${Lu(t,new URLSearchParams({path:n}))}`,{method:"DELETE"}).then(r=>ra(r)),hnt=(e,n,t={})=>Mt(`/api/projects/${e}/file/overleaf/sync`,{path:n,sessionId:t.sessionId,resolve:t.resolve}),_nt=(e,n,t={})=>jt(`/api/projects/${e}/file/overleaf/status?${Lu(t,new URLSearchParams({path:n}))}`),pnt=(e,n,t={})=>`/api/projects/${e}/file/overleaf/upload?${Lu(t,new URLSearchParams({path:n}))}`,Gy=(e,n={})=>{const t=Lu(n).toString();return jt(`/api/projects/${e}/code-tree${t?`?${t}`:""}`)},kA=e=>jt(`/api/chat/sessions/${e}/worktree`),Bg=(e,n,t)=>`https://github.com/${e}/${n}/tree/${t.split("/").map(encodeURIComponent).join("/")}`,gC=()=>jt("/api/settings/hf"),mnt=e=>Mt("/api/settings/hf",{token:e}),bC=()=>jt("/api/settings/tinker"),gnt=e=>Mt("/api/settings/tinker",{key:e}),CA=()=>jt("/api/update"),bnt=()=>Mt("/api/update/apply"),vnt=()=>Mt("/api/update/restart"),xnt=e=>Mt("/api/update/auto",{enabled:e}),ynt=(e=!1)=>Mt("/api/update/install-cli",{force:e}),vC=()=>jt("/api/settings/k8s"),wnt=e=>Mt("/api/settings/k8s",e),xC=()=>jt("/api/settings/modal"),Snt=(e,n)=>Mt("/api/settings/modal",{tokenId:e,tokenSecret:n}),knt=()=>jt("/api/settings/env").then(e=>e.vars),EA=(e,n)=>Mt("/api/settings/env",{key:e,value:n}).then(t=>t.vars),Cnt=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ra(n)).then(n=>n.vars),Ent=()=>jt("/api/settings/data-dir"),Nnt=e=>Mt("/api/settings/data-dir/validate",{path:e}),znt=e=>Mt("/api/settings/data-dir/move",{path:e}),NA=()=>jt("/api/settings/ssh").then(e=>e.hosts),jnt=()=>jt("/api/settings/ssh/config"),Tnt=(e,n)=>bA("/api/settings/ssh/config",{content:e,previousContent:n}),Ant=e=>jt(`/api/settings/ssh/master?host=${encodeURIComponent(e)}`),Rnt=()=>jt("/_orx/runtime"),Mnt=()=>jt("/api/remote/sessions").then(e=>e.sessions),Lnt=(e,n)=>Mt("/api/remote/sessions",{host:e,uiPreferences:n}),Dnt=e=>Mt("/_orx/install",e),Ont=()=>Mt("/_orx/reconnect"),zA=()=>Mt("/_orx/disconnect"),Int=()=>Mt("/_orx/start-host"),jA=()=>jt("/_orx/stop-host"),TA=e=>Mt("/_orx/stop-host",{expectedInstanceId:e.instanceId,expectedPreview:{activeTurnCount:e.activeTurnCount,queuedMessageCount:e.queuedMessageCount,pendingPermissionCount:e.pendingPermissionCount,activeRunCount:e.activeRunCount,attachmentCount:e.attachmentCount}}),Bnt=()=>jt("/api/settings/slurm"),$nt=e=>Mt("/api/settings/slurm",e),Pnt=()=>jt("/api/settings/ray"),Hnt=e=>Mt("/api/settings/ray",e),Fnt=e=>Mt("/api/settings/ray/preflight",{address:e??null}),Unt=e=>jt(`/api/settings/compute${e?`?projectId=${encodeURIComponent(e)}`:""}`),qnt=e=>Mt("/api/settings/compute/default",e),Gnt=()=>jt("/api/settings/local"),Vnt=()=>jt("/api/settings/openresearch"),yC=e=>jt(`/api/projects/${e}/files`),Wnt=(e,n)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ra(t)),Knt=(e,n,t)=>wd(`/api/projects/${e}/files`,{path:n,...t}),nd=(e,n)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(n)}`,AA=512e3,Ynt=(e,n)=>{const t=new Uint8Array(e);if(t.includes(0))return{content:"",binary:!0,truncated:n};try{return{content:new TextDecoder("utf-8",{fatal:!0}).decode(t,{stream:n}),binary:!1,truncated:n}}catch{return{content:"",binary:!0,truncated:n}}},RA=(e,n)=>fetch(nd(e,n),{headers:{Range:`bytes=0-${AA-1}`}}).then(t=>{var s;if(t.status===404)return null;if(t.status===416&&t.headers.get("content-range")==="bytes */0")return{content:"",binary:!1,truncated:!1};if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=Number((s=t.headers.get("content-range"))==null?void 0:s.split("/").pop());return t.arrayBuffer().then(i=>Ynt(i,Number.isFinite(r)&&r>i.byteLength))}),Xnt=e=>e==="image"||e==="audio"||e==="video"||e==="pdf"||e==="text"||e==="unknown"||e==="download",Znt=(e,n)=>fetch(nd(e,n),{method:"HEAD"}).then(t=>{if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);const r=t.headers.get("x-openresearch-presentation");return{size:Number(t.headers.get("content-length"))||0,presentation:Xnt(r)?r:"download"}}),Qnt=()=>jt("/api/settings/profile"),Jnt=()=>jt("/api/settings/lit-sources"),ert=e=>Mt("/api/settings/lit-sources",e),s4=()=>jt("/api/settings/projects"),MA=(e,n)=>Mt("/api/settings/projects",{githubForNewProjects:e,githubDefaultPromptSeen:n}),trt=e=>jt(`/api/projects/${e}/git`),nrt=e=>Mt(`/api/projects/${e}/git/init`),rrt=e=>Mt(`/api/projects/${e}/github`),srt=e=>Mt(`/api/projects/${e}/github/disable`),irt=()=>jt("/api/settings/telemetry"),art=e=>Mt("/api/settings/telemetry",{enabled:e}),Vm=e=>e.displayName??OA(e.id),Wm="default";function $g(e,n){var a,o,c;const t=e==null?void 0:e.models.find(u=>u.id===n),r=(t==null?void 0:t.reasoningLevels)??((a=e==null?void 0:e.options)==null?void 0:a.reasoningLevels)??[],s=t==null?void 0:t.defaultReasoningLevel,i=s&&r.some(u=>u.id===s)?s:r.some(u=>u.id===Wm)?Wm:((o=e==null?void 0:e.options)==null?void 0:o.defaultReasoningLevel)??((c=r[0])==null?void 0:c.id)??null;return{choices:r,defaultId:i}}const Vy="default";function LA(e,n){var r;if((e==null?void 0:e.id)!=="codex")return[];const t=(r=e.models.find(s=>s.id===n))==null?void 0:r.serviceTiers;return t!=null&&t.length?[{id:Vy,label:jTe(),description:CTe()},...t]:[]}function Km(e,n,t){var i;if(!e)return t??null;if(e.id!=="codex"||((i=e.models.find(a=>a.id===n))==null?void 0:i.serviceTiers)===void 0)return null;const s=LA(e,n);return s.length===0?Vy:t!=null&&s.some(a=>a.id===t)?t:Vy}function DA(e,n,t){if(!e)return t;const{choices:r,defaultId:s}=$g(e,n);return r.length===0?Wm:t&&r.some(i=>i.id===t)?t:s}const Ym=(e=!1,n=!1)=>{const t=new URLSearchParams;e&&t.set("refresh","1"),n&&t.set("retry","1");const r=t.size>0?`?${t.toString()}`:"";return jt(`/api/harnesses${r}`).then(s=>s.harnesses)},ort=()=>jt("/api/skills").then(e=>e.skills),lrt=(e,n)=>jt(`/api/skills/${encodeURIComponent(e)}${n?`?project=${encodeURIComponent(n)}`:""}`).then(t=>t.content),crt=()=>jt("/api/latex-templates").then(e=>e.templates),urt=e=>Mt("/api/latex-templates",e).then(n=>n.template),frt=e=>fetch(`/api/latex-templates?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ra(n)),drt=()=>jt("/api/user-skills").then(e=>e.skills),hrt=e=>Mt("/api/user-skills",e).then(n=>n.skill),_rt=e=>fetch(`/api/user-skills?name=${encodeURIComponent(e)}`,{method:"DELETE"}).then(n=>ra(n));function OA(e){const n=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),t=[],r=[];for(const s of n.split("-"))/^\d+(\.\d+)?$/.test(s)?r.push(s):(r.length&&t.push(r.splice(0).join(".")),t.push(s==="gpt"?"GPT":s.charAt(0).toUpperCase()+s.slice(1)));return r.length&&t.push(r.join(".")),t.join(" ")}const gu=e=>jt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(n=>n.sessions),prt=(e,n,t={})=>Mt("/api/chat/sessions",{projectId:e,harness:n,...t}).then(r=>r.session),mrt=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(n=>ra(n)),grt=(e,n)=>wd(`/api/chat/sessions/${e}`,{archived:n}).then(t=>t.session),brt=(e,n)=>wd(`/api/chat/sessions/${e}`,{title:n}).then(t=>t.session),vrt=(e,n)=>wd(`/api/chat/sessions/${e}`,{planMode:n}).then(t=>t.session),xrt=(e,n)=>wd(`/api/chat/sessions/${e}`,{permissionMode:n}).then(t=>t.session),uu=e=>jt(`/api/chat/sessions/${e}/messages`).then(n=>({messages:n.messages,queued:n.queued??[],activeLeafId:n.activeLeafId??null})),yrt=(e,n)=>fetch(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`,{method:"DELETE"}).then(t=>ra(t)),wrt=(e,n)=>Mt(`/api/chat/sessions/${e}/queue/${encodeURIComponent(n)}`),Srt=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,wC=(e,n,t={},r,s,i,a)=>Mt(`/api/chat/sessions/${e}/message`,{text:n,clientTurnId:i,model:t.model,serviceTier:t.serviceTier,permissionMode:t.permissionMode,planMode:t.planMode,reasoningLevel:t.reasoningLevel,images:r,annotations:s,mode:a}),krt=(e,n)=>Mt(`/api/chat/sessions/${e}/shell`,{command:n}),Crt=(e,n,t,r={})=>Mt(`/api/chat/sessions/${e}/turns/${n}/recover`,{action:t,...r}),Ert=(e,n,t)=>Mt(`/api/chat/sessions/${e}/fork`,{messageId:n,text:t}),Nrt=(e,n)=>Mt(`/api/chat/sessions/${e}/branch`,{leafId:n}),zrt=e=>Mt(`/api/chat/sessions/${e}/interrupt`),jrt=(e,n)=>Mt(`/api/chat/sessions/${e}/respond`,n);function no(e){const n=Math.max(0,Math.floor((Date.now()-e)/1e3)),t=new Intl.RelativeTimeFormat(j(),{numeric:"always",style:"narrow"});if(n<60)return t.format(-n,"second");const r=Math.floor(n/60);if(r<60)return t.format(-r,"minute");const s=Math.floor(r/60);return s<24?t.format(-s,"hour"):t.format(-Math.floor(s/24),"day")}function Xm(e){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return Bhe({value:Xt(n)});const t=Math.floor(n/60);if(t<60)return Lhe({value:Xt(t)});const r=Math.floor(t/60);return r<24?The({hours:Xt(r),minutes:Xt(t%60)}):Ehe({days:Xt(Math.floor(r/24)),hours:Xt(r%24)})}function Yo(e){const n=["B","KB","MB","GB","TB"];let t=e,r=0;for(;t>=1024&&rWy.delete(e)}function Du(){return T.useSyncExternalStore(Art,j,j)}const BA="orx:theme";function Rrt(){try{const e=localStorage.getItem(BA);if(e==="light"||e==="dark"||e==="system")return e}catch{}return"system"}let rd=Rrt();const Ky=new Set;function Mrt(e){return e!=="system"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function a4(){document.documentElement.dataset.theme=Mrt(rd)}function $A(e){rd=e;try{localStorage.setItem(BA,e)}catch{}a4();for(const n of Ky)n()}function Lrt(){return rd}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{rd==="system"&&a4()});a4();function Drt(e){return Ky.add(e),()=>Ky.delete(e)}function PA(){return[T.useSyncExternalStore(Drt,()=>rd,()=>rd),$A]}const Ort=(e,n)=>{const t=new Array(e.length+n.length);for(let r=0;r({classGroupId:e,validator:n}),HA=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),Zm="-",SC=[],Brt="arbitrary..",$rt=e=>{const n=Hrt(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Prt(a);const o=a.split(Zm),c=o[0]===""&&o.length>1?1:0;return FA(o,c,n)},getConflictingClassGroupIds:(a,o)=>{if(o){const c=r[a],u=t[a];return c?u?Ort(u,c):c:u||SC}return t[a]||SC}}},FA=(e,n,t)=>{if(e.length-n===0)return t.classGroupId;const s=e[n],i=t.nextPart.get(s);if(i){const u=FA(e,n+1,i);if(u)return u}const a=t.validators;if(a===null)return;const o=n===0?e.join(Zm):e.slice(n).join(Zm),c=a.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?Brt+r:void 0})(),Hrt=e=>{const{theme:n,classGroups:t}=e;return Frt(t,n)},Frt=(e,n)=>{const t=HA();for(const r in e){const s=e[r];o4(s,t,r,n)}return t},o4=(e,n,t,r)=>{const s=e.length;for(let i=0;i{if(typeof e=="string"){qrt(e,n,t);return}if(typeof e=="function"){Grt(e,n,t,r);return}Vrt(e,n,t,r)},qrt=(e,n,t)=>{const r=e===""?n:UA(n,e);r.classGroupId=t},Grt=(e,n,t,r)=>{if(Wrt(e)){o4(e(r),n,t,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Irt(t,e))},Vrt=(e,n,t,r)=>{const s=Object.entries(e),i=s.length;for(let a=0;a{let t=e;const r=n.split(Zm),s=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,Krt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const s=(i,a)=>{t[i]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(i){let a=t[i];if(a!==void 0)return a;if((a=r[i])!==void 0)return s(i,a),a},set(i,a){i in t?t[i]=a:s(i,a)}}},Yy="!",kC=":",Yrt=[],CC=(e,n,t,r,s)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:s}),Xrt=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=s=>{const i=[];let a=0,o=0,c=0,u;const _=s.length;for(let S=0;S<_;S++){const b=s[S];if(a===0&&o===0){if(b===kC){i.push(s.slice(c,S)),c=S+1;continue}if(b==="/"){u=S;continue}}b==="["?a++:b==="]"?a--:b==="("?o++:b===")"&&o--}const f=i.length===0?s:s.slice(c);let p=f,m=!1;f.endsWith(Yy)?(p=f.slice(0,-1),m=!0):f.startsWith(Yy)&&(p=f.slice(1),m=!0);const x=u&&u>c?u-c:void 0;return CC(i,m,p,x)};if(n){const s=n+kC,i=r;r=a=>a.startsWith(s)?i(a.slice(s.length)):CC(Yrt,!1,a,void 0,!0)}if(t){const s=r;r=i=>t({className:i,parseClassName:s})}return r},Zrt=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((t,r)=>{n.set(t,1e6+r)}),t=>{const r=[];let s=[];for(let i=0;i0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},Qrt=e=>({cache:Krt(e.cacheSize),parseClassName:Xrt(e),sortModifiers:Zrt(e),postfixLookupClassGroupIds:Jrt(e),...$rt(e)}),Jrt=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let r=0;r{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:i,postfixLookupClassGroupIds:a}=n,o=[],c=e.trim().split(est);let u="";for(let _=c.length-1;_>=0;_-=1){const f=c[_],{isExternal:p,modifiers:m,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:b}=t(f);if(p){u=f+(u.length>0?" "+u:u);continue}let v=!!b,y;if(v){const R=S.substring(0,b);y=r(R);const N=y&&a[y]?r(S):void 0;N&&N!==y&&(y=N,v=!1)}else y=r(S);if(!y){if(!v){u=f+(u.length>0?" "+u:u);continue}if(y=r(S),!y){u=f+(u.length>0?" "+u:u);continue}v=!1}const w=m.length===0?"":m.length===1?m[0]:i(m).join(":"),C=x?w+Yy:w,z=C+y;if(o.indexOf(z)>-1)continue;o.push(z);const E=s(y,v);for(let R=0;R0?" "+u:u)}return u},nst=(...e)=>{let n=0,t,r,s="";for(;n{if(typeof e=="string")return e;let n,t="";for(let r=0;r{let t,r,s,i;const a=c=>{const u=n.reduce((_,f)=>f(_),e());return t=Qrt(u),r=t.cache.get,s=t.cache.set,i=o,o(c)},o=c=>{const u=r(c);if(u)return u;const _=tst(c,t);return s(c,_),_};return i=a,(...c)=>i(nst(...c))},rst=[],Qr=e=>{const n=t=>t[e]||rst;return n.isThemeGetter=!0,n},GA=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,VA=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sst=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ist=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ast=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ost=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lst=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cst=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ql=e=>sst.test(e),cn=e=>!!e&&!Number.isNaN(Number(e)),Ha=e=>!!e&&Number.isInteger(Number(e)),ax=e=>e.endsWith("%")&&cn(e.slice(0,-1)),Ho=e=>ist.test(e),WA=()=>!0,ust=e=>ast.test(e)&&!ost.test(e),l4=()=>!1,fst=e=>lst.test(e),dst=e=>cst.test(e),hst=e=>!ct(e)&&!ht(e),_st=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),pst=e=>xc(e,XA,l4),ct=e=>GA.test(e),Zc=e=>xc(e,ZA,ust),NC=e=>xc(e,Sst,cn),mst=e=>xc(e,JA,WA),gst=e=>xc(e,QA,l4),zC=e=>xc(e,KA,l4),bst=e=>xc(e,YA,dst),Cp=e=>xc(e,eR,fst),ht=e=>VA.test(e),Ch=e=>Ou(e,ZA),vst=e=>Ou(e,QA),jC=e=>Ou(e,KA),xst=e=>Ou(e,XA),yst=e=>Ou(e,YA),Ep=e=>Ou(e,eR,!0),wst=e=>Ou(e,JA,!0),xc=(e,n,t)=>{const r=GA.exec(e);return r?r[1]?n(r[1]):t(r[2]):!1},Ou=(e,n,t=!1)=>{const r=VA.exec(e);return r?r[1]?n(r[1]):t:!1},KA=e=>e==="position"||e==="percentage",YA=e=>e==="image"||e==="url",XA=e=>e==="length"||e==="size"||e==="bg-size",ZA=e=>e==="length",Sst=e=>e==="number",QA=e=>e==="family-name",JA=e=>e==="number"||e==="weight",eR=e=>e==="shadow",TC=()=>{const e=Qr("color"),n=Qr("font"),t=Qr("text"),r=Qr("font-weight"),s=Qr("tracking"),i=Qr("leading"),a=Qr("breakpoint"),o=Qr("container"),c=Qr("spacing"),u=Qr("radius"),_=Qr("shadow"),f=Qr("inset-shadow"),p=Qr("text-shadow"),m=Qr("drop-shadow"),x=Qr("blur"),S=Qr("perspective"),b=Qr("aspect"),v=Qr("ease"),y=Qr("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...C(),ht,ct],E=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],N=()=>[ht,ct,c],M=()=>[ql,"full","auto",...N()],O=()=>[Ha,"none","subgrid",ht,ct],I=()=>["auto",{span:["full",Ha,ht,ct]},Ha,ht,ct],H=()=>[Ha,"auto",ht,ct],U=()=>["auto","min","max","fr",ht,ct],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],q=()=>["auto",...N()],Q=()=>[ql,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],Z=()=>[ql,"screen","full","dvw","lvw","svw","min","max","fit",...N()],B=()=>[ql,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],D=()=>[e,ht,ct],P=()=>[...C(),jC,zC,{position:[ht,ct]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",xst,pst,{size:[ht,ct]}],ie=()=>[ax,Ch,Zc],le=()=>["","none","full",u,ht,ct],ae=()=>["",cn,Ch,Zc],se=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],oe=()=>[cn,ax,jC,zC],ce=()=>["","none",x,ht,ct],pe=()=>["none",cn,ht,ct],ue=()=>["none",cn,ht,ct],Ee=()=>[cn,ht,ct],Te=()=>[ql,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ho],breakpoint:[Ho],color:[WA],container:[Ho],"drop-shadow":[Ho],ease:["in","out","in-out"],font:[hst],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ho],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ho],shadow:[Ho],spacing:["px",cn],text:[Ho],"text-shadow":[Ho],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ql,ct,ht,b]}],container:["container"],"container-type":[{"@container":["","normal","size",ht,ct]}],"container-named":[_st],columns:[{columns:[cn,ct,ht,o]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:z()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[Ha,"auto",ht,ct]}],basis:[{basis:[ql,"full","auto",o,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[cn,ql,"auto","initial","none",ct]}],grow:[{grow:["",cn,ht,ct]}],shrink:[{shrink:["",cn,ht,ct]}],order:[{order:[Ha,"first","last","none",ht,ct]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:q()}],mx:[{mx:q()}],my:[{my:q()}],ms:[{ms:q()}],me:[{me:q()}],mbs:[{mbs:q()}],mbe:[{mbe:q()}],mt:[{mt:q()}],mr:[{mr:q()}],mb:[{mb:q()}],ml:[{ml:q()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...B()]}],"min-block-size":[{"min-block":["auto",...B()]}],"max-block-size":[{"max-block":["none",...B()]}],w:[{w:[o,"screen",...Q()]}],"min-w":[{"min-w":[o,"screen","none",...Q()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",t,Ch,Zc]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,wst,mst]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ax,ct]}],"font-family":[{font:[vst,gst,n]}],"font-features":[{"font-features":[ct]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,ht,ct]}],"line-clamp":[{"line-clamp":[cn,"none",ht,NC]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",ht,ct]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ht,ct]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[cn,"from-font","auto",ht,Zc]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[cn,"auto",ht,ct]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"tab-size":[{tab:[Ha,ht,ct]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht,ct]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ht,ct]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ha,ht,ct],radial:["",ht,ct],conic:[Ha,ht,ct]},yst,bst]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:ie()}],"gradient-via-pos":[{via:ie()}],"gradient-to-pos":[{to:ie()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-bs":[{"border-bs":ae()}],"border-w-be":[{"border-be":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[cn,ht,ct]}],"outline-w":[{outline:["",cn,Ch,Zc]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",_,Ep,Cp]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",f,Ep,Cp]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[cn,Zc]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",p,Ep,Cp]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[cn,ht,ct]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[cn]}],"mask-image-linear-from-pos":[{"mask-linear-from":oe()}],"mask-image-linear-to-pos":[{"mask-linear-to":oe()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":oe()}],"mask-image-t-to-pos":[{"mask-t-to":oe()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":oe()}],"mask-image-r-to-pos":[{"mask-r-to":oe()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":oe()}],"mask-image-b-to-pos":[{"mask-b-to":oe()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":oe()}],"mask-image-l-to-pos":[{"mask-l-to":oe()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":oe()}],"mask-image-x-to-pos":[{"mask-x-to":oe()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":oe()}],"mask-image-y-to-pos":[{"mask-y-to":oe()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[ht,ct]}],"mask-image-radial-from-pos":[{"mask-radial-from":oe()}],"mask-image-radial-to-pos":[{"mask-radial-to":oe()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[cn]}],"mask-image-conic-from-pos":[{"mask-conic-from":oe()}],"mask-image-conic-to-pos":[{"mask-conic-to":oe()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ht,ct]}],filter:[{filter:["","none",ht,ct]}],blur:[{blur:ce()}],brightness:[{brightness:[cn,ht,ct]}],contrast:[{contrast:[cn,ht,ct]}],"drop-shadow":[{"drop-shadow":["","none",m,Ep,Cp]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",cn,ht,ct]}],"hue-rotate":[{"hue-rotate":[cn,ht,ct]}],invert:[{invert:["",cn,ht,ct]}],saturate:[{saturate:[cn,ht,ct]}],sepia:[{sepia:["",cn,ht,ct]}],"backdrop-filter":[{"backdrop-filter":["","none",ht,ct]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[cn,ht,ct]}],"backdrop-contrast":[{"backdrop-contrast":[cn,ht,ct]}],"backdrop-grayscale":[{"backdrop-grayscale":["",cn,ht,ct]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[cn,ht,ct]}],"backdrop-invert":[{"backdrop-invert":["",cn,ht,ct]}],"backdrop-opacity":[{"backdrop-opacity":[cn,ht,ct]}],"backdrop-saturate":[{"backdrop-saturate":[cn,ht,ct]}],"backdrop-sepia":[{"backdrop-sepia":["",cn,ht,ct]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ht,ct]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[cn,"initial",ht,ct]}],ease:[{ease:["linear","initial",v,ht,ct]}],delay:[{delay:[cn,ht,ct]}],animate:[{animate:["none",y,ht,ct]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ht,ct]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[ht,ct,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":["translate-none"],zoom:[{zoom:[Ha,ht,ct]}],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ht,ct]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ht,ct]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[cn,Ch,Zc,NC]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},kst=(e,{cacheSize:n,prefix:t,experimentalParseClassName:r,extend:s={},override:i={}})=>(jf(e,"cacheSize",n),jf(e,"prefix",t),jf(e,"experimentalParseClassName",r),Np(e.theme,i.theme),Np(e.classGroups,i.classGroups),Np(e.conflictingClassGroups,i.conflictingClassGroups),Np(e.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers),jf(e,"postfixLookupClassGroups",i.postfixLookupClassGroups),jf(e,"orderSensitiveModifiers",i.orderSensitiveModifiers),zp(e.theme,s.theme),zp(e.classGroups,s.classGroups),zp(e.conflictingClassGroups,s.conflictingClassGroups),zp(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),Xy(e,s,"postfixLookupClassGroups"),Xy(e,s,"orderSensitiveModifiers"),e),jf=(e,n,t)=>{t!==void 0&&(e[n]=t)},Np=(e,n)=>{if(n)for(const t in n)jf(e,t,n[t])},zp=(e,n)=>{if(n)for(const t in n)Xy(e,n,t)},Xy=(e,n,t)=>{const r=n[t];r!==void 0&&(e[t]=e[t]?e[t].concat(r):r)},Cst=(e,...n)=>typeof e=="function"?EC(TC,e,...n):EC(()=>kst(TC(),e),...n),Est=Cst({extend:{theme:{text:["menu"]}}});function vs(...e){return Est(...e)}const Nst={default:"border-transparent bg-surface text-subtext",success:"border-accent-green bg-accent-green-subtle text-accent-green",error:"border-accent-red bg-accent-red-subtle text-accent-red",warning:"border-accent-amber bg-accent-amber-subtle text-accent-amber"};function It({variant:e="default",className:n,...t}){return h.jsx("span",{className:vs("badge inline-flex items-center rounded-full border px-2 py-px font-sans text-sm font-medium",Nst[e],n),...t})}const zst=["btn inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap border font-medium","transition-[background,border-color,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45"].join(" "),jst={default:"border-border bg-background text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight",primary:"border-primary bg-primary text-background [&:hover:not(:disabled)]:border-primary-hover [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:border-primary-active [&:active:not(:disabled)]:bg-primary-active",ghost:"border-transparent bg-transparent text-text [&:hover:not(:disabled)]:bg-surface [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-muted",danger:"border-border bg-background text-accent-red [&:hover:not(:disabled)]:bg-danger-hover [&:active:not(:disabled)]:bg-danger-active",warning:"border-accent-amber bg-background text-accent-amber [&:hover:not(:disabled)]:bg-accent-amber-subtle [&:active:not(:disabled)]:bg-highlight"},Tst={default:"h-8 rounded-md px-3.5 text-sm",small:"h-7 rounded-sm px-2.5 text-sm",large:"h-14 rounded-lg px-7 text-xl"};function tR(e,n,t,r){return vs(zst,jst[e],Tst[n],t&&"active",r)}function $e({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return h.jsx("button",{className:tR(n,t,e,r),...s})}function c_({active:e=!1,variant:n="default",size:t="default",className:r,...s}){return h.jsx("a",{className:tR(n,t,e,r),...s})}const Ast=["icon-btn relative inline-flex shrink-0 items-center justify-center","transition-[background,color] duration-120 ease-standard","focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2","disabled:cursor-default disabled:opacity-45","[.chat-header.rail-hidden_>_&:first-child]:me-3"].join(" "),Rst={default:"text-subtext [&:hover:not(:disabled)]:bg-surface [&:hover:not(:disabled)]:text-text [&:active:not(:disabled)]:bg-highlight [&.active]:bg-surface [&.active]:text-primary",primary:"bg-primary text-background [&:hover:not(:disabled)]:bg-primary-hover [&:active:not(:disabled)]:bg-primary-active",stop:"bg-surface text-text [&:hover:not(:disabled)]:bg-stop-hover [&:active:not(:disabled)]:bg-highlight"},Mst={default:"h-8 w-8 rounded-md",small:"h-7 w-7 rounded-sm"};function nR(e,n,t,r){return vs(Ast,Rst[e],Mst[n],t&&"active",r)}const Yt=T.forwardRef(function({active:n=!1,size:t="default",variant:r="default",className:s,...i},a){return h.jsx("button",{ref:a,className:nR(r,t,n,s),...i})});function Pg({active:e=!1,size:n="default",variant:t="default",className:r,...s}){return h.jsx("a",{className:nR(t,n,e,r),...s})}const Lst={default:"h-8 rounded-md border border-border bg-background px-2.5 py-1.5 focus:border-text",inline:"h-8 rounded-none border-x-0 border-t-0 border-b border-transparent bg-transparent px-0 py-0 focus:border-text"};function Ts({variant:e="default",className:n,...t}){return h.jsx("input",{className:vs("w-full font-sans text-sm font-normal text-text outline-none placeholder:text-muted disabled:cursor-default disabled:opacity-45",Lst[e],n),...t})}function Er({active:e=!1,danger:n=!1,size:t="default",className:r,...s}){return h.jsx("button",{className:vs("model-item flex w-full items-center justify-between gap-2 rounded-sm px-2 text-start transition-[background,color] duration-120 ease-standard hover:bg-surface focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default disabled:opacity-45 [&_.model-id]:block [&_.model-id]:text-xs [&_.model-id]:text-muted",t==="compact"?"min-h-6 py-0.5 text-menu":"min-h-8 py-1.5 text-sm",e&&"bg-surface",n&&"text-accent-red hover:text-accent-red",r),...s})}function Ot({className:e,...n}){return h.jsx("span",{className:vs("spinner h-[13px] w-[13px] shrink-0 animate-[spin_0.8s_linear_infinite] rounded-full border-2 border-border border-t-primary",e),...n})}function Br({className:e,...n}){return h.jsx("div",{className:vs("flex items-center gap-2 px-0 py-1 text-sm text-subtext",e),...n})}const Dst={success:"text-accent-green",danger:"text-accent-red",info:"text-accent-teal",warning:"text-accent-amber",caution:"text-accent-orange",accent:"text-accent-purple",neutral:"text-muted"};function c4({tone:e="neutral",live:n=!1,className:t,children:r,...s}){return h.jsxs("span",{className:vs("status-badge inline-flex items-center gap-1.5 whitespace-nowrap text-sm font-medium text-text",t),...s,children:[h.jsx("span",{className:vs("h-[7px] w-[7px] shrink-0 rounded-full bg-current",Dst[e],n&&"animate-[or-pulse_1.2s_ease-in-out_infinite]")}),r]})}const Ost=["relative h-5.5 w-9.5 flex-none rounded-full border border-border bg-surface","transition-[background,border-color] duration-120 ease-standard","[&_span]:absolute [&_span]:start-[3px] [&_span]:top-[3px] [&_span]:h-3.5 [&_span]:w-3.5","[&_span]:rounded-full [&_span]:bg-muted [&_span]:transition-[translate,background] [&_span]:duration-120 [&_span]:ease-standard","hover:border-border-strong","disabled:cursor-default disabled:opacity-45 focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-text focus-visible:outline-offset-2"].join(" ");function rR(e,n){return vs(Ost,e&&"border-primary bg-primary [&_span]:translate-x-4 [&_span]:bg-background",n)}function u4({checked:e=!1,className:n,children:t,...r}){return h.jsx("button",{role:"switch","aria-checked":e,className:rR(e,n),...r,children:t??h.jsx("span",{})})}function Ist({checked:e=!1,className:n,...t}){return h.jsx("span",{className:rR(e,n),...t,children:h.jsx("span",{})})}var al=yj();const Bst=q_(al);function $st(e){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",n.appendChild(t),t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}const Pst=e=>{switch(e){case"success":return Ust;case"info":return Gst;case"warning":return qst;case"error":return Vst;default:return null}},Hst=Array(12).fill(0),Fst=({visible:e,className:n})=>Xe.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":e},Xe.createElement("div",{className:"sonner-spinner"},Hst.map((t,r)=>Xe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Ust=Xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Xe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),qst=Xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Xe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Gst=Xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Xe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Vst=Xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},Xe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Wst=Xe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},Xe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Xe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Kst=()=>{const[e,n]=Xe.useState(document.hidden);return Xe.useEffect(()=>{const t=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},[]),e};let Yst=1;const Xst=100,AC=e=>{var n;return typeof(e==null?void 0:e.id)=="number"||(e==null||(n=e.id)==null?void 0:n.length)>0?e.id:Yst++};class Zst{constructor(){this.subscribe=n=>(this.subscribers.push(n),this.getActiveToasts().forEach(t=>n(t)),()=>{const t=this.subscribers.indexOf(n);this.subscribers.splice(t,1)}),this.publish=n=>{this.subscribers.forEach(t=>t(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n],this.trimHistory()},this.trimHistory=()=>{let n=this.toasts.length-Xst;n<=0||(this.toasts=this.toasts.filter(t=>n>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),n--,!1):!0))},this.create=n=>{const{message:t,...r}=n,s=AC(n),i=this.pendingDismissals.get(s);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(s),this.dismissedToasts.delete(s));const a=this.dismissedToasts.has(s),o=n.dismissible===void 0?!0:n.dismissible;return a&&(this.dismissedToasts.delete(s),this.toasts=this.toasts.filter(u=>u.id!==s)),(a?void 0:this.toasts.find(u=>u.id===s))?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...n,id:s,title:t}),{...u,...n,id:s,dismissible:o,title:t}):u):this.addToast({title:t,...r,dismissible:o,id:s}),s},this.dismiss=n=>{if(n==null)return this.getActiveToasts().forEach(r=>{this.dismissedToasts.add(r.id),this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),n;this.dismissedToasts.add(n);const t=this.pendingDismissals.get(n);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(n,requestAnimationFrame(()=>{this.pendingDismissals.delete(n),this.subscribers.forEach(r=>r({id:n,dismiss:!0}))})),n},this.message=(n,t)=>this.create({...t,message:n,type:void 0}),this.error=(n,t)=>this.create({...t,message:n,type:"error"}),this.success=(n,t)=>this.create({...t,type:"success",message:n}),this.info=(n,t)=>this.create({...t,type:"info",message:n}),this.warning=(n,t)=>this.create({...t,type:"warning",message:n}),this.loading=(n,t)=>this.create({...t,type:"loading",message:n}),this.promise=(n,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:n,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));const s=Promise.resolve(n instanceof Function?n():n);let i=r!==void 0,a;const o=s.then(async u=>{if(a=["resolve",u],Xe.isValidElement(u))i=!1,this.create({id:r,type:"default",message:u});else if(Jst(u)&&!u.ok){i=!1;const f=typeof t.error=="function"?await t.error(`HTTP error! status: ${u.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${u.status}`):t.description,x=typeof f=="object"&&!Xe.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...x})}else if(u instanceof Error){i=!1;const f=typeof t.error=="function"?await t.error(u):t.error,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof f=="object"&&!Xe.isValidElement(f)?f:{message:f};this.create({id:r,type:"error",description:p,...x})}else if(t.success!==void 0){i=!1;const f=typeof t.success=="function"?await t.success(u):t.success,p=typeof t.description=="function"?await t.description(u):t.description,x=typeof f=="object"&&!Xe.isValidElement(f)?f:{message:f};this.create({id:r,type:"success",description:p,...x})}}).catch(async u=>{if(a=["reject",u],t.error!==void 0){i=!1;const _=typeof t.error=="function"?await t.error(u):t.error,f=typeof t.description=="function"?await t.description(u):t.description,m=typeof _=="object"&&!Xe.isValidElement(_)?_:{message:_};this.create({id:r,type:"error",description:f,...m})}}).finally(()=>{i&&(this.dismiss(r),r=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((u,_)=>o.then(()=>a[0]==="reject"?_(a[1]):u(a[1])).catch(_));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(n,t)=>{const r=AC(t);return this.create({...t,jsx:n(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}const si=new Zst,Qst=(e,n)=>si.message(e,n),Jst=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",eit=Qst,tit=()=>si.toasts,nit=()=>si.getActiveToasts(),rit=Object.assign(eit,{success:si.success,info:si.info,warning:si.warning,error:si.error,custom:si.custom,message:si.message,promise:si.promise,dismiss:si.dismiss,loading:si.loading},{getHistory:tit,getToasts:nit});$st("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function jp(e){return e.label!==void 0}const sit=3,iit="24px",ait="16px",RC=4e3,oit=356,lit=14,cit=45,uit=200;function Fa(...e){return e.filter(Boolean).join(" ")}function fit(e){const[n,t]=e.split("-"),r=[];return n&&r.push(n),t&&r.push(t),r}const dit=e=>{var n,t,r,s,i,a,o,c,u;const{invert:_,toast:f,unstyled:p,interacting:m,setHeights:x,visibleToasts:S,heights:b,index:v,toasts:y,expanded:w,removeToast:C,defaultRichColors:z,closeButton:E,style:R,cancelButtonStyle:N,actionButtonStyle:M,className:O="",descriptionClassName:I="",duration:H,position:U,gap:F,expandByDefault:Y,classNames:q,icons:Q,closeButtonAriaLabel:Z="Close toast"}=e,[B,D]=Xe.useState(null),[P,X]=Xe.useState(null),[W,ie]=Xe.useState(!1),[le,ae]=Xe.useState(!1),[se,G]=Xe.useState(!1),[oe,ce]=Xe.useState(!1),[pe,ue]=Xe.useState(!1),[Ee,Te]=Xe.useState(0),[Ie,Le]=Xe.useState(0),He=Xe.useRef(f.duration||H||RC),Tt=Xe.useRef(null),Et=Xe.useRef(null),Vt=v===0,$t=v+1<=S,rt=f.type,nt=rt??"default",ut=f.dismissible!==!1,pt=f.className||"",ve=f.descriptionClassName||"",Oe=Xe.useMemo(()=>b.findIndex(gt=>gt.toastId===f.id)||0,[b,f.id]),Je=Xe.useMemo(()=>{var gt;return(gt=f.closeButton)!=null?gt:E},[f.closeButton,E]),ft=Xe.useMemo(()=>f.duration||H||RC,[f.duration,H]),mt=Xe.useRef(0),Ht=Xe.useRef(0),Fe=Xe.useRef(0),Pt=Xe.useRef(null),[Jt,nn]=U.split("-"),Lt=Xe.useMemo(()=>b.reduce((gt,an,Ge)=>Ge>=Oe?gt:gt+an.height,0),[b,Oe]),Rn=Kst(),Kt=Xe.useMemo(()=>{var gt;return(gt=e.swipeDirections)!=null?gt:fit(U)},[e.swipeDirections,U]),Gn=f.invert||_,cr=rt==="loading";Ht.current=Xe.useMemo(()=>Oe*F+Lt,[Oe,Lt]),Xe.useEffect(()=>{He.current=ft},[ft]),Xe.useEffect(()=>{ie(!0)},[]),Xe.useEffect(()=>{const gt=Et.current;if(gt){const an=gt.getBoundingClientRect().height;return Le(an),x(Ge=>[{toastId:f.id,height:an,position:f.position},...Ge]),()=>x(Ge=>Ge.filter(at=>at.toastId!==f.id))}},[x,f.id]),Xe.useLayoutEffect(()=>{if(!W)return;const gt=Et.current,an=gt.style.height;gt.style.height="auto";const Ge=gt.getBoundingClientRect().height;gt.style.height=an,Le(Ge),x(at=>at.find(Nt=>Nt.toastId===f.id)?at.map(Nt=>Nt.toastId===f.id?{...Nt,height:Ge}:Nt):[{toastId:f.id,height:Ge,position:f.position},...at])},[W,f.title,f.description,x,f.id,f.jsx,f.action,f.cancel]);const vn=Xe.useCallback(()=>{ae(!0),Te(Ht.current),x(gt=>gt.filter(an=>an.toastId!==f.id)),setTimeout(()=>{C(f)},uit)},[f,C,x,Ht]);Xe.useEffect(()=>{if(f.promise&&rt==="loading"||f.duration===1/0||f.type==="loading")return;let gt;return w||m||Rn?(()=>{if(Fe.current{He.current!==1/0&&(mt.current=new Date().getTime(),gt=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),vn()},He.current))})(),()=>clearTimeout(gt)},[w,m,f,rt,Rn,vn]),Xe.useEffect(()=>{f.delete&&(vn(),f.onDismiss==null||f.onDismiss.call(f,f))},[vn,f.delete]);function wr(){var gt;if(Q!=null&&Q.loading){var an;return Xe.createElement("div",{className:Fa(q==null?void 0:q.loader,f==null||(an=f.classNames)==null?void 0:an.loader,"sonner-loader"),"data-visible":rt==="loading"},Q.loading)}return Xe.createElement(Fst,{className:Fa(q==null?void 0:q.loader,f==null||(gt=f.classNames)==null?void 0:gt.loader),visible:rt==="loading"})}const Qn=f.icon||(Q==null?void 0:Q[rt])||Pst(rt);var Wn,Mn;return Xe.createElement("li",{tabIndex:0,ref:Et,className:Fa(O,pt,q==null?void 0:q.toast,f==null||(n=f.classNames)==null?void 0:n.toast,q==null?void 0:q[nt],f==null||(t=f.classNames)==null?void 0:t[nt]),"data-sonner-toast":"","data-rich-colors":(Wn=f.richColors)!=null?Wn:z,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":W,"data-promise":!!f.promise,"data-swiped":pe,"data-removed":le,"data-visible":$t,"data-y-position":Jt,"data-x-position":nn,"data-index":v,"data-front":Vt,"data-swiping":se,"data-dismissible":ut,"data-type":rt,"data-invert":Gn,"data-swipe-out":oe,"data-swipe-direction":P,"data-expanded":!!(w||Y&&W),"data-testid":f.testId,style:{"--index":v,"--toasts-before":v,"--z-index":y.length-v,"--offset":`${le?Ee:Ht.current}px`,"--initial-height":Y?"auto":`${Ie}px`,...R,...f.style},onDragEnd:()=>{G(!1),D(null),Pt.current=null},onPointerDown:gt=>{gt.button!==2&&(cr||!ut||(Tt.current=new Date,Te(Ht.current),gt.target.setPointerCapture(gt.pointerId),gt.target.tagName!=="BUTTON"&&(G(!0),Pt.current={x:gt.clientX,y:gt.clientY})))},onPointerUp:()=>{var gt,an,Ge;if(oe||!ut)return;Pt.current=null;const at=Number(((gt=Et.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),rn=Number(((an=Et.current)==null?void 0:an.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Nt=new Date().getTime()-((Ge=Tt.current)==null?void 0:Ge.getTime()),on=B==="x"?at:rn,Qe=Math.abs(on)/Nt;if((B==="x"?Kt.includes(at>0?"right":"left"):Kt.includes(rn>0?"bottom":"top"))&&(Math.abs(on)>=cit||Qe>.11)){Te(Ht.current),f.onDismiss==null||f.onDismiss.call(f,f),X(B==="x"?at>0?"right":"left":rn>0?"down":"up"),vn(),ce(!0);return}else{var ln,Sr;(ln=Et.current)==null||ln.style.setProperty("--swipe-amount-x","0px"),(Sr=Et.current)==null||Sr.style.setProperty("--swipe-amount-y","0px")}ue(!1),G(!1),D(null)},onPointerMove:gt=>{var an,Ge,at;if(!Pt.current||!ut||((an=window.getSelection())==null?void 0:an.toString().length)>0)return;const Nt=gt.clientY-Pt.current.y,on=gt.clientX-Pt.current.x;!B&&(Math.abs(on)>1||Math.abs(Nt)>1)&&D(Math.abs(on)>Math.abs(Nt)?"x":"y");let Qe={x:0,y:0};const bt=ln=>1/(1.5+Math.abs(ln)/20);if(B==="y"){if(Kt.includes("top")||Kt.includes("bottom"))if(Kt.includes("top")&&Nt<0||Kt.includes("bottom")&&Nt>0)Qe.y=Nt;else{const ln=Nt*bt(Nt);Qe.y=Math.abs(ln)0)Qe.x=on;else{const ln=on*bt(on);Qe.x=Math.abs(ln)0||Math.abs(Qe.y)>0)&&ue(!0),(Ge=Et.current)==null||Ge.style.setProperty("--swipe-amount-x",`${Qe.x}px`),(at=Et.current)==null||at.style.setProperty("--swipe-amount-y",`${Qe.y}px`)}},Je&&!f.jsx&&rt!=="loading"?Xe.createElement("button",{"aria-label":Z,"data-disabled":cr,"data-close-button":!0,onClick:cr||!ut?()=>{}:()=>{vn(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Fa(q==null?void 0:q.closeButton,f==null||(r=f.classNames)==null?void 0:r.closeButton)},(Mn=Q==null?void 0:Q.close)!=null?Mn:Wst):null,(rt||f.icon||f.promise)&&f.icon!==null&&((Q==null?void 0:Q[rt])!==null||f.icon)?Xe.createElement("div",{"data-icon":"",className:Fa(q==null?void 0:q.icon,f==null||(s=f.classNames)==null?void 0:s.icon)},rt==="loading"?f.icon||wr():f.promise?wr():null,rt!=="loading"?Qn:null):null,Xe.createElement("div",{"data-content":"",className:Fa(q==null?void 0:q.content,f==null||(i=f.classNames)==null?void 0:i.content)},Xe.createElement("div",{"data-title":"",className:Fa(q==null?void 0:q.title,f==null||(a=f.classNames)==null?void 0:a.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?Xe.createElement("div",{"data-description":"",className:Fa(I,ve,q==null?void 0:q.description,f==null||(o=f.classNames)==null?void 0:o.description)},typeof f.description=="function"?f.description():f.description):null),Xe.isValidElement(f.cancel)?f.cancel:f.cancel&&jp(f.cancel)?Xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||N,onClick:gt=>{jp(f.cancel)&&ut&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,gt),vn())},className:Fa(q==null?void 0:q.cancelButton,f==null||(c=f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,Xe.isValidElement(f.action)?f.action:f.action&&jp(f.action)?Xe.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||M,onClick:gt=>{jp(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,gt),!gt.defaultPrevented&&vn())},className:Fa(q==null?void 0:q.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function MC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function hit(e,n){const t={};return[e,n].forEach((r,s)=>{const i=s===1,a=i?"--mobile-offset":"--offset",o=i?ait:iit;function c(u){["top","right","bottom","left"].forEach(_=>{t[`${a}-${_}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?t[`${a}-${u}`]=o:t[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),t}const _it=Xe.forwardRef(function(n,t){const{id:r,invert:s,position:i="bottom-right",hotkey:a=["altKey","KeyT"],expand:o,closeButton:c,className:u,offset:_,mobileOffset:f,theme:p="light",richColors:m,duration:x,style:S,visibleToasts:b=sit,toastOptions:v,dir:y=MC(),gap:w=lit,icons:C,customAriaLabel:z,containerAriaLabel:E="Notifications"}=n,[R,N]=Xe.useState([]),M=Xe.useMemo(()=>r?R.filter(ie=>ie.toasterId===r):R.filter(ie=>!ie.toasterId),[R,r]),O=Xe.useMemo(()=>Array.from(new Set([i].concat(M.filter(ie=>ie.position).map(ie=>ie.position)))),[M,i]),[I,H]=Xe.useState([]),[U,F]=Xe.useState(!1),[Y,q]=Xe.useState(!1),[Q,Z]=Xe.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=Xe.useRef(null),D=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Xe.useRef(null),X=Xe.useRef(!1),W=Xe.useCallback(ie=>{N(le=>{var ae;return(ae=le.find(se=>se.id===ie.id))!=null&&ae.delete||si.dismiss(ie.id),le.filter(({id:se})=>se!==ie.id)})},[]);return Xe.useEffect(()=>si.subscribe(ie=>{if(ie.dismiss){requestAnimationFrame(()=>{N(le=>le.map(ae=>ae.id===ie.id?{...ae,delete:!0}:ae))});return}setTimeout(()=>{Bst.flushSync(()=>{N(le=>{const ae=le.findIndex(se=>se.id===ie.id);return ae!==-1?[...le.slice(0,ae),{...le[ae],...ie},...le.slice(ae+1)]:[ie,...le]})})})}),[]),Xe.useEffect(()=>{if(p!=="system"){Z(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Z("dark"):Z("light")),typeof window>"u")return;const ie=window.matchMedia("(prefers-color-scheme: dark)");try{ie.addEventListener("change",({matches:le})=>{Z(le?"dark":"light")})}catch{ie.addListener(({matches:ae})=>{try{Z(ae?"dark":"light")}catch(se){console.error(se)}})}},[p]),Xe.useEffect(()=>{R.length<=1&&F(!1)},[R]),Xe.useEffect(()=>{const ie=le=>{var ae;if(a.length>0&&a.every(oe=>le[oe]||le.code===oe)){var G;F(!0),(G=B.current)==null||G.focus()}le.code==="Escape"&&(document.activeElement===B.current||(ae=B.current)!=null&&ae.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[a]),Xe.useEffect(()=>{if(B.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,X.current=!1)}},[B.current]),Xe.createElement("section",{ref:t,"aria-label":z??`${E} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},O.map((ie,le)=>{var ae;const[se,G]=ie.split("-");return M.length?Xe.createElement("ol",{key:ie,dir:y==="auto"?MC():y,tabIndex:-1,ref:B,className:u,"data-sonner-toaster":!0,"data-sonner-theme":Q,"data-y-position":se,"data-x-position":G,style:{"--front-toast-height":`${((ae=I[0])==null?void 0:ae.height)||0}px`,"--width":`${oit}px`,"--gap":`${w}px`,...S,...hit(_,f)},onBlur:oe=>{X.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(X.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||X.current||(X.current=!0,P.current=oe.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{Y||F(!1)},onDragEnd:()=>F(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},M.filter(oe=>!oe.position&&le===0||oe.position===ie).map((oe,ce)=>{var pe,ue;return Xe.createElement(dit,{key:oe.id,icons:C,index:ce,toast:oe,defaultRichColors:m,duration:(pe=v==null?void 0:v.duration)!=null?pe:x,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:s,visibleToasts:b,closeButton:(ue=v==null?void 0:v.closeButton)!=null?ue:c,interacting:Y,position:ie,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,closeButtonAriaLabel:v==null?void 0:v.closeButtonAriaLabel,removeToast:W,toasts:M.filter(Ee=>Ee.position==oe.position),heights:I.filter(Ee=>Ee.position==oe.position),setHeights:H,expandByDefault:o,gap:w,expanded:U,swipeDirections:n.swipeDirections})})):null}))});function pit(e){const[n]=PA();return h.jsx(_it,{theme:n,...e})}function Vn(e,n,t){rit[n](e,{duration:n==="warning"||n==="error"?1/0:5e3,position:"top-center",closeButton:!0,...t})}function f4({content:e,children:n,className:t}){const r=T.useRef(null),s=T.useRef(null);function i(){const o=r.current,c=s.current;if(!o||!c)return;c.matches(":popover-open")||c.showPopover();const u=o.getBoundingClientRect(),_=c.getBoundingClientRect(),f=Math.max(8,Math.min(u.left+u.width/2-_.width/2,window.innerWidth-_.width-8));c.style.left=`${f}px`,c.style.top=`${Math.max(8,u.top-_.height-6)}px`}function a(){var o,c;(o=r.current)!=null&&o.matches(":hover, :focus")||(c=s.current)==null||c.hidePopover()}return T.useEffect(()=>{const o=()=>{var c;return(c=s.current)==null?void 0:c.hidePopover()};return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[]),h.jsxs("span",{ref:r,className:vs("group relative inline-flex cursor-help rounded-full outline-none focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2",t),tabIndex:0,role:"img","aria-label":e,onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,onKeyDown:o=>{var c;o.key==="Escape"&&((c=s.current)!=null&&c.matches(":popover-open"))&&(o.preventDefault(),o.stopPropagation(),s.current.hidePopover())},children:[n,h.jsx("span",{ref:s,popover:"manual",role:"tooltip",className:"pointer-events-none fixed inset-auto m-0 w-max max-w-64 whitespace-normal rounded-sm border-0 bg-text px-2 py-1.5 font-sans text-sm font-normal leading-snug text-background shadow-control-subtle",children:e})]})}const mit='button:not([disabled]), input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function d4(e,n,t="[data-initial-focus]"){const r=T.useRef(n);r.current=n,T.useEffect(()=>{const s=e.current;if(!s)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null,a=()=>[...s.querySelectorAll(mit)];(s.querySelector(t)??a()[0]??s).focus();const o=c=>{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),r.current();return}if(c.key!=="Tab")return;const u=a(),_=u[0],f=u.at(-1);!_||!f?(c.preventDefault(),s.focus()):c.shiftKey&&document.activeElement===_?(c.preventDefault(),f.focus()):!c.shiftKey&&document.activeElement===f&&(c.preventDefault(),_.focus())};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0),i==null||i.focus()}},[e,t])}function sR({host:e,preview:n,currentClientAttached:t,stopping:r,onClose:s,onConfirm:i}){const a=T.useRef(null),o=Math.max(0,n.attachmentCount-(t?1:0)),c=[];return n.activeTurnCount>0&&c.push(n.activeTurnCount===1?Wze():ije({count:Xt(n.activeTurnCount)})),n.pendingPermissionCount>0&&c.push(n.pendingPermissionCount===1?Aze():lze({count:Xt(n.pendingPermissionCount)})),o>0&&c.push(o===1?$ze():Zze({count:Xt(o)})),n.queuedMessageCount>0&&c.push(n.queuedMessageCount===1?Uze():tje({count:Xt(n.queuedMessageCount)})),n.activeRunCount>0&&c.push(n.activeRunCount===1?Dze():xze({count:Xt(n.activeRunCount)})),d4(a,s),al.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:u=>{!r&&u.target===u.currentTarget&&s()},children:h.jsxs("div",{ref:a,className:"w-120 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-stop-dialog-title","aria-describedby":c.length>0?"remote-stop-dialog-impact":void 0,tabIndex:-1,children:[h.jsx("h2",{id:"remote-stop-dialog-title",className:"m-0 text-xl font-medium text-text",children:mze({host:ze(e)})}),c.length>0&&h.jsxs("div",{id:"remote-stop-dialog-impact",className:"mt-4 text-sm text-text",children:[h.jsx("p",{className:"m-0 font-medium",children:Nze()}),h.jsx("ul",{className:"mt-2 mb-0 space-y-1 ps-5",children:c.map(u=>h.jsx("li",{children:u},u))})]}),h.jsxs("div",{className:"mt-6 flex justify-end gap-2.5",children:[h.jsx($e,{disabled:r,onClick:s,children:W_()}),h.jsx($e,{variant:"danger",disabled:r,onClick:i,children:r?cje():dze()})]})]})}),document.body)}var ox={exports:{}},LC;function git(){return LC||(LC=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={};return(()=>{var r=t;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const i=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(i._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,i=s._renderService.dimensions;if(i.css.cell.width===0||i.css.cell.height===0)return;const a=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),f=c-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),p=u-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(p/i.css.cell.width)),rows:Math.max(1,Math.floor(f/i.css.cell.height))}}}})(),t})()))})(ox)),ox.exports}var bit=git(),lx={exports:{}},DC;function vit(){return DC||(DC=1,(function(e,n){(function(t,r){e.exports=r()})(self,(()=>(()=>{var t={6:(a,o)=>{function c(_){try{const f=new URL(_),p=f.password&&f.username?`${f.protocol}//${f.username}:${f.password}@${f.host}`:f.username?`${f.protocol}//${f.username}@${f.host}`:`${f.protocol}//${f.host}`;return _.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(_,f,p,m={}){this._terminal=_,this._regex=f,this._handler=p,this._options=m}provideLinks(_,f){const p=u.computeLink(_,this._regex,this._terminal,this._handler);f(this._addCallbacks(p))}_addCallbacks(_){return _.map((f=>(f.leave=this._options.leave,f.hover=(p,m)=>{if(this._options.hover){const{range:x}=f;this._options.hover(p,m,x)}},f)))}};class u{static computeLink(f,p,m,x){const S=new RegExp(p.source,(p.flags||"")+"g"),[b,v]=u._getWindowedLineStrings(f-1,m),y=b.join("");let w;const C=[];for(;w=S.exec(y);){const z=w[0];if(!c(z))continue;const[E,R]=u._mapStrIdx(m,v,0,w.index),[N,M]=u._mapStrIdx(m,E,R,z.length);if(E===-1||R===-1||N===-1||M===-1)continue;const O={start:{x:R+1,y:E+1},end:{x:M,y:N+1}};C.push({range:O,text:z,activate:x})}return C}static _getWindowedLineStrings(f,p){let m,x=f,S=f,b=0,v="";const y=[];if(m=p.buffer.active.getLine(f)){const w=m.translateToString(!0);if(m.isWrapped&&w[0]!==" "){for(b=0;(m=p.buffer.active.getLine(--x))&&b<2048&&(v=m.translateToString(!0),b+=v.length,y.push(v),m.isWrapped&&v.indexOf(" ")===-1););y.reverse()}for(y.push(w),b=0;(m=p.buffer.active.getLine(++S))&&m.isWrapped&&b<2048&&(v=m.translateToString(!0),b+=v.length,y.push(v),v.indexOf(" ")===-1););}return[y,x]}static _mapStrIdx(f,p,m,x){const S=f.buffer.active,b=S.getNullCell();let v=m;for(;x;){const y=S.getLine(p);if(!y)return[-1,-1];for(let w=v;w{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=s(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(_,f){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=f}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(_=u,f={}){this._handler=_,this._options=f}activate(_){this._terminal=_;const f=this._options,p=f.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,f))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),i})()))})(lx)),lx.exports}var xit=vit(),cx={exports:{}},OC;function yit(){return OC||(OC=1,(function(e,n){(function(t,r){e.exports=r()})(globalThis,(()=>(()=>{var t={4567:function(a,o,c){var u=this&&this.__decorate||function(y,w,C,z){var E,R=arguments.length,N=R<3?w:z===null?z=Object.getOwnPropertyDescriptor(w,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,w,C,z);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(N=(R<3?E(N):R>3?E(w,C,N):E(w,C))||N);return R>3&&N&&Object.defineProperty(w,C,N),N},_=this&&this.__param||function(y,w){return function(C,z){w(C,z,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const f=c(9042),p=c(9924),m=c(844),x=c(4725),S=c(2585),b=c(3656);let v=o.AccessibilityManager=class extends m.Disposable{constructor(y,w,C,z){super(),this._terminal=y,this._coreBrowserService=C,this._renderService=z,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let E=0;Ethis._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +`)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,m.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(y){for(let w=0;w0?this._charsToConsume.shift()!==y&&(this._charsToAnnounce+=y):this._charsToAnnounce+=y,y===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(y){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(y)||this._charsToConsume.push(y)}_refreshRows(y,w){this._liveRegionDebouncer.refresh(y,w,this._terminal.rows)}_renderRows(y,w){const C=this._terminal.buffer,z=C.lines.length.toString();for(let E=y;E<=w;E++){const R=C.lines.get(C.ydisp+E),N=[],M=(R==null?void 0:R.translateToString(!0,void 0,void 0,N))||"",O=(C.ydisp+E+1).toString(),I=this._rowElements[E];I&&(M.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=M,this._rowColumns.set(I,N)),I.setAttribute("aria-posinset",O),I.setAttribute("aria-setsize",z))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(y,w){const C=y.target,z=this._rowElements[w===0?1:this._rowElements.length-2];if(C.getAttribute("aria-posinset")===(w===0?"1":`${this._terminal.buffer.lines.length}`)||y.relatedTarget!==z)return;let E,R;if(w===0?(E=C,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(E=this._rowElements.shift(),R=C,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),w===0){const N=this._createAccessibilityTreeNode();this._rowElements.unshift(N),this._rowContainer.insertAdjacentElement("afterbegin",N)}else{const N=this._createAccessibilityTreeNode();this._rowElements.push(N),this._rowContainer.appendChild(N)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(w===0?-1:1),this._rowElements[w===0?1:this._rowElements.length-2].focus(),y.preventDefault(),y.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const y=document.getSelection();if(!y)return;if(y.isCollapsed)return void(this._rowContainer.contains(y.anchorNode)&&this._terminal.clearSelection());if(!y.anchorNode||!y.focusNode)return void console.error("anchorNode and/or focusNode are null");let w={node:y.anchorNode,offset:y.anchorOffset},C={node:y.focusNode,offset:y.focusOffset};if((w.node.compareDocumentPosition(C.node)&Node.DOCUMENT_POSITION_PRECEDING||w.node===C.node&&w.offset>C.offset)&&([w,C]=[C,w]),w.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(w={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(w.node))return;const z=this._rowElements.slice(-1)[0];if(C.node.compareDocumentPosition(z)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(C={node:z,offset:((M=z.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(C.node))return;const E=({node:O,offset:I})=>{const H=O instanceof Text?O.parentNode:O;let U=parseInt(H==null?void 0:H.getAttribute("aria-posinset"),10)-1;if(isNaN(U))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(H);if(!F)return console.warn("columns is null. Race condition?"),null;let Y=I=this._terminal.cols&&(++U,Y=0),{row:U,column:Y}},R=E(w),N=E(C);if(R&&N){if(R.row>N.row||R.row===N.row&&R.column>=N.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(N.row-R.row)*this._terminal.cols-R.column+N.column)}}_handleResize(y){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let w=this._rowContainer.children.length;wy;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const y=this._coreBrowserService.mainDocument.createElement("div");return y.setAttribute("role","listitem"),y.tabIndex=-1,this._refreshRowDimensions(y),y}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let y=0;y{function c(p){return p.replace(/\r?\n/g,"\r")}function u(p,m){return m?"\x1B[200~"+p+"\x1B[201~":p}function _(p,m,x,S){p=u(p=c(p),x.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),m.value=""}function f(p,m,x){const S=x.getBoundingClientRect(),b=p.clientX-S.left-10,v=p.clientY-S.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${b}px`,m.style.top=`${v}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=u,o.copyHandler=function(p,m){p.clipboardData&&p.clipboardData.setData("text/plain",m.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,m,x,S){p.stopPropagation(),p.clipboardData&&_(p.clipboardData.getData("text/plain"),m,x,S)},o.paste=_,o.moveTextAreaUnderMouseCursor=f,o.rightClickHandler=function(p,m,x,S,b){f(p,m,x),b&&S.rightClickSelect(p),m.value=S.selectionText,m.select()}},7239:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=c(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(_,f,p){this._css.set(_,f,p)}getCss(_,f){return this._css.get(_,f)}setColor(_,f,p){this._color.set(_,f,p)}getColor(_,f){return this._color.get(_,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,u,_,f){c.addEventListener(u,_,f);let p=!1;return{dispose:()=>{p||(p=!0,c.removeEventListener(u,_,f))}}}},3551:function(a,o,c){var u=this&&this.__decorate||function(v,y,w,C){var z,E=arguments.length,R=E<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,y,w,C);else for(var N=v.length-1;N>=0;N--)(z=v[N])&&(R=(E<3?z(R):E>3?z(y,w,R):z(y,w))||R);return E>3&&R&&Object.defineProperty(y,w,R),R},_=this&&this.__param||function(v,y){return function(w,C){y(w,C,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const f=c(3656),p=c(8460),m=c(844),x=c(2585),S=c(4725);let b=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(v,y,w,C,z){super(),this._element=v,this._mouseService=y,this._renderService=w,this._bufferService=C,this._linkProviderService=z,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const y=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!y)return;this._isMouseOut=!1;const w=v.composedPath();for(let C=0;C{E==null||E.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let w=!1;for(const[E,R]of this._linkProviderService.linkProviders.entries())y?(z=this._activeProviderReplies)!=null&&z.get(E)&&(w=this._checkLinkProviderResult(E,v,w)):R.provideLinks(v.y,(N=>{var O,I;if(this._isMouseOut)return;const M=N==null?void 0:N.map((H=>({link:H})));(O=this._activeProviderReplies)==null||O.set(E,M),w=this._checkLinkProviderResult(E,v,w),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,y){const w=new Set;for(let C=0;Cv?this._bufferService.cols:R.link.range.end.x;for(let O=N;O<=M;O++){if(w.has(O)){z.splice(E--,1);break}w.add(O)}}}}_checkLinkProviderResult(v,y,w){var E;if(!this._activeProviderReplies)return w;const C=this._activeProviderReplies.get(v);let z=!1;for(let R=0;Rthis._linkAtPosition(N.link,y)));R&&(w=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!w)for(let R=0;Rthis._linkAtPosition(M.link,y)));if(N){w=!0,this._handleNewLink(N);break}}return w}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const y=this._positionFromMouseEvent(v,this._element,this._mouseService);y&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,y)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,y){this._currentLink&&this._lastMouseEvent&&(!v||!y||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=y)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._linkAtPosition(v.link,y)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var w,C;return(C=(w=this._currentLink)==null?void 0:w.state)==null?void 0:C.decorations.pointerCursor},set:w=>{var C;(C=this._currentLink)!=null&&C.state&&this._currentLink.state.decorations.pointerCursor!==w&&(this._currentLink.state.decorations.pointerCursor=w,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",w))}},underline:{get:()=>{var w,C;return(C=(w=this._currentLink)==null?void 0:w.state)==null?void 0:C.decorations.underline},set:w=>{var C,z,E;(C=this._currentLink)!=null&&C.state&&((E=(z=this._currentLink)==null?void 0:z.state)==null?void 0:E.decorations.underline)!==w&&(this._currentLink.state.decorations.underline=w,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,w))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((w=>{if(!this._currentLink)return;const C=w.start===0?0:w.start+1+this._bufferService.buffer.ydisp,z=this._bufferService.buffer.ydisp+1+w.end;if(this._currentLink.link.range.start.y>=C&&this._currentLink.link.range.end.y<=z&&(this._clearCurrentLink(C,z),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(v,y,w){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(y,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),y.hover&&y.hover(w,y.text)}_fireUnderlineEvent(v,y){const w=v.range,C=this._bufferService.buffer.ydisp,z=this._createLinkUnderlineEvent(w.start.x-1,w.start.y-C-1,w.end.x,w.end.y-C-1,void 0);(y?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(z)}_linkLeave(v,y,w){var C;(C=this._currentLink)!=null&&C.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(y,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),y.leave&&y.leave(w,y.text)}_linkAtPosition(v,y){const w=v.range.start.y*this._bufferService.cols+v.range.start.x,C=v.range.end.y*this._bufferService.cols+v.range.end.x,z=y.y*this._bufferService.cols+y.x;return w<=z&&z<=C}_positionFromMouseEvent(v,y,w){const C=w.getCoords(v,y,this._bufferService.cols,this._bufferService.rows);if(C)return{x:C[0],y:C[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,y,w,C,z){return{x1:v,y1:y,x2:w,y2:C,cols:this._bufferService.cols,fg:z}}};o.Linkifier=b=u([_(1,S.IMouseService),_(2,S.IRenderService),_(3,x.IBufferService),_(4,S.ILinkProviderService)],b)},9042:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(a,o,c){var u=this&&this.__decorate||function(S,b,v,y){var w,C=arguments.length,z=C<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(S,b,v,y);else for(var E=S.length-1;E>=0;E--)(w=S[E])&&(z=(C<3?w(z):C>3?w(b,v,z):w(b,v))||z);return C>3&&z&&Object.defineProperty(b,v,z),z},_=this&&this.__param||function(S,b){return function(v,y){b(v,y,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const f=c(511),p=c(2585);let m=o.OscLinkProvider=class{constructor(S,b,v){this._bufferService=S,this._optionsService=b,this._oscLinkService=v}provideLinks(S,b){var M;const v=this._bufferService.buffer.lines.get(S-1);if(!v)return void b(void 0);const y=[],w=this._optionsService.rawOptions.linkHandler,C=new f.CellData,z=v.getTrimmedLength();let E=-1,R=-1,N=!1;for(let O=0;Ow?w.activate(F,Y,H):x(0,Y),hover:(F,Y)=>{var q;return(q=w==null?void 0:w.hover)==null?void 0:q.call(w,F,Y,H)},leave:(F,Y)=>{var q;return(q=w==null?void 0:w.leave)==null?void 0:q.call(w,F,Y,H)}})}N=!1,C.hasExtendedAttrs()&&C.extended.urlId?(R=O,E=C.extended.urlId):(R=-1,E=-1)}}b(y)}};function x(S,b){if(confirm(`Do you want to navigate to ${b}? + +WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=u([_(0,p.IBufferService),_(1,p.IOptionsService),_(2,p.IOscLinkService)],m)},6193:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,u){this._renderCallback=c,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,u,_){this._rowCount=_,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const u=c(3614),_=c(3656),f=c(3551),p=c(9042),m=c(3730),x=c(1680),S=c(3107),b=c(5744),v=c(2950),y=c(1296),w=c(428),C=c(4269),z=c(5114),E=c(8934),R=c(3230),N=c(9312),M=c(4725),O=c(6731),I=c(8055),H=c(8969),U=c(8460),F=c(844),Y=c(6114),q=c(8437),Q=c(2584),Z=c(7399),B=c(5941),D=c(9074),P=c(2585),X=c(5435),W=c(4567),ie=c(779);class le extends H.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(se={}){super(se),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((G,oe)=>this.refresh(G,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((G=>this._reportWindowsOptions(G)))),this.register(this._inputHandler.onColor((G=>this._handleColorEvent(G)))),this.register((0,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((G=>this._afterResize(G.cols,G.rows)))),this.register((0,F.toDisposable)((()=>{var G,oe;this._customKeyEventHandler=void 0,(oe=(G=this.element)==null?void 0:G.parentNode)==null||oe.removeChild(this.element)})))}_handleColorEvent(se){if(this._themeService)for(const G of se){let oe,ce="";switch(G.index){case 256:oe="foreground",ce="10";break;case 257:oe="background",ce="11";break;case 258:oe="cursor",ce="12";break;default:oe="ansi",ce="4;"+G.index}switch(G.type){case 0:const pe=I.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${ce};${(0,B.toRgbString)(pe)}${Q.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ue=>ue.ansi[G.index]=I.channels.toColor(...G.color)));else{const ue=oe;this._themeService.modifyColors((Ee=>Ee[ue]=I.channels.toColor(...G.color)))}break;case 2:this._themeService.restoreColor(G.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(se){se?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(se){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var se;return(se=this.textarea)==null?void 0:se.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const se=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(se);if(!G)return;const oe=Math.min(this.buffer.x,this.cols-1),ce=this._renderService.dimensions.css.cell.height,pe=G.getWidth(oe),ue=this._renderService.dimensions.css.cell.width*pe,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Te=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Te+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=ce+"px",this.textarea.style.lineHeight=ce+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(G=>{this.hasSelection()&&(0,u.copyHandler)(G,this._selectionService)})));const se=G=>(0,u.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",se)),this.register((0,_.addDisposableDomListener)(this.element,"paste",se)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(G=>{G.button===2&&(0,u.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(G=>{(0,u.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(G=>{G.button===1&&(0,u.moveTextAreaUnderMouseCursor)(G,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(se=>this._keyUp(se)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(se=>this._keyDown(se)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(se=>this._keyPress(se)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(se=>this._compositionHelper.compositionupdate(se)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(se=>this._inputEvent(se)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(se){var oe;if(!se)throw new Error("Terminal requires a parent element.");if(se.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((oe=this.element)==null?void 0:oe.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=se.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),se.appendChild(this.element);const G=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",(ce=>this.updateCursorStyle(ce)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(z.CoreBrowserService,this.textarea,se.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(ce=>this._handleTextAreaFocus(ce)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(w.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(C.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ce=>this._onRender.fire(ce)))),this.onResize((ce=>this._renderService.resize(ce.cols,ce.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(N.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ce=>this._renderService.handleSelectionChanged(ce.start,ce.end,ce.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ce=>{this.textarea.value=ce,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(ce=>this._selectionService.handleMouseDown(ce)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ce=>this._handleScreenReaderModeOptionChange(ce)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ce=>{!this._overviewRulerRenderer&&ce&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(y.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const se=this,G=this.element;function oe(ue){const Ee=se._mouseService.getMouseReportCoords(ue,se.screenElement);if(!Ee)return!1;let Te,Ie;switch(ue.overrideType||ue.type){case"mousemove":Ie=32,ue.buttons===void 0?(Te=3,ue.button!==void 0&&(Te=ue.button<3?ue.button:3)):Te=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":Ie=0,Te=ue.button<3?ue.button:3;break;case"mousedown":Ie=1,Te=ue.button<3?ue.button:3;break;case"wheel":if(se._customWheelEventHandler&&se._customWheelEventHandler(ue)===!1||se.viewport.getLinesScrolled(ue)===0)return!1;Ie=ue.deltaY<0?0:1,Te=4;break;default:return!1}return!(Ie===void 0||Te===void 0||Te>4)&&se.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Te,action:Ie,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const ce={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:ue=>(oe(ue),ue.buttons||(this._document.removeEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.removeEventListener("mousemove",ce.mousedrag)),this.cancel(ue)),wheel:ue=>(oe(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&oe(ue)},mousemove:ue=>{ue.buttons||oe(ue)}};this.register(this.coreMouseService.onProtocolChange((ue=>{ue?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ue)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&ue?ce.mousemove||(G.addEventListener("mousemove",pe.mousemove),ce.mousemove=pe.mousemove):(G.removeEventListener("mousemove",ce.mousemove),ce.mousemove=null),16&ue?ce.wheel||(G.addEventListener("wheel",pe.wheel,{passive:!1}),ce.wheel=pe.wheel):(G.removeEventListener("wheel",ce.wheel),ce.wheel=null),2&ue?ce.mouseup||(ce.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ce.mouseup),ce.mouseup=null),4&ue?ce.mousedrag||(ce.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ce.mousedrag),ce.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(G,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return oe(ue),ce.mouseup&&this._document.addEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.addEventListener("mousemove",ce.mousedrag),this.cancel(ue)}))),this.register((0,_.addDisposableDomListener)(G,"wheel",(ue=>{if(!ce.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ue)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(ue);if(Ee===0)return;const Te=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let Ie="";for(let Le=0;Le{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(G,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(se,G){var oe;(oe=this._renderService)==null||oe.refreshRows(se,G)}updateCursorStyle(se){var G;(G=this._selectionService)!=null&&G.shouldColumnSelect(se)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(se,G,oe=0){var ce;oe===1?(super.scrollLines(se,G,oe),this.refresh(0,this.rows-1)):(ce=this.viewport)==null||ce.scrollLines(se)}paste(se){(0,u.paste)(se,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(se){this._customKeyEventHandler=se}attachCustomWheelEventHandler(se){this._customWheelEventHandler=se}registerLinkProvider(se){return this._linkProviderService.registerLinkProvider(se)}registerCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(se);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(se){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(se)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(se){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+se)}registerDecoration(se){return this._decorationService.registerDecoration(se)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(se,G,oe){this._selectionService.setSelection(se,G,oe)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var se;(se=this._selectionService)==null||se.clearSelection()}selectAll(){var se;(se=this._selectionService)==null||se.selectAll()}selectLines(se,G){var oe;(oe=this._selectionService)==null||oe.selectLines(se,G)}_keyDown(se){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&se.altKey;if(!G&&!this._compositionHelper.keydown(se))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||se.key!=="Dead"&&se.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,Z.evaluateKeyboardEvent)(se,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(se),oe.type===3||oe.type===2){const ce=this.rows-1;return this.scrollLines(oe.type===2?-ce:ce),this.cancel(se,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,se)||(oe.cancel&&this.cancel(se,!0),!oe.key||!!(se.key&&!se.ctrlKey&&!se.altKey&&!se.metaKey&&se.key.length===1&&se.key.charCodeAt(0)>=65&&se.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==Q.C0.ETX&&oe.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||se.altKey||se.ctrlKey?this.cancel(se,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(se,G){const oe=se.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||se.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||se.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?oe:oe&&(!G.keyCode||G.keyCode>47)}_keyUp(se){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(se)||this.focus(),this.updateCursorStyle(se),this._keyPressHandled=!1)}_keyPress(se){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(se)===!1)return!1;if(this.cancel(se),se.charCode)G=se.charCode;else if(se.which===null||se.which===void 0)G=se.keyCode;else{if(se.which===0||se.charCode===0)return!1;G=se.which}return!(!G||(se.altKey||se.ctrlKey||se.metaKey)&&!this._isThirdLevelShift(this.browser,se)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:se}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(se){if(se.data&&se.inputType==="insertText"&&(!se.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=se.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(se),!0}return!1}resize(se,G){se!==this.cols||G!==this.rows?super.resize(se,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(se,G){var oe,ce;(oe=this._charSizeService)==null||oe.measure(),(ce=this.viewport)==null||ce.syncScrollArea(!0)}clear(){var se;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let G=1;G{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,u=1e3){this._renderCallback=c,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,u,_){this._rowCount=_,c=c!==void 0?c:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=f-this._lastRefreshMs,m=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,u)}}},1680:function(a,o,c){var u=this&&this.__decorate||function(v,y,w,C){var z,E=arguments.length,R=E<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,y,w,C);else for(var N=v.length-1;N>=0;N--)(z=v[N])&&(R=(E<3?z(R):E>3?z(y,w,R):z(y,w))||R);return E>3&&R&&Object.defineProperty(y,w,R),R},_=this&&this.__param||function(v,y){return function(w,C){y(w,C,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const f=c(3656),p=c(4725),m=c(8460),x=c(844),S=c(2585);let b=o.Viewport=class extends x.Disposable{constructor(v,y,w,C,z,E,R,N){super(),this._viewportElement=v,this._scrollArea=y,this._bufferService=w,this._optionsService=C,this._charSizeService=z,this._renderService=E,this._coreBrowserService=R,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(N.colors),this.register(N.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const y=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==y&&(this._lastRecordedBufferHeight=y,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const y=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(v,y){const w=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(y<0&&this._viewportElement.scrollTop!==0||y>0&&w0&&(w=H),C=""}}return{bufferElements:z,cursorElement:w}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let y=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(y/=this._currentRowHeight+0,this._wheelPartialScroll+=y,y=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(y*=this._bufferService.rows),y}_applyScrollModifier(v,y){const w=this._optionsService.rawOptions.fastScrollModifier;return w==="alt"&&y.altKey||w==="ctrl"&&y.ctrlKey||w==="shift"&&y.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const y=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,y!==0&&(this._viewportElement.scrollTop+=y,this._bubbleScroll(v,y))}};o.Viewport=b=u([_(2,S.IBufferService),_(3,S.IOptionsService),_(4,p.ICharSizeService),_(5,p.IRenderService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],b)},3107:function(a,o,c){var u=this&&this.__decorate||function(S,b,v,y){var w,C=arguments.length,z=C<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(S,b,v,y);else for(var E=S.length-1;E>=0;E--)(w=S[E])&&(z=(C<3?w(z):C>3?w(b,v,z):w(b,v))||z);return C>3&&z&&Object.defineProperty(b,v,z),z},_=this&&this.__param||function(S,b){return function(v,y){b(v,y,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const f=c(4725),p=c(844),m=c(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(S,b,v,y,w){super(),this._screenElement=S,this._bufferService=b,this._coreBrowserService=v,this._decorationService=y,this._renderService=w,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((C=>this._removeDecoration(C)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var y;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((y=S==null?void 0:S.options)==null?void 0:y.layer)==="top"),b.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=S.options.x??0;return v&&v>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(S,b),b}_refreshStyle(S){const b=S.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let v=this._decorationElements.get(S);v||(v=this._createElement(S),S.element=v,this._decorationElements.set(S,v),this._container.appendChild(v),S.onDispose((()=>{this._decorationElements.delete(S),v.remove()}))),v.style.top=b*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(v)}}_refreshXPosition(S,b=S.element){if(!b)return;const v=S.options.x??0;(S.options.anchor||"left")==="right"?b.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var b;(b=this._decorationElements.get(S))==null||b.remove(),this._decorationElements.delete(S),S.dispose()}};o.BufferDecorationRenderer=x=u([_(1,m.IBufferService),_(2,f.ICoreBrowserService),_(3,m.IDecorationService),_(4,f.IRenderService)],x)},5871:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const u of this._zones)if(u.color===c.options.overviewRulerOptions.color&&u.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,c.marker.line))return;if(this._lineAdjacentToZone(u,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(u,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&u<=c.endBufferLine}_lineAdjacentToZone(c,u,_){return u>=c.startBufferLine-this._linePadding[_||"full"]&&u<=c.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(c,u){c.startBufferLine=Math.min(c.startBufferLine,u),c.endBufferLine=Math.max(c.endBufferLine,u)}}},5744:function(a,o,c){var u=this&&this.__decorate||function(w,C,z,E){var R,N=arguments.length,M=N<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,z):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,C,z,E);else for(var O=w.length-1;O>=0;O--)(R=w[O])&&(M=(N<3?R(M):N>3?R(C,z,M):R(C,z))||M);return N>3&&M&&Object.defineProperty(C,z,M),M},_=this&&this.__param||function(w,C){return function(z,E){C(z,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const f=c(5871),p=c(4725),m=c(844),x=c(2585),S={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let y=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(w,C,z,E,R,N,M){var I;super(),this._viewportElement=w,this._screenElement=C,this._bufferService=z,this._decorationService=E,this._renderService=R,this._optionsService=N,this._coreBrowserService=M,this._colorZoneStore=new f.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)((()=>{var H;(H=this._canvas)==null||H.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const w=Math.floor(this._canvas.width/3),C=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=w,b.center=C,b.right=w,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=b.left,v.right=b.left+b.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const w=this._canvas.height/this._bufferService.buffer.lines.length,C=Math.round(Math.max(Math.min(w,12),6)*this._coreBrowserService.dpr);S.left=C,S.center=C,S.right=C}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const C of this._decorationService.decorations)this._colorZoneStore.addDecoration(C);this._ctx.lineWidth=1;const w=this._colorZoneStore.zones;for(const C of w)C.position!=="full"&&this._renderColorZone(C);for(const C of w)C.position==="full"&&this._renderColorZone(C);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(w){this._ctx.fillStyle=w.color,this._ctx.fillRect(v[w.position||"full"],Math.round((this._canvas.height-1)*(w.startBufferLine/this._bufferService.buffers.active.lines.length)-S[w.position||"full"]/2),b[w.position||"full"],Math.round((this._canvas.height-1)*((w.endBufferLine-w.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[w.position||"full"]))}_queueRefresh(w,C){this._shouldUpdateDimensions=w||this._shouldUpdateDimensions,this._shouldUpdateAnchor=C||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=y=u([_(2,x.IBufferService),_(3,x.IDecorationService),_(4,p.IRenderService),_(5,x.IOptionsService),_(6,p.ICoreBrowserService)],y)},2950:function(a,o,c){var u=this&&this.__decorate||function(S,b,v,y){var w,C=arguments.length,z=C<3?b:y===null?y=Object.getOwnPropertyDescriptor(b,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(S,b,v,y);else for(var E=S.length-1;E>=0;E--)(w=S[E])&&(z=(C<3?w(z):C>3?w(b,v,z):w(b,v))||z);return C>3&&z&&Object.defineProperty(b,v,z),z},_=this&&this.__param||function(S,b){return function(v,y){b(v,y,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const f=c(4725),p=c(2585),m=c(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,b,v,y,w,C){this._textarea=S,this._compositionView=b,this._bufferService=v,this._optionsService=y,this._coreService=w,this._renderService=C,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,v=b.replace(S,"");this._dataAlreadySent=v,b.length>S.length?this._coreService.triggerDataEvent(v,!0):b.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=x=u([_(2,p.IBufferService),_(3,p.IOptionsService),_(4,p.ICoreService),_(5,f.IRenderService)],x)},9806:(a,o)=>{function c(u,_,f){const p=f.getBoundingClientRect(),m=u.getComputedStyle(f),x=parseInt(m.getPropertyValue("padding-left")),S=parseInt(m.getPropertyValue("padding-top"));return[_.clientX-p.left-x,_.clientY-p.top-S]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(u,_,f,p,m,x,S,b,v){if(!x)return;const y=c(u,_,f);return y?(y[0]=Math.ceil((y[0]+(v?S/2:0))/S),y[1]=Math.ceil(y[1]/b),y[0]=Math.min(Math.max(y[0],1),p+(v?1:0)),y[1]=Math.min(Math.max(y[1],1),m),y):void 0}},9504:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const u=c(2584);function _(b,v,y,w){const C=b-f(b,y),z=v-f(v,y),E=Math.abs(C-z)-(function(R,N,M){let O=0;const I=R-f(R,M),H=N-f(N,M);for(let U=0;U=0&&bv?"A":"B"}function m(b,v,y,w,C,z){let E=b,R=v,N="";for(;E!==y||R!==w;)E+=C?1:-1,C&&E>z.cols-1?(N+=z.buffer.translateBufferLineToString(R,!1,b,E),E=0,b=0,R++):!C&&E<0&&(N+=z.buffer.translateBufferLineToString(R,!1,0,b+1),E=z.cols-1,b=E,R--);return N+z.buffer.translateBufferLineToString(R,!1,b,E)}function x(b,v){const y=v?"O":"[";return u.C0.ESC+y+b}function S(b,v){b=Math.floor(b);let y="";for(let w=0;w0?I-f(I,H):M;const Y=I,q=(function(Q,Z,B,D,P,X){let W;return W=_(B,D,P,X).length>0?D-f(D,P):Z,Q=B&&Wb?"D":"C",S(Math.abs(C-b),x(E,w));E=z>v?"D":"C";const R=Math.abs(z-v);return S((function(N,M){return M.cols-N})(z>v?b:C,y)+(R-1)*y.cols+1+((z>v?C:b)-1),x(E,w))}},1296:function(a,o,c){var u=this&&this.__decorate||function(U,F,Y,q){var Q,Z=arguments.length,B=Z<3?F:q===null?q=Object.getOwnPropertyDescriptor(F,Y):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(U,F,Y,q);else for(var D=U.length-1;D>=0;D--)(Q=U[D])&&(B=(Z<3?Q(B):Z>3?Q(F,Y,B):Q(F,Y))||B);return Z>3&&B&&Object.defineProperty(F,Y,B),B},_=this&&this.__param||function(U,F){return function(Y,q){F(Y,q,U)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const f=c(3787),p=c(2550),m=c(2223),x=c(6171),S=c(6052),b=c(4725),v=c(8055),y=c(8460),w=c(844),C=c(2585),z="xterm-dom-renderer-owner-",E="xterm-rows",R="xterm-fg-",N="xterm-bg-",M="xterm-focus",O="xterm-selection";let I=1,H=o.DomRenderer=class extends w.Disposable{constructor(U,F,Y,q,Q,Z,B,D,P,X,W,ie,le){super(),this._terminal=U,this._document=F,this._element=Y,this._screenElement=q,this._viewportElement=Q,this._helperContainer=Z,this._linkifier2=B,this._charSizeService=P,this._optionsService=X,this._bufferService=W,this._coreBrowserService=ie,this._themeService=le,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,S.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new y.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ae=>this._injectCss(ae)))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(z+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ae=>this._handleLinkHover(ae)))),this.register(this._linkifier2.onHideLinkUnderline((ae=>this._handleLinkLeave(ae)))),this.register((0,w.toDisposable)((()=>{this._element.classList.remove(z+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${E} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${E} .xterm-dim { color: ${v.color.multiplyOpacity(U.foreground,.5).css};}`,F+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;F+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${q} { 50% { box-shadow: none; }}`,F+=`@keyframes ${Q} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,F+=`${this._terminalSelector} .${E}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${E}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${E}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,B]of U.ansi.entries())F+=`${this._terminalSelector} .${R}${Z} { color: ${B.css}; }${this._terminalSelector} .${R}${Z}.xterm-dim { color: ${v.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${N}${Z} { background-color: ${B.css}; }`;F+=`${this._terminalSelector} .${R}${m.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(U.background).css}; }${this._terminalSelector} .${R}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${N}${m.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,F){for(let Y=this._rowElements.length;Y<=F;Y++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,F){this._refreshRowElements(U,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(U,F,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,F,Y),this.renderRows(0,this._bufferService.rows-1),!U||!F)return;this._selectionRenderModel.update(this._terminal,U,F,Y);const q=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||B<0)return;const D=this._document.createDocumentFragment();if(Y){const P=U[0]>F[0];D.appendChild(this._createSelectionElement(Z,P?F[0]:U[0],P?U[0]:F[0],B-Z+1))}else{const P=q===Z?U[0]:0,X=Z===Q?F[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(Z,P,X));const W=B-Z-1;if(D.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,W)),Z!==B){const ie=Q===B?F[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(B,0,ie))}}this._selectionContainer.appendChild(D)}_createSelectionElement(U,F,Y,q=1){const Q=this._document.createElement("div"),Z=F*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(Y-F);return Z+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-Z),Q.style.height=q*this.dimensions.css.cell.height+"px",Q.style.top=U*this.dimensions.css.cell.height+"px",Q.style.left=`${Z}px`,Q.style.width=`${B}px`,Q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const U of this._rowElements)U.replaceChildren()}renderRows(U,F){const Y=this._bufferService.buffer,q=Y.ybase+Y.y,Q=Math.min(Y.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=U;P<=F;P++){const X=P+Y.ydisp,W=this._rowElements[P],ie=Y.lines.get(X);if(!W||!ie)break;W.replaceChildren(...this._rowFactory.createRow(ie,X,X===q,B,D,Q,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${z}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,F,Y,q,Q,Z){Y<0&&(U=0),q<0&&(F=0);const B=this._bufferService.rows-1;Y=Math.max(Math.min(Y,B),0),q=Math.max(Math.min(q,B),0),Q=Math.min(Q,this._bufferService.cols);const D=this._bufferService.buffer,P=D.ybase+D.y,X=Math.min(D.x,Q-1),W=this._optionsService.rawOptions.cursorBlink,ie=this._optionsService.rawOptions.cursorStyle,le=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=Y;ae<=q;++ae){const se=ae+D.ydisp,G=this._rowElements[ae],oe=D.lines.get(se);if(!G||!oe)break;G.replaceChildren(...this._rowFactory.createRow(oe,se,se===P,ie,le,X,W,this.dimensions.css.cell.width,this._widthCache,Z?ae===Y?U:0:-1,Z?(ae===q?F:Q)-1:-1))}}};o.DomRenderer=H=u([_(7,C.IInstantiationService),_(8,b.ICharSizeService),_(9,C.IOptionsService),_(10,C.IBufferService),_(11,b.ICoreBrowserService),_(12,b.IThemeService)],H)},3787:function(a,o,c){var u=this&&this.__decorate||function(E,R,N,M){var O,I=arguments.length,H=I<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,N):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")H=Reflect.decorate(E,R,N,M);else for(var U=E.length-1;U>=0;U--)(O=E[U])&&(H=(I<3?O(H):I>3?O(R,N,H):O(R,N))||H);return I>3&&H&&Object.defineProperty(R,N,H),H},_=this&&this.__param||function(E,R){return function(N,M){R(N,M,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const f=c(2223),p=c(643),m=c(511),x=c(2585),S=c(8055),b=c(4725),v=c(4269),y=c(6171),w=c(3734);let C=o.DomRendererRowFactory=class{constructor(E,R,N,M,O,I,H){this._document=E,this._characterJoinerService=R,this._optionsService=N,this._coreBrowserService=M,this._coreService=O,this._decorationService=I,this._themeService=H,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,R,N){this._selectionStart=E,this._selectionEnd=R,this._columnSelectMode=N}createRow(E,R,N,M,O,I,H,U,F,Y,q){const Q=[],Z=this._characterJoinerService.getJoinedCharacters(R),B=this._themeService.colors;let D,P=E.getNoBgTrimmedLength();N&&P0&&Ee===Z[0][0]){Ie=!0;const Fe=Z.shift();He=new v.JoinedCellData(this._workCell,E.translateToString(!0,Fe[0],Fe[1]),Fe[1]-Fe[0]),Le=Fe[1]-1,Te=He.getWidth()}const Tt=this._isCellInSelection(Ee,R),Et=N&&Ee===I,Vt=ue&&Ee>=Y&&Ee<=q;let $t=!1;this._decorationService.forEachDecorationAtCell(Ee,R,void 0,(Fe=>{$t=!0}));let rt=He.getChars()||p.WHITESPACE_CELL_CHAR;if(rt===" "&&(He.isUnderline()||He.isOverline())&&(rt=" "),ce=Te*U-F.get(rt,He.isBold(),He.isItalic()),D){if(X&&(Tt&&oe||!Tt&&!oe&&He.bg===ie)&&(Tt&&oe&&B.selectionForeground||He.fg===le)&&He.extended.ext===ae&&Vt===se&&ce===G&&!Et&&!Ie&&!$t){He.isInvisible()?W+=p.WHITESPACE_CELL_CHAR:W+=rt,X++;continue}X&&(D.textContent=W),D=this._document.createElement("span"),X=0,W=""}else D=this._document.createElement("span");if(ie=He.bg,le=He.fg,ae=He.extended.ext,se=Vt,G=ce,oe=Tt,Ie&&I>=Ee&&I<=Le&&(I=Ee),!this._coreService.isCursorHidden&&Et&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)H&&pe.push("xterm-cursor-blink"),pe.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(He.isBold()&&pe.push("xterm-bold"),He.isItalic()&&pe.push("xterm-italic"),He.isDim()&&pe.push("xterm-dim"),W=He.isInvisible()?p.WHITESPACE_CELL_CHAR:He.getChars()||p.WHITESPACE_CELL_CHAR,He.isUnderline()&&(pe.push(`xterm-underline-${He.extended.underlineStyle}`),W===" "&&(W=" "),!He.isUnderlineColorDefault()))if(He.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${w.AttributeData.toColorRGB(He.getUnderlineColor()).join(",")})`;else{let Fe=He.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&He.isBold()&&Fe<8&&(Fe+=8),D.style.textDecorationColor=B.ansi[Fe].css}He.isOverline()&&(pe.push("xterm-overline"),W===" "&&(W=" ")),He.isStrikethrough()&&pe.push("xterm-strikethrough"),Vt&&(D.style.textDecoration="underline");let nt=He.getFgColor(),ut=He.getFgColorMode(),pt=He.getBgColor(),ve=He.getBgColorMode();const Oe=!!He.isInverse();if(Oe){const Fe=nt;nt=pt,pt=Fe;const Pt=ut;ut=ve,ve=Pt}let Je,ft,mt,Ht=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,R,void 0,(Fe=>{Fe.options.layer!=="top"&&Ht||(Fe.backgroundColorRGB&&(ve=50331648,pt=Fe.backgroundColorRGB.rgba>>8&16777215,Je=Fe.backgroundColorRGB),Fe.foregroundColorRGB&&(ut=50331648,nt=Fe.foregroundColorRGB.rgba>>8&16777215,ft=Fe.foregroundColorRGB),Ht=Fe.options.layer==="top")})),!Ht&&Tt&&(Je=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,pt=Je.rgba>>8&16777215,ve=50331648,Ht=!0,B.selectionForeground&&(ut=50331648,nt=B.selectionForeground.rgba>>8&16777215,ft=B.selectionForeground)),Ht&&pe.push("xterm-decoration-top"),ve){case 16777216:case 33554432:mt=B.ansi[pt],pe.push(`xterm-bg-${pt}`);break;case 50331648:mt=S.channels.toColor(pt>>16,pt>>8&255,255&pt),this._addStyle(D,`background-color:#${z((pt>>>0).toString(16),"0",6)}`);break;default:Oe?(mt=B.foreground,pe.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):mt=B.background}switch(Je||He.isDim()&&(Je=S.color.multiplyOpacity(mt,.5)),ut){case 16777216:case 33554432:He.isBold()&&nt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(nt+=8),this._applyMinimumContrast(D,mt,B.ansi[nt],He,Je,void 0)||pe.push(`xterm-fg-${nt}`);break;case 50331648:const Fe=S.channels.toColor(nt>>16&255,nt>>8&255,255&nt);this._applyMinimumContrast(D,mt,Fe,He,Je,ft)||this._addStyle(D,`color:#${z(nt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,mt,B.foreground,He,Je,ft)||Oe&&pe.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}pe.length&&(D.className=pe.join(" "),pe.length=0),Et||Ie||$t?D.textContent=W:X++,ce!==this.defaultSpacing&&(D.style.letterSpacing=`${ce}px`),Q.push(D),Ee=Le}return D&&X&&(D.textContent=W),Q}_applyMinimumContrast(E,R,N,M,O,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,y.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const H=this._getContrastCache(M);let U;if(O||I||(U=H.getColor(R.rgba,N.rgba)),U===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);U=S.color.ensureContrastRatio(O||R,I||N,F),H.setColor((O||R).rgba,(I||N).rgba,U??null)}return!!U&&(this._addStyle(E,`color:${U.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,R){E.setAttribute("style",`${E.getAttribute("style")||""}${R};`)}_isCellInSelection(E,R){const N=this._selectionStart,M=this._selectionEnd;return!(!N||!M)&&(this._columnSelectMode?N[0]<=M[0]?E>=N[0]&&R>=N[1]&&E=N[1]&&E>=M[0]&&R<=M[1]:R>N[1]&&R=N[0]&&E=N[0])}};function z(E,R,N){for(;E.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=c.createElement("span");_.classList.add("xterm-char-measure-element");const f=c.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[_,f,p,m],this._container.appendChild(_),this._container.appendChild(f),this._container.appendChild(p),this._container.appendChild(m),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,u,_,f){c===this._font&&u===this._fontSize&&_===this._weight&&f===this._weightBold||(this._font=c,this._fontSize=u,this._weight=_,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(c,u,_){let f=0;if(!u&&!_&&c.length===1&&(f=c.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const x=this._measure(c,0);return x>0&&(this._flat[f]=x),x}let p=c;u&&(p+="B"),_&&(p+="I");let m=this._holey.get(p);if(m===void 0){let x=0;u&&(x|=1),_&&(x|=2),m=this._measure(c,x),m>0&&this._holey.set(p,m)}return m}_measure(c,u){const _=this._measureElements[u];return _.textContent=c.repeat(32),_.offsetWidth/32}}},2223:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const u=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(a,o)=>{function c(_){return 57508<=_&&_<=57558}function u(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},o.isEmoji=u,o.allowRescaling=function(_,f,p,m){return f===1&&p>Math.ceil(1.5*m)&&_!==void 0&&_>255&&!u(_)&&!c(_)&&!(function(x){return 57344<=x&&x<=63743})(_)},o.treatGlyphAsBackgroundColor=function(_){return c(_)||(function(f){return 9472<=f&&f<=9631})(_)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(_,f,p=0){return(_-(2*Math.round(f)-p))%(2*Math.round(f))}},6052:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,f,p,m=!1){if(this.selectionStart=f,this.selectionEnd=p,!f||!p||f[0]===p[0]&&f[1]===p[1])return void this.clear();const x=_.buffers.active.ydisp,S=f[1]-x,b=p[1]-x,v=Math.max(S,0),y=Math.min(b,_.rows-1);v>=_.rows||y<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=S,this.viewportEndRow=b,this.viewportCappedStartRow=v,this.viewportCappedEndRow=y,this.startCol=f[0],this.endCol=p[0])}isCellSelected(_,f,p){return!!this.hasSelection&&(p-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&p>=this.viewportCappedStartRow&&f=this.viewportCappedStartRow&&f>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p=this.startCol&&f=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,u=this.selectionEnd;return!(!c||!u)&&(c[1]>u[1]||c[1]===u[1]&&c[0]>u[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(a,o,c){var u=this&&this.__decorate||function(y,w,C,z){var E,R=arguments.length,N=R<3?w:z===null?z=Object.getOwnPropertyDescriptor(w,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,w,C,z);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(N=(R<3?E(N):R>3?E(w,C,N):E(w,C))||N);return R>3&&N&&Object.defineProperty(w,C,N),N},_=this&&this.__param||function(y,w){return function(C,z){w(C,z,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const f=c(2585),p=c(8460),m=c(844);let x=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(y,w,C){super(),this._optionsService=C,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new b(y,w,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const y=this._measureStrategy.measure();y.width===this.width&&y.height===this.height||(this.width=y.width,this.height=y.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=u([_(2,f.IOptionsService)],x);class S extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(w,C){w!==void 0&&w>0&&C!==void 0&&C>0&&(this._result.width=w,this._result.height=C)}}class b extends S{constructor(w,C,z){super(),this._document=w,this._parentElement=C,this._optionsService=z,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class v extends S{constructor(w){super(),this._optionsService=w,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const C=this._ctx.measureText("W");if(!("width"in C&&"fontBoundingBoxAscent"in C&&"fontBoundingBoxDescent"in C))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const w=this._ctx.measureText("W");return this._validateAndSet(w.width,w.fontBoundingBoxAscent+w.fontBoundingBoxDescent),this._result}}},4269:function(a,o,c){var u=this&&this.__decorate||function(v,y,w,C){var z,E=arguments.length,R=E<3?y:C===null?C=Object.getOwnPropertyDescriptor(y,w):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,y,w,C);else for(var N=v.length-1;N>=0;N--)(z=v[N])&&(R=(E<3?z(R):E>3?z(y,w,R):z(y,w))||R);return E>3&&R&&Object.defineProperty(y,w,R),R},_=this&&this.__param||function(v,y){return function(w,C){y(w,C,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const f=c(3734),p=c(643),m=c(511),x=c(2585);class S extends f.AttributeData{constructor(y,w,C){super(),this.content=0,this.combinedData="",this.fg=y.fg,this.bg=y.bg,this.combinedData=w,this._width=C}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(y){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=S;let b=o.CharacterJoinerService=class iR{constructor(y){this._bufferService=y,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(y){const w={id:this._nextCharacterJoinerId++,handler:y};return this._characterJoiners.push(w),w.id}deregister(y){for(let w=0;w1){const H=this._getJoinedRanges(z,N,R,w,E);for(let U=0;U1){const I=this._getJoinedRanges(z,N,R,w,E);for(let H=0;H{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const u=c(844),_=c(8460),f=c(3656);class p extends u.Disposable{constructor(S,b,v){super(),this._textarea=S,this._window=b,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((y=>this._screenDprMonitor.setWindow(y)))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=p;class m extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const u=c(844);class _ extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const m=this.linkProviders.indexOf(p);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=_},8934:function(a,o,c){var u=this&&this.__decorate||function(x,S,b,v){var y,w=arguments.length,C=w<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,b):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(x,S,b,v);else for(var z=x.length-1;z>=0;z--)(y=x[z])&&(C=(w<3?y(C):w>3?y(S,b,C):y(S,b))||C);return w>3&&C&&Object.defineProperty(S,b,C),C},_=this&&this.__param||function(x,S){return function(b,v){S(b,v,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const f=c(4725),p=c(9806);let m=o.MouseService=class{constructor(x,S){this._renderService=x,this._charSizeService=S}getCoords(x,S,b,v,y){return(0,p.getCoords)(window,x,S,b,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,y)}getMouseReportCoords(x,S){const b=(0,p.getCoordsRelativeToElement)(window,x,S);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};o.MouseService=m=u([_(0,f.IRenderService),_(1,f.ICharSizeService)],m)},3230:function(a,o,c){var u=this&&this.__decorate||function(y,w,C,z){var E,R=arguments.length,N=R<3?w:z===null?z=Object.getOwnPropertyDescriptor(w,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,w,C,z);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(N=(R<3?E(N):R>3?E(w,C,N):E(w,C))||N);return R>3&&N&&Object.defineProperty(w,C,N),N},_=this&&this.__param||function(y,w){return function(C,z){w(C,z,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const f=c(6193),p=c(4725),m=c(8460),x=c(844),S=c(7226),b=c(2585);let v=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(y,w,C,z,E,R,N,M){super(),this._rowCount=y,this._charSizeService=z,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((O,I)=>this._renderRows(O,I)),N),this.register(this._renderDebouncer),this.register(N.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(C.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(C.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(C.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(N.window,w),this.register(N.onWindowChange((O=>this._registerIntersectionObserver(O,w))))}_registerIntersectionObserver(y,w){if("IntersectionObserver"in y){const C=new y.IntersectionObserver((z=>this._handleIntersectionChange(z[z.length-1])),{threshold:0});C.observe(w),this._observerDisposable.value=(0,x.toDisposable)((()=>C.disconnect()))}}_handleIntersectionChange(y){this._isPaused=y.isIntersecting===void 0?y.intersectionRatio===0:!y.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(y,w,C=!1){this._isPaused?this._needsFullRefresh=!0:(C||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(y,w,this._rowCount))}_renderRows(y,w){this._renderer.value&&(y=Math.min(y,this._rowCount-1),w=Math.min(w,this._rowCount-1),this._renderer.value.renderRows(y,w),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:y,end:w}),this._onRender.fire({start:y,end:w}),this._isNextRenderRedrawOnly=!0)}resize(y,w){this._rowCount=w,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(y){this._renderer.value=y,this._renderer.value&&(this._renderer.value.onRequestRedraw((w=>this.refreshRows(w.start,w.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(y){return this._renderDebouncer.addRefreshCallback(y)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var y,w;this._renderer.value&&((w=(y=this._renderer.value).clearTextureAtlas)==null||w.call(y),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(y,w){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var C;return(C=this._renderer.value)==null?void 0:C.handleResize(y,w)})):this._renderer.value.handleResize(y,w),this._fullRefresh())}handleCharSizeChanged(){var y;(y=this._renderer.value)==null||y.handleCharSizeChanged()}handleBlur(){var y;(y=this._renderer.value)==null||y.handleBlur()}handleFocus(){var y;(y=this._renderer.value)==null||y.handleFocus()}handleSelectionChanged(y,w,C){var z;this._selectionState.start=y,this._selectionState.end=w,this._selectionState.columnSelectMode=C,(z=this._renderer.value)==null||z.handleSelectionChanged(y,w,C)}handleCursorMove(){var y;(y=this._renderer.value)==null||y.handleCursorMove()}clear(){var y;(y=this._renderer.value)==null||y.clear()}};o.RenderService=v=u([_(2,b.IOptionsService),_(3,p.ICharSizeService),_(4,b.IDecorationService),_(5,b.IBufferService),_(6,p.ICoreBrowserService),_(7,p.IThemeService)],v)},9312:function(a,o,c){var u=this&&this.__decorate||function(N,M,O,I){var H,U=arguments.length,F=U<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,O):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(N,M,O,I);else for(var Y=N.length-1;Y>=0;Y--)(H=N[Y])&&(F=(U<3?H(F):U>3?H(M,O,F):H(M,O))||F);return U>3&&F&&Object.defineProperty(M,O,F),F},_=this&&this.__param||function(N,M){return function(O,I){M(O,I,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const f=c(9806),p=c(9504),m=c(456),x=c(4725),S=c(8460),b=c(844),v=c(6114),y=c(4841),w=c(511),C=c(2585),z=" ",E=new RegExp(z,"g");let R=o.SelectionService=class extends b.Disposable{constructor(N,M,O,I,H,U,F,Y,q){super(),this._element=N,this._screenElement=M,this._linkifier=O,this._bufferService=I,this._coreService=H,this._mouseService=U,this._optionsService=F,this._renderService=Y,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new w.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const N=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!N||!M||N[0]===M[0]&&N[1]===M[1])}get selectionText(){const N=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!N||!M)return"";const O=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(N[0]===M[0])return"";const H=N[0]H.replace(E," "))).join(v.isWindows?`\r +`:` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(N){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&N&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(N){const M=this._getMouseBufferCoords(N),O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(O&&I&&M)&&this._areCoordsInSelection(M,O,I)}isCellInSelection(N,M){const O=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!O||!I)&&this._areCoordsInSelection([N,M],O,I)}_areCoordsInSelection(N,M,O){return N[1]>M[1]&&N[1]=M[0]&&N[0]=M[0]}_selectWordAtCursor(N,M){var H,U;const O=(U=(H=this._linkifier.currentLink)==null?void 0:H.link)==null?void 0:U.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,y.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(N);return!!I&&(this._selectWordAt(I,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(N,M){this._model.clearSelection(),N=Math.max(N,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,N],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(N){this._model.handleTrim(N)&&this.refresh()}_getMouseBufferCoords(N){const M=this._mouseService.getCoords(N,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(N){let M=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,N,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=O?0:(M>O&&(M-=O),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(N){return v.isMac?N.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:N.shiftKey}handleMouseDown(N){if(this._mouseDownTimeStamp=N.timeStamp,(N.button!==2||!this.hasSelection)&&N.button===0){if(!this._enabled){if(!this.shouldForceSelection(N))return;N.stopPropagation()}N.preventDefault(),this._dragScrollAmount=0,this._enabled&&N.shiftKey?this._handleIncrementalClick(N):N.detail===1?this._handleSingleClick(N):N.detail===2?this._handleDoubleClick(N):N.detail===3&&this._handleTripleClick(N),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(N){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(N))}_handleSingleClick(N){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(N)?3:0,this._model.selectionStart=this._getMouseBufferCoords(N),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(N){this._selectWordAtCursor(N,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(N){const M=this._getMouseBufferCoords(N);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(N){return N.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(N){if(N.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(N),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(N.ydisp+this._bufferService.rows,N.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=N.ydisp),this.refresh()}}_handleMouseUp(N){const M=N.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&N.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(N,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const I=(0,p.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const N=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,O=!(!N||!M||N[0]===M[0]&&N[1]===M[1]);O?N&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&N[0]===this._oldSelectionStart[0]&&N[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(N,M,O)):this._oldHasSelection&&this._fireOnSelectionChange(N,M,O)}_fireOnSelectionChange(N,M,O){this._oldSelectionStart=N,this._oldSelectionEnd=M,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(N){this.clearSelection(),this._trimListener.dispose(),this._trimListener=N.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(N,M){let O=M;for(let I=0;M>=I;I++){const H=N.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:H>1&&M!==I&&(O+=H-1)}return O}setSelection(N,M,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[N,M],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(N){this._isClickInSelection(N)||(this._selectWordAtCursor(N,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(N,M,O=!0,I=!0){if(N[0]>=this._bufferService.cols)return;const H=this._bufferService.buffer,U=H.lines.get(N[1]);if(!U)return;const F=H.translateBufferLineToString(N[1],!1);let Y=this._convertViewportColToCharacterIndex(U,N[0]),q=Y;const Q=N[0]-Y;let Z=0,B=0,D=0,P=0;if(F.charAt(Y)===" "){for(;Y>0&&F.charAt(Y-1)===" ";)Y--;for(;q1&&(P+=ae-1,q+=ae-1);ie>0&&Y>0&&!this._isCharWordSeparator(U.loadCell(ie-1,this._workCell));){U.loadCell(ie-1,this._workCell);const se=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,ie--):se>1&&(D+=se-1,Y-=se-1),Y--,ie--}for(;le1&&(P+=se-1,q+=se-1),q++,le++}}q++;let X=Y+Q-Z+D,W=Math.min(this._bufferService.cols,q-Y+Z+B-D-P);if(M||F.slice(Y,q).trim()!==""){if(O&&X===0&&U.getCodePoint(0)!==32){const ie=H.lines.get(N[1]-1);if(ie&&U.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const le=this._getWordAt([this._bufferService.cols-1,N[1]-1],!1,!0,!1);if(le){const ae=this._bufferService.cols-le.start;X-=ae,W+=ae}}}if(I&&X+W===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const ie=H.lines.get(N[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const le=this._getWordAt([0,N[1]+1],!1,!1,!0);le&&(W+=le.length)}}return{start:X,length:W}}}_selectWordAt(N,M){const O=this._getWordAt(N,M);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,N[1]--;this._model.selectionStart=[O.start,N[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(N){const M=this._getWordAt(N,!0);if(M){let O=N[1];for(;M.start<0;)M.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,O]}}_isCharWordSeparator(N){return N.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(N.getChars())>=0}_selectLineAt(N){const M=this._bufferService.buffer.getWrappedRangeForLine(N),O={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,y.getRangeLength)(O,this._bufferService.cols)}};o.SelectionService=R=u([_(3,C.IBufferService),_(4,C.ICoreService),_(5,x.IMouseService),_(6,C.IOptionsService),_(7,x.IRenderService),_(8,x.ICoreBrowserService)],R)},4725:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=c(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(a,o,c){var u=this&&this.__decorate||function(R,N,M,O){var I,H=arguments.length,U=H<3?N:O===null?O=Object.getOwnPropertyDescriptor(N,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(R,N,M,O);else for(var F=R.length-1;F>=0;F--)(I=R[F])&&(U=(H<3?I(U):H>3?I(N,M,U):I(N,M))||U);return H>3&&U&&Object.defineProperty(N,M,U),U},_=this&&this.__param||function(R,N){return function(M,O){N(M,O,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const f=c(7239),p=c(8055),m=c(8460),x=c(844),S=c(2585),b=p.css.toColor("#ffffff"),v=p.css.toColor("#000000"),y=p.css.toColor("#ffffff"),w=p.css.toColor("#000000"),C={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],N=[0,95,135,175,215,255];for(let M=0;M<216;M++){const O=N[M/36%6|0],I=N[M/6%6|0],H=N[M%6];R.push({css:p.channels.toCss(O,I,H),rgba:p.channels.toRgba(O,I,H)})}for(let M=0;M<24;M++){const O=8+10*M;R.push({css:p.channels.toCss(O,O,O),rgba:p.channels.toRgba(O,O,O)})}return R})());let z=o.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:v,cursor:y,cursorAccent:w,selectionForeground:void 0,selectionBackgroundTransparent:C,selectionBackgroundOpaque:p.color.blend(v,C),selectionInactiveBackgroundTransparent:C,selectionInactiveBackgroundOpaque:p.color.blend(v,C),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(R={}){const N=this._colors;if(N.foreground=E(R.foreground,b),N.background=E(R.background,v),N.cursor=E(R.cursor,y),N.cursorAccent=E(R.cursorAccent,w),N.selectionBackgroundTransparent=E(R.selectionBackground,C),N.selectionBackgroundOpaque=p.color.blend(N.background,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundTransparent=E(R.selectionInactiveBackground,N.selectionBackgroundTransparent),N.selectionInactiveBackgroundOpaque=p.color.blend(N.background,N.selectionInactiveBackgroundTransparent),N.selectionForeground=R.selectionForeground?E(R.selectionForeground,p.NULL_COLOR):void 0,N.selectionForeground===p.NULL_COLOR&&(N.selectionForeground=void 0),p.color.isOpaque(N.selectionBackgroundTransparent)&&(N.selectionBackgroundTransparent=p.color.opacity(N.selectionBackgroundTransparent,.3)),p.color.isOpaque(N.selectionInactiveBackgroundTransparent)&&(N.selectionInactiveBackgroundTransparent=p.color.opacity(N.selectionInactiveBackgroundTransparent,.3)),N.ansi=o.DEFAULT_ANSI_COLORS.slice(),N.ansi[0]=E(R.black,o.DEFAULT_ANSI_COLORS[0]),N.ansi[1]=E(R.red,o.DEFAULT_ANSI_COLORS[1]),N.ansi[2]=E(R.green,o.DEFAULT_ANSI_COLORS[2]),N.ansi[3]=E(R.yellow,o.DEFAULT_ANSI_COLORS[3]),N.ansi[4]=E(R.blue,o.DEFAULT_ANSI_COLORS[4]),N.ansi[5]=E(R.magenta,o.DEFAULT_ANSI_COLORS[5]),N.ansi[6]=E(R.cyan,o.DEFAULT_ANSI_COLORS[6]),N.ansi[7]=E(R.white,o.DEFAULT_ANSI_COLORS[7]),N.ansi[8]=E(R.brightBlack,o.DEFAULT_ANSI_COLORS[8]),N.ansi[9]=E(R.brightRed,o.DEFAULT_ANSI_COLORS[9]),N.ansi[10]=E(R.brightGreen,o.DEFAULT_ANSI_COLORS[10]),N.ansi[11]=E(R.brightYellow,o.DEFAULT_ANSI_COLORS[11]),N.ansi[12]=E(R.brightBlue,o.DEFAULT_ANSI_COLORS[12]),N.ansi[13]=E(R.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),N.ansi[14]=E(R.brightCyan,o.DEFAULT_ANSI_COLORS[14]),N.ansi[15]=E(R.brightWhite,o.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const M=Math.min(N.ansi.length-16,R.extendedAnsi.length);for(let O=0;O{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=c(8460),_=c(844);class f extends _.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const x=new Array(m);for(let S=0;Sthis._length)for(let x=this._length;x=m;b--)this._array[this._getCyclicIndex(b+S.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;bthis._maxLength){const b=this._length+S.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=S.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,S){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let v=x-1;v>=0;v--)this.set(m+v+S,this.get(m+v));const b=m+x+S-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(u,_=5){if(typeof u!="object")return u;const f=Array.isArray(u)?[]:{};for(const p in u)f[p]=_<=1?u[p]:u[p]&&c(u[p],_-1);return f}},8055:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,u=0,_=0,f=0;var p,m,x,S,b;function v(w){const C=w.toString(16);return C.length<2?"0"+C:C}function y(w,C){return w>>0},w.toColor=function(C,z,E,R){return{css:w.toCss(C,z,E,R),rgba:w.toRgba(C,z,E,R)}}})(p||(o.channels=p={})),(function(w){function C(z,E){return f=Math.round(255*E),[c,u,_]=b.toChannels(z.rgba),{css:p.toCss(c,u,_,f),rgba:p.toRgba(c,u,_,f)}}w.blend=function(z,E){if(f=(255&E.rgba)/255,f===1)return{css:E.css,rgba:E.rgba};const R=E.rgba>>24&255,N=E.rgba>>16&255,M=E.rgba>>8&255,O=z.rgba>>24&255,I=z.rgba>>16&255,H=z.rgba>>8&255;return c=O+Math.round((R-O)*f),u=I+Math.round((N-I)*f),_=H+Math.round((M-H)*f),{css:p.toCss(c,u,_),rgba:p.toRgba(c,u,_)}},w.isOpaque=function(z){return(255&z.rgba)==255},w.ensureContrastRatio=function(z,E,R){const N=b.ensureContrastRatio(z.rgba,E.rgba,R);if(N)return p.toColor(N>>24&255,N>>16&255,N>>8&255)},w.opaque=function(z){const E=(255|z.rgba)>>>0;return[c,u,_]=b.toChannels(E),{css:p.toCss(c,u,_),rgba:E}},w.opacity=C,w.multiplyOpacity=function(z,E){return f=255&z.rgba,C(z,f*E/255)},w.toColorRGB=function(z){return[z.rgba>>24&255,z.rgba>>16&255,z.rgba>>8&255]}})(m||(o.color=m={})),(function(w){let C,z;try{const E=document.createElement("canvas");E.width=1,E.height=1;const R=E.getContext("2d",{willReadFrequently:!0});R&&(C=R,C.globalCompositeOperation="copy",z=C.createLinearGradient(0,0,1,1))}catch{}w.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return c=parseInt(E.slice(1,2).repeat(2),16),u=parseInt(E.slice(2,3).repeat(2),16),_=parseInt(E.slice(3,4).repeat(2),16),p.toColor(c,u,_);case 5:return c=parseInt(E.slice(1,2).repeat(2),16),u=parseInt(E.slice(2,3).repeat(2),16),_=parseInt(E.slice(3,4).repeat(2),16),f=parseInt(E.slice(4,5).repeat(2),16),p.toColor(c,u,_,f);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const R=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return c=parseInt(R[1]),u=parseInt(R[2]),_=parseInt(R[3]),f=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),p.toColor(c,u,_,f);if(!C||!z)throw new Error("css.toColor: Unsupported css format");if(C.fillStyle=z,C.fillStyle=E,typeof C.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(C.fillRect(0,0,1,1),[c,u,_,f]=C.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(c,u,_,f),css:E}}})(x||(o.css=x={})),(function(w){function C(z,E,R){const N=z/255,M=E/255,O=R/255;return .2126*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}w.relativeLuminance=function(z){return C(z>>16&255,z>>8&255,255&z)},w.relativeLuminance2=C})(S||(o.rgb=S={})),(function(w){function C(E,R,N){const M=E>>24&255,O=E>>16&255,I=E>>8&255;let H=R>>24&255,U=R>>16&255,F=R>>8&255,Y=y(S.relativeLuminance2(H,U,F),S.relativeLuminance2(M,O,I));for(;Y0||U>0||F>0);)H-=Math.max(0,Math.ceil(.1*H)),U-=Math.max(0,Math.ceil(.1*U)),F-=Math.max(0,Math.ceil(.1*F)),Y=y(S.relativeLuminance2(H,U,F),S.relativeLuminance2(M,O,I));return(H<<24|U<<16|F<<8|255)>>>0}function z(E,R,N){const M=E>>24&255,O=E>>16&255,I=E>>8&255;let H=R>>24&255,U=R>>16&255,F=R>>8&255,Y=y(S.relativeLuminance2(H,U,F),S.relativeLuminance2(M,O,I));for(;Y>>0}w.blend=function(E,R){if(f=(255&R)/255,f===1)return R;const N=R>>24&255,M=R>>16&255,O=R>>8&255,I=E>>24&255,H=E>>16&255,U=E>>8&255;return c=I+Math.round((N-I)*f),u=H+Math.round((M-H)*f),_=U+Math.round((O-U)*f),p.toRgba(c,u,_)},w.ensureContrastRatio=function(E,R,N){const M=S.relativeLuminance(E>>8),O=S.relativeLuminance(R>>8);if(y(M,O)>8));if(Fy(M,S.relativeLuminance(Y>>8))?U:Y}return U}const I=z(E,R,N),H=y(M,S.relativeLuminance(I>>8));if(Hy(M,S.relativeLuminance(U>>8))?I:U}return I}},w.reduceLuminance=C,w.increaseLuminance=z,w.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(b||(o.rgba=b={})),o.toPaddedHex=v,o.contrastRatio=y},8969:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=c(844),_=c(2585),f=c(4348),p=c(7866),m=c(744),x=c(7302),S=c(6975),b=c(8460),v=c(1753),y=c(1480),w=c(7994),C=c(9282),z=c(5435),E=c(5981),R=c(2660);let N=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((I=>{var H;(H=this._onScrollApi)==null||H.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const H in I)this.optionsService.options[H]=I[H]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new x.OptionsService(I)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(y.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(w.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new z.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((H=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((H=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new E.WriteBuffer(((H,U)=>this._inputHandler.parse(H,U)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,H){this._writeBuffer.write(I,H)}writeSync(I,H){this._logService.logLevel<=_.LogLevelEnum.WARN&&!N&&(this._logService.warn("writeSync is unreliable and will be removed soon."),N=!0),this._writeBuffer.writeSync(I,H)}input(I,H=!0){this.coreService.triggerDataEvent(I,H)}resize(I,H){isNaN(I)||isNaN(H)||(I=Math.max(I,m.MINIMUM_COLS),H=Math.max(H,m.MINIMUM_ROWS),this._bufferService.resize(I,H))}scroll(I,H=!1){this._bufferService.scroll(I,H)}scrollLines(I,H,U){this._bufferService.scrollLines(I,H,U)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const H=I-this._bufferService.buffer.ydisp;H!==0&&this.scrollLines(H)}registerEscHandler(I,H){return this._inputHandler.registerEscHandler(I,H)}registerDcsHandler(I,H){return this._inputHandler.registerDcsHandler(I,H)}registerCsiHandler(I,H){return this._inputHandler.registerCsiHandler(I,H)}registerOscHandler(I,H){return this._inputHandler.registerOscHandler(I,H)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const H=this.optionsService.rawOptions.windowsPty;H&&H.buildNumber!==void 0&&H.buildNumber!==void 0?I=H.backend==="conpty"&&H.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(C.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,C.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const H of I)H.dispose()}))}}}o.CoreTerminal=M},8460:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;uu.fire(_)))},o.runAndSubscribe=function(c,u){return u(void 0),c((_=>u(_)))}},5435:function(a,o,c){var u=this&&this.__decorate||function(Z,B,D,P){var X,W=arguments.length,ie=W<3?B:P===null?P=Object.getOwnPropertyDescriptor(B,D):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(Z,B,D,P);else for(var le=Z.length-1;le>=0;le--)(X=Z[le])&&(ie=(W<3?X(ie):W>3?X(B,D,ie):X(B,D))||ie);return W>3&&ie&&Object.defineProperty(B,D,ie),ie},_=this&&this.__param||function(Z,B){return function(D,P){B(D,P,Z)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const f=c(2584),p=c(7116),m=c(2015),x=c(844),S=c(482),b=c(8437),v=c(8460),y=c(643),w=c(511),C=c(3734),z=c(2585),E=c(1480),R=c(6242),N=c(6351),M=c(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function H(Z,B){if(Z>24)return B.setWinLines||!1;switch(Z){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var U;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(o.WindowsOptionsReportType=U={}));let F=0;class Y extends x.Disposable{getAttrData(){return this._curAttrData}constructor(B,D,P,X,W,ie,le,ae,se=new m.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=D,this._coreService=P,this._logService=X,this._optionsService=W,this._oscLinkService=ie,this._coreMouseService=le,this._unicodeService=ae,this._parser=se,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new w.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((G=>this._activeBuffer=G.activeBuffer))),this._parser.setCsiHandlerFallback(((G,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(G),params:oe.toArray()})})),this._parser.setEscHandlerFallback((G=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(G)})})),this._parser.setExecuteHandlerFallback((G=>{this._logService.debug("Unknown EXECUTE code: ",{code:G})})),this._parser.setOscHandlerFallback(((G,oe,ce)=>{this._logService.debug("Unknown OSC code: ",{identifier:G,action:oe,data:ce})})),this._parser.setDcsHandlerFallback(((G,oe,ce)=>{oe==="HOOK"&&(ce=ce.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(G),action:oe,payload:ce})})),this._parser.setPrintHandler(((G,oe,ce)=>this.print(G,oe,ce))),this._parser.registerCsiHandler({final:"@"},(G=>this.insertChars(G))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(G=>this.scrollLeft(G))),this._parser.registerCsiHandler({final:"A"},(G=>this.cursorUp(G))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(G=>this.scrollRight(G))),this._parser.registerCsiHandler({final:"B"},(G=>this.cursorDown(G))),this._parser.registerCsiHandler({final:"C"},(G=>this.cursorForward(G))),this._parser.registerCsiHandler({final:"D"},(G=>this.cursorBackward(G))),this._parser.registerCsiHandler({final:"E"},(G=>this.cursorNextLine(G))),this._parser.registerCsiHandler({final:"F"},(G=>this.cursorPrecedingLine(G))),this._parser.registerCsiHandler({final:"G"},(G=>this.cursorCharAbsolute(G))),this._parser.registerCsiHandler({final:"H"},(G=>this.cursorPosition(G))),this._parser.registerCsiHandler({final:"I"},(G=>this.cursorForwardTab(G))),this._parser.registerCsiHandler({final:"J"},(G=>this.eraseInDisplay(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(G=>this.eraseInDisplay(G,!0))),this._parser.registerCsiHandler({final:"K"},(G=>this.eraseInLine(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(G=>this.eraseInLine(G,!0))),this._parser.registerCsiHandler({final:"L"},(G=>this.insertLines(G))),this._parser.registerCsiHandler({final:"M"},(G=>this.deleteLines(G))),this._parser.registerCsiHandler({final:"P"},(G=>this.deleteChars(G))),this._parser.registerCsiHandler({final:"S"},(G=>this.scrollUp(G))),this._parser.registerCsiHandler({final:"T"},(G=>this.scrollDown(G))),this._parser.registerCsiHandler({final:"X"},(G=>this.eraseChars(G))),this._parser.registerCsiHandler({final:"Z"},(G=>this.cursorBackwardTab(G))),this._parser.registerCsiHandler({final:"`"},(G=>this.charPosAbsolute(G))),this._parser.registerCsiHandler({final:"a"},(G=>this.hPositionRelative(G))),this._parser.registerCsiHandler({final:"b"},(G=>this.repeatPrecedingCharacter(G))),this._parser.registerCsiHandler({final:"c"},(G=>this.sendDeviceAttributesPrimary(G))),this._parser.registerCsiHandler({prefix:">",final:"c"},(G=>this.sendDeviceAttributesSecondary(G))),this._parser.registerCsiHandler({final:"d"},(G=>this.linePosAbsolute(G))),this._parser.registerCsiHandler({final:"e"},(G=>this.vPositionRelative(G))),this._parser.registerCsiHandler({final:"f"},(G=>this.hVPosition(G))),this._parser.registerCsiHandler({final:"g"},(G=>this.tabClear(G))),this._parser.registerCsiHandler({final:"h"},(G=>this.setMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(G=>this.setModePrivate(G))),this._parser.registerCsiHandler({final:"l"},(G=>this.resetMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(G=>this.resetModePrivate(G))),this._parser.registerCsiHandler({final:"m"},(G=>this.charAttributes(G))),this._parser.registerCsiHandler({final:"n"},(G=>this.deviceStatus(G))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(G=>this.deviceStatusPrivate(G))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(G=>this.softReset(G))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(G=>this.setCursorStyle(G))),this._parser.registerCsiHandler({final:"r"},(G=>this.setScrollRegion(G))),this._parser.registerCsiHandler({final:"s"},(G=>this.saveCursor(G))),this._parser.registerCsiHandler({final:"t"},(G=>this.windowOptions(G))),this._parser.registerCsiHandler({final:"u"},(G=>this.restoreCursor(G))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(G=>this.insertColumns(G))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(G=>this.deleteColumns(G))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(G=>this.selectProtected(G))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(G=>this.requestMode(G,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(G=>this.requestMode(G,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new R.OscHandler((G=>(this.setTitle(G),this.setIconName(G),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((G=>this.setIconName(G)))),this._parser.registerOscHandler(2,new R.OscHandler((G=>this.setTitle(G)))),this._parser.registerOscHandler(4,new R.OscHandler((G=>this.setOrReportIndexedColor(G)))),this._parser.registerOscHandler(8,new R.OscHandler((G=>this.setHyperlink(G)))),this._parser.registerOscHandler(10,new R.OscHandler((G=>this.setOrReportFgColor(G)))),this._parser.registerOscHandler(11,new R.OscHandler((G=>this.setOrReportBgColor(G)))),this._parser.registerOscHandler(12,new R.OscHandler((G=>this.setOrReportCursorColor(G)))),this._parser.registerOscHandler(104,new R.OscHandler((G=>this.restoreIndexedColor(G)))),this._parser.registerOscHandler(110,new R.OscHandler((G=>this.restoreFgColor(G)))),this._parser.registerOscHandler(111,new R.OscHandler((G=>this.restoreBgColor(G)))),this._parser.registerOscHandler(112,new R.OscHandler((G=>this.restoreCursorColor(G)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const G in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:G},(()=>this.selectCharset("("+G))),this._parser.registerEscHandler({intermediates:")",final:G},(()=>this.selectCharset(")"+G))),this._parser.registerEscHandler({intermediates:"*",final:G},(()=>this.selectCharset("*"+G))),this._parser.registerEscHandler({intermediates:"+",final:G},(()=>this.selectCharset("+"+G))),this._parser.registerEscHandler({intermediates:"-",final:G},(()=>this.selectCharset("-"+G))),this._parser.registerEscHandler({intermediates:".",final:G},(()=>this.selectCharset("."+G))),this._parser.registerEscHandler({intermediates:"/",final:G},(()=>this.selectCharset("/"+G)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((G=>(this._logService.error("Parsing error: ",G),G))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new N.DcsHandler(((G,oe)=>this.requestStatusString(G,oe))))}_preserveStack(B,D,P,X){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=P,this._parseStack.position=X}_logSlowResolvingAsync(B){this._logService.logLevel<=z.LogLevelEnum.WARN&&Promise.race([B,new Promise(((D,P)=>setTimeout((()=>P("#SLOW_TIMEOUT")),5e3)))]).catch((D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,D){let P,X=this._activeBuffer.x,W=this._activeBuffer.y,ie=0;const le=this._parseStack.paused;if(le){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(P),P;X=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>I&&(ie=this._parseStack.position+I)}if(this._logService.logLevel<=z.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,(G=>String.fromCharCode(G))).join("")}"`),typeof B=="string"?B.split("").map((G=>G.charCodeAt(0))):B),this._parseBuffer.lengthI)for(let G=ie;G0&&ce.getWidth(this._activeBuffer.x-1)===2&&ce.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let pe=this._parser.precedingJoinState;for(let ue=D;ueae){if(se){const Le=ce;let He=this._activeBuffer.x-Ie;for(this._activeBuffer.x=Ie,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ce=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ie>0&&ce instanceof b.BufferLine&&ce.copyCellsFrom(Le,He,0,Ie,!1);He=0;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(G&&(ce.insertCells(this._activeBuffer.x,W-Ie,this._activeBuffer.getNullCell(oe)),ce.getWidth(ae-1)===2&&ce.setCellFromCodepoint(ae-1,y.NULL_CELL_CODE,y.NULL_CELL_WIDTH,oe)),ce.setCellFromCodepoint(this._activeBuffer.x++,X,W,oe),W>0)for(;--W;)ce.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=pe,this._activeBuffer.x0&&ce.getWidth(this._activeBuffer.x)===0&&!ce.hasContent(this._activeBuffer.x)&&ce.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,D){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,D):this._parser.registerCsiHandler(B,(P=>!H(P.params[0],this._optionsService.rawOptions.windowOptions)||D(P)))}registerDcsHandler(B,D){return this._parser.registerDcsHandler(B,new N.DcsHandler(D))}registerEscHandler(B,D){return this._parser.registerEscHandler(B,D)}registerOscHandler(B,D){return this._parser.registerOscHandler(B,new R.OscHandler(D))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var B;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&B.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(B,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=B,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+D)}cursorUp(B){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const D=B.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=B.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=B.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const D=B.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,D,P,X=!1,W=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ie.replaceCells(D,P,this._activeBuffer.getNullCell(this._eraseAttrData()),W),X&&(ie.isWrapped=!1)}_resetBufferLine(B,D=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),P.isWrapped=!1)}eraseInDisplay(B,D=!1){let P;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);P=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 3:const X=this._activeBuffer.lines.length-this._bufferService.rows;X>0&&(this._activeBuffer.lines.trimStart(X),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-X,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-X,0),this._onScroll.fire(0))}return!0}eraseInLine(B,D=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let D=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let se=ae;for(let G=1;G0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let D=0;DTe?1:2,pe=B.params[0];return ue=pe,Ee=D?pe===2?4:pe===4?ce(ie.modes.insertMode):pe===12?3:pe===20?ce(oe.convertEol):0:pe===1?ce(P.applicationCursorKeys):pe===3?oe.windowOptions.setWinLines?ae===80?2:ae===132?1:0:0:pe===6?ce(P.origin):pe===7?ce(P.wraparound):pe===8?3:pe===9?ce(X==="X10"):pe===12?ce(oe.cursorBlink):pe===25?ce(!ie.isCursorHidden):pe===45?ce(P.reverseWraparound):pe===66?ce(P.applicationKeypad):pe===67?4:pe===1e3?ce(X==="VT200"):pe===1002?ce(X==="DRAG"):pe===1003?ce(X==="ANY"):pe===1004?ce(P.sendFocus):pe===1005?4:pe===1006?ce(W==="SGR"):pe===1015?4:pe===1016?ce(W==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ce(se===G):pe===2004?ce(P.bracketedPasteMode):0,ie.triggerDataEvent(`${f.C0.ESC}[${D?"":"?"}${ue};${Ee}$y`),!0;var ue,Ee}_updateAttrColor(B,D,P,X,W){return D===2?(B|=50331648,B&=-16777216,B|=C.AttributeData.fromColorRGB([P,X,W])):D===5&&(B&=-50331904,B|=33554432|255&P),B}_extractColor(B,D,P){const X=[0,0,-1,0,0,0];let W=0,ie=0;do{if(X[ie+W]=B.params[D+ie],B.hasSubParams(D+ie)){const le=B.getSubParams(D+ie);let ae=0;do X[1]===5&&(W=1),X[ie+ae+1+W]=le[ae];while(++ae=2||X[1]===2&&ie+W>=5)break;X[1]&&(W=1)}while(++ie+D5)&&(B=1),D.extended.underlineStyle=B,D.fg|=268435456,B===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(B){B.fg=b.DEFAULT_ATTR_DATA.fg,B.bg=b.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=B.length;let P;const X=this._curAttrData;for(let W=0;W=30&&P<=37?(X.fg&=-50331904,X.fg|=16777216|P-30):P>=40&&P<=47?(X.bg&=-50331904,X.bg|=16777216|P-40):P>=90&&P<=97?(X.fg&=-50331904,X.fg|=16777224|P-90):P>=100&&P<=107?(X.bg&=-50331904,X.bg|=16777224|P-100):P===0?this._processSGR0(X):P===1?X.fg|=134217728:P===3?X.bg|=67108864:P===4?(X.fg|=268435456,this._processUnderline(B.hasSubParams(W)?B.getSubParams(W)[0]:1,X)):P===5?X.fg|=536870912:P===7?X.fg|=67108864:P===8?X.fg|=1073741824:P===9?X.fg|=2147483648:P===2?X.bg|=134217728:P===21?this._processUnderline(2,X):P===22?(X.fg&=-134217729,X.bg&=-134217729):P===23?X.bg&=-67108865:P===24?(X.fg&=-268435457,this._processUnderline(0,X)):P===25?X.fg&=-536870913:P===27?X.fg&=-67108865:P===28?X.fg&=-1073741825:P===29?X.fg&=2147483647:P===39?(X.fg&=-67108864,X.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):P===49?(X.bg&=-67108864,X.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?W+=this._extractColor(B,W,X):P===53?X.bg|=1073741824:P===55?X.bg&=-1073741825:P===59?(X.extended=X.extended.clone(),X.extended.underlineColor=-1,X.updateExtended()):P===100?(X.fg&=-67108864,X.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,X.bg&=-67108864,X.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${D};${P}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${D};${P}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(B){const D=B.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=D%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(B){const D=B.params[0]||1;let P;return(B.length<2||(P=B.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(B){if(!H(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(B){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const D=[],P=B.split(";");for(;P.length>1;){const X=P.shift(),W=P.shift();if(/^\d+$/.exec(X)){const ie=parseInt(X);if(Q(ie))if(W==="?")D.push({type:0,index:ie});else{const le=(0,M.parseColor)(W);le&&D.push({type:1,index:ie,color:le})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(B){const D=B.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(B,D){this._getCurrentLinkId()&&this._finishHyperlink();const P=B.split(":");let X;const W=P.findIndex((ie=>ie.startsWith("id=")));return W!==-1&&(X=P[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:X,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,D){const P=B.split(";");for(let X=0;X=this._specialColors.length);++X,++D)if(P[X]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const W=(0,M.parseColor)(P[X]);W&&this._onColor.fire([{type:1,index:this._specialColors[D],color:W}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const D=[],P=B.split(";");for(let X=0;X=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new w.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D(this._coreService.triggerDataEvent(`${f.C0.ESC}${W}${f.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[X.cursorStyle]-(X.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,D){this._dirtyRowTracker.markRangeDirty(B,D)}}o.InputHandler=Y;let q=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Zthis.end&&(this.end=Z)}markRangeDirty(Z,B){Z>B&&(F=Z,Z=B,B=F),Zthis.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(Z){return 0<=Z&&Z<256}q=u([_(0,z.IBufferService)],q)},844:(a,o)=>{function c(u){for(const _ of u)_.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const _=this._disposables.indexOf(u);_!==-1&&this._disposables.splice(_,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var _;this._isDisposed||u===this._value||((_=this._value)==null||_.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=c,o.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(_,f,p){this._data[_]||(this._data[_]={}),this._data[_][f]=p}get(_,f){return this._data[_]?this._data[_][f]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(u,_,f,p,m){this._data.get(u,_)||this._data.set(u,_,new c),this._data.get(u,_).set(f,p,m)}get(u,_,f,p){var m;return(m=this._data.get(u,_))==null?void 0:m.get(f,p)}clear(){this._data.clear()}}},6114:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const _=c.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const _=this._getKey(u);if(_===void 0||(c=this._search(_),c===-1)||this._getKey(this._array[c])!==_)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===u))do _(this._array[c]);while(++c=_;){let p=_+f>>1;const m=this._getKey(this._array[p]);if(m>u)f=p-1;else{if(!(m0&&this._getKey(this._array[p-1])===u;)p--;return p}_=p+1}}return _}}},7226:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=c(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._iv)return b-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-x))}ms`),void this._start();b=v}this.clear()}}class f extends _{_requestCallback(m){return setTimeout((()=>m(this._createDeadline(16))))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=f,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:f,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=c(643);o.updateWindowsModeWrappedState=function(_){const f=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),p=f==null?void 0:f.get(_.cols-1),m=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);m&&p&&(m.isWrapped=p[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&p[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new c;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,p=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=p}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=c(6349),_=c(7226),f=c(3734),p=c(8437),m=c(4634),x=c(511),S=c(643),b=c(4863),v=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(y,w,C){this._hasScrollback=y,this._optionsService=w,this._bufferService=C,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(y){return y?(this._nullCell.fg=y.fg,this._nullCell.bg=y.bg,this._nullCell.extended=y.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(y){return y?(this._whitespaceCell.fg=y.fg,this._whitespaceCell.bg=y.bg,this._whitespaceCell.extended=y.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(y,w){return new p.BufferLine(this._bufferService.cols,this.getNullCell(y),w)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const y=this.ybase+this.y-this.ydisp;return y>=0&&yo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:w}fillViewportRows(y){if(this.lines.length===0){y===void 0&&(y=p.DEFAULT_ATTR_DATA);let w=this._rows;for(;w--;)this.lines.push(this.getBlankLine(y))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(y,w){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let z=0;const E=this._getCorrectBufferLength(w);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(y,C)));else for(let N=this._rows;N>w;N--)this.lines.length>w+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E0&&(this.lines.trimStart(N),this.ybase=Math.max(this.ybase-N,0),this.ydisp=Math.max(this.ydisp-N,0),this.savedY=Math.max(this.savedY-N,0)),this.lines.maxLength=E}this.x=Math.min(this.x,y-1),this.y=Math.min(this.y,w-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,y-1),this.scrollTop=0}if(this.scrollBottom=w-1,this._isReflowEnabled&&(this._reflow(y,w),this._cols>y))for(let R=0;R.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let y=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,y=!1);let w=0;for(;this._memoryCleanupPosition100)return!0;return y}get _isReflowEnabled(){const y=this._optionsService.rawOptions.windowsPty;return y&&y.buildNumber?this._hasScrollback&&y.backend==="conpty"&&y.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(y,w){this._cols!==y&&(y>this._cols?this._reflowLarger(y,w):this._reflowSmaller(y,w))}_reflowLarger(y,w){const C=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,y,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(C.length>0){const z=(0,m.reflowLargerCreateNewLayout)(this.lines,C);(0,m.reflowLargerApplyNewLayout)(this.lines,z.layout),this._reflowLargerAdjustViewport(y,w,z.countRemoved)}}_reflowLargerAdjustViewport(y,w,C){const z=this.getNullCell(p.DEFAULT_ATTR_DATA);let E=C;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;R--){let N=this.lines.get(R);if(!N||!N.isWrapped&&N.getTrimmedLength()<=y)continue;const M=[N];for(;N.isWrapped&&R>0;)N=this.lines.get(--R),M.unshift(N);const O=this.ybase+this.y;if(O>=R&&O0&&(z.push({start:R+M.length+E,newLines:Y}),E+=Y.length),M.push(...Y);let q=H.length-1,Q=H[q];Q===0&&(q--,Q=H[q]);let Z=M.length-U-1,B=I;for(;Z>=0;){const P=Math.min(B,Q);if(M[q]===void 0)break;if(M[q].copyCellsFrom(M[Z],B-P,Q-P,P,!0),Q-=P,Q===0&&(q--,Q=H[q]),B-=P,B===0){Z--;const X=Math.max(Z,0);B=(0,m.getWrappedLineTrimmedLength)(M,X,this._cols)}}for(let P=0;P0;)this.ybase===0?this.y0){const R=[],N=[];for(let q=0;q=0;q--)if(H&&H.start>O+U){for(let Q=H.newLines.length-1;Q>=0;Q--)this.lines.set(q--,H.newLines[Q]);q++,R.push({index:O+1,amount:H.newLines.length}),U+=H.newLines.length,H=z[++I]}else this.lines.set(q,N[O--]);let F=0;for(let q=R.length-1;q>=0;q--)R[q].index+=F,this.lines.onInsertEmitter.fire(R[q]),F+=R[q].amount;const Y=Math.max(0,M+E-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(y,w,C=0,z){const E=this.lines.get(y);return E?E.translateToString(w,C,z):""}getWrappedRangeForLine(y){let w=y,C=y;for(;w>0&&this.lines.get(w).isWrapped;)w--;for(;C+10;);return y>=this._cols?this._cols-1:y<0?0:y}nextStop(y){for(y==null&&(y=this.x);!this.tabs[++y]&&y=this._cols?this._cols-1:y<0?0:y}clearMarkers(y){this._isClearing=!0;for(let w=0;w{w.line-=C,w.line<0&&w.dispose()}))),w.register(this.lines.onInsert((C=>{w.line>=C.index&&(w.line+=C.amount)}))),w.register(this.lines.onDelete((C=>{w.line>=C.index&&w.lineC.index&&(w.line-=C.amount)}))),w.register(w.onDispose((()=>this._removeMarker(w)))),w}_removeMarker(y){this._isClearing||this.markers.splice(this.markers.indexOf(y),1)}}},8437:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=c(3734),_=c(511),f=c(643),p=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let m=0;class x{constructor(b,v,y=!1){this.isWrapped=y,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const w=v||_.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let C=0;C>22,2097152&v?this._combined[b].charCodeAt(this._combined[b].length-1):y]}set(b,v){this._data[3*b+1]=v[f.CHAR_DATA_ATTR_INDEX],v[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=v[1],this._data[3*b+0]=2097152|b|v[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=v[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const v=this._data[3*b+0];return 2097152&v?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&v}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const v=this._data[3*b+0];return 2097152&v?this._combined[b]:2097151&v?(0,p.stringFromCodePoint)(2097151&v):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,v){return m=3*b,v.content=this._data[m+0],v.fg=this._data[m+1],v.bg=this._data[m+2],2097152&v.content&&(v.combinedData=this._combined[b]),268435456&v.bg&&(v.extended=this._extendedAttrs[b]),v}setCell(b,v){2097152&v.content&&(this._combined[b]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[b]=v.extended),this._data[3*b+0]=v.content,this._data[3*b+1]=v.fg,this._data[3*b+2]=v.bg}setCellFromCodepoint(b,v,y,w){268435456&w.bg&&(this._extendedAttrs[b]=w.extended),this._data[3*b+0]=v|y<<22,this._data[3*b+1]=w.fg,this._data[3*b+2]=w.bg}addCodepointToCell(b,v,y){let w=this._data[3*b+0];2097152&w?this._combined[b]+=(0,p.stringFromCodePoint)(v):2097151&w?(this._combined[b]=(0,p.stringFromCodePoint)(2097151&w)+(0,p.stringFromCodePoint)(v),w&=-2097152,w|=2097152):w=v|4194304,y&&(w&=-12582913,w|=y<<22),this._data[3*b+0]=w}insertCells(b,v,y){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,y),v=0;--C)this.setCell(b+v+C,this.loadCell(b+C,w));for(let C=0;Cthis.length){if(this._data.buffer.byteLength>=4*y)this._data=new Uint32Array(this._data.buffer,0,y);else{const w=new Uint32Array(y);w.set(this._data),this._data=w}for(let w=this.length;w=b&&delete this._combined[E]}const C=Object.keys(this._extendedAttrs);for(let z=0;z=b&&delete this._extendedAttrs[E]}}return this.length=b,4*y*2=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,v,y,w,C){const z=b._data;if(C)for(let R=w-1;R>=0;R--){for(let N=0;N<3;N++)this._data[3*(y+R)+N]=z[3*(v+R)+N];268435456&z[3*(v+R)+2]&&(this._extendedAttrs[y+R]=b._extendedAttrs[v+R])}else for(let R=0;R=v&&(this._combined[N-v+y]=b._combined[N])}}translateToString(b,v,y,w){v=v??0,y=y??this.length,b&&(y=Math.min(y,this.getTrimmedLength())),w&&(w.length=0);let C="";for(;v>22||1}return w&&w.push(v),C}}o.BufferLine=x},4841:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(a,o)=>{function c(u,_,f){if(_===u.length-1)return u[_].getTrimmedLength();const p=!u[_].hasContent(f-1)&&u[_].getWidth(f-1)===1,m=u[_+1].getWidth(0)===2;return p&&m?f-1:f}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,_,f,p,m){const x=[];for(let S=0;S=S&&p0&&(N>w||y[N].getTrimmedLength()===0);N--)R++;R>0&&(x.push(S+y.length-R),x.push(R)),S+=y.length-1}return x},o.reflowLargerCreateNewLayout=function(u,_){const f=[];let p=0,m=_[p],x=0;for(let S=0;Sc(u,y,_))).reduce(((v,y)=>v+y));let x=0,S=0,b=0;for(;bv&&(x-=v,S++);const y=u[S].getWidth(x-1)===2;y&&x--;const w=y?f-1:f;p.push(w),b+=w}return p},o.getWrappedLineTrimmedLength=c},5295:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=c(8460),_=c(844),f=c(9092);class p extends _.Disposable{constructor(x,S){super(),this._optionsService=x,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,S){this._normal.resize(x,S),this._alt.resize(x,S),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=c(482),_=c(643),f=c(3734);class p extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const S=new p;return S.setFromCharData(x),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(x[_.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(x[_.CHAR_DATA_CHAR_INDEX].length===2){const b=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const v=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(b-55296)+v-56320+65536|x[_.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=x[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[_.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=x[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=c(8460),_=c(844);class f{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=f,f._nextId=1},7116:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(a,o)=>{var c,u,_;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=` +`,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(c||(o.C0=c={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(u||(o.C1=u={})),(function(f){f.ST=`${c.ESC}\\`})(_||(o.C1_ESCAPED=_={}))},7399:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=c(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(f,p,m,x){const S={type:0,cancel:!1,key:void 0},b=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=f.ctrlKey?"\b":u.C0.DEL,f.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(f.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=f.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,f.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(f.metaKey)break;b?(S.key=u.C0.ESC+"[1;"+(b+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(m?"b":"[1;5D"))):S.key=p?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(f.metaKey)break;b?(S.key=u.C0.ESC+"[1;"+(b+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(m?"f":"[1;5C"))):S.key=p?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(f.metaKey)break;b?(S.key=u.C0.ESC+"[1;"+(b+1)+"A",m||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=p?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(f.metaKey)break;b?(S.key=u.C0.ESC+"[1;"+(b+1)+"B",m||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=p?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=b?u.C0.ESC+"[3;"+(b+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=b?u.C0.ESC+"[1;"+(b+1)+"H":p?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=b?u.C0.ESC+"[1;"+(b+1)+"F":p?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:f.shiftKey?S.type=2:f.ctrlKey?S.key=u.C0.ESC+"[5;"+(b+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:f.shiftKey?S.type=3:f.ctrlKey?S.key=u.C0.ESC+"[6;"+(b+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=b?u.C0.ESC+"[1;"+(b+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=b?u.C0.ESC+"[1;"+(b+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=b?u.C0.ESC+"[1;"+(b+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=b?u.C0.ESC+"[1;"+(b+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=b?u.C0.ESC+"[15;"+(b+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=b?u.C0.ESC+"[17;"+(b+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=b?u.C0.ESC+"[18;"+(b+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=b?u.C0.ESC+"[19;"+(b+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=b?u.C0.ESC+"[20;"+(b+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=b?u.C0.ESC+"[21;"+(b+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=b?u.C0.ESC+"[23;"+(b+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=b?u.C0.ESC+"[24;"+(b+1)+"~":u.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(m&&!x||!f.altKey||f.metaKey)!m||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?S.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(S.key=u.C0.US),f.key==="@"&&(S.key=u.C0.NUL)):f.keyCode===65&&(S.type=1);else{const v=_[f.keyCode],y=v==null?void 0:v[f.shiftKey?1:0];if(y)S.key=u.C0.ESC+y;else if(f.keyCode>=65&&f.keyCode<=90){const w=f.ctrlKey?f.keyCode-64:f.keyCode+32;let C=String.fromCharCode(w);f.shiftKey&&(C=C.toUpperCase()),S.key=u.C0.ESC+C}else if(f.keyCode===32)S.key=u.C0.ESC+(f.ctrlKey?u.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let w=f.code.slice(3,4);f.shiftKey||(w=w.toLowerCase()),S.key=u.C0.ESC+w,S.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?S.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?S.key=u.C0.NUL:f.keyCode>=51&&f.keyCode<=55?S.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?S.key=u.C0.DEL:f.keyCode===219?S.key=u.C0.ESC:f.keyCode===220?S.key=u.C0.FS:f.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,u=0,_=c.length){let f="";for(let p=u;p<_;++p){let m=c[p];m>65535?(m-=65536,f+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):f+=String.fromCharCode(m)}return f},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const _=c.length;if(!_)return 0;let f=0,p=0;if(this._interim){const m=c.charCodeAt(p++);56320<=m&&m<=57343?u[f++]=1024*(this._interim-55296)+m-56320+65536:(u[f++]=this._interim,u[f++]=m),this._interim=0}for(let m=p;m<_;++m){const x=c.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=_)return this._interim=x,f;const S=c.charCodeAt(m);56320<=S&&S<=57343?u[f++]=1024*(x-55296)+S-56320+65536:(u[f++]=x,u[f++]=S)}else x!==65279&&(u[f++]=x)}return f}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const _=c.length;if(!_)return 0;let f,p,m,x,S=0,b=0,v=0;if(this.interim[0]){let C=!1,z=this.interim[0];z&=(224&z)==192?31:(240&z)==224?15:7;let E,R=0;for(;(E=63&this.interim[++R])&&R<4;)z<<=6,z|=E;const N=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=N-R;for(;v=_)return 0;if(E=c[v++],(192&E)!=128){v--,C=!0;break}this.interim[R++]=E,z<<=6,z|=63&E}C||(N===2?z<128?v--:u[S++]=z:N===3?z<2048||z>=55296&&z<=57343||z===65279||(u[S++]=z):z<65536||z>1114111||(u[S++]=z)),this.interim.fill(0)}const y=_-4;let w=v;for(;w<_;){for(;!(!(w=_)return this.interim[0]=f,S;if(p=c[w++],(192&p)!=128){w--;continue}if(b=(31&f)<<6|63&p,b<128){w--;continue}u[S++]=b}else if((240&f)==224){if(w>=_)return this.interim[0]=f,S;if(p=c[w++],(192&p)!=128){w--;continue}if(w>=_)return this.interim[0]=f,this.interim[1]=p,S;if(m=c[w++],(192&m)!=128){w--;continue}if(b=(15&f)<<12|(63&p)<<6|63&m,b<2048||b>=55296&&b<=57343||b===65279)continue;u[S++]=b}else if((248&f)==240){if(w>=_)return this.interim[0]=f,S;if(p=c[w++],(192&p)!=128){w--;continue}if(w>=_)return this.interim[0]=f,this.interim[1]=p,S;if(m=c[w++],(192&m)!=128){w--;continue}if(w>=_)return this.interim[0]=f,this.interim[1]=p,this.interim[2]=m,S;if(x=c[w++],(192&x)!=128){w--;continue}if(b=(7&f)<<18|(63&p)<<12|(63&m)<<6|63&x,b<65536||b>1114111)continue;u[S++]=b}}return S}}},225:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=c(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let m=0;m<_.length;++m)p.fill(0,_[m][0],_[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?p[m]:(function(x,S){let b,v=0,y=S.length-1;if(xS[y][1])return!1;for(;y>=v;)if(b=v+y>>1,x>S[b][1])v=b+1;else{if(!(x=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let S=this.wcwidth(m),b=S===0&&x!==0;if(b){const v=u.UnicodeService.extractWidth(x);v===0?b=!1:v>S&&(S=v)}return u.UnicodeService.createPropertyValue(0,S,b)}}},5981:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=c(8460),_=c(844);class f extends _.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const S=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],v=this._action(b,x);if(v){const w=C=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(S,C);return void v.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(w)}const y=this._callbacks[this._bufferOffset];if(y&&y(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=f},5941:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function _(f,p){const m=f.toString(16),x=m.length<2?"0"+m:m;switch(p){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(f){if(!f)return;let p=f.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const m=c.exec(p);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),u.exec(p)&&[3,6,9,12].includes(p.length))){const m=p.length/3,x=[0,0,0];for(let S=0;S<3;++S){const b=parseInt(p.slice(m*S,m*S+m),16);x[S]=m===1?b<<4:m===2?b:m===3?b>>4:b>>8}return x}},o.toRgbString=function(f,p=16){const[m,x,S]=f;return`rgb:${_(m,p)}/${_(x,p)}/${_(S,p)}`}},5770:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=c(482),_=c(8742),f=c(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,S){this._handlers[x]===void 0&&(this._handlers[x]=[]);const b=this._handlers[x];return b.push(S),{dispose:()=>{const v=b.indexOf(S);v!==-1&&b.splice(v,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,S){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(x,S,b){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(x,S,b);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(x,S,b))}unhook(x,S=!0){if(this._active.length){let b=!1,v=this._active.length-1,y=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,b=S,y=this._stack.fallThrough,this._stack.paused=!1),!y&&b===!1){for(;v>=0&&(b=this._active[v].unhook(x),b!==!0);v--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,b;v--}for(;v>=0;v--)if(b=this._active[v].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const m=new _.Params;m.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,S,b){this._hitLimit||(this._data+=(0,u.utf32ToString)(x,S,b),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let S=!1;if(this._hitLimit)S=!1;else if(x&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((b=>(this._params=m,this._data="",this._hitLimit=!1,b)));return this._params=m,this._data="",this._hitLimit=!1,S}}},2015:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=c(844),_=c(8742),f=c(6242),p=c(6351);class m{constructor(v){this.table=new Uint8Array(v)}setDefault(v,y){this.table.fill(v<<4|y)}add(v,y,w,C){this.table[y<<8|v]=w<<4|C}addMany(v,y,w,C){for(let z=0;zN)),y=(R,N)=>v.slice(R,N),w=y(32,127),C=y(0,24);C.push(25),C.push.apply(C,y(28,32));const z=y(0,14);let E;for(E in b.setDefault(1,0),b.addMany(w,0,2,0),z)b.addMany([24,26,153,154],E,3,0),b.addMany(y(128,144),E,3,0),b.addMany(y(144,152),E,3,0),b.add(156,E,0,0),b.add(27,E,11,1),b.add(157,E,4,8),b.addMany([152,158,159],E,0,7),b.add(155,E,11,3),b.add(144,E,11,9);return b.addMany(C,0,3,0),b.addMany(C,1,3,1),b.add(127,1,0,1),b.addMany(C,8,0,8),b.addMany(C,3,3,3),b.add(127,3,0,3),b.addMany(C,4,3,4),b.add(127,4,0,4),b.addMany(C,6,3,6),b.addMany(C,5,3,5),b.add(127,5,0,5),b.addMany(C,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(w,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(y(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(w,7,0,7),b.addMany(C,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(y(64,127),3,7,0),b.addMany(y(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(y(48,60),4,8,4),b.addMany(y(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(y(32,64),6,0,6),b.add(127,6,0,6),b.addMany(y(64,127),6,0,0),b.addMany(y(32,48),3,9,5),b.addMany(y(32,48),5,9,5),b.addMany(y(48,64),5,0,6),b.addMany(y(64,127),5,7,0),b.addMany(y(32,48),4,9,5),b.addMany(y(32,48),1,9,2),b.addMany(y(32,48),2,9,2),b.addMany(y(48,127),2,10,0),b.addMany(y(48,80),1,10,0),b.addMany(y(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(y(96,127),1,10,0),b.add(80,1,11,9),b.addMany(C,9,0,9),b.add(127,9,0,9),b.addMany(y(28,32),9,0,9),b.addMany(y(32,48),9,9,12),b.addMany(y(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(C,11,0,11),b.addMany(y(32,128),11,0,11),b.addMany(y(28,32),11,0,11),b.addMany(C,10,0,10),b.add(127,10,0,10),b.addMany(y(28,32),10,0,10),b.addMany(y(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(y(32,48),10,9,12),b.addMany(C,12,0,12),b.add(127,12,0,12),b.addMany(y(28,32),12,0,12),b.addMany(y(32,48),12,9,12),b.addMany(y(48,64),12,0,11),b.addMany(y(64,127),12,12,13),b.addMany(y(64,127),10,12,13),b.addMany(y(64,127),9,12,13),b.addMany(C,13,13,13),b.addMany(w,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(x,0,2,0),b.add(x,8,5,8),b.add(x,6,0,6),b.add(x,11,0,11),b.add(x,13,13,13),b})();class S extends u.Disposable{constructor(v=o.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(y,w,C)=>{},this._executeHandlerFb=y=>{},this._csiHandlerFb=(y,w)=>{},this._escHandlerFb=y=>{},this._errorHandlerFb=y=>y,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,y=[64,126]){let w=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(w=v.prefix.charCodeAt(0),w&&60>w||w>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let z=0;zE||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");w<<=8,w|=E}}if(v.final.length!==1)throw new Error("final must be a single byte");const C=v.final.charCodeAt(0);if(y[0]>C||C>y[1])throw new Error(`final must be in range ${y[0]} .. ${y[1]}`);return w<<=8,w|=C,w}identToString(v){const y=[];for(;v;)y.push(String.fromCharCode(255&v)),v>>=8;return y.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,y){const w=this._identifier(v,[48,126]);this._escHandlers[w]===void 0&&(this._escHandlers[w]=[]);const C=this._escHandlers[w];return C.push(y),{dispose:()=>{const z=C.indexOf(y);z!==-1&&C.splice(z,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,y){this._executeHandlers[v.charCodeAt(0)]=y}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,y){const w=this._identifier(v);this._csiHandlers[w]===void 0&&(this._csiHandlers[w]=[]);const C=this._csiHandlers[w];return C.push(y),{dispose:()=>{const z=C.indexOf(y);z!==-1&&C.splice(z,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,y){return this._dcsParser.registerHandler(this._identifier(v),y)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,y){return this._oscParser.registerHandler(v,y)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,y,w,C,z){this._parseStack.state=v,this._parseStack.handlers=y,this._parseStack.handlerPos=w,this._parseStack.transition=C,this._parseStack.chunkPos=z}parse(v,y,w){let C,z=0,E=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(w===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const N=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(w===!1&&M>-1){for(;M>=0&&(C=N[M](this._params),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 4:if(w===!1&&M>-1){for(;M>=0&&(C=N[M](),C!==!0);M--)if(C instanceof Promise)return this._parseStack.handlerPos=M,C}this._parseStack.handlers=[];break;case 6:if(z=v[this._parseStack.chunkPos],C=this._dcsParser.unhook(z!==24&&z!==26,w),C)return C;z===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(z=v[this._parseStack.chunkPos],C=this._oscParser.end(z!==24&&z!==26,w),C)return C;z===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let N=R;N>4){case 2:for(let U=N+1;;++U){if(U>=y||(z=v[U])<32||z>126&&z=y||(z=v[U])<32||z>126&&z=y||(z=v[U])<32||z>126&&z=y||(z=v[U])<32||z>126&&z=0&&(C=M[O](this._params),C!==!0);O--)if(C instanceof Promise)return this._preserveStack(3,M,O,E,N),C;O<0&&this._csiHandlerFb(this._collect<<8|z,this._params),this.precedingJoinState=0;break;case 8:do switch(z){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(z-48)}while(++N47&&z<60);N--;break;case 9:this._collect<<=8,this._collect|=z;break;case 10:const I=this._escHandlers[this._collect<<8|z];let H=I?I.length-1:-1;for(;H>=0&&(C=I[H](),C!==!0);H--)if(C instanceof Promise)return this._preserveStack(4,I,H,E,N),C;H<0&&this._escHandlerFb(this._collect<<8|z),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|z,this._params);break;case 13:for(let U=N+1;;++U)if(U>=y||(z=v[U])===24||z===26||z===27||z>127&&z=y||(z=v[U])<32||z>127&&z{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=c(5770),_=c(482),f=[];o.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,m){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(m),{dispose:()=>{const S=x.indexOf(m);S!==-1&&x.splice(S,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,m,x){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(p,m,x);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(p,m,x))}start(){this.reset(),this._state=1}put(p,m,x){if(this._state!==3){if(this._state===1)for(;m0&&this._put(p,m,x)}}end(p,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,S=this._active.length-1,b=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,x=m,b=this._stack.fallThrough,this._stack.paused=!1),!b&&x===!1){for(;S>=0&&(x=this._active[S].end(p),x!==!0);S--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,x;S--}for(;S>=0;S--)if(x=this._active[S].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=f,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,m,x){this._hitLimit||(this._data+=(0,_.utf32ToString)(p,m,x),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let m=!1;if(this._hitLimit)m=!1;else if(p&&(m=this._handler(this._data),m instanceof Promise))return m.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class u{static fromArray(f){const p=new u;if(!f.length)return p;for(let m=Array.isArray(f[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new u(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&f.push(Array.prototype.slice.call(this._subParams,m,x))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>c?c:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>c?c:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const p=this._subParamsIdx[f]>>8,m=255&this._subParamsIdx[f];return m-p>0?this._subParams.subarray(p,m):null}getSubParamsAll(){const f={};for(let p=0;p>8,x=255&this._subParamsIdx[p];x-m>0&&(f[p]=this._subParams.slice(m,x))}return f}addDigit(f){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[p-1];m[p-1]=~x?Math.min(10*x+f,c):f}}o.Params=u},5741:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const _={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(_),u.dispose=()=>this._wrappedAddonDispose(_),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let _=0;_{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=c(3785),_=c(511);o.BufferApiView=class{constructor(f,p){this._buffer=f,this.type=p}init(f){return this._buffer=f,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(f){const p=this._buffer.lines.get(f);if(p)return new u.BufferLineApiView(p)}getNullCell(){return new _.CellData}}},3785:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=c(511);o.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,f){if(!(_<0||_>=this._line.length))return f?(this._line.loadCell(_,f),f):this._line.loadCell(_,new u.CellData)}translateToString(_,f,p){return this._line.translateToString(_,f,p)}}},8285:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=c(8771),_=c(8460),f=c(844);class p extends f.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,(_=>u(_.toArray())))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,((_,f)=>u(_,f.toArray())))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(a,o,c){var u=this&&this.__decorate||function(b,v,y,w){var C,z=arguments.length,E=z<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,y):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,v,y,w);else for(var R=b.length-1;R>=0;R--)(C=b[R])&&(E=(z<3?C(E):z>3?C(v,y,E):C(v,y))||E);return z>3&&E&&Object.defineProperty(v,y,E),E},_=this&&this.__param||function(b,v){return function(y,w){v(y,w,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const f=c(8460),p=c(844),m=c(5295),x=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let S=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(b,this))}resize(b,v){this.cols=b,this.rows=v,this.buffers.resize(b,v),this._onResize.fire({cols:b,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,v=!1){const y=this.buffer;let w;w=this._cachedBlankLine,w&&w.length===this.cols&&w.getFg(0)===b.fg&&w.getBg(0)===b.bg||(w=y.getBlankLine(b,v),this._cachedBlankLine=w),w.isWrapped=v;const C=y.ybase+y.scrollTop,z=y.ybase+y.scrollBottom;if(y.scrollTop===0){const E=y.lines.isFull;z===y.lines.length-1?E?y.lines.recycle().copyFrom(w):y.lines.push(w.clone()):y.lines.splice(z+1,0,w.clone()),E?this.isUserScrolling&&(y.ydisp=Math.max(y.ydisp-1,0)):(y.ybase++,this.isUserScrolling||y.ydisp++)}else{const E=z-C+1;y.lines.shiftElements(C+1,E-1,-1),y.lines.set(z,w.clone())}this.isUserScrolling||(y.ydisp=y.ybase),this._onScroll.fire(y.ydisp)}scrollLines(b,v,y){const w=this.buffer;if(b<0){if(w.ydisp===0)return;this.isUserScrolling=!0}else b+w.ydisp>=w.ybase&&(this.isUserScrolling=!1);const C=w.ydisp;w.ydisp=Math.max(Math.min(w.ydisp+b,w.ybase),0),C!==w.ydisp&&(v||this._onScroll.fire(w.ydisp))}};o.BufferService=S=u([_(0,x.IOptionsService)],S)},7994:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(a,o,c){var u=this&&this.__decorate||function(w,C,z,E){var R,N=arguments.length,M=N<3?C:E===null?E=Object.getOwnPropertyDescriptor(C,z):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(w,C,z,E);else for(var O=w.length-1;O>=0;O--)(R=w[O])&&(M=(N<3?R(M):N>3?R(C,z,M):R(C,z))||M);return N>3&&M&&Object.defineProperty(C,z,M),M},_=this&&this.__param||function(w,C){return function(z,E){C(z,E,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const f=c(2585),p=c(8460),m=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:w=>w.button!==4&&w.action===1&&(w.ctrl=!1,w.alt=!1,w.shift=!1,!0)},VT200:{events:19,restrict:w=>w.action!==32},DRAG:{events:23,restrict:w=>w.action!==32||w.button!==3},ANY:{events:31,restrict:w=>!0}};function S(w,C){let z=(w.ctrl?16:0)|(w.shift?4:0)|(w.alt?8:0);return w.button===4?(z|=64,z|=w.action):(z|=3&w.button,4&w.button&&(z|=64),8&w.button&&(z|=128),w.action===32?z|=32:w.action!==0||C||(z|=3)),z}const b=String.fromCharCode,v={DEFAULT:w=>{const C=[S(w,!1)+32,w.col+32,w.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${b(C[0])}${b(C[1])}${b(C[2])}`},SGR:w=>{const C=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${S(w,!0)};${w.col};${w.row}${C}`},SGR_PIXELS:w=>{const C=w.action===0&&w.button!==4?"m":"M";return`\x1B[<${S(w,!0)};${w.x};${w.y}${C}`}};let y=o.CoreMouseService=class extends m.Disposable{constructor(w,C){super(),this._bufferService=w,this._coreService=C,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const z of Object.keys(x))this.addProtocol(z,x[z]);for(const z of Object.keys(v))this.addEncoding(z,v[z]);this.reset()}addProtocol(w,C){this._protocols[w]=C}addEncoding(w,C){this._encodings[w]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(w){if(!this._protocols[w])throw new Error(`unknown protocol "${w}"`);this._activeProtocol=w,this._onProtocolChange.fire(this._protocols[w].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(w){if(!this._encodings[w])throw new Error(`unknown encoding "${w}"`);this._activeEncoding=w}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(w){if(w.col<0||w.col>=this._bufferService.cols||w.row<0||w.row>=this._bufferService.rows||w.button===4&&w.action===32||w.button===3&&w.action!==32||w.button!==4&&(w.action===2||w.action===3)||(w.col++,w.row++,w.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,w,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(w))return!1;const C=this._encodings[this._activeEncoding](w);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=w,!0}explainEvents(w){return{down:!!(1&w),up:!!(2&w),drag:!!(4&w),move:!!(8&w),wheel:!!(16&w)}}_equalEvents(w,C,z){if(z){if(w.x!==C.x||w.y!==C.y)return!1}else if(w.col!==C.col||w.row!==C.row)return!1;return w.button===C.button&&w.action===C.action&&w.ctrl===C.ctrl&&w.alt===C.alt&&w.shift===C.shift}};o.CoreMouseService=y=u([_(0,f.IBufferService),_(1,f.ICoreService)],y)},6975:function(a,o,c){var u=this&&this.__decorate||function(y,w,C,z){var E,R=arguments.length,N=R<3?w:z===null?z=Object.getOwnPropertyDescriptor(w,C):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,w,C,z);else for(var M=y.length-1;M>=0;M--)(E=y[M])&&(N=(R<3?E(N):R>3?E(w,C,N):E(w,C))||N);return R>3&&N&&Object.defineProperty(w,C,N),N},_=this&&this.__param||function(y,w){return function(C,z){w(C,z,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const f=c(1439),p=c(8460),m=c(844),x=c(2585),S=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=o.CoreService=class extends m.Disposable{constructor(y,w,C){super(),this._bufferService=y,this._logService=w,this._optionsService=C,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(b)}reset(){this.modes=(0,f.clone)(S),this.decPrivateModes=(0,f.clone)(b)}triggerDataEvent(y,w=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;w&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),w&&this._onUserInput.fire(),this._logService.debug(`sending data "${y}"`,(()=>y.split("").map((z=>z.charCodeAt(0))))),this._onData.fire(y)}triggerBinaryEvent(y){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${y}"`,(()=>y.split("").map((w=>w.charCodeAt(0))))),this._onBinary.fire(y))}};o.CoreService=v=u([_(0,x.IBufferService),_(1,x.ILogService),_(2,x.IOptionsService)],v)},9074:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=c(8055),_=c(8460),f=c(844),p=c(6106);let m=0,x=0;class S extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((y=>y==null?void 0:y.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(y){if(y.marker.isDisposed)return;const w=new b(y);if(w){const C=w.marker.onDispose((()=>w.dispose()));w.onDispose((()=>{w&&(this._decorations.delete(w)&&this._onDecorationRemoved.fire(w),C.dispose())})),this._decorations.insert(w),this._onDecorationRegistered.fire(w)}return w}reset(){for(const y of this._decorations.values())y.dispose();this._decorations.clear()}*getDecorationsAtCell(y,w,C){let z=0,E=0;for(const R of this._decorations.getKeyIterator(w))z=R.options.x??0,E=z+(R.options.width??1),y>=z&&y{m=E.options.x??0,x=m+(E.options.width??1),y>=m&&y{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=c(2585),_=c(8343);class f{constructor(...m){this._entries=new Map;for(const[x,S]of m)this.set(x,S)}set(m,x){const S=this._entries.get(m);return this._entries.set(m,x),S}forEach(m){for(const[x,S]of this._entries.entries())m(x,S)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=f,o.InstantiationService=class{constructor(){this._services=new f,this._services.set(u.IInstantiationService,this)}setService(p,m){this._services.set(p,m)}getService(p){return this._services.get(p)}createInstance(p,...m){const x=(0,_.getServiceDependencies)(p).sort(((v,y)=>v.index-y.index)),S=[];for(const v of x){const y=this._services.get(v.id);if(!y)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${v.id}.`);S.push(y)}const b=x.length>0?x[0].index:m.length;if(m.length!==b)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${b+1} conflicts with ${m.length} static arguments`);return new p(...m,...S)}}},7866:function(a,o,c){var u=this&&this.__decorate||function(b,v,y,w){var C,z=arguments.length,E=z<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,y):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(b,v,y,w);else for(var R=b.length-1;R>=0;R--)(C=b[R])&&(E=(z<3?C(E):z>3?C(v,y,E):C(v,y))||E);return z>3&&E&&Object.defineProperty(v,y,E),E},_=this&&this.__param||function(b,v){return function(y,w){v(y,w,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const f=c(844),p=c(2585),m={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,S=o.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let v=0;vJSON.stringify(E))).join(", ")})`);const z=w.apply(this,C);return x.trace(`GlyphRenderer#${w.name} return`,z),z}}},7302:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=c(8460),_=c(844),f=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends _.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const v in S)if(v in b)try{const y=S[v];b[v]=this._sanitizeAndValidateOption(v,y)}catch(y){console.error(y)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,b){return this.onOptionChange((v=>{v===S&&b(this.rawOptions[S])}))}onMultipleOptionChange(S,b){return this.onOptionChange((v=>{S.indexOf(v)!==-1&&b()}))}_setupOptions(){const S=v=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},b=(v,y)=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);y=this._sanitizeAndValidateOption(v,y),this.rawOptions[v]!==y&&(this.rawOptions[v]=y,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const y={get:S.bind(this,v),set:b.bind(this,v)};Object.defineProperty(this.options,v,y)}}_sanitizeAndValidateOption(S,b){switch(S){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[S]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${S}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=p.includes(b)?b:o.DEFAULT_OPTIONS[S];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${S} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${S} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=m},2660:function(a,o,c){var u=this&&this.__decorate||function(m,x,S,b){var v,y=arguments.length,w=y<3?x:b===null?b=Object.getOwnPropertyDescriptor(x,S):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(m,x,S,b);else for(var C=m.length-1;C>=0;C--)(v=m[C])&&(w=(y<3?v(w):y>3?v(x,S,w):v(x,S))||w);return y>3&&w&&Object.defineProperty(x,S,w),w},_=this&&this.__param||function(m,x){return function(S,b){x(S,b,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const f=c(2585);let p=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const C=x.addMarker(x.ybase+x.y),z={data:m,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(z,C))),this._dataByLinkId.set(z.id,z),z.id}const S=m,b=this._getEntryIdKey(S),v=this._entriesWithId.get(b);if(v)return this.addLineToLink(v.id,x.ybase+x.y),v.id;const y=x.addMarker(x.ybase+x.y),w={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(w,y))),this._entriesWithId.set(w.key,w),this._dataByLinkId.set(w.id,w),w.id}addLineToLink(m,x){const S=this._dataByLinkId.get(m);if(S&&S.lines.every((b=>b.line!==x))){const b=this._bufferService.buffer.addMarker(x);S.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(S,b)))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const S=m.lines.indexOf(x);S!==-1&&(m.lines.splice(S,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=p=u([_(0,f.IBufferService)],p)},8343:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(_){return _[u]||[]},o.createDecorator=function(_){if(o.serviceRegistry.has(_))return o.serviceRegistry.get(_);const f=function(p,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,b,v){b[c]===b?b[u].push({id:S,index:v}):(b[u]=[{id:S,index:v}],b[c]=b)})(f,p,x)};return f.toString=()=>_,o.serviceRegistry.set(_,f),f}},2585:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=c(8343);var _;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(_||(o.LogLevelEnum=_={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(a,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=c(8460),_=c(225);class f{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,S=!1){return(16777215&m)<<3|(3&x)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const m=new _.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,S=0;const b=m.length;for(let v=0;v=b)return x+this.wcwidth(y);const z=m.charCodeAt(v);56320<=z&&z<=57343?y=1024*(y-55296)+z-56320+65536:x+=this.wcwidth(z)}const w=this.charProperties(y,S);let C=f.extractWidth(w);f.extractShouldJoin(w)&&(C-=f.extractWidth(S)),x+=C,S=w}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}o.UnicodeService=f}},r={};function s(a){var o=r[a];if(o!==void 0)return o.exports;var c=r[a]={exports:{}};return t[a].call(c.exports,c,c.exports,s),c.exports}var i={};return(()=>{var a=i;Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const o=s(9042),c=s(3236),u=s(844),_=s(5741),f=s(8285),p=s(7975),m=s(7090),x=["cols","rows"];class S extends u.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const y=C=>this._core.options[C],w=(C,z)=>{this._checkReadonlyOptions(C),this._core.options[C]=z};for(const C in this._core.options){const z={get:y.bind(this,C),set:w.bind(this,C)};Object.defineProperty(this._publicOptions,C,z)}}_checkReadonlyOptions(v){if(x.includes(v))throw new Error(`Option "${v}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let y="none";switch(this._core.coreMouseService.activeProtocol){case"X10":y="x10";break;case"VT200":y="vt200";break;case"DRAG":y="drag";break;case"ANY":y="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:y,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const y in v)this._publicOptions[y]=v[y]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,y=!0){this._core.input(v,y)}resize(v,y){this._verifyIntegers(v,y),this._core.resize(v,y)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,y,w){this._verifyIntegers(v,y,w),this._core.select(v,y,w)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,y){this._verifyIntegers(v,y),this._core.selectLines(v,y)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,y){this._core.write(v,y)}writeln(v,y){this._core.write(v),this._core.write(`\r +`,y)}paste(v){this._core.paste(v)}refresh(v,y){this._verifyIntegers(v,y),this._core.refresh(v,y)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return o}_verifyIntegers(...v){for(const y of v)if(y===1/0||isNaN(y)||y%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const y of v)if(y&&(y===1/0||isNaN(y)||y%1!=0||y<0))throw new Error("This API only accepts positive integers")}}a.Terminal=S})(),i})()))})(cx)),cx.exports}var wit=yit();function h4(e,n,t=!1){const r=getComputedStyle(document.documentElement),s=new wit.Terminal({convertEol:!0,disableStdin:n,fontSize:12,fontFamily:r.getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:r.getPropertyValue("--term-bg").trim(),foreground:r.getPropertyValue("--term-foreground").trim(),cursor:n?r.getPropertyValue("--term-bg").trim():r.getPropertyValue("--term-foreground").trim(),selectionBackground:r.getPropertyValue("--term-selection").trim()}}),i=new bit.FitAddon;s.loadAddon(i),t&&s.loadAddon(new xit.WebLinksAddon((c,u)=>{let _;try{_=new URL(u)}catch{return}(_.protocol==="http:"||_.protocol==="https:")&&window.open(_,"_blank","noopener,noreferrer")})),s.open(e);const a=()=>{try{i.fit()}catch{}};a();const o=new ResizeObserver(a);return o.observe(e),{terminal:s,dispose(){o.disconnect(),s.dispose()}}}const aR="overflow-hidden rounded-md bg-terminal p-2";function X_(e){return typeof e=="object"&&e!==null}function oR(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function Sit(e){return X_(e)&&typeof e.reachable=="boolean"&&typeof e.toolsFound=="boolean"&&(e.missingTools===void 0||oR(e.missingTools))&&(e.error===null||typeof e.error=="string")&&typeof e.testedAt=="number"}function kit(e){return X_(e)&&typeof e.reachable=="boolean"&&typeof e.slurmFound=="boolean"&&typeof e.toolsFound=="boolean"&&oR(e.partitions)&&(e.error===null||typeof e.error=="string")}function Cit(e){return!X_(e)||e.type!=="complete"?null:e.backend==="ssh"&&Sit(e.result)?{backend:"ssh",result:e.result}:e.backend==="slurm"&&kit(e.result)?{backend:"slurm",result:e.result}:null}function Eit(e){return X_(e)&&e.type==="error"&&typeof e.error=="string"?e.error:null}function _4({host:e,backend:n,path:t="/api/settings/ssh/connect",active:r=!0,onComplete:s,onError:i}){const a=new URLSearchParams({host:e,backend:n});return h.jsx(lR,{path:`${t}?${a}`,label:oA({host:ze(e)}),active:r,onError:i,onComplete:o=>{const c=Cit(o);return c?(s(c),!0):!1}})}function Nit({login:e,onComplete:n,onError:t}){return h.jsx(lR,{path:e?"/api/settings/openresearch/login":"/api/settings/openresearch/ssh-key",label:e?"orx login":"orx ssh-key add",heightClass:"h-80",onError:t,onComplete:r=>!X_(r)||r.type!=="complete"?!1:(n(),!0)})}function lR({path:e,label:n,heightClass:t="h-40",active:r=!0,onComplete:s,onError:i}){const a=T.useRef(null),o=T.useRef(null),c=T.useRef(s),u=T.useRef(i),[_,f]=T.useState(null);return c.current=s,u.current=i,T.useEffect(()=>{const p=a.current;if(!p)return;const{terminal:m,dispose:x}=h4(p,!1,!0);o.current=m,m.focus();const S=location.protocol==="https:"?"wss:":"ws:",b=new URL(e,`${S}//${location.host}`),v=new WebSocket(b);v.binaryType="arraybuffer";let y=!1,w=!1,C=!1;const z=N=>{var M;w||(w=!0,C||m.writeln(N),m.options.disableStdin=!0,m.blur(),f(N),(M=u.current)==null||M.call(u,N))},E=m.onData(N=>{v.readyState===WebSocket.OPEN&&v.send(new TextEncoder().encode(N))}),R=m.onResize(({cols:N,rows:M})=>{v.readyState===WebSocket.OPEN&&v.send(JSON.stringify({type:"resize",cols:N,rows:M}))});return v.onopen=()=>{v.send(JSON.stringify({type:"resize",cols:m.cols,rows:m.rows}))},v.onmessage=N=>{if(N.data instanceof ArrayBuffer){C=!0,m.write(new Uint8Array(N.data));return}if(typeof N.data!="string")return;let M;try{M=JSON.parse(N.data)}catch{return}if(c.current(M)){y=!0,v.close();return}const O=Eit(M);O&&z(O)},v.onerror=()=>z(fC()),v.onclose=()=>{!y&&!w&&z(fC())},()=>{v.onopen=null,v.onmessage=null,v.onerror=null,v.onclose=null,E.dispose(),R.dispose(),v.close(),o.current=null,x()}},[e]),T.useEffect(()=>{const p=o.current;p&&(p.options.disableStdin=!r||_!==null,r&&_===null?p.focus():p.blur())},[r,_]),h.jsxs("div",{className:"mt-3",children:[h.jsx("div",{className:`${t} ${aR}`,role:"group","aria-label":n,children:h.jsx("div",{ref:a,className:"h-full overflow-hidden"})}),_?h.jsx("p",{role:"alert",className:"sr-only",children:_}):null]})}function zit({host:e,transcript:n}){const t=T.useRef(null);return T.useEffect(()=>{const r=t.current;if(!r)return;const{terminal:s,dispose:i}=h4(r,!0,!0);return s.write(n),i},[n]),h.jsx("div",{className:`mt-3 h-40 ${aR}`,role:"group","aria-label":oA({host:ze(e)}),children:h.jsx("div",{ref:t,className:"h-full overflow-hidden"})})}function oc(e,n){return e&&Object.hasOwn(e.tasks,n)?e.tasks[n]:void 0}const jit=["settings","harnesses","projects","compute","instances","environment","git","storage"],Tit=e=>jit.some(n=>n===e),Ait=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Si=e=>typeof e=="string"&&e.length>0,Tp=e=>e==null||Si(e);function p4(e){if(!Ait(e))return;const n=(...t)=>Object.keys(e).every(r=>t.includes(r));switch(e.kind){case"home":if(n("kind","view")&&(e.view==="experiments"||e.view==="files"||e.view==="artifacts"))return{kind:"home",view:e.view};break;case"experiment":if(n("kind","experimentId","view","runId")&&Si(e.experimentId)&&(e.view==="overview"||e.view==="terminal")&&Tp(e.runId))return{kind:"experiment",experimentId:e.experimentId,view:e.view,...Si(e.runId)?{runId:e.runId}:{}};break;case"file":if(n("kind","path","source","sessionId","ref","line","branchLabel")&&Si(e.path)&&Tp(e.sessionId)&&Tp(e.ref)&&Tp(e.branchLabel)&&(e.source==null||e.source==="repo"||e.source==="artifacts"||e.source==="abs")&&(e.line==null||typeof e.line=="number"&&Number.isSafeInteger(e.line)&&e.line>0))return{kind:"file",path:e.path,...e.source?{source:e.source}:{},...Si(e.sessionId)?{sessionId:e.sessionId}:{},...Si(e.ref)?{ref:e.ref}:{},...typeof e.line=="number"?{line:e.line}:{},...Si(e.branchLabel)?{branchLabel:e.branchLabel}:{}};break;case"code":if(n("kind","experimentId","branch","view")&&Si(e.experimentId)&&Si(e.branch)&&(e.view==="files"||e.view==="changes"))return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};break;case"plan":if(n("kind","sessionId","promptId")&&Si(e.sessionId)&&Si(e.promptId))return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId};break;case"subagent":if(n("kind","sessionId","spawnPartId")&&Si(e.sessionId)&&Si(e.spawnPartId))return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function Su(e){if(e==="/projects")return{kind:"home"};const n=e.split("/");if(n[0]!==""||n[1]!=="projects"||!n[2])return null;let t,r;try{t=decodeURIComponent(n[2]),r=decodeURIComponent(n[4]??"")}catch{return null}const s=i=>i.length>0&&i!=="."&&i!==".."&&!/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(i);return s(t)?n.length===3||n.length===4&&n[3]===""?{kind:"resume",projectId:t}:n.length===4&&n[3]==="skills"?{kind:"skills",projectId:t}:n.length===5&&n[3]==="tasks"&&s(r)?{kind:"task",projectId:t,...r==="new"?{}:{sessionId:r}}:n.length===5&&n[3]==="settings"&&Tit(r)?{kind:"settings",projectId:t,section:r}:null:null}function Hg(e){if(typeof e!="string"||!e.startsWith("/")||e.startsWith("//")||/[\\#\u0000-\u001f\u007f-\u009f]/.test(e))return null;const n=e.indexOf("?"),t=n===-1?e:e.slice(0,n),r=n===-1?"":e.slice(n+1),s=Su(t);if(!s||s.kind==="resume")return null;const i=new URLSearchParams(r);if([...i.keys()].some(a=>a!=="pane")||i.getAll("pane").length>1)return null;if(i.has("pane"))try{if(!p4(JSON.parse(i.get("pane")??"")))return null}catch{return null}return e}function mm(e,n,t){const r=`/projects/${encodeURIComponent(e)}/tasks/${n?encodeURIComponent(n):"new"}`;return t?`${r}?${new URLSearchParams({pane:JSON.stringify(t)})}`:r}const IC=()=>({version:1,lastTaskId:null,lastLocation:null,tasks:{}});function cR(e,n){let t,r,s=!1,i=!1,a;async function o(c=!1){if(clearTimeout(a),i||(i=c),s||t===void 0)return;s=!0;const u=t;t=void 0;const _=i;i=!1;try{await e(u,_),r=void 0}catch(f){r=u,n(f)}finally{s=!1,t!==void 0&&o()}}return{queue(c,u=0){t=c,clearTimeout(a),a=setTimeout(()=>void o(),u)},flush:o,retry(){return!s&&t===void 0&&(t=r),o()}}}let m4=null,gm=0;const g4=()=>m4;function uR(){const e=gm;return cR((n,t)=>e===gm?Ptt(n,t):Promise.resolve(),n=>{e===gm&&Vn(n instanceof Error?n.message:String(n),"error",{id:"workspace-save",action:{label:Ji(),onClick:()=>void Fg.retry()}})})}let bm=uR();function Rit(){gm++,m4=null,bm=uR()}const Fg={flush:(e=!1)=>bm.flush(e),retry:()=>bm.retry(),queue(e,n=0){m4=e,bm.queue(e,n)}};window.addEventListener("pagehide",()=>void Fg.flush(!0));function Xo(e,n){if(typeof e=="string")return{kind:"home",view:e};if("code"in e)return{kind:"code",experimentId:e.experimentId,branch:e.branch,view:e.view};if("kind"in e)return e.kind==="plan"?{kind:"plan",sessionId:e.sessionId,promptId:e.promptId}:{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId};if("path"in e)return{kind:"file",path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};const t=n===void 0?e.runId:n;return{kind:"experiment",experimentId:e.id,view:e.view,...t?{runId:t}:{}}}function _a(e){switch(e.kind){case"home":return e.view;case"experiment":return{id:e.experimentId,view:e.view,...e.runId?{runId:e.runId}:{}};case"file":return{path:e.path,source:e.source,sessionId:e.sessionId,ref:e.ref,line:e.line,branchLabel:e.branchLabel};case"code":return{code:!0,experimentId:e.experimentId,branch:e.branch,view:e.view,toggled:new Set};case"plan":return{kind:"plan",sessionId:e.sessionId,promptId:e.promptId,plan:""};case"subagent":return{kind:"subagent",sessionId:e.sessionId,spawnPartId:e.spawnPartId}}}function fR(e,n,t){const r=[];e.filesTabOpen&&r.push("files"),e.artifactsTabOpen&&r.push("artifacts"),e.experimentsTabOpen&&r.push("experiments");const s=[...e.expTabs,...e.fileTabs,...e.planTabs,...e.subagentTabs,...e.codeTabs],i=new Map(s.map(u=>[wt(u),u])),a=e.contentTabOrder.flatMap(u=>{const _=i.get(u);return _?[_]:[]}),o=wt(e.rightTab);return{tabs:[...r,...a].map(u=>Xo(u,wt(u)===o?e.selectedRunId:void 0)),active:e.panelOpen?Xo(e.rightTab,e.selectedRunId):null,previewKey:e.previewTab?wt(e.previewTab):null,history:e.tabHistory.map(wt),expanded:Object.fromEntries([["files",[...e.filesToggled]],...e.codeTabs.map(u=>[wt(u),[...u.toggled]])]),scroll:n,sourceModes:t,filesView:e.filesView,scope:e.scope,panelMax:e.panelMax}}function Mit(e,n){const t=v4();e&&(t.filesView=e.filesView,t.filesToggled=new Set(e.expanded.files??[]),t.scope=e.scope,t.panelMax=e.panelMax);const r=[...(e==null?void 0:e.tabs)??[]];if(n){const i=r.findIndex(a=>wt(_a(a))===wt(_a(n)));i===-1?r.push(n):r[i]=n}for(const i of r){const a=_a(i);if(typeof a=="string"){a==="experiments"&&(t.experimentsTabOpen=!0),a==="files"&&(t.filesTabOpen=!0),a==="artifacts"&&(t.artifactsTabOpen=!0);continue}"code"in a?(a.toggled=new Set((e==null?void 0:e.expanded[wt(a)])??[]),t.codeTabs.push(a)):"path"in a?t.fileTabs.push(a):"kind"in a?a.kind==="plan"?t.planTabs.push(a):t.subagentTabs.push(a):t.expTabs.push(a),t.contentTabOrder.push(wt(a))}const s=new Map(r.map(i=>{const a=_a(i);return[wt(a),a]}));return t.tabHistory=((e==null?void 0:e.history)??[]).flatMap(i=>{const a=s.get(i);return a?[a]:[]}),t.previewTab=e!=null&&e.previewKey?s.get(e.previewKey)??null:null,t.rightTab=n?_a(n):e!=null&&e.active?_a(e.active):"experiments",t.panelOpen=n!==void 0,t.selectedRunId=(n==null?void 0:n.kind)==="experiment"?n.runId??null:null,hR(t,n)}const ux=(e,n)=>e.id===n.id&&e.view===n.view,Qc=(e,n)=>e.path===n.path&&(e.source??"repo")===(n.source??"repo")&&e.sessionId===n.sessionId&&e.ref===n.ref,b4=e=>`${e.source??"repo"}:${e.sessionId??""}:${e.ref??""}:${e.path}`,bs=(e,n,t)=>`${e}:${n??""}:${b4(t)}`,dR=e=>({...e,lineScrollRequest:void 0});function Ap(e){return typeof e=="object"&&"path"in e?dR(e):e}const wf=(e,n)=>e.branch===n.branch;function wt(e){return typeof e=="string"?`home:${e}`:"code"in e?`code:${e.branch}`:"kind"in e?e.kind==="plan"?`plan:${e.promptId}`:`subagent:${e.spawnPartId}`:"path"in e?`file:${b4(e)}`:`experiment:${e.id}:${e.view}`}function Eh(e,n){const t=e.filter(r=>wt(r)!==n);return t.length===e.length?e:t}function Lit(e){return e!==void 0}function v4(e,n=!1){const t={rightTab:"experiments",tabHistory:[],experimentsTabOpen:!1,filesTabOpen:!1,artifactsTabOpen:!1,expTabs:[],fileTabs:[],planTabs:[],subagentTabs:[],codeTabs:[],contentTabOrder:[],previewTab:null,filesView:"files",filesToggled:new Set,selectedRunId:null,scope:"project",panelOpen:!1,panelMax:!1};if(e===_m&&n){const r={path:pm,source:"artifacts"},s="experiments";return{...t,rightTab:s,tabHistory:[r,s],experimentsTabOpen:!0,fileTabs:[r],contentTabOrder:[wt(r)],panelOpen:!0}}if(e===mA){const r=[{path:"nanochat-base-training-curves.svg",source:"artifacts"},{path:"nanochat-sft-training-curves.svg",source:"artifacts"},{path:"nanochat-training-throughput.svg",source:"artifacts"},{path:"nanochat-core-evaluation.svg",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[...r.slice(1),r[0]],fileTabs:r,contentTabOrder:r.map(wt),panelOpen:!0}}if(e===gA){const r=[{path:"nanochat-bottleneck-diagnosis.md",source:"artifacts"}];return{...t,rightTab:r[0],tabHistory:[r[0]],fileTabs:r,contentTabOrder:r.map(wt),panelOpen:!0}}return t}function x4(e,n){const t=v4(e,n);return t.panelOpen?fR(t,{},{}):void 0}function hR(e,n){if(!n)return e;const t=_a(n),r=wt(t),s=[...e.expTabs,...e.fileTabs,...e.codeTabs,...e.planTabs,...e.subagentTabs].find(c=>wt(c)===r),i=(c,u)=>{const _=c.findIndex(f=>wt(f)===r);return _<0?[...c,u]:JSON.stringify(Xo(c[_]))===JSON.stringify(Xo(u))?c:c.map((f,p)=>p===_?{...f,...u}:f)},a={...e};typeof t=="string"?t==="files"?a.filesTabOpen=!0:t==="artifacts"?a.artifactsTabOpen=!0:a.experimentsTabOpen=!0:("path"in t?a.fileTabs=i(e.fileTabs,t):"id"in t?a.expTabs=i(e.expTabs,{...t,runId:n.kind==="experiment"?n.runId:void 0}):"code"in t?a.codeTabs=i(e.codeTabs,{...t,toggled:s&&"code"in s?s.toggled:t.toggled}):t.kind==="plan"?a.planTabs=i(e.planTabs,t):a.subagentTabs=i(e.subagentTabs,t),e.contentTabOrder.includes(r)||(a.contentTabOrder=[...e.contentTabOrder,r]));const o=e.tabHistory.at(-1);return o&&wt(o)===r&&JSON.stringify(Xo(o))===JSON.stringify(Xo(t))||(a.tabHistory=[...e.tabHistory.filter(c=>wt(c)!==r),t]),a}let Xa=0;const u_=new Map,Qm=new Map,Zy=new Set,Qy=()=>{for(const e of Zy)e()},Dit=e=>(Zy.add(e),()=>{Zy.delete(e)}),f_=new Map,pa=new Map,_R=e=>pa.get(e);function Oit(){Xa++,pa.clear(),f_.clear(),u_.clear(),Qm.clear(),Qy()}function Iit(e,n){const t=pa.get(e);if(!(t!=null&&t.tasks.new)||oc(t,n))return;const r=t.tasks.new,s=a=>Object.fromEntries(r.tabs.flatMap(o=>{if(o.kind!=="file")return[];const c=_a(o);if(typeof c=="string"||!("path"in c))return[];const u=bs(e,null,c);return u in a?[[bs(e,n,c),a[u]]]:[]})),i={...t.tasks,[n]:{...r,scroll:s(r.scroll),sourceModes:s(r.sourceModes)}};delete i.new,f_.set(e,n),pa.set(e,{...t,tasks:i})}function Bit(e){let n=u_.get(e);if(!n){const t=Xa;n=cR(async(r,s)=>{t===Xa&&(await $tt(e,r,s),t===Xa&&Qm.delete(e)&&Qy())},r=>{t===Xa&&(Qm.set(e,r instanceof Error?r.message:String(r)),Qy())}),u_.set(e,n)}return n}function fx(e,n,t,r){const s=pa.get(e);if(!s||t==="new"&&f_.has(e))return;const i=Hg(n)??s.lastLocation,a=t?t==="new"?null:t:s.lastTaskId,o=t?oc(s,t):void 0;if(i===s.lastLocation&&a===s.lastTaskId&&(!r||JSON.stringify(r)===JSON.stringify(o)))return;const c={...s,lastLocation:i,lastTaskId:a,tasks:t&&r?{...s.tasks,[t]:r}:s.tasks},u=o&&r&&i===s.lastLocation&&JSON.stringify({...o,scroll:{},sourceModes:{}})===JSON.stringify({...r,scroll:{},sourceModes:{}});pa.set(e,c),Bit(e).queue(c,u?250:0)}function BC(e,n,t,r){const s=new Set(e.state.fileTabs.map(_=>bs(t,r==="new"?null:r,_))),i=Object.fromEntries(Object.entries(e.getScroll()).filter(([_])=>s.has(_))),a=Object.fromEntries(Object.entries(e.sourceModes).filter(([_])=>s.has(_))),o=fR(e.state,i,a),c=e.pane??(n==null?void 0:n.active),u=c?wt(_a(c)):null;return o.active=o.tabs.find(_=>wt(_a(_))===u)??null,o}function $it(e){const{projectId:n,taskKey:t,location:r,pane:s,isTask:i,demoOverview:a,state:o,apply:c,getScroll:u,sourceModes:_,revision:f}=e,p=T.useRef(IC()),m=T.useSyncExternalStore(Dit,()=>n?Qm.get(n)??null:null),[x,S]=T.useState(null),[b,v]=T.useState(0),[y,w]=T.useState(null),[C,z]=T.useState(null),E=T.useRef(null),R=T.useRef(null),N=T.useRef(null),M=T.useRef(e);M.current=e;const O=JSON.stringify([n,t,i]),I=JSON.stringify(s??null),H=T.useCallback(()=>{const F=N.current;if(!F)return;const Y=BC({...M.current,state:F.state,pane:F.pane},oc(pa.get(F.projectId),F.taskKey),F.projectId,F.taskKey);fx(F.projectId,F.location,F.taskKey,Y)},[]);T.useEffect(()=>{let F=!0;const Y=Xa;if(S(null),w(null),!!n)return pa.has(n)?w(n):vA(n).then(q=>{!F||Y!==Xa||(pa.set(n,q??IC()),w(n))}).catch(q=>{F&&Y===Xa&&S(q instanceof Error?q.message:String(q))}),()=>{F=!1}},[n,b]),T.useLayoutEffect(()=>{if(N.current&&N.current.scope!==O){const q=N.current.projectId;H(),f_.get(q)===t&&f_.delete(q),N.current=null}if(!n||y!==n)return;const F=pa.get(n);if(!F)return;if(p.current=F,E.current!==O){if(E.current=O,R.current=I,i){const q=oc(F,t)??(ou(n)?x4(t,a):void 0);c(Mit(q,s),q,!0)}z(O);return}if(C!==O)return;let Y=o;R.current!==I&&(R.current=I,i&&s&&(Y=hR(o,s),c(Y,void 0,!1))),i?(fx(n,r,t,BC({state:Y,pane:s,getScroll:u,sourceModes:_},oc(F,t),n,t)),N.current={projectId:n,taskKey:t,scope:O,location:r,pane:s,state:Y}):fx(n,r),p.current=pa.get(n)??F},[n,t,r,s,I,i,a,o,c,u,_,f,y,O,C,H]),T.useEffect(()=>{const F=Xa,Y=Q=>{if(F===Xa){H();for(const Z of u_.values())Z.flush(Q)}},q=()=>Y(!0);return window.addEventListener("pagehide",q),()=>{window.removeEventListener("pagehide",q),Y(!1)}},[H]);const U=T.useCallback(()=>{var F;n&&(x?v(Y=>Y+1):(F=u_.get(n))==null||F.retry())},[n,x]);return{ready:n===null||y===n&&C===O,loaded:n===null||y===n,error:x??m,retry:U,capture:H,workspace:p}}const Pit="data:image/svg+xml,"+encodeURIComponent(''),Jy=T.createContext(null);function dx(e){var n;return e.kind==="local"?"local":`${e.session.id}:${((n=e.session.installPaths)==null?void 0:n.database)??""}`}function pR(){const e=T.useContext(Jy);if(!e)throw new Error("Runtime is not connected");return e}function Hit(e){const n=document.querySelector('link[rel="icon"]');n&&(n.href=e?Pit:"/favicon.svg")}function $C(e){try{return localStorage.getItem(e)!==null}catch{return!1}}function Fit(e){if(e.kind!=="ssh")return;const{theme:n,locale:t}=e.session.uiPreferences;!$C("orx:theme")&&(n==="light"||n==="dark"||n==="system")&&$A(n),!$C("orx:locale")&&t&&sT(t)&&IA(t)}function Uit(e){return e.includes("ssh ")&&e.includes("failed")}function PC({host:e,overlay:n=!1}){return h.jsx("div",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:h.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[h.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:$T({host:ze(e)})}),h.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:$y()}),h.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:DEe()})]})})}function HC({runtime:e,overlay:n=!1,retriedInteractiveError:t,setRetriedInteractiveError:r}){var M,O,I;const{session:s}=e,[i,a]=T.useState(s.installPaths),[o,c]=T.useState(!1),[u,_]=T.useState(null);T.useEffect(()=>a(s.installPaths),[(M=s.installPaths)==null?void 0:M.binary,(O=s.installPaths)==null?void 0:O.database,(I=s.installPaths)==null?void 0:I.cache]);async function f(){if(i){c(!0);try{await Dnt(i)}catch(H){Vn(H instanceof Error?H.message:String(H),"error")}finally{c(!1)}}}async function p(H=!1){r(H?s.error:null),c(!0);try{await Ont()}catch(U){Vn(U instanceof Error?U.message:String(U),"error")}finally{c(!1)}}async function m(){c(!0);try{await zA()}catch(H){Vn(H instanceof Error?H.message:String(H),"error")}finally{c(!1)}}async function x(){c(!0);try{_(await jA())}catch(H){Vn(H instanceof Error?H.message:String(H),"error")}finally{c(!1)}}async function S(){if(u){c(!0);try{await TA(u),_(null)}catch(H){_(null),Vn(H instanceof Error?H.message:String(H),"error")}finally{c(!1)}}}async function b(){c(!0);try{await Int()}catch(H){Vn(H instanceof Error?H.message:String(H),"error")}finally{c(!1)}}const v=s.status==="applying"||o,y=s.status==="needsInstall",w=s.status==="needsUpdate",C=i&&y,z=["connecting","applying","reconnecting"].includes(s.status),E=s.status==="disconnected"&&s.error!==null&&Uit(s.error)&&t!==s.error&&!s.canStartNewHost,R=y?cNe():w?xje():s.status==="applying"?H9e({host:ze(s.host)}):s.status==="reconnecting"?KNe({host:ze(s.host)}):s.status==="disconnected"?s.error?AEe({host:ze(s.host)}):s.canStartNewHost?UEe({host:ze(s.host)}):$T({host:ze(s.host)}):aEe({host:ze(s.host)}),N=s.error??(s.canStartNewHost?$Ee():y?yNe({user:ze(s.user??""),host:ze(s.host)}):w?mje({host:ze(s.host)}):s.status==="applying"?I9e():s.status==="reconnecting"?qNe():s.status==="disconnected"?kEe():nEe());return h.jsxs(h.Fragment,{children:[h.jsx("main",{className:n?"w-full max-w-2xl":"app flex h-full items-center justify-center bg-background p-6",children:h.jsxs("section",{className:"w-full max-w-2xl rounded-xl border border-border bg-background p-7 shadow-modal",children:[h.jsxs("div",{className:"flex items-start gap-3",children:[z&&h.jsx(Ot,{className:"mt-2"}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h1",{id:"remote-setup-title",className:"m-0 text-2xl font-semibold text-text",children:R}),!E&&h.jsx("p",{className:"mt-2 mb-0 text-base text-text",children:N})]})]}),E&&h.jsx(_4,{host:s.host,backend:"ssh",path:"/_orx/ssh/connect",onComplete:()=>void p(!0)}),C&&h.jsxs("div",{className:"mt-6 grid gap-4 border-t border-border-variant pt-5",children:[h.jsx("p",{className:"m-0 text-sm text-subtext",children:iNe()}),[["binary",WEe()],["database",tNe()],["cache",ZEe()]].map(([H,U])=>h.jsxs("label",{className:"grid gap-1 text-sm font-medium text-subtext",children:[U,h.jsx(Ts,{value:i[H],onChange:F=>a({...i,[H]:F.target.value}),disabled:v,dir:"ltr"})]},H)),!s.error&&h.jsx("div",{className:"flex justify-end pt-1",children:h.jsx($e,{variant:"primary",disabled:v,onClick:()=>void f(),children:v?h.jsxs(h.Fragment,{children:[h.jsx(Ot,{})," ",hNe()]}):w?nC():ZT()})})]}),w&&i&&h.jsx("div",{className:"mt-6 flex justify-end",children:!s.error&&h.jsx($e,{variant:"primary",disabled:v,onClick:()=>void f(),children:v?h.jsxs(h.Fragment,{children:[h.jsx(Ot,{})," ",kje()]}):nC()})}),s.status==="disconnected"&&h.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:s.canStartNewHost?h.jsxs($e,{variant:"primary",disabled:o,onClick:()=>void b(),children:[o?h.jsx(Ot,{}):null,s.error?eC():sze()]}):h.jsxs($e,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?h.jsx(Ot,{}):null,eC()]})}),(s.status==="connecting"||s.status==="reconnecting")&&h.jsx("div",{className:"mt-6 flex justify-end border-t border-border-variant pt-5",children:h.jsx($e,{disabled:o,onClick:()=>void m(),children:Hy()})}),w&&s.error&&h.jsxs("div",{className:"mt-6 flex justify-end gap-2 border-t border-border-variant pt-5",children:[h.jsx($e,{disabled:o,onClick:()=>void m(),children:Hy()}),s.installPaths!==null&&(s.dashboardProtocol===null||s.dashboardProtocolvoid p(),children:[o?h.jsx(Ot,{}):null,J8()]}),s.installPaths===null&&s.dashboardProtocol!==null&&s.dashboardProtocolvoid x(),children:[o?h.jsx(Ot,{}):null,PT()]})]}),y&&s.error&&h.jsx("div",{className:"mt-6 flex justify-end",children:h.jsxs($e,{variant:"primary",disabled:o,onClick:()=>void p(),children:[o?h.jsx(Ot,{}):null,J8()]})})]})}),u&&h.jsx(sR,{host:s.host,preview:u,currentClientAttached:!1,stopping:o,onClose:()=>{o||_(null)},onConfirm:()=>void S()})]})}function qit({children:e}){const n=T.useRef(null);return T.useEffect(()=>{var t;return(t=n.current)==null?void 0:t.focus()},[]),h.jsx("div",{ref:n,role:"alertdialog","aria-modal":"true","aria-labelledby":"remote-setup-title",tabIndex:-1,className:"absolute inset-0 z-100 flex items-center justify-center bg-modal-backdrop p-6",children:e})}function Git(){const e=RF({select:m=>m.pathname==="/remote-launch"}),[n,t]=T.useState(null),[r,s]=T.useState(null),i=T.useRef(!1),a=T.useRef(!1),o=T.useRef(!1),c=T.useRef(null),[u,_]=T.useState(null);if(T.useEffect(()=>{if(e)return;let m=!0,x;const S=async()=>{try{const b=await Rnt();if(!m)return;const v=dx(b);c.current!==null&&c.current!==v&&(Rit(),Oit(),i.current=!1,a.current=!1,o.current=!1),c.current=v,b.kind==="ssh"&&(o.current||(o.current=!0,Fit(b)),b.session.status==="connected"?(i.current=!0,a.current=!0,_(null)):b.session.status==="disconnected"&&b.session.error===null&&(a.current=!1)),t(y=>JSON.stringify(y)===JSON.stringify(b)?y:b),s(null),b.kind==="ssh"&&(x=window.setTimeout(()=>void S(),2e3))}catch(b){m&&(s(b instanceof Error?b.message:String(b)),x=window.setTimeout(()=>void S(),2e3))}};return S(),()=>{m=!1,x!==void 0&&window.clearTimeout(x)}},[e]),T.useEffect(()=>{const m=(n==null?void 0:n.kind)==="ssh";Hit(m),m&&(!i.current||n.session.status==="disconnected"&&!n.session.error)&&(document.title="OpenResearch")},[n]),e)return h.jsxs("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:[h.jsx(Ot,{})," ",INe()]});if(!n)return h.jsx("main",{className:"app flex h-full items-center justify-center gap-3 bg-background text-base text-text",children:r?h.jsxs(h.Fragment,{children:[h.jsx("span",{children:r}),h.jsx($e,{onClick:()=>location.reload(),children:Ji()})]}):h.jsx(Ot,{})});if(n.kind==="local")return h.jsx(Jy,{value:n,children:h.jsx(i_,{})},dx(n));if(!(a.current&&(n.session.status!=="disconnected"||n.session.error!==null))&&n.session.status!=="connected")return r?h.jsx(PC,{host:n.session.host}):h.jsx(HC,{runtime:n,retriedInteractiveError:u,setRetriedInteractiveError:_});const p=n.session.status!=="connected"||r!==null;return h.jsxs("div",{className:"relative h-full",children:[h.jsx("div",{className:"h-full",inert:p,children:h.jsx(Jy,{value:n,children:h.jsx(i_,{})},dx(n))}),p&&h.jsx(qit,{children:r?h.jsx(PC,{host:n.session.host,overlay:!0}):h.jsx(HC,{runtime:n,overlay:!0,retriedInteractiveError:u,setRetriedInteractiveError:_})})]})}const Ug=gF({component:Git}),vm=new Map;function Vit(e,n){let t=vm.get(e);return t||(t=new Set,vm.set(e,t)),t.add(n),()=>{t.delete(n),t.size===0&&vm.delete(e)}}function Wit(e){var n;(n=vm.get(e.runId))==null||n.forEach(t=>t(e))}const e2=new Set;function lc(e){return e2.add(e),()=>{e2.delete(e)}}function Gl(e){e2.forEach(n=>n(e))}function Kit(e,n,t){const r=T.useRef(t);r.current=t,T.useEffect(()=>{if(!n)return;let s=!1,i=!1,a=!1,o=null;const c=()=>{o&&clearInterval(o),o=null},u=()=>{o||(o=setInterval(()=>r.current(),5e3))},_=()=>{i=!1,gu(e).then(p=>{var m;s||i||(a=!!((m=p.find(x=>x.id===n))!=null&&m.busy),a?u():c())}).catch(()=>{})},f=lc(p=>{if(p.type==="reconnected"){r.current(),_();return}p.type!=="busy"||p.sessionId!==n||(i=!0,p.busy!==a&&(a=p.busy,a?u():(c(),r.current())))});return _(),()=>{s=!0,f(),c()}},[e,n])}const t2=new Set;function Yit(e){return t2.add(e),()=>{t2.delete(e)}}function Vl(){t2.forEach(e=>e())}const n2=new Set;function y4(e){return n2.add(e),()=>{n2.delete(e)}}function FC(e){n2.forEach(n=>n(e))}const r2=new Set;function Xit(e){return r2.add(e),()=>{r2.delete(e)}}function hx(e){r2.forEach(n=>n(e))}const s2=new Set;function Zit(e){return s2.add(e),()=>{s2.delete(e)}}function Qit(e){s2.forEach(n=>n(e))}let i2=!0;const a2=new Set;function Jit(e){return a2.add(e),()=>{a2.delete(e)}}function UC(){return i2}function qC(e){e!==i2&&(i2=e,a2.forEach(n=>n()))}const eat=8e3,tat=3e3;function mR(e){const n=T.useRef(e);n.current=e,T.useEffect(()=>{let t=null,r=!1,s,i,a=!1;const o=()=>{t==null||t.close();const c=new EventSource("/api/events");t=c,c.onerror=()=>{r||(a=!0,s??(s=window.setTimeout(()=>qC(!1),eat)),c.readyState===EventSource.CLOSED&&i===void 0&&(i=window.setTimeout(()=>{i=void 0,o()},tat)))},c.onopen=()=>{var _,f;r||(window.clearTimeout(s),s=void 0,qC(!0),a&&(Gl({type:"reconnected"}),Vl(),FC({harness:"*",authState:"unknown"}),(f=(_=n.current).onReconnect)==null||f.call(_)),a=!0)};const u=_=>{try{return JSON.parse(_.data)}catch{return null}};c.addEventListener("run.updated",_=>{const f=u(_);f!=null&&f.run&&(Vl(),n.current.onRun(f.run))}),c.addEventListener("experiment.updated",_=>{const f=u(_);f!=null&&f.experiment&&(Vl(),n.current.onExperiment(f.experiment))}),c.addEventListener("project.updated",_=>{const f=u(_);f!=null&&f.project&&(Vl(),n.current.onProject(f.project))}),c.addEventListener("files.updated",_=>{var p,m;const f=u(_);f!=null&&f.projectId&&((m=(p=n.current).onArtifacts)==null||m.call(p,f.projectId))}),c.addEventListener("run.log",_=>{const f=u(_);f!=null&&f.runId&&Wit(f)}),c.addEventListener("chat.session",_=>{const f=u(_);f!=null&&f.session&&(Vl(),Gl({type:"session",session:f.session}))}),c.addEventListener("chat.session.deleted",_=>{const f=u(_);f!=null&&f.sessionId&&(Vl(),Gl({type:"sessionDeleted",sessionId:f.sessionId}))}),c.addEventListener("chat.message",_=>{const f=u(_);f!=null&&f.message&&(Vl(),Gl({type:"message",sessionId:f.sessionId,message:f.message}))}),c.addEventListener("chat.busy",_=>{const f=u(_);f!=null&&f.sessionId&&(Vl(),Gl({type:"busy",sessionId:f.sessionId,busy:f.busy}))}),c.addEventListener("chat.usage",_=>{const f=u(_);f!=null&&f.sessionId&&f.usage&&Gl({type:"usage",sessionId:f.sessionId,usage:f.usage})}),c.addEventListener("chat.queued",_=>{const f=u(_);f!=null&&f.sessionId&&Gl({type:"queued",sessionId:f.sessionId,items:f.items??[]})}),c.addEventListener("chat.branch",_=>{const f=u(_);f!=null&&f.sessionId&&Gl({type:"branch",sessionId:f.sessionId,activeLeafId:f.activeLeafId??null})}),c.addEventListener("harness.auth",_=>{const f=u(_);f!=null&&f.harness&&f.authState&&FC(f)}),c.addEventListener("datadir.move.progress",_=>{const f=u(_);f&&hx({type:"progress",...f})}),c.addEventListener("datadir.move.done",_=>{const f=u(_);f&&hx({type:"done",path:f.path,oldPathLeft:f.oldPathLeft})}),c.addEventListener("datadir.move.error",_=>{const f=u(_);f&&hx({type:"error",error:f.error})}),c.addEventListener("update.status",_=>{const f=u(_);f&&Qit(f)})};return o(),()=>{r=!0,window.clearTimeout(s),window.clearTimeout(i),t==null||t.close()}},[])}const w4="orx:demo-read-sessions";function gR(){try{const e=JSON.parse(sessionStorage.getItem(w4)??"[]");return new Set(Array.isArray(e)?e.filter(n=>typeof n=="string"):[])}catch{return new Set}}function nat(e){try{const n=gR();n.add(e),sessionStorage.setItem(w4,JSON.stringify([...n]))}catch{}}function rat(){try{sessionStorage.removeItem(w4)}catch{}}function bR(e,n){const t=Su(e.split("?")[0]);return!!(t&&(!t.sessionId||n.some(r=>r.id===t.sessionId&&r.projectId===t.projectId)))}async function sat(){var s;const[e,n]=await Promise.all([Ig(),n4()]),t=Hg((s=g4()??e.workspace)==null?void 0:s.lastLocation);if(!t)return"/projects";const r=Su(t.split("?")[0]);return!(r!=null&&r.projectId)||!n.some(i=>i.id===r.projectId)||r.sessionId&&!bR(t,await gu(r.projectId))?"/projects":t}async function iat(e){var u;const[n,t]=await Promise.all([vA(e),gu(e)]),r=_R(e)??n,s=Hg(r==null?void 0:r.lastLocation);if(s&&((u=Su(s.split("?")[0]))==null?void 0:u.projectId)===e&&bR(s,t))return s;const i=t.find(_=>!_.archived),a=ou(e)?x4(i==null?void 0:i.id,!(await Ig()).tourCompleted):void 0,o=oc(r,(i==null?void 0:i.id)??"new"),c=o?o.active:a==null?void 0:a.active;return mm(e,(i==null?void 0:i.id)??null,c)}/** + * @license lucide-react v1.23.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=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aat=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oat=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GC=e=>{const n=oat(e);return n.charAt(0).toUpperCase()+n.slice(1)};/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var _x={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 v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lat=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},cat=T.createContext({}),uat=()=>T.useContext(cat),fat=T.forwardRef(({color:e,size:n,strokeWidth:t,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>{const{size:u=24,strokeWidth:_=2,absoluteStrokeWidth:f=!1,color:p="currentColor",className:m=""}=uat()??{},x=r??f?Number(t??_)*24/Number(n??u):t??_;return T.createElement("svg",{ref:c,..._x,width:n??u??_x.width,height:n??u??_x.height,stroke:e??p,strokeWidth:x,className:vR("lucide",m,s),...!i&&!lat(o)&&{"aria-hidden":"true"},...o},[...a.map(([S,b])=>T.createElement(S,b)),...Array.isArray(i)?i:[i]])});/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const st=(e,n)=>{const t=T.forwardRef(({className:r,...s},i)=>T.createElement(fat,{ref:i,iconNode:n,className:vR(`lucide-${aat(GC(e))}`,`lucide-${e}`,r),...s}));return t.displayName=GC(e),t};/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dat=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],hat=st("arrow-down",dat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _at=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],d_=st("arrow-left",_at);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pat=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],xm=st("arrow-right",pat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mat=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],gat=st("arrow-up-right",mat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bat=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],xR=st("blocks",bat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vat=[["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"}]],yR=st("book-open",vat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xat=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],yat=st("calendar-days",xat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wat=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16c.5-2 1.5-7 4-7 2 0 2 3 4 3 2.5 0 4.5-5 5-7",key:"lw07rv"}]],Sat=st("chart-spline",wat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kat=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zi=st("check",kat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cat=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lo=st("chevron-down",Cat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eat=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],wR=st("chevron-left",Eat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nat=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],co=st("chevron-right",Nat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zat=[["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"}]],SR=st("circle-alert",zat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jat=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Tat=st("circle-question-mark",jat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Aat=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],kR=st("circle-stop",Aat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rat=[["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"}]],CR=st("circle-x",Rat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mat=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],Lat=st("clock-3",Mat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dat=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Oat=st("clock",Dat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Iat=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],Bat=st("cloud-upload",Iat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $at=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],o2=st("code",$at);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pat=[["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"}]],qg=st("copy",Pat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hat=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],ER=st("corner-down-left",Hat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fat=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Uat=st("cpu",Fat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qat=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Gat=st("download",qat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vat=[["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"}]],S4=st("ellipsis",Vat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wat=[["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"}]],ku=st("external-link",Wat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kat=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],NR=st("file-code",Kat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yat=[["path",{d:"M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127",key:"wfxp4w"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Xat=st("file-output",Yat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zat=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Gg=st("file-text",Zat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qat=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],k4=st("flask-conical",Qat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jat=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],zR=st("folder-git-2",Jat);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eot=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],h_=st("folder-open",eot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tot=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],not=st("folder-plus",tot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rot=[["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"}]],Vg=st("folder-tree",rot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sot=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],iot=st("funnel",sot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aot=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Wg=st("git-branch",aot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oot=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],lot=st("git-commit-horizontal",oot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cot=[["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"}]],uot=st("globe",cot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fot=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],dot=st("history",fot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hot=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],C4=st("info",hot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _ot=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],pot=st("laptop",_ot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mot=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],got=st("lightbulb",mot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bot=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],VC=st("lock",bot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vot=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],xot=st("maximize-2",vot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yot=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],jR=st("message-square-quote",yot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wot=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Sot=st("minimize-2",wot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kot=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Cot=st("monitor",kot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eot=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Not=st("moon",Eot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zot=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],jot=st("mouse-pointer-click",zot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tot=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],E4=st("package",Tot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Aot=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],TR=st("panel-left",Aot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rot=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]],AR=st("panel-right",Rot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mot=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Lot=st("paperclip",Mot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dot=[["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"}]],N4=st("pencil",Dot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oot=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],z4=st("plus",Oot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Iot=[["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"}]],Ca=st("refresh-cw",Iot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bot=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],$ot=st("rotate-cw",Bot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pot=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],j4=st("scroll-text",Pot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hot=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],RR=st("search",Hot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fot=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],WC=st("server",Fot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uot=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],qot=st("settings-2",Uot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Got=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],MR=st("settings",Got);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vot=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],LR=st("sliders-horizontal",Vot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wot=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Sd=st("square-terminal",Wot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kot=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Yot=st("sun",Kot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xot=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],sd=st("terminal",Xot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zot=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Qot=st("toggle-right",Zot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jot=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],kd=st("trash-2",Jot);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const elt=[["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"}]],DR=st("triangle-alert",elt);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tlt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],nlt=st("upload",tlt);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rlt=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],T4=st("users",rlt);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const slt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Dr=st("x",slt);/** + * @license lucide-react v1.23.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ilt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],alt=st("zap",ilt);function A4(){return h.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function px(){return h.jsxs("span",{className:"wordmark inline-flex items-center gap-[0.4em] text-text [&_svg]:w-[1em] [&_svg]:h-[1em] [&_svg]:shrink-0",children:[h.jsx(A4,{}),"OpenResearch"]})}function olt({cmd:e}){const[n,t]=T.useState(!1);return h.jsxs("span",{className:"cmd-inline inline-flex items-center gap-1 align-baseline",children:[h.jsx("code",{className:"font-mono text-sm",children:e}),h.jsx("button",{type:"button",className:"cmd-inline-copy inline-flex items-center p-0.5 border-0 rounded-xs bg-none bg-transparent text-muted cursor-pointer [&:hover]:bg-surface [&:hover]:text-text",onClick:()=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),1500)}).catch(()=>{})},"aria-label":n?l_():kU({value:ze(e)}),title:n?l_():NT(),children:n?h.jsx(zi,{size:11,strokeWidth:3}):h.jsx(qg,{size:11})})]})}function Z_(e){return e?e.split(/`([^`]+)`/).map((n,t)=>t%2===1?h.jsx(olt,{cmd:n},t):n):null}function l2({harness:e,size:n=16}){const t="block shrink-0";return e==="claude-code"?h.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"#d97757","aria-hidden":"true",children:h.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})}):e==="opencode"?h.jsx("svg",{className:t,width:n,height:n,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M22 24H2V0h20zM17 4.8H7v14.4h10z"})}):h.jsx("svg",{className:t,width:n,height:n,viewBox:"146 227 268 265",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M249.176 323.434V298.276C249.176 296.158 249.971 294.569 251.825 293.509L302.406 264.381C309.29 260.409 317.5 258.555 325.973 258.555C357.75 258.555 377.877 283.185 377.877 309.399C377.877 311.253 377.877 313.371 377.611 315.49L325.178 284.771C322.001 282.919 318.822 282.919 315.645 284.771L249.176 323.434ZM367.283 421.415V361.301C367.283 357.592 365.694 354.945 362.516 353.092L296.048 314.43L317.763 301.982C319.617 300.925 321.206 300.925 323.058 301.982L373.639 331.112C388.205 339.586 398.003 357.592 398.003 375.069C398.003 395.195 386.087 413.733 367.283 421.412V421.415ZM233.553 368.452L211.838 355.742C209.986 354.684 209.19 353.095 209.19 350.975V292.718C209.19 264.383 230.905 242.932 260.301 242.932C271.423 242.932 281.748 246.641 290.49 253.26L238.321 283.449C235.146 285.303 233.555 287.951 233.555 291.659V368.455L233.553 368.452ZM280.292 395.462L249.176 377.985V340.913L280.292 323.436L311.407 340.913V377.985L280.292 395.462ZM300.286 475.968C289.163 475.968 278.837 472.259 270.097 465.64L322.264 435.449C325.441 433.597 327.03 430.949 327.03 427.239V350.445L349.011 363.155C350.865 364.213 351.66 365.802 351.66 367.922V426.179C351.66 454.514 329.679 475.965 300.286 475.965V475.968ZM237.525 416.915L186.944 387.785C172.378 379.31 162.582 361.305 162.582 343.827C162.582 323.436 174.763 305.164 193.563 297.485V357.861C193.563 361.571 195.154 364.217 198.33 366.071L264.535 404.467L242.82 416.915C240.967 417.972 239.377 417.972 237.525 416.915ZM234.614 460.343C204.689 460.343 182.71 437.833 182.71 410.028C182.71 407.91 182.976 405.792 183.238 403.672L235.405 433.863C238.582 435.715 241.763 435.715 244.938 433.863L311.407 395.466V420.622C311.407 422.742 310.612 424.331 308.758 425.389L258.179 454.519C251.293 458.491 243.083 460.343 234.611 460.343H234.614ZM300.286 491.854C332.329 491.854 359.073 469.082 365.167 438.892C394.825 431.211 413.892 403.406 413.892 375.073C413.892 356.535 405.948 338.529 391.648 325.552C392.972 319.991 393.766 314.43 393.766 308.87C393.766 271.003 363.048 242.666 327.562 242.666C320.413 242.666 313.528 243.723 306.644 246.109C294.725 234.457 278.307 227.042 260.301 227.042C228.258 227.042 201.513 249.815 195.42 280.004C165.761 287.685 146.694 315.49 146.694 343.824C146.694 362.362 154.638 380.368 168.938 393.344C167.613 398.906 166.819 404.467 166.819 410.027C166.819 447.894 197.538 476.231 233.024 476.231C240.172 476.231 247.058 475.173 253.943 472.788C265.859 484.441 282.278 491.854 300.286 491.854Z"})})}const llt={header:"min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-base font-semibold text-text",list:"text-sm font-medium text-text"};function __({variant:e="list",className:n,...t}){return h.jsx("span",{className:vs("title",llt[e],n),...t})}const KC=["onb-gate-hint text-base font-medium leading-normal text-text","onb-agent-hint mt-0 mx-0 mb-2.5"].join(" "),p_=["onb-card-meta text-sm text-subtext [&_code]:font-mono","[&_code]:text-xs [&_code]:bg-panel","[&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs","[&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap"].join(" "),YC=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text onb-git-hint mt-2"].join(" "),OR=["onb-card flex flex-col gap-[5px] bg-background","border border-border rounded-lg py-4.5 px-5"].join(" "),XC=["onb-gate-hint mt-4.5 mx-0 mb-0 text-base font-medium leading-normal","text-text"].join(" "),clt=[{id:"AI/ML",label:F4e},{id:"Biology",label:V4e},{id:"Physics",label:e5e},{id:"Other",label:X4e}];function ult({onDone:e,preferredAgent:n}){const[t,r]=T.useState(0),[s,i]=T.useState(null),[a,o]=T.useState(),[c,u]=T.useState(!1),[_,f]=T.useState(null),[p,m]=T.useState(null),[x,S]=T.useState(!1),[b,v]=T.useState([]),[y,w]=T.useState(""),[C,z]=T.useState(""),[E,R]=T.useState([]),[N,M]=T.useState(""),[O,I]=T.useState([]),[H,U]=T.useState(!1),F=T.useRef(0),[Y,q]=T.useState(!1),[Q,Z]=T.useState(!1),B=(s==null?void 0:s.some(G=>G.agentReady))??!1,D=a!=null,P=T.useRef(0),X=(G,oe=!1)=>{const ce=++P.current;S(!0),q(!1),Z(!1),o(void 0);const pe=()=>ce===P.current;Promise.allSettled([Ym(G,oe).then(ue=>pe()&&i(ue)),xA().then(ue=>pe()&&o(ue.gitVersion))]).then(([ue,Ee])=>{pe()&&(ue.status==="rejected"&&(q(!0),i(null)),Ee.status==="rejected"&&(Z(!0),o(void 0)))}).finally(()=>pe()&&S(!1))};T.useEffect(()=>X(!1),[]),T.useEffect(()=>{if(s===null)return;const G=s.filter(oe=>oe.agentReady);m(oe=>{var pe;if(oe&&G.some(ue=>ue.id===oe))return oe;const ce=n&&G.find(ue=>ue.id===n.harness);return(ce==null?void 0:ce.id)??((pe=G[0])==null?void 0:pe.id)??null})},[s,n]),T.useEffect(()=>y4(()=>{Ym(!0).then(G=>{i(G),q(!1)}).catch(()=>q(!0))}),[]),T.useEffect(()=>{Qnt().then(G=>{v(G.researchAreas),w(G.otherArea??""),z(G.background??""),R(G.papers)}).catch(()=>{})},[]),T.useEffect(()=>{const G=N.trim();if(G.length<3){I([]),U(!1);return}const oe=++F.current;U(!0);const ce=setTimeout(()=>{yA(G).then(pe=>oe===F.current&&I(pe)).catch(()=>oe===F.current&&I([])).finally(()=>oe===F.current&&U(!1))},350);return()=>clearTimeout(ce)},[N]);const W=G=>{const oe=E.some(ce=>ce.paperId===G.paperId);R(ce=>ce.some(pe=>pe.paperId===G.paperId)?ce:[...ce,{paperId:G.paperId,title:ZC(G.title)}]),M(""),I([]),oe||qy(G.paperId).then(ce=>{var ue;const pe=(ue=ce.title)==null?void 0:ue.trim();pe&&R(Ee=>Ee.map(Te=>Te.paperId===G.paperId?{...Te,title:pe}:Te))}).catch(()=>{})},ie=G=>R(oe=>oe.filter(ce=>ce.paperId!==G)),le=G=>{v(oe=>oe.includes(G)?oe.filter(ce=>ce!==G):[...oe,G])},ae=b.length>0&&(!b.includes("Other")||y.trim().length>0),se=async()=>{const G=s==null?void 0:s.find(ce=>ce.id===p&&ce.agentReady);if(!G||c)return;const oe=dlt(G);u(!0),f(null);try{const ce=await Htt(oe,{researchAreas:b,otherArea:b.includes("Other")?y:null,background:C||null,papers:E});e(ce.project,ce.selection)}catch(ce){f(ce instanceof Error?ce.message:String(ce))}finally{u(!1)}};return h.jsx("div",{className:`home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas onboarding ${t===0?"[&_.home-inner]:max-w-300 [&_.home-inner]:pt-0 [&_.home-inner]:pb-0":"[&_.home-inner]:max-w-140 [&_.home-inner]:pt-24"}`,children:h.jsx("div",{className:`home-inner max-w-155 my-0 mx-auto ${t===0?"px-8 sm:px-12":"pt-12 px-6 pb-16"}`,children:t===0?h.jsxs("div",{className:"onb-intro relative flex min-h-dvh flex-col justify-center gap-4 py-12 min-[1120px]:grid min-[1120px]:grid-cols-[minmax(0,_1.1fr)_minmax(28rem,_1fr)] min-[1120px]:grid-rows-[auto_auto] min-[1120px]:content-center min-[1120px]:gap-x-20 min-[1120px]:gap-y-10",children:[h.jsxs("div",{className:"onb-intro-copy relative z-10 min-[1120px]:col-start-1 min-[1120px]:row-start-1 min-[1120px]:self-start",children:[h.jsx("div",{className:"onb-intro-brand mb-10 text-6xl font-semibold leading-none tracking-[-0.035em]",children:h.jsx(px,{})}),h.jsx("h2",{className:"onb-title mt-0 mx-0 text-4xl font-medium leading-[1.08] tracking-[-0.035em]",children:A4e()})]}),h.jsxs("div",{className:"onb-intro-features relative min-[1120px]:col-start-2 min-[1120px]:row-start-1 min-[1120px]:self-end",children:[h.jsx("div",{"aria-hidden":"true",className:"absolute -inset-14 rounded-full bg-primary-subtle opacity-70 blur-3xl"}),h.jsxs("ul",{className:"onb-intro-list relative flex flex-col gap-4 m-0 p-0 list-none",children:[h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:$5e()}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:hSe()})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:m3e()}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:W6e()})]})}),h.jsx("li",{className:"rounded-2xl border border-border bg-background p-6 shadow-card",children:h.jsxs("span",{children:[h.jsx("strong",{className:"mb-1.5 block text-xl font-semibold tracking-[-0.015em]",children:s3e()}),h.jsx("span",{className:"block text-lg leading-[1.55] text-text",children:ISe()})]})})]})]}),h.jsx("div",{className:"onb-intro-actions relative z-10 mt-8 flex justify-end min-[1120px]:col-start-2 min-[1120px]:row-start-2 min-[1120px]:mt-0 min-[1120px]:self-start",children:h.jsxs($e,{variant:"primary",size:"large",onClick:()=>r(1),children:[U8()," ",h.jsx(xm,{size:20})]})})]}):t===1?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[h.jsx(px,{}),h.jsx("span",{children:Z6e()})]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em]",children:v5e()}),h.jsx("p",{className:"onb-sub text-text text-base leading-[1.55] mt-0 mx-0 mb-5.5 max-w-120",children:F3e()}),s!==null&&!B&&h.jsx("p",{className:KC,children:$6e()}),s!==null&&B&&p===null&&h.jsx("p",{className:KC,children:S5e()}),h.jsx("div",{className:"onb-cards flex flex-col gap-3.5",children:s!==null?s.map(G=>h.jsx(_lt,{h:G,selected:p===G.id,onSelect:()=>m(G.id)},G.id)):Y?h.jsx("div",{className:p_,children:G8()}):h.jsxs(Br,{className:"py-2",children:[h.jsx(Ot,{})," ",X5e()]})}),(a===null||Q)&&h.jsxs("div",{className:"onb-git-check mt-7",role:"status","aria-live":"polite",children:[h.jsx(plt,{gitVersion:a,error:Q}),Q?h.jsx("p",{className:YC,children:G8()}):h.jsx("p",{className:YC,children:d3e()})]}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs($e,{variant:"ghost",onClick:()=>r(0),children:[h.jsx(d_,{size:12})," ",F8()]}),(Y||Q||a===null||s!==null&&!B)&&h.jsxs($e,{variant:"ghost",onClick:()=>X(!0,!0),disabled:x,children:[h.jsx(Ca,{size:12,className:x?"animate-[spin_0.9s_linear_infinite]":""})," ",X3e()]}),h.jsx("div",{className:"flex-1"}),h.jsxs($e,{variant:"primary",onClick:()=>r(2),disabled:x||!B||p===null||!D,title:x?jSe():B?p===null?D5e():Q?s6e():a===void 0?CSe():a===null?k3e():void 0:D6e(),children:[U8()," ",h.jsx(xm,{size:13})]})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"onb-eyebrow mb-4.5 flex items-center gap-2 text-xl font-medium text-muted",children:[h.jsx(px,{}),h.jsx("span",{children:tSe()})]}),h.jsx("h2",{className:"onb-title mt-0 mx-0 mb-1.5 text-3xl tracking-[-0.01em] onb-profile-title mb-5.5",children:iSe()}),h.jsx("div",{className:"onb-cards flex flex-col gap-2.5",children:h.jsxs("div",{className:OR,children:[h.jsxs("fieldset",{className:"onb-fieldset border-0 mt-0 mx-0 mb-4.5 p-0 [&_legend]:text-base [&_legend]:font-medium [&_legend]:mb-1.5",children:[h.jsx("legend",{children:MSe()}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:A5e()}),h.jsx("div",{className:"onb-area-options grid grid-cols-[repeat(2,_minmax(0,_1fr))] gap-2",children:clt.map(G=>h.jsxs("label",{className:"onb-area-option flex items-center gap-2 border border-border rounded-md cursor-pointer py-[9px] px-2.5 [&:has(input:checked)]:border-accent [&:has(input:checked)]:bg-primary-subtle [&_input]:m-0",children:[h.jsx("input",{type:"checkbox",checked:b.includes(G.id),onChange:()=>le(G.id),disabled:c}),h.jsx("span",{children:G.label()})]},G.id))}),b.includes("Other")&&h.jsx("input",{className:"onb-other-area w-full mt-2",value:y,onChange:G=>w(G.target.value),disabled:c,placeholder:cSe(),"aria-label":V3e()})]}),h.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-background",children:d6e()}),h.jsx("textarea",{id:"onb-background",className:"onb-textarea w-full resize-y min-h-19.5 leading-normal text-base mb-3.5",value:C,onChange:G=>z(G.target.value),disabled:c,rows:4,placeholder:e3e()}),h.jsx("label",{className:"onb-field-label text-base font-medium mb-1.5",htmlFor:"onb-paper-search",children:l6e()}),h.jsx("p",{className:"onb-field-hint text-muted text-sm leading-[1.4] mt-0 mx-0 mb-2",children:D4e()}),h.jsxs("div",{className:"onb-paper-search flex flex-col gap-1.5 mt-3 [&_input]:w-full",children:[h.jsx("input",{id:"onb-paper-search",value:N,onChange:G=>M(G.target.value),disabled:c,placeholder:v6e()}),H?h.jsx("div",{className:p_,children:S6e()}):O.length>0?h.jsx("div",{className:"onb-paper-results flex flex-col border border-border rounded-md max-h-50 overflow-y-auto [&_button]:flex [&_button]:flex-col [&_button]:items-start [&_button]:gap-0.5 [&_button]:py-2 [&_button]:px-2.5 [&_button]:bg-none [&_button]:bg-transparent [&_button]:border-0 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-start [&_button]:[font:inherit] [&_button]:text-text [&_button]:cursor-pointer [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_.title]:text-sm [&_.title]:font-medium [&_.id]:text-xs [&_.id]:text-muted",children:O.map(G=>h.jsxs("button",{type:"button",onClick:()=>W(G),disabled:c,children:[h.jsx(__,{children:ZC(G.title)}),h.jsx("span",{className:"id",children:G.paperId})]},G.paperId))}):null]}),E.length>0&&h.jsx("div",{className:"onb-paper-chips flex flex-wrap gap-1.5 mt-2.5",children:E.map(G=>h.jsxs("span",{className:"onb-paper-chip inline-flex items-center gap-1.5 pt-1 pe-1 pb-1 ps-2.5 border border-border rounded-sm bg-surface text-sm max-w-full [&_.title]:font-medium [&_.title]:overflow-hidden [&_.title]:text-ellipsis [&_.title]:whitespace-nowrap [&_.title]:max-w-60 [&_.id]:text-xs [&_.id]:text-muted [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:p-0.5 [&_button]:border-0 [&_button]:bg-none [&_button]:bg-transparent [&_button]:text-muted [&_button]:cursor-pointer [&_button]:rounded-xs [&_button:hover]:text-text [&_button:hover]:bg-panel",children:[h.jsx(__,{children:G.title||G.paperId}),h.jsx("span",{className:"id",children:G.paperId}),h.jsx("button",{type:"button","aria-label":Bq({name:ze(G.paperId)}),onClick:()=>ie(G.paperId),disabled:c,children:h.jsx(Dr,{size:12})})]},G.paperId))})]})}),!ae&&h.jsx("p",{className:"onb-profile-hint text-accent-red text-sm mt-2 mx-0 mb-0",children:b.length===0?N5e():V5e()}),h.jsxs("div",{className:"onb-actions flex items-center gap-2.5 mt-5.5",children:[h.jsxs($e,{variant:"ghost",onClick:()=>r(1),disabled:c,children:[h.jsx(d_,{size:12})," ",F8()]}),h.jsx("div",{className:"flex-1"}),h.jsx($e,{variant:"primary",onClick:()=>void se(),disabled:c||p===null||!ae,children:c?h.jsxs(h.Fragment,{children:[h.jsx(Ot,{})," ",A6e()]}):h.jsxs(h.Fragment,{children:[l3e()," ",h.jsx(xm,{size:13})]})})]}),p===null&&h.jsx("p",{className:XC,children:HSe()}),_&&h.jsx("p",{className:XC,children:_})]})})})}function ZC(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function flt(e){return e.agentReady?{tone:"success",label:U6e()}:e.installed?e.installBroken?{tone:"warning",label:x3e()}:e.authState==="unknown"?{tone:"warning",label:gSe()}:e.authState==="unsupported"?{tone:"warning",label:ySe()}:e.installed?{tone:"warning",label:B3e()}:{tone:"neutral",label:q8()}:{tone:"neutral",label:q8()}}function dlt(e){var t,r;const n=((t=e.models[0])==null?void 0:t.id)??null;return{harness:e.id,model:n,permissionMode:((r=e.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:$g(e,n).defaultId}}function hlt({harness:e}){return h.jsx(l2,{harness:e,size:26})}function _lt({h:e,selected:n,onSelect:t}){var c;const r=flt(e),s=n?{tone:"success",label:N6e()}:r,a=[(c=e.version)==null?void 0:c.replace(/\s*\(.*\)$/,""),e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(u=>Vm(u)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · "),o=h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsxs("span",{className:"onb-card-identity flex items-center gap-3 min-w-0",children:[h.jsx(hlt,{harness:e.id}),h.jsx("span",{className:"onb-card-name text-lg font-semibold tracking-[-0.01em]",children:e.name})]}),h.jsx(c4,{tone:s.tone,children:s.label})]});return e.agentReady?h.jsxs("button",{type:"button",className:`onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected${n?" selected":""}`,"aria-pressed":n,onClick:t,children:[o,h.jsxs("div",{className:"onb-card-detail text-sm",children:[e.account??Yw(),e.plan?` · ${e.plan}`:""]}),h.jsx("div",{className:`${p_} w-full overflow-hidden text-ellipsis whitespace-nowrap`,title:a,children:a})]}):h.jsxs("div",{className:"onb-card flex flex-col gap-2.5 bg-background border border-border rounded-lg py-5.5 px-6 onb-agent-choice w-full text-inherit [font:inherit] text-start transition-[border-color,box-shadow] duration-120 ease-standard [button&]:cursor-pointer [button&:hover]:border-muted [&.selected]:border-accent [&.selected]:shadow-selected",children:[o,h.jsx("div",{className:p_,children:Z_(e.agentNote)})]})}function plt({gitVersion:e,error:n}){return h.jsxs("div",{className:OR,children:[h.jsxs("div",{className:"onb-card-head flex items-center justify-between gap-3",children:[h.jsx("span",{className:"onb-card-name font-semibold text-base",children:z3e()}),h.jsx(c4,{tone:e?"success":n||e===null?"danger":"warning",children:e?e6e():n?o5e():e===null?AT():f5e()})]}),(e||!n&&e===void 0)&&h.jsx("div",{className:p_,children:e??p5e()})]})}const mlt="/assets/slurm-logo-aGSXVZcE.svg",glt="/assets/thinking-machines-BOdslTfm.png";function blt(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"ray_job":return"Ray";case"openresearch_job":return"OpenResearch";case"local_job":return ST();case"tinker_job":return"Tinker";default:return e||"—"}}function vlt({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),h.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),h.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-0.576-.393-.394-1.023-.089-0.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-0.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),h.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),h.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),h.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-0.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-0.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),h.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-0.573.534-.375-.677-1.405-2.416-1.94-2.751-0.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-0.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-0.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-0.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-0.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-0.522z",fill:"#FFD21E"})]})}function xlt({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[h.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),h.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),h.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),h.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),h.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),h.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),h.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),h.jsxs("defs",{children:[h.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),h.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#BFF9B4"}),h.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),h.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[h.jsx("stop",{stopColor:"#80EE64"}),h.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),h.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),h.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),h.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),h.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),h.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function ylt({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:h.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-0.5-.623h-.804l-0.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-0.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-0.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-0.52.123-.736-.172-.216-0.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-0.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-0.555-0.5-0.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-0.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-0.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-0.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function wlt({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#028CF0","aria-hidden":"true",children:h.jsx("path",{d:"M16.153 12.826c-.63-.183-1.03.15-1.378.846-0.58 1.13-1.643 1.644-2.888 1.594-1.245-.05-2.257-.63-2.788-1.776-.233-.498-.498-.664-1.046-.68-.93-.017-1.643.016-2.174 1.062-.631 1.261-2.258 1.693-3.619 1.261a3.234 3.234 0 0 1-2.257-3.22 3.198 3.198 0 0 1 2.29-3.02 3.276 3.276 0 0 1 3.702 1.327c.216.315.216.863.597.93.648.1 1.328.033 1.992.033.299 0 .316-.266.399-.465.58-1.295 1.61-1.959 2.987-1.975 1.361-.017 2.39.647 2.955 1.892.215.465.48.598.946.548.166-.017.332.016.498 0 .464-.083 1.062.282 1.344-.448.282-.73-.382-.913-.68-1.245-.847-.946-1.81-1.793-2.673-2.706-.415-.465-.763-.614-1.41-.415-1.876.614-3.619-.431-4.15-2.357-.448-1.676.714-3.535 2.44-3.917a3.293 3.293 0 0 1 3.95 2.457c.017.05.017.083.033.133.117.564.117 1.145-.132 1.626-.283.531-.133.83.249 1.195a152.61 152.61 0 0 1 3.286 3.27c.299.299.498.349.913.2 1.51-0.565 2.97-.1 3.884 1.161a3.266 3.266 0 0 1-.067 3.801c-.896 1.195-2.357 1.643-3.834 1.079-.381-.15-0.58-.1-.846.182a163.619 163.619 0 0 1-3.403 3.386c-.299.3-.415.532-.232.98a3.198 3.198 0 0 1-1.278 3.917A3.298 3.298 0 0 1 9.646 23c-1.062-1.062-1.228-2.688-.415-4.033a3.196 3.196 0 0 1 3.835-1.294c.498.182.78.083 1.145-.283 1.012-1.045 2.058-2.058 3.087-3.103.266-.266.68-.449.432-1.03-.233-0.547-.631-.414-1.03-.431zM11.97 4.942c.913.016 1.643-.714 1.66-1.627v-.05a1.646 1.646 0 0 0-1.76-1.56 1.63 1.63 0 0 0-1.543 1.527 1.638 1.638 0 0 0 1.577 1.71zm.033 5.41a1.658 1.658 0 0 0-1.676 1.61v.084a1.73 1.73 0 0 0 1.643 1.66c.847.016 1.643-.78 1.677-1.627a1.648 1.648 0 0 0-1.577-1.71c-.017-.016-.05-.016-.067-.016zm7.088 1.694c.016.896.747 1.61 1.626 1.643a1.723 1.723 0 0 0 1.66-1.726 1.666 1.666 0 0 0-1.66-1.61 1.623 1.623 0 0 0-1.643 1.577c.017.05.017.083.017.116zM3.24 10.353a1.692 1.692 0 0 0-1.66 1.626c-.017.847.863 1.727 1.693 1.71a1.687 1.687 0 0 0 1.626-1.743 1.615 1.615 0 0 0-1.643-1.593Zm8.68 12c.98.033 1.71-.647 1.727-1.593a1.646 1.646 0 0 0-1.51-1.793 1.646 1.646 0 0 0-1.793 1.51v.233a1.609 1.609 0 0 0 1.543 1.66c0-.017.017-.017.033-.017z"})})}function Slt({size:e=16}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100","aria-hidden":"true",children:[h.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),h.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]})}function klt({size:e=16}){return h.jsx("img",{className:"tinker-logo block flex-none object-contain",src:glt,width:e,height:e,style:{transform:e>=48?`translateX(${Math.round(e*.18)}px) scale(1.65)`:"scale(1.22)"},alt:"","aria-hidden":"true"})}function Clt({size:e=16}){return h.jsx("img",{className:"block flex-none object-contain",src:mlt,width:e,height:e,alt:"","aria-hidden":"true"})}function Kg({size:e=16}){return h.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:h.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-0.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-0.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})})}function Q_({kind:e,size:n=16}){switch(e){case"modal_job":return h.jsx(xlt,{size:n});case"hf_job":return h.jsx(vlt,{size:n});case"k8s_job":return h.jsx(ylt,{size:n});case"ssh_job":return h.jsx(WC,{size:n,strokeWidth:1.5});case"slurm_job":return h.jsx(Clt,{size:n});case"ray_job":return h.jsx(wlt,{size:n});case"openresearch_job":return h.jsx(Slt,{size:n});case"tinker_job":return h.jsx(klt,{size:n});case"local_job":return h.jsx(pot,{size:n,strokeWidth:1.5});default:return h.jsx(WC,{size:n})}}function R4({backend:e}){const n=i4(e),t=Trt(e);return n?h.jsxs("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted",children:[h.jsx(Q_,{kind:n}),h.jsx("span",{className:"backend-name",children:blt(n)}),t&&h.jsx("span",{className:"backend-detail text-sm",children:t})]}):h.jsx("span",{className:"backend-badge inline-flex items-center gap-[7px] [&_svg]:flex-none [&_svg]:block [&_.backend-name]:font-medium [&_.backend-detail]:text-muted [&.muted]:text-muted muted text-muted",children:"—"})}function mx(e,n){const t=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return(n?t.slice(0,n):t)||"research-project"}function Elt(e){const t=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(t)?t:null}function Nlt(e){const n=e==null?void 0:e.trim().match(/github\.com[/:]([^/]+)\/([^/?#]+)/i);return n?{owner:n[1],repo:n[2].replace(/\.git$/,"")}:null}function zlt(e){return e.trim().replace(/^https?:\/\//i,"").replace(/^git@([^:]+):/i,"$1/").replace(/\.git$/i,"").replace(/\/$/,"")}function jlt({onCreated:e,onCancel:n,remote:t=!1}){const[r,s]=T.useState("blank"),[i,a]=T.useState(""),[o,c]=T.useState(!1),[u,_]=T.useState(""),[f,p]=T.useState(!1),[m,x]=T.useState(null),[S,b]=T.useState(null),[v,y]=T.useState(!1),[w,C]=T.useState(!1),[z,E]=T.useState(!1),[R,N]=T.useState(null),[M,O]=T.useState(!1),[I,H]=T.useState(!1),[U,F]=T.useState(void 0),[Y,q]=T.useState("research-project"),[Q,Z]=T.useState(null),[B,D]=T.useState(!1),[P,X]=T.useState(!1),[W,ie]=T.useState(""),[le,ae]=T.useState(null),[se,G]=T.useState([]),[oe,ce]=T.useState(!1),[pe,ue]=T.useState(""),[Ee,Te]=T.useState(0),Ie=T.useRef(0),Le=T.useRef(0),He=T.useRef(0),Tt=T.useRef({blank:{name:"",nameTouched:!1,path:"",pathTouched:!1},folder:{name:"",nameTouched:!1,path:"",pathTouched:!1},paper:{name:"",nameTouched:!1,path:"",pathTouched:!1}}),Et=r==="paper"?Nlt(le==null?void 0:le.repoUrl):null,Vt=i.trim()?`~/OpenResearch/${mx(i,48)}`:"",$t=`~/OpenResearch/${mx(i||(le==null?void 0:le.title)||(le==null?void 0:le.paperId)||"")}`,rt=r==="blank"&&!f?Vt:r==="paper"&&le&&!f?$t:u,nt=Et??(r==="folder"&&(m!=null&&m.githubOwner)&&m.githubRepo?{owner:m.githubOwner,repo:m.githubRepo}:null);T.useEffect(()=>{qtt().then(({login:Ge})=>F(Ge)).catch(()=>F(null)),s4().then(Ge=>H(Ge.githubForNewProjects)).catch(()=>{})},[]),T.useEffect(()=>{let Ge=!0;D(!0);const at=setTimeout(()=>{Gtt(i.trim()).then(({repo:rn})=>Ge&&q(rn)).catch(()=>Ge&&q(mx(i,48))).finally(()=>Ge&&D(!1))},150);return()=>{Ge=!1,clearTimeout(at)}},[i]),T.useEffect(()=>{let Ge=!0;if(Z(null),X(!!nt),!!nt)return Vtt(nt.owner,nt.repo).then(({canPush:at})=>{Ge&&at&&Z(`github.com/${nt.owner}/${nt.repo}`)}).catch(()=>{}).finally(()=>Ge&&X(!1)),()=>{Ge=!1}},[nt==null?void 0:nt.owner,nt==null?void 0:nt.repo]),T.useEffect(()=>{const Ge=++Le.current,at=rt.trim();if(!at){x(null),b(null),y(!1);return}y(!0),b(null);const rn=setTimeout(()=>{xA(at).then(Nt=>{Ge===Le.current&&x(Nt)}).catch(Nt=>{Ge===Le.current&&(x(null),b(Nt instanceof Error?Nt.message:String(Nt)))}).finally(()=>{Ge===Le.current&&y(!1)})},200);return()=>clearTimeout(rn)},[r,Ee,rt]),T.useEffect(()=>{const Ge=++Ie.current;if(r!=="paper"||le){ce(!1);return}const at=W.trim(),rn=Elt(at);if(!rn&&at.length<3){G([]),ue(""),ce(!1);return}N(null),ce(!0),G([]),ue("");const Nt=setTimeout(()=>{if(rn){qy(rn).then(on=>{var Qe;Ge===Ie.current&&(ae(on),o||a(((Qe=on.title)==null?void 0:Qe.trim())||on.paperId))}).catch(on=>Ge===Ie.current&&N(on instanceof Error?on.message:String(on))).finally(()=>Ge===Ie.current&&ce(!1));return}yA(at).then(on=>{Ge===Ie.current&&(G(on),ue(at))}).catch(on=>Ge===Ie.current&&N(on instanceof Error?on.message:String(on))).finally(()=>Ge===Ie.current&&ce(!1))},350);return()=>clearTimeout(Nt)},[r,le,W,o]);async function ut(Ge){var rn;const at=++Ie.current;ce(!0),N(null);try{const Nt=await qy(Ge);if(at!==Ie.current)return;ae(Nt),G([]),o||a(((rn=Nt.title)==null?void 0:rn.trim())||Nt.paperId)}catch(Nt){at===Ie.current&&N(Nt instanceof Error?Nt.message:String(Nt))}finally{at===Ie.current&&ce(!1)}}function pt(){Ie.current+=1,He.current+=1,ae(null),ie(""),G([]),ue(""),ce(!1),C(!1),_(""),p(!1),Tt.current.paper={name:o?i:"",nameTouched:o,path:"",pathTouched:!1},o||a("")}function ve(Ge){if(Ge===r)return;Ie.current+=1,He.current+=1,Tt.current[r]={name:i,nameTouched:o,path:u,pathTouched:f};const at=Tt.current[Ge];s(Ge),N(null),b(null),x(null),ce(!1),C(!1),a(at.name),c(at.nameTouched),_(at.path),p(at.pathTouched)}async function Oe(){if(w)return;const Ge=++He.current;C(!0),N(null);try{const at=await Ftt();if(Ge!==He.current||!at)return;if(p(!0),x(null),y(!0),_(at),Te(rn=>rn+1),r==="folder"&&!o){const rn=at.replace(/[\\/]+$/,"").split(/[\\/]/).pop();rn&&a(rn)}}catch(at){Ge===He.current&&N(at instanceof Error?at.message:String(at))}finally{Ge===He.current&&C(!1)}}async function Je(Ge){if(Ge.preventDefault(),!!Wn){E(!0),N(null);try{const at=await Utt({name:i.trim(),path:rt.trim(),createFolder:r!=="folder",requireNewFolder:r==="blank",initializeGit:!0,githubSyncEnabled:I,locale:j(),...r==="paper"&&le?{paperId:le.paperId,cloneUrl:le.repoUrl??void 0}:{}});e(at.project,at.githubPublicationError)}catch(at){N(at instanceof Error?at.message:String(at))}finally{E(!1)}}}const ft=i.trim(),mt=r==="paper"&&le&&!le.repoUrl?le.paperId:null,Ht=r==="folder"&&(m==null?void 0:m.gitState)==="ready"?m.resolvedPath??null:null,Fe=ft!==""&&(r==="blank"||mt!==null||Ht!==null);T.useEffect(()=>{if(!Fe)return;const Ge=window.setTimeout(()=>{Wtt({name:ft,paperId:mt??void 0,path:Ht??void 0,locale:j()}).catch(()=>{})},1200);return()=>window.clearTimeout(Ge)},[Fe,ft,mt,Ht]);const Pt=(m==null?void 0:m.gitVersion)===null,Jt=r==="folder"&&!!rt.trim()&&m!==null&&m.exists===!1,nn=r==="blank"&&(m==null?void 0:m.exists)===!0,Lt=!!rt.trim()&&(m==null?void 0:m.exists)===!0&&m.directory===!1,Rn=r==="paper"&&!!(le!=null&&le.repoUrl)&&(m==null?void 0:m.empty)===!1,Kt=r==="paper"&&!!le&&!(le!=null&&le.repoUrl)&&(m==null?void 0:m.empty)===!1,Gn=r==="folder"&&((m==null?void 0:m.gitState)==="detached"||(m==null?void 0:m.gitState)==="invalid"),cr=f&&!rt.trim()||Lt||Rn||Kt,vn=f&&!rt.trim()||Lt||nn,wr=f&&!rt.trim()?H8():Lt?I8():nn?h2e():null,Qn=f&&!rt.trim()?H8():Lt?I8():Rn?l4e():Kt?Lye():null,Wn=!!(i.trim()&&rt.trim())&&!z&&!w&&!v&&m!==null&&!S&&!Pt&&!Jt&&!nn&&!Lt&&!Rn&&!Kt&&!Gn&&(r!=="paper"||!!le)&&(!I||typeof U=="string"&&!B&&!P),Mn=Q??`github.com/${U??"you"}/${Y}`,gt=U===void 0||B||P,an=r==="paper"&&!le&&W.trim().length>=3&&pe===W.trim()&&!oe&&se.length===0&&!R;return h.jsxs("form",{className:"form [&_.form-seg]:self-start [&_.form-seg]:mb-0.5 [&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3 [&_.repo-hint]:font-normal [&_.repo-hint]:text-sm [&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal [&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center [&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full [&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5 [&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background [&_.folder-picker-control]:border [&_.folder-picker-control]:border-border [&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer [&_.folder-picker-control]:text-start [&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard [&_.folder-picker-control:hover:not(:disabled)]:border-muted [&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle [&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text [&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1 [&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden [&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap [&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none [&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none [&_.folder-picker-chevron]:text-muted [&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext [&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm [&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4] [&_.project-location-field]:flex [&_.project-location-field]:flex-col [&_.project-location-field]:gap-2 [&_.project-location-label]:text-text [&_.project-location-label]:text-base [&_.project-location-label]:font-medium [&_.project-field-label]:text-text [&_.project-field-label]:text-base [&_.project-field-label]:font-medium [&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65 [&_.paper-destination]:flex [&_.paper-destination]:items-center [&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3 [&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md [&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1 [&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden [&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm [&_.paper-destination_code]:font-normal [&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap [&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px] [&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant [&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface [&_.project-path-notice]:text-subtext [&_.project-path-notice]:text-sm [&_.project-path-notice]:leading-[1.4] [&_.project-path-notice.error]:border-danger-notice-border [&_.paper-results]:flex [&_.paper-results]:flex-col [&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md [&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto [&_.paper-results_button]:flex [&_.paper-results_button]:flex-col [&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5 [&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent [&_.paper-results_button]:border-0 [&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant [&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit] [&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer [&_.paper-results_button:last-child]:border-b-0 [&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm [&_.paper-results_.title]:font-medium [&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted [&_.paper-pick_.id]:text-xs [&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center [&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3 [&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md [&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0 [&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium flex flex-col [&_label]:flex [&_label]:flex-col [&_label]:gap-1 [&_label]:text-sm [&_label]:text-text [&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2 [&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end [&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start [&_.new-project-actions]:mt-2.5 [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap new-project-form gap-4.5 [&_>_label]:gap-2",onSubmit:Je,children:[h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default form-seg",children:[h.jsx("button",{type:"button",className:r==="blank"?"active":"","aria-pressed":r==="blank",onClick:()=>ve("blank"),children:g2e()}),h.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="paper"?"":" invisible"}`}),h.jsx("button",{type:"button",className:r==="folder"?"active":"","aria-pressed":r==="folder",onClick:()=>ve("folder"),children:P2e()}),h.jsx("span",{"aria-hidden":!0,className:`h-6 w-px bg-border${r==="blank"?"":" invisible"}`}),h.jsx("button",{type:"button",className:r==="paper"?"active":"","aria-pressed":r==="paper",onClick:()=>ve("paper"),children:K2e()})]}),r==="paper"&&!le&&h.jsxs("label",{className:"!font-normal",children:[gwe(),h.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:W,onChange:Ge=>{N(null),ue(""),ie(Ge.target.value)},placeholder:Nwe()}),!an&&h.jsx("span",{className:"repo-hint",children:oe?x4e():d4e()}),an&&h.jsx("span",{className:"project-path-notice block",children:iwe()}),se.length>0&&h.jsx("div",{className:"paper-results",children:se.map(Ge=>h.jsxs("button",{type:"button",onClick:()=>void ut(Ge.paperId),children:[h.jsx(__,{children:Ge.title}),h.jsx("span",{className:"id",children:Ge.paperId})]},Ge.paperId))})]}),le&&r==="paper"&&h.jsxs("div",{className:"paper-pick !flex-col !items-stretch",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2.5",children:[h.jsxs("div",{className:"meta",children:[h.jsx(__,{className:"block",children:le.title||le.paperId}),le.repoUrl&&h.jsx("div",{className:"id",children:zlt(le.repoUrl)})]}),h.jsx($e,{size:"small",type:"button","aria-label":j2e(),onClick:pt,children:C2e()})]}),!le.repoUrl&&h.jsxs("div",{className:"flex w-full flex-col items-start gap-1 rounded-md border border-border-variant bg-background px-[9px] py-1 text-sm font-normal text-subtext",children:[h.jsxs("span",{className:"flex items-center gap-[5px] text-sm",children:[h.jsx(SR,{size:16})," ",cwe()]}),h.jsx("span",{className:"text-sm font-normal text-accent-amber",children:hwe()})]})]}),(r!=="paper"||le)&&h.jsxs(h.Fragment,{children:[r==="blank"&&h.jsxs("label",{className:"!font-normal",children:[h.jsx("span",{className:"project-field-label !font-medium",children:P8()}),h.jsx("input",{className:"text-sm font-normal","data-initial-focus":!0,value:i,onChange:Ge=>{c(!0),a(Ge.target.value)},placeholder:$8()})]}),r==="paper"?h.jsxs("label",{className:"project-location-field",children:[h.jsx("span",{className:"project-location-label !font-medium",children:le!=null&&le.repoUrl?Yye():sx()}),h.jsx("input",{className:"text-sm font-normal",value:rt,onChange:Ge=>{p(!0),x(null),_(Ge.target.value)},"aria-describedby":cr?"paper-destination-description":void 0,placeholder:"~/OpenResearch/paper-title",spellCheck:!1}),v&&h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:B8()}),cr&&h.jsx("span",{id:"paper-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:Qn})]}):r==="folder"&&!t?h.jsxs("button",{"data-initial-focus":!0,type:"button",className:"folder-picker-control","aria-label":u?Bye({path:ze(u)}):D8(),disabled:w,title:u||void 0,onClick:()=>void Oe(),children:[h.jsx(h_,{className:u?"folder-picker-icon":"folder-picker-icon placeholder",size:16}),h.jsx("span",{className:u?"text-sm":"placeholder",children:w?Gye():u||D8()}),h.jsx(co,{className:"folder-picker-chevron",size:15})]}):r==="folder"?h.jsxs("label",{className:"project-location-field",children:[h.jsx("span",{className:"project-location-label !font-medium",children:sx()}),h.jsx("input",{"data-initial-focus":!0,className:"text-sm font-normal",value:u,onChange:Ge=>{p(!0),x(null),_(Ge.target.value)},placeholder:"/home/user/project",spellCheck:!1,dir:"ltr"})]}):i.trim()?h.jsxs("label",{className:"project-location-field",children:[h.jsx("span",{className:"project-location-label !font-medium",children:sx()}),h.jsx("input",{className:"text-sm font-normal",value:rt,onChange:Ge=>{p(!0),x(null),_(Ge.target.value)},placeholder:"~/OpenResearch/my-research","aria-describedby":vn?"blank-destination-description":void 0,spellCheck:!1}),v&&h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:B8()}),vn&&h.jsx("span",{id:"blank-destination-description",className:"folder-picker-hint error !text-accent-red",role:"alert",children:wr})]}):null,r!=="blank"&&rt&&h.jsxs("label",{className:"!font-normal",children:[h.jsx("span",{className:"project-field-label !font-medium",children:P8()}),h.jsx("input",{className:"text-sm font-normal",value:i,onChange:Ge=>{c(!0),a(Ge.target.value)},placeholder:$8()})]}),Pt&&h.jsx("div",{className:"project-path-notice error",children:Q2e()}),!Pt&&r==="folder"&&u.trim()&&!v&&(m==null?void 0:m.exists)===!1&&h.jsx("div",{className:"project-path-notice error",children:Dwe()}),!Pt&&r==="folder"&&u.trim()&&!v&&Lt&&h.jsx("div",{className:"project-path-notice error",children:Uwe()}),!Pt&&r==="folder"&&!v&&(m==null?void 0:m.gitState)==="detached"&&h.jsx("div",{className:"project-path-notice error",children:M2e()}),!Pt&&r==="folder"&&!v&&(m==null?void 0:m.gitState)==="invalid"&&h.jsx("div",{className:"project-path-notice error",children:$we()}),S&&h.jsx("div",{className:"project-path-notice error",role:"alert",children:S})]}),R&&h.jsx("div",{className:"error",role:"alert",children:R}),(r!=="paper"||le)&&rt&&(r!=="blank"||i.trim())&&h.jsxs("div",{className:"flex w-full flex-col items-start gap-2",children:[h.jsxs("button",{type:"button",className:`inline-flex items-center gap-1 text-sm font-medium${I&&U===null?" text-accent-red":" text-text"}`,"aria-expanded":M,"aria-controls":"new-project-advanced-settings",onClick:()=>O(Ge=>!Ge),children:[I?U===null?Eye():Tye():wye(),h.jsx(lo,{className:M?"rotate-180":"",size:16})]}),M&&h.jsxs("label",{id:"new-project-advanced-settings",className:"flex w-full flex-col items-stretch gap-[7px] font-normal",children:[h.jsxs("span",{className:"flex flex-row items-center gap-[9px]",children:[h.jsx("input",{className:"m-0",type:"checkbox",checked:I,onChange:Ge=>H(Ge.target.checked),disabled:z}),h.jsx("strong",{className:"text-base font-medium leading-[1.3] text-text",children:Awe()})]}),h.jsxs("span",{className:"flex flex-col gap-[3px] font-sans text-sm font-normal leading-[1.4] text-subtext",children:[h.jsx("span",{children:gt?Wwe({repository:ze(Mn)}):Q?t4e({repository:ze(Mn)}):Zwe({repository:ze(Mn)})}),h.jsx("span",{children:q2e()}),U===null&&h.jsx("span",{children:m4e({command:ze("gh auth login")})})]})]})]}),h.jsxs("div",{className:"actions new-project-actions",children:[n&&h.jsx($e,{type:"button",onClick:n,children:y2e()}),h.jsx($e,{variant:"primary",className:"ms-auto",disabled:!Wn,children:z?a2e():r==="paper"?le!=null&&le.repoUrl?Jye():O8():r==="folder"?k4e():O8()})]})]})}function IR({onClose:e,onCreated:n,remote:t=!1}){const r=T.useRef(null),s=T.useRef(e);return s.current=e,T.useEffect(()=>{const i=r.current;if(!i)return;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,o=()=>[...i.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(i.querySelector("[data-initial-focus]")??o()[0]??i).focus();const c=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),s.current();return}if(u.key==="Enter"&&(u.metaKey||u.ctrlKey)&&!u.altKey&&u.shiftKey){u.preventDefault(),u.stopPropagation();return}if(u.key!=="Tab")return;const _=o();if(_.length===0){u.preventDefault(),i.focus();return}const f=_[0],p=_[_.length-1];u.shiftKey&&document.activeElement===f?(u.preventDefault(),p.focus()):!u.shiftKey&&document.activeElement===p&&(u.preventDefault(),f.focus())};return document.addEventListener("keydown",c,!0),()=>{document.removeEventListener("keydown",c,!0),a==null||a.focus()}},[]),h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-start justify-center p-5 [--new-project-modal-top:clamp(4rem,20vh,24rem)] pt-[var(--new-project-modal-top)] overflow-y-auto z-100",onClick:i=>{i.target===i.currentTarget&&e()},children:h.jsxs("div",{ref:r,className:"modal w-120 max-w-full max-h-[calc(100vh_-_var(--new-project-modal-top)_-_1.25rem)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl [&_h2]:font-medium",role:"dialog","aria-modal":"true","aria-labelledby":"new-project-dialog-title",tabIndex:-1,children:[h.jsx("h2",{id:"new-project-dialog-title",children:OT()}),h.jsx(jlt,{onCancel:e,onCreated:n,remote:t})]})})}function Tlt({project:e,deleting:n,error:t,onClose:r,onConfirm:s}){const i=T.useRef(null),a=T.useRef(r),o=T.useRef(n);a.current=r,o.current=n,T.useEffect(()=>{const u=i.current;if(!u)return;const _=document.activeElement instanceof HTMLElement?document.activeElement:null,f=()=>[...u.querySelectorAll('button:not([disabled]), [tabindex]:not([tabindex="-1"])')];(f()[0]??u).focus();const p=m=>{if(m.key==="Escape"){m.preventDefault(),o.current||a.current();return}if(m.key!=="Tab")return;const x=f();if(x.length===0){m.preventDefault(),u.focus();return}const S=x[0],b=x[x.length-1];m.shiftKey&&document.activeElement===S?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),S.focus())};return document.addEventListener("keydown",p,!0),()=>{document.removeEventListener("keydown",p,!0),_==null||_.focus()}},[]);const c=!!(e.githubEnabled&&(e.githubUrl||e.githubOwner&&e.githubRepo));return h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop flex items-center justify-center p-5 overflow-y-auto z-100",onClick:u=>{!n&&u.target===u.currentTarget&&r()},children:h.jsxs("div",{ref:i,className:"modal w-110 max-w-full bg-background border border-border rounded-xl shadow-modal p-6",role:"dialog","aria-modal":"true","aria-labelledby":"delete-project-dialog-title","aria-describedby":"delete-project-dialog-description",tabIndex:-1,children:[h.jsx("h2",{id:"delete-project-dialog-title",className:"mt-0 mb-3 text-xl",children:mCe()}),h.jsxs("div",{id:"delete-project-dialog-description",className:"flex flex-col gap-2 text-sm leading-normal text-subtext",children:[h.jsx("p",{className:"m-0",children:Z8e({name:Ja(e.name)})}),h.jsx("p",{className:"m-0",children:c?ACe():DCe()}),t&&h.jsx("p",{className:"m-0 text-accent-red",role:"alert",children:t})]}),h.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[h.jsx($e,{disabled:n,onClick:r,children:lCe()}),h.jsx($e,{variant:"danger",disabled:n,onClick:s,children:n?kCe():xCe()})]})]})})}function QC(){return h.jsx("span",{className:"activity-pulse h-2 w-2 shrink-0 rounded-full bg-accent-teal animate-[or-pulse_1.2s_ease-in-out_infinite]"})}function Alt({projects:e,onOpen:n,onCreated:t,onDeleted:r,remote:s=!1}){const[i,a]=T.useState(!1),[o,c]=T.useState(null),[u,_]=T.useState(null),[f,p]=T.useState(null),[m,x]=T.useState({}),S=T.useRef(0),b=e.map(y=>y.id).join("\0");T.useEffect(()=>{let y=!0,w=null;const C=()=>{w=null;const R=++S.current;Btt().then(N=>{!y||R!==S.current||x(Object.fromEntries(N.map(M=>[M.projectId,M])))}).catch(()=>{})},z=()=>{w===null&&(w=setTimeout(C,100))};C();const E=Yit(z);return()=>{y=!1,E(),w!==null&&clearTimeout(w)}},[b]);async function v(y){c(y.id),_(null);try{await Xtt(y.id),_(null),p(null),r(y.id)}catch(w){_(w instanceof Error?w.message:String(w))}finally{c(null)}}return h.jsxs("div",{className:"home flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges] bg-canvas",children:[h.jsxs("div",{className:"home-inner max-w-290 my-0 mx-auto pt-12 px-6 pb-16 [@media((max-width:_960px))]:pt-6 [@media((max-width:_960px))]:px-4",children:[h.jsxs("div",{className:"home-head flex items-center justify-between gap-3 mb-4.5 [&_h2]:m-0 [&_h2]:text-4xl [&_h2]:tracking-[-0.02em] [@media((max-width:_520px))]:items-start [@media((max-width:_520px))]:flex-col",children:[h.jsx("h2",{children:XCe()}),h.jsxs($e,{onClick:()=>a(!0),children:[h.jsx(z4,{size:15})," ",OT()]})]}),h.jsx("div",{className:"home-list overflow-hidden rounded-lg border border-border bg-background",children:h.jsxs("div",{children:[h.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border bg-background py-2.5 ps-4 pe-2 text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:hidden",children:[h.jsx("span",{children:VCe()}),h.jsx("span",{children:Y8()}),h.jsx("span",{children:X8()}),h.jsx("span",{children:Z8()})]}),e.length===0?h.jsx("div",{className:"py-8 px-4 text-sm text-muted",children:FCe()}):[...e].sort((y,w)=>{var E,R;const C=((E=m[y.id])==null?void 0:E.lastMessageAt)??y.createdAt;return(((R=m[w.id])==null?void 0:R.lastMessageAt)??w.createdAt)-C||y.name.localeCompare(w.name)}).map(y=>{const w=m[y.id],C=y.githubEnabled?y.githubUrl??(y.githubOwner&&y.githubRepo?`https://github.com/${y.githubOwner}/${y.githubRepo}`:null):null,z=C?y.githubOwner&&y.githubRepo?`${y.githubOwner}/${y.githubRepo}`:C.replace(/^https?:\/\/github\.com\//,"").replace(/\.git$/,"").replace(/\/$/,""):IT(),E=w?w.activeAgents>0?U8e({count:Xt(w.activeAgents)}):r9e():"—",R=w?w.totalAgents===1?u9e():W8e({count:Xt(w.totalAgents)}):"—",N=w?w.runningExperiments>0?_9e({count:Xt(w.runningExperiments)}):w.totalExperiments===0?Zw():Q8({count:Xt(w.totalExperiments)}):"—",M=w&&w.runningExperiments>0?Q8({count:Xt(w.totalExperiments)}):null;return h.jsxs("div",{className:"group project-row relative grid cursor-pointer grid-cols-[minmax(0,1fr)_9rem_9rem_minmax(18rem,max-content)] items-center gap-3 border-b border-border-variant py-4 ps-4 pe-2 text-start transition-colors duration-120 ease-standard last:border-b-0 hover:bg-surface-bright focus-within:bg-surface-bright [@media((max-width:_960px))]:grid-cols-[minmax(0,0.8fr)_minmax(0,0.8fr)_minmax(0,1.4fr)] [@media((max-width:_960px))]:items-start [@media((max-width:_960px))]:gap-x-4 [@media((max-width:_960px))]:gap-y-3 [@media((max-width:_960px))]:py-4 [@media((max-width:_960px))]:px-4 [@media((max-width:_600px))]:grid-cols-2",children:[h.jsx("button",{className:"project-row-open absolute inset-0 z-0 cursor-pointer rounded-[inherit] focus-visible:outline focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-[-2px]","aria-label":fq({name:Ja(y.name)}),onClick:()=>n(y.id)}),h.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none [@media((max-width:_960px))]:col-span-3 [@media((max-width:_600px))]:col-span-2",children:[h.jsx("span",{dir:"auto",className:"project-row-title whitespace-normal break-words text-base font-semibold text-text pointer-events-none",children:y.name}),h.jsxs("span",{className:"relative z-2 flex items-center gap-1.5 text-xs text-muted [@media((max-width:_960px))]:flex-wrap",children:[h.jsxs("span",{children:[dCe()," ",no(y.createdAt)]}),y.paperId&&h.jsx("span",{"aria-hidden":"true",children:"·"}),y.paperId&&h.jsxs("span",{children:[sCe()," ",ze(y.paperId)]}),h.jsx("button",{className:"project-row-secondary project-row-delete inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-sm leading-0 text-muted opacity-0 pointer-events-none transition-opacity hover:bg-surface hover:text-accent-red group-hover:opacity-100 group-hover:pointer-events-auto group-focus-within:opacity-100 group-focus-within:pointer-events-auto focus:opacity-100 focus:pointer-events-auto focus-visible:outline focus-visible:outline-2 focus-visible:outline-text","aria-label":Iy({name:Ja(y.name)}),disabled:o===y.id,onClick:O=>{O.stopPropagation(),_(null),p(y)},children:h.jsx(kd,{size:14})})]})]}),h.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[h.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:Y8()}),h.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[w&&w.activeAgents>0&&h.jsx(QC,{}),E]}),h.jsx("span",{className:"text-xs text-muted",children:R})]}),h.jsxs("div",{className:"relative z-1 flex min-w-0 flex-col gap-1 pointer-events-none",children:[h.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:block",children:X8()}),h.jsxs("span",{className:"inline-flex items-center gap-2 text-sm text-text",children:[w&&w.runningExperiments>0&&h.jsx(QC,{}),N]}),M&&h.jsx("span",{className:"text-xs text-muted",children:M})]}),h.jsxs("div",{className:"relative z-1 min-w-0 pointer-events-none [@media((max-width:_600px))]:col-span-2",children:[h.jsx("span",{className:"hidden text-xs font-medium tracking-[0.06em] text-text uppercase [@media((max-width:_960px))]:mb-1 [@media((max-width:_960px))]:block",children:Z8()}),C?h.jsxs("a",{className:"project-row-secondary inline-flex max-w-full items-center gap-2 text-sm text-text no-underline pointer-events-auto hover:underline underline-offset-2",href:C,target:"_blank",rel:"noreferrer","aria-label":Um({name:Ja(y.name)}),children:[h.jsx("span",{className:"inline-flex shrink-0",children:h.jsx(Kg,{size:14})}),h.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap [@media((max-width:_960px))]:whitespace-normal [@media((max-width:_960px))]:break-all",children:ze(z)})]}):h.jsx("span",{className:"text-sm text-text pointer-events-none",children:z})]})]},y.id)})]})})]}),i&&h.jsx(IR,{remote:s,onClose:()=>a(!1),onCreated:(y,w)=>{a(!1),t(y,w)}}),f&&h.jsx(Tlt,{project:f,deleting:o===f.id,error:u,onClose:()=>{_(null),p(null)},onConfirm:()=>void v(f)})]})}function BR(){const e=T.useSyncExternalStore(Jit,UC,UC);return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:e?"":$y()}),!e&&h.jsxs("div",{className:"offline-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-accent-amber-subtle border-b border-b-accent-amber","aria-hidden":!0,children:[h.jsx(SR,{size:13,className:"shrink-0 text-accent-amber"}),h.jsx("span",{dir:"auto",className:"min-w-0",children:$y()})]})]})}const $R=["model-group flex items-center justify-between gap-2","text-sm font-medium text-text pt-2.5 px-2 pb-1.5"].join(" "),JC=["model-more [&_code]:font-mono [&_code]:text-xs","[&_code]:bg-panel [&_code]:border [&_code]:border-border-variant","[&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap","pt-1 px-2 pb-2 text-sm text-muted"].join(" "),Bh={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function Rlt(e){var r,s;const n=e.find(i=>i.agentReady);if(!n)return null;const t=((r=n.models[0])==null?void 0:r.id)??null;return{harness:n.id,model:t,serviceTier:Km(n,t,null),permissionMode:((s=n.options)==null?void 0:s.defaultPermissionMode)??null,reasoningLevel:$g(n,t).defaultId}}function Ea(e){const[n,t]=T.useState(!1),r=T.useRef(null);return T.useEffect(()=>{if(!n)return;const s=a=>{var o,c;a.target instanceof Node&&!((o=r.current)!=null&&o.contains(a.target))&&!((c=e==null?void 0:e.current)!=null&&c.contains(a.target))&&t(!1)},i=a=>{var o;a.key==="Escape"&&(a.preventDefault(),a.stopPropagation(),t(!1),(o=e==null?void 0:e.current)==null||o.focus())};return document.addEventListener("mousedown",s,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("mousedown",s,!0),document.removeEventListener("keydown",i,!0)}},[n,e]),{open:n,setOpen:t,ref:r}}function Mlt({value:e,onSelect:n,permissionChoices:t=[],defaultPermissionId:r,onSelectPermission:s,reasoningChoices:i=[],defaultReasoningId:a,onSelectReasoning:o,onHarnesses:c,lockHarness:u=!1,className:_}){var ae,se,G,oe,ce,pe;const[f,p]=T.useState([]),m=T.useRef(null),x=T.useRef(null),{open:S,setOpen:b,ref:v}=Ea(m),[y,w]=T.useState(""),[C,z]=T.useState("root"),E=()=>{b(!1),z("root"),w("")};T.useEffect(()=>{var ue;S&&(C==="reasoning"||C==="speed"||C==="permissions")&&((ue=x.current)==null||ue.focus())},[S,C]),T.useEffect(()=>{let ue=!0;const Ee=(Ie=!1)=>Ym(Ie).then(Le=>{ue&&(p(Le),c==null||c(Le))}).catch(()=>{});Ee();const Te=y4(()=>void Ee(!0));return()=>{ue=!1,Te()}},[]);const R=T.useMemo(()=>{const ue=y.trim().toLowerCase();return(u&&e?f.filter(Te=>Te.id===e.harness):f).map(Te=>{let Ie=Te.models;return ue?Ie=Ie.filter(Le=>Le.id.toLowerCase().includes(ue)):Te.id==="opencode"&&(Ie=Ie.slice(0,6)),{harness:Te,models:Ie,hidden:ue?0:Te.models.length-Ie.length}})},[f,y,u,e]),N=(ue,Ee)=>{var Ie;const Te=(e==null?void 0:e.harness)===ue.id;n({harness:ue.id,model:Ee,serviceTier:Km(ue,Ee,Te?e==null?void 0:e.serviceTier:null),permissionMode:Te?e.permissionMode:((Ie=ue.options)==null?void 0:Ie.defaultPermissionMode)??null,reasoningLevel:DA(ue,Ee,Te?e.reasoningLevel:null)}),E()},M=(e==null?void 0:e.model)!=null?(ae=f.find(ue=>ue.id===e.harness))==null?void 0:ae.models.find(ue=>ue.id===e.model):void 0,O=e?e.model?M?Vm(M):OA(e.model):R8():rx(),I=(e==null?void 0:e.reasoningLevel)??a??((se=i[0])==null?void 0:se.id),H=(G=i.find(ue=>ue.id===I))==null?void 0:G.label,U=(e==null?void 0:e.permissionMode)??r??((oe=t[0])==null?void 0:oe.id),F=(ce=t.find(ue=>ue.id===U))==null?void 0:ce.label,Y=(e==null?void 0:e.harness)==="opencode"?bye():Rxe(),q=f.find(ue=>ue.id===(e==null?void 0:e.harness)),Q=LA(q,e==null?void 0:e.model),Z=Km(q,e==null?void 0:e.model,e==null?void 0:e.serviceTier),B=(pe=Q.find(ue=>ue.id===Z))==null?void 0:pe.label,D=ue=>{o==null||o(ue),E()},P=ue=>{s==null||s(ue),E()},X=ue=>{e&&n({...e,serviceTier:ue}),E()},W=(ue,Ee,Te)=>h.jsxs("button",{type:"button",className:"model-root-row flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-start text-sm text-text hover:bg-surface","aria-haspopup":"menu",onClick:()=>z(Te),children:[h.jsx("span",{className:"flex-1",children:ue}),Ee&&h.jsx("span",{className:"max-w-36 truncate text-sm text-muted",children:Ee}),h.jsx(co,{size:14,className:"shrink-0 text-muted"})]}),ie=ue=>h.jsxs("button",{ref:x,type:"button",className:"model-submenu-header flex w-full items-center gap-2 border-0 border-b border-solid border-b-border-variant bg-transparent px-2 py-2 text-start text-sm font-medium text-text hover:bg-surface",onClick:()=>{z("root"),w("")},children:[h.jsx(wR,{size:15}),ue]}),le=(ue,Ee,Te,Ie)=>h.jsx("div",{className:"model-menu-list overflow-y-auto p-1.5",children:ue.map(Le=>h.jsxs(Er,{onClick:()=>Ie(Le.id),children:[h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[Le.label,Le.id===Te&&h.jsxs("span",{className:"font-normal text-muted",children:[" ",TT()]})]}),Le.description&&h.jsx("span",{className:"max-w-72 text-sm font-normal leading-snug text-muted",children:Le.description})]}),Le.id===Ee&&h.jsx(zi,{size:13})]},Le.id))});return h.jsxs("div",{className:"model-picker relative inline-flex min-w-0","data-onboarding":"model-picker",ref:v,children:[h.jsxs("button",{ref:m,type:"button",className:vs("composer-pill inline-flex h-8 min-w-0 max-w-full items-center gap-[5px] rounded-md px-2 text-sm text-text whitespace-nowrap transition-[background,color] duration-150 ease-standard hover:bg-surface",_),title:lU({label:`${O}${H?` · ${H}`:""}${B?` · ${B}`:""}`}),"aria-haspopup":"menu","aria-expanded":S,onClick:()=>{S?E():(z("root"),b(!0))},children:[Z==="priority"?h.jsx(alt,{size:14,fill:"currentColor","aria-hidden":"true"}):e!=null&&e.harness?h.jsx(l2,{harness:e.harness,size:14}):null,Z==="priority"&&h.jsxs("span",{className:"sr-only",children:[Oxe()," "]}),h.jsxs("span",{className:"model-picker-label min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:[O,H&&h.jsx("span",{className:"model-picker-reasoning ms-1 text-muted",children:H})]}),h.jsx(lo,{size:14,className:"shrink-0 text-muted"})]}),S&&h.jsxs("div",{className:"model-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-100 flex flex-col bg-background border border-border rounded-md shadow-dropdown z-50 overflow-hidden w-72 [&.align-right]:start-auto [&.align-right]:end-0 [&_input]:rounded-none [&_input]:border-0 [&_input]:border-b [&_input]:border-b-border-variant [&_input]:bg-none [&_input]:bg-transparent [&_input]:py-2 [&_input]:px-2.5 [&_input]:text-sm [&_input]:outline-none align-right",children:[C==="root"&&h.jsxs("div",{className:"model-root-menu p-1",children:[W(rx(),O,"models"),i.length>0&&W(Y,H,"reasoning"),Q.length>0&&W(L8(),B,"speed"),t.length>0&&W(M8(),F,"permissions")]}),C==="models"&&h.jsxs(h.Fragment,{children:[ie(rx()),h.jsx("input",{autoFocus:!0,type:"text",placeholder:eye(),value:y,onChange:ue=>w(ue.target.value)}),h.jsxs("div",{className:"model-menu-list overflow-y-auto p-1.5",children:[R.map(({harness:ue,models:Ee,hidden:Te})=>h.jsxs("div",{className:"[&_.model-item]:ps-6",children:[h.jsxs("div",{className:$R,children:[h.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[h.jsx(l2,{harness:ue.id,size:14}),ue.name]}),!ue.agentReady&&h.jsxs("span",{className:"model-group-status inline-flex items-center gap-1 text-accent-amber font-normal",children:[h.jsx(VC,{size:10})," ",rc()]})]}),ue.agentReady?h.jsxs(h.Fragment,{children:[ue.models.length===0&&h.jsxs(Er,{onClick:()=>N(ue,null),children:[h.jsxs("span",{children:[R8(),h.jsx("span",{className:"model-id",children:jT()})]}),(e==null?void 0:e.harness)===ue.id&&(e==null?void 0:e.model)===null&&h.jsx(zi,{size:13})]}),Ee.map(Ie=>h.jsxs(Er,{title:Ie.id,onClick:()=>N(ue,Ie.id),children:[h.jsx("span",{children:Vm(Ie)}),(e==null?void 0:e.harness)===ue.id&&(e==null?void 0:e.model)===Ie.id&&h.jsx(zi,{size:13})]},Ie.id)),Te>0&&h.jsx("div",{className:JC,children:Vxe({count:Xt(Te)})}),y.trim().length>0&&!ue.models.some(Ie=>Ie.id===y.trim())&&h.jsx(Er,{onClick:()=>N(ue,y.trim()),children:h.jsx("span",{children:_ye({id:ze(y.trim())})})})]}):h.jsx("div",{className:"model-more [&_code]:font-mono [&_code]:text-xs [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_code]:whitespace-nowrap pt-1 px-2 pb-2 text-sm text-muted model-unavailable leading-normal border-b border-b-border-variant",children:ue.agentNote?Z_(ue.agentNote):Xxe()})]},ue.id)),f.length===0&&h.jsx("div",{className:JC,children:zxe()})]}),u&&e&&f.length>1&&h.jsxs("div",{className:"model-locked-note flex items-center gap-1.5 py-[7px] px-3 text-sm text-muted border-t border-t-border-variant [&_svg]:shrink-0",children:[h.jsx(VC,{size:11}),sye()]})]}),C==="reasoning"&&h.jsxs(h.Fragment,{children:[ie(Y),le(i,I,a,D)]}),C==="permissions"&&h.jsxs(h.Fragment,{children:[ie(M8()),le(t,U,r,P)]}),C==="speed"&&h.jsxs(h.Fragment,{children:[ie(L8()),le(Q,Z??void 0,"default",X)]})]})]})}function m_({choices:e,value:n,defaultId:t,header:r,align:s="left",dropDown:i=!1,disabled:a=!1,variant:o="pill",title:c,numbered:u=!1,renderIcon:_,onSelect:f,className:p}){var R,N;const{open:m,setOpen:x,ref:S}=Ea();if(e.length===0)return null;const b=n??t??((R=e[0])==null?void 0:R.id)??null,v=e.find(M=>M.id===b),y=e.find(M=>M.id===t),w=o==="bare"&&(y==null?void 0:y.id)===Wm?y:void 0,C=w?e.filter(M=>M.id!==w.id):e,z=(v==null?void 0:v.label)??((N=e[0])==null?void 0:N.label)??"",E=M=>{f(M),x(!1)};return h.jsxs("div",{className:`option-picker relative inline-flex${o==="field"?" w-full":""}`,ref:S,children:[h.jsxs("button",{type:"button",className:vs(o==="field"?"inline-flex h-9 w-full items-center justify-between gap-2 rounded-md border border-border bg-background px-3 text-sm font-normal text-text transition-colors duration-120 ease-standard hover:bg-surface disabled:opacity-45":`inline-flex h-8 items-center rounded-md transition-[background,color] duration-150 ease-standard hover:bg-surface ${o==="pill"?"composer-pill gap-[5px] px-2 text-sm text-text whitespace-nowrap":"composer-bare gap-[3px] px-1 text-sm text-text"}`,p),title:c,"aria-haspopup":"menu","aria-expanded":m,disabled:a,onClick:()=>x(M=>!M),children:[h.jsxs("span",{className:"inline-flex min-w-0 items-center gap-2",children:[v&&(_==null?void 0:_(v)),h.jsx("span",{className:"truncate",children:z})]}),h.jsx(lo,{size:12})]}),m&&h.jsxs("div",{className:`option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 ${e.some(M=>M.description)?"min-w-80":""} ${o==="field"?"min-w-full":""} ${s==="right"?"align-right":""} ${i?"drop-down":""}`,children:[r&&h.jsx("div",{className:$R,children:r}),w&&h.jsxs(h.Fragment,{children:[h.jsxs(Er,{type:"button",onClick:()=>E(w.id),children:[h.jsxs("span",{className:"inline-flex items-center gap-2",children:[_==null?void 0:_(w),h.jsxs("span",{children:[w.label,h.jsx("span",{className:"option-default text-muted font-normal",children:jT()})]})]}),b===w.id&&h.jsx(zi,{size:13})]}),h.jsx("div",{className:"option-sep h-px my-[5px] mx-1 bg-border-variant"})]}),C.map((M,O)=>h.jsxs(Er,{type:"button",onClick:()=>E(M.id),children:[h.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[_==null?void 0:_(M),h.jsxs("span",{className:"flex min-w-0 flex-col items-start gap-0.5",children:[h.jsxs("span",{children:[M.label,!w&&M.id===t&&h.jsxs("span",{className:"option-default text-muted font-normal",children:[" ",TT()]})]}),M.description&&h.jsx("span",{className:"max-w-68 text-sm font-normal leading-snug text-muted",children:M.description})]})]}),b===M.id?h.jsx(zi,{size:13}):u&&h.jsx("span",{className:"option-num text-muted text-xs tabular-nums",children:O+1})]},M.id))]})]})}function c2({size:e=16,className:n}){return h.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",className:n,"aria-hidden":"true",children:[h.jsx("path",{d:"M3.14573 5.14704C3.34064 4.95221 3.65776 4.95237 3.85277 5.14704L7.85277 9.14704L7.85374 9.14606C8.04873 9.34105 8.0487 9.65809 7.85374 9.8531L3.85374 13.8531C3.7558 13.951 3.62815 13.9995 3.50023 13.9996C3.37223 13.9996 3.24373 13.9501 3.14573 13.8531C2.95103 13.6581 2.95083 13.341 3.14573 13.1461L6.79222 9.50056L3.14573 5.85407C2.95104 5.65905 2.95084 5.34194 3.14573 5.14704Z"}),h.jsx("path",{d:"M12.1457 1.14704C12.3406 0.952206 12.6578 0.952371 12.8528 1.14704C13.0477 1.34202 13.0477 1.65907 12.8528 1.85407L9.20726 5.50056L12.8537 9.14704C13.0487 9.34202 13.0487 9.65907 12.8537 9.85407C12.7558 9.95101 12.6282 10.0005 12.5002 10.0006C12.3722 10.0006 12.2437 9.95207 12.1457 9.85407L8.14573 5.85407C7.95104 5.65905 7.95084 5.34194 8.14573 5.14704L12.1457 1.14704Z"})]})}function Jm({runtime:e,corner:n=!1}){const[t,r]=T.useState(!1),[s,i]=T.useState(!1),[a,o]=T.useState(!1),[c,u]=T.useState(null),_=Ea();async function f(){if(c){o(!0);try{await TA(c),u(null)}catch(p){u(null),Vn(p instanceof Error?p.message:String(p),"error")}finally{o(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:n?"fixed bottom-0 start-0 z-50":"relative shrink-0 rounded-b-lg border-t border-border bg-background",ref:_.ref,children:[_.open&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_6px)] start-2 z-50 min-w-60 rounded-lg border border-border bg-background p-1.5 shadow-menu",children:[h.jsxs("div",{className:"border-b border-border-variant px-2 pt-1 pb-2",children:[h.jsx("div",{className:"text-sm font-medium text-text",children:Q9e({host:ze(e.session.host),user:ze(e.session.user??"")})}),h.jsxs("div",{className:"mt-0.5 text-xs text-subtext",children:["OpenResearch ",ze(e.session.version??"…")]})]}),h.jsxs("div",{className:"flex items-center rounded-sm hover:bg-surface",children:[h.jsx(Er,{className:"hover:bg-transparent",disabled:t,onClick:async()=>{r(!0);try{await zA(),_.setOpen(!1)}catch(p){Vn(p instanceof Error?p.message:String(p),"error")}finally{r(!1)}},children:t?K9e():Hy()}),h.jsx(f4,{content:jNe(),className:"me-2 shrink-0 text-subtext",children:h.jsx(C4,{size:15})})]}),h.jsx(Er,{danger:!0,disabled:s,onClick:async()=>{i(!0);try{u(await jA()),_.setOpen(!1)}catch(p){Vn(p instanceof Error?p.message:String(p),"error")}finally{i(!1)}},children:PT()})]}),n?h.jsxs($e,{variant:"default",className:"h-auto w-auto max-w-48 justify-start rounded-none border-accent-blue bg-accent-blue px-2.5 py-1.5 font-normal text-white [&:hover:not(:disabled)]:border-accent-blue [&:hover:not(:disabled)]:bg-accent-blue/90","aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:[h.jsx(c2,{size:14,className:"shrink-0"}),h.jsx("span",{className:"min-w-0 truncate text-sm leading-tight",children:ix({host:ze(e.session.host)})})]}):h.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[h.jsx(Yt,{size:"small","aria-label":ix({host:ze(e.session.host)}),"aria-haspopup":"menu","aria-expanded":_.open,onClick:()=>_.setOpen(p=>!p),children:h.jsx(c2,{size:14,className:"shrink-0"})}),h.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[h.jsx("span",{className:"-my-0.5 max-w-full self-start truncate rounded-sm bg-accent-blue px-1.5 py-0.5 text-sm leading-tight text-white",children:ix({host:ze(e.session.host)})}),h.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",ze(e.session.version??"…")]})]})]})]}),c&&h.jsx(sR,{host:e.session.host,preview:c,currentClientAttached:e.session.status==="connected",stopping:a,onClose:()=>{a||u(null)},onConfirm:()=>void f()})]})}function M4(e=!0){const[n,t]=T.useState(null),[r,s]=T.useState(null);return T.useEffect(()=>{if(!e)return;let i=!1;const a=Zit(o=>{i=!0,t(o)});return CA().then(o=>!i&&t(o)).catch(o=>s(o instanceof Error?o.message:String(o))),a},[e]),{status:n,error:r,apply:t}}const Llt=6e4,Dlt=500;function PR(e){const[n,t]=T.useState(!1),[r,s]=T.useState(null),i=T.useRef(!1);T.useEffect(()=>(i.current=!1,()=>{i.current=!0}),[]);const a=e!=null&&e.restartRequired?e.instance:null;return{restarting:n,error:r,restart:()=>{!a||n||(t(!0),s(null),(async()=>{try{await vnt();const c=Date.now()+Llt;for(;Date.now()setTimeout(_,Dlt));const u=await CA().catch(()=>null);if(u&&u.instance!==a){window.location.reload();return}}throw new Error(bet())}catch(c){if(i.current)return;s(c instanceof Error?c.message:String(c)),t(!1)}})())}}}function HR({status:e}){const[n,t]=T.useState(null),r=e!=null&&e.restartRequired?e.installedVersion:null,{restarting:s,error:i,restart:a}=PR(e);return!r||n===r?null:h.jsxs("div",{className:"update-banner flex items-center gap-2 shrink-0 py-1.5 px-3.5 text-sm text-text bg-surface border-b border-b-border",role:"status",children:[h.jsx(Ca,{size:13,className:`shrink-0 text-subtext${s?" animate-spin":""}`}),h.jsx("span",{className:"min-w-0",children:i?_A({error:i}):ret({version:ze(r)})}),(e==null?void 0:e.canRestart)&&h.jsx($e,{type:"button",size:"small",disabled:s,onClick:a,children:s?pA():hA()}),h.jsx(Yt,{type:"button",size:"small",className:"ms-auto","aria-label":oet(),disabled:s,onClick:()=>t(r),children:h.jsx(Dr,{size:13})})]})}function L4(){return h.jsx("div",{className:"flex flex-1 h-full items-center justify-center",children:h.jsx(Ot,{})})}function Olt(){return h.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[h.jsx("p",{children:rc()}),h.jsx(Lg,{to:"/projects",children:Gh()})]})}function D4({error:e,reset:n}){return h.jsxs("div",{className:"flex flex-1 h-full flex-col items-center justify-center gap-3 text-subtext",children:[h.jsx("p",{role:"alert",children:e.message}),h.jsx($e,{onClick:n,children:Ji()}),h.jsx(Lg,{to:"/projects",children:Gh()})]})}function FR({projectId:e}){const n=Mg(),[t,r]=T.useState(null),[s,i]=T.useState(0);return T.useEffect(()=>{let a=!0;return r(null),(e?iat(e):sat()).then(o=>{a&&n({href:o,replace:!0})}).catch(o=>{a&&r(o instanceof Error?o:new Error(String(o)))}),()=>{a=!1}},[e,s,n]),t?h.jsx(D4,{error:t,reset:()=>i(a=>a+1)}):h.jsx(L4,{})}function Ilt(){return h.jsx(FR,{})}function Blt({projectId:e}){return h.jsx(FR,{projectId:e})}function $lt(){const e=pR(),n=Mg(),[t,r]=T.useState(null),[s,i]=T.useState(null),[a,o]=T.useState(null),[c,u]=T.useState(0),{status:_}=M4(e.kind==="local");T.useEffect(()=>{let p=!0;return o(null),document.title="OpenResearch",Promise.all([n4(),Ig()]).then(([m,x])=>{p&&(r(m),i(x),Fg.queue({...g4()??x.workspace??{railOpen:!0,panelWidth:760,experimentsView:"table"},lastLocation:"/projects"}))}).catch(m=>{p&&o(m instanceof Error?m:new Error(String(m)))}),()=>{p=!1}},[c]),mR({onRun:()=>{},onExperiment:()=>{},onProject:p=>r(m=>m&&[...m.filter(x=>x.id!==p.id),p]),onReconnect:()=>u(p=>p+1)});const f=p=>void n({to:"/projects/$projectId",params:{projectId:p}});return h.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&h.jsxs(h.Fragment,{children:[h.jsx(BR,{}),h.jsx(HR,{status:_})]}),a?h.jsx(D4,{error:a,reset:()=>u(p=>p+1)}):t===null||s===null?h.jsx(L4,{}):t.length===0&&!s.onboardingCompleted?h.jsx(ult,{preferredAgent:s.preferredAgent,onDone:p=>{rat(),f(p.id)}}):h.jsx(Alt,{remote:e.kind==="ssh",projects:t,onOpen:f,onCreated:(p,m)=>{m?(Vn(m,"error"),n({to:"/projects/$projectId/settings/$tab",params:{projectId:p.id,tab:"git"}})):f(p.id)},onDeleted:p=>r(m=>(m==null?void 0:m.filter(x=>x.id!==p))??null)}),e.kind==="ssh"&&h.jsx(Jm,{runtime:e,corner:!0})]})}const Plt=ao()({component:Ilt}),Hlt=ao()({component:i_}),Flt=ao()({}),Ult=ao()({component:$lt});function qlt(e,n){if(!n)return e;const t=new Map(e.map(i=>[i.id,i]));let r=t.get(n);if(!r)return e;const s=[];for(;r;)s.push(r),r=r.parentId?t.get(r.parentId):void 0;return s.reverse()}function Glt(e,n,t){var a;let r=e;for(;r&&r.role!=="user";)r=r.parentId?n.get(r.parentId):void 0;const s=e.role==="user"?e.parentId??null:(r==null?void 0:r.id)??null,i=(a=t.get(s))==null?void 0:a.filter(o=>o.role===e.role);return i!=null&&i.length?i:[e]}function Vlt(e,n,t,r){const s=e.filter(u=>!r(u.id)),i=new Map(s.map(u=>[u.id,u])),a=new Map;for(const u of s){const _=u.parentId??null,f=a.get(_);f?f.push(u):a.set(_,[u])}const o=new Set(n.map(u=>u.id)),c=new Map;for(const u of t){const _=Glt(u,i,a),f=_.findIndex(p=>o.has(p.id));c.set(u.id,{count:_.length,index:f,prevId:f>0?_[f-1].id:void 0,nextId:f<_.length-1?_[f+1].id:void 0})}return c}function eg(e,n){var t;if(e.type==="tool"&&((t=e.tool)==null?void 0:t.toLowerCase())==="interrupted")return!1;if(e.type==="prompt"){if(!e.prompt)return!1;if(e.prompt.kind==="permission"){if(e.prompt.resolved)return!1;if(n!==void 0)return e.id===n}return!0}return e.type==="reasoning"?!1:e.type==="text"?!!e.text:!0}function J_(e){return e.id==="turn-retry"||e.id==="turn-recovery"}function UR(e){var n;for(let t=e.length-1;t>=0;t--){const r=e[t];if(!(r.type==="steer"||J_(r)||!eg(r)))return r.type!=="tool"||((n=r.state)==null?void 0:n.status)==="error"?null:r.id}return null}function qR(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return null;const t=UR(n.parts);return t?{messageId:n.id,toolId:t}:null}function Wlt(e){const n=e.at(-1);if((n==null?void 0:n.role)!=="assistant")return!1;for(let t=n.parts.length-1;t>=0;t--){const r=n.parts[t];if(!(r.type==="steer"||J_(r)))return r.type==="text"&&!!r.text}return!1}const qa=e=>new Intl.NumberFormat(j()).format(e);function Klt(e,n){const t=typeof e.nextRetryAt=="number"?Math.max(0,Math.ceil((e.nextRetryAt-n)/1e3)):null;return e.retryOwner==="native"&&e.maximum==null&&t==null?aTe():typeof e.attempt=="number"&&typeof e.maximum=="number"&&t!=null?Qje({attempt:qa(e.attempt),maximum:qa(e.maximum),seconds:qa(t)}):typeof e.attempt=="number"&&typeof e.maximum=="number"?Kje({attempt:qa(e.attempt),maximum:qa(e.maximum)}):typeof e.attempt=="number"&&t!=null?nTe({attempt:qa(e.attempt),seconds:qa(t)}):typeof e.attempt=="number"?qje({attempt:qa(e.attempt)}):t!=null?uTe({seconds:qa(t)}):HT()}function Ylt(e,n){if(typeof e!="number")return _Te();const t=Math.max(0,Math.ceil((e-n)/1e3));return bTe({seconds:qa(t)})}function GR(e){return e==="retry"||e==="continue"?e:null}function Xlt(e){const n={};return e.model!==void 0&&(n.model=e.model),e.serviceTier!==void 0&&(n.serviceTier=e.serviceTier),e.permissionMode!==void 0&&(n.permissionMode=e.permissionMode),e.planMode!==void 0&&(n.planMode=e.planMode),e.reasoningLevel!==void 0&&(n.reasoningLevel=e.reasoningLevel),n}function Zlt(e){return["*","?","[","]","{","}"].some(n=>e.includes(n))}function e9(e){return e==="alphaxiv"||e==="openalex"||e==="biorxiv"?e:void 0}function Qlt(e){const n=e.trim(),t=n.toLowerCase();if(t.includes("biorxiv.org"))return"biorxiv";if(t.includes("openalex.org"))return"openalex";const r=n.match(/10\.\d+\/\S+/);if(r)return r[0].startsWith("10.1101/")?"biorxiv":"openalex";const s=n.split("/").pop()??"";return/^W\d+$/i.test(s)?"openalex":"alphaxiv"}function O4(e){const n=[];let t="",r=!1,s=null;const i=()=>{r&&n.push(t),t="",r=!1};for(let a=0;a"||o==="&")break;/\s/.test(o)?i():(t+=o,r=!0)}return i(),n}function Jlt(e){const n=e[0];if((n==='"'||n==="'")&&e.at(-1)===n){const t=O4(e);if(t.length===1)return t[0]}return e}function ect(e){var t,r,s;let n=0;for(;["do","then","else","if","while","until"].includes(e[n]);)n++;for(;/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="env")for(n++;(t=e[n])!=null&&t.startsWith("-")||/^[A-Za-z_][A-Za-z0-9_]*=/.test(e[n]??"");)n++;if(e[n]==="command"){if(n++,["-v","-V"].includes(e[n]))return null;for(;(r=e[n])!=null&&r.startsWith("-");)n++}return((s=e[n])==null?void 0:s.split("/").pop())!=="orx"?null:e.slice(n+1)}function id(e){return ect(typeof e=="string"?O4(e):e)}function tct(e){var t;const n=(t=e[0])==null?void 0:t.split("/").pop();return!n||!["sh","bash","zsh"].includes(n)||e[1]!=="-lc"?null:e[2]??null}function nct(e,n){const t=id(e);return t===null?!1:n.split("\\s+").every((s,i)=>t[i]!==void 0&&new RegExp(`^(?:${s})$`,"i").test(t[i]))}function rct(e){var c;const n=id(e);if(!n)return null;const t=n[0];if(t!=="paper"&&t!=="discover")return null;let r;const s=[],i=new Set(["--limit","--published-after","--published-before","--prioritize"]);for(let u=1;u + + + + +`,ict='',act=` + + +`,VR={alphaxiv:"alphaXiv",openalex:"OpenAlex",biorxiv:"bioRxiv"},oct={alphaxiv:sct,openalex:act,biorxiv:ict};function WR({source:e,size:n=16,decorative:t=!1,className:r=""}){return h.jsx("span",{className:`lit-logo flex-none inline-flex items-center justify-center p-[1.5px] box-border bg-white rounded-[3px] shadow-logo [&_svg]:w-full [&_svg]:h-full [&_svg]:block ${r}`,style:{width:n,height:n},...t?{"aria-hidden":!0}:{role:"img","aria-label":VR[e]},dangerouslySetInnerHTML:{__html:oct[e]}})}function lct(e){const t=e.trim().replace(/^https?:\/\/doi\.org\//i,"").replace(/^doi:/i,"").match(/10\.\d+\/[^\s?#]+/);return t?t[0].replace(/[.,)]+$/,"").replace(/v\d+(\.[a-z][a-z-]*)*$/i,""):null}function cct(e,n){const t=n.trim();if(e==="alphaxiv"){const i=(t.split(/[?#]/)[0].split("/").pop()||t).replace(/\.(pdf|md)$/i,"");return`https://www.alphaxiv.org/abs/${encodeURIComponent(i)}`}const r=lct(t);if(r)return`https://doi.org/${r}`;if(e==="openalex"){const s=t.split("/").pop()||t;return`https://openalex.org/${encodeURIComponent(s)}`}return`https://doi.org/${t}`}const uct=["alphaxiv","openalex","biorxiv"];let t9=null;function fct(){const[e,n]=T.useState(t9),[t,r]=T.useState(!1),s=a=>{t9=a,n(a)};T.useEffect(()=>{Jnt().then(s).catch(()=>{})},[]);const i=a=>{!e||t||(r(!0),ert({...e,[a]:!e[a]}).then(s).catch(()=>{}).finally(()=>r(!1)))};return e?h.jsx("div",{className:"flex flex-col",children:uct.map(a=>{const o=e[a];return h.jsxs(Er,{type:"button",role:"switch","aria-checked":o,disabled:t,onClick:()=>i(a),children:[h.jsxs("span",{className:"inline-flex items-center gap-[9px]",children:[h.jsx(WR,{source:a,size:16,decorative:!0}),VR[a]]}),h.jsx(Ist,{checked:o,"aria-hidden":"true"})]},a)})}):h.jsx("div",{className:"py-1.5 px-2 text-muted text-sm",children:txe()})}function gx(e,n){if(!e)throw new Error("Assertion Error")}function Jc(e,n){if(e==null)throw new Error(`Unexpected ${e}`);return e}function dct(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function hct(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:` +`}]}function _ct(e,n){const t=n.value?n.value+` +`:"",r={},s=n.lang?n.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(i.data={meta:n.meta}),e.patch(n,i),i=e.applyData(n,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(n,i),i}function pct(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function mct(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const qs=yc(/[A-Za-z]/),js=yc(/[\dA-Za-z]/),gct=yc(/[#-'*+\--9=?A-Z^-~]/);function tg(e){return e!==null&&(e<32||e===127)}const u2=yc(/\d/),bct=yc(/[\dA-Fa-f]/),vct=yc(/[!-/:-@[-`{-~]/);function yt(e){return e!==null&&e<-2}function Un(e){return e!==null&&(e<0||e===32)}function hn(e){return e===-2||e===-1||e===32}const Yg=yc(new RegExp("\\p{P}|\\p{S}","u")),Cu=yc(/\s/);function yc(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Cd(e){const n=[];let t=-1,r=0,s=0;for(;++t55295&&i<57344){const o=e.charCodeAt(t+1);i<56320&&o>56319&&o<57344?(a=String.fromCharCode(i,o),s=1):a="�"}else a=String.fromCharCode(i);a&&(n.push(e.slice(r,t),encodeURIComponent(a)),r=t+s+1,a=""),s&&(t+=s,s=0)}return n.join("")+e.slice(r)}function xct(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),s=Cd(r.toLowerCase()),i=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=i+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+s,id:t+"fnref-"+s+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(n,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,u),e.applyData(n,u)}function yct(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function wct(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function KR(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const s=e.all(n),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function Sct(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return KR(e,n);const s={src:Cd(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(n,i),e.applyData(n,i)}function kct(e,n){const t={src:Cd(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function Cct(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function Ect(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return KR(e,n);const s={href:Cd(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:e.all(n)};return e.patch(n,i),e.applyData(n,i)}function Nct(e,n){const t={href:Cd(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function zct(e,n,t){const r=e.all(n),s=t?jct(t):YR(n),i={},a=[];if(typeof n.checked=="boolean"){const _=r[0];let f;_&&_.type==="element"&&_.tagName==="p"?f=_:(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:n.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let o=-1;for(;++o1}function Tct(e,n){const t={},r=e.all(n);let s=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++s0&&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 Lct(e){const n=I4(e),t=XR(e);if(n&&t)return{start:n,end:t}}function Dct(e,n){const t=e.all(n),r=t.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],a),s.push(a)}if(t.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},o=I4(n.children[1]),c=XR(n.children[n.children.length-1]);o&&c&&(a.position={start:o,end:c}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(n,i),e.applyData(n,i)}function Oct(e,n,t){const r=t?t.children:void 0,i=(r?r.indexOf(n):1)===0?"th":"td",a=t&&t.type==="table"?t.align:void 0,o=a?a.length:n.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=t.exec(n);return i.push(s9(n.slice(s),s>0,!1)),i.join("")}function s9(e,n,t){let r=0,s=e.length;if(n){let i=e.codePointAt(r);for(;i===n9||i===r9;)r++,i=e.codePointAt(r)}if(t){let i=e.codePointAt(s-1);for(;i===n9||i===r9;)s--,i=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function $ct(e,n){const t={type:"text",value:Bct(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Pct(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Hct={blockquote:dct,break:hct,code:_ct,delete:pct,emphasis:mct,footnoteReference:xct,heading:yct,html:wct,imageReference:Sct,image:kct,inlineCode:Cct,linkReference:Ect,link:Nct,listItem:zct,list:Tct,paragraph:Act,root:Rct,strong:Mct,table:Dct,tableCell:Ict,tableRow:Oct,text:$ct,thematicBreak:Pct,toml:Rp,yaml:Rp,definition:Rp,footnoteDefinition:Rp};function Rp(){}const QR=-1,Xg=0,Vh=1,ng=2,B4=3,$4=4,P4=5,H4=6,JR=7,eM=8,Fct=typeof self=="object"?self:globalThis,i9=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Fct[e](n)},Uct=(e,n)=>{const t=(s,i)=>(e.set(i,s),s),r=s=>{if(e.has(s))return e.get(s);const[i,a]=n[s];switch(i){case Xg:case QR:return t(a,s);case Vh:{const o=t([],s);for(const c of a)o.push(r(c));return o}case ng:{const o=t({},s);for(const[c,u]of a)o[r(c)]=r(u);return o}case B4:return t(new Date(a),s);case $4:{const{source:o,flags:c}=a;return t(new RegExp(o,c),s)}case P4:{const o=t(new Map,s);for(const[c,u]of a)o.set(r(c),r(u));return o}case H4:{const o=t(new Set,s);for(const c of a)o.add(r(c));return o}case JR:{const{name:o,message:c}=a;return t(i9(o,c),s)}case eM:return t(BigInt(a),s);case"BigInt":return t(Object(BigInt(a)),s);case"ArrayBuffer":return t(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return t(new DataView(o),a)}}return t(i9(i,a),s)};return r},a9=e=>Uct(new Map,e)(0),ru="",{toString:qct}={},{keys:Gct}=Object,Nh=e=>{const n=typeof e;if(n!=="object"||!e)return[Xg,n];const t=qct.call(e).slice(8,-1);switch(t){case"Array":return[Vh,ru];case"Object":return[ng,ru];case"Date":return[B4,ru];case"RegExp":return[$4,ru];case"Map":return[P4,ru];case"Set":return[H4,ru];case"DataView":return[Vh,t]}return t.includes("Array")?[Vh,t]:t.includes("Error")?[JR,t]:[ng,t]},Mp=([e,n])=>e===Xg&&(n==="function"||n==="symbol"),Vct=(e,n,t,r)=>{const s=(a,o)=>{const c=r.push(a)-1;return t.set(o,c),c},i=a=>{if(t.has(a))return t.get(a);let[o,c]=Nh(a);switch(o){case Xg:{let _=a;switch(c){case"bigint":o=eM,_=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);_=null;break;case"undefined":return s([QR],a)}return s([o,_],a)}case Vh:{if(c){let p=a;return c==="DataView"?p=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(p=new Uint8Array(a)),s([c,[...p]],a)}const _=[],f=s([o,_],a);for(const p of a)_.push(i(p));return f}case ng:{if(c)switch(c){case"BigInt":return s([c,a.toString()],a);case"Boolean":case"Number":case"String":return s([c,a.valueOf()],a)}if(n&&"toJSON"in a)return i(a.toJSON());const _=[],f=s([o,_],a);for(const p of Gct(a))(e||!Mp(Nh(a[p])))&&_.push([i(p),i(a[p])]);return f}case B4:return s([o,isNaN(a.getTime())?ru:a.toISOString()],a);case $4:{const{source:_,flags:f}=a;return s([o,{source:_,flags:f}],a)}case P4:{const _=[],f=s([o,_],a);for(const[p,m]of a)(e||!(Mp(Nh(p))||Mp(Nh(m))))&&_.push([i(p),i(m)]);return f}case H4:{const _=[],f=s([o,_],a);for(const p of a)(e||!Mp(Nh(p)))&&_.push(i(p));return f}}const{message:u}=a;return s([o,{name:c,message:u}],a)};return i},o9=(e,{json:n,lossy:t}={})=>{const r=[];return Vct(!(n||t),!!n,new Map,r)(e),r},rg=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?a9(o9(e,n)):structuredClone(e):(e,n)=>a9(o9(e,n));function Wct(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function Kct(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Yct(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Wct,r=e.options.footnoteBackLabel||Kct,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&x.push({type:"text",value:" "});let y=typeof t=="string"?t:t(c,m);typeof y=="string"&&(y={type:"text",value:y}),x.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const b=_[_.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const y=b.children[b.children.length-1];y&&y.type==="text"?y.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...x)}else _.push(...x);const v={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(_,!0)};e.patch(u,v),o.push(v)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...rg(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` +`}]}}const e0=(function(e){if(e==null)return Jct;if(typeof e=="function")return Zg(e);if(typeof e=="object")return Array.isArray(e)?Xct(e):Zct(e);if(typeof e=="string")return Qct(e);throw new Error("Expected function, string, or object as test")});function Xct(e){const n=[];let t=-1;for(;++t":""))+")"})}return p;function p(){let m=tM,x,S,b;if((!n||i(c,u,_[_.length-1]||void 0))&&(m=nut(t(c,_)),m[0]===f2))return m;if("children"in c&&c.children){const v=c;if(v.children&&m[0]!==nM)for(S=(r?v.children.length:-1)+a,b=_.concat(v);S>-1&&S0&&t.push({type:"text",value:` +`}),t}function l9(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function c9(e,n){const t=sut(e,n),r=t.one(e,void 0),s=Yct(t),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:` +`},s),i}function sg(e,n){return e&&"run"in e?async function(t,r){const s=c9(t,{file:r,...n});await e.run(s,r)}:function(t,r){return c9(t,{file:r,...e||n})}}function u9(e){if(e)throw e}var bx,f9;function cut(){if(f9)return bx;f9=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},i=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var _=e.call(u,"constructor"),f=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!_&&!f)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},a=function(u,_){t&&_.name==="__proto__"?t(u,_.name,{enumerable:!0,configurable:!0,value:_.newValue,writable:!0}):u[_.name]=_.newValue},o=function(u,_){if(_==="__proto__")if(e.call(u,_)){if(r)return r(u,_).value}else return;return u[_]};return bx=function c(){var u,_,f,p,m,x,S=arguments[0],b=1,v=arguments.length,y=!1;for(typeof S=="boolean"&&(y=S,S=arguments[1]||{},b=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});ba.length;let c;o&&a.push(s);try{c=e.apply(this,a)}catch(u){const _=u;if(o&&t)throw _;return s(_)}o||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(a,...o){t||(t=!0,n(a,...o))}function i(a){s(null,a)}}function Wh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?d9(e.position):"start"in e||"end"in e?d9(e):"line"in e||"column"in e?_2(e):""}function _2(e){return h9(e&&e.line)+":"+h9(e&&e.column)}function d9(e){return _2(e&&e.start)+"-"+_2(e&&e.end)}function h9(e){return e&&typeof e=="number"?e:1}class Rs extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let s="",i={},a=!1;if(t&&("line"in t&&"column"in t?i={place:t}:"start"in t&&"end"in t?i={place:t}:"type"in t?i={ancestors:[t],place:t.position}:i={...t}),typeof n=="string"?s=n:!i.cause&&n&&(a=!0,s=n.message,i.cause=n),!i.ruleId&&!i.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?i.ruleId=r:(i.source=r.slice(0,c),i.ruleId=r.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=o?o.line:void 0,this.name=Wh(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Rs.prototype.file="";Rs.prototype.name="";Rs.prototype.reason="";Rs.prototype.message="";Rs.prototype.stack="";Rs.prototype.column=void 0;Rs.prototype.line=void 0;Rs.prototype.ancestors=void 0;Rs.prototype.cause=void 0;Rs.prototype.fatal=void 0;Rs.prototype.place=void 0;Rs.prototype.ruleId=void 0;Rs.prototype.source=void 0;const Ga={basename:hut,dirname:_ut,extname:put,join:mut,sep:"/"};function hut(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');t0(e);let t=0,r=-1,s=e.length,i;if(n===void 0||n.length===0||n.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let a=-1,o=n.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){t=s+1;break}}else a<0&&(i=!0,a=s+1),o>-1&&(e.codePointAt(s)===n.codePointAt(o--)?o<0&&(r=s):(o=-1,r=a));return t===r?r=a:r<0&&(r=e.length),e.slice(t,r)}function _ut(e){if(t0(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function put(e){t0(e);let n=e.length,t=-1,r=0,s=-1,i=0,a;for(;n--;){const o=e.codePointAt(n);if(o===47){if(a){r=n+1;break}continue}t<0&&(a=!0,t=n+1),o===46?s<0?s=n:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||t<0||i===0||i===1&&s===t-1&&s===r+1?"":e.slice(s,t)}function mut(...e){let n=-1,t;for(;++n0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function but(e,n){let t="",r=0,s=-1,i=0,a=-1,o,c;for(;++a<=e.length;){if(a2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),s=a,i=0;continue}}else if(t.length>0){t="",r=0,s=a,i=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(s+1,a):t=e.slice(s+1,a),r=a-s-1;s=a,i=0}else o===46&&i>-1?i++:i=-1}return t}function t0(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vut={cwd:xut};function xut(){return"/"}function p2(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function yut(e){if(typeof e=="string")e=new URL(e);else if(!p2(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return wut(e)}function wut(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 n=e.pathname;let t=-1;for(;++t0){let[m,...x]=_;const S=r[p][1];h2(S)&&h2(m)&&(m=vx(!0,S,m)),r[p]=[u,m,...x]}}}}const G4=new q4().freeze();function Sx(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function kx(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Cx(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function p9(e){if(!h2(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function m9(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Lp(e){return Eut(e)?e:new rM(e)}function Eut(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Nut(e){return typeof e=="string"||zut(e)}function zut(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var g9=Object.prototype.hasOwnProperty;function b9(e,n,t){for(t of e.keys())if(Kh(t,n))return t}function Kh(e,n){var t,r,s;if(e===n)return!0;if(e&&n&&(t=e.constructor)===n.constructor){if(t===Date)return e.getTime()===n.getTime();if(t===RegExp)return e.toString()===n.toString();if(t===Array){if((r=e.length)===n.length)for(;r--&&Kh(e[r],n[r]););return r===-1}if(t===Set){if(e.size!==n.size)return!1;for(r of e)if(s=r,s&&typeof s=="object"&&(s=b9(n,s),!s)||!n.has(s))return!1;return!0}if(t===Map){if(e.size!==n.size)return!1;for(r of e)if(s=r[0],s&&typeof s=="object"&&(s=b9(n,s),!s)||!Kh(r[1],n.get(s)))return!1;return!0}if(t===ArrayBuffer)e=new Uint8Array(e),n=new Uint8Array(n);else if(t===DataView){if((r=e.byteLength)===n.byteLength)for(;r--&&e.getInt8(r)===n.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===n.byteLength)for(;r--&&e[r]===n[r];);return r===-1}if(!t||typeof e=="object"){r=0;for(t in e)if(g9.call(e,t)&&++r&&!g9.call(n,t)||!(t in n)||!Kh(e[t],n[t]))return!1;return Object.keys(n).length===r}}return e!==e&&n!==n}function v9(e){const n=[],t=String(e||"");let r=t.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=t.length,i=!0);const a=t.slice(s,r).trim();(a||!i)&&n.push(a),s=r+1,r=t.indexOf(",",s)}return n}function jut(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Tut=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Aut=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rut={};function x9(e,n){return(Rut.jsx?Aut:Tut).test(e)}const Mut=/[ \t\n\f\r]/g;function Lut(e){return typeof e=="object"?e.type==="text"?y9(e.value):!1:y9(e)}function y9(e){return e.replace(Mut,"")===""}class n0{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}n0.prototype.normal={};n0.prototype.property={};n0.prototype.space=void 0;function sM(e,n){const t={},r={};for(const s of e)Object.assign(t,s.property),Object.assign(r,s.normal);return new n0(t,r,n)}function g_(e){return e.toLowerCase()}class li{constructor(n,t){this.attribute=t,this.property=n}}li.prototype.attribute="";li.prototype.booleanish=!1;li.prototype.boolean=!1;li.prototype.commaOrSpaceSeparated=!1;li.prototype.commaSeparated=!1;li.prototype.defined=!1;li.prototype.mustUseProperty=!1;li.prototype.number=!1;li.prototype.overloadedBoolean=!1;li.prototype.property="";li.prototype.spaceSeparated=!1;li.prototype.space=void 0;let Dut=0;const qt=Iu(),Lr=Iu(),m2=Iu(),Ve=Iu(),Fn=Iu(),bu=Iu(),ki=Iu();function Iu(){return 2**++Dut}const g2=Object.freeze(Object.defineProperty({__proto__:null,boolean:qt,booleanish:Lr,commaOrSpaceSeparated:ki,commaSeparated:bu,number:Ve,overloadedBoolean:m2,spaceSeparated:Fn},Symbol.toStringTag,{value:"Module"})),Ex=Object.keys(g2);class V4 extends li{constructor(n,t,r,s){let i=-1;if(super(n,t),w9(this,"space",s),typeof r=="number")for(;++i4&&t.slice(0,4)==="data"&&Put.test(n)){if(n.charAt(4)==="-"){const i=n.slice(5).replace(S9,Fut);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=n.slice(4);if(!S9.test(i)){let a=i.replace($ut,Hut);a.charAt(0)!=="-"&&(a="-"+a),n="data"+a}}s=V4}return new s(r,n)}function Hut(e){return"-"+e.toLowerCase()}function Fut(e){return e.charAt(1).toUpperCase()}const dM=sM([iM,Out,lM,cM,uM],"html"),Qg=sM([iM,Iut,lM,cM,uM],"svg");function k9(e){const n=String(e||"").trim();return n?n.split(/[ \t\n\r\f]+/g):[]}function Uut(e){return e.join(" ").trim()}var Sf={},Nx,C9;function qut(){if(C9)return Nx;C9=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,c=` +`,u="/",_="*",f="",p="comment",m="declaration";function x(b,v){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];v=v||{};var y=1,w=1;function C(F){var Y=F.match(n);Y&&(y+=Y.length);var q=F.lastIndexOf(c);w=~q?F.length-q:w+F.length}function z(){var F={line:y,column:w};return function(Y){return Y.position=new E(F),M(),Y}}function E(F){this.start=F,this.end={line:y,column:w},this.source=v.source}E.prototype.content=b;function R(F){var Y=new Error(v.source+":"+y+":"+w+": "+F);if(Y.reason=F,Y.filename=v.source,Y.line=y,Y.column=w,Y.source=b,!v.silent)throw Y}function N(F){var Y=F.exec(b);if(Y){var q=Y[0];return C(q),b=b.slice(q.length),Y}}function M(){N(t)}function O(F){var Y;for(F=F||[];Y=I();)Y!==!1&&F.push(Y);return F}function I(){var F=z();if(!(u!=b.charAt(0)||_!=b.charAt(1))){for(var Y=2;f!=b.charAt(Y)&&(_!=b.charAt(Y)||u!=b.charAt(Y+1));)++Y;if(Y+=2,f===b.charAt(Y-1))return R("End of comment missing");var q=b.slice(2,Y-2);return w+=2,C(q),b=b.slice(Y),w+=2,F({type:p,comment:q})}}function H(){var F=z(),Y=N(r);if(Y){if(I(),!N(s))return R("property missing ':'");var q=N(i),Q=F({type:m,property:S(Y[0].replace(e,f)),value:q?S(q[0].replace(e,f)):f});return N(a),Q}}function U(){var F=[];O(F);for(var Y;Y=H();)Y!==!1&&(F.push(Y),O(F));return F}return M(),U()}function S(b){return b?b.replace(o,f):f}return Nx=x,Nx}var E9;function Gut(){if(E9)return Sf;E9=1;var e=Sf&&Sf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.default=t;const n=e(qut());function t(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,n.default)(r),o=typeof s=="function";return a.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:_}=c;o?s(u,_,c):_&&(i=i||{},i[u]=_)}),i}return Sf}var zh={},N9;function Vut(){if(N9)return zh;N9=1,Object.defineProperty(zh,"__esModule",{value:!0}),zh.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(u){return!u||t.test(u)||e.test(u)},a=function(u,_){return _.toUpperCase()},o=function(u,_){return"".concat(_,"-")},c=function(u,_){return _===void 0&&(_={}),i(u)?u:(u=u.toLowerCase(),_.reactCompat?u=u.replace(s,o):u=u.replace(r,o),u.replace(n,a))};return zh.camelCase=c,zh}var jh,z9;function Wut(){if(z9)return jh;z9=1;var e=jh&&jh.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},n=e(Gut()),t=Vut();function r(s,i){var a={};return!s||typeof s!="string"||(0,n.default)(s,function(o,c){o&&c&&(a[(0,t.camelCase)(o,i)]=c)}),a}return r.default=r,jh=r,jh}var Kut=Wut();const Yut=q_(Kut),W4={}.hasOwnProperty,Xut=new Map,Zut=/[A-Z]/g,Qut=new Set(["table","tbody","thead","tfoot","tr"]),Jut=new Set(["td","th"]),hM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _M(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=oft(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=aft(t,n.jsx,n.jsxs)}const s={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Qg:dM,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},i=pM(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function pM(e,n,t){if(n.type==="element")return eft(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return tft(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return rft(e,n,t);if(n.type==="mdxjsEsm")return nft(e,n);if(n.type==="root")return sft(e,n,t);if(n.type==="text")return ift(e,n)}function eft(e,n,t){const r=e.schema;let s=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Qg,e.schema=s),e.ancestors.push(n);const i=gM(e,n.tagName,!1),a=lft(e,n);let o=Y4(e,n);return Qut.has(n.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!Lut(c):!0})),mM(e,a,i,n),K4(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function tft(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}b_(e,n.position)}function nft(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);b_(e,n.position)}function rft(e,n,t){const r=e.schema;let s=r;n.name==="svg"&&r.space==="html"&&(s=Qg,e.schema=s),e.ancestors.push(n);const i=n.name===null?e.Fragment:gM(e,n.name,!0),a=cft(e,n),o=Y4(e,n);return mM(e,a,i,n),K4(a,o),e.ancestors.pop(),e.schema=r,e.create(n,i,a,t)}function sft(e,n,t){const r={};return K4(r,Y4(e,n)),e.create(n,e.Fragment,r,t)}function ift(e,n){return n.value}function mM(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function K4(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function aft(e,n,t){return r;function r(s,i,a,o){const u=Array.isArray(a.children)?t:n;return o?u(i,a,o):u(i,a)}}function oft(e,n){return t;function t(r,s,i,a){const o=Array.isArray(i.children),c=I4(r);return n(s,i,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function lft(e,n){const t={};let r,s;for(s in n.properties)if(s!=="children"&&W4.call(n.properties,s)){const i=uft(e,s,n.properties[s]);if(i){const[a,o]=i;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Jut.has(n.tagName)?r=o:t[a]=o}}if(r){const i=t.style||(t.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function cft(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const o=a.properties[0];o.type,Object.assign(t,e.evaluater.evaluateExpression(o.argument))}else b_(e,n.position);else{const s=r.name;let i;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,i=e.evaluater.evaluateExpression(o.expression)}else b_(e,n.position);else i=r.value===null?!0:r.value;t[s]=i}return t}function Y4(e,n){const t=[];let r=-1;const s=e.passKeys?new Map:Xut;for(;++rw.key).filter(w=>w!==void 0));let u=0;for(;u=e.children.length-_&&(E=s.length-(e.children.length-w)),E>=0&&(z=((v=s[E])==null?void 0:v.key)??z);z&&c.has(z)&&((y=s[E])==null?void 0:y.key)!==z;)z=`${z}+`;z&&c.add(z);const R=bM(C,s[E]??null,t,z);i.push(R),R.react!==void 0&&a.push(R.react)}const f=n!==null&&bft(e,n.node);if(n&&n.key===r&&f&&s.length===i.length&&i.every((w,C)=>w===s[C]))return n;const p=e.type==="element"&&pft.has(e.tagName)?a.filter(w=>typeof w!="string"||!mft.test(w)):a,m=p.length>0?p.length===1?p[0]:p:null;let x=f?n==null?void 0:n.shell:null;if(!x){const w=_M({...e,children:[]},t);x={props:w.props,type:w.type}}return{children:i,key:r,node:e,react:h.jsx(x.type,{...x.props,children:m},r),shell:x}}function bft(e,n){if(e===n)return!0;const{children:t,position:r,...s}=e,{children:i,position:a,...o}=n;return Kh(s,o)}function qf(e,n){if(e===n)return!0;if(Array.isArray(e)||Array.isArray(n)){if(!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length)return!1;for(let a=0;as?0:s+n:n=n>s?s:n,t=t>0?t:0,r.length<1e4)a=Array.from(r),a.unshift(n,t),e.splice(...a);else for(t&&e.splice(n,t);i0?(ji(e,e.length,0,n),e):n}const A9={}.hasOwnProperty;function xM(e){const n={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function xa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}function un(e,n,t,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(c){return hn(c)?(e.enter(t),o(c)):n(c)}function o(c){return hn(c)&&i++a))return;const R=n.events.length;let N=R,M,O;for(;N--;)if(n.events[N][0]==="exit"&&n.events[N][1].type==="chunkFlow"){if(M){O=n.events[N][1].end;break}M=!0}for(v(r),E=R;Ew;){const z=t[C];n.containerState=z[1],z[0].exit.call(n,e)}t.length=w}function y(){s.write([null]),i=void 0,s=void 0,n.containerState._closeFlow=void 0}}function Nft(e,n,t){return un(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ad(e){if(e===null||Un(e)||Cu(e))return 1;if(Yg(e))return 2}function Jg(e,n,t){const r=[];let s=-1;for(;++s1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const f={...e[r][1].end},p={...e[t][1].start};M9(f,-c),M9(p,c),a={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},i={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},s={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[t][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Xi(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=Xi(u,[["enter",s,n],["enter",a,n],["exit",a,n],["enter",i,n]]),u=Xi(u,Jg(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=Xi(u,[["exit",i,n],["enter",o,n],["exit",o,n],["exit",s,n]]),e[t][1].end.offset-e[t][1].start.offset?(_=2,u=Xi(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):_=0,ji(e,r-1,t-r+3,u),t=r+u.length-_-2;break}}for(t=-1;++t0&&hn(E)?un(e,y,"linePrefix",i+1)(E):y(E)}function y(E){return E===null||yt(E)?e.check(L9,S,C)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||yt(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),w)}function C(E){return e.exit("codeFenced"),n(E)}function z(E,R,N){let M=0;return O;function O(Y){return E.enter("lineEnding"),E.consume(Y),E.exit("lineEnding"),I}function I(Y){return E.enter("codeFencedFence"),hn(Y)?un(E,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):H(Y)}function H(Y){return Y===o?(E.enter("codeFencedFenceSequence"),U(Y)):N(Y)}function U(Y){return Y===o?(M++,E.consume(Y),U):M>=a?(E.exit("codeFencedFenceSequence"),hn(Y)?un(E,F,"whitespace")(Y):F(Y)):N(Y)}function F(Y){return Y===null||yt(Y)?(E.exit("codeFencedFence"),R(Y)):N(Y)}}}function $ft(e,n,t){const r=this;return s;function s(a){return a===null?t(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}const zx={name:"codeIndented",tokenize:Hft},Pft={partial:!0,tokenize:Fft};function Hft(e,n,t){const r=this;return s;function s(u){return e.enter("codeIndented"),un(e,i,"linePrefix",5)(u)}function i(u){const _=r.events[r.events.length-1];return _&&_[1].type==="linePrefix"&&_[2].sliceSerialize(_[1],!0).length>=4?a(u):t(u)}function a(u){return u===null?c(u):yt(u)?e.attempt(Pft,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||yt(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),n(u)}}function Fft(e,n,t){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?t(a):yt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):un(e,i,"linePrefix",5)(a)}function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?n(a):yt(a)?s(a):t(a)}}const Uft={name:"codeText",previous:Gft,resolve:qft,tokenize:Vft};function qft(e){let n=e.length-4,t=3,r,s;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return nthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const s=t||0;this.setCursor(Math.trunc(n));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Th(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Th(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Th(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n=4?n(a):e.interrupt(r.parser.constructs.flow,t,n)(a)}}function EM(e,n,t,r,s,i,a,o,c){const u=c||Number.POSITIVE_INFINITY;let _=0;return f;function f(v){return v===60?(e.enter(r),e.enter(s),e.enter(i),e.consume(v),e.exit(i),p):v===null||v===32||v===41||tg(v)?t(v):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),S(v))}function p(v){return v===62?(e.enter(i),e.consume(v),e.exit(i),e.exit(s),e.exit(r),n):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===62?(e.exit("chunkString"),e.exit(o),p(v)):v===null||v===60||yt(v)?t(v):(e.consume(v),v===92?x:m)}function x(v){return v===60||v===62||v===92?(e.consume(v),m):m(v)}function S(v){return!_&&(v===null||v===41||Un(v))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),n(v)):_999||m===null||m===91||m===93&&!c||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?t(m):m===93?(e.exit(i),e.enter(s),e.consume(m),e.exit(s),e.exit(r),n):yt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),_):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===null||m===91||m===93||yt(m)||o++>999?(e.exit("chunkString"),_(m)):(e.consume(m),c||(c=!hn(m)),m===92?p:f)}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,f):f(m)}}function zM(e,n,t,r,s,i){let a;return o;function o(p){return p===34||p===39||p===40?(e.enter(r),e.enter(s),e.consume(p),e.exit(s),a=p===40?41:p,c):t(p)}function c(p){return p===a?(e.enter(s),e.consume(p),e.exit(s),e.exit(r),n):(e.enter(i),u(p))}function u(p){return p===a?(e.exit(i),c(a)):p===null?t(p):yt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),un(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),_(p))}function _(p){return p===a||p===null||yt(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?f:_)}function f(p){return p===a||p===92?(e.consume(p),_):_(p)}}function Yh(e,n){let t;return r;function r(s){return yt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t=!0,r):hn(s)?un(e,r,t?"linePrefix":"lineSuffix")(s):n(s)}}const edt={name:"definition",tokenize:ndt},tdt={partial:!0,tokenize:rdt};function ndt(e,n,t){const r=this;let s;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return NM.call(r,e,o,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return s=xa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):t(m)}function c(m){return Un(m)?Yh(e,u)(m):u(m)}function u(m){return EM(e,_,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function _(m){return e.attempt(tdt,f,f)(m)}function f(m){return hn(m)?un(e,p,"whitespace")(m):p(m)}function p(m){return m===null||yt(m)?(e.exit("definition"),r.parser.defined.push(s),n(m)):t(m)}}function rdt(e,n,t){return r;function r(o){return Un(o)?Yh(e,s)(o):t(o)}function s(o){return zM(e,i,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return hn(o)?un(e,a,"whitespace")(o):a(o)}function a(o){return o===null||yt(o)?n(o):t(o)}}const sdt={name:"hardBreakEscape",tokenize:idt};function idt(e,n,t){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return yt(i)?(e.exit("hardBreakEscape"),n(i)):t(i)}}const adt={name:"headingAtx",resolve:odt,tokenize:ldt};function odt(e,n){let t=e.length-2,r=3,s,i;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},i={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ji(e,r,t-r+1,[["enter",s,n],["enter",i,n],["exit",i,n],["exit",s,n]])),e}function ldt(e,n,t){let r=0;return s;function s(_){return e.enter("atxHeading"),i(_)}function i(_){return e.enter("atxHeadingSequence"),a(_)}function a(_){return _===35&&r++<6?(e.consume(_),a):_===null||Un(_)?(e.exit("atxHeadingSequence"),o(_)):t(_)}function o(_){return _===35?(e.enter("atxHeadingSequence"),c(_)):_===null||yt(_)?(e.exit("atxHeading"),n(_)):hn(_)?un(e,o,"whitespace")(_):(e.enter("atxHeadingText"),u(_))}function c(_){return _===35?(e.consume(_),c):(e.exit("atxHeadingSequence"),o(_))}function u(_){return _===null||_===35||Un(_)?(e.exit("atxHeadingText"),o(_)):(e.consume(_),u)}}const cdt=["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"],O9=["pre","script","style","textarea"],udt={concrete:!0,name:"htmlFlow",resolveTo:hdt,tokenize:_dt},fdt={partial:!0,tokenize:mdt},ddt={partial:!0,tokenize:pdt};function hdt(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function _dt(e,n,t){const r=this;let s,i,a,o,c;return u;function u(W){return _(W)}function _(W){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(W),f}function f(W){return W===33?(e.consume(W),p):W===47?(e.consume(W),i=!0,S):W===63?(e.consume(W),s=3,r.interrupt?n:D):qs(W)?(e.consume(W),a=String.fromCharCode(W),b):t(W)}function p(W){return W===45?(e.consume(W),s=2,m):W===91?(e.consume(W),s=5,o=0,x):qs(W)?(e.consume(W),s=4,r.interrupt?n:D):t(W)}function m(W){return W===45?(e.consume(W),r.interrupt?n:D):t(W)}function x(W){const ie="CDATA[";return W===ie.charCodeAt(o++)?(e.consume(W),o===ie.length?r.interrupt?n:H:x):t(W)}function S(W){return qs(W)?(e.consume(W),a=String.fromCharCode(W),b):t(W)}function b(W){if(W===null||W===47||W===62||Un(W)){const ie=W===47,le=a.toLowerCase();return!ie&&!i&&O9.includes(le)?(s=1,r.interrupt?n(W):H(W)):cdt.includes(a.toLowerCase())?(s=6,ie?(e.consume(W),v):r.interrupt?n(W):H(W)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(W):i?y(W):w(W))}return W===45||js(W)?(e.consume(W),a+=String.fromCharCode(W),b):t(W)}function v(W){return W===62?(e.consume(W),r.interrupt?n:H):t(W)}function y(W){return hn(W)?(e.consume(W),y):O(W)}function w(W){return W===47?(e.consume(W),O):W===58||W===95||qs(W)?(e.consume(W),C):hn(W)?(e.consume(W),w):O(W)}function C(W){return W===45||W===46||W===58||W===95||js(W)?(e.consume(W),C):z(W)}function z(W){return W===61?(e.consume(W),E):hn(W)?(e.consume(W),z):w(W)}function E(W){return W===null||W===60||W===61||W===62||W===96?t(W):W===34||W===39?(e.consume(W),c=W,R):hn(W)?(e.consume(W),E):N(W)}function R(W){return W===c?(e.consume(W),c=null,M):W===null||yt(W)?t(W):(e.consume(W),R)}function N(W){return W===null||W===34||W===39||W===47||W===60||W===61||W===62||W===96||Un(W)?z(W):(e.consume(W),N)}function M(W){return W===47||W===62||hn(W)?w(W):t(W)}function O(W){return W===62?(e.consume(W),I):t(W)}function I(W){return W===null||yt(W)?H(W):hn(W)?(e.consume(W),I):t(W)}function H(W){return W===45&&s===2?(e.consume(W),q):W===60&&s===1?(e.consume(W),Q):W===62&&s===4?(e.consume(W),P):W===63&&s===3?(e.consume(W),D):W===93&&s===5?(e.consume(W),B):yt(W)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(fdt,X,U)(W)):W===null||yt(W)?(e.exit("htmlFlowData"),U(W)):(e.consume(W),H)}function U(W){return e.check(ddt,F,X)(W)}function F(W){return e.enter("lineEnding"),e.consume(W),e.exit("lineEnding"),Y}function Y(W){return W===null||yt(W)?U(W):(e.enter("htmlFlowData"),H(W))}function q(W){return W===45?(e.consume(W),D):H(W)}function Q(W){return W===47?(e.consume(W),a="",Z):H(W)}function Z(W){if(W===62){const ie=a.toLowerCase();return O9.includes(ie)?(e.consume(W),P):H(W)}return qs(W)&&a.length<8?(e.consume(W),a+=String.fromCharCode(W),Z):H(W)}function B(W){return W===93?(e.consume(W),D):H(W)}function D(W){return W===62?(e.consume(W),P):W===45&&s===2?(e.consume(W),D):H(W)}function P(W){return W===null||yt(W)?(e.exit("htmlFlowData"),X(W)):(e.consume(W),P)}function X(W){return e.exit("htmlFlow"),n(W)}}function pdt(e,n,t){const r=this;return s;function s(a){return yt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):t(a)}function i(a){return r.parser.lazy[r.now().line]?t(a):n(a)}}function mdt(e,n,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(r0,n,t)}}const gdt={name:"htmlText",tokenize:bdt};function bdt(e,n,t){const r=this;let s,i,a;return o;function o(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),c}function c(D){return D===33?(e.consume(D),u):D===47?(e.consume(D),z):D===63?(e.consume(D),w):qs(D)?(e.consume(D),N):t(D)}function u(D){return D===45?(e.consume(D),_):D===91?(e.consume(D),i=0,x):qs(D)?(e.consume(D),y):t(D)}function _(D){return D===45?(e.consume(D),m):t(D)}function f(D){return D===null?t(D):D===45?(e.consume(D),p):yt(D)?(a=f,Q(D)):(e.consume(D),f)}function p(D){return D===45?(e.consume(D),m):f(D)}function m(D){return D===62?q(D):D===45?p(D):f(D)}function x(D){const P="CDATA[";return D===P.charCodeAt(i++)?(e.consume(D),i===P.length?S:x):t(D)}function S(D){return D===null?t(D):D===93?(e.consume(D),b):yt(D)?(a=S,Q(D)):(e.consume(D),S)}function b(D){return D===93?(e.consume(D),v):S(D)}function v(D){return D===62?q(D):D===93?(e.consume(D),v):S(D)}function y(D){return D===null||D===62?q(D):yt(D)?(a=y,Q(D)):(e.consume(D),y)}function w(D){return D===null?t(D):D===63?(e.consume(D),C):yt(D)?(a=w,Q(D)):(e.consume(D),w)}function C(D){return D===62?q(D):w(D)}function z(D){return qs(D)?(e.consume(D),E):t(D)}function E(D){return D===45||js(D)?(e.consume(D),E):R(D)}function R(D){return yt(D)?(a=R,Q(D)):hn(D)?(e.consume(D),R):q(D)}function N(D){return D===45||js(D)?(e.consume(D),N):D===47||D===62||Un(D)?M(D):t(D)}function M(D){return D===47?(e.consume(D),q):D===58||D===95||qs(D)?(e.consume(D),O):yt(D)?(a=M,Q(D)):hn(D)?(e.consume(D),M):q(D)}function O(D){return D===45||D===46||D===58||D===95||js(D)?(e.consume(D),O):I(D)}function I(D){return D===61?(e.consume(D),H):yt(D)?(a=I,Q(D)):hn(D)?(e.consume(D),I):M(D)}function H(D){return D===null||D===60||D===61||D===62||D===96?t(D):D===34||D===39?(e.consume(D),s=D,U):yt(D)?(a=H,Q(D)):hn(D)?(e.consume(D),H):(e.consume(D),F)}function U(D){return D===s?(e.consume(D),s=void 0,Y):D===null?t(D):yt(D)?(a=U,Q(D)):(e.consume(D),U)}function F(D){return D===null||D===34||D===39||D===60||D===61||D===96?t(D):D===47||D===62||Un(D)?M(D):(e.consume(D),F)}function Y(D){return D===47||D===62||Un(D)?M(D):t(D)}function q(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),n):t(D)}function Q(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return hn(D)?un(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):B(D)}function B(D){return e.enter("htmlTextData"),a(D)}}const Z4={name:"labelEnd",resolveAll:wdt,resolveTo:Sdt,tokenize:kdt},vdt={tokenize:Cdt},xdt={tokenize:Edt},ydt={tokenize:Ndt};function wdt(e){let n=-1;const t=[];for(;++n=3&&(u===null||yt(u))?(e.exit("thematicBreak"),n(u)):t(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),hn(u)?un(e,o,"whitespace")(u):o(u))}}const ni={continuation:{tokenize:Idt},exit:$dt,name:"list",tokenize:Odt},Ldt={partial:!0,tokenize:Pdt},Ddt={partial:!0,tokenize:Bdt};function Odt(e,n,t){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return o;function o(m){const x=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:u2(m)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ym,t,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return t(m)}function c(m){return u2(m)&&++a<10?(e.consume(m),c):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):t(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(r0,r.interrupt?t:_,e.attempt(Ldt,p,f))}function _(m){return r.containerState.initialBlankLine=!0,i++,p(m)}function f(m){return hn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):t(m)}function p(m){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(m)}}function Idt(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(r0,s,i);function s(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,un(e,n,"listItemIndent",r.containerState.size+1)(o)}function i(o){return r.containerState.furtherBlankLines||!hn(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(Ddt,n,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,un(e,e.attempt(ni,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Bdt(e,n,t){const r=this;return un(e,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?n(i):t(i)}}function $dt(e){e.exit(this.containerState.type)}function Pdt(e,n,t){const r=this;return un(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!hn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?n(i):t(i)}}const I9={name:"setextUnderline",resolveTo:Hdt,tokenize:Fdt};function Hdt(e,n){let t=e.length,r,s,i;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(s=t)}else e[t][1].type==="content"&&e.splice(t,1),!i&&e[t][1].type==="definition"&&(i=t);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",a,n]),e.splice(i+1,0,["exit",e[r][1],n]),e[r][1].end={...e[i][1].end}):e[r][1]=a,e.push(["exit",a,n]),e}function Fdt(e,n,t){const r=this;let s;return i;function i(u){let _=r.events.length,f;for(;_--;)if(r.events[_][1].type!=="lineEnding"&&r.events[_][1].type!=="linePrefix"&&r.events[_][1].type!=="content"){f=r.events[_][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),s=u,a(u)):t(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===s?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),hn(u)?un(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||yt(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Udt={tokenize:qdt};function qdt(e){const n=this,t=e.attempt(r0,r,e.attempt(this.parser.constructs.flowInitial,s,un(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Yft,s)),"linePrefix")));return t;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Gdt={resolveAll:TM()},Vdt=jM("string"),Wdt=jM("text");function jM(e){return{resolveAll:TM(e==="text"?Kdt:void 0),tokenize:n};function n(t){const r=this,s=this.parser.constructs[e],i=t.attempt(s,a,o);return a;function a(_){return u(_)?i(_):o(_)}function o(_){if(_===null){t.consume(_);return}return t.enter("data"),t.consume(_),c}function c(_){return u(_)?(t.exit("data"),i(_)):(t.consume(_),c)}function u(_){if(_===null)return!0;const f=s[_];let p=-1;if(f)for(;++p-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}i>0&&a.push(e[s].slice(0,i))}return a}function oht(e,n){let t=-1;const r=[];let s;for(;++t0){const Ht=Je.tokenStack[Je.tokenStack.length-1];(Ht[1]||$9).call(Je,void 0,Ht[0])}for(Oe.position={start:Wl(ve.length>0?ve[0][1].start:{line:1,column:1,offset:0}),end:Wl(ve.length>0?ve[ve.length-2][1].end:{line:1,column:1,offset:0})},mt=-1;++mt0&&(gs(this,tc,rr(this,tc)+t.slice(0,r.commitIndex)),t=t.slice(r.commitIndex),r=P9(t)),rr(this,tc)+jht(t,r)}}tc=new WeakMap;const bht=new Set(["*","**","_","__"]);function P9(e){const n={commitIndex:0,delims:[],exclusive:null,links:[],pendingDelim:null,pendingHtml:null};for(let t=0;tt){t=s-1;continue}if(n.exclusive)continue;if(zht(n)){H9(n,t,r);continue}const i=Sht(n,e,t);if(i>t){t=i-1;continue}const a=kht(n,e,t);if(a>t){t=a-1;continue}ya(e,t)||H9(n,t,r)}return n}function vht(e,n,t){const r=n[t];return r==="`"?xht(e,n,t):r==="$"?yht(e,n,t):r==="~"?wht(e,n,t):t}function xht(e,n,t){const r=J4(n,t),s="`".repeat(r),i=e.exclusive;return(i==null?void 0:i.kind)==="fence"?(i.token[0]==="`"&&ig(n,t)&&!ya(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):(i==null?void 0:i.kind)==="code"?(!ya(n,t)&&r>=i.token.length&&(e.exclusive=null),t+r):i||ya(n,t)?t+r:r>=3&&ig(n,t)?(e.exclusive={kind:"fence",start:t,token:s},t+r):(e.exclusive={kind:"code",start:t,token:s},t+r)}function yht(e,n,t){const r=J4(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="math"?(!ya(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):(s||ya(n,t)||(e.exclusive={kind:"math",start:t,token:r>=2?"$$":"$"}),t+r)}function wht(e,n,t){const r=J4(n,t),s=e.exclusive;return(s==null?void 0:s.kind)==="fence"&&s.token[0]==="~"?(ig(n,t)&&!ya(n,t)&&r>=s.token.length&&(e.exclusive=null),t+r):s||r<3||!ig(n,t)||ya(n,t)?t:(e.exclusive={kind:"fence",start:t,token:"~".repeat(r)},t+r)}function Sht(e,n,t){if(n[t]!=="<"||ya(n,t))return t;const r=n[t+1];if(r!==void 0&&!DM(r))return t;e.pendingHtml=t;for(let s=t+1;s"||n[s]===` +`)return e.pendingHtml=null,s+1;return n.length}function kht(e,n,t){const r=Cht(n,t);if(!r)return t;if(ya(n,t))return t+r.length;const s=e.delims.findLastIndex(i=>i.token===r);return s!==-1?(e.delims.splice(s,1),t+r.length):t+r.length===n.length?(e.pendingDelim={start:t,token:r},t+r.length):(Eht(n,t,r)&&e.delims.push({start:t,token:r}),t+r.length)}function Cht(e,n){const t=e[n];if(t==="*")return e.startsWith("***",n)?"***":e.startsWith("**",n)?"**":"*";if(t==="_")return e.startsWith("__",n)?"__":"_";if(t==="~"&&e.startsWith("~~",n))return"~~"}function Eht(e,n,t){const r=e[n+t.length];if(!r||/\s/.test(r))return!1;const s=e[n-1];return!q9(s)||!q9(r)}function H9(e,n,t){const r=e.links.at(-1);if(t==="["){e.links.push({phase:"text",start:n});return}if(t==="]"&&(r==null?void 0:r.phase)==="text"){e.links[e.links.length-1]={phase:"url_wait",start:r.start,textEnd:n};return}if(t==="("&&(r==null?void 0:r.phase)==="url_wait"){e.links[e.links.length-1]={phase:"url",start:r.start,textEnd:r.textEnd,parenDepth:0};return}if(t==="("&&(r==null?void 0:r.phase)==="url"){r.parenDepth+=1;return}if(t===")"&&(r==null?void 0:r.phase)==="url"){if(r.parenDepth>0){r.parenDepth-=1;return}e.links.pop()}}function Nht(e){var n,t;e.delims.length=0,e.links.length=0,((n=e.exclusive)==null?void 0:n.kind)!=="fence"&&(((t=e.exclusive)==null?void 0:t.kind)==="math"&&e.exclusive.token==="$$"||(e.exclusive=null))}function zht(e){var t;const n=(t=e.links.at(-1))==null?void 0:t.phase;return n==="url_wait"||n==="url"}function jht(e,n){n.pendingHtml!==null&&(e=e.slice(0,Rht(e,n.pendingHtml)));const t=n.links.at(-1);if(t)return Ua(Tht(e,t));const r=Aht(n);if(r)return Ua(Of(e,r));const s=Dht(n);return s?s.kind==="delim"?Ua(v2(e,s.start,s.token.length)?MM(e,s.token):e.slice(0,s.start)):v2(e,s.start,s.token.length)?s.kind==="fence"?Ua(e):s.kind==="code"?Ua(Of(e,s.token)):s.token==="$$"?Ua(Of(e,(e.endsWith(` +`)?"":` +`)+"$$")):/\s/.test(e[e.length-1]??"")?Ua(e):Ua(Of(e,"$")):Ua(s.kind==="fence"?e:e.slice(0,s.start)):Ua(n.pendingDelim?e.slice(0,n.pendingDelim.start):e)}function Tht(e,n){const t=e.slice(0,n.start);if(n.phase==="text")return v2(e,n.start,1)?t+e.slice(n.start+1):t;const r=e.slice(n.start+1,n.textEnd);return n.phase==="url_wait"?t+r+e.slice(n.textEnd+1):t+r}function Aht(e){const n=[];if(e.exclusive){if(e.exclusive.kind!=="code")return;n.push(e.exclusive.token)}for(let t=e.delims.length-1;t>=0;t--){const r=e.delims[t].token;if(!bht.has(r))return;n.push(r)}if(!(n.length<2))return n.join("")}function Rht(e,n){let t=n,r=n;for(;r>0;){const s=e.lastIndexOf("<",r-1);if(s===-1||!Mht(e,s,r))break;t=s,r=s}return t}function Mht(e,n,t){if(e[t-1]!==">"||ya(e,n))return!1;const r=e[n+1];if(r!==void 0&&!DM(r))return!1;for(let s=n+1;s"||i===` +`)return!1}return!0}function Ua(e){var b;const n=e.lastIndexOf(` + +`),t=n===-1?0:n+2,r=e.slice(0,t),s=e.slice(t),i=s.indexOf(` +`),a=i===-1?s:s.slice(0,i),o=(b=a.match(/^( *)\|/))==null?void 0:b[1];if(o===void 0)return e;if(F9(a)<2&&!Oht(a,o))return r;const c=a.trimEnd().endsWith("|")?a:MM(a," |"),u=F9(c),_=u<2?0:c.trimEnd().endsWith("|")?u-1:u;if(_===0)return e;const f=i===-1?"":s.slice(i+1),p=U9(o,Array.from({length:_},()=>"-"));if(f.length===0)return r+c+` +`+p;const m=f.indexOf(` +`),x=m===-1?f:f.slice(0,m),S=m===-1?"":f.slice(m);if(Iht(x,o,_))return e;if(x.startsWith(o+"|")&&/^[ |:\-\t]*$/.test(x.slice(o.length))){const v=LM(x,o).map(y=>{const w=y.trim();if(w.length===0)return"-";let C=0;for(let z=0;z1&&w.endsWith(":")?":":"")});for(;v.length<_;)v.push("-");return r+c+` +`+U9(o,v)+S}return r+c+` +`+p+` +`+f}function Of(e,n){return e+n.slice(Lht(e,n))}function MM(e,n){var s;const t=(s=e.match(/[^\S\n]+$/))==null?void 0:s[0];if(!t)return Of(e,n);const r=e.slice(0,-t.length);return Of(r,n)+t}function Lht(e,n){for(let t=Math.min(e.length,n.length);t>0;t-=1)if(e.endsWith(n.slice(0,t)))return t;return 0}function Dht(e){const n=e.delims.at(-1);return e.exclusive&&(!n||e.exclusive.start>n.start)?e.exclusive:n?{kind:"delim",start:n.start,token:n.token}:e.exclusive}function F9(e){let n=0;for(let t=0;t0}function U9(e,n){return e+"|"+n.map(t=>` ${t} |`).join("")}function LM(e,n){const t=e.slice(n.length+1).split("|");return e.trimEnd().endsWith("|")&&t.pop(),t}function Iht(e,n,t){if(!e.startsWith(n))return!1;const r=e.slice(n.length).trim();if(!r.startsWith("|")||!r.endsWith("|"))return!1;const s=LM(r,"").map(i=>i.trim());return s.length===t&&s.every(i=>/^:?-+:?$/.test(i))}function J4(e,n){let t=n+1;for(;tn+t}function ig(e,n){return n===0||e[n-1]===` +`}function ya(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r--)t+=1;return t%2===1}function q9(e){return!!e&&/[A-Za-z0-9]/.test(e)}function DM(e){return!!e&&/[A-Za-z]/.test(e)}const OM=G4().use(Q4);var $_,Zf,Qf,hu,Jf,P_,H_,F_,_u,U_,pu;class Bht{constructor(){wi(this,$_,OM);wi(this,Zf,null);wi(this,Qf,{});wi(this,hu,null);wi(this,Jf,"");wi(this,P_,[]);wi(this,H_,[]);wi(this,F_,[]);wi(this,_u,0);wi(this,U_,[]);wi(this,pu,[])}reconfigure(n,t,r){rr(this,Zf)!==null&&rr(this,$_)===n&&IM(rr(this,Qf),r)&&!!rr(this,hu)===t||(gs(this,$_,n),n.attachers.some(s=>s[0]===sg)||(n=n(),n.use(sg),n.freeze()),gs(this,Zf,n),gs(this,Qf,r),gs(this,Jf,""),gs(this,P_,[]),gs(this,H_,[]),gs(this,F_,[]),gs(this,_u,0),gs(this,U_,[]),gs(this,hu,t?new ght:null))}update(n){rr(this,hu)&&(n=rr(this,hu).update(n));let t=rr(this,Jf);if(n===t)return rr(this,pu);const r=rr(this,P_),s=$ht(n,t);let i=r.length-1;for(;i>=0&&!(s>=r[i]);i-=1);let a=r[i]??0;i===-1&&(i=0);const o=Jc(rr(this,Zf)),c=rr(this,H_),u=c.slice(i).some(E=>E.some(x2));let _=o.parse(n.slice(a)),f=_.children.map(E=>Jc(Jc(E.position).start.offset)+a);gs(this,Jf,n),gx(r.length===c.length),r.splice(i,r.length-i,...f);{const E=Tx(_,f,a);gx(E.length===f.length),c.splice(i,c.length-i,...E)}if(u||x2(_)){i=0,a=0,_=o.parse(n),f=_.children.map(R=>Jc(Jc(R.position).start.offset)+a),r.splice(0,r.length,...f);const E=Tx(_,f,a);gx(E.length===f.length),c.splice(0,c.length,...E)}const p=Tx(o.runSync(_),f,a),m=rr(this,F_),x=rr(this,U_),S=rr(this,pu),b=x.length;let v=null,y=0;for(;yb&&(m.length=x.length=r.length);for(let E=r.length=C?M=b-(r.length-R):R=b){m[R]=String(rr(this,_u)),gs(this,_u,rr(this,_u)+1),x[R]=null,v&&(v[R]=void 0);continue}m[R]=m[M]??String(Gk(this,_u)._++),x[R]=x[M]??null,v&&(v[R]=S[M])}r.length[]);let s=0;for(const a of e.children){const o=(i=a.position)==null?void 0:i.start.offset;if(o!==void 0){for(;s+1s||t!==-1&&n>t||r!==-1&&n>r||Vht.test(e.slice(0,n))?e:""}const K9=/[#.]/g;function Qht(e,n){const t=e||"",r={};let s=0,i,a;for(;su&&(u=_):_&&(u!==void 0&&u>-1&&c.push(` +`.repeat(u)||" "),u=-1,c.push(_))}return c.join("")}function qM(e,n,t){return e.type==="element"?x_t(e,n,t):e.type==="text"?t.whitespace==="normal"?GM(e,t):y_t(e):[]}function x_t(e,n,t){const r=VM(e,t),s=e.children||[];let i=-1,a=[];if(b_t(e))return a;let o,c;for(w2(e)||tE(e)&&Z9(n,e,tE)?c=` +`:g_t(e)?(o=2,c=2):UM(e)&&(o=1,c=1);++i15?u="…"+o.slice(s-15,s):u=o.slice(0,s);var _;i+15e.replace(E_t,"-$1").toLowerCase(),z_t={"&":"&",">":">","<":"<",'"':""","'":"'"},j_t=/[&><"']/g,As=e=>String(e).replace(j_t,n=>z_t[n]),wm=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?wm(e.body[0]):e:e.type==="font"?wm(e.body):e,T_t=new Set(["mathord","textord","atom"]),ol=e=>T_t.has(wm(e).type),A_t=e=>{var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},S2={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,n)=>(n.push(e),n)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand ",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function R_t(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function M_t(e){if(e.default!==void 0)return e.default;var n=Array.isArray(e.type)?e.type[0]:e.type;return R_t(n)}function L_t(e,n,t,r){var s=t[n];e[n]=s!==void 0?r.processor?r.processor(s):s:M_t(r)}class t5{constructor(n){n===void 0&&(n={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,n=n||{};for(var t of Object.keys(S2)){var r=S2[t];r&&L_t(this,t,n,r)}}reportNonstrict(n,t,r){var s=this.strict;if(typeof s=="function"&&(s=s(n,t,r)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new We("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+n+"]"),r);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]"))}}useStrictBehavior(n,t,r){var s=this.strict;if(typeof s=="function")try{s=s(n,t,r)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+n+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+t+" ["+n+"]")),!1)}isTrusted(n){if("url"in n&&n.url&&!n.protocol){var t=A_t(n.url);if(t==null)return!1;n.protocol=t}var r=typeof this.trust=="function"?this.trust(n):this.trust;return!!r}}class Kl{constructor(n,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=n,this.size=t,this.cramped=r}sup(){return Ka[D_t[this.id]]}sub(){return Ka[O_t[this.id]]}fracNum(){return Ka[I_t[this.id]]}fracDen(){return Ka[B_t[this.id]]}cramp(){return Ka[$_t[this.id]]}text(){return Ka[P_t[this.id]]}isTight(){return this.size>=2}}var n5=0,ag=1,Gf=2,el=3,x_=4,Zi=5,od=6,Gs=7,Ka=[new Kl(n5,0,!1),new Kl(ag,0,!0),new Kl(Gf,1,!1),new Kl(el,1,!0),new Kl(x_,2,!1),new Kl(Zi,2,!0),new Kl(od,3,!1),new Kl(Gs,3,!0)],D_t=[x_,Zi,x_,Zi,od,Gs,od,Gs],O_t=[Zi,Zi,Zi,Zi,Gs,Gs,Gs,Gs],I_t=[Gf,el,x_,Zi,od,Gs,od,Gs],B_t=[el,el,Zi,Zi,Gs,Gs,Gs,Gs],$_t=[ag,ag,el,el,Zi,Zi,Gs,Gs],P_t=[n5,ag,Gf,el,Gf,el,Gf,el],Gt={DISPLAY:Ka[n5],TEXT:Ka[Gf],SCRIPT:Ka[x_],SCRIPTSCRIPT:Ka[od]},k2=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function H_t(e){for(var n=0;n=s[0]&&e<=s[1])return t.name}return null}var Sm=[];k2.forEach(e=>e.blocks.forEach(n=>Sm.push(...n)));function WM(e){for(var n=0;n=Sm[n]&&e<=Sm[n+1])return!0;return!1}var Jr=e=>e+" "+e,kf=80,F_t=function(n,t){return"M95,"+(622+n+t)+` +c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 +c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 +c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 +s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 +c69,-144,104.5,-217.7,106.5,-221 +l`+n/2.075+" -"+n+` +c5.3,-9.3,12,-14,20,-14 +H400000v`+(40+n)+`H845.2724 +s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 +c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z +M`+(834+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},U_t=function(n,t){return"M263,"+(601+n+t)+`c0.7,0,18,39.7,52,119 +c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 +c340,-704.7,510.7,-1060.3,512,-1067 +l`+n/2.084+" -"+n+` +c4.7,-7.3,11,-11,19,-11 +H40000v`+(40+n)+`H1012.3 +s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 +c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 +s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 +c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},q_t=function(n,t){return"M983 "+(10+n+t)+` +l`+n/3.13+" -"+n+` +c4,-6.7,10,-10,18,-10 H400000v`+(40+n)+` +H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 +s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 +c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 +c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 +c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 +c53.7,-170.3,84.5,-266.8,92.5,-289.5z +M`+(1001+n)+" "+t+"h400000v"+(40+n)+"h-400000z"},G_t=function(n,t){return"M424,"+(2398+n+t)+` +c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 +c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 +s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 +s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 +l`+n/4.223+" -"+n+`c4,-6.7,10,-10,18,-10 H400000 +v`+(40+n)+`H1014.6 +s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 +c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2z M`+(1001+n)+" "+t+` +h400000v`+(40+n)+"h-400000z"},V_t=function(n,t){return"M473,"+(2713+n+t)+` +c339.3,-1799.3,509.3,-2700,510,-2702 l`+n/5.298+" -"+n+` +c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+n)+`H1017.7 +s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 +c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 +c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 +s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, +606zM`+(1001+n)+" "+t+"h400000v"+(40+n)+"H1017.7z"},W_t=function(n){var t=n/2;return"M400000 "+n+" H0 L"+t+" 0 l65 45 L145 "+(n-80)+" H400000z"},K_t=function(n,t,r){var s=r-54-t-n;return"M702 "+(n+t)+"H400000"+(40+n)+` +H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 +h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 +c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 +219 661 l218 661zM702 `+t+"H400000v"+(40+n)+"H742z"},Y_t=function(n,t,r){t=1e3*t;var s="";switch(n){case"sqrtMain":s=F_t(t,kf);break;case"sqrtSize1":s=U_t(t,kf);break;case"sqrtSize2":s=q_t(t,kf);break;case"sqrtSize3":s=G_t(t,kf);break;case"sqrtSize4":s=V_t(t,kf);break;case"sqrtTall":s=K_t(t,kf,r)}return s},X_t=function(n,t){switch(n){case"⎜":return Jr("M291 0 H417 V"+t+" H291z");case"∣":return Jr("M145 0 H188 V"+t+" H145z");case"∥":return Jr("M145 0 H188 V"+t+" H145z")+Jr("M367 0 H410 V"+t+" H367z");case"⎟":return Jr("M457 0 H583 V"+t+" H457z");case"⎢":return Jr("M319 0 H403 V"+t+" H319z");case"⎥":return Jr("M263 0 H347 V"+t+" H263z");case"⎪":return Jr("M384 0 H504 V"+t+" H384z");case"⏐":return Jr("M312 0 H355 V"+t+" H312z");case"‖":return Jr("M257 0 H300 V"+t+" H257z")+Jr("M478 0 H521 V"+t+" H478z");default:return""}},nE={doubleleftarrow:`M262 157 +l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 + 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 + 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 +c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 + 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 +-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 +-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z +m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l +-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 + 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 +-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 +-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 +-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 +c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 +-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 + 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 +-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 +c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 + 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 + 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 + l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 +-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 + 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 + 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 + 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 +-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 +H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 + 435 0h399565z`,leftgroupunder:`M400000 262 +H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 + 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 +-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 +-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 +-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 + 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 +-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 +-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z +m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 + 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 + 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 +-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 + 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 +-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 +v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 +-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 +-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 + 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Jr("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Jr("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Jr("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Jr("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 +-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 +c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 + 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Jr("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334 +c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 +-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 + 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 + 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 +c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 + 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 + 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 +-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 +-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z +m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 +60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 +-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z +m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 +c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 +-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z +m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 +85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 +-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z +m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 +c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 +-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 + 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 + 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 +-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 + 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l +-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 +s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 +c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 + 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 +-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 + 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 + 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 +-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 +-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 + 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 +-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 + 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z +m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 + 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 +-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 +-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 + 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 + 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 +-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z +m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 + 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 +-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 + 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Jr("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Jr("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Jr("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 + 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 +-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 +-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 + 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 +-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 +-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 +-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 + 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 +c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 + 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 + 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 +-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 + 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 +-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 + 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 + 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 +-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 +-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 + 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 +c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 + 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 +-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 + 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 + 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 + -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 +-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 + 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 + 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 + -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 +3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 +10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 +-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 +-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 +H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 +c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 +c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 +-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, +-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, +-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 +c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 +c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 +s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 +121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 +s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 +c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z +M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 +-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 +13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 +-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 +-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 +-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 +151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 +c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 +c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 +c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z +M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 +c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, +1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, +-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z +M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 +c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, +-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 +c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z +M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Z_t=function(n,t){switch(n){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 v84 h347 v-84 +H403z M403 1759 V0 H319 V1759 v`+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z +M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z +M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 +c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 +c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z +MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z +MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z +M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z +M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 +c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, +-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, +949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 +c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, +-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 +l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, +-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, +63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 +c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` +c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 +c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 +c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 +c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 +l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function Q_t(e){return"toText"in e}class Nd{constructor(n){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=n,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(n){return this.classes.includes(n)}toNode(){for(var n=document.createDocumentFragment(),t=0;t{if(Q_t(n))return n.toText();throw new Error("Expected MathDomNode with toText, got "+n.constructor.name)}).join("")}}var C2={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},J_t={ex:!0,em:!0,mu:!0},KM=function(n){return typeof n!="string"&&(n=n.unit),n in C2||n in J_t||n==="ex"},dr=function(n,t){var r;if(n.unit in C2)r=C2[n.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(n.unit==="mu")r=t.fontMetrics().cssEmPerMu;else{var s;if(t.style.isTight()?s=t.havingStyle(t.style.text()):s=t,n.unit==="ex")r=s.fontMetrics().xHeight;else if(n.unit==="em")r=s.fontMetrics().quad;else throw new We("Invalid unit: '"+n.unit+"'");s!==t&&(r*=s.sizeMultiplier/t.sizeMultiplier)}return Math.min(n.number*r,t.maxSize)},Ze=function(n){return+n.toFixed(4)+"em"},fc=function(n){return n.filter(t=>t).join(" ")},r5=function(n){var t="";for(var r of Object.keys(n)){var s=n[r];s!==void 0&&(t+=N_t(r)+":"+s+";")}return t},YM=function(n,t,r){if(this.classes=n||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var s=t.getColor();s&&(this.style.color=s)}},XM=function(n){var t=document.createElement(n);t.className=fc(this.classes),Object.assign(t.style,this.style);for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s/=\x00-\x1f]/,ZM=function(n){var t="<"+n;this.classes.length&&(t+=' class="'+As(fc(this.classes))+'"');var r=r5(this.style);r&&(t+=' style="'+As(r)+'"');for(var s of Object.keys(this.attributes)){if(e0t.test(s))throw new We("Invalid attribute name '"+s+"'");t+=" "+s+'="'+As(this.attributes[s])+'"'}t+=">";for(var i=0;i",t};class zd{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,YM.call(this,n,r,s),this.children=t||[]}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return XM.call(this,"span")}toMarkup(){return ZM.call(this,"span")}}class e1{constructor(n,t,r,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,YM.call(this,t,s),this.children=r||[],this.setAttribute("href",n)}setAttribute(n,t){this.attributes[n]=t}hasClass(n){return this.classes.includes(n)}toNode(){return XM.call(this,"a")}toMarkup(){return ZM.call(this,"a")}}class t0t{constructor(n,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=n,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(n){return this.classes.includes(n)}toNode(){var n=document.createElement("img");return n.src=this.src,n.alt=this.alt,n.className="mord",Object.assign(n.style,this.style),n}toMarkup(){var n=''+As(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=Ze(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=fc(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(n),t):n}toMarkup(){var n=!1,t="0&&(r+="margin-right:"+Ze(this.italic)+";"),r+=r5(this.style),r&&(n=!0,t+=' style="'+As(r)+'"');var s=As(this.text);return n?(t+=">",t+=s,t+="",t):s}}class rl{constructor(n,t){this.children=void 0,this.attributes=void 0,this.children=n||[],this.attributes=t||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"svg");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var s=0;s':''}}class E2{constructor(n){this.attributes=void 0,this.attributes=n||{}}toNode(){var n="http://www.w3.org/2000/svg",t=document.createElementNS(n,"line");for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);return t}toMarkup(){var n=" but got "+String(e)+".")}var i0t=e=>e instanceof zd||e instanceof e1||e instanceof Nd,Za={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Dp={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},rE={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function a0t(e,n){Za[e]=n}function s5(e,n,t){if(!Za[n])throw new Error("Font metrics not found for font: "+n+".");var r=e.charCodeAt(0),s=Za[n][r];if(!s&&e[0]in rE&&(r=rE[e[0]].charCodeAt(0),s=Za[n][r]),!s&&t==="text"&&WM(r)&&(s=Za[n][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var Mx={};function o0t(e){var n;if(e>=5?n=0:e>=3?n=1:n=2,!Mx[n]){var t=Mx[n]={cssEmPerMu:Dp.quad[n]/18};for(var r in Dp)Dp.hasOwnProperty(r)&&(t[r]=Dp[r][n])}return Mx[n]}var ir={math:{},text:{}};function $(e,n,t,r,s,i){ir[e][s]={font:n,group:t,replace:r},i&&r&&(ir[e][r]=ir[e][s])}var V="math",Pe="text",ee="main",fe="ams",or="accent-token",lt="bin",Ws="close",jd="inner",Rt="mathord",$r="op-token",Di="open",s0="punct",he="rel",ll="spacing",ge="textord";$(V,ee,he,"≡","\\equiv",!0);$(V,ee,he,"≺","\\prec",!0);$(V,ee,he,"≻","\\succ",!0);$(V,ee,he,"∼","\\sim",!0);$(V,ee,he,"⊥","\\perp");$(V,ee,he,"⪯","\\preceq",!0);$(V,ee,he,"⪰","\\succeq",!0);$(V,ee,he,"≃","\\simeq",!0);$(V,ee,he,"∣","\\mid",!0);$(V,ee,he,"≪","\\ll",!0);$(V,ee,he,"≫","\\gg",!0);$(V,ee,he,"≍","\\asymp",!0);$(V,ee,he,"∥","\\parallel");$(V,ee,he,"⋈","\\bowtie",!0);$(V,ee,he,"⌣","\\smile",!0);$(V,ee,he,"⊑","\\sqsubseteq",!0);$(V,ee,he,"⊒","\\sqsupseteq",!0);$(V,ee,he,"≐","\\doteq",!0);$(V,ee,he,"⌢","\\frown",!0);$(V,ee,he,"∋","\\ni",!0);$(V,ee,he,"∝","\\propto",!0);$(V,ee,he,"⊢","\\vdash",!0);$(V,ee,he,"⊣","\\dashv",!0);$(V,ee,he,"∋","\\owns");$(V,ee,s0,".","\\ldotp");$(V,ee,s0,"⋅","\\cdotp");$(V,ee,s0,"⋅","·");$(Pe,ee,ge,"⋅","·");$(V,ee,ge,"#","\\#");$(Pe,ee,ge,"#","\\#");$(V,ee,ge,"&","\\&");$(Pe,ee,ge,"&","\\&");$(V,ee,ge,"ℵ","\\aleph",!0);$(V,ee,ge,"∀","\\forall",!0);$(V,ee,ge,"ℏ","\\hbar",!0);$(V,ee,ge,"∃","\\exists",!0);$(V,ee,ge,"∇","\\nabla",!0);$(V,ee,ge,"♭","\\flat",!0);$(V,ee,ge,"ℓ","\\ell",!0);$(V,ee,ge,"♮","\\natural",!0);$(V,ee,ge,"♣","\\clubsuit",!0);$(V,ee,ge,"℘","\\wp",!0);$(V,ee,ge,"♯","\\sharp",!0);$(V,ee,ge,"♢","\\diamondsuit",!0);$(V,ee,ge,"ℜ","\\Re",!0);$(V,ee,ge,"♡","\\heartsuit",!0);$(V,ee,ge,"ℑ","\\Im",!0);$(V,ee,ge,"♠","\\spadesuit",!0);$(V,ee,ge,"§","\\S",!0);$(Pe,ee,ge,"§","\\S");$(V,ee,ge,"¶","\\P",!0);$(Pe,ee,ge,"¶","\\P");$(V,ee,ge,"†","\\dag");$(Pe,ee,ge,"†","\\dag");$(Pe,ee,ge,"†","\\textdagger");$(V,ee,ge,"‡","\\ddag");$(Pe,ee,ge,"‡","\\ddag");$(Pe,ee,ge,"‡","\\textdaggerdbl");$(V,ee,Ws,"⎱","\\rmoustache",!0);$(V,ee,Di,"⎰","\\lmoustache",!0);$(V,ee,Ws,"⟯","\\rgroup",!0);$(V,ee,Di,"⟮","\\lgroup",!0);$(V,ee,lt,"∓","\\mp",!0);$(V,ee,lt,"⊖","\\ominus",!0);$(V,ee,lt,"⊎","\\uplus",!0);$(V,ee,lt,"⊓","\\sqcap",!0);$(V,ee,lt,"∗","\\ast");$(V,ee,lt,"⊔","\\sqcup",!0);$(V,ee,lt,"◯","\\bigcirc",!0);$(V,ee,lt,"∙","\\bullet",!0);$(V,ee,lt,"‡","\\ddagger");$(V,ee,lt,"≀","\\wr",!0);$(V,ee,lt,"⨿","\\amalg");$(V,ee,lt,"&","\\And");$(V,ee,he,"⟵","\\longleftarrow",!0);$(V,ee,he,"⇐","\\Leftarrow",!0);$(V,ee,he,"⟸","\\Longleftarrow",!0);$(V,ee,he,"⟶","\\longrightarrow",!0);$(V,ee,he,"⇒","\\Rightarrow",!0);$(V,ee,he,"⟹","\\Longrightarrow",!0);$(V,ee,he,"↔","\\leftrightarrow",!0);$(V,ee,he,"⟷","\\longleftrightarrow",!0);$(V,ee,he,"⇔","\\Leftrightarrow",!0);$(V,ee,he,"⟺","\\Longleftrightarrow",!0);$(V,ee,he,"↦","\\mapsto",!0);$(V,ee,he,"⟼","\\longmapsto",!0);$(V,ee,he,"↗","\\nearrow",!0);$(V,ee,he,"↩","\\hookleftarrow",!0);$(V,ee,he,"↪","\\hookrightarrow",!0);$(V,ee,he,"↘","\\searrow",!0);$(V,ee,he,"↼","\\leftharpoonup",!0);$(V,ee,he,"⇀","\\rightharpoonup",!0);$(V,ee,he,"↙","\\swarrow",!0);$(V,ee,he,"↽","\\leftharpoondown",!0);$(V,ee,he,"⇁","\\rightharpoondown",!0);$(V,ee,he,"↖","\\nwarrow",!0);$(V,ee,he,"⇌","\\rightleftharpoons",!0);$(V,fe,he,"≮","\\nless",!0);$(V,fe,he,"","\\@nleqslant");$(V,fe,he,"","\\@nleqq");$(V,fe,he,"⪇","\\lneq",!0);$(V,fe,he,"≨","\\lneqq",!0);$(V,fe,he,"","\\@lvertneqq");$(V,fe,he,"⋦","\\lnsim",!0);$(V,fe,he,"⪉","\\lnapprox",!0);$(V,fe,he,"⊀","\\nprec",!0);$(V,fe,he,"⋠","\\npreceq",!0);$(V,fe,he,"⋨","\\precnsim",!0);$(V,fe,he,"⪹","\\precnapprox",!0);$(V,fe,he,"≁","\\nsim",!0);$(V,fe,he,"","\\@nshortmid");$(V,fe,he,"∤","\\nmid",!0);$(V,fe,he,"⊬","\\nvdash",!0);$(V,fe,he,"⊭","\\nvDash",!0);$(V,fe,he,"⋪","\\ntriangleleft");$(V,fe,he,"⋬","\\ntrianglelefteq",!0);$(V,fe,he,"⊊","\\subsetneq",!0);$(V,fe,he,"","\\@varsubsetneq");$(V,fe,he,"⫋","\\subsetneqq",!0);$(V,fe,he,"","\\@varsubsetneqq");$(V,fe,he,"≯","\\ngtr",!0);$(V,fe,he,"","\\@ngeqslant");$(V,fe,he,"","\\@ngeqq");$(V,fe,he,"⪈","\\gneq",!0);$(V,fe,he,"≩","\\gneqq",!0);$(V,fe,he,"","\\@gvertneqq");$(V,fe,he,"⋧","\\gnsim",!0);$(V,fe,he,"⪊","\\gnapprox",!0);$(V,fe,he,"⊁","\\nsucc",!0);$(V,fe,he,"⋡","\\nsucceq",!0);$(V,fe,he,"⋩","\\succnsim",!0);$(V,fe,he,"⪺","\\succnapprox",!0);$(V,fe,he,"≆","\\ncong",!0);$(V,fe,he,"","\\@nshortparallel");$(V,fe,he,"∦","\\nparallel",!0);$(V,fe,he,"⊯","\\nVDash",!0);$(V,fe,he,"⋫","\\ntriangleright");$(V,fe,he,"⋭","\\ntrianglerighteq",!0);$(V,fe,he,"","\\@nsupseteqq");$(V,fe,he,"⊋","\\supsetneq",!0);$(V,fe,he,"","\\@varsupsetneq");$(V,fe,he,"⫌","\\supsetneqq",!0);$(V,fe,he,"","\\@varsupsetneqq");$(V,fe,he,"⊮","\\nVdash",!0);$(V,fe,he,"⪵","\\precneqq",!0);$(V,fe,he,"⪶","\\succneqq",!0);$(V,fe,he,"","\\@nsubseteqq");$(V,fe,lt,"⊴","\\unlhd");$(V,fe,lt,"⊵","\\unrhd");$(V,fe,he,"↚","\\nleftarrow",!0);$(V,fe,he,"↛","\\nrightarrow",!0);$(V,fe,he,"⇍","\\nLeftarrow",!0);$(V,fe,he,"⇏","\\nRightarrow",!0);$(V,fe,he,"↮","\\nleftrightarrow",!0);$(V,fe,he,"⇎","\\nLeftrightarrow",!0);$(V,fe,he,"△","\\vartriangle");$(V,fe,ge,"ℏ","\\hslash");$(V,fe,ge,"▽","\\triangledown");$(V,fe,ge,"◊","\\lozenge");$(V,fe,ge,"Ⓢ","\\circledS");$(V,fe,ge,"®","\\circledR");$(Pe,fe,ge,"®","\\circledR");$(V,fe,ge,"∡","\\measuredangle",!0);$(V,fe,ge,"∄","\\nexists");$(V,fe,ge,"℧","\\mho");$(V,fe,ge,"Ⅎ","\\Finv",!0);$(V,fe,ge,"⅁","\\Game",!0);$(V,fe,ge,"‵","\\backprime");$(V,fe,ge,"▲","\\blacktriangle");$(V,fe,ge,"▼","\\blacktriangledown");$(V,fe,ge,"■","\\blacksquare");$(V,fe,ge,"⧫","\\blacklozenge");$(V,fe,ge,"★","\\bigstar");$(V,fe,ge,"∢","\\sphericalangle",!0);$(V,fe,ge,"∁","\\complement",!0);$(V,fe,ge,"ð","\\eth",!0);$(Pe,ee,ge,"ð","ð");$(V,fe,ge,"╱","\\diagup");$(V,fe,ge,"╲","\\diagdown");$(V,fe,ge,"□","\\square");$(V,fe,ge,"□","\\Box");$(V,fe,ge,"◊","\\Diamond");$(V,fe,ge,"¥","\\yen",!0);$(Pe,fe,ge,"¥","\\yen",!0);$(V,fe,ge,"✓","\\checkmark",!0);$(Pe,fe,ge,"✓","\\checkmark");$(V,fe,ge,"ℶ","\\beth",!0);$(V,fe,ge,"ℸ","\\daleth",!0);$(V,fe,ge,"ℷ","\\gimel",!0);$(V,fe,ge,"ϝ","\\digamma",!0);$(V,fe,ge,"ϰ","\\varkappa");$(V,fe,Di,"┌","\\@ulcorner",!0);$(V,fe,Ws,"┐","\\@urcorner",!0);$(V,fe,Di,"└","\\@llcorner",!0);$(V,fe,Ws,"┘","\\@lrcorner",!0);$(V,fe,he,"≦","\\leqq",!0);$(V,fe,he,"⩽","\\leqslant",!0);$(V,fe,he,"⪕","\\eqslantless",!0);$(V,fe,he,"≲","\\lesssim",!0);$(V,fe,he,"⪅","\\lessapprox",!0);$(V,fe,he,"≊","\\approxeq",!0);$(V,fe,lt,"⋖","\\lessdot");$(V,fe,he,"⋘","\\lll",!0);$(V,fe,he,"≶","\\lessgtr",!0);$(V,fe,he,"⋚","\\lesseqgtr",!0);$(V,fe,he,"⪋","\\lesseqqgtr",!0);$(V,fe,he,"≑","\\doteqdot");$(V,fe,he,"≓","\\risingdotseq",!0);$(V,fe,he,"≒","\\fallingdotseq",!0);$(V,fe,he,"∽","\\backsim",!0);$(V,fe,he,"⋍","\\backsimeq",!0);$(V,fe,he,"⫅","\\subseteqq",!0);$(V,fe,he,"⋐","\\Subset",!0);$(V,fe,he,"⊏","\\sqsubset",!0);$(V,fe,he,"≼","\\preccurlyeq",!0);$(V,fe,he,"⋞","\\curlyeqprec",!0);$(V,fe,he,"≾","\\precsim",!0);$(V,fe,he,"⪷","\\precapprox",!0);$(V,fe,he,"⊲","\\vartriangleleft");$(V,fe,he,"⊴","\\trianglelefteq");$(V,fe,he,"⊨","\\vDash",!0);$(V,fe,he,"⊪","\\Vvdash",!0);$(V,fe,he,"⌣","\\smallsmile");$(V,fe,he,"⌢","\\smallfrown");$(V,fe,he,"≏","\\bumpeq",!0);$(V,fe,he,"≎","\\Bumpeq",!0);$(V,fe,he,"≧","\\geqq",!0);$(V,fe,he,"⩾","\\geqslant",!0);$(V,fe,he,"⪖","\\eqslantgtr",!0);$(V,fe,he,"≳","\\gtrsim",!0);$(V,fe,he,"⪆","\\gtrapprox",!0);$(V,fe,lt,"⋗","\\gtrdot");$(V,fe,he,"⋙","\\ggg",!0);$(V,fe,he,"≷","\\gtrless",!0);$(V,fe,he,"⋛","\\gtreqless",!0);$(V,fe,he,"⪌","\\gtreqqless",!0);$(V,fe,he,"≖","\\eqcirc",!0);$(V,fe,he,"≗","\\circeq",!0);$(V,fe,he,"≜","\\triangleq",!0);$(V,fe,he,"∼","\\thicksim");$(V,fe,he,"≈","\\thickapprox");$(V,fe,he,"⫆","\\supseteqq",!0);$(V,fe,he,"⋑","\\Supset",!0);$(V,fe,he,"⊐","\\sqsupset",!0);$(V,fe,he,"≽","\\succcurlyeq",!0);$(V,fe,he,"⋟","\\curlyeqsucc",!0);$(V,fe,he,"≿","\\succsim",!0);$(V,fe,he,"⪸","\\succapprox",!0);$(V,fe,he,"⊳","\\vartriangleright");$(V,fe,he,"⊵","\\trianglerighteq");$(V,fe,he,"⊩","\\Vdash",!0);$(V,fe,he,"∣","\\shortmid");$(V,fe,he,"∥","\\shortparallel");$(V,fe,he,"≬","\\between",!0);$(V,fe,he,"⋔","\\pitchfork",!0);$(V,fe,he,"∝","\\varpropto");$(V,fe,he,"◀","\\blacktriangleleft");$(V,fe,he,"∴","\\therefore",!0);$(V,fe,he,"∍","\\backepsilon");$(V,fe,he,"▶","\\blacktriangleright");$(V,fe,he,"∵","\\because",!0);$(V,fe,he,"⋘","\\llless");$(V,fe,he,"⋙","\\gggtr");$(V,fe,lt,"⊲","\\lhd");$(V,fe,lt,"⊳","\\rhd");$(V,fe,he,"≂","\\eqsim",!0);$(V,ee,he,"⋈","\\Join");$(V,fe,he,"≑","\\Doteq",!0);$(V,fe,lt,"∔","\\dotplus",!0);$(V,fe,lt,"∖","\\smallsetminus");$(V,fe,lt,"⋒","\\Cap",!0);$(V,fe,lt,"⋓","\\Cup",!0);$(V,fe,lt,"⩞","\\doublebarwedge",!0);$(V,fe,lt,"⊟","\\boxminus",!0);$(V,fe,lt,"⊞","\\boxplus",!0);$(V,fe,lt,"⋇","\\divideontimes",!0);$(V,fe,lt,"⋉","\\ltimes",!0);$(V,fe,lt,"⋊","\\rtimes",!0);$(V,fe,lt,"⋋","\\leftthreetimes",!0);$(V,fe,lt,"⋌","\\rightthreetimes",!0);$(V,fe,lt,"⋏","\\curlywedge",!0);$(V,fe,lt,"⋎","\\curlyvee",!0);$(V,fe,lt,"⊝","\\circleddash",!0);$(V,fe,lt,"⊛","\\circledast",!0);$(V,fe,lt,"⋅","\\centerdot");$(V,fe,lt,"⊺","\\intercal",!0);$(V,fe,lt,"⋒","\\doublecap");$(V,fe,lt,"⋓","\\doublecup");$(V,fe,lt,"⊠","\\boxtimes",!0);$(V,fe,he,"⇢","\\dashrightarrow",!0);$(V,fe,he,"⇠","\\dashleftarrow",!0);$(V,fe,he,"⇇","\\leftleftarrows",!0);$(V,fe,he,"⇆","\\leftrightarrows",!0);$(V,fe,he,"⇚","\\Lleftarrow",!0);$(V,fe,he,"↞","\\twoheadleftarrow",!0);$(V,fe,he,"↢","\\leftarrowtail",!0);$(V,fe,he,"↫","\\looparrowleft",!0);$(V,fe,he,"⇋","\\leftrightharpoons",!0);$(V,fe,he,"↶","\\curvearrowleft",!0);$(V,fe,he,"↺","\\circlearrowleft",!0);$(V,fe,he,"↰","\\Lsh",!0);$(V,fe,he,"⇈","\\upuparrows",!0);$(V,fe,he,"↿","\\upharpoonleft",!0);$(V,fe,he,"⇃","\\downharpoonleft",!0);$(V,ee,he,"⊶","\\origof",!0);$(V,ee,he,"⊷","\\imageof",!0);$(V,fe,he,"⊸","\\multimap",!0);$(V,fe,he,"↭","\\leftrightsquigarrow",!0);$(V,fe,he,"⇉","\\rightrightarrows",!0);$(V,fe,he,"⇄","\\rightleftarrows",!0);$(V,fe,he,"↠","\\twoheadrightarrow",!0);$(V,fe,he,"↣","\\rightarrowtail",!0);$(V,fe,he,"↬","\\looparrowright",!0);$(V,fe,he,"↷","\\curvearrowright",!0);$(V,fe,he,"↻","\\circlearrowright",!0);$(V,fe,he,"↱","\\Rsh",!0);$(V,fe,he,"⇊","\\downdownarrows",!0);$(V,fe,he,"↾","\\upharpoonright",!0);$(V,fe,he,"⇂","\\downharpoonright",!0);$(V,fe,he,"⇝","\\rightsquigarrow",!0);$(V,fe,he,"⇝","\\leadsto");$(V,fe,he,"⇛","\\Rrightarrow",!0);$(V,fe,he,"↾","\\restriction");$(V,ee,ge,"‘","`");$(V,ee,ge,"$","\\$");$(Pe,ee,ge,"$","\\$");$(Pe,ee,ge,"$","\\textdollar");$(V,ee,ge,"%","\\%");$(Pe,ee,ge,"%","\\%");$(V,ee,ge,"_","\\_");$(Pe,ee,ge,"_","\\_");$(Pe,ee,ge,"_","\\textunderscore");$(V,ee,ge,"∠","\\angle",!0);$(V,ee,ge,"∞","\\infty",!0);$(V,ee,ge,"′","\\prime");$(V,ee,ge,"△","\\triangle");$(V,ee,ge,"Γ","\\Gamma",!0);$(V,ee,ge,"Δ","\\Delta",!0);$(V,ee,ge,"Θ","\\Theta",!0);$(V,ee,ge,"Λ","\\Lambda",!0);$(V,ee,ge,"Ξ","\\Xi",!0);$(V,ee,ge,"Π","\\Pi",!0);$(V,ee,ge,"Σ","\\Sigma",!0);$(V,ee,ge,"Υ","\\Upsilon",!0);$(V,ee,ge,"Φ","\\Phi",!0);$(V,ee,ge,"Ψ","\\Psi",!0);$(V,ee,ge,"Ω","\\Omega",!0);$(V,ee,ge,"A","Α");$(V,ee,ge,"B","Β");$(V,ee,ge,"E","Ε");$(V,ee,ge,"Z","Ζ");$(V,ee,ge,"H","Η");$(V,ee,ge,"I","Ι");$(V,ee,ge,"K","Κ");$(V,ee,ge,"M","Μ");$(V,ee,ge,"N","Ν");$(V,ee,ge,"O","Ο");$(V,ee,ge,"P","Ρ");$(V,ee,ge,"T","Τ");$(V,ee,ge,"X","Χ");$(V,ee,ge,"¬","\\neg",!0);$(V,ee,ge,"¬","\\lnot");$(V,ee,ge,"⊤","\\top");$(V,ee,ge,"⊥","\\bot");$(V,ee,ge,"∅","\\emptyset");$(V,fe,ge,"∅","\\varnothing");$(V,ee,Rt,"α","\\alpha",!0);$(V,ee,Rt,"β","\\beta",!0);$(V,ee,Rt,"γ","\\gamma",!0);$(V,ee,Rt,"δ","\\delta",!0);$(V,ee,Rt,"ϵ","\\epsilon",!0);$(V,ee,Rt,"ζ","\\zeta",!0);$(V,ee,Rt,"η","\\eta",!0);$(V,ee,Rt,"θ","\\theta",!0);$(V,ee,Rt,"ι","\\iota",!0);$(V,ee,Rt,"κ","\\kappa",!0);$(V,ee,Rt,"λ","\\lambda",!0);$(V,ee,Rt,"μ","\\mu",!0);$(V,ee,Rt,"ν","\\nu",!0);$(V,ee,Rt,"ξ","\\xi",!0);$(V,ee,Rt,"ο","\\omicron",!0);$(V,ee,Rt,"π","\\pi",!0);$(V,ee,Rt,"ρ","\\rho",!0);$(V,ee,Rt,"σ","\\sigma",!0);$(V,ee,Rt,"τ","\\tau",!0);$(V,ee,Rt,"υ","\\upsilon",!0);$(V,ee,Rt,"ϕ","\\phi",!0);$(V,ee,Rt,"χ","\\chi",!0);$(V,ee,Rt,"ψ","\\psi",!0);$(V,ee,Rt,"ω","\\omega",!0);$(V,ee,Rt,"ε","\\varepsilon",!0);$(V,ee,Rt,"ϑ","\\vartheta",!0);$(V,ee,Rt,"ϖ","\\varpi",!0);$(V,ee,Rt,"ϱ","\\varrho",!0);$(V,ee,Rt,"ς","\\varsigma",!0);$(V,ee,Rt,"φ","\\varphi",!0);$(V,ee,lt,"∗","*",!0);$(V,ee,lt,"+","+");$(V,ee,lt,"−","-",!0);$(V,ee,lt,"⋅","\\cdot",!0);$(V,ee,lt,"∘","\\circ",!0);$(V,ee,lt,"÷","\\div",!0);$(V,ee,lt,"±","\\pm",!0);$(V,ee,lt,"×","\\times",!0);$(V,ee,lt,"∩","\\cap",!0);$(V,ee,lt,"∪","\\cup",!0);$(V,ee,lt,"∖","\\setminus",!0);$(V,ee,lt,"∧","\\land");$(V,ee,lt,"∨","\\lor");$(V,ee,lt,"∧","\\wedge",!0);$(V,ee,lt,"∨","\\vee",!0);$(V,ee,ge,"√","\\surd");$(V,ee,Di,"⟨","\\langle",!0);$(V,ee,Di,"∣","\\lvert");$(V,ee,Di,"∥","\\lVert");$(V,ee,Ws,"?","?");$(V,ee,Ws,"!","!");$(V,ee,Ws,"⟩","\\rangle",!0);$(V,ee,Ws,"∣","\\rvert");$(V,ee,Ws,"∥","\\rVert");$(V,ee,he,"=","=");$(V,ee,he,":",":");$(V,ee,he,"≈","\\approx",!0);$(V,ee,he,"≅","\\cong",!0);$(V,ee,he,"≥","\\ge");$(V,ee,he,"≥","\\geq",!0);$(V,ee,he,"←","\\gets");$(V,ee,he,">","\\gt",!0);$(V,ee,he,"∈","\\in",!0);$(V,ee,he,"","\\@not");$(V,ee,he,"⊂","\\subset",!0);$(V,ee,he,"⊃","\\supset",!0);$(V,ee,he,"⊆","\\subseteq",!0);$(V,ee,he,"⊇","\\supseteq",!0);$(V,fe,he,"⊈","\\nsubseteq",!0);$(V,fe,he,"⊉","\\nsupseteq",!0);$(V,ee,he,"⊨","\\models");$(V,ee,he,"←","\\leftarrow",!0);$(V,ee,he,"≤","\\le");$(V,ee,he,"≤","\\leq",!0);$(V,ee,he,"<","\\lt",!0);$(V,ee,he,"→","\\rightarrow",!0);$(V,ee,he,"→","\\to");$(V,fe,he,"≱","\\ngeq",!0);$(V,fe,he,"≰","\\nleq",!0);$(V,ee,ll," ","\\ ");$(V,ee,ll," ","\\space");$(V,ee,ll," ","\\nobreakspace");$(Pe,ee,ll," ","\\ ");$(Pe,ee,ll," "," ");$(Pe,ee,ll," ","\\space");$(Pe,ee,ll," ","\\nobreakspace");$(V,ee,ll,"","\\nobreak");$(V,ee,ll,"","\\allowbreak");$(V,ee,s0,",",",");$(V,ee,s0,";",";");$(V,fe,lt,"⊼","\\barwedge",!0);$(V,fe,lt,"⊻","\\veebar",!0);$(V,ee,lt,"⊙","\\odot",!0);$(V,ee,lt,"⊕","\\oplus",!0);$(V,ee,lt,"⊗","\\otimes",!0);$(V,ee,ge,"∂","\\partial",!0);$(V,ee,lt,"⊘","\\oslash",!0);$(V,fe,lt,"⊚","\\circledcirc",!0);$(V,fe,lt,"⊡","\\boxdot",!0);$(V,ee,lt,"△","\\bigtriangleup");$(V,ee,lt,"▽","\\bigtriangledown");$(V,ee,lt,"†","\\dagger");$(V,ee,lt,"⋄","\\diamond");$(V,ee,lt,"⋆","\\star");$(V,ee,lt,"◃","\\triangleleft");$(V,ee,lt,"▹","\\triangleright");$(V,ee,Di,"{","\\{");$(Pe,ee,ge,"{","\\{");$(Pe,ee,ge,"{","\\textbraceleft");$(V,ee,Ws,"}","\\}");$(Pe,ee,ge,"}","\\}");$(Pe,ee,ge,"}","\\textbraceright");$(V,ee,Di,"{","\\lbrace");$(V,ee,Ws,"}","\\rbrace");$(V,ee,Di,"[","\\lbrack",!0);$(Pe,ee,ge,"[","\\lbrack",!0);$(V,ee,Ws,"]","\\rbrack",!0);$(Pe,ee,ge,"]","\\rbrack",!0);$(V,ee,Di,"(","\\lparen",!0);$(V,ee,Ws,")","\\rparen",!0);$(Pe,ee,ge,"<","\\textless",!0);$(Pe,ee,ge,">","\\textgreater",!0);$(V,ee,Di,"⌊","\\lfloor",!0);$(V,ee,Ws,"⌋","\\rfloor",!0);$(V,ee,Di,"⌈","\\lceil",!0);$(V,ee,Ws,"⌉","\\rceil",!0);$(V,ee,ge,"\\","\\backslash");$(V,ee,ge,"∣","|");$(V,ee,ge,"∣","\\vert");$(Pe,ee,ge,"|","\\textbar",!0);$(V,ee,ge,"∥","\\|");$(V,ee,ge,"∥","\\Vert");$(Pe,ee,ge,"∥","\\textbardbl");$(Pe,ee,ge,"~","\\textasciitilde");$(Pe,ee,ge,"\\","\\textbackslash");$(Pe,ee,ge,"^","\\textasciicircum");$(V,ee,he,"↑","\\uparrow",!0);$(V,ee,he,"⇑","\\Uparrow",!0);$(V,ee,he,"↓","\\downarrow",!0);$(V,ee,he,"⇓","\\Downarrow",!0);$(V,ee,he,"↕","\\updownarrow",!0);$(V,ee,he,"⇕","\\Updownarrow",!0);$(V,ee,$r,"∐","\\coprod");$(V,ee,$r,"⋁","\\bigvee");$(V,ee,$r,"⋀","\\bigwedge");$(V,ee,$r,"⨄","\\biguplus");$(V,ee,$r,"⋂","\\bigcap");$(V,ee,$r,"⋃","\\bigcup");$(V,ee,$r,"∫","\\int");$(V,ee,$r,"∫","\\intop");$(V,ee,$r,"∬","\\iint");$(V,ee,$r,"∭","\\iiint");$(V,ee,$r,"∏","\\prod");$(V,ee,$r,"∑","\\sum");$(V,ee,$r,"⨂","\\bigotimes");$(V,ee,$r,"⨁","\\bigoplus");$(V,ee,$r,"⨀","\\bigodot");$(V,ee,$r,"∮","\\oint");$(V,ee,$r,"∯","\\oiint");$(V,ee,$r,"∰","\\oiiint");$(V,ee,$r,"⨆","\\bigsqcup");$(V,ee,$r,"∫","\\smallint");$(Pe,ee,jd,"…","\\textellipsis");$(V,ee,jd,"…","\\mathellipsis");$(Pe,ee,jd,"…","\\ldots",!0);$(V,ee,jd,"…","\\ldots",!0);$(V,ee,jd,"⋯","\\@cdots",!0);$(V,ee,jd,"⋱","\\ddots",!0);$(V,ee,ge,"⋮","\\varvdots");$(Pe,ee,ge,"⋮","\\varvdots");$(V,ee,or,"ˊ","\\acute");$(V,ee,or,"ˋ","\\grave");$(V,ee,or,"¨","\\ddot");$(V,ee,or,"~","\\tilde");$(V,ee,or,"ˉ","\\bar");$(V,ee,or,"˘","\\breve");$(V,ee,or,"ˇ","\\check");$(V,ee,or,"^","\\hat");$(V,ee,or,"⃗","\\vec");$(V,ee,or,"˙","\\dot");$(V,ee,or,"˚","\\mathring");$(V,ee,Rt,"","\\@imath");$(V,ee,Rt,"","\\@jmath");$(V,ee,ge,"ı","ı");$(V,ee,ge,"ȷ","ȷ");$(Pe,ee,ge,"ı","\\i",!0);$(Pe,ee,ge,"ȷ","\\j",!0);$(Pe,ee,ge,"ß","\\ss",!0);$(Pe,ee,ge,"æ","\\ae",!0);$(Pe,ee,ge,"œ","\\oe",!0);$(Pe,ee,ge,"ø","\\o",!0);$(Pe,ee,ge,"Æ","\\AE",!0);$(Pe,ee,ge,"Œ","\\OE",!0);$(Pe,ee,ge,"Ø","\\O",!0);$(Pe,ee,or,"ˊ","\\'");$(Pe,ee,or,"ˋ","\\`");$(Pe,ee,or,"ˆ","\\^");$(Pe,ee,or,"˜","\\~");$(Pe,ee,or,"ˉ","\\=");$(Pe,ee,or,"˘","\\u");$(Pe,ee,or,"˙","\\.");$(Pe,ee,or,"¸","\\c");$(Pe,ee,or,"˚","\\r");$(Pe,ee,or,"ˇ","\\v");$(Pe,ee,or,"¨",'\\"');$(Pe,ee,or,"˝","\\H");$(Pe,ee,or,"◯","\\textcircled");var QM={"--":!0,"---":!0,"``":!0,"''":!0};$(Pe,ee,ge,"–","--",!0);$(Pe,ee,ge,"–","\\textendash");$(Pe,ee,ge,"—","---",!0);$(Pe,ee,ge,"—","\\textemdash");$(Pe,ee,ge,"‘","`",!0);$(Pe,ee,ge,"‘","\\textquoteleft");$(Pe,ee,ge,"’","'",!0);$(Pe,ee,ge,"’","\\textquoteright");$(Pe,ee,ge,"“","``",!0);$(Pe,ee,ge,"“","\\textquotedblleft");$(Pe,ee,ge,"”","''",!0);$(Pe,ee,ge,"”","\\textquotedblright");$(V,ee,ge,"°","\\degree",!0);$(Pe,ee,ge,"°","\\degree");$(Pe,ee,ge,"°","\\textdegree",!0);$(V,ee,ge,"£","\\pounds");$(V,ee,ge,"£","\\mathsterling",!0);$(Pe,ee,ge,"£","\\pounds");$(Pe,ee,ge,"£","\\textsterling",!0);$(V,fe,ge,"✠","\\maltese");$(Pe,fe,ge,"✠","\\maltese");var sE='0123456789/@."';for(var Lx=0;Lx{var n=e.charCodeAt(0),t=e.charCodeAt(1),r=(n-55296)*1024+(t-56320)+65536;if(119808<=r&&r<120484){var s=Math.floor((r-119808)/26);return _E[s]}else if(120782<=r&&r<=120831){var i=Math.floor((r-120782)/10);return c0t[i]}else{if(r===120485||r===120486)return _E[0];if(120486{if(fc(e.classes)!==fc(n.classes)||e.skew!==n.skew||e.maxFontSize!==n.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var t=e.classes[0];if(t==="mbin"||t==="mord")return!1}for(var r of Object.keys(e.style))if(e.style[r]!==n.style[r])return!1;for(var s of Object.keys(n.style))if(e.style[s]!==n.style[s])return!1;return!0},JM=e=>{for(var n=0;nt&&(t=a.height),a.depth>r&&(r=a.depth),a.maxFontSize>s&&(s=a.maxFontSize)}n.height=t,n.depth=r,n.maxFontSize=s},qe=function(n,t,r,s){var i=new zd(n,t,r,s);return a5(i),i},hc=(e,n,t,r)=>new zd(e,n,t,r),ld=function(n,t,r){var s=qe([n],[],t);return s.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),s.style.borderBottomWidth=Ze(s.height),s.maxFontSize=1,s},h0t=function(n,t,r,s){var i=new e1(n,t,r,s);return a5(i),i},cl=function(n){var t=new Nd(n);return a5(t),t},cd=function(n,t){return n instanceof Nd?qe([],[n],t):n},_0t=function(n){if(n.positionType==="individualShift"){for(var t=n.children,r=[t[0]],s=-t[0].shift-t[0].elem.depth,i=s,a=1;a{var t=qe(["mspace"],[],n),r=dr(e,n);return t.style.marginRight=Ze(r),t},Bp=(e,n,t)=>{var r,s;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return n==="textbf"&&t==="textit"?s="BoldItalic":n==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",r+"-"+s},R2={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},tL={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},nL=function(n,t){var[r,s,i]=tL[n],a=new dc(r),o=new rl([a],{width:Ze(s),height:Ze(i),style:"width:"+Ze(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=hc(["overlay"],[o],t);return c.height=i,c.style.height=Ze(i),c.style.width=Ze(s),c},fr={number:3,unit:"mu"},tu={number:4,unit:"mu"},Fo={number:5,unit:"mu"},p0t={mord:{mop:fr,mbin:tu,mrel:Fo,minner:fr},mop:{mord:fr,mop:fr,mrel:Fo,minner:fr},mbin:{mord:tu,mop:tu,mopen:tu,minner:tu},mrel:{mord:Fo,mop:Fo,mopen:Fo,minner:Fo},mopen:{},mclose:{mop:fr,mbin:tu,mrel:Fo,minner:fr},mpunct:{mord:fr,mop:fr,mrel:Fo,mopen:fr,mclose:fr,mpunct:fr,minner:fr},minner:{mord:fr,mop:fr,mbin:tu,mrel:Fo,mopen:fr,mpunct:fr,minner:fr}},m0t={mord:{mop:fr},mop:{mord:fr,mop:fr},mbin:{},mrel:{},mopen:{},mclose:{mop:fr},mpunct:{},minner:{mop:fr}},rL={},lg={},cg={};function it(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:s},c=0;c{var b=S.classes[0],v=x.classes[0];b==="mbin"&&b0t.has(v)?S.classes[0]="mord":v==="mbin"&&g0t.has(b)&&(x.classes[0]="mord")},{node:f},p,m),M2(i,(x,S)=>{var b,v,y=D2(S),w=D2(x),C=y&&w?x.hasClass("mtight")?(b=m0t[y])==null?void 0:b[w]:(v=p0t[y])==null?void 0:v[w]:null;if(C)return eL(C,u)},{node:f},p,m),i},M2=function(n,t,r,s,i){s&&n.push(s);for(var a=0;ap=>{n.splice(f+1,0,p),a++})(a)}s&&n.pop()},sL=function(n){return n instanceof Nd||n instanceof e1||n instanceof zd&&n.hasClass("enclosing")?n:null},L2=function(n,t){var r=sL(n);if(r){var s=r.children;if(s.length){if(t==="right")return L2(s[s.length-1],"right");if(t==="left")return L2(s[0],"left")}}return n},D2=function(n,t){if(!n)return null;t&&(n=L2(n,t));var r=n.classes[0];return x0t[r]||null},y_=function(n,t){var r=["nulldelimiter"].concat(n.baseSizingClasses());return qe(t.concat(r))},An=function(n,t,r){if(!n)return qe();if(lg[n.type]){var s=lg[n.type](n,t);if(r&&t.size!==r.size){s=qe(t.sizingClasses(r),[s],t);var i=t.sizeMultiplier/r.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new We("Got group of unknown type: '"+n.type+"'")};function $p(e,n){var t=qe(["base"],e,n),r=qe(["strut"]);return r.style.height=Ze(t.height+t.depth),t.depth&&(r.style.verticalAlign=Ze(-t.depth)),t.children.unshift(r),t}function O2(e,n){var t=null;e.length===1&&e[0].type==="tag"&&(t=e[0].tag,e=e[0].body);var r=es(e,n,"root"),s;r.length===2&&r[1].hasClass("tag")&&(s=r.pop());for(var i=[],a=[],o=0;o0&&(i.push($p(a,n)),a=[]),i.push(r[o]));a.length>0&&i.push($p(a,n));var u;t?(u=$p(es(t,n,!0),n),u.classes=["tag"],i.push(u)):s&&i.push(s);var _=qe(["katex-html"],i);if(_.setAttribute("aria-hidden","true"),u){var f=u.children[0];f.style.height=Ze(_.height+_.depth),_.depth&&(f.style.verticalAlign=Ze(-_.depth))}return _}function iL(e){return new Nd(e)}class Ke{constructor(n,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=n,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(n,t){this.attributes[n]=t}getAttribute(n){return this.attributes[n]}toNode(){var n=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&n.setAttribute(t,this.attributes[t]);this.classes.length>0&&(n.className=fc(this.classes));for(var r=0;r0&&(n+=' class ="'+As(fc(this.classes))+'"'),n+=">";for(var r=0;r",n}toText(){return this.children.map(n=>n.toText()).join("")}}class Ir{constructor(n){this.text=void 0,this.text=n}toNode(){return document.createTextNode(this.text)}toMarkup(){return As(this.toText())}toText(){return this.text}}class aL{constructor(n){this.width=void 0,this.character=void 0,this.width=n,n>=.05555&&n<=.05556?this.character=" ":n>=.1666&&n<=.1667?this.character=" ":n>=.2222&&n<=.2223?this.character=" ":n>=.2777&&n<=.2778?this.character="  ":n>=-.05556&&n<=-.05555?this.character=" ⁣":n>=-.1667&&n<=-.1666?this.character=" ⁣":n>=-.2223&&n<=-.2222?this.character=" ⁣":n>=-.2778&&n<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var n=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return n.setAttribute("width",Ze(this.width)),n}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var y0t=new Set(["\\imath","\\jmath"]),w0t=new Set(["mrow","mtable"]),ta=function(n,t,r){return ir[t][n]&&ir[t][n].replace&&n.charCodeAt(0)!==55349&&!(QM.hasOwnProperty(n)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(n=ir[t][n].replace),new Ir(n)},o5=function(n){return n.length===1?n[0]:new Ke("mrow",n)},S0t={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},l5=(e,n)=>{if(e.mode==="text"){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold"}var t=n.font;if(!t||t==="mathnormal")return null;var r=e.mode,s=S0t[t];if(s)return typeof s=="function"?s(e):s;var i=e.text;if(y0t.has(i))return null;if(ir[r][i]){var a=ir[r][i].replace;a&&(i=a)}var o=R2[t].fontName;return s5(i,o,r)?R2[t].variant:null};function Bx(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var n=e.children[0];return n instanceof Ir&&n.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var t=e.children[0];return t instanceof Ir&&t.text===","}else return!1}var Oi=function(n,t,r){if(n.length===1){var s=qn(n[0],t);return r&&s instanceof Ke&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],a,o=0;o=1&&(a.type==="mn"||Bx(a))){var u=c.children[0];u instanceof Ke&&u.type==="mn"&&(u.children=[...a.children,...u.children],i.pop())}else if(a.type==="mi"&&a.children.length===1){var _=a.children[0];if(_ instanceof Ir&&_.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var f=c.children[0];f instanceof Ir&&f.text.length>0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),i.pop())}}}i.push(c),a=c}return i},_c=function(n,t,r){return o5(Oi(n,t,r))},qn=function(n,t){if(!n)return new Ke("mrow");if(cg[n.type])return cg[n.type](n,t);throw new We("Got group of unknown type: '"+n.type+"'")};function pE(e,n,t,r,s){var i=Oi(e,t),a;i.length===1&&i[0]instanceof Ke&&w0t.has(i[0].type)?a=i[0]:a=new Ke("mrow",i);var o=new Ke("annotation",[new Ir(n)]);o.setAttribute("encoding","application/x-tex");var c=new Ke("semantics",[a,o]),u=new Ke("math",[c]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&u.setAttribute("display","block");var _=s?"katex":"katex-mathml";return qe([_],[u])}var k0t=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],mE=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],gE=function(n,t){return t.size<2?n:k0t[n-1][t.size-1]};class Vo{constructor(n){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=n.style,this.color=n.color,this.size=n.size||Vo.BASESIZE,this.textSize=n.textSize||this.size,this.phantom=!!n.phantom,this.font=n.font||"",this.fontFamily=n.fontFamily||"",this.fontWeight=n.fontWeight||"",this.fontShape=n.fontShape||"",this.sizeMultiplier=mE[this.size-1],this.maxSize=n.maxSize,this.minRuleThickness=n.minRuleThickness,this._fontMetrics=void 0}extend(n){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,n),new Vo(t)}havingStyle(n){return this.style===n?this:this.extend({style:n,size:gE(this.textSize,n)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(n){return this.size===n&&this.textSize===n?this:this.extend({style:this.style.text(),size:n,textSize:n,sizeMultiplier:mE[n-1]})}havingBaseStyle(n){n=n||this.style.text();var t=gE(Vo.BASESIZE,n);return this.size===t&&this.textSize===Vo.BASESIZE&&this.style===n?this:this.extend({style:n,size:t})}havingBaseSizing(){var n;switch(this.style.id){case 4:case 5:n=3;break;case 6:case 7:n=1;break;default:n=6}return this.extend({style:this.style.text(),size:n})}withColor(n){return this.extend({color:n})}withPhantom(){return this.extend({phantom:!0})}withFont(n){return this.extend({font:n})}withTextFontFamily(n){return this.extend({fontFamily:n,font:""})}withTextFontWeight(n){return this.extend({fontWeight:n,font:""})}withTextFontShape(n){return this.extend({fontShape:n,font:""})}sizingClasses(n){return n.size!==this.size?["sizing","reset-size"+n.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Vo.BASESIZE?["sizing","reset-size"+this.size,"size"+Vo.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=o0t(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Vo.BASESIZE=6;var oL=function(n){return new Vo({style:n.displayMode?Gt.DISPLAY:Gt.TEXT,maxSize:n.maxSize,minRuleThickness:n.minRuleThickness})},lL=function(n,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),n=qe(r,[n])}return n},C0t=function(n,t,r){var s=oL(r),i;if(r.output==="mathml")return pE(n,t,s,r.displayMode,!0);if(r.output==="html"){var a=O2(n,s);i=qe(["katex"],[a])}else{var o=pE(n,t,s,r.displayMode,!1),c=O2(n,s);i=qe(["katex"],[o,c])}return lL(i,r)},E0t=function(n,t,r){var s=oL(r),i=O2(n,s),a=qe(["katex"],[i]);return lL(a,r)},N0t={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},r1=function(n){var t=new Ke("mo",[new Ir(N0t[n.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},z0t={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},j0t=new Set(["widehat","widecheck","widetilde","utilde"]),s1=function(n,t){function r(){var o=4e5,c=n.label.slice(1);if(j0t.has(c)&&"base"in n){var u=n.base.type==="ordgroup"?n.base.body.length:1,_,f,p;if(u>5)c==="widehat"||c==="widecheck"?(_=420,o=2364,p=.42,f=c+"4"):(_=312,o=2340,p=.34,f="tilde4");else{var m=[1,1,2,2,3,3][u];c==="widehat"||c==="widecheck"?(o=[0,1062,2364,2364,2364][m],_=[0,239,300,360,420][m],p=[0,.24,.3,.3,.36,.42][m],f=c+m):(o=[0,600,1033,2339,2340][m],_=[0,260,286,306,312][m],p=[0,.26,.286,.3,.306,.34][m],f="tilde"+m)}var x=new dc(f),S=new rl([x],{width:"100%",height:Ze(p),viewBox:"0 0 "+o+" "+_,preserveAspectRatio:"none"});return{span:hc([],[S],t),minWidth:0,height:p}}else{var b=[],v=z0t[c];if(!v)throw new Error('No SVG data for "'+c+'".');var[y,w,C]=v,z=C/1e3,E=y.length,R,N;if(E===1){if(v.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+c+'".');R=["hide-tail"],N=[v[3]]}else if(E===2)R=["halfarrow-left","halfarrow-right"],N=["xMinYMin","xMaxYMin"];else if(E===3)R=["brace-left","brace-center","brace-right"],N=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+E+" children.");for(var M=0;M0&&(s.style.minWidth=Ze(i)),s},T0t=function(n,t,r,s,i){var a,o=n.height+n.depth+r+s;if(/fbox|color|angl/.test(t)){if(a=qe(["stretchy",t],[],i),t==="fbox"){var c=i.color&&i.getColor();c&&(a.style.borderColor=c)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new E2({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new E2({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var _=new rl(u,{width:"100%",height:Ze(o)});a=hc([],[_],i)}return a.height=o,a.style.height=Ze(o),a},A0t={bin:1,close:1,inner:1,open:1,punct:1,rel:1},R0t={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function M0t(e){return e in A0t}function tn(e,n){if(!e||e.type!==n)throw new Error("Expected node of type "+n+", but got "+(e?"node of type "+e.type:String(e)));return e}function i1(e){var n=a1(e);if(!n)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return n}function a1(e){return e&&(e.type==="atom"||R0t.hasOwnProperty(e.type))?e:null}var cL=e=>{if(e instanceof Ri)return e;if(i0t(e)&&e.children.length===1)return cL(e.children[0])},c5=(e,n)=>{var t,r,s;e&&e.type==="supsub"?(r=tn(e.base,"accent"),t=r.base,e.base=t,s=s0t(An(e,n)),e.base=r):(r=tn(e,"accent"),t=r.base);var i=An(t,n.havingCrampedStyle()),a=r.isShifty&&ol(t),o=0;if(a){var c,u;o=(c=(u=cL(i))==null?void 0:u.skew)!=null?c:0}var _=r.label==="\\c",f=_?i.height+i.depth:Math.min(i.height,n.fontMetrics().xHeight),p;if(r.isStretchy)p=s1(r,n),p=jn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:p,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+Ze(2*o)+")",marginLeft:Ze(2*o)}:void 0}]});else{var m,x;r.label==="\\vec"?(m=nL("vec",n),x=tL.vec[1]):(m=n1({mode:r.mode,text:r.label},n,"textord"),m=r0t(m),m.italic=0,x=m.width,_&&(f+=m.depth)),p=qe(["accent-body"],[m]);var S=r.label==="\\textcircled";S&&(p.classes.push("accent-full"),f=i.height);var b=o;S||(b-=x/2),p.style.left=Ze(b),r.label==="\\textcircled"&&(p.style.top=".2em"),p=jn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-f},{type:"elem",elem:p}]})}var v=qe(["mord","accent"],[p],n);return s?(s.children[0]=v,s.height=Math.max(v.height,s.height),s.classes[0]="mord",s):v},uL=(e,n)=>{var t=e.isStretchy?r1(e.label):new Ke("mo",[ta(e.label,e.mode)]),r=new Ke("mover",[qn(e.base,n),t]);return r.setAttribute("accent","true"),r},L0t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));it({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,n)=>{var t=ug(n[0]),r=!L0t.test(e.funcName),s=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:s,base:t}},htmlBuilder:c5,mathmlBuilder:uL});it({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,n)=>{var t=n[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:c5,mathmlBuilder:uL});it({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"accentUnder",mode:t.mode,label:r,base:s}},htmlBuilder:(e,n)=>{var t=An(e.base,n),r=s1(e,n),s=e.label==="\\utilde"?.12:0,i=jn({positionType:"top",positionData:t.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:t}]});return qe(["mord","accentunder"],[i],n)},mathmlBuilder:(e,n)=>{var t=r1(e.label),r=new Ke("munder",[qn(e.base,n),t]);return r.setAttribute("accentunder","true"),r}});var Pp=e=>{var n=new Ke("mpadded",e?[e]:[]);return n.setAttribute("width","+0.6em"),n.setAttribute("lspace","0.3em"),n};it({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r,funcName:s}=e;return{type:"xArrow",mode:r.mode,label:s,body:n[0],below:t[0]}},htmlBuilder(e,n){var t=n.style,r=n.havingStyle(t.sup()),s=cd(An(e.body,r,n),n),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var a;e.below&&(r=n.havingStyle(t.sub()),a=cd(An(e.below,r,n),n),a.classes.push(i+"-arrow-pad"));var o=s1(e,n),c=-n.fontMetrics().axisHeight+.5*o.height,u=-n.fontMetrics().axisHeight-.5*o.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(u-=s.depth);var _;if(a){var f=-n.fontMetrics().axisHeight+a.height+.5*o.height+.111;_=jn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:a,shift:f}]})}else _=jn({positionType:"individualShift",children:[{type:"elem",elem:s,shift:u},{type:"elem",elem:o,shift:c,wrapperClasses:["svg-align"]}]});return qe(["mrel","x-arrow"],[_],n)},mathmlBuilder(e,n){var t=r1(e.label);t.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(e.body){var s=Pp(qn(e.body,n));if(e.below){var i=Pp(qn(e.below,n));r=new Ke("munderover",[t,i,s])}else r=new Ke("mover",[t,s])}else if(e.below){var a=Pp(qn(e.below,n));r=new Ke("munder",[t,a])}else r=Pp(),r=new Ke("mover",[t,r]);return r}});function fL(e,n){var t=es(e.body,n,!0);return qe([e.mclass],t,n)}function dL(e,n){var t,r=Oi(e.body,n);return e.mclass==="minner"?t=new Ke("mpadded",r):e.mclass==="mord"?e.isCharacterBox?(t=r[0],t.type="mi"):t=new Ke("mi",r):(e.isCharacterBox?(t=r[0],t.type="mo"):t=new Ke("mo",r),e.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):e.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):e.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}it({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"mclass",mode:t.mode,mclass:"m"+r.slice(5),body:Or(s),isCharacterBox:ol(s)}},htmlBuilder:fL,mathmlBuilder:dL});var o1=e=>{var n=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return n.type==="atom"&&(n.family==="bin"||n.family==="rel")?"m"+n.family:"mord"};it({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,n){var{parser:t}=e;return{type:"mclass",mode:t.mode,mclass:o1(n[0]),body:Or(n[1]),isCharacterBox:ol(n[1])}}});it({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,n){var{parser:t,funcName:r}=e,s=n[1],i=n[0],a;r!=="\\stackrel"?a=o1(s):a="mrel";var o={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:Or(s)},c={type:"supsub",mode:i.mode,base:o,sup:r==="\\underset"?null:i,sub:r==="\\underset"?i:null};return{type:"mclass",mode:t.mode,mclass:a,body:[c],isCharacterBox:ol(c)}},htmlBuilder:fL,mathmlBuilder:dL});it({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"pmb",mode:t.mode,mclass:o1(n[0]),body:Or(n[0])}},htmlBuilder(e,n){var t=es(e.body,n,!0),r=qe([e.mclass],t,n);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,n){var t=Oi(e.body,n),r=new Ke("mstyle",t);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var D0t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},bE=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),vE=e=>e.type==="textord"&&e.text==="@",O0t=(e,n)=>(e.type==="mathord"||e.type==="atom")&&e.text===n;function I0t(e,n,t){var r=D0t[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(r,[n[0]],[n[1]]);case"\\uparrow":case"\\downarrow":{var s=t.callFunction("\\\\cdleft",[n[0]],[]),i={type:"atom",text:r,mode:"math",family:"rel"},a=t.callFunction("\\Big",[i],[]),o=t.callFunction("\\\\cdright",[n[1]],[]),c={type:"ordgroup",mode:"math",body:[s,a,o]};return t.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function B0t(e){var n=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){n.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var t=e.fetch().text;if(t==="&"||t==="\\\\")e.consume();else if(t==="\\end"){n[n.length-1].length===0&&n.pop();break}else throw new We("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],s=[r],i=0;iAV".includes(u))for(var f=0;f<2;f++){for(var p=!0,m=c+1;mAV=|." after @',a[c]);var x=I0t(u,_,e),S={type:"styling",body:[x],mode:"math",style:"display",resetFont:!0};r.push(S),o=bE()}i%2===0?r.push(o):r.shift(),r=[],s.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var b=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:b,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}it({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"cdlabel",mode:t.mode,side:r.slice(4),label:n[0]}},htmlBuilder(e,n){var t=n.havingStyle(n.style.sup()),r=cd(An(e.label,t,n),n);return r.classes.push("cd-label-"+e.side),r.style.bottom=Ze(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,n){var t=new Ke("mrow",[qn(e.label,n)]);return t=new Ke("mpadded",[t]),t.setAttribute("width","0"),e.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new Ke("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});it({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,n){var{parser:t}=e;return{type:"cdlabelparent",mode:t.mode,fragment:n[0]}},htmlBuilder(e,n){var t=cd(An(e.fragment,n),n);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(e,n){return new Ke("mrow",[qn(e.fragment,n)])}});it({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,n){for(var{parser:t}=e,r=tn(n[0],"ordgroup"),s=r.body,i="",a=0;a=1114111)throw new We("\\@char with invalid code point "+i);return c<=65535?u=String.fromCharCode(c):(c-=65536,u=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var hL=(e,n)=>{var t=es(e.body,n.withColor(e.color),!1);return cl(t)},_L=(e,n)=>{var t=Oi(e.body,n.withColor(e.color)),r=new Ke("mstyle",t);return r.setAttribute("mathcolor",e.color),r};it({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,n){var{parser:t}=e,r=tn(n[0],"color-token").color,s=n[1];return{type:"color",mode:t.mode,color:r,body:Or(s)}},htmlBuilder:hL,mathmlBuilder:_L});it({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,n){var{parser:t,breakOnTokenText:r}=e,s=tn(n[0],"color-token").color;t.gullet.macros.set("\\current@color",s);var i=t.parseExpression(!0,r);return{type:"color",mode:t.mode,color:s,body:i}},htmlBuilder:hL,mathmlBuilder:_L});it({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,n,t){var{parser:r}=e,s=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:s&&tn(s,"size").value}},htmlBuilder(e,n){var t=qe(["mspace"],[],n);return e.newLine&&(t.classes.push("newline"),e.size&&(t.style.marginTop=Ze(dr(e.size,n)))),t},mathmlBuilder(e,n){var t=new Ke("mspace");return e.newLine&&(t.setAttribute("linebreak","newline"),e.size&&t.setAttribute("height",Ze(dr(e.size,n)))),t}});var I2={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},pL=e=>{var n=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new We("Expected a control sequence",e);return n},$0t=e=>{var n=e.gullet.popToken();return n.text==="="&&(n=e.gullet.popToken(),n.text===" "&&(n=e.gullet.popToken())),n},mL=(e,n,t,r)=>{var s=e.gullet.macros.get(t.text);s==null&&(t.noexpand=!0,s={tokens:[t],numArgs:0,unexpandable:!e.gullet.isExpandable(t.text)}),e.gullet.macros.set(n,s,r)};it({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:n,funcName:t}=e;n.consumeSpaces();var r=n.fetch();if(I2[r.text])return(t==="\\global"||t==="\\\\globallong")&&(r.text=I2[r.text]),tn(n.parseFunction(),"internal");throw new We("Invalid token after macro prefix",r)}});it({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=n.gullet.popToken(),s=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new We("Expected a control sequence",r);for(var i=0,a,o=[[]];n.gullet.future().text!=="{";)if(r=n.gullet.popToken(),r.text==="#"){if(n.gullet.future().text==="{"){a=n.gullet.future(),o[i].push("{");break}if(r=n.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new We('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==i+1)throw new We('Argument number "'+r.text+'" out of order');i++,o.push([])}else{if(r.text==="EOF")throw new We("Expected a macro definition");o[i].push(r.text)}var{tokens:c}=n.gullet.consumeArg();return a&&c.unshift(a),(t==="\\edef"||t==="\\xdef")&&(c=n.gullet.expandTokens(c),c.reverse()),n.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:o},t===I2[t]),{type:"internal",mode:n.mode}}});it({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=pL(n.gullet.popToken());n.gullet.consumeSpaces();var s=$0t(n);return mL(n,r,s,t==="\\\\globallet"),{type:"internal",mode:n.mode}}});it({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:n,funcName:t}=e,r=pL(n.gullet.popToken()),s=n.gullet.popToken(),i=n.gullet.popToken();return mL(n,r,i,t==="\\\\globalfuture"),n.gullet.pushToken(i),n.gullet.pushToken(s),{type:"internal",mode:n.mode}}});var $h=function(n,t,r){var s=ir.math[n]&&ir.math[n].replace,i=s5(s||n,t,r);if(!i)throw new Error("Unsupported symbol "+n+" and font size "+t+".");return i},u5=function(n,t,r,s){var i=r.havingBaseStyle(t),a=qe(s.concat(i.sizingClasses(r)),[n],r),o=i.sizeMultiplier/r.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},gL=function(n,t,r){var s=t.havingBaseStyle(r),i=(1-t.sizeMultiplier/s.sizeMultiplier)*t.fontMetrics().axisHeight;n.classes.push("delimcenter"),n.style.top=Ze(i),n.height-=i,n.depth+=i},P0t=function(n,t,r,s,i,a){var o=Us(n,"Main-Regular",i,s),c=u5(o,t,s,a);return gL(c,s,t),c},H0t=function(n,t,r,s){return Us(n,"Size"+t+"-Regular",r,s)},bL=function(n,t,r,s,i,a){var o=H0t(n,t,i,s),c=u5(qe(["delimsizing","size"+t],[o],s),Gt.TEXT,s,a);return r&&gL(c,s,Gt.TEXT),c},$x=function(n,t,r){var s;t==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=qe(["delimsizinginner",s],[qe([],[Us(n,t,r)])]);return{type:"elem",elem:i}},Px=function(n,t,r){var s=Za["Size4-Regular"][n.charCodeAt(0)]?Za["Size4-Regular"][n.charCodeAt(0)][4]:Za["Size1-Regular"][n.charCodeAt(0)][4],i=new dc("inner",X_t(n,Math.round(1e3*t))),a=new rl([i],{width:Ze(s),height:Ze(t),style:"width:"+Ze(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=hc([],[a],r);return o.height=t,o.style.height=Ze(t),o.style.width=Ze(s),{type:"elem",elem:o}},B2=.008,Hp={type:"kern",size:-1*B2},F0t=new Set(["|","\\lvert","\\rvert","\\vert"]),U0t=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),vL=function(n,t,r,s,i,a){var o,c,u,_,f="",p=0;o=u=_=n,c=null;var m="Size1-Regular";n==="\\uparrow"?u=_="⏐":n==="\\Uparrow"?u=_="‖":n==="\\downarrow"?o=u="⏐":n==="\\Downarrow"?o=u="‖":n==="\\updownarrow"?(o="\\uparrow",u="⏐",_="\\downarrow"):n==="\\Updownarrow"?(o="\\Uparrow",u="‖",_="\\Downarrow"):F0t.has(n)?(u="∣",f="vert",p=333):U0t.has(n)?(u="∥",f="doublevert",p=556):n==="["||n==="\\lbrack"?(o="⎡",u="⎢",_="⎣",m="Size4-Regular",f="lbrack",p=667):n==="]"||n==="\\rbrack"?(o="⎤",u="⎥",_="⎦",m="Size4-Regular",f="rbrack",p=667):n==="\\lfloor"||n==="⌊"?(u=o="⎢",_="⎣",m="Size4-Regular",f="lfloor",p=667):n==="\\lceil"||n==="⌈"?(o="⎡",u=_="⎢",m="Size4-Regular",f="lceil",p=667):n==="\\rfloor"||n==="⌋"?(u=o="⎥",_="⎦",m="Size4-Regular",f="rfloor",p=667):n==="\\rceil"||n==="⌉"?(o="⎤",u=_="⎥",m="Size4-Regular",f="rceil",p=667):n==="("||n==="\\lparen"?(o="⎛",u="⎜",_="⎝",m="Size4-Regular",f="lparen",p=875):n===")"||n==="\\rparen"?(o="⎞",u="⎟",_="⎠",m="Size4-Regular",f="rparen",p=875):n==="\\{"||n==="\\lbrace"?(o="⎧",c="⎨",_="⎩",u="⎪",m="Size4-Regular"):n==="\\}"||n==="\\rbrace"?(o="⎫",c="⎬",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lgroup"||n==="⟮"?(o="⎧",_="⎩",u="⎪",m="Size4-Regular"):n==="\\rgroup"||n==="⟯"?(o="⎫",_="⎭",u="⎪",m="Size4-Regular"):n==="\\lmoustache"||n==="⎰"?(o="⎧",_="⎭",u="⎪",m="Size4-Regular"):(n==="\\rmoustache"||n==="⎱")&&(o="⎫",_="⎩",u="⎪",m="Size4-Regular");var x=$h(o,m,i),S=x.height+x.depth,b=$h(u,m,i),v=b.height+b.depth,y=$h(_,m,i),w=y.height+y.depth,C=0,z=1;if(c!==null){var E=$h(c,m,i);C=E.height+E.depth,z=2}var R=S+w+C,N=Math.max(0,Math.ceil((t-R)/(z*v))),M=R+N*z*v,O=s.fontMetrics().axisHeight;r&&(O*=s.sizeMultiplier);var I=M/2-O,H=[];if(f.length>0){var U=M-S-w,F=Math.round(M*1e3),Y=Z_t(f,Math.round(U*1e3)),q=new dc(f,Y),Q=Ze(p/1e3),Z=Ze(F/1e3),B=new rl([q],{width:Q,height:Z,viewBox:"0 0 "+p+" "+F}),D=hc([],[B],s);D.height=F/1e3,D.style.width=Q,D.style.height=Z,H.push({type:"elem",elem:D})}else{if(H.push($x(_,m,i)),H.push(Hp),c===null){var P=M-S-w+2*B2;H.push(Px(u,P,s))}else{var X=(M-S-w-C)/2+2*B2;H.push(Px(u,X,s)),H.push(Hp),H.push($x(c,m,i)),H.push(Hp),H.push(Px(u,X,s))}H.push(Hp),H.push($x(o,m,i))}var W=s.havingBaseStyle(Gt.TEXT),ie=jn({positionType:"bottom",positionData:I,children:H});return u5(qe(["delimsizing","mult"],[ie],W),Gt.TEXT,s,a)},Hx=80,Fx=.08,Ux=function(n,t,r,s,i){var a=Y_t(n,s,r),o=new dc(n,a),c=new rl([o],{width:"400em",height:Ze(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return hc(["hide-tail"],[c],i)},q0t=function(n,t){var r=t.havingBaseSizing(),s=kL("\\surd",n*r.sizeMultiplier,SL,r),i=r.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,c,u,_,f;return s.type==="small"?(_=1e3+1e3*a+Hx,n<1?i=1:n<1.4&&(i=.7),c=(1+a+Fx)/i,u=(1+a)/i,o=Ux("sqrtMain",c,_,a,t),o.style.minWidth="0.853em",f=.833/i):s.type==="large"?(_=(1e3+Hx)*Xh[s.size],u=(Xh[s.size]+a)/i,c=(Xh[s.size]+a+Fx)/i,o=Ux("sqrtSize"+s.size,c,_,a,t),o.style.minWidth="1.02em",f=1/i):(c=n+a+Fx,u=n+a,_=Math.floor(1e3*n+a)+Hx,o=Ux("sqrtTall",c,_,a,t),o.style.minWidth="0.742em",f=1.056),o.height=u,o.style.height=Ze(c),{span:o,advanceWidth:f,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},xL=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),G0t=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),yL=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Xh=[0,1.2,1.8,2.4,3],wL=function(n,t,r,s,i){if(n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle"),xL.has(n)||yL.has(n))return bL(n,t,!1,r,s,i);if(G0t.has(n))return vL(n,Xh[t],!1,r,s,i);throw new We("Illegal delimiter: '"+n+"'")},V0t=[{type:"small",style:Gt.SCRIPTSCRIPT},{type:"small",style:Gt.SCRIPT},{type:"small",style:Gt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],W0t=[{type:"small",style:Gt.SCRIPTSCRIPT},{type:"small",style:Gt.SCRIPT},{type:"small",style:Gt.TEXT},{type:"stack"}],SL=[{type:"small",style:Gt.SCRIPTSCRIPT},{type:"small",style:Gt.SCRIPT},{type:"small",style:Gt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],K0t=function(n){if(n.type==="small")return"Main-Regular";if(n.type==="large")return"Size"+n.size+"-Regular";if(n.type==="stack")return"Size4-Regular";var t=n.type;throw new Error("Add support for delim type '"+t+"' here.")},kL=function(n,t,r,s){for(var i=Math.min(2,3-s.style.size),a=i;at)return o}return r[r.length-1]},$2=function(n,t,r,s,i,a){n==="<"||n==="\\lt"||n==="⟨"?n="\\langle":(n===">"||n==="\\gt"||n==="⟩")&&(n="\\rangle");var o;yL.has(n)?o=V0t:xL.has(n)?o=SL:o=W0t;var c=kL(n,t,o,s);return c.type==="small"?P0t(n,c.style,r,s,i,a):c.type==="large"?bL(n,c.size,r,s,i,a):vL(n,t,r,s,i,a)},qx=function(n,t,r,s,i,a){var o=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,u=5/s.fontMetrics().ptPerEm,_=Math.max(t-o,r+o),f=Math.max(_/500*c,2*_-u);return $2(n,f,!0,s,i,a)},xE={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Y0t=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function yE(e){return"isMiddle"in e}function l1(e,n){var t=a1(e);if(t&&Y0t.has(t.text))return t;throw t?new We("Invalid delimiter '"+t.text+"' after '"+n.funcName+"'",e):new We("Invalid delimiter type '"+e.type+"'",e)}it({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,n)=>{var t=l1(n[0],e);return{type:"delimsizing",mode:e.parser.mode,size:xE[e.funcName].size,mclass:xE[e.funcName].mclass,delim:t.text}},htmlBuilder:(e,n)=>e.delim==="."?qe([e.mclass]):wL(e.delim,e.size,n,e.mode,[e.mclass]),mathmlBuilder:e=>{var n=[];e.delim!=="."&&n.push(ta(e.delim,e.mode));var t=new Ke("mo",n);e.mclass==="mopen"||e.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var r=Ze(Xh[e.size]);return t.setAttribute("minsize",r),t.setAttribute("maxsize",r),t}});function wE(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}it({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=e.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new We("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:l1(n[0],e).text,color:t}}});it({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=l1(n[0],e),r=e.parser;++r.leftrightDepth;var s=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=tn(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:s,left:t.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,n)=>{wE(e);for(var t=es(e.body,n,!0,["mopen","mclose"]),r=0,s=0,i=!1,a=0;a{wE(e);var t=Oi(e.body,n);if(e.left!=="."){var r=new Ke("mo",[ta(e.left,e.mode)]);r.setAttribute("fence","true"),t.unshift(r)}if(e.right!=="."){var s=new Ke("mo",[ta(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),t.push(s)}return o5(t)}});it({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var t=l1(n[0],e);if(!e.parser.leftrightDepth)throw new We("\\middle without preceding \\left",t);return{type:"middle",mode:e.parser.mode,delim:t.text}},htmlBuilder:(e,n)=>{var t;return e.delim==="."?t=y_(n,[]):(t=wL(e.delim,1,n,e.mode,[]),t.isMiddle={delim:e.delim,options:n}),t},mathmlBuilder:(e,n)=>{var t=e.delim==="\\vert"||e.delim==="|"?ta("|","text"):ta(e.delim,e.mode),r=new Ke("mo",[t]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var c1=(e,n)=>{var t=cd(An(e.body,n),n),r=e.label.slice(1),s=n.sizeMultiplier,i,a,o=ol(e.body);if(r==="sout")i=qe(["stretchy","sout"]),i.height=n.fontMetrics().defaultRuleThickness/s,a=-.5*n.fontMetrics().xHeight;else if(r==="phase"){var c=dr({number:.6,unit:"pt"},n),u=dr({number:.35,unit:"ex"},n),_=n.havingBaseSizing();s=s/_.sizeMultiplier;var f=t.height+t.depth+c+u;t.style.paddingLeft=Ze(f/2+c);var p=Math.floor(1e3*f*s),m=W_t(p),x=new rl([new dc("phase",m)],{width:"400em",height:Ze(p/1e3),viewBox:"0 0 400000 "+p,preserveAspectRatio:"xMinYMin slice"});i=hc(["hide-tail"],[x],n),i.style.height=Ze(f),a=t.depth+c+u}else{/cancel/.test(r)?o||t.classes.push("cancel-pad"):r==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var S,b,v=0;/box/.test(r)?(v=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness),S=n.fontMetrics().fboxsep+(r==="colorbox"?0:v),b=S):r==="angl"?(v=Math.max(n.fontMetrics().defaultRuleThickness,n.minRuleThickness),S=4*v,b=Math.max(0,.25-t.depth)):(S=o?.2:0,b=S),i=T0t(t,r,S,b,n),/fbox|boxed|fcolorbox/.test(r)?(i.style.borderStyle="solid",i.style.borderWidth=Ze(v)):r==="angl"&&v!==.049&&(i.style.borderTopWidth=Ze(v),i.style.borderRightWidth=Ze(v)),a=t.depth+b,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var y;if(e.backgroundColor)y=jn({positionType:"individualShift",children:[{type:"elem",elem:i,shift:a},{type:"elem",elem:t,shift:0}]});else{var w=/cancel|phase/.test(r)?["svg-align"]:[];y=jn({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:i,shift:a,wrapperClasses:w}]})}return/cancel/.test(r)&&(y.height=t.height,y.depth=t.depth),/cancel/.test(r)&&!o?qe(["mord","cancel-lap"],[y],n):qe(["mord"],[y],n)},u1=(e,n)=>{var t,r=new Ke(e.label.includes("colorbox")?"mpadded":"menclose",[qn(e.body,n)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=n.fontMetrics().fboxsep*n.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*t+"pt"),r.setAttribute("height","+"+2*t+"pt"),r.setAttribute("lspace",t+"pt"),r.setAttribute("voffset",t+"pt"),e.label==="\\fcolorbox"){var s=Math.max(n.fontMetrics().fboxrule,n.minRuleThickness);r.setAttribute("style","border: "+Ze(s)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};it({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=tn(n[0],"color-token").color,a=n[1];return{type:"enclose",mode:r.mode,label:s,backgroundColor:i,body:a}},htmlBuilder:c1,mathmlBuilder:u1});it({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,n,t){var{parser:r,funcName:s}=e,i=tn(n[0],"color-token").color,a=tn(n[1],"color-token").color,o=n[2];return{type:"enclose",mode:r.mode,label:s,backgroundColor:a,borderColor:i,body:o}},htmlBuilder:c1,mathmlBuilder:u1});it({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\fbox",body:n[0]}}});it({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:c1,mathmlBuilder:u1});it({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e;t.mode==="math"&&t.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var s=n[0];return{type:"enclose",mode:t.mode,label:r,body:s}},htmlBuilder:c1,mathmlBuilder:u1});it({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"enclose",mode:t.mode,label:"\\angl",body:n[0]}}});var CL={};function uo(e){for(var{type:n,names:t,props:r,handler:s,htmlBuilder:i,mathmlBuilder:a}=e,o={type:n,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c{var n=e.parser.settings;if(!n.displayMode)throw new We("{"+e.envName+"} can be used only in display mode.")},X0t=new Set(["gather","gather*"]);function f5(e){if(!e.includes("ed"))return!e.includes("*")}function wc(e,n,t){var{hskipBeforeAndAfter:r,addJot:s,cols:i,arraystretch:a,colSeparationType:o,autoTag:c,singleRow:u,emptySingleRow:_,maxNumCols:f,leqno:p}=n;if(e.gullet.beginGroup(),u||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var m=e.gullet.expandMacroAsText("\\arraystretch");if(m==null)a=1;else if(a=parseFloat(m),!a||a<0)throw new We("Invalid \\arraystretch: "+m)}e.gullet.beginGroup();var x=[],S=[x],b=[],v=[],y=c!=null?[]:void 0;function w(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function C(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new wa("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(w(),v.push(SE(e));;){var z=e.parseExpression(!1,u?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var E={type:"ordgroup",mode:e.mode,body:z};t&&(E={type:"styling",mode:e.mode,style:t,resetFont:!0,body:[E]}),x.push(E);var R=e.fetch().text;if(R==="&"){if(f&&x.length===f){if(u||o)throw new We("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(R==="\\end"){C(),x.length===1&&E.type==="styling"&&E.body.length===1&&E.body[0].type==="ordgroup"&&E.body[0].body.length===0&&(S.length>1||!_)&&S.pop(),v.length0&&(w+=.25),u.push({pos:w,isDashed:Je[ft]})}for(C(a[0]),r=0;r0&&(I+=y,RJe))for(r=0;r=o)){var oe=void 0;if(s>0||n.hskipBeforeAndAfter){var ce,pe;oe=(ce=(pe=W)==null?void 0:pe.pregap)!=null?ce:p,oe!==0&&(Y=qe(["arraycolsep"],[]),Y.style.width=Ze(oe),F.push(Y))}var ue=[];for(r=0;r0){for(var $t=ld("hline",t,_),rt=ld("hdashline",t,_),nt=[{type:"elem",elem:Vt,shift:0}];u.length>0;){var ut=u.pop(),pt=ut.pos-H;ut.isDashed?nt.push({type:"elem",elem:rt,shift:pt}):nt.push({type:"elem",elem:$t,shift:pt})}Vt=jn({positionType:"individualShift",children:nt})}if(Q.length===0)return qe(["mord"],[Vt],t);var ve=jn({positionType:"individualShift",children:Q}),Oe=qe(["tag"],[ve],t);return cl([Vt,Oe])},Z0t={c:"center ",l:"left ",r:"right "},ho=function(n,t){for(var r=[],s=new Ke("mtd",[],["mtr-glue"]),i=new Ke("mtd",[],["mml-eqn-num"]),a=0;a0){var x=n.cols,S="",b=!1,v=0,y=x.length;x[0].type==="separator"&&(p+="top ",v=1),x[x.length-1].type==="separator"&&(p+="bottom ",y-=1);for(var w=v;w0?"left ":"",p+=M[M.length-1].length>0?"right ":"";for(var O=1;O0&&m&&(b=1),r[x]={type:"align",align:S,pregap:b,postgap:0}}return a.colSeparationType=m?"align":"alignat",a};uo({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,n){var t=a1(n[0]),r=t?[n[0]]:tn(n[0],"ordgroup").body,s=r.map(function(a){var o=i1(a),c=o.text;if("lcr".includes(c))return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new We("Unknown column alignment: "+c,a)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return wc(e.parser,i,d5(e.envName))},htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var n={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],t="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),t=s.fetch().text,!"lcr".includes(t))throw new We("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),r.cols=[{type:"align",align:t}]}}var i=wc(e.parser,r,d5(e.envName)),a=Math.max(0,...i.body.map(o=>o.length));return i.cols=new Array(a).fill({type:"align",align:t}),n?{type:"leftright",mode:e.mode,body:[i],left:n[0],right:n[1],rightColor:void 0}:i},htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var n={arraystretch:.5},t=wc(e.parser,n,"script");return t.colSeparationType="small",t},htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["subarray"],props:{numArgs:1},handler(e,n){var t=a1(n[0]),r=t?[n[0]]:tn(n[0],"ordgroup").body,s=r.map(function(o){var c=i1(o),u=c.text;if("lc".includes(u))return{type:"align",align:u};throw new We("Unknown column alignment: "+u,o)});if(s.length>1)throw new We("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},a=wc(e.parser,i,"script");if(a.body.length>0&&a.body[0].length>1)throw new We("{subarray} can contain only one column");return a},htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var n={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=wc(e.parser,n,d5(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:zL,htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){X0t.has(e.envName)&&f1(e);var n={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:f5(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return wc(e.parser,n,"display")},htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:zL,htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){f1(e);var n={autoTag:f5(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return wc(e.parser,n,"display")},htmlBuilder:fo,mathmlBuilder:ho});uo({type:"array",names:["CD"],props:{numArgs:0},handler(e){return f1(e),B0t(e.parser)},htmlBuilder:fo,mathmlBuilder:ho});re("\\nonumber","\\gdef\\@eqnsw{0}");re("\\notag","\\nonumber");it({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,n){throw new We(e.funcName+" valid only within array environment")}});var kE=CL;it({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];if(s.type!=="ordgroup")throw new We("Invalid environment name",s);for(var i="",a=0;a{var t=e.font,r=n.withFont(t);return An(e.body,r)},TL=(e,n)=>{var t=e.font,r=n.withFont(t);return qn(e.body,r)},CE={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};it({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=ug(n[0]),i=r;return i in CE&&(i=CE[i]),{type:"font",mode:t.mode,font:i.slice(1),body:s}},htmlBuilder:jL,mathmlBuilder:TL});it({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"mclass",mode:t.mode,mclass:o1(r),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:r}],isCharacterBox:ol(r)}}});it({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r,breakOnTokenText:s}=e,{mode:i}=t,a=t.parseExpression(!0,s);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:t.mode,body:a}}},htmlBuilder:jL,mathmlBuilder:TL});var Q0t=(e,n)=>{var t=n.style,r=t.fracNum(),s=t.fracDen(),i;i=n.havingStyle(r);var a=An(e.numer,i,n);if(e.continued){var o=8.5/n.fontMetrics().ptPerEm,c=3.5/n.fontMetrics().ptPerEm;a.height=a.height0?x=3*p:x=7*p,S=n.fontMetrics().denom1):(f>0?(m=n.fontMetrics().num2,x=p):(m=n.fontMetrics().num3,x=3*p),S=n.fontMetrics().denom2);var b;if(_){var y=n.fontMetrics().axisHeight;m-a.depth-(y+.5*f){var t=new Ke("mfrac",[qn(e.numer,n),qn(e.denom,n)]);if(!e.hasBarLine)t.setAttribute("linethickness","0px");else if(e.barSize){var r=dr(e.barSize,n);t.setAttribute("linethickness",Ze(r))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var i=new Ke("mo",[new Ir(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),s.push(i)}if(s.push(t),e.rightDelim!=null){var a=new Ke("mo",[new Ir(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),s.push(a)}return o5(s)}return t},AL=(e,n)=>{if(!n)return e;var t={type:"styling",mode:e.mode,style:n,body:[e]};return t};it({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=n[1],a,o=null,c=null;switch(r){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":a=!0;break;case"\\\\atopfrac":a=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":a=!1,o="(",c=")";break;case"\\\\bracefrac":a=!1,o="\\{",c="\\}";break;case"\\\\brackfrac":a=!1,o="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}var u=r==="\\cfrac",_=null;return u||r.startsWith("\\d")?_="display":r.startsWith("\\t")&&(_="text"),AL({type:"genfrac",mode:t.mode,numer:s,denom:i,continued:u,hasBarLine:a,leftDelim:o,rightDelim:c,barSize:null},_)},htmlBuilder:Q0t,mathmlBuilder:J0t});it({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:n,funcName:t,token:r}=e,s;switch(t){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:s,token:r}}});var EE=["display","text","script","scriptscript"],NE=function(n){var t=null;return n.length>0&&(t=n,t=t==="."?null:t),t};it({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,n){var{parser:t}=e,r=n[4],s=n[5],i=ug(n[0]),a=i.type==="atom"&&i.family==="open"?NE(i.text):null,o=ug(n[1]),c=o.type==="atom"&&o.family==="close"?NE(o.text):null,u=tn(n[2],"size"),_,f=null;u.isBlank?_=!0:(f=u.value,_=f.number>0);var p=null,m=n[3];if(m.type==="ordgroup"){if(m.body.length>0){var x=tn(m.body[0],"textord");p=EE[Number(x.text)]}}else m=tn(m,"textord"),p=EE[Number(m.text)];return AL({type:"genfrac",mode:t.mode,numer:r,denom:s,continued:!1,hasBarLine:_,barSize:f,leftDelim:a,rightDelim:c},p)}});it({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,n){var{parser:t,funcName:r,token:s}=e;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:tn(n[0],"size").value,token:s}}});it({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0],i=tn(n[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=n[2],o=i.number>0;return{type:"genfrac",mode:t.mode,numer:s,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var RL=(e,n)=>{var t=n.style,r,s;e.type==="supsub"?(r=e.sup?An(e.sup,n.havingStyle(t.sup()),n):An(e.sub,n.havingStyle(t.sub()),n),s=tn(e.base,"horizBrace")):s=tn(e,"horizBrace");var i=An(s.base,n.havingBaseStyle(Gt.DISPLAY)),a=s1(s,n),o;if(s.isOver?o=jn({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:a,wrapperClasses:["svg-align"]}]}):o=jn({positionType:"bottom",positionData:i.depth+.1+a.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:i}]}),r){var c=qe(["minner",s.isOver?"mover":"munder"],[o],n);s.isOver?o=jn({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:r}]}):o=jn({positionType:"bottom",positionData:c.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:c}]})}return qe(["minner",s.isOver?"mover":"munder"],[o],n)},ept=(e,n)=>{var t=r1(e.label);return new Ke(e.isOver?"mover":"munder",[qn(e.base,n),t])};it({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,n){var{parser:t,funcName:r}=e;return{type:"horizBrace",mode:t.mode,label:r,isOver:r.includes("\\over"),base:n[0]}},htmlBuilder:RL,mathmlBuilder:ept});it({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[1],s=tn(n[0],"url").url;return t.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:t.mode,href:s,body:Or(r)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(e,n)=>{var t=es(e.body,n,!1);return h0t(e.href,[],t,n)},mathmlBuilder:(e,n)=>{var t=_c(e.body,n);return t instanceof Ke||(t=new Ke("mrow",[t])),t.setAttribute("href",e.href),t}});it({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=tn(n[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:r}))return t.formatUnsupportedCmd("\\url");for(var s=[],i=0;i{var{parser:t,funcName:r,token:s}=e,i=tn(n[0],"raw").string,a=n[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var o,c={};switch(r){case"\\htmlClass":c.class=i,o={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,o={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,o={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var u=i.split(","),_=0;_{var t=es(e.body,n,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var s=qe(r,t,n);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,n)=>_c(e.body,n)});it({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"htmlmathml",mode:t.mode,html:Or(n[0]),mathml:Or(n[1])}},htmlBuilder:(e,n)=>{var t=es(e.html,n,!1);return cl(t)},mathmlBuilder:(e,n)=>_c(e.mathml,n)});var Gx=function(n){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(n))return{number:+n,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n);if(!t)throw new We("Invalid size: '"+n+"' in \\includegraphics");var r={number:+(t[1]+t[2]),unit:t[3]};if(!KM(r))throw new We("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};it({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,n,t)=>{var{parser:r}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},o="";if(t[0])for(var c=tn(t[0],"raw").string,u=c.split(","),_=0;_{var t=dr(e.height,n),r=0;e.totalheight.number>0&&(r=dr(e.totalheight,n)-t);var s=0;e.width.number>0&&(s=dr(e.width,n));var i={height:Ze(t+r)};s>0&&(i.width=Ze(s)),r>0&&(i.verticalAlign=Ze(-r));var a=new t0t(e.src,e.alt,i);return a.height=t,a.depth=r,a},mathmlBuilder:(e,n)=>{var t=new Ke("mglyph",[]);t.setAttribute("alt",e.alt);var r=dr(e.height,n),s=0;if(e.totalheight.number>0&&(s=dr(e.totalheight,n)-r,t.setAttribute("valign",Ze(-s))),t.setAttribute("height",Ze(r+s)),e.width.number>0){var i=dr(e.width,n);t.setAttribute("width",Ze(i))}return t.setAttribute("src",e.src),t}});it({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=tn(n[0],"size");if(t.settings.strict){var i=r[1]==="m",a=s.value.unit==="mu";i?(a||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+s.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:s.value}},htmlBuilder(e,n){return eL(e.dimension,n)},mathmlBuilder(e,n){var t=dr(e.dimension,n);return new aL(t)}});it({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"lap",mode:t.mode,alignment:r.slice(5),body:s}},htmlBuilder:(e,n)=>{var t;e.alignment==="clap"?(t=qe([],[An(e.body,n)]),t=qe(["inner"],[t],n)):t=qe(["inner"],[An(e.body,n)]);var r=qe(["fix"],[]),s=qe([e.alignment],[t,r],n),i=qe(["strut"]);return i.style.height=Ze(s.height+s.depth),s.depth&&(i.style.verticalAlign=Ze(-s.depth)),s.children.unshift(i),s=qe(["thinbox"],[s],n),qe(["mord","vbox"],[s],n)},mathmlBuilder:(e,n)=>{var t=new Ke("mpadded",[qn(e.body,n)]);if(e.alignment!=="rlap"){var r=e.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",r+"width")}return t.setAttribute("width","0px"),t}});it({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){var{funcName:t,parser:r}=e,s=r.mode;r.switchMode("math");var i=t==="\\("?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(s),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}});it({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,n){throw new We("Mismatched "+e.funcName)}});var zE=(e,n)=>{switch(n.style.size){case Gt.DISPLAY.size:return e.display;case Gt.TEXT.size:return e.text;case Gt.SCRIPT.size:return e.script;case Gt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};it({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,n)=>{var{parser:t}=e;return{type:"mathchoice",mode:t.mode,display:Or(n[0]),text:Or(n[1]),script:Or(n[2]),scriptscript:Or(n[3])}},htmlBuilder:(e,n)=>{var t=zE(e,n),r=es(t,n,!1);return cl(r)},mathmlBuilder:(e,n)=>{var t=zE(e,n);return _c(t,n)}});var ML=(e,n,t,r,s,i,a)=>{e=qe([],[e]);var o=t&&ol(t),c,u;if(n){var _=An(n,r.havingStyle(s.sup()),r);u={elem:_,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-_.depth)}}if(t){var f=An(t,r.havingStyle(s.sub()),r);c={elem:f,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-f.height)}}var p;if(u&&c){var m=r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+a;p=jn({positionType:"bottom",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ze(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Ze(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(c){var x=e.height-a;p=jn({positionType:"top",positionData:x,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ze(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e}]})}else if(u){var S=e.depth+a;p=jn({positionType:"bottom",positionData:S,children:[{type:"elem",elem:e},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:Ze(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else return e;var b=[p];if(c&&i!==0&&!o){var v=qe(["mspace"],[],r);v.style.marginRight=Ze(i),b.unshift(v)}return qe(["mop","op-limits"],b,r)},LL=new Set(["\\smallint"]),Td=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=tn(e.base,"op"),s=!0):i=tn(e,"op");var a=n.style,o=!1;a.size===Gt.DISPLAY.size&&i.symbol&&!LL.has(i.name)&&(o=!0);var c,u;if(i.symbol){var _=o?"Size2-Regular":"Size1-Regular",f="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(f=i.name.slice(1),i.name=f==="oiint"?"\\iint":"\\iiint"),c=Us(i.name,_,"math",n,["mop","op-symbol",o?"large-op":"small-op"]),u=c.italic,f.length>0){var p=nL(f+"Size"+(o?"2":"1"),n);c=jn({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:p,shift:o?.08:0}]}),i.name="\\"+f,c.classes.unshift("mop"),c.italic=u}}else if(i.body){var m=es(i.body,n,!0);m.length===1&&m[0]instanceof Ri?(c=m[0],c.classes[0]="mop"):c=qe(["mop"],m,n)}else{for(var x=[],S=1;S{var t;if(e.symbol)t=new Ke("mo",[ta(e.name,e.mode)]),LL.has(e.name)&&t.setAttribute("largeop","false");else if(e.body)t=new Ke("mo",Oi(e.body,n));else{t=new Ke("mi",[new Ir(e.name.slice(1))]);var r=new Ke("mo",[ta("⁡","text")]);e.parentIsSupSub?t=new Ke("mrow",[t,r]):t=iL([t,r])}return t},tpt={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};it({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=r;return s.length===1&&(s=tpt[s]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Td,mathmlBuilder:i0});it({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Or(r)}},htmlBuilder:Td,mathmlBuilder:i0});var npt={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};it({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Td,mathmlBuilder:i0});it({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:n,funcName:t}=e;return{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Td,mathmlBuilder:i0});it({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:n,funcName:t}=e,r=t;return r.length===1&&(r=npt[r]),{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Td,mathmlBuilder:i0});var DL=(e,n)=>{var t,r,s=!1,i;e.type==="supsub"?(t=e.sup,r=e.sub,i=tn(e.base,"operatorname"),s=!0):i=tn(e,"operatorname");var a;if(i.body.length>0){for(var o=i.body.map(f=>{var p="text"in f?f.text:void 0;return typeof p=="string"?{type:"textord",mode:f.mode,text:p}:f}),c=es(o,n.withFont("mathrm"),!0),u=0;u{for(var t=Oi(e.body,n.withFont("mathrm")),r=!0,s=0;s_.toText()).join("");t=[new Ir(o)]}var c=new Ke("mi",t);c.setAttribute("mathvariant","normal");var u=new Ke("mo",[ta("⁡","text")]);return e.parentIsSupSub?new Ke("mrow",[c,u]):iL([c,u])};it({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,n)=>{var{parser:t,funcName:r}=e,s=n[0];return{type:"operatorname",mode:t.mode,body:Or(s),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:DL,mathmlBuilder:rpt});re("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");$u({type:"ordgroup",htmlBuilder(e,n){return e.semisimple?cl(es(e.body,n,!1)):qe(["mord"],es(e.body,n,!0),n)},mathmlBuilder(e,n){return _c(e.body,n,!0)}});it({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,n){var{parser:t}=e,r=n[0];return{type:"overline",mode:t.mode,body:r}},htmlBuilder(e,n){var t=An(e.body,n.havingCrampedStyle()),r=ld("overline-line",n),s=n.fontMetrics().defaultRuleThickness,i=jn({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*s},{type:"elem",elem:r},{type:"kern",size:s}]});return qe(["mord","overline"],[i],n)},mathmlBuilder(e,n){var t=new Ke("mo",[new Ir("‾")]);t.setAttribute("stretchy","true");var r=new Ke("mover",[qn(e.body,n),t]);return r.setAttribute("accent","true"),r}});it({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"phantom",mode:t.mode,body:Or(r)}},htmlBuilder:(e,n)=>{var t=es(e.body,n.withPhantom(),!1);return cl(t)},mathmlBuilder:(e,n)=>{var t=Oi(e.body,n);return new Ke("mphantom",t)}});re("\\hphantom","\\smash{\\phantom{#1}}");it({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,n)=>{var{parser:t}=e,r=n[0];return{type:"vphantom",mode:t.mode,body:r}},htmlBuilder:(e,n)=>{var t=qe(["inner"],[An(e.body,n.withPhantom())]),r=qe(["fix"],[]);return qe(["mord","rlap"],[t,r],n)},mathmlBuilder:(e,n)=>{var t=Oi(Or(e.body),n),r=new Ke("mphantom",t),s=new Ke("mpadded",[r]);return s.setAttribute("width","0px"),s}});it({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,n){var{parser:t}=e,r=tn(n[0],"size").value,s=n[1];return{type:"raisebox",mode:t.mode,dy:r,body:s}},htmlBuilder(e,n){var t=An(e.body,n),r=dr(e.dy,n);return jn({positionType:"shift",positionData:-r,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ke("mpadded",[qn(e.body,n)]),r=e.dy.number+e.dy.unit;return t.setAttribute("voffset",r),t}});it({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:n}=e;return{type:"internal",mode:n.mode}}});it({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,n,t){var{parser:r}=e,s=t[0],i=tn(n[0],"size"),a=tn(n[1],"size");return{type:"rule",mode:r.mode,shift:s&&tn(s,"size").value,width:i.value,height:a.value}},htmlBuilder(e,n){var t=qe(["mord","rule"],[],n),r=dr(e.width,n),s=dr(e.height,n),i=e.shift?dr(e.shift,n):0;return t.style.borderRightWidth=Ze(r),t.style.borderTopWidth=Ze(s),t.style.bottom=Ze(i),t.width=r,t.height=s+i,t.depth=-i,t.maxFontSize=s*1.125*n.sizeMultiplier,t},mathmlBuilder(e,n){var t=dr(e.width,n),r=dr(e.height,n),s=e.shift?dr(e.shift,n):0,i=n.color&&n.getColor()||"black",a=new Ke("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",Ze(t)),a.setAttribute("height",Ze(r));var o=new Ke("mpadded",[a]);return s>=0?o.setAttribute("height",Ze(s)):(o.setAttribute("height",Ze(s)),o.setAttribute("depth",Ze(-s))),o.setAttribute("voffset",Ze(s)),o}});function OL(e,n,t){for(var r=es(e,n,!1),s=n.sizeMultiplier/t.sizeMultiplier,i=0;i{var t=n.havingSize(e.size);return OL(e.body,t,n)};it({type:"sizing",names:jE,props:{numArgs:0,allowedInText:!0},handler:(e,n)=>{var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!1,t);return{type:"sizing",mode:s.mode,size:jE.indexOf(r)+1,body:i}},htmlBuilder:spt,mathmlBuilder:(e,n)=>{var t=n.havingSize(e.size),r=Oi(e.body,t),s=new Ke("mstyle",r);return s.setAttribute("mathsize",Ze(t.sizeMultiplier)),s}});it({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,n,t)=>{var{parser:r}=e,s=!1,i=!1,a=t[0]&&tn(t[0],"ordgroup");if(a)for(var o,c=0;c{var t=qe([],[An(e.body,n)]);if(!e.smashHeight&&!e.smashDepth)return t;if(e.smashHeight&&(t.height=0),e.smashDepth&&(t.depth=0),e.smashHeight&&e.smashDepth)return qe(["mord","smash"],[t],n);if(t.children)for(var r=0;r{var t=new Ke("mpadded",[qn(e.body,n)]);return e.smashHeight&&t.setAttribute("height","0px"),e.smashDepth&&t.setAttribute("depth","0px"),t}});it({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,n,t){var{parser:r}=e,s=t[0],i=n[0];return{type:"sqrt",mode:r.mode,body:i,index:s}},htmlBuilder(e,n){var t=An(e.body,n.havingCrampedStyle());t.height===0&&(t.height=n.fontMetrics().xHeight),t=cd(t,n);var r=n.fontMetrics(),s=r.defaultRuleThickness,i=s;n.style.idt.height+t.depth+a&&(a=(a+f-t.height-t.depth)/2);var p=c.height-t.height-a-u;t.style.paddingLeft=Ze(_);var m=jn({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+p)},{type:"elem",elem:c},{type:"kern",size:u}]});if(e.index){var x=n.havingStyle(Gt.SCRIPTSCRIPT),S=An(e.index,x,n),b=.6*(m.height-m.depth),v=jn({positionType:"shift",positionData:-b,children:[{type:"elem",elem:S}]}),y=qe(["root"],[v]);return qe(["mord","sqrt"],[y,m],n)}else return qe(["mord","sqrt"],[m],n)},mathmlBuilder(e,n){var{body:t,index:r}=e;return r?new Ke("mroot",[qn(t,n),qn(r,n)]):new Ke("msqrt",[qn(t,n)])}});var P2={display:Gt.DISPLAY,text:Gt.TEXT,script:Gt.SCRIPT,scriptscript:Gt.SCRIPTSCRIPT};function ipt(e){return e in P2}it({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,n){var{breakOnTokenText:t,funcName:r,parser:s}=e,i=s.parseExpression(!0,t),a=r.slice(1,r.length-5);if(!ipt(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:s.mode,style:a,body:i}},htmlBuilder(e,n){var t=P2[e.style],r=n.havingStyle(t);return e.resetFont&&(r=r.withFont("")),OL(e.body,r,n)},mathmlBuilder(e,n){var t=P2[e.style],r=n.havingStyle(t);e.resetFont&&(r=r.withFont(""));var s=Oi(e.body,r),i=new Ke("mstyle",s),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},o=a[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var apt=function(n,t){var r=n.base;if(r)if(r.type==="op"){var s=r.limits&&(t.style.size===Gt.DISPLAY.size||r.alwaysHandleSupSub);return s?Td:null}else if(r.type==="operatorname"){var i=r.alwaysHandleSupSub&&(t.style.size===Gt.DISPLAY.size||r.limits);return i?DL:null}else{if(r.type==="accent")return ol(r.base)?c5:null;if(r.type==="horizBrace"){var a=!n.sub;return a===r.isOver?RL:null}else return null}else return null};$u({type:"supsub",htmlBuilder(e,n){var t=apt(e,n);if(t)return t(e,n);var{base:r,sup:s,sub:i}=e,a=An(r,n),o,c,u=n.fontMetrics(),_=0,f=0,p=r&&ol(r);if(s){var m=n.havingStyle(n.style.sup());o=An(s,m,n),p||(_=a.height-m.fontMetrics().supDrop*m.sizeMultiplier/n.sizeMultiplier)}if(i){var x=n.havingStyle(n.style.sub());c=An(i,x,n),p||(f=a.depth+x.fontMetrics().subDrop*x.sizeMultiplier/n.sizeMultiplier)}var S;n.style===Gt.DISPLAY?S=u.sup1:n.style.cramped?S=u.sup3:S=u.sup2;var b=n.sizeMultiplier,v=Ze(.5/u.ptPerEm/b),y=null;if(c){var w=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(a instanceof Ri||w){var C;y=Ze(-((C=a.italic)!=null?C:0))}}var z;if(o&&c){_=Math.max(_,S,o.depth+.25*u.xHeight),f=Math.max(f,u.sub2);var E=u.defaultRuleThickness,R=4*E;if(_-o.depth-(c.height-f)0&&(_+=N,f-=N)}var M=[{type:"elem",elem:c,shift:f,marginRight:v,marginLeft:y},{type:"elem",elem:o,shift:-_,marginRight:v}];z=jn({positionType:"individualShift",children:M})}else if(c){f=Math.max(f,u.sub1,c.height-.8*u.xHeight);var O=[{type:"elem",elem:c,marginLeft:y,marginRight:v}];z=jn({positionType:"shift",positionData:f,children:O})}else if(o)_=Math.max(_,S,o.depth+.25*u.xHeight),z=jn({positionType:"shift",positionData:-_,children:[{type:"elem",elem:o,marginRight:v}]});else throw new Error("supsub must have either sup or sub.");var I=D2(a,"right")||"mord";return qe([I],[a,qe(["msupsub"],[z])],n)},mathmlBuilder(e,n){var t=!1,r,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(t=!0,r=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[qn(e.base,n)];e.sub&&i.push(qn(e.sub,n)),e.sup&&i.push(qn(e.sup,n));var a;if(t)a=r?"mover":"munder";else if(e.sub)if(e.sup){var u=e.base;u&&u.type==="op"&&u.limits&&n.style===Gt.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(n.style===Gt.DISPLAY||u.limits)?a="munderover":a="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(n.style===Gt.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||n.style===Gt.DISPLAY)?a="munder":a="msub"}else{var o=e.base;o&&o.type==="op"&&o.limits&&(n.style===Gt.DISPLAY||o.alwaysHandleSupSub)||o&&o.type==="operatorname"&&o.alwaysHandleSupSub&&(o.limits||n.style===Gt.DISPLAY)?a="mover":a="msup"}return new Ke(a,i)}});$u({type:"atom",htmlBuilder(e,n){return i5(e.text,e.mode,n,["m"+e.family])},mathmlBuilder(e,n){var t=new Ke("mo",[ta(e.text,e.mode)]);if(e.family==="bin"){var r=l5(e,n);r==="bold-italic"&&t.setAttribute("mathvariant",r)}else e.family==="punct"?t.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&t.setAttribute("stretchy","false");return t}});var IL={mi:"italic",mn:"normal",mtext:"normal"};$u({type:"mathord",htmlBuilder(e,n){return n1(e,n,"mathord")},mathmlBuilder(e,n){var t=new Ke("mi",[ta(e.text,e.mode,n)]),r=l5(e,n)||"italic";return r!==IL[t.type]&&t.setAttribute("mathvariant",r),t}});$u({type:"textord",htmlBuilder(e,n){return n1(e,n,"textord")},mathmlBuilder(e,n){var t=ta(e.text,e.mode,n),r=l5(e,n)||"normal",s;return e.mode==="text"?s=new Ke("mtext",[t]):/[0-9]/.test(e.text)?s=new Ke("mn",[t]):e.text==="\\prime"?s=new Ke("mo",[t]):s=new Ke("mi",[t]),r!==IL[s.type]&&s.setAttribute("mathvariant",r),s}});var Vx={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Wx={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};$u({type:"spacing",htmlBuilder(e,n){if(Wx.hasOwnProperty(e.text)){var t=Wx[e.text].className||"";if(e.mode==="text"){var r=n1(e,n,"textord");return r.classes.push(t),r}else return qe(["mspace",t],[i5(e.text,e.mode,n)],n)}else{if(Vx.hasOwnProperty(e.text))return qe(["mspace",Vx[e.text]],[],n);throw new We('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,n){var t;if(Wx.hasOwnProperty(e.text))t=new Ke("mtext",[new Ir(" ")]);else{if(Vx.hasOwnProperty(e.text))return new Ke("mspace");throw new We('Unknown type of space "'+e.text+'"')}return t}});var TE=()=>{var e=new Ke("mtd",[]);return e.setAttribute("width","50%"),e};$u({type:"tag",mathmlBuilder(e,n){var t=new Ke("mtable",[new Ke("mtr",[TE(),new Ke("mtd",[_c(e.body,n)]),TE(),new Ke("mtd",[_c(e.tag,n)])])]);return t.setAttribute("width","100%"),t}});var AE={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},RE={"\\textbf":"textbf","\\textmd":"textmd"},opt={"\\textit":"textit","\\textup":"textup"},ME=(e,n)=>{var t=e.font;if(t){if(AE[t])return n.withTextFontFamily(AE[t]);if(RE[t])return n.withTextFontWeight(RE[t]);if(t==="\\emph")return n.fontShape==="textit"?n.withTextFontShape("textup"):n.withTextFontShape("textit")}else return n;return n.withTextFontShape(opt[t])};it({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,n){var{parser:t,funcName:r}=e,s=n[0];return{type:"text",mode:t.mode,body:Or(s),font:r}},htmlBuilder(e,n){var t=ME(e,n),r=es(e.body,t,!0);return qe(["mord","text"],r,t)},mathmlBuilder(e,n){var t=ME(e,n);return _c(e.body,t)}});it({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,n){var{parser:t}=e;return{type:"underline",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=An(e.body,n),r=ld("underline-line",n),s=n.fontMetrics().defaultRuleThickness,i=jn({positionType:"top",positionData:t.height,children:[{type:"kern",size:s},{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:t}]});return qe(["mord","underline"],[i],n)},mathmlBuilder(e,n){var t=new Ke("mo",[new Ir("‾")]);t.setAttribute("stretchy","true");var r=new Ke("munder",[qn(e.body,n),t]);return r.setAttribute("accentunder","true"),r}});it({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,n){var{parser:t}=e;return{type:"vcenter",mode:t.mode,body:n[0]}},htmlBuilder(e,n){var t=An(e.body,n),r=n.fontMetrics().axisHeight,s=.5*(t.height-r-(t.depth+r));return jn({positionType:"shift",positionData:s,children:[{type:"elem",elem:t}]})},mathmlBuilder(e,n){var t=new Ke("mpadded",[qn(e.body,n)],["vcenter"]);return new Ke("mrow",[t])}});it({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,n,t){throw new We("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,n){for(var t=LE(e),r=[],s=n.havingStyle(n.style.text()),i=0;ie.body.replace(/ /g,e.star?"␣":" "),sc=rL,BL=`[ \r + ]`,lpt="\\\\[a-zA-Z@]+",cpt="\\\\[^\uD800-\uDFFF]",upt="("+lpt+")"+BL+"*",fpt=`\\\\( +|[ \r ]+ +?)[ \r ]*`,H2="[̀-ͯ]",dpt=new RegExp(H2+"+$"),hpt="("+BL+"+)|"+(fpt+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(H2+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(H2+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+upt)+("|"+cpt+")");class DE{constructor(n,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=n,this.settings=t,this.tokenRegex=new RegExp(hpt,"g"),this.catcodes={"%":14,"~":13}}setCatcode(n,t){this.catcodes[n]=t}lex(){var n=this.input,t=this.tokenRegex.lastIndex;if(t===n.length)return new wa("EOF",new ii(this,t,t));var r=this.tokenRegex.exec(n);if(r===null||r.index!==t)throw new We("Unexpected character: '"+n[t]+"'",new wa(n[t],new ii(this,t,t+1)));var s=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=n.indexOf(` +`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=n.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new wa(s,new ii(this,t,this.tokenRegex.lastIndex))}}class _pt{constructor(n,t){n===void 0&&(n={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=n,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new We("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var n=this.undefStack.pop();for(var t in n)n.hasOwnProperty(t)&&(n[t]==null?delete this.current[t]:this.current[t]=n[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(n){return this.current.hasOwnProperty(n)||this.builtins.hasOwnProperty(n)}get(n){return this.current.hasOwnProperty(n)?this.current[n]:this.builtins[n]}set(n,t,r){if(r===void 0&&(r=!1),r){for(var s=0;s0&&(this.undefStack[this.undefStack.length-1][n]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(n)&&(i[n]=this.current[n])}t==null?delete this.current[n]:this.current[n]=t}}var ppt=EL;re("\\noexpand",function(e){var n=e.popToken();return e.isExpandable(n.text)&&(n.noexpand=!0,n.treatAsRelax=!0),{tokens:[n],numArgs:0}});re("\\expandafter",function(e){var n=e.popToken();return e.expandOnce(!0),{tokens:[n],numArgs:0}});re("\\@firstoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[0],numArgs:0}});re("\\@secondoftwo",function(e){var n=e.consumeArgs(2);return{tokens:n[1],numArgs:0}});re("\\@ifnextchar",function(e){var n=e.consumeArgs(3);e.consumeSpaces();var t=e.future();return n[0].length===1&&n[0][0].text===t.text?{tokens:n[1],numArgs:0}:{tokens:n[2],numArgs:0}});re("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");re("\\TextOrMath",function(e){var n=e.consumeArgs(2);return e.mode==="text"?{tokens:n[0],numArgs:0}:{tokens:n[1],numArgs:0}});var OE={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};re("\\char",function(e){var n=e.popToken(),t,r=0;if(n.text==="'")t=8,n=e.popToken();else if(n.text==='"')t=16,n=e.popToken();else if(n.text==="`")if(n=e.popToken(),n.text[0]==="\\")r=n.text.charCodeAt(1);else{if(n.text==="EOF")throw new We("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(r=OE[n.text],r==null||r>=t)throw new We("Invalid base-"+t+" digit "+n.text);for(var s;(s=OE[e.future().text])!=null&&s{var s=e.consumeArg().tokens;if(s.length!==1)throw new We("\\newcommand's first argument must be a macro name");var i=s[0].text,a=e.isDefined(i);if(a&&!n)throw new We("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!a&&!t)throw new We("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)c+=u.text,u=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new We("Invalid number of arguments: "+c);o=parseInt(c),s=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:s,numArgs:o}),""};re("\\newcommand",e=>h5(e,!1,!0,!1));re("\\renewcommand",e=>h5(e,!0,!1,!1));re("\\providecommand",e=>h5(e,!0,!0,!0));re("\\message",e=>{var n=e.consumeArgs(1)[0];return console.log(n.reverse().map(t=>t.text).join("")),""});re("\\errmessage",e=>{var n=e.consumeArgs(1)[0];return console.error(n.reverse().map(t=>t.text).join("")),""});re("\\show",e=>{var n=e.popToken(),t=n.text;return console.log(n,e.macros.get(t),sc[t],ir.math[t],ir.text[t]),""});re("\\bgroup","{");re("\\egroup","}");re("~","\\nobreakspace");re("\\lq","`");re("\\rq","'");re("\\aa","\\r a");re("\\AA","\\r A");re("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");re("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");re("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");re("ℬ","\\mathscr{B}");re("ℰ","\\mathscr{E}");re("ℱ","\\mathscr{F}");re("ℋ","\\mathscr{H}");re("ℐ","\\mathscr{I}");re("ℒ","\\mathscr{L}");re("ℳ","\\mathscr{M}");re("ℛ","\\mathscr{R}");re("ℭ","\\mathfrak{C}");re("ℌ","\\mathfrak{H}");re("ℨ","\\mathfrak{Z}");re("\\Bbbk","\\Bbb{k}");re("\\llap","\\mathllap{\\textrm{#1}}");re("\\rlap","\\mathrlap{\\textrm{#1}}");re("\\clap","\\mathclap{\\textrm{#1}}");re("\\mathstrut","\\vphantom{(}");re("\\underbar","\\underline{\\text{#1}}");re("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');re("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");re("\\ne","\\neq");re("≠","\\neq");re("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");re("∉","\\notin");re("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");re("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");re("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");re("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");re("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");re("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");re("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");re("⟂","\\perp");re("‼","\\mathclose{!\\mkern-0.8mu!}");re("∌","\\notni");re("⌜","\\ulcorner");re("⌝","\\urcorner");re("⌞","\\llcorner");re("⌟","\\lrcorner");re("©","\\copyright");re("®","\\textregistered");re("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');re("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');re("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');re("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');re("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");re("⋮","\\vdots");re("\\varGamma","\\mathit{\\Gamma}");re("\\varDelta","\\mathit{\\Delta}");re("\\varTheta","\\mathit{\\Theta}");re("\\varLambda","\\mathit{\\Lambda}");re("\\varXi","\\mathit{\\Xi}");re("\\varPi","\\mathit{\\Pi}");re("\\varSigma","\\mathit{\\Sigma}");re("\\varUpsilon","\\mathit{\\Upsilon}");re("\\varPhi","\\mathit{\\Phi}");re("\\varPsi","\\mathit{\\Psi}");re("\\varOmega","\\mathit{\\Omega}");re("\\substack","\\begin{subarray}{c}#1\\end{subarray}");re("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");re("\\boxed","\\fbox{$\\displaystyle{#1}$}");re("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");re("\\implies","\\DOTSB\\;\\Longrightarrow\\;");re("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");re("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");re("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var IE={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},mpt=new Set(["bin","rel"]);re("\\dots",function(e){var n="\\dotso",t=e.expandAfterFuture().text;return t in IE?n=IE[t]:(t.slice(0,4)==="\\not"||t in ir.math&&mpt.has(ir.math[t].group))&&(n="\\dotsb"),n});var _5={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};re("\\dotso",function(e){var n=e.future().text;return n in _5?"\\ldots\\,":"\\ldots"});re("\\dotsc",function(e){var n=e.future().text;return n in _5&&n!==","?"\\ldots\\,":"\\ldots"});re("\\cdots",function(e){var n=e.future().text;return n in _5?"\\@cdots\\,":"\\@cdots"});re("\\dotsb","\\cdots");re("\\dotsm","\\cdots");re("\\dotsi","\\!\\cdots");re("\\dotsx","\\ldots\\,");re("\\DOTSI","\\relax");re("\\DOTSB","\\relax");re("\\DOTSX","\\relax");re("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");re("\\,","\\tmspace+{3mu}{.1667em}");re("\\thinspace","\\,");re("\\>","\\mskip{4mu}");re("\\:","\\tmspace+{4mu}{.2222em}");re("\\medspace","\\:");re("\\;","\\tmspace+{5mu}{.2777em}");re("\\thickspace","\\;");re("\\!","\\tmspace-{3mu}{.1667em}");re("\\negthinspace","\\!");re("\\negmedspace","\\tmspace-{4mu}{.2222em}");re("\\negthickspace","\\tmspace-{5mu}{.277em}");re("\\enspace","\\kern.5em ");re("\\enskip","\\hskip.5em\\relax");re("\\quad","\\hskip1em\\relax");re("\\qquad","\\hskip2em\\relax");re("\\tag","\\@ifstar\\tag@literal\\tag@paren");re("\\tag@paren","\\tag@literal{({#1})}");re("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new We("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});re("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");re("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");re("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");re("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");re("\\newline","\\\\\\relax");re("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var $L=Ze(Za["Main-Regular"][84][1]-.7*Za["Main-Regular"][65][1]);re("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+$L+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");re("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+$L+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");re("\\hspace","\\@ifstar\\@hspacer\\@hspace");re("\\@hspace","\\hskip #1\\relax");re("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");re("\\ordinarycolon",":");re("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");re("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');re("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');re("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');re("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');re("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');re("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');re("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');re("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');re("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');re("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');re("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');re("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');re("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');re("∷","\\dblcolon");re("∹","\\eqcolon");re("≔","\\coloneqq");re("≕","\\eqqcolon");re("⩴","\\Coloneqq");re("\\ratio","\\vcentcolon");re("\\coloncolon","\\dblcolon");re("\\colonequals","\\coloneqq");re("\\coloncolonequals","\\Coloneqq");re("\\equalscolon","\\eqqcolon");re("\\equalscoloncolon","\\Eqqcolon");re("\\colonminus","\\coloneq");re("\\coloncolonminus","\\Coloneq");re("\\minuscolon","\\eqcolon");re("\\minuscoloncolon","\\Eqcolon");re("\\coloncolonapprox","\\Colonapprox");re("\\coloncolonsim","\\Colonsim");re("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");re("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");re("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");re("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");re("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");re("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");re("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");re("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");re("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");re("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");re("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");re("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");re("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");re("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");re("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");re("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");re("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");re("\\nleqq","\\html@mathml{\\@nleqq}{≰}");re("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");re("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");re("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");re("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");re("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");re("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");re("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");re("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");re("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");re("\\imath","\\html@mathml{\\@imath}{ı}");re("\\jmath","\\html@mathml{\\@jmath}{ȷ}");re("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");re("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");re("⟦","\\llbracket");re("⟧","\\rrbracket");re("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");re("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");re("⦃","\\lBrace");re("⦄","\\rBrace");re("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");re("⦵","\\minuso");re("\\darr","\\downarrow");re("\\dArr","\\Downarrow");re("\\Darr","\\Downarrow");re("\\lang","\\langle");re("\\rang","\\rangle");re("\\uarr","\\uparrow");re("\\uArr","\\Uparrow");re("\\Uarr","\\Uparrow");re("\\N","\\mathbb{N}");re("\\R","\\mathbb{R}");re("\\Z","\\mathbb{Z}");re("\\alef","\\aleph");re("\\alefsym","\\aleph");re("\\Alpha","\\mathrm{A}");re("\\Beta","\\mathrm{B}");re("\\bull","\\bullet");re("\\Chi","\\mathrm{X}");re("\\clubs","\\clubsuit");re("\\cnums","\\mathbb{C}");re("\\Complex","\\mathbb{C}");re("\\Dagger","\\ddagger");re("\\diamonds","\\diamondsuit");re("\\empty","\\emptyset");re("\\Epsilon","\\mathrm{E}");re("\\Eta","\\mathrm{H}");re("\\exist","\\exists");re("\\harr","\\leftrightarrow");re("\\hArr","\\Leftrightarrow");re("\\Harr","\\Leftrightarrow");re("\\hearts","\\heartsuit");re("\\image","\\Im");re("\\infin","\\infty");re("\\Iota","\\mathrm{I}");re("\\isin","\\in");re("\\Kappa","\\mathrm{K}");re("\\larr","\\leftarrow");re("\\lArr","\\Leftarrow");re("\\Larr","\\Leftarrow");re("\\lrarr","\\leftrightarrow");re("\\lrArr","\\Leftrightarrow");re("\\Lrarr","\\Leftrightarrow");re("\\Mu","\\mathrm{M}");re("\\natnums","\\mathbb{N}");re("\\Nu","\\mathrm{N}");re("\\Omicron","\\mathrm{O}");re("\\plusmn","\\pm");re("\\rarr","\\rightarrow");re("\\rArr","\\Rightarrow");re("\\Rarr","\\Rightarrow");re("\\real","\\Re");re("\\reals","\\mathbb{R}");re("\\Reals","\\mathbb{R}");re("\\Rho","\\mathrm{P}");re("\\sdot","\\cdot");re("\\sect","\\S");re("\\spades","\\spadesuit");re("\\sub","\\subset");re("\\sube","\\subseteq");re("\\supe","\\supseteq");re("\\Tau","\\mathrm{T}");re("\\thetasym","\\vartheta");re("\\weierp","\\wp");re("\\Zeta","\\mathrm{Z}");re("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");re("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");re("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");re("\\bra","\\mathinner{\\langle{#1}|}");re("\\ket","\\mathinner{|{#1}\\rangle}");re("\\braket","\\mathinner{\\langle{#1}\\rangle}");re("\\Bra","\\left\\langle#1\\right|");re("\\Ket","\\left|#1\\right\\rangle");var PL=e=>n=>{var t=n.consumeArg().tokens,r=n.consumeArg().tokens,s=n.consumeArg().tokens,i=n.consumeArg().tokens,a=n.macros.get("|"),o=n.macros.get("\\|");n.macros.beginGroup();var c=f=>p=>{e&&(p.macros.set("|",a),s.length&&p.macros.set("\\|",o));var m=f;if(!f&&s.length){var x=p.future();x.text==="|"&&(p.popToken(),m=!0)}return{tokens:m?s:r,numArgs:0}};n.macros.set("|",c(!1)),s.length&&n.macros.set("\\|",c(!0));var u=n.consumeArg().tokens,_=n.expandTokens([...i,...u,...t]);return n.macros.endGroup(),{tokens:_.reverse(),numArgs:0}};re("\\bra@ket",PL(!1));re("\\bra@set",PL(!0));re("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");re("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");re("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");re("\\angln","{\\angl n}");re("\\blue","\\textcolor{##6495ed}{#1}");re("\\orange","\\textcolor{##ffa500}{#1}");re("\\pink","\\textcolor{##ff00af}{#1}");re("\\red","\\textcolor{##df0030}{#1}");re("\\green","\\textcolor{##28ae7b}{#1}");re("\\gray","\\textcolor{gray}{#1}");re("\\purple","\\textcolor{##9d38bd}{#1}");re("\\blueA","\\textcolor{##ccfaff}{#1}");re("\\blueB","\\textcolor{##80f6ff}{#1}");re("\\blueC","\\textcolor{##63d9ea}{#1}");re("\\blueD","\\textcolor{##11accd}{#1}");re("\\blueE","\\textcolor{##0c7f99}{#1}");re("\\tealA","\\textcolor{##94fff5}{#1}");re("\\tealB","\\textcolor{##26edd5}{#1}");re("\\tealC","\\textcolor{##01d1c1}{#1}");re("\\tealD","\\textcolor{##01a995}{#1}");re("\\tealE","\\textcolor{##208170}{#1}");re("\\greenA","\\textcolor{##b6ffb0}{#1}");re("\\greenB","\\textcolor{##8af281}{#1}");re("\\greenC","\\textcolor{##74cf70}{#1}");re("\\greenD","\\textcolor{##1fab54}{#1}");re("\\greenE","\\textcolor{##0d923f}{#1}");re("\\goldA","\\textcolor{##ffd0a9}{#1}");re("\\goldB","\\textcolor{##ffbb71}{#1}");re("\\goldC","\\textcolor{##ff9c39}{#1}");re("\\goldD","\\textcolor{##e07d10}{#1}");re("\\goldE","\\textcolor{##a75a05}{#1}");re("\\redA","\\textcolor{##fca9a9}{#1}");re("\\redB","\\textcolor{##ff8482}{#1}");re("\\redC","\\textcolor{##f9685d}{#1}");re("\\redD","\\textcolor{##e84d39}{#1}");re("\\redE","\\textcolor{##bc2612}{#1}");re("\\maroonA","\\textcolor{##ffbde0}{#1}");re("\\maroonB","\\textcolor{##ff92c6}{#1}");re("\\maroonC","\\textcolor{##ed5fa6}{#1}");re("\\maroonD","\\textcolor{##ca337c}{#1}");re("\\maroonE","\\textcolor{##9e034e}{#1}");re("\\purpleA","\\textcolor{##ddd7ff}{#1}");re("\\purpleB","\\textcolor{##c6b9fc}{#1}");re("\\purpleC","\\textcolor{##aa87ff}{#1}");re("\\purpleD","\\textcolor{##7854ab}{#1}");re("\\purpleE","\\textcolor{##543b78}{#1}");re("\\mintA","\\textcolor{##f5f9e8}{#1}");re("\\mintB","\\textcolor{##edf2df}{#1}");re("\\mintC","\\textcolor{##e0e5cc}{#1}");re("\\grayA","\\textcolor{##f6f7f7}{#1}");re("\\grayB","\\textcolor{##f0f1f2}{#1}");re("\\grayC","\\textcolor{##e3e5e6}{#1}");re("\\grayD","\\textcolor{##d6d8da}{#1}");re("\\grayE","\\textcolor{##babec2}{#1}");re("\\grayF","\\textcolor{##888d93}{#1}");re("\\grayG","\\textcolor{##626569}{#1}");re("\\grayH","\\textcolor{##3b3e40}{#1}");re("\\grayI","\\textcolor{##21242c}{#1}");re("\\kaBlue","\\textcolor{##314453}{#1}");re("\\kaGreen","\\textcolor{##71B307}{#1}");var HL={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class gpt{constructor(n,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(n),this.macros=new _pt(ppt,t.macros),this.mode=r,this.stack=[]}feed(n){this.lexer=new DE(n,this.settings)}switchMode(n){this.mode=n}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(n){this.stack.push(n)}pushTokens(n){this.stack.push(...n)}scanArgument(n){var t,r,s;if(n){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:s,end:r}=this.consumeArg(["]"])}else({tokens:s,start:t,end:r}=this.consumeArg());return this.pushToken(new wa("EOF",r.loc)),this.pushTokens(s),new wa("",ii.range(t,r))}consumeSpaces(){for(;;){var n=this.future();if(n.text===" ")this.stack.pop();else break}}consumeArg(n){var t=[],r=n&&n.length>0;r||this.consumeSpaces();var s=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text==="{")++a;else if(i.text==="}"){if(--a,a===-1)throw new We("Extra }",i)}else if(i.text==="EOF")throw new We("Unexpected end of input in a macro argument, expected '"+(n&&r?n[o]:"}")+"'",i);if(n&&r)if((a===0||a===1&&n[o]==="{")&&i.text===n[o]){if(++o,o===n.length){t.splice(-o,o);break}}else o=0}while(a!==0||r);return s.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:s,end:i}}consumeArgs(n,t){if(t){if(t.length!==n+1)throw new We("The length of delimiters doesn't match the number of args!");for(var r=t[0],s=0;sthis.settings.maxExpand)throw new We("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(n){var t=this.popToken(),r=t.text,s=t.noexpand?null:this._getExpansion(r);if(s==null||n&&s.unexpandable){if(n&&s==null&&r[0]==="\\"&&!this.isDefined(r))throw new We("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);var i=s.tokens,a=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var c=i[o];if(c.text==="#"){if(o===0)throw new We("Incomplete placeholder at end of macro body",c);if(c=i[--o],c.text==="#")i.splice(o+1,1);else if(/^[1-9]$/.test(c.text))i.splice(o,2,...a[+c.text-1]);else throw new We("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var n=this.stack.pop();return n.treatAsRelax&&(n.text="\\relax"),n}}expandMacro(n){return this.macros.has(n)?this.expandTokens([new wa(n)]):void 0}expandTokens(n){var t=[],r=this.stack.length;for(this.pushTokens(n);this.stack.length>r;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),t.push(s)}return this.countExpansion(t.length),t}expandMacroAsText(n){var t=this.expandMacro(n);return t&&t.map(r=>r.text).join("")}_getExpansion(n){var t=this.macros.get(n);if(t==null)return t;if(n.length===1){var r=this.lexer.catcodes[n];if(r!=null&&r!==13)return}var s=typeof t=="function"?t(this):t;if(typeof s=="string"){var i=0;if(s.includes("#"))for(var a=s.replace(/##/g,"");a.includes("#"+(i+1));)++i;for(var o=new DE(s,this.settings),c=[],u=o.lex();u.text!=="EOF";)c.push(u),u=o.lex();c.reverse();var _={tokens:c,numArgs:i};return _}return s}isDefined(n){return this.macros.has(n)||sc.hasOwnProperty(n)||ir.math.hasOwnProperty(n)||ir.text.hasOwnProperty(n)||HL.hasOwnProperty(n)}isExpandable(n){var t=this.macros.get(n);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:sc.hasOwnProperty(n)&&!sc[n].primitive}}var BE=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Fp=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Kx={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},$E={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class d1{constructor(n,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new gpt(n,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(n,t){if(t===void 0&&(t=!0),this.fetch().text!==n)throw new We("Expected '"+n+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(n){this.mode=n,this.gullet.switchMode(n)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var n=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),n}finally{this.gullet.endGroups()}}subparse(n){var t=this.nextToken;this.consume(),this.gullet.pushToken(new wa("}")),this.gullet.pushTokens(n);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(n,t){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(d1.endOfExpression.has(s.text)||t&&s.text===t||n&&sc[s.text]&&sc[s.text].infix)break;var i=this.parseAtom(t);if(i){if(i.type==="internal")continue}else break;r.push(i)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(n){for(var t=-1,r,s=0;s=128)this.settings.strict&&(WM(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',n):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),n)),a={type:"textord",mode:"text",loc:ii.range(n),text:t};else return null;if(this.consume(),i)for(var _=0;_0?{type:"text",value:E}:void 0),E===!1?p.lastIndex=C+1:(x!==C&&y.push({type:"text",value:u.value.slice(x,C)}),Array.isArray(E)?y.push(...E):E&&y.push(E),x=C+w[0].length,v=!0),!p.global)break;w=p.exec(u.value)}return v?(x?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const s=HE(e,"(");let i=HE(e,")");for(;r!==-1&&s>i;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),i++;return[e,t]}function GL(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Cu(t)||Yg(t))&&(!n||t!==47)}VL.peek=Xpt;function Fpt(){this.buffer()}function Upt(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function qpt(){this.buffer()}function Gpt(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Vpt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=xa(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Wpt(e){this.exit(e)}function Kpt(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=xa(this.sliceSerialize(e)).toLowerCase(),t.label=n}function Ypt(e){this.exit(e)}function Xpt(){return"["}function VL(e,n,t,r){const s=t.createTracker(r);let i=s.move("[^");const a=t.enter("footnoteReference"),o=t.enter("reference");return i+=s.move(t.safe(t.associationId(e),{after:"]",before:i})),o(),a(),i+=s.move("]"),i}function Zpt(){return{enter:{gfmFootnoteCallString:Fpt,gfmFootnoteCall:Upt,gfmFootnoteDefinitionLabelString:qpt,gfmFootnoteDefinition:Gpt},exit:{gfmFootnoteCallString:Vpt,gfmFootnoteCall:Wpt,gfmFootnoteDefinitionLabelString:Kpt,gfmFootnoteDefinition:Ypt}}}function Qpt(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:VL},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,s,i,a){const o=i.createTracker(a);let c=o.move("[^");const u=i.enter("footnoteDefinition"),_=i.enter("label");return c+=o.move(i.safe(i.associationId(r),{before:c,after:"]"})),_(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((n?` +`:" ")+i.indentLines(i.containerFlow(r,o.current()),n?WL:Jpt))),u(),c}}function Jpt(e,n,t){return n===0?e:WL(e,n,t)}function WL(e,n,t){return(t?"":" ")+e}const emt=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];KL.peek=imt;function tmt(){return{canContainEols:["delete"],enter:{strikethrough:rmt},exit:{strikethrough:smt}}}function nmt(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:emt}],handlers:{delete:KL}}}function rmt(e){this.enter({type:"delete",children:[]},e)}function smt(e){this.exit(e)}function KL(e,n,t,r){const s=t.createTracker(r),i=t.enter("strikethrough");let a=s.move("~~");return a+=t.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function imt(){return"~"}function amt(e){return e.length}function omt(e,n){const t=n||{},r=(t.align||[]).concat(),s=t.stringLength||amt,i=[],a=[],o=[],c=[];let u=0,_=-1;for(;++_u&&(u=e[_].length);++vc[v])&&(c[v]=w)}S.push(y)}a[_]=S,o[_]=b}let f=-1;if(typeof r=="object"&&"length"in r)for(;++fc[f]&&(c[f]=y),m[f]=y),p[f]=w}a.splice(1,0,p),o.splice(1,0,m),_=-1;const x=[];for(;++_ "),i.shift(2);const a=t.indentLines(t.containerFlow(e,i.current()),umt);return s(),a}function umt(e,n,t){return">"+(t?"":" ")+e}function fmt(e,n){return UE(e,n.inConstruct,!0)&&!UE(e,n.notInConstruct,!1)}function UE(e,n,t){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return t;let r=-1;for(;++ra&&(a=i):i=1,s=r+n.length,r=t.indexOf(n,s);return a}function dmt(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function hmt(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function _mt(e,n,t,r){const s=hmt(t),i=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(dmt(e,t)){const f=t.enter("codeIndented"),p=t.indentLines(i,pmt);return f(),p}const o=t.createTracker(r),c=s.repeat(Math.max(YL(i,s)+1,3)),u=t.enter("codeFenced");let _=o.move(c);if(e.lang){const f=t.enter(`codeFencedLang${a}`);_+=o.move(t.safe(e.lang,{before:_,after:" ",encode:["`"],...o.current()})),f()}if(e.lang&&e.meta){const f=t.enter(`codeFencedMeta${a}`);_+=o.move(" "),_+=o.move(t.safe(e.meta,{before:_,after:` +`,encode:["`"],...o.current()})),f()}return _+=o.move(` +`),i&&(_+=o.move(i+` +`)),_+=o.move(c),u(),_}function pmt(e,n,t){return(t?"":" ")+e}function g5(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function mmt(e,n,t,r){const s=g5(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("definition");let o=t.enter("label");const c=t.createTracker(r);let u=c.move("[");return u+=c.move(t.safe(t.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(t.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=t.enter("destinationRaw"),u+=c.move(t.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(t.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),a(),u}function gmt(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function w_(e){return"&#x"+e.toString(16).toUpperCase()+";"}function fg(e,n,t){const r=ad(e),s=ad(n);return r===void 0?s===void 0?t==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}XL.peek=bmt;function XL(e,n,t,r){const s=gmt(t),i=t.enter("emphasis"),a=t.createTracker(r),o=a.move(s);let c=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),_=fg(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(c=w_(u)+c.slice(1));const f=c.charCodeAt(c.length-1),p=fg(r.after.charCodeAt(0),f,s);p.inside&&(c=c.slice(0,-1)+w_(f));const m=a.move(s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+c+m}function bmt(e,n,t){return t.options.emphasis||"*"}function vmt(e,n){let t=!1;return U4(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,f2}),!!((!e.depth||e.depth<3)&&X4(e)&&(n.options.setext||t))}function xmt(e,n,t,r){const s=Math.max(Math.min(6,e.depth||1),1),i=t.createTracker(r);if(vmt(e,t)){const _=t.enter("headingSetext"),f=t.enter("phrasing"),p=t.containerPhrasing(e,{...i.current(),before:` +`,after:` +`});return f(),_(),p+` +`+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(` +`))+1))}const a="#".repeat(s),o=t.enter("headingAtx"),c=t.enter("phrasing");i.move(a+" ");let u=t.containerPhrasing(e,{before:"# ",after:` +`,...i.current()});return/^[\t ]/.test(u)&&(u=w_(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,t.options.closeAtx&&(u+=" "+a),c(),o(),u}ZL.peek=ymt;function ZL(e){return e.value||""}function ymt(){return"<"}QL.peek=wmt;function QL(e,n,t,r){const s=g5(t),i=s==='"'?"Quote":"Apostrophe",a=t.enter("image");let o=t.enter("label");const c=t.createTracker(r);let u=c.move("![");return u+=c.move(t.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=t.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(t.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=t.enter("destinationRaw"),u+=c.move(t.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=t.enter(`title${i}`),u+=c.move(" "+s),u+=c.move(t.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),o()),u+=c.move(")"),a(),u}function wmt(){return"!"}JL.peek=Smt;function JL(e,n,t,r){const s=e.referenceType,i=t.enter("imageReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("![");const u=t.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const f=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==f?c+=o.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Smt(){return"!"}eD.peek=kmt;function eD(e,n,t){let r=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i\u007F]/.test(e.url))}nD.peek=Cmt;function nD(e,n,t,r){const s=g5(t),i=s==='"'?"Quote":"Apostrophe",a=t.createTracker(r);let o,c;if(tD(e,t)){const _=t.stack;t.stack=[],o=t.enter("autolink");let f=a.move("<");return f+=a.move(t.containerPhrasing(e,{before:f,after:">",...a.current()})),f+=a.move(">"),o(),t.stack=_,f}o=t.enter("link"),c=t.enter("label");let u=a.move("[");return u+=a.move(t.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=t.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(t.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=t.enter("destinationRaw"),u+=a.move(t.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=t.enter(`title${i}`),u+=a.move(" "+s),u+=a.move(t.safe(e.title,{before:u,after:s,...a.current()})),u+=a.move(s),c()),u+=a.move(")"),o(),u}function Cmt(e,n,t){return tD(e,t)?"<":"["}rD.peek=Emt;function rD(e,n,t,r){const s=e.referenceType,i=t.enter("linkReference");let a=t.enter("label");const o=t.createTracker(r);let c=o.move("[");const u=t.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const _=t.stack;t.stack=[],a=t.enter("reference");const f=t.safe(t.associationId(e),{before:c,after:"]",...o.current()});return a(),t.stack=_,i(),s==="full"||!u||u!==f?c+=o.move(f+"]"):s==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Emt(){return"["}function b5(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function Nmt(e){const n=b5(e),t=e.options.bulletOther;if(!t)return n==="*"?"-":"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(t===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+t+"`) to be different");return t}function zmt(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function sD(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function jmt(e,n,t,r){const s=t.enter("list"),i=t.bulletCurrent;let a=e.ordered?zmt(t):b5(t);const o=e.ordered?a==="."?")":".":Nmt(t);let c=n&&t.bulletLastUsed?a===t.bulletLastUsed:!1;if(!e.ordered){const _=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&_&&(!_.children||!_.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(c=!0),sD(t)===a&&_){let f=-1;for(;++f-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=t.createTracker(r);o.move(i+" ".repeat(a-i.length)),o.shift(a);const c=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,o.current()),_);return c(),u;function _(f,p,m){return p?(m?"":" ".repeat(a))+f:(m?i:i+" ".repeat(a-i.length))+f}}function Rmt(e,n,t,r){const s=t.enter("paragraph"),i=t.enter("phrasing"),a=t.containerPhrasing(e,r);return i(),s(),a}const Mmt=e0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Lmt(e,n,t,r){return(e.children.some(function(a){return Mmt(a)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Dmt(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}iD.peek=Omt;function iD(e,n,t,r){const s=Dmt(t),i=t.enter("strong"),a=t.createTracker(r),o=a.move(s+s);let c=a.move(t.containerPhrasing(e,{after:s,before:o,...a.current()}));const u=c.charCodeAt(0),_=fg(r.before.charCodeAt(r.before.length-1),u,s);_.inside&&(c=w_(u)+c.slice(1));const f=c.charCodeAt(c.length-1),p=fg(r.after.charCodeAt(0),f,s);p.inside&&(c=c.slice(0,-1)+w_(f));const m=a.move(s+s);return i(),t.attentionEncodeSurroundingInfo={after:p.outside,before:_.outside},o+c+m}function Omt(e,n,t){return t.options.strong||"*"}function Imt(e,n,t,r){return t.safe(e.value,r)}function Bmt(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function $mt(e,n,t){const r=(sD(t)+(t.options.ruleSpaces?" ":"")).repeat(Bmt(t));return t.options.ruleSpaces?r.slice(0,-1):r}const aD={blockquote:cmt,break:qE,code:_mt,definition:mmt,emphasis:XL,hardBreak:qE,heading:xmt,html:ZL,image:QL,imageReference:JL,inlineCode:eD,link:nD,linkReference:rD,list:jmt,listItem:Amt,paragraph:Rmt,root:Lmt,strong:iD,text:Imt,thematicBreak:$mt};function Pmt(){return{enter:{table:Hmt,tableData:GE,tableHeader:GE,tableRow:Umt},exit:{codeText:qmt,table:Fmt,tableData:Qx,tableHeader:Qx,tableRow:Qx}}}function Hmt(e){const n=e._align;this.enter({type:"table",align:n.map(function(t){return t==="none"?null:t}),children:[]},e),this.data.inTable=!0}function Fmt(e){this.exit(e),this.data.inTable=void 0}function Umt(e){this.enter({type:"tableRow",children:[]},e)}function Qx(e){this.exit(e)}function GE(e){this.enter({type:"tableCell",children:[]},e)}function qmt(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Gmt));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function Gmt(e,n){return n==="|"?n:e}function Vmt(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,s=n.stringLength,i=t?" ":"|";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:p,table:a,tableCell:c,tableRow:o}};function a(m,x,S,b){return u(_(m,S,b),m.align)}function o(m,x,S,b){const v=f(m,S,b),y=u([v]);return y.slice(0,y.indexOf(` +`))}function c(m,x,S,b){const v=S.enter("tableCell"),y=S.enter("phrasing"),w=S.containerPhrasing(m,{...b,before:i,after:i});return y(),v(),w}function u(m,x){return omt(m,{align:x,alignDelimiters:r,padding:t,stringLength:s})}function _(m,x,S){const b=m.children;let v=-1;const y=[],w=x.enter("table");for(;++v0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const ugt={tokenize:bgt,partial:!0};function fgt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:pgt,continuation:{tokenize:mgt},exit:ggt}},text:{91:{name:"gfmFootnoteCall",tokenize:_gt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:dgt,resolveTo:hgt}}}}function dgt(e,n,t){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return t(c);const u=xa(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?t(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),n(c))}}function hgt(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},o=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",s,n],["exit",s,n],["enter",i,n],["enter",a,n],["exit",a,n],["exit",i,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...o),e}function _gt(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),c}function c(f){return f!==94?t(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(i>999||f===93&&!a||f===null||f===91||Un(f))return t(f);if(f===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return s.includes(xa(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(f)}return Un(f)||(a=!0),i++,e.consume(f),f===92?_:u}function _(f){return f===91||f===92||f===93?(e.consume(f),i++,u):u(f)}}function pgt(e,n,t){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,o;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",_):t(x)}function _(x){if(a>999||x===93&&!o||x===null||x===91||Un(x))return t(x);if(x===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return i=xa(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Un(x)||(o=!0),a++,e.consume(x),x===92?f:_}function f(x){return x===91||x===92||x===93?(e.consume(x),a++,_):_(x)}function p(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),un(e,m,"gfmFootnoteDefinitionWhitespace")):t(x)}function m(x){return n(x)}}function mgt(e,n,t){return e.check(r0,n,e.attempt(ugt,n,t))}function ggt(e){e.exit("gfmFootnoteDefinition")}function bgt(e,n,t){const r=this;return un(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?n(i):t(i)}}function vgt(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,o){let c=-1;for(;++c1?c(x):(a.consume(x),f++,m);if(f<2&&!t)return c(x);const b=a.exit("strikethroughSequenceTemporary"),v=ad(x);return b._open=!v||v===2&&!!S,b._close=!S||S===2&&!!v,o(x)}}}class xgt{constructor(){this.map=[]}add(n,t,r){ygt(this,n,t,r)}consume(n){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let s=r.pop();for(;s;){for(const i of s)n.push(i);s=r.pop()}this.map.length=0}}function ygt(e,n,t,r){let s=0;if(!(t===0&&r.length===0)){for(;s-1;){const F=r.events[I][1].type;if(F==="lineEnding"||F==="linePrefix")I--;else break}const H=I>-1?r.events[I][1].type:null,U=H==="tableHead"||H==="tableRow"?E:c;return U===E&&r.parser.lazy[r.now().line]?t(O):U(O)}function c(O){return e.enter("tableHead"),e.enter("tableRow"),u(O)}function u(O){return O===124||(a=!0,i+=1),_(O)}function _(O){return O===null?t(O):yt(O)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),m):t(O):hn(O)?un(e,_,"whitespace")(O):(i+=1,a&&(a=!1,s+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),a=!0,_):(e.enter("data"),f(O)))}function f(O){return O===null||O===124||Un(O)?(e.exit("data"),_(O)):(e.consume(O),O===92?p:f)}function p(O){return O===92||O===124?(e.consume(O),f):f(O)}function m(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(O):(e.enter("tableDelimiterRow"),a=!1,hn(O)?un(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):x(O))}function x(O){return O===45||O===58?b(O):O===124?(a=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),S):z(O)}function S(O){return hn(O)?un(e,b,"whitespace")(O):b(O)}function b(O){return O===58?(i+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),v):O===45?(i+=1,v(O)):O===null||yt(O)?C(O):z(O)}function v(O){return O===45?(e.enter("tableDelimiterFiller"),y(O)):z(O)}function y(O){return O===45?(e.consume(O),y):O===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(O))}function w(O){return hn(O)?un(e,C,"whitespace")(O):C(O)}function C(O){return O===124?x(O):O===null||yt(O)?!a||s!==i?z(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(O)):z(O)}function z(O){return t(O)}function E(O){return e.enter("tableRow"),R(O)}function R(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),R):O===null||yt(O)?(e.exit("tableRow"),n(O)):hn(O)?un(e,R,"whitespace")(O):(e.enter("data"),N(O))}function N(O){return O===null||O===124||Un(O)?(e.exit("data"),R(O)):(e.consume(O),O===92?M:N)}function M(O){return O===92||O===124?(e.consume(O),N):N(O)}}function Cgt(e,n){let t=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,_,f;const p=new xgt;for(;++tt[2]+1){const x=t[2]+1,S=t[3]-t[2]-1;e.add(x,S,[])}}e.add(t[3]+1,0,[["exit",f,n]])}return s!==void 0&&(i.end=Object.assign({},Tf(n.events,s)),e.add(s,0,[["exit",i,n]]),i=void 0),i}function WE(e,n,t,r,s){const i=[],a=Tf(n.events,t);s&&(s.end=Object.assign({},a),i.push(["exit",s,n])),r.end=Object.assign({},a),i.push(["exit",r,n]),e.add(t+1,0,i)}function Tf(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Egt={name:"tasklistCheck",tokenize:zgt};function Ngt(){return{text:{91:Egt}}}function zgt(e,n,t){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return Un(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):t(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):t(c)}function o(c){return yt(c)?n(c):hn(c)?e.check({tokenize:jgt},n,t)(c):t(c)}}function jgt(e,n,t){return un(e,r,"whitespace");function r(s){return s===null?t(s):n(s)}}function Tgt(e){return xM([tgt(),fgt(),vgt(e),Sgt(),Ngt()])}const Agt={};function pD(e){const n=this,t=e||Agt,r=n.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Tgt(t)),i.push(Zmt()),a.push(Qmt(t))}function Rgt(){return{enter:{mathFlow:e,mathFlowFenceMeta:n,mathText:i},exit:{mathFlow:s,mathFlowFence:r,mathFlowFenceMeta:t,mathFlowValue:o,mathText:a,mathTextData:o}};function e(c){const u={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[u]}},c)}function n(){this.buffer()}function t(){const c=this.resume(),u=this.stack[this.stack.length-1];u.type,u.meta=c}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const u=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=u;const f=_.data.hChildren[0];f.type,f.tagName,f.children.push({type:"text",value:u}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function a(c){const u=this.resume(),_=this.stack[this.stack.length-1];_.type,this.exit(c),_.value=u,_.data.hChildren.push({type:"text",value:u})}function o(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function Mgt(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),r.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` +`,inConstruct:"mathFlowMeta"},{character:"$",after:n?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:t,inlineMath:r}};function t(i,a,o,c){const u=i.value||"",_=o.createTracker(c),f="$".repeat(Math.max(YL(u,"$")+1,2)),p=o.enter("mathFlow");let m=_.move(f);if(i.meta){const x=o.enter("mathFlowMeta");m+=_.move(o.safe(i.meta,{after:` +`,before:m,encode:["$"],..._.current()})),x()}return m+=_.move(` +`),u&&(m+=_.move(u+` +`)),m+=_.move(f),p(),m}function r(i,a,o){let c=i.value||"",u=1;for(n||u++;new RegExp("(^|[^$])"+"\\$".repeat(u)+"([^$]|$)").test(c);)u++;const _="$".repeat(u);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let f=-1;for(;++f]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}a0.displayName="c";a0.aliases=[];function a0(e){e.register(po),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}h1.displayName="cpp";h1.aliases=[];function h1(e){e.register(a0),(function(n){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return t.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(e)}y5.displayName="arduino";y5.aliases=["ino"];function y5(e){e.register(h1),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}w5.displayName="bash";w5.aliases=["sh","shell"];function w5(e){(function(n){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};n.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=n.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=s.variable[1].inside,o=0;o>/g,function(X,W){return"(?:"+P[+W]+")"})}function r(D,P,X){return RegExp(t(D,P),"")}function s(D,P){for(var X=0;X>/g,function(){return"(?:"+D+")"});return D.replace(/<>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function a(D){return"\\b(?:"+D.trim().replace(/ /g,"|")+")\\b"}var o=a(i.typeDeclaration),c=RegExp(a(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),u=a(i.typeDeclaration+" "+i.contextual+" "+i.other),_=a(i.type+" "+i.typeDeclaration+" "+i.other),f=s(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),p=s(/\((?:[^()]|<>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,x=t(/<<0>>(?:\s*<<1>>)?/.source,[m,f]),S=t(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[u,x]),b=/\[\s*(?:,\s*)*\]/.source,v=t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,b]),y=t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[f,p,b]),w=t(/\(<<0>>+(?:,<<0>>+)+\)/.source,[y]),C=t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[w,S,b]),z={keyword:c,punctuation:/[<>()?,.:[\]]/},E=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,R=/"(?:\\.|[^\\"\r\n])*"/.source,N=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;n.languages.csharp=n.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[N]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[R]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:z},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,C]),lookbehind:!0,inside:z},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,x]),lookbehind:!0,inside:z},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:z},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[v]),lookbehind:!0,inside:z},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[C,_,m]),inside:z}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),n.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),n.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),n.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[p]),lookbehind:!0,alias:"class-name",inside:z},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[C,S]),inside:z,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[C]),lookbehind:!0,inside:z,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,f]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(f),alias:"class-name",inside:z}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,x,m,C,c.source,p,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[x,p]),lookbehind:!0,greedy:!0,inside:n.languages.csharp},keyword:c,"class-name":{pattern:RegExp(C),greedy:!0,inside:z},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var M=R+"|"+E,O=t(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[M]),I=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),H=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,U=t(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,I]);n.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[H,U]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[H]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[I]),inside:n.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var F=/:[^}\r\n]+/.source,Y=s(t(/[^"'/()]|<<0>>|\(<>*\)/.source,[O]),2),q=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,F]),Q=s(t(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[M]),2),Z=t(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Q,F]);function B(D,P){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[D]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[P,F]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:n.languages.csharp}}},string:/[\s\S]+/}}n.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[q]),lookbehind:!0,greedy:!0,inside:B(q,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[Z]),lookbehind:!0,greedy:!0,inside:B(Z,Q)}],char:{pattern:RegExp(E),greedy:!0}}),n.languages.dotnet=n.languages.cs=n.languages.csharp})(e)}o0.displayName="markup";o0.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function o0(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(t,r){var s={};s["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var a={};a[t]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(n,t){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Ad.displayName="css";Ad.aliases=[];function Ad(e){(function(n){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var r=n.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}k5.displayName="diff";k5.aliases=[];function k5(e){(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach(function(r){var s=t[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),n.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r +?| +|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:t})})(e)}C5.displayName="go";C5.aliases=[];function C5(e){e.register(po),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}E5.displayName="ini";E5.aliases=[];function E5(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}N5.displayName="java";N5.aliases=[];function N5(e){e.register(po),(function(n){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:t,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}z5.displayName="regex";z5.aliases=[];function z5(e){(function(n){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},a="(?:[^\\\\-]|"+r.source+")",o=RegExp(a+"-"+a),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};n.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":i,escape:r}},"special-escape":t,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}j5.displayName="json";j5.aliases=["webmanifest"];function j5(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}T5.displayName="kotlin";T5.aliases=["kt","kts"];function T5(e){e.register(po),(function(n){n.languages.kotlin=n.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete n.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:n.languages.kotlin}};n.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete n.languages.kotlin.string,n.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),n.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),n.languages.kt=n.languages.kotlin,n.languages.kts=n.languages.kotlin})(e)}A5.displayName="less";A5.aliases=[];function A5(e){e.register(Ad),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}R5.displayName="lua";R5.aliases=[];function R5(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}M5.displayName="makefile";M5.aliases=[];function M5(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}L5.displayName="yaml";L5.aliases=["yml"];function L5(e){(function(n){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,u){u=(u||"").replace(/m/g,"")+"m";var _=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return c});return RegExp(_,u)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return s}).replace(/<>/g,function(){return"(?:"+i+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(e)}D5.displayName="markdown";D5.aliases=["md"];function D5(e){e.register(o0),(function(n){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+a+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+a+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(n.languages.markdown[o].inside.content.inside[c]=n.languages.markdown[c])})}),n.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(u){if(!(!u||typeof u=="string"))for(var _=0,f=u.length;_]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}I5.displayName="perl";I5.aliases=[];function I5(e){(function(n){var t=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;n.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,t].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,t+/\s*/.source+t].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}p1.displayName="markup-templating";p1.aliases=[];function p1(e){e.register(o0),(function(n){function t(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(n.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,a){if(r.language===s){var o=r.tokenStack=[];r.code=r.code.replace(i,function(c){if(typeof a=="function"&&!a(c))return c;for(var u=o.length,_;r.code.indexOf(_=t(s,u))!==-1;)++u;return o[u]=c,_}),r.grammar=n.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=n.languages[s];var i=0,a=Object.keys(r.tokenStack);function o(c){for(var u=0;u=a.length);u++){var _=c[u];if(typeof _=="string"||_.content&&typeof _.content=="string"){var f=a[i],p=r.tokenStack[f],m=typeof _=="string"?_:_.content,x=t(s,f),S=m.indexOf(x);if(S>-1){++i;var b=m.substring(0,S),v=new n.Token(s,n.tokenize(p,r.grammar),"language-"+s,p),y=m.substring(S+x.length),w=[];b&&w.push.apply(w,o([b])),w.push(v),y&&w.push.apply(w,o([y])),typeof _=="string"?c.splice.apply(c,[u,1].concat(w)):_.content=w}}else _.content&&o(_.content)}return c}o(r.tokens)}}})})(e)}B5.displayName="php";B5.aliases=[];function B5(e){e.register(p1),(function(n){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,a=/[{}\[\](),:;]/;n.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:a};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:n.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];n.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:a}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),n.hooks.add("before-tokenize",function(u){if(/<\?/.test(u.code)){var _=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;n.languages["markup-templating"].buildPlaceholders(u,"php",_)}}),n.hooks.add("after-tokenize",function(u){n.languages["markup-templating"].tokenizePlaceholders(u,"php")})})(e)}$5.displayName="python";$5.aliases=["py"];function $5(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}P5.displayName="r";P5.aliases=[];function P5(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}H5.displayName="ruby";H5.aliases=["rb"];function H5(e){e.register(po),(function(n){n.languages.ruby=n.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),n.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:n.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete n.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;n.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),n.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete n.languages.ruby.string,n.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),n.languages.rb=n.languages.ruby})(e)}F5.displayName="rust";F5.aliases=[];function F5(e){(function(n){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)t=t.replace(//g,function(){return t});t=t.replace(//g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(e)}U5.displayName="sass";U5.aliases=[];function U5(e){e.register(Ad),(function(n){n.languages.sass=n.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),n.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete n.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];n.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:r,important:n.languages.sass.important}}}),delete n.languages.sass.property,delete n.languages.sass.important,n.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}q5.displayName="scss";q5.aliases=[];function q5(e){e.register(Ad),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}G5.displayName="sql";G5.aliases=[];function G5(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}V5.displayName="swift";V5.aliases=[];function V5(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=e.languages.swift})}W5.displayName="typescript";W5.aliases=["ts"];function W5(e){e.register(_1),(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var t=n.languages.extend("typescript",{});delete t["class-name"],n.languages.typescript["class-name"].inside=t,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),n.languages.ts=n.languages.typescript})(e)}m1.displayName="basic";m1.aliases=[];function m1(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}K5.displayName="vbnet";K5.aliases=[];function K5(e){e.register(m1),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const qgt=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],YE={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function gD(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=48&&n<=57}function Ggt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=102||n>=65&&n<=70||n>=48&&n<=57}function Vgt(e){const n=typeof e=="string"?e.charCodeAt(0):e;return n>=97&&n<=122||n>=65&&n<=90}function XE(e){return Vgt(e)||gD(e)}const Wgt=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Kgt(e,n){const t={},r=typeof t.additional=="string"?t.additional.charCodeAt(0):t.additional,s=[];let i=0,a=-1,o="",c,u;t.position&&("start"in t.position||"indent"in t.position?(u=t.position.indent,c=t.position.start):c=t.position);let _=(c?c.line:0)||1,f=(c?c.column:0)||1,p=x(),m;for(i--;++i<=e.length;)if(m===10&&(f=(u?u[a]:0)||1),m=e.charCodeAt(i),m===38){const v=e.charCodeAt(i+1);if(v===9||v===10||v===12||v===32||v===38||v===60||Number.isNaN(v)||r&&v===r){o+=String.fromCharCode(m),f++;continue}const y=i+1;let w=y,C=y,z;if(v===35){C=++w;const U=e.charCodeAt(C);U===88||U===120?(z="hexadecimal",C=++w):z="decimal"}else z="named";let E="",R="",N="";const M=z==="named"?XE:z==="decimal"?gD:Ggt;for(C--;++C<=e.length;){const U=e.charCodeAt(C);if(!M(U))break;N+=String.fromCharCode(U),z==="named"&&qgt.includes(N)&&(E=N,R=v_(N))}let O=e.charCodeAt(C)===59;if(O){C++;const U=z==="named"?v_(N):!1;U&&(E=N,R=U)}let I=1+C-y,H="";if(!(!O&&t.nonTerminated===!1))if(!N)z!=="named"&&S(4,I);else if(z==="named"){if(O&&!R)S(5,1);else if(E!==N&&(C=w+E.length,I=1+C-w,O=!1),!O){const U=E?1:3;if(t.attribute){const F=e.charCodeAt(C);F===61?(S(U,I),R=""):XE(F)?R="":S(U,I)}else S(U,I)}H=R}else{O||S(2,I);let U=Number.parseInt(N,z==="hexadecimal"?16:10);if(Ygt(U))S(7,I),H="�";else if(U in YE)S(6,I),H=YE[U];else{let F="";Xgt(U)&&S(6,I),U>65535&&(U-=65536,F+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),H=F+String.fromCharCode(U)}}if(H){b(),p=x(),i=C-1,f+=C-y+1,s.push(H);const U=x();U.offset++,t.reference&&t.reference.call(t.referenceContext||void 0,H,{start:p,end:U},e.slice(y-1,C)),p=U}else N=e.slice(y-1,C),o+=N,f+=N.length,i=C-1}else m===10&&(_++,a++,f=0),Number.isNaN(m)?b():(o+=String.fromCharCode(m),f++);return s.join("");function x(){return{line:_,column:f,offset:i+((c?c.offset:0)||0)}}function S(v,y){let w;t.warning&&(w=x(),w.column+=y,w.offset+=y,t.warning.call(t.warningContext||void 0,Wgt[v],w,v))}function b(){o&&(s.push(o),t.text&&t.text.call(t.textContext||void 0,o,{start:p,end:x()}),o="")}}function Ygt(e){return e>=55296&&e<=57343||e>1114111}function Xgt(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Zgt=0,qp={},os={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Zgt}),e.__id},clone:function e(n,t){t=t||{};var r,s;switch(os.util.type(n)){case"Object":if(s=os.util.objId(n),t[s])return t[s];r={},t[s]=r;for(var i in n)n.hasOwnProperty(i)&&(r[i]=e(n[i],t));return r;case"Array":return s=os.util.objId(n),t[s]?t[s]:(r=[],t[s]=r,n.forEach(function(a,o){r[o]=e(a,t)}),r);default:return n}}},languages:{plain:qp,plaintext:qp,text:qp,txt:qp,extend:function(e,n){var t=os.util.clone(os.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){r=r||os.languages;var s=r[e],i={};for(var a in s)if(s.hasOwnProperty(a)){if(a==n)for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);t.hasOwnProperty(a)||(i[a]=s[a])}var c=r[e];return r[e]=i,os.languages.DFS(os.languages,function(u,_){_===c&&u!=e&&(this[u]=i)}),i},DFS:function e(n,t,r,s){s=s||{};var i=os.util.objId;for(var a in n)if(n.hasOwnProperty(a)){t.call(n,a,n[a],r||a);var o=n[a],c=os.util.type(o);c==="Object"&&!s[i(o)]?(s[i(o)]=!0,e(o,t,null,s)):c==="Array"&&!s[i(o)]&&(s[i(o)]=!0,e(o,t,a,s))}}},plugins:{},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(os.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=os.tokenize(r.code,r.grammar),os.hooks.run("after-tokenize",r),Zh.stringify(os.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var s=new Qgt;return km(s,s.head,e),bD(e,s,n,s.head,0),e1t(s)},hooks:{all:{},add:function(e,n){var t=os.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=os.hooks.all[e];if(!(!t||!t.length))for(var r=0,s;s=t[r++];)s(n)}},Token:Zh};function Zh(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=(r||"").length|0}function ZE(e,n,t,r){e.lastIndex=n;var s=e.exec(t);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function bD(e,n,t,r,s,i){for(var a in t)if(!(!t.hasOwnProperty(a)||!t[a])){var o=t[a];o=Array.isArray(o)?o:[o];for(var c=0;c=i.reach);v+=b.value.length,b=b.next){var y=b.value;if(n.length>e.length)return;if(!(y instanceof Zh)){var w=1,C;if(p){if(C=ZE(S,v,e,f),!C||C.index>=e.length)break;var N=C.index,z=C.index+C[0].length,E=v;for(E+=b.value.length;N>=E;)b=b.next,E+=b.value.length;if(E-=b.value.length,v=E,b.value instanceof Zh)continue;for(var R=b;R!==n.tail&&(Ei.reach&&(i.reach=H);var U=b.prev;O&&(U=km(n,U,O),v+=O.length),Jgt(n,U,w);var F=new Zh(a,_?os.tokenize(M,_):M,m,M);if(b=km(n,U,F),I&&km(n,b,I),w>1){var Y={cause:a+","+c,reach:H};bD(e,n,t,b.prev,v,Y),i&&Y.reach>i.reach&&(i.reach=Y.reach)}}}}}}function Qgt(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function km(e,n,t){var r=n.next,s={value:t,prev:n,next:r};return n.next=s,r.prev=s,e.length++,s}function Jgt(e,n,t){for(var r=n.next,s=0;st)return null;try{return kt.highlight(e,n).children}catch{return null}}function wD(e,n){var t;return e.type==="text"?e.value??"":e.type!=="element"?null:h.jsx("span",{className:(((t=e.properties)==null?void 0:t.className)??[]).join(" "),children:(e.children??[]).map(wD)},n)}function l1t(e,n,t=3e5){var r;return((r=yD(e,n,t))==null?void 0:r.map(wD))??e}function SD(e,n,t=3e5){const r=yD(e,n,t);if(!r)return e.split(` +`);const s=[];let i=[];const a=[];let o=0;const c=_=>{let f=_;for(let p=a.length-1;p>=0;p--)f=h.jsx("span",{className:a[p],children:f},o++);i.push(f)},u=_=>{var f;if(_.type==="text"){(_.value??"").split(` +`).forEach((p,m)=>{m>0&&(s.push(i),i=[]),p&&c(p)});return}_.type==="element"&&(a.push((((f=_.properties)==null?void 0:f.className)??[]).join(" ")),(_.children??[]).forEach(u),a.pop())};return r.forEach(u),s.push(i),s}function kD(e){return Array.isArray(e)?e.length===0:e===""}const QE=/^\d+(?:,\d{3})*(?:\.\d+)?(?:\s*[–—-]\s*\$?\d+(?:,\d{3})*(?:\.\d+)?)?(?:\/[A-Za-z][A-Za-z0-9-]*)?/;function ud(e,n,t){let r=n;for(;e[r]===t;)r+=1;return r-n}function S_(e,n){let t=0;for(let r=n-1;r>=0&&e[r]==="\\";r-=1)t+=1;return t%2===1}function G2(e){var a;let n=!1,t=0,r=0,s=0;for(;r[ \t]?/.exec(e.slice(r));if(o){r+=o[0].length,s+=1;continue}const c=/^ {0,3}(?:[-+*]|\d+[.)])[ \t]+/.exec(e.slice(r));if(!c)break;r+=c[0].length,t+=c[0].length,n=!0}const i=((a=/^[ \t]*/.exec(e.slice(r)))==null?void 0:a[0].length)??0;return{hasListMarker:n,indentation:i,listIndent:t,offset:r+i,quoteDepth:s}}function c1t(e,n){const t=e[n];if(t!=="`"&&t!=="~"||S_(e,n)||ud(e,n,t)<3)return!1;const r=e.lastIndexOf(` +`,n-1)+1,s=e.indexOf(` +`,n),i=e.slice(r,s===-1?e.length:s),a=G2(i);return a.indentation<=3&&r+a.offset===n}function u1t(e,n){const t=e[n],r=ud(e,n,t),s=e.lastIndexOf(` +`,n-1)+1,i=e.indexOf(` +`,n),a=G2(e.slice(s,i===-1?e.length:i));let o=e.indexOf(` +`,n+r);if(o===-1)return e.length;for(o+=1;o=a.listIndent&&f.indentation<=a.listIndent+3&&m>=r&&/^[ \t\r]*$/.test(e.slice(p+m,u)))return c===-1?e.length:c+1;if(c===-1)return e.length;o=c+1}return e.length}function f1t(e,n,t){const r=ud(e,n,"`");let s=n+r;for(;s")return s+1}return t?e.length:null}function h1t(e){const n=[];for(let t=0;t|()[\]-]+$/.test(t)?/^[eE][+-]?\d+$/.test(t)||/[+*/=^_{}\\<>|()]/.test(t)?!0:/^[A-Za-z][A-Za-z0-9]*$/.test(t):!1:!0}function p1t(e,{predictMath:n=!1}={}){const t=h1t(e),r=new Set,s=new Set;for(let u=0;u`$$${s}$$`).replace(/\\\(([\s\S]+?)\\\)/g,(r,s)=>`$$${s}$$`);return n.predictMath&&(t=t.replace(/\\\[([\s\S]*)$/,(r,s)=>`$$${s}`).replace(/\\\(([\s\S]*)$/,(r,s)=>`$$${s}`)),p1t(t,n)}function CD(e,n={}){let t="",r=0,s=0;for(;ss!==n);return{order:e.order.filter(s=>s!==n),previewKey:e.previewKey===n?null:e.previewKey,fallbackKey:r[r.length-1]??null}}function b1t(e){return e==="Enter"?"keepOpen":e===" "?"preview":null}function Nr(e,n={}){const t=r=>{n.stopPropagation&&r.stopPropagation()};return{onClick:r=>{t(r),e("preview")},onDoubleClick:r=>{t(r),e("keepOpen")},onAuxClick:r=>{r.button===1&&(r.preventDefault(),t(r),e("keepOpen"))},onKeyDown:r=>{const s=b1t(r.key);s&&(r.preventDefault(),t(r),e(s))}}}const v1t=1e5;function x1t({code:e,lang:n}){const[t,r]=T.useState(!1),s=()=>{var i;(i=navigator.clipboard)==null||i.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return h.jsxs("div",{className:"md-code relative my-2.5 mx-0 [&_pre]:m-0 [&:hover_.md-code-copy]:opacity-100",children:[h.jsx(Yt,{size:"small",className:"md-code-copy absolute top-1.5 end-1.5 bg-background opacity-0",title:NT(),"aria-label":lxe(),onClick:s,children:t?h.jsx(zi,{size:13}):h.jsx(qg,{size:13})}),h.jsx("pre",{children:h.jsx("code",{children:l1t(e,n,v1t)})})]})}function y1t(e){const n={};for(const t of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=t[1];r&&(n[r.toLowerCase()]=t[3]??"")}return n}function eN(e,n,t){let r=n.line,s=n.column;for(let i=0;i]*?)\/?>/gi,r=[];let s=0,i=!1;for(const a of n.matchAll(t)){const o=(a[1]??"").toLowerCase(),c=y1t(a[2]??"");if(!c[o==="run"?"id":"path"])continue;i=!0,a.index>s&&r.push({type:"text",value:n.slice(s,a.index),position:Jx(e,s,a.index)});const _=a.index+a[0].length;r.push({children:[],data:{hName:o==="run"?"run-mention":"file-mention",hProperties:c},position:Jx(e,a.index,_),type:o==="run"?"runMention":"fileMention"}),s=_}return i?(sED(e)}function S1t(){return e=>{const n=t=>{var r;for(const s of["href","src"])t.properties&&Object.hasOwn(t.properties,s)&&(t.properties[s]=BM(String(t.properties[s]||"")));(r=t.children)==null||r.forEach(n)};n(e)}}function nN({path:e,lines:n,exp:t,onOpenFile:r}){const s=e.split("/").pop()||e,i=n&&Number.parseInt(n,10)||void 0,a=i!=null?`${s}:${i}`:s;return h.jsxs("button",{className:"file-chip",title:r?oq({path:ze(e)}):e,...Nr(o=>r==null?void 0:r(e,i,t,void 0,o)),disabled:!r,children:[h.jsx(NR,{size:12}),h.jsx("span",{className:"file-chip-label",children:a}),h.jsx(AR,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}function k1t({id:e,label:n,onOpenRun:t}){return h.jsxs("button",{className:"file-chip run-chip",title:t?wq({id:ze(e)}):Xq({id:ze(e)}),...Nr(r=>t==null?void 0:t(e,r)),disabled:!t,children:[h.jsx(j4,{size:12}),h.jsx("span",{className:"file-chip-label",children:n||dA()}),h.jsx(AR,{className:"file-chip-open",size:12,"aria-hidden":"true"})]})}const ND={singleDollarTextMath:!0},C1t=G4().use(Q4).use(pD).use(mD,ND).use(w1t).use(sg).use(S1t).use(qL);function E1t(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const zD={code:({node:e,className:n,children:t,...r})=>{const s=n??"",i=/language-(\w+)/.exec(s),a=String(t??"").replace(/\n$/,"");if(!(i!=null||a.includes(` +`)))return h.jsx("code",{className:s,...r,children:t});const c=i?U2(i[1]):null;return h.jsx(x1t,{code:a,lang:c})},pre:({children:e})=>h.jsx(h.Fragment,{children:e})},ro=T.memo(function({text:n,onOpenFile:t,onOpenRun:r,resolveFilePath:s,resolveImageSrc:i,predict:a=!1}){Du();const o=T.useMemo(()=>({"file-mention":c=>h.jsx(nN,{path:c.path,lines:c.lines,exp:c.exp,onOpenFile:t}),"run-mention":c=>h.jsx(k1t,{id:c.id,label:c.label,onOpenRun:r}),a:({node:c,href:u,children:_,...f})=>{if(u&&E1t(u)&&t){let p;try{p=decodeURI(u)}catch{return h.jsx("span",{children:_})}const m=s?s(p):p;return m?h.jsx(nN,{path:m,onOpenFile:t}):h.jsx("span",{children:_})}return h.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...f,children:_})},th:({node:c,...u})=>h.jsx("th",{dir:"auto",...u}),td:({node:c,...u})=>h.jsx("td",{dir:"auto",...u}),img:({node:c,src:u,alt:_,className:f,...p})=>{if(!u||typeof u!="string")return null;const m=i?i(u):u;return m?h.jsx("img",{...p,src:m,alt:_??"",loading:"lazy",className:`block max-w-full h-auto my-3 rounded-sm border border-border ${f??""}`}):null},...zD}),[t,r,s,i]);return h.jsx("div",{dir:"auto","data-streaming":a||void 0,className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:text-prose-emphasis [&_h1]:font-semibold [&_h1]:mt-3 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h2]:text-text [&_h2]:text-prose-emphasis [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mx-0 [&_h2]:mb-1.5 [&_h3]:text-text [&_h3]:text-prose-emphasis [&_h3]:font-semibold [&_h3]:mt-3 [&_h3]:mx-0 [&_h3]:mb-1.5 [&_h4]:text-text [&_h4]:text-prose-emphasis [&_h4]:font-semibold [&_h4]:mt-3 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_table]:overflow-x-auto [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text",children:h.jsx(Hht,{content:CD(n,{predictMath:a}),processor:C1t,components:o,predict:a})})}),rN="prompt-actions plan-strip-actions flex flex-wrap justify-end gap-x-2 gap-y-1.5";function N1t({synthesized:e,agentLabel:n,onView:t,onApprove:r,showResumeModes:s,onReject:i,onRevise:a}){const[o,c]=T.useState(!1),u=T.useRef(null),[_,f]=T.useState(!1),[p,m]=T.useState(""),x=T.useRef(null);T.useEffect(()=>{if(!o)return;const b=v=>{u.current&&!u.current.contains(v.target)&&c(!1)};return window.addEventListener("pointerdown",b),()=>window.removeEventListener("pointerdown",b)},[o]),T.useEffect(()=>{var b;_&&((b=x.current)==null||b.focus())},[_]);const S=()=>{a(p.trim()||"no specific feedback — use your judgment"),m(""),f(!1)};return h.jsxs("div",{className:"plan-strip relative w-full mt-0 mx-0 mb-2.5 py-[11px] px-[13px] flex flex-col items-stretch gap-2.5 border border-border border-s-[3px] border-s-accent-blue rounded-md bg-surface shadow-plan",children:[h.jsxs("div",{className:"plan-strip-info flex items-baseline gap-2 min-w-0",children:[h.jsx(j4,{size:14,className:"plan-strip-icon text-accent-blue shrink-0 self-center"}),h.jsx("span",{dir:"auto",className:"plan-strip-title text-sm font-semibold whitespace-nowrap",children:e?f8e({agent:ze(n)}):o8e({agent:ze(n)})}),h.jsx("button",{className:"plan-strip-open ms-auto p-0 border-0 bg-none bg-transparent text-accent-blue text-sm cursor-pointer whitespace-nowrap shrink-0 [&:hover]:underline",...Nr(t),children:S8e()})]}),_?h.jsxs(h.Fragment,{children:[h.jsx("textarea",{dir:"auto",ref:x,className:"plan-strip-revise-input w-full resize-none border border-border rounded-md py-[9px] px-[11px] text-sm font-[inherit] bg-background text-text [&:focus]:border-accent-blue",placeholder:$8e(),rows:2,value:p,onChange:b=>m(b.target.value),onKeyDown:b=>{b.key==="Escape"?(b.preventDefault(),m(""),f(!1)):b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),S())}}),h.jsxs("div",{className:rN,children:[h.jsx($e,{size:"small",onClick:()=>{m(""),f(!1)},children:p8e()}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),h.jsxs($e,{size:"small",variant:"primary",onClick:S,children:[A8e(),h.jsx(ER,{size:13})]})]})]}):h.jsxs("div",{className:rN,children:[h.jsx($e,{size:"small",onClick:i,children:N8e()}),h.jsx($e,{size:"small",onClick:()=>f(!0),children:D8e()}),h.jsx("span",{className:"plan-strip-spacer flex-1"}),s?h.jsxs("div",{className:"plan-strip-approve relative flex",ref:u,children:[h.jsx($e,{size:"small",variant:"primary",className:"rounded-e-none",onClick:()=>r("auto"),children:Y7e()}),h.jsx($e,{size:"small",variant:"primary",className:"rounded-s-none border-s-plan-caret px-1.5","aria-label":v8e(),onClick:()=>c(b=>!b),children:h.jsx(lo,{size:13})}),o&&h.jsx("div",{className:"plan-strip-menu absolute end-0 bottom-[calc(100%_+_4px)] flex min-w-47.5 flex-col rounded-md border border-border bg-surface p-1 shadow-plan-menu z-6",children:h.jsx(Er,{onClick:()=>{c(!1),r("bypassPermissions")},children:J7e()})})]}):h.jsx($e,{size:"small",variant:"primary",onClick:()=>r(),children:r8e()})]})]})}function z1t({save:e,onSaved:n,placeholder:t,createHref:r}){const[s,i]=T.useState(""),[a,o]=T.useState(!1),[c,u]=T.useState(null);async function _(f){if(f.preventDefault(),!(a||!s.trim())){o(!0),u(null);try{n(await e(s.trim())),i("")}catch(p){u(p instanceof Error?p.message:String(p))}finally{o(!1)}}}return h.jsxs("form",{className:"onb-token-form flex items-center flex-wrap gap-2 mt-2 [&_input]:flex-1 [&_input]:min-w-55 [&_input]:text-sm [&_a]:text-sm [&_a]:text-subtext [&_a]:whitespace-nowrap [&_.error]:basis-full [&_.error]:text-accent-red [&_.error]:text-sm [&_.error]:whitespace-pre-wrap",onSubmit:_,children:[h.jsx("input",{type:"password",value:s,onChange:f=>i(f.target.value),placeholder:t,autoComplete:"off"}),h.jsx($e,{type:"submit",disabled:a||!s.trim(),children:a?na():oo()}),h.jsx("a",{href:r,target:"_blank",rel:"noreferrer",children:Sbe()}),c&&h.jsx("div",{className:"error",children:c})]})}function jD({value:e,max:n,label:t,caption:r,fillColor:s}){const i=n>0?Math.min(100,Math.round(e/n*100)):0;return h.jsxs("div",{className:"progress mt-3 mx-0 mb-1",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:[h.jsx("div",{className:"progress-track h-2 rounded-full bg-surface border border-border overflow-hidden",children:h.jsx("div",{className:"progress-fill h-full bg-accent rounded-full transition-[width] duration-200 ease-standard",style:{width:`${i}%`,background:s}})}),(t!==void 0||r!==void 0)&&h.jsxs("div",{className:"progress-caption flex justify-between mt-1.5 text-sm text-muted",children:[h.jsx("span",{children:t??`${i}%`}),r]})]})}const sN={done:{tone:"success",live:!1},failed:{tone:"danger",live:!1},running:{tone:"info",live:!0},starting:{tone:"warning",live:!0},cancelling:{tone:"caution",live:!0},cancelled:{tone:"caution",live:!1},editing:{tone:"accent",live:!0},idle:{tone:"neutral",live:!1}};function j1t(e){return sN[e]??sN.idle}const T1t={done:CXe,failed:MXe,running:HXe,starting:GXe,cancelling:yXe,cancelled:gXe,editing:jXe,idle:IXe};function TD(e){const n=T1t[e];return n?n():e.charAt(0).toUpperCase()+e.slice(1)}function tl({status:e,label:n,className:t}){const r=j1t(e);return h.jsx(c4,{tone:r.tone,live:r.live,className:t,children:n??TD(e)})}const dg="font-mono text-sm leading-[1.55] [tab-size:4]",AD="whitespace-pre-wrap break-words",RD="file-view-gutter text-right text-muted select-none";function MD(e){const n=String(e).length+2;return{ruleCh:n,codeCh:n+2}}function LD({value:e,onChange:n,onSave:t,onBlur:r,readOnly:s=!1,path:i,highlightLine:a,scrollRequest:o,onScrollRequestHandled:c,scrollPosition:u,onScrollPositionChange:_}){const f=T.useMemo(()=>SD(e,x5(i)),[e,i]),{ruleCh:p,codeCh:m}=MD(f.length),x=T.useRef(null),S=T.useRef(null),b=()=>{const C=x.current;C&&S.current&&(S.current.scrollTop=C.scrollTop)},v=T.useRef(u);T.useLayoutEffect(()=>{const C=x.current;!C||!v.current||(C.scrollTop=v.current.top,C.scrollLeft=v.current.left,b())},[i]),T.useLayoutEffect(b,[e]),T.useLayoutEffect(()=>{var M;const C=x.current;if(!C||!a||o===void 0)return;const z=e.split(` +`),E=Math.min(Math.max(Math.trunc(a),1),z.length);let R=0;for(let O=0;O{if(!s){if((C.metaKey||C.ctrlKey)&&C.key.toLowerCase()==="s"){C.preventDefault(),t();return}if(C.key==="Tab"){C.preventDefault();const z=C.currentTarget,{selectionStart:E,selectionEnd:R}=z,N=e.slice(0,E)+" "+e.slice(R);n(N),requestAnimationFrame(()=>{z.selectionStart=z.selectionEnd=E+1})}}},w=`absolute inset-0 m-0 py-3.5 pe-4 ${dg} ${AD} [scrollbar-gutter:stable]`;return h.jsxs("div",{className:`file-view-editwrap relative h-full min-h-0 ${dg}`,children:[h.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${p}ch`},"aria-hidden":"true"}),h.jsx("div",{ref:S,className:`file-view-code ${w} overflow-hidden pointer-events-none`,"aria-hidden":"true",children:f.map((C,z)=>h.jsxs("div",{"data-line":z+1,className:"relative",style:{paddingInlineStart:`${m}ch`},children:[h.jsx("span",{className:`${RD} absolute start-0 pe-[1ch]`,style:{width:`${p}ch`},children:z+1}),kD(C)?h.jsx("br",{}):C]},z))}),h.jsx("textarea",{ref:x,className:`file-view-editarea ${w} overflow-y-auto overflow-x-hidden resize-none border-0 bg-transparent text-transparent caret-text outline-none`,style:{paddingInlineStart:`${m}ch`},value:e,onChange:C=>{s||n(C.target.value)},onScroll:C=>{b(),_==null||_({top:Math.max(0,C.currentTarget.scrollTop),left:Math.max(0,C.currentTarget.scrollLeft)})},onKeyDown:y,onBlur:s?void 0:r,readOnly:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off"})]})}function DD({onClose:e,onSaved:n}){const[t,r]=T.useState(null),[s,i]=T.useState(""),[a,o]=T.useState(null),[c,u]=T.useState(!1),_=T.useRef(null),f=T.useRef(e),p=t!==null&&s!==t.content,m=T.useRef(p),x=T.useRef(c);m.current=p,x.current=c,f.current=e,T.useEffect(()=>{jnt().then(v=>{r(v),i(v.content)}).catch(v=>o(v instanceof Error?v.message:String(v)))},[]);const S=()=>{x.current||m.current&&!window.confirm(QYe())||f.current()};d4(_,S,"textarea");async function b(){if(!(!t||!p||c)){u(!0);try{await Tnt(s,t.content),r({...t,content:s}),n==null||n(),Vn(aXe(),"success")}catch(v){Vn(v instanceof Error?v.message:String(v),"error")}finally{u(!1)}}}return al.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:v=>{v.target===v.currentTarget&&S()},children:h.jsxs("div",{ref:_,className:"relative flex h-[min(48rem,calc(100vh-2.5rem))] w-200 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"ssh-config-dialog-title",tabIndex:-1,children:[h.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[h.jsx("h2",{id:"ssh-config-dialog-title",className:"m-0 text-xl font-medium",children:uXe()}),h.jsx("code",{className:"mt-1 block font-mono text-sm text-subtext",children:"~/.ssh/config"})]}),h.jsx(Yt,{className:"absolute end-3.5 top-3.5","aria-label":KYe(),onClick:S,disabled:c,children:h.jsx(Dr,{size:16})}),h.jsx("div",{className:"file-view min-h-0 flex-1 border-y border-border-variant bg-background",children:a?h.jsx("p",{className:"m-5 text-sm text-accent-red",children:a}):t===null?h.jsxs("div",{className:"flex items-center gap-2 p-5 text-sm text-subtext",children:[h.jsx(Ot,{})," ",nXe()]}):h.jsx(LD,{value:s,onChange:i,onSave:()=>void b(),path:t.path})}),h.jsxs("div",{className:"flex shrink-0 justify-end gap-2.5 p-4",children:[h.jsx($e,{onClick:S,disabled:c,children:W_()}),h.jsx($e,{variant:"primary",onClick:()=>void b(),disabled:!p||c,children:c?na():oo()})]})]})}),document.body)}const so=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5","[&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text","[&_.settings-sub]:mb-3 [&_.kv]:gap-y-1.5 [&_.kv]:gap-x-4.5","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0"].join(" "),fd=["kv grid grid-cols-[auto_1fr] items-baseline gap-y-[3px] gap-x-3.5 text-base","[&_.k]:text-sm [&_.k]:text-subtext [&_.v]:text-base [&_.v]:text-text","[&_.v]:break-all"].join(" "),A1t=["grid grid-cols-[9rem_minmax(0,1fr)] items-center gap-x-5 gap-y-2.5 font-sans text-base text-text","[&_.k]:font-medium [&_.k]:text-sm [&_.k]:text-text","[&_.v]:min-w-0 [&_.v]:flex [&_.v]:items-center [&_.v]:flex-wrap [&_.v]:gap-2","[&_.v]:font-sans [&_.v]:text-base [&_.v]:text-text [&_.v]:break-words"].join(" "),g1="mt-3 mx-0 mb-0 ps-3 border-s-2 border-s-accent-red font-sans text-base leading-relaxed text-text whitespace-pre-wrap",Qi=["settings-note mt-2.5 mx-0 mb-0 text-base py-2 px-2.5","border border-accent-amber rounded-md bg-accent-amber-subtle","text-accent-amber font-medium"].join(" "),X5=["form font-sans text-sm text-text [&_.form-seg]:self-start [&_.form-seg]:mb-0.5","[&_.form-seg_button]:py-[5px] [&_.form-seg_button]:px-3","[&_.repo-hint]:font-normal [&_.repo-hint]:text-sm","[&_.repo-hint]:text-muted [&_.repo-hint.ok]:text-accent-teal","[&_.folder-picker-control]:flex [&_.folder-picker-control]:items-center","[&_.folder-picker-control]:gap-[9px] [&_.folder-picker-control]:w-full","[&_.folder-picker-control]:min-w-0 [&_.folder-picker-control]:py-2 [&_.folder-picker-control]:px-2.5","[&_.folder-picker-control]:overflow-hidden [&_.folder-picker-control]:bg-background","[&_.folder-picker-control]:border [&_.folder-picker-control]:border-border","[&_.folder-picker-control]:rounded-md [&_.folder-picker-control]:cursor-pointer","[&_.folder-picker-control]:text-start","[&_.folder-picker-control]:transition-[border-color,box-shadow] [&_.folder-picker-control]:duration-120 [&_.folder-picker-control]:ease-standard","[&_.folder-picker-control:hover:not(:disabled)]:border-muted","[&_.folder-picker-control:hover:not(:disabled)]:shadow-control-subtle","[&_.folder-picker-control:focus-visible]:outline-2 [&_.folder-picker-control:focus-visible]:outline-solid [&_.folder-picker-control:focus-visible]:outline-text","[&_.folder-picker-control:focus-visible]:outline-offset-2 [&_.folder-picker-control_span]:flex-1","[&_.folder-picker-control_span]:min-w-0 [&_.folder-picker-control_span]:overflow-hidden","[&_.folder-picker-control_span]:text-ellipsis [&_.folder-picker-control_span]:whitespace-nowrap","[&_.folder-picker-control_.placeholder]:text-muted [&_.folder-picker-icon]:flex-none","[&_.folder-picker-icon]:text-current [&_.folder-picker-chevron]:flex-none","[&_.folder-picker-chevron]:text-muted","[&_.folder-picker-control:hover:not(:disabled)_.folder-picker-chevron]:text-subtext","[&_.folder-picker-hint]:text-subtext [&_.folder-picker-hint]:text-sm","[&_.folder-picker-hint]:font-normal [&_.folder-picker-hint]:leading-[1.4]","[&_.project-location-field]:flex [&_.project-location-field]:flex-col","[&_.project-location-field]:gap-2 [&_.project-location-label]:text-text","[&_.project-location-label]:text-base","[&_.project-location-label]:font-medium [&_.project-field-label]:text-text","[&_.project-field-label]:text-base [&_.project-field-label]:font-medium","[&_.folder-picker-control:disabled]:cursor-default [&_.folder-picker-control:disabled]:opacity-65","[&_.paper-destination]:flex [&_.paper-destination]:items-center","[&_.paper-destination]:gap-2.5 [&_.paper-destination]:pt-2 [&_.paper-destination]:pe-2 [&_.paper-destination]:pb-2 [&_.paper-destination]:ps-3","[&_.paper-destination]:border [&_.paper-destination]:border-border [&_.paper-destination]:rounded-md","[&_.paper-destination]:bg-background [&_.paper-destination_code]:flex-1","[&_.paper-destination_code]:min-w-0 [&_.paper-destination_code]:overflow-hidden","[&_.paper-destination_code]:text-text [&_.paper-destination_code]:text-sm","[&_.paper-destination_code]:font-normal","[&_.paper-destination_code]:text-ellipsis [&_.paper-destination_code]:whitespace-nowrap","[&_.paper-destination_.btn]:flex-none [&_.project-path-notice]:py-[9px] [&_.project-path-notice]:px-[11px]","[&_.project-path-notice]:border [&_.project-path-notice]:border-border-variant","[&_.project-path-notice]:rounded-sm [&_.project-path-notice]:bg-surface","[&_.project-path-notice]:text-base [&_.project-path-notice]:leading-relaxed [&_.project-path-notice]:text-text","[&_.project-path-notice]:leading-[1.4]","[&_.project-path-notice.error]:border-danger-notice-border","[&_.paper-results]:flex [&_.paper-results]:flex-col","[&_.paper-results]:border [&_.paper-results]:border-border [&_.paper-results]:rounded-md","[&_.paper-results]:max-h-60 [&_.paper-results]:overflow-y-auto","[&_.paper-results_button]:flex [&_.paper-results_button]:flex-col","[&_.paper-results_button]:items-start [&_.paper-results_button]:gap-0.5","[&_.paper-results_button]:py-2 [&_.paper-results_button]:px-2.5 [&_.paper-results_button]:bg-none [&_.paper-results_button]:bg-transparent","[&_.paper-results_button]:border-0","[&_.paper-results_button]:border-b [&_.paper-results_button]:border-b-border-variant","[&_.paper-results_button]:text-start [&_.paper-results_button]:[font:inherit]","[&_.paper-results_button]:text-text [&_.paper-results_button]:cursor-pointer","[&_.paper-results_button:last-child]:border-b-0","[&_.paper-results_button:hover]:bg-surface [&_.paper-results_.title]:text-sm","[&_.paper-results_.title]:font-medium","[&_.paper-results_.id]:text-xs [&_.paper-results_.id]:text-muted","[&_.paper-pick_.id]:text-xs","[&_.paper-pick_.id]:text-muted [&_.paper-pick]:flex [&_.paper-pick]:items-center","[&_.paper-pick]:justify-between [&_.paper-pick]:gap-2.5 [&_.paper-pick]:py-2.5 [&_.paper-pick]:px-3","[&_.paper-pick]:border [&_.paper-pick]:border-border [&_.paper-pick]:rounded-md","[&_.paper-pick]:bg-surface [&_.paper-pick_.meta]:min-w-0","[&_.paper-pick_.title]:text-sm [&_.paper-pick_.title]:font-medium","flex flex-col gap-2.5 [&_label]:flex [&_label]:flex-col","[&_label]:gap-1 [&_label]:text-sm [&_label]:text-text","[&_label]:font-medium [&_.row2]:grid [&_.row2]:grid-cols-2","[&_input]:font-sans [&_input]:text-sm [&_input]:font-normal [&_input]:text-text [&_input::placeholder]:text-subtext","[&_select]:font-sans [&_select]:text-sm [&_select]:font-normal [&_select]:text-text","[&_.row2]:gap-2.5 [&_.actions]:flex [&_.actions]:justify-end","[&_.actions]:gap-2.5 [&_.actions]:mt-1.5 [&_.new-project-actions]:justify-start","[&_.new-project-actions]:mt-2.5","[&_.error]:text-accent-red [&_.error]:text-base [&_.error]:whitespace-pre-wrap","settings-form mt-3.5 pt-3.5 border-t border-t-border"].join(" "),Zo=["project-default-row flex items-center justify-between gap-6","pt-3.5 border-t border-t-border-variant [&_p]:mt-[3px] [&_p]:mx-0 [&_p]:mb-0","[&_.project-default-title]:text-base [&_p]:text-sm [&_p]:leading-relaxed [&_p]:text-text"].join(" "),V2=["settings-card [&_>_.error]:text-accent-red [&_>_.error]:text-base","[&_>_.error]:whitespace-pre-wrap bg-background border border-border","rounded-lg mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base","[&_h3]:font-semibold [&_h3]:text-text [&_.settings-sub]:mb-3","[&_>_.project-default-row:first-child]:pt-0 [&_>_.project-default-row:first-child]:border-t-0","git-settings-card py-3.5 px-4 [&_h3]:mb-3","[&_.kv]:grid-cols-[132px_minmax(0,_1fr)] [&_.kv]:items-center [&_.kv]:gap-y-[9px] [&_.kv]:gap-x-4.5","[&_.kv_.k]:text-sm [&_.kv_.v]:flex [&_.kv_.v]:items-center","[&_.kv_.v]:flex-wrap [&_.kv_.v]:gap-[7px] [&_.kv_.v]:min-w-0 [&_.kv_.v]:font-sans","[&_.kv_.v]:text-base [&_.kv_.v]:break-normal","[@media((max-width:_640px))]:[&_.kv]:grid-cols-1","[@media((max-width:_640px))]:[&_.kv]:gap-[3px] [@media((max-width:_640px))]:[&_.kv_.v_+_.k]:mt-[7px]"].join(" "),Cm=["git-card-actions flex flex-wrap gap-2 mt-3.5 pt-3.5","border-t border-t-border-variant"].join(" "),Cf=["settings-stack-section [&_+_.settings-stack-section]:mt-6 [&_>_:last-child]:mb-0","[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl"].join(" ");function ey(e){return e.agentReady?{cls:"ok",variant:"success",label:wUe()}:e.installed?e.installBroken?{cls:"warn",variant:"warning",label:jBe()}:e.authState==="unknown"?{cls:"warn",variant:"warning",label:Fy()}:e.authState==="unsupported"?{cls:"warn",variant:"warning",label:Iqe()}:{cls:"warn",variant:"warning",label:JT()}:{cls:"warn",variant:"warning",label:rHe()}}function R1t({h:e}){return e.authMethod?h.jsx(h.Fragment,{children:e.authMethod==="oauth"?rDe():Yw()}):h.jsx(h.Fragment,{children:"—"})}function M1t(){const[e,n]=T.useState(null),[t,r]=T.useState("claude-code"),[s,i]=T.useState(!1),a=(c,u=!1)=>{i(!0),Ym(c,u).then(n).catch(()=>{}).finally(()=>i(!1))};T.useEffect(()=>a(!1),[]),T.useEffect(()=>y4(()=>a(!0)),[]);const o=e==null?void 0:e.find(c=>c.id===t);return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:uBe()}),h.jsx("div",{className:"harness-tabs mt-3 flex gap-1 mb-3.5 border-b border-b-border-variant [&_button]:inline-flex [&_button]:items-center [&_button]:gap-[7px] [&_button]:py-[7px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:border-b-2 [&_button]:border-b-transparent [&_button]:-mb-px [&_button:hover]:text-text [&_button.active]:border-b-primary",children:(e??[]).map(c=>h.jsxs("button",{className:c.id===t?"active":"",onClick:()=>r(c.id),children:[c.name,h.jsx("span",{className:`w-[7px] h-[7px] rounded-full bg-muted [&.ok]:bg-accent-green [&.err]:bg-accent-red [&.warn]:bg-accent-amber ${ey(c).cls}`})]},c.id))}),e?o?h.jsxs("div",{className:so,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx(It,{variant:ey(o).variant,children:ey(o).label}),h.jsx("div",{className:"spacer flex-1"}),h.jsxs($e,{size:"small",onClick:()=>a(!0,!0),disabled:s,children:[h.jsx(Ca,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Y_()]})]}),h.jsxs("div",{className:fd,children:[h.jsx("span",{className:"k",children:QDe()}),h.jsx("span",{className:"v",children:o.binPath??HLe()}),h.jsx("span",{className:"k",children:sA()}),h.jsx("span",{className:"v",children:o.version??"—"}),h.jsx("span",{className:"k",children:MDe()}),h.jsx("span",{className:"v",children:h.jsx(R1t,{h:o})}),o.account&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:o.id==="opencode"?mGe():Qw()}),h.jsx("span",{className:"v",children:o.account})]}),o.org&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:PHe()}),h.jsx("span",{className:"v",children:o.org})]}),o.plan&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:gFe()}),h.jsx("span",{className:"v",children:o.plan})]}),h.jsx("span",{className:"k",children:EDe()}),h.jsx("span",{className:"v",children:o.models.length>0?oLe({count:Xt(o.models.length),models:new Intl.ListFormat(j()).format(o.models.slice(0,4).map(c=>ze(Vm(c))))}):Zw()})]}),o.agentNote&&h.jsx("p",{className:Qi,children:Z_(o.agentNote)})]}):null:h.jsxs(Br,{children:[h.jsx(Ot,{})," ",AIe()]})]})}function L1t({s:e}){const n=e.preflight;return n.kubectlFound?n.reachable?n.canCreateJobs?h.jsx(It,{variant:"success",children:FOe()}):h.jsx(It,{variant:"error",children:NPe()}):h.jsx(It,{variant:"error",children:AOe()}):h.jsx(It,{variant:"error",children:QBe()})}function D1t({onEditState:e}){const[n,t]=T.useState(null),[r,s]=T.useState(null),[i,a]=T.useState(""),[o,c]=T.useState(""),[u,_]=T.useState(!1),[f,p]=T.useState(!1),[m,x]=T.useState(null),S=C=>{t(C),a(C.context??""),c(C.namespace)};T.useEffect(()=>{vC().then(S).catch(C=>s(C instanceof Error?C.message:String(C)))},[]);const b=n!==null&&i===(n.context??"")&&o.trim()===n.namespace,v=n!==null&&!b;T.useEffect(()=>{e==null||e({dirty:v,saving:u})},[v,u,e]);async function y(){if(!(f||u||!b)){p(!0);try{t(await vC())}catch(C){Vn(C instanceof Error?C.message:String(C),"error")}finally{p(!1)}}}async function w(C){if(C.preventDefault(),!(u||f)){_(!0),x(null);try{S(await wnt({context:i,namespace:o.trim()}))}catch(z){x(z instanceof Error?z.message:String(z))}finally{_(!1)}}}return h.jsx(h.Fragment,{children:r?h.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r}):n?h.jsxs(h.Fragment,{children:[h.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[h.jsx("dt",{className:"text-subtext",children:yd()}),h.jsx("dd",{className:"m-0",children:f||u?h.jsx(It,{children:Sa()}):v?h.jsx(It,{children:ET()}):h.jsx(L1t,{s:n})})]}),b&&!f&&!u&&n.preflight.error&&h.jsx("p",{className:`${g1} break-words`,children:n.preflight.error}),h.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:w,children:[h.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[VOe(),h.jsx(m_,{choices:[{id:"",label:n.currentContext?yMe({context:ze(n.currentContext)}):gMe()},...i&&!n.contexts.includes(i)?[{id:i,label:GLe({context:ze(i)})}]:[],...n.contexts.map(C=>({id:C,label:C}))],value:i,variant:"field",dropDown:!0,disabled:u||f,onSelect:a})]}),h.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[J$e(),h.jsx(Ts,{type:"text",value:o,disabled:u||f,onChange:C=>c(C.target.value),placeholder:mIe(),autoComplete:"off",spellCheck:!1})]}),m&&h.jsx("p",{className:"m-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:m}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsxs($e,{type:"button",onClick:()=>void y(),disabled:u||f||!b,children:[h.jsx(Ca,{size:13})," ",f?Sa():V_()]}),h.jsx($e,{variant:"primary",type:"submit",disabled:u||f||b,children:u?na():oo()})]})]})]}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",hOe()]})})}function O1t(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[a,o]=T.useState(""),[c,u]=T.useState(!0),[_,f]=T.useState(!1);T.useEffect(()=>{let x=!0;return xC().then(S=>{x&&n(S)}).catch(S=>{x&&r(S instanceof Error?S.message:String(S))}).finally(()=>{x&&u(!1)}),()=>{x=!1}},[]);async function p(){if(!(c||_)){u(!0),r(null);try{n(await xC())}catch(x){n(null),r(x instanceof Error?x.message:String(x))}finally{u(!1)}}}async function m(x){if(x.preventDefault(),!(!s.trim()||!a.trim()||c||_||e!=null&&e.processEnv)){f(!0),r(null);try{n(await Snt(s.trim(),a.trim())),i(""),o("")}catch(S){r(S instanceof Error?S.message:String(S))}finally{f(!1)}}}return h.jsxs(h.Fragment,{children:[c?h.jsxs(Br,{children:[h.jsx(Ot,{})," ",gOe()]}):e&&h.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[h.jsx("dt",{className:"font-medium text-subtext",children:yd()}),h.jsx("dd",{className:"m-0",children:h.jsx(It,{variant:e.tokenConfigured?"success":"warning",children:e.tokenConfigured?e4():Og()})})]}),(e==null?void 0:e.processEnv)&&h.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:IMe()}),h.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:m,children:[h.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e!=null&&e.tokenConfigured?HMe():JMe(),h.jsx(Ts,{type:"password",value:s,onChange:x=>i(x.target.value),placeholder:(e==null?void 0:e.maskedTokenId)??"ak-…",autoComplete:"new-password",disabled:e==null?void 0:e.processEnv})]}),h.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e!=null&&e.tokenConfigured?GMe():rLe(),h.jsx(Ts,{type:"password",value:a,onChange:x=>o(x.target.value),placeholder:(e==null?void 0:e.maskedTokenSecret)??"as-…",autoComplete:"new-password",disabled:e==null?void 0:e.processEnv})]}),h.jsx("a",{className:"self-start text-sm text-subtext underline",href:"https://modal.com/docs/sdk/py/latest/config",target:"_blank",rel:"noreferrer",children:YMe()}),t&&h.jsx("p",{className:"m-0 text-sm text-accent-red",children:t}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsxs($e,{type:"button",disabled:c||_,onClick:()=>void p(),children:[h.jsx(Ca,{size:13})," ",Y_()]}),h.jsx($e,{variant:"primary",type:"submit",disabled:!s.trim()||!a.trim()||c||_||(e==null?void 0:e.processEnv),children:_?na():oo()})]})]})]})}const OD="rounded-sm border-border-strong bg-surface text-subtext",ID="rounded-sm border-accent-blue bg-accent-blue-subtle text-accent-blue",I1t=5e3;function BD(e){const[n,t]=T.useState({}),r=e.join("\0");return T.useEffect(()=>{const i=r?r.split("\0"):[];if(i.length===0){t({});return}let a=!1;const o=async()=>{const u=await Promise.all(i.map(async _=>{try{return[_,(await Ant(_)).running]}catch{return null}}));a||t(_=>{const f={};for(const p of u)p&&(f[p[0]]=p[1]);for(const p of i)f[p]===void 0&&_[p]!==void 0&&(f[p]=_[p]);return f})};o();const c=window.setInterval(o,I1t);return()=>{a=!0,window.clearInterval(c)}},[r]),[n,i=>t(a=>({...a,[i]:!0}))]}function B1t({test:e,connecting:n,masterRunning:t}){if(n)return h.jsx("span",{role:"status",children:h.jsx(It,{className:ID,children:UT()})});if(e===void 0)return h.jsx(It,{className:OD,children:QT()});const r=e.missingTools??[],s=e.reachable&&e.toolsFound&&t===!1,i=e.reachable?e.toolsFound?s?h.jsx(It,{className:"rounded-sm",variant:"warning",children:GT()}):h.jsx(It,{className:"rounded-sm",variant:"success",children:K_()}):h.jsx(It,{className:"rounded-sm",variant:"error",children:r.length===1?fLe({tool:ze(r[0])}):pLe()}):h.jsx(It,{className:"rounded-sm",variant:"error",children:Jw()});return h.jsxs("div",{className:"flex items-center gap-4",role:"status",children:[i,!s&&h.jsx("span",{className:"ssh-tested-at whitespace-nowrap text-xs text-subtext",children:no(e.testedAt)})]})}function $1t({remote:e=!1}){const[n,t]=T.useState(null),[r,s]=T.useState(!1),[i,a]=T.useState(0),[o,c]=T.useState({}),[u,_]=T.useState({}),[f,p]=T.useState(null),[m,x]=T.useState(!1),[S,b]=T.useState(0),v=e?[]:(n==null?void 0:n.filter(R=>{const N=o[R.host]??R.lastTest;return(N==null?void 0:N.reachable)&&N.toolsFound}).map(R=>R.host))??[],[y,w]=BD(v);T.useEffect(()=>{NA().then(t).catch(()=>t([]))},[i]);function C(R){x(!1),b(N=>N+1),p(R),_(N=>({...N,[R]:!0}))}function z(){x(!1),p(null)}function E(R,N){_(M=>({...M,[R]:!N}))}return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"mb-3 flex justify-end",children:h.jsxs($e,{variant:"ghost",onClick:()=>s(!0),children:[h.jsx(MR,{size:14})," ",fA()]})}),n===null?h.jsxs(Br,{children:[h.jsx(Ot,{})," ",tA()]}):n.length===0?h.jsx("p",{className:"settings-empty mt-1 mx-0 mb-0 text-base text-subtext",children:SPe()}):h.jsx("div",{className:"border-y border-border-variant divide-y divide-border-variant",children:n.map(R=>{const N=o[R.host]??R.lastTest,M=f===R.host,O=u[R.host]??!1,I=!e&&(M||(N==null?void 0:N.reachable)===!1),H=`${R.user?`${R.user}@`:""}${R.hostname??R.host}${R.port?`:${R.port}`:""}`;return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-3 py-3 px-2",children:[h.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[I?h.jsx("button",{type:"button",className:"flex-none inline-flex items-center p-0.5 rounded-sm [&:hover]:bg-panel","aria-expanded":O,"aria-label":O?dU({name:ze(R.host)}):LU({name:ze(R.host)}),onClick:U=>{U.stopPropagation(),E(R.host,O)},children:h.jsx(lo,{size:15,className:`text-muted transition-transform duration-120 ease-standard${O?" rotate-180":""}`})}):h.jsx("span",{className:"w-5 flex-none","aria-hidden":"true"}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"truncate text-base font-medium text-text",title:R.host,children:R.host}),h.jsx("div",{className:"mt-1 truncate text-sm text-subtext",title:H,children:H})]})]}),!e&&h.jsxs("div",{className:"grid flex-none grid-cols-[8.5rem_5rem] items-center gap-x-12",children:[h.jsx("div",{className:"text-start",children:h.jsx(B1t,{test:N,connecting:M&&!m,masterRunning:y[R.host]})}),h.jsx($e,{size:"small",type:"button",className:"justify-self-end",onClick:U=>{U.stopPropagation(),M&&!m?z():C(R.host)},disabled:!M&&f!==null&&!m,children:M?m?Ji():W_():(N==null?void 0:N.reachable)===!1?Ji():N?iA():Xw()})]})]}),I&&(O||M)&&h.jsxs("div",{className:`border-t border-t-border-variant py-3 pe-2 ps-10${O?"":" hidden"}`,children:[!M&&(N==null?void 0:N.error)&&h.jsx(zit,{host:R.host,transcript:N.error}),M&&h.jsx(_4,{host:R.host,backend:"ssh",active:O,onComplete:U=>{U.backend==="ssh"&&(c(F=>({...F,[R.host]:U.result})),w(R.host),x(!1),p(null))},onError:U=>{x(!0),c(F=>({...F,[R.host]:{reachable:!1,toolsFound:!1,missingTools:[],error:U,testedAt:Date.now()}}))}},S)]})]},R.host)})}),r&&h.jsx(DD,{onClose:()=>s(!1),onSaved:()=>a(R=>R+1)})]})}function P1t({test:e,connecting:n,masterRunning:t}){return n?h.jsx(It,{className:ID,children:UT()}):e===null?h.jsx(It,{className:OD,children:QT()}):e.reachable?e.slurmFound?e.toolsFound?t===!1?h.jsx(It,{className:"rounded-sm",variant:"warning",children:GT()}):h.jsx(It,{className:"rounded-sm",variant:"success",children:K_()}):h.jsx(It,{className:"rounded-sm",variant:"error",children:I$e()}):h.jsx(It,{className:"rounded-sm",variant:"error",children:UPe()}):h.jsx(It,{className:"rounded-sm",variant:"error",children:Jw()})}function H1t({remote:e=!1}){const[n,t]=T.useState(null),[r,s]=T.useState(null),[i,a]=T.useState(""),[o,c]=T.useState(""),[u,_]=T.useState(""),[f,p]=T.useState(""),[m,x]=T.useState(!1),[S,b]=T.useState(null),[v,y]=T.useState(null),[w,C]=T.useState(!1),[z,E]=T.useState(!1),[R,N]=T.useState(0),M=!e&&i&&(v!=null&&v.reachable)&&v.slurmFound&&v.toolsFound?[i]:[],[O,I]=BD(M);function H(){E(!1),N(q=>q+1),C(!0)}const U=q=>{t(q),a(q.host??""),c(q.partition??""),_(q.account??""),p(q.timeLimit??"")};T.useEffect(()=>{Bnt().then(U).catch(q=>s(q instanceof Error?q.message:String(q)))},[]);const F=n!==null&&i===(n.host??"")&&o.trim()===(n.partition??"")&&u.trim()===(n.account??"")&&f.trim()===(n.timeLimit??"");async function Y(q){if(q.preventDefault(),!m){x(!0),b(null);try{U(await $nt({host:i,partition:o.trim(),account:u.trim(),timeLimit:f.trim()}))}catch(Q){b(Q instanceof Error?Q.message:String(Q))}finally{x(!1)}}}return h.jsx(h.Fragment,{children:r?h.jsx("div",{className:"error",children:r}):n?h.jsxs(h.Fragment,{children:[!w&&(v==null?void 0:v.error)&&h.jsx("p",{className:g1,children:v.error}),h.jsxs("form",{className:X5,onSubmit:Y,children:[h.jsx("div",{className:"max-w-xl",children:h.jsxs("label",{children:[j$e(),h.jsx(m_,{choices:[{id:"",label:pHe()},...i&&!n.hosts.some(q=>q.host===i)?[{id:i,label:`${i} (not in ~/.ssh/config)`}]:[],...n.hosts.map(q=>({id:q.host,label:q.host}))],value:i,variant:"field",dropDown:!0,disabled:m||w,onSelect:q=>{a(q),y(null),C(!1),E(!1)}})]})}),h.jsxs("div",{className:"actions",children:[!e&&h.jsx($e,{type:"button",onClick:()=>{w&&!z?(E(!1),C(!1)):H()},disabled:!i,title:i?void 0:dGe(),children:w?z?Ji():W_():v?iA():Xw()}),h.jsx("span",{role:"status",children:h.jsx(P1t,{test:v,connecting:w&&!z,masterRunning:O[i]})})]}),h.jsxs("div",{className:"mt-5 border-t border-border pt-5",children:[h.jsxs("div",{className:"row2",children:[h.jsxs("label",{children:[cFe(),h.jsx(Ts,{type:"text",list:"slurm-partitions",value:o,onChange:q=>c(q.target.value),placeholder:iC(),autoComplete:"off",spellCheck:!1}),h.jsx("datalist",{id:"slurm-partitions",children:v==null?void 0:v.partitions.map(q=>h.jsx("option",{value:q},q))})]}),h.jsxs("label",{children:[Qw(),h.jsx(Ts,{type:"text",value:u,onChange:q=>_(q.target.value),placeholder:iC(),autoComplete:"off",spellCheck:!1})]})]}),h.jsxs("label",{className:"mt-3 block max-w-xl",children:[Eqe(),h.jsx(Ts,{type:"text",value:f,onChange:q=>p(q.target.value),placeholder:NOe(),autoComplete:"off",spellCheck:!1})]})]}),S&&h.jsx("div",{className:"error",children:S}),h.jsx("div",{className:"actions",children:h.jsx($e,{variant:"primary",type:"submit",disabled:m||F||w,children:m?na():oo()})})]}),!e&&w&&h.jsx(_4,{host:i,backend:"slurm",onComplete:q=>{q.backend==="slurm"&&(y(q.result),I(i),E(!1),C(!1))},onError:q=>{E(!0),y({reachable:!1,slurmFound:!1,toolsFound:!1,partitions:[],error:q})}},R)]}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",h$e()]})})}function F1t(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[a,o]=T.useState(!1),[c,u]=T.useState(null),[_,f]=T.useState(null),p=_!==null&&_!=="testing"?_:null,m=v=>{n(v),i(v.address??"")};T.useEffect(()=>{Pnt().then(m).catch(v=>r(v instanceof Error?v.message:String(v)))},[]);const x=e!==null&&s===(e.address??"");async function S(v){if(v.preventDefault(),!a){o(!0),u(null);try{m(await Hnt({address:s}))}catch(y){u(y instanceof Error?y.message:String(y))}finally{o(!1)}}}async function b(){f("testing");try{f(await Fnt(s.trim()||void 0))}catch(v){f({reachable:!1,address:s.trim()||"(unknown)",rayVersion:null,error:v instanceof Error?v.message:String(v)})}}return h.jsx(h.Fragment,{children:t?h.jsx("div",{className:"error",children:t}):e?h.jsxs(h.Fragment,{children:[(p==null?void 0:p.error)&&h.jsx("p",{className:g1,children:p.error}),h.jsxs("form",{className:X5,onSubmit:S,children:[h.jsxs("label",{children:[KBe(),h.jsx(Ts,{type:"text",value:s,onChange:v=>{i(v.target.value),f(null)},placeholder:"http://127.0.0.1:8265",autoComplete:"off",spellCheck:!1})]}),h.jsxs("p",{className:"m-0 text-sm text-subtext",children:[$Ie(),": ",ze(e.resolvedAddress)," · ",nA(),": ",e.source]}),c&&h.jsx("div",{className:"error",children:c}),h.jsxs("div",{className:"actions",children:[h.jsx($e,{variant:"primary",type:"submit",disabled:a||x,children:a?na():oo()}),h.jsx($e,{type:"button",onClick:()=>void b(),disabled:_==="testing",children:nqe()}),h.jsx(U1t,{test:_})]}),(p==null?void 0:p.reachable)&&p.rayVersion&&h.jsxs("p",{className:"m-0 text-sm text-subtext",children:[CFe(),": ",p.rayVersion]})]})]}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",c$e()]})})}function U1t({test:e}){return e===null?null:e==="testing"?h.jsx(It,{children:aqe()}):e.reachable?h.jsx(It,{variant:"success",children:jFe()}):h.jsx(It,{variant:"error",children:Jw()})}function q1t(e){const n=e.chip??`${e.os}/${e.arch}`,t=e.memBytes===null?null:Yo(e.memBytes),r=e.gpus.length===0?null:NRe({count:e.gpus.length});return[n,e.cpuCount>0?$Ae({count:e.cpuCount}):null,t,r].filter(Boolean).join(" · ")}function G1t({remote:e}){const[n,t]=T.useState(null),[r,s]=T.useState(null),[i,a]=T.useState(!0),[o,c]=T.useState(0),[u,_]=T.useState(!0),[f,p]=T.useState(!1);async function m(){a(!0),s(null);try{t(await Vnt())}catch(x){s(x instanceof Error?x.message:String(x))}finally{a(!1)}}return T.useEffect(()=>{m()},[e]),h.jsxs(h.Fragment,{children:[r&&!n?h.jsx("div",{className:"error",children:r}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:A1t,children:[h.jsx("span",{className:"k",children:yd()}),h.jsx("span",{className:"v",children:i||f?h.jsxs(It,{className:"gap-1.5",role:"status",children:[h.jsx(Ot,{}),f?fDe():Sa()]}):r?h.jsx(It,{variant:"warning",children:Fy()}):n?n.loggedIn?n.sshKeyStatus==="matched"?h.jsx(It,{variant:"success",children:K_()}):n.sshKeyStatus==="unknown"?h.jsx(It,{variant:"warning",children:Fy()}):h.jsx(It,{variant:"warning",children:Og()}):h.jsx(It,{variant:"warning",children:JT()}):null}),h.jsx("span",{className:"k",children:qHe()}),h.jsx("span",{className:"v",children:n!=null&&n.loggedIn&&n.orgs.length>0?n.orgs.join(", "):"—"}),h.jsx("span",{className:"k",children:jUe()}),h.jsx("span",{className:"v",children:i||!(n!=null&&n.loggedIn)?"—":n.sshKeyStatus==="matched"?h.jsx(It,{variant:"success",children:wHe()}):n.sshKeyStatus==="no_local_match"?h.jsx(It,{variant:"warning",children:fHe()}):n.sshKeyStatus==="none_registered"?h.jsx(It,{variant:"error",children:WPe()}):h.jsx(It,{children:Mqe()})})]}),e&&n&&!n.loggedIn&&h.jsx("p",{className:"mt-4 mb-0 text-sm text-subtext",children:jMe({command:ze("orx login")})}),!e&&o>0&&h.jsx(Nit,{login:u,onComplete:()=>{p(!1),c(0),m()},onError:x=>{p(!1),Vn(x,"error")}},o),e&&(n==null?void 0:n.loggedIn)&&n.sshKeyStatus==="none_registered"&&(n.sshKeyPath?h.jsxs("p",{dir:"auto",className:Qi,children:[bDe()," ",h.jsxs("code",{children:["orx ssh-key add ",n.sshKeyPath]}),"."]}):h.jsxs("p",{dir:"auto",className:Qi,children:[$Pe()," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),uqe()," ",h.jsx("code",{children:"orx ssh-key add"}),"."]})),e&&(n==null?void 0:n.loggedIn)&&n.sshKeyStatus==="no_local_match"&&(n.sshKeyPath?h.jsx("p",{dir:"auto",className:Qi,children:SGe({register:ze(`orx ssh-key add ${n.sshKeyPath}`),load:ze("ssh-add")})}):h.jsxs("p",{dir:"auto",className:Qi,children:[DPe()," ",h.jsx("code",{children:"ssh-add"}),OHe()," ",h.jsx("code",{children:"ssh-keygen -t ed25519"}),"."]})),!i&&(r||(n==null?void 0:n.error))&&h.jsx("p",{dir:"auto",className:"mt-4 mb-0 text-sm text-accent-red whitespace-pre-wrap break-words",children:r||(n==null?void 0:n.error)})]}),h.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[h.jsxs($e,{onClick:()=>void m(),disabled:i||f,children:[h.jsx(Ca,{size:13})," ",i?Sa():V_()]}),!e&&n&&(!n.loggedIn||n.sshKeyStatus!=="matched")&&h.jsxs($e,{variant:"primary",disabled:i||f,onClick:()=>{_(!n.loggedIn),p(!0),c(x=>x+1)},children:[f?h.jsx(Ot,{}):h.jsx(Sd,{size:13})," ",n.loggedIn?yVe():aA()]})]})]})}const dd={local:ST,tinker:Mde,hf:nde,modal:hde,k8s:ade,ssh:jde,slurm:Cde,ray:yde,openresearch:gde},V1t={local:zfe,ssh:Kfe,tinker:Qfe,hf:xfe,modal:Rfe,k8s:kfe,slurm:qfe,ray:Pfe,openresearch:Ofe},b1={local:"local_job",tinker:"tinker_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",ray:"ray_job",openresearch:"openresearch_job"},iN=["hf","modal","slurm","ray","openresearch"],ty=["hf","modal","openresearch"],$D={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],ray:["cpu","cpu:2","gpu","gpu:1","gpu:1,cpu:4","gpu:1,mem:8GiB"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]},W2=["tinker","hf","modal","ray","k8s"],W1t={tinker:Yde,hf:Ide,modal:Hde,openresearch:Gde},aN="__custom__";function Ah(e,n){return!!(n&&!($D[e]??[]).includes(n))}function K1t({settings:e,projectId:n,onSaved:t}){const r=e.configuredDefaultBackend??e.defaultBackend??"local",s=e.defaultFlavor??"",[i,a]=T.useState(r),[o,c]=T.useState(s),[u,_]=T.useState(Ah(r,s)),[f,p]=T.useState(!1),[m,x]=T.useState(null),S=e.targets.find(I=>I.id===i),b=e.targets.filter(I=>I.configured||I.id===r),v=iN.includes(i),y=ty.includes(i),w=$D[i]??[],C=i===r&&(!v||o.trim()===s),z=dd[i](),E=W1t[i],R=f?AWe():y&&!o.trim()?_Ae({destination:z}):i==="ssh"?SLe():vLe({destination:z});T.useEffect(()=>{a(r),c(s),_(Ah(r,s))},[r,s]);async function N(I,H){const U=iN.includes(I);if(!(f||ty.includes(I)&&!H.trim())){p(!0),x(null);try{t(await qnt({backend:I,flavor:U&&H.trim()||null,projectId:n}))}catch(F){x(F instanceof Error?F.message:String(F)),a(r),c(s),_(Ah(r,s))}finally{p(!1)}}}function M(I){const H=e.targets.find(F=>F.id===I);if(!H)return;a(H.id);const U=H.id===r?s:"";c(U),_(Ah(H.id,U)),ty.includes(H.id)||N(H.id,U)}function O(I){if(I===aN){_(!0);return}_(!1),c(I),(!y||I)&&N(i,I)}return h.jsxs("section",{className:"mb-8",children:[h.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:SIe()}),h.jsxs("div",{children:[h.jsxs("form",{className:"grid grid-cols-[minmax(12rem,18rem)_minmax(12rem,18rem)] items-start gap-3",onSubmit:I=>{I.preventDefault(),C||N(i,o)},children:[h.jsx(m_,{choices:b.map(I=>({id:I.id,label:dd[I.id]()})),value:i,variant:"field",dropDown:!0,disabled:f,renderIcon:I=>{const H=e.targets.find(U=>U.id===I.id);return H?h.jsx(Q_,{kind:b1[H.id],size:16}):null},onSelect:M}),v&&h.jsx("div",{children:u?h.jsxs("div",{className:"relative",children:[h.jsx("input",{className:"h-9 w-full rounded-md border border-border bg-background py-0 pe-10 ps-3 font-sans text-sm text-text outline-none focus:border-text",type:"text",value:o,onChange:I=>c(I.target.value),onBlur:()=>{if(y&&!o.trim()){i===r&&(c(s),_(Ah(r,s)));return}C||N(i,o)},placeholder:sIe(),autoFocus:!0,autoComplete:"off",spellCheck:!1,disabled:f}),h.jsx("button",{type:"button",className:"absolute inset-y-0 end-0 inline-flex w-9 items-center justify-center text-muted hover:text-text","aria-label":sC(),title:sC(),onMouseDown:I=>I.preventDefault(),onClick:()=>_(!1),children:h.jsx(lo,{size:12})})]}):h.jsx(m_,{choices:[{id:"",label:y?uAe():ALe()},...o&&!w.includes(o)?[{id:o,label:ZAe({value:ze(o)})}]:[],...w.map(I=>({id:I,label:I})),{id:aN,label:lIe()}],value:o,variant:"field",dropDown:!0,disabled:f,onSelect:O})})]}),m&&h.jsx("div",{className:"error mt-2.5",children:m}),S&&!S.configured&&h.jsx("p",{className:Qi,children:bqe()})]}),h.jsx("p",{className:"mt-2 mb-0 text-sm leading-relaxed text-subtext",children:R}),E&&h.jsx("p",{className:"mt-1 mb-0 text-sm leading-relaxed text-subtext",children:E()})]})}function Y1t({target:e,isDefault:n,summary:t,onOpen:r,onOpenEnvironment:s}){const i=`compute-${e.id}-summary`,a=e.unverified?nAe():e.id==="openresearch"?aA():e.id==="ray"?Xw():gVe();return h.jsxs("div",{className:`group relative flex min-h-41 w-full flex-col items-start rounded-lg border border-border bg-background p-5 text-start font-sans ${r&&e.enabled?"transition-colors duration-120 ease-standard hover:border-text hover:bg-surface":""} ${e.enabled?"":"opacity-52"}`,children:[r&&h.jsx("button",{type:"button",className:"absolute inset-0 z-10 rounded-lg focus-visible:outline-2 focus-visible:outline-text focus-visible:outline-offset-2 disabled:cursor-default",onClick:r,disabled:!e.enabled,"aria-label":dd[e.id](),"aria-describedby":i,"aria-haspopup":W2.includes(e.id)?"dialog":void 0}),h.jsx("span",{className:"flex h-16 w-40 flex-none items-center justify-start",children:h.jsx(Q_,{kind:b1[e.id],size:48})}),h.jsx("span",{className:"mt-5 text-lg font-semibold text-text",children:dd[e.id]()}),h.jsx("span",{className:"mt-1 line-clamp-2 min-h-9 text-sm leading-normal text-text",children:V1t[e.id]()}),h.jsx("span",{id:i,className:"mt-2 line-clamp-2 min-h-8 text-xs leading-normal text-subtext",children:e.fromEnvironmentTab?h.jsxs(h.Fragment,{children:[e.id==="tinker"?hMe():pWe()," ",h.jsx("button",{type:"button",className:"relative z-20 text-primary underline-offset-2 hover:text-primary-hover hover:underline",onClick:s,children:oRe()})]}):t??e.summary}),h.jsxs("span",{className:"mt-auto flex w-full items-center justify-between gap-3 pt-3 text-sm",children:[h.jsx("span",{className:n?"font-medium text-primary":"text-subtext",children:n?YT():e.configured?!r||W2.includes(e.id)?e4():FWe():a}),r&&h.jsx("span",{className:"text-subtext transition-transform duration-120 ease-standard group-hover:translate-x-0.5","aria-hidden":"true",children:h.jsx(xm,{size:16})})]})]})}function X1t({target:e,isDefault:n,onBack:t,remote:r}){return h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back mb-6 inline-flex items-center gap-2 text-sm font-medium text-subtext hover:text-text",onClick:t,children:[h.jsx(d_,{size:16})," ",WT()]}),h.jsxs("div",{className:"flex items-center justify-between gap-6",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx("span",{className:"flex h-10 w-10 flex-none items-center justify-center",children:h.jsx(Q_,{kind:b1[e.id],size:36})}),h.jsx("h1",{className:"m-0 min-w-0 text-2xl",children:dd[e.id]()})]}),n&&h.jsx(It,{className:"flex-none border-primary bg-primary-subtle text-primary",children:YT()})]}),h.jsxs("div",{className:"mt-6 font-sans text-base text-text [&_.settings-card]:mb-0 [&_.settings-form]:mt-6 [&_.settings-form]:border-t-0 [&_.settings-form]:pt-0 [&>.settings-form:first-child]:mt-0 [&>div:first-child]:border-t-0",children:[e.id==="ssh"&&h.jsx($1t,{remote:r}),e.id==="slurm"&&h.jsx(H1t,{remote:r}),e.id==="openresearch"&&h.jsx(G1t,{remote:r})]})]})}function Z1t({target:e,onClose:n}){const t=T.useRef(null),[r,s]=T.useState({dirty:!1,saving:!1});T.useEffect(()=>{const a=t.current;return a==null||a.showModal(),()=>a==null?void 0:a.close()},[]);const i=()=>{r.saving||r.dirty&&!window.confirm(cMe())||n()};return h.jsxs("dialog",{ref:t,className:"m-auto w-140 max-w-[calc(100vw_-_40px)] max-h-[calc(100vh_-_40px)] overflow-y-auto rounded-xl border border-border bg-background p-5 text-text shadow-modal backdrop:bg-modal-backdrop-light","aria-labelledby":"compute-quick-setup-title",onKeyDown:a=>{a.key==="Escape"&&(a.preventDefault(),i())},onCancel:a=>{a.preventDefault(),i()},children:[h.jsxs("div",{className:"mb-5 flex items-center justify-between gap-4",children:[h.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[h.jsx(Q_,{kind:b1[e.id],size:32}),h.jsx("h2",{id:"compute-quick-setup-title",className:"m-0 text-xl font-medium text-text",children:dd[e.id]()})]}),h.jsx(Yt,{title:qm(),"aria-label":qm(),onClick:i,disabled:r.saving,children:h.jsx(Dr,{size:14})})]}),e.id==="tinker"&&h.jsx(J1t,{target:e}),e.id==="hf"&&h.jsx(tbt,{}),e.id==="modal"&&h.jsx(O1t,{}),e.id==="ray"&&h.jsx(F1t,{}),e.id==="k8s"&&h.jsx(D1t,{onEditState:s})]})}function Q1t({project:e,onViewHistory:n,onOpenEnvironment:t,remote:r}){const[s,i]=T.useState(null),[a,o]=T.useState(null),[c,u]=T.useState(null),[_,f]=T.useState(null),[p,m]=T.useState(null),[x,S]=T.useState(null),b=T.useRef(0);T.useEffect(()=>{b.current++,i(null),u(null),o(null),f(null)},[e==null?void 0:e.id]),T.useEffect(()=>{Gnt().then(m).catch(M=>S(M instanceof Error?M.message:String(M)))},[]),T.useEffect(()=>{const M=++b.current;Unt(e==null?void 0:e.id).then(O=>{M===b.current&&(i(O),o(null))}).catch(O=>{if(M!==b.current)return;const I=O instanceof Error?O.message:String(O);i(H=>(H===null?o(I):f(I),H))})},[c,e==null?void 0:e.id]);const v=M=>{b.current++,i(M),f(null)},y=s?s.targets:null,w=(s==null?void 0:s.configuredDefaultBackend)??(s==null?void 0:s.defaultBackend),C=y?[...y].sort((M,O)=>+(O.id===w)-+(M.id===w)):null,z=(C==null?void 0:C.filter(M=>M.configured))??[],E=(C==null?void 0:C.filter(M=>!M.configured))??[],R=M=>h.jsx(Y1t,{target:M,isDefault:w===M.id,summary:M.id==="local"?p?q1t(p):x??NIe():void 0,onOpen:M.id==="local"?void 0:()=>u(M.id),onOpenEnvironment:t},`${(e==null?void 0:e.id)??"none"}:${M.id}`),N=c?s==null?void 0:s.targets.find(M=>M.id===c):null;return N&&!W2.includes(N.id)?h.jsx(X1t,{target:N,isDefault:w===N.id,onBack:()=>u(null),remote:r}):h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:KT()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:BOe()}),h.jsx(bbt,{projectId:e==null?void 0:e.id,onViewHistory:n}),a?h.jsx("div",{className:"error",children:a}):s?h.jsxs(h.Fragment,{children:[_&&h.jsx("div",{className:"error",children:_}),h.jsx(K1t,{settings:s,projectId:e==null?void 0:e.id,onSaved:v}),h.jsxs("section",{className:"mb-8",children:[h.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:e4()}),h.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:z.map(R)})]}),E.length>0&&h.jsxs("section",{className:"mb-3.5",children:[h.jsx("h2",{className:"mt-0 mx-0 mb-2 text-lg",children:H$e()}),h.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(R)})]}),N&&h.jsx(Z1t,{target:N,onClose:()=>u(null)})]}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",cOe()]})]})}function J1t({target:e}){const[n,t]=T.useState(""),[r,s]=T.useState(!1),[i,a]=T.useState(null),[o,c]=T.useState(null),[u,_]=T.useState(!0);T.useEffect(()=>{let m=!0;return bC().then(x=>{m&&c(x)}).catch(x=>{m&&a(x instanceof Error?x.message:String(x))}).finally(()=>{m&&_(!1)}),()=>{m=!1}},[]);async function f(){if(!(u||r)){_(!0),a(null),c(null);try{c(await bC())}catch(m){a(m instanceof Error?m.message:String(m))}finally{_(!1)}}}async function p(m){if(m.preventDefault(),!(!n.trim()||r||u)){s(!0),a(null);try{c(await gnt(n.trim())),t("")}catch(x){a(x instanceof Error?x.message:String(x))}finally{s(!1)}}}return h.jsxs(h.Fragment,{children:[u?h.jsxs(Br,{children:[h.jsx(Ot,{})," ",Sa()]}):o&&h.jsxs("dl",{className:"m-0 flex items-center justify-between gap-4 text-sm",children:[h.jsx("dt",{className:"font-medium text-subtext",children:yd()}),h.jsx("dd",{className:"m-0",children:h.jsx(It,{variant:o.validationStatus==="valid"?"success":o.validationStatus==="invalid"?"error":"warning",children:o.validationStatus==="valid"?K_():o.validationStatus==="invalid"?fWe():o.validationStatus==="billingRequired"?rWe():Og()})})]}),(o==null?void 0:o.validationStatus)==="billingRequired"&&h.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:h.jsx("a",{className:"underline",href:"https://tinker.thinkingmachines.ai/",target:"_blank",rel:"noreferrer",children:JVe()})}),(o==null?void 0:o.processEnv)&&h.jsx("p",{className:"mt-2 mb-0 text-sm text-subtext",children:oWe()}),h.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:p,children:[h.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e.configured||o!==null&&o.validationStatus!=="missing"?WGe():Yw(),h.jsx(Ts,{type:"password",value:n,placeholder:(o==null?void 0:o.maskedKey)??"",onChange:m=>t(m.target.value),autoComplete:"new-password"})]}),i&&h.jsx("p",{className:"m-0 text-sm text-accent-red",children:i}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsxs($e,{type:"button",disabled:r||u,onClick:()=>void f(),children:[h.jsx(Ca,{size:13})," ",u?Sa():V_()]}),h.jsx($e,{variant:"primary",type:"submit",disabled:!n.trim()||r||u,children:r?lA():oo()})]})]})]})}function ebt({settings:e}){return e.validationStatus==="missing"?h.jsx(It,{variant:"warning",children:Og()}):e.validationStatus==="invalid"?h.jsx(It,{variant:"error",children:qBe()}):e.validationStatus!=="valid"?null:e.jobsWrite===!0?h.jsx(It,{variant:"success",children:K_()}):e.jobsWrite===!1?h.jsxs("span",{className:"inline-flex items-center gap-2",children:[h.jsx(It,{variant:"warning",children:APe()}),h.jsx(f4,{content:$Re(),className:"text-subtext",children:h.jsx(C4,{size:15})})]}):null}function tbt(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[a,o]=T.useState(!1),[c,u]=T.useState(!1),[_,f]=T.useState(null),p=T.useRef(!1);T.useEffect(()=>{gC().then(S=>{p.current||n(S)}).catch(S=>{p.current||r(S instanceof Error?S.message:String(S))})},[]);async function m(){if(!(a||c||!e&&!t)){u(!0),r(null);try{n(await gC()),p.current=!1}catch(S){r(S instanceof Error?S.message:String(S))}finally{u(!1)}}}async function x(S){if(S.preventDefault(),!(!s.trim()||a||c||!e&&!t)){o(!0),f(null);try{const b=await mnt(s.trim());p.current=!0,n(b),r(null),i("")}catch(b){f(b instanceof Error?b.message:String(b))}finally{o(!1)}}}return h.jsxs(h.Fragment,{children:[t?h.jsx("div",{className:"error",children:t}):e?h.jsxs(h.Fragment,{children:[h.jsxs("dl",{className:"m-0 flex flex-col gap-3 text-sm",children:[e.username&&h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("dt",{className:"font-medium text-subtext",children:Qw()}),h.jsx("dd",{className:"m-0 text-text",children:e.username})]}),(e.validationStatus==="missing"||e.validationStatus==="invalid"||e.validationStatus==="valid"&&e.jobsWrite!==null)&&h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("dt",{className:"font-medium text-subtext",children:yd()}),h.jsx("dd",{className:"m-0 text-text",children:h.jsx(ebt,{settings:e})})]})]}),e.validationStatus==="unreachable"&&e.validationError&&h.jsx("p",{className:g1,children:e.validationError}),e.source==="env"&&h.jsx("p",{className:Qi,children:bBe()}),e.validationStatus==="valid"&&e.jobsWrite===null&&h.jsx("p",{className:Qi,children:DRe({login:ze("hf auth login"),url:ze("huggingface.co/settings/tokens")})})]}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",g$e()]}),h.jsxs("form",{className:"mt-5 flex flex-col gap-4",onSubmit:x,children:[h.jsxs("label",{className:"flex flex-col gap-2 text-sm font-medium text-subtext",children:[e!=null&&e.configured?ZGe():NLe(),h.jsx(Ts,{type:"password",value:s,onChange:S=>i(S.target.value),placeholder:(e==null?void 0:e.maskedToken)??_Be(),autoComplete:"off"})]}),_&&h.jsx("div",{className:"error",children:_}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsxs($e,{type:"button",disabled:a||c||!e&&!t,onClick:()=>void m(),children:[h.jsx(Ca,{size:13})," ",c?Sa():V_()]}),h.jsx($e,{variant:"primary",type:"submit",disabled:!s.trim()||a||c||!e&&!t,children:a?lA():oo()})]})]})]})}const PD=/^hf_[A-Za-z0-9]{10,}$/;function HD(){return h.jsx("tr",{children:h.jsx("td",{colSpan:3,children:h.jsxs("p",{dir:"auto",className:Qi,children:[wqe()," ",h.jsx("code",{children:"HF_TOKEN"}),pUe()]})})})}const oN=["TINKER_API_KEY","HF_TOKEN","WANDB_API_KEY"];function K2(e,n){const t=n instanceof Error?n.message:String(n);Vn(t.includes(e)?t:`${e}: ${t}`,"error")}function nbt({name:e,entry:n,onVars:t}){const[r,s]=T.useState(""),[i,a]=T.useState(!1);async function o(){if(!(!r.trim()||i)){a(!0);try{t(await EA(e,r.trim())),s("")}catch(u){K2(e,u)}finally{a(!1)}}}async function c(){if(!i){a(!0);try{t(await Cnt(e))}catch(u){K2(e,u)}finally{a(!1)}}}return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{className:"font-mono text-sm",children:e}),h.jsx("td",{className:"text-base text-subtext",children:n?h.jsxs(h.Fragment,{children:[n.maskedValue,n.inProcessEnv&&h.jsx(It,{children:iFe()})]}):h.jsx(Ts,{variant:"inline",className:"text-base",type:"password",value:r,onChange:u=>s(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),o()),u.key==="Escape"&&!i&&s("")},placeholder:rA(),"aria-label":dG({name:ze(e)}),autoComplete:"new-password",disabled:i})}),h.jsx("td",{children:n?h.jsx(Yt,{className:"[&:hover:not(:disabled)]:text-accent-red",title:Iy({name:ze(e)}),"aria-label":Iy({name:ze(e)}),onClick:()=>void c(),disabled:i,children:h.jsx(kd,{size:13})}):r.trim()&&h.jsx($e,{size:"small",onClick:()=>void o(),disabled:i,children:i?na():oo()})})]}),!n&&e!=="HF_TOKEN"&&PD.test(r.trim())&&h.jsx(HD,{})]})}function rbt({onVars:e,onDone:n}){const[t,r]=T.useState(""),[s,i]=T.useState(""),[a,o]=T.useState(!1);async function c(){if(!(!t.trim()||!s.trim()||a)){o(!0);try{e(await EA(t.trim(),s.trim())),n()}catch(_){K2(t.trim(),_)}finally{o(!1)}}}const u=_=>{_.key==="Enter"&&(_.preventDefault(),c()),_.key==="Escape"&&!a&&n()};return h.jsxs(h.Fragment,{children:[h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx(Ts,{autoFocus:!0,variant:"inline",className:"font-mono text-sm",type:"text",value:t,onChange:_=>r(_.target.value),onKeyDown:u,placeholder:"MY_API_KEY","aria-label":fPe(),autoComplete:"off",spellCheck:!1,disabled:a})}),h.jsx("td",{children:h.jsx(Ts,{variant:"inline",className:"text-base",type:"password",value:s,onChange:_=>i(_.target.value),onKeyDown:u,placeholder:rA(),"aria-label":pPe(),autoComplete:"new-password",disabled:a})}),h.jsxs("td",{children:[h.jsx($e,{size:"small",onClick:()=>void c(),disabled:a||!t.trim()||!s.trim(),children:a?na():oo()}),h.jsx(Yt,{title:W_(),"aria-label":iOe(),onClick:n,disabled:a,children:h.jsx(Dr,{size:13})})]})]}),t.trim()!=="HF_TOKEN"&&PD.test(s.trim())&&h.jsx(HD,{})]})}function sbt(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(!1);T.useEffect(()=>{knt().then(n).catch(c=>r(c instanceof Error?c.message:String(c)))},[]);const a=e===null?[]:e.map(c=>c.key).filter(c=>!oN.includes(c)),o=[...oN,...a];return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"mb-4.5 flex items-center justify-between gap-4",children:[h.jsx("p",{className:"m-0 text-base leading-relaxed text-text",children:Zqe()}),h.jsxs($e,{size:"small",className:"shrink-0",onClick:()=>i(!0),disabled:s||e===null,children:[h.jsx(z4,{size:12})," ",wDe()]})]}),h.jsx("div",{className:so,children:t?h.jsx("div",{className:"error",children:t}):e===null?h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]}):h.jsx("table",{className:"env-table w-full table-fixed border-collapse text-base [&_td:first-child]:w-[32%] [&_td:first-child]:wrap-anywhere [&_.badge]:ms-2 [&_td]:h-12 [&_td]:pt-0 [&_td]:pe-2.5 [&_td]:pb-0 [&_td]:ps-0 [&_td]:align-middle [&_td]:border-b [&_td]:border-b-border-variant [&_td:last-child]:w-29 [&_td:last-child]:whitespace-nowrap [&_td:last-child]:text-end [&_td[colspan]]:whitespace-normal [&_td[colspan]]:text-start [&_.icon-btn]:ms-2 [&_.icon-btn]:align-middle",children:h.jsxs("tbody",{children:[o.map(c=>h.jsx(nbt,{name:c,entry:e.find(u=>u.key===c),onVars:n},c)),s&&h.jsx(rbt,{onVars:n,onDone:()=>i(!1)})]})})})]})}const Rh=[{value:"system",label:YVe,icon:Cot},{value:"light",label:GVe,icon:Yot},{value:"dark",label:BVe,icon:Not}],ibt=[{id:"en",label:"English"},{id:"zh-CN",label:"简体中文"},{id:"fa",label:"فارسی"}];function abt(){const e=Du(),[n,t]=PA(),r=s=>{var _;const i=s.key==="ArrowRight"||s.key==="ArrowDown"?1:s.key==="ArrowLeft"||s.key==="ArrowUp"?-1:0;if(!i)return;s.preventDefault();const a=[...s.currentTarget.querySelectorAll('[role="radio"]')],o=a.findIndex(f=>f===document.activeElement),u=((o===-1?Rh.findIndex(f=>f.value===n):o)+i+Rh.length)%Rh.length;t(Rh[u].value),(_=a[u])==null||_.focus()};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:ITe()}),h.jsxs("div",{className:`${so} mt-3`,children:[h.jsxs("div",{className:`${Zo} pb-3.5`,children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:dC()}),h.jsx("div",{className:"theme-segmented inline-flex flex-none gap-0.5 p-0.5 border border-border rounded-md bg-surface",role:"radiogroup","aria-label":dC(),onKeyDown:r,children:Rh.map(({value:s,label:i,icon:a})=>h.jsxs("button",{type:"button",role:"radio","aria-checked":n===s,tabIndex:n===s?0:-1,className:`theme-segment inline-flex items-center gap-1.5 py-[5px] px-2.5 rounded-sm text-subtext text-sm cursor-pointer transition-[background,color] duration-120 ease-standard [&:hover:not(.on)]:text-text [&:hover:not(.on)]:bg-highlight [&.on]:text-background [&.on]:bg-primary [&:focus-visible]:outline-2 [&:focus-visible]:outline-solid [&:focus-visible]:outline-text [&:focus-visible]:outline-offset-2 ${n===s?"on":""}`,onClick:()=>t(s),children:[h.jsx(a,{size:14}),i()]},s))})]}),h.jsxs("div",{className:Zo,children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:CMe()}),h.jsx("div",{className:"w-52 flex-none",children:h.jsx(m_,{choices:ibt,value:e,variant:"field",dropDown:!0,onSelect:s=>{sT(s)&&IA(s)}})})]})]})]})}const obt={installer:Bet,"app-bundle":Eet,cargo:Tet,homebrew:Let,nix:Fet,unknown:Vet},ny={cargo:Xet,homebrew:ett,nix:stt};function lbt(){var _;const{status:e,error:n,apply:t}=M4(),[r,s]=T.useState(null),[i,a]=T.useState(null),o=PR(e),c=r!==null||o.restarting;if(!e)return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:uC()}),n?h.jsx("div",{className:so,children:h.jsx("div",{className:"error",children:n})}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]})]});const u=async(f,p)=>{s(f),a(null);try{await p()}catch(m){a(m instanceof Error?m.message:String(m))}finally{s(null)}};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:uC()}),h.jsxs("div",{className:`${so} mt-3`,children:[h.jsxs("div",{className:`${fd} pb-3.5`,children:[h.jsx("div",{className:"k",children:sA()}),h.jsx("div",{className:"v",children:e.current}),h.jsx("div",{className:"k",children:n$e()}),h.jsx("div",{className:"v",children:e.latest??"—"}),h.jsx("div",{className:"k",children:ZT()}),h.jsx("div",{className:"v",children:obt[e.channel]()})]}),e.restartRequired&&h.jsxs("div",{className:Zo,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:rUe()}),h.jsx("p",{children:o.error?_A({error:o.error}):iVe({installed:ze(e.installedVersion??"—"),current:ze(e.current??e.installedVersion??"—")})})]}),e.canRestart&&h.jsx($e,{size:"small",type:"button",disabled:c,onClick:o.restart,children:o.restarting?pA():hA()})]}),e.selfUpdates?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:Zo,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:oC()}),h.jsxs("p",{children:[oPe(),e.envDisabled&&NWe()]})]}),h.jsx(u4,{type:"button",checked:e.autoUpdate,"aria-label":oC(),disabled:c,onClick:()=>void u("auto",()=>xnt(!e.autoUpdate).then(t))})]}),h.jsxs("div",{className:Zo,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:e.updateAvailable?SWe({version:ze(e.latest??"—")}):KTe()}),h.jsx("p",{children:e.updateAvailable?iMe():aAe()})]}),h.jsx($e,{size:"small",type:"button",disabled:c,onClick:()=>void u("apply",()=>bnt().then(t)),children:r==="apply"?Kw():e.updateAvailable?vWe():QTe()})]})]}):h.jsx("div",{className:Zo,children:h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:KHe()}),h.jsx("p",{children:((_=ny[e.channel])==null?void 0:_.call(ny))??NGe()})]})}),e.channel==="app-bundle"&&h.jsx(ubt,{busy:r,disabled:c,run:u}),i&&h.jsx("div",{className:"error",children:i})]})]})}function cbt(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null);T.useEffect(()=>{irt().then(n).catch(o=>i(o instanceof Error?o.message:String(o)))},[]);const a=()=>{!e||t||(r(!0),i(null),art(!e.preferenceEnabled).then(n).catch(o=>i(o instanceof Error?o.message:String(o))).finally(()=>r(!1)))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:qqe()}),e?h.jsxs("div",{className:`${so} mt-3`,children:[h.jsxs("div",{className:Zo,children:[h.jsxs("div",{children:[h.jsxs("div",{className:"project-default-title inline-flex items-center gap-1.5 text-base font-medium",children:[rC(),e.locked&&e.reason&&h.jsx(f4,{content:`${eIe()} ${e.reason}.`,className:"text-subtext",children:h.jsx(C4,{size:15})})]}),h.jsx("p",{children:vPe()})]}),h.jsx(u4,{type:"button",checked:e.enabled,"aria-label":rC(),disabled:t||e.locked,onClick:a})]}),s&&h.jsx("div",{className:"error",children:s})]}):s?h.jsx("div",{className:"error",children:s}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]})]})}function ubt({busy:e,disabled:n,run:t}){const[r,s]=T.useState(null),[i,a]=T.useState(!1),o=c=>void t("cli",()=>ynt(c).then(u=>{s(u),a(!1)}).catch(u=>{throw a(!c&&String((u==null?void 0:u.message)??u).includes("--force")),u}));return h.jsxs("div",{className:Zo,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:ZRe({command:ze("orx")})}),r?h.jsxs("p",{children:[r.alreadyCurrent?wAe({link:ze(r.link)}):EAe({link:ze(r.link)}),!r.onPath&&MTe({directory:ze(r.dir)})]}):h.jsx("p",{children:WRe({command:ze("orx")})})]}),h.jsx($e,{size:"small",type:"button",disabled:n,onClick:()=>o(i),children:e==="cli"?Kw():i?UGe():r?AGe():URe()})]})}function fbt(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null),a=()=>(i(null),s4().then(n).catch(c=>i(c instanceof Error?c.message:String(c))));T.useEffect(()=>void a(),[]);const o=()=>{if(!e||t)return;const c=!e.githubForNewProjects;r(!0),i(null),MA(c,!0).then(n).catch(u=>i(u instanceof Error?u.message:String(u))).finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:QIe()}),e?h.jsxs("div",{className:`${so} mt-3 project-defaults-card [&_.settings-card-head]:justify-between [&_.settings-card-head]:mb-0 [&_.settings-card-head]:pb-3 [&_.settings-card-head_h3]:m-0`,children:[h.jsxs("div",{className:"settings-card-head flex items-center gap-2.5 mb-3",children:[h.jsx("h3",{children:nBe()}),h.jsx(It,{variant:e.githubAuthenticated?"success":e.ghInstalled?"warning":"error",children:e.githubAuthenticated?FT():VT()})]}),h.jsxs("div",{className:Zo,children:[h.jsxs("div",{children:[h.jsx("div",{className:"project-default-title text-base font-medium",children:aC()}),h.jsx("p",{children:sGe()})]}),h.jsx(u4,{type:"button",checked:e.githubForNewProjects,"aria-label":aC(),disabled:t||!e.githubAuthenticated&&!e.githubForNewProjects,onClick:o})]}),!e.githubAuthenticated&&h.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:h.jsx(FD,{ghInstalled:e.ghInstalled,onCheck:a})}),s&&h.jsx("div",{className:"error",children:s})]}):s?h.jsx("div",{className:"error",children:s}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]})]})}function FD({ghInstalled:e,onCheck:n}){const[t,r]=T.useState(!1),s=()=>{r(!0),n().finally(()=>r(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper m-0 text-sm leading-relaxed text-text",children:Z_(e?cVe():tMe())}),h.jsxs("div",{className:"flex flex-wrap gap-2 mt-2.5",children:[!e&&h.jsxs(c_,{variant:"primary",href:"https://cli.github.com/",target:"_blank",rel:"noreferrer",children:[MBe()," ",h.jsx(ku,{size:12})]}),h.jsx($e,{type:"button",variant:e?"warning":"default",disabled:t,onClick:s,children:t?Sa():V_()})]})]})}function dbt(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null);return T.useEffect(()=>{lnt().then(a=>n(a.hasToken)).catch(a=>i(a instanceof Error?a.message:String(a)))},[]),h.jsxs("div",{className:V2,children:[h.jsx("h3",{children:eA()}),h.jsxs("div",{className:fd,children:[h.jsx("span",{className:"k",children:aBe()}),h.jsx("span",{className:"v",children:h.jsx(It,{variant:e?"success":"default",children:e===null?s?rc():Sa():e?hVe():JLe()})})]}),h.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:lGe()}),e?h.jsx("div",{className:Cm,children:h.jsx($e,{disabled:t,onClick:()=>{r(!0),i(null),cnt().then(a=>n(a.hasToken)).catch(a=>i(a instanceof Error?a.message:String(a))).finally(()=>r(!1))},children:t?$Ge():DGe()})}):h.jsx(z1t,{save:SA,onSaved:a=>n(a.hasToken),placeholder:tFe(),createHref:"https://www.overleaf.com/user/settings"}),s&&h.jsx("div",{className:"error",children:s})]})}function hbt({project:e,onProjectUpdate:n}){const[t,r]=T.useState(null),[s,i]=T.useState(!1),[a,o]=T.useState(null),[c,u]=T.useState(!1),[_,f]=T.useState(!1),[p,m]=T.useState(null),x=T.useRef(0),S=!!(t!=null&&t.github.owner&&t.github.repo),b=(C=!0)=>{const z=++x.current;return C&&r(null),o(null),e?trt(e.id).then(E=>{z===x.current&&r(E)}).catch(E=>{z===x.current&&o(E instanceof Error?E.message:String(E))}):Promise.resolve()};T.useEffect(()=>void b(),[e==null?void 0:e.id]);const v=C=>{const z=C instanceof Error?C.message:String(C);return z.toLowerCase().includes("archived")?pRe():z.includes("(fetch first)")||z.includes("non-fast-forward")?vRe():z.includes("403")||z.toLowerCase().includes("permission denied")?SRe():z},y=()=>{e&&(i(!0),o(null),rrt(e.id).then(C=>{r(C.git),n(C.project),s4().then(z=>{!z.githubForNewProjects&&!z.githubDefaultPromptSeen&&u(!0)}).catch(()=>{})}).catch(C=>o(v(C))).finally(()=>i(!1)))},w=C=>{f(!0),m(null),MA(C,!0).then(()=>u(!1)).catch(z=>m(z instanceof Error?z.message:String(z))).finally(()=>f(!1))};return h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:JFe()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-base leading-relaxed text-text",children:tVe({project:(e==null?void 0:e.name)??WAe()})}),e?a&&!t?h.jsx("div",{className:"error",children:a}):t?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:V2,children:[h.jsx("h3",{children:C$e()}),h.jsxs("div",{className:fd,children:[h.jsx("span",{className:"k",children:hFe()}),h.jsx("span",{className:"v",children:t.path}),h.jsx("span",{className:"k",children:"Git"}),h.jsx("span",{className:"v",children:t.gitVersion??AT()}),h.jsx("span",{className:"k",children:IUe()}),h.jsx("span",{className:"v",children:t.initialized?fRe({branch:ze(t.currentBranch??qT()),state:t.clean?bAe():ARe()}):YLe()}),h.jsx("span",{className:"k",children:KDe()}),h.jsx("span",{className:"v",children:t.baselineBranch}),h.jsx("span",{className:"k",children:YFe()}),h.jsx("span",{className:"v",children:t.remotes.length?t.remotes.map(C=>`${C.name}: ${C.url}`).join(" · "):Zw()})]}),!t.initialized&&h.jsx("div",{className:Cm,children:h.jsx($e,{variant:"primary",onClick:()=>void nrt(e.id).then(r).catch(C=>o(String(C))),children:wBe()})})]}),h.jsxs("div",{className:V2,children:[h.jsx("h3",{children:"GitHub"}),h.jsxs("div",{className:fd,children:[h.jsx("span",{className:"k",children:IDe()}),h.jsx("span",{className:"v",children:h.jsx(It,{variant:t.github.authenticated?"success":t.github.ghInstalled?"warning":"error",children:t.github.authenticated?FT():VT()})}),h.jsx("span",{className:"k",children:yFe()}),h.jsx("span",{className:"v",children:S?h.jsxs(h.Fragment,{children:[h.jsxs("span",{children:[t.github.owner,"/",t.github.repo]}),!t.github.enabled&&h.jsx(It,{children:QUe()})]}):h.jsx(It,{children:y$e()})}),t.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"k",children:KUe()}),h.jsx("span",{className:"v",children:t.github.syncStatus})]})]}),!t.github.authenticated&&h.jsx("div",{className:"mt-3.5 pt-3.5 border-t border-t-border-variant",children:h.jsx(FD,{ghInstalled:t.github.ghInstalled,onCheck:()=>b(!1)})}),t.github.authenticated&&!t.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:S?DWe():UAe()}),h.jsxs("div",{className:Cm,children:[S&&t.github.url&&h.jsxs(c_,{href:t.github.url,target:"_blank",rel:"noreferrer",children:[cC()," ",h.jsx(ku,{size:12})]}),h.jsx($e,{variant:"primary",disabled:s,onClick:y,children:s?Oje():Rje()})]})]}),t.github.enabled&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"git-card-helper mt-3.5 mx-0 mb-0 text-sm leading-relaxed text-text",children:DIe()}),h.jsxs("div",{className:Cm,children:[t.github.url&&h.jsxs(c_,{href:t.github.url,target:"_blank",rel:"noreferrer",children:[cC()," ",h.jsx(ku,{size:12})]}),h.jsx($e,{disabled:s,onClick:()=>{i(!0),srt(e.id).then(C=>{r(C.git),n(C.project)}).catch(C=>o(C instanceof Error?C.message:String(C))).finally(()=>i(!1))},children:s?Pje():zje()})]})]})]}),h.jsx(dbt,{}),a&&h.jsx("div",{className:"error",children:v(a)})]}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]}):h.jsx("div",{className:so,children:h.jsx("p",{className:Qi,children:EHe()})}),c&&h.jsx("div",{className:"modal-backdrop fixed inset-0 bg-modal-backdrop-light flex items-start justify-center pt-[var(--modal-top)] px-4 pb-6 overflow-y-auto z-100",onClick:()=>w(!1),children:h.jsxs("div",{className:"modal max-w-[94vw] max-h-[calc(100vh_-_var(--modal-top)_-_48px)] overflow-y-auto bg-background border border-border rounded-xl shadow-modal p-6 [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-xl github-default-modal w-110 [&_>_p]:m-0 [&_>_p]:text-sm [&_>_p]:leading-relaxed [&_>_p]:text-text [&_>_.error]:mt-3.5",role:"dialog","aria-modal":"true","aria-labelledby":"github-default-title",onClick:C=>C.stopPropagation(),children:[h.jsx("h2",{id:"github-default-title",children:M$e()}),h.jsx("p",{children:_qe()}),p&&h.jsx("div",{className:"error",children:p}),h.jsxs("div",{className:"github-default-actions flex justify-end gap-2.5 mt-5.5",children:[h.jsx($e,{disabled:_,onClick:()=>w(!1),children:oHe()}),h.jsx($e,{variant:"primary",disabled:_,onClick:()=>w(!0),children:_?na():MMe()})]})]})})]})}const _bt={env:AZe,config:DZe,xdg:$Ze,default:NZe},ry={preparing:vZe,copying:YXe,verifying:UZe,finalizing:JXe},pbt=e=>{var n;return((n=ry[e])==null?void 0:n.call(ry))??e};function mbt(){const[e,n]=T.useState(null),[t,r]=T.useState(null),[s,i]=T.useState(""),[a,o]=T.useState(!1),[c,u]=T.useState(null),[_,f]=T.useState({kind:"idle"}),[p,m]=T.useState(null),x=()=>Ent().then(C=>{n(C),i(z=>z||C.current)}).catch(C=>r(C instanceof Error?C.message:String(C)));T.useEffect(()=>{x()},[]),T.useEffect(()=>Xit(C=>{C.type==="progress"?f(z=>{const E=z.kind==="moving"?z.total:0;return{kind:"moving",phase:C.phase,copied:C.copiedBytes,total:C.totalBytes||E}}):C.type==="done"?(f({kind:"done",oldPathLeft:C.oldPathLeft}),u(null),i(""),x()):C.type==="error"&&f({kind:"error",message:C.error})}),[]);const S=(e==null?void 0:e.source)==="env",b=s.trim(),v=e!==null&&b===e.current;async function y(){if(!(a||!b)){o(!0),m(null),u(null);try{u(await Nnt(b))}catch(C){m(C instanceof Error?C.message:String(C))}finally{o(!1)}}}async function w(C){if(C.preventDefault(),!(_.kind==="moving"||!b||v)&&(m(null),!!window.confirm(oZe({path:ze(b)})))){f({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await znt(b)}catch(z){f({kind:"idle"}),m(z instanceof Error?z.message:String(z))}}}return h.jsxs(h.Fragment,{children:[h.jsx("h2",{children:qUe()}),h.jsx("p",{className:"settings-sub mt-0 mx-0 mb-4.5 text-sm leading-relaxed text-subtext",children:AVe()}),t?h.jsx("div",{className:so,children:h.jsx("div",{className:"error",children:t})}):e?h.jsxs("div",{className:so,children:[h.jsx("div",{className:"settings-card-head mb-3",children:h.jsx("h3",{children:dIe()})}),h.jsxs("div",{className:fd,children:[h.jsx("span",{className:"k",children:XOe()}),h.jsx("span",{className:"v",children:e.current}),h.jsx("span",{className:"k",children:nA()}),h.jsx("span",{className:"v",children:_bt[e.source]()})]}),!S&&h.jsxs("form",{className:X5,onSubmit:w,children:[h.jsxs("label",{children:[rPe(),h.jsx("input",{className:"text-sm",type:"text",value:s,onChange:C=>{i(C.target.value),u(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:_.kind==="moving"})]}),c&&!c.error&&c.ok&&h.jsxs("p",{className:Qi,children:[$Fe()," ",Yo(c.treeBytes??0),c.freeBytes!=null&&` — ${rZe({size:ze(Yo(c.freeBytes))})}`,c.sameFilesystem?SZe():"","."]}),c&&c.ok===!1&&c.error&&h.jsx("div",{className:"error",children:c.error}),p&&h.jsx("div",{className:"error",children:p}),_.kind==="moving"&&h.jsx(jD,{value:_.copied,max:_.total,label:pbt(_.phase),caption:_.total>0?h.jsxs("span",{className:"text-sm",children:[Yo(_.copied)," / ",Yo(_.total)]}):void 0}),_.kind==="done"&&h.jsxs("p",{className:Qi,children:[Y$e(),_.oldPathLeft&&h.jsxs(h.Fragment,{children:[" ",oDe({path:ze(_.oldPathLeft)})]})]}),_.kind==="error"&&h.jsxs("div",{className:"error",children:[G$e()," ",_.message]}),h.jsxs("div",{className:"actions",children:[h.jsx($e,{type:"button",onClick:y,disabled:a||!b||v||_.kind==="moving",children:a?Sa():HTe()}),h.jsx($e,{variant:"primary",type:"submit",disabled:!b||v||_.kind==="moving",children:_.kind==="moving"?pZe():fZe()})]})]})]}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]})]})}const Y2=e=>e==="running"||e==="starting";function gbt(e){return Y2(e.status)?Xm(Date.now()-e.createdAt):e.endedAt?Xm(e.endedAt-e.createdAt):"—"}function UD({instances:e,emptyLabel:n}){return e.length===0?h.jsx("p",{className:"instances-empty m-0 rounded-lg border border-border bg-background py-3.5 px-4 text-base text-subtext",children:n}):h.jsx("div",{className:"instances-table-wrap overflow-x-auto",children:h.jsxs("table",{className:"runs-table w-full border-collapse bg-background text-base [&_th]:text-start [&_th]:text-text [&_th]:text-sm [&_th]:font-medium [&_th]:py-2 [&_th]:px-3 [&_th]:border-b [&_th]:border-b-border [&_th]:sticky [&_th]:top-0 [&_th]:bg-background [&_th]:z-1 [&_td]:py-2 [&_td]:px-3 [&_td]:border-b [&_td]:border-b-divider-faint [&_td]:whitespace-nowrap [&_tr:last-child_td]:border-b-0 [&_tr.clickable]:cursor-pointer [&_tr.clickable:hover_td]:bg-canvas",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:qDe()}),h.jsx("th",{children:yd()}),h.jsx("th",{children:MUe()}),h.jsx("th",{children:fUe()})]})}),h.jsx("tbody",{children:e.map(t=>{var s;const r=typeof((s=t.backend)==null?void 0:s.url)=="string"?t.backend.url:void 0;return h.jsxs("tr",{children:[h.jsx("td",{children:h.jsxs("span",{className:"backend-cell inline-flex items-center gap-0.5",children:[h.jsx(R4,{backend:t.backend}),r&&h.jsx(Pg,{size:"small",href:r,target:"_blank",rel:"noreferrer",title:lC(),"aria-label":lC(),onClick:i=>i.stopPropagation(),children:h.jsx(ku,{size:12})})]})}),h.jsx("td",{children:h.jsx(tl,{status:ea(t)})}),h.jsx("td",{children:no(t.createdAt)}),h.jsx("td",{children:gbt(t)})]},t.id)})})]})})}function bbt({projectId:e,onViewHistory:n}){const[t,r]=T.useState(null),[s,i]=T.useState(null),[a,o]=T.useState(!1),[,c]=T.useState(0);T.useEffect(()=>{const m=setInterval(()=>c(x=>x+1),3e4);return()=>clearInterval(m)},[]);const u=()=>{if(!e){r([]);return}o(!0),r4(e).then(m=>{r(m),i(null)}).catch(m=>{i(m instanceof Error?m.message:String(m)),r(x=>x??[])}).finally(()=>o(!1))};T.useEffect(()=>u(),[e]);const _=(m,x)=>x.createdAt-m.createdAt,f=t==null?void 0:t.filter(m=>Y2(m.status)).sort(_),p=t==null?void 0:t.filter(m=>!Y2(m.status)).sort(_);return h.jsxs("section",{className:"compute-activity [&_.count-badge]:inline-flex [&_.count-badge]:items-center [&_.count-badge]:justify-center [&_.count-badge]:min-w-4.5 [&_.count-badge]:h-4.5 [&_.count-badge]:py-0 [&_.count-badge]:px-[5px] [&_.count-badge]:rounded-md [&_.count-badge]:bg-canvas [&_.count-badge]:border [&_.count-badge]:border-border [&_.count-badge]:text-xs [&_.count-badge]:font-medium [&_.count-badge]:text-text mt-5.5 mx-0 mb-8",children:[h.jsxs("div",{className:"compute-activity-head flex items-start justify-between gap-5 mb-3.5 [&_h2]:flex [&_h2]:items-center [&_h2]:gap-2 [&_h2]:m-0 [&_h2]:text-lg [@media((max-width:_640px))]:items-stretch [@media((max-width:_640px))]:flex-col",children:[h.jsx("div",{children:h.jsxs("h2",{children:[oUe(),f&&f.length>0&&h.jsx("span",{className:"count-badge",children:f.length})]})}),h.jsxs("div",{className:"compute-activity-actions flex gap-2 flex-none [@media((max-width:_640px))]:justify-start",children:[h.jsxs($e,{size:"small",onClick:u,disabled:a,children:[h.jsx(Ca,{size:12,className:a?"animate-[spin_0.9s_linear_infinite]":""})," ",Y_()]}),h.jsx($e,{size:"small",onClick:n,children:p!=null&&p.length?Wve({count:Xt(p.length)}):Uve()})]})]}),s&&h.jsx("div",{className:"error",children:s}),!f||!p?h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]}):h.jsx(UD,{instances:f,emptyLabel:e?Ave():$ve()})]})}function vbt({projectId:e,onBack:n}){const[t,r]=T.useState(null),[s,i]=T.useState(null),[a,o]=T.useState(!1),[,c]=T.useState(0);T.useEffect(()=>{const _=setInterval(()=>c(f=>f+1),3e4);return()=>clearInterval(_)},[]);const u=()=>{if(!e){r([]);return}o(!0),r4(e).then(_=>{r(_.sort((f,p)=>p.createdAt-f.createdAt)),i(null)}).catch(_=>{i(_ instanceof Error?_.message:String(_)),r(f=>f??[])}).finally(()=>o(!1))};return T.useEffect(u,[e]),h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",className:"settings-back inline-flex items-center gap-1.5 mt-0 mx-0 mb-4.5 text-subtext text-sm font-medium [&:hover]:text-text",onClick:n,children:[h.jsx(d_,{size:14})," ",WT()]}),h.jsxs("div",{className:"settings-head-row flex items-center justify-between gap-2.5 [&_h1]:m-0",children:[h.jsx("h1",{children:PBe()}),h.jsxs($e,{size:"small",onClick:u,disabled:a,children:[h.jsx(Ca,{size:12,className:a?"animate-[spin_0.9s_linear_infinite]":""})," ",Y_()]})]}),s&&h.jsx("div",{className:"error",children:s}),t?h.jsx(UD,{instances:t,emptyLabel:e?Nve():Dve()}):h.jsxs(Br,{children:[h.jsx(Ot,{})," ",vc()]})]})}const qD=["projects","harnesses","storage"],xbt=[{id:"compute",label:KT,icon:h.jsx(Uat,{size:15}),activeTabs:["compute","instances"]},{id:"environment",label:XT,icon:h.jsx(Sd,{size:15}),activeTabs:["environment"]},{id:"settings",label:t4,icon:h.jsx(MR,{size:15}),activeTabs:["settings",...qD]}];function ybt(e){return qD.includes(e)}function wbt({tab:e,project:n,onProjectUpdate:t,onSelectTab:r,remote:s=!1}){const i=e==="settings"||ybt(e),a=T.useRef(null);return T.useLayoutEffect(()=>{const o=a.current,c=o==null?void 0:o.parentElement;if(!o||!c)return;const u=()=>o.scrollIntoView({block:"start"}),_=new ResizeObserver(u);_.observe(c),u();const f=()=>_.disconnect(),p=["wheel","touchstart","pointerdown","keydown"];for(const m of p)window.addEventListener(m,f,{passive:!0});return()=>{f();for(const m of p)window.removeEventListener(m,f)}},[e,n==null?void 0:n.id]),h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl [&_>_.error]:text-accent-red [&_>_.error]:text-base [&_>_.error]:whitespace-pre-wrap [&_>_.error]:mt-0 [&_>_.error]:mx-0 [&_>_.error]:mb-3",children:[i&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:t4()}),h.jsxs("div",{className:"settings-stack mt-4.5",children:[h.jsx("section",{className:Cf,children:h.jsx(abt,{})}),h.jsx("section",{ref:e==="projects"?a:void 0,className:Cf,children:h.jsx(fbt,{})}),h.jsx("section",{ref:e==="harnesses"?a:void 0,className:Cf,children:h.jsx(M1t,{})}),!s&&h.jsx("section",{ref:e==="storage"?a:void 0,className:Cf,children:h.jsx(mbt,{})}),h.jsx("section",{className:Cf,children:h.jsx(cbt,{})}),!s&&h.jsx("section",{className:Cf,children:h.jsx(lbt,{})})]})]}),e==="compute"&&h.jsx(Q1t,{project:n,onViewHistory:()=>r("instances"),onOpenEnvironment:()=>r("environment"),remote:s}),e==="instances"&&h.jsx(vbt,{projectId:n==null?void 0:n.id,onBack:()=>r("compute")}),e==="environment"&&h.jsxs(h.Fragment,{children:[h.jsx("h1",{children:XT()}),h.jsx(sbt,{})]}),e==="git"&&h.jsx(hbt,{project:n,onProjectUpdate:t})]})}function Sbt({skills:e,activeIndex:n,onPick:t,onHover:r}){return h.jsx("div",{className:"skill-menu absolute bottom-[calc(100%_+_8px)] start-0 min-w-85 max-w-full p-1.5 bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden",children:e.map((s,i)=>h.jsxs("button",{type:"button",className:`skill-item flex flex-col gap-0.5 w-full text-start py-[7px] px-2 rounded-sm [&.active]:bg-surface [&_.skill-name]:text-sm [&_.skill-desc]:text-sm [&_.skill-desc]:text-subtext ${i===n?"active":""}`,onMouseDown:a=>{a.preventDefault(),t(s)},onMouseEnter:()=>r(i),children:[h.jsxs("span",{className:"skill-name flex items-center gap-1.5",children:["/",s.name,s.source!=="command"&&h.jsx(It,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:cA()})]}),h.jsx("span",{className:"skill-desc",children:s.description})]},s.name))})}const lN={name:"plan",get description(){return G7e()},source:"command"};function sy(e,n){if(n<0||n>e.length)return null;let t=n;for(;t>0&&!/\s/.test(e[t-1]);)t-=1;if(e[t]!=="/")return null;let r=n;for(;r1&&/[ \t]$/.test(i)&&(i=i.replace(/[ \t]+$/,_=>_.includes(" ")||_.length>=r?_:s));let a=e.slice(n.end);if(!a)a=s;else if(!a.startsWith(` +`)){const _=(c=/^[ \t]+/.exec(a))==null?void 0:c[0];a=_?`${_.length>=r?_:s}${a.slice(_.length)}`:s+a}const o=((u=/^[ \t]+/.exec(a))==null?void 0:u[0].length)??0;return{text:`${i}/${t}${a}`,cursor:i.length+t.length+1+o}}function uN(e,n){let t=e.slice(0,n.start),r=e.slice(n.end);return t?r?/\s$/.test(t)&&/^\s/.test(r)&&(r=r.slice(1)):t=t.replace(/\s$/,""):r=r.replace(/^\s/,""),{text:t+r,cursor:t.length}}function Cbt(e,n){const t=e.filter(r=>r.name.toLowerCase()!==lN.name);return n?[lN,...t]:t}function Ebt(e,n){if(!n)return null;const t=/(^|\s)\/plan(?=\s|$)/gi;return t.test(e)?{prompt:e.replace(t,"").trim()}:null}function fN(e,n,t){if(e==="command")return n!==void 0?n:t??void 0}const Nbt=["font-family","font-size","font-weight","font-style","font-variant","line-height","letter-spacing","word-spacing","text-transform","direction","unicode-bidi","tab-size","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width"],iy=new Map;function zbt(e,n){const t=`${n}\0${e}`,r=iy.get(t);if(r)return r;const s=lrt(e,n).catch(i=>{throw iy.delete(t),i});return iy.set(t,s),s}function GD(e,n,t,r,s,i=!1){let a=0;return kbt(e,n).map((o,c)=>{const u=a+o.text.length;a=u;const _=o.text.slice(1).toLowerCase();return o.command&&s?s(o.text,_,u,c):o.command?h.jsxs("span",{className:t,onMouseDown:void 0,children:[h.jsx("span",{className:"text-skill-blue-slash",children:"/"}),o.text.slice(1)]},c):i?h.jsx("span",{"aria-hidden":"true",children:o.text},c):h.jsx(T.Fragment,{children:o.text},c)})}function jbt({label:e,name:n,end:t,skill:r,projectId:s,textareaRef:i}){const a=T.useRef(null),o=T.useRef(null),c=T.useRef(null),u=T.useId(),[_,f]=T.useState(!1),[p,m]=T.useState(null),[x,S]=T.useState(!1),[b,v]=T.useState({}),y=()=>{c.current!==null&&window.clearTimeout(c.current),c.current=null},w=()=>{const E=a.current;if(!E)return;const R=E.getBoundingClientRect(),N=Math.min(420,window.innerWidth-32),M=Math.max(16,Math.min(R.left-4,window.innerWidth-N-16));v(R.top>300?{bottom:window.innerHeight-R.top+12,left:M,width:N}:{left:M,top:R.bottom+12,width:N})},C=()=>{y(),w(),f(!0),!(p!==null||x)&&(S(!0),zbt(n,s).then(m).catch(()=>m(null)).finally(()=>S(!1)))},z=()=>{y(),c.current=window.setTimeout(()=>f(!1),120)};return T.useEffect(()=>()=>y(),[]),T.useEffect(()=>{if(!_)return;const E=()=>w();return window.addEventListener("resize",E),window.addEventListener("scroll",E,!0),()=>{window.removeEventListener("resize",E),window.removeEventListener("scroll",E,!0)}},[_]),h.jsxs(T.Fragment,{children:[h.jsxs("span",{ref:a,role:"button",tabIndex:0,"aria-controls":u,"aria-expanded":_,"aria-label":Tq({name:n}),className:"composer-chip group/skill pointer-events-auto relative z-1 cursor-text rounded-md bg-background text-skill-blue",onMouseEnter:C,onMouseLeave:z,onFocus:C,onBlur:z,onKeyDown:E=>{var R,N;if(E.key==="Escape"){f(!1);return}if(E.key==="Enter"||E.key===" "){E.preventDefault(),C();return}_&&(E.key==="ArrowDown"||E.key==="PageDown")&&(E.preventDefault(),(R=o.current)==null||R.scrollBy({top:E.key==="PageDown"?240:48,behavior:"smooth"})),_&&(E.key==="ArrowUp"||E.key==="PageUp")&&(E.preventDefault(),(N=o.current)==null||N.scrollBy({top:E.key==="PageUp"?-240:-48,behavior:"smooth"}))},onMouseDown:E=>{var R,N;E.preventDefault(),(R=i.current)==null||R.focus(),(N=i.current)==null||N.setSelectionRange(t,t),y()},children:[h.jsx("span",{className:"pointer-events-none absolute -inset-[7px] z-0 rounded-md bg-skill-blue-subtle opacity-0 transition-opacity group-hover/skill:opacity-100"}),h.jsxs("span",{className:"relative z-1",children:[h.jsx("span",{className:"text-skill-blue-slash",children:"/"}),e.slice(1)]})]}),_&&al.createPortal(h.jsxs("div",{id:u,ref:o,role:"dialog","aria-label":lG({name:n}),style:{...b,maxHeight:"min(28rem, calc(100vh - 2rem))"},className:"fixed z-100 overflow-y-auto rounded-lg border border-border bg-background shadow-floating",onMouseEnter:y,onMouseLeave:z,onFocus:y,onBlur:z,onMouseDown:E=>E.stopPropagation(),children:[h.jsxs("div",{className:"sticky top-0 z-1 flex items-center gap-2 border-b border-border-variant bg-background px-4 py-3",children:[h.jsxs("span",{className:"text-sm font-medium text-muted",children:["/",n]}),h.jsx(It,{className:"h-5 border-border-variant bg-canvas px-1.5 tracking-[0.05em]",children:cA()})]}),h.jsx("div",{className:"p-4 text-sm text-text",children:x&&p===null?h.jsx("span",{className:"text-muted",children:YWe()}):h.jsx(ro,{text:p??r.description})})]}),document.body)]})}function Tbt({text:e,isCommand:n}){return h.jsx(h.Fragment,{children:GD(e,n,"skill-chip mx-1 inline-flex items-center rounded-md px-2 py-1 font-medium text-skill-blue transition-colors hover:bg-skill-blue-subtle")})}function Abt({text:e,isCommand:n,skills:t,projectId:r,textareaRef:s}){const i=T.useRef(null);return T.useLayoutEffect(()=>{const a=s.current,o=i.current;if(!a||!o)return;const c=()=>{const _=getComputedStyle(a);for(const f of Nbt)o.style.setProperty(f,_.getPropertyValue(f));o.style.width=`${a.clientWidth+parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth)}px`};c();const u=new ResizeObserver(c);return u.observe(a),()=>u.disconnect()},[e,s]),T.useLayoutEffect(()=>{const a=s.current;if(!a)return;const o=()=>{i.current&&(i.current.scrollTop=a.scrollTop)};return o(),a.addEventListener("scroll",o),()=>a.removeEventListener("scroll",o)},[s,e]),h.jsxs("div",{ref:i,className:"composer-chips pointer-events-none absolute inset-y-0 start-0 z-2 box-border overflow-hidden whitespace-pre-wrap break-words border-solid border-transparent text-transparent select-none",children:[GD(e,n,"",void 0,(a,o,c,u)=>{const _=t.find(f=>f.name===o);return _&&_.source!=="command"?h.jsx(jbt,{label:a,name:o,end:c,skill:_,projectId:r,textareaRef:s},`${u}:${c}`):h.jsxs("span",{"aria-hidden":"true",className:"bg-background text-skill-blue",children:[h.jsx("span",{className:"text-skill-blue-slash",children:"/"}),a.slice(1)]},`${u}:${c}`)},!0),"​"]})}function Rbt(e){return e>=95?"var(--accent-red)":e>=80?"var(--accent-amber)":"var(--accent)"}const X2=6.5,dN=2*Math.PI*X2;function Mbt({usage:e}){return!e||e.usedTokens<=0?null:h.jsx(Lbt,{usage:e})}function Lbt({usage:e}){const{open:n,setOpen:t,ref:r}=Ea(),{usedTokens:s,contextWindow:i}=e,a=i&&i>0?Math.min(100,Math.round(s/i*100)):null,o=a===null?"var(--accent)":Rbt(a),c=a===null?"":new Intl.NumberFormat(j(),{style:"percent"}).format(a/100);return h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:r,children:[h.jsx("button",{type:"button",className:`${a===null?"inline-flex h-8 items-center rounded-md px-1 transition-[background,color] duration-150 ease-standard hover:bg-surface":"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-text transition-[background,color] duration-150 ease-standard hover:bg-surface"} composer-bare context-ring text-sm text-text`,title:rhe(),onClick:()=>t(u=>!u),children:a===null?kp(s):h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:X2,fill:"none",stroke:"var(--border)",strokeWidth:"2.5"}),h.jsx("circle",{cx:"8",cy:"8",r:X2,fill:"none",stroke:o,strokeWidth:"2.5",strokeLinecap:"round",strokeDasharray:`${dN*Math.max(a,2)/100} ${dN}`,transform:"rotate(-90 8 8)"})]})}),n&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 align-right context-meter-menu w-70 pt-2.5 px-3 pb-3 [&_.progress]:mt-2 [&_.progress]:mx-0 [&_.progress]:mb-0 [&_.progress-track]:h-[5px] [&_.progress-track]:border-0 [&_.progress-track]:bg-border",children:[h.jsxs("div",{className:"context-meter-head flex justify-between items-baseline gap-3 text-sm text-muted",children:[h.jsx("span",{children:Jde()}),h.jsx("span",{className:"context-meter-value text-text tabular-nums",children:a===null?ohe({value:ze(kp(s))}):fhe({used:ze(kp(s)),total:ze(kp(i)),percent:ze(c)})})]}),a!==null&&h.jsx(jD,{value:s,max:i,fillColor:o})]})]})}const hg="!";function hN(e){return e.startsWith(hg)?e.slice(hg.length).trim():null}function Dbt(e){return e.startsWith(hg)?e.slice(hg.length):e}function Obt(e){return e.replace(/([\\`*_[\]<>$~])/g,"\\$1").replace(/(^|\n)(\s*)(#{1,6}|>|[-+]|\d+\.)\s/g,"$1$2\\$3 ").replace(/(^|\n)(\s*)(=+|-{1,2})(?=\s*(?:\n|$))/g,"$1$2\\$3").replace(/(^|\n)(\s*)(-{3,})(?=\s*(?:\n|$))/g,"$1$2\\$3")}function Ibt(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),s=>s[0].length)),t="`".repeat(n+1),r=/^[\s`]|[\s`]$/.test(e)?` ${e} `:e;return`${t}${r}${t}`}function Bbt(e){const n=Math.max(0,...Array.from(e.matchAll(/`+/g),r=>r[0].length)),t="`".repeat(Math.max(3,n+1));return` + +${t} +${e.replace(/^\n|\n$/g,"")} +${t} + +`}function Z2(e,n){return n?` + +\\[ +${e} +\\] + +`:`\\(${e}\\)`}function $bt(e,n){const t=n.trim().split(` +`),r=" ".repeat(e.length+1);return[`${e} ${t[0]??""}`,...t.slice(1).map(s=>s?`${r}${s}`:"")].join(` +`)}function Pbt(e,n){if(e.length===0)return"";const t=Math.max(...e.map(a=>a.length)),r=a=>`| ${Array.from({length:t},(o,c)=>a[c]??"").join(" | ")} |`,s=n?e[0]:Array.from({length:t},()=>""),i=n?e.slice(1):e;return[r(s),r(Array.from({length:t},()=>"---")),...i.map(r)].join(` +`)}function Hbt(e,n){const t=Number(e.slice(1));return Number.isInteger(t)&&t>=1&&t<=6?`${"#".repeat(t)} ${n.trim()}`:void 0}function Fbt(e){return!e.includes("\\(")&&!e.includes("\\[")&&!e.includes("$$")}function Ubt(e,n){return Math.min(e.length,n.length)/Math.max(e.length,n.length)>=.8&&(e.includes(n)||n.includes(e))}const VD="tool-line flex-1 min-w-0 line-clamp-2 break-words text-base leading-6",Z5="tool-output py-1.5 px-2.5 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere max-h-65 overflow-y-auto bg-background border border-border-variant rounded-sm",pc=256,WD=1024,KD=2e4,ay=8,Gp="chat-annotations";function fu(e){return e instanceof Element?e:e.parentElement}function _N(e){const n=document.createRange();return n.setStart(e.container,e.offset),n.collapse(!0),n}function oy(e,n){return _N(e).compareBoundaryPoints(Range.START_TO_START,_N(n))<0}function pN(e,n){const t=document.createRange();return t.setStart(e.container,e.offset),t.setEnd(n.container,n.offset),t.cloneContents()}const qbt=new Set(["A","B","CODE","EM","I","STRONG"]);function Gbt(e,n){var s,i;const t=fu(e.endContainer);if(Array.from(n.childNodes).every(a=>a.nodeType===Node.TEXT_NODE)){let a=fu(e.startContainer);for(;a&&a.matches(".md *")&&a.contains(t);){if(qbt.has(a.tagName)){const o=a.cloneNode(!1);o instanceof HTMLElement&&(o.replaceChildren(...Array.from(n.childNodes)),n.replaceChildren(o))}a=a.parentElement}}const r=(s=fu(e.startContainer))==null?void 0:s.closest("pre");if(r!=null&&r.contains(t)){const a=(i=r.querySelector("code"))==null?void 0:i.cloneNode(!1),o=r.cloneNode(!1);o instanceof HTMLElement&&a instanceof HTMLElement&&(a.replaceChildren(...Array.from(n.childNodes)),o.replaceChildren(a),n.replaceChildren(o))}}function Vbt(e){e.querySelectorAll("button").forEach(n=>{n.replaceWith(document.createTextNode(n.textContent??""))}),e.querySelectorAll("script, style, iframe, object, embed, input, textarea, select").forEach(n=>n.remove()),e.querySelectorAll("*").forEach(n=>{for(const t of Array.from(n.attributes))(t.name.toLowerCase().startsWith("on")||t.name==="contenteditable"||t.name==="tabindex")&&n.removeAttribute(t.name)})}function Wbt(e,n){const t=document.createElement("div"),r={container:e.endContainer,offset:e.endOffset};let s={container:e.startContainer,offset:e.startOffset};const i=Array.from(n.querySelectorAll(".katex")).filter(a=>e.intersectsNode(a));for(const a of i){const o=a.closest(".katex-display")??a,c=document.createRange();c.selectNode(o);const u={container:c.startContainer,offset:c.startOffset},_={container:c.endContainer,offset:c.endOffset};if(oy(s,u)&&t.append(pN(s,u)),t.append(o.cloneNode(!0)),s=_,!oy(s,r))break}return i.length===0?t.append(e.cloneContents()):oy(s,r)&&t.append(pN(s,r)),Gbt(e,t),Vbt(t),t}function Kbt(e){const n=Array.from(e.querySelectorAll("tr")).map(t=>Array.from(t.querySelectorAll(":scope > th, :scope > td")).map(r=>k_(r).trim().replaceAll("|","\\|"))).filter(t=>t.length>0);return n.length>0?` + +${Pbt(n,!!e.querySelector("tr:first-child th"))} + +`:""}function YD(e){const n=e.tagName==="OL",t=e.getAttribute("start"),r=t===null?1:Number(t);let s=Number.isFinite(r)?r:1;const i=[];for(const a of Array.from(e.children).filter(o=>o instanceof HTMLElement&&o.tagName==="LI")){const o=a.getAttribute("value"),c=o===null?s:Number(o),u=Number.isFinite(c)?c:s;s=u+1;const _=Array.from(a.childNodes).map(f=>f instanceof HTMLElement&&f.matches("UL, OL")?` +${YD(f).trim()} +`:k_(f)).join("").trim();i.push($bt(n?`${u}.`:"-",_))}return` + +${i.join(` +`)} + +`}function k_(e){var r,s,i,a,o;if(e.nodeType===Node.TEXT_NODE)return Obt(e.textContent??"");if(!(e instanceof HTMLElement))return Array.from(e.childNodes).map(k_).join("");if(e.matches(".katex-display")){const c=(s=(r=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:r.textContent)==null?void 0:s.trim();return c?Z2(c,!0):""}if(e.matches(".katex")){const c=(a=(i=e.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:i.textContent)==null?void 0:a.trim();return c?Z2(c,!1):""}if(e.tagName==="BR")return` +`;if(e.tagName==="TABLE")return Kbt(e);if(e.matches("UL, OL"))return YD(e);if(e.tagName==="CODE"&&((o=e.parentElement)==null?void 0:o.tagName)!=="PRE")return Ibt(e.textContent??"");if(e.tagName==="PRE")return Bbt(e.textContent??"");const n=Array.from(e.childNodes).map(k_).join("");if(!n)return"";if(e.matches("strong, b"))return`**${n}**`;if(e.matches("em, i"))return`*${n}*`;if(e.tagName==="A"){const c=e.getAttribute("href");return c?`[${n}](${c})`:n}if(e.tagName==="LI")return`${n.trim()} +`;if(e.matches("TH, TD"))return`${n.trim()} | `;if(e.tagName==="TR")return`${n.replace(/ \| $/,"")} +`;if(e.tagName==="BLOCKQUOTE")return` + +${n.trim().split(` +`).map(c=>`> ${c}`).join(` +`)} + +`;const t=Hbt(e.tagName,n);return t?` + +${t} + +`:e.matches("P, DIV, UL, OL, TABLE")?` + +${n.trim()} + +`:n}function Ybt(e,n){return k_(e).replace(/\r\n?/g,` +`).replace(/[ \t]+\n/g,` +`).replace(/\n{3,}/g,` + +`).trim()||n}function mN(e){return e.normalize("NFKC").replace(/[\s\u200B-\u200D\u2060\uFEFF]/g,"").toLowerCase()}function Xbt(e,n){var s,i,a,o;if(!Fbt(e))return;const t=mN(e);if(t.length<8)return;let r;for(const c of n.querySelectorAll(".msg-assistant > .md .katex")){const _=[(s=c.querySelector(".katex-mathml"))==null?void 0:s.textContent,(i=c.querySelector(".katex-html"))==null?void 0:i.textContent,c.textContent].filter(x=>!!x).map(mN).find(x=>Ubt(x,t));if(!_)continue;const f=(o=(a=c.querySelector("annotation[encoding='application/x-tex']"))==null?void 0:a.textContent)==null?void 0:o.trim();if(!f)continue;const p=!!c.closest(".katex-display"),m={markdown:Z2(f,p).trim(),delta:Math.abs(_.length-t.length)};(!r||m.deltaN.width>0&&N.height>0),x=m[0]??t.getBoundingClientRect(),S=m.filter(N=>N.topx.top),b=S.length>0?S:[x],v=Math.min(...b.map(N=>N.left)),y=Math.max(...b.map(N=>N.right)),w=Math.min(...b.map(N=>N.top)),C=Math.max(...b.map(N=>N.bottom)),z=34,E=74,R=w>=z+ay?w-z-ay:C+ay;return{text:Ybt(p,f),range:t.cloneRange(),x:Math.min(window.innerWidth-E,Math.max(E,v+(y-v)/2)),top:R}}function Qbt(e,n){const[t,r]=T.useState(null),s=T.useRef(!1),i=T.useCallback(()=>{const c=e.current;r(c?Zbt(c):null)},[e]);T.useEffect(()=>{let c=null;const u=()=>{s.current||i()},_=p=>{const m=e.current,x=p.target;!p.isPrimary||p.button!==0||!m||!(x instanceof Node)||!m.contains(x)||(s.current=!0,r(null))},f=p=>{!p.isPrimary||!s.current||(s.current=!1,c=window.requestAnimationFrame(i))};return document.addEventListener("selectionchange",u),document.addEventListener("pointerdown",_,!0),window.addEventListener("pointerup",f,!0),window.addEventListener("pointercancel",f,!0),()=>{document.removeEventListener("selectionchange",u),document.removeEventListener("pointerdown",_,!0),window.removeEventListener("pointerup",f,!0),window.removeEventListener("pointercancel",f,!0),c!==null&&window.cancelAnimationFrame(c),s.current=!1}},[i]),T.useEffect(()=>{if(!t)return;const c=u=>{const _=u.target;_ instanceof Element&&_.closest(".chat-selection-action")||r(null)};return document.addEventListener("mousedown",c,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("mousedown",c,!0),window.removeEventListener("resize",i)}},[t,i]);const a=T.useCallback(()=>{var c;t&&(n({text:t.text,range:t.range}),r(null),(c=window.getSelection())==null||c.removeAllRanges())},[t,n]),o=T.useCallback(()=>r(null),[]);return{action:t,add:a,dismiss:o}}function Jbt(e){T.useLayoutEffect(()=>{if(!("highlights"in CSS)||typeof Highlight>"u")return;const n=e.flatMap(r=>r.range?[r.range]:[]);if(n.length===0){CSS.highlights.delete(Gp);return}const t=new Highlight(...n);return CSS.highlights.set(Gp,t),()=>{CSS.highlights.get(Gp)===t&&CSS.highlights.delete(Gp)}},[e])}function evt({annotation:e}){const n=T.useRef(null),[t,r]=T.useState();return T.useLayoutEffect(()=>{var i;const s=(i=n.current)==null?void 0:i.closest(".chat-thread-inner");r(s?Xbt(e.text,s):void 0)},[e.id,e.text]),h.jsx("div",{ref:n,children:h.jsx(ro,{text:t??e.text})})}function tvt({annotations:e,onRemove:n}){return e.map((t,r)=>h.jsxs("div",{className:`annotation-item grid gap-2 py-2 px-1 [&+&]:border-t [&+&]:border-border-variant ${n?"grid-cols-[24px_minmax(0,_1fr)_28px]":"grid-cols-[24px_minmax(0,_1fr)]"}`,children:[h.jsxs("span",{className:"text-sm text-muted text-end",children:[r+1,"."]}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("div",{className:"text-sm text-muted mb-1",children:Tae()}),h.jsx(evt,{annotation:t})]}),n&&h.jsx(Yt,{type:"button",size:"small","data-annotation-remove":!0,title:rae(),"aria-label":Lq({number:Xt(r+1)}),onClick:()=>n(t.id),children:h.jsx(Dr,{size:13})})]},t.id))}function Q5({annotations:e,variant:n,onClear:t,onRemove:r}){const s=T.useRef(null),i=T.useRef(null),a=T.useId(),o=Ea(s),c=n==="sent",u=T.useRef(null),_=()=>{u.current!==null&&window.clearTimeout(u.current),u.current=null,o.setOpen(!0)},f=()=>{u.current=window.setTimeout(()=>{var x;(x=i.current)!=null&&x.contains(document.activeElement)||o.setOpen(!1)},160)},p=()=>{const x=c||!o.open;o.setOpen(x),x&&window.requestAnimationFrame(()=>{var S;return(S=i.current)==null?void 0:S.focus()})},m=x=>{r==null||r(x),window.requestAnimationFrame(()=>{var b,v;(v=((b=i.current)==null?void 0:b.querySelector("button[data-annotation-remove]"))??i.current??s.current)==null||v.focus()})};return T.useEffect(()=>()=>{u.current!==null&&window.clearTimeout(u.current)},[]),h.jsxs("div",{className:c?"sent-annotations relative flex w-fit":"composer-annotations relative flex w-fit pt-2 px-3 pb-0",ref:o.ref,onMouseEnter:c?_:void 0,onMouseLeave:c?f:void 0,children:[h.jsxs("div",{className:`inline-flex items-center border border-border bg-background overflow-hidden ${c?"rounded-full":"rounded-sm"}`,children:[h.jsxs("button",{ref:s,type:"button",className:`inline-flex items-center gap-1.5 py-1 text-sm font-medium text-text [&:hover]:bg-surface ${c?"px-2.5":"ps-2 pe-1.5"}`,"aria-expanded":o.open,"aria-haspopup":"dialog","aria-controls":a,onClick:p,children:[h.jsx(jR,{size:c?13:14,className:"text-muted"}),e.length===1?Dte():GJ({count:Xt(e.length)})]}),t&&h.jsx("button",{type:"button",className:"inline-flex items-center justify-center self-stretch w-6.5 text-muted border-s border-border [&:hover]:bg-surface [&:hover]:text-text",title:t8(),"aria-label":t8(),onClick:t,children:h.jsx(Dr,{size:13})})]}),o.open&&h.jsx("div",{id:a,ref:i,tabIndex:-1,className:`annotation-menu absolute bottom-[calc(100%_+_8px)] z-50 w-[min(440px,_calc(100vw_-_48px))] max-h-80 overflow-y-auto overscroll-contain bg-background border border-border rounded-lg shadow-popover p-2 text-start ${c?"end-0 after:absolute after:top-full after:start-0 after:end-0 after:h-2 after:content-['']":"start-3"}`,role:"dialog","aria-label":Eae(),children:h.jsx(tvt,{annotations:e,onRemove:r?m:void 0})})]})}function nvt(e){return h.jsx(Q5,{...e,variant:"composer"})}const rvt=["prompt-collapsed text-muted text-base font-[375] my-3.5 mx-0 [&_summary]:flex","[&_summary]:items-center [&_summary]:gap-2 [&_summary]:cursor-pointer","[&_summary]:list-none [&_summary]:select-none [&_summary::-webkit-details-marker]:hidden","[&_summary::after]:content-['›'] [&_summary::after]:text-muted","[&_summary::after]:transition-transform [&_summary::after]:duration-80 [&_summary::after]:ease-standard [&[open]_summary::after]:rotate-90"].join(" "),gN=["prompt-collapsed-body mt-1.5 ps-3 border-s-2 border-s-border","text-sm text-subtext"].join(" "),svt=["prompt-collapsed plan-resolved text-subtext my-3.5 mx-0","[&_summary]:flex [&_summary]:items-center [&_summary]:gap-2 [&_summary]:w-fit [&_summary]:max-w-full","[&_summary]:py-[3px] [&_summary]:px-1 [&_summary]:cursor-pointer [&_summary]:rounded-sm","[&_summary]:list-none [&_summary]:select-none [&_summary:hover]:bg-surface","[&_summary::-webkit-details-marker]:hidden","[&_summary_.plan-chevron]:transition-transform [&_summary_.plan-chevron]:duration-120","[&_summary_.plan-chevron]:ease-standard [&[open]_summary_.plan-chevron]:rotate-90"].join(" "),ivt=["prompt-head text-sm font-medium text-text","[&_code]:font-mono [&_code]:text-sm [&_code]:text-text"].join(" "),Q2="prompt-actions flex flex-wrap gap-2",vu="local-",XD="bash",bN=[];function vN(e,n){const t=e.findIndex(r=>r.id===n.id);if(t>=0){const r=e.slice();return r[t]=n,r}return n.role!=="user"?[...e,n]:[...e.filter(r=>!r.id.startsWith(vu)),n]}function avt(e,n){switch(n.type){case"reset":return{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}};case"seed":return n.onlyIfAbsent&&n.sessionId in e.messagesBySession?e:{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:n.messages},queuedBySession:{...e.queuedBySession,[n.sessionId]:n.queued??[]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.activeLeafId??null}};case"upsertMessage":{const t=e.messagesBySession[n.sessionId]??[],r=t.some(o=>o.id===n.message.id),s=e.activeLeafBySession[n.sessionId]??null,i=n.message.role==="user"&&s!==null&&s.startsWith(vu),a=n.message.parentId!=null&&n.message.parentId===s;return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:vN(t,n.message)},activeLeafBySession:r&&!i&&!a?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.message.id}}}case"localError":{const t=e.messagesBySession[n.sessionId]??[],r={id:`${vu}senderr-${Date.now()}`,role:"assistant",parts:[{id:"p0",type:"tool",tool:"error",state:{status:"error",error:n.text}}],createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,r]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:r.id}}}case"localShell":{const t=e.messagesBySession[n.sessionId]??[],r=t.find(i=>i.id===n.id),s={id:n.id,role:"user",parts:[{id:"p0",type:"tool",tool:XD,state:{status:n.error===void 0?"running":"error",input:{command:n.command},error:n.error}}],createdAt:(r==null?void 0:r.createdAt)??Date.now(),parentId:r?r.parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:r?vN(t,s):[...t,s]},activeLeafBySession:r?e.activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"activeLeaf":return{...e,activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:n.leafId}};case"optimisticUser":{const t=e.messagesBySession[n.sessionId]??[],r=n.text?[{id:"p0",type:"text",text:n.text}]:[];n.attachments.forEach((i,a)=>r.push({id:`img${a}`,type:"image",text:i.url,name:i.name})),n.annotations.forEach((i,a)=>r.push({id:`annotation${a}`,type:"annotation",text:i.text}));const s={id:`${vu}${Date.now()}`,role:"user",parts:r,createdAt:Date.now(),parentId:e.activeLeafBySession[n.sessionId]??null};return{...e,messagesBySession:{...e.messagesBySession,[n.sessionId]:[...t,s]},activeLeafBySession:{...e.activeLeafBySession,[n.sessionId]:s.id}}}case"busy":{const t=new Set(e.busySessions);return n.busy?t.add(n.sessionId):t.delete(n.sessionId),{...e,busySessions:t}}case"seedBusy":{const t=new Set(n.sessions),r=new Set(n.known);for(const s of e.busySessions)r.has(s)||t.add(s);return{...e,busySessions:t}}case"setQueued":return{...e,queuedBySession:{...e.queuedBySession,[n.sessionId]:n.items}};case"forget":{const t={...e.messagesBySession};delete t[n.sessionId];const r=new Set(e.busySessions);r.delete(n.sessionId);const s={...e.queuedBySession};delete s[n.sessionId];const i={...e.activeLeafBySession};return delete i[n.sessionId],{messagesBySession:t,busySessions:r,queuedBySession:s,activeLeafBySession:i}}}}function ovt(e){if(!e)return"";const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return M9e();const t=Math.floor(n/60);if(t<60)return j9e({value:Xt(t)});const r=Math.floor(t/60);return r<24?C9e({value:Xt(r)}):y9e({value:Xt(Math.floor(r/24))})}function su(e){const n=e.replace(/\/+$/,"");return n.slice(n.lastIndexOf("/")+1)||n}function ly(e){var t;const n=e.replace(/\\/g,"/").replace(/\/+$/,"").split("/").filter(Boolean);return((t=n.at(-1))==null?void 0:t.toLowerCase())!=="skill.md"?null:n.at(-2)??null}function lvt(e,n){return/^orx-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(n)?e==="Skill"?`.claude/skills/${n}/SKILL.md`:e==="skill"?`.opencode/skills/${n}/SKILL.md`:null:null}function zs(e,...n){for(const t of n){const r=e[t];if(typeof r=="string"&&r)return r}return null}function cy(e,n,t){const r=e[n];if(!Array.isArray(r))return null;for(const s of r){if(!s||typeof s!="object"||!(t in s))continue;const i=s[t];if(typeof i=="string"&&i)return i}return null}function uy(e,n){const t=e[n];if(!Array.isArray(t))return[];const r=[];for(let s=0;s=pc));s++);return r}function cvt(e,n){const t=e[n];if(!Array.isArray(t))return null;const r=[];for(const s of t){if(typeof s!="string")return null;r.push(s)}return r}function Vf(...e){const n=new Set,t=new RegExp(`^${xu}$`,"i");let r=0;for(const s of e)for(const i of s){if(n.size>=pc||r++>=WD)return[...n];t.test(i)&&n.add(i.toLowerCase())}return[...n]}function v1(e){return e.replace(/^Exit code \d+\s*/i,"").split(` +`).filter(n=>!/^\s*\[orx-(?:run|experiment):[^\]]+\]\s*$/.test(n)).join(` +`).trim()}function uvt(e){const n=e.changes;if(!Array.isArray(n))return null;for(const t of n){if(!t||typeof t!="object"||!("path"in t)||typeof t.path!="string")continue;const r="kind"in t?t.kind:null,s=r&&typeof r=="object"&&"type"in r&&typeof r.type=="string"?r.type:null;return{path:t.path,type:s}}return null}function fvt(e){const n=e.trim(),t=n.match(/^\/bin\/(?:ba|z)?sh\s+-lc\s+([\s\S]+)$/);let r=((t==null?void 0:t[1])??n).trim();return r=Jlt(r),ZD(r)}function ZD(e){return hvt(e).replace(/[\t\r ]+/g," ").trim()}function dvt(e){let n=null,t=!1;for(let r=0;r!i.startsWith("-")&&i.includes(":"));if(!n)return null;const t=n.indexOf(":"),r=n.slice(0,t),s=n.slice(t+1);return r&&JD(s)?{ref:r,path:s}:null}function mvt(e){const n=e.match(/\b(?:rg|grep)\b(?:\s+-[^\s]+)*\s+(?:"([^"]+)"|'([^']+)'|([^\s]+))/);return(n==null?void 0:n[1])??(n==null?void 0:n[2])??(n==null?void 0:n[3])??null}function xN(e,n){if(/[$`~]/.test(e)||/[$`~]/.test(n))return null;const t=n.startsWith("/")||!n.startsWith("/")&&e.startsWith("/"),r=n.startsWith("/")?[]:e.split("/").filter(Boolean);for(const i of n.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r[r.length-1]!==".."?r.pop():t||r.push(i);continue}r.push(i)}return`${t?"/":""}${r.join("/")}`||(t?"/":null)}function gvt(e,n,t,r){if(e.startsWith("/"))return e;let s=r??"";for(let i=0;i!u.startsWith("-"));if(!o)return null;const c=xN(s,o);if(!c)return null;s=c}return s?xN(s,e):e}const Va="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",bvt=new RegExp(`\\bchat_(${Va})\\b`,"gi"),xu=`(?:${Va}|[0-9a-f]{8})`;function Wf(e){const n=[];let t="",r="",s=null,i=!1;const a=()=>{(t.trim()||r.trim())&&n.push({raw:t.trim(),code:r.trim()}),t="",r=""},o=u=>{let _=1,f=null,p=!1;for(let m=u;m{let _=!1;for(let f=u;fnct(t.raw,n))}function Yi(e,n){return x1(e,n).length>0}function vvt(e){if(!e)return[];const n=new Set;for(const t of e.slice(0,KD).matchAll(bvt))if(n.add(t[0].toLowerCase()),n.size>=pc)break;return[...n]}function J2(e,n){if(!e)return[];const t=new Set,r=e.slice(0,KD),s=n==="runs"?[new RegExp(`/runs/(${Va})`,"gi"),new RegExp(`\\brun(?:_|\\s+)id:\\s*(${Va})`,"gi"),new RegExp(`^\\s*RUN\\s+(${Va})\\b`,"gim"),new RegExp(`={3,}\\s*(${Va})\\s*={3,}`,"gi")]:[new RegExp(`/experiments/(${Va})`,"gi"),new RegExp(`^\\s*id:\\s*(${Va})`,"gim"),new RegExp(`={3,}\\s*(${Va})\\s*={3,}`,"gi")];for(const a of s)for(const o of r.matchAll(a))if(t.add(o[1]),t.size>=pc)return[...t];const i=new RegExp(`^\\s*(${Va})(?:\\s|$)`,"gim");for(const a of r.matchAll(i))if(t.add(a[1]),t.size>=pc)break;return[...t]}function tO(e,n){let t=0;return n.map(r=>{const s=e.indexOf(r.raw,t),i=s===-1?e.indexOf(r.raw):s;return t=Math.max(t,i+r.raw.length),{invocation:r,offset:Math.max(0,i)}})}function nO(e,n,t,r){const s=new RegExp(`(?:^|[\\s;])(?:export\\s+)?${n}\\s*=\\s*(?:"([^"]*)"|'([^']*)'|([^\\s;]+))`,"gi");let i="";for(const a of e.matchAll(s)){if((a.index??0)>=t)break;i=a[1]??a[2]??a[3]??""}return[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function rO(e,n,t,r){const s=new RegExp(`\\bfor\\s+${n}\\s+in\\s+([\\s\\S]*?)(?:;|\\n)\\s*do\\b`,"gi");let i="";for(const a of e.matchAll(s)){const o=a.index??0;if(o>=t)break;const c=o+a[0].length;c<=t&&/\bdone\b/.test(e.slice(c,t))||(i=a[1])}return/\$\(|`/.test(i)?[]:[...i.matchAll(new RegExp(r,"gi"))].map(a=>a[0])}function xvt(e,n,t=[],r=[]){const s=x1(e,"logs"),i=new Set;if(s.length===0){if(!Yi(e,"logs"))return[];const o=t.length>0?[]:J2(n,"runs");for(const c of t.length>0?t:o.length>0?o:r)if(i.add(c),i.size>=pc)break;return Vf([...i])}let a=!1;for(const{invocation:o,offset:c}of tO(e,s)){const u=id(o.raw);if((u==null?void 0:u[0])!=="logs")continue;const _=u.slice(1);let f=null;for(let b=0;b<_.length;b++){const v=_[b];if(v!=="--head"){if(v==="--bytes"||v==="--range"){b++;continue}if(!(v.startsWith("--bytes=")||v.startsWith("--range="))){f=v;break}}}if(!f){a=!0;continue}if(new RegExp(`^${xu}$`,"i").test(f)){i.add(f);continue}const p=/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(f);if(!p){a=!0;continue}const m=p[1],x=nO(e,m,c,xu);for(const b of x)i.add(b);const S=rO(e,m,c,xu);for(const b of S)i.add(b);x.length===0&&S.length===0&&(a=!0)}if(i.size===0||a){const o=t.length>0?[]:J2(n,"runs"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=pc)break}return Vf([...i])}function Ef(e,n,t=[],r=[]){const s=x1(e,"exp\\s+(?:status|desc)");if(s.length===0)return[];const i=new Set;let a=!1;for(const{invocation:o,offset:c}of tO(e,s)){const u=id(o.raw),_=(u==null?void 0:u[0])==="exp"&&(u[1]==="status"||u[1]==="desc")?u[2]:null;let f=!1;_&&new RegExp(`^${xu}$`,"i").test(_)&&(i.add(_),f=!0);const p=_?/^\$\{?([A-Za-z_][A-Za-z0-9_]*)\}?$/.exec(_):null;if(p){const m=p[1],x=nO(e,m,c,xu);if(x.length>0){for(const b of x)i.add(b);f=!0}const S=rO(e,m,c,xu);for(const b of S)i.add(b);S.length>0&&(f=!0)}f||(a=!0)}if(i.size===0||a){const o=t.length>0?[]:J2(n,"experiments"),c=t.length>0?t:o.length>0?o:r;for(const u of c)if(i.add(u),i.size>=pc)break}return Vf([...i])}function mc(e){var v,y,w,C;const n=e.tool??"tool",t=((v=e.state)==null?void 0:v.input)??{},r=t.arguments,s=r&&typeof r=="object"&&!Array.isArray(r)?Object.fromEntries(Object.entries(r)):{},i={...t,...s},a=zs(i,"command","cmd"),o=cvt(i,"commandArgv"),c=((y=e.state)==null?void 0:y.output)||((w=e.state)==null?void 0:w.error),u=Vf(uy(i,"targetIds")),_=Vf(uy(i,"runTargetIds")),f=Vf(uy(i,"experimentTargetIds")),p=zs(i,"filePath","file_path","notebookPath","notebook_path","path"),m=zs(i,"description"),x=n.toLowerCase().split(/(?::|\.|__)+/),S=x.at(-1)??n.toLowerCase();if(S==="run"&&x.includes("web")){const z=cy(i,"search_query","q"),E=cy(i,"image_query","q"),R=cy(i,"find","pattern");return z?{kind:"web",label:B7({query:z})}:E?{kind:"web",label:CK({query:E})}:R?{kind:"web",label:UK({pattern:R})}:Array.isArray(i.open)?{kind:"web",label:nie()}:Array.isArray(i.weather)?{kind:"web",label:yre()}:Array.isArray(i.finance)?{kind:"web",label:hre()}:Array.isArray(i.sports)?{kind:"web",label:gre()}:Array.isArray(i.time)?{kind:"web",label:cre()}:{kind:"web",label:J7()}}switch(new Map([["read_file","read"],["write_file","write"],["edit_file","edit"],["exec","bash"],["exec_command","bash"],["run_command","bash"],["agent","task"],["collabagenttoolcall","subagent"],["subagentactivity","subagent"]]).get(S)??S){case"bash":{if(!a&&!(o!=null&&o.length))return{kind:"command",label:jie()};const z=fvt(a??(o==null?void 0:o.join(" "))??""),E=Wf(z);let R=E.map(ae=>ae.raw);if(o!=null&&o.length){const ae=tct(o);R=ae===null?[o]:Wf(ZD(ae)).map(se=>se.raw)}let N=null;for(const ae of R)if(N=rct(ae),N)break;const M=R.some(ae=>{const se=id(ae);return se!==null&&se[0]!=="discover"&&se[0]!=="paper"});if(N&&!M){const ae=N.kind==="discover"?{keyword:oK(),embedding:fK(),openalex:OK(),biorxiv:pK()}[N.strategy]:null,se=N.kind==="discover"?N.query?bV({activity:ae??I7(),query:N.query}):ae??I7():N.id?kh({target:ze(N.id)}):lW();return{kind:N.kind==="paper"?"read":"search",label:se,litCall:N}}if(Yi(z,"agent\\s+spawn"))return{kind:"agent",label:$re(),spawnedSessionIds:vvt(c),litCall:N??void 0};const O=E.map(ae=>eO(ae.raw)),I=Yi(z,"exp\\s+status"),H=Yi(z,"exp\\s+desc"),U=x1(z,"exp\\s+desc").some(ae=>(id(ae.raw)??[]).some(G=>G==="--set"||G.startsWith("--set=")||G==="--stdin")),F=U?gY():sW(),Y=U?zG():FW();if(Yi(z,"logs")){const ae=xvt(z,c,_,u);return{kind:"project",label:ae.length===1?LW():BW(),runIds:ae,litCall:N??void 0}}if(Yi(z,"exp\\s+run"))return{kind:"project",label:Wae(),litCall:N??void 0};if(Yi(z,"exp\\s+wait"))return{kind:"project",label:Noe(),litCall:N??void 0};if(Yi(z,"exp\\s+cancel"))return{kind:"project",label:qne(),litCall:N??void 0};const q=Yi(z,"project\\s+view");if(q&&I&&H)return{kind:"project",label:Y,experimentIds:Ef(z,c,f,u),litCall:N??void 0};if(q&&H)return{kind:"project",label:F,experimentIds:Ef(z,c,f,u),litCall:N??void 0};if(q&&I)return{kind:"project",label:e8(),experimentIds:Ef(z,c,f,u),litCall:N??void 0};if(q)return{kind:"project",label:Gie(),litCall:N??void 0};if(I&&H)return{kind:"project",label:Y,experimentIds:Ef(z,c,f,u),litCall:N??void 0};if(I)return{kind:"project",label:e8(),experimentIds:Ef(z,c,f,u),litCall:N??void 0};if(H)return{kind:"project",label:F,experimentIds:Ef(z,c,f,u),litCall:N??void 0};if(Yi(z,"runs?"))return{kind:"project",label:Ise(),litCall:N??void 0};if(Yi(z,"projects"))return{kind:"project",label:Hse(),litCall:N??void 0};if(Yi(z,"compute"))return{kind:"project",label:Qne(),litCall:N??void 0};const Q=O.map(pvt).find(ae=>ae!=null);if(Q){const ae=ly(Q.path);return{kind:ae?"skill":"read",label:ae?Zv({name:ze(ae)}):kh({target:ze(su(Q.path))}),filePath:Q.path,fileRef:Q.ref,labelTarget:ae?`${ae} skill`:su(Q.path)}}const Z=O.findIndex(ae=>ae!=null&&["sed","cat","head","tail"].includes(ae.name)),B=Z>=0?O[Z]:null,D=B?_vt(B):null,P=D?gvt(D,E,Z,zs(i,"cwd","workdir")):null;if(D&&P){const ae=ly(P);return{kind:ae?"skill":"read",label:ae?Zv({name:ze(ae)}):kh({target:ze(su(D))}),filePath:P,labelTarget:ae?`${ae} skill`:su(D)}}if(O.some(ae=>(ae==null?void 0:ae.name)==="find"||(ae==null?void 0:ae.name)==="ls"||(ae==null?void 0:ae.name)==="rg"&&ae.args.includes("--files")))return{kind:"search",label:o8()};const X=O.findIndex(ae=>(ae==null?void 0:ae.name)==="rg"||(ae==null?void 0:ae.name)==="grep");if(X>=0){const ae=mvt(E[X].raw);return{kind:"search",label:ae?Jv({pattern:ze(ae)}):Qv(),searchPattern:ae??void 0}}const W=O.find(ae=>(ae==null?void 0:ae.name)==="git"),ie=W==null?void 0:W.args[0];if(ie==="grep"){const ae=W==null?void 0:W.args.slice(1).find(se=>!se.startsWith("-"));return{kind:"search",label:ae?Jv({pattern:ze(ae)}):Qv(),searchPattern:ae}}if(ie==="status")return{kind:"command",label:ire()};if(ie==="diff")return{kind:"command",label:vae()};if(ie==="log")return{kind:"command",label:Hie()};const le=ae=>O.some(se=>!se||!["cargo","pnpm","npm","yarn"].includes(se.name)?!1:se.args[0]===ae||se.args[0]==="run"&&se.args[1]===ae);return le("test")?{kind:"command",label:Mie()}:O.some(ae=>(ae==null?void 0:ae.name)==="tsc")||le("typecheck")?{kind:"command",label:Cre()}:le("lint")?{kind:"command",label:Kne()}:le("build")?{kind:"command",label:One()}:{kind:"command",label:VV({command:ze(z)})}}case"skill":{const z=zs(i,"skill","name"),E=z?lvt(n,z):null;return{kind:"skill",label:z?LV({name:ze(z)}):TV(),filePath:E??void 0,labelTarget:E&&z?`${z} skill`:void 0}}case"read":{const z=p?su(p):null,E=p?ly(p):null;return E?{kind:"skill",label:Zv({name:ze(E)}),filePath:p??void 0,labelTarget:`${E} skill`}:z?{kind:"read",label:kh({target:ze(z)}),filePath:p??void 0,labelTarget:z}:{kind:"read",label:Iie()}}case"edit":case"write":case"notebookedit":{const z=uvt(i),E=p??(z==null?void 0:z.path)??null,R=E?su(E):null,N=R?(z==null?void 0:z.type)==="add"?qG({target:ze(R)}):(z==null?void 0:z.type)==="delete"?nV({target:ze(R)}):uV({target:ze(R)}):null;return R?{kind:"edit",label:N??r8(),filePath:E??void 0,labelTarget:R}:{kind:"edit",label:r8()}}case"grep":{const z=zs(i,"pattern");return{kind:"search",label:z?Jv({pattern:ze(z)}):Qv(),searchPattern:z??void 0}}case"glob":{const z=zs(i,"pattern");return{kind:"search",label:z?wV({pattern:ze(z)}):o8()}}case"websearch":{const z=zs(i,"query"),E=zs(i,"url"),R=zs(i,"pattern");return z?{kind:"web",label:B7({query:z})}:R&&E?{kind:"web",label:RK({pattern:R})}:E?{kind:"web",label:FV({target:ze(E)})}:{kind:"web",label:m??J7()}}case"webfetch":{const z=zs(i,"url");return{kind:"web",label:z?kh({target:ze(z)}):m??bW()}}case"task":return{kind:"agent",label:m??XV()};case"subagent":return{kind:"agent",label:yvt(i)};case"error":return{kind:"command",label:moe()};case"contextcompaction":return{kind:"command",label:OG(),progressLabel:PG()};default:{const z=m??p??a??((C=e.state)==null?void 0:C.title)??"";return{kind:"command",label:z?`${n}: ${z}`:n}}}}function yvt(e){const n=typeof e.nickname=="string"&&e.nickname?e.nickname.replace(/[_-]+/g," "):"",t=n&&n.charAt(0).toUpperCase()+n.slice(1);if(t)return t;switch(typeof e.tool=="string"?e.tool:""){case"spawnAgent":return tY();case"sendInput":return ZK();case"resumeAgent":return EW();case"wait":return yY();case"closeAgent":return RG()}switch(typeof e.kind=="string"?e.kind:""){case"started":return hY();case"interacted":return mG();case"interrupted":return cY()}return iY()}function _g({activity:e,className:n=""}){const t={size:16,strokeWidth:1.75,className:"tool-kind-icon"};let r=h.jsx(Sd,{...t});if(e.litCall)r=h.jsx(WR,{source:e.litCall.source,size:16,className:"tool-kind-icon"});else switch(e.kind){case"skill":r=h.jsx(xR,{...t});break;case"read":case"project":r=h.jsx(yR,{...t});break;case"search":r=h.jsx(RR,{...t});break;case"edit":r=h.jsx(N4,{...t});break;case"web":r=h.jsx(uot,{...t});break;case"agent":r=h.jsx(T4,{...t});break}return h.jsx("span",{className:`flex h-6 shrink-0 items-center ${n}`,children:r})}function fy({items:e,onOpen:n,onSelect:t,targetType:r}){const[s,i]=T.useState(!1),a=T.useRef(null),o=T.useRef(!1);return T.useEffect(()=>{var c,u;!s||!o.current||(o.current=!1,(u=(c=a.current)==null?void 0:c.querySelector("button"))==null||u.focus())},[s]),h.jsxs("span",{className:"tool-target-overflow inline",children:[s&&h.jsx("span",{className:"tool-target-reveal",ref:a,children:e.map((c,u)=>h.jsxs("span",{children:[u>0&&", ",n||t?h.jsx("button",{className:"tool-target",...n?Nr(_=>n(c.id,_),{stopPropagation:!0}):{onClick:_=>{_.stopPropagation(),t==null||t(c.id)}},children:c.label}):h.jsx("span",{children:c.label})]},c.id))}),s&&", ",h.jsx("button",{className:"tool-target-more","aria-expanded":s,"aria-label":s?BU({target:r}):sG({count:Xt(e.length),target:r}),onClick:c=>{c.preventDefault(),c.stopPropagation(),o.current=!s&&c.detail===0,i(u=>!u)},children:s?yT():que({count:Xt(e.length)})})]})}function ew({activity:e,onOpenFile:n,onOpenRun:t,onOpenSpawnedSession:r,runExperimentName:s,onOpenExperiment:i,experimentName:a}){var o,c,u,_;if(e.searchPattern)return e.label;if(((o=e.litCall)==null?void 0:o.kind)==="paper"&&e.litCall.id)return h.jsxs("a",{className:"tool-target",href:cct(e.litCall.source,e.litCall.id),target:"_blank",rel:"noopener noreferrer",children:[e.label,h.jsx(gat,{className:"inline ms-1 opacity-50",size:13,"aria-hidden":"true"})]});if(e.filePath&&e.labelTarget&&n){const f=e.filePath;return h.jsx("span",{className:"tool-target",role:"button",tabIndex:0,...Nr(p=>n(f,void 0,void 0,e.fileRef,p),{stopPropagation:!0}),children:e.label})}if((c=e.spawnedSessionIds)!=null&&c.length&&r){const f=e.spawnedSessionIds,p=f.slice(0,3),m=f.slice(p.length).map((x,S)=>({id:x,label:W7({number:Xt(p.length+S+1)})}));return h.jsxs(h.Fragment,{children:[e.label," — ",p.map((x,S)=>h.jsxs("span",{children:[S>0&&", ",h.jsx("button",{className:"tool-target",title:Qse(),onClick:b=>{b.preventDefault(),b.stopPropagation(),r(x)},children:W7({number:Xt(S+1)})})]},x)),m.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(fy,{items:m,onSelect:r,targetType:BJ()})]})]})}if((u=e.runIds)!=null&&u.length){const f=s?e.runIds.filter(x=>!!s(x)):e.runIds;if(f.length===0)return e.label;const p=f.slice(0,3),m=f.slice(p.length).map(x=>({id:x,label:(s==null?void 0:s(x))||Go()}));return h.jsxs(h.Fragment,{children:[e.label," — ",p.map((x,S)=>h.jsxs("span",{children:[S>0&&", ",t?h.jsx("button",{className:"tool-target",title:pq({run:ze(x)}),...Nr(b=>t(x,b),{stopPropagation:!0}),children:(s==null?void 0:s(x))||Go()}):h.jsx("span",{children:(s==null?void 0:s(x))||Go()})]},x)),m.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(fy,{items:m,onOpen:t,targetType:Ble()})]})]})}if((_=e.experimentIds)!=null&&_.length){const f=a?e.experimentIds.filter(x=>!!a(x)):e.experimentIds;if(f.length===0)return e.label;const p=f.slice(0,3),m=f.slice(p.length).map(x=>({id:x,label:(a==null?void 0:a(x))||Go()}));return h.jsxs(h.Fragment,{children:[e.label," — ",p.map((x,S)=>h.jsxs("span",{children:[S>0&&", ",i?h.jsx("button",{className:"tool-target",title:rq({name:(a==null?void 0:a(x))||ze(x)}),...Nr(b=>i(x,b),{stopPropagation:!0}),children:(a==null?void 0:a(x))||Go()}):h.jsx("span",{children:(a==null?void 0:a(x))||Go()})]},x)),m.length>0&&h.jsxs(h.Fragment,{children:[", ",h.jsx(fy,{items:m,onOpen:i,targetType:ete()})]})]})}return e.label}function J5(e){const n=e.progressLabel??{skill:BV(),read:wW(),search:WK(),edit:_V(),project:VW(),web:kG(),agent:QG(),command:cT()}[e.kind];return{...e,label:n}}function sO(e,n){const t=mc({tool:e,state:{status:"running",input:n}});return{skill:EV(),read:eW(),search:rK(),edit:aV(),project:TW(),web:xG(),agent:KG(),command:XW()}[t.kind]}function wvt(e){return e==null?!0:typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0}const Svt=250;function kvt(e,n){const[t,r]=T.useState(e),s=T.useRef(Date.now()),i=T.useRef(e);return T.useEffect(()=>{if(i.current=e,(e==null?void 0:e.label)===(t==null?void 0:t.label)||n&&e!=null&&t!=null)return;if(e==null||t==null){s.current=Date.now(),r(e);return}const a=Svt-(Date.now()-s.current);if(a<=0){s.current=Date.now(),r(e);return}const o=window.setTimeout(()=>{s.current=Date.now(),r(i.current)},a);return()=>window.clearTimeout(o)},[e,t,n]),e!=null&&e.label===(t==null?void 0:t.label)?e:t}const Cvt=160;function iO(e){const[n,t]=T.useState(!1);return T.useEffect(()=>{if(!e){t(!1);return}const r=window.setTimeout(()=>t(!0),Cvt);return()=>window.clearTimeout(r)},[e]),e&&n}function Evt(e){const n=["skill","read","search","edit","project","web","command","agent"];for(const t of n){const r=e.find(s=>s.kind===t);if(r)return r}return e[0]??{kind:"command",label:mT()}}function Nvt(e,n){var t,r;return((t=e.state)==null?void 0:t.status)!=="completed"?null:JSON.stringify([n.kind,n.label,n.filePath??null,n.fileRef??null,((r=n.litCall)==null?void 0:r.kind)==="paper"?n.litCall.id??null:null,n.runIds??null,n.experimentIds??null,n.spawnedSessionIds??null])}function zvt(e){const n=[];let t=null;for(const r of e){const s=mc(r),i=Nvt(r,s),a=n[n.length-1];i&&a&&t===i?a.count++:n.push({part:r,activity:s,count:1}),t=i}return n}function jvt({part:e,busy:n,recovering:t,onRecover:r}){var p,m;const s=(p=e.state)==null?void 0:p.input,i=(s==null?void 0:s.nextRetryAt)??null,[a,o]=T.useState(Date.now());if(T.useEffect(()=>{if(typeof i!="number"||(o(Date.now()),i<=Date.now()))return;const x=window.setInterval(()=>{const S=Date.now();o(S),S>=i&&window.clearInterval(x)},1e3);return()=>window.clearInterval(x)},[i]),e.id==="turn-retry"){const x=Klt(s??{},a);return h.jsxs("div",{className:"turn-retry-row flex items-center gap-2 py-1 px-1 text-sm text-subtext",children:[h.jsx(Ot,{}),h.jsx("span",{children:x})]})}const c=GR(s==null?void 0:s.recoveryAction),u=s==null?void 0:s.turnId;if(c!=="retry"&&c!=="continue"||!u)return null;const _=c==="retry"?Ji():Lee(),f=v1(((m=e.state)==null?void 0:m.error)||jce());return h.jsxs("div",{className:"turn-recovery-row flex items-center justify-between gap-2 py-1.5 px-2.5 border border-border rounded-md bg-background",children:[h.jsx("span",{className:"min-w-0 truncate text-sm text-accent-red",title:f,children:f}),h.jsx($e,{type:"button",size:"small",disabled:n||t,onClick:()=>r==null?void 0:r(u,c),children:t?nce():_})]})}function yN({part:e,repeatCount:n=1,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){const c=e.state,u=mc(e),_=(c==null?void 0:c.status)==="error",f=v1((c==null?void 0:c.error)||(c==null?void 0:c.output)||""),p=_&&!!f,[m,x]=T.useState(!1),S=`tool-error-${e.id.replace(/[^A-Za-z0-9_-]/g,"-")}`,b=h.jsxs(h.Fragment,{children:[_&&h.jsxs("span",{className:"sr-only",children:[Ww()," "]}),_?h.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:h.jsx(CR,{size:16,strokeWidth:1.75,className:"tool-kind-icon","aria-hidden":"true"})}):h.jsx(_g,{activity:u,className:"text-muted"}),h.jsxs("span",{className:`${VD} ${_?"text-accent-red":"text-subtext"}`,children:[h.jsx(ew,{activity:u,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}),n>1&&h.jsxs("span",{className:"tool-repeat-count ms-1 text-muted font-normal",title:VU({count:Xt(n)}),children:["×",n]})]})]});return p?h.jsxs("div",{className:"tool-row tool-row-error flex flex-col min-w-0",children:[h.jsxs("div",{className:"flex items-start gap-2 w-fit max-w-full py-[3px] px-1 min-w-0 rounded-sm",children:[b,h.jsx("button",{type:"button",className:"tool-row-detail-toggle inline-flex h-6 shrink-0 items-center justify-center p-0.5 rounded-sm cursor-pointer hover:bg-surface","aria-expanded":m,"aria-controls":S,"aria-label":m?FU({activity:u.label}):eG({activity:u.label}),onClick:()=>x(v=>!v),children:h.jsx(co,{size:16,className:`text-accent-red transition-transform duration-120 ease-standard ${m?"rotate-90":""}`})})]}),m&&h.jsx("div",{className:"tool-detail mt-1 me-0 mb-1 ms-6",id:S,children:h.jsx("div",{className:Z5,children:f.slice(0,2e4)})})]}):h.jsx("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1",children:b})}function Tvt({parts:e,pendingTail:n,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o}){var z,E,R,N;const[c,u]=T.useState(!1),_=zvt(e),f=_.map(({activity:M})=>M),p=n?_.at(-1):void 0,m=p==null?void 0:p.part,x=p==null?void 0:p.activity,S=((z=m==null?void 0:m.state)==null?void 0:z.status)!=="error"?(x&&J5(x))??null:null,b=!!m&&((E=m.state)==null?void 0:E.status)==="running"&&!(S!=null&&S.progressLabel)&&(wvt((R=m.state)==null?void 0:R.input)||(S==null?void 0:S.kind)==="command"&&!zs(((N=m.state)==null?void 0:N.input)??{},"command","cmd")),v=kvt(S,b),y=iO(v!=null),w=v??Evt(f),C=v?v.label:mT();return e.length===1?v?h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsxs("div",{className:"tool-row flex items-start gap-2 min-w-0 py-[3px] px-1 text-base leading-6 text-subtext",children:[h.jsx(_g,{activity:v,className:y?"tool-running-shimmer-icon":"text-muted"}),h.jsx("span",{className:`${y?"tool-running-shimmer":""} min-w-0 line-clamp-2 break-words`,title:C,children:h.jsx(ew,{activity:v,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})})]})}):h.jsx("div",{className:"tool-group my-3.5 mx-0",children:h.jsx(yN,{part:e[0],onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):h.jsxs("div",{className:"tool-group my-3.5 mx-0",children:[h.jsxs("div",{className:"tool-group-summary flex items-start gap-2 w-fit max-w-full py-[3px] px-1 text-base leading-6 text-subtext text-start",children:[h.jsx(_g,{activity:w,className:y?"tool-running-shimmer-icon":"text-muted"}),v?h.jsx("span",{className:`tool-group-label min-w-0 line-clamp-2 break-words ${y?"tool-running-shimmer":""}`,title:C,children:h.jsx(ew,{activity:v,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o})}):h.jsx("button",{type:"button",className:"tool-group-label min-w-0 whitespace-normal break-words cursor-pointer text-start",onClick:()=>u(M=>!M),"aria-expanded":c,children:C}),h.jsx("button",{type:"button",className:"tool-group-chevron-button inline-flex h-6 shrink-0 items-center justify-center p-px cursor-pointer rounded-sm",onClick:()=>u(M=>!M),"aria-expanded":c,"aria-label":c?Tee():Xee(),children:h.jsx(co,{size:16,className:`tool-chevron text-muted transition-[transform,color] duration-120 ease-standard [&.open]:rotate-90 ${c?"open":""}`})})]}),h.jsx("div",{className:`tool-group-disclosure ${c?"open":""}`,"aria-hidden":!c,inert:!c,children:h.jsx("div",{className:"tool-group-disclosure-inner",children:h.jsx("div",{className:"tool-group-rows flex flex-col gap-px mt-0.5 me-0 mb-1 ms-6",children:_.map(({part:M,count:O})=>h.jsx(yN,{part:M,repeatCount:O,onOpenFile:t,onOpenRun:r,onOpenSpawnedSession:s,runExperimentName:i,onOpenExperiment:a,experimentName:o},M.id))})})})]})}function Avt({part:e,onRespond:n,onOpenFile:t,onOpenPlan:r}){var _;const s=e.prompt,[i,a]=T.useState([]),o=!n,c=f=>n==null?void 0:n({promptId:e.id,...f});if(s.resolved){if(s.kind==="permission")return null;if(s.kind==="plan"){const m=s.approved===!0?{label:uie(),icon:zi,iconClass:"text-accent-green"}:s.approved===!1&&s.note?{label:wie(),icon:N4,iconClass:"text-accent-amber"}:s.approved===!1?{label:_ie(),icon:Dr,iconClass:"text-accent-red"}:{label:bie(),icon:Gg,iconClass:"text-muted"},x=m.icon;return h.jsxs("details",{className:svt,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"plan-resolved-label text-base font-[375] wrap-anywhere",children:s.synthesized?gT():g8()}),h.jsx(x,{size:17,strokeWidth:1.8,className:`shrink-0 ${m.iconClass}`}),h.jsx("span",{className:"plan-resolved-label prompt-outcome text-base font-[375] wrap-anywhere",children:m.label}),h.jsx(co,{size:12,className:"plan-chevron shrink-0 text-muted"})]}),h.jsxs("div",{className:`${gN} ms-6`,children:[h.jsx(ro,{text:s.plan??"",onOpenFile:t}),s.note&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})}const f=(s.answers??[]).join(", ")||s.note||"",p=(s.annotations??[]).map((m,x)=>({id:`${e.id}-annotation-${x}`,text:m.text}));return h.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[p.length>0&&h.jsx(Q5,{annotations:p,variant:"sent"}),h.jsxs("details",{className:rvt,children:[h.jsxs("summary",{children:[h.jsx("span",{className:"prompt-collapsed-title font-[375] wrap-anywhere",children:s.header||s.question||rle()}),h.jsx("span",{className:`prompt-outcome font-[375] text-subtext wrap-anywhere [&.approved]:text-accent-green [&.chosen]:text-accent-green [&.approved::before]:content-['✓_'] [&.chosen::before]:content-['✓_'] [&.revised]:text-accent-amber [&.rejected]:text-accent-amber ${f?"chosen":""}`,children:f||Tle()})]}),h.jsxs("div",{className:gN,children:[s.header&&s.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),(s.options??[]).length>0&&h.jsx("ul",{className:"prompt-collapsed-options mt-1.5 mx-0 mb-0 ps-4.5 [&_.sel]:text-text [&_.sel]:font-medium",children:(s.options??[]).map(m=>{var x;return h.jsx("li",{className:(x=s.answers)!=null&&x.includes(m.label)?"sel":"",children:m.label},m.label)})}),s.note&&s.note!==f&&h.jsx("div",{className:"prompt-collapsed-note mt-1.5 italic",children:s.note})]})]})]})}if(s.kind==="plan"){const f=!!r;return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 plan ${o?"readonly":""}`,children:[h.jsx("div",{className:"prompt-head text-base font-semibold text-text",children:s.synthesized?Xoe():g8()}),h.jsx("div",{className:`prompt-plan text-base leading-[1.6] text-text max-h-85 overflow-y-auto [&.clamped]:max-h-[9.5em] [&.clamped]:overflow-hidden [&.clamped]:relative [&.clamped::after]:content-[''] [&.clamped::after]:absolute [&.clamped::after]:inset-x-0 [&.clamped::after]:bottom-0 [&.clamped::after]:top-auto [&.clamped::after]:h-8.5 [&.clamped::after]:bg-[linear-gradient(to_bottom,_transparent,_var(--surface))] [&.clamped::after]:pointer-events-none ${f?"clamped":""}`,children:h.jsx(ro,{text:s.plan??"",onOpenFile:t})}),f&&h.jsx("button",{className:"prompt-plan-open self-start border-0 bg-transparent text-accent-blue text-sm p-0 cursor-pointer [&:hover]:underline",...Nr(p=>r(s.plan??"",e.id,p)),children:Soe()}),!o&&!f&&h.jsxs("div",{className:Q2,children:[h.jsx($e,{size:"small",variant:"primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:Vte()}),h.jsx($e,{size:"small",onClick:()=>c({approve:!0,resumeMode:"bypassPermissions"}),children:Xte()}),h.jsx($e,{size:"small",onClick:()=>c({approve:!1}),children:Yie()})]})]})}if(s.kind==="permission"){const f=s.toolInput??{},p=zs(f,"command","cmd","filePath","file_path","path")||"",m=typeof((_=s.toolInput)==null?void 0:_.reason)=="string"&&s.toolInput.reason||"",x=zs(f,"description")||"",S=m||x||sO(s.tool,f),b=`permission-heading-${e.id}`;return h.jsxs("div",{className:`prompt-card permission my-3 w-full max-w-2xl overflow-hidden rounded-md border border-border bg-background shadow-hairline [&.readonly]:opacity-60 ${o?"readonly":""}`,role:"group","aria-labelledby":b,children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3.5 pt-3 pb-0",children:[h.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-accent-amber-subtle text-accent-amber",children:h.jsx(DR,{size:15,strokeWidth:1.8,"aria-hidden":"true"})}),h.jsx("span",{id:b,className:"text-base font-semibold text-text",children:dne()})]}),h.jsxs("div",{className:"flex flex-col gap-3 px-3.5 py-3",children:[h.jsx("div",{className:"prompt-sub text-base font-normal leading-normal text-text wrap-anywhere",children:S}),p&&h.jsx("code",{className:"prompt-command block max-h-36 overflow-auto whitespace-pre-wrap wrap-anywhere rounded-md border border-border-variant bg-surface px-3 py-2 font-mono text-sm leading-relaxed text-text",children:p}),!o&&h.jsxs("div",{className:"prompt-actions flex items-center justify-end gap-2 pt-0.5",children:[h.jsx($e,{size:"small",variant:"ghost",onClick:()=>c({approve:!1}),children:Vre()}),h.jsx($e,{size:"small",variant:"primary",onClick:()=>c({approve:!0}),children:lne()})]})]})]})}const u=f=>a(p=>s.multiSelect?p.includes(f)?p.filter(m=>m!==f):[...p,f]:[f]);return h.jsxs("div",{className:`prompt-card my-2 mx-0 py-3 px-3.5 border border-border border-s-[3px] border-s-border rounded-sm bg-surface flex flex-col gap-[9px] [&.plan]:border-s-accent-blue [&.permission]:border-s-accent-amber [&.question]:border-s-accent-purple [&.readonly]:opacity-60 question ${o?"readonly":""}`,children:[s.header&&h.jsx("div",{className:ivt,children:s.header}),s.question&&h.jsx("div",{className:"prompt-q text-base font-semibold leading-normal text-text",children:s.question}),h.jsx("div",{className:"prompt-options flex flex-col gap-1.5",children:(s.options??[]).map(f=>{const p=i.includes(f.label);return h.jsxs("button",{className:`prompt-option flex flex-col items-start gap-0.5 w-full py-2 px-[11px] text-start border border-border rounded-sm bg-background text-text cursor-pointer transition-[border-color,background] duration-80 ease-standard [&:hover:not(:disabled)]:border-border-strong [&:hover:not(:disabled)]:bg-surface [&.sel]:border-primary [&.sel]:bg-primary-subtle [&:disabled]:cursor-default ${p?"sel":""}`,disabled:o,onClick:()=>o?void 0:s.multiSelect?u(f.label):c({answers:[f.label]}),children:[h.jsx("span",{className:"prompt-option-label block text-sm font-medium",children:f.label}),f.description&&h.jsx("span",{className:"prompt-option-desc block text-sm font-normal leading-[1.45] text-subtext",children:f.description})]},f.label)})}),s.multiSelect&&!o&&h.jsx("div",{className:Q2,children:h.jsx($e,{size:"small",variant:"primary",disabled:i.length===0,onClick:()=>c({answers:i}),children:loe()})})]})}function Rvt(e,n){return e.role==="user"?!0:e.parts.some(t=>eg(t,n))}function Mvt(e){const n=e.text??"",t=n.startsWith("data:")?n:Srt(n),r=n.startsWith("data:")?"":n.includes("__")?n.slice(n.indexOf("__")+2):n,s=e.name||r||"attachment",i=n.startsWith("data:application/pdf")||/\.pdf$/i.test(s)||/\.pdf$/i.test(n);return{src:t,isPdf:i,name:s}}function Lvt({count:e,index:n,prevId:t,nextId:r,onSelect:s,pagerDisabled:i,onEdit:a,editDisabled:o}){const c=e>1;return h.jsxs("div",{className:`fork-controls flex items-center gap-0.5 transition-opacity duration-80 ease-standard ${c?"opacity-100":"opacity-0 group-hover/turn:opacity-100 group-focus-within/turn:opacity-100"}`,children:[c&&h.jsxs(h.Fragment,{children:[h.jsx(Yt,{size:"small",title:c8(),"aria-label":c8(),disabled:i||!t,onClick:()=>t&&s(t),children:h.jsx(wR,{size:14})}),h.jsxs("span",{className:"fork-count text-xs text-subtext tabular-nums select-none",children:[n+1,"/",e]}),h.jsx(Yt,{size:"small",title:l8(),"aria-label":l8(),disabled:i||!r,onClick:()=>r&&s(r),children:h.jsx(co,{size:14})})]}),h.jsx(Yt,{size:"small",title:n8(),"aria-label":n8(),disabled:o,onClick:a,children:h.jsx(N4,{size:13})})]})}const Dvt=T.memo(function({message:n,activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:_,onOpenPlan:f,onOpenSubagent:p,busy:m=!1,recoveringTurnId:x,onRecover:S,skills:b,predictTextTail:v=!1,forkCount:y,forkIndex:w=0,forkPrevId:C,forkNextId:z,forkDisabled:E,branchDisabled:R,onFork:N,onSelectFork:M}){var Y,q;Du();const[O,I]=T.useState(null),H=Ovt(n);if(H)return h.jsx(Ivt,{part:H});if(n.role==="user"){const Q=n.parts.filter(W=>W.type==="text").map(W=>W.text??"").join(` +`),Z=W=>!!(b!=null&&b.some(ie=>ie.name===W)),B=n.parts.filter(W=>W.type==="image"&&W.text).map(Mvt),D=B.filter(W=>!W.isPdf),P=B.filter(W=>W.isPdf),X=n.parts.filter(W=>W.type==="annotation"&&W.text).map(W=>({id:W.id,text:W.text??""}));if(O!==null){const W=()=>{const ie=O.trim();!ie||E||(I(null),N(n.id,ie))};return h.jsx("div",{className:"msg-user-group self-end flex w-full max-w-[88%] flex-col items-end gap-1.5",children:h.jsxs("div",{className:"msg-user-edit w-full bg-surface rounded-[16px] py-2.5 px-[15px] flex flex-col gap-2",children:[h.jsx("textarea",{dir:"auto",className:"w-full bg-transparent text-base text-text resize-none outline-none field-sizing-content min-h-16","aria-label":Jre(),value:O,autoFocus:!0,onChange:ie=>I(ie.target.value),onKeyDown:ie=>{ie.key==="Escape"?(ie.preventDefault(),I(null)):ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing&&(ie.preventDefault(),W())}}),h.jsxs("div",{className:`${Q2} justify-end`,children:[h.jsx($e,{size:"small",onClick:()=>I(null),children:Pne()}),h.jsx($e,{size:"small",variant:"primary",onClick:W,disabled:E||!O.trim(),children:By()})]})]})})}return h.jsxs("div",{className:"msg-user-group group/turn self-end flex max-w-[88%] flex-col items-end gap-1.5",children:[X.length>0&&h.jsx(Q5,{annotations:X,variant:"sent"}),h.jsxs("div",{dir:"auto",className:"msg-user max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere [&_.skill-chip]:me-0.5 [&_.skill-chip]:align-baseline",children:[h.jsx(Tbt,{text:Q,isCommand:Z}),D.length>0&&h.jsx("div",{className:"msg-images flex flex-wrap gap-1.5 mt-2 [&_img]:max-w-55 [&_img]:max-h-40 [&_img]:border [&_img]:border-border-variant [&_img]:rounded-xs [&_img]:block",children:D.map((W,ie)=>h.jsx("a",{href:W.src,target:"_blank",rel:"noreferrer",children:h.jsx("img",{src:W.src,alt:oee()})},ie))}),P.length>0&&h.jsx("div",{className:"msg-files flex flex-wrap gap-1.5 mt-2",children:P.map((W,ie)=>h.jsxs("a",{className:"msg-file inline-flex items-center gap-1.5 max-w-60 py-1.5 px-2.5 border border-border-variant rounded-sm text-text no-underline [&:hover]:border-text [&_span]:overflow-hidden [&_span]:text-ellipsis [&_span]:whitespace-nowrap",href:W.src,target:"_blank",rel:"noreferrer",children:[h.jsx(Gg,{size:15}),h.jsx("span",{children:W.name})]},ie))})]}),y!==void 0&&h.jsx(Lvt,{count:y,index:w,prevId:C,nextId:z,onSelect:M,pagerDisabled:R,onEdit:()=>I(Q),editDisabled:E})]})}const U=n.parts.find(J_),F=U?n.parts.filter(Q=>Q!==U):n.parts;return h.jsxs("div",{className:"msg-assistant group/turn text-base leading-[1.62] text-text min-w-0",children:[aO(F,{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:_,onOpenPlan:f,onOpenSubagent:p,predictTextTail:v}),U&&h.jsx(jvt,{part:U,busy:m,recovering:x===((q=(Y=U.state)==null?void 0:Y.input)==null?void 0:q.turnId),onRecover:S})]})});function Ovt(e){const n=e.parts.length===1?e.parts[0]:void 0;return e.role==="user"&&(n==null?void 0:n.type)==="tool"&&n.tool===XD?n:null}function Ivt({part:e}){var c;const n=e.state,t=zs((n==null?void 0:n.input)??{},"command")??"",r=(n==null?void 0:n.status)==="running",s=(n==null?void 0:n.status)==="error",i=typeof((c=n==null?void 0:n.input)==null?void 0:c.exitCode)=="number"?n.input.exitCode:null,a=[n==null?void 0:n.output,n==null?void 0:n.error].filter(Boolean).join(` +`),o=r?cT():s&&i!==null?See({code:Xt(i)}):null;return h.jsx("div",{className:"msg-shell self-end flex w-full max-w-[88%] flex-col items-stretch gap-1.5",children:h.jsxs("div",{dir:"ltr",className:"max-w-full bg-surface rounded-[16px] py-2.5 px-[15px] text-base",children:[h.jsxs("div",{className:"flex items-start gap-2 font-mono text-sm text-text whitespace-pre-wrap wrap-anywhere",children:[h.jsxs("span",{className:"sr-only",children:[hT()," "]}),h.jsx(Sd,{size:16,strokeWidth:1.6,className:`mt-0.5 shrink-0 ${s?"text-accent-red":"text-muted"}`,"aria-hidden":"true"}),h.jsx("span",{children:t})]}),a&&h.jsx("div",{className:`${Z5} mt-2`,children:a.slice(0,2e4)}),o&&h.jsx("div",{className:`mt-1.5 text-xs ${s?"text-accent-red":"text-muted"}`,children:o})]})})}function aO(e,n){var y,w;const{activePermissionId:t,pendingTailToolId:r,onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u,onRespond:_,onOpenPlan:f,onOpenSubagent:p,predictTextTail:m=!1}=n,x=e.filter(C=>C.type!=="steer"&&eg(C,t)).at(-1),S=[];let b=[];const v=()=>{b.length!==0&&(S.push(h.jsx(Tvt,{parts:b,pendingTail:b.some(C=>C.id===r),onOpenFile:s,onOpenRun:i,onOpenSpawnedSession:a,runExperimentName:o,onOpenExperiment:c,experimentName:u},`tg-${b[0].id}`)),b=[])};for(const C of e)if(eg(C,t)){if(C.type==="tool"&&($vt(C.tool)||(((y=C.children)==null?void 0:y.length)??0)>0)){v(),S.push(h.jsx(Hvt,{part:C,pendingTail:m&&((w=C.state)==null?void 0:w.status)==="running"||C.id===r,onOpenSubagent:p},C.id));continue}if(C.type==="tool"){b.push(C);continue}v(),C.type==="text"?S.push(h.jsx(ro,{text:C.text,onOpenFile:s,onOpenRun:i,predict:m&&C.id===(x==null?void 0:x.id)},C.id)):C.type==="steer"?S.push(h.jsx("div",{dir:"auto",role:"note","aria-label":$oe(),className:"msg-steer my-2 ms-auto w-fit max-w-[88%] bg-surface rounded-[16px] py-2.5 px-[15px] text-base whitespace-pre-wrap wrap-anywhere",children:C.text},C.id)):C.type==="prompt"&&C.prompt&&S.push(h.jsx(Avt,{part:C,onRespond:_,onOpenFile:s,onOpenPlan:f},C.id))}return v(),S}function Bvt(e){return mc(e).label}function $vt(e){const n=(e??"").toLowerCase();return n==="subagent"||n==="task"||n==="agent"}function oO(e){var t,r;const n=((t=e.state)==null?void 0:t.status)==="completed"?((r=e.state)==null?void 0:r.output)??"":"";return n.startsWith("Async agent launched")?"":n}function Qh(e,n){for(const t of e){if(t.id===n)return t;const r=t.children&&Qh(t.children,n);if(r)return r}return null}function Pvt({spawn:e,onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a}){var x,S,b,v;const o=e.children??[],c=((x=e.state)==null?void 0:x.status)==="running",u=((S=e.state)==null?void 0:S.status)==="error",_=u?v1(((b=e.state)==null?void 0:b.error)||((v=e.state)==null?void 0:v.output)||""):"",f=aO(o,{onOpenFile:n,onOpenRun:t,runExperimentName:r,onOpenExperiment:s,experimentName:i,onOpenSubagent:a,predictTextTail:c,pendingTailToolId:c?UR(o):null}),m=o.some(y=>y.type==="text"&&!!y.text)?"":oO(e);return h.jsxs("div",{className:"msg-assistant text-base leading-[1.62] text-text min-w-0",children:[u&&h.jsxs("span",{className:"sr-only",children:[Ww()," "]}),_&&h.jsx("div",{className:Z5,children:_.slice(0,2e4)}),f.length===0&&!m&&!_?h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:c?Kw():Ste()}):h.jsxs(h.Fragment,{children:[f,m&&h.jsx(ro,{text:m,onOpenFile:n,onOpenRun:t})]})]})}function Hvt({part:e,pendingTail:n,onOpenSubagent:t}){var u,_,f,p;const r=((u=e.state)==null?void 0:u.status)==="error",s=v1(((_=e.state)==null?void 0:_.error)||((f=e.state)==null?void 0:f.output)||""),i=n&&!r?J5(mc(e)):mc(e),a=iO(!!(n&&!r)),o=(((p=e.children)==null?void 0:p.length)??0)===0&&!r&&!oO(e),c=h.jsxs(h.Fragment,{children:[r&&h.jsxs("span",{className:"sr-only",children:[Ww()," "]}),r?h.jsx("span",{className:"flex h-6 shrink-0 items-center text-accent-red",children:h.jsx(CR,{size:16,strokeWidth:1.75,className:"subagent-icon","aria-hidden":"true"})}):h.jsx(_g,{activity:i,className:`subagent-icon ${a?"tool-running-shimmer-icon":"text-muted"}`}),h.jsx("span",{className:`${VD} ${a?"tool-running-shimmer":r?"text-accent-red":"text-subtext"}`,children:i.label})]});return o?h.jsx("div",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 text-text text-base text-start rounded-sm",children:c}):h.jsxs("button",{className:"subagent-row flex items-start gap-2 w-full my-3.5 mx-0 py-[3px] px-1 cursor-pointer text-text text-base text-start rounded-sm [&:hover:not(:disabled)]:bg-surface [&:disabled]:cursor-default",title:r&&s?s:$te(),...Nr(m=>t==null?void 0:t(e.id,i.label,m)),disabled:!t,children:[c,h.jsx("span",{className:"subagent-row-chevron flex h-6 shrink-0 items-center text-muted",children:h.jsx(co,{size:12})})]})}function Fvt(e){const n=new Map;let t;for(let s=e.length-1;s>=0;s--)if(e[s].role==="assistant"){t=e[s];break}if(!t)return{messageId:"",states:n};const r=(s,i)=>{var a,o;for(const c of s){const u=`${i}/${c.id}`;c.type==="tool"&&((a=c.state)!=null&&a.status)&&n.set(u,{status:c.state.status,part:c}),(o=c.children)!=null&&o.length&&r(c.children,u)}};return r(t.parts,t.id),{messageId:t.id,states:n}}function e3(e){const n=(t,r)=>{var s;for(const i of t){const a=i.prompt;if(i.type==="prompt"&&(a==null?void 0:a.kind)==="permission"&&!a.resolved){const o=a.toolInput??{},u=zs(o,"reason","description")||sO(a.tool,o);return{id:i.id,path:`${r}/${i.id}`,label:u}}if((s=i.children)!=null&&s.length){const o=n(i.children,`${r}/${i.id}`);if(o)return o}}return null};for(const t of e){if(t.role!=="assistant")continue;const r=n(t.parts,t.id);if(r)return r}return null}function Uvt(e){const[n,t]=T.useState({text:"",sequence:0}),r=T.useRef(null);return T.useEffect(()=>{var x,S,b,v,y;const s=((x=e[0])==null?void 0:x.id)??"",{messageId:i,states:a}=Fvt(e),o=e3(e);if(!r.current||r.current.transcript!==s){r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},t(w=>({text:o?$7({label:Ja(o.label)}):"",sequence:w.sequence+1}));return}const c=r.current.messageId===i?r.current.states:new Map,u=r.current.permissionPath,_=[...a].filter(([w,C])=>{var z;return((z=c.get(w))==null?void 0:z.status)!==C.status});if(r.current={transcript:s,messageId:i,states:a,permissionPath:(o==null?void 0:o.path)??null},o&&o.path!==u){t(w=>({text:$7({label:Ja(o.label)}),sequence:w.sequence+1}));return}const f=(S=_.find(([,w])=>J_(w.part)))==null?void 0:S[1].part;if((f==null?void 0:f.id)==="turn-recovery"){const w=GR((v=(b=f.state)==null?void 0:b.input)==null?void 0:v.recoveryAction);t(C=>({text:`${nX()}${w?` ${w==="retry"?OY():RY()}`:""}`,sequence:C.sequence+1}));return}if((f==null?void 0:f.id)==="turn-retry"){t(w=>({text:zY(),sequence:w.sequence+1}));return}const p=_.filter(([,w])=>w.status==="error");if(p.length>0){const w=p.slice(0,2).map(([,C])=>mc(C.part).label).join(", ");t(C=>({text:p.length===1?KY({labels:w}):QY({count:Xt(p.length),labels:w}),sequence:C.sequence+1}));return}const m=_.filter(([,w])=>w.status==="running");if(m.length>0){const w=(y=m.at(-1))==null?void 0:y[1].part;t(C=>({text:w?J5(mc(w)).label:PY(),sequence:C.sequence+1}));return}_.some(([,w])=>w.status==="completed")&&t(w=>({text:qY(),sequence:w.sequence+1}))},[e]),n}const qvt=T.memo(function({messages:n,allMessages:t,canFork:r,onFork:s,onSelectFork:i,busy:a,onOpenFile:o,onOpenRun:c,onOpenSpawnedSession:u,runExperimentName:_,onOpenExperiment:f,experimentName:p,onRespond:m,onOpenPlan:x,onOpenSubagent:S,recoveringTurnId:b,onRecover:v,skills:y}){var M;Du();const w=((M=e3(n))==null?void 0:M.id)??null,C=T.useMemo(()=>n.filter(O=>Rvt(O,w)),[n,w]),z=T.useMemo(()=>{const O=C.filter(I=>I.role==="user"&&!I.id.startsWith(vu));return Vlt(t,n,O,I=>I.startsWith(vu))},[n,C,t]),E=C.at(-1),R=Uvt(n),N=a?qR(n):null;return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:h.jsx("span",{children:R.text},R.sequence)}),C.map(O=>{var F,Y,q,Q,Z,B;const I=O.parts.find(J_),H=(Y=(F=I==null?void 0:I.state)==null?void 0:F.input)==null?void 0:Y.turnId,U=I?a||b!==null:!1;return h.jsx(Dvt,{message:O,forkCount:(q=z.get(O.id))==null?void 0:q.count,forkIndex:(Q=z.get(O.id))==null?void 0:Q.index,forkPrevId:(Z=z.get(O.id))==null?void 0:Z.prevId,forkNextId:(B=z.get(O.id))==null?void 0:B.nextId,forkDisabled:!r,branchDisabled:a,onFork:s,onSelectFork:i,activePermissionId:w,pendingTailToolId:(N==null?void 0:N.messageId)===O.id?N.toolId:null,onOpenFile:o,onOpenRun:c,onOpenSpawnedSession:u,runExperimentName:_,onOpenExperiment:f,experimentName:p,onRespond:m,onOpenPlan:x,onOpenSubagent:S,busy:U,recoveringTurnId:H===b?b:null,onRecover:v,skills:y,predictTextTail:a&&O===E&&O.role==="assistant"},O.id)})]})}),Gvt=(e,n)=>e==="all"?!0:e==="archived"?n:!n,lO=[{id:"active",label:ene,railLabel:bT},{id:"archived",label:Z7,railLabel:Z7},{id:"all",label:sne,railLabel:dT}];function Vvt({value:e,onChange:n}){const{open:t,setOpen:r,ref:s}=Ea();return h.jsxs("div",{className:"rail-filter relative inline-flex",ref:s,children:[h.jsx(Yt,{size:"small",className:"rail-filter-btn",active:e!=="active",title:a8(),"aria-label":a8(),onClick:()=>r(i=>!i),children:h.jsx(LR,{size:13})}),t&&h.jsx("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right",children:lO.map(i=>h.jsxs(Er,{onClick:()=>{n(i.id),r(!1)},children:[h.jsx("span",{children:i.label()}),e===i.id&&h.jsx(zi,{size:13})]},i.id))})]})}const Wvt=14,Kvt=500,Yvt=1200;function cO({title:e,animate:n}){return n?h.jsx("span",{className:"title-reveal","aria-label":e,children:Array.from(e).map((t,r)=>t===" "?h.jsx("span",{"aria-hidden":!0,children:t},r):h.jsx("span",{"aria-hidden":!0,className:"title-reveal-char inline-block animate-[title-char-in_240ms_ease-out_both] [@media((prefers-reduced-motion:_reduce))]:animate-none",style:{animationDelay:`${Math.min(r*Wvt,Kvt)}ms`},children:t},r))}):h.jsx(h.Fragment,{children:e})}function Xvt({session:e,active:n,unread:t,busy:r,waiting:s,revealTitle:i,onOpen:a,onRename:o,onSetArchived:c,onDelete:u}){var z;const{open:_,setOpen:f,ref:p}=Ea(),m=((z=e.title)==null?void 0:z.trim())||"Untitled",[x,S]=T.useState(!1),[b,v]=T.useState(""),y=T.useRef(null);function w(){var E;v(((E=e.title)==null?void 0:E.trim())||""),S(!0)}function C(){var R;const E=b.trim();S(!1),E&&E!==(((R=e.title)==null?void 0:R.trim())||"")&&o(E)}return T.useEffect(()=>{var E,R;x&&((E=y.current)==null||E.focus(),(R=y.current)==null||R.select())},[x]),h.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row relative flex items-center gap-2 w-full text-start py-[7px] px-2.5 rounded-md text-sm text-text cursor-pointer select-none [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium [&_.session-dot]:w-3.5 [&_.session-dot]:inline-flex [&_.session-dot]:items-center [&_.session-dot]:justify-center [&_.session-dot]:shrink-0 [&_.session-title]:flex-1 [&_.session-title]:min-w-0 [&_.session-title]:overflow-hidden [&_.session-title]:text-ellipsis [&_.session-title]:whitespace-nowrap [&.unread_.session-title]:font-semibold [&_.session-time]:text-xs [&_.session-time]:text-muted [&_.session-time]:shrink-0 [&_.session-menu-btn]:hidden [&_.session-menu-btn]:items-center [&_.session-menu-btn]:justify-center [&_.session-menu-btn]:w-4 [&_.session-menu-btn]:h-4 [&_.session-menu-btn]:-my-0.5 [&_.session-menu-btn]:mx-0 [&_.session-menu-btn]:rounded-sm [&_.session-menu-btn]:text-muted [&_.session-menu-btn]:shrink-0 [&_.session-menu-btn:hover]:text-text [&_.session-menu-btn:hover]:bg-panel [&:hover_.session-menu-btn]:inline-flex [&:focus-within_.session-menu-btn]:inline-flex [&.menu-open_.session-menu-btn]:inline-flex [&:hover_.session-time]:hidden [&:focus-within_.session-time]:hidden [&.menu-open_.session-time]:hidden [&_.busy-dot]:w-[7px] [&_.busy-dot]:h-[7px] [&_.busy-dot]:rounded-full [&_.busy-dot]:bg-primary [&_.busy-dot]:animate-[or-pulse_1.2s_infinite] [&_.busy-dot]:shrink-0 [&_.unread-dot]:w-[7px] [&_.unread-dot]:h-[7px] [&_.unread-dot]:rounded-full [&_.unread-dot]:bg-primary [&_.unread-dot]:shrink-0 [&_.busy-dot.waiting]:animate-none [&_.session-title-input]:flex-1 [&_.session-title-input]:min-w-0 [&_.session-title-input]:py-px [&_.session-title-input]:px-[5px] [&_.session-title-input]:-my-0.5 [&_.session-title-input]:mx-0 [&_.session-title-input]:[font:inherit] [&_.session-title-input]:text-text [&_.session-title-input]:bg-background [&_.session-title-input]:border [&_.session-title-input]:border-primary [&_.session-title-input]:rounded-sm [&_.session-title-input]:outline-none [&.editing]:bg-surface [&.editing]:cursor-default [&.editing_.session-menu-btn]:hidden [&.editing_.session-time]:hidden ${n?"active":""} ${t?"unread":""} ${_?"menu-open":""} ${x?"editing":""}`,title:`${Bh[e.harness]}${e.model?` · ${e.model}`:""}${e.parentSessionId?Qle():""}`,onClick:()=>{x||(_?f(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),_?f(!1):a())},children:[h.jsx("span",{className:"session-dot",children:r?h.jsx("span",{className:`busy-dot ${s?"waiting":""}`}):t&&h.jsx("span",{className:"unread-dot"})}),e.parentSessionId&&!x&&h.jsx(T4,{className:"text-muted shrink-0",size:12,"aria-hidden":!0}),x?h.jsx("input",{ref:y,className:"session-title-input","aria-label":Pae(),value:b,onChange:E=>v(E.target.value),onClick:E=>E.stopPropagation(),onBlur:C,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),C()):E.key==="Escape"&&(E.preventDefault(),S(!1))}}):h.jsx("span",{className:"session-title",children:h.jsx(cO,{title:m,animate:i!==void 0},i??"static")}),h.jsx("span",{className:"session-time",children:ovt(e.updatedAt)}),h.jsx("button",{className:"session-menu-btn",title:_8(),"aria-label":_8(),onClick:E=>{E.stopPropagation(),f(R=>!R)},children:h.jsx(S4,{size:14})}),_&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down session-menu",children:[h.jsx(Er,{onClick:E=>{E.stopPropagation(),f(!1),w()},children:h.jsx("span",{children:pT()})}),h.jsx(Er,{onClick:E=>{E.stopPropagation(),f(!1),c(!e.archived)},children:h.jsx("span",{children:e.archived?Ice():YJ()})}),h.jsx(Er,{danger:!0,onClick:E=>{E.stopPropagation(),f(!1),u()},children:h.jsx("span",{children:_T()})})]})]})}const wN=[yR,RR,Sd,k4],dy=[{box:"border-accent-blue/45",icon:"text-accent-blue"},{box:"border-accent-green/45",icon:"text-accent-green"},{box:"border-accent-amber/45",icon:"text-accent-amber"},{box:"border-primary/45",icon:"text-primary"}],SN="mt-7 grid w-full max-w-readable grid-cols-1 gap-3 sm:grid-cols-2";function Zvt({onClose:e,onConfigureSsh:n}){const[t,r]=T.useState(null),[s,i]=T.useState([]),[a,o]=T.useState(""),[c,u]=T.useState(null),[_,f]=T.useState(null),p=T.useRef(null);T.useEffect(()=>{Promise.all([NA(),Mnt()]).then(([b,v])=>{r(b),i(v)}).catch(b=>u(b instanceof Error?b.message:String(b)))},[]),d4(p,e);async function m(b){const v=window.open("/remote-launch","_blank");if(!v){Vn(MNe(),"error");return}f(b);try{const y=await Lnt(b,{theme:Lrt(),locale:j()});v.location.replace(y.gatewayUrl),e()}catch(y){v.close(),Vn(y instanceof Error?y.message:String(y),"error")}finally{f(null)}}const x=t==null?void 0:t.filter(b=>b.host.toLocaleLowerCase().includes(a.trim().toLocaleLowerCase())),S=new Map(s.map(b=>[b.host,b]));return al.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",onClick:b=>{b.target===b.currentTarget&&e()},children:h.jsxs("div",{ref:p,className:"relative flex h-[min(42rem,calc(100vh-2.5rem))] w-160 max-w-full flex-col overflow-hidden rounded-xl border border-border bg-background shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"remote-host-dialog-title",tabIndex:-1,children:[h.jsx(Yt,{className:"absolute end-3.5 top-3.5","aria-label":uEe(),onClick:e,children:h.jsx(Dr,{size:16})}),h.jsxs("div",{className:"shrink-0 px-6 pt-5 pb-4 pe-14",children:[h.jsx("h2",{id:"remote-host-dialog-title",className:"m-0 text-xl font-medium",children:BT()}),h.jsx("p",{className:"mt-2 mb-0 text-sm leading-normal text-subtext",children:_Ee()}),h.jsx(Ts,{"data-initial-focus":!0,className:"mt-4",value:a,onChange:b=>o(b.target.value),placeholder:tC(),"aria-label":tC()})]}),h.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border-variant p-2",children:c?h.jsx("p",{className:"m-3 text-sm text-accent-red",children:c}):t===null?h.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-subtext",children:[h.jsx(Ot,{})," ",tA()]}):(x==null?void 0:x.length)===0?h.jsx("p",{className:"m-3 text-sm text-subtext",children:gNe()}):x==null?void 0:x.map(b=>{const v=S.get(b.host);return h.jsxs($e,{variant:"ghost",className:"w-full justify-start text-base font-normal",disabled:_===b.host,onClick:()=>void m(b.host),children:[h.jsx("span",{className:"min-w-0 flex-1 truncate text-start",children:b.host}),_===b.host?h.jsx(Ot,{}):v?h.jsx("span",{className:"text-sm text-subtext",children:CNe()}):null]},b.host)})}),h.jsx("div",{className:"shrink-0 border-t border-border-variant p-2",children:h.jsxs($e,{variant:"ghost",className:"w-full justify-start text-base font-normal",onClick:n,children:[h.jsx(LR,{size:15}),fA()]})})]})}),document.body)}function Qvt({projectId:e,projectName:n,railHeader:t,railOpen:r,onShowRail:s,mainView:i,onSelectMainView:a,experimentsActive:o,filesActive:c,artifactsActive:u,onOpenExperiments:_,onOpenArtifacts:f,onOpenFile:p,onOpenRun:m,runExperimentName:x,onOpenExperiment:S,experimentName:b,onOpenPlan:v,onOpenSubagent:y,onOpenWorktree:w,runtime:C,onOpenDemoWelcome:z,composerPrefill:E=null,activeSessionId:R,onActiveSessionChange:N,preferredAgent:M,onPreferredAgentChange:O,children:I}){var Lc,ia,vl;const[H,U]=T.useState([]),[F,Y]=T.useState(!1),[q,Q]=T.useState(!1),Z=R,B=T.useRef(N);B.current=N;const D=T.useRef({projectId:e});D.current.projectId!==e&&(D.current={projectId:e});const[P,X]=T.useState(new Set),[W,ie]=T.useState("active"),[le,ae]=T.useState(""),[se,G]=T.useState([]),oe=T.useRef(0),ce=T.useRef({projectId:e,activeId:Z,mainView:i});(ce.current.projectId!==e||ce.current.activeId!==Z||ce.current.mainView!==i)&&(ce.current={projectId:e,activeId:Z,mainView:i});const[pe,ue]=T.useState([]),[Ee,Te]=T.useState(null),[Ie,Le]=T.useState(null),He=T.useRef(Promise.resolve()),Tt=T.useRef(0),Et=T.useRef(0),[Vt,$t]=T.useState(null),rt=T.useRef(null),nt=T.useRef(!1),ut=T.useRef(null),[pt,ve]=T.useReducer(avt,{messagesBySession:{},busySessions:new Set,queuedBySession:{},activeLeafBySession:{}}),[Oe,Je]=T.useState([]),[ft,mt]=T.useState(M);T.useEffect(()=>mt(M),[M]);const[Ht,Fe]=T.useState({}),[Pt,Jt]=T.useState({}),[nn,Lt]=T.useState(null),Rn=T.useRef(!1),Kt=T.useRef(null),[Gn,cr]=T.useState(null),vn=T.useRef(null),[wr,Qn]=T.useState(new Map),Wn=T.useRef(new Map),Mn=T.useRef(new Set),gt=T.useRef(new Set),an=T.useRef(0),Ge=T.useRef([]),at=T.useRef(null),rn=T.useRef(null),Nt=T.useRef(!0),[on,Qe]=T.useState(!0),bt=T.useRef(null),ln=Ea(),Sr=T.useCallback(te=>{var be;oe.current+=1,G(Ne=>[...Ne,{id:`annotation-${oe.current}`,...te}]),(be=bt.current)==null||be.focus()},[]),yn=Qbt(rn,Sr);Jbt(se),T.useEffect(()=>{G([]),yn.dismiss()},[Z,e,yn.dismiss]);const[dt,Ct]=T.useState([]),[_n,hr]=T.useState(0),[ls,Hr]=T.useState(!1),[Ms,ts]=T.useState(0),Ls=T.useRef(!1);T.useEffect(()=>{ort().then(Ct).catch(()=>{})},[i]);function Fr(te){if(!ur)return;if(te.source==="command"&&te.name==="plan"){hl(le,ur);return}const be=cN(le,ur,te.name,2);ae(be.text),window.requestAnimationFrame(()=>{var Ne,Me;(Ne=bt.current)==null||Ne.focus(),(Me=bt.current)==null||Me.setSelectionRange(be.cursor,be.cursor),ts(be.cursor)})}function ns(te){const be=te.selectionStart;if(Ls.current||be!==te.selectionEnd)return!1;const Ne=sy(le,be);if(!Ne||Ne.end!==be||!pl(Ne.query))return!1;const Me=uN(le,Ne);return ae(Me.text),ts(Me.cursor),window.requestAnimationFrame(()=>te.setSelectionRange(Me.cursor,Me.cursor)),!0}function cs(te){Te(null);let Me=pe.reduce((Ue,ot)=>Ue+ot.size,0);for(const Ue of te){if(!/^(image\/(png|jpeg|gif|webp)|application\/pdf)$/.test(Ue.type))continue;if(Ue.size>31457280){Te(fee({name:ze(Ue.name)}));continue}if(Me+Ue.size>41943040){Te(pee());continue}Me+=Ue.size;const ot=new FileReader;ot.onload=()=>{const J=ot.result;ue(de=>[...de,{dataUrl:J,mediaType:Ue.type,name:Ue.name,size:Ue.size}])},ot.readAsDataURL(Ue)}}function Ds(te){const be=Array.from(te.clipboardData.items).filter(Ne=>Ne.kind==="file"&&(Ne.type.startsWith("image/")||Ne.type==="application/pdf")).map(Ne=>Ne.getAsFile()).filter(Ne=>Ne!==null);be.length>0&&(te.preventDefault(),cs(be))}const Zt=H.find(te=>te.id===Z),Pn=ft??Rlt(Oe),rs=Zt?{harness:Zt.harness,model:Ht.model??Zt.model,serviceTier:Ht.serviceTier!==void 0?Ht.serviceTier:Zt.serviceTier,permissionMode:Ht.permissionMode??Zt.permissionMode,reasoningLevel:Ht.reasoningLevel??Zt.reasoningLevel}:Pn?{...Pn,...Ht}:null,tt=rs?Oe.find(te=>te.id===rs.harness):void 0,At=tt==null?void 0:tt.options,ss=T.useMemo(()=>Cbt(dt,At==null?void 0:At.planActivation),[dt,At==null?void 0:At.planActivation]),Ur=hN(le),Ks=Ur!==null,ur=sy(le,Ms),xs=(ur==null?void 0:ur.query)??null,qr=xs===null?[]:ss.filter(te=>te.name.startsWith(xs)),Cn=!Ks&&xs!==null&&(ur==null?void 0:ur.end)===Ms&&qr.some(te=>te.name!==xs)&&!ls?qr:[],On=Cn.length>0,Gr=Math.min(_n,Math.max(0,Cn.length-1));T.useEffect(()=>hr(0),[xs]);const zr=rs&&tt&&tt.models.length>0&&!tt.models.some(te=>te.id===rs.model)?tt.models[0].id:(rs==null?void 0:rs.model)??null,Ut=rs&&{...rs,model:zr,serviceTier:Km(tt,zr,rs.serviceTier),reasoningLevel:DA(tt,zr,rs.reasoningLevel)},ci=$g(tt,Ut==null?void 0:Ut.model),Ii=te=>{if(!Ut)return;const be={...Ut,...te},Ne={};te.model!==void 0&&te.model!==Ut.model&&(Ne.model=te.model),te.serviceTier!==void 0&&te.serviceTier!==Ut.serviceTier&&(Ne.serviceTier=te.serviceTier),te.permissionMode!==void 0&&te.permissionMode!==Ut.permissionMode&&(Ne.permissionMode=te.permissionMode),te.reasoningLevel!==void 0&&te.reasoningLevel!==Ut.reasoningLevel&&(Ne.reasoningLevel=te.reasoningLevel),Jt(Me=>({...Me,...Ne})),mt(be),O(be).catch(()=>{}),Zt?Fe(Me=>({...Me,...te})):te.harness&&te.harness!==Ut.harness&&Fe({})},Vr=T.useCallback(te=>{const be=He.current.catch(()=>{}).then(te);return He.current=be.then(()=>{},()=>{}),be},[]),_r=te=>{if(te==="plan"&&(tt==null?void 0:tt.id)==="claude-code"?(Jt(Me=>({...Me,permissionMode:te})),Fe(Me=>({...Me,permissionMode:te}))):(Fe(Me=>{const Ue={...Me};return delete Ue.permissionMode,Ue}),Ii({permissionMode:te})),!Zt)return;const be=Zt.id,Ne=++Tt.current;Le(null),Vr(()=>xrt(be,te)).then(Me=>{U(Ue=>Ue.map(ot=>ot.id===Me.id?Me:ot)),Tt.current===Ne&&Fe(Ue=>{const ot={...Ue};return delete ot.permissionMode,ot})}).catch(()=>{Tt.current===Ne&&(Fe(Me=>{const Ue={...Me};return delete Ue.permissionMode,Ue}),Le(qce()))})},go=te=>Ii({reasoningLevel:te}),us=(Ut==null?void 0:Ut.harness)==="claude-code"?Ut.permissionMode==="plan":(At==null?void 0:At.planActivation)==="command"?Vt??(Zt==null?void 0:Zt.planMode)??!1:!1;T.useEffect(()=>{Vt===null||(Zt==null?void 0:Zt.planMode)!==Vt||(rt.current=null,$t(null))},[Zt==null?void 0:Zt.planMode,Vt]);async function sa(te){if(Jt(Me=>({...Me,planMode:te})),rt.current=te,$t(te),!Zt)return;const be=Zt.id,Ne=++Et.current;Le(null);try{const Me=await Vr(()=>vrt(be,te));U(Ue=>Ue.map(ot=>ot.id===Me.id?Me:ot)),Et.current===Ne&&(rt.current=null,$t(null),Le(null))}catch(Me){throw Et.current===Ne&&(rt.current=null,$t(null)),Me}}async function Os(){if((Ut==null?void 0:Ut.harness)==="claude-code"){_r("auto");return}if(Zt)try{await sa(!1)}catch{Le(Vee())}}async function ja(){const te=!us;try{if((Ut==null?void 0:Ut.harness)==="claude-code")_r(te?"plan":"auto");else if((At==null?void 0:At.planActivation)==="command")await sa(te);else throw new Error(tx())}catch{Le(v8())}}function hl(te,be){const Ne=uN(te,be);ae(Ne.text),Hr(!0),ja(),window.requestAnimationFrame(()=>{var Me,Ue;(Me=bt.current)==null||Me.focus(),(Ue=bt.current)==null||Ue.setSelectionRange(Ne.cursor,Ne.cursor),ts(Ne.cursor)})}Ge.current=H;const Wr=T.useCallback(async()=>{const te=D.current;if(te.projectId!==e)return null;const be=Ge.current.map(Ne=>Ne.id);try{const Ne=await gu(e);if(D.current!==te)return null;const Me=Ne.filter(ot=>!gt.current.has(ot.id)),Ue=new Set(Me.map(ot=>ot.id));for(const ot of be)Ue.has(ot)||La(ot);return U(ot=>{const J=new Map(ot.map(de=>[de.id,de.contextUsage]));return Me.map(de=>({...de,contextUsage:de.contextUsage??J.get(de.id)}))}),Wn.current=new Map(Me.map(ot=>[ot.id,ot.title])),ve({type:"seedBusy",sessions:Me.filter(ot=>ot.busy).map(ot=>ot.id),known:Me.map(ot=>ot.id)}),Me}catch{return null}},[e]),Ta=T.useCallback(async te=>{const be=D.current;if(be.projectId!==e)return;const Ne=ce.current.activeId===te?Kt.current:void 0,[{messages:Me,queued:Ue,activeLeafId:ot}]=await Promise.all([uu(te),Wr()]);if(D.current!==be)return;const J=Ne!==void 0&&ce.current.activeId===te&&Kt.current!==Ne;ve({type:"seed",sessionId:te,messages:Me,queued:Ue,activeLeafId:J?Kt.current:ot})},[e,Wr,ve]);T.useEffect(()=>{U([]),Ge.current=[];const te=gR();X(e===hC?new Set([mA,gA].filter(Ne=>!te.has(Ne))):new Set),ae(""),ue([]),ve({type:"reset"}),Mn.current=new Set,Qn(new Map),Wn.current=new Map,Wr();const be=D.current;return()=>{D.current===be&&(D.current={projectId:e})}},[e,Wr]),T.useEffect(()=>{Jt({}),vn.current=null},[Z]),T.useEffect(()=>{if(!Z||Mn.current.has(Z))return;const te=D.current;Mn.current.add(Z),uu(Z).then(({messages:be,queued:Ne,activeLeafId:Me})=>{D.current===te&&ve({type:"seed",sessionId:Z,messages:be,queued:Ne,activeLeafId:Me})}).catch(()=>{D.current===te&&(ve({type:"seed",sessionId:Z,messages:[],onlyIfAbsent:!0}),Mn.current.delete(Z))})},[Z,e]),T.useEffect(()=>lc(te=>{switch(te.type){case"session":{if(te.session.projectId!==e||gt.current.has(te.session.id))return;const be=Wn.current.has(te.session.id),Ne=Wn.current.get(te.session.id)!==te.session.title;Wn.current.set(te.session.id,te.session.title),be&&Ne&&te.session.titleSource==="generated"&&(Qn(Me=>{const Ue=new Map(Me);return Ue.set(te.session.id,(Me.get(te.session.id)??0)+1),Ue}),window.setTimeout(()=>{Qn(Me=>{if(!Me.has(te.session.id))return Me;const Ue=new Map(Me);return Ue.delete(te.session.id),Ue})},Yvt)),U(Me=>{const Ue=Me.findIndex(J=>J.id===te.session.id);if(Ue<0)return[te.session,...Me];const ot=Me.slice();return ot[Ue]={...te.session,contextUsage:te.session.contextUsage??Me[Ue].contextUsage},ot});break}case"sessionDeleted":La(te.sessionId);break;case"message":an.current++,ve({type:"upsertMessage",sessionId:te.sessionId,message:te.message});break;case"busy":ve({type:"busy",sessionId:te.sessionId,busy:te.busy});break;case"queued":ve({type:"setQueued",sessionId:te.sessionId,items:te.items});break;case"branch":ve({type:"activeLeaf",sessionId:te.sessionId,leafId:te.activeLeafId});break;case"usage":U(be=>be.map(Ne=>Ne.id===te.sessionId?{...Ne,contextUsage:te.usage}:Ne));break}}),[e]),T.useEffect(()=>lc(te=>{if(te.type!=="reconnected"||(Wr(),!Z||!Mn.current.has(Z)))return;const be=D.current,Ne=Me=>{const Ue=an.current;uu(Z).then(({messages:ot,queued:J,activeLeafId:de})=>{D.current===be&&(ve({type:"seed",sessionId:Z,messages:ot,queued:J,activeLeafId:de}),Me&&an.current!==Ue&&Ne(!1))}).catch(()=>{})};Ne(!0)}),[Z,Wr]);const bo=Z?pt.messagesBySession[Z]??bN:bN,vo=Z?pt.activeLeafBySession[Z]??null:null;Kt.current=vo;const Kr=T.useMemo(()=>qlt(bo,vo),[bo,vo]),Jn=Z?pt.busySessions.has(Z):!1,kc=!Jn&&!!(tt!=null&&tt.agentReady),Aa=Jn&&qR(Kr)!=null,ui=Jn&&Wlt(Kr),Ft=Z?pt.queuedBySession[Z]??[]:[],ys=Ft.some(te=>te.dispatchState==="retrying"),fi=Ft.findIndex(te=>te.dispatchState==="blocked"),Yr=Ft.reduce((te,be)=>be.dispatchState!=="retrying"||typeof be.nextRetryAt!="number"?te:te===null?be.nextRetryAt:Math.min(te,be.nextRetryAt),null),[xo,Ra]=T.useState(()=>Date.now());T.useEffect(()=>{if(!ys||Yr===null||(Ra(Date.now()),Yr<=Date.now()))return;const te=window.setInterval(()=>{const be=Date.now();Ra(be),be>=Yr&&window.clearInterval(te)},1e3);return()=>window.clearInterval(te)},[ys,Yr]),T.useEffect(()=>{const te=Ft.reduce((be,Ne)=>Ne.planMode??be,void 0);te!==void 0?(nt.current=!0,rt.current=te,$t(te)):nt.current&&(nt.current=!1,rt.current=null,$t(null))},[Ft]);const _l=!!Z&&!(Z in pt.messagesBySession),Bi=T.useMemo(()=>{const te=new Set;for(const be of pt.busySessions)(pt.messagesBySession[be]??[]).some(Ne=>Ne.parts.some(Me=>Me.type==="prompt"&&Me.prompt&&!Me.prompt.resolved&&Me.prompt.nativeId))&&te.add(be);return te},[pt.busySessions,pt.messagesBySession]),Is=Z?Bi.has(Z):!1,Kn=Zt,di=Kn?wr.get(Kn.id):void 0,er=T.useMemo(()=>{var te;for(let be=Kr.length-1;be>=0;be--)for(const Ne of Kr[be].parts)if(Ne.type==="prompt"&&((te=Ne.prompt)==null?void 0:te.kind)==="plan"&&!Ne.prompt.resolved)return{promptId:Ne.id,plan:Ne.prompt.plan??"",synthesized:!!Ne.prompt.synthesized};return null},[Kr]),Bs=T.useMemo(()=>{const te=Kn==null?void 0:Kn.harness;if(!Z||te!=="claude-code"&&te!=="codex")return null;for(let be=Kr.length-1;be>=0;be--)for(const Ne of Kr[be].parts)if(!(Ne.type!=="prompt"||!Ne.prompt||Ne.prompt.resolved)&&Ne.prompt.kind==="question")return Ne.prompt.nativeId&&!pt.busySessions.has(Z)?null:Ne.id;return null},[Kr,Kn==null?void 0:Kn.harness,Z,pt.busySessions]),pr=Ks&&!Bs,pl=te=>!Bs&&!Ks&&ss.some(be=>be.name===te),[$s,hi]=T.useState(null),Cc=$s&&$s.sessionId===Z?$s:null;T.useEffect(()=>{if(!$s)return;const te=pt.busySessions.has($s.sessionId),be=$s.sessionId===Z&&er&&er.promptId!==$s.promptId;(!te||be)&&hi(null)},[$s,er,pt.busySessions,Z]);const jr=T.useMemo(()=>e3(Kr),[Kr]),_i=Jn&&!!(tt!=null&&tt.supportsSteering)&&!!(tt!=null&&tt.agentReady)&&!er&&!Bs&&!jr&&pe.length===0&&se.length===0,$i=T.useMemo(()=>v&&Z?(te,be,Ne)=>v(te,Z,be,Ne):void 0,[v,Z]),Ma=T.useMemo(()=>y&&Z?(te,be,Ne)=>y(Z,te,be,Ne):void 0,[y,Z]),Ld=T.useMemo(()=>p&&((te,be,Ne,Me,Ue)=>p(te,Z??void 0,be,Ne,Me,Ue)),[p,Z]);T.useEffect(()=>{Tt.current+=1,Et.current+=1;const te=(Z?pt.queuedBySession[Z]??[]:[]).reduce((be,Ne)=>Ne.planMode??be,void 0);nt.current=te!==void 0,rt.current=te??null,$t(te??null),Fe({}),Le(null)},[Z]);const ws=i==="chat"&&(Kr.length>0||Jn),Ss=(Ut==null?void 0:Ut.harness)??null,pi=(Ut==null?void 0:Ut.model)??null,[Ys,ml]=T.useState(null),ks=(Ys==null?void 0:Ys.projectId)===e&&(Ys.prompts!==null||Ys.harness===Ss),Fu=i==="chat"&&!ws&&!_l;T.useEffect(()=>{if(!Fu||!Ss||ks)return;let te=!0;return Ktt(e,Ss,pi,j()).then(be=>{te&&ml({projectId:e,harness:Ss,prompts:be.prompts})}).catch(()=>{te&&ml({projectId:e,harness:Ss,prompts:null})}),()=>{te=!1}},[e,Ss,pi,ks,Fu]);const Ec=ks&&Ys?Ys.prompts:null,Nc=Ss!==null&&!ks,Dd=te=>{ae(te),Hr(!1),window.requestAnimationFrame(()=>{const be=bt.current;be&&(be.focus(),be.setSelectionRange(te.length,te.length),ts(te.length))})};T.useEffect(()=>{E&&(ae(E),Hr(!1),ts(E.length))},[E]);const gl=T.useCallback(te=>{const be=te.scrollHeight-te.scrollTop-te.clientHeight<60;Nt.current=be,Qe(be)},[]),Xs=T.useCallback(()=>{Nt.current=!0,Qe(!0);const te=at.current;te&&(te.scrollTop=te.scrollHeight)},[]);T.useLayoutEffect(()=>{Xs()},[Z,ws,Xs]),T.useLayoutEffect(()=>{Nt.current&&Xs()},[Kr,Jn,Xs]),T.useEffect(()=>{const te=at.current,be=rn.current;if(!te||!be)return;const Ne=new ResizeObserver(()=>{if(Nt.current){te.scrollTop=te.scrollHeight;return}gl(te)});return Ne.observe(be),Ne.observe(te),()=>Ne.disconnect()},[ws,gl]);const Uu=T.useCallback(te=>{te.currentTarget.blur(),Xs()},[Xs]);async function zc({queue:te=!1}={}){var Cs,xl,$d,Pd,Hd;const be=le.trim(),Ne=Bs?null:Ebt(be,At==null?void 0:At.planActivation),Me=!!Ne,Ue=!us,ot=fN(At==null?void 0:At.planActivation,Me?Ue:void 0,rt.current),J=Me&&(tt==null?void 0:tt.id)==="claude-code"?Ue?"plan":"auto":void 0,de=Ne?Ne.prompt:be,ye=pe,Ae=se,ke=Ae.map(Nn=>({text:Nn.text})),Ye=e,et=i;let vt=Z;const sn=()=>{const Nn=ce.current;return Nn.projectId===Ye&&Nn.activeId===vt&&Nn.mainView===et},br=()=>{sn()&&(ae(Nn=>Nn||be),ue(Nn=>Nn.length?Nn:ye),G(Nn=>Nn.length?Nn:Ae))};if(Me&&!de&&ye.length===0&&Ae.length===0){ae(""),Hr(!1);try{if((tt==null?void 0:tt.id)==="claude-code")_r(Ue?"plan":"auto");else if((At==null?void 0:At.planActivation)==="command")await sa(Ue);else throw new Error(tx())}catch{Le(v8()),br()}return}const wn=Ut?{...Ut,...J?{permissionMode:J}:{}}:null;J&&_r(J);let ds=null;const Pi=rt.current;Me&&(At==null?void 0:At.planActivation)==="command"&&(ds=++Et.current,rt.current=Ue,$t(Ue));const aa=()=>{!sn()||ds===null||Et.current!==ds||(rt.current=Pi,$t(Pi))};if(!de&&ye.length===0&&Ae.length===0)return;if((de||Ae.length>0)&&Bs&&ye.length===0){ae(""),G([]),mr({promptId:Bs,answers:[],note:de||void 0,annotations:ke}).then(Nn=>{Nn||br()});return}const Oa=JSON.stringify({text:de,images:ye.map(Nn=>({mediaType:Nn.mediaType,name:Nn.name,dataUrl:Nn.dataUrl})),annotations:ke,settings:wn?{model:wn.model,serviceTier:wn.serviceTier,permissionMode:wn.permissionMode,planMode:ot,reasoningLevel:wn.reasoningLevel}:null}),oa=((Cs=vn.current)==null?void 0:Cs.signature)===Oa?vn.current.id:`ct_${crypto.randomUUID()}`;if(vn.current={signature:Oa,id:oa},Jn){if(!Z||!(tt!=null&&tt.agentReady)){aa();return}const Nn=Z;ae(""),ue([]),G([]),Te(null);const la=wn?{model:wn.model,serviceTier:wn.serviceTier,permissionMode:wn.permissionMode,planMode:(At==null?void 0:At.planActivation)==="command"?ot??(Zt==null?void 0:Zt.planMode):ot,reasoningLevel:wn.reasoningLevel}:{};sn()&&Fe({});const Co=ye.map(tr=>({mediaType:tr.mediaType,dataBase64:tr.dataUrl.slice(tr.dataUrl.indexOf(",")+1),name:tr.name}));try{(xl=(await Vr(()=>wC(Nn,de,la,Co.length?Co:void 0,ke,oa,_i&&!te&&!Me?"steer":void 0))).turn)!=null&&xl.existing&&await Ta(Nn),sn()&&Jt({}),(($d=vn.current)==null?void 0:$d.id)===oa&&(vn.current=null)}catch{aa(),br()}return}if(!(tt!=null&&tt.agentReady)){aa();return}if(!wn){aa();return}ae(""),ue([]),G([]),Te(null);let Ps=Z;try{if(!Ps){const Xr=await yo(wn,ot);Ps=Xr.id,vt=Xr.id}ve({type:"optimisticUser",sessionId:Ps,text:de||ree(),attachments:ye.map(Xr=>({url:Xr.dataUrl,mediaType:Xr.mediaType,name:Xr.name})),annotations:Ae}),ve({type:"busy",sessionId:Ps,busy:!0}),sn()&&Xs(),sn()&&W==="archived"&&ie("active");const Nn=wn?{model:wn.model,serviceTier:wn.serviceTier,permissionMode:wn.permissionMode,planMode:ot,reasoningLevel:wn.reasoningLevel}:{};sn()&&Fe({});const la=ye.map(Xr=>({mediaType:Xr.mediaType,dataBase64:Xr.dataUrl.slice(Xr.dataUrl.indexOf(",")+1),name:Xr.name})),Co=Ps;if(!Co)throw new Error(Kle());(Pd=(await Vr(()=>wC(Co,de,Nn,la.length?la:void 0,ke,oa))).turn)!=null&&Pd.existing&&await Ta(Co),sn()&&Jt({}),((Hd=vn.current)==null?void 0:Hd.id)===oa&&(vn.current=null)}catch(Nn){if(br(),aa(),!Ps)return;const la=Nn instanceof Error?Nn.message:String(Nn);if(!/session is busy/i.test(la)&&await gu(e).then(tr=>{var yl;return!!((yl=tr.find(Xr=>Xr.id===Ps))!=null&&yl.busy)}).catch(()=>!1)){sn()&&(ae(tr=>tr===de?"":tr),ue(tr=>tr===ye?[]:tr),G(tr=>tr===Ae?[]:tr));return}ve({type:"busy",sessionId:Ps,busy:!1}),ve({type:"localError",sessionId:Ps,text:dte({error:ze(la)})})}}async function yo(te,be){const Ne=ce.current,Me=D.current,Ue=await prt(e,te.harness,{model:te.model,serviceTier:te.serviceTier,permissionMode:te.permissionMode,planMode:be,reasoningLevel:te.reasoningLevel});return D.current===Me&&(Mn.current.add(Ue.id),U(ot=>[Ue,...ot.filter(J=>J.id!==Ue.id)])),D.current===Me&&ce.current===Ne&&(B.current(Ue.id,{replace:!0}),ce.current={...Ne,activeId:Ue.id}),Ue}function qu(){const te=Dbt(le);ae(te),window.requestAnimationFrame(()=>{var be,Ne;(be=bt.current)==null||be.focus(),(Ne=bt.current)==null||Ne.setSelectionRange(te.length,te.length),ts(te.length)})}async function Gu(){const te=Ur;if(!te)return;if(Le(null),Jn){Le(vee());return}const be=le,Ne=ce.current;let Me=Z;const Ue=()=>{const ye=ce.current;return ye.projectId===Ne.projectId&&ye.activeId===Me&&ye.mainView===Ne.mainView},ot=()=>{Ue()&&ae(ye=>ye||be)};ae(""),Hr(!1);let J=Z;if(!J){if(!(tt!=null&&tt.agentReady)||!Ut){ot(),Le(tx());return}try{const ye=fN(At==null?void 0:At.planActivation,void 0,rt.current);J=(await yo(Ut,ye)).id,Me=J,Ue()&&Fe({})}catch(ye){ot();const Ae=ye instanceof Error?ye.message:String(ye);Ue()&&Le(K7({error:ze(Ae)}));return}}Ue()&&W==="archived"&&ie("active");const de=`${vu}shell-${Date.now()}`;ve({type:"localShell",sessionId:J,id:de,command:te}),Ue()&&Xs();try{const{message:ye}=await krt(J,te);ve({type:"upsertMessage",sessionId:J,message:ye})}catch(ye){const Ae=ye instanceof Error?ye.message:String(ye);ve({type:"localShell",sessionId:J,id:de,command:te,error:K7({error:ze(Ae)})})}}function Vu(){Z&&zrt(Z).catch(()=>{Le(uce())})}const jc=T.useCallback(async(te,be)=>{if(!(!Z||Rn.current)){Rn.current=!0,Le(null),Lt(te);try{const Ne=Xlt({model:Pt.model,serviceTier:Pt.serviceTier,permissionMode:Pt.permissionMode,planMode:Pt.planMode,reasoningLevel:Pt.reasoningLevel}),Me=Z;(await Crt(Me,te,be,Ne)).turn.existing&&await Ta(Me),Jt({})}catch{Le(ble())}finally{Rn.current=!1,Lt(null)}}},[Z,Pt,Ta]),Tc=T.useCallback((te,be)=>{if(!Z||Jn||!(tt!=null&&tt.agentReady))return;const Ne=Z;ve({type:"busy",sessionId:Ne,busy:!0}),Xs(),Vr(()=>Ert(Ne,te,be)).catch(Me=>{ve({type:"busy",sessionId:Ne,busy:!1});const Ue=Me instanceof Error?Me.message:String(Me);ve({type:"localError",sessionId:Ne,text:Ele({error:ze(Ue)})})})},[Z,Jn,tt==null?void 0:tt.agentReady,Xs,Vr]),Od=T.useCallback(te=>{if(!Z||Jn)return;const be=Z,Ne=Kt.current;ve({type:"activeLeaf",sessionId:be,leafId:te}),Vr(()=>Nrt(be,te)).catch(Me=>{ve({type:"activeLeaf",sessionId:be,leafId:Ne});const Ue=Me instanceof Error?Me.message:String(Me);ve({type:"localError",sessionId:be,text:_ce({error:ze(Ue)})})})},[Z,Jn,Vr]);function fs(te){if(!Z)return;const be=Z;yrt(be,te).then(({removed:Ne})=>{if(Ne)return Ta(be)}).catch(()=>Le(wle()))}async function En(te){if(!Z||Gn)return;const be=Z;Le(null),cr(te);try{await wrt(be,te),await Ta(be)}catch{Le(Lle())}finally{cr(null)}}T.useEffect(()=>{if(!Jn||i!=="chat")return;function te(be){var Ne;be.key!=="Escape"||be.defaultPrevented||(be.preventDefault(),Vu(),(Ne=bt.current)==null||Ne.focus())}return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[Jn,Z,i]);function La(te){gt.current.add(te),U(be=>be.filter(Ne=>Ne.id!==te)),ce.current.projectId===e&&ce.current.activeId===te&&ce.current.mainView==="chat"&&B.current(null,{replace:!0}),X(be=>{if(!be.has(te))return be;const Ne=new Set(be);return Ne.delete(te),Ne}),Mn.current.delete(te),Wn.current.delete(te),ve({type:"forget",sessionId:te})}function Id(te,be){const Ne=te.archived;U(Me=>Me.map(Ue=>Ue.id===te.id?{...Ue,archived:be}:Ue)),grt(te.id,be).catch(()=>{U(Me=>Me.map(Ue=>Ue.id===te.id?{...Ue,archived:Ne}:Ue))})}function bl(te,be){const Ne=te.title;U(Me=>Me.map(Ue=>Ue.id===te.id?{...Ue,title:be}:Ue)),brt(te.id,be).catch(()=>{U(Me=>Me.map(Ue=>Ue.id===te.id?{...Ue,title:Ne}:Ue))})}async function Bd(te){var Ne;const be=((Ne=te.title)==null?void 0:Ne.trim())||nx();if(window.confirm(Bee({title:Ja(be)}))){try{await mrt(te.id)}catch(Me){Vn(Fee({title:Ja(be),error:ze(Me instanceof Error?Me.message:String(Me))}),"error");return}La(te.id)}}const mr=T.useCallback(te=>{if(!Z)return Promise.resolve(!1);const be=Z,Ne=D.current;return ve({type:"busy",sessionId:be,busy:!0}),Vr(()=>jrt(be,te)).then(()=>!0).catch(()=>!1).finally(()=>{uu(be).then(({messages:Me,queued:Ue,activeLeafId:ot})=>{D.current===Ne&&ve({type:"seed",sessionId:be,messages:Me,queued:Ue,activeLeafId:ot})}).catch(()=>{}),gu(e).then(Me=>{var Ue;D.current===Ne&&ve({type:"busy",sessionId:be,busy:!!((Ue=Me.find(ot=>ot.id===be))!=null&&Ue.busy)})}).catch(()=>{})})},[Z,e,Vr]),wo=H.filter(te=>Gvt(W,te.archived)),Ac=/Mac|iPhone|iPad/.test(navigator.platform),Da=Ac?"⌘ ⇧ Enter":"Ctrl + Shift + Enter",So=Ac?"⌘ Enter":"Ctrl + Enter",is=T.useCallback(()=>{ie("active"),N(null)},[N]),ko=T.useCallback(te=>{ie("all"),N(te)},[N]);T.useEffect(()=>{const te=be=>{be.repeat||be.key!=="Enter"||!be.metaKey&&!be.ctrlKey||be.altKey||!be.shiftKey||(be.preventDefault(),is())};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[is]);const gr=h.jsxs("aside",{className:"session-rail w-68 shrink-0 flex flex-col mt-5 me-3.5 mb-5 ms-0 bg-background min-h-0 [&_.rail-body]:flex-1 [&_.rail-body]:min-h-0 [&_.rail-body]:overflow-y-auto [&_.rail-body]:py-1 [&_.rail-body]:px-2 border border-border rounded-lg overflow-visible shadow-elevated",children:[t,h.jsxs("nav",{className:"rail-nav flex flex-col gap-0.5 p-2 shrink-0",children:[h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${c?"active":""}`,onClick:w,children:[h.jsx(h_,{size:15}),vse()]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${u?"active":""}`,"data-onboarding":"nav-artifacts",onClick:f,children:[h.jsx(E4,{size:15}),vne()]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${o?"active":""}`,onClick:_,children:[h.jsx(k4,{size:15}),dse()]}),h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i==="skills"?"active":""}`,onClick:()=>a("skills"),children:[h.jsx(xR,{size:15}),Rre()]}),xbt.map(te=>h.jsxs("button",{className:`rail-nav-item flex items-center gap-2.5 py-[7px] px-2.5 text-base text-text rounded-md text-start [&:hover:not(.active)]:bg-surface [&.active]:bg-panel [&.active]:font-medium ${i!=="chat"&&i!=="skills"&&te.activeTabs.includes(i)?"active":""}`,"data-onboarding":te.id==="compute"?"nav-compute":void 0,onClick:()=>a(te.id),children:[te.icon,te.label()]},te.id))]}),h.jsxs("div",{className:"rail-section-head flex items-center justify-between shrink-0 pt-3.5 pe-2.5 pb-1.5 ps-4.5",children:[h.jsx("div",{className:"rail-section-label p-0 text-sm font-medium text-subtext",children:((Lc=lO.find(te=>te.id===W))==null?void 0:Lc.railLabel())??bT()}),h.jsxs("div",{className:"rail-section-actions flex items-center gap-0.5",children:[h.jsxs("button",{className:"rail-section-new inline-flex items-center gap-1 py-[3px] px-1.5 rounded-sm text-subtext text-sm font-medium [&:hover]:text-text [&:hover]:bg-surface tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]","data-onboarding":"new-session","data-tip":Da,"aria-keyshortcuts":"Meta+Shift+Enter Control+Shift+Enter",onClick:is,children:[h.jsx(z4,{size:13}),doe()]}),h.jsx(Vvt,{value:W,onChange:ie})]})]}),h.jsxs("div",{className:"rail-body",children:[wo.map(te=>h.jsx(Xvt,{session:te,active:te.id===Z&&i==="chat",unread:P.has(te.id),busy:pt.busySessions.has(te.id),waiting:Bi.has(te.id),revealTitle:wr.get(te.id),onOpen:()=>{N(te.id),e===hC&&nat(te.id),X(be=>{if(!be.has(te.id))return be;const Ne=new Set(be);return Ne.delete(te.id),Ne})},onRename:be=>bl(te,be),onSetArchived:be=>Id(te,be),onDelete:()=>void Bd(te)},te.id)),wo.length===0&&h.jsx("div",{className:"rail-empty py-1.5 px-2.5 text-sm text-muted",children:W==="archived"?Nte():H.length>0?vte():Ate()})]}),C.kind==="ssh"?h.jsx(Jm,{runtime:C}):h.jsx("div",{className:"relative shrink-0 border-t border-border",children:h.jsxs("div",{className:"flex items-center gap-1.5 py-2 ps-1 pe-2.5",children:[h.jsx(Yt,{size:"small","aria-label":BT(),"aria-haspopup":"dialog",onClick:()=>Y(!0),children:h.jsx(c2,{size:14,className:"shrink-0"})}),h.jsxs("span",{className:"flex min-w-0 flex-col gap-1 text-start text-text",children:[h.jsx("span",{className:"truncate text-sm leading-tight",children:IT()}),h.jsxs("span",{className:"truncate text-xs leading-tight text-subtext",children:["OpenResearch ",ze(C.version)]})]})]})}),F&&h.jsx(Zvt,{onClose:()=>Y(!1),onConfigureSsh:()=>{Y(!1),Q(!0)}}),q&&h.jsx(DD,{onClose:()=>{Q(!1),Y(!0)}})]}),Rc=`chat-header flex items-center gap-2 py-0 px-4 bg-background shrink-0 h-12 relative z-4 w-full max-w-readable my-0 mx-auto [&.rail-hidden]:max-w-none [&.rail-hidden]:py-0 [&.rail-hidden]:px-0.5 [&::after]:content-[''] [&::after]:absolute [&::after]:top-full [&::after]:start-0 [&::after]:end-0 [&::after]:h-6 [&::after]:bg-[linear-gradient(to_bottom,_var(--base),_transparent)] [&::after]:pointer-events-none${r?"":" rail-hidden"}`,Mc=!r&&h.jsx(Yt,{title:p8(),"aria-label":p8(),onClick:s,children:h.jsx(TR,{size:15})});return i!=="chat"?h.jsxs(h.Fragment,{children:[r&&gr,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[!r&&h.jsx("div",{className:Rc,children:Mc}),h.jsx("div",{className:"settings-view-scroll flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",children:I})]})]}):h.jsxs(h.Fragment,{children:[r&&gr,h.jsxs("section",{className:"chat-pane flex-1 min-w-0 flex flex-col bg-background min-h-0",children:[h.jsxs("div",{className:Rc,children:[Mc,h.jsx(__,{variant:"header",title:Kn?((ia=Kn.title)==null?void 0:ia.trim())||nx():Y7(),children:Kn?h.jsx(cO,{title:((vl=Kn.title)==null?void 0:vl.trim())||nx(),animate:di!==void 0},di??"static"):Y7()}),z&&h.jsx(Yt,{"data-tip":X7(),"aria-label":X7(),onClick:z,children:h.jsx(Tat,{size:15})})]}),_l?h.jsxs("div",{className:"chat-loading flex-1 flex items-center justify-center gap-3 text-subtext text-xl p-5 [&_.spinner]:w-5.5 [&_.spinner]:h-5.5 [&_.spinner]:border-[3px]","aria-live":"polite","aria-busy":"true",children:[h.jsx(Ot,{}),h.jsx("span",{children:Gse()})]}):ws?h.jsx("div",{className:"chat-thread flex-1 min-h-0 overflow-y-auto [scrollbar-gutter:stable_both-edges]",ref:at,onScroll:te=>{gl(te.currentTarget),yn.dismiss()},children:h.jsxs("div",{className:"chat-thread-inner max-w-readable my-0 mx-auto pt-4 px-4 pb-8 flex flex-col gap-4",ref:rn,children:[h.jsx(qvt,{messages:Kr,allMessages:bo,canFork:kc,onFork:Tc,onSelectFork:Od,busy:Jn,onOpenFile:Ld,onOpenRun:m,onOpenSpawnedSession:ko,runExperimentName:x,onOpenExperiment:S,experimentName:b,onRespond:mr,onOpenPlan:$i,onOpenSubagent:Ma,recoveringTurnId:nn,onRecover:jc,skills:ss}),Jn&&Is&&h.jsx("div",{className:"flex items-center gap-2 text-subtext text-sm pt-0.5 px-0 pb-2 italic",children:Aoe()}),Jn&&!Is&&!Aa&&!ui&&h.jsx("div",{className:"text-base pt-0.5 px-1 pb-2",children:h.jsx("span",{className:"tool-running-shimmer",children:wce()})})]})}):h.jsxs("div",{className:"chat-empty flex-1 flex flex-col items-center justify-center text-text p-8 text-center [&_h2]:m-0 [&_h2]:text-5xl [&_h2]:font-medium [&_h2]:tracking-[-0.015em] [&_h2]:text-text",children:[h.jsx("div",{className:"chat-empty-mark w-10.5 h-10.5 mb-5.5 [&_svg]:block [&_svg]:w-full [&_svg]:h-full",children:h.jsx(A4,{})}),h.jsx("h2",{children:Doe()}),h.jsxs("div",{className:"chat-empty-project inline-flex items-center gap-[7px] mt-3 py-1.5 px-3 border border-border rounded-full text-subtext bg-surface text-lg font-medium",children:[h.jsx(h_,{size:19}),h.jsx("span",{children:n})]}),Nc&&h.jsx("div",{className:SN,role:"status","aria-live":"polite","aria-label":Zae(),"aria-busy":"true",children:wN.map((te,be)=>h.jsxs("div",{className:`flex min-h-22 animate-pulse flex-col items-start justify-center gap-2.5 rounded-xl border bg-background px-5 py-4 ${dy[be].box}`,children:[h.jsxs("span",{className:`flex w-full items-center gap-2.5 ${dy[be].icon}`,children:[h.jsx(te,{size:17}),h.jsx("span",{className:"h-3.5 w-2/5 rounded bg-surface-bright"})]}),h.jsx("span",{className:"h-3 w-4/5 rounded bg-surface"})]},be))}),Ec&&Ec.length>0&&h.jsx("div",{className:SN,role:"group","aria-label":toe(),children:Ec.map((te,be)=>{const Ne=wN[be],Me=dy[be];return h.jsxs("button",{type:"button",className:`flex min-h-22 w-full min-w-0 cursor-pointer flex-col items-start justify-center gap-1.5 rounded-xl border bg-background px-5 py-4 text-start font-sans transition-colors duration-120 ease-standard hover:bg-surface ${Me.box}`,onClick:()=>Dd(te.prompt),children:[h.jsxs("span",{className:"flex items-center gap-2.5 text-base font-medium text-text",children:[h.jsx(Ne,{size:17,className:Me.icon}),te.title]}),h.jsx("span",{className:"w-full truncate text-sm text-subtext",children:te.prompt})]},be)})})]}),yn.action&&h.jsxs($e,{type:"button",size:"small",className:"chat-selection-action fixed z-50 shadow-control",style:{left:yn.action.x,top:yn.action.top,transform:"translateX(-50%)"},onMouseDown:te=>te.preventDefault(),onClick:yn.add,children:[h.jsx(jR,{size:14}),Sne()]}),h.jsxs("div",{className:"composer px-3 pb-5 shrink-0 relative z-4 bg-background w-full max-w-readable my-0 mx-auto [&_textarea]:border-0 [&_textarea]:bg-none [&_textarea]:bg-transparent [&_textarea]:resize-none [&_textarea]:pt-2.5 [&_textarea]:px-3 [&_textarea]:pb-1 [&_textarea]:text-base [&_textarea]:field-sizing-content [&_textarea]:min-h-18 [&_textarea]:max-h-45",children:[ws&&h.jsx(Yt,{className:`absolute bottom-full left-1/2 z-5 mb-6 h-9 w-9 -translate-x-1/2 rounded-full border border-border bg-background shadow-control transition-opacity duration-150 ease-standard ${on?"opacity-0":"opacity-100"}`,title:b8(),"aria-label":b8(),inert:on,onClick:Uu,children:Jn&&!Is?h.jsx(S4,{size:18,className:"tool-running-shimmer-icon"}):h.jsx(hat,{size:16})}),er&&!(Cc&&er.promptId===Cc.promptId)&&h.jsx(N1t,{synthesized:er.synthesized,agentLabel:Kn?Bh[Kn.harness]:bce(),showResumeModes:(Kn==null?void 0:Kn.harness)==="claude-code",onView:te=>$i==null?void 0:$i(er.plan,er.promptId,te),onApprove:te=>mr({promptId:er.promptId,approve:!0,...te?{resumeMode:te}:{}}),onReject:()=>mr({promptId:er.promptId,approve:!1}),onRevise:te=>{Z&&hi({sessionId:Z,promptId:er.promptId}),mr({promptId:er.promptId,approve:!1,note:te})}}),Ft.length>0&&h.jsx("div",{className:"composer-queued flex flex-col gap-1 mb-1.5",children:Ft.map((te,be)=>h.jsxs("div",{className:"queued-chip flex flex-wrap items-center gap-x-2 gap-y-1 py-1.5 px-2.5 text-sm text-subtext bg-background border border-border rounded-sm",title:te.error?`${te.text} + +${te.error}`:te.text,children:[te.dispatchState==="blocked"?h.jsx(DR,{size:13,className:"shrink-0 text-accent-amber"}):h.jsx(Oat,{size:13,className:"shrink-0 text-muted"}),h.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap text-text",children:te.text}),te.dispatchState!=="blocked"&&h.jsx("span",{className:"shrink-0 text-sm text-muted",children:te.dispatchState==="retrying"?Ylt(te.nextRetryAt,xo):ole()}),te.dispatchState==="blocked"?h.jsxs(h.Fragment,{children:[h.jsx("button",{onClick:()=>void En(te.id),"aria-label":Vq({text:te.text}),disabled:Gn!==null,className:"shrink-0 px-1.5 py-0.5 border border-border rounded-sm text-sm text-text bg-background cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:border-text",children:Gn===te.id?HT():Ji()}),h.jsx("button",{onClick:()=>fs(te.id),"aria-label":Fq({text:te.text}),disabled:Gn!==null,className:"shrink-0 px-1.5 py-0.5 border-0 text-sm text-muted bg-transparent cursor-pointer disabled:opacity-50 disabled:cursor-default [&:hover:not(:disabled)]:text-text",children:Jie()}),be===fi&&befs(te.id),className:"shrink-0 inline-flex items-center justify-center w-4 h-4 p-0 border-0 rounded-full text-muted cursor-pointer [&:hover]:bg-text [&:hover]:text-background",children:h.jsx(Dr,{size:11})})]},te.id))}),h.jsxs("div",{className:`composer-box relative flex flex-col border ${pr?"border-accent-amber":"border-border"} rounded-lg bg-background shadow-elevated`,"data-onboarding":"composer",children:[tt&&!tt.agentReady&&h.jsxs("div",{className:"composer-harness-warning py-2 px-3 text-subtext text-sm leading-normal border-b border-b-border-variant [&_strong]:text-accent-amber [&_strong]:font-medium [&_code]:font-mono [&_code]:text-text",children:[h.jsxs("strong",{children:[tt.name," ",Ese()]})," ",tt.agentNote?Z_(tt.agentNote):_le()]}),On&&h.jsx(Sbt,{skills:Cn,activeIndex:Gr,onPick:Fr,onHover:hr}),se.length>0&&h.jsx(nvt,{annotations:se,onClear:()=>{G([]),window.requestAnimationFrame(()=>{var te;return(te=bt.current)==null?void 0:te.focus()})},onRemove:te=>{const be=se.filter(Ne=>Ne.id!==te);G(be),be.length===0&&window.requestAnimationFrame(()=>{var Ne;return(Ne=bt.current)==null?void 0:Ne.focus()})}}),pe.length>0&&h.jsx("div",{className:"composer-attachments flex flex-wrap gap-1.5 pt-2 px-3 pb-0",children:pe.map((te,be)=>{const Ne=()=>ue(Me=>Me.filter((Ue,ot)=>ot!==be));return te.mediaType==="application/pdf"?h.jsxs("div",{className:"attachment-file [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background relative inline-flex items-center gap-2 max-w-55 py-2 px-2.5 border border-border rounded-sm text-text bg-surface [&_svg]:shrink-0 [&_svg]:text-muted",title:te.name,children:[h.jsx(Gg,{size:22}),h.jsx("span",{className:"attachment-file-name overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:te.name??"document.pdf"}),h.jsx("button",{title:u8(),"aria-label":u8(),onClick:Ne,children:h.jsx(Dr,{size:11})})]},be):h.jsxs("div",{className:"attachment-thumb relative [&_img]:w-13 [&_img]:h-13 [&_img]:object-cover [&_img]:border [&_img]:border-border [&_img]:rounded-sm [&_img]:block [&_button]:absolute [&_button]:-top-[5px] [&_button]:-right-[5px] [&_button]:inline-flex [&_button]:items-center [&_button]:justify-center [&_button]:w-4 [&_button]:h-4 [&_button]:p-0 [&_button]:border [&_button]:border-border [&_button]:rounded-full [&_button]:bg-surface [&_button]:text-text [&_button]:cursor-pointer [&_button:hover]:bg-text [&_button:hover]:text-background",children:[h.jsx("img",{src:te.dataUrl,alt:Uoe()}),h.jsx("button",{title:f8(),"aria-label":f8(),onClick:Ne,children:h.jsx(Dr,{size:11})})]},be)})}),Ee&&h.jsx("div",{className:"composer-attach-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ee}),Ie&&h.jsx("div",{className:"composer-settings-error pt-1.5 px-3 pb-0 text-sm text-accent-red",role:"alert",children:Ie}),h.jsxs("div",{className:`composer-input relative flex overflow-hidden [&_textarea]:flex-1 ${pr?"[&_textarea]:font-mono [&_textarea]:text-sm":""}`,children:[h.jsx("textarea",{dir:"auto",ref:bt,className:"relative z-1 bg-transparent",value:le,placeholder:Bs?Mce():_i&&tt?ace({harness:ze(Bh[tt.id]),shortcut:ze(So)}):Ut?tt!=null&&tt.agentReady?lte({harness:ze(Bh[Ut.harness])}):ste({harness:ze(Bh[Ut.harness])}):JJ(),rows:2,onPaste:Ds,onDragOver:te=>{te.dataTransfer.types.includes("Files")&&te.preventDefault()},onDrop:te=>{te.dataTransfer.files.length!==0&&(te.preventDefault(),cs(Array.from(te.dataTransfer.files)))},onChange:te=>{const be=te.target.value,Ne=te.target.selectionStart;ts(Ne);const Me=Ne>0&&/\s/.test(be[Ne-1])&&!Bs&&!Ls.current&&hN(be)===null?sy(be,Ne-1):null;if((Me==null?void 0:Me.query)==="plan"&&(At!=null&&At.planActivation)){hl(be,Me);return}const Ue=Me?ss.find(ot=>ot.source!=="command"&&ot.name===Me.query):void 0;if(Ue&&Me){const ot=cN(be,Me,Ue.name,2);ae(ot.text),window.requestAnimationFrame(()=>{var J;(J=bt.current)==null||J.setSelectionRange(ot.cursor,ot.cursor),ts(ot.cursor)});return}ae(be),Hr(!1)},onSelect:te=>ts(te.currentTarget.selectionStart),onCompositionStart:()=>{Ls.current=!0},onCompositionEnd:()=>{Ls.current=!1},onKeyDown:te=>{if(On){if(te.key==="ArrowDown"||te.key==="ArrowUp"){te.preventDefault();const be=te.key==="ArrowDown"?1:-1;hr((Gr+be+Cn.length)%Cn.length);return}if(te.key==="Tab"||te.key==="Enter"){te.preventDefault(),Fr(Cn[Gr]);return}if(te.key==="Escape"){te.preventDefault(),Hr(!0);return}}if(te.key==="Backspace"&&ns(te.currentTarget)){te.preventDefault();return}if(te.key==="Enter"&&!te.shiftKey&&!te.nativeEvent.isComposing){if(te.preventDefault(),pr){Gu();return}zc({queue:te.metaKey||te.ctrlKey})}}}),h.jsx(Abt,{text:le,isCommand:pl,skills:ss,projectId:e,textareaRef:bt})]}),h.jsxs("div",{className:"composer-actions flex min-w-0 justify-end items-center gap-2 pt-1.5 px-2 pb-2",children:[h.jsxs("div",{className:"option-picker relative inline-flex shrink-0",ref:ln.ref,children:[h.jsx(Yt,{type:"button",className:"composer-bare",title:ex(),"aria-label":ex(),"aria-haspopup":"dialog","aria-expanded":ln.open,onClick:()=>ln.setOpen(te=>!te),children:h.jsx(Qot,{size:16})}),ln.open&&h.jsxs("div",{className:"composer-sources-menu absolute bottom-[calc(100%_+_8px)] start-0 z-50 flex min-w-55 flex-col gap-1 rounded-md border border-border bg-background p-2 shadow-dropdown",children:[h.jsx("span",{className:"px-1 text-sm font-medium text-muted",children:ex()}),h.jsx(fct,{})]})]}),h.jsx("input",{ref:ut,type:"file",accept:"application/pdf,image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:te=>{cs(Array.from(te.target.files??[])),te.target.value=""}}),h.jsx(Yt,{type:"button",className:"composer-attach",title:Q7(),"aria-label":Q7(),onClick:()=>{var te;return(te=ut.current)==null?void 0:te.click()},children:h.jsx(Lot,{size:16})}),us&&h.jsxs($e,{type:"button",variant:"ghost",active:!0,className:"group",title:i8(),"aria-label":i8(),onClick:()=>void Os(),children:[h.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[h.jsx(got,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),h.jsx(Dr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),h.jsx("span",{children:aie()})]}),pr&&h.jsxs($e,{type:"button",variant:"ghost",active:!0,className:"group",title:s8(),"aria-label":s8(),onClick:qu,children:[h.jsxs("span",{className:"relative size-4","aria-hidden":"true",children:[h.jsx(Sd,{className:"absolute inset-0 transition-opacity group-hover:opacity-0 group-focus-visible:opacity-0",size:16,strokeWidth:1.6}),h.jsx(Dr,{className:"absolute inset-0 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",size:16,strokeWidth:1.8})]}),h.jsx("span",{children:hT()})]}),h.jsx("div",{className:"min-w-0 flex-1"}),h.jsxs("div",{className:"flex min-w-0 items-center",children:[h.jsx(Mlt,{value:Ut,onSelect:Ii,permissionChoices:tt!=null&&tt.agentReady?(At==null?void 0:At.permissionModes)??[]:[],defaultPermissionId:(At==null?void 0:At.defaultPermissionMode)??null,onSelectPermission:_r,reasoningChoices:tt!=null&&tt.agentReady?ci.choices:[],defaultReasoningId:ci.defaultId,onSelectReasoning:go,onHarnesses:Je,lockHarness:!!Zt}),h.jsx(Mbt,{usage:Zt==null?void 0:Zt.contextUsage})]}),Jn&&!Bs?h.jsx(Yt,{className:"send-btn",variant:"stop",title:m8(),"aria-label":m8(),onClick:Vu,children:h.jsx(Dr,{size:16})}):h.jsx(Yt,{className:"send-btn",variant:"primary",title:pr?h8():By(),"aria-label":pr?h8():By(),onClick:()=>void(pr?Gu():zc()),disabled:pr?!Ur||!Z&&!(tt!=null&&tt.agentReady):!(tt!=null&&tt.agentReady)||!le.trim()&&pe.length===0&&se.length===0,children:h.jsx(ER,{size:16})})]})]})]})]})]})}function da({className:e,...n}){return h.jsx("div",{className:vs("relative flex min-h-0 flex-1 flex-col",e),...n})}function Kf({className:e,...n}){return h.jsx("div",{className:vs("min-h-0 flex-1 overflow-auto bg-background",e),...n})}function ma({className:e,...n}){return h.jsx("div",{className:vs("shrink-0 border-b border-b-border-variant px-4 py-2 text-sm text-muted",e),...n})}const kN=["pane-content flex-1 min-h-0 relative subagent-tab-content overflow-y-auto","bg-background py-8 px-4"].join(" ");function Jvt({sessionId:e,spawnPartId:n,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}){const[c,u]=T.useState(null),_=T.useRef(null),f=T.useRef(null),p=T.useRef(!0);if(T.useLayoutEffect(()=>{p.current=!0;const x=_.current;x&&(x.scrollTop=x.scrollHeight)},[e,n]),T.useLayoutEffect(()=>{const x=_.current;x&&p.current&&(x.scrollTop=x.scrollHeight)},[c]),T.useEffect(()=>{const x=_.current,S=f.current;if(!x||!S)return;const b=new ResizeObserver(()=>{p.current&&(x.scrollTop=x.scrollHeight)});return b.observe(S),b.observe(x),()=>b.disconnect()},[c===null]),T.useEffect(()=>{let x=!0;const S=new Set;let b=0;const v=()=>{const w=++b;uu(e).then(({messages:C})=>{!x||w!==b||u(z=>{if(!z)return C;const E=C.map(N=>S.has(N.id)?z.find(M=>M.id===N.id)??N:N),R=new Set(C.map(N=>N.id));return[...E,...z.filter(N=>!R.has(N.id))]})}).catch(()=>x&&u(C=>C??[]))};v();const y=lc(w=>{if(w.type==="reconnected"){S.clear(),v();return}w.type!=="message"||w.sessionId!==e||(S.add(w.message.id),u(C=>{const z=C?C.slice():[],E=z.findIndex(R=>R.id===w.message.id);return E===-1?z.push(w.message):z[E]=w.message,z}))});return()=>{x=!1,y()}},[e]),c===null)return h.jsx(da,{children:h.jsx("div",{className:kN,children:h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:WZe()})})});let m=null;for(const x of c)if(m=Qh(x.parts,n),m)break;return h.jsx(da,{children:h.jsx("div",{className:kN,ref:_,onScroll:x=>{const S=x.currentTarget;p.current=S.scrollHeight-S.scrollTop-S.clientHeight<60},children:h.jsx("div",{ref:f,children:m?h.jsx(Pvt,{spawn:m,onOpenFile:t,onOpenRun:r,runExperimentName:s,onOpenExperiment:i,experimentName:a,onOpenSubagent:o}):h.jsx("div",{className:"subagent-empty py-[3px] px-1 text-sm text-muted",children:ZZe()})})})})}function CN(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable}))),t.push.apply(t,r)}return t}function Tn(e){for(var n=1;n=0||(_[c]=a[c]);return _})(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(s[t]=e[t])}return s}function bn(e,n){return fO(e)||(function(t,r){var s=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(s!=null){var i,a,o,c,u=[],_=!0,f=!1;try{if(o=(s=s.call(t)).next,r===0){if(Object(s)!==s)return;_=!1}else for(;!(_=(i=o.call(s)).done)&&(u.push(i.value),u.length!==r);_=!0);}catch(p){f=!0,a=p}finally{try{if(!_&&s.return!=null&&(c=s.return(),Object(c)!==c))return}finally{if(f)throw a}}return u}})(e,n)||y1(e,n)||hO()}function uO(e){return fO(e)||dO(e)||y1(e)||hO()}function Ti(e){return(function(n){if(Array.isArray(n))return nw(n)})(e)||dO(e)||y1(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function fO(e){if(Array.isArray(e))return e}function dO(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function y1(e,n){if(e){if(typeof e=="string")return nw(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?nw(e,n):void 0}}function nw(e,n){(n==null||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,a=!0,o=!1;return{s:function(){t=t.call(e)},n:function(){var c=t.next();return a=c.done,c},e:function(c){o=!0,i=c},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw i}}}}var Vp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function l0(e,n){return e(n={exports:{}},n.exports),n.exports}var Ni=l0((function(e){/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(){var n={}.hasOwnProperty;function t(){for(var r=[],s=0;s-1?v.slice(0,w):C;switch(C){case"diff":S--;break e;case"deleted":case"new":var z=v.slice(w+1);z.indexOf("file mode")===0&&(a[C==="new"?"newMode":"oldMode"]=z.slice(10));break;case"similarity":a.similarity=parseInt(v.split(" ")[2],10);break;case"index":var E=v.slice(w+1).split(" "),R=E[0].split("..");a.oldRevision=R[0],a.newRevision=R[1],E[1]&&(a.oldMode=a.newMode=E[1]);break;case"copy":case"rename":var N=v.slice(w+1);N.indexOf("from")===0?a.oldPath=N.slice(5):a.newPath=N.slice(3),y=C;break;case"---":var M=v.slice(w+1),O=m[++S].slice(4);M==="/dev/null"?(O=O.slice(2),y="add"):O==="/dev/null"?(M=M.slice(2),y="delete"):(y="modify",M=M.slice(2),O=O.slice(2)),M&&(a.oldPath=M),O&&(a.newPath=O),p=5;break e}}a.type=y||"modify"}else if(b.indexOf("Binary")===0)a.isBinary=!0,a.type=b.indexOf("/dev/null and")>=0?"add":b.indexOf("and /dev/null")>=0?"delete":"modify",p=2,a=null;else if(p===5)if(b.indexOf("@@")===0){var I=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(b);o={content:b,oldStart:I[1]-0,newStart:I[4]-0,oldLines:I[3]-0||1,newLines:I[6]-0||1,changes:[]},a.hunks.push(o),c=o.oldStart,u=o.newStart}else{var H=b.slice(0,1),U={content:b.slice(1)};switch(H){case"+":U.type="insert",U.isInsert=!0,U.lineNumber=u,u++;break;case"-":U.type="delete",U.isDelete=!0,U.lineNumber=c,c++;break;case" ":U.type="normal",U.isNormal=!0,U.oldLineNumber=c,U.newLineNumber=u,c++,u++;break;case"\\":var F=o.changes[o.changes.length-1];F.isDelete||(a.newEndingNewLine=!1),F.isInsert||(a.oldEndingNewLine=!1)}U.type&&o.changes.push(U)}S++}return f}};e.exports=s})()}));function Sc(e){return e.type==="insert"}function Ai(e){return e.type==="delete"}function sl(e){return e.type==="normal"}function rxt(e,n){var t=n.nearbySequences==="zip"?(function(r){var s=r.reduce((function(i,a,o){var c=bn(i,3),u=c[0],_=c[1],f=c[2];return _?Sc(a)&&f>=0?(u.splice(f+1,0,a),[u,a,f+2]):(u.push(a),[u,a,Ai(a)&&Ai(_)?f:o]):(u.push(a),[u,a,Ai(a)?o:-1])}),[[],null,-1]);return bn(s,1)[0]})(e.changes):e.changes;return Tn(Tn({},e),{},{isPlain:!1,changes:t})}function rw(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=(function(r){if(r.startsWith("diff --git"))return r;var s=r.indexOf(` +`),i=r.indexOf(` +`,s+1),a=r.slice(0,s),o=r.slice(s+1,i),c=a.split(" ").slice(1,-3).join(" "),u=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(u),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(u),r.slice(i+1)].join(` +`)})(e.trimStart());return nxt.parse(t).map((function(r){return(function(s,i){var a=s.hunks.map((function(o){return rxt(o,i)}));return Tn(Tn({},s),{},{hunks:a})})(r,n)}))}function sxt(e){return e[0]}function ixt(e){return e[e.length-1]}function sw(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function C_(e){return e==="old"?function(n){return Sc(n)?-1:sl(n)?n.oldLineNumber:n.lineNumber}:function(n){return Ai(n)?-1:sl(n)?n.newLineNumber:n.lineNumber}}function pO(e,n){return function(t,r){var s=t[e],i=s+t[n];return r>=s&&r=i&&s-1},hxt=function(e,n){var t=this.__data__,r=w1(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function Af(e){var n=-1,t=e==null?0:e.length;for(this.clear();++no))return!1;var u=i.get(e),_=i.get(n);if(u&&_)return u==n&&_==e;var f=-1,p=!0,m=2&t?new Xxt:void 0;for(i.set(e,n),i.set(n,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Zn={};Zn["[object Float32Array]"]=Zn["[object Float64Array]"]=Zn["[object Int8Array]"]=Zn["[object Int16Array]"]=Zn["[object Int32Array]"]=Zn["[object Uint8Array]"]=Zn["[object Uint8ClampedArray]"]=Zn["[object Uint16Array]"]=Zn["[object Uint32Array]"]=!0,Zn["[object Arguments]"]=Zn["[object Array]"]=Zn["[object ArrayBuffer]"]=Zn["[object Boolean]"]=Zn["[object DataView]"]=Zn["[object Date]"]=Zn["[object Error]"]=Zn["[object Function]"]=Zn["[object Map]"]=Zn["[object Number]"]=Zn["[object Object]"]=Zn["[object RegExp]"]=Zn["[object Set]"]=Zn["[object String]"]=Zn["[object WeakMap]"]=!1;var dyt=function(e){return hd(e)&&r3(e.length)&&!!Zn[Rd(e)]},hyt=function(e){return function(n){return e(n)}},MN=l0((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,s=r&&r.exports===t&&bO.process,i=(function(){try{var a=r&&r.require&&r.require("util").types;return a||s&&s.binding&&s.binding("util")}catch{}})();e.exports=i})),LN=MN&&MN.isTypedArray,s3=LN?hyt(LN):dyt,_yt=Object.prototype.hasOwnProperty,pyt=function(e,n){var t=Mi(e),r=!t&&E1(e),s=!t&&!r&&pg(e),i=!t&&!r&&!s&&s3(e),a=t||r||s||i,o=a?oyt(e.length,String):[],c=o.length;for(var u in e)!_yt.call(e,u)||a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||kO(u,c))||o.push(u);return o},myt=Object.prototype,CO=function(e){var n=e&&e.constructor;return e===(typeof n=="function"&&n.prototype||myt)},gyt=(function(e,n){return function(t){return e(n(t))}})(Object.keys,Object),byt=Object.prototype.hasOwnProperty,EO=function(e){if(!CO(e))return gyt(e);var n=[];for(var t in Object(e))byt.call(e,t)&&t!="constructor"&&n.push(t);return n},N1=function(e){return e!=null&&r3(e.length)&&!xO(e)},i3=function(e){return N1(e)?pyt(e):EO(e)},DN=function(e){return nyt(e,i3,ayt)},vyt=Object.prototype.hasOwnProperty,xyt=function(e,n,t,r,s,i){var a=1&t,o=DN(e),c=o.length;if(c!=DN(n).length&&!a)return!1;for(var u=c;u--;){var _=o[u];if(!(a?_ in n:vyt.call(n,_)))return!1}var f=i.get(e),p=i.get(n);if(f&&p)return f==n&&p==e;var m=!0;i.set(e,n),i.set(n,e);for(var x=a;++u1)return!1;if(e.length===1){var n=bn(e,1)[0];return n.type==="text"&&!n.value}return!0}function l2t(e){var n=e.changeKey,t=e.text,r=e.tokens,s=e.renderToken,i=gc(e,a2t),a=s?function(o,c){return s(o,PN,c)}:PN;return h.jsx("td",Tn(Tn({},i),{},{"data-change-key":n,children:r?o2t(r)?" ":r.map(a):t||" "}))}var LO=T.memo(l2t);function DO(e,n){return function(){var t=n==="old"?R1(e):M1(e);return t===-1?void 0:t}}function OO(e,n){return function(t){return e&&t?h.jsx("a",{href:n?"#"+n:void 0,children:t}):t}}function mg(e,n){return n?function(t){e(),n(t)}:e}function HN(e,n,t,r){return T.useMemo((function(){var s=MO(e,(function(i){return function(a){return i&&i(n,a)}}));return s.onMouseEnter=mg(t,s.onMouseEnter),s.onMouseLeave=mg(r,s.onMouseLeave),s}),[e,t,r,n])}function FN(e,n,t,r,s,i,a,o,c){var u={change:n,side:r,inHoverState:o,renderDefault:DO(n,r),wrapInAnchor:OO(s,i)};return h.jsx("td",Tn(Tn({className:e},a),{},{"data-change-key":t,children:c(u)}))}function c2t(e){var n,t,r,s=e.change,i=e.selected,a=e.tokens,o=e.className,c=e.generateLineClassName,u=e.gutterClassName,_=e.codeClassName,f=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.gutterAnchor,S=e.generateAnchorID,b=e.renderToken,v=e.renderGutter,y=s.type,w=s.content,C=cc(s),z=(n=bn(T.useState(!1),2),t=n[0],r=n[1],[t,T.useCallback((function(){return r(!0)}),[]),T.useCallback((function(){return r(!1)}),[])]),E=bn(z,3),R=E[0],N=E[1],M=E[2],O=T.useMemo((function(){return{change:s}}),[s]),I=HN(f,O,N,M),H=HN(p,O,N,M),U=S(s),F=c({changes:[s],defaultGenerate:function(){return o}}),Y=Ni("diff-gutter","diff-gutter-".concat(y),u,{"diff-gutter-selected":i}),q=Ni("diff-code","diff-code-".concat(y),_,{"diff-code-selected":i});return h.jsxs("tr",{id:U,className:Ni("diff-line",F),children:[!m&&FN(Y,s,C,"old",x,U,I,R,v),!m&&FN(Y,s,C,"new",x,U,I,R,v),h.jsx(LO,Tn({className:q,changeKey:C,text:w,tokens:a,renderToken:b},H))]})}var u2t=T.memo(c2t);function f2t(e){var n=e.hideGutter,t=e.element;return h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?1:3,className:"diff-widget-content",children:t})})}var d2t=["hideGutter","selectedChanges","tokens","lineClassName"],h2t=["hunk","widgets","className"];function _2t(e){var n=e.hunk,t=e.widgets,r=e.className,s=gc(e,h2t),i=(function(a,o){return a.reduce((function(c,u){var _=cc(u);c.push(["change",_,u]);var f=o[_];return f&&c.push(["widget",_,f]),c}),[])})(n.changes,t);return h.jsx("tbody",{className:Ni("diff-hunk",r),children:i.map((function(a){return(function(o,c){var u=bn(o,3),_=u[0],f=u[1],p=u[2],m=c.hideGutter,x=c.selectedChanges,S=c.tokens,b=c.lineClassName,v=gc(c,d2t);if(_==="change"){var y=Ai(p)?"old":"new",w=Ai(p)?R1(p):M1(p),C=S?S[y][w-1]:null;return h.jsx(u2t,Tn({className:b,change:p,hideGutter:m,selected:x.includes(f),tokens:C},v),"change".concat(f))}return _==="widget"?h.jsx(f2t,{hideGutter:m,element:p},"widget".concat(f)):null})(a,s)}))})}var IO=0;function Kp(e,n,t,r){var s=T.useCallback((function(){return n(e)}),[e,n]),i=T.useCallback((function(){return n("")}),[n]);return T.useMemo((function(){var a=MO(r,(function(o){return function(c){return o&&o({side:e,change:t},c)}}));return a.onMouseEnter=mg(s,a.onMouseEnter),a.onMouseLeave=mg(i,a.onMouseLeave),a}),[t,r,s,e,i])}function py(e){var n=e.change,t=e.side,r=e.selected,s=e.tokens,i=e.gutterClassName,a=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,u=e.anchorID,_=e.gutterAnchor,f=e.gutterAnchorTarget,p=e.hideGutter,m=e.hover,x=e.renderToken,S=e.renderGutter;if(!n){var b=Ni("diff-gutter","diff-gutter-omit",i),v=Ni("diff-code","diff-code-omit",a);return[!p&&h.jsx("td",{className:b},"gutter"),h.jsx("td",{className:v},"code")]}var y=n.type,w=n.content,C=cc(n),z=t===IO?"old":"new",E=Tn({id:u||void 0,className:Ni("diff-gutter","diff-gutter-".concat(y),tw({"diff-gutter-selected":r},"diff-line-hover-"+z,m),i),children:S({change:n,side:z,inHoverState:m,renderDefault:DO(n,z),wrapInAnchor:OO(_,f)})},o),R=Ni("diff-code","diff-code-".concat(y),tw({"diff-code-selected":r},"diff-line-hover-"+z,m),a);return[!p&&h.jsx("td",Tn(Tn({},E),{},{"data-change-key":C}),"gutter"),h.jsx(LO,Tn({className:R,changeKey:C,text:w,tokens:s,renderToken:x},c),"code")]}function p2t(e){var n=e.className,t=e.oldChange,r=e.newChange,s=e.oldSelected,i=e.newSelected,a=e.oldTokens,o=e.newTokens,c=e.monotonous,u=e.gutterClassName,_=e.codeClassName,f=e.gutterEvents,p=e.codeEvents,m=e.hideGutter,x=e.generateAnchorID,S=e.generateLineClassName,b=e.gutterAnchor,v=e.renderToken,y=e.renderGutter,w=bn(T.useState(""),2),C=w[0],z=w[1],E=Kp("old",z,t,f),R=Kp("new",z,r,f),N=Kp("old",z,t,p),M=Kp("new",z,r,p),O=t&&x(t),I=r&&x(r),H=S({changes:[t,r],defaultGenerate:function(){return n}}),U={monotonous:c,hideGutter:m,gutterClassName:u,codeClassName:_,gutterEvents:f,codeEvents:p,renderToken:v,renderGutter:y},F=Tn(Tn({},U),{},{change:t,side:IO,selected:s,tokens:a,gutterEvents:E,codeEvents:N,anchorID:O,gutterAnchor:b,gutterAnchorTarget:O,hover:C==="old"}),Y=Tn(Tn({},U),{},{change:r,side:1,selected:i,tokens:o,gutterEvents:R,codeEvents:M,anchorID:t===r?null:I,gutterAnchor:b,gutterAnchorTarget:t===r?O:I,hover:C==="new"});if(c)return h.jsx("tr",{className:Ni("diff-line",H),children:py(t?F:Y)});var q=(function(Q,Z){return Q&&!Z?"diff-line-old-only":!Q&&Z?"diff-line-new-only":Q===Z?"diff-line-normal":"diff-line-compare"})(t,r);return h.jsxs("tr",{className:Ni("diff-line",q,H),children:[py(F),py(Y)]})}var m2t=T.memo(p2t);function g2t(e){var n=e.hideGutter,t=e.oldElement,r=e.newElement;return e.monotonous?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t||r})}):t===r?h.jsx("tr",{className:"diff-widget",children:h.jsx("td",{colSpan:n?2:4,className:"diff-widget-content",children:t})}):h.jsxs("tr",{className:"diff-widget",children:[h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:t}),h.jsx("td",{colSpan:n?1:2,className:"diff-widget-content",children:r})]})}var b2t=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],v2t=["hunk","widgets","className"];function Yp(e,n){return(e?cc(e):"00")+(n?cc(n):"00")}function x2t(e){var n=e.hunk,t=e.widgets,r=e.className,s=gc(e,v2t),i=(function(a,o){for(var c=function(v){if(!v)return null;var y=cc(v);return o[y]||null},u=[],_=0;_=(i==null?void 0:i.value.length))return[e];var o=function(f,p){var m=i.value.slice(f,p);return[].concat(Ti(s),[Tn(Tn({},i),{},{value:m})])};if(n>0){var c=o(0,n);a.push(If(c))}var u=o(Math.max(n,0),t);if(a.push(r?(function(f,p){return[p].concat(Ti(If(f)))})(u,r):If(u)),t1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,s=gc(e,P2t);t.push(s);var i,a=t3(r);try{for(a.s();!(i=a.n()).done;)HO(i.value,n,t)}catch(o){a.e(o)}finally{a.f()}t.pop()}else n.push(If([].concat(Ti(t.slice(1)),[e])));return n}function H2t(e){return e.reduce((function(n,t){var r=n[n.length-1],s=(function(c){var u=u3(c);return u.value.includes(` +`)?u.value.split(` +`).map((function(_){return I2t(c,Tn(Tn({},u),{},{value:_}))})):[c]})(t),i=uO(s),a=i[0],o=i.slice(1);return[].concat(Ti(n.slice(0,-1)),[[].concat(Ti(r),[a])],Ti(o.map((function(c){return[c]}))))}),[[]])}function VN(e){return H2t(HO(e))}var F2t=function(e,n,t){var r=(t=typeof t=="function"?t:void 0)?t(e,n):void 0;return r===void 0?z1(e,n,void 0,t):!!r},U2t=function(e,n){return z1(e,n)},q2t=function(e){var n=e==null?0:e.length;return n?e[n-1]:void 0};function G2t(e,n){if(!e.children)throw new Error("parent node missing children property");var t,r,s=q2t(e.children);return s&&(r=n,(t=s).type===r.type&&(t.type==="text"||t.children&&r.children&&F2t(t,r,(function(i,a,o){return o==="chlidren"||U2t(i,a)}))))?e.children[e.children.length-1]=(function(i,a){return"value"in i&&"value"in a?Tn(Tn({},i),{},{value:"".concat(i.value).concat(a.value)}):i})(s,n):e.children.push(n),e.children[e.children.length-1]}function WN(e){var n,t={type:"root",children:[]},r=t3(e);try{var s=function(){var i=n.value;i.reduce((function(a,o,c){return G2t(a,c===i.length-1?Tn({},o):Tn(Tn({},o),{},{children:[]}))}),t)};for(r.s();!(n=r.n()).done;)s()}catch(i){r.e(i)}finally{r.f()}return t}var V2t=Object.prototype.hasOwnProperty,W2t=$O((function(e,n,t){V2t.call(e,t)?e[t].push(n):l3(e,t,[n])})),K2t=Object.prototype.hasOwnProperty,Y2t=function(e){if(e==null)return!0;if(N1(e)&&(Mi(e)||typeof e=="string"||typeof e.splice=="function"||pg(e)||s3(e)||E1(e)))return!e.length;var n=cw(e);if(n=="[object Map]"||n=="[object Set]")return!e.size;if(CO(e))return!EO(e).length;for(var t in e)if(K2t.call(e,t))return!1;return!0},X2t=function(e,n){var t=n.start,r=n.length,s=t+r,i=e.reduce((function(a,o){var c=bn(a,2),u=c[0],_=c[1],f=_+u3(o).value.length;if(_>s||fr.length?t:r,c=t.length>r.length?r:t,u=o.indexOf(c);if(u!=-1)return a=[new n.Diff(1,o.substring(0,u)),new n.Diff(0,c),new n.Diff(1,o.substring(u+c.length))],t.length>r.length&&(a[0][0]=a[2][0]=-1),a;if(c.length==1)return[new n.Diff(-1,t),new n.Diff(1,r)];var _=this.diff_halfMatch_(t,r);if(_){var f=_[0],p=_[1],m=_[2],x=_[3],S=_[4],b=this.diff_main(f,m,s,i),v=this.diff_main(p,x,s,i);return b.concat([new n.Diff(0,S)],v)}return s&&t.length>100&&r.length>100?this.diff_lineMode_(t,r,i):this.diff_bisect_(t,r,i)},n.prototype.diff_lineMode_=function(t,r,s){var i=this.diff_linesToChars_(t,r);t=i.chars1,r=i.chars2;var a=i.lineArray,o=this.diff_main(t,r,!1,s);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new n.Diff(0,""));for(var c=0,u=0,_=0,f="",p="";c=1&&_>=1){o.splice(c-u-_,u+_),c=c-u-_;for(var m=this.diff_main(f,p,!1,s),x=m.length-1;x>=0;x--)o.splice(c,0,m[x]);c+=m.length}_=0,u=0,f="",p=""}c++}return o.pop(),o},n.prototype.diff_bisect_=function(t,r,s){for(var i=t.length,a=r.length,o=Math.ceil((i+a)/2),c=o,u=2*o,_=new Array(u),f=new Array(u),p=0;ps);w++){for(var C=-w+S;C<=w-b;C+=2){for(var z=c+C,E=(I=C==-w||C!=w&&_[z-1]<_[z+1]?_[z+1]:_[z-1]+1)-C;Ii)b+=2;else if(E>a)S+=2;else if(x&&(M=c+m-C)>=0&&M=(N=i-f[M]))return this.diff_bisectSplit_(t,r,I,E,s)}for(var R=-w+v;R<=w-y;R+=2){for(var N,M=c+R,O=(N=R==-w||R!=w&&f[M-1]i)y+=2;else if(O>a)v+=2;else if(!x&&(z=c+m-R)>=0&&z=(N=i-N))return this.diff_bisectSplit_(t,r,I,E,s)}}}return[new n.Diff(-1,t),new n.Diff(1,r)]},n.prototype.diff_bisectSplit_=function(t,r,s,i,a){var o=t.substring(0,s),c=r.substring(0,i),u=t.substring(s),_=r.substring(i),f=this.diff_main(o,c,!1,a),p=this.diff_main(u,_,!1,a);return f.concat(p)},n.prototype.diff_linesToChars_=function(t,r){var s=[],i={};function a(u){for(var _="",f=0,p=-1,m=s.length;pi?t=t.substring(s-i):sr.length?t:r,i=t.length>r.length?r:t;if(s.length<4||2*i.length=S.length?[y,w,C,z,N]:null}var c,u,_,f,p,m=o(s,i,Math.ceil(s.length/4)),x=o(s,i,Math.ceil(s.length/2));return m||x?(c=x?m&&m[4].length>x[4].length?m:x:m,t.length>r.length?(u=c[0],_=c[1],f=c[2],p=c[3]):(f=c[0],p=c[1],u=c[2],_=c[3]),[u,_,f,p,c[4]]):null},n.prototype.diff_cleanupSemantic=function(t){for(var r=!1,s=[],i=0,a=null,o=0,c=0,u=0,_=0,f=0;o0?s[i-1]:-1,c=0,u=0,_=0,f=0,a=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(t),this.diff_cleanupSemanticLossless(t),o=1;o=S?(x>=p.length/2||x>=m.length/2)&&(t.splice(o,0,new n.Diff(0,m.substring(0,x))),t[o-1][1]=p.substring(0,p.length-x),t[o+1][1]=m.substring(x),o++):(S>=p.length/2||S>=m.length/2)&&(t.splice(o,0,new n.Diff(0,p.substring(0,S))),t[o-1][0]=1,t[o-1][1]=m.substring(0,m.length-S),t[o+1][0]=-1,t[o+1][1]=p.substring(S),o++),o++}o++}},n.prototype.diff_cleanupSemanticLossless=function(t){function r(S,b){if(!S||!b)return 6;var v=S.charAt(S.length-1),y=b.charAt(0),w=v.match(n.nonAlphaNumericRegex_),C=y.match(n.nonAlphaNumericRegex_),z=w&&v.match(n.whitespaceRegex_),E=C&&y.match(n.whitespaceRegex_),R=z&&v.match(n.linebreakRegex_),N=E&&y.match(n.linebreakRegex_),M=R&&S.match(n.blanklineEndRegex_),O=N&&b.match(n.blanklineStartRegex_);return M||O?5:R||N?4:w&&!z&&E?3:z||E?2:w||C?1:0}for(var s=1;s=m&&(m=x,_=i,f=a,p=o)}t[s-1][1]!=_&&(_?t[s-1][1]=_:(t.splice(s-1,1),s--),t[s][1]=f,p?t[s+1][1]=p:(t.splice(s+1,1),s--))}s++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(t){for(var r=!1,s=[],i=0,a=null,o=0,c=!1,u=!1,_=!1,f=!1;o0?s[i-1]:-1,_=f=!1),r=!0)),o++;r&&this.diff_cleanupMerge(t)},n.prototype.diff_cleanupMerge=function(t){t.push(new n.Diff(0,""));for(var r,s=0,i=0,a=0,o="",c="";s1?(i!==0&&a!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(s-i-a>0&&t[s-i-a-1][0]==0?t[s-i-a-1][1]+=c.substring(0,r):(t.splice(0,0,new n.Diff(0,c.substring(0,r))),s++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(t[s][1]=c.substring(c.length-r)+t[s][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),s-=i+a,t.splice(s,i+a),o.length&&(t.splice(s,0,new n.Diff(-1,o)),s++),c.length&&(t.splice(s,0,new n.Diff(1,c)),s++),s++):s!==0&&t[s-1][0]==0?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,a=0,i=0,o="",c=""}t[t.length-1][1]===""&&t.pop();var u=!1;for(s=1;sr));s++)o=i,c=a;return t.length!=s&&t[s][0]===-1?c:c+(r-o)},n.prototype.diff_prettyHtml=function(t){for(var r=[],s=/&/g,i=//g,o=/\n/g,c=0;c");switch(u){case 1:r[c]=''+_+"";break;case-1:r[c]=''+_+"";break;case 0:r[c]=""+_+""}}return r.join("")},n.prototype.diff_text1=function(t){for(var r=[],s=0;sthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(r),a=this;function o(E,R){var N=E/r.length,M=Math.abs(s-R);return a.Match_Distance?N+M/a.Match_Distance:M?1:N}var c=this.Match_Threshold,u=t.indexOf(r,s);u!=-1&&(c=Math.min(o(0,u),c),(u=t.lastIndexOf(r,s+r.length))!=-1&&(c=Math.min(o(0,u),c)));var _,f,p=1<=b;w--){var C=i[t.charAt(w-1)];if(y[w]=S===0?(y[w+1]<<1|1)&C:(y[w+1]<<1|1)&C|(m[w+1]|m[w])<<1|1|m[w+1],y[w]&p){var z=o(S,w-1);if(z<=c){if(c=z,!((u=w-1)>s))break;b=Math.max(1,2*s-u)}}}if(o(S+1,s)>c)break;m=y}return u},n.prototype.match_alphabet_=function(t){for(var r={},s=0;s2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(t&&typeof t=="object"&&r===void 0&&s===void 0)a=t,i=this.diff_text1(a);else if(typeof t=="string"&&r&&typeof r=="object"&&s===void 0)i=t,a=r;else{if(typeof t!="string"||typeof r!="string"||!s||typeof s!="object")throw new Error("Unknown call format to patch_make.");i=t,a=s}if(a.length===0)return[];for(var o=[],c=new n.patch_obj,u=0,_=0,f=0,p=i,m=i,x=0;x=2*this.Patch_Margin&&u&&(this.patch_addContext_(c,p),o.push(c),c=new n.patch_obj,u=0,p=m,_=f)}S!==1&&(_+=b.length),S!==-1&&(f+=b.length)}return u&&(this.patch_addContext_(c,p),o.push(c)),o},n.prototype.patch_deepCopy=function(t){for(var r=[],s=0;sthis.Match_MaxBits?(c=this.match_main(r,f.substring(0,this.Match_MaxBits),_))!=-1&&((p=this.match_main(r,f.substring(f.length-this.Match_MaxBits),_+f.length-this.Match_MaxBits))==-1||c>=p)&&(c=-1):c=this.match_main(r,f,_),c==-1)a[o]=!1,i-=t[o].length2-t[o].length1;else if(a[o]=!0,i=c-_,f==(u=p==-1?r.substring(c,c+f.length):r.substring(c,p+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(t[o].diffs)+r.substring(c+f.length);else{var m=this.diff_main(f,u,!1);if(f.length>this.Match_MaxBits&&this.diff_levenshtein(m)/f.length>this.Patch_DeleteThreshold)a[o]=!1;else{this.diff_cleanupSemanticLossless(m);for(var x,S=0,b=0;bo[0][1].length){var c=r-o[0][1].length;o[0][1]=s.substring(o[0][1].length)+o[0][1],a.start1-=c,a.start2-=c,a.length1+=c,a.length2+=c}return(o=(a=t[t.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new n.Diff(0,s)),a.length1+=r,a.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=s.substring(0,c),a.length1+=c,a.length2+=c),s},n.prototype.patch_splitMax=function(t){for(var r=this.Match_MaxBits,s=0;s2*r?(u.length1+=p.length,a+=p.length,_=!1,u.diffs.push(new n.Diff(f,p)),i.diffs.shift()):(p=p.substring(0,r-u.length1-this.Patch_Margin),u.length1+=p.length,a+=p.length,f===0?(u.length2+=p.length,o+=p.length):_=!1,u.diffs.push(new n.Diff(f,p)),p==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(p.length))}c=(c=this.diff_text2(u.diffs)).substring(c.length-this.Patch_Margin);var m=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);m!==""&&(u.length1+=m.length,u.length2+=m.length,u.diffs.length!==0&&u.diffs[u.diffs.length-1][0]===0?u.diffs[u.diffs.length-1][1]+=m:u.diffs.push(new n.Diff(0,m))),_||t.splice(++s,0,u)}}},n.prototype.patch_toText=function(t){for(var r=[],s=0;s1&&arguments[1]!==void 0?arguments[1]:{}).type,t=(n===void 0?"block":n)==="block"?nwt:rwt,r=c3(e.map((function(o){return o.changes})),FO).map(t).reduce((function(o,c){var u=bn(o,2),_=u[0],f=u[1],p=bn(c,2),m=p[0],x=p[1];return[_.concat(m),f.concat(x)]}),[[],[]]),s=bn(r,2),i=s[0],a=s[1];return Z2t(YN(i),YN(a))}var iwt=["enhancers"],JN=function(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.enhancers,s=r===void 0?[]:r,i=bn(O2t(e,gc(t,iwt)),2),a=i[0],o=i[1],c=[VN(a),VN(o)],u=(n=[c[0],c[1]],s.reduce((function(S,b){return b(S)}),n)),_=bn(u,2),f=_[0],p=_[1],m=[f.map(WN),p.map(WN)],x=m[1];return{old:m[0].map((function(S){var b;return(b=S.children)!==null&&b!==void 0?b:[]})),new:x.map((function(S){var b;return(b=S.children)!==null&&b!==void 0?b:[]}))}};const fw=["openresearch-diff flex flex-col gap-4","[&_.openresearch-diff-file]:[--diff-background-color:var(--base)]","[&_.openresearch-diff-file]:[--diff-text-color:var(--text)]","[&_.openresearch-diff-file]:[--diff-font-family:var(--mono)]","[&_.openresearch-diff-file]:[--diff-selection-text-color:var(--primary)]","[&_.openresearch-diff-file]:[--diff-selection-background-color:var(--color-diff-selection)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-gutter-selected-background-color:var(--color-diff-gutter-selection)]","[&_.openresearch-diff-file]:[--diff-code-selected-text-color:var(--diff-selection-text-color)]","[&_.openresearch-diff-file]:[--diff-code-selected-background-color:var(--diff-selection-background-color)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-text-color:var(--accent-green)]","[&_.openresearch-diff-file]:[--diff-gutter-insert-background-color:var(--color-diff-insert-gutter)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-text-color:var(--accent-red)]","[&_.openresearch-diff-file]:[--diff-gutter-delete-background-color:var(--color-diff-delete-gutter)]","[&_.openresearch-diff-file]:[--diff-code-insert-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-background-color:var(--color-diff-insert-code)]","[&_.openresearch-diff-file]:[--diff-code-delete-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-background-color:var(--color-diff-delete-code)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-insert-edit-background-color:var(--color-diff-insert-edit)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-text-color:var(--diff-text-color)]","[&_.openresearch-diff-file]:[--diff-code-delete-edit-background-color:var(--color-diff-delete-edit)]","[&_.openresearch-diff-file]:[--diff-omit-gutter-line-color:var(--color-diff-omit-gutter)]","[&_.openresearch-diff-file]:w-full [&_.openresearch-diff-file]:text-sm","[&_.openresearch-diff-file]:leading-[1.55] [&_.openresearch-diff-file.diff-unified]:table-auto","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:collapse","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:first-child]:w-0","[&_.openresearch-diff-file.diff-unified_col.diff-gutter-col:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:first-child]:hidden","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:sticky","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:start-0","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:z-1","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:w-[1%]","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pt-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pe-2.5 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:pb-0 [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:ps-3.5","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:whitespace-nowrap","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-end","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:text-diff-gutter-text","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e [&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:border-e-border","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:select-none","[&_.openresearch-diff-file.diff-unified_.diff-line_>_td:nth-child(2)]:cursor-default","[&_.openresearch-diff-file_.diff-line]:leading-[1.55]","[&_.openresearch-diff-file_.diff-line:has(.diff-code-insert)]:bg-diff-insert-code","[&_.openresearch-diff-file_.diff-line:has(.diff-code-delete)]:bg-diff-delete-code","[&_.openresearch-diff-file_.diff-code]:py-0 [&_.openresearch-diff-file_.diff-code]:px-4","[&_.openresearch-diff-file_.diff-code]:whitespace-pre","[&_.openresearch-diff-file_.diff-code]:break-normal","[&_.openresearch-diff-file_.diff-code]:wrap-normal","[&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t [&_.openresearch-diff-file_.diff-hunk_+_.diff-hunk_.diff-line:first-child_>_td]:border-t-border"].join(" "),awt=2e3,owt={highlight(e,n){return kt.highlight(e,n).children}};function lwt(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function f3(e){let n=0,t=0;for(const r of e.hunks)for(const s of r.changes)s.type==="insert"?n++:s.type==="delete"&&t++;return{additions:n,deletions:t}}function cwt(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function dw(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function uwt(e){const n=[swt(e.hunks,{type:"line"})],t=x5(cwt(e));return t&&kt.registered(t)?JN(e.hunks,{enhancers:n,highlight:!0,language:t,refractor:owt}):JN(e.hunks,{enhancers:n,highlight:!1})}function fwt(e,n){if(!e.trim())return{files:[],failed:!1};try{return{files:rw(e,{nearbySequences:"zip"}),failed:!1}}catch{if(n){const t=Array.from(e.matchAll(/^diff --git /gm),s=>s.index),r=t[t.length-1];if(t.length>1&&r!==void 0)try{return{files:rw(e.slice(0,r),{nearbySequences:"zip"}),failed:!1}}catch{return{files:[],failed:!0}}}return{files:[],failed:!0}}}const dwt=({change:e,side:n})=>n==="old"?null:lwt(e);function qO({bytesRead:e,byteLimit:n}){return h.jsxs("div",{className:"truncated-notice border border-accent-amber rounded-md bg-accent-amber-subtle py-3 px-3.5 text-sm [&_h4]:mt-0 [&_h4]:mx-0 [&_h4]:mb-1 [&_h4]:text-sm [&_h4]:text-accent-amber [&_p]:m-0 [&_p]:text-subtext",children:[h.jsx("h4",{children:I1e()}),h.jsx("p",{children:pbe({limit:ze(Yo(n)),read:ze(Yo(e))})})]})}function GO({file:e,defaultExpanded:n}){const[t,r]=T.useState(n),{additions:s,deletions:i}=T.useMemo(()=>f3(e),[e]),a=t&&s+i<=awt,o=T.useMemo(()=>{if(a)try{return uwt(e)}catch{return}},[e,a]);return h.jsxs("section",{className:`diff-file-card overflow-hidden border border-border rounded-md bg-background [&.expanded_.diff-file-header]:border-b [&.expanded_.diff-file-header]:border-b-border ${t?"expanded":""}`,children:[h.jsxs("button",{className:"diff-file-header sticky top-0 z-10 flex items-center justify-between gap-3 w-full text-start py-2 px-3 bg-canvas cursor-pointer [&_.chev]:text-muted [&_.chev]:text-xs [&_.chev]:shrink-0 [&_.chev]:w-3 [&_.path]:flex [&_.path]:items-center [&_.path]:gap-2 [&_.path]:min-w-0 [&_.path]:flex-1 [&_.path_code]:min-w-0 [&_.path_code]:flex-1 [&_.path_code]:overflow-hidden [&_.path_code]:text-ellipsis [&_.path_code]:whitespace-nowrap [&_.path_code]:font-mono [&_.path_code]:text-xs [&_.path_code]:font-semibold [&_.path_code]:text-text [&_.stats]:flex [&_.stats]:items-center [&_.stats]:gap-2 [&_.stats]:shrink-0 [&_.stats]:font-mono [&_.stats]:text-xs [&_.stats]:font-medium [&_.stats]:tabular-nums","aria-expanded":t,onClick:()=>r(c=>!c),children:[h.jsx("span",{className:"chev",children:t?h.jsx(lo,{size:14}):h.jsx(co,{size:14})}),h.jsx("span",{className:"path",children:h.jsx("code",{children:dw(e)})}),h.jsxs("span",{className:"stats",children:[h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",s]}),h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",i]})]})]}),t&&(e.hunks.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:J1e()}):h.jsx("div",{className:"diff-file-body overflow-x-auto bg-background",children:h.jsx(E2t,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:dwt,tokens:o,viewType:"unified"})}))]})}function hwt({files:e,className:n}){return h.jsx("div",{className:n?`${fw} ${n}`:fw,children:e.map((t,r)=>h.jsx(GO,{file:t,defaultExpanded:r===0},`${t.oldPath}→${t.newPath}#${r}`))})}function _wt(e){switch(e.type){case"add":return"A";case"delete":return"D";case"rename":return"R";case"copy":return"C";case"modify":return"M"}}function VO({diff:e,partial:n=!1}){var p;const t=T.useMemo(()=>fwt(e,n),[e,n]),r=t.files,s=T.useMemo(()=>r.map((m,x)=>({file:m,key:`${m.oldPath}→${m.newPath}#${x}`,changes:f3(m)})),[r]),[i,a]=T.useState(null),[o,c]=T.useState(!1),u=o&&!n,_=s.some(m=>m.key===i)?i:((p=s[0])==null?void 0:p.key)??null,f=s.find(m=>m.key===_)??null;return t.failed?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:n?Y1e():fbe()}):s.length===0?h.jsx("div",{className:"diff-empty py-2 px-3 text-muted text-sm",children:G1e()}):h.jsxs("div",{className:"diff-explorer @container",children:[h.jsxs("div",{className:"diff-explorer-toolbar flex items-center justify-between gap-3 mb-2.5 text-sm [&_button]:py-0.5 [&_button]:px-0 [&_button]:text-muted [&_button]:text-sm [&_button]:font-medium [&_button:hover]:text-text [&_button:hover]:underline [&_button:hover]:underline-offset-2",children:[h.jsx("strong",{children:n?s.length===1?obe():H1e({count:Xt(s.length)}):s.length===1?rbe():j1e({count:Xt(s.length)})}),!n&&h.jsx("button",{type:"button",onClick:()=>c(m=>!m),children:u?C1e():vbe()})]}),u?h.jsx(hwt,{files:r}):h.jsxs("div",{className:"diff-explorer-layout grid grid-cols-[minmax(180px,_260px)_minmax(0,_1fr)] items-start gap-3.5 [@container((max-width:_960px))]:grid-cols-1",children:[h.jsx("div",{className:"diff-explorer-files sticky top-0 max-h-[min(70vh,_720px)] overflow-auto border border-border rounded-md bg-background [&_button]:grid [&_button]:grid-cols-[18px_minmax(0,_1fr)_auto_auto] [&_button]:items-center [&_button]:gap-[7px] [&_button]:w-full [&_button]:py-2 [&_button]:px-[9px] [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button:last-child]:border-b-0 [&_button:hover]:bg-surface [&_button.active]:bg-surface [&_button.active]:shadow-diff-active [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap [&_code]:text-xs [@container((max-width:_960px))]:static [@container((max-width:_960px))]:max-h-55","aria-label":M1e(),children:s.map(m=>h.jsxs("button",{type:"button",className:m.key===_?"active":"","aria-pressed":m.key===_,onClick:()=>a(m.key),children:[h.jsx("span",{className:`diff-file-status font-mono text-xs font-medium text-muted [&.status-add]:text-accent-green [&.status-delete]:text-accent-red [&.status-rename]:text-accent-blue [&.status-copy]:text-accent-blue status-${m.file.type}`,children:_wt(m.file)}),h.jsx("code",{title:dw(m.file),children:dw(m.file)}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-add text-accent-green",children:["+",m.changes.additions]}),h.jsxs("span",{className:"diff-explorer-stat font-mono text-xs diff-stat-del text-accent-red",children:["−",m.changes.deletions]})]},m.key))}),h.jsx("div",{className:`${fw} diff-explorer-preview min-w-0`,children:f&&h.jsx(GO,{file:f.file,defaultExpanded:!0},f.key)})]})]})}function pwt({experiment:e,refreshKey:n,onLoadingChange:t}){const[r,s]=T.useState(null),[i,a]=T.useState(null);return T.useEffect(()=>{let o=!1;return t(!0),a(null),s(null),ent(e.id).then(c=>{o||s(c)}).catch(c=>{o||a(c.message)}).finally(()=>{o||t(!1)}),()=>{o=!0}},[e.id,n,t]),h.jsx(Kf,{className:"branch-changes [&_>_.changes-note]:mx-4 [&_>_.changes-note]:my-3.5 [&_>_.diff-explorer]:mx-4 [&_>_.diff-explorer]:mb-0 [&_>_.diff-explorer]:mt-3.5 [&_>_.openresearch-diff]:mx-4 [&_>_.openresearch-diff]:mb-0 [&_>_.openresearch-diff]:mt-3.5 [&_>_.truncated-notice]:mx-4 [&_>_.truncated-notice]:mb-0 [&_>_.truncated-notice]:mt-3.5",children:i?h.jsxs(ma,{children:[SJ()," ",ze(i)]}):r?r.diff.trim()?h.jsxs(h.Fragment,{children:[r.truncated&&h.jsx(qO,{bytesRead:r.bytesRead,byteLimit:r.byteLimit}),h.jsx(VO,{diff:r.diff,partial:r.truncated})]}):h.jsx("div",{className:"changes-note text-sm text-muted",children:e.parentExperimentId?AJ():vJ()}):h.jsx(ma,{children:NJ()})})}function WO({view:e,onViewChange:n,showViewToggle:t=!0,branchLabel:r,branchTitle:s,githubHref:i,githubTitle:a,refreshing:o,onRefresh:c}){return h.jsxs("div",{className:"code-tab-header flex items-center gap-2 py-1.5 px-3 border-b border-b-border-variant shrink-0 [&_>_.seg]:p-0.5 [&_>_.seg]:rounded-sm [&_>_.seg_button]:py-0.5 [&_>_.seg_button]:px-2 [&_>_.seg_button]:text-sm [&_>_.seg_button]:font-medium",children:[t&&h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 p-[3px] rounded-md bg-hover-subtle [&_button]:py-[3px] [&_button]:px-3 [&_button]:text-sm [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default",role:"group","aria-label":iue(),children:[h.jsx("button",{type:"button",className:e==="files"?"active":"","aria-pressed":e==="files",onClick:()=>n("files"),children:cue()}),h.jsx("button",{type:"button",className:e==="changes"?"active":"","aria-pressed":e==="changes",onClick:()=>n("changes"),children:tue()})]}),r&&h.jsxs("span",{className:"wt-branch-chip inline-flex items-center gap-1 min-w-0 py-0.5 px-2 rounded-full bg-hover-muted text-subtext text-xs [&_>_svg]:shrink-0",title:s,children:[h.jsx(Wg,{size:12}),h.jsx("span",{className:"wt-branch-name overflow-hidden text-ellipsis whitespace-nowrap",children:r})]}),i&&h.jsx(Pg,{href:i,target:"_blank",rel:"noopener noreferrer",title:a,"aria-label":a,children:h.jsx(Kg,{size:13})}),h.jsx("span",{className:"flex-1"}),h.jsx(Yt,{title:x8(),"aria-label":x8(),onClick:c,children:o?h.jsx(Ot,{}):h.jsx($ot,{size:13})})]})}const mwt=/\.(md|mdx|markdown)$/i,gwt=/\.tex$/i,bwt=/\.html?$/i,vwt=/\.(apng|avif|bmp|gif|heic|heif|ico|jpe?g|jfif|jxl|pbm|pgm|png|pnm|ppm|svg|tiff?|webp)$/i,xwt=/\.(csv|tsv|xlsx?|ods)$/i,ywt=/\.(c|cc|cpp|css|go|html?|java|js|jsx|json|mjs|py|rs|sh|toml|ts|tsx|ya?ml)$/i,wwt=/\.(7z|bz2|gz|rar|tar|tgz|zip)$/i,Swt=/\.pdf$/i,kwt=/\.(docx?|log|rtf|txt)$/i;function Cwt(e){return vwt.test(e)}function d3(e){return mwt.test(e)}function KO(e){return gwt.test(e)}function Ewt(e){return bwt.test(e)}function _d({name:e}){const n=d3(e)?"markdown":Cwt(e)?"image":xwt.test(e)?"spreadsheet":ywt.test(e)?"code":wwt.test(e)?"archive":Swt.test(e)?"pdf":kwt.test(e)||KO(e)?"document":"file";let t;return n==="markdown"?t=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M1 3h14v10H1z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M2.6 10.5v-5h1.2l1.6 2 1.6-2h1.2v5H6.8V7.6L5.4 9.3 4 7.6v2.9H2.6Zm8.5-5v2.4h1.3L10.5 10 8.6 7.9h1.3V5.5h1.2Z",fill:"currentColor"})]}):n==="image"?t=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"1.5",y:"2",width:"13",height:"12",rx:"2",fill:"currentColor",opacity:".18"}),h.jsx("circle",{cx:"5",cy:"5.5",r:"1.4",fill:"currentColor"}),h.jsx("path",{d:"m2.8 12 3.3-3.5 2.2 2 2.1-2.5 2.8 4H2.8Z",fill:"currentColor"})]}):n==="spreadsheet"?t=h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2",y:"1.5",width:"12",height:"13",rx:"1.5",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M3.5 4.5h9M3.5 8h9M3.5 11.5h9M7 3v10M10.5 3v10",stroke:"currentColor",strokeWidth:"1.1"})]}):n==="code"?t=h.jsx("path",{d:"M6.2 3 1.8 8l4.4 5 1.3-1.2L4.2 8l3.3-3.8L6.2 3Zm3.6 0-1.3 1.2L11.8 8l-3.3 3.8 1.3 1.2 4.4-5-4.4-5Z",fill:"currentColor"}):n==="archive"?t=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M2 2h12v12H2z",fill:"currentColor",opacity:".18"}),h.jsx("path",{d:"M7 2h2v2H7V2Zm0 3h2v2H7V5Zm0 3h2v2H7V8Zm-0.5 3h3v2h-3v-2Z",fill:"currentColor"})]}):t=h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 1.5h6l4 4v9H3v-13Z",fill:"currentColor",opacity:".2"}),h.jsx("path",{d:"M9 1.5v4h4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M5 8h6M5 10.5h6M5 13h4",stroke:"currentColor",strokeWidth:"1.2"})]}),h.jsx("svg",{className:`file-tree-icon w-[15px] h-[15px] shrink-0 text-muted overflow-visible [&.markdown]:text-accent-blue [&.image]:text-accent-purple [&.spreadsheet]:text-accent-green [&.code]:text-accent-orange [&.archive]:text-accent-amber [&.pdf]:text-accent-red [&.document]:text-subtext ${n}`,viewBox:"0 0 16 16","aria-hidden":"true",children:t})}function YO(e,n){const t=navigator.clipboard;if(!t){Vn(X0e(),"error");return}t.writeText(`${e.replace(/[\\/]+$/,"")}/${n}`).then(()=>Vn(l_(),"success")).catch(r=>Vn(r instanceof Error?r.message:String(r),"error"))}function XO({name:e,onCommit:n,onCancel:t}){const[r,s]=T.useState(e),i=T.useRef(!1),a=()=>{if(i.current)return;i.current=!0;const o=r.trim();!o||o===e?t():n(o)};return h.jsx(Ts,{autoFocus:!0,variant:"inline",className:"min-w-0 flex-1",value:r,"aria-label":mpe({path:ze(e)}),onFocus:o=>{const c=e.lastIndexOf(".");o.currentTarget.setSelectionRange(0,c>0?c:e.length)},onChange:o=>s(o.target.value),onClick:o=>o.stopPropagation(),onDoubleClick:o=>o.stopPropagation(),onBlur:a,onKeyDown:o=>{o.stopPropagation(),o.key==="Enter"?(o.preventDefault(),o.currentTarget.blur()):o.key==="Escape"&&(o.preventDefault(),i.current=!0,t())}})}function ZO(e,n){const t=e.currentTarget.getBoundingClientRect(),r="clientX"in e?e.clientX:0,s="clientY"in e?e.clientY:0;return{path:n,x:r||t.left+16,y:s||t.top+t.height}}function QO({target:e,onOpen:n,onRename:t,onDuplicate:r,onCopyPath:s,onDelete:i,onClose:a}){const o=T.useRef(null),c=T.useRef(a);c.current=a;const[u,_]=T.useState({x:e.x,y:e.y});T.useLayoutEffect(()=>{var S;const m=o.current;if(!m)return;const x=document.activeElement instanceof HTMLElement?document.activeElement:null;return _({x:Math.max(8,Math.min(e.x,window.innerWidth-m.offsetWidth-8)),y:Math.max(8,Math.min(e.y,window.innerHeight-m.offsetHeight-8))}),(S=m.querySelector("button"))==null||S.focus(),()=>{m.contains(document.activeElement)&&(x==null||x.focus())}},[e]),T.useEffect(()=>{const m=()=>c.current(),x=b=>{var v;(v=o.current)!=null&&v.contains(b.target instanceof Node?b.target:null)||c.current()},S=b=>{if(b.key==="Tab"){b.preventDefault(),c.current();return}b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),c.current())};return document.addEventListener("pointerdown",x),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("pointerdown",x),window.removeEventListener("blur",m),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0),document.removeEventListener("keydown",S,!0)}},[]);const f=m=>{c.current(),m()},p=(m,x,S=!1)=>h.jsx(Er,{size:"compact",role:"menuitem",danger:S,onClick:()=>f(x),children:h.jsx("span",{children:m})});return al.createPortal(h.jsxs("div",{ref:o,role:"menu","aria-label":lpe({path:ze(e.path)}),className:"option-menu fixed z-100 min-w-44 overflow-hidden rounded-md border border-border bg-background p-1 shadow-menu",style:{left:u.x,top:u.y},onContextMenu:m=>m.preventDefault(),onKeyDown:m=>{var v,y;if(m.key!=="ArrowDown"&&m.key!=="ArrowUp")return;m.preventDefault();const x=[...((v=o.current)==null?void 0:v.querySelectorAll("button"))??[]],S=x.indexOf(document.activeElement instanceof HTMLButtonElement?document.activeElement:x[0]),b=m.key==="ArrowDown"?1:-1;(y=x[(S+b+x.length)%x.length])==null||y.focus()},children:[p(dpe(),n),t&&p(pT(),t),r&&p(spe(),r),p(uT(),s),i&&p(_T(),i,!0)]}),document.body)}const hw=["file-tree-row flex items-center gap-1.5 w-full py-[3px] px-2.5 border-0","bg-transparent text-text text-start cursor-pointer font-[inherit]","[&:hover]:bg-panel [&_>_svg]:shrink-0","[&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted"].join(" "),ez=["file-tree-chevron text-muted shrink-0 [button&]:inline-flex","[button&]:items-center [button&]:justify-center [button&]:w-[13px]","[button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent","[button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90"].join(" ");function tz(){return{dirs:new Map,files:[]}}function JO(e){const n=tz();for(const t of e){const r=t.split("/");let s=n;for(let i=0;ii(t),title:t,children:[p?h.jsx(lo,{size:13,className:ez}):h.jsx(co,{size:13,className:ez}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:e})]}),p&&h.jsx(h3,{node:n,parentPath:t,depth:r+1,toggled:s,onToggle:i,onOpenFile:a,renamingPath:o,onContextMenu:c,onRename:u,onCancelRename:_})]})}function h3({node:e,parentPath:n,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u}){const _=[...e.dirs.keys()].sort((p,m)=>p.localeCompare(m)),f=[...e.files].sort((p,m)=>p.localeCompare(m));return h.jsxs(h.Fragment,{children:[_.map(p=>{const m=n?`${n}/${p}`:p;return h.jsx(Nwt,{name:p,node:e.dirs.get(p),path:m,depth:t,toggled:r,onToggle:s,onOpenFile:i,renamingPath:a,onContextMenu:o,onRename:c,onCancelRename:u},`d:${m}`)}),f.map(p=>{const m=n?`${n}/${p}`:p;if(a===m&&c&&u)return h.jsxs("div",{className:hw,style:{paddingInlineStart:8+t*14},children:[h.jsx(_d,{name:p}),h.jsx(XO,{name:p,onCommit:S=>c(m,S),onCancel:u})]},`f:${m}`);const x=Nr(S=>i(m,S));return h.jsxs("button",{type:"button",className:hw,style:{paddingInlineStart:8+t*14},...x,onContextMenu:S=>{o&&(S.preventDefault(),o(S,m))},onKeyDown:S=>{if(o&&(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10")){S.preventDefault(),o(S,m);return}x.onKeyDown(S)},title:XU({name:ze(m)}),children:[h.jsx(_d,{name:p}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p})]},`f:${m}`)})]})}function zwt({projectId:e,project:n,experiment:t,view:r,toggled:s,onViewChange:i,onToggledChange:a,onOpenFile:o}){const c=t.branchName,u=`${e}:${c}`,[_,f]=T.useState(null),[p,m]=T.useState(null),[x,S]=T.useState(!1),[b,v]=T.useState(!1),[y,w]=T.useState(0),[C,z]=T.useState(void 0),E=T.useRef(0),R=T.useRef(null),N=T.useCallback(()=>{R.current=u;const H=++E.current;S(!0),Gy(e,{ref:c}).then(U=>{H===E.current&&(f(U),m(null))}).catch(U=>{H===E.current&&m(U.message)}).finally(()=>{H===E.current&&S(!1)})},[e,c,u]);T.useEffect(()=>(E.current++,R.current=null,f(null),m(null),S(!1),()=>{E.current++}),[u]),T.useEffect(()=>{r==="files"&&R.current!==u&&N()},[r,u,N]),T.useEffect(()=>{z(void 0);const H=t.chatSessionId;if(!H)return;let U=!1;return kA(H).then(F=>{!U&&F.exists&&F.branch===c&&z(H)}).catch(()=>{}),()=>{U=!0}},[t.chatSessionId,c]);const M=T.useMemo(()=>_?JO(_.entries):null,[_]),O=r==="files"?x:b,I=T.useCallback(H=>{const U=new Set(s);U.has(H)?U.delete(H):U.add(H),a(U)},[s,a]);return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0",children:[h.jsx(WO,{view:r,onViewChange:i,branchLabel:c,branchTitle:`Committed branch ${c}`,githubHref:n.githubEnabled?Bg(n.githubOwner,n.githubRepo,c):void 0,githubTitle:lT({branch:ze(c)}),refreshing:O,onRefresh:()=>r==="files"?N():w(H=>H+1)}),r==="changes"?h.jsx(pwt,{experiment:t,refreshKey:y,onLoadingChange:v},t.id):h.jsxs(h.Fragment,{children:[(_==null?void 0:_.truncated)&&h.jsx(ma,{children:mue()}),p&&M&&h.jsxs(ma,{children:[kue()," ",ze(p)]}),h.jsx(Kf,{children:M?M.dirs.size===0&&M.files.length===0?h.jsx(ma,{children:xue()}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:h.jsx(h3,{node:M,parentPath:"",depth:0,toggled:s,onToggle:I,onOpenFile:(H,U)=>C?o(H,C,void 0,U):o(H,void 0,c,U)})}):h.jsx(ma,{children:p?vT({error:ze(p)}):xT()})})]})]})}function jwt({sessionId:e,project:n,view:t,toggled:r,onViewChange:s,onToggledChange:i,onOpenFile:a,canRenameFile:o}){var Z;const c=n.id,[u,_]=T.useState(null),[f,p]=T.useState(null),[m,x]=T.useState(null),[S,b]=T.useState(!0),[v,y]=T.useState(null),[w,C]=T.useState(null),z=T.useRef(0),E=T.useCallback(()=>{const B=++z.current;b(!0),(async()=>{if(!e)return[null,await Gy(c,{ref:n.baselineBranch})];const P=await kA(e),X=P.exists?{sessionId:e}:{ref:n.baselineBranch};return[P,await Gy(c,X)]})().then(([P,X])=>{B===z.current&&(_(P),p(X),x(null))}).catch(P=>{B===z.current&&x(P.message)}).finally(()=>{B===z.current&&b(!1)})},[e,c,n.baselineBranch]);T.useEffect(()=>(_(null),p(null),x(null),E(),()=>{z.current++}),[E]),Kit(c,e,E);const R=T.useMemo(()=>f?JO(f.entries):null,[f]),N=T.useCallback(B=>{const D=new Set(r);D.has(B)?D.delete(B):D.add(B),i(D)},[r,i]),M=e&&(u!=null&&u.exists)?u:null,O=(M==null?void 0:M.branch)??(M!=null&&M.baselineBranch?mtt({branch:ze(M.baselineBranch)}):qT()),I=((Z=M==null?void 0:M.files)==null?void 0:Z.length)??0,H=M?ltt({branch:ze(`${O}${I>0?"*":""}`)}):dtt({branch:ze(n.baselineBranch)}),U=M?M.branch:n.baselineBranch,F=(B,D)=>M?a(B,e,void 0,D):a(B,void 0,n.baselineBranch,D),Y=(f==null?void 0:f.root)==="worktree",q=async(B,D)=>{try{await snt(c,B,D,{sessionId:e}),E()}catch(P){Vn(P instanceof Error?P.message:String(P),"error")}},Q=B=>{const D=(f==null?void 0:f.path)??n.repoPath;YO(D,B)};return h.jsxs("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:[h.jsx(WO,{view:M?t:"files",onViewChange:s,showViewToggle:!!M,branchLabel:H,branchTitle:H,githubHref:n.githubEnabled&&U?Bg(n.githubOwner,n.githubRepo,U):void 0,githubTitle:U?lT({branch:ze(U)}):void 0,refreshing:S,onRefresh:E}),m&&(u||f)&&h.jsxs(ma,{children:[Ott()," ",ze(m)]}),!f||e&&!u?h.jsx(Kf,{children:h.jsx(ma,{children:m?vT({error:ze(m)}):xT()})}):M&&t==="changes"?h.jsx(Kf,{className:"wt-changes px-4 pb-6 pt-0 [&_>_:first-child]:mt-3.5",children:I===0||!M.diff?h.jsx("div",{className:"changes-note text-sm text-muted",children:ztt()}):h.jsxs(h.Fragment,{children:[M.diff.truncated&&h.jsx(qO,{bytesRead:M.diff.bytesRead,byteLimit:M.diff.byteLimit}),h.jsx(VO,{diff:M.diff.diff,partial:M.diff.truncated})]})}):h.jsxs(Kf,{children:[f.truncated&&h.jsx(ma,{children:xtt()}),R?R.dirs.size===0&&R.files.length===0?h.jsx(ma,{children:Rtt()}):h.jsx("div",{className:"file-tree py-1.5 px-0 text-sm",children:h.jsx(h3,{node:R,parentPath:"",depth:0,toggled:r,onToggle:N,onOpenFile:F,renamingPath:w,onContextMenu:(B,D)=>{y(ZO(B,D))},onRename:(B,D)=>{C(null),q(B,{action:"rename",newName:D})},onCancelRename:()=>C(null)})}):h.jsx(ma,{children:ktt()})]}),v&&h.jsx(QO,{target:v,onOpen:()=>F(v.path,"keepOpen"),onRename:Y&&o(v.path)?()=>C(v.path):void 0,onDuplicate:Y?()=>void q(v.path,{action:"duplicate"}):void 0,onCopyPath:()=>Q(v.path),onDelete:Y?()=>{window.confirm(epe({path:ze(v.path)}))&&q(v.path,{action:"delete"})}:void 0,onClose:()=>y(null)})]})}function eI({text:e,path:n,highlightLine:t,scrollRequest:r,onScrollRequestHandled:s}){const i=T.useMemo(()=>{if(!e)return[];const _=e.replace(/\r\n?/g,` +`),f=SD(_,x5(n));return _.endsWith(` +`)?f.slice(0,-1):f},[e,n]),a=t&&i.length>0?Math.min(Math.max(Math.trunc(t),1),i.length):void 0,o=T.useRef(null);T.useEffect(()=>{var _;r!==void 0&&(a?((_=o.current)==null||_.scrollIntoView({block:"center"}),s==null||s()):i.length===0&&(s==null||s()))},[i.length,s,r,a]);const{ruleCh:c}=MD(i.length),u=T.useMemo(()=>i.map((_,f)=>h.jsxs("div",{ref:f+1===a?o:void 0,className:`file-view-line flex items-stretch ${f+1===a?"file-view-line-highlight bg-accent-blue-subtle shadow-file-line":""}`,children:[h.jsx("span",{"data-line":f+1,className:`${RD} before:content-[attr(data-line)] shrink-0 pe-[1ch]`,style:{width:`${c}ch`},"aria-hidden":"true"}),h.jsx("code",{className:`file-view-code flex-1 min-w-0 ps-[2ch] pe-4 ${dg} ${AD}`,children:kD(_)?h.jsx("br",{}):_})]},f)),[i,c,a]);return h.jsxs("div",{className:`file-view-codewrap relative py-3.5 ${dg}`,children:[i.length>0&&h.jsx("div",{className:"absolute start-0 top-0 bottom-0 border-e border-e-border-variant pointer-events-none",style:{width:`${c}ch`},"aria-hidden":"true"}),u]})}function tI(e){return e==="image"||e==="audio"||e==="video"||e==="pdf"?e:null}function nz({url:e,name:n}){return h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[pxe()," ",h.jsxs("a",{href:e,download:n,children:[zT()," ",ze(n)]})]})}function _w({kind:e,url:n,name:t,downloadBar:r=!0}){const[s,i]=T.useState(!1);if(T.useEffect(()=>i(!1),[e,n]),s)return h.jsx(nz,{url:n,name:t});let a;return e==="image"?a=h.jsx("div",{className:"fpreview-image flex min-h-0 flex-1 items-start justify-center overflow-auto p-6 [&_img]:max-w-full [&_img]:h-auto [&_img]:border [&_img]:border-border [&_img]:rounded-sm",children:h.jsx("img",{src:n,alt:t,onError:()=>i(!0)})}):e==="audio"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("audio",{className:"w-full max-w-160",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):e==="video"?a=h.jsx("div",{className:"flex min-h-0 flex-1 items-center justify-center p-6",children:h.jsx("video",{className:"max-h-full max-w-full rounded-sm border border-border",controls:!0,preload:"metadata",src:n,"aria-label":t,onError:()=>i(!0)})}):a=h.jsx("object",{className:"fpreview-pdf block min-h-0 flex-1 w-full border-0","aria-label":t,data:n,type:"application/pdf",onError:()=>i(!0),children:h.jsx(nz,{url:n,name:t})}),h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[a,r&&h.jsx("div",{className:"shrink-0 border-t border-border-variant py-1.5 px-3 text-end text-sm",children:h.jsxs("a",{href:n,download:t,children:[zT()," ",t]})})]})}function nI(e,n=!0){const[t,r]=T.useState(null);return T.useEffect(()=>{if(!n)return;const s=new AbortController;let i=!1;const a=async()=>{if(!(i||document.visibilityState==="hidden")){i=!0;try{const u=await fetch(e,{method:"HEAD",cache:"no-store",signal:s.signal});if(s.signal.aborted)return;u.status===404?r("missing"):u.ok&&r(u.headers.get("etag")??u.headers.get("content-length"))}catch{}finally{i=!1}}};a();const o=window.setInterval(()=>void a(),2e3);window.addEventListener("focus",a),document.addEventListener("visibilitychange",a);const c=lc(u=>{u.type==="reconnected"&&a()});return()=>{s.abort(),window.clearInterval(o),window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a),c()}},[e,n]),t}const rz="tip-up [&[data-tip]::after]:top-auto [&[data-tip]::after]:bottom-[calc(100%_+_6px)]";function Twt(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function Awt(e,n,t){const r=t.indexOf("#"),s=r===-1?t:t.slice(0,r),i=r===-1?"":t.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1),u=o.startsWith("/")?[]:n.split("/").filter(m=>m.length>0);for(const m of o.split("/"))if(!(!m||m==="."))if(m===".."){if(u.length===0)return null;u.pop()}else u.push(m);const _=u.join("/");if(!_)return null;const f=new URLSearchParams(c);f.delete("path");const p=f.toString();return{path:_,url:`${nd(e,_)}${p?`&${p}`:""}${i}`}}function Rwt(e){if(!e.startsWith("---"))return e;const n=e.indexOf(` +---`,3);return n===-1?e:e.slice(n+4).replace(/^\r?\n/,"")}const rI="orx:files-tree-width",sI="orx:artifacts-collapsed:",iI=180,aI=320,Mwt=8,Lwt=280;function Dwt(){try{const e=Number(localStorage.getItem(rI));if(Number.isFinite(e)&&e>=iI&&e<=aI)return e}catch{}return Lwt}function Owt(e){try{const n=localStorage.getItem(`${sI}${e}`);if(!n)return new Set;const t=JSON.parse(n);return Array.isArray(t)?new Set(t.filter(r=>typeof r=="string")):new Set}catch{return new Set}}function j_(e,n){for(const t of e){if(t.path===n)return t;if(t.isDir&&n.startsWith(t.path+"/")){const r=j_(t.children??[],n);if(r)return r}}return null}function oI({projectId:e,folder:n,markdown:t,entries:r}){const s=i=>{if(Twt(i))return i;const a=Awt(e,n,i);if(!a)return null;const o=j_(r,a.path);if(!o)return a.url;const c=a.url.indexOf("#"),u=c===-1?a.url:a.url.slice(0,c),_=c===-1?"":a.url.slice(c);return`${u}&v=${o.modifiedAt}:${o.size}${_}`};return h.jsx("div",{className:"md min-w-0 wrap-anywhere text-text leading-[1.62] [&_>_*:first-child]:mt-0 [&_>_*:last-child]:mb-0 [&_p]:my-2.5 [&_p]:mx-0 [&_strong]:text-text [&_strong]:font-semibold [&_pre]:bg-surface [&_pre]:border [&_pre]:border-border-muted [&_pre]:rounded-md [&_pre]:py-2 [&_pre]:px-3 [&_pre]:overflow-x-auto [&_pre]:text-sm [&_pre]:text-text [&_code]:font-mono [&_code]:text-sm [&_code]:font-medium [&_code]:text-primary [&_code]:bg-panel [&_code]:border [&_code]:border-border-variant [&_code]:rounded-xs [&_code]:py-px [&_code]:px-[5px] [&_.katex]:text-prose-emphasis [&_.katex-display]:my-3 [&_.katex-display]:mx-0 [&_.katex-display]:overflow-x-auto [&_.katex-display]:overflow-y-hidden [&_.katex-display]:py-0.5 [&_.katex-display]:px-0 [&_.file-chip]:inline-flex [&_.file-chip]:items-center [&_.file-chip]:gap-1 [&_.file-chip]:max-w-full [&_.file-chip]:my-0 [&_.file-chip]:mx-px [&_.file-chip]:py-0 [&_.file-chip]:px-1.5 [&_.file-chip]:align-baseline [&_.file-chip]:font-mono [&_.file-chip]:text-sm [&_.file-chip]:font-medium [&_.file-chip]:text-text [&_.file-chip]:bg-panel [&_.file-chip]:border [&_.file-chip]:border-border-variant [&_.file-chip]:rounded-xs [&_.file-chip]:cursor-pointer [&_.file-chip:hover:not(:disabled)]:bg-surface [&_.file-chip:hover:not(:disabled)]:text-primary [&_.file-chip_svg]:flex-none [&_.file-chip_svg]:opacity-60 [&_.file-chip-label]:max-w-65 [&_.file-chip-label]:overflow-hidden [&_.file-chip-label]:text-ellipsis [&_.file-chip-label]:whitespace-nowrap [&_.run-chip_svg]:opacity-100 [&_.run-chip_svg]:text-primary [&_pre_code]:bg-none [&_pre_code]:bg-transparent [&_pre_code]:border-0 [&_pre_code]:text-inherit [&_pre_code]:p-0 [&_pre_code]:font-normal [&_h1]:text-text [&_h1]:font-semibold [&_h2]:text-text [&_h2]:font-semibold [&_h3]:text-text [&_h3]:font-semibold [&_h4]:text-text [&_h4]:font-semibold [&_ul]:my-1.5 [&_ul]:mx-0 [&_ul]:ps-5.5 [&_ol]:my-1.5 [&_ol]:mx-0 [&_ol]:ps-5.5 [&_li::marker]:text-primary [&_a]:text-primary [&_table]:border-collapse [&_table]:text-sm [&_table]:my-2.5 [&_table]:mx-0 [&_table]:border [&_table]:border-border [&_table]:rounded-md [&_th]:border-b [&_th]:border-b-border-variant [&_th]:py-2 [&_th]:px-3.5 [&_th]:text-start [&_th]:text-text [&_th]:break-normal [&_th]:break-words [&_td]:border-b [&_td]:border-b-border-variant [&_td]:py-2 [&_td]:px-3.5 [&_td]:text-start [&_td]:text-text [&_td]:break-normal [&_td]:break-words [&_tr:last-child_td]:border-b-0 [&_thead_th]:bg-surface [&_thead_th]:font-medium [&_thead_th]:text-text [&_thead_th]:border-b [&_thead_th]:border-b-border [&_tbody_tr:hover_td]:bg-surface-bright [&_blockquote]:my-1.5 [&_blockquote]:mx-0 [&_blockquote]:pt-0.5 [&_blockquote]:pe-0 [&_blockquote]:pb-0.5 [&_blockquote]:ps-2.5 [&_blockquote]:border-s-[3px] [&_blockquote]:border-s-border [&_blockquote]:text-subtext [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:italic [:is(&,_.openresearch-diff,_.file-view)_.token.operator]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.entity]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.url]:text-syntax-cyan [:is(&,_.openresearch-diff,_.file-view)_.token.comment]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.prolog]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.cdata]:text-syntax-comment [:is(&,_.openresearch-diff,_.file-view)_.token.punctuation]:text-syntax-text [:is(&,_.openresearch-diff,_.file-view)_.token.property]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.tag]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.deleted]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.constant]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.symbol]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.boolean]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.number]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.selector]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.attr-name]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.char]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.inserted]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.string]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.builtin]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.atrule]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.attr-value]:text-syntax-orange [:is(&,_.openresearch-diff,_.file-view)_.token.keyword]:text-syntax-purple [:is(&,_.openresearch-diff,_.file-view)_.token.function]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.decorator]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.def]:text-syntax-blue [:is(&,_.openresearch-diff,_.file-view)_.token.class-name]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.namespace]:text-syntax-yellow [:is(&,_.openresearch-diff,_.file-view)_.token.regex]:text-syntax-green [:is(&,_.openresearch-diff,_.file-view)_.token.important]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.variable]:text-syntax-red [:is(&,_.openresearch-diff,_.file-view)_.token.parameter]:text-syntax-text artifact-md text-lg [&_h1]:text-4xl [&_h1]:leading-[1.18] [&_h1]:mt-7 [&_h1]:mx-0 [&_h1]:mb-3.5 [&_h2]:text-3xl [&_h2]:leading-tight [&_h2]:mt-7 [&_h2]:mx-0 [&_h2]:mb-2.5 [&_h3]:text-xl [&_h3]:leading-[1.35] [&_h3]:mt-5.5 [&_h3]:mx-0 [&_h3]:mb-2 [&_h4]:text-lg [&_h4]:leading-[1.4] [&_h4]:mt-4.5 [&_h4]:mx-0 [&_h4]:mb-1.5 [&_table]:block [&_table]:w-max [&_table]:max-w-full [&_table]:overflow-x-auto [&_.artifact-img]:block [&_.artifact-img]:my-3 [&_.artifact-img]:mx-0 [&_.artifact-img_img]:max-w-full [&_.artifact-img_img]:h-auto [&_.artifact-img_img]:border [&_.artifact-img_img]:border-border [&_.artifact-img_img]:rounded-sm [&_.artifact-img-caption]:block [&_.artifact-img-caption]:mt-1 [&_.artifact-img-caption]:text-center [&_.artifact-img-caption]:text-sm [&_.artifact-img-caption]:text-subtext",children:h.jsx(Kht,{remarkPlugins:[pD,[mD,ND]],rehypePlugins:[qL],components:{a:({href:i,children:a,...o})=>{const c=!i||i.startsWith("#"),u=c?i:s(i);return u?h.jsx("a",{...o,href:u,...c?{}:{target:"_blank",rel:"noopener noreferrer"},children:a}):h.jsx("span",{children:a})},img:({src:i,alt:a})=>{if(!i||typeof i!="string")return null;const o=s(i);return o?h.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"artifact-img",children:[h.jsx("img",{src:o,alt:a??"",loading:"lazy"}),a&&h.jsx("span",{className:"artifact-img-caption",children:a})]}):null},...zD},children:CD(Rwt(t))})})}function Iwt(e){return e.presentation==="text"&&d3(e.name)?"markdown":tI(e.presentation)??(e.presentation==="text"||e.presentation==="unknown"?"text":"download")}function Bwt(e,n,t,r){const[s,i]=T.useState(null),[a,o]=T.useState(!1),[c,u]=T.useState(!1),[_,f]=T.useState(null),p=T.useRef(0),m=T.useRef(!1),x=t==="markdown"||t==="text"&&n.size<=AA;return T.useEffect(()=>{if(o(!1),u(!1),f(null),!x)return;let S=!1;const b=++p.current;return RA(e,n.path).then(y=>{if(!y)throw new Error(cQ());return y}).then(y=>{S||b!==p.current||(y.binary?o(!0):(m.current=!0,i(y.content)),u(y.truncated))}).catch(y=>{!S&&b===p.current&&!m.current&&f(y instanceof Error?y.message:String(y))}),()=>{S=!0}},[e,n.path,n.modifiedAt,n.size,t,x,r]),{text:s,binary:a,truncated:c,error:_,wantsText:x}}function $wt({projectId:e,entry:n,onDelete:t,artifactEntries:r}){const s=Iwt(n),i=nI(nd(e,n.path)),{text:a,binary:o,truncated:c,error:u,wantsText:_}=Bwt(e,n,s,i),[f,p]=T.useState(!1),m=s==="markdown",x=n.path.split("/").slice(0,-1).join("/"),S=`${nd(e,n.path)}&v=${encodeURIComponent(i??`${n.modifiedAt}:${n.size}`)}`;let b;return s==="image"||s==="audio"||s==="video"||s==="pdf"?b=h.jsx(_w,{kind:s,url:S,name:n.name}):s==="download"||!_||o?b=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[s==="download"||o?nQ():pJ()," ",h.jsx("a",{href:S,...s==="download"||o?{download:n.name}:{target:"_blank",rel:"noopener noreferrer"},children:s==="download"||o?kT():hQ()})]}):u?b=h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[RQ()," ",ze(u)]}):a===null?b=h.jsxs(Br,{children:[h.jsx(Ot,{})," ",fT()]}):m&&!f?b=h.jsx(oI,{projectId:e,folder:x,markdown:a,entries:r}):b=h.jsx(eI,{text:a,path:n.path}),h.jsxs("div",{className:"fpreview flex-1 min-w-0 bg-background file-view flex flex-col h-full min-h-0 [@container((max-width:_720px))]:hidden",children:[h.jsxs("div",{className:"fpreview-head flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-subtext shrink-0",children:[h.jsx(_d,{name:n.name}),h.jsx("span",{className:"fpreview-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":ze(n.path),children:n.name}),h.jsxs("span",{dir:"auto",className:"fpreview-date text-xs text-muted whitespace-nowrap shrink-0",children:[ZQ()," ",new Date(n.modifiedAt).toLocaleString(j(),{dateStyle:"medium",timeStyle:"short"})]}),(s==="text"||s==="download")&&h.jsx("span",{className:"fpreview-size text-xs text-muted whitespace-nowrap shrink-0",children:Yo(n.size)}),m&&h.jsx(Yt,{size:"small",active:f,"data-tip":f?Gm():Df(),"data-tip-align":"end","aria-label":f?Gm():Df(),onClick:()=>p(v=>!v),children:h.jsx(o2,{size:13})}),h.jsx(Pg,{size:"small",href:S,target:"_blank",rel:"noopener noreferrer","data-tip":G7(),"data-tip-align":"end","aria-label":G7(),children:h.jsx(ku,{size:13})}),h.jsx(Yt,{size:"small","data-tip":q7(),"data-tip-align":"end","aria-label":q7(),onClick:()=>{window.confirm(Vw({path:ze(n.path)}))&&t(n.path)},children:h.jsx(kd,{size:13})})]}),h.jsxs("div",{className:`fpreview-body flex-1 min-h-0 overflow-auto [&.doc]:pt-4.5 [&.doc]:px-7 [&.doc]:pb-12 [&.doc_.artifact-md]:max-w-readable [&.doc_.artifact-md]:my-0 [&.doc_.artifact-md]:mx-auto ${m&&!f?"doc":""}`,children:[b,c&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:OQ()})]})]})}function lI({entries:e,depth:n,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:_,onCancelRename:f}){return h.jsx("div",{className:"flex w-full max-w-full min-w-0 flex-col items-stretch",children:e.map(p=>{var x;const m={paddingInlineStart:8+Math.min(n,Mwt)*14};if(p.isDir){const S=!t.has(p.path);return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100",style:m,onClick:()=>s(p.path),children:[h.jsx("button",{className:"file-tree-chevron text-muted shrink-0 [button&]:inline-flex [button&]:items-center [button&]:justify-center [button&]:w-[13px] [button&]:h-[13px] [button&]:p-0 [button&]:border-0 [button&]:bg-transparent [button&_>_svg]:transition-transform [button&_>_svg]:duration-120 [button&_>_svg]:ease-standard [button&_>_svg.open]:rotate-90","aria-label":S?HZ({name:ze(p.name)}):QZ({name:ze(p.name)}),onClick:b=>{b.stopPropagation(),s(p.path)},children:h.jsx(co,{size:13,className:S?"open":""})}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name}),h.jsx(Yt,{size:"small",className:"ft-row-delete opacity-35 focus-visible:opacity-100","data-tip":zQ(),"data-tip-align":"end","aria-label":KZ({name:ze(p.name)}),onClick:b=>{b.stopPropagation(),window.confirm(Vw({path:ze(p.path)}))&&o(p.path)},children:h.jsx(kd,{size:12})})]}),S&&(((x=p.children)==null?void 0:x.length)??0)>0&&h.jsx(lI,{entries:p.children??[],depth:n+1,collapsed:t,selected:r,onToggle:s,onSelect:i,onOpenFile:a,onDelete:o,renamingPath:c,onContextMenu:u,onRename:_,onCancelRename:f})]},p.path)}return c===p.path?h.jsxs("div",{className:"file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start font-[inherit] artifact-tree-row",style:m,children:[h.jsx(_d,{name:p.name}),h.jsx(XO,{name:p.name,onCommit:S=>_(p.path,S),onCancel:f})]},p.path):h.jsxs("button",{type:"button",className:`file-tree-row flex w-full min-w-0 items-center gap-1.5 py-[3px] px-2.5 border-0 bg-transparent text-text text-start cursor-pointer font-[inherit] [&:hover]:bg-panel [&_>_svg]:shrink-0 [&_>_svg]:text-subtext [&_>_svg.file-tree-chevron]:text-muted artifact-tree-row [&.selected]:bg-panel [&.selected:hover]:bg-panel [&:hover_.ft-row-delete]:opacity-100 ${r===p.path?"selected":""}`,style:m,title:ZF({path:ze(p.path)}),"aria-keyshortcuts":"Space Enter","aria-pressed":r===p.path,onClick:()=>i(p.path),onDoubleClick:()=>a(p.path),onContextMenu:S=>{S.preventDefault(),i(p.path),u(S,p.path)},onAuxClick:S=>{S.button===1&&(S.preventDefault(),i(p.path),a(p.path))},onKeyDown:S=>{if(S.key==="ContextMenu"||S.shiftKey&&S.key==="F10"){S.preventDefault(),i(p.path),u(S,p.path);return}if(S.key===" "){S.preventDefault(),S.stopPropagation(),i(p.path);return}S.key==="Enter"&&(S.preventDefault(),S.stopPropagation(),i(p.path),a(p.path))},children:[h.jsx(_d,{name:p.name}),h.jsx("span",{className:"file-tree-name flex-1 min-w-0 overflow-hidden text-ellipsis whitespace-nowrap",children:p.name})]},p.path)})})}function Pwt({dir:e,onOpenStorage:n}){const[t,r]=T.useState(!1);return h.jsxs("div",{className:"ftree-footer shrink-0 flex items-center gap-0.5 py-[5px] px-2 border-t border-t-border-variant [&_code]:flex-1 [&_code]:min-w-0 [&_code]:[direction:rtl] [&_code]:text-left [&_code]:font-mono [&_code]:text-xs [&_code]:text-muted [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:ze(e),children:[h.jsx("code",{className:"path-front-ellipsis",children:e}),h.jsx(Yt,{size:"small",className:rz,"data-tip":t?l_():uT(),"aria-label":yQ(),onClick:()=>{var s;(s=navigator.clipboard)==null||s.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:t?h.jsx(zi,{size:12}):h.jsx(qg,{size:12})}),n&&h.jsx(Yt,{size:"small",className:rz,"data-tip":V7(),"data-tip-align":"end","aria-label":V7(),onClick:n,children:h.jsx(qot,{size:12})})]})}function Hwt({project:e,artifacts:n,onChanged:t,onOpenFile:r,canRenameFile:s,onOpenStorage:i}){const[a,o]=T.useState(null),[c,u]=T.useState(()=>Owt(e.id)),[_,f]=T.useState(Dwt),[p,m]=T.useState(null),[x,S]=T.useState(null),b=T.useRef(null);T.useEffect(()=>{try{localStorage.setItem(`${sI}${e.id}`,JSON.stringify([...c]))}catch{}},[e.id,c]);const v=N=>{var U;N.preventDefault(),N.currentTarget.setPointerCapture(N.pointerId);const M=(U=b.current)==null?void 0:U.getBoundingClientRect(),O=document.body.style.userSelect;document.body.style.userSelect="none";const I=F=>{const Y=Math.round(F.clientX-((M==null?void 0:M.left)??0)),q=Math.min(Math.max(Y,iI),aI);f(q);try{localStorage.setItem(rI,String(q))}catch{}},H=()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",H),document.body.style.userSelect=O};window.addEventListener("pointermove",I),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",H)};T.useEffect(()=>{if(!a||!n)return;const N=j_(n.entries,a);(!N||N.isDir)&&o(null)},[a,n]);const y=N=>u(M=>{const O=new Set(M);return O.has(N)?O.delete(N):O.add(N),O}),w=N=>{(a===N||a!=null&&a.startsWith(N+"/"))&&o(null),Wnt(e.id,N).catch(()=>{}).finally(t)},C=async(N,M)=>{try{await Knt(e.id,N,M),M.action==="rename"&&a===N&&o(null),t()}catch(O){Vn(O instanceof Error?O.message:String(O),"error")}},z=N=>{n&&YO(n.dir,N)};if(!n)return h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs(Br,{className:"p-5",children:[h.jsx(Ot,{})," ",WQ()]})});const E=N=>h.jsx(lI,{entries:N,depth:0,collapsed:c,selected:a,onToggle:y,onSelect:o,onOpenFile:r,onDelete:w,renamingPath:x,onContextMenu:(M,O)=>{m(ZO(M,O))},onRename:(M,O)=>{S(null),C(M,{action:"rename",newName:O})},onCancelRename:()=>S(null)}),R=a?j_(n.entries,a):null;return n.entries.length===0?h.jsx("div",{className:"files-tab h-full min-h-0 flex bg-background",children:h.jsxs("div",{className:"files-empty-state flex-1 flex flex-col items-center justify-center gap-1.5 p-6 text-center text-muted [&_h3]:mt-1.5 [&_h3]:mx-0 [&_h3]:mb-0 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text [&_p]:m-0 [&_p]:max-w-105 [&_p]:text-sm [&_p]:leading-[1.55] [&_p]:text-subtext [&_.ftree-footer]:mt-2.5 [&_.ftree-footer]:max-w-full [&_.ftree-footer]:border [&_.ftree-footer]:border-border [&_.ftree-footer]:rounded-md [&_.ftree-footer]:py-1.5 [&_.ftree-footer]:px-2.5 [&_.ftree-footer]:bg-background [&_.ftree-footer_code]:max-w-95",children:[h.jsx(E4,{size:28,strokeWidth:1.5}),h.jsx("h3",{children:tJ()}),h.jsx("p",{children:fJ()}),h.jsx(Pwt,{dir:n.dir,onOpenStorage:i})]})}):h.jsxs("div",{className:"files-tab h-full min-h-0 flex bg-background @container",children:[h.jsxs("div",{className:"ftree-pane relative shrink-0 flex flex-col min-h-0 border-s border-s-border-variant border-e border-e-border-variant bg-background [@container((max-width:_720px))]:!w-full",ref:b,style:{width:_},children:[h.jsx("div",{className:"ftree-resizer absolute -end-[3px] top-0 bottom-0 w-1.5 cursor-col-resize z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover [@container((max-width:_720px))]:hidden",onPointerDown:v}),h.jsxs("div",{className:"ftree-scroll flex-1 min-h-0 overflow-y-auto file-tree py-1.5 px-0 text-sm",children:[E(n.entries),n.truncated&&h.jsx("p",{className:"files-truncated m-0 py-2 px-3.5 text-sm text-muted",children:PQ()})]})]}),R?h.jsx($wt,{projectId:e.id,entry:R,onDelete:w,artifactEntries:n.entries},R.path):h.jsxs("div",{className:"fpreview flex-1 min-w-0 flex flex-col min-h-0 bg-background fpreview-none items-center justify-center gap-2 text-sm text-muted [@container((max-width:_720px))]:hidden",children:[h.jsx(jot,{size:22,strokeWidth:1.5}),h.jsx("span",{children:gQ()})]}),p&&h.jsx(QO,{target:p,onOpen:()=>r(p.path),onRename:s(p.path)?()=>S(p.path):void 0,onDuplicate:()=>void C(p.path,{action:"duplicate"}),onCopyPath:()=>z(p.path),onDelete:()=>{window.confirm(Vw({path:ze(p.path)}))&&w(p.path)},onClose:()=>m(null)})]})}const cI=20*1024*1024,uI="bg-background border border-border rounded-lg py-4 px-4.5 mb-4 [&_h3]:mt-0 [&_h3]:mx-0 [&_h3]:mb-2.5 [&_h3]:text-base [&_h3]:font-semibold [&_h3]:text-text",fI="mt-0 mx-0 mb-3 text-sm leading-relaxed text-text",dI="flex items-start gap-3 py-2.5 border-t border-t-border first:border-t-0",Fwt="font-mono text-base font-medium text-text",Uwt="mt-1 mb-0 text-sm leading-relaxed text-text";function hI(e){return new Promise((n,t)=>{const r=new FileReader;r.onload=()=>{const s=r.result;if(typeof s!="string"){t(new Error("could not read file"));return}const i=s.indexOf(",");n(i>=0?s.slice(i+1):s)},r.onerror=()=>t(r.error??new Error("could not read file")),r.readAsDataURL(e)})}function qwt(e){const n=e.toLowerCase();return n.endsWith(".md")||n.endsWith(".markdown")||n.endsWith(".zip")}function _I({accept:e,busy:n,prompt:t,onFile:r}){const[s,i]=T.useState(!1),a=T.useRef(null);return h.jsxs("div",{className:`flex flex-col items-center justify-center gap-2 py-6.5 px-4.5 border-[1.5px] border-dashed rounded-md text-center text-sm text-text transition-[border-color,background] duration-120 ${n?"cursor-default":"cursor-pointer"} ${s?"border-primary bg-surface text-text":"border-border-variant bg-surface [&:hover]:border-primary"}`,onDragOver:o=>{o.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:o=>{var u;if(o.preventDefault(),i(!1),n)return;const c=(u=o.dataTransfer.files)==null?void 0:u[0];c&&r(c)},onClick:()=>{var o;n||(o=a.current)==null||o.click()},role:"button",tabIndex:0,"aria-disabled":n,"aria-busy":n,onKeyDown:o=>{var c;(o.key==="Enter"||o.key===" ")&&!n&&(o.preventDefault(),(c=a.current)==null||c.click())},children:[h.jsx("input",{ref:a,type:"file",accept:e,hidden:!0,onChange:o=>{var u;const c=(u=o.target.files)==null?void 0:u[0];c&&r(c),o.target.value=""}}),n?h.jsxs(h.Fragment,{children:[h.jsx(Ot,{}),h.jsx("span",{children:RYe()})]}):h.jsxs(h.Fragment,{children:[h.jsx(nlt,{size:20,strokeWidth:1.5}),h.jsx("span",{children:t})]})]})}function pI({bytes:e,updatedAt:n}){return h.jsxs("div",{className:"shrink-0 text-end whitespace-nowrap pt-0.5 text-xs text-subtext",children:[Yo(e),n>0&&h.jsxs("span",{className:"text-muted",children:[" · ",no(n)]})]})}function Gwt({skill:e,onDeleted:n,onError:t}){const[r,s]=T.useState(!1);return h.jsxs("div",{className:dI,children:[h.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[h.jsxs("code",{className:Fwt,children:["/",e.name]}),e.origin&&h.jsx(It,{children:e.origin})]}),h.jsx(pI,{bytes:e.bytes,updatedAt:e.updatedAt}),!e.origin&&h.jsx(Yt,{"data-tip":eYe(),"data-tip-align":"end","aria-label":rKe({name:ze(e.name)}),disabled:r,onClick:()=>{window.confirm(JWe({name:ze(e.name)}))&&(s(!0),_rt(e.name).then(n).catch(i=>{s(!1),t(i instanceof Error?i.message:String(i))}))},children:h.jsx(kd,{size:13})})]})}function Vwt({template:e,onChanged:n,onError:t}){const[r,s]=T.useState(!1),i=e.supportFiles.length;return h.jsxs("div",{className:dI,children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-base font-medium text-text",children:e.name}),h.jsxs("p",{className:Uwt,children:[e.entry,i>0&&(i===1?TKe():BKe({count:Xt(i)}))]})]}),h.jsx(pI,{bytes:e.bytes,updatedAt:e.updatedAt}),h.jsx(Yt,{"data-tip":sYe(),"data-tip-align":"end","aria-label":fKe({name:ze(e.name)}),disabled:r,onClick:()=>{window.confirm(oKe({name:ze(e.name)}))&&(s(!0),frt(e.name).then(n).catch(a=>{s(!1),t(a instanceof Error?a.message:String(a))}))},children:h.jsx(kd,{size:13})})]})}function Wwt(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(!1),[a,o]=T.useState(null),[c,u]=T.useState(null),_=T.useCallback(()=>{i(!0),drt().then(m=>{n(m),u(null)}).catch(m=>{n([]),u(m instanceof Error?m.message:String(m))}).finally(()=>i(!1))},[]);T.useEffect(()=>{_()},[_]);const f=T.useRef(!1),p=T.useCallback(async m=>{if(!f.current){if(o(null),!qwt(m.name)){o(PYe());return}if(m.size>cI){o(uA());return}f.current=!0,r(!0);try{await hrt({filename:m.name,contentBase64:await hI(m)}),_()}catch(x){o(x instanceof Error?x.message:String(x))}finally{f.current=!1,r(!1)}}},[_]);return h.jsxs("section",{className:uI,children:[h.jsxs("div",{className:"flex items-baseline gap-2.5",children:[h.jsx("h3",{children:zYe()}),h.jsxs($e,{className:"ms-auto",size:"small",onClick:_,disabled:s,children:[h.jsx(Ca,{size:12,className:s?"animate-[spin_0.9s_linear_infinite]":""})," ",Y_()]})]}),h.jsx("p",{className:fI,children:pKe()}),h.jsx(_I,{accept:".md,.markdown,.zip",busy:t,prompt:vKe(),onFile:m=>void p(m)}),a&&h.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:a}),e===null?h.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[h.jsx(Ot,{})," ",dYe()]}):c?h.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[FKe()," ",c]}):e.length===0?h.jsx("div",{className:"pt-3 text-sm text-subtext",children:xYe()}):h.jsx("div",{className:"flex flex-col mt-1",children:e.map(m=>h.jsx(Gwt,{skill:m,onDeleted:_,onError:o},m.name))})]})}function Kwt(){const[e,n]=T.useState(null),[t,r]=T.useState(!1),[s,i]=T.useState(null),[a,o]=T.useState(null),c=T.useCallback(()=>{crt().then(f=>{n(f),o(null)}).catch(f=>{n([]),o(f instanceof Error?f.message:String(f))})},[]);T.useEffect(()=>{c()},[c]);const u=T.useRef(!1),_=T.useCallback(async f=>{if(u.current)return;i(null);const p=f.name.toLowerCase();if(!p.endsWith(".tex")&&!p.endsWith(".zip")){i(qYe());return}if(f.size>cI){i(uA());return}u.current=!0,r(!0);try{await urt({filename:f.name,contentBase64:await hI(f)}),c()}catch(m){i(m instanceof Error?m.message:String(m))}finally{u.current=!1,r(!1)}},[c]);return h.jsxs("section",{className:uI,children:[h.jsx("h3",{children:lYe()}),h.jsx("p",{className:fI,children:OYe()}),h.jsx(_I,{accept:".tex,.zip",busy:t,prompt:SKe(),onFile:f=>void _(f)}),s&&h.jsx("div",{role:"alert",className:"mt-2.5 text-base text-accent-red whitespace-pre-wrap",children:s}),e===null?h.jsxs("div",{className:"flex items-center gap-2 pt-3 text-sm text-subtext",children:[h.jsx(Ot,{})," ",mYe()]}):a?h.jsxs("div",{role:"alert",className:"pt-3 text-base text-accent-red",children:[VKe()," ",a]}):e.length===0?h.jsx("div",{className:"pt-3 text-sm text-subtext",children:kYe()}):h.jsx("div",{className:"flex flex-col mt-1",children:e.map(f=>h.jsx(Vwt,{template:f,onChanged:c,onError:i},f.name))})]})}function Ywt(){return h.jsxs("div",{className:"settings-view max-w-readable my-0 mx-auto pt-6 px-8 pb-15 [&_h1]:mt-0 [&_h1]:mx-0 [&_h1]:mb-1.5 [&_h1]:text-3xl",children:[h.jsx("h1",{children:XKe()}),h.jsx("p",{className:"mt-0 mx-0 mb-5 text-base leading-relaxed text-text",children:LKe()}),h.jsx(Wwt,{}),h.jsx(Kwt,{})]})}const Xwt="italic [&_.tab-label_>_span]:pe-1 [&_.tab-label::after]:pe-1";function Xl({active:e,label:n,icon:t,shimmer:r=!1,preview:s=!1,onSelect:i,onPromote:a,onClose:o}){return h.jsxs("button",{className:`tab [&.closable]:max-w-60 [&.closable]:pe-0.5 [&_.tab-label]:grid [&_.tab-label]:grid-cols-[minmax(0,_1fr)] [&_.tab-label]:min-w-0 [&_.tab-label]:overflow-hidden [&_.tab-label_>_span]:[grid-area:1_/_1] [&_.tab-label_>_span]:overflow-hidden [&_.tab-label_>_span]:text-ellipsis [&_.tab-label_>_span]:whitespace-nowrap [&_.tab-label::after]:[grid-area:1_/_1] [&_.tab-label::after]:overflow-hidden [&_.tab-label::after]:text-ellipsis [&_.tab-label::after]:whitespace-nowrap [&_.tab-label::after]:content-[attr(data-label)] [&_.tab-label::after]:invisible [&_.tab-label::after]:font-medium [&_.tab-close]:inline-flex [&_.tab-close]:items-center [&_.tab-close]:justify-center [&_.tab-close]:w-3.5 [&_.tab-close]:h-3.5 [&_.tab-close]:rounded-xs [&_.tab-close]:text-muted [&_.tab-close]:shrink-0 [&_.tab-close:hover]:bg-hover-strong [&_.tab-close:hover]:text-text relative inline-flex items-center gap-[5px] h-8 py-0 px-2 border border-transparent border-b-0 rounded-[var(--radius-md)_var(--radius-md)_0_0] text-sm font-normal text-subtext whitespace-nowrap select-none min-w-24 [&:hover]:bg-surface [&:hover]:text-text [&:not(.active)_+_.tab:not(.active)::before]:content-[''] [&:not(.active)_+_.tab:not(.active)::before]:absolute [&:not(.active)_+_.tab:not(.active)::before]:top-2.5 [&:not(.active)_+_.tab:not(.active)::before]:bottom-2.5 [&:not(.active)_+_.tab:not(.active)::before]:-start-px [&:not(.active)_+_.tab:not(.active)::before]:w-px [&:not(.active)_+_.tab:not(.active)::before]:bg-border [&.active]:border-border [&.active]:bg-background [&.active]:text-text [&.active]:font-medium [&.active::after]:content-[''] [&.active::after]:absolute [&.active::after]:end-0 [&.active::after]:-bottom-px [&.active::after]:start-0 [&.active::after]:h-px [&.active::after]:bg-background closable ${e?"active":""} ${s?Xwt:""}`,onClick:i,onDoubleClick:a,title:s?iQe({label:n}):n,"aria-label":s?tQe({label:n}):n,children:[t,h.jsx("span",{className:"tab-label","data-label":n,children:h.jsx("span",{className:r?"tool-running-shimmer":"",children:n})}),h.jsx("span",{role:"button",className:"tab-close",title:Zce(),onPointerDown:c=>c.preventDefault(),onClick:c=>{c.stopPropagation(),o()},children:h.jsx(Dr,{size:12})})]})}const sz=["files-pill inline-flex items-center gap-2 min-w-0 border border-border","rounded-md py-[7px] px-[11px] bg-background text-text","no-underline [&_code]:font-mono [&_code]:text-sm","[&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap","[&_>_svg]:shrink-0 [&_>_svg]:text-muted [a&:hover]:border-muted"].join(" ");function Zwt({owner:e,repo:n,branch:t}){return!e||!n?h.jsx("span",{className:sz,children:h.jsx("code",{children:t})}):h.jsxs("a",{className:sz,href:Bg(e,n,t),target:"_blank",rel:"noopener noreferrer",title:Um({name:ze(t)}),children:[h.jsx("code",{children:t}),h.jsx(Kg,{size:12})]})}const my=["experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant","[&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm","[&_h2]:font-semibold"].join(" "),iz=["experiment-overview-command block mt-[13px] text-text text-sm","wrap-anywhere"].join(" ");function az(e){return new Date(e).toLocaleString(j(),{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"})}function oz(e,n){return Xm((e.endedAt??n)-e.createdAt)}function Qwt({experiment:e,parentExperiment:n,project:t,runs:r,onOpenLogs:s,onOpenCode:i}){const a=r[0]??null,o=r.some(_=>_.status==="running"||_.status==="starting"),[c,u]=T.useState(()=>Date.now());return T.useEffect(()=>{if(!o)return;u(Date.now());const _=window.setInterval(()=>u(Date.now()),1e3);return()=>window.clearInterval(_)},[o]),h.jsx("div",{className:"experiment-overview absolute inset-0 overflow-y-auto bg-background [&_h1]:m-0 [&_h1]:text-text [&_h1]:text-xl [&_h1]:leading-tight",children:h.jsxs("div",{className:"experiment-overview-inner w-full max-w-230 my-0 mx-auto pt-6.5 px-7 pb-10 [@media((max-width:_720px))]:pt-5 [@media((max-width:_720px))]:px-4.5 [@media((max-width:_720px))]:pb-8",children:[h.jsxs("header",{className:"experiment-overview-head flex items-start justify-between gap-6",children:[h.jsxs("div",{className:"experiment-overview-heading min-w-0",children:[h.jsx("h1",{children:e.title||e.slug}),h.jsx("div",{className:"experiment-overview-slug mt-[5px] text-muted text-sm",children:e.slug})]}),h.jsx(tl,{status:a?ea(a):"idle"})]}),h.jsxs("div",{className:"experiment-overview-actions flex gap-[7px] mt-4.5 [@media((max-width:_720px))]:flex-wrap",children:[a&&h.jsxs($e,{...Nr(_=>s(a.id,_)),children:[h.jsx(sd,{size:15}),O_e()]}),h.jsxs($e,{...Nr(i),children:[h.jsx(Vg,{size:15}),l_e()]})]}),e.description&&h.jsxs("section",{className:"experiment-overview-section mt-5.5 pt-4.5 border-t border-t-border-variant [&_h2]:mt-0 [&_h2]:mx-0 [&_h2]:mb-3.5 [&_h2]:text-text [&_h2]:text-sm [&_h2]:font-semibold overview-description [&_.md]:text-text [&_.md]:leading-[1.65]",children:[h.jsx("h2",{children:x_e()}),h.jsx(ro,{text:e.description})]}),h.jsxs("section",{className:my,children:[h.jsx("h2",{children:a?s_e():Q_e()}),a&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap gap-y-2.5 gap-x-4.5 text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs",children:[h.jsx(tl,{status:ea(a)}),h.jsx(R4,{backend:a.backend}),h.jsxs("span",{title:K_e(),children:[h.jsx(yat,{size:13}),az(a.createdAt)]}),h.jsxs("span",{title:k_e(),children:[h.jsx(Lat,{size:13}),oz(a,c)]}),a.commitSha&&h.jsxs("span",{title:d_e(),children:[h.jsx(lot,{size:14}),h.jsx("code",{children:a.commitSha.slice(0,7)})]}),a.exitCode!==null&&a.exitCode!==void 0&&a.exitCode!==0&&h.jsxs("span",{children:[z_e()," ",a.exitCode]})]}),a.command&&h.jsxs("code",{className:iz,children:["$ ",a.command]}),a.resultMarkdown&&h.jsx("div",{className:`experiment-overview-result mt-4 [&.failed]:text-accent-red ${a.status==="failed"?"failed":""}`,children:h.jsx(ro,{text:a.resultMarkdown})})]})]}),h.jsxs("section",{className:my,children:[h.jsx("h2",{children:"Git"}),h.jsxs("div",{className:"experiment-overview-meta flex items-center flex-wrap text-text text-sm [&_svg]:text-muted [&_.backend-badge]:text-text [&_.status-badge]:text-text [&_>_span]:inline-flex [&_>_span]:items-center [&_>_span]:gap-[5px] [&_code]:text-text [&_code]:text-xs experiment-overview-git-meta gap-y-[9px] gap-x-3.5 [&_.files-pill]:py-[5px] [&_.files-pill]:px-2 [&_.files-pill]:rounded-sm [&_.files-pill_code]:text-xs",children:[h.jsx(Zwt,{owner:t.githubEnabled?t.githubOwner:"",repo:t.githubEnabled?t.githubRepo:"",branch:e.branchName}),n&&h.jsxs("span",{children:[R_e()," ",h.jsx("code",{children:n.slug})]}),h.jsxs("span",{title:az(e.createdAt),children:[m_e()," ",no(e.createdAt)]})]}),e.runCommand!==(a==null?void 0:a.command)&&h.jsxs("code",{className:iz,children:["$ ",e.runCommand]})]}),r.length>0&&h.jsxs("section",{className:my,children:[h.jsx("h2",{children:q_e()}),h.jsx("div",{className:"experiment-run-history border-t border-t-border-variant [&_button]:w-full [&_button]:grid [&_button]:grid-cols-[minmax(72px,_0.7fr)_minmax(100px,_1fr)_minmax(70px,_0.7fr)_60px_16px] [&_button]:items-center [&_button]:gap-3.5 [&_button]:py-[11px] [&_button]:px-0.5 [&_button]:border-b [&_button]:border-b-border-variant [&_button]:text-text [&_button]:text-start [&_button]:text-sm [&_button:hover]:bg-surface [@media((max-width:_720px))]:[&_button]:grid-cols-[65px_1fr_60px_16px] [@media((max-width:_720px))]:[&_button_>_:nth-child(3)]:hidden",children:r.map((_,f)=>h.jsxs("button",{...Nr(p=>s(_.id,p)),children:[h.jsxs("span",{className:"experiment-run-number text-xs font-medium",children:[P_e()," ",r.length-f]}),h.jsx(tl,{status:ea(_)}),h.jsx("span",{children:no(_.createdAt)}),h.jsx("span",{children:oz(_,c)}),h.jsx(sd,{size:13})]},_.id))})]})]})})}function lz(e){const n=atob(e),t=new Uint8Array(n.length);for(let r=0;r{const t=n.current;if(!t)return;const{terminal:r,dispose:s}=h4(t,!0);let i=!1,a=0,o=!1,c=!1;async function u(){if(o){c=!0;return}o=!0;try{for(;;){const f=await Qtt(e,a);if(i)return;if(f.dataBase64&&r.write(lz(f.dataBase64)),a=f.nextOffset,f.eof)break}}catch{}finally{o=!1,c&&!i&&(c=!1,u())}}const _=Vit(e,f=>{if(i)return;const p=lz(f.dataBase64);!o&&f.offset===a?(r.write(p),a+=p.length):f.offset+p.length>a&&u()});return u(),()=>{i=!0,_(),s()}},[e]),h.jsx("div",{ref:n,className:"h-full w-full"})}function e4t({experiment:e,project:n,view:t,runs:r,selectedRunId:s,onSelectRun:i,parentExperiment:a,onOpenView:o,onOpenCode:c}){const u=r.filter(_=>_.experimentId===e.id).sort((_,f)=>f.createdAt-_.createdAt);return t==="overview"?h.jsx(Qwt,{experiment:e,parentExperiment:a,project:n,runs:u,onOpenLogs:(_,f)=>o("terminal",_,f),onOpenCode:_=>c("files",_)}):h.jsx(t4t,{experiment:e,expRuns:u,selectedRunId:s,onSelectRun:i})}function t4t({experiment:e,expRuns:n,selectedRunId:t,onSelectRun:r}){const[s,i]=T.useState(null),[a,o]=T.useState(null),[c,u]=T.useState(!1),_=T.useRef(null),f=t?n.find(b=>b.id===t)??null:n[0]??null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",m=!!(f&&p&&(f.cancelRequested||a===f.id)),x=b=>{const v=n.findIndex(y=>y.id===b);return v===-1?n.length:n.length-v};T.useEffect(()=>{if(!c)return;const b=v=>{var y;(y=_.current)!=null&&y.contains(v.target)||u(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[c]);async function S(){if(f){i(null),o(f.id);try{await wA(f.id)}catch(b){o(null),i(b instanceof Error?b.message:String(b))}}}return h.jsxs("div",{className:"term-view absolute inset-0 flex flex-col bg-background z-20",children:[h.jsxs("div",{className:"term-bar flex items-center gap-2 h-10 py-0 px-2.5 border-b border-b-border shrink-0 [&_.error]:text-sm [&_.error]:text-accent-red [&_.btn]:inline-flex [&_.btn]:items-center [&_.btn]:gap-[5px]",children:[h.jsx("div",{className:"term-title min-w-0 text-sm font-semibold text-text overflow-hidden text-ellipsis whitespace-nowrap",title:e.title||e.slug,children:e.title||e.slug}),h.jsx("span",{className:"flex-1"}),s&&h.jsx("span",{className:"error",role:"alert",children:s}),p&&h.jsxs($e,{size:"small",variant:"ghost",disabled:m,onClick:()=>void S(),children:[h.jsx(kR,{size:13}),m?zue():wT()]}),n.length>0&&f&&h.jsxs("div",{className:"run-history relative shrink-0",ref:_,children:[h.jsxs($e,{title:whe(),"aria-expanded":c,onClick:()=>u(b=>!b),children:[h.jsxs("span",{children:[y8()," ",x(f.id)]}),h.jsx(tl,{status:m?"cancelling":ea(f)}),h.jsx(lo,{size:14,className:"run-picker-chev text-muted shrink-0"})]}),c&&h.jsx("div",{className:"history-menu absolute top-[calc(100%_+_6px)] end-0 min-w-57.5 max-h-80 overflow-y-auto bg-background border border-border rounded-lg shadow-menu p-[5px] z-50",children:n.map(b=>h.jsxs(Er,{className:"justify-start",active:b.id===(f==null?void 0:f.id),onClick:()=>{r(b.id),u(!1)},children:[h.jsxs("span",{className:"font-medium",children:[y8()," ",x(b.id)]}),h.jsx(tl,{status:ea(b)}),h.jsx("span",{className:"ms-auto text-xs text-muted",children:no(b.createdAt)})]},b.id))})]})]}),h.jsx("div",{className:"term-fill flex-1 min-h-0 bg-terminal pt-1 pe-0 pb-1 ps-1.5",children:f?h.jsx(Jwt,{runId:f.id},f.id):h.jsx("div",{className:"term-empty h-full flex items-center justify-center p-6 text-center text-sm text-muted",children:t?rc():phe()})})]})}let pw=!1;function cz(e){pw=!0;try{return window.confirm(e)}finally{pw=!1}}const mw=e=>e.replace(/\r\n/g,` +`),uz=(e,n,t)=>{const r=mw(n);return{path:e,draft:r,baseline:r,version:t,crlf:n.includes(`\r +`),conflict:null}},qo=e=>e.draft!==e.baseline,n4t=(e,n)=>({...e,draft:n,conflict:n===e.baseline?null:e.conflict}),r4t=e=>e.crlf?e.draft.replace(/\n/g,`\r +`):e.draft;function s4t(e,n,t){return!qo(e)||t&&n===e.version?null:{currentVersion:n,exists:t}}class i4t{constructor(){Es(this,"buffer",null);Es(this,"listeners",new Set);Es(this,"saving",!1);Es(this,"saveError",null);Es(this,"revision",0);Es(this,"saveRevision",0);Es(this,"getSnapshot",()=>this.buffer);Es(this,"getRevision",()=>this.revision);Es(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));Es(this,"set",n=>{this.buffer=n,this.notify()});Es(this,"setSaving",n=>{this.saving=n,n&&this.saveRevision++,this.notify()});Es(this,"saved",(n,t)=>{this.buffer&&this.set({...this.buffer,baseline:n,version:t,conflict:null})});Es(this,"setSaveError",n=>{this.saveError=n,this.notify()})}notify(){this.revision++;for(const n of this.listeners)n()}get needsProtection(){return this.saving||this.buffer!==null&&(qo(this.buffer)||this.buffer.conflict!==null)}}function a4t({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,ready:a,source:o}){const[c,u]=T.useState(void 0),[_,f]=T.useState(null),[p,m]=T.useState(null),[x,S]=T.useState(!1),[b,v]=T.useState(null),[y,w]=T.useState(null),[C,z]=T.useState(!1),[E,R]=T.useState(null),[N,M]=T.useState(null),[O,I]=T.useState(!1),[H,U]=T.useState(0),F=T.useCallback(B=>{I(B),B&&U(D=>D+1)},[]),Y=T.useRef(o);Y.current=o,T.useEffect(()=>{if(!r)return;let B=!1;return ant().then(D=>{B||(u(D.engine),f(D.hint),m(D.installCommand))}).catch(()=>{B||u(null)}),()=>{B=!0}},[r]);const q=T.useRef(!1),Q=T.useRef(null),Z=T.useCallback(()=>{if(q.current)return;Q.current=n,q.current=!0,S(!0);const B=Y.current;M(null),w(null),R(null),ont(e,n,{sessionId:t}).then(D=>{var X,W;const P=D.pdfPath;if(D.ok&&P){v(ie=>({path:P,version:((ie==null?void 0:ie.version)??0)+1,source:B})),z(D.hadErrors),R(D.note),D.hadErrors&&w(((X=D.log)==null?void 0:X.trim())||null),F(!0);return}v(null),z(!1),R(D.note),I(!1),w(((W=D.log)==null?void 0:W.trim())||Zve())}).catch(D=>{v(null),z(!1),R(null),I(!1),M(D instanceof Error?D.message:String(D))}).finally(()=>{q.current=!1,S(!1)})},[e,n,t,F]);return T.useEffect(()=>{!r||!s||!a||!c||Q.current!==n&&Z()},[r,s,a,c,n,Z]),{engine:c,installHint:_,installCommand:p,compiling:x,compiled:b,stale:b!==null&&b.source!==o,log:y,builtWithErrors:C,note:E,error:N,showPdf:O,setShowPdf:F,viewNonce:H,compile:()=>{i==null||i(),Z()},dismiss:()=>{M(null),w(null)}}}const o4t=3e4;function l4t({projectId:e,filePath:n,sessionId:t,enabled:r,autoRun:s=!0,onManualAction:i,savedSource:a,dirty:o,onPulled:c}){const[u,_]=T.useState(!1),[f,p]=T.useState(null),[m,x]=T.useState(!1),[S,b]=T.useState(!1),[v,y]=T.useState(null),[w,C]=T.useState(null),[z,E]=T.useState(!1),R=T.useCallback(F=>{_(F.hasToken),p(F.link)},[]);T.useEffect(()=>{let F=!1;if(x(!1),p(null),y(null),C(null),E(!1),I.current=!1,!!r)return unt(e,n,{sessionId:t}).then(Y=>{F||R(Y)}).catch(Y=>{F||C(Y instanceof Error?Y.message:String(Y))}).finally(()=>{F||x(!0)}),()=>{F=!0}},[r,e,n,t,R]),T.useEffect(()=>{E(!1)},[a]);const N=T.useRef(!1),M=T.useRef(c);M.current=c;const O=T.useRef(o);O.current=o;const I=T.useRef(!1),H=T.useCallback(F=>!u||!f||N.current||O.current?!1:(N.current=!0,b(!0),C(null),hnt(e,n,{sessionId:t,resolve:F}).then(Y=>{I.current=!1,y(Y),Y.pulled.includes(n)&&(O.current?E(!0):M.current(Y.pulled))}).catch(Y=>{I.current=!0,y(null),C(Y instanceof Error?Y.message:String(Y))}).finally(()=>{N.current=!1,b(!1)}),!0),[e,n,t,u,f]),U=T.useRef(null);return T.useEffect(()=>{if(!r||!s||!m||!u||!f||o)return;const F=`${n}:${f.projectId}:${a}`;U.current!==F&&H()&&(U.current=F)},[r,s,m,u,f,n,a,o,S,H]),T.useEffect(()=>{if(!r||!s||!m||!u||!f||o)return;const F=setInterval(()=>{N.current||I.current||_nt(e,n,{sessionId:t}).then(Y=>{Y.remoteChanged&&H()}).catch(Y=>{I.current=!0,C(Y instanceof Error?Y.message:String(Y))})},o4t);return()=>clearInterval(F)},[r,s,m,u,f,o,e,n,t,H]),{hasToken:u,link:f,loaded:m,syncing:S,last:v,error:w,blocked:o,staleOnDisk:z,reloaded:()=>E(!1),uploadUrl:pnt(e,n,{sessionId:t}),saveToken:async F=>{const Y=await SA(F);U.current=null,I.current=!1,C(null),_(Y.hasToken)},linkProject:async F=>{R(await fnt(e,n,{project:F,sessionId:t})),i==null||i()},unlink:async()=>{R(await dnt(e,n,{sessionId:t})),U.current=null,I.current=!1,y(null),C(null)},sync:F=>{I.current=!1,H(F)&&(U.current=`${n}:${f==null?void 0:f.projectId}:${a}`,i==null||i())}}}function mI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function fz(e,n,t=!1){const r=n.indexOf("#"),s=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r),a=s.indexOf("?"),o=a===-1?s:s.slice(0,a),c=a===-1?"":s.slice(a+1);let u;try{u=decodeURI(o)}catch{return null}if(!u||u.includes("\0"))return null;const _=u.startsWith("/"),f=_?[]:e.split("/").filter(Boolean);for(const p of u.split("/"))if(!(!p||p===".")){if(p===".."){if(f.length===0)return null;f.pop();continue}f.push(p)}return f.length===0?null:{path:`${t&&(_||e.startsWith("/"))?"/":""}${f.join("/")}`,query:c,hash:i}}function c4t(e,n){return`${e}${n.query?`&${n.query}`:""}${n.hash}`}const dz=[{selector:"img[src]",attribute:"src",typePrefixes:["image/"]},{selector:"source[src]",attribute:"src",typePrefixes:["image/","audio/","video/"]},{selector:"video[poster]",attribute:"poster",typePrefixes:["image/"]},{selector:"video[src]",attribute:"src",typePrefixes:["video/"]},{selector:"audio[src]",attribute:"src",typePrefixes:["audio/"]},{selector:'link[rel~="stylesheet"][href]',attribute:"href",typePrefixes:["text/css"]},{selector:"script[src]",attribute:"src",typePrefixes:["text/javascript"]}],u4t=4e6,f4t=200,hz=16e6,d4t=e=>new Promise(n=>{const t=new FileReader;t.onload=()=>n(typeof t.result=="string"?t.result:null),t.onerror=()=>n(null),t.readAsDataURL(e)}),_z=e=>e.startsWith("//")?`https:${e}`:e;async function h4t(e,n){var s;let t=u4t;const r=new Map;for(const{element:i,attribute:a,url:o,typePrefixes:c}of e){if(r.has(o)){const x=r.get(o);x&&i.setAttribute(a,x);continue}if(n.aborted)return;if(r.size>=f4t)continue;r.set(o,null);const u=await fetch(o,{signal:n}).catch(()=>null);if(!(u!=null&&u.ok))continue;const _=u.headers.get("content-type")??"",f=Number(u.headers.get("content-length"));if(!c.some(x=>_.startsWith(x))||!(Number.isFinite(f)&&f>0&&f<=t)){await((s=u.body)==null?void 0:s.cancel().catch(()=>{}));continue}const p=await u.blob().catch(()=>null),m=p&&await d4t(p);!p||!m||(t-=p.size,r.set(o,m),i.setAttribute(a,m))}}async function _4t(e,n,t){var a;const r=new DOMParser().parseFromString(e,"text/html"),s=[];for(const o of r.querySelectorAll(dz.map(c=>c.selector).join(", ")))for(const{selector:c,attribute:u,typePrefixes:_}of dz){if(!o.matches(c))continue;const f=o.getAttribute(u);if(!f)continue;const p=n(f);p&&(p===f?o.setAttribute(u,_z(f)):s.push({element:o,attribute:u,url:p,typePrefixes:_}))}await h4t(s,t);for(const o of r.querySelectorAll("a[href]")){const c=o.getAttribute("href");!c||!mI(c)||(o.setAttribute("href",_z(c)),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"))}const i=((a=r.querySelector("base[href]"))==null?void 0:a.getAttribute("href"))??"";if(!/^https?:\/\//i.test(i)){const o=r.createElement("base");o.setAttribute("href","about:srcdoc"),r.head.prepend(o)}return`${r.doctype?``:""}${r.documentElement.outerHTML}`}async function p4t(e,n,t,r){var o;if(!n)return{text:e,partial:!1};const s=await fetch(t,{signal:r,headers:{Range:`bytes=0-${hz-1}`}}).catch(()=>null),i=s!=null&&s.ok?await s.text().catch(()=>null):null;if(i===null)return{text:e,partial:!0};const a=Number((o=s==null?void 0:s.headers.get("content-range"))==null?void 0:o.split("/").pop());return{text:i,partial:Number.isFinite(a)&&a>hz}}function m4t({html:e,truncated:n,url:t,name:r,resolveSrc:s}){const[i,a]=T.useState(null);return T.useEffect(()=>{let o=!1;const c=new AbortController;return a(null),p4t(e,n,t,c.signal).then(async({text:u,partial:_})=>({source:await _4t(u,s,c.signal),partial:_})).then(u=>{o||a(u)}),()=>{o=!0,c.abort()}},[e,n,t,s]),i===null?h.jsxs("div",{className:"file-view-note flex items-center gap-2 py-2.5 px-4 text-sm text-muted",children:[h.jsx(Ot,{})," ",CT()]}):h.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[i.partial&&h.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-muted",children:Rme()}),h.jsx("iframe",{className:"block min-h-0 flex-1 w-full border-0 bg-white",title:Ome({name:ze(r)}),sandbox:"allow-scripts allow-popups allow-downloads",referrerPolicy:"no-referrer",srcDoc:i.source})]})}function g4t({overleaf:e}){var f;const n=T.useRef(null),{open:t,setOpen:r,ref:s}=Ea(n),i=T.useId(),[a,o]=T.useState({top:0,left:0,maxHeight:0}),c=((f=e.last)==null?void 0:f.conflicts.length)??0,u=e.hasToken&&!!e.error,_=u?Py():c?GSe():!e.hasToken||!e.link?N7e():e.syncing?DT():e.blocked?LT():RT();return T.useEffect(()=>{c&&r(!0)},[c,r]),T.useEffect(()=>{u&&Vn(Py(),"error",{id:i,duration:5e3})},[u,e.error,i]),T.useLayoutEffect(()=>{if(!t||!n.current||!s.current)return;const p=n.current.getBoundingClientRect(),m=Math.min(384,window.innerWidth-16),x=Math.min(p.bottom+6,window.innerHeight-80);o({top:x,left:Math.max(8,Math.min(p.right-m,window.innerWidth-m-8)),maxHeight:window.innerHeight-x-8}),(s.current.querySelector("input")??s.current).focus();const S=()=>r(!1),b=v=>{var y;v.target instanceof Node&&!((y=s.current)!=null&&y.contains(v.target))&&S()};return window.addEventListener("resize",S),window.addEventListener("scroll",b,!0),()=>{window.removeEventListener("resize",S),window.removeEventListener("scroll",b,!0)}},[t,s,r]),h.jsxs(h.Fragment,{children:[h.jsx(Yt,{ref:n,size:"small",active:t,disabled:!e.loaded,"data-tip":_,"data-tip-align":"end","aria-label":Eq({status:_}),"aria-haspopup":"dialog","aria-expanded":t,"aria-controls":t?i:void 0,onClick:()=>r(!t),children:e.syncing?h.jsx(Ot,{}):h.jsx(Bat,{size:13,className:u||c?"text-accent-red":e.hasToken&&e.link?"text-accent-green":void 0})}),t&&al.createPortal(h.jsxs("div",{ref:s,id:i,role:"dialog","aria-label":eA(),tabIndex:-1,className:"fixed z-100 w-96 max-w-[calc(100vw-1rem)] overflow-auto rounded-lg border border-border bg-background p-4 text-text shadow-popover",style:a,onBlur:p=>{var m;p.relatedTarget instanceof Node&&!p.currentTarget.contains(p.relatedTarget)&&!((m=n.current)!=null&&m.contains(p.relatedTarget))&&r(!1)},children:[h.jsx("div",{className:"absolute end-3 top-3",children:h.jsx(Yt,{size:"small","aria-label":_me(),onClick:()=>{var p;r(!1),(p=n.current)==null||p.focus()},children:h.jsx(Dr,{size:13})})}),h.jsx(x4t,{overleaf:e})]}),document.body)]})}const Zp=e=>Ja(new Intl.ListFormat(j()).format(e.map(ze)));function b4t(e){if(e.error)return ike();if(e.syncing)return DT();if(e.blocked)return LT();const n=e.last;return n?n.pulled.length&&n.pushed.length?l7e({pulled:Zp(n.pulled),pushed:Zp(n.pushed)}):n.pulled.length?s7e({paths:Zp(n.pulled)}):n.pushed.length?d7e({paths:Zp(n.pushed)}):n.conflicts.length?mke():RT():e7e()}function v4t({href:e}){return h.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:e,target:"_blank",rel:"noreferrer",children:MT()})}function x4t({overleaf:e}){var p,m;const[n,t]=T.useState(""),[r,s]=T.useState(!1),[i,a]=T.useState(null),[o,c]=T.useState(!1),u=()=>{t(""),a(null),c(!0)},_=!e.hasToken||o;async function f(x){x.preventDefault();const S=n.trim();if(!(r||!S)){s(!0),a(null);try{_?(await e.saveToken(S),c(!1)):await e.linkProject(S),t("")}catch(b){a(b instanceof Error?b.message:String(b))}finally{s(!1)}}}if(e.link&&!_){const x=((p=e.last)==null?void 0:p.conflicts)??[];return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsxs("div",{className:"space-y-1.5 pe-8",role:e.error?"alert":"status",children:[h.jsxs("div",{className:`flex items-center gap-2 text-sm font-medium ${e.error?"text-accent-red":"text-text"}`,children:[e.syncing&&h.jsx(Ot,{}),e.error?Py():b4t(e)]}),e.error&&h.jsx("p",{className:"text-sm text-text whitespace-pre-wrap break-words",children:e.error})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx($e,{variant:e.error?"primary":"default",disabled:e.syncing||e.blocked,"data-tip":e.blocked?m7e():void 0,onClick:()=>e.sync(),children:e.error?Ji():$ke()}),h.jsxs(c_,{variant:"ghost",href:e.link.url,target:"_blank",rel:"noreferrer",children:[Rke()," ",h.jsx(ku,{size:12})]})]}),x.map(S=>h.jsxs("div",{className:"space-y-2 text-sm",children:[h.jsxs("p",{className:"break-words text-accent-red",children:[h.jsx("code",{className:"font-mono",children:S})," ",kke()]}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.jsx($e,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[S]:"keep-local"}),children:zke()}),h.jsx($e,{disabled:e.syncing||e.blocked,onClick:()=>e.sync({[S]:"take-overleaf"}),children:Xke()})]})]},S)),((m=e.last)==null?void 0:m.note)&&h.jsx("div",{className:"text-sm text-accent-amber",children:e.last.note}),i&&h.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i}),h.jsxs("details",{className:"border-t border-border pt-3",children:[h.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-text focus-visible:outline-2 focus-visible:outline-text",children:h.jsx("span",{className:"ms-2",children:t4()})}),h.jsxs("div",{className:"mt-2 flex flex-col items-start gap-1",children:[h.jsx($e,{variant:"ghost",className:"font-normal",type:"button",onClick:u,children:K8()}),h.jsx(c_,{variant:"ghost",className:"font-normal",href:e.uploadUrl,target:"_blank",rel:"noreferrer",children:MT()}),h.jsx($e,{variant:"ghost",className:"font-normal",disabled:e.syncing,onClick:()=>void e.unlink().catch(S=>{a(S instanceof Error?S.message:String(S))}),children:Uke()})]})]})]})}return h.jsxs("form",{className:"flex flex-col gap-1.5",onSubmit:f,children:[h.jsx("div",{className:"pe-8 text-sm text-subtext",children:_?I7e():H7e()}),h.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[h.jsx(Ts,{className:"basis-full min-w-0","aria-label":_?V8():W8(),"aria-invalid":!!i,type:_?"password":"text",value:n,onChange:x=>t(x.target.value),placeholder:_?V8():"https://www.overleaf.com/project/…",autoComplete:"off"}),h.jsx($e,{type:"submit",disabled:r||!n.trim(),children:r?_?na():Sa():_?S7e():cke()}),h.jsx("a",{className:"text-sm text-subtext whitespace-nowrap",href:_?"https://www.overleaf.com/user/settings":"https://www.overleaf.com/project",target:"_blank",rel:"noreferrer",children:_?YSe():W8()})]}),(i||e.error)&&h.jsx("div",{role:"alert",className:"text-sm text-accent-red whitespace-pre-wrap break-words",children:i||e.error}),h.jsxs("div",{className:"flex items-center flex-wrap gap-3",children:[h.jsx(v4t,{href:e.uploadUrl}),o?h.jsx($e,{variant:"ghost",type:"button",onClick:()=>c(!1),children:xke()}):e.hasToken&&h.jsx($e,{variant:"ghost",type:"button",onClick:u,children:K8()})]})]})}function y4t({command:e}){const[n,t]=T.useState("idle"),r=T.useRef(null),s=async()=>{try{await navigator.clipboard.writeText(e),t("copied"),setTimeout(()=>t("idle"),1500)}catch{const i=r.current;if(i){const a=document.createRange();a.selectNodeContents(i);const o=window.getSelection();o==null||o.removeAllRanges(),o==null||o.addRange(a)}t("select"),setTimeout(()=>t("idle"),4e3)}};return h.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[h.jsx("code",{ref:r,className:"font-mono text-xs text-text bg-panel border border-border-variant rounded-xs py-1 px-2",children:e}),h.jsx(Yt,{"data-tip":n==="copied"?l_():n==="select"?Vge():Fpe(),"aria-label":Vpe(),onClick:()=>void s(),children:n==="copied"?h.jsx(zi,{size:13}):h.jsx(qg,{size:13})})]})}function w4t({projectId:e,path:n,source:t="repo",sessionId:r,gitRef:s,line:i,branchLabel:a,onOpenFile:o,scrollPosition:c,onScrollPositionChange:u,lineScrollRequest:_,onLineScrollRequestHandled:f,onEdit:p,artifactVersion:m,artifactEntries:x=[],bufferSession:S,remote:b=!1,restored:v=!1,onRestoreActivated:y,showSource:w=!1,onShowSourceChange:C}){var on;const[z,E]=T.useState(null),[R,N]=T.useState(null),[M,O]=T.useState(0),I=t==="artifacts",H=t==="abs",U=d3(n),F=KO(n),Y=Ewt(n),q=U||Y,[Q,Z]=T.useState(!1),B=!v||Q,D=()=>{Z(!0),y==null||y()};T.useSyncExternalStore(S.subscribe,S.getRevision);const P=S.getSnapshot(),X=S.set,W=S.saving,ie=S.setSaving,le=S.saveRevision,ae=S.saveError,se=S.setSaveError,G=T.useRef(0),oe=T.useRef(null),ce=T.useRef(c),pe=(z==null?void 0:z.file)??null,ue=P&&qo(P)?P.path:(z==null?void 0:z.source)==="checkout"?z.file.path:n,Ee=ue.split("/").slice(0,-1).join("/"),Te=(z==null?void 0:z.source)==="artifact",Ie=T.useCallback(Qe=>{var bt;return((bt=fz(Ee,Qe,H))==null?void 0:bt.path)??null},[H,Ee]),Le=T.useCallback(Qe=>H?nnt(Qe):Te?nd(e,Qe):mC(e,Qe,{sessionId:r,ref:s}),[Te,s,H,e,r]),He=T.useCallback(Qe=>{if(mI(Qe))return Qe;const bt=fz(Ee,Qe,H);return bt?c4t(Le(bt.path),bt):null},[H,Ee,Le]),Tt=tI(pe==null?void 0:pe.presentation),Et=(z==null?void 0:z.source)==="artifact"&&!I,Vt=I&&(z==null?void 0:z.source)==="checkout",$t=!s&&(z==null?void 0:z.source)==="checkout"&&pe!=null&&!pe.notFound,rt=r!=null&&(z==null?void 0:z.source)==="checkout"&&z.file.root==="clone",nt=$t&&pe!=null&&!pe.binary&&!pe.truncated&&!Tt&&!rt,ut=nt&&pe.version===void 0,pt=P!==null&&qo(P),ve=!ut&&(nt&&typeof pe.version=="string"||pt),Oe=(P==null?void 0:P.draft)??mw((pe==null?void 0:pe.content)??""),Je=(P==null?void 0:P.baseline)??mw((pe==null?void 0:pe.content)??""),ft=ve&&P!==null&&qo(P),mt=async Qe=>{const bt=S.getSnapshot();if(!ve||!bt||!qo(bt))return!0;if(S.saving)return!1;if(bt.conflict&&Qe===void 0)return se(bt.conflict.exists?w8():k8()),!1;const ln=bt.draft,Sr=r4t(bt);ie(!0),se(null);try{const yn=await rnt(e,ue,Sr,{sessionId:r,expectedVersion:Qe??bt.version});return S.getSnapshot()?(G.current++,S.saved(ln,yn.version),E(Ct=>Ct&&Ct.source==="checkout"?{source:"checkout",file:{...Ct.file,content:Sr,version:yn.version}}:Ct),!0):!1}catch(yn){if(yn instanceof Uy){const dt=S.getSnapshot();return!dt||!qo(dt)||X({...dt,conflict:{currentVersion:yn.currentVersion,exists:yn.exists}}),!1}return se(yn instanceof Error?yn.message:String(yn)),!1}finally{ie(!1)}},Ht=F&&$t&&!rt,Fe=a4t({projectId:e,filePath:ue,sessionId:r,enabled:Ht,autoRun:B,onManualAction:D,ready:pe!=null&&!pe.notFound,source:ve?Oe:(pe==null?void 0:pe.content)??""}),Pt=l4t({projectId:e,filePath:ue,sessionId:r,enabled:Ht,autoRun:B,onManualAction:D,savedSource:Je,dirty:ft,onPulled:T.useCallback(Qe=>{Qe.includes(ue)&&O(bt=>bt+1)},[ue])}),Jt=F&&Fe.showPdf&&Fe.compiled!=null,nn=ut&&pt,Lt=(ve||nn)&&!(q&&!w)&&!Jt,Rn=Fe.compiled?`${mC(e,Fe.compiled.path,{sessionId:r})}&v=${Fe.compiled.version}`:null,Kt=Rn?`${Rn}&view=${Fe.viewNonce}#toolbar=0&navpanes=0&statusbar=0`:null,Gn=Fe.compiled?Fe.compiled.path.split("/").pop()??Fe.compiled.path:null,cr=async()=>{ft&&!await mt()||F&&Fe.engine&&Fe.compile()},vn=async()=>{ft&&(B?await cr():await mt())},[wr,Qn]=T.useState(!1),[Wn,Mn]=T.useState(null),gt=async()=>{Qn(!0),Mn(null);try{await int(e,ue,{sessionId:r})}catch(Qe){Mn(Qe instanceof Error?Qe.message:String(Qe))}finally{Qn(!1)}},an=T.useCallback(()=>{S.saving||O(Qe=>Qe+1)},[S]),Ge=()=>{X(null),se(null),an()},at=nI(Le(ue),!s&&!W);T.useEffect(()=>{if(!R||s)return;const Qe=window.setInterval(()=>{document.visibilityState!=="hidden"&&an()},2e3);return()=>window.clearInterval(Qe)},[R,s,an]);const rn=`${Le(ue)}&v=${encodeURIComponent(at??m??"")}&reload=${M}`;T.useEffect(()=>{let Qe=!1;const bt=++G.current;if(W)return;const ln=async()=>{const dt=await Znt(e,n),Ct=(dt==null?void 0:dt.presentation)==="text"||(dt==null?void 0:dt.presentation)==="unknown",_n=dt&&Ct?await RA(e,n):null,hr=dt===null||Ct&&_n===null;return{path:n,content:(_n==null?void 0:_n.content)??"",truncated:(_n==null?void 0:_n.truncated)??!1,binary:(_n==null?void 0:_n.binary)??(dt==null?void 0:dt.presentation)==="download",notFound:hr,presentation:_n?_n.binary?"download":"text":(dt==null?void 0:dt.presentation)??"download"}},Sr=async()=>{for(const dt of[`artifacts/${n}`,n]){const Ct=await pC(e,dt,{sessionId:r}).catch(()=>null);if(Ct&&!Ct.notFound)return Ct}return null};return(H?tnt(n).then(dt=>({source:"absolute",file:dt})):I?ln().then(async dt=>{if(!dt.notFound)return{source:"artifact",file:dt};const Ct=await Sr();return Ct?{source:"checkout",file:Ct}:{source:"artifact",file:dt}}):pC(e,n,{sessionId:r,ref:s}).then(dt=>dt.notFound&&!s?ln().then(Ct=>Ct.notFound?{source:"checkout",file:dt}:{source:"artifact",file:Ct,checkoutRoot:dt.root}):{source:"checkout",file:dt})).then(dt=>{var _n,hr;if(Qe||bt!==G.current||S.saving||le!==S.saveRevision)return;const Ct=S.getSnapshot();if(Ct&&qo(Ct)){const ls=dt.source==="checkout"?dt.file:null,Hr=ls!==null&&ls.path===Ct.path&&(!r||ls.root==="worktree"),Ms=s4t(Ct,Hr&&typeof ls.version=="string"?ls.version:null,Hr&&!ls.notFound);Ms&&(Ms.currentVersion!==((_n=Ct.conflict)==null?void 0:_n.currentVersion)||Ms.exists!==((hr=Ct.conflict)==null?void 0:hr.exists))?X({...Ct,conflict:Ms}):!Ms&&Ct.conflict&&X({...Ct,conflict:null})}(!Ct||!qo(Ct))&&dt.source==="checkout"&&!dt.file.notFound&&!dt.file.binary&&!dt.file.truncated&&typeof dt.file.version=="string"&&(X(uz(dt.file.path,dt.file.content,dt.file.version)),se(null)),E(dt),N(null)}).catch(dt=>{!Qe&&bt===G.current&&N(dt.message)}),()=>{Qe=!0}},[e,n,t,r,s,M,m,at,W,le]),T.useLayoutEffect(()=>{const Qe=oe.current,bt=ce.current;!Qe||!pe||!bt||(Qe.scrollTop=bt.top,Qe.scrollLeft=bt.left)},[pe]);const Nt=Qe=>{if(Qe.source==="absolute")return tge();if(I)return Wme({root:r?Sp():wp()});if(s)return Zme({branch:ze(s)});if(r&&Qe.source==="checkout"&&Qe.file.root==="clone")return y1e();const bt=Qe.source==="checkout"?Qe.file.root:Qe.checkoutRoot;return ige({root:bt==="worktree"?Sp():wp()})};return h.jsxs("div",{className:"file-view flex flex-col h-full min-h-0 min-w-0",children:[h.jsxs("div",{className:"file-view-header flex w-full min-w-0 min-h-9 items-center gap-1 px-4 py-1 bg-background text-text shrink-0",children:[h.jsx(_d,{name:ue}),h.jsx("span",{className:"file-view-path flex-1 min-w-0 truncate text-sm text-subtext","data-tip":ze(ue),children:ue.split("/").pop()||ue}),a&&h.jsxs("span",{className:"file-view-branch inline-flex items-center gap-1 min-w-0 text-xs text-muted border border-border-variant rounded-sm py-px px-1.5 max-w-65 overflow-hidden text-ellipsis whitespace-nowrap shrink-0 [&_svg]:flex-none",title:tU({branch:ze(a)}),children:[h.jsx(Wg,{size:11}),a]}),Lt&&(W||ft||ae)&&h.jsx("span",{className:`file-view-save-status inline-flex items-center gap-1 text-sm shrink-0 ${ae?"text-accent-red":"text-muted"}`,title:ae??(W?na():h1e()),children:W?h.jsxs(h.Fragment,{children:[h.jsx(Ot,{})," ",Fge()]}):ae?Bge():ET()}),F&&Fe.compiled&&h.jsx(Yt,{size:"small",active:!Fe.showPdf,"data-tip":Fe.stale&&Fe.showPdf?kge():Fe.showPdf?Df():j8(),"data-tip-align":"end","aria-label":Fe.showPdf?Df():j8(),onClick:()=>Fe.setShowPdf(!Fe.showPdf),children:Fe.showPdf?h.jsx(o2,{size:13}):h.jsx(Gg,{size:13,className:Fe.stale?"text-accent-amber":void 0})}),F&&Rn&&Gn&&h.jsx(Pg,{size:"small","data-tip":Fe.stale?yme({name:ze(Gn)}):O7({name:ze(Gn)}),"data-tip-align":"end","aria-label":O7({name:ze(Gn)}),href:Rn,download:Gn,children:h.jsx(Gat,{size:13,className:Fe.stale?"text-accent-amber":void 0})}),Ht&&h.jsx(g4t,{overleaf:Pt}),F&&$t&&h.jsx(Yt,{size:"small","data-tip":Fe.compiled?z8():S8(),"data-tip-align":"end","aria-label":Fe.compiled?z8():S8(),disabled:Fe.compiling||!Fe.engine,onClick:()=>void cr(),children:Fe.compiling?h.jsx(Ot,{}):h.jsx(Xat,{size:13})}),q&&h.jsx(Yt,{size:"small",active:w,"data-tip":w?Gm():Df(),"data-tip-align":"end","aria-label":w?Gm():Df(),onClick:()=>C==null?void 0:C(!w),children:h.jsx(o2,{size:13})}),$t&&!b&&h.jsx(Yt,{size:"small","data-tip":Wn??N8(),"data-tip-align":"end","aria-label":N8(),disabled:wr,onClick:()=>void gt(),children:wr?h.jsx(Ot,{}):h.jsx(ku,{size:13})})]}),!R&&Vt&&(z==null?void 0:z.source)==="checkout"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted border-b border-b-border-variant shrink-0",children:cge({root:z.file.root==="worktree"?Sp():wp()})}),ut&&h.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-amber",children:g1e()}),R&&pe!==null&&h.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-accent-red",children:[E8()," ",ze(R)]}),(P==null?void 0:P.conflict)&&h.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[h.jsx("span",{className:"flex-1 min-w-0",role:"status",children:P.conflict.exists?w8():k8()}),((on=P==null?void 0:P.conflict)==null?void 0:on.exists)&&P.conflict.currentVersion&&h.jsx($e,{disabled:W,onPointerDown:Qe=>Qe.preventDefault(),onClick:()=>{var Qe;return void mt(((Qe=P.conflict)==null?void 0:Qe.currentVersion)??void 0)},children:xge()}),h.jsx($e,{disabled:W,onPointerDown:Qe=>Qe.preventDefault(),onClick:Ge,children:Lge()})]}),(Fe.error||Fe.log)&&h.jsxs("div",{className:"file-view-note shrink-0 max-h-45 overflow-auto border-b border-b-border-variant py-2.5 px-4",children:[h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx("span",{className:`flex-1 min-w-0 text-sm ${Fe.builtWithErrors?"text-subtext":"text-accent-red"}`,children:Fe.error??(Fe.builtWithErrors?Bpe():Ape())}),h.jsx(Yt,{"data-tip":ame(),"data-tip-align":"end","aria-label":ume(),onClick:Fe.dismiss,children:h.jsx(Dr,{size:13})})]}),Fe.log&&h.jsx("pre",{className:"mt-1.5 mb-0 font-mono text-xs text-subtext whitespace-pre-wrap wrap-anywhere",children:Fe.log})]}),Ht&&Pt.staleOnDisk&&h.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 flex items-center flex-wrap gap-2 text-sm text-accent-amber",children:[h.jsx("span",{className:"flex-1 min-w-0",children:mge()}),h.jsx($e,{onClick:()=>{Pt.reloaded(),O(Qe=>Qe+1)},children:Jpe()})]}),F&&$t&&Fe.engine===null&&Fe.installHint&&h.jsxs("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2.5 px-4 text-sm text-subtext",children:[Fe.installHint,Fe.installCommand&&h.jsx(y4t,{command:Fe.installCommand})]}),Fe.note&&h.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-accent-amber",children:Fe.note}),Jt&&Fe.stale&&h.jsx("div",{className:"file-view-note shrink-0 border-b border-b-border-variant py-2 px-4 text-sm text-subtext",children:n1e()}),h.jsxs("div",{ref:oe,className:"file-view-body flex-1 min-h-0 overflow-auto bg-background",onScroll:Qe=>{const bt={top:Math.max(0,Qe.currentTarget.scrollTop),left:Math.max(0,Qe.currentTarget.scrollLeft)};ce.current=bt,u==null||u(bt)},children:[!Lt&&!R&&!I&&(z==null?void 0:z.source)==="checkout"&&!z.file.notFound&&!s&&r&&z.file.root==="clone"&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:a1e()}),!Lt&&!R&&(z==null?void 0:z.source)==="artifact"&&!z.file.notFound&&Et&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:xpe({root:z.checkoutRoot==="worktree"?Sp():wp()})}),R&&pe===null?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[E8()," ",ze(R)]}):pe===null?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:CT()}):Lt?h.jsx(LD,{value:Oe,onChange:Qe=>{const bt=S.getSnapshot()??(pe&&typeof pe.version=="string"?uz(pe.path,pe.content,pe.version):null);bt&&X(n4t(bt,Qe)),p==null||p(),ae&&se(null)},onSave:()=>void vn(),onBlur:()=>{pw||vn()},readOnly:nn,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:f,scrollPosition:ce.current,onScrollPositionChange:Qe=>{ce.current=Qe,u==null||u(Qe)}}):pe.notFound?h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:z?Nt(z):Ume()}):Tt?h.jsx(_w,{kind:Tt,url:rn,name:n.split("/").pop()??n}):pe.binary?h.jsxs("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:[kpe()," ",h.jsx("a",{href:rn,download:n.split("/").pop()??n,children:kT()})]}):Jt&&Kt&&Gn?h.jsx(_w,{kind:"pdf",url:Kt,name:Gn,downloadBar:!1},Kt):U&&!w?h.jsx("div",{className:"file-view-md max-w-readable pt-4.5 px-5 pb-8 [&_.md]:text-base [&_.md_h1]:text-2xl [&_.md_h1]:mt-4.5 [&_.md_h1]:mx-0 [&_.md_h1]:mb-2 [&_.md_h2]:text-xl [&_.md_h2]:mt-4 [&_.md_h2]:mx-0 [&_.md_h2]:mb-2 [&_.md_h3]:text-lg",children:Te?h.jsx(oI,{projectId:e,folder:Ee,markdown:pe.content,entries:x}):h.jsx(ro,{text:pe.content,resolveFilePath:Ie,resolveImageSrc:He,onOpenFile:o&&((Qe,bt,ln,Sr,yn)=>o(Qe,r,s,yn))})}):Y&&!w?h.jsx(m4t,{html:pe.content,truncated:pe.truncated,url:rn,name:ue,resolveSrc:He}):h.jsxs(h.Fragment,{children:[h.jsx(eI,{text:pe.content,path:n,highlightLine:i,scrollRequest:_,onScrollRequestHandled:f}),pe.truncated&&h.jsx("div",{className:"file-view-note py-2.5 px-4 text-sm text-muted",children:zme()})]})]})]})}const gy=["project-menu-label inline-flex items-center gap-2 min-w-0 overflow-hidden","text-ellipsis whitespace-nowrap"].join(" ");function S4t({projectName:e,onHome:n,onNewProject:t,onRepository:r,onCollapse:s}){const{open:i,setOpen:a,ref:o}=Ea(),c=T.useRef(null);return T.useEffect(()=>{if(!i)return;const u=_=>{var f;_.key==="Escape"&&((f=c.current)==null||f.focus())};return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[i]),h.jsxs("div",{className:"rail-brand flex items-center gap-1 h-16 p-2 border-b border-b-border shrink-0 [&_.project-switcher]:relative [&_.project-switcher]:flex-1 [&_.project-switcher]:self-stretch [&_.project-switcher]:min-w-0 [&_.project-back]:shrink-0 [&_.brand]:flex [&_.brand]:items-center [&_.brand]:justify-between [&_.brand]:gap-2 [&_.brand]:w-full [&_.brand]:h-full [&_.brand]:min-w-0 [&_.brand]:font-semibold [&_.brand]:text-base [&_.brand]:text-text [&_.brand]:py-1 [&_.brand]:px-1.5 [&_.brand]:border [&_.brand]:border-transparent [&_.brand]:rounded-sm [&_.brand:hover]:bg-surface [&_.brand:hover]:border-border [&_.brand.open]:bg-surface [&_.brand.open]:border-border [&_.brand_svg]:shrink-0 [&_.brand-project-copy]:flex [&_.brand-project-copy]:flex-col [&_.brand-project-copy]:gap-[3px] [&_.brand-project-copy]:min-w-0 [&_.brand-project-copy]:leading-[1.15] [&_.brand-project-copy]:text-start [&_.brand-project-label]:text-muted [&_.brand-project-label]:text-xs [&_.brand-project-label]:font-medium [&_.brand-project-label]:tracking-[0.04em] [&_.brand-project-label]:uppercase [&_.brand_.brand-project]:min-w-0 [&_.brand_.brand-project]:overflow-hidden [&_.brand_.brand-project]:text-ellipsis [&_.brand_.brand-project]:whitespace-nowrap [&_.brand_.brand-project]:text-xl [&_.project-chevron]:text-muted [&_.project-chevron]:opacity-0 [&_.project-chevron]:transition-transform [&_.project-chevron]:duration-120 [&_.project-chevron]:ease-standard [&_.brand:hover_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:opacity-100 [&_.brand.open_.project-chevron]:rotate-180 [&_.project-menu]:start-0 [&_.project-menu]:w-52.5 [&_.project-menu]:z-70",children:[h.jsx(Yt,{className:"project-back text-text","aria-label":T8(),onClick:n,children:h.jsx(d_,{size:18})}),h.jsxs("div",{className:"project-switcher",ref:o,children:[h.jsxs("button",{ref:c,className:`brand${i?" open":""}`,onClick:()=>a(u=>!u),"aria-expanded":i,children:[h.jsxs("span",{className:"brand-project-copy",children:[h.jsx("span",{className:"brand-project-label",children:Hbe()}),h.jsx("span",{className:"brand-project",children:e})]}),h.jsx(lo,{className:"project-chevron",size:14})]}),i&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down project-menu",children:[h.jsx(Er,{onClick:()=>{a(!1),r()},children:h.jsxs("span",{className:gy,children:[h.jsx(zR,{size:14}),Tbe()]})}),h.jsx(Er,{onClick:()=>{a(!1),n()},children:h.jsxs("span",{className:gy,children:[h.jsx(dot,{size:14}),T8()]})}),h.jsx(Er,{onClick:()=>{var u;(u=c.current)==null||u.focus(),a(!1),t()},children:h.jsxs("span",{className:gy,children:[h.jsx(not,{size:14}),Lbe()]})})]})]}),s&&h.jsx(Yt,{"data-tip":A8(),"data-tip-align":"end","aria-label":A8(),onClick:s,children:h.jsx(TR,{size:15})})]})}function k4t({runs:e,experiments:n,emptyHint:t,onOpen:r,onOpenLogs:s,onOpenCode:i,onCancel:a}){const[o,c]=T.useState(new Set),[u,_]=T.useState(null),f=new Map;for(const x of e){const S=f.get(x.experimentId);S?S.push(x):f.set(x.experimentId,[x])}for(const x of f.values())x.sort((S,b)=>b.createdAt-S.createdAt);const p=[...n].sort((x,S)=>{var y,w,C,z;const b=((w=(y=f.get(x.id))==null?void 0:y[0])==null?void 0:w.createdAt)??x.createdAt;return(((z=(C=f.get(S.id))==null?void 0:C[0])==null?void 0:z.createdAt)??S.createdAt)-b});if(p.length===0)return h.jsx("div",{className:"empty-state absolute inset-0 flex flex-col items-center justify-center gap-2.5 p-6 text-center text-subtext [&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:leading-normal [&_p]:text-balance [&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext experiments-empty-state [&_p]:text-2xl",children:h.jsx("p",{children:t??a0e()})});async function m(x){_(null),c(S=>new Set(S).add(x));try{await a(x)}catch(S){c(b=>{const v=new Set(b);return v.delete(x),v}),_(S instanceof Error?S.message:String(S))}}return h.jsxs("div",{className:"experiments-table-wrap absolute inset-0 overflow-auto bg-background @container",children:[u&&h.jsxs("div",{className:"experiments-table-error py-2 px-3 text-accent-red text-sm border-b border-b-border",role:"alert",children:[V0e()," ",u]}),h.jsx("div",{className:"experiments-table w-full text-sm bg-background",role:"list","aria-label":B0e(),children:p.map(x=>{const S=f.get(x.id)??[],b=S[0]??null,v=S.find(z=>z.status==="running"||z.status==="starting"),y=v??b,w=!!(v&&(v.cancelRequested||o.has(v.id))),C=v?w?"cancelling":ea(v):b?ea(b):"idle";return h.jsxs("div",{className:"experiment-table-group grid grid-cols-[minmax(0,_1fr)_auto] [grid-template-areas:'name_meta'_'actions_actions'] gap-x-8 items-center py-4 px-5 gap-y-[7px] border-b border-b-divider-subtle bg-background cursor-pointer [&:hover]:bg-canvas [&:last-child]:border-b-0 [@container((max-width:_560px))]:grid-cols-[minmax(0,_1fr)_auto] [@container((max-width:_560px))]:gap-x-3.5 [@container((max-width:_560px))]:gap-y-[9px] [@container((max-width:_400px))]:grid-cols-[minmax(0,_1fr)] [@container((max-width:_400px))]:[grid-template-areas:'name'_'meta'_'actions']",role:"listitem",onClick:()=>r(x,"preview"),onDoubleClick:()=>r(x,"keepOpen"),onAuxClick:z=>{z.button===1&&(z.preventDefault(),r(x,"keepOpen"))},children:[h.jsxs("div",{className:"experiment-table-name [grid-area:name] self-start min-w-0",children:[h.jsx("button",{type:"button",className:"experiment-table-title block w-full overflow-hidden text-text font-semibold text-start text-ellipsis whitespace-nowrap",...Nr(z=>r(x,z),{stopPropagation:!0}),children:x.title||x.slug}),h.jsxs("span",{className:"experiment-table-subtitle flex items-center min-w-0 gap-1.5 mt-1 overflow-hidden text-subtext text-sm [&_>_svg]:shrink-0 [&_code]:min-w-0 [&_code]:overflow-hidden [&_code]:text-ellipsis [&_code]:whitespace-nowrap",title:x.branchName,children:[h.jsx(Wg,{size:14,"aria-hidden":"true"}),h.jsx("code",{children:x.branchName})]})]}),h.jsxs("div",{className:"experiment-table-meta [grid-area:meta] self-start flex items-center justify-end gap-4.5 whitespace-nowrap [@container((max-width:_560px))]:flex-col [@container((max-width:_560px))]:items-end [@container((max-width:_560px))]:gap-1.5 [@container((max-width:_400px))]:!flex-row [@container((max-width:_400px))]:!items-center [@container((max-width:_400px))]:flex-wrap [@container((max-width:_400px))]:justify-start [@container((max-width:_400px))]:gap-3",children:[h.jsx("div",{className:"experiment-table-status flex items-center min-w-0",children:h.jsx(tl,{status:C})}),h.jsx("div",{className:"experiment-run-summary flex items-center min-w-0 gap-2 text-subtext text-sm font-medium",children:h.jsx("span",{children:S.length===1?_0e():w0e({count:Xt(S.length)})})}),h.jsx("div",{className:"experiment-table-latest flex items-center gap-1.5 min-w-0 text-subtext text-sm font-medium whitespace-nowrap",children:h.jsx("span",{children:b?no(b.createdAt):u0e()})})]}),h.jsxs("div",{className:"experiment-table-actions [grid-area:actions] flex flex-wrap items-center justify-start gap-2 mt-3",role:"group","aria-label":WF({name:x.title||x.slug}),onClick:z=>z.stopPropagation(),onDoubleClick:z=>z.stopPropagation(),onAuxClick:z=>z.stopPropagation(),children:[h.jsxs($e,{size:"small",disabled:!y,title:y?b0e():n0e(),...Nr(z=>{y&&s(x.id,y.id,z)},{stopPropagation:!0}),children:[h.jsx(sd,{size:15}),F0e()]}),h.jsxs($e,{size:"small",title:oT({branch:ze(x.branchName)}),...Nr(z=>i(x.id,z),{stopPropagation:!0}),children:[h.jsx(Vg,{size:15}),L0e()]}),v&&h.jsxs($e,{size:"small",variant:"danger",className:"[@container((max-width:_560px))]:ms-auto",disabled:w,title:w?E0e():T0e(),onClick:()=>void m(v.id),children:[h.jsx(kR,{size:15}),w?hfe():wT()]})]})]},x.id)})})]})}function C4t({onClose:e,onCreateProject:n}){const[t,r]=T.useState(!1),[s,i]=T.useState(null),a=T.useRef(null),o=T.useCallback(c=>{t||(r(!0),i(null),c().catch(()=>i(IQe())).finally(()=>r(!1)))},[t]);return T.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),u.stopPropagation(),o(e))};return document.addEventListener("keydown",c,!0),()=>document.removeEventListener("keydown",c,!0)},[e,o]),T.useEffect(()=>{const c=a.current;if(!c)return;const u=document.activeElement instanceof HTMLElement?document.activeElement:null,_=()=>[...c.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')];(_()[0]??c).focus();const f=p=>{if(p.key!=="Tab")return;const m=_();if(m.length===0){p.preventDefault(),c.focus();return}const x=m[0],S=m[m.length-1];p.shiftKey&&document.activeElement===x?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),x.focus())};return document.addEventListener("keydown",f,!0),()=>{document.removeEventListener("keydown",f,!0),u==null||u.focus()}},[]),al.createPortal(h.jsx("div",{className:"fixed inset-0 z-200 flex items-center justify-center bg-modal-backdrop p-5",children:h.jsxs("div",{ref:a,className:"relative w-110 max-w-full rounded-xl border border-border bg-background p-6 shadow-modal",role:"dialog","aria-modal":"true","aria-labelledby":"demo-welcome-title",tabIndex:-1,children:[h.jsx(Yt,{className:"absolute end-3.5 top-3.5","aria-label":hQe(),onClick:()=>o(e),disabled:t,children:h.jsx(Dr,{size:16})}),h.jsxs("div",{className:"mb-5 flex items-center gap-3 pe-8",children:[h.jsx("span",{className:"block h-9 w-9 shrink-0 [&_svg]:block [&_svg]:h-full [&_svg]:w-full",children:h.jsx(A4,{})}),h.jsxs("div",{children:[h.jsx("div",{className:"mb-0.5 text-xs font-medium tracking-[0.08em] text-primary uppercase",children:yQe()}),h.jsx("h2",{id:"demo-welcome-title",className:"m-0 text-2xl leading-tight tracking-[-0.02em]",children:GQe()})]})]}),h.jsxs("div",{className:"text-base leading-relaxed text-text [&_p]:m-0 [&_p_+_p]:mt-3",children:[h.jsxs("p",{dir:"auto",children:[HQe()," ",h.jsx("a",{dir:"ltr",href:"https://github.com/karpathy/nanochat",target:"_blank",rel:"noreferrer",className:"font-medium text-primary underline decoration-border-strong underline-offset-3 hover:decoration-primary",children:MQe()}),cQe()]}),h.jsx("p",{dir:"auto",children:jQe()})]}),s&&h.jsx("p",{className:"mt-3 mb-0 text-sm text-accent-red",children:s}),h.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-end gap-2.5",children:[h.jsx($e,{onClick:()=>o(n),disabled:t,children:gQe()}),h.jsx($e,{variant:"primary",onClick:()=>o(e),disabled:t,children:t?na():CQe()})]})]})}),document.body)}function Pr(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let t=0,r;t{}};function D1(){for(var e=0,n=arguments.length,t={},r;e=0&&(r=t.slice(s+1),t=t.slice(0,s)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}zm.prototype=D1.prototype={constructor:zm,on:function(e,n){var t=this._,r=N4t(e+"",t),s,i=-1,a=r.length;if(arguments.length<2){for(;++i0)for(var t=new Array(s),r=0,s,i;r=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),mz.hasOwnProperty(n)?{space:mz[n],local:e}:e}function j4t(e){return function(){var n=this.ownerDocument,t=this.namespaceURI;return t===gw&&n.documentElement.namespaceURI===gw?n.createElement(e):n.createElementNS(t,e)}}function T4t(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gI(e){var n=O1(e);return(n.local?T4t:j4t)(n)}function A4t(){}function _3(e){return e==null?A4t:function(){return this.querySelector(e)}}function R4t(e){typeof e!="function"&&(e=_3(e));for(var n=this._groups,t=n.length,r=new Array(t),s=0;s=w&&(w=y+1);!(z=b[w])&&++w=0;)(a=r[s])&&(i&&a.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(a,i),i=a);return this}function r5t(e){e||(e=s5t);function n(f,p){return f&&p?e(f.__data__,p.__data__):!f-!p}for(var t=this._groups,r=t.length,s=new Array(r),i=0;in?1:e>=n?0:NaN}function i5t(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function a5t(){return Array.from(this)}function o5t(){for(var e=this._groups,n=0,t=e.length;n1?this.each((n==null?b5t:typeof n=="function"?x5t:v5t)(e,n,t??"")):pd(this.node(),e)}function pd(e,n){return e.style.getPropertyValue(n)||wI(e).getComputedStyle(e,null).getPropertyValue(n)}function w5t(e){return function(){delete this[e]}}function S5t(e,n){return function(){this[e]=n}}function k5t(e,n){return function(){var t=n.apply(this,arguments);t==null?delete this[e]:this[e]=t}}function C5t(e,n){return arguments.length>1?this.each((n==null?w5t:typeof n=="function"?k5t:S5t)(e,n)):this.node()[e]}function SI(e){return e.trim().split(/^|\s+/)}function p3(e){return e.classList||new kI(e)}function kI(e){this._node=e,this._names=SI(e.getAttribute("class")||"")}kI.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function CI(e,n){for(var t=p3(e),r=-1,s=n.length;++r=0&&(t=n.slice(r+1),n=n.slice(0,r)),{type:n,name:t}})}function J5t(e){return function(){var n=this.__on;if(n){for(var t=0,r=-1,s=n.length,i;t()=>e;function bw(e,{sourceEvent:n,subject:t,target:r,identifier:s,active:i,x:a,y:o,dx:c,dy:u,dispatch:_}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:_}})}bw.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function c3t(e){return!e.ctrlKey&&!e.button}function u3t(){return this.parentNode}function f3t(e,n){return n??{x:e.x,y:e.y}}function d3t(){return navigator.maxTouchPoints||"ontouchstart"in this}function AI(){var e=c3t,n=u3t,t=f3t,r=d3t,s={},i=D1("start","drag","end"),a=0,o,c,u,_,f=0;function p(C){C.on("mousedown.drag",m).filter(r).on("touchstart.drag",b).on("touchmove.drag",v,l3t).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(C,z){if(!(_||!e.call(this,C,z))){var E=w(this,n.call(this,C,z),C,z,"mouse");E&&(Ci(C.view).on("mousemove.drag",x,T_).on("mouseup.drag",S,T_),jI(C.view),by(C),u=!1,o=C.clientX,c=C.clientY,E("start",C))}}function x(C){if(Yf(C),!u){var z=C.clientX-o,E=C.clientY-c;u=z*z+E*E>f}s.mouse("drag",C)}function S(C){Ci(C.view).on("mousemove.drag mouseup.drag",null),TI(C.view,u),Yf(C),s.mouse("end",C)}function b(C,z){if(e.call(this,C,z)){var E=C.changedTouches,R=n.call(this,C,z),N=E.length,M,O;for(M=0;M>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):t===8?Jp(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):t===4?Jp(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=_3t.exec(e))?new oi(n[1],n[2],n[3],1):(n=p3t.exec(e))?new oi(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=m3t.exec(e))?Jp(n[1],n[2],n[3],n[4]):(n=g3t.exec(e))?Jp(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=b3t.exec(e))?Sz(n[1],n[2]/100,n[3]/100,1):(n=v3t.exec(e))?Sz(n[1],n[2]/100,n[3]/100,n[4]):gz.hasOwnProperty(e)?xz(gz[e]):e==="transparent"?new oi(NaN,NaN,NaN,0):null}function xz(e){return new oi(e>>16&255,e>>8&255,e&255,1)}function Jp(e,n,t,r){return r<=0&&(e=n=t=NaN),new oi(e,n,t,r)}function w3t(e){return e instanceof u0||(e=Eu(e)),e?(e=e.rgb(),new oi(e.r,e.g,e.b,e.opacity)):new oi}function vw(e,n,t,r){return arguments.length===1?w3t(e):new oi(e,n,t,r??1)}function oi(e,n,t,r){this.r=+e,this.g=+n,this.b=+t,this.opacity=+r}m3(oi,vw,RI(u0,{brighter(e){return e=e==null?bg:Math.pow(bg,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?A_:Math.pow(A_,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new oi(yu(this.r),yu(this.g),yu(this.b),vg(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:yz,formatHex:yz,formatHex8:S3t,formatRgb:wz,toString:wz}));function yz(){return`#${du(this.r)}${du(this.g)}${du(this.b)}`}function S3t(){return`#${du(this.r)}${du(this.g)}${du(this.b)}${du((isNaN(this.opacity)?1:this.opacity)*255)}`}function wz(){const e=vg(this.opacity);return`${e===1?"rgb(":"rgba("}${yu(this.r)}, ${yu(this.g)}, ${yu(this.b)}${e===1?")":`, ${e})`}`}function vg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yu(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function du(e){return e=yu(e),(e<16?"0":"")+e.toString(16)}function Sz(e,n,t,r){return r<=0?e=n=t=NaN:t<=0||t>=1?e=n=NaN:n<=0&&(e=NaN),new ga(e,n,t,r)}function MI(e){if(e instanceof ga)return new ga(e.h,e.s,e.l,e.opacity);if(e instanceof u0||(e=Eu(e)),!e)return new ga;if(e instanceof ga)return e;e=e.rgb();var n=e.r/255,t=e.g/255,r=e.b/255,s=Math.min(n,t,r),i=Math.max(n,t,r),a=NaN,o=i-s,c=(i+s)/2;return o?(n===i?a=(t-r)/o+(t0&&c<1?0:a,new ga(a,o,c,e.opacity)}function k3t(e,n,t,r){return arguments.length===1?MI(e):new ga(e,n,t,r??1)}function ga(e,n,t,r){this.h=+e,this.s=+n,this.l=+t,this.opacity=+r}m3(ga,k3t,RI(u0,{brighter(e){return e=e==null?bg:Math.pow(bg,e),new ga(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?A_:Math.pow(A_,e),new ga(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*n,s=2*t-r;return new oi(vy(e>=240?e-240:e+120,s,r),vy(e,s,r),vy(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new ga(kz(this.h),em(this.s),em(this.l),vg(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=vg(this.opacity);return`${e===1?"hsl(":"hsla("}${kz(this.h)}, ${em(this.s)*100}%, ${em(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kz(e){return e=(e||0)%360,e<0?e+360:e}function em(e){return Math.max(0,Math.min(1,e||0))}function vy(e,n,t){return(e<60?n+(t-n)*e/60:e<180?t:e<240?n+(t-n)*(240-e)/60:n)*255}const g3=e=>()=>e;function C3t(e,n){return function(t){return e+t*n}}function E3t(e,n,t){return e=Math.pow(e,t),n=Math.pow(n,t)-e,t=1/t,function(r){return Math.pow(e+r*n,t)}}function N3t(e){return(e=+e)==1?LI:function(n,t){return t-n?E3t(n,t,e):g3(isNaN(n)?t:n)}}function LI(e,n){var t=n-e;return t?C3t(e,t):g3(isNaN(e)?n:e)}const xg=(function e(n){var t=N3t(n);function r(s,i){var a=t((s=vw(s)).r,(i=vw(i)).r),o=t(s.g,i.g),c=t(s.b,i.b),u=LI(s.opacity,i.opacity);return function(_){return s.r=a(_),s.g=o(_),s.b=c(_),s.opacity=u(_),s+""}}return r.gamma=e,r})(1);function z3t(e,n){n||(n=[]);var t=e?Math.min(n.length,e.length):0,r=n.slice(),s;return function(i){for(s=0;st&&(i=n.slice(t,i),o[a]?o[a]+=i:o[++a]=i),(r=r[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,c.push({i:a,x:Ya(r,s)})),t=xy.lastIndex;return t180?_+=360:_-u>180&&(u+=360),p.push({i:f.push(s(f)+"rotate(",null,r)-2,x:Ya(u,_)})):_&&f.push(s(f)+"rotate("+_+r)}function o(u,_,f,p){u!==_?p.push({i:f.push(s(f)+"skewX(",null,r)-2,x:Ya(u,_)}):_&&f.push(s(f)+"skewX("+_+r)}function c(u,_,f,p,m,x){if(u!==f||_!==p){var S=m.push(s(m)+"scale(",null,",",null,")");x.push({i:S-4,x:Ya(u,f)},{i:S-2,x:Ya(_,p)})}else(f!==1||p!==1)&&m.push(s(m)+"scale("+f+","+p+")")}return function(u,_){var f=[],p=[];return u=e(u),_=e(_),i(u.translateX,u.translateY,_.translateX,_.translateY,f,p),a(u.rotate,_.rotate,f,p),o(u.skewX,_.skewX,f,p),c(u.scaleX,u.scaleY,_.scaleX,_.scaleY,f,p),u=_=null,function(m){for(var x=-1,S=p.length,b;++x=0&&e._call.call(void 0,n),e=e._next;--md}function Nz(){Nu=(wg=M_.now())+I1,md=Ph=0;try{U3t()}finally{md=0,G3t(),Nu=0}}function q3t(){var e=M_.now(),n=e-wg;n>BI&&(I1-=n,wg=e)}function G3t(){for(var e,n=yg,t,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:yg=t);Hh=e,ww(r)}function ww(e){if(!md){Ph&&(Ph=clearTimeout(Ph));var n=e-Nu;n>24?(e<1/0&&(Ph=setTimeout(Nz,e-M_.now()-I1)),Lh&&(Lh=clearInterval(Lh))):(Lh||(wg=M_.now(),Lh=setInterval(q3t,BI)),md=1,$I(Nz))}}function zz(e,n,t){var r=new Sg;return n=n==null?0:+n,r.restart(s=>{r.stop(),e(s+n)},n,t),r}var V3t=D1("start","end","cancel","interrupt"),W3t=[],HI=0,jz=1,Sw=2,Tm=3,Tz=4,kw=5,Am=6;function B1(e,n,t,r,s,i){var a=e.__transition;if(!a)e.__transition={};else if(t in a)return;K3t(e,t,{name:n,index:r,group:s,on:V3t,tween:W3t,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:HI})}function v3(e,n){var t=Na(e,n);if(t.state>HI)throw new Error("too late; already scheduled");return t}function mo(e,n){var t=Na(e,n);if(t.state>Tm)throw new Error("too late; already running");return t}function Na(e,n){var t=e.__transition;if(!t||!(t=t[n]))throw new Error("transition not found");return t}function K3t(e,n,t){var r=e.__transition,s;r[n]=t,t.timer=PI(i,0,t.time);function i(u){t.state=jz,t.timer.restart(a,t.delay,t.time),t.delay<=u&&a(u-t.delay)}function a(u){var _,f,p,m;if(t.state!==jz)return c();for(_ in r)if(m=r[_],m.name===t.name){if(m.state===Tm)return zz(a);m.state===Tz?(m.state=Am,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[_]):+_Sw&&r.state=0&&(n=n.slice(0,t)),!n||n==="start"})}function k6t(e,n,t){var r,s,i=S6t(n)?v3:mo;return function(){var a=i(this,e),o=a.on;o!==r&&(s=(r=o).copy()).on(n,t),a.on=s}}function C6t(e,n){var t=this._id;return arguments.length<2?Na(this.node(),t).on.on(e):this.each(k6t(t,e,n))}function E6t(e){return function(){var n=this.parentNode;for(var t in this.__transition)if(+t!==e)return;n&&n.removeChild(this)}}function N6t(){return this.on("end.remove",E6t(this._id))}function z6t(e){var n=this._name,t=this._id;typeof e!="function"&&(e=_3(e));for(var r=this._groups,s=r.length,i=new Array(s),a=0;a()=>e;function J6t(e,{sourceEvent:n,target:t,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Qo(e,n,t){this.k=e,this.x=n,this.y=t}Qo.prototype={constructor:Qo,scale:function(e){return e===1?this:new Qo(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Qo(this.k,this.x+this.k*e,this.y+this.k*n)},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 $1=new Qo(1,0,0);GI.prototype=Qo.prototype;function GI(e){for(;!e.__zoom;)if(!(e=e.parentNode))return $1;return e.__zoom}function yy(e){e.stopImmediatePropagation()}function Dh(e){e.preventDefault(),e.stopImmediatePropagation()}function eSt(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tSt(){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 Az(){return this.__zoom||$1}function nSt(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rSt(){return navigator.maxTouchPoints||"ontouchstart"in this}function sSt(e,n,t){var r=e.invertX(n[0][0])-t[0][0],s=e.invertX(n[1][0])-t[1][0],i=e.invertY(n[0][1])-t[0][1],a=e.invertY(n[1][1])-t[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function VI(){var e=eSt,n=tSt,t=sSt,r=nSt,s=rSt,i=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,c=jm,u=D1("start","zoom","end"),_,f,p,m=500,x=150,S=0,b=10;function v(F){F.property("__zoom",Az).on("wheel.zoom",N,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",O).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(F,Y,q,Q){var Z=F.selection?F.selection():F;Z.property("__zoom",Az),F!==Z?z(F,Y,q,Q):Z.interrupt().each(function(){E(this,arguments).event(Q).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},v.scaleBy=function(F,Y,q,Q){v.scaleTo(F,function(){var Z=this.__zoom.k,B=typeof Y=="function"?Y.apply(this,arguments):Y;return Z*B},q,Q)},v.scaleTo=function(F,Y,q,Q){v.transform(F,function(){var Z=n.apply(this,arguments),B=this.__zoom,D=q==null?C(Z):typeof q=="function"?q.apply(this,arguments):q,P=B.invert(D),X=typeof Y=="function"?Y.apply(this,arguments):Y;return t(w(y(B,X),D,P),Z,a)},q,Q)},v.translateBy=function(F,Y,q,Q){v.transform(F,function(){return t(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof q=="function"?q.apply(this,arguments):q),n.apply(this,arguments),a)},null,Q)},v.translateTo=function(F,Y,q,Q,Z){v.transform(F,function(){var B=n.apply(this,arguments),D=this.__zoom,P=Q==null?C(B):typeof Q=="function"?Q.apply(this,arguments):Q;return t($1.translate(P[0],P[1]).scale(D.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof q=="function"?-q.apply(this,arguments):-q),B,a)},Q,Z)};function y(F,Y){return Y=Math.max(i[0],Math.min(i[1],Y)),Y===F.k?F:new Qo(Y,F.x,F.y)}function w(F,Y,q){var Q=Y[0]-q[0]*F.k,Z=Y[1]-q[1]*F.k;return Q===F.x&&Z===F.y?F:new Qo(F.k,Q,Z)}function C(F){return[(+F[0][0]+ +F[1][0])/2,(+F[0][1]+ +F[1][1])/2]}function z(F,Y,q,Q){F.on("start.zoom",function(){E(this,arguments).event(Q).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(Q).end()}).tween("zoom",function(){var Z=this,B=arguments,D=E(Z,B).event(Q),P=n.apply(Z,B),X=q==null?C(P):typeof q=="function"?q.apply(Z,B):q,W=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),ie=Z.__zoom,le=typeof Y=="function"?Y.apply(Z,B):Y,ae=c(ie.invert(X).concat(W/ie.k),le.invert(X).concat(W/le.k));return function(se){if(se===1)se=le;else{var G=ae(se),oe=W/G[2];se=new Qo(oe,X[0]-G[0]*oe,X[1]-G[1]*oe)}D.zoom(null,se)}})}function E(F,Y,q){return!q&&F.__zooming||new R(F,Y)}function R(F,Y){this.that=F,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=n.apply(F,Y),this.taps=0}R.prototype={event:function(F){return F&&(this.sourceEvent=F),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(F,Y){return this.mouse&&F!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&F!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&F!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(F){var Y=Ci(this.that).datum();u.call(F,this.that,new J6t(F,{sourceEvent:this.sourceEvent,target:v,transform:this.that.__zoom,dispatch:u}),Y)}};function N(F,...Y){if(!e.apply(this,arguments))return;var q=E(this,Y).event(F),Q=this.__zoom,Z=Math.max(i[0],Math.min(i[1],Q.k*Math.pow(2,r.apply(this,arguments)))),B=ha(F);if(q.wheel)(q.mouse[0][0]!==B[0]||q.mouse[0][1]!==B[1])&&(q.mouse[1]=Q.invert(q.mouse[0]=B)),clearTimeout(q.wheel);else{if(Q.k===Z)return;q.mouse=[B,Q.invert(B)],Rm(this),q.start()}Dh(F),q.wheel=setTimeout(D,x),q.zoom("mouse",t(w(y(Q,Z),q.mouse[0],q.mouse[1]),q.extent,a));function D(){q.wheel=null,q.end()}}function M(F,...Y){if(p||!e.apply(this,arguments))return;var q=F.currentTarget,Q=E(this,Y,!0).event(F),Z=Ci(F.view).on("mousemove.zoom",X,!0).on("mouseup.zoom",W,!0),B=ha(F,q),D=F.clientX,P=F.clientY;jI(F.view),yy(F),Q.mouse=[B,this.__zoom.invert(B)],Rm(this),Q.start();function X(ie){if(Dh(ie),!Q.moved){var le=ie.clientX-D,ae=ie.clientY-P;Q.moved=le*le+ae*ae>S}Q.event(ie).zoom("mouse",t(w(Q.that.__zoom,Q.mouse[0]=ha(ie,q),Q.mouse[1]),Q.extent,a))}function W(ie){Z.on("mousemove.zoom mouseup.zoom",null),TI(ie.view,Q.moved),Dh(ie),Q.event(ie).end()}}function O(F,...Y){if(e.apply(this,arguments)){var q=this.__zoom,Q=ha(F.changedTouches?F.changedTouches[0]:F,this),Z=q.invert(Q),B=q.k*(F.shiftKey?.5:2),D=t(w(y(q,B),Q,Z),n.apply(this,Y),a);Dh(F),o>0?Ci(this).transition().duration(o).call(z,D,Q,F):Ci(this).call(v.transform,D,Q,F)}}function I(F,...Y){if(e.apply(this,arguments)){var q=F.touches,Q=q.length,Z=E(this,Y,F.changedTouches.length===Q).event(F),B,D,P,X;for(yy(F),D=0;D`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} 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:n,sourceHandle:t,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?t:r}", edge id: ${n}.`,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.`},L_=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],WI=["Enter"," ","Escape"],KI={"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:n,y:t})=>`Moved selected node ${e}. New position, x: ${n}, y: ${t}`,"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 gd;(function(e){e.Strict="strict",e.Loose="loose"})(gd||(gd={}));var wu;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(wu||(wu={}));var D_;(function(e){e.Partial="partial",e.Full="full"})(D_||(D_={}));const YI={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ec;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ec||(ec={}));var kg;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(kg||(kg={}));var St;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(St||(St={}));const Rz={[St.Left]:St.Right,[St.Right]:St.Left,[St.Top]:St.Bottom,[St.Bottom]:St.Top};function XI(e){return e===null?null:e?"valid":"invalid"}const ZI=e=>"id"in e&&"source"in e&&"target"in e,iSt=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),y3=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),f0=(e,n=[0,0])=>{const{width:t,height:r}=dl(e),s=e.origin??n,i=t*s[0],a=r*s[1];return{x:e.position.x-i,y:e.position.y-a}},aSt=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const t=e.reduce((r,s)=>{const i=typeof s=="string";let a=!n.nodeLookup&&!i?s:void 0;n.nodeLookup&&(a=i?n.nodeLookup.get(s):y3(s)?s:n.nodeLookup.get(s.id));const o=a?Cg(a,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return P1(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return H1(t)},d0=(e,n={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(n.filter===void 0||n.filter(s))&&(t=P1(t,Cg(s)),r=!0)}),r?H1(t):{x:0,y:0,width:0,height:0}},w3=(e,n,[t,r,s]=[0,0,1],i=!1,a=!1)=>{const o=(n.x-t)/s,c=(n.y-r)/s,u=n.width/s,_=n.height/s,f=[];for(const p of e.values()){const{measured:m,selectable:x=!0,hidden:S=!1}=p;if(a&&!x||S)continue;const b=m.width??p.width??p.initialWidth??0,v=m.height??p.height??p.initialHeight??0,{x:y,y:w}=p.internals.positionAbsolute,C=tB(o,c,u,_,y,w,b,v),z=b*v,E=i&&C>0;(!p.internals.handleBounds||E||C>=z||p.dragging)&&f.push(p)}return f},oSt=(e,n)=>{const t=new Set;return e.forEach(r=>{t.add(r.id)}),n.filter(r=>t.has(r.source)||t.has(r.target))};function lSt(e,n){const t=new Map,r=n!=null&&n.nodes?new Set(n.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&t.set(s.id,s)}),t}async function cSt({nodes:e,width:n,height:t,panZoom:r,minZoom:s,maxZoom:i},a){if(e.size===0)return!0;const o=lSt(e,a),c=d0(o),u=k3(c,n,t,(a==null?void 0:a.minZoom)??s,(a==null?void 0:a.maxZoom)??i,(a==null?void 0:a.padding)??.1);return await r.setViewport(u,{duration:a==null?void 0:a.duration,ease:a==null?void 0:a.ease,interpolate:a==null?void 0:a.interpolate}),!0}function QI({nodeId:e,nextPosition:n,nodeLookup:t,nodeOrigin:r=[0,0],nodeExtent:s,onError:i}){const a=t.get(e),o=a.parentId?t.get(a.parentId):void 0,{x:c,y:u}=o?o.internals.positionAbsolute:{x:0,y:0},_=a.origin??r;let f=a.extent||s;if(a.extent==="parent"&&!a.expandParent)if(!o)i==null||i("005",ka.error005());else{const m=o.measured.width,x=o.measured.height;m&&x&&(f=[[c,u],[c+m,u+x]])}else o&&ju(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);const p=ju(f)?zu(n,f,a.measured):n;return(a.measured.width===void 0||a.measured.height===void 0)&&(i==null||i("015",ka.error015())),{position:{x:p.x-c+(a.measured.width??0)*_[0],y:p.y-u+(a.measured.height??0)*_[1]},positionAbsolute:p}}async function uSt({nodesToRemove:e=[],edgesToRemove:n=[],nodes:t,edges:r,onBeforeDelete:s}){const i=new Set(e.map(p=>p.id)),a=[];for(const p of t){if(p.deletable===!1)continue;const m=i.has(p.id),x=!m&&p.parentId&&a.find(S=>S.id===p.parentId);(m||x)&&a.push(p)}const o=new Set(n.map(p=>p.id)),c=r.filter(p=>p.deletable!==!1),_=oSt(a,c);for(const p of c)o.has(p.id)&&!_.find(x=>x.id===p.id)&&_.push(p);if(!s)return{edges:_,nodes:a};const f=await s({nodes:a,edges:_});return typeof f=="boolean"?f?{edges:_,nodes:a}:{edges:[],nodes:[]}:f}const bd=(e,n=0,t=1)=>Math.min(Math.max(e,n),t),zu=(e={x:0,y:0},n,t)=>({x:bd(e.x,n[0][0],n[1][0]-((t==null?void 0:t.width)??0)),y:bd(e.y,n[0][1],n[1][1]-((t==null?void 0:t.height)??0))});function JI(e,n,t){const{width:r,height:s}=dl(t),{x:i,y:a}=t.internals.positionAbsolute;return zu(e,[[i,a],[i+r,a+s]],n)}const Mz=(e,n,t)=>et?-bd(Math.abs(e-t),1,n)/n:0,S3=(e,n,t=15,r=40)=>{const s=Mz(e.x,r,n.width-r)*t,i=Mz(e.y,r,n.height-r)*t;return[s,i]},P1=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Cw=({x:e,y:n,width:t,height:r})=>({x:e,y:n,x2:e+t,y2:n+r}),H1=({x:e,y:n,x2:t,y2:r})=>({x:e,y:n,width:t-e,height:r-n}),O_=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=y3(e)?e.internals.positionAbsolute:f0(e,n);return{x:t,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},Cg=(e,n=[0,0])=>{var s,i;const{x:t,y:r}=y3(e)?e.internals.positionAbsolute:f0(e,n);return{x:t,y:r,x2:t+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},eB=(e,n)=>H1(P1(Cw(e),Cw(n))),tB=(e,n,t,r,s,i,a,o)=>{const c=Math.max(0,Math.min(e+t,s+a)-Math.max(e,s)),u=Math.max(0,Math.min(n+r,i+o)-Math.max(n,i));return Math.ceil(c*u)},Eg=(e,n)=>tB(e.x,e.y,e.width,e.height,n.x,n.y,n.width,n.height),Lz=e=>ba(e.width)&&ba(e.height)&&ba(e.x)&&ba(e.y),ba=e=>!isNaN(e)&&isFinite(e),nB=(e,n)=>(t,r)=>{},h0=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),_0=({x:e,y:n},[t,r,s],i=!1,a=[1,1])=>{const o={x:(e-t)/s,y:(n-r)/s};return i?h0(o,a):o},vd=({x:e,y:n},[t,r,s])=>({x:e*s+t,y:n*s+r});function Nf(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e=="string"&&e.endsWith("%")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(n*t*.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 fSt(e,n,t){if(typeof e=="string"||typeof e=="number"){const r=Nf(e,t),s=Nf(e,n);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=Nf(e.top??e.y??0,t),s=Nf(e.bottom??e.y??0,t),i=Nf(e.left??e.x??0,n),a=Nf(e.right??e.x??0,n);return{top:r,right:a,bottom:s,left:i,x:i+a,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dSt(e,n,t,r,s,i){const{x:a,y:o}=vd(e,[n,t,r]),{x:c,y:u}=vd({x:e.x+e.width,y:e.y+e.height},[n,t,r]),_=s-c,f=i-u;return{left:Math.floor(a),top:Math.floor(o),right:Math.floor(_),bottom:Math.floor(f)}}const k3=(e,n,t,r,s,i)=>{const a=fSt(i,n,t),o=(n-a.x)/e.width,c=(t-a.y)/e.height,u=Math.min(o,c),_=bd(u,r,s),f=e.x+e.width/2,p=e.y+e.height/2,m=n/2-f*_,x=t/2-p*_,S=dSt(e,m,x,_,n,t),b={left:Math.min(S.left-a.left,0),top:Math.min(S.top-a.top,0),right:Math.min(S.right-a.right,0),bottom:Math.min(S.bottom-a.bottom,0)};return{x:m-b.left+b.right,y:x-b.top+b.bottom,zoom:_}},I_=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ju(e){return e!=null&&e!=="parent"}function dl(e){var n,t;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight??0}}function rB(e){var n,t;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((t=e.measured)==null?void 0:t.height)??e.height??e.initialHeight)!==void 0}function sB(e,n={width:0,height:0},t,r,s){const i={...e},a=r.get(t);if(a){const o=a.origin||s;i.x+=a.internals.positionAbsolute.x-(n.width??0)*o[0],i.y+=a.internals.positionAbsolute.y-(n.height??0)*o[1]}return i}function Dz(e,n){if(e.size!==n.size)return!1;for(const t of e)if(!n.has(t))return!1;return!0}function hSt(){let e,n;return{promise:new Promise((r,s)=>{e=r,n=s}),resolve:e,reject:n}}function _St(e){return{...KI,...e||{}}}function e_(e,{snapGrid:n=[0,0],snapToGrid:t=!1,transform:r,containerBounds:s}){const{x:i,y:a}=va(e),o=_0({x:i-((s==null?void 0:s.left)??0),y:a-((s==null?void 0:s.top)??0)},r),{x:c,y:u}=t?h0(o,n):o;return{xSnapped:c,ySnapped:u,...o}}const C3=e=>({width:e.offsetWidth,height:e.offsetHeight}),iB=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},pSt=["INPUT","SELECT","TEXTAREA"];function aB(e){var r,s;const n=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:pSt.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const oB=e=>"clientX"in e,va=(e,n)=>{var i,a;const t=oB(e),r=t?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,s=t?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((n==null?void 0:n.left)??0),y:s-((n==null?void 0:n.top)??0)}},Oz=(e,n,t,r,s)=>{const i=n.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(a=>{const o=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:s,position:a.getAttribute("data-handlepos"),x:(o.left-t.left)/r,y:(o.top-t.top)/r,...C3(a)}})};function lB({sourceX:e,sourceY:n,targetX:t,targetY:r,sourceControlX:s,sourceControlY:i,targetControlX:a,targetControlY:o}){const c=e*.125+s*.375+a*.375+t*.125,u=n*.125+i*.375+o*.375+r*.125,_=Math.abs(c-e),f=Math.abs(u-n);return[c,u,_,f]}function rm(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function Iz({pos:e,x1:n,y1:t,x2:r,y2:s,c:i}){switch(e){case St.Left:return[n-rm(n-r,i),t];case St.Right:return[n+rm(r-n,i),t];case St.Top:return[n,t-rm(t-s,i)];case St.Bottom:return[n,t+rm(s-t,i)]}}function cB({sourceX:e,sourceY:n,sourcePosition:t=St.Bottom,targetX:r,targetY:s,targetPosition:i=St.Top,curvature:a=.25}){const[o,c]=Iz({pos:t,x1:e,y1:n,x2:r,y2:s,c:a}),[u,_]=Iz({pos:i,x1:r,y1:s,x2:e,y2:n,c:a}),[f,p,m,x]=lB({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:_});return[`M${e},${n} C${o},${c} ${u},${_} ${r},${s}`,f,p,m,x]}function uB({sourceX:e,sourceY:n,targetX:t,targetY:r}){const s=Math.abs(t-e)/2,i=t0}const bSt=({source:e,sourceHandle:n,target:t,targetHandle:r})=>`xy-edge__${e}${n||""}-${t}${r||""}`,vSt=(e,n)=>n.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),xSt=(e,n,t={})=>{var i;if(!e.source||!e.target)return(i=t.onError)==null||i.call(t,"006",ka.error006()),n;const r=t.getEdgeId||bSt;let s;return ZI(e)?s={...e}:s={...e,id:r(e)},vSt(s,n)?n:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,n.concat(s))};function fB({sourceX:e,sourceY:n,targetX:t,targetY:r}){const[s,i,a,o]=uB({sourceX:e,sourceY:n,targetX:t,targetY:r});return[`M ${e},${n}L ${t},${r}`,s,i,a,o]}const Bz={[St.Left]:{x:-1,y:0},[St.Right]:{x:1,y:0},[St.Top]:{x:0,y:-1},[St.Bottom]:{x:0,y:1}},ySt=({source:e,sourcePosition:n=St.Bottom,target:t})=>n===St.Left||n===St.Right?e.xMath.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function wSt({source:e,sourcePosition:n=St.Bottom,target:t,targetPosition:r=St.Top,center:s,offset:i,stepPosition:a}){const o=Bz[n],c=Bz[r],u={x:e.x+o.x*i,y:e.y+o.y*i},_={x:t.x+c.x*i,y:t.y+c.y*i},f=ySt({source:u,sourcePosition:n,target:_}),p=f.x!==0?"x":"y",m=f[p];let x=[],S,b;const v={x:0,y:0},y={x:0,y:0},[,,w,C]=uB({sourceX:e.x,sourceY:e.y,targetX:t.x,targetY:t.y});if(o[p]*c[p]===-1){p==="x"?(S=s.x??u.x+(_.x-u.x)*a,b=s.y??(u.y+_.y)/2):(S=s.x??(u.x+_.x)/2,b=s.y??u.y+(_.y-u.y)*a);const N=[{x:S,y:u.y},{x:S,y:_.y}],M=[{x:u.x,y:b},{x:_.x,y:b}];o[p]===m?x=p==="x"?N:M:x=p==="x"?M:N}else{const N=[{x:u.x,y:_.y}],M=[{x:_.x,y:u.y}];if(p==="x"?x=o.x===m?M:N:x=o.y===m?N:M,n===r){const F=Math.abs(e[p]-t[p]);if(F<=i){const Y=Math.min(i-1,i-F);o[p]===m?v[p]=(u[p]>e[p]?-1:1)*Y:y[p]=(_[p]>t[p]?-1:1)*Y}}if(n!==r){const F=p==="x"?"y":"x",Y=o[p]===c[F],q=u[F]>_[F],Q=u[F]<_[F];(o[p]===1&&(!Y&&q||Y&&Q)||o[p]!==1&&(!Y&&Q||Y&&q))&&(x=p==="x"?N:M)}const O={x:u.x+v.x,y:u.y+v.y},I={x:_.x+y.x,y:_.y+y.y},H=Math.max(Math.abs(O.x-x[0].x),Math.abs(I.x-x[0].x)),U=Math.max(Math.abs(O.y-x[0].y),Math.abs(I.y-x[0].y));H>=U?(S=(O.x+I.x)/2,b=x[0].y):(S=x[0].x,b=(O.y+I.y)/2)}const z={x:u.x+v.x,y:u.y+v.y},E={x:_.x+y.x,y:_.y+y.y};return[[e,...z.x!==x[0].x||z.y!==x[0].y?[z]:[],...x,...E.x!==x[x.length-1].x||E.y!==x[x.length-1].y?[E]:[],t],S,b,w,C]}function SSt(e,n,t,r){const s=Math.min($z(e,n)/2,$z(n,t)/2,r),{x:i,y:a}=n;if(e.x===i&&i===t.x||e.y===a&&a===t.y)return`L${i} ${a}`;if(e.y===a){const u=e.xt.id===n):e[0])||null}function Nw(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function CSt(e,{id:n,defaultColor:t,defaultMarkerStart:r,defaultMarkerEnd:s}){const i=new Set;return e.reduce((a,o)=>([o.markerStart||r,o.markerEnd||s].forEach(c=>{if(c&&typeof c=="object"){const u=Nw(c,n);i.has(u)||(a.push({id:u,color:c.color||t,...c}),i.add(u))}}),a),[]).sort((a,o)=>a.id.localeCompare(o.id))}const dB=1e3,ESt=10,E3={nodeOrigin:[0,0],nodeExtent:L_,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},NSt={...E3,checkEquality:!0};function N3(e,n){const t={...e};for(const r in n)n[r]!==void 0&&(t[r]=n[r]);return t}function zSt(e,n,t){const r=N3(E3,t);for(const s of e.values())if(s.parentId)j3(s,e,n,r);else{const i=f0(s,r.nodeOrigin),a=ju(s.extent)?s.extent:r.nodeExtent,o=zu(i,a,dl(s));s.internals.positionAbsolute=o}}function jSt(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const t=[],r=[];for(const s of e.handles){const i={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(i):s.type==="target"&&r.push(i)}return{source:t,target:r}}function z3(e){return e==="manual"}function zw(e,n,t,r={}){var _,f;const s=N3(NSt,r),i={i:0},a=new Map(n),o=s!=null&&s.elevateNodesOnSelect&&!z3(s.zIndexMode)?dB:0;let c=e.length>0,u=!1;n.clear(),t.clear();for(const p of e){let m=a.get(p.id);if(s.checkEquality&&p===(m==null?void 0:m.internals.userNode))n.set(p.id,m);else{const x=f0(p,s.nodeOrigin),S=ju(p.extent)?p.extent:s.nodeExtent,b=zu(x,S,dl(p));m={...s.defaults,...p,measured:{width:(_=p.measured)==null?void 0:_.width,height:(f=p.measured)==null?void 0:f.height},internals:{positionAbsolute:b,handleBounds:jSt(p,m),z:hB(p,o,s.zIndexMode),userNode:p}},n.set(p.id,m)}(m.measured===void 0||m.measured.width===void 0||m.measured.height===void 0)&&!m.hidden&&(c=!1),p.parentId&&j3(m,n,t,r,i),u||(u=p.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:u}}function TSt(e,n){if(!e.parentId)return;const t=n.get(e.parentId);t?t.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function j3(e,n,t,r,s){const{elevateNodesOnSelect:i,nodeOrigin:a,nodeExtent:o,zIndexMode:c}=N3(E3,r),u=e.parentId,_=n.get(u);if(!_){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}TSt(e,t),s&&!_.parentId&&_.internals.rootParentIndex===void 0&&c==="auto"&&(_.internals.rootParentIndex=++s.i,_.internals.z=_.internals.z+s.i*ESt),s&&_.internals.rootParentIndex!==void 0&&(s.i=_.internals.rootParentIndex);const f=i&&!z3(c)?dB:0,{x:p,y:m,z:x}=ASt(e,_,a,o,f,c),{positionAbsolute:S}=e.internals,b=p!==S.x||m!==S.y;(b||x!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:p,y:m}:S,z:x}})}function hB(e,n,t){const r=ba(e.zIndex)?e.zIndex:0;return z3(t)?r:r+(e.selected?n:0)}function ASt(e,n,t,r,s,i){const{x:a,y:o}=n.internals.positionAbsolute,c=dl(e),u=f0(e,t),_=ju(e.extent)?zu(u,e.extent,c):u;let f=zu({x:a+_.x,y:o+_.y},r,c);e.extent==="parent"&&(f=JI(f,c,n));const p=hB(e,s,i),m=n.internals.z??0;return{x:f.x,y:f.y,z:m>=p?m+1:p}}function T3(e,n,t,r=[0,0]){var a;const s=[],i=new Map;for(const o of e){const c=n.get(o.parentId);if(!c)continue;const u=((a=i.get(o.parentId))==null?void 0:a.expandedRect)??O_(c),_=eB(u,o.rect);i.set(o.parentId,{expandedRect:_,parent:c})}return i.size>0&&i.forEach(({expandedRect:o,parent:c},u)=>{var w;const _=c.internals.positionAbsolute,f=dl(c),p=c.origin??r,m=o.x<_.x?Math.round(Math.abs(_.x-o.x)):0,x=o.y<_.y?Math.round(Math.abs(_.y-o.y)):0,S=Math.max(f.width,Math.round(o.width)),b=Math.max(f.height,Math.round(o.height)),v=(S-f.width)*p[0],y=(b-f.height)*p[1];(m>0||x>0||v||y)&&(s.push({id:u,type:"position",position:{x:c.position.x-m+v,y:c.position.y-x+y}}),(w=t.get(u))==null||w.forEach(C=>{e.some(z=>z.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+m,y:C.position.y+x}})})),(f.width0){const m=T3(p,n,t,s);u.push(...m)}return{changes:u,updatedInternals:c}}async function MSt({delta:e,panZoom:n,transform:t,translateExtent:r,width:s,height:i}){if(!n||!e.x&&!e.y)return!1;const a=await n.setViewportConstrained({x:t[0]+e.x,y:t[1]+e.y,zoom:t[2]},[[0,0],[s,i]],r);return!!a&&(a.x!==t[0]||a.y!==t[1]||a.k!==t[2])}function Uz(e,n,t,r,s,i){let a=s;const o=r.get(a)||new Map;r.set(a,o.set(t,n)),a=`${s}-${e}`;const c=r.get(a)||new Map;if(r.set(a,c.set(t,n)),i){a=`${s}-${e}-${i}`;const u=r.get(a)||new Map;r.set(a,u.set(t,n))}}function _B(e,n,t){e.clear(),n.clear();for(const r of t){const{source:s,target:i,sourceHandle:a=null,targetHandle:o=null}=r,c={edgeId:r.id,source:s,target:i,sourceHandle:a,targetHandle:o},u=`${s}-${a}--${i}-${o}`,_=`${i}-${o}--${s}-${a}`;Uz("source",c,_,e,s,a),Uz("target",c,u,e,i,o),n.set(r.id,r)}}function pB(e,n){if(!e.parentId)return!1;const t=n.get(e.parentId);return t?t.selected?!0:pB(t,n):!1}function qz(e,n,t){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,n))return!0;if(r===t)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function LSt(e,n,t,r){const s=new Map;for(const[i,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!pB(a,e))&&(a.draggable||n&&typeof a.draggable>"u")){const o=e.get(i);o&&s.set(i,{id:i,position:o.position||{x:0,y:0},distance:{x:t.x-o.internals.positionAbsolute.x,y:t.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 s}function wy({nodeId:e,dragItems:n,nodeLookup:t,dragging:r=!0}){var a,o,c;const s=[];for(const[u,_]of n){const f=(a=t.get(u))==null?void 0:a.internals.userNode;f&&s.push({...f,position:_.position,dragging:r})}if(!e)return[s[0],s];const i=(o=t.get(e))==null?void 0:o.internals.userNode;return[i?{...i,position:((c=n.get(e))==null?void 0:c.position)||i.position,dragging:r}:s[0],s]}function DSt({dragItems:e,snapGrid:n,x:t,y:r}){const s=e.values().next().value;if(!s)return null;const i={x:t-s.distance.x,y:r-s.distance.y},a=h0(i,n);return{x:a.x-i.x,y:a.y-i.y}}function OSt({onNodeMouseDown:e,getStoreItems:n,onDragStart:t,onDrag:r,onDragStop:s}){let i={x:null,y:null},a=0,o=new Map,c=!1,u={x:0,y:0},_=null,f=!1,p=null,m=!1,x=!1,S=null;function b({noDragClassName:y,handleSelector:w,domNode:C,isSelectable:z,nodeId:E,nodeClickDistance:R=0}){p=Ci(C);function N({x:H,y:U}){const{nodeLookup:F,nodeExtent:Y,snapGrid:q,snapToGrid:Q,nodeOrigin:Z,onNodeDrag:B,onSelectionDrag:D,onError:P,updateNodePositions:X}=n();i={x:H,y:U};let W=!1;const ie=o.size>1,le=ie&&Y?Cw(d0(o)):null,ae=ie&&Q?DSt({dragItems:o,snapGrid:q,x:H,y:U}):null;for(const[se,G]of o){if(!F.has(se))continue;let oe={x:H-G.distance.x,y:U-G.distance.y};Q&&(oe=ae?{x:Math.round(oe.x+ae.x),y:Math.round(oe.y+ae.y)}:h0(oe,q));let ce=null;if(ie&&Y&&!G.extent&&le){const{positionAbsolute:Ee}=G.internals,Te=Ee.x-le.x+Y[0][0],Ie=Ee.x+G.measured.width-le.x2+Y[1][0],Le=Ee.y-le.y+Y[0][1],He=Ee.y+G.measured.height-le.y2+Y[1][1];ce=[[Te,Le],[Ie,He]]}const{position:pe,positionAbsolute:ue}=QI({nodeId:se,nextPosition:oe,nodeLookup:F,nodeExtent:ce||Y,nodeOrigin:Z,onError:P});W=W||G.position.x!==pe.x||G.position.y!==pe.y,G.position=pe,G.internals.positionAbsolute=ue}if(x=x||W,!!W&&(X(o,!0),S&&(r||B||!E&&D))){const[se,G]=wy({nodeId:E,dragItems:o,nodeLookup:F});r==null||r(S,o,se,G),B==null||B(S,se,G),E||D==null||D(S,G)}}async function M(){if(!_)return;const{transform:H,panBy:U,autoPanSpeed:F,autoPanOnNodeDrag:Y}=n();if(!Y){c=!1,cancelAnimationFrame(a);return}const[q,Q]=S3(u,_,F);(q!==0||Q!==0)&&(i.x=(i.x??0)-q/H[2],i.y=(i.y??0)-Q/H[2],await U({x:q,y:Q})&&N(i)),a=requestAnimationFrame(M)}function O(H){var ie;const{nodeLookup:U,multiSelectionActive:F,nodesDraggable:Y,transform:q,snapGrid:Q,snapToGrid:Z,selectNodesOnDrag:B,onNodeDragStart:D,onSelectionDragStart:P,unselectNodesAndEdges:X}=n();f=!0,(!B||!z)&&!F&&E&&((ie=U.get(E))!=null&&ie.selected||X()),z&&B&&E&&(e==null||e(E));const W=e_(H.sourceEvent,{transform:q,snapGrid:Q,snapToGrid:Z,containerBounds:_});if(i=W,o=LSt(U,Y,W,E),o.size>0&&(t||D||!E&&P)){const[le,ae]=wy({nodeId:E,dragItems:o,nodeLookup:U});t==null||t(H.sourceEvent,o,le,ae),D==null||D(H.sourceEvent,le,ae),E||P==null||P(H.sourceEvent,ae)}}const I=AI().clickDistance(R).on("start",H=>{const{domNode:U,nodeDragThreshold:F,transform:Y,snapGrid:q,snapToGrid:Q}=n();_=(U==null?void 0:U.getBoundingClientRect())||null,m=!1,x=!1,S=H.sourceEvent,F===0&&O(H),i=e_(H.sourceEvent,{transform:Y,snapGrid:q,snapToGrid:Q,containerBounds:_}),u=va(H.sourceEvent,_)}).on("drag",H=>{const{autoPanOnNodeDrag:U,transform:F,snapGrid:Y,snapToGrid:q,nodeDragThreshold:Q,nodeLookup:Z}=n(),B=e_(H.sourceEvent,{transform:F,snapGrid:Y,snapToGrid:q,containerBounds:_});if(S=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||E&&!Z.has(E))&&(m=!0),!m){if(!c&&U&&f&&(c=!0,M()),!f){const D=va(H.sourceEvent,_),P=D.x-u.x,X=D.y-u.y;Math.sqrt(P*P+X*X)>Q&&O(H)}(i.x!==B.xSnapped||i.y!==B.ySnapped)&&o&&f&&(u=va(H.sourceEvent,_),N(B))}}).on("end",H=>{if(!f||m){m&&o.size>0&&n().updateNodePositions(o,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),o.size>0){const{nodeLookup:U,updateNodePositions:F,onNodeDragStop:Y,onSelectionDragStop:q}=n();if(x&&(F(o,!1),x=!1),s||Y||!E&&q){const[Q,Z]=wy({nodeId:E,dragItems:o,nodeLookup:U,dragging:!1});s==null||s(H.sourceEvent,o,Q,Z),Y==null||Y(H.sourceEvent,Q,Z),E||q==null||q(H.sourceEvent,Z)}}}).filter(H=>{const U=H.target;return!H.button&&(!y||!qz(U,`.${y}`,C))&&(!w||qz(U,w,C))});p.call(I)}function v(){p==null||p.on(".drag",null)}return{update:b,destroy:v}}function ISt(e,n,t){const r=[],s={x:e.x-t,y:e.y-t,width:t*2,height:t*2};for(const i of n.values())Eg(s,O_(i))>0&&r.push(i);return r}const BSt=250;function $St(e,n,t,r){var o,c;let s=[],i=1/0;const a=ISt(e,t,n+BSt);for(const u of a){const _=[...((o=u.internals.handleBounds)==null?void 0:o.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of _){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:p,y:m}=Tu(u,f,f.position,!0),x=Math.sqrt(Math.pow(p-e.x,2)+Math.pow(m-e.y,2));x>n||(x1){const u=r.type==="source"?"target":"source";return s.find(_=>_.type===u)??s[0]}return s[0]}function mB(e,n,t,r,s,i=!1){var u,_,f;const a=r.get(e);if(!a)return null;const o=s==="strict"?(u=a.internals.handleBounds)==null?void 0:u[n]:[...((_=a.internals.handleBounds)==null?void 0:_.source)??[],...((f=a.internals.handleBounds)==null?void 0:f.target)??[]],c=(t?o==null?void 0:o.find(p=>p.id===t):o==null?void 0:o[0])??null;return c&&i?{...c,...Tu(a,c,c.position,!0)}:c}function gB(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function PSt(e,n){let t=null;return n?t=!0:e&&!n&&(t=!1),t}const bB=()=>!0;function HSt(e,{connectionMode:n,connectionRadius:t,handleId:r,nodeId:s,edgeUpdaterType:i,isTarget:a,domNode:o,nodeLookup:c,lib:u,autoPanOnConnect:_,flowId:f,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:S,onConnectEnd:b,isValidConnection:v=bB,onReconnectEnd:y,updateConnection:w,getTransform:C,getFromHandle:z,autoPanSpeed:E,dragThreshold:R=1,handleDomNode:N}){const M=iB(e.target);let O=0,I;const{x:H,y:U}=va(e),F=gB(i,N),Y=o==null?void 0:o.getBoundingClientRect();let q=!1;if(!Y||!F)return;const Q=mB(s,F,r,c,n);if(!Q)return;let Z=va(e,Y),B=!1,D=null,P=!1,X=null;function W(){if(!_||!Y)return;const[pe,ue]=S3(Z,Y,E);p({x:pe,y:ue}),O=requestAnimationFrame(W)}const ie={...Q,nodeId:s,type:F,position:Q.position},le=c.get(s);let se={inProgress:!0,isValid:null,from:Tu(le,ie,St.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:le,to:Z,toHandle:null,toPosition:Rz[ie.position],toNode:null,pointer:Z};function G(){q=!0,w(se),x==null||x(e,{nodeId:s,handleId:r,handleType:F})}R===0&&G();function oe(pe){if(!q){const{x:He,y:Tt}=va(pe),Et=He-H,Vt=Tt-U;if(!(Et*Et+Vt*Vt>R*R))return;G()}if(!z()||!ie){ce(pe);return}const ue=C();Z=va(pe,Y),I=$St(_0(Z,ue,!1,[1,1]),t,c,ie),B||(W(),B=!0);const Ee=vB(pe,{handle:I,connectionMode:n,fromNodeId:s,fromHandleId:r,fromType:a?"target":"source",isValidConnection:v,doc:M,lib:u,flowId:f,nodeLookup:c});X=Ee.handleDomNode,D=Ee.connection,P=PSt(!!I,Ee.isValid);const Te=c.get(s),Ie=Te?Tu(Te,ie,St.Left,!0):se.from,Le={...se,from:Ie,isValid:P,to:Ee.toHandle&&P?vd({x:Ee.toHandle.x,y:Ee.toHandle.y},ue):Z,toHandle:Ee.toHandle,toPosition:P&&Ee.toHandle?Ee.toHandle.position:Rz[ie.position],toNode:Ee.toHandle?c.get(Ee.toHandle.nodeId):null,pointer:Z};w(Le),se=Le}function ce(pe){if(!("touches"in pe&&pe.touches.length>0)){if(q){(I||X)&&D&&P&&(S==null||S(D));const{inProgress:ue,...Ee}=se,Te={...Ee,toPosition:se.toHandle?se.toPosition:null};b==null||b(pe,Te),i&&(y==null||y(pe,Te))}m(),cancelAnimationFrame(O),B=!1,P=!1,D=null,X=null,M.removeEventListener("mousemove",oe),M.removeEventListener("mouseup",ce),M.removeEventListener("touchmove",oe),M.removeEventListener("touchend",ce)}}M.addEventListener("mousemove",oe),M.addEventListener("mouseup",ce),M.addEventListener("touchmove",oe),M.addEventListener("touchend",ce)}function vB(e,{handle:n,connectionMode:t,fromNodeId:r,fromHandleId:s,fromType:i,doc:a,lib:o,flowId:c,isValidConnection:u=bB,nodeLookup:_}){const f=i==="target",p=n?a.querySelector(`.${o}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:m,y:x}=va(e),S=a.elementFromPoint(m,x),b=S!=null&&S.classList.contains(`${o}-flow__handle`)?S:p,v={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const y=gB(void 0,b),w=b.getAttribute("data-nodeid"),C=b.getAttribute("data-handleid"),z=b.classList.contains("connectable"),E=b.classList.contains("connectableend");if(!w||!y)return v;const R={source:f?w:r,sourceHandle:f?C:s,target:f?r:w,targetHandle:f?s:C};v.connection=R;const M=z&&E&&(t===gd.Strict?f&&y==="source"||!f&&y==="target":w!==r||C!==s);v.isValid=M&&u(R),v.toHandle=mB(w,y,C,_,t,!0)}return v}const jw={onPointerDown:HSt,isValid:vB};function FSt({domNode:e,panZoom:n,getTransform:t,getViewScale:r}){const s=Ci(e);function i({translateExtent:o,width:c,height:u,zoomStep:_=1,pannable:f=!0,zoomable:p=!0,inversePan:m=!1}){const x=w=>{if(w.sourceEvent.type!=="wheel"||!n)return;const C=t(),z=w.sourceEvent.ctrlKey&&I_()?10:1,E=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*_,R=C[2]*Math.pow(2,E*z);n.scaleTo(R)};let S=[0,0];const b=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(S=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},v=w=>{const C=t();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!n)return;const z=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],E=[z[0]-S[0],z[1]-S[1]];S=z;const R=r()*Math.max(C[2],Math.log(C[2]))*(m?-1:1),N={x:C[0]-E[0]*R,y:C[1]-E[1]*R},M=[[0,0],[c,u]];n.setViewportConstrained({x:N.x,y:N.y,zoom:C[2]},M,o)},y=VI().on("start",b).on("zoom",f?v:null).on("zoom.wheel",p?x:null);s.call(y,{})}function a(){s.on("zoom",null)}return{update:i,destroy:a,pointer:ha}}const F1=e=>({x:e.x,y:e.y,zoom:e.k}),Sy=({x:e,y:n,zoom:t})=>$1.translate(e,n).scale(t),Bf=(e,n)=>e.target.closest(`.${n}`),xB=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),USt=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ky=(e,n=0,t=USt,r=()=>{})=>{const s=typeof n=="number"&&n>0;return s||r(),s?e.transition().duration(n).ease(t).on("end",r):e},yB=e=>{const n=e.ctrlKey&&I_()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function qSt({zoomPanValues:e,noWheelClassName:n,d3Selection:t,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:u}){return _=>{if(Bf(_,n))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const f=t.property("__zoom").k||1;if(_.ctrlKey&&a){const b=ha(_),v=yB(_),y=f*Math.pow(2,v);r.scaleTo(t,y,b,_);return}const p=_.deltaMode===1?20:1;let m=s===wu.Vertical?0:_.deltaX*p,x=s===wu.Horizontal?0:_.deltaY*p;!I_()&&_.shiftKey&&s!==wu.Vertical&&(m=_.deltaY*p,x=0),r.translateBy(t,-(m/f)*i,-(x/f)*i,{internal:!0});const S=F1(t.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(_,S),e.panScrollTimeout=setTimeout(()=>{u==null||u(_,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(_,S))}}function GSt({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:t}){return function(r,s){const i=r.type==="wheel",a=!n&&i&&!r.ctrlKey,o=Bf(r,e);if(r.ctrlKey&&i&&o&&r.preventDefault(),a||o)return null;r.preventDefault(),t.call(this,r,s)}}function VSt({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:t}){return r=>{var i,a,o;if((i=r.sourceEvent)!=null&&i.internal)return;const s=F1(r.transform);e.mouseButton=((a=r.sourceEvent)==null?void 0:a.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&n(!0),t&&(t==null||t(r.sourceEvent,s))}}function WSt({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:t,onTransformChange:r,onPanZoom:s}){return i=>{var a,o;e.usedRightMouseButton=!!(t&&xB(n,e.mouseButton??0)),(a=i.sourceEvent)!=null&&a.sync||r([i.transform.x,i.transform.y,i.transform.k]),s&&!((o=i.sourceEvent)!=null&&o.internal)&&(s==null||s(i.sourceEvent,F1(i.transform)))}}function KSt({zoomPanValues:e,panOnDrag:n,panOnScroll:t,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:i}){return a=>{var o;if(!((o=a.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,i&&xB(n,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const c=F1(a.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(a.sourceEvent,c)},t?150:0)}}}function YSt({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:t,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:o,noPanClassName:c,lib:u,connectionInProgress:_}){return f=>{var b;const p=e||n,m=t&&f.ctrlKey,x=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Bf(f,`${u}-flow__node`)||Bf(f,`${u}-flow__edge`)))return!0;if(!r&&!p&&!s&&!i&&!t||a||_&&!x||Bf(f,o)&&x||Bf(f,c)&&(!x||s&&x&&!e)||!t&&f.ctrlKey&&x)return!1;if(!t&&f.type==="touchstart"&&((b=f.touches)==null?void 0:b.length)>1)return f.preventDefault(),!1;if(!p&&!s&&!m&&x||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const S=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||x)&&S}}function XSt({domNode:e,minZoom:n,maxZoom:t,translateExtent:r,viewport:s,onPanZoom:i,onPanZoomStart:a,onPanZoomEnd:o,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=e.getBoundingClientRect(),f=VI().scaleExtent([n,t]).translateExtent(r),p=Ci(e).call(f);y({x:s.x,y:s.y,zoom:bd(s.zoom,n,t)},[[0,0],[_.width,_.height]],r);const m=p.on("wheel.zoom"),x=p.on("dblclick.zoom");f.wheelDelta(yB);async function S(I,H){return p?new Promise(U=>{f==null||f.interpolate((H==null?void 0:H.interpolate)==="linear"?Jh:jm).transform(ky(p,H==null?void 0:H.duration,H==null?void 0:H.ease,()=>U(!0)),I)}):!1}function b({noWheelClassName:I,noPanClassName:H,onPaneContextMenu:U,userSelectionActive:F,panOnScroll:Y,panOnDrag:q,panOnScrollMode:Q,panOnScrollSpeed:Z,preventScrolling:B,zoomOnPinch:D,zoomOnScroll:P,zoomOnDoubleClick:X,zoomActivationKeyPressed:W,lib:ie,onTransformChange:le,connectionInProgress:ae,paneClickDistance:se,selectionOnDrag:G}){F&&!u.isZoomingOrPanning&&v();const oe=Y&&!W&&!F;f.clickDistance(G?1/0:!ba(se)||se<0?0:se);const ce=oe?qSt({zoomPanValues:u,noWheelClassName:I,d3Selection:p,d3Zoom:f,panOnScrollMode:Q,panOnScrollSpeed:Z,zoomOnPinch:D,onPanZoomStart:a,onPanZoom:i,onPanZoomEnd:o}):GSt({noWheelClassName:I,preventScrolling:B,d3ZoomHandler:m});p.on("wheel.zoom",ce,{passive:!1});const pe=VSt({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});f.on("start",pe);const ue=WSt({zoomPanValues:u,panOnDrag:q,onPaneContextMenu:!!U,onPanZoom:i,onTransformChange:le});f.on("zoom",ue);const Ee=KSt({zoomPanValues:u,panOnDrag:q,panOnScroll:Y,onPaneContextMenu:U,onPanZoomEnd:o,onDraggingChange:c});f.on("end",Ee);const Te=YSt({zoomActivationKeyPressed:W,panOnDrag:q,zoomOnScroll:P,panOnScroll:Y,zoomOnDoubleClick:X,zoomOnPinch:D,userSelectionActive:F,noPanClassName:H,noWheelClassName:I,lib:ie,connectionInProgress:ae});f.filter(Te),X?p.on("dblclick.zoom",x):p.on("dblclick.zoom",null)}function v(){f.on("zoom",null)}async function y(I,H,U){const F=Sy(I),Y=f==null?void 0:f.constrain()(F,H,U);return Y&&await S(Y),Y}async function w(I,H){const U=Sy(I);return await S(U,H),U}function C(I){if(p){const H=Sy(I),U=p.property("__zoom");(U.k!==I.zoom||U.x!==I.x||U.y!==I.y)&&(f==null||f.transform(p,H,null,{sync:!0}))}}function z(){const I=p?GI(p.node()):{x:0,y:0,k:1};return{x:I.x,y:I.y,zoom:I.k}}async function E(I,H){return p?new Promise(U=>{f==null||f.interpolate((H==null?void 0:H.interpolate)==="linear"?Jh:jm).scaleTo(ky(p,H==null?void 0:H.duration,H==null?void 0:H.ease,()=>U(!0)),I)}):!1}async function R(I,H){return p?new Promise(U=>{f==null||f.interpolate((H==null?void 0:H.interpolate)==="linear"?Jh:jm).scaleBy(ky(p,H==null?void 0:H.duration,H==null?void 0:H.ease,()=>U(!0)),I)}):!1}function N(I){f==null||f.scaleExtent(I)}function M(I){f==null||f.translateExtent(I)}function O(I){const H=!ba(I)||I<0?0:I;f==null||f.clickDistance(H)}return{update:b,destroy:v,setViewport:w,setViewportConstrained:y,getViewport:z,scaleTo:E,scaleBy:R,setScaleExtent:N,setTranslateExtent:M,syncViewport:C,setClickDistance:O}}var xd;(function(e){e.Line="line",e.Handle="handle"})(xd||(xd={}));function ZSt({width:e,prevWidth:n,height:t,prevHeight:r,affectsX:s,affectsY:i}){const a=e-n,o=t-r,c=[a>0?1:a<0?-1:0,o>0?1:o<0?-1:0];return a&&s&&(c[0]=c[0]*-1),o&&i&&(c[1]=c[1]*-1),c}function Gz(e){const n=e.includes("right")||e.includes("left"),t=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:n,isVertical:t,affectsX:r,affectsY:s}}function Zl(e,n){return Math.max(0,n-e)}function Ql(e,n){return Math.max(0,e-n)}function sm(e,n,t){return Math.max(0,n-e,e-t)}function Vz(e,n){return e?!n:n}function QSt(e,n,t,r,s,i,a,o){let{affectsX:c,affectsY:u}=n;const{isHorizontal:_,isVertical:f}=n,p=_&&f,{xSnapped:m,ySnapped:x}=t,{minWidth:S,maxWidth:b,minHeight:v,maxHeight:y}=r,{x:w,y:C,width:z,height:E,aspectRatio:R}=e;let N=Math.floor(_?m-e.pointerX:0),M=Math.floor(f?x-e.pointerY:0);const O=z+(c?-N:N),I=E+(u?-M:M),H=-i[0]*z,U=-i[1]*E;let F=sm(O,S,b),Y=sm(I,v,y);if(a){let Z=0,B=0;c&&N<0?Z=Zl(w+N+H,a[0][0]):!c&&N>0&&(Z=Ql(w+O+H,a[1][0])),u&&M<0?B=Zl(C+M+U,a[0][1]):!u&&M>0&&(B=Ql(C+I+U,a[1][1])),F=Math.max(F,Z),Y=Math.max(Y,B)}if(o){let Z=0,B=0;c&&N>0?Z=Ql(w+N,o[0][0]):!c&&N<0&&(Z=Zl(w+O,o[1][0])),u&&M>0?B=Ql(C+M,o[0][1]):!u&&M<0&&(B=Zl(C+I,o[1][1])),F=Math.max(F,Z),Y=Math.max(Y,B)}if(s){if(_){const Z=sm(O/R,v,y)*R;if(F=Math.max(F,Z),a){let B=0;!c&&!u||c&&!u&&p?B=Ql(C+U+O/R,a[1][1])*R:B=Zl(C+U+(c?N:-N)/R,a[0][1])*R,F=Math.max(F,B)}if(o){let B=0;!c&&!u||c&&!u&&p?B=Zl(C+O/R,o[1][1])*R:B=Ql(C+(c?N:-N)/R,o[0][1])*R,F=Math.max(F,B)}}if(f){const Z=sm(I*R,S,b)/R;if(Y=Math.max(Y,Z),a){let B=0;!c&&!u||u&&!c&&p?B=Ql(w+I*R+H,a[1][0])/R:B=Zl(w+(u?M:-M)*R+H,a[0][0])/R,Y=Math.max(Y,B)}if(o){let B=0;!c&&!u||u&&!c&&p?B=Zl(w+I*R,o[1][0])/R:B=Ql(w+(u?M:-M)*R,o[0][0])/R,Y=Math.max(Y,B)}}}M=M+(M<0?Y:-Y),N=N+(N<0?F:-F),s&&(p?O>I*R?M=(Vz(c,u)?-N:N)/R:N=(Vz(c,u)?-M:M)*R:_?(M=N/R,u=c):(N=M*R,c=u));const q=c?w+N:w,Q=u?C+M:C;return{width:z+(c?-N:N),height:E+(u?-M:M),x:i[0]*N*(c?-1:1)+q,y:i[1]*M*(u?-1:1)+Q}}const wB={width:0,height:0,x:0,y:0},JSt={...wB,pointerX:0,pointerY:0,aspectRatio:1};function ekt(e,n,t){const r=n.position.x+e.position.x,s=n.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,o=t[0]*i,c=t[1]*a;return[[r-o,s-c],[r+i-o,s+a-c]]}function tkt({domNode:e,nodeId:n,getStoreItems:t,onChange:r,onEnd:s}){const i=Ci(e);let a={controlDirection:Gz("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:u,boundaries:_,keepAspectRatio:f,resizeDirection:p,onResizeStart:m,onResize:x,onResizeEnd:S,shouldResize:b}){let v={...wB},y={...JSt};a={boundaries:_,resizeDirection:p,keepAspectRatio:f,controlDirection:Gz(u)};let w,C=null,z=[],E,R,N,M=!1;const O=AI().on("start",I=>{const{nodeLookup:H,transform:U,snapGrid:F,snapToGrid:Y,nodeOrigin:q,paneDomNode:Q}=t();if(w=H.get(n),!w)return;C=(Q==null?void 0:Q.getBoundingClientRect())??null;const{xSnapped:Z,ySnapped:B}=e_(I.sourceEvent,{transform:U,snapGrid:F,snapToGrid:Y,containerBounds:C});v={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},y={...v,pointerX:Z,pointerY:B,aspectRatio:v.width/v.height},E=void 0,R=ju(w.extent)?w.extent:void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(E=H.get(w.parentId)),E&&w.extent==="parent"&&(R=[[0,0],[E.measured.width,E.measured.height]]),z=[],N=void 0;for(const[D,P]of H)if(P.parentId===n&&(z.push({id:D,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const X=ekt(P,w,P.origin??q);N?N=[[Math.min(X[0][0],N[0][0]),Math.min(X[0][1],N[0][1])],[Math.max(X[1][0],N[1][0]),Math.max(X[1][1],N[1][1])]]:N=X}m==null||m(I,{...v})}).on("drag",I=>{const{transform:H,snapGrid:U,snapToGrid:F,nodeOrigin:Y}=t(),q=e_(I.sourceEvent,{transform:H,snapGrid:U,snapToGrid:F,containerBounds:C}),Q=[];if(!w)return;const{x:Z,y:B,width:D,height:P}=v,X={},W=w.origin??Y,{width:ie,height:le,x:ae,y:se}=QSt(y,a.controlDirection,q,a.boundaries,a.keepAspectRatio,W,R,N),G=ie!==D,oe=le!==P,ce=ae!==Z&&G,pe=se!==B&&oe;if(!ce&&!pe&&!G&&!oe)return;if((ce||pe||W[0]===1||W[1]===1)&&(X.x=ce?ae:v.x,X.y=pe?se:v.y,v.x=X.x,v.y=X.y,z.length>0)){const Ie=ae-Z,Le=se-B;for(const He of z)He.position={x:He.position.x-Ie+W[0]*(ie-D),y:He.position.y-Le+W[1]*(le-P)},Q.push(He)}if((G||oe)&&(X.width=G&&(!a.resizeDirection||a.resizeDirection==="horizontal")?ie:v.width,X.height=oe&&(!a.resizeDirection||a.resizeDirection==="vertical")?le:v.height,v.width=X.width,v.height=X.height),E&&w.expandParent){const Ie=W[0]*(X.width??0);X.x&&X.x{M&&(S==null||S(I,{...v}),s==null||s({...v}),M=!1)});i.call(O)}function c(){i.on(".drag",null)}return{update:o,destroy:c}}const nkt={},Wz=e=>{let n;const t=new Set,r=(_,f)=>{const p=typeof _=="function"?_(n):_;if(!Object.is(p,n)){const m=n;n=f??(typeof p!="object"||p===null)?p:Object.assign({},n,p),t.forEach(x=>x(n,m))}},s=()=>n,c={setState:r,getState:s,getInitialState:()=>u,subscribe:_=>(t.add(_),()=>t.delete(_)),destroy:()=>{(nkt?"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."),t.clear()}},u=n=e(r,s,c);return c},rkt=e=>e?Wz(e):Wz,{useDebugValue:skt}=Xe,{useSyncExternalStoreWithSelector:ikt}=rF,akt=e=>e;function SB(e,n=akt,t){const r=ikt(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,t);return skt(r),r}const Kz=(e,n)=>{const t=rkt(e),r=(s,i=n)=>SB(t,s,i);return Object.assign(r,t),r},okt=(e,n)=>e?Kz(e,n):Kz;function ar(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[r,s]of e)if(!Object.is(s,n.get(r)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}const t=Object.keys(e);if(t.length!==Object.keys(n).length)return!1;for(const r of t)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(e[r],n[r]))return!1;return!0}const U1=T.createContext(null),lkt=U1.Provider,kB=ka.error001("react");function xn(e,n){const t=T.useContext(U1);if(t===null)throw new Error(kB);return SB(t,e,n)}function lr(){const e=T.useContext(U1);if(e===null)throw new Error(kB);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Yz={display:"none"},ckt={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},CB="react-flow__node-desc",EB="react-flow__edge-desc",ukt="react-flow__aria-live",fkt=e=>e.ariaLiveMessage,dkt=e=>e.ariaLabelConfig;function hkt({rfId:e}){const n=xn(fkt);return h.jsx("div",{id:`${ukt}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:ckt,children:n})}function _kt({rfId:e,disableKeyboardA11y:n}){const t=xn(dkt);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${CB}-${e}`,style:Yz,children:n?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${EB}-${e}`,style:Yz,children:t["edge.a11yDescription.default"]}),!n&&h.jsx(hkt,{rfId:e})]})}const q1=T.forwardRef(({position:e="top-left",children:n,className:t,style:r,...s},i)=>{const a=`${e}`.split("-");return h.jsx("div",{className:Pr(["react-flow__panel",t,...a]),style:r,ref:i,...s,children:n})});q1.displayName="Panel";const Xz="https://reactflow.dev?utm_source=attribution";function pkt({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(q1,{position:n,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Xz}`,children:h.jsx("a",{href:Xz,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const mkt=e=>{const n=[],t=[];for(const[,r]of e.nodeLookup)r.selected&&n.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&t.push(r);return{selectedNodes:n,selectedEdges:t}},im=e=>e.id;function gkt(e,n){return ar(e.selectedNodes.map(im),n.selectedNodes.map(im))&&ar(e.selectedEdges.map(im),n.selectedEdges.map(im))}function bkt({onSelectionChange:e}){const n=lr(),{selectedNodes:t,selectedEdges:r}=xn(mkt,gkt);return T.useEffect(()=>{const s={nodes:t,edges:r};e==null||e(s),n.getState().onSelectionChangeHandlers.forEach(i=>i(s))},[t,r,e]),null}const vkt=e=>!!e.onSelectionChangeHandlers;function xkt({onSelectionChange:e}){const n=xn(vkt);return e||n?h.jsx(bkt,{onSelectionChange:e}):null}const NB=[0,0],ykt={x:0,y:0,zoom:1},wkt=["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"],Zz=[...wkt,"rfId"],Skt=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}),Qz={translateExtent:L_,nodeOrigin:NB,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kkt(e){const{setNodes:n,setEdges:t,setMinZoom:r,setMaxZoom:s,setTranslateExtent:i,setNodeExtent:a,reset:o,setDefaultNodesAndEdges:c}=xn(Skt,ar),u=lr();T.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{_.current=Qz,o()}),[]);const _=T.useRef(Qz);return T.useEffect(()=>{for(const f of Zz){const p=e[f],m=_.current[f];p!==m&&(typeof e[f]>"u"||(f==="nodes"?n(p):f==="edges"?t(p):f==="minZoom"?r(p):f==="maxZoom"?s(p):f==="translateExtent"?i(p):f==="nodeExtent"?a(p):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:_St(p)}):f==="fitView"?u.setState({fitViewQueued:p}):f==="fitViewOptions"?u.setState({fitViewOptions:p}):u.setState({[f]:p})))}_.current=e},Zz.map(f=>e[f])),null}function Jz(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Ckt(e){var r;const[n,t]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){t(e);return}const s=Jz(),i=()=>t(s!=null&&s.matches?"dark":"light");return i(),s==null||s.addEventListener("change",i),()=>{s==null||s.removeEventListener("change",i)}},[e]),n!==null?n:(r=Jz())!=null&&r.matches?"dark":"light"}const ej=typeof document<"u"?document:null;function B_(e=null,n={target:ej,actInsideInputWithModifier:!0}){const[t,r]=T.useState(!1),s=T.useRef(!1),i=T.useRef(new Set([])),[a,o]=T.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",` +`).replace(` + +`,` ++`).split(` +`)),_=u.reduce((f,p)=>f.concat(...p),[]);return[u,_]}return[[],[]]},[e]);return T.useEffect(()=>{const c=(n==null?void 0:n.target)??ej,u=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const _=m=>{var b,v;if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!u)&&aB(m))return!1;const S=nj(m.code,o);if(i.current.add(m[S]),tj(a,i.current,!1)){const y=((v=(b=m.composedPath)==null?void 0:b.call(m))==null?void 0:v[0])||m.target,w=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";n.preventDefault!==!1&&(s.current||!w)&&m.preventDefault(),r(!0)}},f=m=>{const x=nj(m.code,o);tj(a,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[x]),m.key==="Meta"&&i.current.clear(),s.current=!1},p=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",_),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{c==null||c.removeEventListener("keydown",_),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,r]),t}function tj(e,n,t){return e.filter(r=>t||r.length===n.size).some(r=>r.every(s=>n.has(s)))}function nj(e,n){return n.includes(e)?"code":"key"}const Ekt=()=>{const e=lr();return T.useMemo(()=>({zoomIn:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:t}=e.getState();return t?t.scaleBy(1/1.2,n):!1},zoomTo:async(n,t)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(n,t):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,t)=>{const{transform:[r,s,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:n.x??r,y:n.y??s,zoom:n.zoom??i},t),!0):!1},getViewport:()=>{const[n,t,r]=e.getState().transform;return{x:n,y:t,zoom:r}},setCenter:async(n,t,r)=>e.getState().setCenter(n,t,r),fitBounds:async(n,t)=>{const{width:r,height:s,minZoom:i,maxZoom:a,panZoom:o}=e.getState(),c=k3(n,r,s,i,a,(t==null?void 0:t.padding)??.1);return o?(await o.setViewport(c,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),!0):!1},screenToFlowPosition:(n,t={})=>{const{transform:r,snapGrid:s,snapToGrid:i,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u={x:n.x-o,y:n.y-c},_=t.snapGrid??s,f=t.snapToGrid??i;return _0(u,r,f,_)},flowToScreenPosition:n=>{const{transform:t,domNode:r}=e.getState();if(!r)return n;const{x:s,y:i}=r.getBoundingClientRect(),a=vd(n,t);return{x:a.x+s,y:a.y+i}}}),[])};function zB(e,n){const t=[],r=new Map,s=[];for(const i of e)if(i.type==="add"){s.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const a=r.get(i.id);a?a.push(i):r.set(i.id,[i])}for(const i of n){const a=r.get(i.id);if(!a){t.push(i);continue}if(a[0].type==="remove")continue;if(a[0].type==="replace"){t.push({...a[0].item});continue}const o={...i};for(const c of a)Nkt(c,o);t.push(o)}return s.length&&s.forEach(i=>{i.index!==void 0?t.splice(i.index,0,{...i.item}):t.push({...i.item})}),t}function Nkt(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function zkt(e,n){return zB(e,n)}function jkt(e,n){return zB(e,n)}function au(e,n){return{id:e,type:"select",selected:n}}function $f(e,n=new Set,t=!1){const r=[];for(const[s,i]of e){const a=n.has(s);!(i.selected===void 0&&!a)&&i.selected!==a&&(t&&(i.selected=a),r.push(au(i.id,a)))}return r}function rj({items:e=[],lookup:n}){var s;const t=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,a]of e.entries()){const o=n.get(a.id),c=((s=o==null?void 0:o.internals)==null?void 0:s.userNode)??o;c!==void 0&&c!==a&&t.push({id:a.id,item:a,type:"replace"}),c===void 0&&t.push({item:a,type:"add",index:i})}for(const[i]of n)r.get(i)===void 0&&t.push({id:i,type:"remove"});return t}function sj(e){return{id:e.id,type:"remove"}}const Tkt=nB();function Akt(e,n,t={}){return xSt(e,n,{...t,onError:t.onError??Tkt})}const ij=e=>iSt(e),Rkt=e=>ZI(e);function jB(e){return T.forwardRef(e)}const Mkt=typeof window<"u"?T.useLayoutEffect:T.useEffect;function aj(e){const[n,t]=T.useState(BigInt(0)),[r]=T.useState(()=>Lkt(()=>t(s=>s+BigInt(1))));return Mkt(()=>{const s=r.get();s.length&&(e(s),r.reset())},[n]),r}function Lkt(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:t=>{n.push(t),e()}}}const TB=T.createContext(null);function Dkt({children:e}){const n=lr(),t=T.useCallback(o=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:_,onNodesChange:f,nodeLookup:p,fitViewQueued:m,onNodesChangeMiddlewareMap:x}=n.getState();let S=c;for(const v of o)S=typeof v=="function"?v(S):v;let b=rj({items:S,lookup:p});for(const v of x.values())b=v(b);_&&u(S),b.length>0?f==null||f(b):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:y,setNodes:w}=n.getState();v&&w(y)})},[]),r=aj(t),s=T.useCallback(o=>{const{edges:c=[],setEdges:u,hasDefaultEdges:_,onEdgesChange:f,edgeLookup:p}=n.getState();let m=c;for(const x of o)m=typeof x=="function"?x(m):x;_?u(m):f&&f(rj({items:m,lookup:p}))},[]),i=aj(s),a=T.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return h.jsx(TB.Provider,{value:a,children:e})}function Okt(){const e=T.useContext(TB);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const Ikt=e=>!!e.panZoom;function A3(){const e=Ekt(),n=lr(),t=Okt(),r=xn(Ikt),s=T.useMemo(()=>{const i=f=>n.getState().nodeLookup.get(f),a=f=>{t.nodeQueue.push(f)},o=f=>{t.edgeQueue.push(f)},c=f=>{var v,y;const{nodeLookup:p,nodeOrigin:m}=n.getState(),x=ij(f)?f:p.get(f.id),S=x.parentId?sB(x.position,x.measured,x.parentId,p,m):x.position,b={...x,position:S,width:((v=x.measured)==null?void 0:v.width)??x.width,height:((y=x.measured)==null?void 0:y.height)??x.height};return O_(b)},u=(f,p,m={replace:!1})=>{a(x=>x.map(S=>{if(S.id===f){const b=typeof p=="function"?p(S):p;return m.replace&&ij(b)?b:{...S,...b}}return S}))},_=(f,p,m={replace:!1})=>{o(x=>x.map(S=>{if(S.id===f){const b=typeof p=="function"?p(S):p;return m.replace&&Rkt(b)?b:{...S,...b}}return S}))};return{getNodes:()=>n.getState().nodes.map(f=>({...f})),getNode:f=>{var p;return(p=i(f))==null?void 0:p.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=n.getState();return f.map(p=>({...p}))},getEdge:f=>n.getState().edgeLookup.get(f),setNodes:a,setEdges:o,addNodes:f=>{const p=Array.isArray(f)?f:[f];t.nodeQueue.push(m=>[...m,...p])},addEdges:f=>{const p=Array.isArray(f)?f:[f];t.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:f=[],edges:p=[],transform:m}=n.getState(),[x,S,b]=m;return{nodes:f.map(v=>({...v})),edges:p.map(v=>({...v})),viewport:{x,y:S,zoom:b}}},deleteElements:async({nodes:f=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:S,onEdgesDelete:b,triggerNodeChanges:v,triggerEdgeChanges:y,onDelete:w,onBeforeDelete:C}=n.getState(),{nodes:z,edges:E}=await uSt({nodesToRemove:f,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:C}),R=E.length>0,N=z.length>0;if(R){const M=E.map(sj);b==null||b(E),y(M)}if(N){const M=z.map(sj);S==null||S(z),v(M)}return(N||R)&&(w==null||w({nodes:z,edges:E})),{deletedNodes:z,deletedEdges:E}},getIntersectingNodes:(f,p=!0,m)=>{const x=Lz(f),S=x?f:c(f),b=m!==void 0;return S?(m||n.getState().nodes).filter(v=>{const y=n.getState().nodeLookup.get(v.id);if(y&&!x&&(v.id===f.id||!y.internals.positionAbsolute))return!1;const w=O_(b?v:y),C=Eg(w,S);return p&&C>0||C>=w.width*w.height||C>=S.width*S.height}):[]},isNodeIntersecting:(f,p,m=!0)=>{const S=Lz(f)?f:c(f);if(!S)return!1;const b=Eg(S,p);return m&&b>0||b>=p.width*p.height||b>=S.width*S.height},updateNode:u,updateNodeData:(f,p,m={replace:!1})=>{u(f,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},updateEdge:_,updateEdgeData:(f,p,m={replace:!1})=>{_(f,x=>{const S=typeof p=="function"?p(x):p;return m.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},m)},getNodesBounds:f=>{const{nodeLookup:p,nodeOrigin:m}=n.getState();return aSt(f,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:f,id:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}-${f}${p?`-${p}`:""}`))==null?void 0:x.values())??[])},getNodeConnections:({type:f,handleId:p,nodeId:m})=>{var x;return Array.from(((x=n.getState().connectionLookup.get(`${m}${f?p?`-${f}-${p}`:`-${f}`:""}`))==null?void 0:x.values())??[])},fitView:async f=>{const p=n.getState().fitViewResolver??hSt();return n.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:p}),t.nodeQueue.push(m=>[...m]),p.promise}}},[]);return T.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const oj=e=>e.selected,Bkt=typeof window<"u"?window:void 0;function $kt({deleteKeyCode:e,multiSelectionKeyCode:n}){const t=lr(),{deleteElements:r}=A3(),s=B_(e,{actInsideInputWithModifier:!1}),i=B_(n,{target:Bkt});T.useEffect(()=>{if(s){const{edges:a,nodes:o}=t.getState();r({nodes:o.filter(oj),edges:a.filter(oj)}),t.setState({nodesSelectionActive:!1})}},[s]),T.useEffect(()=>{t.setState({multiSelectionActive:i})},[i])}function Pkt(e){const n=lr();T.useEffect(()=>{const t=()=>{var s,i,a,o;if(!e.current||!(((i=(s=e.current).checkVisibility)==null?void 0:i.call(s))??!0))return!1;const r=C3(e.current);(r.height===0||r.width===0)&&((o=(a=n.getState()).onError)==null||o.call(a,"004",ka.error004())),n.setState({width:r.width||500,height:r.height||500})};if(e.current){t(),window.addEventListener("resize",t);const r=new ResizeObserver(()=>t());return r.observe(e.current),()=>{window.removeEventListener("resize",t),r&&e.current&&r.unobserve(e.current)}}},[])}const G1={position:"absolute",width:"100%",height:"100%",top:0,left:0},Hkt=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Fkt({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:t=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:i=wu.Free,zoomOnDoubleClick:a=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:u,minZoom:_,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:S,noPanClassName:b,onViewportChange:v,isControlledViewport:y,paneClickDistance:w,selectionOnDrag:C}){const z=lr(),E=T.useRef(null),{userSelectionActive:R,lib:N,connectionInProgress:M}=xn(Hkt,ar),O=B_(p),I=T.useRef();Pkt(E);const H=T.useCallback(U=>{v==null||v({x:U[0],y:U[1],zoom:U[2]}),y||z.setState({transform:U})},[v,y]);return T.useEffect(()=>{if(E.current){I.current=XSt({domNode:E.current,minZoom:_,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:q=>z.setState(Q=>Q.paneDragging===q?Q:{paneDragging:q}),onPanZoomStart:(q,Q)=>{const{onViewportChangeStart:Z,onMoveStart:B}=z.getState();B==null||B(q,Q),Z==null||Z(Q)},onPanZoom:(q,Q)=>{const{onViewportChange:Z,onMove:B}=z.getState();B==null||B(q,Q),Z==null||Z(Q)},onPanZoomEnd:(q,Q)=>{const{onViewportChangeEnd:Z,onMoveEnd:B}=z.getState();B==null||B(q,Q),Z==null||Z(Q)}});const{x:U,y:F,zoom:Y}=I.current.getViewport();return z.setState({panZoom:I.current,transform:[U,F,Y],domNode:E.current.closest(".react-flow")}),()=>{var q;(q=I.current)==null||q.destroy()}}},[]),T.useEffect(()=>{var U;(U=I.current)==null||U.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:t,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:o,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:b,userSelectionActive:R,noWheelClassName:S,lib:N,onTransformChange:H,connectionInProgress:M,selectionOnDrag:C,paneClickDistance:w})},[e,n,t,r,s,i,a,o,O,m,b,R,S,N,H,M,C,w]),h.jsx("div",{className:"react-flow__renderer",ref:E,style:G1,children:x})}const Ukt=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qkt(){const{userSelectionActive:e,userSelectionRect:n}=xn(Ukt,ar);return e&&n?h.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const Cy=(e,n)=>t=>{t.target===n.current&&(e==null||e(t))},Gkt=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Vkt({isSelecting:e,selectionKeyPressed:n,selectionMode:t=D_.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:_,onPaneScroll:f,onPaneMouseEnter:p,onPaneMouseMove:m,onPaneMouseLeave:x,children:S}){const b=T.useRef(0),v=lr(),{userSelectionActive:y,elementsSelectable:w,dragging:C,panBy:z,autoPanSpeed:E}=xn(Gkt,ar),R=w&&(e||y),N=T.useRef(null),M=T.useRef(),O=T.useRef(new Set),I=T.useRef(new Set),H=T.useRef(!1),U=T.useRef(!1),F=T.useRef({x:0,y:0}),Y=T.useRef(!1),q=G=>{if(U.current||H.current||v.getState().connection.inProgress){U.current=!1,H.current=!1;return}u==null||u(G),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},Q=G=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){G.preventDefault();return}_==null||_(G)},Z=f?G=>f(G):void 0,B=G=>{U.current&&(G.stopPropagation(),U.current=!1)},D=G=>{var He,Tt;const{domNode:oe,transform:ce}=v.getState();if(M.current=oe==null?void 0:oe.getBoundingClientRect(),!M.current)return;const pe=G.target===N.current;if(!pe&&!!G.target.closest(".nokey")||!e||!(a&&pe||n)||G.button!==0||!G.isPrimary)return;(Tt=(He=G.target)==null?void 0:He.setPointerCapture)==null||Tt.call(He,G.pointerId),U.current=!1;const{x:Te,y:Ie}=va(G.nativeEvent,M.current),Le=_0({x:Te,y:Ie},ce);v.setState({userSelectionRect:{width:0,height:0,startX:Le.x,startY:Le.y,x:Te,y:Ie}}),pe||(G.stopPropagation(),G.preventDefault())};function P(G,oe){const{userSelectionRect:ce}=v.getState();if(!ce)return;const{transform:pe,nodeLookup:ue,edgeLookup:Ee,connectionLookup:Te,triggerNodeChanges:Ie,triggerEdgeChanges:Le,defaultEdgeOptions:He}=v.getState(),Tt={x:ce.startX,y:ce.startY},{x:Et,y:Vt}=vd(Tt,pe),$t={startX:Tt.x,startY:Tt.y,x:Gpt.id)),I.current=new Set;const ut=(He==null?void 0:He.selectable)??!0;for(const pt of O.current){const ve=Te.get(pt);if(ve)for(const{edgeId:Oe}of ve.values()){const Je=Ee.get(Oe);Je&&(Je.selectable??ut)&&I.current.add(Oe)}}if(!Dz(rt,O.current)){const pt=$f(ue,O.current,!0);Ie(pt)}if(!Dz(nt,I.current)){const pt=$f(Ee,I.current);Le(pt)}v.setState({userSelectionRect:$t,userSelectionActive:!0,nodesSelectionActive:!1})}function X(){if(!s||!M.current)return;const[G,oe]=S3(F.current,M.current,E);z({x:G,y:oe}).then(ce=>{if(!U.current||!ce){b.current=requestAnimationFrame(X);return}const{x:pe,y:ue}=F.current;P(pe,ue),b.current=requestAnimationFrame(X)})}const W=()=>{cancelAnimationFrame(b.current),b.current=0,Y.current=!1};T.useEffect(()=>()=>W(),[]);const ie=G=>{const{userSelectionRect:oe,transform:ce,resetSelectedElements:pe}=v.getState();if(!M.current||!oe)return;const{x:ue,y:Ee}=va(G.nativeEvent,M.current);F.current={x:ue,y:Ee};const Te=vd({x:oe.startX,y:oe.startY},ce);if(!U.current){const Ie=n?0:i;if(Math.hypot(ue-Te.x,Ee-Te.y)<=Ie)return;pe(),o==null||o(G)}U.current=!0,Y.current||(X(),Y.current=!0),P(ue,Ee)},le=G=>{var oe,ce;if(!R){G.target===N.current&&v.getState().connection.inProgress&&(H.current=!0);return}G.button===0&&((ce=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||ce.call(oe,G.pointerId),!y&&G.target===N.current&&v.getState().userSelectionRect&&(q==null||q(G)),v.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(c==null||c(G),v.setState({nodesSelectionActive:O.current.size>0})),W())},ae=G=>{var oe,ce;(ce=(oe=G.target)==null?void 0:oe.releasePointerCapture)==null||ce.call(oe,G.pointerId),W()},se=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Pr(["react-flow__pane",{draggable:se,dragging:C,selection:e}]),onClick:R?void 0:Cy(q,N),onContextMenu:Cy(Q,N),onWheel:Cy(Z,N),onPointerEnter:R?void 0:p,onPointerMove:R?ie:m,onPointerUp:le,onPointerCancel:R?ae:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?B:void 0,onPointerLeave:x,ref:N,style:G1,children:[S,h.jsx(qkt,{})]})}function Tw({id:e,store:n,unselect:t=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:o,onError:c}=n.getState(),u=o.get(e);if(!u){c==null||c("012",ka.error012(e));return}n.setState({nodesSelectionActive:!1}),u.selected?(t||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var _;return(_=r==null?void 0:r.current)==null?void 0:_.blur()})):s([e])}function AB({nodeRef:e,disabled:n=!1,noDragClassName:t,handleSelector:r,nodeId:s,isSelectable:i,nodeClickDistance:a}){const o=lr(),[c,u]=T.useState(!1),_=T.useRef();return T.useEffect(()=>{_.current=OSt({getStoreItems:()=>o.getState(),onNodeMouseDown:f=>{Tw({id:f,store:o,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),T.useEffect(()=>{if(!(n||!e.current||!_.current))return _.current.update({noDragClassName:t,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:s,nodeClickDistance:a}),()=>{var f;(f=_.current)==null||f.destroy()}},[t,r,n,i,e,s,a]),c}const Wkt=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function RB(){const e=lr();return T.useCallback(t=>{const{nodeExtent:r,snapToGrid:s,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:c,nodeLookup:u,nodeOrigin:_}=e.getState(),f=new Map,p=Wkt(a),m=s?i[0]:5,x=s?i[1]:5,S=t.direction.x*m*t.factor,b=t.direction.y*x*t.factor;for(const[,v]of u){if(!p(v))continue;let y={x:v.internals.positionAbsolute.x+S,y:v.internals.positionAbsolute.y+b};s&&(y=h0(y,i));const{position:w,positionAbsolute:C}=QI({nodeId:v.id,nextPosition:y,nodeLookup:u,nodeExtent:r,nodeOrigin:_,onError:o});v.position=w,v.internals.positionAbsolute=C,f.set(v.id,v)}c(f)},[])}const R3=T.createContext(null),Kkt=R3.Provider;R3.Consumer;const MB=()=>T.useContext(R3),Ykt=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),LB=T.createContext(null);function Xkt({children:e}){const n=xn(Ykt,ar);return h.jsx(LB.Provider,{value:n,children:e})}function Zkt(){const e=T.useContext(LB);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Qkt={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Jkt=(e,n,t)=>r=>{const{connectionClickStartHandle:s,connectionMode:i,connection:a}=r,{fromHandle:o,toHandle:c,isValid:u}=a;if(!o&&!s)return Qkt;const _=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===n&&(c==null?void 0:c.type)===t;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===n&&(o==null?void 0:o.type)===t,connectingTo:_,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===n&&(s==null?void 0:s.type)===t,isPossibleEndHandle:i===gd.Strict?(o==null?void 0:o.type)!==t:e!==(o==null?void 0:o.nodeId)||n!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!s,valid:_&&u}};function e7t({type:e="source",position:n=St.Top,isValidConnection:t,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:i=!0,id:a,onConnect:o,children:c,className:u,onMouseDown:_,onTouchStart:f,...p},m){var Y,q;const x=a||null,S=e==="target",b=lr(),v=MB(),{connectOnClick:y,noPanClassName:w,rfId:C}=Zkt(),{connectingFrom:z,connectingTo:E,clickConnecting:R,isPossibleEndHandle:N,connectionInProcess:M,clickConnectionInProcess:O,valid:I}=xn(Jkt(v,x,e),ar);v||(q=(Y=b.getState()).onError)==null||q.call(Y,"010",ka.error010());const H=Q=>{const{defaultEdgeOptions:Z,onConnect:B,hasDefaultEdges:D}=b.getState(),P={...Z,...Q};if(D){const{edges:X,setEdges:W,onError:ie}=b.getState();W(Akt(P,X,{onError:ie}))}B==null||B(P),o==null||o(P)},U=Q=>{if(!v)return;const Z=oB(Q.nativeEvent);if(s&&(Z&&Q.button===0||!Z)){const B=b.getState();jw.onPointerDown(Q.nativeEvent,{handleDomNode:Q.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:S,handleId:x,nodeId:v,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...D)=>{var P,X;return(X=(P=b.getState()).onConnectEnd)==null?void 0:X.call(P,...D)},updateConnection:B.updateConnection,onConnect:H,isValidConnection:t||((...D)=>{var P,X;return((X=(P=b.getState()).isValidConnection)==null?void 0:X.call(P,...D))??!0}),getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}Z?_==null||_(Q):f==null||f(Q)},F=Q=>{const{onClickConnectStart:Z,onClickConnectEnd:B,connectionClickStartHandle:D,connectionMode:P,isValidConnection:X,lib:W,rfId:ie,nodeLookup:le,connection:ae}=b.getState();if(!v||!D&&!s)return;if(!D){Z==null||Z(Q.nativeEvent,{nodeId:v,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:v,type:e,id:x}});return}const se=iB(Q.target),G=t||X,{connection:oe,isValid:ce}=jw.isValid(Q.nativeEvent,{handle:{nodeId:v,id:x,type:e},connectionMode:P,fromNodeId:D.nodeId,fromHandleId:D.id||null,fromType:D.type,isValidConnection:G,flowId:ie,doc:se,lib:W,nodeLookup:le});ce&&oe&&H(oe);const pe=structuredClone(ae);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,B==null||B(Q,pe),b.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":x,"data-nodeid":v,"data-handlepos":n,"data-id":`${C}-${v}-${x}-${e}`,className:Pr(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",w,u,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:i,clickconnecting:R,connectingfrom:z,connectingto:E,valid:I,connectionindicator:r&&(!M||N)&&(M||O?i:s)}]),onMouseDown:U,onTouchStart:U,onClick:y?F:void 0,ref:m,...p,children:c})}const bc=T.memo(jB(e7t));function t7t({data:e,isConnectable:n,sourcePosition:t=St.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(bc,{type:"source",position:t,isConnectable:n})]})}function n7t({data:e,isConnectable:n,targetPosition:t=St.Top,sourcePosition:r=St.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(bc,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label,h.jsx(bc,{type:"source",position:r,isConnectable:n})]})}function r7t(){return null}function s7t({data:e,isConnectable:n,targetPosition:t=St.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(bc,{type:"target",position:t,isConnectable:n}),e==null?void 0:e.label]})}const Ng={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lj={input:t7t,default:n7t,output:s7t,group:r7t};function i7t(e){var n,t,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((t=e.style)==null?void 0:t.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const a7t=e=>{const{width:n,height:t,x:r,y:s}=d0(e.nodeLookup,{filter:i=>!!i.selected});return{width:ba(n)?n:null,height:ba(t)?t:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function o7t({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:t}){const r=lr(),{width:s,height:i,transformString:a,userSelectionActive:o}=xn(a7t,ar),c=RB(),u=T.useRef(null);T.useEffect(()=>{var m;t||(m=u.current)==null||m.focus({preventScroll:!0})},[t]);const _=!o&&s!==null&&i!==null;if(AB({nodeRef:u,disabled:!_}),!_)return null;const f=e?m=>{const x=r.getState().nodes.filter(S=>S.selected);e(m,x)}:void 0,p=m=>{Object.prototype.hasOwnProperty.call(Ng,m.key)&&(m.preventDefault(),c({direction:Ng[m.key],factor:m.shiftKey?4:1}))};return h.jsx("div",{className:Pr(["react-flow__nodesselection","react-flow__container",n]),style:{transform:a},children:h.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:t?void 0:-1,onKeyDown:t?void 0:p,style:{width:s,height:i}})})}const cj=typeof window<"u"?window:void 0,l7t=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function DB({children:e,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:_,selectionMode:f,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:b,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:w,panOnScroll:C,panOnScrollSpeed:z,panOnScrollMode:E,zoomOnDoubleClick:R,panOnDrag:N,autoPanOnSelection:M,defaultViewport:O,translateExtent:I,minZoom:H,maxZoom:U,preventScrolling:F,onSelectionContextMenu:Y,noWheelClassName:q,noPanClassName:Q,disableKeyboardA11y:Z,onViewportChange:B,isControlledViewport:D}){const{nodesSelectionActive:P,userSelectionActive:X}=xn(l7t,ar),W=B_(u,{target:cj}),ie=B_(S,{target:cj}),le=ie||N,ae=ie||C,se=_&&le!==!0,G=W||X||se;return $kt({deleteKeyCode:c,multiSelectionKeyCode:x}),h.jsx(Fkt,{onPaneContextMenu:i,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:w,panOnScroll:ae,panOnScrollSpeed:z,panOnScrollMode:E,zoomOnDoubleClick:R,panOnDrag:!W&&le,defaultViewport:O,translateExtent:I,minZoom:H,maxZoom:U,zoomActivationKeyCode:b,preventScrolling:F,noWheelClassName:q,noPanClassName:Q,onViewportChange:B,isControlledViewport:D,paneClickDistance:o,selectionOnDrag:se,children:h.jsxs(Vkt,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:n,onPaneMouseEnter:t,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:le,autoPanOnSelection:M,isSelecting:!!G,selectionMode:f,selectionKeyPressed:W,paneClickDistance:o,selectionOnDrag:se,children:[e,P&&h.jsx(o7t,{onSelectionContextMenu:Y,noPanClassName:Q,disableKeyboardA11y:Z})]})})}DB.displayName="FlowRenderer";const c7t=T.memo(DB),u7t=e=>n=>e?w3(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(t=>t.id):Array.from(n.nodeLookup.keys());function f7t(e){return xn(T.useCallback(u7t(e),[e]),ar)}const d7t=e=>e.updateNodeInternals;function h7t(){const e=xn(d7t),[n]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const r=new Map;t.forEach(s=>{const i=s.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:s.target,force:!0})}),e(r)}));return T.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function _7t({node:e,nodeType:n,hasDimensions:t,resizeObserver:r}){const s=lr(),i=T.useRef(null),a=T.useRef(null),o=T.useRef(e.sourcePosition),c=T.useRef(e.targetPosition),u=T.useRef(n),_=t&&!!e.internals.handleBounds;return T.useEffect(()=>{i.current&&!e.hidden&&(!_||a.current!==i.current)&&(a.current&&(r==null||r.unobserve(a.current)),r==null||r.observe(i.current),a.current=i.current)},[_,e.hidden]),T.useEffect(()=>()=>{a.current&&(r==null||r.unobserve(a.current),a.current=null)},[]),T.useEffect(()=>{if(i.current){const f=u.current!==n,p=o.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||p||m)&&(u.current=n,o.current=e.sourcePosition,c.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),i}function p7t({id:e,onClick:n,onMouseEnter:t,onMouseMove:r,onMouseLeave:s,onContextMenu:i,onDoubleClick:a,nodesDraggable:o,elementsSelectable:c,nodesConnectable:u,nodesFocusable:_,resizeObserver:f,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:S,nodeTypes:b,nodeClickDistance:v,onError:y}){const{node:w,internals:C,isParent:z}=xn(G=>{const oe=G.nodeLookup.get(e),ce=G.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:ce}},ar);let E=w.type||"default",R=(b==null?void 0:b[E])||lj[E];R===void 0&&(y==null||y("003",ka.error003(E)),E="default",R=(b==null?void 0:b.default)||lj.default);const N=!!(w.draggable||o&&typeof w.draggable>"u"),M=!!(w.selectable||c&&typeof w.selectable>"u"),O=!!(w.connectable||u&&typeof w.connectable>"u"),I=!!(w.focusable||_&&typeof w.focusable>"u"),H=lr(),U=rB(w),F=_7t({node:w,nodeType:E,hasDimensions:U,resizeObserver:f}),Y=AB({nodeRef:F,disabled:w.hidden||!N,noDragClassName:p,handleSelector:w.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:v}),q=RB();if(w.hidden)return null;const Q=dl(w),Z=i7t(w),B=M||N||n||t||r||s,D=t?G=>t(G,{...C.userNode}):void 0,P=r?G=>r(G,{...C.userNode}):void 0,X=s?G=>s(G,{...C.userNode}):void 0,W=i?G=>i(G,{...C.userNode}):void 0,ie=a?G=>a(G,{...C.userNode}):void 0,le=G=>{const{selectNodesOnDrag:oe,nodeDragThreshold:ce}=H.getState();M&&(!oe||!N||ce>0)&&Tw({id:e,store:H,nodeRef:F}),n&&n(G,{...C.userNode})},ae=G=>{if(!(aB(G.nativeEvent)||x)){if(WI.includes(G.key)&&M){const oe=G.key==="Escape";Tw({id:e,store:H,unselect:oe,nodeRef:F})}else if(N&&w.selected&&Object.prototype.hasOwnProperty.call(Ng,G.key)){G.preventDefault();const{ariaLabelConfig:oe}=H.getState();H.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:G.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),q({direction:Ng[G.key],factor:G.shiftKey?4:1})}}},se=()=>{var Te;if(x||!((Te=F.current)!=null&&Te.matches(":focus-visible")))return;const{transform:G,width:oe,height:ce,autoPanOnNodeFocus:pe,setCenter:ue}=H.getState();if(!pe)return;w3(new Map([[e,w]]),{x:0,y:0,width:oe,height:ce},G,!0).length>0||ue(w.position.x+Q.width/2,w.position.y+Q.height/2,{zoom:G[2]})};return h.jsx("div",{className:Pr(["react-flow__node",`react-flow__node-${E}`,{[m]:N},w.className,{selected:w.selected,selectable:M,parent:z,draggable:N,dragging:Y}]),ref:F,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:B?"all":"none",visibility:U?"visible":"hidden",...w.style,...Z},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:D,onMouseMove:P,onMouseLeave:X,onContextMenu:W,onClick:le,onDoubleClick:ie,onKeyDown:I?ae:void 0,tabIndex:I?0:void 0,onFocus:I?se:void 0,role:w.ariaRole??(I?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${CB}-${S}`,"aria-label":w.ariaLabel,...w.domAttributes,children:h.jsx(Kkt,{value:e,children:h.jsx(R,{id:e,data:w.data,type:E,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:w.selected??!1,selectable:M,draggable:N,deletable:w.deletable??!0,isConnectable:O,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:Y,dragHandle:w.dragHandle,zIndex:C.z,parentId:w.parentId,...Q})})})}var m7t=T.memo(p7t);const g7t=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function OB(e){const{nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,onError:i}=xn(g7t,ar),a=f7t(e.onlyRenderVisibleElements),o=h7t();return h.jsx("div",{className:"react-flow__nodes",style:G1,children:a.map(c=>h.jsx(m7t,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:n,nodesConnectable:t,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}OB.displayName="NodeRenderer";const b7t=T.memo(OB);function v7t(e){return xn(T.useCallback(t=>{if(!e)return t.edges.map(s=>s.id);const r=[];if(t.width&&t.height)for(const s of t.edges){const i=t.nodeLookup.get(s.source),a=t.nodeLookup.get(s.target);i&&a&&gSt({sourceNode:i,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&r.push(s.id)}return r},[e]),ar)}const x7t=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},y7t=({color:e="none",strokeWidth:n=1})=>{const t={strokeWidth:n,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},uj={[kg.Arrow]:x7t,[kg.ArrowClosed]:y7t};function w7t(e){const n=lr();return T.useMemo(()=>{var s,i;return Object.prototype.hasOwnProperty.call(uj,e)?uj[e]:((i=(s=n.getState()).onError)==null||i.call(s,"009",ka.error009(e)),null)},[e])}const S7t=({id:e,type:n,color:t,width:r=12.5,height:s=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:o="auto-start-reverse"})=>{const c=w7t(n);return c?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:o,refX:"0",refY:"0",children:h.jsx(c,{color:t,strokeWidth:a})}):null},IB=({defaultColor:e,rfId:n})=>{const t=xn(i=>i.edges),r=xn(i=>i.defaultEdgeOptions),s=T.useMemo(()=>CSt(t,{id:n,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[t,r,n,e]);return s.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:s.map(i=>h.jsx(S7t,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};IB.displayName="MarkerDefinitions";var k7t=T.memo(IB);function BB({x:e,y:n,label:t,labelStyle:r,labelShowBg:s=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:o=2,children:c,className:u,..._}){const[f,p]=T.useState({x:1,y:0,width:0,height:0}),m=Pr(["react-flow__edge-textwrapper",u]),x=T.useRef(null);return T.useEffect(()=>{if(x.current){const S=x.current.getBBox();p({x:S.x,y:S.y,width:S.width,height:S.height})}},[t]),t?h.jsxs("g",{transform:`translate(${e-f.width/2} ${n-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",..._,children:[s&&h.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:i,rx:o,ry:o}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:x,style:r,children:t}),c]}):null}BB.displayName="EdgeText";const C7t=T.memo(BB);function V1({path:e,labelX:n,labelY:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:u=20,..._}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{..._,d:e,fill:"none",className:Pr(["react-flow__edge-path",_.className])}),u?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ba(n)&&ba(t)?h.jsx(C7t,{x:n,y:t,label:r,labelStyle:s,labelShowBg:i,labelBgStyle:a,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function fj({pos:e,x1:n,y1:t,x2:r,y2:s}){return e===St.Left||e===St.Right?[.5*(n+r),t]:[n,.5*(t+s)]}function $B({sourceX:e,sourceY:n,sourcePosition:t=St.Bottom,targetX:r,targetY:s,targetPosition:i=St.Top}){const[a,o]=fj({pos:t,x1:e,y1:n,x2:r,y2:s}),[c,u]=fj({pos:i,x1:r,y1:s,x2:e,y2:n}),[_,f,p,m]=lB({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:c,targetControlY:u});return[`M${e},${n} C${a},${o} ${c},${u} ${r},${s}`,_,f,p,m]}function PB(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a,targetPosition:o,label:c,labelStyle:u,labelShowBg:_,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:b,interactionWidth:v})=>{const[y,w,C]=$B({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o}),z=e.isInternal?void 0:n;return h.jsx(V1,{id:z,path:y,labelX:w,labelY:C,label:c,labelStyle:u,labelShowBg:_,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:b,interactionWidth:v})})}const E7t=PB({isInternal:!1}),HB=PB({isInternal:!0});E7t.displayName="SimpleBezierEdge";HB.displayName="SimpleBezierEdgeInternal";function FB(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:f,style:p,sourcePosition:m=St.Bottom,targetPosition:x=St.Top,markerEnd:S,markerStart:b,pathOptions:v,interactionWidth:y})=>{const[w,C,z]=Ew({sourceX:t,sourceY:r,sourcePosition:m,targetX:s,targetY:i,targetPosition:x,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset,stepPosition:v==null?void 0:v.stepPosition}),E=e.isInternal?void 0:n;return h.jsx(V1,{id:E,path:w,labelX:C,labelY:z,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:f,style:p,markerEnd:S,markerStart:b,interactionWidth:y})})}const UB=FB({isInternal:!1}),qB=FB({isInternal:!0});UB.displayName="SmoothStepEdge";qB.displayName="SmoothStepEdgeInternal";function GB(e){return T.memo(({id:n,...t})=>{var s;const r=e.isInternal?void 0:n;return h.jsx(UB,{...t,id:r,pathOptions:T.useMemo(()=>{var i;return{borderRadius:0,offset:(i=t.pathOptions)==null?void 0:i.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const N7t=GB({isInternal:!1}),VB=GB({isInternal:!0});N7t.displayName="StepEdge";VB.displayName="StepEdgeInternal";function WB(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:f,style:p,markerEnd:m,markerStart:x,interactionWidth:S})=>{const[b,v,y]=fB({sourceX:t,sourceY:r,targetX:s,targetY:i}),w=e.isInternal?void 0:n;return h.jsx(V1,{id:w,path:b,labelX:v,labelY:y,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:_,labelBgBorderRadius:f,style:p,markerEnd:m,markerStart:x,interactionWidth:S})})}const z7t=WB({isInternal:!1}),KB=WB({isInternal:!0});z7t.displayName="StraightEdge";KB.displayName="StraightEdgeInternal";function YB(e){return T.memo(({id:n,sourceX:t,sourceY:r,targetX:s,targetY:i,sourcePosition:a=St.Bottom,targetPosition:o=St.Top,label:c,labelStyle:u,labelShowBg:_,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:b,pathOptions:v,interactionWidth:y})=>{const[w,C,z]=cB({sourceX:t,sourceY:r,sourcePosition:a,targetX:s,targetY:i,targetPosition:o,curvature:v==null?void 0:v.curvature}),E=e.isInternal?void 0:n;return h.jsx(V1,{id:E,path:w,labelX:C,labelY:z,label:c,labelStyle:u,labelShowBg:_,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:S,markerStart:b,interactionWidth:y})})}const j7t=YB({isInternal:!1}),XB=YB({isInternal:!0});j7t.displayName="BezierEdge";XB.displayName="BezierEdgeInternal";const dj={default:XB,straight:KB,step:VB,smoothstep:qB,simplebezier:HB},hj={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},T7t=(e,n,t)=>t===St.Left?e-n:t===St.Right?e+n:e,A7t=(e,n,t)=>t===St.Top?e-n:t===St.Bottom?e+n:e,_j="react-flow__edgeupdater";function pj({position:e,centerX:n,centerY:t,radius:r=10,onMouseDown:s,onMouseEnter:i,onMouseOut:a,type:o}){return h.jsx("circle",{onMouseDown:s,onMouseEnter:i,onMouseOut:a,className:Pr([_j,`${_j}-${o}`]),cx:T7t(n,r,e),cy:A7t(t,r,e),r,stroke:"transparent",fill:"transparent"})}function R7t({isReconnectable:e,reconnectRadius:n,edge:t,sourceX:r,sourceY:s,targetX:i,targetY:a,sourcePosition:o,targetPosition:c,onReconnect:u,onReconnectStart:_,onReconnectEnd:f,setReconnecting:p,setUpdateHover:m}){const x=lr(),S=(C,z)=>{if(C.button!==0)return;const{autoPanOnConnect:E,domNode:R,connectionMode:N,connectionRadius:M,lib:O,onConnectStart:I,cancelConnection:H,nodeLookup:U,rfId:F,panBy:Y,updateConnection:q}=x.getState(),Q=z.type==="target",Z=(P,X)=>{p(!1),f==null||f(P,t,z.type,X)},B=P=>u==null?void 0:u(t,P),D=(P,X)=>{p(!0),_==null||_(C,t,z.type),I==null||I(P,X)};jw.onPointerDown(C.nativeEvent,{autoPanOnConnect:E,connectionMode:N,connectionRadius:M,domNode:R,handleId:z.id,nodeId:z.nodeId,nodeLookup:U,isTarget:Q,edgeUpdaterType:z.type,lib:O,flowId:F,cancelConnection:H,panBy:Y,isValidConnection:(...P)=>{var X,W;return((W=(X=x.getState()).isValidConnection)==null?void 0:W.call(X,...P))??!0},onConnect:B,onConnectStart:D,onConnectEnd:(...P)=>{var X,W;return(W=(X=x.getState()).onConnectEnd)==null?void 0:W.call(X,...P)},onReconnectEnd:Z,updateConnection:q,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},b=C=>S(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),v=C=>S(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),y=()=>m(!0),w=()=>m(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(pj,{position:o,centerX:r,centerY:s,radius:n,onMouseDown:b,onMouseEnter:y,onMouseOut:w,type:"source"}),(e===!0||e==="target")&&h.jsx(pj,{position:c,centerX:i,centerY:a,radius:n,onMouseDown:v,onMouseEnter:y,onMouseOut:w,type:"target"})]})}function M7t({id:e,edgesFocusable:n,edgesReconnectable:t,elementsSelectable:r,onClick:s,onDoubleClick:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,reconnectRadius:_,onReconnect:f,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:S,noPanClassName:b,onError:v,disableKeyboardA11y:y}){let w=xn(ue=>ue.edgeLookup.get(e));const C=xn(ue=>ue.defaultEdgeOptions);w=C?{...C,...w}:w;let z=w.type||"default",E=(S==null?void 0:S[z])||dj[z];E===void 0&&(v==null||v("011",ka.error011(z)),z="default",E=(S==null?void 0:S.default)||dj.default);const R=!!(w.focusable||n&&typeof w.focusable>"u"),N=typeof f<"u"&&(w.reconnectable||t&&typeof w.reconnectable>"u"),M=!!(w.selectable||r&&typeof w.selectable>"u"),O=T.useRef(null),[I,H]=T.useState(!1),[U,F]=T.useState(!1),Y=lr(),{zIndex:q=w.zIndex,sourceX:Q,sourceY:Z,targetX:B,targetY:D,sourcePosition:P,targetPosition:X}=xn(T.useCallback(ue=>{const Ee=ue.nodeLookup.get(w.source),Te=ue.nodeLookup.get(w.target);if(!Ee||!Te)return hj;const Ie=kSt({id:e,sourceNode:Ee,targetNode:Te,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:ue.connectionMode,onError:v}),Le=mSt({selected:w.selected,zIndex:w.zIndex,sourceNode:Ee,targetNode:Te,elevateOnSelect:ue.elevateEdgesOnSelect,zIndexMode:ue.zIndexMode});return{...Ie||hj,zIndex:Le}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),ar),W=T.useMemo(()=>w.markerStart?`url('#${Nw(w.markerStart,x)}')`:void 0,[w.markerStart,x]),ie=T.useMemo(()=>w.markerEnd?`url('#${Nw(w.markerEnd,x)}')`:void 0,[w.markerEnd,x]);if(w.hidden||Q===null||Z===null||B===null||D===null)return null;const le=ue=>{var Le;const{addSelectedEdges:Ee,unselectNodesAndEdges:Te,multiSelectionActive:Ie}=Y.getState();M&&(Y.setState({nodesSelectionActive:!1}),w.selected&&Ie?(Te({nodes:[],edges:[w]}),(Le=O.current)==null||Le.blur()):Ee([e])),s&&s(ue,w)},ae=i?ue=>{i(ue,{...w})}:void 0,se=a?ue=>{a(ue,{...w})}:void 0,G=o?ue=>{o(ue,{...w})}:void 0,oe=c?ue=>{c(ue,{...w})}:void 0,ce=u?ue=>{u(ue,{...w})}:void 0,pe=ue=>{var Ee;if(!y&&WI.includes(ue.key)&&M){const{unselectNodesAndEdges:Te,addSelectedEdges:Ie}=Y.getState();ue.key==="Escape"?((Ee=O.current)==null||Ee.blur(),Te({edges:[w]})):Ie([e])}};return h.jsx("svg",{style:{zIndex:q},children:h.jsxs("g",{className:Pr(["react-flow__edge",`react-flow__edge-${z}`,w.className,b,{selected:w.selected,animated:w.animated,inactive:!M&&!s,updating:I,selectable:M}]),onClick:le,onDoubleClick:ae,onContextMenu:se,onMouseEnter:G,onMouseMove:oe,onMouseLeave:ce,onKeyDown:R?pe:void 0,tabIndex:R?0:void 0,role:w.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":R?`${EB}-${x}`:void 0,ref:O,...w.domAttributes,children:[!U&&h.jsx(E,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:M,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:Q,sourceY:Z,targetX:B,targetY:D,sourcePosition:P,targetPosition:X,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:W,markerEnd:ie,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),N&&h.jsx(R7t,{edge:w,isReconnectable:N,reconnectRadius:_,onReconnect:f,onReconnectStart:p,onReconnectEnd:m,sourceX:Q,sourceY:Z,targetX:B,targetY:D,sourcePosition:P,targetPosition:X,setUpdateHover:H,setReconnecting:F})]})})}var L7t=T.memo(M7t);const D7t=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ZB({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:t,edgeTypes:r,noPanClassName:s,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:_,reconnectRadius:f,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:b,edgesReconnectable:v,elementsSelectable:y,onError:w}=xn(D7t,ar),C=v7t(n);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(k7t,{defaultColor:e,rfId:t}),C.map(z=>h.jsx(L7t,{id:z,edgesFocusable:b,edgesReconnectable:v,elementsSelectable:y,noPanClassName:s,onReconnect:i,onContextMenu:a,onMouseEnter:o,onMouseMove:c,onMouseLeave:u,onClick:_,reconnectRadius:f,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:t,onError:w,edgeTypes:r,disableKeyboardA11y:S},z))]})}ZB.displayName="EdgeRenderer";const O7t=T.memo(ZB),I7t=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function B7t({children:e}){const n=xn(I7t);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function $7t(e){const n=A3(),t=T.useRef(!1);T.useEffect(()=>{!t.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),t.current=!0)},[e,n.viewportInitialized])}const P7t=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function H7t(e){const n=xn(P7t),t=lr();return T.useEffect(()=>{e&&(n==null||n(e),t.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function F7t(e){return e.connection.inProgress?{...e.connection,to:_0(e.connection.to,e.transform)}:{...e.connection}}function U7t(e){return F7t}function q7t(e){const n=U7t();return xn(n,ar)}const G7t=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function V7t({containerStyle:e,style:n,type:t,component:r}){const{nodesConnectable:s,width:i,height:a,isValid:o,inProgress:c}=xn(G7t,ar);return!(i&&s&&c)?null:h.jsx("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Pr(["react-flow__connection",XI(o)]),children:h.jsx(QB,{style:n,type:t,CustomComponent:r,isValid:o})})})}const QB=({style:e,type:n=ec.Bezier,CustomComponent:t,isValid:r})=>{const{inProgress:s,from:i,fromNode:a,fromHandle:o,fromPosition:c,to:u,toNode:_,toHandle:f,toPosition:p,pointer:m}=q7t();if(!s)return;if(t)return h.jsx(t,{connectionLineType:n,connectionLineStyle:e,fromNode:a,fromHandle:o,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:p,connectionStatus:XI(r),toNode:_,toHandle:f,pointer:m});let x="";const S={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:p};switch(n){case ec.Bezier:[x]=cB(S);break;case ec.SimpleBezier:[x]=$B(S);break;case ec.Step:[x]=Ew({...S,borderRadius:0});break;case ec.SmoothStep:[x]=Ew(S);break;default:[x]=fB(S)}return h.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:e})};QB.displayName="ConnectionLine";const W7t={};function mj(e=W7t){T.useRef(e),lr(),T.useEffect(()=>{},[e])}function K7t(){lr(),T.useRef(!1),T.useEffect(()=>{},[])}function JB({nodeTypes:e,edgeTypes:n,onInit:t,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:_,onSelectionContextMenu:f,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:b,connectionLineContainerStyle:v,selectionKeyCode:y,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:z,panActivationKeyCode:E,zoomActivationKeyCode:R,deleteKeyCode:N,onlyRenderVisibleElements:M,elementsSelectable:O,defaultViewport:I,translateExtent:H,minZoom:U,maxZoom:F,preventScrolling:Y,defaultMarkerColor:q,zoomOnScroll:Q,zoomOnPinch:Z,panOnScroll:B,panOnScrollSpeed:D,panOnScrollMode:P,zoomOnDoubleClick:X,panOnDrag:W,autoPanOnSelection:ie,onPaneClick:le,onPaneMouseEnter:ae,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneScroll:oe,onPaneContextMenu:ce,paneClickDistance:pe,nodeClickDistance:ue,onEdgeContextMenu:Ee,onEdgeMouseEnter:Te,onEdgeMouseMove:Ie,onEdgeMouseLeave:Le,reconnectRadius:He,onReconnect:Tt,onReconnectStart:Et,onReconnectEnd:Vt,noDragClassName:$t,noWheelClassName:rt,noPanClassName:nt,disableKeyboardA11y:ut,nodeExtent:pt,rfId:ve,viewport:Oe,onViewportChange:Je}){return mj(e),mj(n),K7t(),$7t(t),H7t(Oe),h.jsx(c7t,{onPaneClick:le,onPaneMouseEnter:ae,onPaneMouseMove:se,onPaneMouseLeave:G,onPaneContextMenu:ce,onPaneScroll:oe,paneClickDistance:pe,deleteKeyCode:N,selectionKeyCode:y,selectionOnDrag:w,selectionMode:C,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:z,panActivationKeyCode:E,zoomActivationKeyCode:R,elementsSelectable:O,zoomOnScroll:Q,zoomOnPinch:Z,zoomOnDoubleClick:X,panOnScroll:B,panOnScrollSpeed:D,panOnScrollMode:P,panOnDrag:W,autoPanOnSelection:ie,defaultViewport:I,translateExtent:H,minZoom:U,maxZoom:F,onSelectionContextMenu:f,preventScrolling:Y,noDragClassName:$t,noWheelClassName:rt,noPanClassName:nt,disableKeyboardA11y:ut,onViewportChange:Je,isControlledViewport:!!Oe,children:h.jsxs(B7t,{children:[h.jsx(O7t,{edgeTypes:n,onEdgeClick:s,onEdgeDoubleClick:a,onReconnect:Tt,onReconnectStart:Et,onReconnectEnd:Vt,onlyRenderVisibleElements:M,onEdgeContextMenu:Ee,onEdgeMouseEnter:Te,onEdgeMouseMove:Ie,onEdgeMouseLeave:Le,reconnectRadius:He,defaultMarkerColor:q,noPanClassName:nt,disableKeyboardA11y:ut,rfId:ve}),h.jsx(V7t,{style:S,type:x,component:b,containerStyle:v}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(b7t,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:_,nodeClickDistance:ue,onlyRenderVisibleElements:M,noPanClassName:nt,noDragClassName:$t,disableKeyboardA11y:ut,nodeExtent:pt,rfId:ve}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}JB.displayName="GraphView";const Y7t=T.memo(JB),X7t=nB(),gj=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c=.5,maxZoom:u=2,nodeOrigin:_,nodeExtent:f,zIndexMode:p="basic"}={})=>{const m=new Map,x=new Map,S=new Map,b=new Map,v=r??n??[],y=t??e??[],w=_??[0,0],C=f??L_;_B(S,b,v);const{nodesInitialized:z}=zw(y,m,x,{nodeOrigin:w,nodeExtent:C,zIndexMode:p});let E=[0,0,1];if(a&&s&&i){const R=d0(m,{filter:I=>!!((I.width||I.initialWidth)&&(I.height||I.initialHeight))}),{x:N,y:M,zoom:O}=k3(R,s,i,c,u,(o==null?void 0:o.padding)??.1);E=[N,M,O]}return{rfId:"1",width:s??0,height:i??0,transform:E,nodes:y,nodesInitialized:z,nodeLookup:m,parentLookup:x,edges:v,edgeLookup:b,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:L_,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:gd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,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:{...YI},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:X7t,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:KI,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},Z7t=({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:_,nodeExtent:f,zIndexMode:p})=>okt((m,x)=>{async function S(){const{nodeLookup:b,panZoom:v,fitViewOptions:y,fitViewResolver:w,width:C,height:z,minZoom:E,maxZoom:R}=x();v&&(await cSt({nodes:b,width:C,height:z,panZoom:v,minZoom:E,maxZoom:R},y),w==null||w.resolve(!0),m({fitViewResolver:null}))}return{...gj({nodes:e,edges:n,width:s,height:i,fitView:a,fitViewOptions:o,minZoom:c,maxZoom:u,nodeOrigin:_,nodeExtent:f,defaultNodes:t,defaultEdges:r,zIndexMode:p}),setNodes:b=>{const{nodeLookup:v,parentLookup:y,nodeOrigin:w,elevateNodesOnSelect:C,fitViewQueued:z,zIndexMode:E,nodesSelectionActive:R}=x(),{nodesInitialized:N,hasSelectedNodes:M}=zw(b,v,y,{nodeOrigin:w,nodeExtent:f,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:E}),O=R&&M;z&&N?(S(),m({nodes:b,nodesInitialized:N,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:O})):m({nodes:b,nodesInitialized:N,nodesSelectionActive:O})},setEdges:b=>{const{connectionLookup:v,edgeLookup:y}=x();_B(v,y,b),m({edges:b})},setDefaultNodesAndEdges:(b,v)=>{if(b){const{setNodes:y}=x();y(b),m({hasDefaultNodes:!0})}if(v){const{setEdges:y}=x();y(v),m({hasDefaultEdges:!0})}},updateNodeInternals:b=>{const{triggerNodeChanges:v,nodeLookup:y,parentLookup:w,domNode:C,nodeOrigin:z,nodeExtent:E,debug:R,fitViewQueued:N,zIndexMode:M}=x(),{changes:O,updatedInternals:I}=RSt(b,y,w,C,z,E,M);I&&(zSt(y,w,{nodeOrigin:z,nodeExtent:E,zIndexMode:M}),N?(S(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(O==null?void 0:O.length)>0&&(R&&console.log("React Flow: trigger node changes",O),v==null||v(O)))},updateNodePositions:(b,v=!1)=>{const y=[];let w=[];const{nodeLookup:C,triggerNodeChanges:z,connection:E,updateConnection:R,onNodesChangeMiddlewareMap:N}=x();for(const[M,O]of b){const I=C.get(M),H=!!(I!=null&&I.expandParent&&(I!=null&&I.parentId)&&(O!=null&&O.position)),U={id:M,type:"position",position:H?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:v};if(I&&E.inProgress&&E.fromNode.id===I.id){const F=Tu(I,E.fromHandle,St.Left,!0);R({...E,from:F})}H&&I.parentId&&y.push({id:M,parentId:I.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),w.push(U)}if(y.length>0){const{parentLookup:M,nodeOrigin:O}=x(),I=T3(y,C,M,O);w.push(...I)}for(const M of N.values())w=M(w);z(w)},triggerNodeChanges:b=>{const{onNodesChange:v,setNodes:y,nodes:w,hasDefaultNodes:C,debug:z}=x();if(b!=null&&b.length){if(C){const E=zkt(b,w);y(E)}z&&console.log("React Flow: trigger node changes",b),v==null||v(b)}},triggerEdgeChanges:b=>{const{onEdgesChange:v,setEdges:y,edges:w,hasDefaultEdges:C,debug:z}=x();if(b!=null&&b.length){if(C){const E=jkt(b,w);y(E)}z&&console.log("React Flow: trigger edge changes",b),v==null||v(b)}},addSelectedNodes:b=>{const{multiSelectionActive:v,edgeLookup:y,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:z}=x();if(v){const E=b.map(R=>au(R,!0));C(E);return}C($f(w,new Set([...b]),!0)),z($f(y))},addSelectedEdges:b=>{const{multiSelectionActive:v,edgeLookup:y,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:z}=x();if(v){const E=b.map(R=>au(R,!0));z(E);return}z($f(y,new Set([...b]))),C($f(w,new Set,!0))},unselectNodesAndEdges:({nodes:b,edges:v}={})=>{const{edges:y,nodes:w,nodeLookup:C,triggerNodeChanges:z,triggerEdgeChanges:E}=x(),R=b||w,N=v||y,M=[];for(const I of R){if(!I.selected)continue;const H=C.get(I.id);H&&(H.selected=!1),M.push(au(I.id,!1))}const O=[];for(const I of N)I.selected&&O.push(au(I.id,!1));z(M),E(O)},setMinZoom:b=>{const{panZoom:v,maxZoom:y}=x();v==null||v.setScaleExtent([b,y]),m({minZoom:b})},setMaxZoom:b=>{const{panZoom:v,minZoom:y}=x();v==null||v.setScaleExtent([y,b]),m({maxZoom:b})},setTranslateExtent:b=>{var v;(v=x().panZoom)==null||v.setTranslateExtent(b),m({translateExtent:b})},resetSelectedElements:()=>{const{edges:b,nodes:v,triggerNodeChanges:y,triggerEdgeChanges:w,elementsSelectable:C}=x();if(!C)return;const z=v.reduce((R,N)=>N.selected?[...R,au(N.id,!1)]:R,[]),E=b.reduce((R,N)=>N.selected?[...R,au(N.id,!1)]:R,[]);y(z),w(E)},setNodeExtent:b=>{const{nodes:v,nodeLookup:y,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:z,nodeExtent:E,zIndexMode:R}=x();b[0][0]===E[0][0]&&b[0][1]===E[0][1]&&b[1][0]===E[1][0]&&b[1][1]===E[1][1]||(zw(v,y,w,{nodeOrigin:C,nodeExtent:b,elevateNodesOnSelect:z,checkEquality:!1,zIndexMode:R}),m({nodeExtent:b}))},panBy:b=>{const{transform:v,width:y,height:w,panZoom:C,translateExtent:z}=x();return MSt({delta:b,panZoom:C,transform:v,translateExtent:z,width:y,height:w})},setCenter:async(b,v,y)=>{const{width:w,height:C,maxZoom:z,panZoom:E}=x();if(!E)return!1;const R=typeof(y==null?void 0:y.zoom)<"u"?y.zoom:z;return await E.setViewport({x:w/2-b*R,y:C/2-v*R,zoom:R},{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),!0},cancelConnection:()=>{m({connection:{...YI}})},updateConnection:b=>{m({connection:b})},reset:()=>m({...gj()})}},Object.is);function Q7t({initialNodes:e,initialEdges:n,defaultNodes:t,defaultEdges:r,initialWidth:s,initialHeight:i,initialMinZoom:a,initialMaxZoom:o,initialFitViewOptions:c,fitView:u,nodeOrigin:_,nodeExtent:f,zIndexMode:p,children:m}){const[x]=T.useState(()=>Z7t({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,width:s,height:i,fitView:u,minZoom:a,maxZoom:o,fitViewOptions:c,nodeOrigin:_,nodeExtent:f,zIndexMode:p}));return h.jsx(lkt,{value:x,children:h.jsx(Dkt,{children:h.jsx(Xkt,{children:m})})})}function J7t({children:e,nodes:n,edges:t,defaultNodes:r,defaultEdges:s,width:i,height:a,fitView:o,fitViewOptions:c,minZoom:u,maxZoom:_,nodeOrigin:f,nodeExtent:p,zIndexMode:m}){return T.useContext(U1)?h.jsx(h.Fragment,{children:e}):h.jsx(Q7t,{initialNodes:n,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:i,initialHeight:a,fitView:o,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:_,nodeOrigin:f,nodeExtent:p,zIndexMode:m,children:e})}const e8t={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function t8t({nodes:e,edges:n,defaultNodes:t,defaultEdges:r,className:s,nodeTypes:i,edgeTypes:a,onNodeClick:o,onEdgeClick:c,onInit:u,onMove:_,onMoveStart:f,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:b,onClickConnectEnd:v,onNodeMouseEnter:y,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:E,onNodeDragStart:R,onNodeDrag:N,onNodeDragStop:M,onNodesDelete:O,onEdgesDelete:I,onDelete:H,onSelectionChange:U,onSelectionDragStart:F,onSelectionDrag:Y,onSelectionDragStop:q,onSelectionContextMenu:Q,onSelectionStart:Z,onSelectionEnd:B,onBeforeDelete:D,connectionMode:P,connectionLineType:X=ec.Bezier,connectionLineStyle:W,connectionLineComponent:ie,connectionLineContainerStyle:le,deleteKeyCode:ae="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:G=!1,selectionMode:oe=D_.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:pe=I_()?"Meta":"Control",zoomActivationKeyCode:ue=I_()?"Meta":"Control",snapToGrid:Ee,snapGrid:Te,onlyRenderVisibleElements:Ie=!1,selectNodesOnDrag:Le,nodesDraggable:He,autoPanOnNodeFocus:Tt,nodesConnectable:Et,nodesFocusable:Vt,nodeOrigin:$t=NB,edgesFocusable:rt,edgesReconnectable:nt,elementsSelectable:ut=!0,defaultViewport:pt=ykt,minZoom:ve=.5,maxZoom:Oe=2,translateExtent:Je=L_,preventScrolling:ft=!0,nodeExtent:mt,defaultMarkerColor:Ht="#b1b1b7",zoomOnScroll:Fe=!0,zoomOnPinch:Pt=!0,panOnScroll:Jt=!1,panOnScrollSpeed:nn=.5,panOnScrollMode:Lt=wu.Free,zoomOnDoubleClick:Rn=!0,panOnDrag:Kt=!0,onPaneClick:Gn,onPaneMouseEnter:cr,onPaneMouseMove:vn,onPaneMouseLeave:wr,onPaneScroll:Qn,onPaneContextMenu:Wn,paneClickDistance:Mn=1,nodeClickDistance:gt=0,children:an,onReconnect:Ge,onReconnectStart:at,onReconnectEnd:rn,onEdgeContextMenu:Nt,onEdgeDoubleClick:on,onEdgeMouseEnter:Qe,onEdgeMouseMove:bt,onEdgeMouseLeave:ln,reconnectRadius:Sr=10,onNodesChange:yn,onEdgesChange:dt,noDragClassName:Ct="nodrag",noWheelClassName:_n="nowheel",noPanClassName:hr="nopan",fitView:ls,fitViewOptions:Hr,connectOnClick:Ms,attributionPosition:ts,proOptions:Ls,defaultEdgeOptions:Fr,elevateNodesOnSelect:ns=!0,elevateEdgesOnSelect:cs=!1,disableKeyboardA11y:Ds=!1,autoPanOnConnect:Zt,autoPanOnNodeDrag:Pn,autoPanOnSelection:rs=!0,autoPanSpeed:tt,connectionRadius:At,isValidConnection:ss,onError:Ur,style:Ks,id:ur,nodeDragThreshold:xs,connectionDragThreshold:qr,viewport:za,onViewportChange:Cn,width:On,height:Gr,colorMode:zr="light",debug:Ut,onScroll:ci,ariaLabelConfig:Ii,zIndexMode:Vr="basic",..._r},go){const us=ur||"1",sa=Ckt(zr),Os=T.useCallback(ja=>{ja.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ci==null||ci(ja)},[ci]);return h.jsx("div",{"data-testid":"rf__wrapper",..._r,onScroll:Os,style:{...Ks,...e8t},ref:go,className:Pr(["react-flow",s,sa]),id:ur,role:"application",children:h.jsxs(J7t,{nodes:e,edges:n,width:On,height:Gr,fitView:ls,fitViewOptions:Hr,minZoom:ve,maxZoom:Oe,nodeOrigin:$t,nodeExtent:mt,zIndexMode:Vr,children:[h.jsx(kkt,{nodes:e,edges:n,defaultNodes:t,defaultEdges:r,onConnect:m,onConnectStart:x,onConnectEnd:S,onClickConnectStart:b,onClickConnectEnd:v,nodesDraggable:He,autoPanOnNodeFocus:Tt,nodesConnectable:Et,nodesFocusable:Vt,edgesFocusable:rt,edgesReconnectable:nt,elementsSelectable:ut,elevateNodesOnSelect:ns,elevateEdgesOnSelect:cs,minZoom:ve,maxZoom:Oe,nodeExtent:mt,onNodesChange:yn,onEdgesChange:dt,snapToGrid:Ee,snapGrid:Te,connectionMode:P,translateExtent:Je,connectOnClick:Ms,defaultEdgeOptions:Fr,fitView:ls,fitViewOptions:Hr,onNodesDelete:O,onEdgesDelete:I,onDelete:H,onNodeDragStart:R,onNodeDrag:N,onNodeDragStop:M,onSelectionDrag:Y,onSelectionDragStart:F,onSelectionDragStop:q,onMove:_,onMoveStart:f,onMoveEnd:p,noPanClassName:hr,nodeOrigin:$t,rfId:us,autoPanOnConnect:Zt,autoPanOnNodeDrag:Pn,autoPanSpeed:tt,onError:Ur,connectionRadius:At,isValidConnection:ss,selectNodesOnDrag:Le,nodeDragThreshold:xs,connectionDragThreshold:qr,onBeforeDelete:D,debug:Ut,ariaLabelConfig:Ii,zIndexMode:Vr}),h.jsx(Y7t,{onInit:u,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:z,onNodeDoubleClick:E,nodeTypes:i,edgeTypes:a,connectionLineType:X,connectionLineStyle:W,connectionLineComponent:ie,connectionLineContainerStyle:le,selectionKeyCode:se,selectionOnDrag:G,selectionMode:oe,deleteKeyCode:ae,multiSelectionKeyCode:pe,panActivationKeyCode:ce,zoomActivationKeyCode:ue,onlyRenderVisibleElements:Ie,defaultViewport:pt,translateExtent:Je,minZoom:ve,maxZoom:Oe,preventScrolling:ft,zoomOnScroll:Fe,zoomOnPinch:Pt,zoomOnDoubleClick:Rn,panOnScroll:Jt,panOnScrollSpeed:nn,panOnScrollMode:Lt,panOnDrag:Kt,autoPanOnSelection:rs,onPaneClick:Gn,onPaneMouseEnter:cr,onPaneMouseMove:vn,onPaneMouseLeave:wr,onPaneScroll:Qn,onPaneContextMenu:Wn,paneClickDistance:Mn,nodeClickDistance:gt,onSelectionContextMenu:Q,onSelectionStart:Z,onSelectionEnd:B,onReconnect:Ge,onReconnectStart:at,onReconnectEnd:rn,onEdgeContextMenu:Nt,onEdgeDoubleClick:on,onEdgeMouseEnter:Qe,onEdgeMouseMove:bt,onEdgeMouseLeave:ln,reconnectRadius:Sr,defaultMarkerColor:Ht,noDragClassName:Ct,noWheelClassName:_n,noPanClassName:hr,rfId:us,disableKeyboardA11y:Ds,nodeExtent:mt,viewport:za,onViewportChange:Cn}),h.jsx(xkt,{onSelectionChange:U}),an,h.jsx(pkt,{proOptions:Ls,position:ts}),h.jsx(_kt,{rfId:us,disableKeyboardA11y:Ds})]})})}var n8t=jB(t8t);function r8t({dimensions:e,lineWidth:n,variant:t,className:r}){return h.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Pr(["react-flow__background-pattern",t,r])})}function s8t({radius:e,className:n}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Pr(["react-flow__background-pattern","dots",n])})}var nl;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(nl||(nl={}));const i8t={[nl.Dots]:1,[nl.Lines]:1,[nl.Cross]:6},a8t=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function e$({id:e,variant:n=nl.Dots,gap:t=20,size:r,lineWidth:s=1,offset:i=0,color:a,bgColor:o,style:c,className:u,patternClassName:_}){const f=T.useRef(null),{transform:p,patternId:m}=xn(a8t,ar),x=r||i8t[n],S=n===nl.Dots,b=n===nl.Cross,v=Array.isArray(t)?t:[t,t],y=[v[0]*p[2]||1,v[1]*p[2]||1],w=x*p[2],C=Array.isArray(i)?i:[i,i],z=b?[w,w]:y,E=[C[0]*p[2]||1+z[0]/2,C[1]*p[2]||1+z[1]/2],R=`${m}${e||""}`;return h.jsxs("svg",{className:Pr(["react-flow__background",u]),style:{...c,...G1,"--xy-background-color-props":o,"--xy-background-pattern-color-props":a},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:R,x:p[0]%y[0],y:p[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:S?h.jsx(s8t,{radius:w/2,className:_}):h.jsx(r8t,{dimensions:z,lineWidth:s,variant:n,className:_})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}e$.displayName="Background";const o8t=T.memo(e$);function l8t(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function c8t(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function u8t(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 f8t(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 d8t(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 am({children:e,className:n,...t}){return h.jsx("button",{type:"button",className:Pr(["react-flow__controls-button",n]),...t,children:e})}const h8t=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function t$({style:e,showZoom:n=!0,showFitView:t=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:i,onZoomOut:a,onFitView:o,onInteractiveChange:c,className:u,children:_,position:f="bottom-left",orientation:p="vertical","aria-label":m}){const x=lr(),{isInteractive:S,minZoomReached:b,maxZoomReached:v,ariaLabelConfig:y}=xn(h8t,ar),{zoomIn:w,zoomOut:C,fitView:z}=A3(),E=()=>{w(),i==null||i()},R=()=>{C(),a==null||a()},N=()=>{z(s),o==null||o()},M=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),c==null||c(!S)},O=p==="horizontal"?"horizontal":"vertical";return h.jsxs(q1,{className:Pr(["react-flow__controls",O,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??y["controls.ariaLabel"],children:[n&&h.jsxs(h.Fragment,{children:[h.jsx(am,{onClick:E,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:v,children:h.jsx(l8t,{})}),h.jsx(am,{onClick:R,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:b,children:h.jsx(c8t,{})})]}),t&&h.jsx(am,{className:"react-flow__controls-fitview",onClick:N,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:h.jsx(u8t,{})}),r&&h.jsx(am,{className:"react-flow__controls-interactive",onClick:M,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:S?h.jsx(d8t,{}):h.jsx(f8t,{})}),_]})}t$.displayName="Controls";T.memo(t$);function _8t({id:e,x:n,y:t,width:r,height:s,style:i,color:a,strokeColor:o,strokeWidth:c,className:u,borderRadius:_,shapeRendering:f,selected:p,onClick:m}){const{background:x,backgroundColor:S}=i||{},b=a||x||S;return h.jsx("rect",{className:Pr(["react-flow__minimap-node",{selected:p},u]),x:n,y:t,rx:_,ry:_,width:r,height:s,style:{fill:b,stroke:o,strokeWidth:c},shapeRendering:f,onClick:m?v=>m(v,e):void 0})}const p8t=T.memo(_8t),m8t=e=>e.nodes.map(n=>n.id),Ey=e=>e instanceof Function?e:()=>e;function g8t({nodeStrokeColor:e,nodeColor:n,nodeClassName:t="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:i=p8t,onClick:a}){const o=xn(m8t,ar),c=Ey(n),u=Ey(e),_=Ey(t),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:o.map(p=>h.jsx(v8t,{id:p,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:_,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:i,onClick:a,shapeRendering:f},p))})}function b8t({id:e,nodeColorFunc:n,nodeStrokeColorFunc:t,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:o,onClick:c}){const{node:u,x:_,y:f,width:p,height:m}=xn(x=>{const S=x.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const b=S.internals.userNode,{x:v,y}=S.internals.positionAbsolute,{width:w,height:C}=dl(b);return{node:b,x:v,y,width:w,height:C}},ar);return!u||u.hidden||!rB(u)?null:h.jsx(o,{x:_,y:f,width:p,height:m,style:u.style,selected:!!u.selected,className:r(u),color:n(u),borderRadius:s,strokeColor:t(u),strokeWidth:i,shapeRendering:a,onClick:c,id:u.id})}const v8t=T.memo(b8t);var x8t=T.memo(g8t);const y8t=200,w8t=150,S8t=e=>!e.hidden,k8t=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?eB(d0(e.nodeLookup,{filter:S8t}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},C8t="react-flow__minimap-desc";function n$({style:e,className:n,nodeStrokeColor:t,nodeColor:r,nodeClassName:s="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:o,bgColor:c,maskColor:u,maskStrokeColor:_,maskStrokeWidth:f,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:S=!1,zoomable:b=!1,ariaLabel:v,inversePan:y,zoomStep:w=1,offsetScale:C=5}){const z=lr(),E=T.useRef(null),{boundingRect:R,viewBB:N,rfId:M,panZoom:O,translateExtent:I,flowWidth:H,flowHeight:U,ariaLabelConfig:F}=xn(k8t,ar),Y=(e==null?void 0:e.width)??y8t,q=(e==null?void 0:e.height)??w8t,Q=R.width/Y,Z=R.height/q,B=Math.max(Q,Z),D=B*Y,P=B*q,X=C*B,W=R.x-(D-R.width)/2-X,ie=R.y-(P-R.height)/2-X,le=D+X*2,ae=P+X*2,se=`${C8t}-${M}`,G=T.useRef(0),oe=T.useRef();G.current=B,T.useEffect(()=>{if(E.current&&O)return oe.current=FSt({domNode:E.current,panZoom:O,getTransform:()=>z.getState().transform,getViewScale:()=>G.current}),()=>{var Ee;(Ee=oe.current)==null||Ee.destroy()}},[O]),T.useEffect(()=>{var Ee;(Ee=oe.current)==null||Ee.update({translateExtent:I,width:H,height:U,inversePan:y,pannable:S,zoomStep:w,zoomable:b})},[S,b,y,w,I,H,U]);const ce=m?Ee=>{var Le;const[Te,Ie]=((Le=oe.current)==null?void 0:Le.pointer(Ee))||[0,0];m(Ee,{x:Te,y:Ie})}:void 0,pe=x?T.useCallback((Ee,Te)=>{const Ie=z.getState().nodeLookup.get(Te).internals.userNode;x(Ee,Ie)},[]):void 0,ue=v??F["minimap.ariaLabel"];return h.jsx(q1,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*B:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof a=="number"?a:void 0},className:Pr(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:Y,height:q,viewBox:`${W} ${ie} ${le} ${ae}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:E,onClick:ce,children:[ue&&h.jsx("title",{id:se,children:ue}),h.jsx(x8t,{onClick:pe,nodeColor:r,nodeStrokeColor:t,nodeBorderRadius:i,nodeClassName:s,nodeStrokeWidth:a,nodeComponent:o}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-X},${ie-X}h${le+X*2}v${ae+X*2}h${-le-X*2}z + M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}n$.displayName="MiniMap";T.memo(n$);const E8t=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,N8t={[xd.Line]:"right",[xd.Handle]:"bottom-right"};function z8t({nodeId:e,position:n,variant:t=xd.Handle,className:r,style:s=void 0,children:i,color:a,minWidth:o=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:S,onResize:b,onResizeEnd:v}){const y=MB(),w=typeof e=="string"?e:y,C=lr(),z=T.useRef(null),E=t===xd.Handle,R=xn(T.useCallback(E8t(E&&m),[E,m]),ar),N=T.useRef(null),M=n??N8t[t];T.useEffect(()=>{if(!(!z.current||!w))return N.current||(N.current=tkt({domNode:z.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:I,transform:H,snapGrid:U,snapToGrid:F,nodeOrigin:Y,domNode:q}=C.getState();return{nodeLookup:I,transform:H,snapGrid:U,snapToGrid:F,nodeOrigin:Y,paneDomNode:q}},onChange:(I,H)=>{const{triggerNodeChanges:U,nodeLookup:F,parentLookup:Y,nodeOrigin:q}=C.getState(),Q=[],Z={x:I.x,y:I.y},B=F.get(w);if(B&&B.expandParent&&B.parentId){const D=B.origin??q,P=I.width??B.measured.width??0,X=I.height??B.measured.height??0,W={id:B.id,parentId:B.parentId,rect:{width:P,height:X,...sB({x:I.x??B.position.x,y:I.y??B.position.y},{width:P,height:X},B.parentId,F,D)}},ie=T3([W],F,Y,q);Q.push(...ie),Z.x=I.x?Math.max(D[0]*P,I.x):void 0,Z.y=I.y?Math.max(D[1]*X,I.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const D={id:w,type:"position",position:{...Z}};Q.push(D)}if(I.width!==void 0&&I.height!==void 0){const P={id:w,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:I.width,height:I.height}};Q.push(P)}for(const D of H){const P={...D,type:"position"};Q.push(P)}U(Q)},onEnd:({width:I,height:H})=>{const U={id:w,type:"dimensions",resizing:!1,dimensions:{width:I,height:H}};C.getState().triggerNodeChanges([U])}})),N.current.update({controlPosition:M,boundaries:{minWidth:o,minHeight:c,maxWidth:u,maxHeight:_},keepAspectRatio:f,resizeDirection:p,onResizeStart:S,onResize:b,onResizeEnd:v,shouldResize:x}),()=>{var I;(I=N.current)==null||I.destroy()}},[M,o,c,u,_,f,S,b,v,x]);const O=M.split("-");return h.jsx("div",{className:Pr(["react-flow__resize-control","nodrag",...O,t,r]),ref:z,style:{...s,scale:R,...a&&{[E?"backgroundColor":"borderColor"]:a}},children:i})}T.memo(z8t);function j8t(){const[e,n]=T.useState(0),[t,r]=T.useState(0);return{ref:T.useCallback(i=>{if(!i)return;function a(){n(i.offsetWidth),r(i.offsetHeight)}const o=new ResizeObserver(a),c=new MutationObserver(a);return o.observe(i),c.observe(i,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),a(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:t}}const om=8;function T8t(e,n){const{offsetWidth:t,offsetHeight:r}=n,[{viewHeight:s,viewWidth:i},a]=T.useState({viewWidth:0,viewHeight:0});T.useEffect(()=>{function _(){a({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",_),_(),()=>window.removeEventListener("resize",_)},[]);let o=0,c=0,u=0;if(e){const{distance:_}=e;switch(e.anchor){case"left":o=e.x-t-_,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+_,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-t/2,c=e.y+e.height+_;break;case"above":o=e.x+e.width/2-t/2,c=e.y-r-_;break}const f=o,p=c;o=Math.min(Math.max(o,om),i-t-om),c=Math.min(Math.max(c,om),s-r-om),u=e.anchor==="left"||e.anchor==="right"?p-c:f-o}return{x:o,y:c,arrowAdjustment:u}}const Ny=380,zy=12,A8t=350,R8t=150,Aw=new EventTarget;function M8t(){Aw.dispatchEvent(new Event("move"))}function L8t(e,n){const[t,r]=T.useState(null),s=T.useRef(void 0),i=T.useRef(void 0);T.useEffect(()=>{const u=()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),r(null)};return Aw.addEventListener("move",u),()=>{Aw.removeEventListener("move",u),window.clearTimeout(s.current),window.clearTimeout(i.current)}},[]),T.useEffect(()=>{r(u=>{var f;if(!u)return u;const _=((f=e.current)==null?void 0:f.getBoundingClientRect())??null;return _&&u.x===_.x&&u.y===_.y&&u.width===_.width&&u.height===_.height?u:_})},[e,n]);const a=T.useCallback(()=>{window.clearTimeout(i.current),window.clearTimeout(s.current),s.current=window.setTimeout(()=>{var u;r(((u=e.current)==null?void 0:u.getBoundingClientRect())??null)},A8t)},[e]),o=T.useCallback(()=>{window.clearTimeout(s.current),window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(null),R8t)},[]),c=T.useCallback(()=>window.clearTimeout(i.current),[]);return{rect:t,onMouseEnter:a,onMouseLeave:o,keepOpen:c}}function D8t(e){const n=new Date(e),t=n.getFullYear()===new Date().getFullYear()?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"};return n.toLocaleDateString(j(),t)}function O8t({exp:e,runs:n,latestRun:t,parentSlug:r,anchor:s,onOpenLogs:i,onOpenCode:a,onMouseEnter:o,onMouseLeave:c}){const u=j8t(),_=s.right+zy+Ny<=window.innerWidth,f=s.x-zy-Ny>=0,p=_?"right":f?"left":s.y>window.innerHeight/2?"above":"below",{x:m,y:x}=T8t({x:s.x,y:s.y,width:s.width,height:s.height,anchor:p,distance:zy},u),[S,b]=T.useState(null),v=e.parentExperimentId&&(t!=null&&t.commitSha)?t.id:null;T.useEffect(()=>{if(b(null),!v)return;let I=!1;return Jtt(v).then(H=>{let U=H.diff;if(H.truncated){const Q=U.lastIndexOf(` +diff --git `);U=Q!==-1?U.slice(0,Q+1):U.slice(0,U.lastIndexOf(` +`)+1)}let F=[];try{F=U.trim()?rw(U):[]}catch{return}if(H.truncated&&F.every(Q=>Q.hunks.length===0))return;let Y=0,q=0;for(const Q of F){const Z=f3(Q);Y+=Z.additions,q+=Z.deletions}I||b({fileCount:F.length,additions:Y,deletions:q,truncated:H.truncated})}).catch(()=>{}),()=>{I=!0}},[v]);const y={done:0,failed:0,cancelled:0,live:0};for(const I of n)I.status==="done"?y.done+=1:I.status==="failed"?y.failed+=1:I.status==="cancelled"?y.cancelled+=1:y.live+=1;const w=t?Xm((t.endedAt??Date.now())-t.createdAt):null,C=(t==null?void 0:t.status)==="failed"&&t.resultMarkdown?t.resultMarkdown:null,z=e.description||(C?null:t==null?void 0:t.resultMarkdown)||null,E=T.useRef(null),[R,N]=T.useState(!1),[M,O]=T.useState(!1);return T.useEffect(()=>{N(!1)},[z]),T.useEffect(()=>{const I=E.current;I&&O(I.scrollHeight>I.clientHeight+1)},[z,R]),al.createPortal(h.jsxs("div",{ref:u.ref,className:"exp-hover-card fixed z-60 bg-background border border-border rounded-lg shadow-menu py-3.5 px-4 text-sm text-text [&_.hc-head]:flex [&_.hc-head]:items-baseline [&_.hc-head]:justify-between [&_.hc-head]:gap-2.5 [&_.hc-slug]:text-sm [&_.hc-slug]:font-semibold [&_.hc-slug]:min-w-0 [&_.hc-slug]:overflow-hidden [&_.hc-slug]:text-ellipsis [&_.hc-slug]:whitespace-nowrap [&_.hc-title]:mt-[3px] [&_.hc-title]:text-text [&_.hc-actions]:flex [&_.hc-actions]:items-center [&_.hc-actions]:gap-1.5 [&_.hc-actions]:mt-2.5 [&_.hc-actions_button]:inline-flex [&_.hc-actions_button]:items-center [&_.hc-actions_button]:justify-center [&_.hc-actions_button]:gap-[5px] [&_.hc-actions_button]:min-w-21 [&_.hc-actions_button]:py-1.5 [&_.hc-actions_button]:px-2.5 [&_.hc-actions_button]:border [&_.hc-actions_button]:border-border [&_.hc-actions_button]:rounded-md [&_.hc-actions_button]:bg-background [&_.hc-actions_button]:text-text [&_.hc-actions_button]:text-sm [&_.hc-actions_button]:font-medium [&_.hc-actions_button:hover]:border-border-hover-strong [&_.hc-actions_button:hover]:bg-canvas [&_.hc-body]:mt-2.5 [&_.hc-body]:border-t [&_.hc-body]:border-t-border-variant [&_.hc-body]:pt-2.5 [&_.hc-body]:leading-[1.6] [&_.hc-body]:whitespace-pre-line [&_.hc-body]:line-clamp-10 [&_.hc-body.expanded]:block [&_.hc-body.expanded]:line-clamp-none [&_.hc-body.expanded]:max-h-[45vh] [&_.hc-body.expanded]:overflow-y-auto [&_.hc-body.expanded]:overflow-x-hidden [&_.hc-body.expanded]:pb-1 [&_.hc-toggle]:mt-1 [&_.hc-toggle]:text-sm [&_.hc-toggle]:font-medium [&_.hc-toggle]:text-muted [&_.hc-toggle:hover]:text-text [&_.hc-failure]:mt-2 [&_.hc-failure]:text-accent-red [&_.hc-failure]:line-clamp-3 [&_.hc-stats]:mt-2.5 [&_.hc-stats]:border-t [&_.hc-stats]:border-t-border-variant [&_.hc-stats]:pt-2.5 [&_.hc-stats]:flex [&_.hc-stats]:items-center [&_.hc-stats]:gap-3 [&_.hc-stats]:flex-wrap [&_.hc-stats]:text-xs [&_.hc-stats]:text-text [&_.hc-git]:mt-2.5 [&_.hc-git]:pt-2 [&_.hc-git]:border-t [&_.hc-git]:border-t-border-variant [&_.hc-git]:text-xs [&_.hc-git]:text-text [&_.hc-git]:flex [&_.hc-git]:flex-col [&_.hc-git]:gap-1 [&_.hc-git-row]:flex [&_.hc-git-row]:items-center [&_.hc-git-row]:gap-2.5 [&_.hc-git-row]:flex-wrap [&_.hc-git-row]:min-w-0 [&_.hc-branch]:inline-flex [&_.hc-branch]:items-center [&_.hc-branch]:gap-1 [&_.hc-branch]:min-w-0 [&_.hc-branch]:overflow-hidden [&_.hc-branch]:text-ellipsis [&_.hc-branch]:whitespace-nowrap [&_.hc-foot]:mt-2 [&_.hc-foot]:flex [&_.hc-foot]:items-center [&_.hc-foot]:justify-between [&_.hc-foot]:gap-2.5 [&_.hc-foot]:text-xs [&_.hc-foot]:text-muted [&_.hc-foot_.hc-command]:min-w-0 [&_.hc-foot_.hc-command]:overflow-hidden [&_.hc-foot_.hc-command]:text-ellipsis [&_.hc-foot_.hc-command]:whitespace-nowrap",style:{width:Ny,left:m,top:x,visibility:u.offsetHeight===0?"hidden":void 0},onMouseEnter:o,onMouseLeave:c,children:[h.jsxs("div",{className:"hc-head",children:[h.jsx("span",{className:"hc-slug",children:e.slug}),h.jsx(tl,{status:t?ea(t):"idle"})]}),e.title&&h.jsx("div",{className:"hc-title",children:e.title}),h.jsxs("div",{className:"hc-actions",children:[i&&h.jsxs("button",{type:"button",...Nr(i),children:[h.jsx(sd,{size:13}),e_e()]}),h.jsxs("button",{type:"button",...Nr(a),children:[h.jsx(Vg,{size:13}),Fhe()]})]}),z&&h.jsx("div",{className:`hc-body${R?" expanded":""}`,ref:E,children:z}),z&&(M||R)&&h.jsx("button",{type:"button",className:"hc-toggle",onClick:()=>N(I=>!I),children:R?yT():afe()}),C&&h.jsx("div",{className:"hc-failure",children:C}),h.jsxs("div",{className:"hc-stats",children:[h.jsx("span",{children:new Intl.ListFormat(j(),{style:"short"}).format([n.length===1?vve():Sve({count:Xt(n.length)}),...y.done>0?[Ybe({count:Xt(y.done)})]:[],...y.failed>0?[Jbe({count:Xt(y.failed)})]:[],...y.cancelled>0?[Gbe({count:Xt(y.cancelled)})]:[],...y.live>0?[fve({count:Xt(y.live)})]:[]])}),t&&i4(t.backend)&&h.jsx(R4,{backend:t.backend}),w&&h.jsx("span",{children:w}),t&&h.jsx("span",{children:no(t.createdAt)})]}),h.jsxs("div",{className:"hc-git",children:[h.jsxs("div",{className:"hc-git-row",children:[h.jsxs("span",{className:"hc-branch",title:e.branchName,children:[h.jsx(Wg,{size:12}),e.branchName]}),r&&h.jsxs("span",{children:[Xhe()," ",h.jsx("span",{children:r})]})]}),S&&S.fileCount>0&&h.jsx("div",{className:"hc-git-row",title:S.truncated?xU({parent:ze(r??"parent")}):mU({parent:ze(r??"parent")}),children:h.jsxs("span",{children:[S.truncated&&"≥ ",h.jsxs("span",{className:"diff-stat-add text-accent-green",children:["+",S.additions]})," ",h.jsxs("span",{className:"diff-stat-del text-accent-red",children:["−",S.deletions]})," · ",S.fileCount===1&&!S.truncated?pve():S.truncated?ove({count:Xt(S.fileCount)}):rve({count:Xt(S.fileCount)})]})})]}),h.jsxs("div",{className:"hc-foot",children:[h.jsxs("span",{className:"hc-command font-mono",children:["$ ",e.runCommand]}),h.jsxs("span",{children:[Vhe()," ",D8t(e.createdAt)]})]})]}),document.body)}const bj=["empty-state absolute inset-0 flex flex-col items-center","justify-center p-6 text-center text-subtext [&_p]:max-w-[46ch]","[&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal [&_p]:text-balance","[&_p.empty-state-title]:text-2xl [&_p.empty-state-title]:font-normal","[&_p.empty-state-title]:text-text [&_p.empty-state-hint]:text-lg","[&_p.empty-state-hint]:text-subtext empty-state-cta gap-1.5"].join(" "),I8t=264,vj=132,Mm=44,B8t=72,$8t=148,P8t=44;function H8t(e){const n=new Map(e.map(i=>[i.id,{exp:i,children:[]}])),t=[];for(const i of e){const a=n.get(i.id),o=i.parentExperimentId?n.get(i.parentExperimentId):void 0;o?o.children.push(a):t.push(a)}const r=(i,a)=>i.exp.createdAt-a.exp.createdAt,s=i=>{i.children.sort(r),i.children.forEach(s)};return t.sort(r),t.forEach(s),t}function F8t(e,n){const t=new Map,r=o=>{const c=t.get(o)??1+o.children.reduce((u,_)=>u+r(_),0);return t.set(o,c),c},s=new Map,i=o=>{const c=s.get(o)??(n(o)||o.children.some(i));return s.set(o,c),c};function a(o){if(n(o)){const _=[];let f=0;for(const p of o.children)i(p)?_.push(...a(p)):f+=r(p);return f>0&&_.push({kind:"elided",id:`el-${o.exp.id}`,count:f,children:[]}),[{kind:"exp",exp:o.exp,children:_}]}if(!i(o))return[];let c=0;const u=[];return(function _(f){c+=1;for(const p of f.children)n(p)?u.push(...a(p)):i(p)?_(p):c+=r(p)})(o),[{kind:"elided",id:`el-${o.exp.id}`,count:c,children:u}]}return e.flatMap(a)}function Rw(e){return e.kind==="exp"?I8t:$8t}function lm(e){return e.kind==="exp"?e.exp.id:e.id}function Lm(e){if(e.children.length===0)return Rw(e);const n=e.children.reduce((t,r)=>t+Lm(r),0)+Mm*(e.children.length-1);return Math.max(Rw(e),n)}function U8t(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"||e==="cancelling"?"live":"other"}const q8t=T.memo(function({data:n}){Du();const{exp:t,latestRun:r,runs:s,isBaseline:i,parentSlug:a,githubOwner:o,githubRepo:c,onOpenView:u,onOpenCode:_}=n,f=r?ea(r):void 0,p=f==="running"||f==="starting"||f==="cancelling",m=i?YQe():p?uJe():Go(),x=s.slice(-8),S=T.useRef(null),b=L8t(S,n);return h.jsxs("div",{ref:S,className:`exp-node w-66 border border-border rounded-md bg-background py-2.5 px-3 shadow-tree text-sm transition-[box-shadow] duration-120 ease-standard [&:hover]:shadow-tree-hover [&.live]:border-accent-teal [&.live]:shadow-tree-live [&_.node-overview-link]:block [&_.node-overview-link]:w-full [&_.node-overview-link]:p-0 [&_.node-overview-link]:border-0 [&_.node-overview-link]:bg-transparent [&_.node-overview-link]:text-inherit [&_.node-overview-link]:[font:inherit] [&_.node-overview-link]:text-start [&_.node-overview-link]:cursor-pointer [&_.node-overview-link:hover_.node-slug]:underline [&_.node-overview-link:hover_.node-slug]:underline-offset-[3px] [&_.node-overview-link:focus-visible]:outline-2 [&_.node-overview-link:focus-visible]:outline-solid [&_.node-overview-link:focus-visible]:outline-accent [&_.node-overview-link:focus-visible]:outline-offset-4 [&_.node-overview-link:focus-visible]:rounded-xs [&_.node-eyebrow]:flex [&_.node-eyebrow]:items-center [&_.node-eyebrow]:justify-between [&_.node-eyebrow]:gap-2 [&_.node-eyebrow]:mb-1.5 [&_.node-eyebrow]:text-xs [&_.node-eyebrow]:font-medium [&_.node-eyebrow]:text-muted [&_.node-head]:flex [&_.node-head]:items-center [&_.node-head]:gap-[7px] [&_.node-head]:min-w-0 [&_.node-status]:w-2 [&_.node-status]:h-2 [&_.node-status]:rounded-full [&_.node-status]:shrink-0 [&_.node-slug]:text-sm [&_.node-slug]:font-semibold [&_.node-slug]:text-text [&_.node-slug]:flex-1 [&_.node-slug]:min-w-0 [&_.node-slug]:overflow-hidden [&_.node-slug]:text-ellipsis [&_.node-slug]:whitespace-nowrap [&_.node-title]:mt-1 [&_.node-title]:text-text [&_.node-title]:text-sm [&_.node-title]:line-clamp-2 [&_.node-meta]:mt-2 [&_.node-meta]:flex [&_.node-meta]:items-center [&_.node-meta]:gap-2 [&_.node-meta]:text-xs [&_.node-meta]:text-muted [&_.node-actions]:mt-2 [&_.node-actions]:pt-1.5 [&_.node-actions]:border-t [&_.node-actions]:border-t-border-variant [&_.node-actions]:flex [&_.node-actions]:items-center [&_.node-actions]:gap-[3px] [&_.node-action]:inline-flex [&_.node-action]:items-center [&_.node-action]:gap-[5px] [&_.node-action]:py-[3px] [&_.node-action]:px-1.5 [&_.node-action]:text-sm [&_.node-action]:font-medium [&_.node-action]:text-text [&_.node-action]:rounded-sm [&_.node-action]:no-underline [&_.node-action:hover]:text-text [&_.node-action:hover]:bg-surface [&_.node-action-ext]:ms-auto [&_.node-action-ext]:py-[3px] [&_.node-action-ext]:px-[5px] ${p?"live":""}`,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,children:[h.jsx(bc,{type:"target",position:St.Top}),h.jsxs("div",{role:"button",tabIndex:0,className:"node-overview-link nodrag",...Nr(v=>u(t.id,"overview",v)),children:[h.jsxs("div",{className:"node-eyebrow",children:[h.jsx("span",{children:m}),h.jsx(tl,{status:f??"idle"})]}),h.jsx("div",{className:"node-head",children:h.jsx("span",{className:"node-slug",children:t.slug})}),(t.title||t.description)&&h.jsx("div",{className:"node-title",children:t.title||t.description}),h.jsxs("div",{className:"node-meta",children:[h.jsx("span",{children:YJe()}),x.length>0?h.jsx("span",{className:"run-squares flex items-center gap-[3px]",children:x.map(v=>h.jsx("span",{className:`run-sq w-[9px] h-[9px] shrink-0 [&.pass]:bg-accent-green [&.fail]:border-[1.5px] [&.fail]:border-danger-outline [&.live]:bg-accent-teal [&.live]:animate-[or-pulse_1.2s_ease-in-out_infinite] [&.other]:border-[1.5px] [&.other]:border-border ${U8t(ea(v))}`,title:TD(ea(v))},v.id))}):h.jsx("span",{children:IJe()}),h.jsx("span",{className:"flex-1"}),r&&h.jsx("span",{children:no(r.createdAt)})]})]}),h.jsxs("div",{className:"node-actions",onClick:v=>v.stopPropagation(),children:[s.length>0&&h.jsxs("button",{className:"node-action",title:HJe(),...Nr(v=>u(t.id,"terminal",v)),children:[h.jsx(sd,{size:13}),dA()]}),h.jsxs("button",{className:"node-action",title:oT({branch:ze(t.branchName)}),...Nr(v=>_(t.id,t.branchName,"files",v)),children:[h.jsx(Vg,{size:13}),wJe()]}),o&&c&&h.jsx("a",{className:"node-action node-action-ext",title:Um({name:ze(t.branchName)}),"aria-label":Um({name:ze(t.branchName)}),href:Bg(o,c,t.branchName),target:"_blank",rel:"noopener noreferrer",onClick:v=>v.stopPropagation(),children:h.jsx(Kg,{size:13})})]}),h.jsx(bc,{type:"source",position:St.Bottom}),b.rect&&h.jsx(O8t,{exp:t,runs:s,latestRun:r,parentSlug:a,anchor:b.rect,onOpenLogs:s.length>0?v=>u(t.id,"terminal",v):void 0,onOpenCode:v=>_(t.id,t.branchName,"files",v),onMouseEnter:b.keepOpen,onMouseLeave:b.onMouseLeave})]})}),G8t=T.memo(function({data:n}){Du();const{count:t,onShowProjectScope:r}=n;return h.jsxs("div",{className:"elided-node w-37 h-11 flex items-center gap-2 py-1.5 px-2.5 border border-dashed border-border rounded-md bg-hover-faint text-muted text-sm font-medium text-start transition-[border-color,color] duration-120 ease-standard [&:hover]:border-text [&:hover]:text-text [&_.elided-node-label]:flex [&_.elided-node-label]:flex-col [&_.elided-node-label]:leading-[1.3] [&_.elided-node-sub]:text-muted",role:"button",tabIndex:0,title:JJe(),onClick:r,onKeyDown:s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},children:[h.jsx(bc,{type:"target",position:St.Top}),h.jsx(S4,{size:14}),h.jsxs("span",{className:"elided-node-label",children:[t===1?aJe():nJe({count:Xt(t)}),h.jsx("span",{className:"elided-node-sub",children:GJe()})]}),h.jsx(bc,{type:"source",position:St.Bottom})]})}),V8t={exp:q8t,elided:G8t},r$={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}},W8t={...r$.style,strokeDasharray:"4 4"};function K8t({experiments:e,runs:n,project:t,onOpenView:r,onOpenCode:s,agentSessionId:i,onShowProjectScope:a}){const{nodes:o,edges:c}=T.useMemo(()=>{const u=new Map;for(const v of n){const y=u.get(v.experimentId);y?y.push(v):u.set(v.experimentId,[v])}for(const v of u.values())v.sort((y,w)=>y.createdAt-w.createdAt);const _=[],f=[],p=v=>!i||v.exp.chatSessionId===i,m=F8t(H8t(e),p),x=new Map(e.map(v=>[v.id,v.slug]));function S(v,y,w){const C=y-Rw(v)/2;if(v.kind==="exp"){const R=u.get(v.exp.id)??[];_.push({id:v.exp.id,type:"exp",position:{x:C,y:w},data:{exp:v.exp,latestRun:R[R.length-1]??null,runs:R,isBaseline:!v.exp.parentExperimentId,parentSlug:v.exp.parentExperimentId?x.get(v.exp.parentExperimentId)??null:null,githubOwner:t.githubEnabled?t.githubOwner:"",githubRepo:t.githubEnabled?t.githubRepo:"",onOpenView:r,onOpenCode:s}})}else _.push({id:v.id,type:"elided",position:{x:C,y:w+(vj-P8t)/2},data:{count:v.count,onShowProjectScope:a}});if(v.children.length===0)return;const z=v.children.reduce((R,N)=>R+Lm(N),0)+Mm*(v.children.length-1);let E=y-z/2;for(const R of v.children){const N=Lm(R),M=v.kind==="elided"||R.kind==="elided";f.push({id:`e-${lm(v)}-${lm(R)}`,source:lm(v),target:lm(R),...M?{style:W8t}:{}}),S(R,E+N/2,w+vj+B8t),E+=N+Mm}}let b=0;for(const v of m){const y=Lm(v);S(v,b+y/2,0),b+=y+Mm}return{nodes:_,edges:f}},[e,n,r,s,t.githubOwner,t.githubRepo,t.githubEnabled,i,a]);return e.length===0?h.jsxs("div",{className:bj,children:[h.jsx("p",{className:"empty-state-title",children:MJe()}),h.jsx("p",{className:"empty-state-hint",children:bJe()})]}):o.length===0&&i?h.jsxs("div",{className:bj,children:[h.jsx("p",{className:"empty-state-title",children:jJe()}),h.jsx("p",{className:"empty-state-hint",children:_Je()})]}):h.jsx(n8t,{className:"[&_.react-flow\\_\\_node.react-flow\\_\\_node-exp.selectable]:cursor-default [&_.react-flow\\_\\_node.react-flow\\_\\_node-elided.selectable]:cursor-pointer [&_.react-flow\\_\\_handle]:opacity-0 [&_.react-flow\\_\\_handle]:pointer-events-none [&_.react-flow\\_\\_attribution]:hidden!",nodes:o,edges:c,nodeTypes:V8t,defaultEdgeOptions:r$,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,onMoveStart:M8t,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:h.jsx(o8t,{variant:nl.Dots,color:"var(--dots-strong)",gap:28,size:1.6})},i??"project")}const Oh=["empty-state absolute inset-0 flex flex-col items-center","justify-center gap-2.5 p-6 text-center text-subtext","[&_p]:max-w-[46ch] [&_p]:m-0 [&_p]:text-sm [&_p]:leading-normal","[&_p]:text-balance [&_p.empty-state-title]:text-2xl","[&_p.empty-state-title]:font-normal [&_p.empty-state-title]:text-text","[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext"].join(" ");function Y8t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function X8t(e,n,t,r,s){let i=e,a;const o=n==null?void 0:n.replace(/\/+$/,""),c=r==null?void 0:r.replace(/\/+$/,"");if(i.startsWith("artifacts/"))return i=i.slice(10),i?{path:i,source:"artifacts"}:null;if(i==="~"||i.startsWith("~/"))return{path:i,source:"abs"};const u=p=>{const m=b=>b.replace(/^\/private(?=\/(?:tmp|var)(?:\/|$))/,""),[x,S]=[m(i),m(p)];return x===S?"":x.startsWith(`${S}/`)?x.slice(S.length).replace(/^\/+/,""):null},_=i.startsWith("/")&&c?u(c):null,f=i.startsWith("/")&&o?u(o):null;if(!i.startsWith("/"))a=t;else{if(_!==null)return _?{path:_,source:"artifacts"}:null;if(f!==null)i=f;else{const p=s?Y8t(s):"[^/]+",m=i.match(new RegExp(`/files/${p}/(.+)$`)),x=m?null:i.match(/\/openresearch\/worktrees\/[^/]+\/([^/]+)\/(.+)$/),S=m||x?null:i.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);if(m)return{path:m[1],source:"artifacts"};x?(a=x[1],i=x[2]):S&&(i=S[1])}}return i?i.startsWith("/")?{path:i,source:"abs"}:{path:i,sessionId:a}:null}function Z8t(e,n){if(!(e.source==="artifacts"||e.source==="abs"))return e.ref??e.branchLabel??n}const zg=360,Q8t=10,J8t=272,eCt=380,tCt=J8t+56,nCt=80,rCt=48;function Fh(){return Math.max(zg,window.innerWidth-tCt-eCt)}function sCt(){const e=Fh();return Math.max(zg,Math.min(760,e,Math.round(window.innerWidth*.4)))}function Ih(e,n){const t=e.findIndex(s=>s.id===n.id);if(t<0)return[...e,n];const r=e.slice();return r[t]=n,r}function xj(e){const n=T.useRef(e);return n.current.size===e.size&&[...e].every(([r,s])=>n.current.get(r)===s)||(n.current=e),n.current}function iCt({runtime:e,projectId:n,pane:t}){var Ue,ot;const r=Vs(),s=tT({select:J=>J.location}),i=Su(s.pathname),a=(i==null?void 0:i.kind)==="skills"?"skills":(i==null?void 0:i.kind)==="settings"?i.section??"settings":"chat",o=T.useRef(null),c=(i==null?void 0:i.kind)==="task"?i.sessionId??null:o.current;(i==null?void 0:i.kind)==="task"&&(o.current=c);const u=t!==void 0,_=(t==null?void 0:t.kind)==="experiment"?t.runId??null:null,[f,p]=T.useState(null),[m,x]=T.useState(0),S=T.useRef({href:"",jump:0,value:0});(S.current.href!==s.href||S.current.jump!==m)&&(S.current={href:s.href,jump:m,value:S.current.value+1});const b=T.useMemo(()=>{const J=t?_a(t):"experiments";return typeof J=="object"&&"path"in J&&J.line&&f!==S.current.value?{...J,lineScrollRequest:S.current.value}:J},[t,f,s.href,m]),[v,y]=T.useState(null),w=T.useRef(new Set),C=T.useRef(new Set),z=T.useRef({}),[E,R]=T.useState(0),N=T.useRef({projectId:n,activeSessionId:c,pane:t,isTask:(i==null?void 0:i.kind)==="task"});N.current={projectId:n,activeSessionId:c,pane:t,isTask:(i==null?void 0:i.kind)==="task"};const M=T.useCallback((J,de=!1)=>{const ye=N.current;ye.projectId&&r.navigate({href:mm(ye.projectId,ye.activeSessionId,J),replace:de})},[r]),O=T.useCallback(J=>{const de=Xo(J);M(de.kind==="file"?{...de,line:void 0}:de)},[M]),I=T.useCallback(()=>M(void 0),[M]),H=T.useCallback(J=>{(t==null?void 0:t.kind)==="experiment"&&M({...t,runId:J??void 0})},[t,M]),U=T.useCallback(J=>{r.navigate({href:J?`/projects/${encodeURIComponent(J)}`:"/projects"})},[r]),F=T.useCallback(J=>{var de;if(n)if(J==="chat"){const ye=o.current;r.navigate({href:mm(n,ye,(de=oc(Wr.current,ye??"new"))==null?void 0:de.active)})}else r.navigate({href:`/projects/${encodeURIComponent(n)}/${J==="skills"?"skills":`settings/${J}`}`})},[r,n]),Y=Du(),{status:q}=M4(e.kind==="local"),[Q,Z]=T.useState(null),[B,D]=T.useState(null),P=T.useRef(void 0);P.current=B==null?void 0:B.tourCompleted;const[X,W]=T.useState(null),ie=T.useRef(null),[le,ae]=T.useState([]),[se,G]=T.useState(!1),[oe,ce]=T.useState(!1),[pe,ue]=T.useState([]),Ee=T.useRef(pe);Ee.current=pe;const Te=T.useRef(new Map),Ie=T.useRef(new Set),Le=T.useRef(null),He=T.useRef(!1),Tt=T.useRef(new Map),Et=T.useRef(new Map),Vt=T.useRef(0),$t=T.useRef(le);$t.current=le;const[rt,nt]=T.useState(null),[ut,pt]=T.useState("table"),[ve,Oe]=T.useState("project"),Je=T.useRef(null),{open:ft,setOpen:mt,ref:Ht}=Ea(Je),[Fe,Pt]=T.useState(!1),Jt=le.every(J=>J.chatSessionId),nn=c&&Jt?ve:"project",Lt=T.useMemo(()=>nn!=="agent"?le:le.filter(J=>J.chatSessionId===c),[le,nn,c]),Rn=T.useMemo(()=>{if(nn!=="agent")return pe;const J=new Set(Lt.map(de=>de.id));return pe.filter(de=>J.has(de.experimentId))},[pe,Lt,nn]),[Kt,Gn]=T.useState([]),[cr,vn]=T.useState(!1),[wr,Qn]=T.useState(!1),[Wn,Mn]=T.useState(!1),[gt,an]=T.useState([]),[Ge,at]=T.useState([]),rn=T.useRef(new Map),Nt=T.useRef(new Map),on=J=>{let de=Nt.current.get(J);return de||(de=new i4t,Nt.current.set(J,de)),de},[Qe,bt]=T.useState([]),[ln,Sr]=T.useState([]),[yn,dt]=T.useState([]),[Ct,_n]=T.useState([]),[hr,ls]=T.useState(null),[Hr,Ms]=T.useState("files"),[ts,Ls]=T.useState(new Set),[Fr,ns]=T.useState(!1),[cs,Ds]=T.useState(sCt),[Zt,Pn]=T.useState(!0),[rs,tt]=T.useState(!1),At=T.useRef(v4()),ss=T.useRef(c);ss.current=c;const Ur=T.useRef(Kt);Ur.current=Kt;const Ks=T.useRef(Ct);Ks.current=Ct;const ur=T.useRef(null),xs=T.useCallback(J=>{const de=[...J];Ks.current=de,_n(de)},[]),qr=T.useCallback(J=>{ur.current=J,ls(J)},[]),za=T.useCallback(J=>{const de=wt(J);an(ke=>Eh(ke,de)),at(ke=>Eh(ke,de)),bt(ke=>Eh(ke,de)),Sr(ke=>Eh(ke,de)),dt(ke=>Eh(ke,de));const ye=ys.current;if(ye&&"path"in J){const ke=bs(ye,ss.current,J);rn.current.delete(ke),Nt.current.delete(ke),C.current.delete(ke),w.current.delete(ke)}const Ae=Ur.current.filter(ke=>wt(ke)!==de);Ur.current=Ae,Gn(Ae)},[]),Cn=T.useCallback(J=>{const de=wt(J),ye=[...Ur.current.filter(Ae=>wt(Ae)!==de),Ap(J)];Ur.current=ye,Gn(ye),O(J)},[O]),On=T.useCallback((J,de,ye)=>{const Ae=wt(J),ke=ur.current,Ye=m1t({order:Ks.current,previewKey:ke?wt(ke):null},Ae,de);Ye.replacedKey&&ke&&typeof ke!="string"&&wt(ke)===Ye.replacedKey&&za(ke),xs(Ye.order),Ye.previewKey===null?qr(null):Ye.previewKey===Ae&&qr(Ap(J));const et=[...Ur.current.filter(vt=>wt(vt)!==Ae),Ap(J)];Ur.current=et,Gn(et),M(Xo(J,ye))},[za,xs,qr,M]),Gr=T.useCallback(J=>{const de=ur.current;de&&wt(de)===wt(J)&&qr(null)},[qr]);T.useEffect(()=>{let J=!1;const de=Ae=>{const ke=ur.current,Ye=Ae.target;if(Ye instanceof Element&&Ye.closest("input, textarea, [contenteditable='true']")!==null){J=!1;return}if(ke&&wt(ke)===wt(At.current.rightTab)&&(Ae.metaKey||Ae.ctrlKey)&&!Ae.altKey&&!Ae.shiftKey&&Ae.key.toLowerCase()==="k"){Ae.preventDefault(),J=!0;return}if(J&&Ae.key==="Enter"){Ae.preventDefault(),J=!1;const vt=ur.current;vt&&Gr(vt);return}J=!1},ye=()=>{J=!1};return window.addEventListener("keydown",de),window.addEventListener("blur",ye),window.addEventListener("pointerdown",ye),()=>{window.removeEventListener("keydown",de),window.removeEventListener("blur",ye),window.removeEventListener("pointerdown",ye)}},[Gr]);const zr=T.useCallback((J,de)=>{const ye=wt(J),Ae=ur.current;Ae&&wt(Ae)===ye&&qr(null);const ke=g1t({order:Ks.current,previewKey:Ae?wt(Ae):null},ye,Ur.current.map(wt));xs(ke.order);const Ye=Ur.current.filter(vt=>wt(vt)!==ye);if(Ur.current=Ye,Gn(Ye),!de)return;const et=ke.fallbackKey?Ye.find(vt=>wt(vt)===ke.fallbackKey):void 0;et?O(et):(I(),ns(!1))},[xs,qr,O,I]),Ut=F,ci=T.useMemo(()=>({rightTab:Ap(b),tabHistory:Kt,experimentsTabOpen:cr,filesTabOpen:wr,artifactsTabOpen:Wn,expTabs:gt,fileTabs:Ge,planTabs:Qe,subagentTabs:ln,codeTabs:yn,contentTabOrder:Ks.current,previewTab:ur.current,filesView:Hr,filesToggled:ts,selectedRunId:_,scope:ve,panelOpen:u,panelMax:Fr}),[b,Kt,cr,wr,Wn,gt,Ge,Qe,ln,yn,Ct,hr,Hr,ts,_,ve,u,Fr]);At.current=ci;const Ii=T.useCallback(()=>Object.fromEntries(rn.current),[]),Vr=T.useRef(void 0),_r=T.useCallback(()=>{clearTimeout(Vr.current),Vr.current=setTimeout(()=>R(J=>J+1),200)},[]);T.useEffect(()=>()=>clearTimeout(Vr.current),[]);const go=T.useCallback((J,de,ye)=>{if(Gn(J.tabHistory),Ur.current=J.tabHistory,vn(J.experimentsTabOpen),Qn(J.filesTabOpen),Mn(J.artifactsTabOpen),an(J.expTabs),at(J.fileTabs),bt(ke=>ke===J.planTabs?ke:J.planTabs.map(Ye=>{var et;return{...Ye,plan:((et=ke.find(vt=>vt.sessionId===Ye.sessionId&&vt.promptId===Ye.promptId))==null?void 0:et.plan)??""}})),Sr(J.subagentTabs),dt(J.codeTabs),xs(J.contentTabOrder),qr(J.previewTab),Ms(J.filesView),Ls(J.filesToggled),Oe(J.scope),ns(J.panelMax),Pt(N.current.activeSessionId===_m&&J.fileTabs.some(ke=>Qc(ke,{path:pm,source:"artifacts"}))),ye){for(const[ke,Ye]of Object.entries((de==null?void 0:de.scroll)??{}))rn.current.set(ke,Ye);Object.assign(z.current,de==null?void 0:de.sourceModes)}const Ae=N.current;if(Ae.projectId)for(const ke of J.fileTabs){const Ye=bs(Ae.projectId,Ae.activeSessionId,ke);C.current.has(Ye)||w.current.add(Ye)}},[xs,qr]),{ready:us,loaded:sa,error:Os,retry:ja,capture:hl,workspace:Wr}=$it({projectId:B&&v!==null&&((i==null?void 0:i.kind)!=="task"||!c||v.includes(c))?n:null,taskKey:c??"new",location:s.href,pane:t,isTask:(i==null?void 0:i.kind)==="task",demoOverview:(B==null?void 0:B.tourCompleted)===!1,state:ci,apply:go,getScroll:Ii,sourceModes:z.current,revision:E}),Ta=T.useCallback((J,de)=>{var Ye,et;if(!n)return;J&&((Ye=Yr.current)==null||Ye.set(J,!0),y(vt=>vt&&vt.includes(J)?vt:[...vt??[],J]),de!=null&&de.replace&&c===null&&(hl(),Iit(n,J)));const ye=oc(_R(n),J??"new"),Ae=ye?ye.active:ou(n)?(et=x4(J??void 0,P.current===!1))==null?void 0:et.active:void 0,ke=de!=null&&de.replace&&J&&c===null?N.current.pane:Ae;r.navigate({href:mm(n,J,ke),replace:de==null?void 0:de.replace})},[r,n,c,hl]);T.useEffect(()=>{us&&(i==null?void 0:i.kind)!=="task"&&!o.current&&Wr.current.lastTaskId&&(v!=null&&v.includes(Wr.current.lastTaskId))&&(o.current=Wr.current.lastTaskId,R(J=>J+1))},[us,i==null?void 0:i.kind,Wr,v]),AF({shouldBlockFn:({next:J})=>{var de;return((de=Su(J.pathname))==null?void 0:de.projectId)!==n&&[...Nt.current.values()].some(ye=>ye.needsProtection)&&!cz(C8())},enableBeforeUnload:()=>[...Nt.current.values()].some(J=>J.needsProtection)});const bo=T.useRef(null);T.useEffect(()=>{const J=Hg(s.href);!B||!us||!J||(Fg.queue({lastLocation:J,railOpen:Zt,panelWidth:cs,experimentsView:ut},bo.current===J?250:0),bo.current=J)},[s.href,B,us,Zt,cs,ut]);const vo=(B==null?void 0:B.onboardingCompleted)??!1,[Kr,Jn]=T.useState(!1),kc=T.useCallback(()=>Jn(!0),[]),Aa=T.useCallback(async()=>{const J=await _C({tourCompleted:!0});D(de=>de&&{...de,tourCompleted:J.tourCompleted}),Jn(!1)},[]),ui=T.useCallback(async()=>{await Aa(),tt(!0)},[Aa]);T.useEffect(()=>{!n||!ou(n)||!vo||B!=null&&B.tourCompleted||kc()},[n,vo,kc,B==null?void 0:B.tourCompleted]);const Ft=(Q==null?void 0:Q.find(J=>J.id===n))??null;T.useEffect(()=>{const J=X||B===null?null:Ft==null?void 0:Ft.name;document.title=J?`${Ja(J)} — OpenResearch`:"OpenResearch"},[X,B,Ft]);const ys=T.useRef(n);ys.current=n;const fi=T.useCallback((J=!1)=>{J&&(!N.current.isTask||N.current.pane)||(vn(!0),M({kind:"home",view:"experiments"},J))},[M]),Yr=T.useRef(null),xo=T.useCallback(async()=>{const J=new Map;Yr.current=J;const de=await gu(n);if(Yr.current!==J)return;const ye=new Set(de.map(Ae=>Ae.id));for(const[Ae,ke]of J)ke?ye.add(Ae):ye.delete(Ae);Yr.current=null,y([...ye]),o.current&&!ye.has(o.current)&&(o.current=null)},[n]),Ra=T.useCallback(()=>{W(null),Z(null),D(null),Promise.allSettled([n4(),Ig(),xo()]).then(([J,de,ye])=>{const Ae=[];if(ye.status==="rejected"&&Ae.push(dT()),J.status==="fulfilled"?Z(J.value):Ae.push(Gh()),de.status==="fulfilled"){ie.current=de.value.preferredAgent;const ke=g4()??de.value.workspace;ke&&(Pn(ke.railOpen),Ds(Math.min(ke.panelWidth,Fh())),pt(ke.experimentsView)),D(de.value)}else Ae.push(yZ());Ae.length>0&&W(CZ({items:new Intl.ListFormat(j()).format(Ae)}))})},[xo]);T.useEffect(()=>{Ra()},[Ra]),T.useEffect(()=>{const J=lc(de=>{var ye,Ae;de.type==="reconnected"?xo().catch(()=>{}):de.type==="session"&&de.session.projectId===n?((ye=Yr.current)==null||ye.set(de.session.id,!0),y(ke=>ke!=null&&ke.includes(de.session.id)?ke:[...ke??[],de.session.id])):de.type==="sessionDeleted"&&((Ae=Yr.current)==null||Ae.set(de.sessionId,!1),y(ke=>(ke==null?void 0:ke.filter(Ye=>Ye!==de.sessionId))??null),o.current===de.sessionId&&(o.current=null))});return()=>{J(),Yr.current=null}},[n,xo]);const _l=T.useRef(Promise.resolve()),Bi=T.useRef(0),Is=T.useCallback(J=>{const de=++Bi.current;D(Ae=>Ae&&{...Ae,preferredAgent:J});const ye=_l.current.then(()=>_C({preferredAgent:J})).then(Ae=>{ie.current=Ae.preferredAgent,de===Bi.current&&D(ke=>ke&&{...ke,preferredAgent:Ae.preferredAgent})}).catch(Ae=>{throw de===Bi.current&&D(ke=>ke&&{...ke,preferredAgent:ie.current}),Ae});return _l.current=ye.catch(()=>{}),ye},[]);T.useEffect(()=>{const J=()=>Ds(de=>Math.min(de,Fh()));return window.addEventListener("resize",J),()=>window.removeEventListener("resize",J)},[]);const Kn=T.useCallback(J=>{He.current=!1,Tt.current.clear(),Et.current.clear();const de=++Vt.current;r4(J).then(ye=>{if(ys.current!==J||Le.current!==J||Vt.current!==de)return;Tt.current=new Map(ye.map(ke=>[ke.id,ke]));const Ae=[...Et.current.values()].some(ke=>{const Ye=Tt.current.get(ke.id);return!Ye||Ye.status!=="running"&&Ye.updatedAt<=ke.updatedAt});Et.current.clear();for(const ke of ye){const Ye=Te.current.get(ke.id);(!Ye||Ye.updatedAt{const Ye=new Map(ye.map(et=>[et.id,et]));for(const et of ke){const vt=Ye.get(et.id);(!vt||vt.updatedAt<=et.updatedAt)&&Ye.set(et.id,et)}return[...Ye.values()]}),He.current=!0,ce(!0),Ae&&fi(!0)}).catch(()=>{Vt.current===de&&(Et.current.clear(),ce(!0))})},[fi]);T.useEffect(()=>{if(!n)return;let J=!0;return Le.current=n,Te.current.clear(),Ie.current.clear(),Ytt(n).catch(()=>{}),ae([]),ue([]),nt(null),Ztt(n).then(de=>{J&&(ae(de),G(!0))}).catch(()=>{J&&G(!0)}),Kn(n),yC(n).then(de=>{J&&nt(de)}).catch(()=>{}),()=>{J=!1,Vt.current++}},[Kn,n]);const di=T.useCallback(()=>{const J=ys.current;J&&yC(J).then(nt).catch(()=>{})},[]),er=T.useCallback(()=>{di(),Mn(!0),Cn("artifacts")},[di,Cn]);mR({onReconnect:()=>{const J=ys.current;J&&(Le.current=J,Te.current.clear(),Ie.current.clear(),Kn(J))},onRun:J=>{if(J.projectId!==ys.current||J.projectId!==Le.current)return;const de=Te.current.get(J.id),ye=Ie.current.has(J.id);if(de&&de.updatedAt>J.updatedAt||(Te.current.set(J.id,J),Ie.current.add(J.id),ue(Ye=>Ih(Ye,J)),J.status!=="running"||(de==null?void 0:de.status)==="running"))return;const Ae=Tt.current.get(J.id),ke=He.current&&(!Ae||Ae.status!=="running"&&Ae.updatedAt<=J.updatedAt);ye&&de||ke?fi(!0):He.current||Et.current.set(J.id,J)},onExperiment:J=>{J.projectId===ys.current&&ae(de=>Ih(de,J))},onProject:J=>{Z(de=>de?Ih(de,J):[J])},onArtifacts:J=>{J===ys.current&&di()}});const Bs=T.useCallback(()=>Oe("project"),[]),pr=T.useCallback((J,de="overview",ye="preview",Ae)=>{const ke={id:J,view:de};an(Ye=>Ye.some(et=>ux(et,ke))?Ye:[...Ye,ke]),On(ke,ye,Ae)},[On]),pl=T.useCallback((J,de="preview")=>{const ye=Ee.current.filter(ke=>ke.id===J||ke.id.startsWith(J)),Ae=ye.length===1?ye[0]:null;Ae&&pr(Ae.experimentId,"terminal",de,Ae.id)},[pr]),$s=T.useMemo(()=>new Map(le.map(J=>{var de;return[J.id,((de=J.title)==null?void 0:de.trim())||J.slug||Go()]})),[le,Y]),hi=xj($s),Cc=T.useMemo(()=>{const J=new Map;for(const de of pe)J.set(de.id,hi.get(de.experimentId)??Go());return J},[hi,pe,Y]),jr=xj(Cc),_i=T.useCallback(J=>{const de=jr.get(J);if(de)return de;const ye=[...jr].filter(([Ae])=>Ae.startsWith(J));return ye.length===1?ye[0][1]:""},[jr]),$i=T.useCallback(J=>{const de=hi.get(J);if(de)return de;const ye=[...hi].filter(([Ae])=>Ae.startsWith(J));return ye.length===1?ye[0][1]:""},[hi]),Ma=T.useCallback((J,de="preview")=>{const ye=$t.current.filter(Ae=>Ae.id===J||Ae.id.startsWith(J));ye.length===1&&pr(ye[0].id,"overview",de)},[pr]),Ld=T.useCallback(J=>{const de=gt.findIndex(ye=>ux(ye,J));de!==-1&&(an(ye=>ye.filter((Ae,ke)=>ke!==de)),zr(J,wt(b)===wt(J)))},[gt,zr,b]),ws=T.useCallback((J,de="preview")=>{J.line!=null&&x(ke=>ke+1);const ye=ys.current;if(ye){const ke=bs(ye,ss.current,J);At.current.fileTabs.some(Ye=>Qc(Ye,J))||w.current.delete(ke),C.current.add(ke)}const Ae=dR(J);at(ke=>{const Ye=ke.findIndex(vt=>Qc(vt,J));if(Ye===-1)return[...ke,Ae];const et=ke.slice();return et[Ye]=Ae,et}),On(J,de)},[On]),Ss=T.useCallback((J,de,ye,Ae,ke,Ye)=>{const et=Q==null?void 0:Q.find(ds=>ds.id===n),vt=X8t(J,et==null?void 0:et.repoPath,de,(et==null?void 0:et.artifactsDir)??(et==null?void 0:et.filesDir),et==null?void 0:et.slug);if(!vt)return null;const sn=ke?$t.current.find(ds=>ds.id===ke||ke.length>=6&&ds.id.startsWith(ke)):void 0,br=ye??(sn==null?void 0:sn.branchName),wn=vt.source==null||vt.source==="repo";return br&&wn&&(vt.ref=br),Ye&&!vt.ref&&wn&&(vt.branchLabel=Ye),Ae!=null&&(vt.line=Ae),vt},[Q,n]),pi=T.useCallback((J,de,ye,Ae,ke,Ye,et="preview")=>{const vt=Ss(J,de,ye,Ae,ke,Ye);vt&&ws(vt,et)},[ws,Ss]),Ys=T.useCallback(J=>ws({path:J,source:"artifacts"},"keepOpen"),[ws]),ml=T.useCallback((J,de,ye,Ae,ke,Ye="preview")=>{const et=Ss(J,de,ke,ye,Ae);et&&ws(et,Ye)},[ws,Ss]),ks=T.useCallback((J,de)=>{Gr(J),de()},[Gr]),Fu=T.useCallback(J=>{var Ae;const de=Ge.findIndex(ke=>Qc(ke,J));if(de===-1)return;const ye=n?bs(n,c,J):null;ye&&((Ae=Nt.current.get(ye))!=null&&Ae.needsProtection)&&!cz(C8())||(at(ke=>ke.filter((Ye,et)=>et!==de)),ye&&(rn.current.delete(ye),Nt.current.delete(ye),C.current.delete(ye),w.current.delete(ye),delete z.current[ye]),c===_m&&Qc(J,{path:pm,source:"artifacts"})&&Pt(!1),zr(J,wt(b)===wt(J)))},[c,Ge,zr,n,b]),Ec=T.useCallback(J=>{J.lineScrollRequest!==void 0&&p(J.lineScrollRequest)},[]),Nc=T.useCallback((J,de,ye,Ae="preview")=>{const ke={kind:"plan",sessionId:de,promptId:ye,plan:J};bt(Ye=>{const et=Ye.findIndex(sn=>sn.promptId===ye);if(et===-1)return[...Ye,ke];const vt=Ye.slice();return vt[et]=ke,vt}),On(ke,Ae)},[On]),Dd=T.useCallback(J=>{const de=Qe.findIndex(ye=>ye.promptId===J.promptId);de!==-1&&(bt(ye=>ye.filter((Ae,ke)=>ke!==de)),zr(J,wt(b)===wt(J)))},[zr,Qe,b]),gl=T.useCallback((J,de,ye,Ae="preview")=>{const ke={kind:"subagent",sessionId:J,spawnPartId:de,label:ye};Sr(Ye=>Ye.some(et=>et.spawnPartId===de)?Ye:[...Ye,ke]),On(ke,Ae)},[On]),Xs=T.useCallback(J=>{const de=ln.findIndex(ye=>ye.spawnPartId===J.spawnPartId);de!==-1&&(Sr(ye=>ye.filter((Ae,ke)=>ke!==de)),zr(J,wt(b)===wt(J)))},[zr,b,ln]),[Uu,zc]=T.useState({});T.useEffect(()=>{if(zc(et=>{const vt=new Set(ln.map(sn=>sn.spawnPartId));return Object.keys(et).every(sn=>vt.has(sn))?et:Object.fromEntries(Object.entries(et).filter(([sn])=>vt.has(sn)))}),ln.length===0)return;let J=!0;const de=new Set,ye=(et,vt,sn)=>{zc(br=>{var ds;let wn=br;for(const Pi of vt)if(!(sn&&de.has(Pi.spawnPartId)))for(const aa of et){const Oa=Qh(aa.parts,Pi.spawnPartId);if(!Oa)continue;sn||de.add(Pi.spawnPartId);const oa={label:Bvt(Oa),running:((ds=Oa.state)==null?void 0:ds.status)==="running"},Ps=wn[Pi.spawnPartId];(!Ps||Ps.label!==oa.label||Ps.running!==oa.running)&&(wn===br&&(wn={...br}),wn[Pi.spawnPartId]=oa);break}return wn})};let Ae=0;const ke=()=>{const et=++Ae;for(const vt of new Set(ln.map(sn=>sn.sessionId)))uu(vt).then(({messages:sn})=>{J&&et===Ae&&ye(sn,ln.filter(br=>br.sessionId===vt),!0)}).catch(()=>{})};ke();const Ye=lc(et=>{if(et.type==="reconnected"){de.clear(),ke();return}if(et.type!=="message")return;const vt=ln.filter(sn=>sn.sessionId===et.sessionId);vt.length&&ye([et.message],vt,!1)});return()=>{J=!1,Ye()}},[ln]);const yo=T.useCallback((J,de,ye="files",Ae="preview")=>{const ke={code:!0,experimentId:J,branch:de,view:ye,toggled:new Set};dt(Ye=>Ye.some(et=>wf(et,ke))?Ye.map(et=>wf(et,ke)?{...et,experimentId:J,view:ye}:et):[...Ye,ke]),On(ke,Ae)},[On]),qu=T.useCallback((J,de)=>{dt(ye=>ye.map(Ae=>wf(Ae,J)?{...Ae,...de}:Ae)),de.view&&M(Xo({...J,...de}))},[]),Gu=T.useCallback(J=>{const de=yn.findIndex(ye=>wf(ye,J));de!==-1&&(dt(ye=>ye.filter((Ae,ke)=>ke!==de)),zr(J,wt(b)===wt(J)))},[yn,zr,b]),Vu=T.useCallback(()=>{Qn(!0),Cn("files")},[Cn]),jc=T.useCallback(J=>{J==="experiments"?vn(!1):J==="files"?Qn(!1):Mn(!1),zr(J,b===J)},[zr,b]),Tc=J=>{J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId);const ye=document.body.style.userSelect;document.body.style.userSelect="none";const Ae=Fr,ke=J.clientX,Ye=cs;let et=!1;function vt(){window.removeEventListener("pointermove",sn),window.removeEventListener("pointerup",vt),window.removeEventListener("pointercancel",vt),document.body.style.userSelect=ye}function sn(br){if(Ae){const aa=br.clientX-ke;if(et||aads+nCt){ns(!0);return}ns(!1);const Pi=Math.min(Math.max(wn,zg),ds);Ds(Pi)}window.addEventListener("pointermove",sn),window.addEventListener("pointerup",vt),window.addEventListener("pointercancel",vt)},Od=(J,de)=>{Z(ye=>ye?Ih(ye,J):[J]),r.navigate({href:`/projects/${encodeURIComponent(J.id)}${de?"/settings/git":""}`}),de&&Vn(de,"error")},fs=typeof b=="object"&&"id"in b?b:null,En=typeof b=="object"&&"path"in b?b:null,La=(En==null?void 0:En.source)==="artifacts"&&rt?j_(rt.entries,En.path):null,Id=La?`${La.modifiedAt}:${La.size}`:null,bl=c===_m&&Fe?Ge.find(J=>Qc(J,{path:pm,source:"artifacts"})):void 0,Bd=bl?[bl]:[],mr=typeof b=="object"&&"kind"in b&&b.kind==="plan"?b:null,[wo,Ac]=T.useState(null),Da=mr==null?void 0:mr.sessionId,So=mr==null?void 0:mr.promptId;T.useEffect(()=>{if(!Da||!So||!(v!=null&&v.includes(Da)))return;let J=!0;const de=`${Da}:${So}`,ye=Ye=>{var vt;const et=Ye.flatMap(sn=>{const br=Qh(sn.parts,So);return br?[br]:[]})[0];J&&Ac({key:de,text:((vt=et==null?void 0:et.prompt)==null?void 0:vt.plan)??null})},Ae=()=>void uu(Da).then(({messages:Ye})=>ye(Ye)).catch(()=>{J&&Ac({key:de,text:null})});Ae();const ke=lc(Ye=>{Ye.type==="reconnected"&&Ae(),Ye.type==="message"&&Ye.sessionId===Da&&Qh(Ye.message.parts,So)&&ye([Ye.message])});return()=>{J=!1,ke()}},[Da,So,v]);const is=typeof b=="object"&&"kind"in b&&b.kind==="subagent"?b:null,ko=typeof b=="object"&&"code"in b?b:null,gr=ko?yn.find(J=>wf(J,ko))??null:null,Rc=new Map;for(const J of[...gt,...Ge,...Qe,...ln,...yn])Rc.set(wt(J),J);const Mc=bl?wt(bl):null,Lc=Ct.filter(J=>J!==Mc).map(J=>Rc.get(J)).filter(Lit),ia=J=>hr!==null&&wt(hr)===wt(J),vl=J=>h.jsx(Xl,{active:En!==null&&Qc(En,J),label:J.path.split("/").pop()||J.path,icon:h.jsx(NR,{size:12,className:"shrink-0"}),preview:ia(J),onSelect:()=>Cn(J),onPromote:()=>Gr(J),onClose:()=>Fu(J)},`file:${b4(J)}`),te=fs?le.find(J=>J.id===fs.id)??null:null,be=gr?le.find(J=>J.id===gr.experimentId&&J.branchName===gr.branch)??null:null,Ne=J=>{var ye,Ae;if("path"in J)return vl(J);if("id"in J){const ke=le.find(Ye=>Ye.id===J.id);return h.jsx(Xl,{active:fs!==null&&ux(fs,J),label:ke?ke.title||ke.slug:"…",icon:J.view==="overview"?h.jsx(Sat,{size:12,className:"shrink-0"}):h.jsx(sd,{size:12,className:"shrink-0"}),preview:ia(J),onSelect:()=>Cn(J),onPromote:()=>Gr(J),onClose:()=>Ld(J)},wt(J))}if("kind"in J&&J.kind==="plan")return h.jsx(Xl,{active:mr!==null&&mr.promptId===J.promptId,label:gT(),icon:h.jsx(j4,{size:12,className:"shrink-0"}),preview:ia(J),onSelect:()=>Cn(J),onPromote:()=>Gr(J),onClose:()=>Dd(J)},wt(J));if("kind"in J)return h.jsx(Xl,{active:is!==null&&is.spawnPartId===J.spawnPartId,label:((ye=Uu[J.spawnPartId])==null?void 0:ye.label)??J.label??jZ(),shimmer:((Ae=Uu[J.spawnPartId])==null?void 0:Ae.running)??!1,icon:h.jsx(T4,{size:12,className:"shrink-0"}),preview:ia(J),onSelect:()=>Cn(J),onPromote:()=>Gr(J),onClose:()=>Xs(J)},wt(J));const de=le.find(ke=>ke.id===J.experimentId);return h.jsx(Xl,{active:gr!==null&&wf(gr,J),label:(de==null?void 0:de.slug)??J.branch,icon:h.jsx(h_,{size:12,className:"shrink-0"}),preview:ia(J),onSelect:()=>Cn(J),onPromote:()=>Gr(J),onClose:()=>Gu(J)},wt(J))};if(!i||i.kind==="resume")return null;if(X)return h.jsxs("div",{className:"app flex flex-col h-full",children:[h.jsxs("div",{className:Oh,children:[h.jsx("p",{children:X}),h.jsx($e,{variant:"primary",onClick:Ra,children:Ji()})]}),e.kind==="ssh"&&h.jsx(Jm,{runtime:e,corner:!0})]});if(Q&&!Ft)return h.jsxs("div",{className:Oh,children:[rc(),h.jsx($e,{onClick:()=>U(null),children:Gh()})]});if(Os&&!us)return h.jsxs("div",{className:Oh,children:[h.jsx("p",{role:"alert",children:Os}),h.jsx($e,{onClick:ja,children:Ji()})]});if(Q===null||B===null||!sa||v===null)return h.jsxs("div",{className:"app flex flex-col h-full",children:[h.jsx("div",{className:Oh,children:h.jsx(Ot,{})}),e.kind==="ssh"&&h.jsx(Jm,{runtime:e,corner:!0})]});if(!Ft||(i==null?void 0:i.kind)==="task"&&c&&!(v!=null&&v.includes(c)))return h.jsxs("div",{className:Oh,children:[rc(),h.jsx($e,{onClick:()=>U(null),children:Gh()})]});const Me=h.jsx(S4t,{projectName:((Ue=Q.find(J=>J.id===n))==null?void 0:Ue.name)??"",onHome:()=>void r.navigate({to:"/projects"}),onNewProject:()=>tt(!0),onRepository:()=>Ut("git"),onCollapse:()=>Pn(!1)});return h.jsxs("div",{className:"app flex flex-col h-full",children:[e.kind==="local"&&h.jsx(BR,{}),e.kind==="local"&&h.jsx(HR,{status:q}),Os&&h.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-4 py-2 text-subtext",children:[h.jsx("span",{children:Os}),h.jsx($e,{onClick:ja,children:Ji()})]}),h.jsxs("div",{className:"app-body flex flex-1 min-h-0 py-0 px-3.5",children:[n&&h.jsx(Qvt,{projectId:n,projectName:(Ft==null?void 0:Ft.name)??"",railHeader:Me,railOpen:Zt,onShowRail:()=>Pn(!0),mainView:a,onSelectMainView:Ut,experimentsActive:a==="chat"&&u&&b==="experiments",filesActive:a==="chat"&&u&&b==="files",artifactsActive:a==="chat"&&u&&b==="artifacts",onOpenExperiments:()=>fi(),onOpenArtifacts:er,onOpenFile:ml,onOpenRun:pl,runExperimentName:_i,onOpenExperiment:Ma,experimentName:$i,onOpenPlan:Nc,onOpenSubagent:gl,onOpenWorktree:Vu,composerPrefill:Ft&&ou(Ft.id)&&(B==null?void 0:B.tourCompleted)===!1?Itt:null,runtime:e,onOpenDemoWelcome:Ft&&ou(Ft.id)?kc:void 0,activeSessionId:c,onActiveSessionChange:Ta,preferredAgent:B.preferredAgent,onPreferredAgentChange:Is,children:a==="skills"?h.jsx(Ywt,{}):a!=="chat"?h.jsx(wbt,{remote:e.kind==="ssh",tab:a,project:Ft,onProjectUpdate:J=>{Z(de=>de?Ih(de,J):[J])},onSelectTab:Ut}):null}),a==="chat"&&u&&h.jsxs("aside",{className:`right-pane relative shrink-0 min-w-0 flex flex-col mt-5 me-0 mb-5 ms-3.5 bg-canvas [&.max]:fixed [&.max]:inset-2.5 [&.max]:m-0 [&.max]:z-60 [&.max]:shadow-panel-max border border-border rounded-lg overflow-hidden shadow-elevated ${Fr?"max":""}`,style:Fr?void 0:{width:cs},"data-onboarding":"experiments",children:[h.jsx("div",{className:`panel-resizer absolute start-0 top-0 bottom-0 w-1.5 z-30 [&:hover]:bg-resizer-hover [&:active]:bg-resizer-hover ${Fr?"cursor-e-resize":"cursor-col-resize"}`,title:Fr?xX():mX(),onPointerDown:Tc}),h.jsxs("div",{className:"tabs flex items-end gap-0 pt-1 pe-1.5 pb-0 ps-2 h-10 border-b border-b-border bg-background shrink-0",children:[h.jsxs("div",{className:"tab-strip flex items-end gap-0.5 flex-1 min-w-0 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[Bd.map(vl),wr&&h.jsx(Xl,{active:b==="files",label:FX(),icon:h.jsx(h_,{size:12,className:"shrink-0"}),onSelect:()=>Cn("files"),onClose:()=>jc("files")}),Wn&&h.jsx(Xl,{active:b==="artifacts",label:aX(),icon:h.jsx(E4,{size:12,className:"shrink-0"}),onSelect:()=>Cn("artifacts"),onClose:()=>jc("artifacts")}),cr&&h.jsx(Xl,{active:b==="experiments",label:BX(),icon:h.jsx(k4,{size:12,className:"shrink-0"}),onSelect:()=>Cn("experiments"),onClose:()=>jc("experiments")}),Lc.map(Ne)]}),h.jsxs("div",{className:"panel-controls inline-flex items-center gap-0.5 self-center py-0 px-1.5 shrink-0",children:[h.jsx(Yt,{title:Fr?U7():F7(),"aria-label":Fr?U7():F7(),onClick:()=>ns(J=>!J),children:Fr?h.jsx(Sot,{size:14}):h.jsx(xot,{size:14})}),h.jsx(Yt,{title:qm(),"aria-label":qm(),onClick:()=>{I(),ns(!1)},children:h.jsx(Dr,{size:14})})]})]}),!us||((t==null?void 0:t.kind)==="experiment"||(t==null?void 0:t.kind)==="code")&&!se||(t==null?void 0:t.kind)==="experiment"&&t.runId&&!oe?h.jsx(da,{children:h.jsx(Ot,{})}):fs&&(!te||_&&!pe.some(J=>J.id===_&&J.experimentId===fs.id))||ko&&!be||t&&"sessionId"in t&&t.sessionId&&!(v!=null&&v.includes(t.sessionId))?h.jsx(da,{children:h.jsx("div",{className:"p-6 text-subtext",children:rc()})}):b==="artifacts"?h.jsx(da,{children:Ft&&h.jsx(Hwt,{project:Ft,artifacts:rt,onChanged:di,onOpenFile:Ys,canRenameFile:J=>{var de;return!((de=Nt.current.get(bs(Ft.id,c,{path:J,source:"artifacts"})))!=null&&de.needsProtection)},onOpenStorage:e.kind==="ssh"?void 0:()=>Ut("storage")},Ft.id)}):b==="experiments"?h.jsxs(da,{children:[h.jsxs("div",{className:"pane-toolbar flex shrink-0 flex-wrap items-center gap-2 bg-background px-3 pt-2.5 pb-2",children:[h.jsx("span",{className:"flex-1"}),h.jsxs("div",{className:"experiments-toolbar-controls inline-flex items-center gap-[5px]",children:[h.jsxs("div",{className:"option-picker relative inline-flex",ref:Ht,children:[h.jsx(Yt,{size:"small",ref:Je,className:"experiment-scope-trigger",active:nn==="agent",title:TX({scope:nn==="agent"?P7():H7()}),"aria-label":VX(),"aria-expanded":ft,onClick:()=>mt(J=>!J),children:h.jsx(iot,{size:16,strokeWidth:2.5})}),ft&&h.jsxs("div",{className:"option-menu absolute bottom-[calc(100%_+_8px)] start-0 max-h-95 flex flex-col bg-background border border-border rounded-lg shadow-menu z-50 overflow-hidden min-w-47.5 p-1.5 [&.align-right]:start-auto [&.align-right]:end-0 [&.drop-down]:bottom-auto [&.drop-down]:top-[calc(100%_+_4px)] [&.session-menu]:start-auto [&.session-menu]:end-1.5 [&.session-menu]:top-[calc(100%_-_2px)] [&.session-menu]:min-w-35 drop-down align-right experiment-scope-menu [&_.model-item]:whitespace-nowrap [&_.model-item:disabled]:text-muted [&_.model-item:disabled]:cursor-default [&_.model-item:disabled:hover]:bg-transparent",children:[h.jsxs(Er,{"aria-pressed":nn==="agent",disabled:!c||!Jt,title:c?Jt?void 0:XX():sZ(),onClick:()=>{Oe("agent"),mt(!1)},children:[h.jsx("span",{children:P7()}),nn==="agent"&&h.jsx(zi,{size:13})]}),h.jsxs(Er,{"aria-pressed":nn==="project",onClick:()=>{Oe("project"),mt(!1)},children:[h.jsx("span",{children:H7()}),nn==="project"&&h.jsx(zi,{size:13})]})]})]}),h.jsxs("div",{className:"seg inline-flex items-center gap-0.5 rounded-md bg-hover-subtle [&_button]:font-medium [&_button]:text-text [&_button]:rounded-sm [&_button:not(:disabled):hover]:text-text [&_button.active]:bg-background [&_button.active]:shadow-segment [&_button:disabled]:text-muted [&_button:disabled]:cursor-default experiments-view-toggle p-0.5 [&_button]:py-0.5 [&_button]:px-2 [&_button]:text-sm",role:"group","aria-label":LX(),children:[h.jsx("button",{className:ut==="table"?"active":"","aria-pressed":ut==="table",onClick:()=>pt("table"),children:MZ()}),h.jsx("button",{className:ut==="tree"?"active":"","aria-pressed":ut==="tree",onClick:()=>pt("tree"),children:IZ()})]})]})]}),h.jsx("div",{className:"pane-content flex-1 min-h-0 relative bg-background",children:ut==="tree"?Ft&&h.jsx(K8t,{experiments:le,runs:Rn,project:Ft,onOpenView:pr,onOpenCode:yo,agentSessionId:nn==="agent"?c:null,onShowProjectScope:Bs}):h.jsx(k4t,{runs:Rn,emptyHint:nn==="agent"&&le.length>0?eZ():void 0,experiments:Lt,onOpen:(J,de)=>{pr(J.id,"overview",de)},onOpenLogs:(J,de,ye)=>{pr(J,"terminal",ye,de)},onOpenCode:(J,de)=>{const ye=le.find(Ae=>Ae.id===J);ye&&yo(ye.id,ye.branchName,"files",de)},onCancel:wA})})]}):b==="files"?h.jsx(da,{children:Ft?h.jsx(jwt,{sessionId:c??void 0,project:Ft,view:Hr,toggled:ts,onViewChange:Ms,onToggledChange:Ls,canRenameFile:J=>{var de;return!((de=Nt.current.get(bs(Ft.id,c,{path:J,source:"repo",sessionId:c??void 0})))!=null&&de.needsProtection)},onOpenFile:(J,de,ye,Ae)=>pi(J,de,ye,void 0,void 0,void 0,Ae)},`files:${c??`project:${Ft.id}`}`):h.jsx("div",{className:"code-tab flex flex-col h-full min-h-0 wt-tab",children:h.jsx(Kf,{children:h.jsxs("div",{className:"wt-empty flex flex-col items-center gap-2.5 py-12 px-6 text-center text-muted [&_>_svg]:text-subtext [&_p]:m-0 [&_p]:max-w-80 [&_p]:text-sm",children:[h.jsx(zR,{size:22}),h.jsx("p",{children:gZ()})]})})})}):En?h.jsx(da,{children:n&&h.jsx(w4t,{remote:e.kind==="ssh",restored:w.current.has(bs(n,c,En)),onRestoreActivated:()=>{const J=bs(n,c,En);w.current.delete(J),C.current.add(J)},showSource:z.current[bs(n,c,En)]??!1,onShowSourceChange:J=>{z.current[bs(n,c,En)]=J,R(de=>de+1)},projectId:n,path:En.path,source:En.source,sessionId:En.source==="artifacts"?c??void 0:En.sessionId,gitRef:En.ref,line:En.line,branchLabel:Z8t(En,Ft==null?void 0:Ft.baselineBranch),artifactVersion:Id,artifactEntries:En.source==="artifacts"?rt==null?void 0:rt.entries:void 0,bufferSession:on(bs(n,c,En)),onOpenFile:(J,de,ye,Ae)=>ks(En,()=>pi(J,de,ye,void 0,void 0,void 0,Ae)),scrollPosition:rn.current.get(bs(n,c,En)),onScrollPositionChange:J=>{rn.current.set(bs(n,c,En),J),_r()},lineScrollRequest:En.lineScrollRequest,onLineScrollRequestHandled:()=>Ec(En),onEdit:()=>Gr(En)},bs(n,c,En))}):mr?h.jsx(da,{children:h.jsx("div",{className:"pane-content flex-1 min-h-0 relative plan-tab-content overflow-y-auto bg-background py-4.5 px-6 [&_.md]:max-w-readable",children:h.jsx(ro,{text:(wo==null?void 0:wo.key)===`${mr.sessionId}:${mr.promptId}`?wo.text??rc():((ot=Qe.find(J=>J.promptId===mr.promptId))==null?void 0:ot.plan)||fT(),onOpenFile:(J,de,ye,Ae,ke)=>ks(mr,()=>pi(J,mr.sessionId,Ae,de,ye,void 0,ke))})})}):is?h.jsx(Jvt,{sessionId:is.sessionId,spawnPartId:is.spawnPartId,onOpenFile:(J,de,ye,Ae,ke)=>ks(is,()=>ml(J,is.sessionId,de,ye,Ae,ke)),onOpenRun:(J,de)=>ks(is,()=>pl(J,de)),runExperimentName:_i,onOpenExperiment:(J,de)=>ks(is,()=>Ma(J,de)),experimentName:$i,onOpenSubagent:(J,de,ye)=>ks(is,()=>gl(is.sessionId,J,de,ye))},is.spawnPartId):gr?h.jsx(da,{children:n&&Ft&&gr&&be&&h.jsx(zwt,{projectId:n,project:Ft,experiment:be,view:gr.view,toggled:gr.toggled,onViewChange:J=>qu(gr,{view:J}),onToggledChange:J=>qu(gr,{toggled:J}),onOpenFile:(J,de,ye,Ae)=>ks(gr,()=>pi(J,de,ye,void 0,void 0,be.branchName,Ae))},`code:${gr.branch}`)}):h.jsx(da,{children:fs&&te&&Ft&&h.jsx(e4t,{experiment:te,project:Ft,view:fs.view,runs:pe,selectedRunId:_,onSelectRun:H,parentExperiment:le.find(J=>J.id===te.parentExperimentId)??null,onOpenView:(J,de,ye)=>{ks(fs,()=>pr(te.id,J,ye,de))},onOpenCode:(J,de)=>ks(fs,()=>yo(te.id,te.branchName,J,de))},`${fs.id}:${fs.view}`)})]})]}),rs&&h.jsx(IR,{remote:e.kind==="ssh",onClose:()=>tt(!1),onCreated:(J,de)=>{tt(!1),Od(J,de)}}),Kr&&Ft&&ou(Ft.id)&&h.jsx(C4t,{onClose:Aa,onCreateProject:ui})]})}const Mw=ao()({validateSearch:e=>({pane:p4(e.pane)}),beforeLoad:({location:e})=>{if(!Su(e.pathname))throw iH()},component:aCt});function aCt(){const{projectId:e}=Mw.useParams(),{pane:n}=Mw.useSearch(),t=Vs(),r=tT({select:s=>s.location});return T.useEffect(()=>{const s=oCt(r.searchStr);s!==null&&t.navigate({href:`${r.pathname}${s}${r.hash?`#${r.hash}`:""}`,replace:!0})},[r,t]),h.jsxs(h.Fragment,{children:[h.jsx(i_,{}),h.jsx(iCt,{projectId:e,pane:n,runtime:pR()},e)]})}function oCt(e){const n=new URLSearchParams(e);if(!n.has("pane"))return null;try{if(n.getAll("pane").length===1&&p4(JSON.parse(n.get("pane")??"")))return null}catch{}n.delete("pane");const t=n.toString();return t?`?${t}`:""}const s$=ao()({component:lCt});function lCt(){const{projectId:e}=s$.useParams();return h.jsx(Blt,{projectId:e})}const cCt=ao()({}),uCt=ao()({}),fCt=ao()({}),dCt=ao()({}),hCt=Plt.update({id:"/",path:"/",getParentRoute:()=>Ug}),M3=Hlt.update({id:"/projects",path:"/projects",getParentRoute:()=>Ug}),_Ct=Flt.update({id:"/remote-launch",path:"/remote-launch",getParentRoute:()=>Ug}),pCt=Ult.update({id:"/",path:"/",getParentRoute:()=>M3}),Md=Mw.update({id:"/$projectId",path:"/$projectId",getParentRoute:()=>M3}),mCt=s$.update({id:"/",path:"/",getParentRoute:()=>Md}),gCt=cCt.update({id:"/skills",path:"/skills",getParentRoute:()=>Md}),bCt=uCt.update({id:"/settings/$tab",path:"/settings/$tab",getParentRoute:()=>Md}),vCt=fCt.update({id:"/tasks/$sessionId",path:"/tasks/$sessionId",getParentRoute:()=>Md}),xCt=dCt.update({id:"/tasks/new",path:"/tasks/new",getParentRoute:()=>Md}),yCt={ProjectsProjectIdSkillsRoute:gCt,ProjectsProjectIdIndexRoute:mCt,ProjectsProjectIdSettingsTabRoute:bCt,ProjectsProjectIdTasksSessionIdRoute:vCt,ProjectsProjectIdTasksNewRoute:xCt},wCt=Md._addFileChildren(yCt),SCt={ProjectsProjectIdRoute:wCt,ProjectsIndexRoute:pCt},kCt=M3._addFileChildren(SCt),CCt={IndexRoute:hCt,ProjectsRoute:kCt,RemoteLaunchRoute:_Ct},ECt=Ug._addFileChildren(CCt)._addFileTypes(),NCt=EF({routeTree:ECt,trailingSlash:"never",defaultPendingComponent:L4,defaultErrorComponent:D4,defaultNotFoundComponent:Olt}),zCt=j();document.documentElement.lang=zCt;document.documentElement.dir="ltr";DP.createRoot(document.getElementById("root")).render(h.jsxs(T.StrictMode,{children:[h.jsx(jF,{router:NCt}),h.jsx(pit,{})]})); diff --git a/ui/dist/index.html b/ui/dist/index.html index b9522d9e..51f70ce9 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -49,7 +49,7 @@ html { background: #ffffff; } html[data-theme="dark"] { background: #0e0c0c; } - + diff --git a/ui/package.json b/ui/package.json index 05f96023..88dbedfa 100644 --- a/ui/package.json +++ b/ui/package.json @@ -5,7 +5,9 @@ "type": "module", "scripts": { "dev": "vite", - "build": "pnpm lint:i18n && paraglide-js compile --silent --emit-ts-declarations && tsc --noEmit && vite build", + "build": "pnpm lint:i18n && paraglide-js compile --silent --emit-ts-declarations && pnpm typecheck && vite build", + "routes:generate": "tsr generate", + "typecheck": "pnpm routes:generate && tsc --noEmit", "lint:i18n": "node scripts/check-i18n.mjs", "lint:styles": "node scripts/check-styles.mjs", "test": "node --test --experimental-strip-types tests/*.test.mjs", @@ -14,6 +16,7 @@ "dependencies": { "@clo/react-markdown": "jsr:1.1.1", "@inlang/paraglide-js": "^2.25.0", + "@tanstack/react-router": "^1.170.32", "@xterm/addon-fit": "^0.10.0", "@xterm/addon-web-links": "^0.11.0", "@xterm/xterm": "^5.5.0", @@ -36,6 +39,8 @@ }, "devDependencies": { "@tailwindcss/vite": "4.3.3", + "@tanstack/router-cli": "^1.167.33", + "@tanstack/router-plugin": "^1.168.35", "@types/react": "^19.1.0", "@types/react-dom": "^19.1.0", "@vitejs/plugin-react": "^4.5.0", diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 264c9437..c09d0437 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@inlang/paraglide-js': specifier: ^2.25.0 version: 2.25.0(typescript@5.9.3)(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0)) + '@tanstack/react-router': + specifier: ^1.170.32 + version: 1.170.32(react-dom@19.2.7(react@19.2.7))(react@19.2.7) '@xterm/addon-fit': specifier: ^0.10.0 version: 0.10.0(@xterm/xterm@5.5.0) @@ -75,6 +78,12 @@ importers: '@tailwindcss/vite': specifier: 4.3.3 version: 4.3.3(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0)) + '@tanstack/router-cli': + specifier: ^1.167.33 + version: 1.167.33 + '@tanstack/router-plugin': + specifier: ^1.168.35 + version: 1.168.35(@tanstack/react-router@1.170.32(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(esbuild@0.25.12)(rollup@4.62.2)(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0)) '@types/react': specifier: ^19.1.0 version: 19.2.17 @@ -624,6 +633,68 @@ packages: peerDependencies: vite: ^5.2.0 || ^6 || ^7 || ^8 + '@tanstack/history@1.162.1': + resolution: {integrity: sha512-DR9t6lfLVdrjgCwpglrR9DR7Ok8/HlXjcOE+goWXF3zyuLUO/ug7vMbSFxTqrQTtbRghJfyhmIZ0S6LhPIy44w==} + engines: {node: '>=20.19'} + + '@tanstack/react-router@1.170.32': + resolution: {integrity: sha512-SIpxvaTKco100a5ZR3ePmArbhtm3XOx+w1dpGYY9gxHDta4iXSKDdQuhLonwJbIMkVJsU1rwXf0UDHMrF/1snw==} + engines: {node: '>=20.19'} + peerDependencies: + react: '>=18.0.0 || >=19.0.0' + react-dom: '>=18.0.0 || >=19.0.0' + + '@tanstack/react-store@0.9.3': + resolution: {integrity: sha512-y2iHd/N9OkoQbFJLUX1T9vbc2O9tjH0pQRgTcx1/Nz4IlwLvkgpuglXUx+mXt0g5ZDFrEeDnONPqkbfxXJKwRg==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + + '@tanstack/router-cli@1.167.33': + resolution: {integrity: sha512-OZcP4zmzj85rLq2Cr6I3tZDT9Yb8gsquDgka+baKOKXJULBqP5uZ56X8Ggrgq5IBypk47/b1K2tA1qChd1qUig==} + engines: {node: '>=20.19'} + hasBin: true + + '@tanstack/router-core@1.171.27': + resolution: {integrity: sha512-wDwSLvoLwIaNcnx9UNcN9Mb7Y8QwCYq1U1RQZwyN186gnkIoIYI2SOxy8VqH1vFigbkHkk4FmwMAQlghPgDK2g==} + engines: {node: '>=20.19'} + + '@tanstack/router-generator@1.167.33': + resolution: {integrity: sha512-Z3lCWIPuRUMPmuI8Mm48x/s49TxmHOaFVZ52j1W1QKYrsFHyT6U/h9bqfHJDxfQ8kz7y9q+W1YPKZ15Ee7yuCA==} + engines: {node: '>=20.19'} + + '@tanstack/router-plugin@1.168.35': + resolution: {integrity: sha512-foDAZKFqHXae+oFbIgcsSvy2QCVRn7XdS3nhwcRvD+ed6JrKPUP/1lQMsZLJqWycgR1vkZF7gs955KGa0NZQ0w==} + engines: {node: '>=20.19'} + peerDependencies: + '@rsbuild/core': '>=1.0.2 || ^2.0.0' + '@tanstack/react-router': ^1.170.32 + vite: '>=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0' + vite-plugin-solid: ^2.11.10 || ^3.0.0-0 + webpack: '>=5.92.0' + peerDependenciesMeta: + '@rsbuild/core': + optional: true + '@tanstack/react-router': + optional: true + vite: + optional: true + vite-plugin-solid: + optional: true + webpack: + optional: true + + '@tanstack/router-utils@1.162.2': + resolution: {integrity: sha512-hTWqJtqIFFdvuCl8WXNyrodp2L9zo2G37xKRrcVmVRWpAB2h+U1LuRAfS4tsFTiWOIoE/B+WDVFB8JpoEdw6jQ==} + engines: {node: '>=20.19'} + + '@tanstack/store@0.9.3': + resolution: {integrity: sha512-8reSzl/qGWGGVKhBoxXPMWzATSbZLZFWhwBAFO9NAyp0TxzfBP0mIrGb8CP8KrQTmvzXlR/vFPPUrHTLBGyFyw==} + + '@tanstack/virtual-file-routes@1.162.0': + resolution: {integrity: sha512-uhOeFyxLcU41HzvrxsGpiWdcMbScY1EDgbZ5K7DVRMYInbLYWAC0EA/kx9wXAoSM8q82bUG2hRl8+EAjE6XAbA==} + engines: {node: '>=20.19'} + '@types/babel__core@7.20.5': resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} @@ -735,9 +806,24 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansis@4.3.1: + resolution: {integrity: sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA==} + engines: {node: '>=14'} + array-timsort@1.0.3: resolution: {integrity: sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ==} + babel-dead-code-elimination@1.0.12: + resolution: {integrity: sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig==} + bail@2.0.2: resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} @@ -769,12 +855,27 @@ packages: character-reference-invalid@2.0.1: resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + chokidar@5.0.0: + resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} + engines: {node: '>= 20.19.0'} + classcat@5.0.5: resolution: {integrity: sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==} classnames@2.5.1: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} + cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} @@ -797,6 +898,9 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + cookie-es@3.1.1: + resolution: {integrity: sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==} + csstype@3.2.3: resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} @@ -864,9 +968,16 @@ packages: diff-match-patch@1.0.5: resolution: {integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==} + diff@8.0.4: + resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==} + engines: {node: '>=0.3.1'} + electron-to-chromium@1.5.387: resolution: {integrity: sha512-TaxwufTFDufvPEoXdhwVrA3UdFWBeWGkYoJ1K8ldF1xe6gKfth6iRNS5lTQ5JPNOHdGQm8PT1QYKUqFLCiUefQ==} + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + enhanced-resolve@5.24.5: resolution: {integrity: sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==} engines: {node: '>=10.13.0'} @@ -920,6 +1031,10 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + gitdiff-parser@0.3.1: resolution: {integrity: sha512-YQJnY8aew65id8okGxKCksH3efDCJ9HzV7M9rsvd65habf39Pkh4cgYJ27AaoDMqo1X98pgNJhNMrm/kpV7UVQ==} @@ -971,6 +1086,10 @@ packages: is-decimal@2.0.1: resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + is-hexadecimal@2.0.1: resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} @@ -978,6 +1097,10 @@ packages: resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} engines: {node: '>=12'} + isbot@5.2.2: + resolution: {integrity: sha512-iQcBXcd+Rv/pkubRyGh2utW2j1oPG5hZY6TUhVPpqK4G+o3IbxpJNx04hgksjc/N7GK5pEorUxDeg31cFgEk/w==} + engines: {node: '>=18'} + jiti@2.7.0: resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==} hasBin: true @@ -1250,6 +1373,9 @@ packages: parse5@7.3.0: resolution: {integrity: sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==} + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -1261,6 +1387,11 @@ packages: resolution: {integrity: sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==} engines: {node: ^10 || ^12 || >=14} + prettier@3.9.6: + resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==} + engines: {node: '>=14'} + hasBin: true + property-information@7.2.0: resolution: {integrity: sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==} @@ -1288,6 +1419,10 @@ packages: resolution: {integrity: sha512-HNe9WslTbXmFK8o8cmwgAeJFSBvt1bPdHCVKtaaV+WlAN36mpT4hcRpwbf3fY56ar2oIXzsBpOAiIRHAdY0OlQ==} engines: {node: '>=0.10.0'} + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} + engines: {node: '>= 20.19.0'} + refractor@5.0.0: resolution: {integrity: sha512-QXOrHQF5jOpjjLfiNk5GFnWhRXvxjUVnlFxkeDmewR5sXkr3iM46Zo+CnRR8B+MDVqkULW4EcLVcRBNOPXHosw==} @@ -1312,6 +1447,10 @@ packages: remark-stringify@11.0.0: resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + rollup@4.62.2: resolution: {integrity: sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -1324,6 +1463,16 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true + seroval-plugins@1.6.4: + resolution: {integrity: sha512-R0f1U9hmn38+dFMz6b6ab8lwucmw4AtiY7St+JPWudy1dm+Bs3g884nyrsH9Cy6rKpZKLYayXuMda9GZ/fl8JQ==} + engines: {node: '>=10'} + peerDependencies: + seroval: ^1.0 + + seroval@1.6.4: + resolution: {integrity: sha512-LErWMNS2RRFdu2RMA5u/PA59/IWs0XsikyEXGQ2/36iEWFrdG0ABmg17E17cikrv76891kOAMq3TkTFXpwAHXw==} + engines: {node: '>=10'} + shallow-equal@3.1.0: resolution: {integrity: sha512-pfVOw8QZIXpMbhBWvzBISicvToTiM5WBF1EeAUZDDSb5Dt29yl4AYbyywbJFSEsRUMr7gJaxqCdr4L3tQf9wVg==} @@ -1349,9 +1498,17 @@ packages: peerDependencies: kysely: '*' + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + stringify-entities@4.0.4: resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + style-to-js@1.1.21: resolution: {integrity: sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==} @@ -1411,6 +1568,39 @@ packages: resolution: {integrity: sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==} engines: {node: '>=18.12.0'} + unplugin@3.3.0: + resolution: {integrity: sha512-qa66K+crbfyE6JK10GjvbJeRrOsuC/JpbnHctfyp/i4oBTxWOzJfRZyDiOk1PtErMFRu8JhsU/wPvOdBNWe5Rg==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + '@farmfe/core': '*' + '@rspack/core': '*' + bun-types-no-globals: '*' + esbuild: '*' + rolldown: '*' + rollup: '*' + unloader: '*' + vite: '*' + webpack: '*' + peerDependenciesMeta: + '@farmfe/core': + optional: true + '@rspack/core': + optional: true + bun-types-no-globals: + optional: true + esbuild: + optional: true + rolldown: + optional: true + rollup: + optional: true + unloader: + optional: true + vite: + optional: true + webpack: + optional: true + update-browserslist-db@1.2.3: resolution: {integrity: sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==} hasBin: true @@ -1495,9 +1685,28 @@ packages: webpack-virtual-modules@0.6.2: resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==} + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + + yargs@17.7.3: + resolution: {integrity: sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==} + engines: {node: '>=12'} + + zod@4.5.4: + resolution: {integrity: sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA==} + zustand@4.5.7: resolution: {integrity: sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==} engines: {node: '>=12.7.0'} @@ -1940,6 +2149,93 @@ snapshots: tailwindcss: 4.3.3 vite: 6.4.3(jiti@2.7.0)(lightningcss@1.32.0) + '@tanstack/history@1.162.1': {} + + '@tanstack/react-router@1.170.32(react-dom@19.2.7(react@19.2.7))(react@19.2.7)': + dependencies: + '@tanstack/history': 1.162.1 + '@tanstack/react-store': 0.9.3(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + '@tanstack/router-core': 1.171.27 + isbot: 5.2.2 + react: 19.2.7 + react-dom: 19.2.7(react@19.2.7) + + '@tanstack/react-store@0.9.3(react-dom@19.2.7(react@19.2.7))(react@19.2.7)': + dependencies: + '@tanstack/store': 0.9.3 + react: 19.2.7 + react-dom: 19.2.7(react@19.2.7) + use-sync-external-store: 1.6.0(react@19.2.7) + + '@tanstack/router-cli@1.167.33': + dependencies: + '@tanstack/router-generator': 1.167.33 + chokidar: 5.0.0 + yargs: 17.7.3 + transitivePeerDependencies: + - supports-color + + '@tanstack/router-core@1.171.27': + dependencies: + '@tanstack/history': 1.162.1 + cookie-es: 3.1.1 + seroval: 1.6.4 + seroval-plugins: 1.6.4(seroval@1.6.4) + + '@tanstack/router-generator@1.167.33': + dependencies: + '@babel/types': 7.29.7 + '@tanstack/router-core': 1.171.27 + '@tanstack/router-utils': 1.162.2 + '@tanstack/virtual-file-routes': 1.162.0 + jiti: 2.7.0 + magic-string: 0.30.21 + prettier: 3.9.6 + zod: 4.5.4 + transitivePeerDependencies: + - supports-color + + '@tanstack/router-plugin@1.168.35(@tanstack/react-router@1.170.32(react-dom@19.2.7(react@19.2.7))(react@19.2.7))(esbuild@0.25.12)(rollup@4.62.2)(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0))': + dependencies: + '@babel/core': 7.29.7 + '@babel/template': 7.29.7 + '@babel/types': 7.29.7 + '@tanstack/router-core': 1.171.27 + '@tanstack/router-generator': 1.167.33 + '@tanstack/router-utils': 1.162.2 + chokidar: 5.0.0 + unplugin: 3.3.0(esbuild@0.25.12)(rollup@4.62.2)(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0)) + zod: 4.5.4 + optionalDependencies: + '@tanstack/react-router': 1.170.32(react-dom@19.2.7(react@19.2.7))(react@19.2.7) + vite: 6.4.3(jiti@2.7.0)(lightningcss@1.32.0) + transitivePeerDependencies: + - '@farmfe/core' + - '@rspack/core' + - bun-types-no-globals + - esbuild + - rolldown + - rollup + - supports-color + - unloader + + '@tanstack/router-utils@1.162.2': + dependencies: + '@babel/generator': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/types': 7.29.7 + ansis: 4.3.1 + babel-dead-code-elimination: 1.0.12 + diff: 8.0.4 + pathe: 2.0.3 + tinyglobby: 0.2.17 + transitivePeerDependencies: + - supports-color + + '@tanstack/store@0.9.3': {} + + '@tanstack/virtual-file-routes@1.162.0': {} + '@types/babel__core@7.20.5': dependencies: '@babel/parser': 7.29.7 @@ -2069,8 +2365,25 @@ snapshots: acorn@8.18.0: {} + ansi-regex@5.0.1: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansis@4.3.1: {} + array-timsort@1.0.3: {} + babel-dead-code-elimination@1.0.12: + dependencies: + '@babel/core': 7.29.7 + '@babel/parser': 7.29.7 + '@babel/traverse': 7.29.7 + '@babel/types': 7.29.7 + transitivePeerDependencies: + - supports-color + bail@2.0.2: {} baseline-browser-mapping@2.10.42: {} @@ -2095,10 +2408,26 @@ snapshots: character-reference-invalid@2.0.1: {} + chokidar@5.0.0: + dependencies: + readdirp: 5.1.1 + classcat@5.0.5: {} classnames@2.5.1: {} + cliui@8.0.1: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + comma-separated-tokens@2.0.3: {} commander@11.1.0: {} @@ -2114,6 +2443,8 @@ snapshots: convert-source-map@2.0.0: {} + cookie-es@3.1.1: {} + csstype@3.2.3: {} d3-color@3.1.0: {} @@ -2170,8 +2501,12 @@ snapshots: diff-match-patch@1.0.5: {} + diff@8.0.4: {} + electron-to-chromium@1.5.387: {} + emoji-regex@8.0.0: {} + enhanced-resolve@5.24.5: dependencies: graceful-fs: 4.2.11 @@ -2229,6 +2564,8 @@ snapshots: gensync@1.0.0-beta.2: {} + get-caller-file@2.0.5: {} + gitdiff-parser@0.3.1: {} graceful-fs@4.2.11: {} @@ -2326,10 +2663,14 @@ snapshots: is-decimal@2.0.1: {} + is-fullwidth-code-point@3.0.0: {} + is-hexadecimal@2.0.1: {} is-plain-obj@4.1.0: {} + isbot@5.2.2: {} + jiti@2.7.0: {} js-tokens@4.0.0: {} @@ -2801,6 +3142,8 @@ snapshots: dependencies: entities: 6.0.1 + pathe@2.0.3: {} + picocolors@1.1.1: {} picomatch@4.0.5: {} @@ -2811,6 +3154,8 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 + prettier@3.9.6: {} + property-information@7.2.0: {} react-diff-view@3.3.3(react@19.2.7): @@ -2850,6 +3195,8 @@ snapshots: react@19.2.7: {} + readdirp@5.1.1: {} + refractor@5.0.0: dependencies: '@types/hast': 3.0.4 @@ -2918,6 +3265,8 @@ snapshots: mdast-util-to-markdown: 2.1.2 unified: 11.0.5 + require-directory@2.1.1: {} + rollup@4.62.2: dependencies: '@types/estree': 1.0.9 @@ -2953,6 +3302,12 @@ snapshots: semver@6.3.1: {} + seroval-plugins@1.6.4(seroval@1.6.4): + dependencies: + seroval: 1.6.4 + + seroval@1.6.4: {} + shallow-equal@3.1.0: {} sonner@2.0.8(@types/react@19.2.17)(react-dom@19.2.7(react@19.2.7))(react@19.2.7): @@ -2971,11 +3326,21 @@ snapshots: '@sqlite.org/sqlite-wasm': 3.48.0-build4 kysely: 0.28.17 + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + stringify-entities@4.0.4: dependencies: character-entities-html4: 2.1.0 character-entities-legacy: 3.0.0 + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + style-to-js@1.1.21: dependencies: style-to-object: 1.0.14 @@ -3051,6 +3416,16 @@ snapshots: picomatch: 4.0.5 webpack-virtual-modules: 0.6.2 + unplugin@3.3.0(esbuild@0.25.12)(rollup@4.62.2)(vite@6.4.3(jiti@2.7.0)(lightningcss@1.32.0)): + dependencies: + '@jridgewell/remapping': 2.3.5 + picomatch: 4.0.5 + webpack-virtual-modules: 0.6.2 + optionalDependencies: + esbuild: 0.25.12 + rollup: 4.62.2 + vite: 6.4.3(jiti@2.7.0)(lightningcss@1.32.0) + update-browserslist-db@1.2.3(browserslist@4.28.4): dependencies: browserslist: 4.28.4 @@ -3105,8 +3480,30 @@ snapshots: webpack-virtual-modules@0.6.2: {} + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + y18n@5.0.8: {} + yallist@3.1.1: {} + yargs-parser@21.1.1: {} + + yargs@17.7.3: + dependencies: + cliui: 8.0.1 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + + zod@4.5.4: {} + zustand@4.5.7(@types/react@19.2.17)(react@19.2.7): dependencies: use-sync-external-store: 1.6.0(react@19.2.7) diff --git a/ui/src/App.tsx b/ui/src/App.tsx index d7eb8815..7f35da4c 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -1,3 +1,8 @@ +import { useBlocker, useRouter, useRouterState } from "@tanstack/react-router"; +import { getTaskWorkspace, parseDestination, safeLocation, taskLocation, type Pane, type TaskWorkspace } from "./workspaceState"; +import { getRememberedGlobalWorkspace, globalWorkspaceWriter } from "./workspacePersistence"; +import { type ExpViewDef, sameExpTab, type FileViewDef, sameFileTab, fileTabKey, fileScrollKey, persistentFileTab, persistentRightTab, type PlanViewDef, type SubagentViewDef, type CodeTabDef, sameCodeTab, type RightTab, type ContentTab, rightTabKey, withoutTab, isPresent, type RightPaneSessionState, initialRightPaneSessionState, tabPane, paneTab, defaultTaskWorkspace } from "./workspaceTabs"; +import { getCachedProjectWorkspace, inheritNewTaskWorkspace, useProjectWorkspace } from "./useProjectWorkspace"; import { m } from "./paraglide/messages.js"; import { getLocale } from "./paraglide/runtime.js"; import { useLocale } from "./locale"; @@ -21,14 +26,13 @@ import { import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { cancelRun, - DEMO_FIGURE_SESSION_ID, - DEMO_LITERATURE_SESSION_ID, DEMO_MAIN_SESSION_ID, DEMO_OVERVIEW_ARTIFACT, DEMO_RUN_EXPERIMENT_PROMPT, getArtifacts, getChatMessages, getUiState, + listChatSessions, isDemoProjectId, listExperiments, listProjects, @@ -54,21 +58,19 @@ import { SkillsTab } from "./components/SkillsTab"; import { ClosableTab } from "./components/ClosableTab"; import { DetailDrawer, type ExperimentView } from "./components/DetailDrawer"; import { FileViewer, type FileScrollPosition } from "./components/FileViewer"; -import { confirmFileDiscard, type FileBufferState } from "./fileSync"; +import { confirmFileDiscard, FileBufferSession } from "./fileSync"; import { RailHeader } from "./components/Header"; import { UpdateBanner, useUpdateStatus } from "./components/UpdateBanner"; import { OfflineBanner } from "./components/OfflineBanner"; -import { Onboarding } from "./components/Onboarding"; -import { NewProjectDialog, ProjectsHome } from "./components/ProjectsHome"; +import { NewProjectDialog } from "./components/ProjectsHome"; import { ExperimentsTable } from "./components/ExperimentsTable"; import { Md } from "./components/Md"; import { SettingsView, type SettingsTab } from "./components/SettingsPage"; import { DemoWelcomeModal } from "./components/Tour"; -import { clearReadDemoSessions } from "./demoSessionState"; import { TreeView } from "./components/TreeView"; import { onChatEvent, useOrxEvents } from "./events"; import { closeTab, openTab, type TabOpenIntent } from "./tabPreview"; -import { Button, IconButton, MenuItem, Spinner } from "./components/ui"; +import { Button, IconButton, MenuItem, showAlert, Spinner } from "./components/ui"; import { CodeTabBody, TabBody } from "./components/layout/TabBody"; import { RemoteStatus } from "./components/RemoteStatus"; @@ -81,232 +83,6 @@ const EMPTY_STATE_CLASS_NAME = [ "[&_p.empty-state-hint]:text-lg [&_p.empty-state-hint]:text-subtext", ].join(" "); -/** An experiment view open as a right-panel tab. */ -interface ExpViewDef { - id: string; - view: ExperimentView; -} - -const sameExpTab = (a: ExpViewDef, b: ExpViewDef) => a.id === b.id && a.view === b.view; - -/** A project file open as a right-panel tab (clicked in chat tool rows or the - * code browser). */ -interface FileViewDef { - path: string; - /** Which backend serves this file. Absent/"repo" → the repo `/file` - * endpoint (worktree/clone/branch), falling back to artifacts when a - * non-ref path misses the checkout; "artifacts" → the project's durable - * output directory through the compatibility `/files/file` endpoint; - * "abs" → an absolute path on disk outside both (the `/files/abs` - * endpoint), for files an agent references anywhere on the machine. */ - source?: "repo" | "artifacts" | "abs"; - /** Chat session whose worktree holds the file (absent → hub clone). - * Artifact and absolute-path tabs never carry this. */ - sessionId?: string; - /** Branch whose committed copy to show (code browser in branch mode); - * overrides the live checkout. */ - ref?: string; - /** Branch to show in the header chip when the file is read from a checkout - * (no `ref`) whose branch isn't the baseline — e.g. an experiment's worktree. - * Display-only, so it's kept out of tab identity. */ - branchLabel?: string; - /** 1-based line to scroll to and highlight on open (from a `file:line` - * evidence chip). Not part of tab identity — reopening at a new line updates - * the same tab. */ - line?: number; - /** One-shot generation for explicit line navigation; omitted on stored tabs. */ - lineScrollRequest?: number; -} - -const sameFileTab = (a: FileViewDef, b: FileViewDef) => - a.path === b.path && - (a.source ?? "repo") === (b.source ?? "repo") && - a.sessionId === b.sessionId && - a.ref === b.ref; - -const fileTabKey = (t: FileViewDef) => - `${t.source ?? "repo"}:${t.sessionId ?? ""}:${t.ref ?? ""}:${t.path}`; - -const fileScrollKey = (projectId: string, ownerSessionId: string | null, tab: FileViewDef) => - `${projectId}:${ownerSessionId ?? ""}:${fileTabKey(tab)}`; - -const persistentFileTab = (tab: FileViewDef): FileViewDef => ({ - ...tab, - lineScrollRequest: undefined, -}); - -function persistentRightTab(tab: RightTab): RightTab { - return typeof tab === "object" && "path" in tab - ? persistentFileTab(tab) - : tab; -} - -/** A proposed plan open as a right-panel tab (from the chat plan strip/card). - * The markdown is already client-side (it rode the prompt part), so the tab - * renders it directly — no fetch. Deliberately has neither a `view` nor a - * `path` field: the other tab kinds discriminate on those. */ -interface PlanViewDef { - kind: "plan"; - sessionId: string; - /** The prompt part the plan came from — one tab per plan card. */ - promptId: string; - plan: string; -} - -/** A sub-agent's transcript, opened from a chat spawn row's "view" button. One - * tab per spawn part; its parts stream live off the session's chat message. */ -interface SubagentViewDef { - kind: "subagent"; - sessionId: string; - /** The `subagent` spawn part whose `children` are the sub-agent transcript. */ - spawnPartId: string; - /** The spawn row's activity label at open time — the tab title. */ - label?: string; -} - -/** One committed code-browser tab per experiment branch. Source, selected - * view, and expansion state live here so they survive tab switches. */ -interface CodeTabDef { - code: true; - experimentId: string; - branch: string; - view: CodeView; - /** Dirs the user flipped away from their depth default. */ - toggled: ReadonlySet; -} - -const sameCodeTab = (a: CodeTabDef, b: CodeTabDef) => a.branch === b.branch; - -type RightTab = - | "experiments" - | "files" - | "artifacts" - | ExpViewDef - | FileViewDef - | PlanViewDef - | SubagentViewDef - | CodeTabDef; - -type ContentTab = Exclude; - -function rightTabKey(tab: RightTab): string { - if (typeof tab === "string") return `home:${tab}`; - if ("code" in tab) return `code:${tab.branch}`; - if ("kind" in tab) { - return tab.kind === "plan" ? `plan:${tab.promptId}` : `subagent:${tab.spawnPartId}`; - } - if ("path" in tab) return `file:${fileTabKey(tab)}`; - return `experiment:${tab.id}:${tab.view}`; -} - -/** Drop `key`'s tab from one strip list, keeping the array identity (and so the - * effects keyed on it) when the tab doesn't live in this list. */ -function withoutTab(tabs: T[], key: string): T[] { - const next = tabs.filter((tab) => rightTabKey(tab) !== key); - return next.length === tabs.length ? tabs : next; -} - -function isPresent(value: T | undefined): value is T { - return value !== undefined; -} - -interface RightPaneSessionState { - rightTab: RightTab; - tabHistory: RightTab[]; - experimentsTabOpen: boolean; - filesTabOpen: boolean; - artifactsTabOpen: boolean; - expTabs: ExpViewDef[]; - fileTabs: FileViewDef[]; - planTabs: PlanViewDef[]; - subagentTabs: SubagentViewDef[]; - codeTabs: CodeTabDef[]; - /** Stable strip order for content tabs; home tabs keep their fixed leading slots. */ - contentTabOrder: string[]; - /** The reusable preview tab, replaced by the next preview open. */ - previewTab: RightTab | null; - filesView: WorktreeView; - filesToggled: ReadonlySet; - selectedRunId: string | null; - scope: "agent" | "project"; - panelOpen: boolean; - panelMax: boolean; -} - -function initialRightPaneSessionState( - sessionId?: string, - openDemoOverview = false, -): RightPaneSessionState { - const initial: RightPaneSessionState = { - rightTab: "experiments", - tabHistory: [], - experimentsTabOpen: false, - filesTabOpen: false, - artifactsTabOpen: false, - expTabs: [], - fileTabs: [], - planTabs: [], - subagentTabs: [], - codeTabs: [], - contentTabOrder: [], - previewTab: null, - filesView: "files", - filesToggled: new Set(), - selectedRunId: null, - scope: "project", - panelOpen: false, - panelMax: false, - }; - if (sessionId === DEMO_MAIN_SESSION_ID && openDemoOverview) { - const demoOverviewTab: FileViewDef = { - path: DEMO_OVERVIEW_ARTIFACT, - source: "artifacts", - }; - // First demo open leads with the experiments tab so the idle follow-ups - // are visible next to the prefilled prompt that runs one of them. - const experimentsTab: RightTab = "experiments"; - return { - ...initial, - rightTab: experimentsTab, - tabHistory: [demoOverviewTab, experimentsTab], - experimentsTabOpen: true, - fileTabs: [demoOverviewTab], - contentTabOrder: [rightTabKey(demoOverviewTab)], - panelOpen: true, - }; - } - if (sessionId === DEMO_FIGURE_SESSION_ID) { - const fileTabs: FileViewDef[] = [ - { path: "nanochat-base-training-curves.svg", source: "artifacts" }, - { path: "nanochat-sft-training-curves.svg", source: "artifacts" }, - { path: "nanochat-training-throughput.svg", source: "artifacts" }, - { path: "nanochat-core-evaluation.svg", source: "artifacts" }, - ]; - return { - ...initial, - rightTab: fileTabs[0], - tabHistory: [...fileTabs.slice(1), fileTabs[0]], - fileTabs, - contentTabOrder: fileTabs.map(rightTabKey), - panelOpen: true, - }; - } - if (sessionId === DEMO_LITERATURE_SESSION_ID) { - const fileTabs: FileViewDef[] = [ - { path: "nanochat-bottleneck-diagnosis.md", source: "artifacts" }, - ]; - return { - ...initial, - rightTab: fileTabs[0], - tabHistory: [fileTabs[0]], - fileTabs, - contentTabOrder: fileTabs.map(rightTabKey), - panelOpen: true, - }; - } - return initial; -} - /** Escape a string for literal use inside a RegExp. */ function escapeRegExp(s: string): string { return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); @@ -395,19 +171,8 @@ function fileBranchLabel(tab: FileViewDef, baselineBranch?: string): string | un return tab.ref ?? tab.branchLabel ?? baselineBranch; } -const PANEL_WIDTH_KEY = "orx:panel-width"; -const EXPERIMENTS_VIEW_KEY = "orx:experiments-view"; - type ExperimentsView = "tree" | "table"; -function initialExperimentsView(): ExperimentsView { - try { - return localStorage.getItem(EXPERIMENTS_VIEW_KEY) === "tree" ? "tree" : "table"; - } catch { - return "table"; - } -} - /** Floating panel sizing: keep both the panel and the chat column usable. */ const PANEL_MIN_WIDTH = 360; const PANEL_MARGIN = 10; @@ -430,12 +195,6 @@ function panelMaxWidth(): number { function initialPanelWidth(): number { const max = panelMaxWidth(); - try { - const saved = Number(localStorage.getItem(PANEL_WIDTH_KEY)); - if (Number.isFinite(saved) && saved >= PANEL_MIN_WIDTH) return Math.min(saved, max); - } catch { - // storage unavailable — fall through to the default - } return Math.max(PANEL_MIN_WIDTH, Math.min(760, max, Math.round(window.innerWidth * 0.4))); } @@ -455,18 +214,66 @@ function useStableStringMap(next: Map): Map { return current.current; } -export default function App({ runtime }: { runtime: RuntimeInfo }) { +export default function App({ runtime, projectId, pane }: { runtime: RuntimeInfo; projectId: string; pane?: Pane }) { + const router = useRouter(); + const location = useRouterState({ select: (state) => state.location }); + const destination = parseDestination(location.pathname); + const mainView = destination?.kind === "skills" ? "skills" : destination?.kind === "settings" ? destination.section ?? "settings" : "chat"; + const rememberedSessionRef = useRef(null); + const activeSessionId = destination?.kind === "task" ? destination.sessionId ?? null : rememberedSessionRef.current; + if (destination?.kind === "task") rememberedSessionRef.current = activeSessionId; + const panelOpen = pane !== undefined; + const selectedRunId = pane?.kind === "experiment" ? pane.runId ?? null : null; + const [consumedLine, setConsumedLine] = useState(null); + const [lineJump, setLineJump] = useState(0); + const lineVisit = useRef({ href: "", jump: 0, value: 0 }); + if (lineVisit.current.href !== location.href || lineVisit.current.jump !== lineJump) lineVisit.current = { href: location.href, jump: lineJump, value: lineVisit.current.value + 1 }; + const rightTab = useMemo(() => { + const tab = pane ? paneTab(pane) : "experiments"; + return typeof tab === "object" && "path" in tab && tab.line && consumedLine !== lineVisit.current.value + ? { ...tab, lineScrollRequest: lineVisit.current.value } : tab; + }, [pane, consumedLine, location.href, lineJump]); + const [sessions, setSessions] = useState(null); + const restoredFilesRef = useRef(new Set()); + const intentionalFilesRef = useRef(new Set()); + const sourceModesRef = useRef>({}); + const [metadataRevision, setMetadataRevision] = useState(0); + const navigationRef = useRef({ projectId, activeSessionId, pane, isTask: destination?.kind === "task" }); + navigationRef.current = { projectId, activeSessionId, pane, isTask: destination?.kind === "task" }; + const navigatePane = useCallback((next: Pane | undefined, replace = false) => { + const current = navigationRef.current; + if (current.projectId) void router.navigate({ href: taskLocation(current.projectId, current.activeSessionId, next), replace }); + }, [router]); + const setRightTab = useCallback((tab: RightTab) => { + const next = tabPane(tab); + navigatePane(next.kind === "file" ? { ...next, line: undefined } : next); + }, [navigatePane]); + const closePanel = useCallback(() => navigatePane(undefined), [navigatePane]); + const setSelectedRunId = useCallback((runId: string | null) => { + if (pane?.kind === "experiment") navigatePane({ ...pane, runId: runId ?? undefined }); + }, [pane, navigatePane]); + const setProjectId = useCallback((id: string | null) => { + void router.navigate({ href: id ? `/projects/${encodeURIComponent(id)}` : "/projects" }); + }, [router]); + const setMainView = useCallback((view: "chat" | "skills" | SettingsTab) => { + if (!projectId) return; + if (view === "chat") { + const id = rememberedSessionRef.current; + void router.navigate({ href: taskLocation(projectId, id, getTaskWorkspace(workspaceRef.current, id ?? "new")?.active) }); + } else void router.navigate({ href: `/projects/${encodeURIComponent(projectId)}/${view === "skills" ? "skills" : `settings/${view}`}` }); + }, [router, projectId]); + const locale = useLocale(); const { status: updateStatus } = useUpdateStatus(runtime.kind === "local"); const [projects, setProjects] = useState(null); const [uiState, setUiState] = useState(null); const tourCompletedRef = useRef(undefined); tourCompletedRef.current = uiState?.tourCompleted; - const demoOverviewSeededRef = useRef(false); const [startupError, setStartupError] = useState(null); const persistedPreferredAgent = useRef(null); - const [projectId, setProjectId] = useState(null); const [experiments, setExperiments] = useState([]); + const [experimentDataReady, setExperimentDataReady] = useState(false); + const [runDataReady, setRunDataReady] = useState(false); const [runs, setRuns] = useState([]); // Latest runs/experiments, read by the stable openRunLogs/openFileTab so // evidence chips resolve ids without re-creating the callbacks on every poll @@ -484,14 +291,13 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const experimentsRef = useRef(experiments); experimentsRef.current = experiments; const [artifacts, setArtifacts] = useState(null); - const [view, setView] = useState(initialExperimentsView); + const [view, setView] = useState("table"); // Experiments pane scope: "agent" narrows to the open chat session's work. // Falls back to "project" whenever there is no usable experiment attribution. const [scope, setScope] = useState<"agent" | "project">("project"); const scopeTriggerRef = useRef(null); const { open: scopeMenuOpen, setOpen: setScopeMenuOpen, ref: scopeMenuRef } = usePopover(scopeTriggerRef); - const [activeSessionId, setActiveSessionId] = useState(null); const [demoOverviewLeading, setDemoOverviewLeading] = useState(false); const allExperimentsAttributed = experiments.every((experiment) => experiment.chatSessionId); const effectiveScope = activeSessionId && allExperimentsAttributed ? scope : "project"; @@ -505,17 +311,9 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const mine = new Set(scopedExperiments.map((experiment) => experiment.id)); return runs.filter((r) => mine.has(r.experimentId)); }, [runs, scopedExperiments, effectiveScope]); - useEffect(() => { - try { - localStorage.setItem(EXPERIMENTS_VIEW_KEY, view); - } catch { - // The preference remains sticky for this app session when storage is unavailable. - } - }, [view]); - const [selectedRunId, setSelectedRunId] = useState(null); + // Right-panel tab strip: closable home and working tabs. The same experiment // can keep both its overview and terminal open. - const [rightTab, setRightTab] = useState("experiments"); const [tabHistory, setTabHistory] = useState([]); const [experimentsTabOpen, setExperimentsTabOpen] = useState(false); const [filesTabOpen, setFilesTabOpen] = useState(false); @@ -523,8 +321,15 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const [expTabs, setExpTabs] = useState([]); const [fileTabs, setFileTabs] = useState([]); const fileScrollPositionsRef = useRef(new Map()); - const fileBuffersRef = useRef(new Map()); - const fileLineScrollRequestRef = useRef(0); + const fileBuffersRef = useRef(new Map()); + const getFileBufferSession = (key: string) => { + let buffer = fileBuffersRef.current.get(key); + if (!buffer) { + buffer = new FileBufferSession(); + fileBuffersRef.current.set(key, buffer); + } + return buffer; + }; const [planTabs, setPlanTabs] = useState([]); const [subagentTabs, setSubagentTabs] = useState([]); const [codeTabs, setCodeTabs] = useState([]); @@ -534,22 +339,14 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const [filesToggled, setFilesToggled] = useState>(new Set()); // The right pane is a floating panel: closable, edge-resizable, expandable // to (nearly) full screen. Width persists across sessions. - const [panelOpen, setPanelOpen] = useState(false); const [panelMax, setPanelMax] = useState(false); const [panelWidth, setPanelWidth] = useState(initialPanelWidth); // The agents rail is a floating panel too: fixed-width, collapsible. const [railOpen, setRailOpen] = useState(true); - const [homeOpen, setHomeOpen] = useState(false); const [newProjectOpen, setNewProjectOpen] = useState(false); - const [mainView, setMainView] = useState<"chat" | "skills" | SettingsTab>("chat"); - const [githubPublicationError, setGithubPublicationError] = useState<{ - projectId: string; - message: string; - } | null>(null); - const rightPaneStatesRef = useRef(new Map()); const currentRightPaneStateRef = useRef(initialRightPaneSessionState()); - const activeSessionIdRef = useRef(null); - const pendingExperimentsAutoOpenRef = useRef(false); + const activeSessionIdRef = useRef(activeSessionId); + activeSessionIdRef.current = activeSessionId; const tabHistoryRef = useRef(tabHistory); tabHistoryRef.current = tabHistory; const contentTabOrderRef = useRef(contentTabOrder); @@ -578,7 +375,11 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { setCodeTabs((prev) => withoutTab(prev, key)); const project = projectIdRef.current; if (project && "path" in tab) { - fileScrollPositionsRef.current.delete(fileScrollKey(project, activeSessionIdRef.current, tab)); + const fileKey = fileScrollKey(project, activeSessionIdRef.current, tab); + fileScrollPositionsRef.current.delete(fileKey); + fileBuffersRef.current.delete(fileKey); + intentionalFilesRef.current.delete(fileKey); + restoredFilesRef.current.delete(fileKey); } const next = tabHistoryRef.current.filter((item) => rightTabKey(item) !== key); tabHistoryRef.current = next; @@ -586,7 +387,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { }, []); const selectRightTab = useCallback((tab: RightTab) => { - pendingExperimentsAutoOpenRef.current = false; const key = rightTabKey(tab); const next = [ ...tabHistoryRef.current.filter((item) => rightTabKey(item) !== key), @@ -595,10 +395,9 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { tabHistoryRef.current = next; setTabHistory(next); setRightTab(tab); - }, []); + }, [setRightTab]); - const openRightTab = useCallback((tab: ContentTab, intent: TabOpenIntent) => { - pendingExperimentsAutoOpenRef.current = false; + const openRightTab = useCallback((tab: ContentTab, intent: TabOpenIntent, runId?: string) => { const key = rightTabKey(tab); const outgoing = previewTabRef.current; const transition = openTab( @@ -627,8 +426,8 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { ]; tabHistoryRef.current = next; setTabHistory(next); - setRightTab(tab); - }, [retireRightTab, setContentTabOrder, setPreviewTab]); + navigatePane(tabPane(tab, runId)); + }, [retireRightTab, setContentTabOrder, setPreviewTab, navigatePane]); const promoteRightTab = useCallback((tab: RightTab) => { const current = previewTabRef.current; @@ -682,7 +481,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { }, [promoteRightTab]); const forgetRightTab = useCallback((tab: RightTab, selectFallback: boolean) => { - pendingExperimentsAutoOpenRef.current = false; const key = rightTabKey(tab); const preview = previewTabRef.current; if (preview && rightTabKey(preview) === key) setPreviewTab(null); @@ -704,17 +502,14 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { : undefined; if (fallback) setRightTab(fallback); else { - setPanelOpen(false); + closePanel(); setPanelMax(false); } - }, [setContentTabOrder, setPreviewTab]); + }, [setContentTabOrder, setPreviewTab, setRightTab, closePanel]); - const selectMainView = useCallback((view: "chat" | "skills" | SettingsTab) => { - if (view !== "chat") pendingExperimentsAutoOpenRef.current = false; - setMainView(view); - }, []); + const selectMainView = setMainView; - currentRightPaneStateRef.current = { + const rightPaneState = useMemo(() => ({ rightTab: persistentRightTab(rightTab), tabHistory, experimentsTabOpen, @@ -733,63 +528,82 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { scope, panelOpen, panelMax, - }; - const onActiveSessionChange = useCallback((nextSessionId: string | null) => { - const previousSessionId = activeSessionIdRef.current; - if (previousSessionId === nextSessionId) return; - if (previousSessionId) { - rightPaneStatesRef.current.set(previousSessionId, currentRightPaneStateRef.current); + }), [rightTab, tabHistory, experimentsTabOpen, filesTabOpen, artifactsTabOpen, expTabs, fileTabs, planTabs, subagentTabs, codeTabs, contentTabOrder, previewTab, filesView, filesToggled, selectedRunId, scope, panelOpen, panelMax]); + currentRightPaneStateRef.current = rightPaneState; + const getFileScroll = useCallback(() => Object.fromEntries(fileScrollPositionsRef.current), []); + const scrollSaveTimer = useRef | undefined>(undefined); + const recordScroll = useCallback(() => { + clearTimeout(scrollSaveTimer.current); + scrollSaveTimer.current = setTimeout(() => setMetadataRevision((value) => value + 1), 200); + }, []); + useEffect(() => () => clearTimeout(scrollSaveTimer.current), []); + const applyWorkspace = useCallback((state: RightPaneSessionState, saved: TaskWorkspace | undefined, restored: boolean) => { + setTabHistory(state.tabHistory); + tabHistoryRef.current = state.tabHistory; + setExperimentsTabOpen(state.experimentsTabOpen); + setFilesTabOpen(state.filesTabOpen); + setArtifactsTabOpen(state.artifactsTabOpen); + setExpTabs(state.expTabs); + setFileTabs(state.fileTabs); + setPlanTabs((current) => current === state.planTabs ? current : state.planTabs.map((tab) => ({ ...tab, plan: current.find((item) => item.sessionId === tab.sessionId && item.promptId === tab.promptId)?.plan ?? "" }))); + setSubagentTabs(state.subagentTabs); + setCodeTabs(state.codeTabs); + setContentTabOrder(state.contentTabOrder); + setPreviewTab(state.previewTab); + setFilesView(state.filesView); + setFilesToggled(state.filesToggled); + setScope(state.scope); + setPanelMax(state.panelMax); + setDemoOverviewLeading(navigationRef.current.activeSessionId === DEMO_MAIN_SESSION_ID && state.fileTabs.some((tab) => sameFileTab(tab, { path: DEMO_OVERVIEW_ARTIFACT, source: "artifacts" }))); + if (restored) { + for (const [key, position] of Object.entries(saved?.scroll ?? {})) fileScrollPositionsRef.current.set(key, position); + Object.assign(sourceModesRef.current, saved?.sourceModes); + } + const current = navigationRef.current; + if (current.projectId) for (const tab of state.fileTabs) { + const key = fileScrollKey(current.projectId, current.activeSessionId, tab); + if (!intentionalFilesRef.current.has(key)) restoredFilesRef.current.add(key); } - let nextState = nextSessionId ? rightPaneStatesRef.current.get(nextSessionId) : undefined; - if (!nextState) { - const openDemoOverview = - nextSessionId === DEMO_MAIN_SESSION_ID && - tourCompletedRef.current === false && - !demoOverviewSeededRef.current; - if (openDemoOverview) { - demoOverviewSeededRef.current = true; - setDemoOverviewLeading(true); + }, [setContentTabOrder, setPreviewTab]); + const { ready: workspaceReady, loaded: workspaceLoaded, error: workspaceError, retry: retryWorkspace, capture: captureWorkspace, workspace: workspaceRef } = useProjectWorkspace({ + projectId: uiState && sessions !== null && (destination?.kind !== "task" || !activeSessionId || sessions.includes(activeSessionId)) ? projectId : null, taskKey: activeSessionId ?? "new", location: location.href, pane, + isTask: destination?.kind === "task", demoOverview: uiState?.tourCompleted === false, state: rightPaneState, + apply: applyWorkspace, getScroll: getFileScroll, + sourceModes: sourceModesRef.current, revision: metadataRevision, + }); + const onActiveSessionChange = useCallback((sessionId: string | null, options?: { replace?: boolean }) => { + if (!projectId) return; + if (sessionId) { + sessionLoadRef.current?.set(sessionId, true); + setSessions((current) => current && current.includes(sessionId) ? current : [...(current ?? []), sessionId]); + if (options?.replace && activeSessionId === null) { + captureWorkspace(); + inheritNewTaskWorkspace(projectId, sessionId); } - nextState = initialRightPaneSessionState(nextSessionId ?? undefined, openDemoOverview); } - if (nextSessionId && pendingExperimentsAutoOpenRef.current) { - pendingExperimentsAutoOpenRef.current = false; - const experimentsTab: RightTab = "experiments"; - nextState = { - ...nextState, - rightTab: experimentsTab, - tabHistory: [ - ...nextState.tabHistory.filter( - (tab) => rightTabKey(tab) !== rightTabKey(experimentsTab), - ), - experimentsTab, - ], - experimentsTabOpen: true, - panelOpen: true, - }; + const saved = getTaskWorkspace(getCachedProjectWorkspace(projectId), sessionId ?? "new"); + const remembered = saved ? saved.active : (isDemoProjectId(projectId) ? defaultTaskWorkspace(sessionId ?? undefined, tourCompletedRef.current === false)?.active : undefined); + const nextPane = options?.replace && sessionId && activeSessionId === null ? navigationRef.current.pane : remembered; + void router.navigate({ href: taskLocation(projectId, sessionId, nextPane), replace: options?.replace }); + }, [router, projectId, activeSessionId, captureWorkspace]); + useEffect(() => { + if (workspaceReady && destination?.kind !== "task" && !rememberedSessionRef.current && workspaceRef.current.lastTaskId && sessions?.includes(workspaceRef.current.lastTaskId)) { + rememberedSessionRef.current = workspaceRef.current.lastTaskId; + setMetadataRevision((value) => value + 1); } - setRightTab(nextState.rightTab); - tabHistoryRef.current = nextState.tabHistory; - setTabHistory(nextState.tabHistory); - setExperimentsTabOpen(nextState.experimentsTabOpen); - setFilesTabOpen(nextState.filesTabOpen); - setArtifactsTabOpen(nextState.artifactsTabOpen); - setExpTabs(nextState.expTabs); - setFileTabs(nextState.fileTabs); - setPlanTabs(nextState.planTabs); - setSubagentTabs(nextState.subagentTabs); - setCodeTabs(nextState.codeTabs); - setContentTabOrder(nextState.contentTabOrder); - setPreviewTab(nextState.previewTab); - setFilesView(nextState.filesView); - setFilesToggled(nextState.filesToggled); - setSelectedRunId(nextState.selectedRunId); - setScope(nextState.scope); - setPanelOpen(nextState.panelOpen); - setPanelMax(nextState.panelMax); - activeSessionIdRef.current = nextSessionId; - setActiveSessionId(nextSessionId); - }, [setContentTabOrder, setPreviewTab]); + }, [workspaceReady, destination?.kind, workspaceRef, sessions]); + useBlocker({ + shouldBlockFn: ({ next }) => parseDestination(next.pathname)?.projectId !== projectId + && [...fileBuffersRef.current.values()].some((buffer) => buffer.needsProtection) && !confirmFileDiscard(m.file_viewer_discard_unsaved_changes()), + enableBeforeUnload: () => [...fileBuffersRef.current.values()].some((buffer) => buffer.needsProtection), + }); + const lastGlobalLocation = useRef(null); + useEffect(() => { + const savedLocation = safeLocation(location.href); + if (!uiState || !workspaceReady || !savedLocation) return; + globalWorkspaceWriter.queue({ lastLocation: savedLocation, railOpen, panelWidth, experimentsView: view }, lastGlobalLocation.current === savedLocation ? 250 : 0); + lastGlobalLocation.current = savedLocation; + }, [location.href, uiState, workspaceReady, railOpen, panelWidth, view]); const onboarded = uiState?.onboardingCompleted ?? false; const [demoWelcomeOpen, setDemoWelcomeOpen] = useState(false); const openDemoWelcome = useCallback(() => setDemoWelcomeOpen(true), []); @@ -806,48 +620,65 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { // Show the welcome once the bundled demo is first visible. User projects // never open it automatically. useEffect(() => { - if (!projectId || !isDemoProjectId(projectId) || homeOpen || !onboarded) return; + if (!projectId || !isDemoProjectId(projectId) || !onboarded) return; if (uiState?.tourCompleted) return; openDemoWelcome(); - }, [projectId, homeOpen, onboarded, openDemoWelcome, uiState?.tourCompleted]); + }, [projectId, onboarded, openDemoWelcome, uiState?.tourCompleted]); const activeProject = projects?.find((p) => p.id === projectId) ?? null; // The home, error, and loading screens leave projects populated but show no project. useEffect(() => { - const name = homeOpen || startupError || uiState === null ? null : activeProject?.name; + const name = startupError || uiState === null ? null : activeProject?.name; document.title = name ? `${autoDir(name)} — OpenResearch` : "OpenResearch"; - }, [homeOpen, startupError, uiState, activeProject]); + }, [startupError, uiState, activeProject]); const projectIdRef = useRef(projectId); projectIdRef.current = projectId; - const openExperimentsTab = useCallback(() => { - setMainView("chat"); + const openExperimentsTab = useCallback((replace = false) => { + if (replace && (!navigationRef.current.isTask || navigationRef.current.pane)) return; setExperimentsTabOpen(true); - selectRightTab("experiments"); - setPanelOpen(true); - if (!activeSessionIdRef.current) pendingExperimentsAutoOpenRef.current = true; - }, [selectRightTab]); + navigatePane({ kind: "home", view: "experiments" }, replace); + }, [navigatePane]); + + const sessionLoadRef = useRef | null>(null); + const loadSessionIds = useCallback(async () => { + const changes = new Map(); + sessionLoadRef.current = changes; + const loaded = await listChatSessions(projectId); + if (sessionLoadRef.current !== changes) return; + const ids = new Set(loaded.map((session) => session.id)); + for (const [id, present] of changes) { + if (present) ids.add(id); + else ids.delete(id); + } + sessionLoadRef.current = null; + setSessions([...ids]); + if (rememberedSessionRef.current && !ids.has(rememberedSessionRef.current)) rememberedSessionRef.current = null; + }, [projectId]); const loadInitialState = useCallback(() => { setStartupError(null); setProjects(null); setUiState(null); - void Promise.allSettled([listProjects(), getUiState()]).then(([projectsResult, uiStateResult]) => { + void Promise.allSettled([listProjects(), getUiState(), loadSessionIds()]).then(([projectsResult, uiStateResult, sessionsResult]) => { const errors: string[] = []; + if (sessionsResult.status === "rejected") errors.push(m.chat_all_sessions()); if (projectsResult.status === "fulfilled") { setProjects(projectsResult.value); - setProjectId((current) => - current && projectsResult.value.some((project) => project.id === current) - ? current - : projectsResult.value[0]?.id ?? null, - ); + } else { errors.push(m.app_projects()); } if (uiStateResult.status === "fulfilled") { persistedPreferredAgent.current = uiStateResult.value.preferredAgent; + const prefs = getRememberedGlobalWorkspace() ?? uiStateResult.value.workspace; + if (prefs) { + setRailOpen(prefs.railOpen); + setPanelWidth(Math.min(prefs.panelWidth, panelMaxWidth())); + setView(prefs.experimentsView); + } setUiState(uiStateResult.value); } else { errors.push(m.app_settings()); @@ -856,11 +687,27 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { setStartupError(m.app_startup_load_failed({ items: new Intl.ListFormat(getLocale()).format(errors) })); } }); - }, []); + }, [loadSessionIds]); useEffect(() => { loadInitialState(); }, [loadInitialState]); + useEffect(() => { + const off = onChatEvent((event) => { + if (event.type === "reconnected") { + void loadSessionIds().catch(() => {}); + } else if (event.type === "session" && event.session.projectId === projectId) { + sessionLoadRef.current?.set(event.session.id, true); + setSessions((current) => current?.includes(event.session.id) ? current : [...(current ?? []), event.session.id]); + } else if (event.type === "sessionDeleted") { + sessionLoadRef.current?.set(event.sessionId, false); + setSessions((current) => current?.filter((id) => id !== event.sessionId) ?? null); + if (rememberedSessionRef.current === event.sessionId) rememberedSessionRef.current = null; + } + }); + return () => { off(); sessionLoadRef.current = null; }; + }, [projectId, loadSessionIds]); + const preferredAgentWrite = useRef>(Promise.resolve()); const preferredAgentSaveSeq = useRef(0); const persistPreferredAgent = useCallback((selection: AgentSelection) => { @@ -934,57 +781,33 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { return [...merged.values()]; }); runsBaselineReadyRef.current = true; - if (shouldAutoOpen) openExperimentsTab(); + setRunDataReady(true); + if (shouldAutoOpen) openExperimentsTab(true); }) .catch(() => { - if (runsVisitRef.current === runsVisit) pendingFirstRunningRunsRef.current.clear(); + if (runsVisitRef.current === runsVisit) { + pendingFirstRunningRunsRef.current.clear(); + setRunDataReady(true); + } }); }, [openExperimentsTab]); // Per-project data. Harness agents spawn lazily on the first chat message. useEffect(() => { if (!projectId) return; - const previousSessionId = activeSessionIdRef.current; - if (previousSessionId) { - rightPaneStatesRef.current.set(previousSessionId, currentRightPaneStateRef.current); - } - activeSessionIdRef.current = null; - pendingExperimentsAutoOpenRef.current = false; - setActiveSessionId(null); + let active = true; observedRunsProjectRef.current = projectId; observedRunsRef.current.clear(); liveRunIdsRef.current.clear(); - // Record the visit for persisted project-level UI recency. openProject(projectId).catch(() => {}); setExperiments([]); setRuns([]); setArtifacts(null); - setSelectedRunId(null); - setExpTabs([]); - setFileTabs([]); - setDemoOverviewLeading(false); - setPlanTabs([]); - setSubagentTabs([]); - setCodeTabs([]); - setContentTabOrder([]); - setPreviewTab(null); - setFilesView("files"); - setFilesToggled(new Set()); - tabHistoryRef.current = []; - setTabHistory([]); - setRightTab("experiments"); - setExperimentsTabOpen(false); - setFilesTabOpen(false); - setArtifactsTabOpen(false); - setPanelOpen(false); - setPanelMax(false); - // Scoping is an explicit per-project choice — don't let Current task scope - // re-bind to whichever session ChatPanel auto-selects in the next project. - setScope("project"); - listExperiments(projectId).then(setExperiments).catch(() => {}); + listExperiments(projectId).then((items) => { if (active) { setExperiments(items); setExperimentDataReady(true); } }).catch(() => { if (active) setExperimentDataReady(true); }); loadRunsBaseline(projectId); - getArtifacts(projectId).then(setArtifacts).catch(() => {}); - }, [loadRunsBaseline, projectId, setContentTabOrder, setPreviewTab]); + getArtifacts(projectId).then((items) => { if (active) setArtifacts(items); }).catch(() => {}); + return () => { active = false; runsVisitRef.current++; }; + }, [loadRunsBaseline, projectId]); // Refetch artifacts on open and whenever the directory changes. const refreshArtifacts = useCallback(() => { @@ -994,10 +817,8 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const openArtifactsTab = useCallback(() => { refreshArtifacts(); - setMainView("chat"); setArtifactsTabOpen(true); selectRightTab("artifacts"); - setPanelOpen(true); }, [refreshArtifacts, selectRightTab]); // Live store updates. @@ -1027,7 +848,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { runsBaselineReadyRef.current && (!baselineRun || (baselineRun.status !== "running" && baselineRun.updatedAt <= run.updatedAt)); - if ((previouslyLive && previous) || newSinceBaseline) openExperimentsTab(); + if ((previouslyLive && previous) || newSinceBaseline) openExperimentsTab(true); else if (!runsBaselineReadyRef.current) pendingFirstRunningRunsRef.current.set(run.id, run); }, onExperiment: (experiment) => { @@ -1052,11 +873,11 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { id: string, view: ExperimentView = "overview", intent: TabOpenIntent = "preview", + runId?: string, ) => { const tab = { id, view }; setExpTabs((prev) => (prev.some((t) => sameExpTab(t, tab)) ? prev : [...prev, tab])); - openRightTab(tab, intent); - setPanelOpen(true); + openRightTab(tab, intent, runId); }, [openRightTab]); // A `` evidence chip in chat opens that run's logs — the only evidence @@ -1067,8 +888,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const matches = runsRef.current.filter((run) => run.id === runId || run.id.startsWith(runId)); const run = matches.length === 1 ? matches[0] : null; if (!run) return; - setSelectedRunId(run.id); - openExperimentTab(run.experimentId, "terminal", intent); + openExperimentTab(run.experimentId, "terminal", intent, run.id); }, [openExperimentTab], ); @@ -1123,6 +943,13 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const openResolvedFileTab = useCallback( (tab: FileViewDef, intent: TabOpenIntent = "preview") => { + if (tab.line != null) setLineJump((value) => value + 1); + const project = projectIdRef.current; + if (project) { + const key = fileScrollKey(project, activeSessionIdRef.current, tab); + if (!currentRightPaneStateRef.current.fileTabs.some((item) => sameFileTab(item, tab))) restoredFilesRef.current.delete(key); + intentionalFilesRef.current.add(key); + } const persistentTab = persistentFileTab(tab); setFileTabs((prev) => { const idx = prev.findIndex((item) => sameFileTab(item, tab)); @@ -1132,7 +959,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { return next; }); openRightTab(tab, intent); - setPanelOpen(true); }, [openRightTab], ); @@ -1179,7 +1005,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { // viewer re-scrolls. if (line != null) { tab.line = line; - tab.lineScrollRequest = ++fileLineScrollRequestRef.current; } return tab; }, @@ -1239,11 +1064,14 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const idx = fileTabs.findIndex((t) => sameFileTab(t, tab)); if (idx === -1) return; const key = projectId ? fileScrollKey(projectId, activeSessionId, tab) : null; - if (key && fileBuffersRef.current.has(key) && !confirmFileDiscard(m.file_viewer_discard_unsaved_changes())) return; + if (key && fileBuffersRef.current.get(key)?.needsProtection && !confirmFileDiscard(m.file_viewer_discard_unsaved_changes())) return; setFileTabs((prev) => prev.filter((_, i) => i !== idx)); if (key) { fileScrollPositionsRef.current.delete(key); fileBuffersRef.current.delete(key); + intentionalFilesRef.current.delete(key); + restoredFilesRef.current.delete(key); + delete sourceModesRef.current[key]; } if ( activeSessionId === DEMO_MAIN_SESSION_ID && @@ -1258,15 +1086,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const consumeFileLineScrollRequest = useCallback((tab: FileViewDef) => { if (tab.lineScrollRequest === undefined) return; - setRightTab((current) => { - if ( - typeof current !== "object" || - !("path" in current) || - !sameFileTab(current, tab) || - current.lineScrollRequest !== tab.lineScrollRequest - ) return current; - return persistentRightTab(current); - }); + setConsumedLine(tab.lineScrollRequest); }, []); // Open a proposed plan as a right-panel tab (the chat plan strip's "View @@ -1287,7 +1107,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { return next; }); openRightTab(tab, intent); - setPanelOpen(true); }, [openRightTab]); const closePlanTab = useCallback( @@ -1314,7 +1133,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { prev.some((t) => t.spawnPartId === spawnPartId) ? prev : [...prev, tab], ); openRightTab(tab, intent); - setPanelOpen(true); }, [openRightTab]); const closeSubagentTab = useCallback( @@ -1422,7 +1240,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { : [...prev, opened], ); openRightTab(opened, intent); - setPanelOpen(true); }, [openRightTab], ); @@ -1432,6 +1249,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { setCodeTabs((prev) => prev.map((item) => (sameCodeTab(item, tab) ? { ...item, ...patch } : item)), ); + if (patch.view) navigatePane(tabPane({ ...tab, ...patch })); }, [], ); @@ -1447,10 +1265,8 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { ); const openWorktreeTab = useCallback(() => { - setMainView("chat"); setFilesTabOpen(true); selectRightTab("files"); - setPanelOpen(true); }, [selectRightTab]); const closeHomeTab = useCallback( @@ -1493,11 +1309,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { panelMaxWidth(), ); setPanelWidth(width); - try { - localStorage.setItem(PANEL_WIDTH_KEY, String(width)); - } catch { - // best-effort persistence - } window.removeEventListener("pointermove", onMove); return; } @@ -1512,11 +1323,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { setPanelMax(false); const clamped = Math.min(Math.max(w, PANEL_MIN_WIDTH), max); setPanelWidth(clamped); - try { - localStorage.setItem(PANEL_WIDTH_KEY, String(clamped)); - } catch { - // best-effort persistence - } } window.addEventListener("pointermove", onMove); window.addEventListener("pointerup", stop); @@ -1525,19 +1331,12 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { const onProjectCreated = (project: Project, publicationError: string | null) => { setProjects((cur) => (cur ? upsert(cur, project) : [project])); - setProjectId(project.id); - setHomeOpen(false); + void router.navigate({ href: `/projects/${encodeURIComponent(project.id)}${publicationError ? "/settings/git" : ""}` }); if (publicationError) { - setGithubPublicationError({ projectId: project.id, message: publicationError }); - selectMainView("git"); + showAlert(publicationError, "error"); } }; - const onProjectDeleted = (id: string) => { - setProjects((cur) => (cur ? cur.filter((p) => p.id !== id) : cur)); - if (projectId === id) setProjectId(null); - }; - const expTab = typeof rightTab === "object" && "id" in rightTab ? rightTab : null; const fileTab = typeof rightTab === "object" && "path" in rightTab ? rightTab : null; @@ -1565,6 +1364,28 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { typeof rightTab === "object" && "kind" in rightTab && rightTab.kind === "plan" ? rightTab : null; + const [planContent, setPlanContent] = useState<{ key: string; text: string | null } | null>(null); + const planSessionId = planTab?.sessionId; + const planPromptId = planTab?.promptId; + useEffect(() => { + if (!planSessionId || !planPromptId || !sessions?.includes(planSessionId)) return; + let active = true; + const key = `${planSessionId}:${planPromptId}`; + const apply = (messages: ChatMessage[]) => { + const part = messages.flatMap((message) => { + const found = findPartById(message.parts, planPromptId); + return found ? [found] : []; + })[0]; + if (active) setPlanContent({ key, text: part?.prompt?.plan ?? null }); + }; + const load = () => void getChatMessages(planSessionId).then(({ messages }) => apply(messages)).catch(() => { if (active) setPlanContent({ key, text: null }); }); + load(); + const off = onChatEvent((event) => { + if (event.type === "reconnected") load(); + if (event.type === "message" && event.sessionId === planSessionId && findPartById(event.message.parts, planPromptId)) apply([event.message]); + }); + return () => { active = false; off(); }; + }, [planSessionId, planPromptId, sessions]); const subagentTab = typeof rightTab === "object" && "kind" in rightTab && rightTab.kind === "subagent" ? rightTab @@ -1601,7 +1422,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { ); const tabExperiment = expTab ? (experiments.find((e) => e.id === expTab.id) ?? null) : null; const codeExperiment = codeTab - ? (experiments.find((experiment) => experiment.id === codeTab.experimentId) ?? null) + ? (experiments.find((experiment) => experiment.id === codeTab.experimentId && experiment.branchName === codeTab.branch) ?? null) : null; const renderContentTab = (tab: ContentTab) => { if ("path" in tab) return renderFileTab(tab); @@ -1670,6 +1491,8 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { ); }; + if (!destination || destination.kind === "resume") return null; + if (startupError) { return (
@@ -1682,7 +1505,15 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { ); } - if (projects === null || uiState === null) { + if (projects && !activeProject) { + return
{m.model_picker_unavailable()}
; + } + + if (workspaceError && !workspaceReady) { + return

{workspaceError}

; + } + + if (projects === null || uiState === null || !workspaceLoaded || sessions === null) { return (
@@ -1693,45 +1524,14 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { ); } - // First boot: the walkthrough installs and opens the embedded demo project. - if (projects.length === 0) { - return ( -
- {runtime.kind === "local" && } - {runtime.kind === "local" && } - {onboarded ? ( - - ) : ( - { - clearReadDemoSessions(); - persistedPreferredAgent.current = selection; - setProjects([project]); - setProjectId(project.id); - setUiState((current) => ({ - ...(current ?? { tourCompleted: false }), - onboardingCompleted: true, - preferredAgent: selection, - })); - }} - /> - )} - {runtime.kind === "ssh" && } -
- ); + if (!activeProject || (destination?.kind === "task" && activeSessionId && !sessions?.includes(activeSessionId))) { + return
{m.model_picker_unavailable()}
; } const railHeader = ( p.id === projectId)?.name ?? ""} - onHome={() => setHomeOpen(true)} + onHome={() => void router.navigate({ to: "/projects" })} onNewProject={() => setNewProjectOpen(true)} onRepository={() => selectMainView("git")} onCollapse={() => setRailOpen(false)} @@ -1742,21 +1542,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) {
{runtime.kind === "local" && } {runtime.kind === "local" && } - {homeOpen ? ( - <> - { - setProjectId(id); - setHomeOpen(false); - }} - onCreated={onProjectCreated} - onDeleted={onProjectDeleted} - /> - {runtime.kind === "ssh" && } - - ) : ( + {workspaceError &&
{workspaceError}
}
{projectId && ( openExperimentsTab()} onOpenArtifacts={openArtifactsTab} onOpenFile={openChatFile} onOpenRun={openRunLogs} @@ -1793,6 +1579,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { onOpenDemoWelcome={ activeProject && isDemoProjectId(activeProject.id) ? openDemoWelcome : undefined } + activeSessionId={activeSessionId} onActiveSessionChange={onActiveSessionChange} preferredAgent={uiState.preferredAgent} onPreferredAgentChange={persistPreferredAgent} @@ -1804,14 +1591,8 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { remote={runtime.kind === "ssh"} tab={mainView} project={activeProject} - githubPublicationError={ - githubPublicationError && githubPublicationError.projectId === activeProject?.id - ? githubPublicationError.message - : null - } onProjectUpdate={(project) => { setProjects((current) => (current ? upsert(current, project) : [project])); - if (project.githubEnabled) setGithubPublicationError(null); }} onSelectTab={selectMainView} /> @@ -1873,8 +1654,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { title={m.app_close_panel()} aria-label={m.app_close_panel()} onClick={() => { - pendingExperimentsAutoOpenRef.current = false; - setPanelOpen(false); + closePanel(); setPanelMax(false); }} > @@ -1882,7 +1662,13 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) {
- {rightTab === "artifacts" ? ( + {!workspaceReady || ((pane?.kind === "experiment" || pane?.kind === "code") && !experimentDataReady) || (pane?.kind === "experiment" && pane.runId && !runDataReady) ? ( + + ) : (expTab && (!tabExperiment || (selectedRunId && !runs.some((run) => run.id === selectedRunId && run.experimentId === expTab.id)))) + || (requestedCodeTab && !codeExperiment) + || (pane && "sessionId" in pane && pane.sessionId && !sessions?.includes(pane.sessionId)) ? ( +
{m.model_picker_unavailable()}
+ ) : rightTab === "artifacts" ? ( {activeProject && ( !fileBuffersRef.current.has( + canRenameFile={(path) => !fileBuffersRef.current.get( fileScrollKey(activeProject.id, activeSessionId, { path, source: "artifacts" }), - )} + )?.needsProtection} onOpenStorage={runtime.kind === "ssh" ? undefined : () => selectMainView("storage")} /> )} @@ -1996,8 +1782,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { openExperimentTab(experiment.id, "overview", intent); }} onOpenLogs={(experimentId, runId, intent) => { - setSelectedRunId(runId); - openExperimentTab(experimentId, "terminal", intent); + openExperimentTab(experimentId, "terminal", intent, runId); }} onOpenCode={(experimentId, intent) => { const experiment = experiments.find((item) => item.id === experimentId); @@ -2025,13 +1810,13 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { toggled={filesToggled} onViewChange={setFilesView} onToggledChange={setFilesToggled} - canRenameFile={(path) => !fileBuffersRef.current.has( + canRenameFile={(path) => !fileBuffersRef.current.get( fileScrollKey(activeProject.id, activeSessionId, { path, source: "repo", sessionId: activeSessionId ?? undefined, }), - )} + )?.needsProtection} onOpenFile={(path, sessionId, ref, intent) => openFileTab( path, @@ -2060,6 +1845,17 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { {projectId && ( { + const key = fileScrollKey(projectId, activeSessionId, fileTab); + restoredFilesRef.current.delete(key); + intentionalFilesRef.current.add(key); + }} + showSource={sourceModesRef.current[fileScrollKey(projectId, activeSessionId, fileTab)] ?? false} + onShowSourceChange={(showSource) => { + sourceModesRef.current[fileScrollKey(projectId, activeSessionId, fileTab)] = showSource; + setMetadataRevision((value) => value + 1); + }} key={fileScrollKey(projectId, activeSessionId, fileTab)} projectId={projectId} path={fileTab.path} @@ -2075,14 +1871,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { branchLabel={fileBranchLabel(fileTab, activeProject?.baselineBranch)} artifactVersion={artifactVersion} artifactEntries={fileTab.source === "artifacts" ? artifacts?.entries : undefined} - initialBuffer={fileBuffersRef.current.get( - fileScrollKey(projectId, activeSessionId, fileTab), - )} - onBufferStateChange={(buffer) => { - const key = fileScrollKey(projectId, activeSessionId, fileTab); - if (buffer) fileBuffersRef.current.set(key, buffer); - else fileBuffersRef.current.delete(key); - }} + bufferSession={getFileBufferSession(fileScrollKey(projectId, activeSessionId, fileTab))} onOpenFile={(path, sessionId, ref, intent) => openFromRightTab(fileTab, () => openFileTab( @@ -2104,6 +1893,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { fileScrollKey(projectId, activeSessionId, fileTab), position, ); + recordScroll(); }} lineScrollRequest={fileTab.lineScrollRequest} onLineScrollRequestHandled={() => consumeFileLineScrollRequest(fileTab)} @@ -2117,7 +1907,7 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { file links resolve against the plan's session worktree. */}
tab.promptId === planTab.promptId)?.plan || m.artifacts_tab_loading()} onOpenFile={(path, line, exp, ref, intent) => openFromRightTab(planTab, () => openFileTab( @@ -2204,9 +1994,8 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { ) ?? null } onOpenView={(view, runId, intent) => { - if (runId) setSelectedRunId(runId); openFromRightTab(expTab, () => - openExperimentTab(tabExperiment.id, view, intent), + openExperimentTab(tabExperiment.id, view, intent, runId), ); }} onOpenCode={(view, intent) => @@ -2226,7 +2015,6 @@ export default function App({ runtime }: { runtime: RuntimeInfo }) { )}
- )} {newProjectOpen && ( )} - {demoWelcomeOpen && !homeOpen && activeProject && isDemoProjectId(activeProject.id) && ( + {demoWelcomeOpen && activeProject && isDemoProjectId(activeProject.id) && ( '); +const RuntimeContext = createContext(null); + +function workspaceKey(runtime: RuntimeInfo): string { + return runtime.kind === "local" ? "local" : `${runtime.session.id}:${runtime.session.installPaths?.database ?? ""}`; +} + +export function useRuntime(): RuntimeInfo { + const runtime = useContext(RuntimeContext); + if (!runtime) throw new Error("Runtime is not connected"); + return runtime; +} + function setFavicon(remote: boolean) { const link = document.querySelector('link[rel="icon"]'); if (link) link.href = remote ? REMOTE_FAVICON : "/favicon.svg"; @@ -354,12 +368,13 @@ function RemoteOverlay({ children }: { children: ReactNode }) { } export function RuntimeRoot() { - const launchPlaceholder = location.pathname === "/remote-launch"; + const launchPlaceholder = useLocation({ select: (location) => location.pathname === "/remote-launch" }); const [runtime, setRuntime] = useState(null); const [error, setError] = useState(null); const everConnected = useRef(false); const workspaceMounted = useRef(false); const preferencesApplied = useRef(false); + const previousWorkspace = useRef(null); const [retriedInteractiveError, setRetriedInteractiveError] = useState(null); useEffect(() => { @@ -370,6 +385,15 @@ export function RuntimeRoot() { try { const next = await getRuntime(); if (!active) return; + const nextWorkspace = workspaceKey(next); + if (previousWorkspace.current !== null && previousWorkspace.current !== nextWorkspace) { + resetGlobalWorkspace(); + clearProjectWorkspaceCache(); + everConnected.current = false; + workspaceMounted.current = false; + preferencesApplied.current = false; + } + previousWorkspace.current = nextWorkspace; if (next.kind === "ssh") { if (!preferencesApplied.current) { preferencesApplied.current = true; @@ -424,7 +448,7 @@ export function RuntimeRoot() { ); } - if (runtime.kind === "local") return ; + if (runtime.kind === "local") return ; const keepWorkspace = workspaceMounted.current && (runtime.session.status !== "disconnected" || runtime.session.error !== null); if (!keepWorkspace && runtime.session.status !== "connected") { @@ -440,7 +464,7 @@ export function RuntimeRoot() { return (
- +
{showOverlay && ( diff --git a/ui/src/api.ts b/ui/src/api.ts index aad65c6e..3b6386b1 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -1,5 +1,6 @@ // Typed client for the orx up local HTTP API (/api/*). All wire JSON is camelCase. +import type { GlobalWorkspace, ProjectWorkspace } from "./workspaceState"; import { m } from "./paraglide/messages.js"; import { getLocale } from "./paraglide/runtime.js"; import { fmtNumber } from "./i18n"; @@ -127,9 +128,10 @@ async function json(res: Response): Promise { } const get = (url: string) => fetch(url).then((r) => json(r)); -const post = (url: string, body?: unknown) => +const post = (url: string, body?: unknown, keepalive = false) => fetch(url, { method: "POST", + keepalive, headers: body === undefined ? {} : { "content-type": "application/json" }, body: body === undefined ? undefined : JSON.stringify(body), }).then((r) => json(r)); @@ -173,6 +175,7 @@ export interface OnboardingSelection { export type AgentSelection = OnboardingSelection; export interface UiState { + workspace: GlobalWorkspace | null; onboardingCompleted: boolean; tourCompleted: boolean; preferredAgent: AgentSelection | null; @@ -180,7 +183,16 @@ export interface UiState { export const getUiState = () => get("/api/settings/ui-state"); +export const getProjectUiState = (projectId: string) => + get(`/api/projects/${encodeURIComponent(projectId)}/ui-state`); + +export const saveProjectUiState = (projectId: string, state: ProjectWorkspace, keepalive = false) => + post(`/api/projects/${encodeURIComponent(projectId)}/ui-state`, state, keepalive); +export const saveGlobalWorkspace = (workspace: GlobalWorkspace, keepalive = false) => + post("/api/settings/ui-state", { workspace }, keepalive); + export const updateUiState = (body: { + workspace?: GlobalWorkspace; tourCompleted?: boolean; preferredAgent?: AgentSelection; }) => post("/api/settings/ui-state", body); diff --git a/ui/src/components/ChatPanel.tsx b/ui/src/components/ChatPanel.tsx index 26c28f2a..10bcc241 100644 --- a/ui/src/components/ChatPanel.tsx +++ b/ui/src/components/ChatPanel.tsx @@ -55,7 +55,6 @@ import { deleteChatSession, DEMO_FIGURE_SESSION_ID, DEMO_LITERATURE_SESSION_ID, - DEMO_MAIN_SESSION_ID, DEMO_PROJECT_ID, forkChatTurn, fmtNumber, @@ -4285,6 +4284,7 @@ export function ChatPanel({ runtime, onOpenDemoWelcome, composerPrefill = null, + activeSessionId, onActiveSessionChange, preferredAgent, onPreferredAgentChange, @@ -4347,8 +4347,8 @@ export function ChatPanel({ /** Reopen the demo welcome modal from the chat header. */ onOpenDemoWelcome?: () => void; composerPrefill?: string | null; - /** The open chat session, surfaced so the shell can scope panes to it. */ - onActiveSessionChange?: (sessionId: string | null) => void; + activeSessionId: string | null; + onActiveSessionChange: (sessionId: string | null, options?: { replace?: boolean }) => void; /** Database-backed selection used to seed new chat sessions. */ preferredAgent: ModelSelection | null; onPreferredAgentChange: (selection: ModelSelection) => Promise; @@ -4358,14 +4358,22 @@ export function ChatPanel({ const [sessions, setSessions] = useState([]); const [remoteDialogOpen, setRemoteDialogOpen] = useState(false); const [sshConfigOpen, setSshConfigOpen] = useState(false); - const [activeId, setActiveId] = useState(null); + const activeId = activeSessionId; + const onActiveSessionChangeRef = useRef(onActiveSessionChange); + onActiveSessionChangeRef.current = onActiveSessionChange; + const projectVisitRef = useRef({ projectId }); + if (projectVisitRef.current.projectId !== projectId) projectVisitRef.current = { projectId }; const [unreadSessionIds, setUnreadSessionIds] = useState>(new Set()); const [sessionFilter, setSessionFilter] = useState("active"); const [draft, setDraft] = useState(""); const [annotations, setAnnotations] = useState([]); const annotationId = useRef(0); - const composerScopeRef = useRef({ projectId, activeId }); - composerScopeRef.current = { projectId, activeId }; + const composerScopeRef = useRef({ projectId, activeId, mainView }); + if (composerScopeRef.current.projectId !== projectId + || composerScopeRef.current.activeId !== activeId + || composerScopeRef.current.mainView !== mainView) { + composerScopeRef.current = { projectId, activeId, mainView }; + } // Pasted/dropped/uploaded attachments waiting in the composer, as data URLs. const [attachments, setAttachments] = useState< { dataUrl: string; mediaType: string; name?: string; size: number }[] @@ -4806,11 +4814,13 @@ export function ChatPanel({ // flight is absent from the response but also absent here, so it can // never be mistaken for deleted (forgetSession tombstones — a false // positive would kill a live session for good). + const visit = projectVisitRef.current; + if (visit.projectId !== projectId) return null; const before = sessionsRef.current.map((s) => s.id); try { - const list = (await listChatSessions(projectId)).filter( - (s) => !deletedIds.current.has(s.id), - ); + const response = await listChatSessions(projectId); + if (projectVisitRef.current !== visit) return null; + const list = response.filter((s) => !deletedIds.current.has(s.id)); const ids = new Set(list.map((s) => s.id)); // Forget BEFORE seeding busy: forget drops the ghost's busy flag, so // the known-scoped seed below can't carry it forward as if the session @@ -4839,6 +4849,8 @@ export function ChatPanel({ const reseedSession = useCallback( async (sessionId: string) => { + const visit = projectVisitRef.current; + if (visit.projectId !== projectId) return; const leafBefore = composerScopeRef.current.activeId === sessionId ? activeLeafRef.current : undefined; @@ -4846,6 +4858,7 @@ export function ChatPanel({ getChatMessages(sessionId), syncSessionList(), ]); + if (projectVisitRef.current !== visit) return; const localLeafMoved = leafBefore !== undefined && composerScopeRef.current.activeId === sessionId && activeLeafRef.current !== leafBefore; @@ -4857,7 +4870,7 @@ export function ChatPanel({ activeLeafId: localLeafMoved ? activeLeafRef.current : activeLeafId, }); }, - [syncSessionList, dispatch], + [projectId, syncSessionList, dispatch], ); // Reset everything when the project changes. @@ -4867,7 +4880,6 @@ export function ChatPanel({ // snapshots it, and the old project's rows would all read as "deleted" // against the new project's list — tombstoning the entire old project. sessionsRef.current = []; - setActiveId(null); const readDemoSessions = loadReadDemoSessions(); setUnreadSessionIds( projectId === DEMO_PROJECT_ID @@ -4884,19 +4896,11 @@ export function ChatPanel({ loadedSessions.current = new Set(); setTitleReveals(new Map()); seenTitles.current = new Map(); - void syncSessionList().then((list) => { - // Prefer the newest non-archived session; archived ones stay hidden. - if (list) - setActiveId( - (cur) => - cur ?? - (projectId === DEMO_PROJECT_ID - ? list.find((session) => session.id === DEMO_MAIN_SESSION_ID)?.id - : undefined) ?? - list.find((session) => !session.archived)?.id ?? - null, - ); - }); + void syncSessionList(); + const visit = projectVisitRef.current; + return () => { + if (projectVisitRef.current === visit) projectVisitRef.current = { projectId }; + }; }, [projectId, syncSessionList]); // Load message history when a session becomes active. @@ -4907,12 +4911,15 @@ export function ChatPanel({ useEffect(() => { if (!activeId || loadedSessions.current.has(activeId)) return; + const visit = projectVisitRef.current; loadedSessions.current.add(activeId); getChatMessages(activeId) - .then(({ messages, queued, activeLeafId }) => - dispatch({ type: "seed", sessionId: activeId, messages, queued, activeLeafId }), - ) + .then(({ messages, queued, activeLeafId }) => { + if (projectVisitRef.current !== visit) return; + dispatch({ type: "seed", sessionId: activeId, messages, queued, activeLeafId }); + }) .catch(() => { + if (projectVisitRef.current !== visit) return; // Recover from a failed fetch to a usable state rather than a stuck // "Loading conversation…" spinner: seed an empty transcript (clears // historyLoading, falls through to the empty state) unless messages @@ -4921,7 +4928,7 @@ export function ChatPanel({ dispatch({ type: "seed", sessionId: activeId, messages: [], onlyIfAbsent: true }); loadedSessions.current.delete(activeId); }); - }, [activeId]); + }, [activeId, projectId]); // Chat events from the shared /api/events stream. useEffect(() => { @@ -5009,10 +5016,12 @@ export function ChatPanel({ // One retry is sufficient: flush persists to the store BEFORE it emits, // so a refetch issued after observing a raced event already reads that // event's content. + const visit = projectVisitRef.current; const reseed = (allowRetry: boolean) => { const gen = msgGen.current; getChatMessages(activeId) .then(({ messages, queued, activeLeafId }) => { + if (projectVisitRef.current !== visit) return; dispatch({ type: "seed", sessionId: activeId, messages, queued, activeLeafId }); if (allowRetry && msgGen.current !== gen) reseed(false); }) @@ -5232,11 +5241,6 @@ export function ChatPanel({ setSettingsError(null); }, [activeId]); - // Surface the open session to the shell (Agent-scoped panes key off it). - useEffect(() => { - onActiveSessionChange?.(activeId); - }, [activeId, onActiveSessionChange]); - // Opening a session or returning from settings starts pinned at the latest messages. const threadMounted = mainView === "chat" && (messages.length > 0 || busy); @@ -5357,10 +5361,13 @@ export function ChatPanel({ text: annotation.text, })); const sourceProjectId = projectId; + const sourceView = mainView; let sourceSessionId = activeId; const inSourceScope = () => { const current = composerScopeRef.current; - return current.projectId === sourceProjectId && current.activeId === sourceSessionId; + return current.projectId === sourceProjectId + && current.activeId === sourceSessionId + && current.mainView === sourceView; }; const restoreComposer = () => { if (!inSourceScope()) return; @@ -5400,7 +5407,8 @@ export function ChatPanel({ setPlanModeOverride(toggledPlanMode); } const clearFailedPlanCommand = () => { - if (planCommandMutation === null || planMutationSeq.current !== planCommandMutation) return; + if (!inSourceScope() || planCommandMutation === null + || planMutationSeq.current !== planCommandMutation) return; planModeOverrideRef.current = previousPlanModeOverride; setPlanModeOverride(previousPlanModeOverride); }; @@ -5480,7 +5488,7 @@ export function ChatPanel({ reasoningLevel: effective.reasoningLevel, } : {}; - setSessionOverride({}); + if (inSourceScope()) setSessionOverride({}); const images: ChatImageAttachment[] = pending.map((a) => ({ mediaType: a.mediaType, dataBase64: a.dataUrl.slice(a.dataUrl.indexOf(",") + 1), @@ -5499,7 +5507,7 @@ export function ChatPanel({ ); const response = await queueSessionMutation(sendBusy); if (response.turn?.existing) await reseedSession(sid); - setRecoveryOverrides({}); + if (inSourceScope()) setRecoveryOverrides({}); if (pendingClientTurn.current?.id === clientTurnId) pendingClientTurn.current = null; } catch { // Never reached the turn — restore the composer so a retry is one keypress. @@ -5537,11 +5545,11 @@ export function ChatPanel({ annotations: pendingAnnotations, }); dispatch({ type: "busy", sessionId: sid, busy: true }); - pinTranscriptToBottom(); + if (inSourceScope()) pinTranscriptToBottom(); // The session being sent to is never archived after this turn (new ones // start active; existing ones are unarchived server-side by activity) — // leave the Archived-only view so its row stays visible. - if (sessionFilter === "archived") setSessionFilter("active"); + if (inSourceScope() && sessionFilter === "archived") setSessionFilter("active"); // `effective.harness` is always the target session's harness (locked once // it exists), so these overrides are always valid — the backend persists // them as the session's sticky settings. Clear the unsent tweak now. @@ -5554,7 +5562,7 @@ export function ChatPanel({ reasoningLevel: effective.reasoningLevel, } : {}; - setSessionOverride({}); + if (inSourceScope()) setSessionOverride({}); const images: ChatImageAttachment[] = pending.map((a) => ({ mediaType: a.mediaType, dataBase64: a.dataUrl.slice(a.dataUrl.indexOf(",") + 1), @@ -5573,7 +5581,7 @@ export function ChatPanel({ ); const response = await queueSessionMutation(sendTurn); if (response.turn?.existing) await reseedSession(targetSessionId); - setRecoveryOverrides({}); + if (inSourceScope()) setRecoveryOverrides({}); if (pendingClientTurn.current?.id === clientTurnId) pendingClientTurn.current = null; } catch (err) { // The message never reached a turn — put it back in the composer so a @@ -5609,6 +5617,8 @@ export function ChatPanel({ /** Create the session a first message (or `!` command) lands in and open it. */ async function openNewSession(selection: ModelSelection, planMode: boolean | undefined) { + const scope = composerScopeRef.current; + const visit = projectVisitRef.current; const session = await createChatSession(projectId, selection.harness, { model: selection.model, serviceTier: selection.serviceTier, @@ -5616,10 +5626,14 @@ export function ChatPanel({ planMode, reasoningLevel: selection.reasoningLevel, }); - loadedSessions.current.add(session.id); - setSessions((cur) => [session, ...cur]); - setActiveId(session.id); - composerScopeRef.current = { projectId, activeId: session.id }; + if (projectVisitRef.current === visit) { + loadedSessions.current.add(session.id); + setSessions((cur) => [session, ...cur.filter((row) => row.id !== session.id)]); + } + if (projectVisitRef.current === visit && composerScopeRef.current === scope) { + onActiveSessionChangeRef.current(session.id, { replace: true }); + composerScopeRef.current = { ...scope, activeId: session.id }; + } return session; } @@ -5645,9 +5659,15 @@ export function ChatPanel({ } const originalDraft = draft; const sourceScope = composerScopeRef.current; - const restoreDraft = () => { + let sourceSessionId = activeId; + const inSourceScope = () => { const current = composerScopeRef.current; - if (current.projectId !== sourceScope.projectId || current.activeId !== sourceScope.activeId) return; + return current.projectId === sourceScope.projectId + && current.activeId === sourceSessionId + && current.mainView === sourceScope.mainView; + }; + const restoreDraft = () => { + if (!inSourceScope()) return; setDraft((value) => value || originalDraft); }; setDraft(""); @@ -5666,18 +5686,19 @@ export function ChatPanel({ planModeOverrideRef.current, ); sid = (await openNewSession(composerSelection, planMode)).id; - setSessionOverride({}); + sourceSessionId = sid; + if (inSourceScope()) setSessionOverride({}); } catch (err) { restoreDraft(); const detail = err instanceof Error ? err.message : String(err); - setSettingsError(m.chat_bash_failed({ error: ltr(detail) })); + if (inSourceScope()) setSettingsError(m.chat_bash_failed({ error: ltr(detail) })); return; } } - if (sessionFilter === "archived") setSessionFilter("active"); + if (inSourceScope() && sessionFilter === "archived") setSessionFilter("active"); const localId = `${LOCAL_PREFIX}shell-${Date.now()}`; dispatch({ type: "localShell", sessionId: sid, id: localId, command }); - pinTranscriptToBottom(); + if (inSourceScope()) pinTranscriptToBottom(); try { const { message } = await runShellCommand(sid, command); dispatch({ type: "upsertMessage", sessionId: sid, message }); @@ -5824,7 +5845,11 @@ export function ChatPanel({ function forgetSession(sessionId: string) { deletedIds.current.add(sessionId); setSessions((cur) => cur.filter((s) => s.id !== sessionId)); - setActiveId((cur) => (cur === sessionId ? null : cur)); + if (composerScopeRef.current.projectId === projectId + && composerScopeRef.current.activeId === sessionId + && composerScopeRef.current.mainView === "chat") { + onActiveSessionChangeRef.current(null, { replace: true }); + } setUnreadSessionIds((current) => { if (!current.has(sessionId)) return current; const next = new Set(current); @@ -5842,11 +5867,6 @@ export function ChatPanel({ // which could undo a concurrent authoritative update). const prev = session.archived; setSessions((cur) => cur.map((s) => (s.id === session.id ? { ...s, archived } : s))); - // Deselect only when the row leaves the rail's current filter — keeping it - // selected would leave the thread (and Agent-scoped panes) keyed to an - // invisible session. Kept even if the request fails; it's a no-op then. - if (!matchesFilter(sessionFilter, archived)) - setActiveId((cur) => (cur === session.id ? null : cur)); void setChatSessionArchived(session.id, archived).catch(() => { setSessions((cur) => cur.map((s) => (s.id === session.id ? { ...s, archived: prev } : s)), @@ -5884,6 +5904,7 @@ export function ChatPanel({ (answer: PromptAnswer): Promise => { if (!activeId) return Promise.resolve(false); const sid = activeId; + const visit = projectVisitRef.current; // The resumed turn streams over SSE; optimistically mark busy. dispatch({ type: "busy", sessionId: sid, busy: true }); return queueSessionMutation(() => respondChat(sid, answer)) @@ -5899,18 +5920,20 @@ export function ChatPanel({ // just-started optimistic flag), so the optimistic dispatch above // can't wedge true after a no-op or failure. getChatMessages(sid) - .then(({ messages, queued, activeLeafId }) => - dispatch({ type: "seed", sessionId: sid, messages, queued, activeLeafId }), - ) + .then(({ messages, queued, activeLeafId }) => { + if (projectVisitRef.current !== visit) return; + dispatch({ type: "seed", sessionId: sid, messages, queued, activeLeafId }); + }) .catch(() => {}); listChatSessions(projectId) - .then((list) => + .then((list) => { + if (projectVisitRef.current !== visit) return; dispatch({ type: "busy", sessionId: sid, busy: !!list.find((s) => s.id === sid)?.busy, - }), - ) + }); + }) // On a failed fetch keep the optimistic flag: clearing busy while a // Handled resume is still streaming would hide Working…/Stop for // the rest of the turn (nothing re-asserts busy mid-stream). @@ -5926,21 +5949,16 @@ export function ChatPanel({ const queueChord = isApple ? "⌘ Enter" : "Ctrl + Enter"; const startNewTask = useCallback(() => { setSessionFilter("active"); - setActiveId(null); - onSelectMainView("chat"); - }, [onSelectMainView]); - - /** Follow a spawn card into the session it started. Spawned sessions are - * ordinary top-level sessions, so this is just a switch in the rail — via - * "All", because selecting a row the active filter hides would leave the - * thread keyed to a session with no row (see `setArchived`). */ + onActiveSessionChange(null); + }, [onActiveSessionChange]); + + /** Follow a spawn card and reveal its session in the rail. */ const openSpawnedSession = useCallback( (sessionId: string) => { setSessionFilter("all"); - setActiveId(sessionId); - onSelectMainView("chat"); + onActiveSessionChange(sessionId); }, - [onSelectMainView], + [onActiveSessionChange], ); useEffect(() => { @@ -6035,7 +6053,7 @@ export function ChatPanel({ waiting={waitingSessions.has(s.id)} revealTitle={titleReveals.get(s.id)} onOpen={() => { - setActiveId(s.id); + onActiveSessionChange(s.id); if (projectId === DEMO_PROJECT_ID) markDemoSessionRead(s.id); setUnreadSessionIds((current) => { if (!current.has(s.id)) return current; @@ -6043,7 +6061,6 @@ export function ChatPanel({ next.delete(s.id); return next; }); - onSelectMainView("chat"); }} onRename={(title) => rename(s, title)} onSetArchived={(archived) => setArchived(s, archived)} diff --git a/ui/src/components/CodeEditor.tsx b/ui/src/components/CodeEditor.tsx index cae5562d..ecfcde8e 100644 --- a/ui/src/components/CodeEditor.tsx +++ b/ui/src/components/CodeEditor.tsx @@ -26,6 +26,8 @@ export function CodeEditor({ highlightLine, scrollRequest, onScrollRequestHandled, + scrollPosition, + onScrollPositionChange, }: { value: string; onChange: (next: string) => void; @@ -41,6 +43,8 @@ export function CodeEditor({ * so the caret re-navigates even though `path` didn't change. */ scrollRequest?: number; onScrollRequestHandled?: () => void; + scrollPosition?: { top: number; left: number }; + onScrollPositionChange?: (position: { top: number; left: number }) => void; }) { // A trailing newline opens a new (empty) line the caret can sit on, so unlike // the read-only view every "\n" gets a row. @@ -58,6 +62,14 @@ export function CodeEditor({ const ta = taRef.current; if (ta && overlayRef.current) overlayRef.current.scrollTop = ta.scrollTop; }; + const initialScroll = useRef(scrollPosition); + useLayoutEffect(() => { + const ta = taRef.current; + if (!ta || !initialScroll.current) return; + ta.scrollTop = initialScroll.current.top; + ta.scrollLeft = initialScroll.current.left; + syncScroll(); + }, [path]); // Re-sync after content changes relayout (e.g. a newline shifts scrollHeight). useLayoutEffect(syncScroll, [value]); @@ -68,7 +80,7 @@ export function CodeEditor({ // request re-runs this against real content. useLayoutEffect(() => { const ta = taRef.current; - if (!ta || !highlightLine) return; + if (!ta || !highlightLine || scrollRequest === undefined) return; const text = value.split("\n"); const target = Math.min(Math.max(Math.trunc(highlightLine), 1), text.length); let caret = 0; @@ -146,7 +158,10 @@ export function CodeEditor({ onChange={(e) => { if (!readOnly) onChange(e.target.value); }} - onScroll={syncScroll} + onScroll={(event) => { + syncScroll(); + onScrollPositionChange?.({ top: Math.max(0, event.currentTarget.scrollTop), left: Math.max(0, event.currentTarget.scrollLeft) }); + }} onKeyDown={onKeyDown} onBlur={readOnly ? undefined : onBlur} readOnly={readOnly} diff --git a/ui/src/components/DetailDrawer.tsx b/ui/src/components/DetailDrawer.tsx index 49dbaeec..992a4cd2 100644 --- a/ui/src/components/DetailDrawer.tsx +++ b/ui/src/components/DetailDrawer.tsx @@ -90,8 +90,9 @@ function TerminalView({ const [historyOpen, setHistoryOpen] = useState(false); const historyRef = useRef(null); - const selectedRun = - (selectedRunId && expRuns.find((r) => r.id === selectedRunId)) || expRuns[0] || null; + const selectedRun = selectedRunId + ? expRuns.find((run) => run.id === selectedRunId) ?? null + : expRuns[0] ?? null; const live = selectedRun?.status === "running" || selectedRun?.status === "starting"; const cancelling = Boolean( selectedRun && live && (selectedRun.cancelRequested || pendingRunId === selectedRun.id), @@ -103,18 +104,6 @@ function TerminalView({ return idx === -1 ? expRuns.length : expRuns.length - idx; }; - // When a new run starts while the tab is open, follow it live. - const seenRunIds = useRef | null>(null); - useEffect(() => { - if (seenRunIds.current === null) { - seenRunIds.current = new Set(expRuns.map((r) => r.id)); - return; - } - const fresh = expRuns.find((r) => !seenRunIds.current!.has(r.id)); - for (const r of expRuns) seenRunIds.current.add(r.id); - if (fresh) onSelectRun(fresh.id); - }, [expRuns, onSelectRun]); - // Close the history dropdown on outside click. useEffect(() => { if (!historyOpen) return; @@ -197,7 +186,7 @@ function TerminalView({ // the terminal with the selected run's output. ) : ( -
{m.detail_drawer_no_runs_yet_ask_the_agent_to_launch()}
+
{selectedRunId ? m.model_picker_unavailable() : m.detail_drawer_no_runs_yet_ask_the_agent_to_launch()}
)}
diff --git a/ui/src/components/FileViewer.tsx b/ui/src/components/FileViewer.tsx index b6402c44..b49b7ad4 100644 --- a/ui/src/components/FileViewer.tsx +++ b/ui/src/components/FileViewer.tsx @@ -18,7 +18,7 @@ import { GitBranch, X, } from "lucide-react"; -import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react"; +import { useCallback, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react"; import { absoluteFileUrl, artifactUrl, @@ -44,7 +44,7 @@ import { isDirtyFileBuffer, normalizedFileContent, updateFileDraft, - type FileBufferState, + type FileBufferSession, } from "../fileSync"; import { useLatexCompile } from "../useLatexCompile"; import { useOverleafSync } from "../useOverleafSync"; @@ -144,9 +144,12 @@ export function FileViewer({ onEdit, artifactVersion, artifactEntries = [], - initialBuffer, - onBufferStateChange, + bufferSession, remote = false, + restored = false, + onRestoreActivated, + showSource = false, + onShowSourceChange, }: { projectId: string; path: string; @@ -182,9 +185,12 @@ export function FileViewer({ /** Selected artifact metadata changes only when this path changes. */ artifactVersion?: string | null; artifactEntries?: ArtifactEntry[]; - initialBuffer?: FileBufferState; - onBufferStateChange?: (buffer: FileBufferState | null) => void; + bufferSession: FileBufferSession; remote?: boolean; + restored?: boolean; + onRestoreActivated?: () => void; + showSource?: boolean; + onShowSourceChange?: (showSource: boolean) => void; }) { const [loaded, setLoaded] = useState(null); const [error, setError] = useState(null); @@ -199,27 +205,22 @@ export function FileViewer({ // .html likewise, and its scripts run — see HtmlPreview. const isHtml = isHtmlFile(path); const rendersByDefault = isMarkdown || isHtml; - const [showSource, setShowSource] = useState(false); + const [activated, setActivated] = useState(false); + const autoRun = !restored || activated; + const activate = () => { + setActivated(true); + onRestoreActivated?.(); + }; // Live edit buffer for the code file. It IS the view for editable files (no // edit mode); it tracks the loaded content and diverges as the user types. - const [editState, setEditState] = useState(initialBuffer ?? null); - const editStateRef = useRef(editState); - const onBufferStateChangeRef = useRef(onBufferStateChange); - onBufferStateChangeRef.current = onBufferStateChange; - useEffect(() => { - onBufferStateChangeRef.current = onBufferStateChange; - return () => { onBufferStateChangeRef.current = undefined; }; - }, [onBufferStateChange]); - const updateEditState = (next: FileBufferState | null) => { - editStateRef.current = next; - setEditState(next); - onBufferStateChangeRef.current?.( - next && (isDirtyFileBuffer(next) || next.conflict) ? next : null, - ); - }; - const [saving, setSaving] = useState(false); - const savingRef = useRef(false); - const [saveError, setSaveError] = useState(null); + useSyncExternalStore(bufferSession.subscribe, bufferSession.getRevision); + const editState = bufferSession.getSnapshot(); + const updateEditState = bufferSession.set; + const saving = bufferSession.saving; + const setSaving = bufferSession.setSaving; + const saveRevision = bufferSession.saveRevision; + const saveError = bufferSession.saveError; + const setSaveError = bufferSession.setSaveError; const loadRequestRef = useRef(0); const bodyRef = useRef(null); const scrollPositionRef = useRef(scrollPosition); @@ -288,20 +289,10 @@ export function FileViewer({ const baseline = editState?.baseline ?? normalizedFileContent(data?.content ?? ""); const dirty = editable && editState !== null && isDirtyFileBuffer(editState); - // Clean loads seed the editor. Dirty buffers survive tab switches and any - // incoming disk version is handled by the guarded loader below. - useEffect(() => { - if (!editable || loaded?.source !== "checkout" || typeof data?.version !== "string") return; - const current = editStateRef.current; - if (current && isDirtyFileBuffer(current)) return; - updateEditState(createFileBuffer(data.path, data.content, data.version)); - setSaveError(null); - }, [data?.content, data?.version, editable, loaded?.source, path]); - const save = async (expectedVersion?: string): Promise => { - const savingState = editStateRef.current; + const savingState = bufferSession.getSnapshot(); if (!editable || !savingState || !isDirtyFileBuffer(savingState)) return true; - if (savingRef.current) return false; + if (bufferSession.saving) return false; if (savingState.conflict && expectedVersion === undefined) { setSaveError(savingState.conflict.exists ? m.file_viewer_changed_on_disk() @@ -310,7 +301,6 @@ export function FileViewer({ } const savedDraft = savingState.draft; const content = fileBufferContent(savingState); - savingRef.current = true; setSaving(true); setSaveError(null); try { @@ -318,14 +308,10 @@ export function FileViewer({ sessionId, expectedVersion: expectedVersion ?? savingState.version, }); - const current = editStateRef.current ?? savingState; + const current = bufferSession.getSnapshot(); + if (!current) return false; loadRequestRef.current++; - updateEditState({ - ...current, - baseline: savedDraft, - version: result.version, - conflict: null, - }); + bufferSession.saved(savedDraft, result.version); setLoaded((prev) => prev && prev.source === "checkout" ? { source: "checkout", file: { ...prev.file, content, version: result.version } } @@ -334,7 +320,8 @@ export function FileViewer({ return true; } catch (e) { if (e instanceof FileChangedError) { - const current = editStateRef.current ?? savingState; + const current = bufferSession.getSnapshot(); + if (!current) return false; if (!isDirtyFileBuffer(current)) return false; updateEditState({ ...current, @@ -345,7 +332,6 @@ export function FileViewer({ setSaveError(e instanceof Error ? e.message : String(e)); return false; } finally { - savingRef.current = false; setSaving(false); } }; @@ -358,6 +344,8 @@ export function FileViewer({ filePath, sessionId, enabled: liveTex, + autoRun, + onManualAction: activate, ready: data != null && !data.notFound, source: editable ? draft : (data?.content ?? ""), }); @@ -369,6 +357,8 @@ export function FileViewer({ filePath, sessionId, enabled: liveTex, + autoRun, + onManualAction: activate, savedSource: baseline, dirty, // A pull rewrote the file underneath this view; refetch so the editor shows @@ -412,7 +402,8 @@ export function FileViewer({ // Blur and ⌘S only rebuild when there was an edit to save. const saveAndCompile = async () => { if (!dirty) return; - await compileFromDisk(); + if (autoRun) await compileFromDisk(); + else await save(); }; const [openingEditor, setOpeningEditor] = useState(false); @@ -431,8 +422,8 @@ export function FileViewer({ } }; const reload = useCallback(() => { - if (!savingRef.current) setNonce((value) => value + 1); - }, []); + if (!bufferSession.saving) setNonce((value) => value + 1); + }, [bufferSession]); const discardAndReload = () => { updateEditState(null); setSaveError(null); @@ -455,6 +446,7 @@ export function FileViewer({ useEffect(() => { let cancelled = false; const request = ++loadRequestRef.current; + if (saving) return; // Artifacts come from the compatibility /files endpoint (no session/branch); // repo files from the checkout-aware /file endpoint. All paths normalize // into the same ProjectFile-shaped `data` so the render body is shared. @@ -508,8 +500,8 @@ export function FileViewer({ ); load .then((next) => { - if (cancelled || request !== loadRequestRef.current) return; - const current = editStateRef.current; + if (cancelled || request !== loadRequestRef.current || bufferSession.saving || saveRevision !== bufferSession.saveRevision) return; + const current = bufferSession.getSnapshot(); if (current && isDirtyFileBuffer(current)) { const checkout = next.source === "checkout" ? next.file : null; const sameTarget = checkout !== null && @@ -529,6 +521,11 @@ export function FileViewer({ } else if (!conflict && current.conflict) updateEditState({ ...current, conflict: null }); } + if ((!current || !isDirtyFileBuffer(current)) && next.source === "checkout" && + !next.file.notFound && !next.file.binary && !next.file.truncated && typeof next.file.version === "string") { + updateEditState(createFileBuffer(next.file.path, next.file.content, next.file.version)); + setSaveError(null); + } setLoaded(next); setError(null); }) @@ -538,7 +535,7 @@ export function FileViewer({ return () => { cancelled = true; }; - }, [projectId, path, source, sessionId, gitRef, nonce, artifactVersion, diskVersion]); + }, [projectId, path, source, sessionId, gitRef, nonce, artifactVersion, diskVersion, saving, saveRevision]); // Stays a layout effect: the code views scroll to a `file:line` target in // passive effects, which run after this and so win over the restore. @@ -648,7 +645,7 @@ export function FileViewer({ data-tip={showSource ? m.common_rendered_view() : m.common_view_source()} data-tip-align="end" aria-label={showSource ? m.common_rendered_view() : m.common_view_source()} - onClick={() => setShowSource((s) => !s)} + onClick={() => onShowSourceChange?.(!showSource)} > @@ -771,8 +768,8 @@ export function FileViewer({ className="file-view-body flex-1 min-h-0 overflow-auto bg-background" onScroll={(event) => { const position = { - top: event.currentTarget.scrollTop, - left: event.currentTarget.scrollLeft, + top: Math.max(0, event.currentTarget.scrollTop), + left: Math.max(0, event.currentTarget.scrollLeft), }; scrollPositionRef.current = position; onScrollPositionChange?.(position); @@ -797,7 +794,7 @@ export function FileViewer({ { - const current = editStateRef.current ?? ( + const current = bufferSession.getSnapshot() ?? ( data && typeof data.version === "string" ? createFileBuffer(data.path, data.content, data.version) : null @@ -813,6 +810,11 @@ export function FileViewer({ highlightLine={line} scrollRequest={lineScrollRequest} onScrollRequestHandled={onLineScrollRequestHandled} + scrollPosition={scrollPositionRef.current} + onScrollPositionChange={(position) => { + scrollPositionRef.current = position; + onScrollPositionChange?.(position); + }} /> ) : data.notFound ? (
diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index ae1b7ffc..be9d5efe 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -15,7 +15,7 @@ import { Trash2, X, } from "lucide-react"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useLayoutEffect, useRef, useState } from "react"; import { deleteEnvVar, deleteOverleafToken, @@ -248,15 +248,7 @@ const SETTINGS_STACK_SECTION_CLASS_NAME = [ "[&_>_h2]:mt-0 [&_>_h2]:mx-0 [&_>_h2]:mb-1.5 [&_>_h2]:text-xl", ].join(" "); -export type SettingsTab = - | "settings" - | "harnesses" - | "projects" - | "compute" - | "instances" - | "environment" - | "git" - | "storage"; +export type SettingsTab = import("../workspaceState").SettingsSection; type Tab = SettingsTab; // --- harnesses --------------------------------------------------------------- @@ -2932,11 +2924,9 @@ function OverleafCard() { function GitTab({ project, - publicationError, onProjectUpdate, }: { project: Project | null; - publicationError: string | null; onProjectUpdate: (project: Project) => void; }) { const [status, setStatus] = useState(null); @@ -3074,7 +3064,6 @@ function GitTab({ )}
- {publicationError &&
{syncErrorMessage(publicationError)}
} {error &&
{syncErrorMessage(error)}
} )} @@ -3546,19 +3535,35 @@ function isSettingsSection(tab: Tab): boolean { export function SettingsView({ tab, project, - githubPublicationError, onProjectUpdate, onSelectTab, remote = false, }: { tab: Tab; project: Project | null; - githubPublicationError: string | null; onProjectUpdate: (project: Project) => void; onSelectTab: (tab: Tab) => void; remote?: boolean; }) { const showsSettings = tab === "settings" || isSettingsSection(tab); + const sectionRef = useRef(null); + useLayoutEffect(() => { + const section = sectionRef.current; + const stack = section?.parentElement; + if (!section || !stack) return; + const reveal = () => section.scrollIntoView({ block: "start" }); + // Earlier sections load asynchronously; keep the target visible until the user interacts. + const observer = new ResizeObserver(reveal); + observer.observe(stack); + reveal(); + const stop = () => observer.disconnect(); + const events = ["wheel", "touchstart", "pointerdown", "keydown"]; + for (const event of events) window.addEventListener(event, stop, { passive: true }); + return () => { + stop(); + for (const event of events) window.removeEventListener(event, stop); + }; + }, [tab, project?.id]); return (
@@ -3569,14 +3574,14 @@ export function SettingsView({
-
+
-
+
{!remote && ( -
+
)} @@ -3611,7 +3616,6 @@ export function SettingsView({ {tab === "git" && ( )} diff --git a/ui/src/fileSync.ts b/ui/src/fileSync.ts index 218b891f..3ef0d666 100644 --- a/ui/src/fileSync.ts +++ b/ui/src/fileSync.ts @@ -58,3 +58,44 @@ export function conflictAfterRefresh( if (!isDirtyFileBuffer(buffer) || (exists && currentVersion === buffer.version)) return null; return { currentVersion, exists }; } + +// A tab owns its buffer and pending save even while its viewer is unmounted. +export class FileBufferSession { + private buffer: FileBufferState | null = null; + private listeners = new Set<() => void>(); + saving = false; + saveError: string | null = null; + private revision = 0; + saveRevision = 0; + + getSnapshot = () => this.buffer; + getRevision = () => this.revision; + subscribe = (listener: () => void) => { + this.listeners.add(listener); + return () => { this.listeners.delete(listener); }; + }; + set = (buffer: FileBufferState | null) => { + this.buffer = buffer; + this.notify(); + }; + setSaving = (saving: boolean) => { + this.saving = saving; + if (saving) this.saveRevision++; + this.notify(); + }; + saved = (draft: string, version: string) => { + if (!this.buffer) return; + this.set({ ...this.buffer, baseline: draft, version, conflict: null }); + }; + setSaveError = (error: string | null) => { + this.saveError = error; + this.notify(); + }; + private notify() { + this.revision++; + for (const listener of this.listeners) listener(); + } + get needsProtection() { + return this.saving || (this.buffer !== null && (isDirtyFileBuffer(this.buffer) || this.buffer.conflict !== null)); + } +} diff --git a/ui/src/main.tsx b/ui/src/main.tsx index ecb15c6f..88a02d4c 100644 --- a/ui/src/main.tsx +++ b/ui/src/main.tsx @@ -1,6 +1,7 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; -import { RuntimeRoot } from "./RemoteRuntime"; +import { RouterProvider } from "@tanstack/react-router"; +import { router } from "./router"; import { Toaster } from "./components/ui"; import { getLocale } from "./paraglide/runtime.js"; import "./tailwind.css"; @@ -11,7 +12,7 @@ document.documentElement.dir = "ltr"; createRoot(document.getElementById("root")!).render( - + , ); diff --git a/ui/src/routePages.tsx b/ui/src/routePages.tsx new file mode 100644 index 00000000..3b409954 --- /dev/null +++ b/ui/src/routePages.tsx @@ -0,0 +1,128 @@ +import { Link, useNavigate, type ErrorComponentProps } from "@tanstack/react-router"; +import { useEffect, useState } from "react"; +import { + getUiState, + listProjects, + type Project, + type UiState, +} from "./api"; +import { useRuntime } from "./RemoteRuntime"; +import { useOrxEvents } from "./events"; +import { clearReadDemoSessions } from "./demoSessionState"; +import { globalResumeLocation, projectResumeLocation } from "./routeResume"; +import { getRememberedGlobalWorkspace, globalWorkspaceWriter } from "./workspacePersistence"; +import { m } from "./paraglide/messages.js"; +import { Onboarding } from "./components/Onboarding"; +import { ProjectsHome } from "./components/ProjectsHome"; +import { OfflineBanner } from "./components/OfflineBanner"; +import { RemoteStatus } from "./components/RemoteStatus"; +import { UpdateBanner, useUpdateStatus } from "./components/UpdateBanner"; +import { Button, showAlert, Spinner } from "./components/ui"; + +export function RoutePending() { + return
; +} + +export function RouteNotFound() { + return ( +
+

{m.model_picker_unavailable()}

+ {m.app_projects()} +
+ ); +} + +export function RouteFailure({ error, reset }: Pick) { + return ( +
+

{error.message}

+ + {m.app_projects()} +
+ ); +} + +function Resume({ projectId }: { projectId?: string }) { + const navigate = useNavigate(); + const [error, setError] = useState(null); + const [attempt, setAttempt] = useState(0); + useEffect(() => { + let current = true; + setError(null); + void (projectId ? projectResumeLocation(projectId) : globalResumeLocation()) + .then((href) => { if (current) void navigate({ href, replace: true }); }) + .catch((cause: unknown) => { + if (current) setError(cause instanceof Error ? cause : new Error(String(cause))); + }); + return () => { current = false; }; + }, [projectId, attempt, navigate]); + return error ? setAttempt((value) => value + 1)} /> : ; +} + +export function ResumeGlobal() { return ; } +export function ResumeProject({ projectId }: { projectId: string }) { return ; } + +export function ProjectsPage() { + const runtime = useRuntime(); + const navigate = useNavigate(); + const [projects, setProjects] = useState(null); + const [state, setState] = useState(null); + const [error, setError] = useState(null); + const [attempt, setAttempt] = useState(0); + const { status } = useUpdateStatus(runtime.kind === "local"); + useEffect(() => { + let current = true; + setError(null); + document.title = "OpenResearch"; + void Promise.all([listProjects(), getUiState()]).then(([loadedProjects, loadedState]) => { + if (!current) return; + setProjects(loadedProjects); + setState(loadedState); + globalWorkspaceWriter.queue({ + ...(getRememberedGlobalWorkspace() ?? loadedState.workspace ?? { railOpen: true, panelWidth: 760, experimentsView: "table" }), + lastLocation: "/projects", + }); + }).catch((cause: unknown) => { + if (current) setError(cause instanceof Error ? cause : new Error(String(cause))); + }); + return () => { current = false; }; + }, [attempt]); + useOrxEvents({ + onRun: () => {}, + onExperiment: () => {}, + onProject: (project) => setProjects((current) => current && [...current.filter((item) => item.id !== project.id), project]), + onReconnect: () => setAttempt((value) => value + 1), + }); + const openProject = (projectId: string) => void navigate({ to: "/projects/$projectId", params: { projectId } }); + + return ( +
+ {runtime.kind === "local" && <>} + {error ? setAttempt((value) => value + 1)} /> + : projects === null || state === null ? + : projects.length === 0 && !state.onboardingCompleted ? ( + { + clearReadDemoSessions(); + openProject(project.id); + }} + /> + ) : ( + { + if (publicationError) { + showAlert(publicationError, "error"); + void navigate({ to: "/projects/$projectId/settings/$tab", params: { projectId: project.id, tab: "git" } }); + } else openProject(project.id); + }} + onDeleted={(id) => setProjects((current) => current?.filter((project) => project.id !== id) ?? null)} + /> + )} + {runtime.kind === "ssh" && } +
+ ); +} diff --git a/ui/src/routeResume.ts b/ui/src/routeResume.ts new file mode 100644 index 00000000..8f9c801a --- /dev/null +++ b/ui/src/routeResume.ts @@ -0,0 +1,36 @@ +import { getProjectUiState, getUiState, isDemoProjectId, listChatSessions, listProjects, type ChatSession } from "./api"; +import { defaultTaskWorkspace } from "./workspaceTabs"; +import { getTaskWorkspace, parseDestination, safeLocation, taskLocation } from "./workspaceState"; +import { getRememberedGlobalWorkspace } from "./workspacePersistence"; +import { getCachedProjectWorkspace } from "./useProjectWorkspace"; + +function validSessionLocation(location: string, sessions: ChatSession[]): boolean { + const destination = parseDestination(location.split("?")[0]); + return Boolean(destination && (!destination.sessionId || sessions.some((session) => + session.id === destination.sessionId && session.projectId === destination.projectId))); +} + +export async function globalResumeLocation(): Promise { + const [state, projects] = await Promise.all([getUiState(), listProjects()]); + const location = safeLocation((getRememberedGlobalWorkspace() ?? state.workspace)?.lastLocation); + if (!location) return "/projects"; + const destination = parseDestination(location.split("?")[0]); + if (!destination?.projectId) return "/projects"; + if (!projects.some((project) => project.id === destination.projectId)) return "/projects"; + if (destination.sessionId && !validSessionLocation(location, await listChatSessions(destination.projectId))) + return "/projects"; + return location; +} + +export async function projectResumeLocation(projectId: string): Promise { + const [loaded, sessions] = await Promise.all([getProjectUiState(projectId), listChatSessions(projectId)]); + const state = getCachedProjectWorkspace(projectId) ?? loaded; + const location = safeLocation(state?.lastLocation); + if (location && parseDestination(location.split("?")[0])?.projectId === projectId + && validSessionLocation(location, sessions)) return location; + const newest = sessions.find((session) => !session.archived); + const defaults = isDemoProjectId(projectId) ? defaultTaskWorkspace(newest?.id, !(await getUiState()).tourCompleted) : undefined; + const task = getTaskWorkspace(state, newest?.id ?? "new"); + const rememberedPane = task ? task.active : defaults?.active; + return taskLocation(projectId, newest?.id ?? null, rememberedPane); +} diff --git a/ui/src/routeTree.gen.ts b/ui/src/routeTree.gen.ts new file mode 100644 index 00000000..e37b13cc --- /dev/null +++ b/ui/src/routeTree.gen.ts @@ -0,0 +1,270 @@ +/* eslint-disable */ + +// @ts-nocheck + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as ProjectsRouteImport } from './routes/projects' +import { Route as RemoteLaunchRouteImport } from './routes/remote-launch' +import { Route as ProjectsIndexRouteImport } from './routes/projects.index' +import { Route as ProjectsProjectIdRouteImport } from './routes/projects.$projectId' +import { Route as ProjectsProjectIdIndexRouteImport } from './routes/projects.$projectId.index' +import { Route as ProjectsProjectIdSkillsRouteImport } from './routes/projects.$projectId.skills' +import { Route as ProjectsProjectIdSettingsTabRouteImport } from './routes/projects.$projectId.settings.$tab' +import { Route as ProjectsProjectIdTasksSessionIdRouteImport } from './routes/projects.$projectId.tasks.$sessionId' +import { Route as ProjectsProjectIdTasksNewRouteImport } from './routes/projects.$projectId.tasks.new' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const ProjectsRoute = ProjectsRouteImport.update({ + id: '/projects', + path: '/projects', + getParentRoute: () => rootRouteImport, +} as any) +const RemoteLaunchRoute = RemoteLaunchRouteImport.update({ + id: '/remote-launch', + path: '/remote-launch', + getParentRoute: () => rootRouteImport, +} as any) +const ProjectsIndexRoute = ProjectsIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => ProjectsRoute, +} as any) +const ProjectsProjectIdRoute = ProjectsProjectIdRouteImport.update({ + id: '/$projectId', + path: '/$projectId', + getParentRoute: () => ProjectsRoute, +} as any) +const ProjectsProjectIdIndexRoute = ProjectsProjectIdIndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => ProjectsProjectIdRoute, +} as any) +const ProjectsProjectIdSkillsRoute = ProjectsProjectIdSkillsRouteImport.update({ + id: '/skills', + path: '/skills', + getParentRoute: () => ProjectsProjectIdRoute, +} as any) +const ProjectsProjectIdSettingsTabRoute = + ProjectsProjectIdSettingsTabRouteImport.update({ + id: '/settings/$tab', + path: '/settings/$tab', + getParentRoute: () => ProjectsProjectIdRoute, + } as any) +const ProjectsProjectIdTasksSessionIdRoute = + ProjectsProjectIdTasksSessionIdRouteImport.update({ + id: '/tasks/$sessionId', + path: '/tasks/$sessionId', + getParentRoute: () => ProjectsProjectIdRoute, + } as any) +const ProjectsProjectIdTasksNewRoute = + ProjectsProjectIdTasksNewRouteImport.update({ + id: '/tasks/new', + path: '/tasks/new', + getParentRoute: () => ProjectsProjectIdRoute, + } as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/projects': typeof ProjectsRouteWithChildren + '/remote-launch': typeof RemoteLaunchRoute + '/projects/$projectId': typeof ProjectsProjectIdRouteWithChildren + '/projects/': typeof ProjectsIndexRoute + '/projects/$projectId/skills': typeof ProjectsProjectIdSkillsRoute + '/projects/$projectId/': typeof ProjectsProjectIdIndexRoute + '/projects/$projectId/settings/$tab': typeof ProjectsProjectIdSettingsTabRoute + '/projects/$projectId/tasks/$sessionId': typeof ProjectsProjectIdTasksSessionIdRoute + '/projects/$projectId/tasks/new': typeof ProjectsProjectIdTasksNewRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/remote-launch': typeof RemoteLaunchRoute + '/projects': typeof ProjectsIndexRoute + '/projects/$projectId/skills': typeof ProjectsProjectIdSkillsRoute + '/projects/$projectId': typeof ProjectsProjectIdIndexRoute + '/projects/$projectId/settings/$tab': typeof ProjectsProjectIdSettingsTabRoute + '/projects/$projectId/tasks/$sessionId': typeof ProjectsProjectIdTasksSessionIdRoute + '/projects/$projectId/tasks/new': typeof ProjectsProjectIdTasksNewRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute + '/projects': typeof ProjectsRouteWithChildren + '/remote-launch': typeof RemoteLaunchRoute + '/projects/$projectId': typeof ProjectsProjectIdRouteWithChildren + '/projects/': typeof ProjectsIndexRoute + '/projects/$projectId/skills': typeof ProjectsProjectIdSkillsRoute + '/projects/$projectId/': typeof ProjectsProjectIdIndexRoute + '/projects/$projectId/settings/$tab': typeof ProjectsProjectIdSettingsTabRoute + '/projects/$projectId/tasks/$sessionId': typeof ProjectsProjectIdTasksSessionIdRoute + '/projects/$projectId/tasks/new': typeof ProjectsProjectIdTasksNewRoute +} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: + | '/' + | '/projects' + | '/remote-launch' + | '/projects/$projectId' + | '/projects/' + | '/projects/$projectId/skills' + | '/projects/$projectId/' + | '/projects/$projectId/settings/$tab' + | '/projects/$projectId/tasks/$sessionId' + | '/projects/$projectId/tasks/new' + fileRoutesByTo: FileRoutesByTo + to: + | '/' + | '/remote-launch' + | '/projects' + | '/projects/$projectId/skills' + | '/projects/$projectId' + | '/projects/$projectId/settings/$tab' + | '/projects/$projectId/tasks/$sessionId' + | '/projects/$projectId/tasks/new' + id: + | '__root__' + | '/' + | '/projects' + | '/remote-launch' + | '/projects/$projectId' + | '/projects/' + | '/projects/$projectId/skills' + | '/projects/$projectId/' + | '/projects/$projectId/settings/$tab' + | '/projects/$projectId/tasks/$sessionId' + | '/projects/$projectId/tasks/new' + fileRoutesById: FileRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + ProjectsRoute: typeof ProjectsRouteWithChildren + RemoteLaunchRoute: typeof RemoteLaunchRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + '/projects': { + id: '/projects' + path: '/projects' + fullPath: '/projects' + preLoaderRoute: typeof ProjectsRouteImport + parentRoute: typeof rootRouteImport + } + '/remote-launch': { + id: '/remote-launch' + path: '/remote-launch' + fullPath: '/remote-launch' + preLoaderRoute: typeof RemoteLaunchRouteImport + parentRoute: typeof rootRouteImport + } + '/projects/': { + id: '/projects/' + path: '/' + fullPath: '/projects/' + preLoaderRoute: typeof ProjectsIndexRouteImport + parentRoute: typeof ProjectsRoute + } + '/projects/$projectId': { + id: '/projects/$projectId' + path: '/$projectId' + fullPath: '/projects/$projectId' + preLoaderRoute: typeof ProjectsProjectIdRouteImport + parentRoute: typeof ProjectsRoute + } + '/projects/$projectId/': { + id: '/projects/$projectId/' + path: '/' + fullPath: '/projects/$projectId/' + preLoaderRoute: typeof ProjectsProjectIdIndexRouteImport + parentRoute: typeof ProjectsProjectIdRoute + } + '/projects/$projectId/skills': { + id: '/projects/$projectId/skills' + path: '/skills' + fullPath: '/projects/$projectId/skills' + preLoaderRoute: typeof ProjectsProjectIdSkillsRouteImport + parentRoute: typeof ProjectsProjectIdRoute + } + '/projects/$projectId/settings/$tab': { + id: '/projects/$projectId/settings/$tab' + path: '/settings/$tab' + fullPath: '/projects/$projectId/settings/$tab' + preLoaderRoute: typeof ProjectsProjectIdSettingsTabRouteImport + parentRoute: typeof ProjectsProjectIdRoute + } + '/projects/$projectId/tasks/$sessionId': { + id: '/projects/$projectId/tasks/$sessionId' + path: '/tasks/$sessionId' + fullPath: '/projects/$projectId/tasks/$sessionId' + preLoaderRoute: typeof ProjectsProjectIdTasksSessionIdRouteImport + parentRoute: typeof ProjectsProjectIdRoute + } + '/projects/$projectId/tasks/new': { + id: '/projects/$projectId/tasks/new' + path: '/tasks/new' + fullPath: '/projects/$projectId/tasks/new' + preLoaderRoute: typeof ProjectsProjectIdTasksNewRouteImport + parentRoute: typeof ProjectsProjectIdRoute + } + } +} + +interface ProjectsProjectIdRouteChildren { + ProjectsProjectIdSkillsRoute: typeof ProjectsProjectIdSkillsRoute + ProjectsProjectIdIndexRoute: typeof ProjectsProjectIdIndexRoute + ProjectsProjectIdSettingsTabRoute: typeof ProjectsProjectIdSettingsTabRoute + ProjectsProjectIdTasksSessionIdRoute: typeof ProjectsProjectIdTasksSessionIdRoute + ProjectsProjectIdTasksNewRoute: typeof ProjectsProjectIdTasksNewRoute +} + +const ProjectsProjectIdRouteChildren: ProjectsProjectIdRouteChildren = { + ProjectsProjectIdSkillsRoute: ProjectsProjectIdSkillsRoute, + ProjectsProjectIdIndexRoute: ProjectsProjectIdIndexRoute, + ProjectsProjectIdSettingsTabRoute: ProjectsProjectIdSettingsTabRoute, + ProjectsProjectIdTasksSessionIdRoute: ProjectsProjectIdTasksSessionIdRoute, + ProjectsProjectIdTasksNewRoute: ProjectsProjectIdTasksNewRoute, +} + +const ProjectsProjectIdRouteWithChildren = + ProjectsProjectIdRoute._addFileChildren(ProjectsProjectIdRouteChildren) + +interface ProjectsRouteChildren { + ProjectsProjectIdRoute: typeof ProjectsProjectIdRouteWithChildren + ProjectsIndexRoute: typeof ProjectsIndexRoute +} + +const ProjectsRouteChildren: ProjectsRouteChildren = { + ProjectsProjectIdRoute: ProjectsProjectIdRouteWithChildren, + ProjectsIndexRoute: ProjectsIndexRoute, +} + +const ProjectsRouteWithChildren = ProjectsRoute._addFileChildren( + ProjectsRouteChildren, +) + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + ProjectsRoute: ProjectsRouteWithChildren, + RemoteLaunchRoute: RemoteLaunchRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/ui/src/router.tsx b/ui/src/router.tsx new file mode 100644 index 00000000..6f0fed18 --- /dev/null +++ b/ui/src/router.tsx @@ -0,0 +1,17 @@ +import { createRouter } from "@tanstack/react-router"; +import { routeTree } from "./routeTree.gen"; +import { RouteFailure, RouteNotFound, RoutePending } from "./routePages"; + +export const router = createRouter({ + routeTree, + trailingSlash: "never", + defaultPendingComponent: RoutePending, + defaultErrorComponent: RouteFailure, + defaultNotFoundComponent: RouteNotFound, +}); + +declare module "@tanstack/react-router" { + interface Register { + router: typeof router; + } +} diff --git a/ui/src/routes/__root.tsx b/ui/src/routes/__root.tsx new file mode 100644 index 00000000..5c2810a4 --- /dev/null +++ b/ui/src/routes/__root.tsx @@ -0,0 +1,4 @@ +import { createRootRoute } from "@tanstack/react-router"; +import { RuntimeRoot } from "../RemoteRuntime"; + +export const Route = createRootRoute({ component: RuntimeRoot }); diff --git a/ui/src/routes/index.tsx b/ui/src/routes/index.tsx new file mode 100644 index 00000000..4b83c01d --- /dev/null +++ b/ui/src/routes/index.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from "@tanstack/react-router"; +import { ResumeGlobal } from "../routePages"; + +export const Route = createFileRoute("/")({ component: ResumeGlobal }); diff --git a/ui/src/routes/projects.$projectId.index.tsx b/ui/src/routes/projects.$projectId.index.tsx new file mode 100644 index 00000000..c873796e --- /dev/null +++ b/ui/src/routes/projects.$projectId.index.tsx @@ -0,0 +1,11 @@ +import { createFileRoute } from "@tanstack/react-router"; +import { ResumeProject } from "../routePages"; + +export const Route = createFileRoute("/projects/$projectId/")({ + component: ProjectIndex, +}); + +function ProjectIndex() { + const { projectId } = Route.useParams(); + return ; +} diff --git a/ui/src/routes/projects.$projectId.settings.$tab.tsx b/ui/src/routes/projects.$projectId.settings.$tab.tsx new file mode 100644 index 00000000..f5072801 --- /dev/null +++ b/ui/src/routes/projects.$projectId.settings.$tab.tsx @@ -0,0 +1,3 @@ +import { createFileRoute } from "@tanstack/react-router"; + +export const Route = createFileRoute("/projects/$projectId/settings/$tab")({}); diff --git a/ui/src/routes/projects.$projectId.skills.tsx b/ui/src/routes/projects.$projectId.skills.tsx new file mode 100644 index 00000000..922c7000 --- /dev/null +++ b/ui/src/routes/projects.$projectId.skills.tsx @@ -0,0 +1,3 @@ +import { createFileRoute } from "@tanstack/react-router"; + +export const Route = createFileRoute("/projects/$projectId/skills")({}); diff --git a/ui/src/routes/projects.$projectId.tasks.$sessionId.tsx b/ui/src/routes/projects.$projectId.tasks.$sessionId.tsx new file mode 100644 index 00000000..99d06581 --- /dev/null +++ b/ui/src/routes/projects.$projectId.tasks.$sessionId.tsx @@ -0,0 +1,3 @@ +import { createFileRoute } from "@tanstack/react-router"; + +export const Route = createFileRoute("/projects/$projectId/tasks/$sessionId")({}); diff --git a/ui/src/routes/projects.$projectId.tasks.new.tsx b/ui/src/routes/projects.$projectId.tasks.new.tsx new file mode 100644 index 00000000..07a3a741 --- /dev/null +++ b/ui/src/routes/projects.$projectId.tasks.new.tsx @@ -0,0 +1,3 @@ +import { createFileRoute } from "@tanstack/react-router"; + +export const Route = createFileRoute("/projects/$projectId/tasks/new")({}); diff --git a/ui/src/routes/projects.$projectId.tsx b/ui/src/routes/projects.$projectId.tsx new file mode 100644 index 00000000..c3079583 --- /dev/null +++ b/ui/src/routes/projects.$projectId.tsx @@ -0,0 +1,35 @@ +import { createFileRoute, notFound, Outlet, useRouter, useRouterState } from "@tanstack/react-router"; +import { useEffect } from "react"; +import App from "../App"; +import { useRuntime } from "../RemoteRuntime"; +import { parseDestination, parsePane, type Pane } from "../workspaceState"; + +export const Route = createFileRoute("/projects/$projectId")({ + validateSearch: (search): { pane?: Pane } => ({ pane: parsePane(search.pane) }), + beforeLoad: ({ location }) => { if (!parseDestination(location.pathname)) throw notFound(); }, + component: ProjectLayout, +}); + +function ProjectLayout() { + const { projectId } = Route.useParams(); + const { pane } = Route.useSearch(); + const router = useRouter(); + const location = useRouterState({ select: (state) => state.location }); + useEffect(() => { + const search = normalizedPaneSearch(location.searchStr); + if (search === null) return; + void router.navigate({ href: `${location.pathname}${search}${location.hash ? `#${location.hash}` : ""}`, replace: true }); + }, [location, router]); + return <>; +} + +export function normalizedPaneSearch(searchStr: string): string | null { + const search = new URLSearchParams(searchStr); + if (!search.has("pane")) return null; + try { + if (search.getAll("pane").length === 1 && parsePane(JSON.parse(search.get("pane") ?? ""))) return null; + } catch { /* Invalid JSON is the same as an invalid pane descriptor. */ } + search.delete("pane"); + const query = search.toString(); + return query ? `?${query}` : ""; +} diff --git a/ui/src/routes/projects.index.tsx b/ui/src/routes/projects.index.tsx new file mode 100644 index 00000000..7d0596d7 --- /dev/null +++ b/ui/src/routes/projects.index.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from "@tanstack/react-router"; +import { ProjectsPage } from "../routePages"; + +export const Route = createFileRoute("/projects/")({ component: ProjectsPage }); diff --git a/ui/src/routes/projects.tsx b/ui/src/routes/projects.tsx new file mode 100644 index 00000000..5f07a656 --- /dev/null +++ b/ui/src/routes/projects.tsx @@ -0,0 +1,3 @@ +import { createFileRoute, Outlet } from "@tanstack/react-router"; + +export const Route = createFileRoute("/projects")({ component: Outlet }); diff --git a/ui/src/routes/remote-launch.tsx b/ui/src/routes/remote-launch.tsx new file mode 100644 index 00000000..d00c39a9 --- /dev/null +++ b/ui/src/routes/remote-launch.tsx @@ -0,0 +1,3 @@ +import { createFileRoute } from "@tanstack/react-router"; + +export const Route = createFileRoute("/remote-launch")({}); diff --git a/ui/src/useLatexCompile.ts b/ui/src/useLatexCompile.ts index bbd9888f..dc80e1c2 100644 --- a/ui/src/useLatexCompile.ts +++ b/ui/src/useLatexCompile.ts @@ -49,6 +49,8 @@ export function useLatexCompile({ filePath, sessionId, enabled, + autoRun = true, + onManualAction, ready, source, }: { @@ -58,6 +60,8 @@ export function useLatexCompile({ sessionId?: string; /** This is a .tex file the compiler can actually reach (live checkout). */ enabled: boolean; + autoRun?: boolean; + onManualAction?: () => void; /** The file has loaded, so `source` is real and not the empty initial buffer. */ ready: boolean; /** The live edit buffer, which is what a compile should reflect. */ @@ -105,8 +109,10 @@ export function useLatexCompile({ // double-invokes updaters under StrictMode, so a guard inside one lets two // compiles of the same file race each other's aux and output files. const compilingRef = useRef(false); + const autoCompiled = useRef(null); const compile = useCallback(() => { if (compilingRef.current) return; + autoCompiled.current = filePath; compilingRef.current = true; setCompiling(true); const built = sourceRef.current; @@ -151,13 +157,11 @@ export function useLatexCompile({ // Render the real document on open. Once per file: a compile that fails must // not spin, and the user can retry from the header. - const autoCompiled = useRef(null); useEffect(() => { - if (!enabled || !ready || !engine) return; + if (!enabled || !autoRun || !ready || !engine) return; if (autoCompiled.current === filePath) return; - autoCompiled.current = filePath; compile(); - }, [enabled, ready, engine, filePath, compile]); + }, [enabled, autoRun, ready, engine, filePath, compile]); return { engine, @@ -173,7 +177,10 @@ export function useLatexCompile({ showPdf, setShowPdf: showPdfPane, viewNonce, - compile, + compile: () => { + onManualAction?.(); + compile(); + }, dismiss: () => { setError(null); setLog(null); diff --git a/ui/src/useOverleafSync.ts b/ui/src/useOverleafSync.ts index 60882727..1c77a544 100644 --- a/ui/src/useOverleafSync.ts +++ b/ui/src/useOverleafSync.ts @@ -57,6 +57,8 @@ export function useOverleafSync({ filePath, sessionId, enabled, + autoRun = true, + onManualAction, savedSource, dirty, onPulled, @@ -66,6 +68,8 @@ export function useOverleafSync({ sessionId?: string; /** This is a .tex in the live checkout, so there is a file to sync. */ enabled: boolean; + autoRun?: boolean; + onManualAction?: () => void; /** The file as it stands on disk. A push carries the file, not the compile, * so this — not the compiled source — is what says our side has moved: a * machine with no LaTeX engine never compiles, and is exactly the one this @@ -173,18 +177,18 @@ export function useOverleafSync({ // a sync actually started, so one refused mid-flight is not forgotten. const syncedMarker = useRef(null); useEffect(() => { - if (!enabled || !loaded || !hasToken || !link || dirty) return; + if (!enabled || !autoRun || !loaded || !hasToken || !link || dirty) return; const marker = `${filePath}:${link.projectId}:${savedSource}`; if (syncedMarker.current === marker) return; if (sync()) syncedMarker.current = marker; // `syncing` is a dependency so a sync refused while another was in flight // is retried when that one finishes, rather than waiting for an edit. - }, [enabled, loaded, hasToken, link, filePath, savedSource, dirty, syncing, sync]); + }, [enabled, autoRun, loaded, hasToken, link, filePath, savedSource, dirty, syncing, sync]); // And the other direction: ask whether Overleaf has moved, and sync when it // has. The marker is left alone — this is not a change on our side. useEffect(() => { - if (!enabled || !loaded || !hasToken || !link || dirty) return; + if (!enabled || !autoRun || !loaded || !hasToken || !link || dirty) return; const timer = setInterval(() => { if (syncingRef.current || failedRef.current) return; getOverleafStatus(projectId, filePath, { sessionId }) @@ -197,7 +201,7 @@ export function useOverleafSync({ }); }, POLL_MS); return () => clearInterval(timer); - }, [enabled, loaded, hasToken, link, dirty, projectId, filePath, sessionId, sync]); + }, [enabled, autoRun, loaded, hasToken, link, dirty, projectId, filePath, sessionId, sync]); return { hasToken, @@ -219,6 +223,7 @@ export function useOverleafSync({ }, linkProject: async (project: string) => { apply(await linkOverleaf(projectId, filePath, { project, sessionId })); + onManualAction?.(); }, unlink: async () => { apply(await unlinkOverleaf(projectId, filePath, { sessionId })); @@ -229,7 +234,10 @@ export function useOverleafSync({ }, sync: (resolve?: Record) => { failedRef.current = false; - sync(resolve); + if (sync(resolve)) { + syncedMarker.current = `${filePath}:${link?.projectId}:${savedSource}`; + onManualAction?.(); + } }, }; } diff --git a/ui/src/useProjectWorkspace.ts b/ui/src/useProjectWorkspace.ts new file mode 100644 index 00000000..62cf9cc3 --- /dev/null +++ b/ui/src/useProjectWorkspace.ts @@ -0,0 +1,209 @@ +import { useCallback, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore, type MutableRefObject } from "react"; +import { getProjectUiState, isDemoProjectId, saveProjectUiState } from "./api"; +import { createWorkspaceWriter, emptyProjectWorkspace, getTaskWorkspace, safeLocation, type Pane, type ProjectWorkspace, type TaskWorkspace } from "./workspaceState"; +import { applyPane, defaultTaskWorkspace, paneTab, rememberWorkspace, restoreWorkspace, rightTabKey, fileScrollKey, type RightPaneSessionState } from "./workspaceTabs"; + +let epoch = 0; +const writers = new Map>>(); +const saveErrors = new Map(); +const errorListeners = new Set<() => void>(); +const notifyErrors = () => { for (const listener of errorListeners) listener(); }; +const subscribeErrors = (listener: () => void) => { errorListeners.add(listener); return () => { errorListeners.delete(listener); }; }; +const newTaskPromotions = new Map(); +const projectCache = new Map(); +export const getCachedProjectWorkspace = (projectId: string) => projectCache.get(projectId); +export function clearProjectWorkspaceCache() { + epoch++; + projectCache.clear(); + newTaskPromotions.clear(); + writers.clear(); + saveErrors.clear(); + notifyErrors(); +} +export function inheritNewTaskWorkspace(projectId: string, sessionId: string) { + const current = projectCache.get(projectId); + if (!current?.tasks.new || getTaskWorkspace(current, sessionId)) return; + const source = current.tasks.new; + const remap = (values: Record) => Object.fromEntries(source.tabs.flatMap((pane) => { + if (pane.kind !== "file") return []; + const tab = paneTab(pane); + if (typeof tab === "string" || !("path" in tab)) return []; + const oldKey = fileScrollKey(projectId, null, tab); + return oldKey in values ? [[fileScrollKey(projectId, sessionId, tab), values[oldKey]]] : []; + })); + const tasks = { ...current.tasks, [sessionId]: { ...source, scroll: remap(source.scroll), sourceModes: remap(source.sourceModes) } }; + delete tasks.new; + newTaskPromotions.set(projectId, sessionId); + projectCache.set(projectId, { ...current, tasks }); +} + +function writerFor(id: string) { + let writer = writers.get(id); + if (!writer) { + const visit = epoch; + writer = createWorkspaceWriter(async (value, unloading) => { + if (visit !== epoch) return; + await saveProjectUiState(id, value, unloading); + if (visit === epoch && saveErrors.delete(id)) notifyErrors(); + }, (error) => { + if (visit !== epoch) return; + saveErrors.set(id, error instanceof Error ? error.message : String(error)); + notifyErrors(); + }); + writers.set(id, writer); + } + return writer; +} + +function save(id: string, location: string, key?: string, task?: TaskWorkspace) { + const previous = projectCache.get(id); + if (!previous || (key === "new" && newTaskPromotions.has(id))) return; + const lastLocation = safeLocation(location) ?? previous.lastLocation; + const lastTaskId = key ? key === "new" ? null : key : previous.lastTaskId; + const oldTask = key ? getTaskWorkspace(previous, key) : undefined; + if (lastLocation === previous.lastLocation && lastTaskId === previous.lastTaskId && (!task || JSON.stringify(task) === JSON.stringify(oldTask))) return; + const next = { ...previous, lastLocation, lastTaskId, tasks: key && task ? { ...previous.tasks, [key]: task } : previous.tasks }; + const metadataOnly = oldTask && task && lastLocation === previous.lastLocation + && JSON.stringify({ ...oldTask, scroll: {}, sourceModes: {} }) === JSON.stringify({ ...task, scroll: {}, sourceModes: {} }); + projectCache.set(id, next); + writerFor(id).queue(next, metadataOnly ? 250 : 0); +} + +interface Props { + projectId: string | null; + taskKey: string; + location: string; + pane: Pane | undefined; + isTask: boolean; + demoOverview: boolean; + state: RightPaneSessionState; + apply: (state: RightPaneSessionState, saved: TaskWorkspace | undefined, restored: boolean) => void; + getScroll: () => TaskWorkspace["scroll"]; + sourceModes: TaskWorkspace["sourceModes"]; + revision: number; +} + +interface Committed { + projectId: string; + taskKey: string; + scope: string; + location: string; + pane: Pane | undefined; + state: RightPaneSessionState; +} + +function snapshot(props: Pick, previous: TaskWorkspace | undefined, projectId: string, taskKey: string): TaskWorkspace { + const keys = new Set(props.state.fileTabs.map((tab) => fileScrollKey(projectId, taskKey === "new" ? null : taskKey, tab))); + const scroll = Object.fromEntries(Object.entries(props.getScroll()).filter(([key]) => keys.has(key))); + const sourceModes = Object.fromEntries(Object.entries(props.sourceModes).filter(([key]) => keys.has(key))); + const task = rememberWorkspace(props.state, scroll, sourceModes); + const active = props.pane ?? previous?.active; + const activeKey = active ? rightTabKey(paneTab(active)) : null; + task.active = task.tabs.find((tab) => rightTabKey(paneTab(tab)) === activeKey) ?? null; + return task; +} + +export function useProjectWorkspace(props: Props): { + ready: boolean; + loaded: boolean; + error: string | null; + retry: () => void; + capture: () => void; + workspace: MutableRefObject; +} { + const { projectId, taskKey, location, pane, isTask, demoOverview, state, apply, getScroll, sourceModes, revision } = props; + const workspace = useRef(emptyProjectWorkspace()); + const saveError = useSyncExternalStore(subscribeErrors, () => projectId ? saveErrors.get(projectId) ?? null : null); + const [readError, setReadError] = useState(null); + const [attempt, setAttempt] = useState(0); + const [loadedProject, setLoadedProject] = useState(null); + const [renderedScope, setRenderedScope] = useState(null); + const appliedScope = useRef(null); + const appliedPane = useRef(null); + const committed = useRef(null); + const latest = useRef(props); + latest.current = props; + const scope = JSON.stringify([projectId, taskKey, isTask]); + const paneKey = JSON.stringify(pane ?? null); + + const capture = useCallback(() => { + const previous = committed.current; + if (!previous) return; + const task = snapshot({ ...latest.current, state: previous.state, pane: previous.pane }, getTaskWorkspace(projectCache.get(previous.projectId), previous.taskKey), previous.projectId, previous.taskKey); + save(previous.projectId, previous.location, previous.taskKey, task); + }, []); + + useEffect(() => { + let live = true; + const visit = epoch; + setReadError(null); + setLoadedProject(null); + if (!projectId) return; + if (projectCache.has(projectId)) setLoadedProject(projectId); + else void getProjectUiState(projectId).then((saved) => { + if (!live || visit !== epoch) return; + projectCache.set(projectId, saved ?? emptyProjectWorkspace()); + setLoadedProject(projectId); + }).catch((error: unknown) => { + if (live && visit === epoch) setReadError(error instanceof Error ? error.message : String(error)); + }); + return () => { live = false; }; + }, [projectId, attempt]); + + useLayoutEffect(() => { + if (committed.current && committed.current.scope !== scope) { + const previousProject = committed.current.projectId; + capture(); + if (newTaskPromotions.get(previousProject) === taskKey) newTaskPromotions.delete(previousProject); + committed.current = null; + } + if (!projectId || loadedProject !== projectId) return; + const document = projectCache.get(projectId); + if (!document) return; + workspace.current = document; + if (appliedScope.current !== scope) { + appliedScope.current = scope; + appliedPane.current = paneKey; + if (isTask) { + const saved = getTaskWorkspace(document, taskKey) ?? (isDemoProjectId(projectId) ? defaultTaskWorkspace(taskKey, demoOverview) : undefined); + apply(restoreWorkspace(saved, pane), saved, true); + } + setRenderedScope(scope); + return; + } + if (renderedScope !== scope) return; + let resolvedState = state; + if (appliedPane.current !== paneKey) { + appliedPane.current = paneKey; + if (isTask && pane) { + resolvedState = applyPane(state, pane); + apply(resolvedState, undefined, false); + } + } + if (isTask) { + save(projectId, location, taskKey, snapshot({ state: resolvedState, pane, getScroll, sourceModes }, getTaskWorkspace(document, taskKey), projectId, taskKey)); + committed.current = { projectId, taskKey, scope, location, pane, state: resolvedState }; + } else save(projectId, location); + workspace.current = projectCache.get(projectId) ?? document; + }, [projectId, taskKey, location, pane, paneKey, isTask, demoOverview, state, apply, getScroll, sourceModes, revision, loadedProject, scope, renderedScope, capture]); + + useEffect(() => { + const visit = epoch; + const flush = (unloading: boolean) => { + if (visit !== epoch) return; + capture(); + for (const writer of writers.values()) void writer.flush(unloading); + }; + const onPageHide = () => flush(true); + window.addEventListener("pagehide", onPageHide); + return () => { window.removeEventListener("pagehide", onPageHide); flush(false); }; + }, [capture]); + + const retry = useCallback(() => { + if (!projectId) return; + if (readError) setAttempt((value) => value + 1); + else void writers.get(projectId)?.retry(); + }, [projectId, readError]); + + return { ready: projectId === null || (loadedProject === projectId && renderedScope === scope), loaded: projectId === null || loadedProject === projectId, error: readError ?? saveError, retry, capture, workspace }; +} diff --git a/ui/src/workspacePersistence.ts b/ui/src/workspacePersistence.ts new file mode 100644 index 00000000..7261605e --- /dev/null +++ b/ui/src/workspacePersistence.ts @@ -0,0 +1,40 @@ +import { saveGlobalWorkspace } from "./api"; +import { showAlert } from "./components/ui"; +import { m } from "./paraglide/messages.js"; +import { createWorkspaceWriter, type GlobalWorkspace } from "./workspaceState"; + +let rememberedGlobalWorkspace: GlobalWorkspace | null = null; +let epoch = 0; +export const getRememberedGlobalWorkspace = () => rememberedGlobalWorkspace; + +function createWriter() { + const visit = epoch; + return createWorkspaceWriter( + (value, unloading) => visit === epoch ? saveGlobalWorkspace(value, unloading) : Promise.resolve(), + (error) => { + if (visit !== epoch) return; + showAlert(error instanceof Error ? error.message : String(error), "error", { + id: "workspace-save", + action: { label: m.app_retry(), onClick: () => void globalWorkspaceWriter.retry() }, + }); + }, + ); +} +let writer = createWriter(); + +export function resetGlobalWorkspace() { + epoch++; + rememberedGlobalWorkspace = null; + writer = createWriter(); +} + +export const globalWorkspaceWriter = { + flush: (unloading = false) => writer.flush(unloading), + retry: () => writer.retry(), + queue(value: GlobalWorkspace, delay = 0) { + rememberedGlobalWorkspace = value; + writer.queue(value, delay); + }, +}; + +window.addEventListener("pagehide", () => void globalWorkspaceWriter.flush(true)); diff --git a/ui/src/workspaceState.ts b/ui/src/workspaceState.ts new file mode 100644 index 00000000..afc38c81 --- /dev/null +++ b/ui/src/workspaceState.ts @@ -0,0 +1,152 @@ +export type Pane = + | { kind: "home"; view: "experiments" | "files" | "artifacts" } + | { kind: "experiment"; experimentId: string; view: "overview" | "terminal"; runId?: string } + | { kind: "file"; path: string; source?: "repo" | "artifacts" | "abs"; sessionId?: string; ref?: string; line?: number; branchLabel?: string } + | { kind: "code"; experimentId: string; branch: string; view: "files" | "changes" } + | { kind: "plan"; sessionId: string; promptId: string } + | { kind: "subagent"; sessionId: string; spawnPartId: string }; + +export interface TaskWorkspace { + tabs: Pane[]; + active: Pane | null; + previewKey: string | null; + history: string[]; + expanded: Record; + scroll: Record; + sourceModes: Record; + filesView: "files" | "changes"; + scope: "agent" | "project"; + panelMax: boolean; +} + +export interface ProjectWorkspace { + version: 1; + lastTaskId: string | null; + lastLocation: string | null; + tasks: Record; +} + +export function getTaskWorkspace(workspace: ProjectWorkspace | null | undefined, key: string): TaskWorkspace | undefined { + return workspace && Object.hasOwn(workspace.tasks, key) ? workspace.tasks[key] : undefined; +} + +export interface GlobalWorkspace { + lastLocation: string | null; + railOpen: boolean; + panelWidth: number; + experimentsView: "tree" | "table"; +} + +export const settingsTabs = ["settings", "harnesses", "projects", "compute", "instances", "environment", "git", "storage"] as const; +export type SettingsSection = typeof settingsTabs[number]; +export const isSettingsSection = (value: unknown): value is SettingsSection => + settingsTabs.some((tab) => tab === value); + +export const isRecord = (value: unknown): value is Record => + typeof value === "object" && value !== null && !Array.isArray(value); +const nonempty = (value: unknown): value is string => typeof value === "string" && value.length > 0; +const optionalString = (value: unknown) => value == null || nonempty(value); + +export function parsePane(value: unknown): Pane | undefined { + if (!isRecord(value)) return; + const only = (...fields: string[]) => Object.keys(value).every((field) => fields.includes(field)); + switch (value.kind) { + case "home": + if (only("kind", "view") && (value.view === "experiments" || value.view === "files" || value.view === "artifacts")) + return { kind: "home", view: value.view }; + break; + case "experiment": + if (only("kind", "experimentId", "view", "runId") && nonempty(value.experimentId) && (value.view === "overview" || value.view === "terminal") && optionalString(value.runId)) + return { kind: "experiment", experimentId: value.experimentId, view: value.view, ...(nonempty(value.runId) ? { runId: value.runId } : {}) }; + break; + case "file": + if (only("kind", "path", "source", "sessionId", "ref", "line", "branchLabel") && nonempty(value.path) && optionalString(value.sessionId) && optionalString(value.ref) && optionalString(value.branchLabel) + && (value.source == null || value.source === "repo" || value.source === "artifacts" || value.source === "abs") + && (value.line == null || (typeof value.line === "number" && Number.isSafeInteger(value.line) && value.line > 0))) + return { kind: "file", path: value.path, ...(value.source ? { source: value.source } : {}), + ...(nonempty(value.sessionId) ? { sessionId: value.sessionId } : {}), ...(nonempty(value.ref) ? { ref: value.ref } : {}), + ...(typeof value.line === "number" ? { line: value.line } : {}), ...(nonempty(value.branchLabel) ? { branchLabel: value.branchLabel } : {}) }; + break; + case "code": + if (only("kind", "experimentId", "branch", "view") && nonempty(value.experimentId) && nonempty(value.branch) && (value.view === "files" || value.view === "changes")) + return { kind: "code", experimentId: value.experimentId, branch: value.branch, view: value.view }; + break; + case "plan": + if (only("kind", "sessionId", "promptId") && nonempty(value.sessionId) && nonempty(value.promptId)) return { kind: "plan", sessionId: value.sessionId, promptId: value.promptId }; + break; + case "subagent": + if (only("kind", "sessionId", "spawnPartId") && nonempty(value.sessionId) && nonempty(value.spawnPartId)) return { kind: "subagent", sessionId: value.sessionId, spawnPartId: value.spawnPartId }; + } +} + +export interface Destination { + kind: "home" | "resume" | "task" | "skills" | "settings"; + projectId?: string; + sessionId?: string; + section?: SettingsSection; +} + +export function parseDestination(pathname: string): Destination | null { + if (pathname === "/projects") return { kind: "home" }; + const parts = pathname.split("/"); + if (parts[0] !== "" || parts[1] !== "projects" || !parts[2]) return null; + let projectId: string; + let leaf: string; + try { projectId = decodeURIComponent(parts[2]); leaf = decodeURIComponent(parts[4] ?? ""); } catch { return null; } + const validId = (id: string) => id.length > 0 && id !== "." && id !== ".." && !/[\\/?#\u0000-\u001f\u007f-\u009f]/.test(id); + if (!validId(projectId)) return null; + if (parts.length === 3 || (parts.length === 4 && parts[3] === "")) return { kind: "resume", projectId }; + if (parts.length === 4 && parts[3] === "skills") return { kind: "skills", projectId }; + if (parts.length === 5 && parts[3] === "tasks" && validId(leaf)) return { kind: "task", projectId, ...(leaf === "new" ? {} : { sessionId: leaf }) }; + if (parts.length === 5 && parts[3] === "settings" && isSettingsSection(leaf)) return { kind: "settings", projectId, section: leaf }; + return null; +} + +export function safeLocation(value: unknown): string | null { + if (typeof value !== "string" || !value.startsWith("/") || value.startsWith("//") || /[\\#\u0000-\u001f\u007f-\u009f]/.test(value)) return null; + const delimiter = value.indexOf("?"); + const pathname = delimiter === -1 ? value : value.slice(0, delimiter); + const query = delimiter === -1 ? "" : value.slice(delimiter + 1); + const destination = parseDestination(pathname); + if (!destination || destination.kind === "resume") return null; + const search = new URLSearchParams(query); + if ([...search.keys()].some((key) => key !== "pane") || search.getAll("pane").length > 1) return null; + if (search.has("pane")) { + try { if (!parsePane(JSON.parse(search.get("pane") ?? ""))) return null; } catch { return null; } + } + return value; +} + +export function taskLocation(projectId: string, sessionId: string | null, pane?: Pane | null): string { + const path = `/projects/${encodeURIComponent(projectId)}/tasks/${sessionId ? encodeURIComponent(sessionId) : "new"}`; + return pane ? `${path}?${new URLSearchParams({ pane: JSON.stringify(pane) })}` : path; +} + +export const emptyProjectWorkspace = (): ProjectWorkspace => ({ version: 1, lastTaskId: null, lastLocation: null, tasks: {} }); + +// ponytail: one serialized writer per mounted workspace; add multi-window coordination only if needed. +export function createWorkspaceWriter(save: (value: T, unloading: boolean) => Promise, onError: (error: unknown) => void) { + let pending: T | undefined; + let failed: T | undefined; + let running = false; + let unloadPending = false; + let timer: ReturnType | undefined; + async function flush(unloading = false): Promise { + clearTimeout(timer); + unloadPending ||= unloading; + if (running || pending === undefined) return; + running = true; + const value = pending; + pending = undefined; + const keepalive = unloadPending; + unloadPending = false; + try { await save(value, keepalive); failed = undefined; } + catch (error) { failed = value; onError(error); } + finally { running = false; if (pending !== undefined) void flush(); } + } + return { + queue(value: T, delay = 0) { pending = value; clearTimeout(timer); timer = setTimeout(() => void flush(), delay); }, + flush, + retry() { if (!running && pending === undefined) pending = failed; return flush(); }, + }; +} diff --git a/ui/src/workspaceTabs.ts b/ui/src/workspaceTabs.ts new file mode 100644 index 00000000..401b5d58 --- /dev/null +++ b/ui/src/workspaceTabs.ts @@ -0,0 +1,345 @@ +import type { ExperimentView } from "./components/DetailDrawer"; +import type { CodeView } from "./components/CodeTab"; +import type { WorktreeView } from "./components/WorktreeTab"; +import { DEMO_MAIN_SESSION_ID, DEMO_FIGURE_SESSION_ID, DEMO_LITERATURE_SESSION_ID, DEMO_OVERVIEW_ARTIFACT } from "./api"; +import type { Pane, TaskWorkspace } from "./workspaceState"; + +export function tabPane(tab: RightTab, runId?: string | null): Pane { + if (typeof tab === "string") return { kind: "home", view: tab }; + if ("code" in tab) return { kind: "code", experimentId: tab.experimentId, branch: tab.branch, view: tab.view }; + if ("kind" in tab) return tab.kind === "plan" + ? { kind: "plan", sessionId: tab.sessionId, promptId: tab.promptId } + : { kind: "subagent", sessionId: tab.sessionId, spawnPartId: tab.spawnPartId }; + if ("path" in tab) return { kind: "file", path: tab.path, source: tab.source, sessionId: tab.sessionId, ref: tab.ref, line: tab.line, branchLabel: tab.branchLabel }; + const selectedRun = runId === undefined ? tab.runId : runId; + return { kind: "experiment", experimentId: tab.id, view: tab.view, ...(selectedRun ? { runId: selectedRun } : {}) }; +} + +export function paneTab(pane: Pane): RightTab { + switch (pane.kind) { + case "home": return pane.view; + case "experiment": return { id: pane.experimentId, view: pane.view, ...(pane.runId ? { runId: pane.runId } : {}) }; + case "file": return { path: pane.path, source: pane.source, sessionId: pane.sessionId, ref: pane.ref, line: pane.line, branchLabel: pane.branchLabel }; + case "code": return { code: true, experimentId: pane.experimentId, branch: pane.branch, view: pane.view, toggled: new Set() }; + case "plan": return { kind: "plan", sessionId: pane.sessionId, promptId: pane.promptId, plan: "" }; + case "subagent": return { kind: "subagent", sessionId: pane.sessionId, spawnPartId: pane.spawnPartId }; + } +} + +export function rememberWorkspace(state: RightPaneSessionState, scroll: TaskWorkspace["scroll"], sourceModes: TaskWorkspace["sourceModes"]): TaskWorkspace { + const home: RightTab[] = []; + if (state.filesTabOpen) home.push("files"); + if (state.artifactsTabOpen) home.push("artifacts"); + if (state.experimentsTabOpen) home.push("experiments"); + const content = [...state.expTabs, ...state.fileTabs, ...state.planTabs, ...state.subagentTabs, ...state.codeTabs]; + const byKey = new Map(content.map((tab) => [rightTabKey(tab), tab])); + const ordered = state.contentTabOrder.flatMap((key) => { const tab = byKey.get(key); return tab ? [tab] : []; }); + const activeKey = rightTabKey(state.rightTab); + const tabs = [...home, ...ordered].map((tab) => tabPane(tab, rightTabKey(tab) === activeKey ? state.selectedRunId : undefined)); + return { tabs, active: state.panelOpen ? tabPane(state.rightTab, state.selectedRunId) : null, + previewKey: state.previewTab ? rightTabKey(state.previewTab) : null, + history: state.tabHistory.map(rightTabKey), + expanded: Object.fromEntries([["files", [...state.filesToggled]], ...state.codeTabs.map((tab) => [rightTabKey(tab), [...tab.toggled]])]), + scroll, sourceModes, filesView: state.filesView, scope: state.scope, panelMax: state.panelMax }; +} + +export function restoreWorkspace(saved: TaskWorkspace | undefined, pane: Pane | undefined): RightPaneSessionState { + const state = initialRightPaneSessionState(); + if (saved) { + state.filesView = saved.filesView; + state.filesToggled = new Set(saved.expanded.files ?? []); + state.scope = saved.scope; + state.panelMax = saved.panelMax; + } + const tabs = [...(saved?.tabs ?? [])]; + if (pane) { + const index = tabs.findIndex((item) => rightTabKey(paneTab(item)) === rightTabKey(paneTab(pane))); + if (index === -1) tabs.push(pane); + else tabs[index] = pane; + } + for (const item of tabs) { + const tab = paneTab(item); + if (typeof tab === "string") { + if (tab === "experiments") state.experimentsTabOpen = true; + if (tab === "files") state.filesTabOpen = true; + if (tab === "artifacts") state.artifactsTabOpen = true; + continue; + } + if ("code" in tab) { tab.toggled = new Set(saved?.expanded[rightTabKey(tab)] ?? []); state.codeTabs.push(tab); } + else if ("path" in tab) state.fileTabs.push(tab); + else if ("kind" in tab) { + if (tab.kind === "plan") state.planTabs.push(tab); + else state.subagentTabs.push(tab); + } else state.expTabs.push(tab); + state.contentTabOrder.push(rightTabKey(tab)); + } + const byKey = new Map(tabs.map((item) => { const tab = paneTab(item); return [rightTabKey(tab), tab]; })); + state.tabHistory = (saved?.history ?? []).flatMap((key) => { const tab = byKey.get(key); return tab ? [tab] : []; }); + state.previewTab = saved?.previewKey ? byKey.get(saved.previewKey) ?? null : null; + state.rightTab = pane ? paneTab(pane) : saved?.active ? paneTab(saved.active) : "experiments"; + state.panelOpen = pane !== undefined; + state.selectedRunId = pane?.kind === "experiment" ? pane.runId ?? null : null; + return applyPane(state, pane); +} + +/** An experiment view open as a right-panel tab. */ +export interface ExpViewDef { + id: string; + view: ExperimentView; + runId?: string; +} + +export const sameExpTab = (a: ExpViewDef, b: ExpViewDef) => a.id === b.id && a.view === b.view; + +/** A project file open as a right-panel tab (clicked in chat tool rows or the + * code browser). */ +export interface FileViewDef { + path: string; + /** Which backend serves this file. Absent/"repo" → the repo `/file` + * endpoint (worktree/clone/branch), falling back to artifacts when a + * non-ref path misses the checkout; "artifacts" → the project's durable + * output directory through the compatibility `/files/file` endpoint; + * "abs" → an absolute path on disk outside both (the `/files/abs` + * endpoint), for files an agent references anywhere on the machine. */ + source?: "repo" | "artifacts" | "abs"; + /** Chat session whose worktree holds the file (absent → hub clone). + * Artifact and absolute-path tabs never carry this. */ + sessionId?: string; + /** Branch whose committed copy to show (code browser in branch mode); + * overrides the live checkout. */ + ref?: string; + /** Branch to show in the header chip when the file is read from a checkout + * (no `ref`) whose branch isn't the baseline — e.g. an experiment's worktree. + * Display-only, so it's kept out of tab identity. */ + branchLabel?: string; + /** 1-based line to scroll to and highlight on open (from a `file:line` + * evidence chip). Not part of tab identity — reopening at a new line updates + * the same tab. */ + line?: number; + /** One-shot generation for explicit line navigation; omitted on stored tabs. */ + lineScrollRequest?: number; +} + +export const sameFileTab = (a: FileViewDef, b: FileViewDef) => + a.path === b.path && + (a.source ?? "repo") === (b.source ?? "repo") && + a.sessionId === b.sessionId && + a.ref === b.ref; + +export const fileTabKey = (t: FileViewDef) => + `${t.source ?? "repo"}:${t.sessionId ?? ""}:${t.ref ?? ""}:${t.path}`; + +export const fileScrollKey = (projectId: string, ownerSessionId: string | null, tab: FileViewDef) => + `${projectId}:${ownerSessionId ?? ""}:${fileTabKey(tab)}`; + +export const persistentFileTab = (tab: FileViewDef): FileViewDef => ({ + ...tab, + lineScrollRequest: undefined, +}); + +export function persistentRightTab(tab: RightTab): RightTab { + return typeof tab === "object" && "path" in tab + ? persistentFileTab(tab) + : tab; +} + +/** A proposed plan open as a right-panel tab (from the chat plan strip/card). + * The markdown is already client-side (it rode the prompt part), so the tab + * renders it directly — no fetch. Deliberately has neither a `view` nor a + * `path` field: the other tab kinds discriminate on those. */ +export interface PlanViewDef { + kind: "plan"; + sessionId: string; + /** The prompt part the plan came from — one tab per plan card. */ + promptId: string; + plan: string; +} + +/** A sub-agent's transcript, opened from a chat spawn row's "view" button. One + * tab per spawn part; its parts stream live off the session's chat message. */ +export interface SubagentViewDef { + kind: "subagent"; + sessionId: string; + /** The `subagent` spawn part whose `children` are the sub-agent transcript. */ + spawnPartId: string; + /** The spawn row's activity label at open time — the tab title. */ + label?: string; +} + +/** One committed code-browser tab per experiment branch. Source, selected + * view, and expansion state live here so they survive tab switches. */ +export interface CodeTabDef { + code: true; + experimentId: string; + branch: string; + view: CodeView; + /** Dirs the user flipped away from their depth default. */ + toggled: ReadonlySet; +} + +export const sameCodeTab = (a: CodeTabDef, b: CodeTabDef) => a.branch === b.branch; + +export type RightTab = + | "experiments" + | "files" + | "artifacts" + | ExpViewDef + | FileViewDef + | PlanViewDef + | SubagentViewDef + | CodeTabDef; + +export type ContentTab = Exclude; + +export function rightTabKey(tab: RightTab): string { + if (typeof tab === "string") return `home:${tab}`; + if ("code" in tab) return `code:${tab.branch}`; + if ("kind" in tab) { + return tab.kind === "plan" ? `plan:${tab.promptId}` : `subagent:${tab.spawnPartId}`; + } + if ("path" in tab) return `file:${fileTabKey(tab)}`; + return `experiment:${tab.id}:${tab.view}`; +} + +/** Drop `key`'s tab from one strip list, keeping the array identity (and so the + * effects keyed on it) when the tab doesn't live in this list. */ +export function withoutTab(tabs: T[], key: string): T[] { + const next = tabs.filter((tab) => rightTabKey(tab) !== key); + return next.length === tabs.length ? tabs : next; +} + +export function isPresent(value: T | undefined): value is T { + return value !== undefined; +} + +export interface RightPaneSessionState { + rightTab: RightTab; + tabHistory: RightTab[]; + experimentsTabOpen: boolean; + filesTabOpen: boolean; + artifactsTabOpen: boolean; + expTabs: ExpViewDef[]; + fileTabs: FileViewDef[]; + planTabs: PlanViewDef[]; + subagentTabs: SubagentViewDef[]; + codeTabs: CodeTabDef[]; + /** Stable strip order for content tabs; home tabs keep their fixed leading slots. */ + contentTabOrder: string[]; + /** The reusable preview tab, replaced by the next preview open. */ + previewTab: RightTab | null; + filesView: WorktreeView; + filesToggled: ReadonlySet; + selectedRunId: string | null; + scope: "agent" | "project"; + panelOpen: boolean; + panelMax: boolean; +} + +export function initialRightPaneSessionState( + sessionId?: string, + openDemoOverview = false, +): RightPaneSessionState { + const initial: RightPaneSessionState = { + rightTab: "experiments", + tabHistory: [], + experimentsTabOpen: false, + filesTabOpen: false, + artifactsTabOpen: false, + expTabs: [], + fileTabs: [], + planTabs: [], + subagentTabs: [], + codeTabs: [], + contentTabOrder: [], + previewTab: null, + filesView: "files", + filesToggled: new Set(), + selectedRunId: null, + scope: "project", + panelOpen: false, + panelMax: false, + }; + if (sessionId === DEMO_MAIN_SESSION_ID && openDemoOverview) { + const demoOverviewTab: FileViewDef = { + path: DEMO_OVERVIEW_ARTIFACT, + source: "artifacts", + }; + // First demo open leads with the experiments tab so the idle follow-ups + // are visible next to the prefilled prompt that runs one of them. + const experimentsTab: RightTab = "experiments"; + return { + ...initial, + rightTab: experimentsTab, + tabHistory: [demoOverviewTab, experimentsTab], + experimentsTabOpen: true, + fileTabs: [demoOverviewTab], + contentTabOrder: [rightTabKey(demoOverviewTab)], + panelOpen: true, + }; + } + if (sessionId === DEMO_FIGURE_SESSION_ID) { + const fileTabs: FileViewDef[] = [ + { path: "nanochat-base-training-curves.svg", source: "artifacts" }, + { path: "nanochat-sft-training-curves.svg", source: "artifacts" }, + { path: "nanochat-training-throughput.svg", source: "artifacts" }, + { path: "nanochat-core-evaluation.svg", source: "artifacts" }, + ]; + return { + ...initial, + rightTab: fileTabs[0], + tabHistory: [...fileTabs.slice(1), fileTabs[0]], + fileTabs, + contentTabOrder: fileTabs.map(rightTabKey), + panelOpen: true, + }; + } + if (sessionId === DEMO_LITERATURE_SESSION_ID) { + const fileTabs: FileViewDef[] = [ + { path: "nanochat-bottleneck-diagnosis.md", source: "artifacts" }, + ]; + return { + ...initial, + rightTab: fileTabs[0], + tabHistory: [fileTabs[0]], + fileTabs, + contentTabOrder: fileTabs.map(rightTabKey), + panelOpen: true, + }; + } + return initial; +} + +export function defaultTaskWorkspace(sessionId: string | undefined, openDemoOverview: boolean): TaskWorkspace | undefined { + const state = initialRightPaneSessionState(sessionId, openDemoOverview); + return state.panelOpen ? rememberWorkspace(state, {}, {}) : undefined; +} + +export function applyPane(state: RightPaneSessionState, pane: Pane | undefined): RightPaneSessionState { + if (!pane) return state; + const tab = paneTab(pane); + const key = rightTabKey(tab); + const existing = [...state.expTabs, ...state.fileTabs, ...state.codeTabs, ...state.planTabs, ...state.subagentTabs].find((item) => rightTabKey(item) === key); + const update = (tabs: T[], target: T): T[] => { + const index = tabs.findIndex((item) => rightTabKey(item) === key); + if (index < 0) return [...tabs, target]; + if (JSON.stringify(tabPane(tabs[index])) === JSON.stringify(tabPane(target))) return tabs; + return tabs.map((item, i) => i === index ? { ...item, ...target } : item); + }; + const next = { ...state }; + if (typeof tab === "string") { + if (tab === "files") next.filesTabOpen = true; + else if (tab === "artifacts") next.artifactsTabOpen = true; + else next.experimentsTabOpen = true; + } else { + if ("path" in tab) next.fileTabs = update(state.fileTabs, tab); + else if ("id" in tab) next.expTabs = update(state.expTabs, { ...tab, runId: pane.kind === "experiment" ? pane.runId : undefined }); + else if ("code" in tab) next.codeTabs = update(state.codeTabs, { ...tab, toggled: existing && "code" in existing ? existing.toggled : tab.toggled }); + else if (tab.kind === "plan") next.planTabs = update(state.planTabs, tab); + else next.subagentTabs = update(state.subagentTabs, tab); + if (!state.contentTabOrder.includes(key)) next.contentTabOrder = [...state.contentTabOrder, key]; + } + const last = state.tabHistory.at(-1); + if (last && rightTabKey(last) === key && JSON.stringify(tabPane(last)) === JSON.stringify(tabPane(tab))) return next; + next.tabHistory = [...state.tabHistory.filter((item) => rightTabKey(item) !== key), tab]; + return next; +} diff --git a/ui/tests/detailDrawer.test.mjs b/ui/tests/detailDrawer.test.mjs new file mode 100644 index 00000000..389846ab --- /dev/null +++ b/ui/tests/detailDrawer.test.mjs @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { createRequire } from "node:module"; +import test from "node:test"; +import React from "react"; +import { renderToStaticMarkup } from "react-dom/server"; +import ts from "typescript"; + +const require = createRequire(import.meta.url); +const source = readFileSync(new URL("../src/components/DetailDrawer.tsx", import.meta.url), "utf8"); +const compiled = ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS, jsx: ts.JsxEmit.ReactJSX }, +}).outputText; +const mocks = { + "../paraglide/messages.js": { m: new Proxy({}, { get: (_, name) => () => String(name) }) }, + "../api": { runDisplayStatus: () => "complete", timeAgo: () => "now" }, + "./ExperimentOverview": { ExperimentOverview: () => null }, + "./LogTerminal": { LogTerminal: ({ runId }) => `LOG:${runId}` }, + "./StatusBadge": { StatusBadge: () => null }, + "./ui": { Button: ({ children }) => React.createElement("button", null, children) }, + "lucide-react": { ChevronDown: () => null, CircleStop: () => null }, +}; +const exports = {}; +new Function("require", "exports", compiled)((name) => mocks[name] ?? require(name), exports); +const props = { + experiment: { id: "experiment-a", slug: "example" }, + project: {}, + view: "terminal", + runs: [ + { id: "run-old", experimentId: "experiment-a", createdAt: 1, status: "completed" }, + { id: "run-new", experimentId: "experiment-a", createdAt: 2, status: "completed" }, + { id: "foreign-run", experimentId: "experiment-b", createdAt: 3, status: "completed" }, + ], + onSelectRun: () => assert.fail("render must not navigate"), +}; +const render = (selectedRunId) => renderToStaticMarkup(React.createElement(exports.DetailDrawer, { ...props, selectedRunId })); + +test("terminal uses newest only when the URL omits a run", () => { + assert.match(render(null), /LOG:run-new/); + const explicit = render("run-old"); + assert.match(explicit, /LOG:run-old/); + assert.doesNotMatch(explicit, /LOG:run-new/); +}); + +test("missing and foreign explicit runs render unavailable without substituting another run", () => { + for (const id of ["missing-run", "foreign-run"]) { + const html = render(id); + assert.doesNotMatch(html, /LOG:/); + assert.match(html, /model_picker_unavailable/); + } +}); diff --git a/ui/tests/fileRestore.test.mjs b/ui/tests/fileRestore.test.mjs new file mode 100644 index 00000000..c795b56f --- /dev/null +++ b/ui/tests/fileRestore.test.mjs @@ -0,0 +1,162 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +import ts from "typescript"; + +// Execute the hooks with deterministic effect turns and timers, without a browser. +function viewerHooks(restored) { + const slots = []; + const timers = new Map(); + const calls = { compile: 0, sync: 0, status: 0, activated: 0 }; + let cursor = 0; + let changed = true; + let effects = []; + let timerId = 0; + let autoRun = !restored; + const same = (a, b) => a && a.length === b.length && a.every((v, i) => Object.is(v, b[i])); + const react = { + useState(initial) { + const index = cursor++; + if (!(index in slots)) slots[index] = initial; + return [slots[index], (update) => { + const next = typeof update === "function" ? update(slots[index]) : update; + if (!Object.is(next, slots[index])) { slots[index] = next; changed = true; } + }]; + }, + useRef(initial) { + const index = cursor++; + slots[index] ??= { current: initial }; + return slots[index]; + }, + useCallback(callback, deps) { + const index = cursor++; + if (!same(slots[index]?.deps, deps)) slots[index] = { deps, callback }; + return slots[index].callback; + }, + useEffect(effect, deps) { + const index = cursor++; + if (same(slots[index]?.deps, deps)) return; + const previous = slots[index]; + slots[index] = { deps }; + effects.push(() => { + previous?.cleanup?.(); + slots[index].cleanup = effect(); + }); + }, + }; + const link = { projectId: "paper", url: "https://overleaf.com/project/paper" }; + const api = { + getLatexEngine: async () => ({ engine: "tectonic", hint: null, installCommand: null }), + compileLatex: async () => { + calls.compile++; + return { ok: true, pdfPath: "paper.pdf", hadErrors: false, note: null }; + }, + getOverleafState: async () => ({ hasToken: true, link }), + getOverleafStatus: async () => { calls.status++; return { remoteChanged: true }; }, + syncOverleaf: async () => { + calls.sync++; + return { pulled: [], pushed: [], conflicts: [] }; + }, + overleafUploadUrl: () => "https://overleaf.com/upload", + linkOverleaf: async () => ({ hasToken: true, link }), + saveOverleafToken: async () => ({ hasToken: true }), + }; + function loadHook(name) { + const source = readFileSync(new URL(`../src/${name}.ts`, import.meta.url), "utf8"); + const compiled = ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 }, + }).outputText; + const exports = {}; + new Function("require", "exports", "setInterval", "clearInterval", compiled)( + (id) => { + if (id === "react") return react; + if (id === "./api") return api; + if (id === "./paraglide/messages.js") return { m: {} }; + throw new Error(`Unexpected dependency: ${id}`); + }, + exports, + (callback) => { timers.set(++timerId, callback); return timerId; }, + (id) => timers.delete(id), + ); + return exports[name]; + } + const useLatexCompile = loadHook("useLatexCompile"); + const useOverleafSync = loadHook("useOverleafSync"); + const onManualAction = () => { calls.activated++; autoRun = true; changed = true; }; + const result = { + calls, + async flush() { + for (let turn = 0; turn < 20; turn++) { + if (changed) { + changed = false; + cursor = 0; + const common = { projectId: "project", filePath: "paper.tex", enabled: true, autoRun, onManualAction }; + result.latex = useLatexCompile({ ...common, ready: true, source: "paper" }); + result.overleaf = useOverleafSync({ ...common, savedSource: "paper", dirty: false, onPulled: () => {} }); + const pending = effects; + effects = []; + pending.forEach((effect) => effect()); + } + await Promise.resolve(); + } + }, + async focus() { changed = true; await result.flush(); }, + async poll() { [...timers.values()].forEach((callback) => callback()); await result.flush(); }, + }; + return result; +} + +test("restored tabs load controls but focus and polling never compile or sync", async () => { + const viewer = viewerHooks(true); + await viewer.flush(); + assert.equal(viewer.latex.engine, "tectonic"); + assert.equal(viewer.latex.compiled, null); + assert.equal(viewer.latex.showPdf, false); + assert.equal(viewer.overleaf.loaded, true); + await viewer.focus(); + await viewer.poll(); + assert.deepEqual(viewer.calls, { compile: 0, sync: 0, status: 0, activated: 0 }); +}); + +test("explicit compile opts both hooks in without a duplicate initial compile", async () => { + const viewer = viewerHooks(true); + await viewer.flush(); + viewer.latex.compile(); + await viewer.flush(); + assert.deepEqual(viewer.calls, { compile: 1, sync: 1, status: 0, activated: 1 }); + await viewer.poll(); + assert.equal(viewer.calls.status, 1); + assert.equal(viewer.calls.sync, 2); +}); + +test("explicit sync opts both hooks in without a duplicate initial sync", async () => { + const viewer = viewerHooks(true); + await viewer.flush(); + viewer.overleaf.sync(); + await viewer.flush(); + assert.deepEqual(viewer.calls, { compile: 1, sync: 1, status: 0, activated: 1 }); + await viewer.poll(); + assert.equal(viewer.calls.sync, 2); +}); + +test("link-and-sync remains an explicit opt-in; saving a token alone is passive", async () => { + const viewer = viewerHooks(true); + await viewer.flush(); + await viewer.overleaf.saveToken("token"); + await viewer.flush(); + assert.equal(viewer.calls.sync, 0); + await viewer.overleaf.linkProject("paper"); + await viewer.flush(); + assert.deepEqual(viewer.calls, { compile: 1, sync: 1, status: 0, activated: 1 }); +}); + +test("intentionally opened tabs retain automatic compile and sync", async () => { + const viewer = viewerHooks(false); + await viewer.flush(); + assert.deepEqual(viewer.calls, { compile: 1, sync: 1, status: 0, activated: 0 }); + await viewer.focus(); + assert.equal(viewer.calls.compile, 1); + assert.equal(viewer.calls.sync, 1); + await viewer.poll(); + assert.equal(viewer.calls.sync, 2); +}); diff --git a/ui/tests/fileSync.test.mjs b/ui/tests/fileSync.test.mjs index efb7faa8..ca3eac5a 100644 --- a/ui/tests/fileSync.test.mjs +++ b/ui/tests/fileSync.test.mjs @@ -7,6 +7,7 @@ import { confirmingFileDiscard, createFileBuffer, fileBufferContent, + FileBufferSession, updateFileDraft, } from "../src/fileSync.ts"; @@ -55,3 +56,68 @@ test("undoing to the baseline clears the conflict without changing the saved ver assert.deepEqual(updateFileDraft(dirty, "baseline"), clean); assert.deepEqual(updateFileDraft(dirty, "new draft").conflict, dirty.conflict); }); + + +test("a pending save survives viewer unmount and updates the remounted buffer", () => { + const session = new FileBufferSession(); + session.set(updateFileDraft(createFileBuffer("paper.tex", "original", "v1"), "saved edit")); + let firstNotifications = 0; + const unmount = session.subscribe(() => firstNotifications++); + session.setSaving(true); + const revisionDuringSave = session.saveRevision; + unmount(); + let displayed; + const remount = session.subscribe(() => { displayed = session.getSnapshot(); }); + session.saved("saved edit", "v2"); + session.setSaving(false); + assert.equal(firstNotifications, 1); + assert.equal(displayed.draft, "saved edit"); + assert.equal(displayed.version, "v2"); + assert.equal(session.needsProtection, false); + assert.equal(session.saving, false); + assert.equal(revisionDuringSave, 1); + remount(); +}); + +test("save completion preserves edits made after returning to the tab", () => { + const session = new FileBufferSession(); + session.set(updateFileDraft(createFileBuffer("paper.tex", "original", "v1"), "first edit")); + session.setSaving(true); + session.set(updateFileDraft(session.getSnapshot(), "second edit")); + session.saved("first edit", "v2"); + session.setSaving(false); + assert.equal(session.getSnapshot().draft, "second edit"); + assert.equal(session.getSnapshot().baseline, "first edit"); + assert.equal(session.getSnapshot().version, "v2"); + assert.equal(session.needsProtection, true); + session.set(null); + session.saved("second edit", "v3"); + assert.equal(session.getSnapshot(), null); + assert.equal(session.needsProtection, false); +}); + + +test("undo during a pending save remains protected until the saved baseline is known", () => { + const session = new FileBufferSession(); + session.set(updateFileDraft(createFileBuffer("paper.tex", "original", "v1"), "pending")); + session.setSaving(true); + session.set(updateFileDraft(session.getSnapshot(), "original")); + assert.equal(session.needsProtection, true); + session.saved("pending", "v2"); + session.setSaving(false); + assert.equal(session.needsProtection, true); + assert.equal(session.getSnapshot().draft, "original"); + assert.equal(session.getSnapshot().baseline, "pending"); +}); + +test("a save error is retained and delivered to the current viewer", () => { + const session = new FileBufferSession(); + let displayed; + const unsubscribe = session.subscribe(() => { displayed = session.saveError; }); + session.setSaveError("Disk full"); + assert.equal(displayed, "Disk full"); + unsubscribe(); + assert.equal(session.saveError, "Disk full"); + session.setSaveError(null); + assert.equal(session.saveError, null); +}); diff --git a/ui/tests/routes.test.mjs b/ui/tests/routes.test.mjs new file mode 100644 index 00000000..fd754d29 --- /dev/null +++ b/ui/tests/routes.test.mjs @@ -0,0 +1,144 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +import * as routing from "@tanstack/react-router"; +import * as react from "react"; +import * as jsx from "react/jsx-runtime"; +import ts from "typescript"; +import * as workspace from "../src/workspaceState.ts"; + +// Run complete route modules with UI-only dependencies stubbed; route definitions stay real. +function loadModule(filename, api = {}, remembered = null) { + const cache = new Map(); + function load(url) { + if (cache.has(url.href)) return cache.get(url.href); + const output = ts.transpileModule(readFileSync(url, "utf8"), { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022, jsx: ts.JsxEmit.ReactJSX }, + }).outputText; + const exports = {}; + cache.set(url.href, exports); + new Function("require", "exports", output)((id) => { + if (id === "@tanstack/react-router") return routing; + if (id === "react") return react; + if (id.endsWith("/useProjectWorkspace")) return { getCachedProjectWorkspace: () => undefined }; + if (id === "react/jsx-runtime") return jsx; + if (id.endsWith("/workspaceState")) return workspace; + if (id.endsWith("/workspacePersistence")) return { getRememberedGlobalWorkspace: () => remembered }; + if (id === "./api") return { isDemoProjectId: () => false, ...api }; + if (id === "./workspaceTabs") return load(new URL("./workspaceTabs.ts", url)); + if (id === "../App") return { default: () => null }; + if (id === "../RemoteRuntime") return { RuntimeRoot: () => null, useRuntime: () => ({ kind: "local" }) }; + if (id === "../routePages") return { ResumeGlobal: () => null, ResumeProject: () => null, ProjectsPage: () => null }; + if (id.startsWith("./routes/")) return load(new URL(`${id}.tsx`, url)); + throw new Error(`Unexpected dependency: ${id}`); + }, exports); + return exports; + } + return load(new URL(`../src/${filename}`, import.meta.url)); +} + +async function match(path) { + const { routeTree } = loadModule("routeTree.gen.ts"); + const router = routing.createRouter({ routeTree, isServer: false, history: routing.createMemoryHistory({ initialEntries: [path] }) }); + await router.load(); + return router; +} + +test("real file routes distinguish task/new, task IDs, project index, and settings", async () => { + for (const [path, routeId] of [ + ["/", "/"], + ["/projects", "/projects/"], + ["/projects/p", "/projects/$projectId/"], + ["/projects/p/tasks/new", "/projects/$projectId/tasks/new"], + ["/projects/p/tasks/old", "/projects/$projectId/tasks/$sessionId"], + ["/projects/p/skills", "/projects/$projectId/skills"], + ["/projects/p/settings/git", "/projects/$projectId/settings/$tab"], + ["/remote-launch", "/remote-launch"], + ]) { + const router = await match(path); + assert.equal(router.state.matches.at(-1).routeId, routeId, path); + assert.equal(router.state.matches.at(-1).status, "success", path); + } + for (const path of ["/projects/p/settings/unknown", "/projects/p/tasks/%00"]) { + const invalid = await match(path); + assert(invalid.state.matches.some((route) => route.status === "notFound"), path); + } +}); + +test("project search validates every pane variant and rejects malformed panes", async () => { + const panes = [ + { kind: "home", view: "files" }, + { kind: "experiment", experimentId: "experiment", view: "terminal", runId: "run" }, + { kind: "file", path: "notes.md", line: 3 }, + { kind: "code", experimentId: "experiment", branch: "main", view: "changes" }, + { kind: "plan", sessionId: "task", promptId: "prompt" }, + { kind: "subagent", sessionId: "task", spawnPartId: "part" }, + ]; + for (const pane of [...panes, { kind: "unknown" }, "broken", null]) { + const router = await match(`/projects/p/tasks/task?${new URLSearchParams({ pane: JSON.stringify(pane) })}`); + assert.deepEqual(router.matchRoutes(router.state.location).at(-1).search.pane, workspace.parsePane(pane)); + } + const closed = await match("/projects/p/tasks/task"); + assert.equal(closed.state.matches.at(-1).search.pane, undefined); +}); + +function resumeApi(lastLocation, sessions = [], projects = [{ id: "p" }], tasks = {}) { + return { + getUiState: async () => ({ workspace: { lastLocation } }), + getProjectUiState: async () => ({ version: 1, lastLocation, tasks }), + listProjects: async () => projects, + listChatSessions: async () => sessions, + }; +} + +test("global resume preserves settings and archived task links, and terminates stale redirects at home", async () => { + for (const [location, sessions, expected] of [ + ["/projects/p/settings/storage", [], "/projects/p/settings/storage"], + ["/projects/p/tasks/old", [{ id: "old", projectId: "p", archived: true }], "/projects/p/tasks/old"], + ["/projects/p/tasks/deleted", [], "/projects"], + ["/projects/deleted/tasks/new", [], "/projects"], + ["/projects/p", [], "/projects"], + ["//elsewhere.test", [], "/projects"], + [null, [], "/projects"], + ]) { + const { globalResumeLocation } = loadModule("routeResume.ts", resumeApi(location, sessions)); + assert.equal(await globalResumeLocation(), expected); + } +}); + +test("project resume uses API order, keeps remembered pane, and falls back to new when all tasks are archived", async () => { + const pane = { kind: "file", path: "notes.md" }; + const sessions = [{ id: "archived", archived: true }, { id: "latest", archived: false }, { id: "older", archived: false }]; + const { projectResumeLocation } = loadModule("routeResume.ts", resumeApi( + "/projects/p/tasks/deleted", sessions, undefined, { latest: { active: pane } }, + )); + assert.equal(await projectResumeLocation("p"), workspace.taskLocation("p", "latest", pane)); + const empty = loadModule("routeResume.ts", resumeApi("/projects/other/settings/git", [{ id: "archived", archived: true }])); + assert.equal(await empty.projectResumeLocation("p"), "/projects/p/tasks/new"); +}); + +test("resume uses the current database response and current queued preference; failed reads never become defaults", async () => { + const saved = "/projects/p/settings/git"; + const api = resumeApi(saved); + const current = loadModule("routeResume.ts", api, { lastLocation: "/projects/p/skills" }); + assert.equal(await current.globalResumeLocation(), "/projects/p/skills"); + const otherDatabase = loadModule("routeResume.ts", resumeApi(saved, [], [{ id: "other" }])); + assert.equal(await otherDatabase.globalResumeLocation(), "/projects"); + const failed = loadModule("routeResume.ts", { + ...api, + getUiState: async () => { throw new Error("offline"); }, + getProjectUiState: async () => { throw new Error("offline"); }, + }); + await assert.rejects(failed.globalResumeLocation(), /offline/); + await assert.rejects(failed.projectResumeLocation("p"), /offline/); +}); + + +test("malformed pane cleanup removes only the invalid pane and leaves valid descriptors unchanged", () => { + const { normalizedPaneSearch } = loadModule("routes/projects.$projectId.tsx"); + assert.equal(normalizedPaneSearch("?pane=not-json"), ""); + assert.equal(normalizedPaneSearch("?pane=%7B%7D&other=1"), "?other=1"); + const valid = new URLSearchParams({ pane: JSON.stringify({ kind: "home", view: "files" }) }); + assert.equal(normalizedPaneSearch(`?${valid}`), null); + assert.equal(normalizedPaneSearch(`?${valid}&${valid}`), ""); +}); diff --git a/ui/tests/workspace.test.mjs b/ui/tests/workspace.test.mjs new file mode 100644 index 00000000..7f7885db --- /dev/null +++ b/ui/tests/workspace.test.mjs @@ -0,0 +1,333 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; +import ts from "typescript"; +import * as workspace from "../src/workspaceState.ts"; + +function load(name, dependencies) { + const code = ts.transpileModule(readFileSync(new URL(`../src/${name}.ts`, import.meta.url), "utf8"), { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 }, + }).outputText; + const exports = {}; + new Function("require", "exports", "window", code)((id) => { + if (id in dependencies) return dependencies[id]; + throw new Error(`Unexpected dependency: ${id}`); + }, exports, { addEventListener() {}, removeEventListener() {} }); + return exports; +} +const demo = { DEMO_MAIN_SESSION_ID: "demo-main", DEMO_FIGURE_SESSION_ID: "demo-figures", DEMO_LITERATURE_SESSION_ID: "demo-literature", DEMO_OVERVIEW_ARTIFACT: "overview.md" }; +const tabs = load("workspaceTabs", { "./api": demo }); +const clean = (value) => JSON.parse(JSON.stringify(value)); +const deferred = () => { + let resolve, reject; + const promise = new Promise((yes, no) => { resolve = yes; reject = no; }); + return { promise, resolve, reject }; +}; + +function host(api) { + const slots = []; + let cursor = 0, changed = true, effects = [], layouts = []; + const same = (a, b) => a && b && a.length === b.length && a.every((value, i) => Object.is(value, b[i])); + const effect = (queue) => (callback, deps) => { + const index = cursor++; + if (same(slots[index]?.deps, deps)) return; + const previous = slots[index]; + slots[index] = { deps }; + queue.push(() => { previous?.cleanup?.(); slots[index].cleanup = callback(); }); + }; + const react = { + useState(initial) { + const index = cursor++; + if (!(index in slots)) slots[index] = typeof initial === "function" ? initial() : initial; + return [slots[index], (update) => { + const next = typeof update === "function" ? update(slots[index]) : update; + if (!Object.is(next, slots[index])) { slots[index] = next; changed = true; } + }]; + }, + useRef(initial) { const index = cursor++; slots[index] ??= { current: initial }; return slots[index]; }, + useCallback(callback, deps) { + const index = cursor++; + if (!same(slots[index]?.deps, deps)) slots[index] = { callback, deps }; + return slots[index].callback; + }, + useEffect(callback, deps) { effect(effects)(callback, deps); }, + useLayoutEffect(callback, deps) { effect(layouts)(callback, deps); }, + useSyncExternalStore(subscribe, getSnapshot) { react.useEffect(() => subscribe(() => { changed = true; }), [subscribe]); return getSnapshot(); }, + }; + const hook = load("useProjectWorkspace", { react, "./api": { ...api, isDemoProjectId: () => false }, "./workspaceState": workspace, "./workspaceTabs": tabs }); + const readiness = []; + let state = tabs.initialRightPaneSessionState(); + let props = { projectId: "p", taskKey: "one", isTask: true, demoOverview: false, location: "/projects/p/tasks/one", pane: undefined, sourceModes: {}, revision: 0 }; + const scroll = {}; + const getScroll = () => scroll; + const apply = (next, saved, restored) => { + state = next; + if (restored) { Object.assign(scroll, saved?.scroll); Object.assign(props.sourceModes, saved?.sourceModes); } + changed = true; + }; + let result; + return { + hook, readiness, scroll, + get result() { return result; }, + get state() { return state; }, + navigate(projectId, taskKey, pane) { + props = { ...props, projectId, taskKey, pane, location: workspace.taskLocation(projectId, taskKey === "new" ? null : taskKey, pane) }; + state = { ...state, rightTab: pane ? tabs.paneTab(pane) : "experiments", panelOpen: Boolean(pane), selectedRunId: pane?.kind === "experiment" ? pane.runId ?? null : null }; + changed = true; + }, + async flush() { + for (let round = 0; round < 30; round++) { + if (changed) { + changed = false; + cursor = 0; + result = hook.useProjectWorkspace({ ...props, state, apply, getScroll }); + readiness.push(result.ready); + const pendingLayouts = layouts; layouts = []; pendingLayouts.forEach((run) => run()); + const pendingEffects = effects; effects = []; pendingEffects.forEach((run) => run()); + } + await Promise.resolve(); + } + await new Promise((resolve) => setTimeout(resolve, 2)); + }, + unmount() { slots.forEach((slot) => slot?.cleanup?.()); }, + }; +} + +const file = { kind: "file", path: "paper.tex", branchLabel: "experiment-branch", line: 8 }; +const code = { kind: "code", experimentId: "exp", branch: "experiment-branch", view: "changes" }; +function savedTask(panes = [file, code]) { + let state = panes.reduce((current, pane) => tabs.applyPane(current, pane), tabs.initialRightPaneSessionState()); + state = tabs.applyPane(state, panes[0]); + state.rightTab = tabs.paneTab(panes[0]); state.panelOpen = true; + return tabs.rememberWorkspace(state, {}, {}); +} + +test("all tab variants retain ordering, preview, history, expansion and view metadata", () => { + const panes = [file, code, { kind: "experiment", experimentId: "exp", view: "terminal", runId: "old" }, { kind: "plan", sessionId: "one", promptId: "plan" }, { kind: "subagent", sessionId: "one", spawnPartId: "spawn" }]; + const saved = savedTask(panes); + saved.previewKey = tabs.rightTabKey(tabs.paneTab(file)); + saved.expanded = { files: ["src"], [tabs.rightTabKey(tabs.paneTab(code))]: ["src/utils"] }; + saved.scroll = { file: { top: 100, left: 8 } }; saved.sourceModes = { file: true }; saved.panelMax = true; + const restored = tabs.restoreWorkspace(saved, file); + assert.deepEqual(clean(tabs.rememberWorkspace(restored, saved.scroll, saved.sourceModes)), clean(saved)); + const selected = tabs.applyPane(restored, { ...code, view: "files" }); + assert.equal(selected.fileTabs, restored.fileTabs); + assert.equal(selected.expTabs, restored.expTabs); + assert.equal(selected.subagentTabs, restored.subagentTabs); + assert.deepEqual([...selected.codeTabs[0].toggled], ["src/utils"]); + const line = tabs.applyPane(restored, { ...file, line: 20 }); + assert.equal(line.fileTabs[0].branchLabel, "experiment-branch"); + assert.equal(line.fileTabs[0].line, 20); +}); + +test("demo defaults preserve the welcome, figures, and literature workspaces", () => { + assert.equal(tabs.defaultTaskWorkspace("ordinary", true), undefined); + assert.equal(tabs.defaultTaskWorkspace(demo.DEMO_MAIN_SESSION_ID, false), undefined); + assert.deepEqual(tabs.defaultTaskWorkspace(demo.DEMO_MAIN_SESSION_ID, true).active, { kind: "home", view: "experiments" }); + assert.equal(tabs.defaultTaskWorkspace(demo.DEMO_FIGURE_SESSION_ID, false).tabs.length, 4); + assert.equal(tabs.defaultTaskWorkspace(demo.DEMO_LITERATURE_SESSION_ID, false).tabs[0].path, "nanochat-bottleneck-diagnosis.md"); +}); + +test("delayed hydration cannot save defaults or apply a previous project response", async () => { + const a = deferred(), b = deferred(), writes = []; + const app = host({ getProjectUiState: (id) => id === "p" ? a.promise : b.promise, saveProjectUiState: async (...args) => { writes.push(args); } }); + await app.flush(); + assert.equal(app.result.ready, false); assert.equal(writes.length, 0); + app.navigate("other", "two", undefined); await app.flush(); + b.resolve({ ...workspace.emptyProjectWorkspace(), tasks: { two: savedTask() } }); await app.flush(); + assert.equal(app.result.ready, true); assert.equal(app.state.fileTabs[0].path, "paper.tex"); + a.resolve({ ...workspace.emptyProjectWorkspace(), tasks: { one: savedTask([{ kind: "file", path: "wrong.txt" }]) } }); await app.flush(); + assert.equal(app.state.fileTabs[0].path, "paper.tex"); + assert(writes.every(([id]) => id === "other")); + app.unmount(); +}); + +test("pane history keeps task readiness and saved tabs; task switches restore the target snapshot", async () => { + const writes = []; + const document = { ...workspace.emptyProjectWorkspace(), tasks: { one: savedTask(), two: savedTask([{ kind: "home", view: "artifacts" }]) } }; + const app = host({ getProjectUiState: async () => document, saveProjectUiState: async (...args) => { writes.push(args); } }); + await app.flush(); + assert.equal(app.state.panelOpen, false); + assert.equal(app.hook.getCachedProjectWorkspace("p").tasks.one.active.kind, "file"); + app.readiness.length = 0; + app.navigate("p", "one", { ...file, line: 23 }); await app.flush(); + assert(app.readiness.every(Boolean)); + assert.equal(app.state.fileTabs[0].line, 23); + app.navigate("p", "two", undefined); await app.flush(); + assert.equal(app.state.fileTabs.length, 0); assert.equal(app.state.artifactsTabOpen, true); + app.navigate("p", "one", undefined); await app.flush(); + assert.equal(app.state.fileTabs[0].line, 23); + assert.equal(app.state.panelOpen, false); + assert.equal(app.hook.getCachedProjectWorkspace("p").tasks.one.active.line, 23); + assert(writes.length > 0); + app.unmount(); +}); + +test("failed hydration stays read-only until a successful retry", async () => { + let fail = true; + const writes = []; + const app = host({ getProjectUiState: async () => { if (fail) throw new Error("offline"); return { ...workspace.emptyProjectWorkspace(), tasks: { one: savedTask() } }; }, saveProjectUiState: async (...args) => { writes.push(args); } }); + await app.flush(); + assert.equal(app.result.error, "offline"); assert.equal(app.result.ready, false); assert.equal(writes.length, 0); + fail = false; app.result.retry(); await app.flush(); + assert.equal(app.result.error, null); assert.equal(app.result.ready, true); assert.equal(app.state.fileTabs[0].path, "paper.tex"); + app.unmount(); +}); + + +test("creating a task moves its workspace and retains an explicitly closed pane", async () => { + const key = tabs.fileScrollKey("p", null, tabs.paneTab(file)); + const saved = savedTask(); saved.scroll[key] = { top: 75, left: 0 }; saved.sourceModes[key] = true; + const app = host({ getProjectUiState: async () => ({ ...workspace.emptyProjectWorkspace(), tasks: { new: saved } }), saveProjectUiState: async () => {} }); + app.navigate("p", "new", undefined); await app.flush(); + app.scroll[key] = { top: 500, left: 2 }; + app.result.capture(); + app.hook.inheritNewTaskWorkspace("p", "created"); + app.navigate("p", "created", undefined); await app.flush(); + const document = app.hook.getCachedProjectWorkspace("p"); + const newKey = tabs.fileScrollKey("p", "created", tabs.paneTab(file)); + assert.equal(document.tasks.new, undefined); + assert.equal(document.lastTaskId, "created"); + assert.equal(document.lastLocation, "/projects/p/tasks/created"); + assert.equal(app.state.panelOpen, false); + assert.equal(document.tasks.created.scroll[newKey].top, 500); + assert.equal(document.tasks.created.sourceModes[newKey], true); + app.unmount(); +}); + +test("unmount captures scroll changes that are still awaiting their debounce", async () => { + const writes = []; + const app = host({ getProjectUiState: async () => ({ ...workspace.emptyProjectWorkspace(), tasks: { one: savedTask() } }), saveProjectUiState: async (id, state) => { writes.push(state); } }); + await app.flush(); + const key = tabs.fileScrollKey("p", "one", tabs.paneTab(file)); + app.scroll[key] = { top: 500, left: 2 }; + app.unmount(); + assert.equal(writes.at(-1).tasks.one.scroll[key].top, 500); +}); + +test("changing runtimes drops queued writes from the previous database", async () => { + const first = deferred(), writes = []; + const app = host({ getProjectUiState: async () => ({ ...workspace.emptyProjectWorkspace(), tasks: { one: savedTask() } }), saveProjectUiState: async (id, state) => { writes.push(state); await first.promise; } }); + await app.flush(); + app.navigate("p", "one", file); await app.flush(); + assert.equal(writes.length, 1); + app.hook.clearProjectWorkspaceCache(); + first.resolve(); await app.flush(); + assert.equal(writes.length, 1); + assert.equal(app.hook.getCachedProjectWorkspace("p"), undefined); + app.unmount(); +}); + + +test("selected run descriptors survive tab-close fallback history", () => { + const overview = { kind: "experiment", experimentId: "exp", view: "overview" }; + const pinned = { ...overview, runId: "older-run" }; + let state = tabs.applyPane(tabs.initialRightPaneSessionState(), overview); + state = tabs.applyPane(state, pinned); + state = tabs.applyPane(state, file); + const history = state.tabHistory.filter((tab) => tabs.rightTabKey(tab) !== tabs.rightTabKey(tabs.paneTab(file))); + assert.deepEqual(tabs.tabPane(history.at(-1)), pinned); + const cleared = tabs.applyPane(state, overview); + assert.equal(tabs.tabPane(cleared.tabHistory.at(-1)).runId, undefined); +}); + +test("prototype names in task URLs cannot hydrate inherited object values", async () => { + for (const key of ["constructor", "__proto__", "toString"]) { + assert.equal(workspace.getTaskWorkspace(workspace.emptyProjectWorkspace(), key), undefined); + const app = host({ getProjectUiState: async () => workspace.emptyProjectWorkspace(), saveProjectUiState: async () => {} }); + app.navigate("p", key, undefined); + await app.flush(); + assert.equal(app.result.ready, true); + assert.equal(app.state.fileTabs.length, 0); + app.unmount(); + } +}); + + +test("a run baseline resolving after project unmount cannot navigate", async () => { + const source = ts.createSourceFile("App.tsx", readFileSync(new URL("../src/App.tsx", import.meta.url), "utf8"), ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX); + let baseline, projectEffect; + function visit(node) { + if (ts.isVariableDeclaration(node) && node.name.getText(source) === "loadRunsBaseline") baseline = node.initializer.arguments[0]; + if (ts.isCallExpression(node) && node.expression.getText(source) === "useEffect" && node.arguments[0]?.getText(source).includes("loadRunsBaseline(projectId);")) projectEffect = node.arguments[0]; + ts.forEachChild(node, visit); + } + visit(source); + const response = deferred(); + let navigations = 0; + const context = { + projectId: "p", projectIdRef: { current: "p" }, observedRunsProjectRef: { current: "p" }, + runsVisitRef: { current: 0 }, runsBaselineReadyRef: { current: false }, + baselineRunsRef: { current: new Map() }, pendingFirstRunningRunsRef: { current: new Map() }, + observedRunsRef: { current: new Map() }, liveRunIdsRef: { current: new Set() }, + listRuns: () => response.promise, listExperiments: async () => [], getArtifacts: async () => [], openProject: async () => {}, + setExperiments() {}, setRuns() {}, setArtifacts() {}, setRunDataReady() {}, setExperimentDataReady() {}, + openExperimentsTab: () => { navigations++; }, + }; + function evaluate(node) { + assert(node); + const code = ts.transpileModule(`const callback = ${node.getText(source)};`, { compilerOptions: { target: ts.ScriptTarget.ES2022 } }).outputText; + return new Function(...Object.keys(context), `${code}; return callback;`)(...Object.values(context)); + } + context.loadRunsBaseline = evaluate(baseline); + const cleanup = evaluate(projectEffect)(); + context.pendingFirstRunningRunsRef.current.set("run", { id: "run", status: "running", updatedAt: "now" }); + cleanup(); + response.resolve([]); + await response.promise; + await Promise.resolve(); + assert.equal(navigations, 0); + assert.equal(context.runsBaselineReadyRef.current, false); +}); + + +test("deep-linked tabs participate in close fallback after hydration", () => { + let state = tabs.restoreWorkspace(undefined, file); + state = tabs.applyPane(state, code); + const fallback = state.tabHistory.filter((tab) => tabs.rightTabKey(tab) !== tabs.rightTabKey(tabs.paneTab(code))).at(-1); + assert.deepEqual(clean(tabs.tabPane(fallback)), file); + const saved = savedTask([file, code]); + assert.equal(tabs.rightTabKey(tabs.restoreWorkspace(saved, code).tabHistory.at(-1)), tabs.rightTabKey(tabs.paneTab(code))); + assert.deepEqual(tabs.restoreWorkspace(saved, undefined).tabHistory.map(tabs.rightTabKey), saved.history); +}); + +test("session refresh removes missing tasks while preserving concurrent live events", async () => { + const source = ts.createSourceFile("App.tsx", readFileSync(new URL("../src/App.tsx", import.meta.url), "utf8"), ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX); + let callback; + function visit(node) { + if (ts.isVariableDeclaration(node) && node.name.getText(source) === "loadSessionIds") callback = node.initializer.arguments[0]; + ts.forEachChild(node, visit); + } + visit(source); + assert(callback); + const response = deferred(); + let ids = ["old", "deleted-offline"]; + const sessionLoadRef = { current: null }, rememberedSessionRef = { current: "deleted-offline" }; + const code = ts.transpileModule(`const callback = ${callback.getText(source)};`, { compilerOptions: { target: ts.ScriptTarget.ES2022 } }).outputText; + const load = new Function("listChatSessions", "projectId", "sessionLoadRef", "setSessions", "rememberedSessionRef", `${code}; return callback;`)(() => response.promise, "p", sessionLoadRef, (next) => { ids = next; }, rememberedSessionRef); + const pending = load(); + sessionLoadRef.current.set("created-live", true); + sessionLoadRef.current.set("deleted-live", false); + response.resolve([{ id: "old" }, { id: "deleted-live" }]); + await pending; + assert.deepEqual(ids, ["old", "created-live"]); + assert.equal(rememberedSessionRef.current, null); + assert.equal(sessionLoadRef.current, null); +}); + + +test("code destinations cannot silently substitute another experiment branch", () => { + const source = ts.createSourceFile("App.tsx", readFileSync(new URL("../src/App.tsx", import.meta.url), "utf8"), ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX); + let expression; + function visit(node) { + if (ts.isVariableDeclaration(node) && node.name.getText(source) === "codeExperiment") expression = node.initializer; + ts.forEachChild(node, visit); + } + visit(source); + assert(expression); + const resolve = new Function("codeTab", "experiments", `return ${expression.getText(source)};`); + const experiment = { id: "exp", branchName: "expected" }; + assert.equal(resolve({ experimentId: "exp", branch: "wrong" }, [experiment]), null); + assert.equal(resolve({ experimentId: "exp", branch: "expected" }, [experiment]), experiment); + assert.equal(resolve({ experimentId: "missing", branch: "expected" }, [experiment]), null); +}); diff --git a/ui/tests/workspaceState.test.mjs b/ui/tests/workspaceState.test.mjs new file mode 100644 index 00000000..da01acae --- /dev/null +++ b/ui/tests/workspaceState.test.mjs @@ -0,0 +1,200 @@ +import assert from "node:assert/strict"; +import test from "node:test"; + +import { + createWorkspaceWriter, + emptyProjectWorkspace, + parseDestination, + parsePane, + safeLocation, + settingsTabs, + taskLocation, +} from "../src/workspaceState.ts"; + +const panes = [ + ...["experiments", "files", "artifacts"].map((view) => ({ kind: "home", view })), + { kind: "experiment", experimentId: "experiment", view: "overview" }, + { kind: "experiment", experimentId: "experiment", view: "terminal", runId: "run" }, + { kind: "file", path: "paper.tex" }, + { kind: "file", path: "研究/figure +100%?draft#1.tex", source: "repo", sessionId: "session α", ref: "feature/分析", line: 12 }, + { kind: "file", path: "figure.svg", source: "artifacts" }, + { kind: "file", path: "/tmp/paper.tex", source: "abs", line: Number.MAX_SAFE_INTEGER }, + { kind: "code", experimentId: "experiment", branch: "main", view: "files" }, + { kind: "code", experimentId: "experiment", branch: "feature", view: "changes" }, + { kind: "plan", sessionId: "session", promptId: "prompt" }, + { kind: "subagent", sessionId: "session", spawnPartId: "part" }, +]; + +test("every pane variant round-trips through a concrete task URL", () => { + for (const pane of panes) { + assert.deepEqual(parsePane(pane), pane); + const location = taskLocation("project α", "task % +", pane); + assert.equal(safeLocation(location), location); + const url = new URL(location, "http://localhost:8080"); + assert.deepEqual(parsePane(JSON.parse(url.searchParams.get("pane"))), pane); + assert.deepEqual(parseDestination(url.pathname), { + kind: "task", projectId: "project α", sessionId: "task % +", + }); + assert.equal(new URL(location, "http://localhost:9999").pathname, url.pathname); + } + assert.equal(taskLocation("demo", null), "/projects/demo/tasks/new"); + assert.equal(taskLocation("demo", null, null), "/projects/demo/tasks/new"); + assert.deepEqual(parsePane({ kind: "file", path: "paper.tex", source: null, sessionId: null, ref: null, line: null }), { kind: "file", path: "paper.tex" }); + assert.deepEqual(parsePane({ kind: "experiment", experimentId: "exp", view: "overview", runId: null }), { kind: "experiment", experimentId: "exp", view: "overview" }); +}); + +test("pane validation rejects malformed identifiers, views, line numbers and extra content", () => { + for (const invalid of [ + null, undefined, [], "files", {}, { kind: "unknown" }, + { kind: "home", view: "settings" }, + { kind: "experiment", experimentId: "", view: "overview" }, + { kind: "experiment", experimentId: "exp", view: "files" }, + { kind: "experiment", experimentId: "exp", view: "terminal", runId: "" }, + { kind: "file", path: "" }, + { kind: "file", path: "file", source: "remote" }, + { kind: "file", path: "file", sessionId: "" }, + { kind: "file", path: "file", ref: "" }, + ...[0, -1, 1.5, Infinity, NaN, Number.MAX_SAFE_INTEGER + 1, "12"].map((line) => ({ kind: "file", path: "file", line })), + { kind: "code", experimentId: "exp", branch: "", view: "files" }, + { kind: "plan", sessionId: "session", promptId: "" }, + { kind: "subagent", sessionId: "", spawnPartId: "part" }, + ...panes.map((pane) => ({ ...pane, content: "do not persist file or transcript content" })), + ]) assert.equal(parsePane(invalid), undefined, JSON.stringify(invalid)); +}); + +test("only recognized concrete destinations can be saved for automatic resume", () => { + assert.deepEqual(parseDestination("/projects/demo"), { kind: "resume", projectId: "demo" }); + assert.deepEqual(parseDestination("/projects/demo/tasks/new"), { kind: "task", projectId: "demo" }); + for (const location of [ + "/projects", "/projects/demo/tasks/new", "/projects/demo/tasks/archived", + "/projects/demo/skills", ...settingsTabs.map((tab) => `/projects/demo/settings/${tab}`), + "/projects/demo/settings/%67it", `/projects/demo/tasks/new?%70ane=${encodeURIComponent(JSON.stringify(panes[0]))}&`, + ]) assert.equal(safeLocation(location), location); + for (const location of [ + null, undefined, 42, "", "/", "/projects/demo", "/projects/demo/", "/remote-launch", + "https://example.com/projects", "javascript:alert(1)", "//example.com/projects", + "/\\example.com/projects", "/projects/../tasks/new", "/projects/%2e%2e/tasks/new", + "/projects/%2Fexample.com/tasks/new", "/projects/demo/tasks/%5c", "/projects/demo/tasks/%ZZ", + "/projects/demo/tasks/%00", "/projects/demo/tasks/%7f", "/projects/demo/tasks/%C2%85", + "/projects/demo/tasks/new\n", "/projects/demo/tasks/new#fragment", + "/projects/demo/settings/unknown", "/projects/demo/tasks/new/extra", + "/projects/demo/tasks/new?next=https://example.com", "/projects/demo/tasks/new?pane=not-json", + "/projects/demo/tasks/new?pane=null", "/projects/demo/tasks/new?pane={}", + `${taskLocation("demo", null, panes[0])}&pane=${encodeURIComponent(JSON.stringify(panes[1]))}`, + `${taskLocation("demo", null, panes[0])}?ignored=payload`, + taskLocation("demo", null, { kind: "home", view: "files", content: "extra" }), + ]) assert.equal(safeLocation(location), null, String(location)); + const first = emptyProjectWorkspace(); + first.tasks.new = { tabs: [] }; + assert.deepEqual(emptyProjectWorkspace(), { version: 1, lastTaskId: null, lastLocation: null, tasks: {} }); +}); + +test("writer coalesces layout updates and a forced flush cancels their timer", async () => { + const calls = []; + const writer = createWorkspaceWriter(async (value, unloading) => calls.push({ value, unloading }), assert.fail); + writer.queue({ panelWidth: 400 }, 60_000); + writer.queue({ panelWidth: 500 }, 60_000); + assert.equal(calls.length, 0); + await writer.flush(); + assert.deepEqual(calls, [{ value: { panelWidth: 500 }, unloading: false }]); + await writer.flush(); + await writer.retry(); + assert.equal(calls.length, 1); +}); + +test("writer serializes saves and keeps the latest pending snapshot during unload", async () => { + const calls = []; + const first = Promise.withResolvers(); + const writer = createWorkspaceWriter(async (value, unloading) => { + calls.push({ value, unloading }); + if (value === "first") await first.promise; + }, assert.fail); + writer.queue("first", 60_000); + const flushing = writer.flush(); + writer.queue("intermediate", 60_000); + writer.queue("latest", 60_000); + await writer.flush(true); + assert.deepEqual(calls, [{ value: "first", unloading: false }]); + first.resolve(); + await flushing; + assert.deepEqual(calls, [ + { value: "first", unloading: false }, { value: "latest", unloading: true }, + ]); +}); + +test("writer reports failed saves, retries them, and never retries over newer state", async () => { + const calls = []; + const errors = []; + const error = new Error("disk unavailable"); + let failing = true; + const writer = createWorkspaceWriter(async (value) => { + calls.push(value); + if (failing) throw error; + }, (error) => errors.push(error)); + writer.queue("original", 60_000); + await writer.flush(); + assert.deepEqual(errors, [error]); + failing = false; + await writer.retry(); + assert.deepEqual(calls, ["original", "original"]); + failing = true; + writer.queue("failed", 60_000); + await writer.flush(); + writer.queue("newer", 60_000); + failing = false; + await writer.retry(); + await writer.retry(); + assert.deepEqual(calls, ["original", "original", "failed", "newer"]); +}); + +test("failed in-flight save does not discard a queued project snapshot", async () => { + const first = Promise.withResolvers(); + const calls = []; + const errors = []; + const writer = createWorkspaceWriter(async (value) => { + calls.push(value); + if (value === "first") await first.promise; + }, (error) => errors.push(error)); + writer.queue("first", 60_000); + const flushing = writer.flush(); + writer.queue("latest", 60_000); + const error = new Error("request failed"); + first.reject(error); + await flushing; + assert.deepEqual(calls, ["first", "latest"]); + assert.deepEqual(errors, [error]); + await writer.retry(); + assert.deepEqual(calls, ["first", "latest"]); +}); + +test("retry during a newer in-flight save cannot queue an obsolete failed snapshot", async () => { + const calls = []; + const newer = Promise.withResolvers(); + const writer = createWorkspaceWriter(async (value) => { + calls.push(value); + if (value === "failed") throw new Error("save failed"); + await newer.promise; + }, () => {}); + writer.queue("failed", 60_000); + await writer.flush(); + writer.queue("newer", 60_000); + const flushing = writer.flush(); + await writer.retry(); + newer.resolve(); + await flushing; + assert.deepEqual(calls, ["failed", "newer"]); +}); + +test("project writers remain independent and idle unload sends pending metadata immediately", async () => { + const calls = []; + const slow = Promise.withResolvers(); + const first = createWorkspaceWriter(async (value) => { calls.push(["first", value]); await slow.promise; }, assert.fail); + const second = createWorkspaceWriter(async (value, unloading) => calls.push(["second", value, unloading]), assert.fail); + first.queue("project-one", 60_000); + const flushing = first.flush(); + second.queue("project-two", 60_000); + await second.flush(true); + assert.deepEqual(calls, [["first", "project-one"], ["second", "project-two", true]]); + slow.resolve(); + await flushing; +}); diff --git a/ui/vite.config.ts b/ui/vite.config.ts index e13b9943..8d04c464 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -2,6 +2,7 @@ import { paraglideVitePlugin } from "@inlang/paraglide-js"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; import { defineConfig } from "vite"; +import { tanstackRouter } from "@tanstack/router-plugin/vite"; // Backend the dev server proxies to. Defaults to the standard `orx up` port; // override with ORX_BACKEND when running against a backend on another port. @@ -9,6 +10,7 @@ const backend = process.env.ORX_BACKEND ?? "http://127.0.0.1:4791"; export default defineConfig({ plugins: [ + tanstackRouter({ target: "react", autoCodeSplitting: false }), paraglideVitePlugin({ project: "./project.inlang", outdir: "./src/paraglide",